miaofuhao 1 год назад
Родитель
Сommit
afc791cac0

+ 10 - 1
WebUI/CallCenterWeb.UI/.project

@@ -1,6 +1,6 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <projectDescription>
3
-	<name>AY12345CallCenterWeb.UI</name>
3
+	<name>AnYang12345CallCenterWeb.UI</name>
4 4
 	<comment></comment>
5 5
 	<projects>
6 6
 	</projects>
@@ -150,5 +150,14 @@
150 150
 				<arguments>1.0-name-matches-false-false-node_modules</arguments>
151 151
 			</matcher>
152 152
 		</filter>
153
+		<filter>
154
+			<id>0</id>
155
+			<name></name>
156
+			<type>26</type>
157
+			<matcher>
158
+				<id>org.eclipse.ui.ide.multiFilter</id>
159
+				<arguments>1.0-name-matches-false-false-node_modules</arguments>
160
+			</matcher>
161
+		</filter>
153 162
 	</filteredResources>
154 163
 </projectDescription>

+ 17 - 0
WebUI/CallCenterWeb.UI/CommonHtml/errorPrompt.html

@@ -0,0 +1,17 @@
1
+<!DOCTYPE html>
2
+<html>
3
+	<head>
4
+		<meta charset="UTF-8">
5
+		<title></title>
6
+	</head>
7
+	<body>
8
+		<div style="width: 100%; padding-left: 15px;">
9
+			
10
+			<div style="display: flex; color: #2e73ff; line-height: 36px;border-bottom: 1px solid #2e73ff; width: 98%;">
11
+				<div style="width: 5px; height: 20px; background: #2e73ff; margin: 8px;"></div>
12
+				<div>提示信息</div>
13
+			</div>
14
+			<div style="padding-left: 20px; line-height: 36px;">发生错误</div>
15
+		</div>
16
+	</body>
17
+</html>

+ 1 - 1
WebUI/CallCenterWeb.UI/zhiShiKu/zhiShiKu.html

@@ -82,7 +82,7 @@
82 82
                 </span>
83 83
                
84 84
                <button class="btns searchGo">搜索</button>
85
-                <button class="btns addCon">知识条目添加</button>
85
+                
86 86
             </div>
87 87
         </div>
88 88
         <div class="treeTable clearfix">

+ 214 - 0
WebUI/CallCenterWeb.UI/zhiShiKuNew/cpns/addZhiShiKu.html

