Browse Source

统一更改添加关键词的enter事件

luyanan 7 years ago
parent
commit
cdf64d71dd

+ 10 - 12
articalIssue.html

63
					</li>
63
					</li>
64
					<li class="form-item">
64
					<li class="form-item">
65
						<div class="aboutTit">关键词<span class="frmconmsg" id="keyPrompt"></span></div>
65
						<div class="aboutTit">关键词<span class="frmconmsg" id="keyPrompt"></span></div>
66
						<div style="position: relative;">
67
							<input type="text" class="frmtype frmcontype" placeholder="请输入关键词" id="KeyWord"/>
68
							<!--输入框中键入内容时按钮显示,添加内容出现在结果标签中时按钮隐藏-->
69
							<button class="frmcontype frmadd displayNone" id="addkeyWord">添加</button>
70
						
71
							<div class="form-drop keydrop displayNone">
72
								<ul id="keydropList">
73
									
74
								</ul>
75
							</div>
76
							<div class="form-result keyResult">
77
								<ul class="clearfix" id="keyWordlist">
66
						<div class="col-w-12" style="position: relative;">
67
							<input type="text" class="frmcontype oinput" placeholder="请输入关键词" data-pro="关键词不得超过15个字"  data-num="5" data-fontSizeN="15" id="KeyWord" />
68
							<button type="button" class="frmcontype btnModel frmaddG addButton">添加</button>
69
							<div class="form-drop keydrop">
70
								<ul>
78
									
71
									
79
								</ul>
72
								</ul>
80
							</div>
73
							</div>
81
						</div>
74
						</div>
75
						<div class="form-result keyResult" style="margin-top: -10px;">
76
							<ul class="ulspace editUlist clearfix" id="keyWordlist">
77
								<!--<li>dd<div class="closeThis"></div></li>-->
78
							</ul>
79
						</div>	
82
					</li>
80
					</li>
83
					<li>
81
					<li>
84
						<div class="aboutTit">文章内容<span class="frmconmsg"></span></div>
82
						<div class="aboutTit">文章内容<span class="frmconmsg"></span></div>

+ 12 - 13
articalModify.html

61
					</li>
61
					</li>
62
					<li class="form-item">
62
					<li class="form-item">
63
						<div class="aboutTit">关键词<span class="frmconmsg" id="keyPrompt"></span></div>
63
						<div class="aboutTit">关键词<span class="frmconmsg" id="keyPrompt"></span></div>
64
						<div style="position: relative;">
65
							<input type="text" class="frmtype frmcontype" value="" placeholder="请输入关键词" id="KeyWord"/>
66
							<!--输入框中键入内容时按钮显示,添加内容出现在结果标签中时按钮隐藏-->
67
							<button class="frmcontype frmadd displayNone" id="addkeyWord">添加</button>
64
						<div class="col-w-12" style="position: relative;">
65
							<input type="text" class="frmcontype oinput" placeholder="请输入关键词" data-pro="关键词不得超过15个字"  data-num="5" data-fontSizeN="15" id="KeyWord" />
66
							<button type="button" class="frmcontype btnModel frmaddG addButton">添加</button>
67
							<div class="form-drop keydrop">
68
								<ul>
69
									
70
								</ul>
71
							</div>
68
						</div>
72
						</div>
69
						<div class="form-drop keydrop displayNone">
70
							<ul id="keydropList">
71
								
73
						<div class="form-result keyResult" style="margin-top: -10px;">
74
							<ul class="ulspace editUlist clearfix" id="keyWordlist">
75
								<!--<li>dd<div class="closeThis"></div></li>-->
72
							</ul>
76
							</ul>
73
						</div>
74
						<div class="form-result keyResult">
75
							<ul class="clearfix" id="keyWordlist">
76
								
77
							</ul>
78
						</div>
77
						</div>	
79
					</li>
78
					</li>
80
					<li>
79
					<li>
81
						<div class="aboutTit">文章内容<span class="frmconmsg"></span></div>
80
						<div class="aboutTit">文章内容<span class="frmconmsg"></span></div>

+ 11 - 12
cmp-portal/articalIssue.html

59
					</li>
59
					</li>
60
					<li class="form-item">
60
					<li class="form-item">
61
						<div class="aboutTit">关键词<span class="frmconmsg" id="keyPrompt"></span></div>
61
						<div class="aboutTit">关键词<span class="frmconmsg" id="keyPrompt"></span></div>
62
						<div style="position: relative;">
63
							<input type="text" class="frmtype frmcontype" value="" placeholder="请输入关键词" id="KeyWord"/>
64
							<!--输入框中键入内容时按钮显示,添加内容出现在结果标签中时按钮隐藏-->
65
							<button class="frmcontype frmadd displayNone" id="addkeyWord">添加</button>
62
						<div class="col-w-12" style="position: relative;">
63
							<input type="text" class="frmcontype oinput" placeholder="请输入关键词" data-pro="关键词不得超过15个字"  data-num="5" data-fontSizeN="15" id="KeyWord" />
64
							<button type="button" class="frmcontype btnModel frmadd addButton">添加</button>
65
							<div class="form-drop keydrop">
66
								<ul>
67
									
68
								</ul>
69
							</div>
66
						</div>
70
						</div>
67
						<div class="form-drop keydrop displayNone">
68
							<ul id="keydropList">
69
								
70
							</ul>
71
						</div>
72
						<div class="form-result keyResult">
73
							<ul class="clearfix" id="keyWordlist">
74
								
71
						<div class="form-result keyResult" style="margin-top: -10px;">
72
							<ul class="ulspace editUlist clearfix" id="keyWordlist">
73
								<!--<li>dd<div class="closeThis"></div></li>-->
75
							</ul>
74
							</ul>
76
						</div>
75
						</div>
77
					</li>
76
					</li>

+ 11 - 12
cmp-portal/articalModify.html

61
					</li>
61
					</li>
62
					<li class="form-item">
62
					<li class="form-item">
63
						<div class="aboutTit">关键词<span class="frmconmsg" id="keyPrompt"></span></div>
63
						<div class="aboutTit">关键词<span class="frmconmsg" id="keyPrompt"></span></div>
64
						<div style="position: relative;">
65
							<input type="text" class="frmtype frmcontype" value="" placeholder="请输入关键词" id="KeyWord"/>
66
							<!--输入框中键入内容时按钮显示,添加内容出现在结果标签中时按钮隐藏-->
67
							<button class="frmcontype frmadd displayNone" id="addkeyWord">添加</button>
64
						<div class="col-w-12" style="position: relative;">
65
							<input type="text" class="frmcontype oinput" placeholder="请输入关键词" data-pro="关键词不得超过15个字"  data-num="5" data-fontSizeN="15" id="KeyWord" />
66
							<button type="button" class="frmcontype btnModel frmadd addButton">添加</button>
67
							<div class="form-drop keydrop">
68
								<ul>
69
									
70
								</ul>
71
							</div>
68
						</div>
72
						</div>
69
						<div class="form-drop keydrop displayNone">
70
							<ul id="keydropList">
71
								
72
							</ul>
73
						</div>
74
						<div class="form-result keyResult">
75
							<ul class="clearfix" id="keyWordlist">
76
								
73
						<div class="form-result keyResult" style="margin-top: -10px;">
74
							<ul class="ulspace editUlist clearfix" id="keyWordlist">
75
								<!--<li>dd<div class="closeThis"></div></li>-->
77
							</ul>
76
							</ul>
78
						</div>
77
						</div>
79
					</li>
78
					</li>

+ 2 - 2
cmp-portal/css/cmpindex.css

200
.cmpFrmList .msgContbox{height: 200px;}
200
.cmpFrmList .msgContbox{height: 200px;}
201
.cmpFrmList .msgContbox textarea{min-height:176px;}
201
.cmpFrmList .msgContbox textarea{min-height:176px;}
202
202
203
.ulspace>li{margin-top:16px;margin-right:30px;padding:6px 10px;border-width:1px;border-style:solid;border-color:#D6D6D6;}
203
.ulspace>li{margin-top:16px;margin-right:30px; padding: 6px 12px;border-width:1px;border-style:solid;border-color:#D6D6D6;}
204
.keyResult>ul.editUlist,.keyResult>ul.editUlistC{width: 98%;margin-right: -30px;margin-bottom:0}
204
.keyResult>ul.editUlist,.keyResult>ul.editUlistC{width: 98%;margin-right: -30px;margin-bottom:0}
205
.keyResult>ul.editUlistC>li,.keyResult>ul.editUlist>li{position:relative;padding:6px 12px;background: #fff;border-radius: 0;margin-bottom:0;}
205
.keyResult>ul.editUlistC>li,.keyResult>ul.editUlist>li{position:relative;padding:6px 12px;background: #fff;margin-bottom:0;}
206
.keyResult>ul.editUlist>li{float:left;}
206
.keyResult>ul.editUlist>li{float:left;}
207
.keyResult>ul.editUlistC>li{width:100%;margin-top:12px;}
207
.keyResult>ul.editUlistC>li{width:100%;margin-top:12px;}
208
.saveBtn .frmcontype{width: 120px;margin-right: 30px;margin-top: 20px;}
208
.saveBtn .frmcontype{width: 120px;margin-right: 30px;margin-top: 20px;}

+ 14 - 111
cmp-portal/js/articalIssue.js

28
		}
28
		}
29
	})
