Просмотр исходного кода

Merge branch 'master' of http://192.168.1.222:3000/yuqian/ZYKJ_UI.git

yuqian лет назад: 8
Родитель
Сommit
c8af925e3d

+ 342 - 0
CallCenterWeb.UI/zhiShiKu/addZhiShiKuManger.html

@@ -0,0 +1,342 @@
1
+<!DOCTYPE html>
2
+<html>
3
+	<head>
4
+		<meta charset="UTF-8">
5
+		<script src="../Script/Common/huayi.load.js"></script>
6
+	    <script src="../Script/Common/huayi.config.js"></script>
7
+	    <link href="../css/layer/need/layer.css" />
8
+	    <link rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
9
+	    <link rel="stylesheet" href="../css/laydate/need/laydate.css" />
10
+	    <link rel="stylesheet" href="../css/init.css" />
11
+		<title>知识库增加</title>
12
+		<style>
13
+			  .toolBar {
14
+            padding: 15px 0;
15
+            border-bottom: 1px solid #ccc;
16
+        }
17
+
18
+        .boxCon table th {
19
+            width: 20%;
20
+        }
21
+
22
+        .boxCon table td textarea {
23
+            width: 100%;
24
+        }
25
+
26
+        .inpBox {
27
+            border: 1px solid #a9a9a9;
28
+            height: 27px;
29
+            width: 55%;
30
+            ;
31
+            display: inline-block;
32
+            position: relative;
33
+            vertical-align: middle;
34
+        }
35
+
36
+        .inps1,
37
+        .inps4 {
38
+            width: 100%;
39
+            height: 24px;
40
+            outline: none;
41
+            border: 0;
42
+            border-image-width: 0;
43
+            padding: 0;
44
+            padding-left: 3px;
45
+        }
46
+
47
+        .changeTitle, .changeKey, .addTitle, .addKey {
48
+            width: 55%;
49
+        }
50
+
51
+        .xl {
52
+            display: inline-block;
53
+            background: url(../img/dropDown.png) no-repeat;
54
+            height: 100%;
55
+            background-position: center center;
56
+            width: 20px;
57
+            position: absolute;
58
+            right: 0;
59
+            top: 0px;
60
+            background-color: #f7bc8b;
61
+            cursor: pointer;
62
+        }
63
+            .xl:hover {
64
+                background-color: #e6d523;
65
+            }
66
+
67
+        .addTree {
68
+            background: #fff;
69
+            position: absolute;
70
+            width: 100%;
71
+            border: 1px solid darkgrey;
72
+            right: 0;
73
+            top: 26px;
74
+            display: none;
75
+            height: 220px;
76
+            overflow-y: auto;
77
+                z-index: 999;
78
+        }
79
+
80
+        .treeTable {
81
+            height: 400px;
82
+            /*overflow-y: auto;*/
83
+        }
84
+
85
+        .tree {
86
+            height: 100%;
87
+        }
88
+
89
+        .trTitle {
90
+            width: 100%;
91
+            height: 34px;
92
+            line-height: 34px;
93
+            border-bottom: 1px solid #ebebeb;
94
+            color: red;
95
+            font-weight: 700;
96
+            margin-bottom: 15px;
97
+        }
98
+
99
+        .treeCon {
100
+            height: 90%;
101
+            border: 1px solid #ebebeb;
102
+            overflow-y: auto;
103
+        }
104
+
105
+        .ztree li {
106
+            width: 100%;
107
+            overflow: hidden;
108
+            white-space: nowrap;
109
+            text-overflow: ellipsis;
110
+        }
111
+
112
+        .content {
113
+            width: 270px;
114
+            height: 25px;
115
+            overflow: hidden;
116
+            white-space: nowrap;
117
+            text-overflow: ellipsis;
118
+            text-align: left;
119
+        }
120
+
121
+        .radio-inline input[type=radio] {
122
+            margin-top: 7px;
123
+        }
124
+
125
+        .editTimeBoxs, .timeBoxs {
126
+            display: none;
127
+        }
128
+		</style>
129
+	
130
+	</head>
131
+	<body >
132
+		<div class="container-fluid">
133
+			 <div class="boxCon">
134
+                <table>
135
+                    <tbody>
136
+                        <tr>
137
+                            <th>所属分类:</th>
138
+                            <td colspan="3">
139
+                                <div class="inpBox">
140
+                                    <input type="text" class="inps inps1" />
141
+                                    <i class="xl xl_one"></i>
142
+                                    <div class="addTree xlAdd">
143
+                                        <ul id="addTreeDemo" class="ztree"></ul>
144
+                                    </div>
145
+                                </div>
146
+                            </td>
147
+                        </tr>
148
+                        <tr>
149
+                            <th>标题:</th>
150
+                            <td colspan="3"><input type="text" class="addTitle" /></td>
151
+                        </tr>
152
+                        <tr>
153
+                            <th>关键字:</th>
154
+                            <td colspan="3"><input type="text" class="addKey" /></td>
155
+                        </tr>
156
+                        <tr>
157
+                            <th>是否永久生效:</th>
158
+                            <td>
159
+                                <label class="radio-inline">
160
+                                    <input type="radio" checked="checked" name="canlastlong" value="1" style="vertical-align: middle;display: inline-block;">是
161
+                                </label>
162
+                                <label class="radio-inline">
163
+                                    <input type="radio" name="canlastlong" value="0" style="vertical-align: middle;display: inline-block;">否
164
+                                </label>
165
+                            </td>
166
+                        </tr>
167
+                        <tr class="timeBoxs">
168
+                            <th>开始时间:</th>
169
+                            <td>
170
+                                <input type="text" id="startTime" class="laydate-icon" placeholder="开始时间" style="width: 160px; padding-left: 10px;" />
171
+                                <input type="text" id="endTime" class="laydate-icon" placeholder="结束时间" style="width: 160px; padding-left: 10px; margin-left: 5px;" />
172
+                            </td>
173
+                        </tr>
174
+                        <tr>
175
+                            <th>内容:</th>
176
+                            <td colspan="3"><textarea id="addEditor" name="content" style="width: 100%;height: 100px;"></textarea></td>
177
+                        </tr>
178
+                    </tbody>
179
+                </table>
180
+                <div style="text-align: center;"><button class="btns addCun">保存</button></div>
181
+            </div>
182
+		</div>
183
+		<script src="../js/zTree/jquery.ztree.core.js"></script>
184
+	    <script src="../js/kindeditor/kindeditor.js"></script>
185
+	    <script src="../js/kindeditor/lang/zh_CN.js"></script>
186
+	    <script src="../css/laydate/laydate.js"></script>
187
+		<script>
188
+			var pid=helper.request.queryString("addPid"); //当前父节点ID
189
+			var names=unescape(decodeURI(helper.request.queryString("addName"))); //选择的name
190
+			var token=$.cookie("token");
191
+			var id=helper.request.queryString("addId"); //当前节点id
192
+			if(pid=="undefined"){
193
+				pid="0"
194
+			}else{
195
+				pid=pid;
196
+			}
197
+			$(document).ready(function(){
198
+				var addPid, addTitle, addKey, addCon, addDes;
199
+				laydate.skin('molv');
200
+				laydate({
201
+				    elem: '#startTime',
202
+				    event: 'focus',
203
+				    istime: true,
204
+				    format: 'YYYY-MM-DD hh:mm:ss', // 分隔符可以任意定义,该例子表示只显示年月
205
+				});
206
+				laydate({
207
+				    elem: '#endTime',
208
+				    event: 'focus',
209
+				    istime: true,
210
+				    format: 'YYYY-MM-DD hh:mm:ss', // 分隔符可以任意定义,该例子表示只显示年月
211
+				});
212
+				$('input:radio[name="canlastlong"]').change(function () {
213
+				    if ($(this).val() == '0') {
214
+				        $(".timeBoxs").show();
215
+				    }
216
+				    else {
217
+				        $(".timeBoxs").hide();
218
+				    }
219
+				})
220
+
221
+			var setting2 = {
222
+				    data: {
223
+				        key: {
224
+				            name: "text"
225
+				        },
226
+				        simpleData: {
227
+				            enable: true,
228
+				            idKey: "id",
229
+				            rootPId: 0
230
+				        }
231
+				    },
232
+				    callback: {
233
+				        onClick: addTreeClick
234
+				    }
235
+				};
236
+				
237
+			function addTreeClick(event, treeId, treeNode) {
238
+			    addPid = treeNode.id;
239
+			    //console.log(addPid);
240
+			    xlName = treeNode.text;
241
+			    $('.inps1').val(xlName);
242
+			};
243
+			function getTree() {
244
+			    $.get(huayi.config.callcenter_url + 'KnowledgeClass/GetList', {
245
+			        "token": $.cookie("token"),
246
+			        "pid": pid
247
+			    }, function (result) {
248
+			        result = $.parseJSON(result);
249
+			        $.fn.zTree.init($("#addTreeDemo"), setting2, result.data); //实例化树形图
250
+			    });
251
+			
252
+			}	
253
+				getTree();
254
+			//编辑器配置
255
+			KindEditor.ready(function (K) {
256
+			    window.editor = K.create('#addEditor');//添加弹出框编辑器
257
+			});
258
+		
259
+		   if (names) {
260
+		        $('.inps1').val(names);
261
+		        addPid = id;
262
+		    } else {
263
+		        $('.inps1').val("顶级分类");
264
+		        addPid = 0
265
+		        //console.log(addPid);
266
+		    }
267
+			//添加内容下拉
268
+			$('.inps1').focus(function () {
269
+			    $('.xlAdd').css('display', 'block');
270
+			})
271
+			$('.xl_one').click(function () {
272
+			    if ($('.xlAdd').css('display') == 'block') {
273
+			        $('.xlAdd').css('display', 'none')
274
+			    } else {
275
+			        $('.xlAdd').css('display', 'block')
276
+			    }
277
+			})
278
+			$('.addTree').mouseleave(function () {
279
+			    $(this).css('display', 'none')
280
+			})
281
+			//保存添加按钮
282
+			$('.addCun').click(function () {
283
+			    console.log(addPid);
284
+			    if ($('.inps1').val() == "" || $('.addTitle').val() == "") {
285
+			        layer.confirm('所添加内容不允许为空!', {
286
+			            btn: ['确定']
287
+			        });
288
+			        return;
289
+			    } else {
290
+			        addTitle = $('.addTitle').val();
291
+			        addKey = $('.addKey').val();
292
+			        addCon = encodeURIComponent(editor.html());
293
+			    
294
+			        addCunTree(addPid, addTitle, addKey, addCon);
295
+			    }
296
+			})
297
+			
298
+			
299
+					function addCunTree(addPid, addTitle, addKey, addCon) {
300
+					    if ($('input:radio[name="canlastlong"]').val() == '0') {
301
+					        if ($('#startTime').val() == '') {
302
+					            layer.msg("请选择开始时间!");
303
+					
304
+					        } if ($('#endTime').val() == '') {
305
+					            layer.msg("请选择结束时间!");
306
+					        }
307
+					    }
308
+					    $.ajax({
309
+					        type: "post",
310
+					        url: huayi.config.callcenter_url + "Knowledge/AddInfo",
311
+					        dataType: 'json',
312
+					        async: true,
313
+					        data: {
314
+					            title: addTitle,
315
+					            key: addKey,
316
+					            con: addCon,
317
+					            pid: addPid,
318
+					            start: $('#startTime').val(),
319
+					            end: $('#endTime').val(),
320
+					            canlastlong: $('input:radio:checked[name="canlastlong"]').val(),
321
+					            token: token
322
+					        },
323
+					        success: function (data) {
324
+					            if (data.state == "success") {
325
+					                var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
326
+												parent.layer.close(index); //再执行关闭
327
+					                            parent.layer.msg("添加成功!");
328
+								                parent.table.bootstrapTable('refresh'); 
329
+					            }
330
+					        }
331
+					
332
+					    });
333
+					
334
+					}
335
+				
336
+			})
337
+			
338
+			
339
+			
340
+		</script>
341
+	</body>
342
+</html>