@@ -0,0 +1,214 @@
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
+		<link rel="stylesheet" href="../css/addZhiShiKu.css" />
11
+		<title>知识条目添加</title>
12
+	</head>
13
+
14
+	<body class="gray-bg">
15
+		<div class="container-fluid wrapper-content animated fadeInRight">
16
+			<div class="content">
17
+				<table class="table">
18
+					<tr>
19
+						<th>
20
+							<b>标题:</b>
21
+						</th>
22
+						<td>
23
+							<input type="text " class="m-kuang zs_t" />
24
+						</td>
25
+					</tr>
26
+					<tr>
27
+						<th>
28
+							<b>所属分类:</b>
29
+						</th>
30
+						<td>
31
+							<div class="inpBox">
32
+							<input type="text" class="inps" />
33
+							<i class="xl xl_one"></i>
34
+							<div class="addTree xlAdd">
35
+								<ul id="addTreeDemo" class="ztree">
36
+
37
+								</ul>
38
+							</div>
39
+							</div>
40
+						</td>
41
+					</tr>
42
+					<tr>
43
+						<th>
44
+							<b>内容:</b>
45
+						</th>
46
+						<td>
47
+							<textarea data-adaptheight id="addEditor" name="content" style="width: 80%;height: 450px;"></textarea>
48
+						</td>
49
+					</tr>
50
+					<tr>
51
+
52
+						<td colspan="2" class="text-center">
53
+							<div class="checkbox">
54
+								<label>
55
+							      	<input type="checkbox" style="margin-top: 2px;" class="isCheck"> 是否提交审核
56
+							    </label>
57
+							</div>
58
+						</td>
59
+					</tr>
60
+					<tr>
61
+						<td colspan="2" class="text-center">
62
+							<!--<button class="btns">添加</button>-->
63
+							<button class="btns tiJiao">提交</button>
64
+						</td>
65
+					</tr>
66
+				</table>
67
+
68
+			</div>
69
+
70
+		</div>
71
+
72
+		<script src="../../css/layer/layer.js"></script>
73
+		<script src="../../js/zTree/jquery.ztree.core.js"></script>
74
+		<script src="../../js/kindeditor/kindeditor-all-min.js"></script>
75
+		<script src="../../js/kindeditor/lang/zh-CN.js"></script>
76
+		<script src="../../js/adjustHeight.js"></script>
77
+		<script>
78
+			var bid = helper.request.queryString("id");
79
+			var id = ''; //当前节点id
80
+			var cname; //当前节点name
81
+			var pid; //当前节点父ID
82
+			var pidName; //当前节点父name
83
+			var xlName; //添加弹出框内下拉框内节点name
84
+			var token = $.cookie("token");
85
+			//编辑器配置
86
+			KindEditor.ready(function(K) {
87
+				window.editor = K.create('#addEditor', {
88
+					uploadJson: '../../js/kindeditor/asp.net/upload_json.ashx',
89
+					fileManagerJson: '../../js/kindeditor/asp.net/file_manager_json.ashx',
90
+					allowFileManager: true
91
+				}); //添加弹出框编辑器
92
+			});
93
+			$(document).ready(function () {
94
+				tree();
95
+				if (bid) {
96
+					getInfo()
97
+				}
98
+			})
99
+			var title;//知识库标题
100
+			var con;//知识库内容
101
+			var issub;//是否提交审核
102
+			$('.tiJiao').click(function(){
103
+			
104
+				if($('.isCheck').is(':checked')==true){
105
+					issub=1;
106
+				}else{
107
+					issub=0;
108
+				}
109
+				title=$('.zs_t').val();
110
+				con=encodeURIComponent(editor.html());
111
+				//console.log(issub)
112
+				add(title,con,id, issub)
113
+			});
114
+			
115
+			function add(title,con,id, issub){
116
+				$.ajax({
117
+					type:"post",
118
+					url:huayi.config.callcenter_url+"Knowledge/AddInfo",
119
+					async:true,
120
+					dataType:'json',
121
+					data:{
122
+						token:$.cookie("token"),
123
+						title:title,//知识库标题
124
+						con:con,//知识库内容
125
+						pid:id,//分类ID
126
+						issub:issub//是否提交审核
127
+					},
128
+					success:function(data){
129
+						if(data.state.toLowerCase()=="success"){
130
+							var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
131
+                    		parent.layer.close(index); //再执行关闭
132
+                    		//debugger;
133
+						  	parent.initTable(id);					 
134
+							parent.layer.msg("添加成功");
135
+						}
136
+					}
137
+				});
138
+			}
139
+			function getInfo () {
140
+				$.ajax({
141
+					type:"get",
142
+					url:huayi.config.callcenter_url+"Knowledge/GetInfo",
143
+					async:true,
144
+					dataType:'json',
145
+						data:{
146
+							token:$.cookie("token"),
147
+							infoid:bid,//知识库标题
148
+						},
149
+						success:function(data){
150
+							var con=data.data;
151
+							if(data.state.toLowerCase()=='success'){
152
+								$('.zs_t').val(con.F_Title);//标题
153
+								$('.inps').val(con.F_Category);
154
+								cname=con.F_Category;
155
+								editor.html(con.F_Content);
156
+								id=con.F_CategoryId;
157
+							}
158
+						}
159
+				});
160
+			}
161
+			function tree() {
162
+				$.get(huayi.config.callcenter_url + 'KnowledgeClass/GetList', {
163
+					"token": $.cookie("token"),
164
+					//		"pid": pid
165
+				}, function(result) {
166
+					result = $.parseJSON(result);
167
+					var zTreeObj=$.fn.zTree.init($("#addTreeDemo"), setting1, result.data); //实例化树形图
168
+					   var nodes = zTreeObj.getNodes();
169
+			            for (var i = 0; i < nodes.length; i++) { //设置节点展开
170
+			                zTreeObj.expandNode(nodes[i], true, false, true);
171
+			            }
172
+				});
173
+			}
174
+			var setting1 = {
175
+				data: {
176
+					key: {
177
+						name: "text"
178
+					},
179
+					simpleData: {
180
+						enable: true,
181
+						idKey: "id",
182
+						rootPId: 0
183
+					}
184
+				},
185
+				callback: {
186
+					onClick: zTreeOnClick
187
+				}
188
+			};
189
+
190
+			function zTreeOnClick(event, treeId, treeNode) {
191
+				//		pid = treeNode.pId;
192
+				id = treeNode.id;
193
+				cname = treeNode.text;
194
+				$('.inps').val(cname);
195
+			};
196
+			//所属分类下拉
197
+			$('.inps').focus(function() {
198
+				$('.xlAdd').css('display', 'block')
199
+			})
200
+			$('.xl').click(function() {
201
+				if($('.xlAdd').css('display') == 'block') {
202
+					$('.xlAdd').css('display', 'none')
203
+				} else {
204
+					$('.xlAdd').css('display', 'block')
205
+				}
206
+			})
207
+			$('.addTree').mouseleave(function() {
208
+				$(this).css('display', 'none')
209
+			})
210
+		
211
+		</script>
212
+	</body>
213
+
214
+</html>

+ 72 - 0
WebUI/CallCenterWeb.UI/zhiShiKuNew/cpns/zhiShiKuDetail.html

