Sfoglia il codice sorgente

知识库问题修改

liuyifan 5 anni fa
parent
commit
209cc95137

+ 5 - 0
CallCenterWeb.UI/callScreen/css/call.css

@@ -1271,6 +1271,11 @@ html,
1271 1271
     overflow: auto;
1272 1272
 }
1273 1273
 
1274
+.detail-con .explancon table tr td{
1275
+    text-align: center;
1276
+    border: 1px solid #C0C0C0;
1277
+}
1278
+
1274 1279
 @media (max-width: 1680px) {
1275 1280
 
1276 1281
 	.head_time,

+ 121 - 117
CallCenterWeb.UI/zhiShiKu/css/seeDetail.css

@@ -1,176 +1,180 @@
1 1
 .table {
2
-	margin: 20px;
3
-	width: 97%;
2
+    margin: 20px;
3
+    width: 97%;
4 4
 }
5 5
 
6
-.table th {
7
-	width: 10%;
8
-	font-weight: bold;
9
-	text-align: center;
10
-}
6
+/* .table th {
7
+    width: 10%;
8
+    font-weight: bold;
9
+    text-align: center;
10
+} */
11 11
 
12
-.table td {
13
-	width: 90%;
14
-	table-layout: fixed;
15
-	word-break: break-all;
16
-	overflow: hidden;
12
+/* .table td {
13
+    width: 90%;
14
+    table-layout: fixed;
15
+    word-break: break-all;
16
+    overflow: hidden;
17
+} */
18
+.addCon table tr td{
19
+    text-align: center;
20
+    border: 1px solid #C0C0C0;
17 21
 }
18 22
 
19 23
 .file_imgs {
20
-	padding: 10px 5px;
21
-	list-style: none;
22
-	margin-bottom: 60px;
23
-	margin-left: -15px;
24
+    padding: 10px 5px;
25
+    list-style: none;
26
+    margin-bottom: 60px;
27
+    margin-left: -15px;
24 28
 }
25 29
 
26 30
 .file_imgs li {
27
-	float: left;
28
-	position: relative;
29
-	width: 109px;
30
-	height: 109px;
31
-	margin-left: 10px;
32
-	margin-right: 10px;
33
-	margin-bottom: 40px;
34
-	padding-top: 0;
35
-	padding-bottom: 0;
31
+    float: left;
32
+    position: relative;
33
+    width: 109px;
34
+    height: 109px;
35
+    margin-left: 10px;
36
+    margin-right: 10px;
37
+    margin-bottom: 40px;
38
+    padding-top: 0;
39
+    padding-bottom: 0;
36 40
 }
37 41
 
38 42
 .file_imgs li:hover .img_mask {
39
-	display: block;
43
+    display: block;
40 44
 }
41 45
 
42 46
 .file_imgs .img_mask {
43
-	display: none;
44
-	position: absolute;
45
-	left: 0;
46
-	top: 0;
47
-	background-color: rgba(0, 0, 0, .3);
48
-	width: 100%;
49
-	height: 22px;
50
-	z-index: 1;
47
+    display: none;
48
+    position: absolute;
49
+    left: 0;
50
+    top: 0;
51
+    background-color: rgba(0, 0, 0, 0.3);
52
+    width: 100%;
53
+    height: 22px;
54
+    z-index: 1;
51 55
 }
52 56
 
53 57
 .file_imgs .img_mask i {
54
-	position: absolute;
55
-	right: 5px;
56
-	top: 5px;
57
-	display: inline-block;
58
-	width: 13px;
59
-	height: 12px;
60
-	cursor: pointer;
61
-	background: url(../../img/file_img_icons.png) no-repeat 0 0;
58
+    position: absolute;
59
+    right: 5px;
60
+    top: 5px;
61
+    display: inline-block;
62
+    width: 13px;
63
+    height: 12px;
64
+    cursor: pointer;
65
+    background: url(../../img/file_img_icons.png) no-repeat 0 0;
62 66
 }
63 67
 
64 68
 .file_imgs .file_name {
65
-	width: 100%;
66
-	display: inline-block;
67
-	text-align: center;
68
-	/*overflow: hidden;
69
+    width: 100%;
70
+    display: inline-block;
71
+    text-align: center;
72
+    /*overflow: hidden;
69 73
 				text-overflow: ellipsis;
70 74
 				white-space: nowrap;*/
71
-	word-break: break-all;
72
-	padding-top: 8px;
75
+    word-break: break-all;
76
+    padding-top: 8px;
73 77
 }
74 78
 
75 79
 .file_imgs li img {
76
-	width: 100%;
77
-	height: 100%;
78
-	border: 0;
79
-	vertical-align: middle;
80
+    width: 100%;
81
+    height: 100%;
82
+    border: 0;
83
+    vertical-align: middle;
80 84
 }
81 85
 
82 86
 .file_imgs .upload-state-done .img_state {
83
-	display: block;
84
-	position: absolute;
85
-	right: 0;
86
-	bottom: 0;
87
-	width: 0;
88
-	height: 0;
89
-	border-bottom: 40px solid #01b2fe;
90
-	border-left: 40px solid transparent;
91
-	overflow: inherit;
87
+    display: block;
88
+    position: absolute;
89
+    right: 0;
90
+    bottom: 0;
91
+    width: 0;
92
+    height: 0;
93
+    border-bottom: 40px solid #01b2fe;
94
+    border-left: 40px solid transparent;
95
+    overflow: inherit;
92 96
 }
93 97
 
94 98
 .file_imgs .img_state i {
95
-	position: absolute;
96
-	right: 4px;
97
-	bottom: -32px;
98
-	display: inline-block;
99
-	width: 15px;
100
-	height: 11px;
101
-	background: url(../../img/file_img_icons.png) no-repeat 0 -16px;
99
+    position: absolute;
100
+    right: 4px;
101
+    bottom: -32px;
102
+    display: inline-block;
103
+    width: 15px;
104
+    height: 11px;
105
+    background: url(../../img/file_img_icons.png) no-repeat 0 -16px;
102 106
 }
103 107
 
104 108
 .error {
105
-	color: red;
106
-	text-align: center;
109
+    color: red;
110
+    text-align: center;
107 111
 }
108 112
 
109 113
 .noThumb {
110
-	width: 109px;
111
-	height: 109px;
112
-	text-align: center;
113
-	color: #1aaad0;
114
+    width: 109px;
115
+    height: 109px;
116
+    text-align: center;
117
+    color: #1aaad0;
114 118
 }
115 119
 
116 120
 .glyphicon.glyphicon-paperclip {
117
-	font-size: 80px;
118
-	text-align: center;
121
+    font-size: 80px;
122
+    text-align: center;
119 123
 }
120 124
 
121 125
 .img-box {
122
-	float: left;
123
-	width: 120px;
124
-	height: 120px;
125
-	background-size: 100% 100%;
126
-	display: inline-block;
127
-	position: relative;
128
-	border-radius: 5px;
129
-	margin-right: 10px;
130
-	border: solid 1px #e8e8e8;
131
-	cursor: pointer;
132
-	text-align: center;
133
-	line-height: 120px
126
+    float: left;
127
+    width: 120px;
128
+    height: 120px;
129
+    background-size: 100% 100%;
130
+    display: inline-block;
131
+    position: relative;
132
+    border-radius: 5px;
133
+    margin-right: 10px;
134
+    border: solid 1px #e8e8e8;
135
+    cursor: pointer;
136
+    text-align: center;
137
+    line-height: 120px;
134 138
 }
135 139
 
136 140
 .img-box .img_mask {
137
-	display: none;
138
-	position: absolute;
139
-	left: 0;
140
-	top: 0;
141
-	background-color: rgba(0, 0, 0, .3);
142
-	width: 100%;
143
-	height: 22px;
144
-	z-index: 5;
141
+    display: none;
142
+    position: absolute;
143
+    left: 0;
144
+    top: 0;
145
+    background-color: rgba(0, 0, 0, 0.3);
146
+    width: 100%;
147
+    height: 22px;
148
+    z-index: 5;
145 149
 }
146 150
 
147 151
 .image-item {
148
-	width: 120px;
149
-	height: 120px;
150
-	background-size: 100% 100%;
151
-	display: inline-block;
152
-	position: relative;
153
-	border-radius: 5px;
154
-	margin-right: 10px;
155
-	/*border: solid 1px #e8e8e8;*/
156
-	cursor: pointer;
152
+    width: 120px;
153
+    height: 120px;
154
+    background-size: 100% 100%;
155
+    display: inline-block;
156
+    position: relative;
157
+    border-radius: 5px;
158
+    margin-right: 10px;
159
+    /*border: solid 1px #e8e8e8;*/
160
+    cursor: pointer;
157 161
 }
158 162
 
159 163
 .img-box .img_mask i {
160
-	position: absolute;
161
-	right: 5px;
162
-	top: 5px;
163
-	display: inline-block;
164
-	width: 13px;
165
-	height: 12px;
166
-	cursor: pointer;
167
-	color: #fff;
164
+    position: absolute;
165
+    right: 5px;
166
+    top: 5px;
167
+    display: inline-block;
168
+    width: 13px;
169
+    height: 12px;
170
+    cursor: pointer;
171
+    color: #fff;
168 172
 }
169 173
 
170 174
 .img-box:hover .img_mask {
171
-	display: block;
175
+    display: block;
172 176
 }
173 177
 
174
-.img_filename{
175
-	font-size: 30px;
176
-}
178
+.img_filename {
179
+    font-size: 30px;
180
+}

+ 41 - 0
CallCenterWeb.UI/zhiShiKu/css/zhishiku.css

@@ -226,4 +226,45 @@
226 226
 .glyphicon.glyphicon-paperclip {
227 227
 	font-size: 80px;
228 228
 	text-align: center;
229
+}
230
+
231
+.searchKeyword{
232
+    position: relative;
233
+    display: inline-block;
234
+}
235
+#formKeyword{
236
+    width: 400px;
237
+    height: 38px;
238
+}
239
+
240
+.selDpart1{
241
+    display: none;
242
+    position: absolute;
243
+    left: 0px;
244
+    top: 38px;
245
+    z-index: 11111;
246
+    width: 400px;
247
+    line-height: 30px;
248
+    background: #FFFFFF;
249
+}
250
+#sponsor{
251
+    width: 400px;
252
+    border: 1px solid #00a1cb;
253
+    margin: 0;
254
+    padding: 0;
255
+    list-style: none;
256
+    max-height: 212px;
257
+    overflow-x: hidden;
258
+    overflow-y: scroll;
259
+}
260
+#sponsor li{
261
+    margin: 0;
262
+    padding-left: 10px;
263
+    width: 400px;
264
+    height: 30px;
265
+    line-height: 30px;
266
+    list-style: none;
267
+}
268
+#sponsor li:hover{
269
+    background: #00a1cb;
229 270
 }

