浏览代码

修改知识库 列表展示问题

fanlongfei 7 年之前
父节点
当前提交
39c5f63c39

+ 75 - 100
CallCenterWeb.UI/zhiShiKu/addModel.html

@@ -1,105 +1,80 @@
1 1
 <!DOCTYPE html>
2 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="../css/init.css" />
9
-    <title>知识库查询</title>
10
-    <style>
11
-        .table{
12
-        	margin: 20px;
13
-        	width: 97%;
14
-        }
15
-
16
-        .table th {
17
-            width: 10%;
18
-            font-weight: bold;
19
-            text-align: center;
20
-        }
21
-		
22
-		.table td{
23
-			width: 90%;
24
-		}
25
-        .table td textarea {
26
-            width: 100%;
27
-        }
28
-		
29
-    </style>
30
-</head>
31
-<body>
32
-    <!--查看弹出内容-->
33
-   
34
-    <table class="table-bordered table">
35
-        <tbody>
36
-            <tr>
37
-                <th>标题:</th>
38
-                <td colspan="3" class="addTitle"></td>
39
-            </tr>
40
-            <tr>
41
-                <th>关键字:</th>
42
-                <td colspan="3" class="addKey"></td>
43
-            </tr>
44
-            <tr>
45
-                <th>内容:</th>
46
-                <td colspan="3" class="addCon"></td>
47
-            </tr>
48
-        </tbody>
49
-    </table>
50
-    
51
-    <script src="../css/layer/layer.js"></script>
52
-</body>
53
-<script>
54
-    var token = $.cookie("token");
55
-    var changeGetid = helper.request.queryString("changeGetid"); 
56
-    getChangeBox(changeGetid);
57
-  
58
-    function getChangeBox(changeGetid) {
59
-        $.ajax({
60
-            type: "post",
61
-            url: huayi.config.callcenter_url + "Knowledge/GetInfo",
62
-            async: true,
63
-            dataType: 'json',
64
-            data: {
65
-                infoid: changeGetid,
66
-                token: token
67
-            },
68
-            success: function (data) {
69
-                var con = data.data;
70
-                $('.addTitle').html(con.F_Title);
71
-                $('.addKey').html(con.F_KeyWords);
72
-                $('.addCon').html(con.F_Content);
73
-            }
74
-        });
75
-
76
-    }
77
-   
78
-</script>
79
-
80
-</html>
81
-
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
-
100
-
101
-
102
-
103 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="../css/init.css" />
10
+		<title>知识库查询</title>
11
+		<style>
12
+			.table {
13
+				margin: 20px;
14
+				width: 97%;
15
+			}
16
+			
17
+			.table th {
18
+				width: 10%;
19
+				font-weight: bold;
20
+				text-align: center;
21
+			}
22
+			
23
+			.table td {
24
+				width: 90%;
25
+				table-layout: fixed;
26
+				word-break: break-all;
27
+				overflow: hidden;
28
+			}
29
+		</style>
30
+	</head>
31
+
32
+	<body>
33
+		<!--查看弹出内容-->
34
+
35
+		<table class="table-bordered table">
36
+			<tbody>
37
+				<tr>
38
+					<th>标题:</th>
39
+					<td colspan="3" class="addTitle"></td>
40
+				</tr>
41
+				<tr>
42
+					<th>关键字:</th>
43
+					<td colspan="3" class="addKey"></td>
44
+				</tr>
45
+				<tr>
46
+					<th>内容:</th>
47
+					<td colspan="3" class="addCon"></td>
48
+				</tr>
49
+			</tbody>
50
+		</table>
51
+
52
+		<script src="../css/layer/layer.js"></script>
53
+	</body>
54
+	<script>
55
+		var token = $.cookie("token");
56
+		var changeGetid = helper.request.queryString("changeGetid");
57
+		getChangeBox(changeGetid);
58
+
59
+		function getChangeBox(changeGetid) {
60
+			$.ajax({
61
+				type: "post",
62
+				url: huayi.config.callcenter_url + "Knowledge/GetInfo",
63
+				async: true,
64
+				dataType: 'json',
65
+				data: {
66
+					infoid: changeGetid,
67
+					token: token
68
+				},
69
+				success: function(data) {
70
+					var con = data.data;
71
+					$('.addTitle').html(con.F_Title);
72
+					$('.addKey').html(con.F_KeyWords);
73
+					$('.addCon').html(con.F_Content);
74
+				}
75
+			});
104 76
 
77
+		}
78
+	</script>
105 79
 