@@ -0,0 +1,72 @@
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.http.js"></script>
8
+		<script src="../../Script/Common/huayi.config.js"></script>
9
+		<link rel="stylesheet" href="../../js/zTree/zTreeStyle.css" />
10
+		<link rel="stylesheet" href="../../css/init.css" />
11
+		<link rel="stylesheet" href="../css/zhiShiKuDetail.css" />
12
+		<title>知识库详情页面</title>
13
+	</head>
14
+
15
+	<body>
16
+		<div class="container-fluid">
17
+			<div class="treeTable">
18
+				<h3 class="con_title"></h3>
19
+				<div class="con_message">
20
+					<span>所属类别:</span>
21
+					<sapn class="lb"></sapn>
22
+					<span>创建人:</span>
23
+					<sapn class="cjr"></sapn>
24
+					<span>审核人:</span>
25
+					<sapn class="shr"></sapn>
26
+					<span>创建日期:</span>
27
+					<sapn class="time"></sapn>
28
+				</div>
29
+				<table class="con_content table table-striped table-hover">
30
+					<tr>
31
+						<td class="content"></td>
32
+					</tr>
33
+				</table>
34
+			</div>
35
+		</div>
36
+
37
+		<script src="../../css/laydate/laydate.js"></script>
38
+		<script src="../../js/zTree/jquery.ztree.core.js"></script>
39
+		<script src="../../js/kindeditor/kindeditor-all-min.js"></script>
40
+		<script src="../../js/kindeditor/lang/zh-CN.js"></script>
41
+		<script>
42
+			$(function() {
43
+				var id = helper.request.queryString("id");
44
+				Ajax(id);
45
+				function Ajax(id) {
46
+					$.ajax({
47
+						type: "get",
48
+						url: huayi.config.callcenter_url + "Knowledge/GetInfo",
49
+						async: true,
50
+						dataType: 'json',
51
+						data: {
52
+							token: $.cookie("token"),
53
+							infoid: id
54
+						},
55
+						success: function(data) {
56
+							var con = data.data;
57
+							if(data.state.toLowerCase() == 'success') {
58
+								$('.lb').html(con.F_Category); //所属类别
59
+								$('.cjr').html(con.F_CreateBy); //创建人
60
+								$('.shr').html(con.F_AuditBy); //审核人
61
+								$('.time').html(con.F_CreateOn); //创建日期
62
+								$('.content').html(con.F_Content);
63
+								$('.con_title').html(con.F_Title);
64
+							}
65
+						}
66
+					});
67
+				}
68
+			})
69
+		</script>
70
+	</body>
71
+
72
+</html>

+ 72 - 0
WebUI/CallCenterWeb.UI/zhiShiKuNew/css/addZhiShiKu.css

@@ -0,0 +1,72 @@
1
+.m-kuang {
2
+	width: 80%;
3
+	background-color: #FFF;
4
+	background-image: none;
5
+	border: 1px solid #ccc;
6
+	border-radius: 1px;
7
+	color: inherit;
8
+	padding: 6px 12px;
9
+	outline: none;
10
+	vertical-align: middle;
11
+}
12
+
13
+table th {
14
+	width: 20%;
15
+	text-align: right;
16
+	border-top: 0!important;
17
+}
18
+
19
+table td {
20
+	border-top: 0!important;
21
+}
22
+
23
+.daoHang {
24
+	border-bottom: 1px solid #ccc;
25
+}
26
+
27
+.content {
28
+	margin-top: 15px;
29
+}
30
+
31
+.inps {
32
+	width: 95%;
33
+	height: 30px;
34
+	outline: none;
35
+	border: 0;
36
+	border-image-width: 0;
37
+	padding: 0;
38
+	padding-left: 3px;
39
+}
40
+
41
+.inpBox {
42
+	border: 1px solid #ccc;
43
+	height: 32px;
44
+	width: 80%;
45
+	display: inline-block;
46
+	position: relative;
47
+	vertical-align: middle;
48
+}
49
+
50
+.xl {
51
+	display: inline-block;
52
+	background: url(../../img/dropDown.png) no-repeat;
53
+	height: 100%;
54
+	background-position: center center;
55
+	width: 20px;
56
+	position: absolute;
57
+	right: 0;
58
+	top: 0px;
59
+	/* background-color: #f7bc8b; */
60
+	cursor: pointer;
61
+}
62
+
63
+.addTree {
64
+	background: #fff;
65
+	position: absolute;
66
+	width: 100%;
67
+	border: 1px solid darkgrey;
68
+	right: 0;
69
+	top: 32px;
70
+	display: none;
71
+	z-index: 9999;
72
+}

Разница между файлами не показана из-за своего большого размера
+ 1 - 0
WebUI/CallCenterWeb.UI/zhiShiKuNew/css/jquery.pagination.min.css


+ 217 - 0
WebUI/CallCenterWeb.UI/zhiShiKuNew/css/knowledgeList.css