+ 376 - 0
CallCenterWeb.UI/zhiShiKu/editZhiShiKuManger.html

@@ -0,0 +1,376 @@
1
+<!DOCTYPE html>
2
+<html>
3
+
4
+	<head>
5
+		<meta charset="UTF-8">
6
+		<meta charset="UTF-8">
7
+		<script src="../Script/Common/huayi.load.js"></script>
8
+		<script src="../Script/Common/huayi.config.js"></script>
9
+		<link href="../css/layer/need/layer.css" />
10
+		<link rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
11
+		<link rel="stylesheet" href="../css/laydate/need/laydate.css" />
12
+		<link rel="stylesheet" href="../css/init.css" />
13
+		<title>知识库修改</title>
14
+		<style>
15
+			.toolBar {
16
+				padding: 15px 0;
17
+				border-bottom: 1px solid #ccc;
18
+			}
19
+			
20
+			.boxCon table th {
21
+				width: 20%;
22
+			}
23
+			
24
+			.boxCon table td textarea {
25
+				width: 100%;
26
+			}
27
+			
28
+			.inpBox {
29
+				border: 1px solid #a9a9a9;
30
+				height: 27px;
31
+				width: 55%;
32
+				;
33
+				display: inline-block;
34
+				position: relative;
35
+				vertical-align: middle;
36
+			}
37
+			
38
+			.inps1,
39
+			.inps4 {
40
+				width: 100%;
41
+				height: 24px;
42
+				outline: none;
43
+				border: 0;
44
+				border-image-width: 0;
45
+				padding: 0;
46
+				padding-left: 3px;
47
+			}
48
+			
49
+			.changeTitle,
50
+			.changeKey,
51
+			.addTitle,
52
+			.addKey {
53
+				width: 55%;
54
+			}
55
+			
56
+			.xl {
57
+				display: inline-block;
58
+				background: url(../img/dropDown.png) no-repeat;
59
+				height: 100%;
60
+				background-position: center center;
61
+				width: 20px;
62
+				position: absolute;
63
+				right: 0;
64
+				top: 0px;
65
+				background-color: #f7bc8b;
66
+				cursor: pointer;
67
+			}
68
+			
69
+			.xl:hover {
70
+				background-color: #e6d523;
71
+			}
72
+			
73
+			.addTree {
74
+				background: #fff;
75
+				position: absolute;
76
+				width: 100%;
77
+				border: 1px solid darkgrey;
78
+				right: 0;
79
+				top: 26px;
80
+				display: none;
81
+				height: 220px;
82
+				overflow-y: auto;
83
+				z-index: 999;
84
+			}
85
+			
86
+			.treeTable {
87
+				height: 400px;
88
+				/*overflow-y: auto;*/
89
+			}
90
+			
91
+			.tree {
92
+				height: 100%;
93
+			}
94
+			
95
+			.trTitle {
96
+				width: 100%;
97
+				height: 34px;
98
+				line-height: 34px;
99
+				border-bottom: 1px solid #ebebeb;
100
+				color: red;
101
+				font-weight: 700;
102
+				margin-bottom: 15px;
103
+			}
104
+			
105
+			.treeCon {
106
+				height: 90%;
107
+				border: 1px solid #ebebeb;
108
+				overflow-y: auto;
109
+			}
110
+			
111
+			.ztree li {
112
+				width: 100%;
113
+				overflow: hidden;
114
+				white-space: nowrap;
115
+				text-overflow: ellipsis;
116
+			}
117
+			
118
+			.content {
119
+				width: 270px;
120
+				height: 25px;
121
+				overflow: hidden;
122
+				white-space: nowrap;
123
+				text-overflow: ellipsis;
124
+				text-align: left;
125
+			}
126
+			
127
+			.radio-inline input[type=radio] {
128
+				margin-top: 7px;
129
+			}
130
+			
131
+			.editTimeBoxs,
132
+			.timeBoxs {
133
+				display: none;
134
+			}
135
+		</style>
136
+
137
+	</head>
138
+
139
+	<body>
140
+		<div class="container-fluid">
141
+
142
+			<div class="boxCon">
143
+					<table>
144
+						<tbody>
145
+							<tr>
146
+								<th>所属分类:</th>
147
+								<td colspan="3">
148
+									<div class="inpBox">
149
+										<input type="text" class="inps inps4" />
150
+										<i class="xl xl_two"></i>
151
+										<div class="addTree xlChange">
152
+											<ul id="changeTreeDemo" class="ztree"></ul>
153
+										</div>
154
+									</div>
155
+								</td>
156
+							</tr>
157
+							<tr>
158
+								<th>标题:</th>
159
+								<td colspan="3"><input type="text" class="changeTitle" /></td>
160
+							</tr>
161
+							<tr>
162
+								<th>关键字:</th>
163
+								<td colspan="3"><input type="text" class="changeKey" /></td>
164
+							</tr>
165
+							<tr>
166
+								<th>是否永久生效:</th>
167
+								<td>
168
+									<label class="radio-inline">
169
+                                    <input type="radio" checked="checked" name="editCanlastlong" value="1" style="vertical-align: middle;display: inline-block;">是
170
+                                </label>
171
+									<label class="radio-inline">
172
+                                    <input type="radio" name="editCanlastlong" value="0" style="vertical-align: middle;display: inline-block;">否
173
+                                </label>
174
+								</td>
175
+							</tr>
176
+							<tr class="editTimeBoxs">
177
+								<th>开始时间:</th>
178
+								<td>
179
+									<input type="text" id="editStartTime" class="laydate-icon" placeholder="开始时间" style="width: 160px; padding-left: 10px;" />
180
+									<input type="text" id="editEndTime" class="laydate-icon" placeholder="结束时间" style="width: 160px; padding-left: 10px; margin-left: 5px;" />
181
+								</td>
182
+							</tr>
183
+							<tr>
184
+								<th>内容:</th>
185
+								<td colspan="3"><textarea id="changeEditor" name="content" style="width: 100%;height: 100px;"></textarea></td>
186
+							</tr>
187
+						</tbody>
188
+					</table>
189
+					<div style="text-align: center;"><button class="btns changeCun">保存</button></div>
190
+				</div>
191
+
192
+		</div>
193
+
194
+		<script src="../js/zTree/jquery.ztree.core.js"></script>
195
+		<script src="../js/kindeditor/kindeditor.js"></script>
196
+		<script src="../js/kindeditor/lang/zh_CN.js"></script>
197
+		<script src="../css/laydate/laydate.js"></script>
198
+		<script>
199
+			var pid = helper.request.queryString("editPid"); //当前父节点ID
200
+			var names = unescape(decodeURI(helper.request.queryString("editName"))); //选择的name
201
+			var token = $.cookie("token");
202
+			//			var id = helper.request.queryString("editId"); //当前节点id
203
+			var changeGetid = helper.request.queryString("editId"); //当前节点id
204
+			if(pid=="undefined"){
205
+				pid="0"
206
+			}else{
207
+				pid=pid;
208
+			}
209
+			//编辑器配置
210
+				KindEditor.ready(function(K) {
211
+					window.changeEditor = K.create('#changeEditor'); //修改弹出框编辑器
212
+				});
213
+
214
+			$(document).ready(function() {
215
+				console.log(pid)
216
+				var chanId, //修改弹出框内 下拉框当前节点ID
217
+					changeName, //修改弹出框内 下拉框当前节点name
218
+					//			    changeGetid,
219
+					chanCunId;
220
+				getChangeTree();
221
+				getChangeBox(changeGetid);
222
+
223
+				$('input:radio[name="editCanlastlong"]').change(function() {
224
+					if($(this).val() == '0') {
225
+						$(".editTimeBoxs").show();
226
+					} else {
227
+						$(".editTimeBoxs").hide();
228
+					}
229
+				})
230
+				laydate.skin('molv');
231
+				laydate({
232
+					elem: '#editStartTime',
233
+					event: 'focus',
234
+					istime: true,
235
+					format: 'YYYY-MM-DD hh:mm:ss' // 分隔符可以任意定义,该例子表示只显示年月
236
+				});
237
+				laydate({
238
+					elem: '#editEndTime',
239
+					event: 'focus',
240
+					istime: true,
241
+					format: 'YYYY-MM-DD hh:mm:ss', // 分隔符可以任意定义,该例子表示只显示年月
242
+				});
243
+
244
+				$('.inps4').focus(function() {
245
+					$('.xlChange').css('display', 'block')
246
+				})
247
+				//下拉按钮功能
248
+				$('.xl_two').click(function() {
249
+					if($('.xlChange').css('display') == 'block') {
250
+						$('.xlChange').css('display', 'none')
251
+					} else {
252
+						$('.xlChange').css('display', 'block')
253
+					}
254
+
255
+				})
256
+				$('.addTree').mouseleave(function () {
257
+						    $(this).css('display', 'none')
258
+						})
259
+				//修改弹出框内 下拉树形图参数配置项
260
+				var setting3 = {
261
+					data: {
262
+						key: {
263
+							name: "text"
264
+						},
265
+						simpleData: {
266
+							enable: true,
267
+							idKey: "id",
268
+							rootPId: 0
269
+						}
270
+					},
271
+					callback: {
272
+						onClick: changeTreeClick
273
+					}
274
+				}
275
+
276
+				function changeTreeClick(event, treeId, treeNode) {
277
+					chanId = treeNode.id;
278
+					changeName = treeNode.text;
279
+					$('.inps4').val(changeName);
280
+					chanCunId = chanId;
281
+				};
282
+
283
+				function getChangeTree() {
284
+					$.get(huayi.config.callcenter_url + 'KnowledgeClass/GetList', {
285
+						"token": $.cookie("token"),
286
+						"pid": pid
287
+					}, function(result) {
288
+						result = $.parseJSON(result);
289
+						$.fn.zTree.init($("#changeTreeDemo"), setting3, result.data); //实例化树形图
290
+					});
291
+
292
+				}
293
+
294
+				var cunId;
295
+
296
+				function getChangeBox(changeGetid) {
297
+					$.ajax({
298
+						type: "post",
299
+						url: huayi.config.callcenter_url + "Knowledge/GetInfo",
300
+						async: true,
301
+						dataType: 'json',
302
+						data: {
303
+							infoid: changeGetid,
304
+							token: token
305
+						},
306
+						success: function(data) {
307
+							var con = data.data;
308
+							$('.inps4').val(con.F_Expand1);
309
+							$('.changeTitle').val(con.F_Title);
310
+							$('.changeKey').val(con.F_KeyWords);
311
+							$('input:radio[name="editCanlastlong"][value="' + con.F_CanLastLong + '"]').prop("checked", "checked");
312
+							if(con.F_CanLastLong == '0') {
313
+								$(".editTimeBoxs").show();
314
+							} else {
315
+								$(".editTimeBoxs").hide();
316
+							}
317
+							$('#editStartTime').val(con.F_StartTime);
318
+							$('#editEndTime').val(con.F_EndTime);
319
+							changeEditor.html(con.F_Content);
320
+							cunId = con.F_CategoryId;
321
+							chanCunId = cunId;
322
+						}
323
+					});
324
+
325
+				}
326
+
327
+				function changeBaoCunAjax(changeGetid, chanCunId) {
328
+					if($('input:radio[name="editCanlastlong"]').val() == '0') {
329
+						if($('#editStartTime').val() == '') {
330
+							layer.msg("请选择开始时间!");
331
+
332
+						}
333
+						if($('#editEndTime').val() == '') {
334
+							layer.msg("请选择结束时间!");
335
+						}
336
+					}
337
+					$.ajax({
338
+						type: "post",
339
+						url: huayi.config.callcenter_url + "Knowledge/EditInfo",
340
+						async: true,
341
+						dataType: 'json',
342
+						data: {
343
+							infoid: changeGetid,
344
+							title: $('.changeTitle').val(),
345
+							key: $('.changeKey').val(),
346
+							con: encodeURIComponent(changeEditor.html()),
347
+							pid: chanCunId,
348
+							start: $('#editStartTime').val(),
349
+							end: $('#editEndTime').val(),
350
+							canlastlong: $('input:radio:checked[name="editCanlastlong"]').val(),
351
+							token: token
352
+						},
353
+						success: function(data) {
354
+							if(data.state == "success") {
355
+
356
+								var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
357
+								parent.layer.close(index); //再执行关闭
358
+								parent.layer.msg("修改成功!");
359
+								parent.table.bootstrapTable('refresh');
360
+							}
361
+						}
362
+					});
363
+
364
+				}
365
+				$('.changeCun').click(function() {
366
+					console.log(chanCunId)
367
+					changeBaoCunAjax(changeGetid, chanCunId);
368
+
369
+				})
370
+
371
+			})
372
+		</script>
373
+
374
+	</body>
375
+
376
+</html>

