liuzhihui лет назад: 2
Родитель
Сommit
8864dddacd
1 измененных файлов с 288 добавлено и 0 удалено
  1. 288 0
      newUI/zhiShiKu/addZhiShiKu.html

+ 288 - 0
newUI/zhiShiKu/addZhiShiKu.html

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