29
	})
30

30

31
	hotKey(".oinput");
31
	//校验关键字
32
	//校验关键字
32
	$("#KeyWord").on({
33
	$("#KeyWord").on({
33
		focus: function() {
34
		focus: function() {
35
		},
36
		},
36
		blur: function() {
37
		blur: function() {
37
			$("#keyPrompt").text("");
38
			$("#keyPrompt").text("");
38
		},
39
		keyup: function() {
40
			var ti=$(this).val();
41
			hbur=ti;
42
			if(ti==""){
43
				$(".frmadd").addClass("displayNone");
44
				$(".keydrop ul").html("");
45
				$(".keydrop").addClass("displayNone");
46
				return;
47
			}else{
48
				$(".frmadd").removeClass("displayNone");
49
			}
50
			if($(this).val().length > 15) {
51
				$(this).val($(this).val().substr(0, 15));
52
			}
53
			setTimeout(function(){
54
				if( ti===hbur && ti!== hburEnd) {
55
					KeyWordList(ti);
56
				}
57
				
58
			},500)
59
			
60
		}
39
		}
61
	})
40
	})
62

63
	//添加关键字
64
	$("#addkeyWord").on("click", function() {
65
		var keyWord = $("#KeyWord").val();
66
		keyWordlen(keyWord);
67
		$(".frmadd").addClass("displayNone");
68
		$(".keydrop ul").html("");
69
		$(".keydrop").addClass("displayNone");
70
	})
71

72
	//点击搜出的关键字添加
73
	$(".keydrop").on("click", "p", function() {
74
		var keyWord = $(this).text();
75
		$(".frmadd").addClass("displayNone");
76
		keyWordlen(keyWord)
77
		$(".keydrop ul").html("");
78
		$(".keydrop").addClass("displayNone");
79
	})
80

81
	//删除关键字
82
	$("#keyWordlist").on("click", ".closeThis", function() {
41
	$("#keyWordlist").on("click", ".closeThis", function() {
83
		$(this).parent().remove();
42
		$(this).parent().remove();
84
		var plength = $(".keyResult li p").length;
85
		if(plength < 5) {
86
			$("#KeyWord").removeClass("displayNone");
43
		var liNum = $("#keyWordlist").find("li").length;
44
		if(liNum < 5) {
45
			$("#keyWordlist").parents(".keyResult").siblings("div.col-w-12").show();
87
		}
46
		}
88
		$(".keydrop ul").html("");
89
		$(".keydrop").addClass("displayNone");
90
	})
47
	})
91

92
	//组合关键字
93
	function captiureSubInd(subIndu) {
94
		var industrys = $("#" + subIndu + "");
95
		var industryAll = "";
96
		if(industrys.size() > 0) {
97
			for(var i = 0; i < industrys.size(); i++) {
98
				industryAll += industrys[i].innerText;
99
				industryAll += ',';
100
			};
101
			industryAll = industryAll.substring(0, industryAll.length - 1);
102
		}
103
		return industryAll;
104
	}
105

106
	function keyWordlen(keyWord) {
107
		$("#KeyWord").val("");
108
		var plength = $(".keyResult li p");
109
		for(var i = 0; i < plength.length; i++) {
110
			if(plength[i].innerText == keyWord) {
111
				$("#keyPrompt").text("关键词已存在");
112
				return;
113
			}
114
		}
115
		if(plength.length > 3) {
116
			$("#KeyWord").addClass("displayNone");
117
			$("#keyWordlist").append("<li class='delkeylist'><p class='h2Font'>" + keyWord + "</p><div class='closeThis'></div></li>");
118
		} else {
119
			$("#keyWordlist").append("<li class='delkeylist'><p class='h2Font'>" + keyWord + "</p><div class='closeThis'></div></li>");
120
		}
121
	}
122
	function KeyWordList(seValue) {
123
		hburEnd=seValue;
124
		$.ajax({
125
			"url": "/ajax/dataDict/qaHotKey",
126
			"type": "get",
127
			"data": {
128
				"key": $("#KeyWord").val()
129
			},
130
			"success": function(data) {
131
				console.log(data);
132
				if(data.success) {
133
					if(hburEnd == seValue){
134
						var itemlist = '';
135
						$("#keydropList").html("");
136
						for(var i = 0; i < Math.min(data.data.length,5); i++) {
137
							var itemlist = '<li><p class="h2Font"></p></li>';
138
							$itemlist = $(itemlist);
139
							$("#keydropList").append($itemlist);
140
							$itemlist.find(".h2Font").text(data.data[i].caption);
141
						}
142
						$(".keydrop").removeClass("displayNone");
143
					}
144
				} else {
145
					//$(".keydrop").addClass("displayNone");
146
					//$(".keydrop ul").html("");
147
				}
148
			},
149
			"error": function() {
150
				$.MsgBox.Alert('提示', '链接服务器超时')
151
			}
152
		});
153
	}
154
	//校验右侧专家和资源
48
	//校验右侧专家和资源
155
	$("#checkZj").on("focus", function() {
49
	$("#checkZj").on("focus", function() {
156
		$(this).prev().find("span").text("最多选择5位专家");
50
		$(this).prev().find("span").text("最多选择5位专家");
480
	}
374
	}
481
	/*获取数据*/
375
	/*获取数据*/
482
	function getdata(publishTime) {
376
	function getdata(publishTime) {
377
		var industrys = $("#keyWordlist li");
378
		var industryAll = "";
379
		if(industrys.size() > 0) {
380
			for(var i = 0; i < industrys.size(); i++) {
381
				industryAll += industrys[i].innerText;
382
				industryAll += ',';
383
			};
384
			industryAll = industryAll.substring(0, industryAll.length - 1);
385
		}
483
		expertli(); //相关专家
386
		expertli(); //相关专家
484
		resourcesli(); //相关咨询
387
		resourcesli(); //相关咨询
485
		$data.orgId = orgId;
388
		$data.orgId = orgId;
487
			$data.orgs = getAttrId.call($("#companys li"));
390
			$data.orgs = getAttrId.call($("#companys li"));
488
		}
391
		}
489
		$data.articleTitle = $("#newstitle").val();
392
		$data.articleTitle = $("#newstitle").val();
490
		$data.subject = captiureSubInd("keyWordlist .delkeylist");
393
		$data.subject = industryAll;
491
		$data.articleImg = $("#uploader").attr("data-id");
394
		$data.articleImg = $("#uploader").attr("data-id");
492
		$data.articleContent = ue.getContent();
395
		$data.articleContent = ue.getContent();
493
		$data.professors = experarray;
396
		$data.professors = experarray;

+ 15 - 112
cmp-portal/js/articalModify.js

33
		}
33
		}
34
	})
34
	})
35

35

36
	hotKey(".oinput");
36
	//校验关键字
37
	//校验关键字
37
	$("#KeyWord").on({
38
	$("#KeyWord").on({
38
		focus: function() {
39
		focus: function() {
40
		},
41
		},
41
		blur: function() {
42
		blur: function() {
42
			$("#keyPrompt").text("");
43
			$("#keyPrompt").text("");
43
		},
44
		keyup: function() {
45
			var ti=$(this).val();
46
			hbur=ti;
47
			if(ti==""){
48
				$(".frmadd").addClass("displayNone");
49
				$(".keydrop ul").html("");
50
				$(".keydrop").addClass("displayNone");
51
				return;
52
			}else{
53
				$(".frmadd").removeClass("displayNone");
54
			}
55
			if($(this).val().length > 15) {
56
				$(this).val($(this).val().substr(0, 15));
57
			}
58
			setTimeout(function(){
59
				if( ti===hbur && ti!== hburEnd) {
60
					KeyWordList(ti);
61
				}
62
				
63
			},500)
64
			
65
		}
44
		}
66
	})
45
	})