+ 47 - 5
CallCenterWeb.UI/zhiShiKu/js/zhiShiKuManger.js

@@ -6,7 +6,6 @@ var kn_id = ""; //当前节点id
6 6
 var pid; //当前父节点ID
7 7
 var name = ''; //选择的name
8 8
 var pidName; //父节点name
9
-var keyWord = $('.searCon').val(); //关键字
10 9
 var table = $('#table1'); //右边表格
11 10
 
12 11
 $(function() {
@@ -14,7 +13,6 @@ $(function() {
14 13
 	initTable();
15 14
 	//搜索按钮
16 15
 	$('#sc_btns').click(function() {
17
-		keyWord = $('.searCon').val();
18 16
 		initTable();
19 17
 	});
20 18
 });
@@ -57,7 +55,6 @@ function zTreeOnClick(event, treeId, treeNode) {
57 55
 		pid == 0;
58 56
 		//console.log(pid);
59 57
 	}
60
-	keyWord = $('.searCon').val();
61 58
 	initTable();
62 59
 };
63 60
 
@@ -87,7 +84,7 @@ function initTable() {
87 84
 				pagesize: params.pageSize,
88 85
 				token: token,
89 86
 				pid: kn_id,
90
-				keywords: keyWord
87
+				keywords: $('#formKeyword').val()
91 88
 			};
92 89
 			return param;
93 90
 		},