@@ -0,0 +1,217 @@
1
+.toolBar{
2
+	position: relative;
3
+	margin-bottom: 0px;
4
+}
5
+.addCon{
6
+	position: absolute;
7
+	right: 50px;
8
+	top: 15px;
9
+}
10
+nav>li.active {
11
+	border-left: 2px solid #00a1cb;
12
+	background: #00a1cb;
13
+}
14
+
15
+.nav-pills>li.active>a,
16
+.nav-pills>li.active>a:focus,
17
+.nav-pills>li.active>a:hover {
18
+	border-left: 2px solid #00a1cb;
19
+	background: #00a1cb;
20
+}
21
+
22
+.nav>li>a {
23
+	color: #000000;
24
+	padding: 5px 8px 5px 5px;
25
+}
26
+
27
+.nav {
28
+	width: 152px;
29
+	margin: 0 auto;
30
+}
31
+
32
+
33
+/*多级下拉开始*/
34
+
35
+.Cleans,
36
+.CleansReactionCategoryLabel {
37
+	width: 20px;
38
+	position: absolute;
39
+	right: 8px;
40
+	top: 8px;
41
+	height: 20px;
42
+	color: #000;
43
+	line-height: 20px;
44
+	z-index: 1111;
45
+	font-size: 24px;
46
+	display: none;
47
+	font-weight: bold;
48
+}
49
+
50
+.reflectCategory-wrapper {
51
+	width: 150px;
52
+	position: relative;
53
+}
54
+
55
+.reflectCategoryList-wrapper {
56
+	display: none;
57
+	position: absolute;
58
+	top: 38px;
59
+	z-index: 9999;
60
+	line-height: 32px;
61
+	background: #FFF;
62
+}
63
+
64
+#reflectCategoryList {
65
+	height: 240px;
66
+	background: #FFF;
67
+	border: 1px solid #e5e6e7;
68
+	overflow: auto;
69
+}
70
+
71
+#reflectCategoryList li {
72
+	padding: 0 10px;
73
+	width: 100%;
74
+	line-height: 32px;
75
+	
76
+}
77
+
78
+#reflectCategoryList li:hover {
79
+	background: #00a1cb;
80
+}
81
+
82
+.layui-menu li {
83
+	margin: 0 !important;
84
+	padding: 2px 15px !important;
85
+	height: 16px;
86
+	line-height: 12px !important;
87
+	font-size: 12px !important;
88
+}
89
+
90
+
91
+/*多级下拉结束*/
92
+
93
+
94
+/*搜索开始*/
95
+
96
+.universalSearch {
97
+	display: none;
98
+	margin-top: 15px;
99
+}
100
+
101
+.universalSearch .input-group {
102
+	width: 600px;
103
+	margin: 0 auto;
104
+}
105
+
106
+.advancedSearch {
107
+	display: block;
108
+	margin: 0 auto;
109
+	width: 500px;
110
+	display: none;
111
+}
112
+
113
+.advancedSearch .form-group {
114
+	display: flex;
115
+	margin-top: 15px;
116
+}
117
+
118
+.advancedSearch .form-group label {
119
+	width: 150px;
120
+	text-align: right;
121
+	line-height: 33px;
122
+	margin-right: 8px;
123
+}
124
+
125
+.advancedSearch .form-group input {
126
+	width: 350px;
127
+}
128
+
129
+.advancedSearch .form-group select {
130
+	width: 350px;
131
+}
132
+.searchBtn{
133
+	text-align: center;
134
+	margin-top: 15px;
135
+}
136
+
137
+/*搜索结束*/
138
+
139
+
140
+/*列表样式开始*/
141
+
142
+.content {
143
+	text-align: left;
144
+	width: 98%;
145
+	margin: 0 auto;
146
+}
147
+.content  .page{
148
+	text-align: right;
149
+}
150
+.content  .page nav .pageNum{
151
+	text-align: left;
152
+	line-height: 70px;
153
+	width: 50%;
154
+	float: left;
155
+}
156
+.content  .page nav .pagination{}
157
+.content .list ul {
158
+	list-style: none;
159
+	color: rgba(0, 0, 0, 0.65);
160
+	font-size: 14px;
161
+	font-variant: tabular-nums;
162
+	line-height: 1.5;
163
+}
164
+
165
+.content .list ul li {
166
+	position: relative;
167
+	border-bottom: 1px solid #CCCCCC;
168
+	margin-top: 8px;
169
+	padding: 0 12px;
170
+}
171
+
172
+.content .list ul li .title {
173
+	font-size: 16px;
174
+	font-weight: bolder;
175
+	cursor: pointer;
176
+	color: #000c17;
177
+}
178
+.content .list ul li .title .mx-1{
179
+	color: #FF0000;
180
+}
181
+.content .list ul li .category {
182
+	color: #9e9e9e;
183
+	font-size: 12px;
184
+}
185
+
186
+.content .list ul li .category span {
187
+	background: #f4f4f4;
188
+	font-size: 12px;
189
+	padding: 3px 8px;
190
+	border-radius: 5px;
191
+	height: 28px;
192
+	line-height: 28px;
193
+	margin-right: 5px;
194
+	color: #5c6065;
195
+}
196
+
197
+.content .list ul li .text {
198
+	overflow: hidden;
199
+	text-overflow: ellipsis;
200
+	display: -webkit-box;
201
+	-webkit-line-clamp: 2;
202
+	overflow: hidden;
203
+	-webkit-box-orient: vertical;
204
+}
205
+.content .list ul li .text {
206
+	margin-bottom: 8px;
207
+}
208
+.button {
209
+	position: absolute;
210
+	right: 30px;
211
+	bottom: 26px;
212
+}
213
+.button a{
214
+	margin-right: 15px;
215
+}
216
+
217
+/*列表样式结束*/

+ 31 - 0
WebUI/CallCenterWeb.UI/zhiShiKuNew/css/zhiShiKuDetail.css

@@ -0,0 +1,31 @@
1
+.treeTable {
2
+	/*height: 400px;*/
3
+	/*overflow-y: auto;*/
4
+	width: 100%;
5
+	border: 1px solid #e5e5e5;
6
+	text-align: center;
7
+	padding: 15px;
8
+}
9
+
10
+.con_title {
11
+	font-weight: bold;
12
+	color: #000;
13
+}
14
+
15
+.con_message {
16
+	border-bottom: 1px solid #e5e5e5;
17
+	padding: 5px;
18
+	margin-bottom: 15px;
19
+}
20
+
21
+.con_content {
22
+	text-align: left;
23
+}
24
+
25
+.icon_r {
26
+	margin-right: 3px;
27
+}
28
+
29
+.box .btop {
30
+	background: #00a1cb;
31
+}

+ 136 - 0
WebUI/CallCenterWeb.UI/zhiShiKuNew/js/jquery.pagination.js