67
	//添加关键字
68
	$("#addkeyWord").on("click", function() {
69
		var keyWord = $("#KeyWord").val();
70
		keyWordlen(keyWord);
71
		$(".frmadd").addClass("displayNone");
72
		$(".keydrop ul").html("");
73
		$(".keydrop").addClass("displayNone");
74
	})
75

76
	//点击搜出的关键字添加
77
	$(".keydrop").on("click", "p", function() {
78
		var keyWord = $(this).text();
79
		$(".frmadd").addClass("displayNone");
80
		keyWordlen(keyWord)
81
		$(".keydrop ul").html("");
82
		$(".keydrop").addClass("displayNone");
83
	})
84

85
	//删除关键字
86
	$("#keyWordlist").on("click", ".closeThis", function() {
46
	$("#keyWordlist").on("click", ".closeThis", function() {
87
		$(this).parent().remove();
47
		$(this).parent().remove();
88
		var plength = $(".keyResult li p").length;
89
		if(plength < 5) {
90
			$("#KeyWord").removeClass("displayNone");
48
		var liNum = $("#keyWordlist").find("li").length;
49
		if(liNum < 5) {
50
			$("#keyWordlist").parents(".keyResult").siblings("div.col-w-12").show();
91
		}
51
		}
92
		$(".keydrop ul").html("");
93
		$(".keydrop").addClass("displayNone");
94
	})
52
	})
95

96
	//组合关键字
97
	function captiureSubInd(subIndu) {
98
		var industrys = $("#" + subIndu + "");
99
		var industryAll = "";
100
		if(industrys.size() > 0) {
101
			for(var i = 0; i < industrys.size(); i++) {
102
				industryAll += industrys[i].innerText;
103
				industryAll += ',';
104
			};
105
			industryAll = industryAll.substring(0, industryAll.length - 1);
106
		}
107
		return industryAll;
108
	}
109

110
	function keyWordlen(keyWord) {
111
		$("#KeyWord").val("");
112
		var plength = $(".keyResult li p");
113
		for(var i = 0; i < plength.length; i++) {
114
			if(plength[i].innerText == keyWord) {
115
				$("#keyPrompt").text("关键词已存在");
116
				return;
117
			}
118
		}
119
		if(plength.length > 3) {
120
			$("#KeyWord").addClass("displayNone");
121
			$("#keyWordlist").append("<li class='delkeylist'><p class='h2Font'>" + keyWord + "</p><div class='closeThis'></div></li>");
122
		} else {
123
			$("#keyWordlist").append("<li class='delkeylist'><p class='h2Font'>" + keyWord + "</p><div class='closeThis'></div></li>");
124
		}
125
	}
126
	
127
	function KeyWordList(seValue) {
128
		hburEnd=seValue;
129
		$.ajax({
130
			"url": "/ajax/dataDict/qaHotKey",
131
			"type": "get",
132
			"data": {
133
				"key": $("#KeyWord").val()
134
			},
135
			"success": function(data) {
136
				console.log(data);
137
				if(data.success && data.data != "") {
138
					if(hburEnd == seValue){
139
						var itemlist = '';
140
						$("#keydropList").html("");
141
						for(var i = 0; i < Math.min(data.data.length,5); i++) {
142
							var itemlist = '<li><p class="h2Font"></p></li>';
143
							$itemlist = $(itemlist);
144
							$("#keydropList").append($itemlist);
145
							$itemlist.find(".h2Font").text(data.data[i].caption);
146
						}
147
						$(".keydrop").removeClass("displayNone");
148
					} else {
149
						$(".keydrop").addClass("displayNone");
150
						$(".keydrop ul").html("");
151
					}
152
				}	
153
			},
154
			"error": function() {
155
				$.MsgBox.Alert('提示', '链接服务器超时')
156
			}
157
		});
158
	}
159
	
53
	
160
	//拆解关键字
54
	//拆解关键字
161
	function industryShow(data,industryList){
55
	function industryShow(data,industryList){
173
				};
67
				};
174
			}
68
			}
175
			if(subs.length>4){
69
			if(subs.length>4){
176
				$("#KeyWord").addClass("displayNone");
70
				$("#KeyWord").parent().addClass("displayNone");
177
			}
71
			}
178
		}			
72
		}			
179
	}
73
	}
654
	}
548
	}
655
	/*获取数据*/
549
	/*获取数据*/
656
	function getdata(publishTime) {
550
	function getdata(publishTime) {
551
		var industrys = $("#keyWordlist li");
552
		var industryAll = "";
553
		if(industrys.size() > 0) {
554
			for(var i = 0; i < industrys.size(); i++) {
555
				industryAll += industrys[i].innerText;
556
				industryAll += ',';
557
			};
558
			industryAll = industryAll.substring(0, industryAll.length - 1);
559
		}
657
		expertli(); //相关专家
560
		expertli(); //相关专家
658
		resourcesli(); //相关咨询
561
		resourcesli(); //相关咨询
659
		$data.orgId = orgId;
562
		$data.orgId = orgId;
662
			$data.orgs = getAttrId.call($("#companys li"));
565
			$data.orgs = getAttrId.call($("#companys li"));
663
		}
566
		}
664
		$data.articleTitle = $("#newstitle").val();
567
		$data.articleTitle = $("#newstitle").val();
665
		$data.subject = captiureSubInd("keyWordlist .delkeylist");
568
		$data.subject = industryAll;
666
		$data.articleImg = $("#uploader").attr("data-id");
569
		$data.articleImg = $("#uploader").attr("data-id");
667
		$data.articleContent = ue.getContent();
570
		$data.articleContent = ue.getContent();
668
		$data.professors = experarray;
571
		$data.professors = experarray;

+ 31 - 0
cmp-portal/js/public/common.js

328
		$(this).parent("ul").html("")
328
		$(this).parent("ul").html("")
329
	})
329
	})
330
	/*添加*/
330
	/*添加*/
331
	$("button:contains('添加')").siblings("input").keypress(function(){
332
		var e = event || window.event;
333
		if(e.keyCode == 13) {
334
			var oValue = $(this).val().trim();
335
			var oJudge = $(this).parent().siblings().find("ul.ulspace li");
336
			var addContent = $(this).attr("data-pro");
337
			var addNum = $(this).attr("data-num");
338
			var addfontSizeNum = $(this).attr("data-fontSizeN");
339
			if(!oValue) {
340
				$.MsgBox.Alert('提示', '请先填写内容');
341
				return;
342
			}
343
			if(oValue.length > addfontSizeNum) {
344
				$.MsgBox.Alert('提示', addContent);
345
				return;
346
			}
347
			for(var i = 0; i < oJudge.length; i++) {
348
				if(oValue == oJudge[i].innerText) {
349
					$.MsgBox.Alert('提示', '添加内容不能重复');
350
					return;
351
				}
352
			}
353
			$(this).parent().siblings().find("ul.ulspace").append('<li>' + oValue + '<div class="closeThis"></div></li>');
354
			$(this).siblings(".addButton").hide();
355
			$(this).val("");
356
			if(oJudge.length == addNum - 1) {
357
				$(this).val("").parents(".col-w-12").hide();
358
			}
359
			$(this).siblings(".keydrop").find("ul").html("");
360
		}
361
	})
331
	$("button:contains('添加')").click(function() {
362
	$("button:contains('添加')").click(function() {
332
		var oValue = $(this).siblings("input").val().trim();
363
		var oValue = $(this).siblings("input").val().trim();
333
		var oJudge = $(this).parent().siblings().find("ul.ulspace li");
364
		var oJudge = $(this).parent().siblings().find("ul.ulspace li");

+ 26 - 111
cmp-portal/js/resourceIssue.js

54
			var oSub = $da.subject.split(",");
54
			var oSub = $da.subject.split(",");
55
			var oSt = "";
55
			var oSt = "";
56
			for(var i = 0; i < oSub.length; i++) {
56
			for(var i = 0; i < oSub.length; i++) {
57
				oSt += '<li><p class="h2Font">' + oSub[i] + '</p><div class="closeThis"></div></li>'
57
				oSt += '<li>' + oSub[i] + '<div class="closeThis"></div></li>'
58
			}
59
			$("#keyWordlist").html(oSt);
60
			if(oSub.length>4){
61
				$("#KeyWord").parent().addClass("displayNone");
58
			}
62
			}
59
			$("#keywordList").html(oSt);
60
		} else {
63
		} else {
61
			$("#keywordList").html("");
64
			$("#keyWordlist").html("");
62
		}
65
		}
63
		if($da.descp) { //编辑器
66
		if($da.descp) { //编辑器
64
			ue.ready(function() {
67
			ue.ready(function() {
209
			}
212
			}
210
		}
213
		}
211
	})
214
	})