@@ -248,4 +245,49 @@ function btn_delete(del_id) {
248 245
 			})
249 246
 		},
250 247
 	});
251
-}
248
+}
249
+
250
+//被投诉单位
251
+function darptSearch() {
252
+    if ($('#formKeyword').val() == '') {
253
+        $(".selDpart1").css('display', 'none');
254
+    } else {
255
+        $(".selDpart1").css('display', 'block');
256
+        getFormKeyword();
257
+    }
258
+}
259
+
260
+$("#sponsor").on('click', 'li', function() {
261
+	$(".selDpart1").css('display', 'none');
262
+	$("#formKeyword").val($(this).html().replace("...",""));
263
+})
264
+
265
+function getFormKeyword() {
266
+	$("#sponsor").empty();
267
+    $.ajax({
268
+        type: "get",
269
+        url: huayi.config.callcenter_url + "Knowledge/GetList",
270
+        dataType: 'json',
271
+        async: true,
272
+        data: {
273
+            page: 1,
274
+            pagesize: 10000,
275
+    		keywords: $('#formKeyword').val(),
276
+            token: token,
277
+        },
278
+        success: function(data) {
279
+            var content = data.rows;
280
+            if (content.length === 0) {
281
+                $(".selDpart1").css('display', 'none');
282
+            } else {                
283
+                $(content).each(function (i, n) {
284
+                    var descriptionStr = n.F_Description
285
+                    if(descriptionStr.length > 20) {
286
+                        descriptionStr = descriptionStr.substring(0, 20) + "...";
287
+                    }
288
+                    $("<li index='" + descriptionStr + "'>" + descriptionStr + "</li>").appendTo("#sponsor");
289
+                })
290
+            }
291
+        }
292
+    });
293
+}