@@ -0,0 +1,136 @@
1
+(function($){
2
+
3
+    $.fn.pagination = function(options){
4
+        var defaults = {
5
+            /*总页数*/
6
+            total: 0,
7
+            /*每页条数*/
8
+            row: 10,
9
+            /*最大页码量,调这个值分页页码数量会变化*/
10
+            num: 2,
11
+            /*当前页索引*/
12
+            current: 1,
13
+            /*
14
+                自定义分页模板
15
+                first, last, prev, next 请保证 data-index 值正确否则click事件无响应
16
+                item 必须有,其它可选
17
+            */
18
+            template: {
19
+                first:'<li class="first" data-index="first"><a href="javascript:;">首页</a></li>',
20
+                last: '<li class="last" data-index="last"><a href="javascript:;">最后一页</a></li>',
21
+                prev: '<li class="prev" data-index="prev"><a href="javascript:;">上一页</a></li>',
22
+                next: '<li class="next" data-index="next"><a href="javascript:;">下一页</a></li>',
23
+                ellipsis: '<li class="ellipsis" data-index="ellipsis"><a href="javascript:;">...</a></li>',
24
+                item: '<li class="page-{{dataIndex}}" data-index="{{dataIndex}}"><a href="javascript:;">{{index}}</a></li>',
25
+                wrapElement: 'ul'
26
+            },
27
+            /*回调 $.noop.call(this, current, context);*/
28
+            onJump: $.noop
29
+        };
30
+
31
+        function Pager(){
32
+            return this.init.apply(this, arguments);
33
+        }
34
+
35
+        Pager.prototype = {
36
+            init: function(opt, context){
37
+                if(!opt.template || !opt.template.item){
38
+                    throw new  Error("`item` cannot be empty!");
39
+                }
40
+                this.config   = opt || {};
41
+                this.template      = opt.template;
42
+                this.$context = $(context);
43
+                this.total    = opt.total;
44
+                this.row      = opt.row;
45
+                this.num      = opt.num;
46
+                this.current  = opt.current;
47
+                this.onJump   = opt.onJump;
48
+                this.render();
49
+                this.bindEvent();
50
+            },
51
+            bindEvent: function(){
52
+                var self = this;
53
+                var tag  = this.template.item.match(/\<(\w+)/)[1];
54
+
55
+                function clickHandler(){
56
+                    var $this = $(this), index = $this.data('index');
57
+                    if(index === 'current' || index == 'ellipsis')return;
58
+                    switch(index){
59
+                        case 'prev'  : self.current--; break;
60
+                        case 'next'  : self.current++; break;
61
+                        case 'last'  : self.current = self.page; break;
62
+                        case 'first' : self.current = 1; break;
63
+                        default: self.current = index*1;
64
+                    }
65
+                    self.onJump.call(this, self.current, self);
66
+                    self.render();
67
+                }
68
+                this.$context.on('click', tag, clickHandler)
69
+            },
70
+            fixParams: function(){
71
+                this.page    = Math.ceil(this.total/this.row);
72
+                this.num     = Math.min(this.page-1, this.num);
73
+                this.current = Math.min(Math.max(this.current, 1), this.page);
74
+            },
75
+            render: function(){
76
+                this.fixParams();
77
+                var code  = [], 
78
+                    cur   = this.current, 
79
+                    start = Math.max(1, cur-this.num), 
80
+                    end   = start + this.num;
81
+
82
+                if(start > 2){
83
+                    code.push(this.template.first || "");
84
+                    code.push(this.template.prev  || "");
85
+                    code.push(this.getItemPageHtml(1));
86
+                    code.push(this.template.ellipsis || "");
87
+                }else if(start == 2){
88
+                    code.push(this.getItemPageHtml(1));
89
+                }
90
+
91
+                for(var i = start; i <= end; i++){
92
+                    code.push(this.getItemPageHtml(i));
93
+                }
94
+
95
+                end < this.page-1 && code.push(this.template.ellipsis || "");
96
+
97
+                if(end < this.page){
98
+                    code.push(this.getItemPageHtml(this.page));
99
+                    code.push(this.template.next || "");
100
+                    code.push(this.template.last || "");
101
+                }
102
+
103
+                if(this.template.wrapElement){
104
+                    code.unshift('<' + this.template.wrapElement + '>');
105
+                    code.push('</' + this.template.wrapElement + '>');
106
+                }
107
+                this.$context.html( code.join('') );
108
+            },
109
+            getItemPageHtml: function(index){
110
+                var self = this;
111
+                var obj = {
112
+                    index: function(){ return index; },
113
+                    dataIndex: function(){
114
+                        return index === self.current ? 'current' : index;
115
+                    }
116
+                };
117
+                return self.template.item.replace(/\{\{(\w+)\}\}/g, function(a, key){
118
+                    return obj[key]();
119
+                });
120
+            }
121
+        };
122
+
123
+        this.each(function(){
124
+            var $pagination = $(this).data('pagination');
125
+            if($pagination){
126
+                $.extend($pagination, $.extend($pagination.config, options));
127
+                $pagination.render();
128
+            }else{
129
+                $(this).data('pagination', new Pager($.extend(defaults, options), this));
130
+            }
131
+        });
132
+
133
+        return this;
134
+    };
135
+
136
+}(jQuery));

+ 378 - 0
WebUI/CallCenterWeb.UI/zhiShiKuNew/knowledgeList.html