80
+</html>

+ 17 - 9
CallCenterWeb.UI/zhiShiKu/js/zhiShiKuManger.js

@@ -394,17 +394,25 @@ function initTable(token, id, keyWord) {
394 394
 	});
395 395
 }
396 396
 
397
+function formatterTitle(val, row){
398
+	if(val.length > 15){
399
+		val = val.substring(0,15) + "...";
400
+	}
401
+	return val;
402
+}
403
+
397 404
 function oper(val, row) {
398
-	if(val) {
399
-		var str = '<div '
400
-		if(val > 10) {
401
-			str = str + ' title="' + val + '" ';
402
-			val = val.substr(0, 5) + "...";
403
-		}
404
-		return str + '>' + val + '</div>';
405
-	} else {
406
-		return '';
405
+	if(val.length > 20){
406
+		val = val.substring(0,20) + "...";
407
+	}
408
+	return val;
409
+}
410
+
411
+function formatterKey(val, row) {
412
+	if(val.length > 10){
413
+		val = val.substring(0,10) + "...";
407 414
 	}
415
+	return val; 
408 416
 }
409 417
 
410 418
 function setCode(val, row, index) {

+ 20 - 3
CallCenterWeb.UI/zhiShiKu/zhiShiKuChaXun.html

@@ -96,9 +96,9 @@
96 96
 							<tr>
97 97
 								<th data-field="state" data-checkbox="true" data-align="center"></th>
98 98
 								<th data-align="center" data-formatter="setCode">编号</th>
99
-								<th data-field="F_Title" data-align="left">标题</th>
99
+								<th data-field="F_Title" data-align="left" data-formatter="formatterTitle">标题</th>
100 100
 								<th data-field="F_Description" data-align="left" data-formatter="oper">内容</th>
101
-								<th data-field="F_KeyWords" data-align="center">关键字</th>
101
+								<th data-field="F_KeyWords" data-align="center" data-formatter="formatterKey">关键字</th>
102 102
 								<th data-field="F_CreateOn" data-align="center">创建时间</th>
103 103
 							</tr>
104 104
 						</thead>
@@ -248,8 +248,25 @@
248 248
 			});
249 249
 		}
250 250
 
251
+		function formatterTitle(val, row) {
252
+			if(val.length > 15) {
253
+				val = val.substring(0, 15) + "...";
254
+			}
255
+			return val;
256
+		}
257
+
251 258
 		function oper(val, row) {
252
-			return '<div class="content">' + row.F_Content + '</div>'
259
+			if(val.length > 20) {
260
+				val = val.substring(0, 20) + "...";
261
+			}
262
+			return val;
263
+		}
264
+
265
+		function formatterKey(val, row) {
266
+			if(val.length > 10) {
267
+				val = val.substring(0, 10) + "...";
268
+			}
269
+			return val;
253 270
 		}
254 271
 
255 272
 		function setCode(val, row, index) {

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

@@ -164,9 +164,9 @@
164 164
 								<th data-field="state" data-checkbox="true" data-align="center"></th>
165 165
 								<th data-align="center" data-formatter="setCode">编号</th>
166 166
 								<!--<th data-align="center" data-field="id" data-formatter="setCode"></th>-->
167
-								<th data-field="F_Title" data-align="left">标题</th>
167
+								<th data-field="F_Title" data-align="left" data-formatter="formatterTitle">标题</th>
168 168
 								<th data-field="F_Description" data-align="left" data-formatter="oper">内容</th>
169
-								<th data-field="F_KeyWords" data-align="center">关键字</th>
169
+								<th data-field="F_KeyWords" data-align="center" data-formatter="formatterKey">关键字</th>
170 170
 								<th data-field="F_CreateOn" data-align="center">创建时间</th>
171 171
 							</tr>
172 172
 						</thead>