+ 3 - 3
CallCenterWeb.UI/zhiShiKu/template/seeDetail.html

@@ -15,8 +15,8 @@
15 15
 		<table class="table-bordered table">
16 16
 			<tbody>
17 17
 				<tr>
18
-					<th>标题:</th>
19
-					<td colspan="3" class="addTitle"></td>
18
+					<th width="10%">标题:</th>
19
+					<td colspan="3" class="addTitle" width="90%"></td>
20 20
 				</tr>
21 21
 				<tr>
22 22
 					<th>关键字:</th>
@@ -63,7 +63,7 @@
63 63
 					if(con){
64 64
 						$('.addTitle').html(con.F_Title);
65 65
 						$('.addKey').html(con.F_KeyWords);
66
-						$('.addCon').html(helper.filter.content(con.F_Content));
66
+						$('.addCon').html(con.F_Content);
67 67
 						var proimglist = con.FileUrls;
68 68
 						if(proimglist && proimglist.length > 0) {
69 69
 							$(proimglist).each(function(i, n) {

+ 246 - 247
CallCenterWeb.UI/zhiShiKu/zhiShiKuChaXun.html

@@ -1,264 +1,263 @@
1 1
 <!DOCTYPE html>
2 2
 <html>
3 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 href="../css/layer/need/layer.css" />
9
-		<link rel="stylesheet" href="../js/zTree/zTreeStyle.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
-			.treeTable {
19
-				height: 400px;
20
-				/*overflow-y: auto;*/
21
-			}
22
-			
23
-			.tree {
24
-				height: 100%;
25
-			}
26
-			
27
-			.trTitle {
28
-				width: 100%;
29
-				height: 34px;
30
-				line-height: 34px;
31
-				border-bottom: 1px solid #ebebeb;
32
-				color: red;
33
-				font-weight: 700;
34
-				margin-bottom: 15px;
35
-			}
36
-			
37
-			.treeCon {
38
-				height: 90%;
39
-				border: 1px solid #ebebeb;
40
-				overflow-y: auto
41
-			}
42
-			
43
-			.ztree li {
44
-				width: 100%;
45
-				overflow: hidden;
46
-				white-space: nowrap;
47
-				text-overflow: ellipsis;
48
-			}
49
-			
50
-			.content {
51
-				cursor: pointer;
52
-			}
53
-			
54
-			.content:hover {
55
-				color: #1ab394;
56
-			}
57
-		</style>
58
-	</head>
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 href="../css/layer/need/layer.css" />
9
+    <link rel="stylesheet" href="../js/zTree/zTreeStyle.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
+        }
59 17
 
60
-	<body class="gray-bg">
61
-		<div class="daoHang clearfix">
62
-			<div class="dhLeft">
63
-				<sapn><i class="syIcon"></i>位置:
64
-					<a href="javaScript:;" id="ReIndex">首页</a>&gt;
65
-					<a href="javaScript:;">知识库</a>&gt;
66
-					<a href="" class="nowPosition">知识库查询</a>
67
-				</sapn>
68
-			</div>
69
-			<div class="dhRight">
70
-				<a href="#" title="刷新"><i class="fa fa-refresh"></i></a>
71
-			</div>
72
-		</div>
73
-		<div class="wrapper wrapper-content animated fadeInRight">
74
-			<div class="toolBar clearfix">
75
-				<div class="toolRight">
76
-					<span>搜索:<input type="text" class="searCon" /></span>
77
-					<button id="sc_btns" class="btns">搜索</button>
78
-				</div>
18
+        .treeTable {
19
+            height: 400px;
20
+            /*overflow-y: auto;*/
21
+        }
79 22
 
80
-			</div>
81
-			<div class="treeTable clearfix">
82
-				<div class="tree col-md-3">
83
-					<div class="trTitle">知识库分类</div>
84
-					<div class="treeCon">
85
-						<ul id="treeDemo" class="ztree">
86
-							<!--类名为ztree是必须的-->
87
-						</ul>
88
-					</div>
23
+        .tree {
24
+            height: 100%;
25
+        }
89 26
 
90
-				</div>
91
-				<div class="tableCon col-md-9">
92
-					<div class="trTitle"> 知识库列表</div>
93
-					<table id="table1" data-row-style="rowStyle" data-query-params="queryParams" data-pagination="true">
94
-						<thead>
95
-							<tr>
96
-								<!--<th data-field="state" data-checkbox="true" data-align="center"></th>-->
97
-								<th data-align="center" data-formatter="setCode">编号</th>
98
-								<th data-field="F_Title" data-align="left" data-formatter="formatterTitle">标题</th>
99
-								<th data-field="F_Content" data-align="left" data-formatter="oper">内容</th>
100
-								<th data-field="F_KeyWords" data-align="center" data-formatter="formatterKey">关键字</th>
101
-								<th data-field="F_CreateOn" data-align="center">创建时间</th>
102
-							</tr>
103
-						</thead>
104
-						<tbody id="tbody">
105
-						</tbody>
106
-					</table>
27
+        .trTitle {
28
+            width: 100%;
29
+            height: 34px;
30
+            line-height: 34px;
31
+            border-bottom: 1px solid #ebebeb;
32
+            color: red;
33
+            font-weight: 700;
34
+            margin-bottom: 15px;
35
+        }
107 36
 
108
-				</div>
109
-			</div>
37
+        .treeCon {
38
+            height: 90%;
39
+            border: 1px solid #ebebeb;
40
+            overflow-y: auto
41
+        }
110 42
 
111
-		</div>
112
-		<script src="../js/zTree/jquery.ztree.core.js"></script>
113
-	</body>
114
-	<script>
115
-		var token = $.cookie("token");
116
-		var id; //当前节点id
117
-		var pid; //当前父节点ID
118
-		var name; //选择的name
119
-		var pidName; //父节点name
120
-		var keyWord; //关键字
121
-		var table = $('#table1'); //右边表格
122
-		$(function() {
123
-			//实例化树形结构	
124
-			$.get(huayi.config.callcenter_url + 'KnowledgeClass/GetList', {
125
-				"token": $.cookie("token"),
126
-				"pid": pid
127
-			}, function(result) {
128
-				result = $.parseJSON(result);
129
-				$.fn.zTree.init($("#treeDemo"), setting1, result.data); //实例化树形图
130
-			});
131
-			var setting1 = {
132
-				data: {
133
-					key: {
134
-						name: "text"
135
-					},
136
-					simpleData: {
137
-						enable: true,
138
-						idKey: "id",
139
-						rootPId: 0
140
-					}
141
-				},
142
-				callback: {
143
-					onClick: zTreeOnClick
144
-				}
145
-			};
43
+        .ztree li {
44
+            width: 100%;
45
+            overflow: hidden;
46
+            white-space: nowrap;
47
+            text-overflow: ellipsis;
48
+        }
146 49
 
147
-			initTable();
148
-			
149
-			//搜索按钮
150
-			$('#sc_btns').click(function() {
151
-				keyWord = $('.searCon').val();
152
-				//console.log(keyWord);
153
-				initTable();
154
-			});
50
+        .content {
51
+            cursor: pointer;
52
+        }
155 53
 
156
-		});
54
+        .content:hover {
55
+            color: #1ab394;
56
+        }
57
+    </style>
58
+</head>
157 59
 
158
-		function zTreeOnClick(event, treeId, treeNode) {
159
-			id = treeNode.id;
160
-			name = treeNode.text;
161
-			//		console.log(name);
162
-			//		console.log(id);
163
-			//		var pidnode = treeNode.getParentNode();
164
-			//		console.log(pidnode);
165
-			//		if(pidnode) {
166
-			//			pidName = pidnode.text;
167
-			//			pid = pidnode.id;
168
-			//			console.log(pid);
169
-			//		} else {
170
-			//			pidName = "顶级分类";
171
-			//			pid == 0;
172
-			//			console.log(pid);
173
-			//		}
174
-			keyWord = $('.searCon').val();
175
-			initTable();
176
-		};
60
+<body class="gray-bg">
61
+    <div class="daoHang clearfix">
62
+        <div class="dhLeft">
63
+            <sapn><i class="syIcon"></i>位置:
64
+                <a href="javaScript:;" id="ReIndex">首页</a>&gt;
65
+                <a href="javaScript:;">知识库</a>&gt;
66
+                <a href="" class="nowPosition">知识库查询</a>
67
+            </sapn>
68
+        </div>
69
+        <div class="dhRight">
70
+            <a href="#" title="刷新"><i class="fa fa-refresh"></i></a>
71
+        </div>
72
+    </div>
73
+    <div class="wrapper wrapper-content animated fadeInRight">
74
+        <div class="toolBar clearfix">
75
+            <div class="toolRight">
76
+                <span>搜索:<input type="text" class="searCon" /></span>
77
+                <button id="sc_btns" class="btns">搜索</button>
78
+            </div>
177 79
 
178
-		function initTable() {
179
-			//先销毁表格
180
-			table.bootstrapTable('destroy');
181
-			//初始化表格,动态从服务器加载数据
182
-			table.bootstrapTable({
183
-				method: "get", //使用get请求到服务器获取数据
184
-				url: huayi.config.callcenter_url + "Knowledge/GetList", //获取数据的Servlet地址
185
-				contentType: 'application/x-www-form-urlencoded',
186
-				striped: true, //表格显示条纹
187
-				pagination: true, //启动分页
188
-				pageSize: 10, //每页显示的记录数
189
-				pageNumber: 1, //当前第几页
190
-				pageList: [10, 15, 20, 50, 100], //记录数可选列表
191
-				search: false, //是否启用查询
192
-				showColumns: false, //显示下拉框勾选要显示的列
193
-				showRefresh: false, //显示刷新按钮
194
-				sidePagination: "server", //表示服务端请求
195
-				//设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
196
-				//设置为limit可以获取limit, offset, search, sort, order
197
-				queryParamsType: "undefined",
198
-				queryParams: function queryParams(params) { //设置查询参数
199
-					var param = {
200
-						page: params.pageNumber,
201
-						pagesize: params.pageSize,
202
-						token: token,
203
-						pid: id,
204
-						keywords: keyWord
205
-					};
206
-					return param;
207
-				},
208
-				onLoadSuccess: function() { //加载成功时执行
209
-					//layer.msg("加载成功");
210
-				},
211
-				onLoadError: function() { //加载失败时执行
212
-					//layer.msg("加载数据失败", { time: 1500, icon: 2 });
213
-				}
214
-			});
215
-		}
216
-		
217
-		function formatterTitle(val, row) {
218
-			if(val.length > 15) {
219
-				val = val.substring(0, 15) + "...";
220
-			}
221
-			return '<div onclick="btn_detail(' + row.F_RepositoryId + ')" class="content">' + val + '</div>'
222
-		}
80
+        </div>
81
+        <div class="treeTable clearfix">
82
+            <div class="tree col-md-3">
83
+                <div class="trTitle">知识库分类</div>
84
+                <div class="treeCon">
85
+                    <ul id="treeDemo" class="ztree">
86
+                        <!--类名为ztree是必须的-->
87
+                    </ul>
88
+                </div>
223 89
 
90
+            </div>
91
+            <div class="tableCon col-md-9">
92
+                <div class="trTitle"> 知识库列表</div>
93
+                <table id="table1" data-row-style="rowStyle" data-query-params="queryParams" data-pagination="true">
94
+                    <thead>
95
+                        <tr>
96
+                            <!--<th data-field="state" data-checkbox="true" data-align="center"></th>-->
97
+                            <th data-align="center" data-formatter="setCode">编号</th>
98
+                            <th data-field="F_Title" data-align="left" data-formatter="formatterTitle">标题</th>
99
+                            <th data-field="F_Description" data-align="left" data-formatter="oper">内容</th>
100
+                            <th data-field="F_KeyWords" data-align="center" data-formatter="formatterKey">关键字</th>
101
+                            <th data-field="F_CreateOn" data-align="center">创建时间</th>
102
+                        </tr>
103
+                    </thead>
104
+                    <tbody id="tbody">
105
+                    </tbody>
106
+                </table>
224 107
 
225
-		function oper(val, row) {
226
-			if(val.length > 20) {
227
-				val = val.substring(0, 20) + "...";
228
-			}
229
-			return '<div onclick="btn_detail(' + row.F_RepositoryId + ')" class="content">' + val + '</div>'
230
-		}
231
-		
232
-		function formatterKey(val, row) {
233
-			if(val.length > 10) {
234
-				val = val.substring(0, 10) + "...";
235
-			}
236
-			return val;
237
-		}
238
-		
239
-		function setCode(val, row, index) {
240
-//			var page = table.bootstrapTable("getPageCode");
241
-//			return page.pageSize * (page.pageNumber - 1) + index + 1;
242
-			return index + 1;
243
-		}
244
-		
245
-		//点击标题 内容查看详情
246
-		function btn_detail(seeid) {
247
-			layer.open({
248
-				type: 2,
249
-				title: '查看知识库',
250
-				shadeClose: true, //是否开启点击遮罩关闭
251
-				shade: 0.4, //遮罩
252
-				maxmin: true, //开启最大化最小化按钮
253
-				id: 'LAY_layuipro', //防止重复弹出
254
-				moveType: 1, //拖拽类型 默认的拖拽风格正如你所见到的,会有个过度的透明框。但是如果你不喜欢,你可以设定moveType: 1切换到传统的拖拽模式
255
-				moveOut: false, //拖拽到窗口外
256
-				//resize: true,//是否允许拉伸
257
-				area: ['70%', '50%'],
258
-				content: 'template/seeDetail.html?changeGetid=' + seeid + ''
259
-			});
260
-		}
108
+            </div>
109
+        </div>
261 110
 
262
-	</script>
111
+    </div>
112
+    <script src="../js/zTree/jquery.ztree.core.js"></script>
113
+</body>
114
+<script>
115
+    var token = $.cookie("token");
116
+    var id; //当前节点id
117
+    var pid; //当前父节点ID
118
+    var name; //选择的name
119
+    var pidName; //父节点name
120
+    var keyWord; //关键字
121
+    var table = $('#table1'); //右边表格
122
+    $(function () {
123
+        //实例化树形结构	
124
+        $.get(huayi.config.callcenter_url + 'KnowledgeClass/GetList', {
125
+            "token": $.cookie("token"),
126
+            "pid": pid
127
+        }, function (result) {
128
+            result = $.parseJSON(result);
129
+            $.fn.zTree.init($("#treeDemo"), setting1, result.data); //实例化树形图
130
+        });
131
+        var setting1 = {
132
+            data: {
133
+                key: {
134
+                    name: "text"
135
+                },
136
+                simpleData: {
137
+                    enable: true,
138
+                    idKey: "id",
139
+                    rootPId: 0
140
+                }
141
+            },
142
+            callback: {
143
+                onClick: zTreeOnClick
144
+            }
145
+        };
146
+
147
+        initTable();
148
+
149
+        //搜索按钮
150
+        $('#sc_btns').click(function () {
151
+            keyWord = $('.searCon').val();
152
+            //console.log(keyWord);
153
+            initTable();
154
+        });
155
+
156
+    });
157
+
158
+    function zTreeOnClick(event, treeId, treeNode) {
159
+        id = treeNode.id;
160
+        name = treeNode.text;
161
+        //		console.log(name);
162
+        //		console.log(id);
163
+        //		var pidnode = treeNode.getParentNode();
164
+        //		console.log(pidnode);
165
+        //		if(pidnode) {
166
+        //			pidName = pidnode.text;
167
+        //			pid = pidnode.id;
168
+        //			console.log(pid);
169
+        //		} else {
170
+        //			pidName = "顶级分类";
171
+        //			pid == 0;
172
+        //			console.log(pid);
173
+        //		}
174
+        keyWord = $('.searCon').val();
175
+        initTable();
176
+    };
177
+
178
+    function initTable() {
179
+        //先销毁表格
180
+        table.bootstrapTable('destroy');
181
+        //初始化表格,动态从服务器加载数据
182
+        table.bootstrapTable({
183
+            method: "get", //使用get请求到服务器获取数据
184
+            url: huayi.config.callcenter_url + "Knowledge/GetList", //获取数据的Servlet地址
185
+            contentType: 'application/x-www-form-urlencoded',
186
+            striped: true, //表格显示条纹
187
+            pagination: true, //启动分页
188
+            pageSize: 10, //每页显示的记录数
189
+            pageNumber: 1, //当前第几页
190
+            pageList: [10, 15, 20, 50, 100], //记录数可选列表
191
+            search: false, //是否启用查询
192
+            showColumns: false, //显示下拉框勾选要显示的列
193
+            showRefresh: false, //显示刷新按钮
194
+            sidePagination: "server", //表示服务端请求
195
+            //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
196
+            //设置为limit可以获取limit, offset, search, sort, order
197
+            queryParamsType: "undefined",
198
+            queryParams: function queryParams(params) { //设置查询参数
199
+                var param = {
200
+                    page: params.pageNumber,
201
+                    pagesize: params.pageSize,
202
+                    token: token,
203
+                    pid: id,
204
+                    keywords: keyWord
205
+                };
206
+                return param;
207
+            },
208
+            onLoadSuccess: function () { //加载成功时执行
209
+                //layer.msg("加载成功");
210
+            },
211
+            onLoadError: function () { //加载失败时执行
212
+                //layer.msg("加载数据失败", { time: 1500, icon: 2 });
213
+            }
214
+        });
215
+    }
216
+
217
+    function formatterTitle(val, row) {
218
+        if (val.length > 15) {
219
+            val = val.substring(0, 15) + "...";
220
+        }
221
+        return '<div onclick="btn_detail(' + row.F_RepositoryId + ')" class="content">' + val + '</div>'
222
+    }
223
+
224
+
225
+    function oper(val, row) {
226
+        if (val.length > 20) {
227
+            val = val.substring(0, 20) + "...";
228
+        }
229
+        return '<div onclick="btn_detail(' + row.F_RepositoryId + ')" class="content">' + val + '</div>'
230
+    }
231
+
232
+    function formatterKey(val, row) {
233
+        if (val.length > 10) {
234
+            val = val.substring(0, 10) + "...";
235
+        }
236
+        return val;
237
+    }
238
+
239
+    function setCode(val, row, index) {
240
+        //			var page = table.bootstrapTable("getPageCode");
241
+        //			return page.pageSize * (page.pageNumber - 1) + index + 1;
242
+        return index + 1;
243
+    }
244
+
245
+    //点击标题 内容查看详情
246
+    function btn_detail(seeid) {
247
+        layer.open({
248
+            type: 2,
249
+            title: '查看知识库',
250
+            shadeClose: true, //是否开启点击遮罩关闭
251
+            shade: 0.4, //遮罩
252
+            maxmin: true, //开启最大化最小化按钮
253
+            id: 'LAY_layuipro', //防止重复弹出
254
+            moveType: 1, //拖拽类型 默认的拖拽风格正如你所见到的,会有个过度的透明框。但是如果你不喜欢,你可以设定moveType: 1切换到传统的拖拽模式
255
+            moveOut: false, //拖拽到窗口外
256
+            //resize: true,//是否允许拉伸
257
+            area: ['70%', '50%'],
258
+            content: 'template/seeDetail.html?changeGetid=' + seeid + ''
259
+        });
260
+    }
261
+</script>
263 262
 
264 263
 </html>

+ 10 - 1
CallCenterWeb.UI/zhiShiKu/zhiShiKuManger.html

@@ -34,7 +34,16 @@
34 34
 					<button class="btns del">删除</button>
35 35
 				</div>
36 36
 				<div class="toolRight">
37
-					<span>搜索:<input type="text" class="searCon" /></span>
37
+                    <div class="searchKeyword">
38
+                        <div class="form-group">
39
+                            <input type="text" class="form-control" id="formKeyword" placeholder="请输入关键字" onkeyup="darptSearch()" autocomplete="off" />
40
+                        </div>
41
+                        <div class="selDpart1">
42
+                            <ul id="sponsor">
43
+                            </ul>
44
+                        </div>
45
+                    </div>
46
+					<!-- <span>搜索:<input type="text" class="searCon" /></span> -->
38 47
 					<button id="sc_btns" class="btns">搜索</button>
39 48
 				</div>
40 49