212
	/*关键词*/
213
	$("#keywordName").bind({
215
	hotKey(".oinput");
216
	//校验关键字
217
	$("#KeyWord").on({
214
		focus: function() {
218
		focus: function() {
215
			$("#keywordPrompt").show().text('最多可添加5个关键词,每个关键词15字以内');
219
			$("#keyPrompt").text("最多可添加5个关键词,每个关键词15字以内");
216
		},
220
		},
217
		blur: function() {
221
		blur: function() {
218
			$("#keywordPrompt").text('');
219
		},
220
		keyup: function() {
221
			var ti=$(this).val();
222
			hbur=ti;
223
			var lNum=$.trim($(this).val()).length;
224
			console.log(lNum);
225
			if(lNum > 15) {
226
				$(this).val($(this).val().substr(0, 15));
227
			} else if(0 < lNum&& lNum < 15) {
228
					$("#addKeyword").show();
229
					setTimeout(function(){
230
						if( ti===hbur && ti!== hburEnd) {
231
							var tt=ti;
232
							hburEnd=tt;
233
						$.ajax({
234
						"url": "/ajax/dataDict/qaHotKey",
235
						"type": "GET",
236
						"success": function(data) {
237
							console.log(data);
238
							if(data.success) {
239
								if(hburEnd == tt){
240
									if(data.data.length==0) {
241
										$("#keyList").addClass("displayNone");
242
										$("#keyList ul").html("");
243
									}else{
244
										$("#keyList").removeClass("displayNone");
245
										var oSr="";
246
										for(var i=0;i<Math.min(data.data.length,5);i++) {
247
											oSr+='<li><p class="h2Font">'+data.data[i].caption+'</p></li>'
248
										}
249
										$("#keyList ul").html(oSr);
250
									}
251
								}	
252
							}else {
253
								$("#keyList ul").html("");
254
							}
255
						},
256
						"data": {
257
							"key":$('#keywordName').val()
258
						},
259
						dataType: "json",
260
						'error':function() {
261
							$.MsgBox.Alert('提示', '服务器连接超时!');
262
						}
263
				});
264
				}
265
				},500)
266
			}else if(lNum == 0){
267
				 $("#addKeyword").hide();
268
				 $("#keyList ul").html("");
269
			}
222
			$("#keyPrompt").text("");
270
		}
223
		}
271
	});
272
	$("#keyList ul").on("click","li",function(){
273
		 keyWord($(this).find("p").text());
274
		 $("#keyList ul").html("");
275
		 $("#keyList").addClass("displayNone");
276
		  $("#addKeyword").hide();
277
	})
224
	})
278
	/*添加关键词*/
279
	$("#addKeyword").click(function() {
280
		 keyWord($("#keywordName").val());
281
	})
282
	function keyWord(atl) {
283
		var oKeywordName =$.trim(atl);
284
		var keywordListLength = $("#keywordList").find("li");
285
		if(oKeywordName.length == 0) {
286
			$("#keywordPrompt").text('关键词输入不能为空');
287
			return;
288
		}
289
		for(var i = 0; i < keywordListLength.length; i++) {
290
			if(oKeywordName == keywordListLength.find("p").eq(i).text()) {
291
				$("#keywordPrompt").text('该关键词已存在');
292
				return;
293
			}
294
		}
295
		$("#keyList ul").html("");
296
		 $("#addKeyword").hide();
297
		var oStr = '<li><p class="h2Font">' + oKeywordName + '</p><div class="closeThis"></div></li>'
298
		$("#keywordList").append(oStr);
299
		$("#keywordName").val("");
300
		if((keywordListLength.length + 1) == 5) {
301
			$("#keywordHide").hide();
302
			$("#keyList").css("border-top","none");
303
		}
304
	}
305
	/*删除关键词*/
306
	$("#keywordList").on("click", ".closeThis", function() {
225
	$("#keyWordlist").on("click", ".closeThis", function() {
307
		$(this).parent().remove();
226
		$(this).parent().remove();
308
		var keywordListLength = $("#keywordList").find("li");
309
		if(keywordListLength.length < 5) {
310
			$("#keywordHide").show();
311
			$("#keyList").css("border-top","1px solid #E5E5E5");	
227
		var liNum = $("#keyWordlist").find("li").length;
228
		if(liNum < 5) {
229
			$("#keyWordlist").parents(".keyResult").siblings("div.col-w-12").show();
312
		}
230
		}
313
	});
231
	})
314
	/*应用用途*/
232
	/*应用用途*/
