|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+<!DOCTYPE html>
|
|
|
2
|
+<html>
|
|
|
3
|
+
|
|
|
4
|
+ <head>
|
|
|
5
|
+ <meta charset="UTF-8">
|
|
|
6
|
+ <script src="../Script/Common/huayi.load.js"></script>
|
|
|
7
|
+ <script src="../Script/Common/huayi.config.js"></script>
|
|
|
8
|
+ <link rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
|
|
|
9
|
+ <link rel="stylesheet" href="../css/init.css" />
|
|
|
10
|
+ <title>编辑知识库详细情</title>
|
|
|
11
|
+ <style>
|
|
|
12
|
+ .m-kuang {
|
|
|
13
|
+ width: 50%;
|
|
|
14
|
+ background-color: #FFF;
|
|
|
15
|
+ background-image: none;
|
|
|
16
|
+ border: 1px solid #ccc;
|
|
|
17
|
+ border-radius: 1px;
|
|
|
18
|
+ color: inherit;
|
|
|
19
|
+ padding: 6px 12px;
|
|
|
20
|
+ outline: none;
|
|
|
21
|
+ vertical-align: middle;
|
|
|
22
|
+ }
|
|
|
23
|
+
|
|
|
24
|
+ table th {
|
|
|
25
|
+ width: 20%;
|
|
|
26
|
+ text-align: right;
|
|
|
27
|
+ border-top: 0!important;
|
|
|
28
|
+ }
|
|
|
29
|
+
|
|
|
30
|
+ table td {
|
|
|
31
|
+ border-top: 0!important;
|
|
|
32
|
+ }
|
|
|
33
|
+
|
|
|
34
|
+ .daoHang {
|
|
|
35
|
+ border-bottom: 1px solid #ccc;
|
|
|
36
|
+ }
|
|
|
37
|
+
|
|
|
38
|
+ .content {
|
|
|
39
|
+ margin-top: 15px;
|
|
|
40
|
+ }
|
|
|
41
|
+ .inps{
|
|
|
42
|
+ width: 95%;
|
|
|
43
|
+ height: 30px;
|
|
|
44
|
+ outline: none;
|
|
|
45
|
+ border: 0;
|
|
|
46
|
+ border-image-width: 0;
|
|
|
47
|
+ padding: 0;
|
|
|
48
|
+ padding-left: 8px;
|
|
|
49
|
+ }
|
|
|
50
|
+ .inpBox{
|
|
|
51
|
+ border: 1px solid #ccc;
|
|
|
52
|
+ height: 32px;
|
|
|
53
|
+ width: 50%;
|
|
|
54
|
+ display: inline-block;
|
|
|
55
|
+ position: relative;
|
|
|
56
|
+ vertical-align: middle;
|
|
|
57
|
+ }
|
|
|
58
|
+ .xl{
|
|
|
59
|
+ display: inline-block;
|
|
|
60
|
+ background: url(../img/dropDown.png) no-repeat;
|
|
|
61
|
+ height: 100%;
|
|
|
62
|
+ background-position: center center;
|
|
|
63
|
+ width: 20px;
|
|
|
64
|
+ position: absolute;
|
|
|
65
|
+ right: 0;
|
|
|
66
|
+ top: 0px;
|
|
|
67
|
+ /* background-color: #f7bc8b; */
|
|
|
68
|
+ cursor: pointer;
|
|
|
69
|
+ }
|
|
|
70
|
+ .addTree {
|
|
|
71
|
+ background: #fff;
|
|
|
72
|
+ position: absolute;
|
|
|
73
|
+ width: 100%;
|
|
|
74
|
+ border: 1px solid darkgrey;
|
|
|
75
|
+ right: 0;
|
|
|
76
|
+ top: 32px;
|
|
|
77
|
+ display: none;
|
|
|
78
|
+ z-index: 1;
|
|
|
79
|
+ }
|
|
|
80
|
+
|
|
|
81
|
+ </style>
|
|
|
82
|
+ </head>
|
|
|
83
|
+
|
|
|
84
|
+ <body>
|
|
|
85
|
+ <div class="container-fluid">
|
|
|
86
|
+ <div class="content">
|
|
|
87
|
+ <table class="table">
|
|
|
88
|
+ <tr>
|
|
|
89
|
+ <th>
|
|
|
90
|
+ <b>标题:</b>
|
|
|
91
|
+ </th>
|
|
|
92
|
+ <td>
|
|
|
93
|
+ <input type="text " class="m-kuang zs_t" />
|
|
|
94
|
+ </td>
|
|
|
95
|
+ </tr>
|
|
|
96
|
+ <tr>
|
|
|
97
|
+ <th>
|
|
|
98
|
+ <b>所属分类:</b>
|
|
|
99
|
+ </th>
|
|
|
100
|
+ <td>
|
|
|
101
|
+ <div class="inpBox">
|
|
|
102
|
+ <input type="text" class="inps" />
|
|
|
103
|
+ <i class="xl xl_one"></i>
|
|
|
104
|
+ <div class="addTree xlAdd">
|
|
|
105
|
+ <ul id="addTreeDemo" class="ztree">
|
|
|
106
|
+
|
|
|
107
|
+ </ul>
|
|
|
108
|
+ </div>
|
|
|
109
|
+ </div>
|
|
|
110
|
+ </td>
|
|
|
111
|
+ </tr>
|
|
|
112
|
+ <tr>
|
|
|
113
|
+ <th>
|
|
|
114
|
+ <b>内容:</b>
|
|
|
115
|
+ </th>
|
|
|
116
|
+ <td>
|
|
|
117
|
+ <textarea data-adaptheight id="addEditor" name="content" style="width: 80%;height: 200px;"></textarea>
|
|
|
118
|
+ </td>
|
|
|
119
|
+ </tr>
|
|
|
120
|
+ <!--<tr>
|
|
|
121
|
+
|
|
|
122
|
+ <td colspan="2" class="text-center">
|
|
|
123
|
+ <div class="checkbox">
|
|
|
124
|
+ <label>
|
|
|
125
|
+ <input type="checkbox" style="margin-top: 2px;" class="isCheck"> 是否提交审核
|
|
|
126
|
+ </label>
|
|
|
127
|
+ </div>
|
|
|
128
|
+ </td>
|
|
|
129
|
+ </tr>-->
|
|
|
130
|
+ <tr>
|
|
|
131
|
+ <td colspan="2" class="text-center">
|
|
|
132
|
+ <!--<button class="btns">添加</button>-->
|
|
|
133
|
+ <button class="btns tiJiao">提交</button>
|
|
|
134
|
+ </td>
|
|
|
135
|
+ </tr>
|
|
|
136
|
+ </table>
|
|
|
137
|
+
|
|
|
138
|
+ </div>
|
|
|
139
|
+
|
|
|
140
|
+ </div>
|
|
|
141
|
+
|
|
|
142
|
+ <script src="../css/layer/layer.js"></script>
|
|
|
143
|
+ <script src="../js/zTree/jquery.ztree.core.js"></script>
|
|
|
144
|
+ <script src="../js/kindeditor/kindeditor-all-min.js"></script>
|
|
|
145
|
+ <script src="../js/kindeditor/lang/zh-CN.js"></script>
|
|
|
146
|
+ <script src="../js/adjustHeight.js"></script>
|
|
|
147
|
+ <script>
|
|
|
148
|
+ var bid = helper.request.queryString("id");
|
|
|
149
|
+ var id = ''; //当前节点id
|
|
|
150
|
+ var cname; //当前节点name
|
|
|
151
|
+ var pid; //当前节点父ID
|
|
|
152
|
+ var pidName; //当前节点父name
|
|
|
153
|
+ var xlName; //添加弹出框内下拉框内节点name
|
|
|
154
|
+ var token = $.cookie("token");
|
|
|
155
|
+ //编辑器配置
|
|
|
156
|
+ KindEditor.ready(function(K) {
|
|
|
157
|
+ window.editor = K.create('#addEditor', {
|
|
|
158
|
+ uploadJson: '../../js/kindeditor/asp.net/upload_json.ashx',
|
|
|
159
|
+ fileManagerJson: '../../js/kindeditor/asp.net/file_manager_json.ashx',
|
|
|
160
|
+ allowFileManager: true
|
|
|
161
|
+ }); //添加弹出框编辑器
|
|
|
162
|
+ });
|
|
|
163
|
+
|
|
|
164
|
+ tree();
|
|
|
165
|
+ function tree() {
|
|
|
166
|
+
|
|
|
167
|
+ $.get(huayi.config.callcenter_url + 'KnowledgeClass/GetList', {
|
|
|
168
|
+ "token": $.cookie("token"),
|
|
|
169
|
+ // "pid": pid
|
|
|
170
|
+ }, function(result) {
|
|
|
171
|
+ result = $.parseJSON(result);
|
|
|
172
|
+ $.fn.zTree.init($("#addTreeDemo"), setting1, result.data); //实例化树形图
|
|
|
173
|
+ });
|
|
|
174
|
+ }
|
|
|
175
|
+ var setting1 = {
|
|
|
176
|
+ data: {
|
|
|
177
|
+ key: {
|
|
|
178
|
+ name: "text"
|
|
|
179
|
+ },
|
|
|
180
|
+ simpleData: {
|
|
|
181
|
+ enable: true,
|
|
|
182
|
+ idKey: "id",
|
|
|
183
|
+ rootPId: 0
|
|
|
184
|
+ }
|
|
|
185
|
+ },
|
|
|
186
|
+ callback: {
|
|
|
187
|
+ onClick: zTreeOnClick
|
|
|
188
|
+ }
|
|
|
189
|
+ };
|
|
|
190
|
+
|
|
|
191
|
+ function zTreeOnClick(event, treeId, treeNode) {
|
|
|
192
|
+ // pid = treeNode.pId;
|
|
|
193
|
+ id = treeNode.id;
|
|
|
194
|
+ cname = treeNode.text;
|
|
|
195
|
+ $('.inps').val(cname);
|
|
|
196
|
+ };
|
|
|
197
|
+ //所属分类下拉
|
|
|
198
|
+ $('.inps').focus(function() {
|
|
|
199
|
+ $('.xlAdd').css('display', 'block')
|
|
|
200
|
+ })
|
|
|
201
|
+ $('.xl').click(function() {
|
|
|
202
|
+ if($('.xlAdd').css('display') == 'block') {
|
|
|
203
|
+ $('.xlAdd').css('display', 'none')
|
|
|
204
|
+ } else {
|
|
|
205
|
+ $('.xlAdd').css('display', 'block')
|
|
|
206
|
+ }
|
|
|
207
|
+ })
|
|
|
208
|
+ $('.addTree').mouseleave(function() {
|
|
|
209
|
+ $(this).css('display', 'none')
|
|
|
210
|
+ })
|
|
|
211
|
+
|
|
|
212
|
+ $.ajax({
|
|
|
213
|
+ type:"get",
|
|
|
214
|
+ url:huayi.config.callcenter_url+"Knowledge/GetInfo",
|
|
|
215
|
+ async:true,
|
|
|
216
|
+ dataType:'json',
|
|
|
217
|
+ data:{
|
|
|
218
|
+ token:$.cookie("token"),
|
|
|
219
|
+ infoid:bid,//知识库标题
|
|
|
220
|
+ },
|
|
|
221
|
+ success:function(data){
|
|
|
222
|
+ var con=data.data;
|
|
|
223
|
+ if(data.state.toLowerCase()=='success'){
|
|
|
224
|
+ $('.zs_t').val(con.F_Title);//标题
|
|
|
225
|
+ $('.inps').val(con.F_Category);
|
|
|
226
|
+ cname=con.F_Category;
|
|
|
227
|
+ editor.html(con.F_Content);
|
|
|
228
|
+ id=con.F_CategoryId;
|
|
|
229
|
+ }
|
|
|
230
|
+ }
|
|
|
231
|
+ });
|
|
|
232
|
+ var title;//知识库标题
|
|
|
233
|
+ var con;//知识库内容
|
|
|
234
|
+ var issub;//是否提交审核
|
|
|
235
|
+ function add(title,con,id, issub){
|
|
|
236
|
+ $.ajax({
|
|
|
237
|
+ type:"post",
|
|
|
238
|
+ url:huayi.config.callcenter_url+"Knowledge/EditInfo",
|
|
|
239
|
+ async:true,
|
|
|
240
|
+ dataType:'json',
|
|
|
241
|
+ data:{
|
|
|
242
|
+ token:$.cookie("token"),
|
|
|
243
|
+ infoid:bid,
|
|
|
244
|
+ title:title,//知识库标题
|
|
|
245
|
+ con:con,//知识库内容
|
|
|
246
|
+ pid:id,//分类ID
|
|
|
247
|
+ issub:issub//是否提交审核
|
|
|
248
|
+ },
|
|
|
249
|
+ success:function(data){
|
|
|
250
|
+ if(data.state.toLowerCase()=="success"){
|
|
|
251
|
+ var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
|
|
|
252
|
+ parent.layer.close(index); //再执行关闭
|
|
|
253
|
+ //debugger;
|
|
|
254
|
+ parent.initTable(id);
|
|
|
255
|
+ parent.layer.msg("编辑成功");
|
|
|
256
|
+ }
|
|
|
257
|
+ }
|
|
|
258
|
+ });
|
|
|
259
|
+ }
|
|
|
260
|
+ $('.tiJiao').click(function(){
|
|
|
261
|
+ if($('.isCheck').is(':checked')==true){
|
|
|
262
|
+ issub=1;
|
|
|
263
|
+ }else{
|
|
|
264
|
+ issub=0;
|
|
|
265
|
+ }
|
|
|
266
|
+ title=$('.zs_t').val();
|
|
|
267
|
+ con=encodeURIComponent(editor.html());
|
|
|
268
|
+ //debugger;
|
|
|
269
|
+ add(title,con,id, issub)
|
|
|
270
|
+ })
|
|
|
271
|
+
|
|
|
272
|
+ </script>
|
|
|
273
|
+ </body>
|
|
|
274
|
+
|
|
|
275
|
+</html>
|