@@ -0,0 +1,378 @@
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/layui/css/layui.css">
9
+		<link rel="stylesheet" href="./css/jquery.pagination.min.css" />
10
+		<link rel="stylesheet" href="../css/init.css" />
11
+		<link rel="stylesheet" href="./css/knowledgeList.css" />
12
+		<title>知识库主界面</title>
13
+	</head>
14
+
15
+	<body class="gray-bg">
16
+		<div class="container-fluid wrapper-content animated fadeInRight">
17
+			<div class="daoHang clearfix">
18
+				<div class="dhLeft">
19
+					<sapn><i class="syIcon"></i>位置:
20
+						<a id="ReIndex">首页</a>&gt;
21
+						<a href="javaScript:;">知识库</a>&gt;
22
+						<a href="" class="nowPosition">知识库主界面</a>
23
+					</sapn>
24
+				</div>
25
+				<div class="dhRight">
26
+					<a href="" title="刷新"><i class="fa fa-refresh"></i></a>
27
+				</div>
28
+			</div>
29
+			<div class="toolBar clearfix">
30
+				<ul class="nav nav-pills">
31
+					<li role="presentation" class="active" index="1">
32
+						<a href="#">普通检索</a>
33
+					</li>
34
+					<li role="presentation" index="2">
35
+						<a href="#">高级检索</a>
36
+					</li>
37
+				</ul>
38
+				<div class="universalSearch" style="display: block;">
39
+					<div class="input-group" >
40
+						<span class="input-group-btn reflectCategory-wrapper">
41
+								<input type="text" id="reflectCategoryLabel" placeholder="请选择分类" class="form-control reflectCategory" autocomplete="off" />
42
+								<span class="CleansReactionCategoryLabel Cleans">×</span>
43
+								<div class="reflectCategoryList-wrapper">
44
+									<ul id="reflectCategoryList">
45
+									</ul>
46
+								</div>
47
+			      		</span>
48
+						<input type="text" id="searCon" class="form-control" placeholder="请输入关键字">
49
+					</div>
50
+				</div>
51
+				<div class="advancedSearch">
52
+					<div class="form-group">
53
+						<label for="name">关键字</label>
54
+						<input type="text" class="form-control" id="searCon2" placeholder="请输入关键字">
55
+					</div>
56
+					<div  class="form-group">
57
+						<label for="name">审核状态</label>
58
+						<select  class="form-control" id="isPass">
59
+							<option value="" selected="selected">全部</option>
60
+		                	<option value="0">未审核</option>
61
+		                	<option value="1">通过审核</option>
62
+		                	<option value="-1">未通过</option>
63
+						</select>
64
+					</div>
65
+					<div  class="form-group">
66
+						<label for="name">是否提交</label>
67
+						<select  class="form-control" id="isSub">
68
+							<option value="" selected="selected">全部</option>
69
+		                	<option value="0">否</option>
70
+		                	<option value="1">是</option>
71
+						</select>
72
+					</div>
73
+					<div  class="form-group">
74
+						<label for="name">分类</label>
75
+						<div class="reflectCategory-wrapper" style="width: 345px">
76
+							<input type="text" id="reflectCategoryLabel2" placeholder="请选择分类" class="form-control reflectCategory" autocomplete="off" />
77
+							<span class="CleansReactionCategoryLabel2 Cleans">×</span>
78
+							<div class="reflectCategoryList-wrapper">
79
+								<ul id="reflectCategoryList">
80
+								</ul>
81
+							</div>
82
+						</div>
83
+					</div>
84
+					
85
+				</div>
86
+				
87
+				<div class="searchBtn">
88
+					<button class="btns" id="resetBtn">重置</button>
89
+					<button class="btns" id="serchBtn">搜索</button>
90
+				</div>
91
+				<button class="btns addCon">知识条目添加</button>
92
+			</div>
93
+			<div class="tableList">
94
+				<div class="content">
95
+			        <div class="list knowledgeList">
96
+			          <ul>
97
+			            <!--<li>
98
+			              <div class="title">
99
+			                <span style="margin-right: 3px; vertical-align: -15%"></span>
100
+			                <span  onclick="goDetail()">标题</span>
101
+			                <span class="mx-1" style="margin-left: 15px; font-size: 12px">拒绝理由</span>
102
+			              </div>
103
+			              <div class="category">
104
+			                <span>分类:<span> 1</span></span>
105
+			                <span>标签:<span> 2</span></span>
106
+			                <span>目录分类:<span>3</span></span>
107
+			              </div>
108
+			              <span class="text"></span>
109
+			              <div class="time">
110
+			                <span style="margin-right: 3px; vertical-align: -15%"></span>
111
+			                创建者<span>发布于</span>2024年3月14日15:44:14
112
+			              </div>
113
+			              <div class="button">
114
+			                <a class="stateWaitAudit">待审核</a>
115
+			                <a class="statePass">通过</a>
116
+			                <a onclick="editKnowledge()">编辑</a>
117
+			                <a onclick="remove()">删除</a>
118
+			              </div>
119
+			            </li>-->
120
+			          </ul>
121
+			          <div class="noMsg" style="display: none; text-align: center;">暂无数据</div>
122
+			        </div>
123
+			        <div class="page knowledgePage" >
124
+			        	<div class="pagination"></div>
125
+			         <!--<nav aria-label="Page navigation">
126
+			         		<div class="pageNum">共<span class="pageTotal"></span>页</div>
127
+						  <ul class="pagination">
128
+						    <li>
129
+						      <a href="#" aria-label="Previous">
130
+						        <span aria-hidden="true">&laquo;</span>
131
+						      </a>
132
+						    </li>
133
+						    <li><a href="#">1</a></li>
134
+						    <li><a href="#">2</a></li>
135
+						    <li><a href="#">3</a></li>
136
+						    <li><a href="#">4</a></li>
137
+						    <li><a href="#">5</a></li>
138
+						    <li>
139
+						      <a href="#" aria-label="Next">
140
+						        <span aria-hidden="true">&raquo;</span>
141
+						      </a>
142
+						    </li>
143
+						  </ul>
144
+						</nav>-->
145
+			        </div>
146
+      			</div>
147
+			</div>
148
+
149
+		</div>
150
+		
151
+		<input type="hidden" id="keyidLabel" value="" />
152
+		<input type="hidden" id="keyidLabel2" value="" />
153
+		<script src="../js/kindeditor/kindeditor-all-min.js"></script>
154
+		<script src="../js/kindeditor/lang/zh-CN.js"></script>
155
+		<script src="../js/layui/layui.js"></script>
156
+		<script src="./js/jquery.pagination.js"></script>
157
+
158
+	</body>
159
+	<script>
160
+		var dataParams = {
161
+			page:1,
162
+			pagesize:10,
163
+			token:$.cookie("token"),
164
+		}
165
+		var dataSearchIndex = '1'
166
+		$(document).ready(function () {
167
+			getListData(dataParams)
168
+			getReactionCategoryLabel() //多级下拉获取数据
169
+		})
170
+		$("#serchBtn").click(function() {
171
+			getListData(dataParams)
172
+		})
173
+		$("#resetBtn").click(function() {
174
+			cleanSearch()
175
+		})
176
+		//		tab切换事件
177
+		$(".nav-pills li").click(function() {
178
+			$(".nav-pills li").removeClass("active")
179
+			$(this).addClass("active")
180
+			$(".universalSearch").hide()
181
+			$(".advancedSearch").hide()
182
+			$(".universalSearch").hide()
183
+			if ($(this).attr("index")==='1') {
184
+				$(".universalSearch").show()
185
+				dataSearchIndex = '1'
186
+			} else {
187
+				dataSearchIndex = '2'
188
+				$(".advancedSearch").show()
189
+			}
190
+		})
191
+//		tab切换事件结束
192
+		function getListData(dataParams){
193
+			$(".knowledgeList ul").empty();
194
+			if (dataSearchIndex === '1') {
195
+				dataParams.keywords = $("#searCon").val()
196
+				dataParams.pid = $("#keyidLabel").val()
197
+				delete dataParams.isPass
198
+				delete dataParams.isSub
199
+			}else if (dataSearchIndex === '2') {
200
+				dataParams.keywords = $("#searCon2").val()
201
+				dataParams.pid = $("#keyidLabel2").val()
202
+				dataParams.isPass = $("#isPass").val()
203
+				dataParams.isSub = $("#isSub").val()
204
+			}
205
+			$.ajax({
206
+					type:"get",
207
+					url:huayi.config.callcenter_url+"Knowledge/GetList",
208
+					async:true,
209
+					dataType:'json',
210
+					data:dataParams,
211
+					success:function(data){
212
+						if (data.rows.length>0) {
213
+							var dataRows = data.rows
214
+							$(".pagination").pagination({
215
+							    total: data.total,
216
+							    onJump: function(index){
217
+							    	getListData(index)
218
+							    }
219
+							});
220
+							data.total && $(".pageTotal").text(Math.ceil(data.total/10))
221
+							$(dataRows).each(function (i, n) {
222
+								$('<li><div class="title"><span style="margin-right: 3px; vertical-align: -15%"></span><span  onclick="goDetail('
223
+								+n.F_CategoryId+')">'
224
+								+n.F_Title+'</span></div><span class="text">'
225
+								+n.F_Description+'</span><div class="time"><span style="margin-right: 3px; vertical-align: -15%"></span><span>发布于</span>'
226
+		                		+n.F_CreateOn+'</div><div class="button"><a class="stateWaitAudit">待审核</a><a class="statePass">通过</a>'
227
+		                		+'<a onclick="editKnowledge('
228
+		                		+n.F_CategoryId+')">编辑</a><a onclick="remove('
229
+		                		+n.F_CategoryId+')">删除</a></div></li>').appendTo($('.knowledgeList ul'))
230
+							})
231
+						}else{
232
+							$(".knowledgeList ul").hide()
233
+							$(".knowledgeList .noMsg").show()
234
+						}
235
+					}
236
+				});
237
+		}
238
+		//添加条目
239
+		$('.addCon').click(function() {
240
+		    layer.open({
241
+		      	type: 2,
242
+		      	title: '添加知识库',
243
+		      	shadeClose: true, //是否开启点击遮罩关闭
244
+		      	shade: 0.4, //遮罩
245
+		     	maxmin: true, //开启最大化最小化按钮
246
+		     	id: 'LAY_layuipro2',//防止重复弹出
247
+		     	moveType: 1,//拖拽类型 默认的拖拽风格正如你所见到的,会有个过度的透明框。但是如果你不喜欢,你可以设定moveType: 1切换到传统的拖拽模式
248
+		     	moveOut: true, //拖拽到窗口外
249
+		     	//resize: true,//是否允许拉伸
250
+		      	area: ['80%', '80%'],
251
+		      	content: './cpns/addZhiShiKu.html'
252
+		    });
253
+		})
254
+		//编辑
255
+		function editKnowledge(editId){
256
+			layer.open({
257
+		      	type: 2,
258
+		      	title: '编辑知识库详情',
259
+		      	shadeClose: true, //是否开启点击遮罩关闭
260
+		      	shade: 0.4, //遮罩
261
+		     	maxmin: true, //开启最大化最小化按钮
262
+		     	id: 'LAY_layuipro1',//防止重复弹出
263
+		     	moveType: 1,//拖拽类型 默认的拖拽风格正如你所见到的,会有个过度的透明框。但是如果你不喜欢,你可以设定moveType: 1切换到传统的拖拽模式
264
+		     	moveOut: true, //拖拽到窗口外
265
+		      	area: ['80%', '80%'],
266
+		      	content: './cpns/addZhiShiKu.html?id='+ editId +''
267
+		    });
268
+		}
269
+		//删除
270
+		function remove(delIds){
271
+			layer.confirm('提示:若要删除,要等待审核。您确定要删除吗?', {
272
+				  btn: ['确定','取消'] //按钮
273
+			}, function(){
274
+				$.post(huayi.config.callcenter_url + "Knowledge/DelInfos", {
275
+					ids: delIds,
276
+					token: $.cookie("token")
277
+				}, function(result) {
278
+					result = JSON.parse(result);
279
+					if(result.state.toLowerCase() == "success") {
280
+						debugger;
281
+						layer.msg(result.message);
282
+						initTable(id, keyWord,isPass,isSub);
283
+					}
284
+				})
285
+			});
286
+		}
287
+		//查看详情页
288
+		function goDetail(did){
289
+			//iframe窗
290
+		    layer.open({
291
+		      	type: 2,
292
+		      	title: '查看知识库详情',
293
+		      	shadeClose: true, //是否开启点击遮罩关闭
294
+		      	shade: 0.4, //遮罩
295
+		     	maxmin: true, //开启最大化最小化按钮
296
+		     	id: 'LAY_layuipro',//防止重复弹出
297
+		     	moveType: 1,//拖拽类型 默认的拖拽风格正如你所见到的,会有个过度的透明框。但是如果你不喜欢,你可以设定moveType: 1切换到传统的拖拽模式
298
+		     	moveOut: true, //拖拽到窗口外
299
+		     	//resize: true,//是否允许拉伸
300
+		      	area: ['80%', '80%'],
301
+		      	content: './cpns/zhiShiKuDetail.html?id='+ did +''
302
+		    });
303
+		}
304
+		function cleanSearch () {
305
+			$("#searCon").val('')
306
+			$("#keyidLabel").val('')
307
+			$("#reflectCategoryLabel").val('')
308
+			$("#searCon2").val('')
309
+			$("#keyidLabel2").val('')
310
+			$("#reflectCategoryLabel2").val('')
311
+			$("#isPass").val('')
312
+			$("#isSub").val('')
313
+		}
314
+//		多级下拉开始
315
+		$(".Cleans").click(function() {
316
+			$(".Cleans").hide()
317
+			$("#reflectCategoryLabel").val("");
318
+			$("#keyidLabel").val("");
319
+			$("#reflectCategoryLabel2").val("");
320
+			$("#keyidLabel2").val("");
321
+		});
322
+		$(".reflectCategory").focus(function() {
323
+			$(".Cleans").show()
324
+		});
325
+		$(".reflectCategory").blur(function() {
326
+			if ($("#reflectCategoryLabel").val()==='') {
327
+				$(".CleansReactionCategoryLabel").hide()
328
+			} else if($("#reflectCategoryLabel2").val()===''){
329
+				$(".CleansReactionCategoryLabel2").hide()
330
+			}
331
+		});
332
+		
333
+		function getReactionCategoryLabel(pid = 38) {
334
+			$.get(
335
+				huayi.config.callcenter_url + "KnowledgeClass/GetList", {
336
+					token: $.cookie("token"),
337
+				},
338
+				function(result) {
339
+					result = $.parseJSON(result);
340
+					var content = result.data
341
+					selectMultiple(getTreeData(content),"reflectCategoryLabel","#keyidLabel","CleansReactionCategoryLabel")
342
+					selectMultiple(getTreeData(content),"reflectCategoryLabel2","#keyidLabel2","CleansReactionCategoryLabel2")
343
+				}
344
+			);
345
+		}
346
+		function selectMultiple(data,ID,keyId,cleansClass) {
347
+			console.log(data)
348
+			layui.use("dropdown", function() {
349
+				var dropdown = layui.dropdown;
350
+				dropdown.render({
351
+					elem: "#"+ID, //可绑定在任意元素中,此处以上述按钮为例
352
+					data: data,
353
+					id: ID,
354
+					isclickparent: true,
355
+					//菜单被点击的事件
356
+					click: function(obj) {
357
+						$("#"+ID).val(obj.title);
358
+						$(keyId).val(obj.id);
359
+						$(cleansClass).show()
360
+					},
361
+				});
362
+			});
363
+		}
364
+		function getTreeData (data) {
365
+			var newData=[]
366
+			data.forEach(function (ele) {
367
+				newData.push({
368
+		            id: ele.id,
369
+		            title: ele.text,
370
+		            child: (ele.children && ele.children.length > 0) ? getTreeData(ele.children) : []
371
+		       })
372
+			})
373
+			return newData
374
+		}
375
+//		多级下拉结束
376
+	</script>
377
+
378
+</html>