315
	$("#application").bind({
233
	$("#application").bind({
316
		focus: function() {
234
		focus: function() {
426
	}
344
	}
427
	/*发布函数*/
345
	/*发布函数*/
428
	function ajsPost(pa1, pa2) {
346
	function ajsPost(pa1, pa2) {
347
		var industrys = $("#keyWordlist li");
348
		var industryAll = "";
349
		if(industrys.size() > 0) {
350
			for(var i = 0; i < industrys.size(); i++) {
351
				industryAll += industrys[i].innerText;
352
				industryAll += ',';
353
			};
354
			industryAll = industryAll.substring(0, industryAll.length - 1);
355
		}
429
		$(".operateBlock").find("li").addClass("disableLi");
356
		$(".operateBlock").find("li").addClass("disableLi");
430
		var oUrl = "/ajax/resource/orgSave";
357
		var oUrl = "/ajax/resource/orgSave";
431
		if(pa1) {
358
		if(pa1) {
438
		$data.orgId = orgId;
365
		$data.orgId = orgId;
439
		$data.resourceName = $("#resourceName").val(); //资源名字
366
		$data.resourceName = $("#resourceName").val(); //资源名字
440
		$data.cooperationNotes = $("#remarkContent").val(); //合作备注
367
		$data.cooperationNotes = $("#remarkContent").val(); //合作备注
441
		$data.subject = captiureSubInd("keywordList p");
368
		$data.subject = industryAll;
442
		console.log($data.subject);
369
		console.log($data.subject);
443
		$data.supportedServices = $("#application").val();
370
		$data.supportedServices = $("#application").val();
444
		$data.spec = $("#modelNumber").val();
371
		$data.spec = $("#modelNumber").val();
490
		});
417
		});
491
	}
418
	}
492

419

493
	function captiureSubInd(subIndu) {
494
		var industrys = $("#" + subIndu + "");
495
		var industryAll = "";
496
		if(industrys.size() > 0) {
497
			for(var i = 0; i < industrys.size(); i++) {
498
				industryAll += industrys[i].innerText;
499
				industryAll += ',';
500
			};
501
			industryAll = industryAll.substring(0, industryAll.length - 1);
502
		}
503
		return industryAll;
504
	}
505
	function UnauthorizedUser() {
420
	function UnauthorizedUser() {
506
		$.ajax({
421
		$.ajax({
507
			url: "/ajax/professor/qaOrgAuth",
422
			url: "/ajax/professor/qaOrgAuth",

+ 12 - 35
cmp-portal/resourceIssue.html

48
						<input type="text" class="frmtype frmcontype" id="resourceName" value="" placeholder="请输入资源名称" />
48
						<input type="text" class="frmtype frmcontype" id="resourceName" value="" placeholder="请输入资源名称" />
49
					</li>
49
					</li>
50
					<li class="form-item">
50
					<li class="form-item">
51
						<div class="aboutTit">关键词<span class="frmconmsg" id="keywordPrompt" style="display:none;">最多可添加5个关键词、每个关键词最多15个字</span></div>
52
						<div style="position: relative;" id="keywordHide">
53
							<input type="text" class="frmtype frmcontype" id="keywordName" value="" placeholder="请输入关键词" />
54
							<!--输入框中键入内容时按钮显示,添加内容出现在结果标签中时按钮隐藏-->
55
							<button class="frmcontype frmadd displayNone" id="addKeyword">添加</button>
51
						<div class="aboutTit">关键词<span class="frmconmsg" id="keyPrompt"></span></div>
52
						<div class="col-w-12" style="position: relative;">
53
							<input type="text" class="frmcontype oinput" placeholder="请输入关键词" data-pro="关键词不得超过15个字"  data-num="5" data-fontSizeN="15" id="KeyWord" />
54
							<button type="button" class="frmcontype btnModel frmaddG addButton">添加</button>
55
							<div class="form-drop keydrop">
56
								<ul>
57
									
58
								</ul>
59
							</div>
56
						</div>
60
						</div>
57
						<div class="form-drop keydrop displayNone" id="keyList">
58
							<ul>
59
								<!--<li>
60
									<p class="h2Font">金属材料工程与腐蚀</p>
61
								</li>-->
62
								
63
							</ul>
64
						</div>
65
						<div class="form-result keyResult">
66
							<ul class="clearfix" id="keywordList">
67
								<!--<li>
68
									<p class="h2Font">金属材料工程与腐蚀蚀</p>
69
									<div class="closeThis"></div>
70
								</li>
71
								<li>
72
									<p class="h2Font">金属材料工程与腐蚀蚀</p>
73
									<div class="closeThis"></div>
74
								</li>
75
								<li>
76
									<p class="h2Font">金属材料工程与腐蚀蚀</p>
77
									<div class="closeThis"></div>
78
								</li>
79
								<li>
80
									<p class="h2Font">金属材料工程与腐蚀蚀</p>
81
									<div class="closeThis"></div>
82
								</li>
83
								<li>
84
									<p class="h2Font">金属材料工程与腐蚀蚀</p>
85
									<div class="closeThis"></div>
86
								</li>-->
61
						<div class="form-result keyResult" style="margin-top: -10px;">
62
							<ul class="ulspace editUlist clearfix" id="keyWordlist">
63
								<!--<li>dd<div class="closeThis"></div></li>-->
87
							</ul>
64
							</ul>
88
						</div>
65
						</div>
89
					</li>
66
					</li>

+ 14 - 113
js/articalIssue.js

25
		}
25
		}
26
	})
26
	})
27

27

28
	hotKey(".oinput");
28
	//校验关键字
29
	//校验关键字
29
	$("#KeyWord").on({
30
	$("#KeyWord").on({
30
		focus: function() {
31
		focus: function() {
32
		},
33
		},
33
		blur: function() {
34
		blur: function() {
34
			$("#keyPrompt").text("");
35
			$("#keyPrompt").text("");
35
		},
36
		keyup: function() {
37
			var ti=$(this).val();
38
			hbur=ti;
39
			if(ti==""){
40
				$(".frmadd").addClass("displayNone");
41
				$(".keydrop ul").html("");
42
				$(".keydrop").addClass("displayNone");
43
				return;
44
			}else{
45
				$(".frmadd").removeClass("displayNone");
46
			}
47
			if($(this).val().length > 15) {
48
				$(this).val($(this).val().substr(0, 15));
49
			}
50
			setTimeout(function(){
51
				if( ti===hbur && ti!== hburEnd) {
52
					KeyWordList(ti);
53
				}
54
				
55
			},500)
56
			
57
		}
36
		}
58
	})
37
	})
59

60
	//添加关键字
61
	$("#addkeyWord").on("click", function() {
62
		var keyWord = $("#KeyWord").val();
63
		keyWordlen(keyWord);
64
		$(".frmadd").addClass("displayNone");
65
		$(".keydrop ul").html("");
66
		$(".keydrop").addClass("displayNone");
67
	})
68

69
	//点击搜出的关键字添加
70
	$(".keydrop").on("click", "p", function() {
71
		var keyWord = $(this).text();
72
		$(".frmadd").addClass("displayNone");
73
		keyWordlen(keyWord)
74
		$(".keydrop ul").html("");
75
		$(".keydrop").addClass("displayNone");
76
	})
77

78
	//删除关键字
79
	$("#keyWordlist").on("click", ".closeThis", function() {
38
	$("#keyWordlist").on("click", ".closeThis", function() {
80
		$(this).parent().remove();
39
		$(this).parent().remove();
81
		var plength = $(".keyResult li p").length;
82
		if(plength < 5) {
83
			$("#KeyWord").removeClass("displayNone");
40
		var liNum = $("#keyWordlist").find("li").length;
41
		if(liNum < 5) {
42
			$("#keyWordlist").parents(".keyResult").siblings("div.col-w-12").show();
84
		}
43
		}
85
		$(".keydrop ul").html("");
86
		$(".keydrop").addClass("displayNone");
87
	})
44
	})
88

45

89
	//组合关键字
90
	function captiureSubInd(subIndu) {
91
		var industrys = $("#" + subIndu + "");
92
		var industryAll = "";
93
		if(industrys.size() > 0) {
94
			for(var i = 0; i < industrys.size(); i++) {
95
				industryAll += industrys[i].innerText;
96
				industryAll += ',';
97
			};
98
			industryAll = industryAll.substring(0, industryAll.length - 1);
99
		}
100
		return industryAll;
101
	}
102

103
	function keyWordlen(keyWord) {
104
		$("#KeyWord").val("");
105
		var plength = $(".keyResult li p");
106
		for(var i = 0; i < plength.length; i++) {
107
			if(plength[i].innerText == keyWord) {
108
				$("#keyPrompt").text("关键词已存在");
109
				return;
110
			}
111
		}
112
		if(plength.length > 3) {
113
			$("#KeyWord").addClass("displayNone");
114
			$("#keyWordlist").append("<li class='delkeylist'><p class='h2Font'>" + keyWord + "</p><div class='closeThis'></div></li>");
115
		} else {
116
			$("#keyWordlist").append("<li class='delkeylist'><p class='h2Font'>" + keyWord + "</p><div class='closeThis'></div></li>");
117
		}
118
	}
119
	
120
	function KeyWordList(seValue) {
121
		hburEnd=seValue;
122
		$.ajax({
123
			"url": "/ajax/dataDict/qaHotKey",
124
			"type": "get",
125
			"data": {
126
				"key": $("#KeyWord").val()
127
			},
128
			"success": function(data) {
129
				console.log(data);
130
				if(data.success) {
131
					if(hburEnd == seValue){
132
						var itemlist = '';
133
						$("#keydropList").html("");
134
						for(var i = 0; i < Math.min(data.data.length,5); i++) {
135
							var itemlist = '<li><p class="h2Font"></p></li>';
136
							$itemlist = $(itemlist);
137
							$("#keydropList").append($itemlist);
138
							$itemlist.find(".h2Font").text(data.data[i].caption);
139
						}
140
						$(".keydrop").removeClass("displayNone");
141
					}
142
				} else {
143
					//$(".keydrop").addClass("displayNone");
144
					//$(".keydrop ul").html("");
145
				}
146
			},
147
			"error": function() {
148
				$.MsgBox.Alert('提示', '链接服务器超时')
149
			}
150
		});
151
	}
152

153

154
	//校验右侧专家和资源
46
	//校验右侧专家和资源
155
	$("#checkZj").on("focus", function() {
47
	$("#checkZj").on("focus", function() {
156
		$(this).prev().find("span").text("最多选择5位专家");
48
		$(this).prev().find("span").text("最多选择5位专家");
445

337

446
	/*获取数据*/
338
	/*获取数据*/
447
	function getdata(publishTime) {
339
	function getdata(publishTime) {
340
		var industrys = $("#keyWordlist li");
341
		var industryAll = "";
342
		if(industrys.size() > 0) {
343
			for(var i = 0; i < industrys.size(); i++) {
344
				industryAll += industrys[i].innerText;
345
				industryAll += ',';
346
			};
347
			industryAll = industryAll.substring(0, industryAll.length - 1);
348
		}
448
		expertli(); //相关专家
349
		expertli(); //相关专家
449
		resourcesli(); //相关咨询
350
		resourcesli(); //相关咨询
450
		$data.professorId = userid;
351
		$data.professorId = userid;
451
		$data.articleTitle = $("#newstitle").val();
352
		$data.articleTitle = $("#newstitle").val();
452
		$data.subject = captiureSubInd("keyWordlist .delkeylist");
353
		$data.subject = industryAll;
453
		$data.articleImg = $("#uploader").attr("data-id");
354
		$data.articleImg = $("#uploader").attr("data-id");
454
		$data.articleContent = ue.getContent();
355
		$data.articleContent = ue.getContent();
455
		$data.professors = experarray;
356
		$data.professors = experarray;

+ 17 - 114
js/articalModify.js

29
		}
29
		}
30
	})
30
	})
31

31

32
	hotKey(".oinput");
32
	//校验关键字
33
	//校验关键字
33
	$("#KeyWord").on({
34
	$("#KeyWord").on({
34
		focus: function() {
35
		focus: function() {
36
		},
37
		},
37
		blur: function() {
38
		blur: function() {
38
			$("#keyPrompt").text("");
39
			$("#keyPrompt").text("");
39
		},
40
		keyup: function() {
41
			var ti=$(this).val();
42
			hbur=ti;
43
			if($(this).val()==""){
44
				$(".frmadd").addClass("displayNone");
45
				$(".keydrop ul").html("");
46
				$(".keydrop").addClass("displayNone");
47
				return;
48
			}else{
49
				$(".frmadd").removeClass("displayNone");
50
			}
51
			if($(this).val().length > 15) {
52
				$(this).val($(this).val().substr(0, 15));
53
			}
54
			setTimeout(function(){
55
				if( ti===hbur && ti!== hburEnd) {
56
					KeyWordList(ti);
57
				}
58
				
59
			},500)
60
		}
40
		}
61
	})
41
	})
62

63
	//添加关键字
64
	$("#addkeyWord").on("click", function() {
65
		var keyWord = $("#KeyWord").val();
66
		keyWordlen(keyWord);
67
		$(".frmadd").addClass("displayNone");
68
		$(".keydrop ul").html("");
69
		$(".keydrop").addClass("displayNone");
70
	})
71

72
	//点击搜出的关键字添加
73
	$(".keydrop").on("click", "p", function() {
74
		var keyWord = $(this).text();
75
		$(".frmadd").addClass("displayNone");
76
		keyWordlen(keyWord)
77
		$(".keydrop ul").html("");
78
		$(".keydrop").addClass("displayNone");
79
	})
80

81
	//删除关键字
82
	$("#keyWordlist").on("click", ".closeThis", function() {
42
	$("#keyWordlist").on("click", ".closeThis", function() {
83
		$(this).parent().remove();
43
		$(this).parent().remove();
84
		var plength = $(".keyResult li p").length;
85
		if(plength < 5) {
86
			$("#KeyWord").removeClass("displayNone");
87
		}
88
		$(".keydrop ul").html("");
89
		$(".keydrop").addClass("displayNone");
90
	})
91

92
	//组合关键字
93
	function captiureSubInd(subIndu) {
94
		var industrys = $("#" + subIndu + "");
95
		var industryAll = "";
96
		if(industrys.size() > 0) {
97
			for(var i = 0; i < industrys.size(); i++) {
98
				industryAll += industrys[i].innerText;
99
				industryAll += ',';
100
			};
101
			industryAll = industryAll.substring(0, industryAll.length - 1);
102
		}
103
		return industryAll;
104
	}
105

106
	function keyWordlen(keyWord) {
107
		$("#KeyWord").val("");
108
		var plength = $(".keyResult li p");
109
		for(var i = 0; i < plength.length; i++) {
110
			if(plength[i].innerText == keyWord) {
111
				$("#keyPrompt").text("关键词已存在");
112
				return;
113
			}
44
		var liNum = $("#keyWordlist").find("li").length;
45
		if(liNum < 5) {
46
			$("#keyWordlist").parents(".keyResult").siblings("div.col-w-12").show();
114
		}
47
		}
115
		if(plength.length > 3) {
116
			$("#KeyWord").addClass("displayNone");
117
			$("#keyWordlist").append("<li class='delkeylist'><p class='h2Font'>" + keyWord + "</p><div class='closeThis'></div></li>");
118
		} else {
119
			$("#keyWordlist").append("<li class='delkeylist'><p class='h2Font'>" + keyWord + "</p><div class='closeThis'></div></li>");
120
		}
121
	}
122
	function KeyWordList(seValue) {
123
		hburEnd=seValue;
124
		$.ajax({
125
			"url": "/ajax/dataDict/qaHotKey",
126
			"type": "get",
127
			"data": {
128
				"key": $("#KeyWord").val()
129
			},
130
			"success": function(data) {
131
				console.log(data);
132
				if(data.success) {
133
					if(hburEnd == seValue){
134
						var itemlist = '';
135
						$("#keydropList").html("");
136
						for(var i = 0; i < Math.min(data.data.length,5); i++) {
137
							var itemlist = '<li><p class="h2Font"></p></li>';
138
							$itemlist = $(itemlist);
139
							$("#keydropList").append($itemlist);
140
							$itemlist.find(".h2Font").text(data.data[i].caption);
141
						}
142
						$(".keydrop").removeClass("displayNone");
143
					}
144
				} else {
145
					//$(".keydrop").addClass("displayNone");
146
					//$(".keydrop ul").html("");
147
				}
148
			},
149
			"error": function() {
150
				$.MsgBox.Alert('提示', '链接服务器超时')
151
			}
152
		});
153
	}
154
	
48
	})	
155
	//拆解关键字
49
	//拆解关键字
156
	function industryShow(data,industryList){
50
	function industryShow(data,industryList){
157
		if(data != undefined && data.length != 0 ){
51
		if(data != undefined && data.length != 0 ){
164
			if(subs.length>0){
58
			if(subs.length>0){
165
				for (var i = 0; i < subs.length; i++) 
59
				for (var i = 0; i < subs.length; i++) 
166
				{
60
				{
167
					$("#"+industryList+"").append('<li class="delkeylist"><p class="h2Font">'+ subs[i] +'</p><div class="closeThis"></div></li>');																
61
					$("#"+industryList+"").append('<li>'+ subs[i] +'<div class="closeThis"></div></li>');																
168
				};
62
				};
169
			}
63
			}
170
			if(subs.length>4){
64
			if(subs.length>4){
171
				$("#KeyWord").addClass("displayNone");
65
				$("#KeyWord").parent().addClass("displayNone");
172
			}
66
			}
173
		}			
67
		}			
174
	}
68
	}
613
	
507
	
614
	/*获取数据*/
508
	/*获取数据*/
615
	function getdata(publishTime,settime) {
509
	function getdata(publishTime,settime) {
510
		var industrys = $("#keyWordlist li");
511
		var industryAll = "";
512
		if(industrys.size() > 0) {
513
			for(var i = 0; i < industrys.size(); i++) {
514
				industryAll += industrys[i].innerText;
515
				industryAll += ',';
516
			};
517
			industryAll = industryAll.substring(0, industryAll.length - 1);
518
		}
616
		expertli();//相关专家
519
		expertli();//相关专家
617
		resourcesli();//相关咨询
520
		resourcesli();//相关咨询
618
	    $data.articleId = articleId;
521
	    $data.articleId = articleId;
619
		$data.professorId = userid;
522
		$data.professorId = userid;
620
		$data.articleTitle = $("#newstitle").val();
523
		$data.articleTitle = $("#newstitle").val();
621
		$data.subject = captiureSubInd("keyWordlist .delkeylist");
524
		$data.subject = industryAll;
622
		$data.articleImg = $("#uploader").attr("data-id");
525
		$data.articleImg = $("#uploader").attr("data-id");
623
		$data.articleContent = ue.getContent();
526
		$data.articleContent = ue.getContent();
624
		$data.professors = experarray;
527
		$data.professors = experarray;

+ 31 - 0
js/common.js

916
		return;
916
		return;
917
	} else {
917
	} else {
918
		/*添加*/
918
		/*添加*/
919
		$(".addButton").siblings("input").keypress(function(){
920
			var e = event || window.event;
921
			if(e.keyCode == 13) {
922
				var oValue = $(this).val().trim();
923
				var oJudge = $(this).parent().siblings().find("ul.ulspace li");
924
				var addContent = $(this).attr("data-pro");
925
				var addNum = $(this).attr("data-num");
926
				var addfontSizeNum = $(this).attr("data-fontSizeN");
927
				if(!oValue) {
928
					$.MsgBox.Alert('提示', '请先填写内容');
929
					return;
930
				}
931
				if(oValue.length > addfontSizeNum) {
932
					$.MsgBox.Alert('提示', addContent);
933
					return;
934
				}
935
				for(var i = 0; i < oJudge.length; i++) {
936
					if(oValue == oJudge[i].innerText) {
937
						$.MsgBox.Alert('提示', '添加内容不能重复');
938
						return;
939
					}
940
				}
941
				$(this).parent().siblings().find("ul.ulspace").append('<li>' + oValue + '<div class="closeThis"></div></li>');
942
				$(this).siblings(".addButton").hide();
943
				$(this).val("");
944
				if(oJudge.length == addNum - 1) {
945
					$(this).val("").parents(".col-w-12").hide();
946
				}
947
				$(this).siblings(".keydrop").find("ul").html("");
948
			}
949
		})
919
		$(".addButton").click(function() {
950
		$(".addButton").click(function() {
920
			var oValue = $(this).siblings("input").val().trim();
951
			var oValue = $(this).siblings("input").val().trim();
921
			var oJudge = $(this).parent().siblings().find("ul.ulspace li");
952
			var oJudge = $(this).parent().siblings().find("ul.ulspace li");

+ 33 - 6
js/information.js

202
		if(orgName != $("#orgName").val()) {
202
		if(orgName != $("#orgName").val()) {
203
			
203
			
204
			if(authSD == 1) {
204
			if(authSD == 1) {
205
				$.MsgBox.Confirm("提示", "您修改了所在机构,认证员工身份将失效,为企业发布的需求也将关闭,确定修改 ?", function() {
205
				$.MsgBox.Confirm("提示", "您修改了所在机构,认证员工身份将失效,为企业发布的需求也将自动关闭,确定修改 ?", function() {
206
					ofl=true
206
					ofl=true
207
					setTimeout(function() {
207
					setTimeout(function() {
208
						if(osty == "e") {
208
						if(osty == "e") {
209
							if($("#name").val() != opName) {
209
							if($("#name").val() != opName) {
210
								$.MsgBox.Confirm("提示", "您修改了姓名,您的专利和论文将取消关联,确定修改?", personUpdata);
210
								$.MsgBox.Confirm("提示", "您修改了姓名,您的专利和论文将自动取消关联,确定修改?", personUpdata);
211
							}
211
							}
212
						}else{
212
						}else{
213
							personUpdata();
213
							personUpdata();
216

216

217
				});
217
				});
218
			} else {
218
			} else {
219
				$.MsgBox.Confirm("提示", "您修改了所在机构,您为企业发布的需求将关闭,确定修改?", function() {
219
				$.MsgBox.Confirm("提示", "您修改了所在机构,为该机构发布的需求将自动关闭,确定修改?", function() {
220
					setTimeout(function() {
220
					setTimeout(function() {
221
						if(osty == "e") {
221
						if(osty == "e") {
222
							if($("#name").val() != opName) {
222
							if($("#name").val() != opName) {
223
								$.MsgBox.Confirm("提示", "您修改了姓名,您的专利和论文将取消关联,确定修改?", personUpdata);
223
								$.MsgBox.Confirm("提示", "您修改了姓名,您的专利和论文将自动取消关联,确定修改?", personUpdata);
224
							}else {
224
							}else {
225
								personUpdata();
225
								personUpdata();
226
							}
226
							}
233
		} else {
233
		} else {
234
			if(osty == "e") {
234
			if(osty == "e") {
235
				if($("#name").val() != opName) {
235
				if($("#name").val() != opName) {
236
					$.MsgBox.Confirm("提示", "您修改了姓名,您的专利和论文将取消关联,确定修改?", personUpdata);
236
					$.MsgBox.Confirm("提示", "您修改了姓名,您的专利和论文将自动取消关联,确定修改?", personUpdata);
237
				}else{
237
				}else{
238
					personUpdata();
238
					personUpdata();
239
				}
239
				}
646
		$("#researchAreaList").append("<li class='yjlist'><div><span class='like'>0</span><span class='ra'>" + researchArea + "</span><span class='closeThis'></span></div></li>");
646
		$("#researchAreaList").append("<li class='yjlist'><div><span class='like'>0</span><span class='ra'>" + researchArea + "</span><span class='closeThis'></span></div></li>");
647
		$("#researchArea").val("");
647
		$("#researchArea").val("");
648
	});
648
	});
649
	$("#researchAreaAdd").siblings("input").keypress(function(){
650
		var e = event || window.event;
651
		if(e.keyCode == 13) {
652
			var researchArea = $("#researchArea").val();
653
			if(!researchArea) {
654
				$.MsgBox.Alert("提示", "内容不能为空");
655
				return;
656
			}
657
			if(researchArea.length > 30) {
658
				$.MsgBox.Alert("提示", "研究方向不得超过30个字");
659
				return;
660
			}
661
			var inV = $("#researchAreaList .ra");
662
			for(var i = 0; i < inV.length; i++) {
663
				if(inV[i].innerText == researchArea) {
664
					$.MsgBox.Alert("提示", "不能添加重复内容");
665
					return;
666
				}
667
			}
668
			if(inV.length == 9) {
669
				$("#researchAreaList").parents(".keyResult").siblings("div.col-w-12").hide();
670
			}
671
	
672
			$("#researchAreaList").append("<li class='yjlist'><div><span class='like'>0</span><span class='ra'>" + researchArea + "</span><span class='closeThis'></span></div></li>");
673
			$("#researchArea").val("");
674
		}
675
	})
649
	//研究方向删除
676
	//研究方向删除
650
	$("#researchAreaList").on("click", ".closeThis", function() {
677
	$("#researchAreaList").on("click", ".closeThis", function() {
651
		$(this).parent().remove();
678
		$(this).parents(".yjlist").remove();
652
		var liNum = $("#researchAreaList").find("li").length;
679
		var liNum = $("#researchAreaList").find("li").length;
653
		if(liNum < 10) {
680
		if(liNum < 10) {
654
			$("#researchAreaList").parents(".keyResult").siblings("div.col-w-12").show();
681
			$("#researchAreaList").parents(".keyResult").siblings("div.col-w-12").show();

+ 28 - 113
js/resourceIssue.js

58
			var oSub=$da.subject.split(",");
58
			var oSub=$da.subject.split(",");
59
			var oSt="";
59
			var oSt="";
60
			for(var i=0;i<oSub.length;i++){
60
			for(var i=0;i<oSub.length;i++){
61
				oSt+='<li><p class="h2Font">'+oSub[i]+'</p><div class="closeThis"></div></li>'
61
				oSt+='<li>'+oSub[i]+'<div class="closeThis"></div></li>'
62
			}
63
			$("#keyWordlist").html(oSt);
64
			if(oSub.length>4){
65
				$("#KeyWord").parent().addClass("displayNone");
62
			}
66
			}
63
			$("#keywordList").html(oSt);
64
		}else{
67
		}else{
65
			$("#keywordList").html("");
68
			$("#keyWordlist").html("");
66
		}
69
		}
67
		if($da.descp) {//编辑器
70
		if($da.descp) {//编辑器
68
			 ue.ready(function() {
71
			 ue.ready(function() {
69
				    	ue.setContent($da.descp);
70
				    });
72
		    	ue.setContent($da.descp);
73
		    });
71
			 
74
			 
72
		}
75
		}
73
		if($da.images.length) {
76
		if($da.images.length) {
215
			}
218
			}
216
		}
219
		}
217
	})
220
	})
218
	/*关键词*/
219
	$("#keywordName").bind({
221
	hotKey(".oinput");
222
	//校验关键字
223
	$("#KeyWord").on({
220
		focus: function() {
224
		focus: function() {
221
			$("#keywordPrompt").show().text('最多可添加5个关键词,每个关键词15字以内');
225
			$("#keyPrompt").text("最多可添加5个关键词,每个关键词15字以内");
222
		},
226
		},
223
		blur: function() {
227
		blur: function() {
224
			$("#keywordPrompt").text('');
225
		},
226
		keyup: function() {
227
			var ti=$(this).val();
228
			hbur=ti;
229
			var lNum=$.trim($(this).val()).length;
230
			console.log(lNum);
231
			if(lNum > 15) {
232
				$(this).val($(this).val().substr(0, 15));
233
			} else if(0 < lNum&& lNum < 15) {
234
					$("#addKeyword").show();
235
					setTimeout(function(){
236
						if( ti===hbur && ti!== hburEnd) {
237
							var tt=ti;
238
							hburEnd=tt;
239
						$.ajax({
240
						"url": "/ajax/dataDict/qaHotKey",
241
						"type": "GET",
242
						"success": function(data) {
243
							console.log(data);
244
							if(data.success) {
245
								if(hburEnd == tt){
246
									if(data.data.length==0) {
247
										$("#keyList").addClass("displayNone");
248
										$("#keyList ul").html("");
249
									}else{
250
										$("#keyList").removeClass("displayNone");
251
										var oSr="";
252
										for(var i=0;i<Math.min(data.data.length,5);i++) {
253
											oSr+='<li><p class="h2Font">'+data.data[i].caption+'</p></li>'
254
										}
255
										$("#keyList ul").html(oSr);
256
									}
257
								}	
258
							}else {
259
								$("#keyList ul").html("");
260
							}
261
						},
262
						"data": {
263
							"key":$('#keywordName').val()
264
						},
265
						dataType: "json",
266
						'error':function() {
267
							$.MsgBox.Alert('提示', '服务器连接超时!');
268
						}
269
				});
270
				}
271
				},500)
272
			}else if(lNum == 0){
273
				 $("#addKeyword").hide();
274
				 $("#keyList ul").html("");
275
			}
228
			$("#keyPrompt").text("");
276
		}
229
		}
277
	});
278
	$("#keyList ul").on("click","li",function(){
279
		 keyWord($(this).find("p").text());
280
		 $("#keyList ul").html("");
281
		 $("#keyList").addClass("displayNone");
282
		 $("#addKeyword").hide();
283
	})
284
	/*添加关键词*/
285
	$("#addKeyword").click(function() {
286
		 keyWord($("#keywordName").val());
287
	})
230
	})
288
	function keyWord(atl) {
289
		var oKeywordName =  $.trim(atl);
290
		var keywordListLength = $("#keywordList").find("li");
291
		if(oKeywordName.length == 0) {
292
			$("#keywordPrompt").text('关键词输入不能为空');
293
			return;
294
		}
295
		for(var i = 0; i < keywordListLength.length; i++) {
296
			if(oKeywordName == keywordListLength.find("p").eq(i).text()) {
297
				$("#keywordPrompt").text('该关键词已存在');
298
				return;
299
			}
300
		}
301
		 $("#keyList ul").html("");
302
		  $("#addKeyword").hide();
303
		var oStr = '<li><p class="h2Font">' + oKeywordName + '</p><div class="closeThis"></div></li>'
304
		$("#keywordList").append(oStr);
305
		$("#keywordName").val("");
306
		if((keywordListLength.length + 1) == 5) {
307
			$("#keywordHide").hide();
308
			$("#keyList").css("border-top","none");
309
		}
310
	}
311
	/*删除关键词*/
312
	$("#keywordList").on("click", ".closeThis", function() {
231
	$("#keyWordlist").on("click", ".closeThis", function() {
313
		$(this).parent().remove();
232
		$(this).parent().remove();
314
		var keywordListLength = $("#keywordList").find("li");
315
		if(keywordListLength.length < 5) {
316
			$("#keywordHide").show();
317
			$("#keyList").css("border-top","1px solid #E5E5E5");		
233
		var liNum = $("#keyWordlist").find("li").length;
234
		if(liNum < 5) {
235
			$("#keyWordlist").parents(".keyResult").siblings("div.col-w-12").show();
318
		}
236
		}
319
	});
237
	})
320
	/*应用用途*/
238
	/*应用用途*/
321
	$("#application").bind({
239
	$("#application").bind({
322
		focus: function() {
240
		focus: function() {
487
	}
405
	}
488
	/*发布函数*/
406
	/*发布函数*/
489
	function ajsPost(pa1,pa2) {
407
	function ajsPost(pa1,pa2) {
408
		var industrys = $("#keyWordlist li");
409
		var industryAll = "";
410
		if(industrys.size() > 0) {
411
			for(var i = 0; i < industrys.size(); i++) {
412
				industryAll += industrys[i].innerText;
413
				industryAll += ',';
414
			};
415
			industryAll = industryAll.substring(0, industryAll.length - 1);
416
		}
490
		$(".operateBlock").find("li").addClass("disableLi");
417
		$(".operateBlock").find("li").addClass("disableLi");
491
		var oUrl="/ajax/resource/save";
418
		var oUrl="/ajax/resource/save";
492
		if(pa1) {
419
		if(pa1) {
499
			$data.professorId=userid;
426
			$data.professorId=userid;
500
			$data.resourceName = $("#resourceName").val();//资源名字
427
			$data.resourceName = $("#resourceName").val();//资源名字
501
			$data.cooperationNotes = $("#remarkContent").val();//合作备注
428
			$data.cooperationNotes = $("#remarkContent").val();//合作备注
502
			$data.subject = captiureSubInd("keywordList p");
429
			$data.subject = industryAll;
503
			console.log($data.subject);
430
			console.log($data.subject);
504
			$data.supportedServices=$("#application").val();
431
			$data.supportedServices=$("#application").val();
505
			$data.orgName=$("#organizationName").val();
432
			$data.orgName=$("#organizationName").val();
550
					dataType: "json"
477
					dataType: "json"
551
			});
478
			});
552
	}
479
	}
553
	function captiureSubInd(subIndu) {
554
			var industrys = $("#" + subIndu + "");
555
			var industryAll = "";
556
			if(industrys.size() > 0) {
557
				for(var i = 0; i < industrys.size(); i++) {
558
					industryAll += industrys[i].innerText;
559
					industryAll += ',';
560
				};
561
				industryAll = industryAll.substring(0, industryAll.length - 1);
562
			}
563
			return industryAll;
564
		}
565
})
480
})

+ 12 - 41
resourceIssue.html

46
						<input type="text" class="frmtype frmcontype" id="resourceName" value="" placeholder="请输入资源名称" />
46
						<input type="text" class="frmtype frmcontype" id="resourceName" value="" placeholder="请输入资源名称" />
47
					</li>
47
					</li>
48
					<li class="form-item">
48
					<li class="form-item">
49
						<div class="aboutTit">关键词<span class="frmconmsg" id="keywordPrompt" style="display:none;">最多可添加5个关键词、每个关键词最多15个字</span></div>
50
						<div style="position: relative;" id="keywordHide">
51
							<input type="text" class="frmtype frmcontype" id="keywordName" value="" placeholder="请输入关键词" />
52
							<!--输入框中键入内容时按钮显示,添加内容出现在结果标签中时按钮隐藏-->
53
							<button class="frmcontype frmadd displayNone" id="addKeyword">添加</button>
49
						<div class="aboutTit">关键词<span class="frmconmsg" id="keyPrompt"></span></div>
50
						<div class="col-w-12" style="position: relative;">
51
							<input type="text" class="frmcontype oinput" placeholder="请输入关键词" data-pro="关键词不得超过15个字"  data-num="5" data-fontSizeN="15" id="KeyWord" />
52
							<button type="button" class="frmcontype btnModel frmaddG addButton">添加</button>
53
							<div class="form-drop keydrop">
54
								<ul>
55
									
56
								</ul>
57
							</div>
54
						</div>
58
						</div>
55
						<div class="form-drop keydrop displayNone" id="keyList">
56
							<ul>
57
								<!--<li>
58
									<p class="h2Font">金属材料工程与腐蚀</p>
59
								</li>-->
60
								
61
							</ul>
62
						</div>
63
						<div class="form-result keyResult">
64
							<ul class="clearfix" id="keywordList">
65
								<!--<li>
66
									<p class="h2Font">金属材料工程与腐蚀蚀</p>
67
									<div class="closeThis"></div>
68
								</li>
69
								<li>
70
									<p class="h2Font">金属材料工程与腐蚀蚀</p>
71
									<div class="closeThis"></div>
72
								</li>
73
								<li>
74
									<p class="h2Font">金属材料工程与腐蚀蚀</p>
75
									<div class="closeThis"></div>
76
								</li>
77
								<li>
78
									<p class="h2Font">金属材料工程与腐蚀蚀</p>
79
									<div class="closeThis"></div>
80
								</li>
81
								<li>
82
									<p class="h2Font">金属材料工程与腐蚀蚀</p>
83
									<div class="closeThis"></div>
84
								</li>-->
59
						<div class="form-result keyResult" style="margin-top: -10px;">
60
							<ul class="ulspace editUlist clearfix" id="keyWordlist">
61
								<!--<li>dd<div class="closeThis"></div></li>-->
85
							</ul>
62
							</ul>
86
						</div>
63
						</div>
87
					</li>
64
					</li>
97
								<!--<li class="clearfix">
74
								<!--<li class="clearfix">
98
									<img src="images/authsort2.png" alt="" class="floatL" style="width:50px;height:50px;"/>
75
									<img src="images/authsort2.png" alt="" class="floatL" style="width:50px;height:50px;"/>
99
									<p class="h2Font floatL">金属材料工程与腐蚀</p>
76
									<p class="h2Font floatL">金属材料工程与腐蚀</p>
100
								</li>
101
								<li>
102
									<p class="h2Font">金属材料工程与腐蚀</p>
103
								</li>
104
								<li>
105
									<p class="h2Font">金属材料工程与腐蚀</p>
106
								</li>-->
77
								</li>-->
107
							</ul>
78
							</ul>
108
						</div>
79
						</div>