+ 19 - 291
CallCenterWeb.UI/zhiShiKu/js/zhiShiKuManger.js

@@ -18,7 +18,7 @@ $('.searchGo').click(function () {
18 18
 })
19 19
 tree();
20 20
 function tree() {
21
-
21
+console.log(pid)
22 22
     $.get(huayi.config.callcenter_url + 'KnowledgeClass/GetList', {
23 23
         "token": $.cookie("token"),
24 24
         "pid": pid
@@ -51,7 +51,7 @@ function zTreeOnClick(event, treeId, treeNode) {
51 51
     if (pidnode) {
52 52
         pidName = pidnode.text;
53 53
         pid = pidnode.id;
54
-        //console.log(pid);
54
+          console.log(pid);
55 55
     } else {
56 56
         pidName = "顶级分类";
57 57
         pid == 0;
@@ -60,45 +60,8 @@ function zTreeOnClick(event, treeId, treeNode) {
60 60
     keyWord = $('.searCon').val();
61 61
     initTable(token, id, keyWord);
62 62
 };
63
-var setting2 = {
64
-    data: {
65
-        key: {
66
-            name: "text"
67
-        },
68
-        simpleData: {
69
-            enable: true,
70
-            idKey: "id",
71
-            rootPId: 0
72
-        }
73
-    },
74
-    callback: {
75
-        onClick: addTreeClick
76
-    }
77
-};
78
-
79
-function addTreeClick(event, treeId, treeNode) {
80
-    addPid = treeNode.id;
81
-    //console.log(addPid);
82
-    xlName = treeNode.text;
83
-    $('.inps1').val(xlName);
84
-};
85
-//编辑器配置
86
-KindEditor.ready(function (K) {
87
-    window.editor = K.create('#addEditor');//添加弹出框编辑器
88
-    window.changeEditor = K.create('#changeEditor');//修改弹出框编辑器
89
-});
90 63
 
91
-function getTree() {
92
-    $.get(huayi.config.callcenter_url + 'KnowledgeClass/GetList', {
93
-        "token": $.cookie("token"),
94
-        "pid": pid
95
-    }, function (result) {
96
-        result = $.parseJSON(result);
97
-        $.fn.zTree.init($("#addTreeDemo"), setting2, result.data); //实例化树形图
98
-    });
99 64
 
100
-}
101
-//===============添加功能开始=============================
102 65
 
103 66
 //添加按钮
104 67
 $('.add').click(function () {
@@ -107,147 +70,27 @@ $('.add').click(function () {
107 70
             btn: ['确定']
108 71
         })
109 72
         return;
73
+    }else{
74
+    	  layer.open({
75
+                type: 2,
76
+                title: '添加知识库',
77
+                maxmin: true, //开启最大化最小化按钮
78
+                area: ['70%', '50%'],
79
+                content: 'addZhiShiKuManger.html?addId=' + id + '&addPid='+ pid +'&addName='+ name +''
80
+            });
110 81
     }
111
-    $('.addModel').css('display', 'block');
112 82
 
113
-    //		console.log(pidName);
114
-    if (name) {
115
-        $('.inps1').val(name);
116
-        addPid = id;
117
-    } else {
118
-        $('.inps1').val("顶级分类");
119
-        addPid = 0
120
-        //console.log(addPid);
121
-    }
122
-    getTree();
123 83
 })
124
-$('.addBtr').click(function () {
125
-    $('.addModel').css('display', 'none');
126
-})
127
-//添加内容下拉
128
-$('.inps1').focus(function () {
129
-    $('.xlAdd').css('display', 'block');
130 84
 
131
-})
132
-$('.xl_one').click(function () {
133
-    if ($('.xlAdd').css('display') == 'block') {
134
-        $('.xlAdd').css('display', 'none')
135
-    } else {
136
-        $('.xlAdd').css('display', 'block')
137
-    }
138
-})
139
-$('.addTree').mouseleave(function () {
140
-    $(this).css('display', 'none')
141
-})
142
-//保存添加按钮
143
-var addPid, addTitle, addKey, addCon, addDes;
144
-$('.addCun').click(function () {
145
-    console.log(addPid);
146
-    if ($('.inps1').val() == "" || $('.addTitle').val() == "") {
147
-        layer.confirm('所添加内容不允许为空!', {
148
-            btn: ['确定']
149
-        });
150
-        return;
151
-    } else {
152
-        addTitle = $('.addTitle').val();
153
-        addKey = $('.addKey').val();
154
-        addCon = encodeURIComponent(editor.html());
155
-        //console.log(addCon);
156
-        $('.addModel').css('display', 'none');
157
-        addCunTree(addPid, addTitle, addKey, addCon);
158
-    }
159
-})
160
-laydate.skin('molv');
161
-laydate({
162
-    elem: '#startTime',
163
-    event: 'focus',
164
-    istime: true,
165
-    format: 'YYYY-MM-DD hh:mm:ss', // 分隔符可以任意定义,该例子表示只显示年月
166
-});
167
-laydate({
168
-    elem: '#endTime',
169
-    event: 'focus',
170
-    istime: true,
171
-    format: 'YYYY-MM-DD hh:mm:ss', // 分隔符可以任意定义,该例子表示只显示年月
172
-});
173
-$('input:radio[name="canlastlong"]').change(function () {
174
-    if ($(this).val() == '0') {
175
-        $(".timeBoxs").show();
176
-    }
177
-    else {
178
-        $(".timeBoxs").hide();
179
-    }
180
-})
181
-
182
-function addCunTree(addPid, addTitle, addKey, addCon) {
183
-    if ($('input:radio[name="canlastlong"]').val() == '0') {
184
-        if ($('#startTime').val() == '') {
185
-            layer.msg("请选择开始时间!");
186
-
187
-        } if ($('#endTime').val() == '') {
188
-            layer.msg("请选择结束时间!");
189
-        }
190
-    }
191
-    $.ajax({
192
-        type: "post",
193
-        url: huayi.config.callcenter_url + "Knowledge/AddInfo",
194
-        dataType: 'json',
195
-        async: true,
196
-        data: {
197
-            title: addTitle,
198
-            key: addKey,
199
-            con: addCon,
200
-            pid: addPid,
201
-            start: $('#startTime').val(),
202
-            end: $('#endTime').val(),
203
-            canlastlong: $('input:radio:checked[name="canlastlong"]').val(),
204
-            token: token
205
-        },
206
-        success: function (data) {
207
-            console.log(data)
208
-            console.log(data.state);
209
-            if (data.state == "success") {
210
-                layer.msg("添加成功!");
211
-                tree();
212
-                initTable(token, id, keyWord);
213
-            }
214
-        }
215
-
216
-    });
217
-
218
-}
219
-//***********************添加功能结束=============================
220 85
 
221 86
 
222 87
 //=======================修改功能开始==============================
223
-$('input:radio[name="editCanlastlong"]').change(function () {
224
-    if ($(this).val() == '0') {
225
-        $(".editTimeBoxs").show();
226
-    }
227
-    else {
228
-        $(".editTimeBoxs").hide();
229
-    }
230
-})
231 88
 
232
-laydate({
233
-    elem: '#editStartTime',
234
-    event: 'focus',
235
-    istime: true,
236
-    format: 'YYYY-MM-DD hh:mm:ss' // 分隔符可以任意定义,该例子表示只显示年月
237
-});
238
-laydate({
239
-    elem: '#editEndTime',
240
-    event: 'focus',
241
-    istime: true,
242
-    format: 'YYYY-MM-DD hh:mm:ss', // 分隔符可以任意定义,该例子表示只显示年月
243
-});
244 89
 
245
-var chanId,//修改弹出框内 下拉框当前节点ID
246
-    changeName,//修改弹出框内 下拉框当前节点name
247
-    changeGetid,
248
-    chanCunId;
90
+
249 91
 //		JSON.stringify($table.bootstrapTable('getSelections'));
250 92
 $('.change').click(function () {
93
+	console.log(pid)
251 94
     var changes = $.map($('#table1').bootstrapTable('getSelections'), function (row) {
252 95
         return row.F_RepositoryId;
253 96
     });
@@ -257,133 +100,18 @@ $('.change').click(function () {
257 100
         });
258 101
         return;
259 102
     } else {
260
-        $('.changeModel').css('display', 'block');
261
-    }
262
-    changeGetid = changes;
263
-    getChangeTree();
264
-    getChangeBox(changeGetid);
265
-})
266
-$('.changeBtr').click(function () {
267
-    $('.changeModel').css('display', 'none');
268
-})
269
-$('.inps4').focus(function () {
270
-    $('.xlChange').css('display', 'block')
271
-})
272
-//下拉按钮功能
273
-$('.xl_two').click(function () {
274
-    if ($('.xlChange').css('display') == 'block') {
275
-        $('.xlChange').css('display', 'none')
276
-    } else {
277
-        $('.xlChange').css('display', 'block')
103
+    	 layer.open({
104
+                type: 2,
105
+                title: '修改知识库',
106
+                maxmin: true, //开启最大化最小化按钮
107
+                area: ['70%', '50%'],
108
+                content: 'editZhiShiKuManger.html?editId=' + changes + '&editPid='+ pid +'&editName='+ name +''
109
+            });
278 110
     }
279
-
280 111
 })
281 112
 
282
-//修改弹出框内 下拉树形图参数配置项
283
-var setting3 = {
284
-    data: {
285
-        key: {
286
-            name: "text"
287
-        },
288
-        simpleData: {
289
-            enable: true,
290
-            idKey: "id",
291
-            rootPId: 0
292
-        }
293
-    },
294
-    callback: {
295
-        onClick: changeTreeClick
296
-    }
297
-}
298 113
 
299
-function changeTreeClick(event, treeId, treeNode) {
300
-    chanId = treeNode.id;
301
-    changeName = treeNode.text;
302
-    $('.inps4').val(changeName);
303
-    chanCunId = chanId;
304
-};
305
-function getChangeTree() {
306
-    $.get(huayi.config.callcenter_url + 'KnowledgeClass/GetList', {
307
-        "token": $.cookie("token"),
308
-        "pid": pid
309
-    }, function (result) {
310
-        result = $.parseJSON(result);
311
-        $.fn.zTree.init($("#changeTreeDemo"), setting3, result.data); //实例化树形图
312
-    });
313 114
 
314
-}
315
-var cunId;
316
-function getChangeBox(changeGetid) {
317
-    $.ajax({
318
-        type: "post",
319
-        url: huayi.config.callcenter_url + "Knowledge/GetInfo",
320
-        async: true,
321
-        dataType: 'json',
322
-        data: {
323
-            infoid: changeGetid,
324
-            token: token
325
-        },
326
-        success: function (data) {
327
-            var con = data.data;
328
-            $('.inps4').val(con.F_Expand1);
329
-            $('.changeTitle').val(con.F_Title);
330
-            $('.changeKey').val(con.F_KeyWords);
331
-            $('input:radio[name="editCanlastlong"][value="' + con.F_CanLastLong + '"]').prop("checked", "checked");
332
-            if (con.F_CanLastLong == '0') {
333
-                $(".editTimeBoxs").show();
334
-            }
335
-            else {
336
-                $(".editTimeBoxs").hide();
337
-            }
338
-            $('#editStartTime').val(con.F_StartTime);
339
-            $('#editEndTime').val(con.F_EndTime);
340
-            changeEditor.html(con.F_Content);
341
-            cunId = con.F_CategoryId;
342
-            chanCunId = cunId;
343
-        }
344
-    });
345
-
346
-}
347
-function changeBaoCunAjax(changeGetid, chanCunId) {
348
-    if ($('input:radio[name="editCanlastlong"]').val() == '0') {
349
-        if ($('#editStartTime').val() == '') {
350
-            layer.msg("请选择开始时间!");
351
-
352
-        } if ($('#editEndTime').val() == '') {
353
-            layer.msg("请选择结束时间!");
354
-        }
355
-    }
356
-    $.ajax({
357
-        type: "post",
358
-        url: huayi.config.callcenter_url + "Knowledge/EditInfo",
359
-        async: true,
360
-        dataType: 'json',
361
-        data: {
362
-            infoid: changeGetid,
363
-            title: $('.changeTitle').val(),
364
-            key: $('.changeKey').val(),
365
-            con: encodeURIComponent(changeEditor.html()),
366
-            pid: chanCunId,
367
-            start: $('#editStartTime').val(),
368
-            end: $('#editEndTime').val(),
369
-            canlastlong: $('input:radio:checked[name="editCanlastlong"]').val(),
370
-            token: token
371
-        },
372
-        success: function (data) {
373
-            if (data.state == "success") {
374
-                layer.msg("修改成功!");
375
-                initTable(token, id, keyWord);
376
-            }
377
-        }
378
-    });
379
-
380
-}
381
-$('.changeCun').click(function () {
382
-    console.log(chanCunId)
383
-    changeBaoCunAjax(changeGetid, chanCunId);
384
-    $('.changeModel').css('display', 'none');
385
-
386
-})
387 115
 
388 116
 
389 117
 //***********************修改功能结束=============================

+ 2 - 59
CallCenterWeb.UI/zhiShiKu/zhiShiKuManger.html

@@ -172,65 +172,7 @@
172 172
             </div>
173 173
         </div>
174 174
     </div>
175
-    <!--添加弹出内容-->
176
-    <div class="model addModel">
177
-        <div class="box">
178
-            <div class="btop clearfix">
179
-                <p class="btl">添加知识库</p>
180
-                <p class="btr addBtr" title="关闭">X</p>
181
-            </div>
182
-            <div class="boxCon">
183
-                <table>
184
-                    <tbody>
185
-                        <tr>
186
-                            <th>所属分类:</th>
187
-                            <td colspan="3">
188
-                                <div class="inpBox">
189
-                                    <input type="text" class="inps inps1" />
190
-                                    <i class="xl xl_one"></i>
191
-                                    <div class="addTree xlAdd">
192
-                                        <ul id="addTreeDemo" class="ztree"></ul>
193
-                                    </div>
194
-                                </div>
195
-                            </td>
196
-                        </tr>
197
-                        <tr>
198
-                            <th>标题:</th>
199
-                            <td colspan="3"><input type="text" class="addTitle" /></td>
200
-                        </tr>
201
-                        <tr>
202
-                            <th>关键字:</th>
203
-                            <td colspan="3"><input type="text" class="addKey" /></td>
204
-                        </tr>
205
-                        <tr>
206
-                            <th>是否永久生效:</th>
207
-                            <td>
208
-                                <label class="radio-inline">
209
-                                    <input type="radio" checked="checked" name="canlastlong" value="1" style="vertical-align: middle;display: inline-block;">是
210
-                                </label>
211
-                                <label class="radio-inline">
212
-                                    <input type="radio" name="canlastlong" value="0" style="vertical-align: middle;display: inline-block;">否
213
-                                </label>
214
-                            </td>
215
-                        </tr>
216
-                        <tr class="timeBoxs">
217
-                            <th>开始时间:</th>
218
-                            <td>
219
-                                <input type="text" id="startTime" class="laydate-icon" placeholder="开始时间" style="width: 160px; padding-left: 10px;" />
220
-                                <input type="text" id="endTime" class="laydate-icon" placeholder="结束时间" style="width: 160px; padding-left: 10px; margin-left: 5px;" />
221
-                            </td>
222
-                        </tr>
223
-                        <tr>
224
-                            <th>内容:</th>
225
-                            <td colspan="3"><textarea id="addEditor" name="content" style="width: 100%;height: 100px;"></textarea></td>
226
-                        </tr>
227
-                    </tbody>
228
-                </table>
229
-                <div style="text-align: center;"><button class="btns addCun">保存</button></div>
230
-            </div>
231
-        </div>
232
-    </div>
233
-    <!--删除弹出内容-->
175
+   <!--删除弹出内容-->
234 176
     <div class="model delModel">
235 177
         <div class="box">
236 178
             <div class="btop clearfix">
@@ -311,6 +253,7 @@
311 253
     <script src="../js/kindeditor/kindeditor.js"></script>
312 254
     <script src="../js/kindeditor/lang/zh_CN.js"></script>
313 255
     <script src="./../css/laydate/laydate.js"></script>
256
+    <script src="../css/layer/layer.js"></script>
314 257
     <script src="./js/zhiShiKuManger.js"></script>
315 258
 </body>
316 259
 </html>