Browse Source

关键词修改

jack 7 years ago
parent
commit
c61a71072c
6 changed files with 513 additions and 322 deletions
  1. 128 77
      cmp-portal/js/articalIssue.js
  2. 135 83
      cmp-portal/js/articalModify.js
  3. 43 29
      cmp-portal/js/resourceIssue.js
  4. 78 53
      js/articalIssue.js
  5. 107 69
      js/articalModify.js
  6. 22 11
      js/resourceIssue.js

+ 128 - 77
cmp-portal/js/articalIssue.js

@ -6,6 +6,10 @@ $(function() {
6 6
	var fa = false;
7 7
    var orgId = $.cookie("orgId");
8 8
    var colMgr = $.cookie("colMgr");
9
    var hbur,hburEnd;
10
  	var pr,prEnd;
11
  	var re,reEnd;
12
  	var orgr,orgrEnd;
9 13
    if(orgId == "" || orgId == null || orgId == "null"){
10 14
    	location.href = "cmp-settled-log.html";
11 15
    }
@ -33,17 +37,26 @@ $(function() {
33 37
			$("#keyPrompt").text("");
34 38
		},
35 39
		keyup: function() {
36
			if($(this).val()==""){
40
			var ti=$(this).val();
41
			hbur=ti;
42
			if(ti==""){
37 43
				$(".frmadd").addClass("displayNone");
38 44
				$(".keydrop ul").html("");
39 45
				$(".keydrop").addClass("displayNone");
46
				return;
40 47
			}else{
41 48
				$(".frmadd").removeClass("displayNone");
42 49
			}
43 50
			if($(this).val().length > 15) {
44 51
				$(this).val($(this).val().substr(0, 15));
45 52
			}
46
			KeyWordList();
53
			setTimeout(function(){
54
				if( ti===hbur && ti!== hburEnd) {
55
					KeyWordList(ti);
56
				}
57
				
58
			},500)
59
			
47 60
		}
48 61
	})
49 62

@ -106,8 +119,8 @@ $(function() {
106 119
			$("#keyWordlist").append("<li class='delkeylist'><p class='h2Font'>" + keyWord + "</p><div class='closeThis'></div></li>");
107 120
		}
108 121
	}
109
	
110
	function KeyWordList() {
122
	function KeyWordList(seValue) {
123
		hburEnd=seValue;
111 124
		$.ajax({
112 125
			"url": "/ajax/dataDict/qaHotKey",
113 126
			"type": "get",
@ -116,19 +129,21 @@ $(function() {
116 129
			},
117 130
			"success": function(data) {
118 131
				console.log(data);
119
				if(data.success && data.data != "") {
120
					var itemlist = '';
121
					$("#keydropList").html("");
122
					for(var i = 0; i < 5; i++) {
123
						var itemlist = '<li><p class="h2Font"></p></li>';
124
						$itemlist = $(itemlist);
125
						$("#keydropList").append($itemlist);
126
						$itemlist.find(".h2Font").text(data.data[i].caption);
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");
127 143
					}
128
					$(".keydrop").removeClass("displayNone");
129 144
				} else {
130
					$(".keydrop").addClass("displayNone");
131
					$(".keydrop ul").html("");
145
					//$(".keydrop").addClass("displayNone");
146
					//$(".keydrop ul").html("");
132 147
				}
133 148
			},
134 149
			"error": function() {
@ -136,7 +151,6 @@ $(function() {
136 151
			}
137 152
		});
138 153
	}
139
	
140 154
	//校验右侧专家和资源
141 155
	$("#checkZj").on("focus", function() {
142 156
		$(this).prev().find("span").text("最多选择5位专家");
@ -152,12 +166,34 @@ $(function() {
152 166

153 167
	$("#checkZj").on("keyup", function() {
154 168
		var _this = this;
155
		checkZj(_this);
169
		var ti=$(this).val();
170
		pr=ti;
171
		if($(this).val()=="") {
172
			return;
173
		}
174
		setTimeout(function(){
175
				if( ti===pr && ti!== prEnd) {
176
					checkZj(_this,ti);
177
				}
178
				
179
			},500)
180
		
156 181
	})
157 182

158 183
	$("#checkZy").on("keyup", function() {
184
		var ti=$(this).val();
185
		re=ti;
186
		if($(this).val()=="") {
187
			return;
188
		}
159 189
		var _this = this;
160
		checkZy(_this);
190
		setTimeout(function(){
191
				if( ti===re && ti!== reEnd) {
192
					checkZy(_this,ti);
193
				}
194
				
195
			},500)
196
		
161 197
	})
162 198

163 199
	$("#expertlist").on("click", "li", function() {
@ -202,7 +238,8 @@ $(function() {
202 238
		$(this).parent().remove();
203 239
	})
204 240

205
	function checkZj(_this) {
241
	function checkZj(_this,prd) {
242
		prEnd=prd;
206 243
		$.ajax({
207 244
			"url": "/ajax/professor/qaByName",
208 245
			"type": "get",
@ -214,26 +251,28 @@ $(function() {
214 251
				console.log(data);
215 252
				if(data.success) {
216 253
					if(data.data != "") {
217
						$(_this).next().removeClass("displayNone");
218
						var itemlist = '';
219
						$("#expertlist").html("");
220
						for(var i = 0; i < data.data.length; i++) {
221
							var itemlist = '<li id="usid" class="flexCenter">';
222
							itemlist += '<div class="madiaHead useHead" id="userimg"></div>';
223
							itemlist += '<div class="madiaInfo">';
224
							itemlist += '<p class="ellipsisSty"><span class="h1Font" id="name"></span><span class="h2Font" style="margin-left:10px;" id="title"></span></p>';
225
							itemlist += '<p class="h2Font ellipsisSty" id="orgName"></p>';
226
							itemlist += '</div><div class="deleteThis"></div></li>';
227
							$itemlist = $(itemlist);
228
							$("#expertlist").append($itemlist);
229
							var datalist = data.data[i];
230
							$itemlist.attr("data-id", datalist.id);
231
							$itemlist.find("#name").text(datalist.name);
232
							$itemlist.find("#title").text(datalist.title);
233
							$itemlist.find("#orgName").text(datalist.orgName);
234
							if(datalist.hasHeadImage == 1) {
235
								$itemlist.find("#userimg").attr("style", "background-image: url(/images/head/" + datalist.id + "_l.jpg);");
236
							}
254
							if(prEnd == prd){
255
								$(_this).next().removeClass("displayNone");
256
								var itemlist = '';
257
								$("#expertlist").html("");
258
								for(var i = 0; i < data.data.length; i++) {
259
									var itemlist = '<li id="usid" class="flexCenter">';
260
									itemlist += '<div class="madiaHead useHead" id="userimg"></div>';
261
									itemlist += '<div class="madiaInfo">';
262
									itemlist += '<p class="ellipsisSty"><span class="h1Font" id="name"></span><span class="h2Font" style="margin-left:10px;" id="title"></span></p>';
263
									itemlist += '<p class="h2Font ellipsisSty" id="orgName"></p>';
264
									itemlist += '</div><div class="deleteThis"></div></li>';
265
									$itemlist = $(itemlist);
266
									$("#expertlist").append($itemlist);
267
									var datalist = data.data[i];
268
									$itemlist.attr("data-id", datalist.id);
269
									$itemlist.find("#name").text(datalist.name);
270
									$itemlist.find("#title").text(datalist.title);
271
									$itemlist.find("#orgName").text(datalist.orgName);
272
									if(datalist.hasHeadImage == 1) {
273
										$itemlist.find("#userimg").attr("style", "background-image: url(/images/head/" + datalist.id + "_l.jpg);");
274
									}
275
							}		
237 276
						}
238 277
					} else {
239 278
						$(_this).next().addClass("displayNone");
@ -248,7 +287,8 @@ $(function() {
248 287
		});
249 288
	}
250 289

251
	function checkZy(_this) {
290
	function checkZy(_this,prd) {
291
		reEnd=prd;
252 292
		$.ajax({
253 293
			"url": "/ajax/resource/qaByName",
254 294
			"type": "get",
@ -260,30 +300,32 @@ $(function() {
260 300
				console.log(data);
261 301
				if(data.success) {
262 302
					if(data.data != "") {
263
						$(_this).next().removeClass("displayNone");
264
						var itemlist = '';
265
						$("#resouselist").html("");
266
						for(var i = 0; i < data.data.length; i++) {
267
							var itemlist = '<li id="usid" class="flexCenter">';
268
							itemlist += '<div class="madiaHead resouseHead" id="userimg"></div>';
269
							itemlist += '<div class="madiaInfo">';
270
							itemlist += '<p class="h1Font ellipsisSty" id="resourceName"></p>';
271
							itemlist += '<p class="h2Font ellipsisSty" id="name"></p>';
272
							itemlist += '</div><div class="deleteThis"></div></li>';
273
							$itemlist = $(itemlist);
274
							$("#resouselist").append($itemlist);
275
							var datalist = data.data[i];
276
							$itemlist.attr("data-id", datalist.resourceId);
277
							$itemlist.find("#resourceName").text(datalist.resourceName);
278
							if(datalist.resourceType==1){
279
								$itemlist.find("#name").text(datalist.professor.name);
280
							}else{
281
								$itemlist.find("#name").text(datalist.organization.name);
282
							}
283
							if(datalist.images.length > 0) {
284
								$itemlist.find("#userimg").attr("style", "background-image: url(/data/resource/" + datalist.images[0].imageSrc + ");");
285
							}
286
						}
303
						if(reEnd==prd) {
304
								$(_this).next().removeClass("displayNone");
305
								var itemlist = '';
306
								$("#resouselist").html("");
307
								for(var i = 0; i < data.data.length; i++) {
308
									var itemlist = '<li id="usid" class="flexCenter">';
309
									itemlist += '<div class="madiaHead resouseHead" id="userimg"></div>';
310
									itemlist += '<div class="madiaInfo">';
311
									itemlist += '<p class="h1Font ellipsisSty" id="resourceName"></p>';
312
									itemlist += '<p class="h2Font ellipsisSty" id="name"></p>';
313
									itemlist += '</div><div class="deleteThis"></div></li>';
314
									$itemlist = $(itemlist);
315
									$("#resouselist").append($itemlist);
316
									var datalist = data.data[i];
317
									$itemlist.attr("data-id", datalist.resourceId);
318
									$itemlist.find("#resourceName").text(datalist.resourceName);
319
									if(datalist.resourceType==1){
320
										$itemlist.find("#name").text(datalist.professor.name);
321
									}else{
322
										$itemlist.find("#name").text(datalist.organization.name);
323
									}
324
									if(datalist.images.length > 0) {
325
										$itemlist.find("#userimg").attr("style", "background-image: url(/data/resource/" + datalist.images[0].imageSrc + ");");
326
									}
327
								}
328
							}	
287 329
					} else {
288 330
						$(_this).next().addClass("displayNone");
289 331
					}
@ -620,33 +662,40 @@ function getAttrId() {
620 662
			$(this).siblings(".aboutTit").find("span").text("最多选择3家企业");
621 663
		},
622 664
		keyup: function(e) {
665
			 var ti=$(this).val();
666
			 orgr=ti;
667
			 var $this=$(this);
623 668
			if($(this).val().trim()) {
624 669
				var lNum = $.trim($(this).val()).length;
625 670
				if(0 < lNum) {
626
					var $this = $(this)
671
					setTimeout(function(){
672
						if( ti===orgr && ti!== orgrEnd) {
673
							var tt=ti;
674
							orgrEnd=tt;
627 675
					$("#companylist").parent().show();
628
					console.log($(this).val())
629 676
					$.ajax({
630 677
						"url": "/ajax/org/qr",
631 678
						"type": "GET",
632 679
						"data":{
633
							kw: $(this).val(),
680
							kw: $this.val(),
634 681
							limit:3
635 682
						},
636 683
						"success": function(data) {
637 684
							console.log(data);
638 685
							if(data.success) {
639
								if(data.data.length == 0) {
640
									$this.siblings(".form-drop").addClass("displayNone");
641
									$this.siblings(".form-drop").find("ul").html("");
642
								} else {
643
									$this.siblings(".form-drop").removeClass("displayNone");
644
									var oSr = "";
645
									for(var i = 0; i < data.data.length; i++) {
646
										var busName=(data.data[i].forShort)?data.data[i].forShort:data.data[i].name;
647
										oSr += '<li style="min-height:40px;position:static;"data-id="'+data.data[i].id+'">' + busName + '</li>';
686
								if(orgrEnd==tt) {
687
									if(data.data.length == 0) {
688
										$this.siblings(".form-drop").addClass("displayNone");
689
										$this.siblings(".form-drop").find("ul").html("");
690
									} else {
691
										$this.siblings(".form-drop").removeClass("displayNone");
692
										var oSr = "";
693
										for(var i = 0; i < data.data.length; i++) {
694
											var busName=(data.data[i].forShort)?data.data[i].forShort:data.data[i].name;
695
											oSr += '<li style="min-height:40px;position:static;"data-id="'+data.data[i].id+'">' + busName + '</li>';
696
										}
697
										$this.siblings(".form-drop").find("ul").html(oSr);
648 698
									}
649
									$this.siblings(".form-drop").find("ul").html(oSr);
650 699
								}
651 700
							} else {
652 701
								$this.siblings(".form-drop").addClass("displayNone");
@ -658,6 +707,8 @@ function getAttrId() {
658 707
							$.MsgBox.Alert('提示', '服务器连接超时!');
659 708
						}
660 709
					});
710
					}
711
					},500)
661 712
				}
662 713
			} else {
663 714
				$(this).siblings(".form-drop").addClass("displayNone");

+ 135 - 83
cmp-portal/js/articalModify.js

@ -10,6 +10,10 @@ $(function() {
10 10
	if(orgId == "" || orgId == null || orgId == "null"){
11 11
    	location.href = "cmp-settled-log.html";
12 12
    }
13
	var hbur,hburEnd;
14
  	var pr,prEnd;
15
  	var re,reEnd;
16
  	var orgr,orgrEnd;
13 17
	articleshow();
14 18
	relevantExperts();
15 19
	relevantResources();
@ -38,20 +42,28 @@ $(function() {
38 42
			$("#keyPrompt").text("");
39 43
		},
40 44
		keyup: function() {
41
			if($(this).val()==""){
45
			var ti=$(this).val();
46
			hbur=ti;
47
			if(ti==""){
42 48
				$(".frmadd").addClass("displayNone");
43 49
				$(".keydrop ul").html("");
44 50
				$(".keydrop").addClass("displayNone");
51
				return;
45 52
			}else{
46 53
				$(".frmadd").removeClass("displayNone");
47 54
			}
48 55
			if($(this).val().length > 15) {
49 56
				$(this).val($(this).val().substr(0, 15));
50 57
			}
51
			KeyWordList();
58
			setTimeout(function(){
59
				if( ti===hbur && ti!== hburEnd) {
60
					KeyWordList(ti);
61
				}
62
				
63
			},500)
64
			
52 65
		}
53 66
	})
54

55 67
	//添加关键字
56 68
	$("#addkeyWord").on("click", function() {
57 69
		var keyWord = $("#KeyWord").val();
@ -112,7 +124,8 @@ $(function() {
112 124
		}
113 125
	}
114 126
	
115
	function KeyWordList() {
127
	function KeyWordList(seValue) {
128
		hburEnd=seValue;
116 129
		$.ajax({
117 130
			"url": "/ajax/dataDict/qaHotKey",
118 131
			"type": "get",
@ -122,19 +135,21 @@ $(function() {
122 135
			"success": function(data) {
123 136
				console.log(data);
124 137
				if(data.success && data.data != "") {
125
					var itemlist = '';
126
					$("#keydropList").html("");
127
					for(var i = 0; i < 5; i++) {
128
						var itemlist = '<li><p class="h2Font"></p></li>';
129
						$itemlist = $(itemlist);
130
						$("#keydropList").append($itemlist);
131
						$itemlist.find(".h2Font").text(data.data[i].caption);
138
					if(hburEnd == seValue){
139
						var itemlist = '';
140
						$("#keydropList").html("");
141
						for(var i = 0; i < 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("");
132 151
					}
133
					$(".keydrop").removeClass("displayNone");
134
				} else {
135
					$(".keydrop").addClass("displayNone");
136
					$(".keydrop ul").html("");
137
				}
152
				}	
138 153
			},
139 154
			"error": function() {
140 155
				$.MsgBox.Alert('提示', '链接服务器超时')
@ -176,12 +191,34 @@ $(function() {
176 191
	
177 192
	$("#checkZj").on("keyup", function() {
178 193
		var _this = this;
179
		checkZj(_this);
194
		var ti=$(this).val();
195
		pr=ti;
196
		if($(this).val()=="") {
197
			return;
198
		}
199
		setTimeout(function(){
200
				if( ti===pr && ti!== prEnd) {
201
					checkZj(_this,ti);
202
				}
203
				
204
			},500)
205
		
180 206
	})
181 207

182 208
	$("#checkZy").on("keyup", function() {
209
		var ti=$(this).val();
210
		re=ti;
211
		if($(this).val()=="") {
212
			return;
213
		}
183 214
		var _this = this;
184
		checkZy(_this);
215
		setTimeout(function(){
216
				if( ti===re && ti!== reEnd) {
217
					checkZy(_this,ti);
218
				}
219
				
220
			},500)
221
		
185 222
	})
186 223
	
187 224
	$("#expertlist").on("click","li",function(){
@ -226,43 +263,46 @@ $(function() {
226 263
		$(this).parent().remove();
227 264
	})
228 265
	
229
	function checkZj(_this){
266
	function checkZj(_this,prd) {
267
		prEnd=prd;
230 268
		$.ajax({
231 269
			"url": "/ajax/professor/qaByName",
232 270
			"type": "get",
233 271
			"data": {
234 272
				"name": $("#checkZj").val(),
235
				"total":3
273
				"total": 3
236 274
			},
237 275
			"success": function(data) {
238 276
				console.log(data);
239
				if(data.success ) {
240
					if(data.data != ""){
241
						$(_this).next().removeClass("displayNone");
242
						var itemlist = '';
243
						$("#expertlist").html("");
244
						for(var i = 0; i < data.data.length; i++) {
245
							var itemlist = '<li id="usid" class="flexCenter">';
246
							itemlist += '<div class="madiaHead useHead" id="userimg"></div>';
247
							itemlist += '<div class="madiaInfo">';
248
							itemlist += '<p class="ellipsisSty"><span class="h1Font" id="name"></span><span class="h2Font" style="margin-left:10px;" id="title"></span></p>';
249
							itemlist += '<p class="h2Font ellipsisSty" id="orgName"></p>';
250
							itemlist += '</div><div class="deleteThis"></div></li>';
251
							$itemlist = $(itemlist);
252
							$("#expertlist").append($itemlist);
253
							var datalist = data.data[i];
254
							$itemlist.attr("data-id",datalist.id);
255
							$itemlist.find("#name").text(datalist.name);
256
							$itemlist.find("#title").text(datalist.title);
257
							$itemlist.find("#orgName").text(datalist.orgName);
258
							if(datalist.hasHeadImage==1) {
259
								$itemlist.find("#userimg").attr("style", "background-image: url(/images/head/" + datalist.id + "_l.jpg);");
260
							}
277
				if(data.success) {
278
					if(data.data != "") {
279
							if(prEnd == prd){
280
								$(_this).next().removeClass("displayNone");
281
								var itemlist = '';
282
								$("#expertlist").html("");
283
								for(var i = 0; i < data.data.length; i++) {
284
									var itemlist = '<li id="usid" class="flexCenter">';
285
									itemlist += '<div class="madiaHead useHead" id="userimg"></div>';
286
									itemlist += '<div class="madiaInfo">';
287
									itemlist += '<p class="ellipsisSty"><span class="h1Font" id="name"></span><span class="h2Font" style="margin-left:10px;" id="title"></span></p>';
288
									itemlist += '<p class="h2Font ellipsisSty" id="orgName"></p>';
289
									itemlist += '</div><div class="deleteThis"></div></li>';
290
									$itemlist = $(itemlist);
291
									$("#expertlist").append($itemlist);
292
									var datalist = data.data[i];
293
									$itemlist.attr("data-id", datalist.id);
294
									$itemlist.find("#name").text(datalist.name);
295
									$itemlist.find("#title").text(datalist.title);
296
									$itemlist.find("#orgName").text(datalist.orgName);
297
									if(datalist.hasHeadImage == 1) {
298
										$itemlist.find("#userimg").attr("style", "background-image: url(/images/head/" + datalist.id + "_l.jpg);");
299
									}
300
							}		
261 301
						}
262
					}else{
302
					} else {
263 303
						$(_this).next().addClass("displayNone");
264 304
					}
265
				}else{
305
				} else {
266 306
					$(_this).next().addClass("displayNone");
267 307
				}
268 308
			},
@ -271,8 +311,9 @@ $(function() {
271 311
			}
272 312
		});
273 313
	}
274
	
275
		function checkZy(_this) {
314

315
	function checkZy(_this,prd) {
316
		reEnd=prd;
276 317
		$.ajax({
277 318
			"url": "/ajax/resource/qaByName",
278 319
			"type": "get",
@ -284,30 +325,32 @@ $(function() {
284 325
				console.log(data);
285 326
				if(data.success) {
286 327
					if(data.data != "") {
287
						$(_this).next().removeClass("displayNone");
288
						var itemlist = '';
289
						$("#resouselist").html("");
290
						for(var i = 0; i < data.data.length; i++) {
291
							var itemlist = '<li id="usid" class="flexCenter">';
292
							itemlist += '<div class="madiaHead resouseHead" id="userimg"></div>';
293
							itemlist += '<div class="madiaInfo">';
294
							itemlist += '<p class="h2Font ellipsisSty" id="resourceName"></p>';
295
							itemlist += '<p class="h1Font ellipsisSty" id="name"></p>';
296
							itemlist += '</div><div class="deleteThis"></div></li>';
297
							$itemlist = $(itemlist);
298
							$("#resouselist").append($itemlist);
299
							var datalist = data.data[i];
300
							$itemlist.attr("data-id", datalist.resourceId);
301
							$itemlist.find("#resourceName").text(datalist.resourceName);
302
							if(datalist.resourceType==1){
303
								$itemlist.find("#name").text(datalist.professor.name);
304
							}else{
305
								$itemlist.find("#name").text(datalist.organization.name);
306
							}
307
							if(datalist.images.length > 0) {
308
								$itemlist.find("#userimg").attr("style", "background-image: url(/data/resource/" + datalist.images[0].imageSrc + ");");
309
							}
310
						}
328
						if(reEnd==prd) {
329
								$(_this).next().removeClass("displayNone");
330
								var itemlist = '';
331
								$("#resouselist").html("");
332
								for(var i = 0; i < data.data.length; i++) {
333
									var itemlist = '<li id="usid" class="flexCenter">';
334
									itemlist += '<div class="madiaHead resouseHead" id="userimg"></div>';
335
									itemlist += '<div class="madiaInfo">';
336
									itemlist += '<p class="h1Font ellipsisSty" id="resourceName"></p>';
337
									itemlist += '<p class="h2Font ellipsisSty" id="name"></p>';
338
									itemlist += '</div><div class="deleteThis"></div></li>';
339
									$itemlist = $(itemlist);
340
									$("#resouselist").append($itemlist);
341
									var datalist = data.data[i];
342
									$itemlist.attr("data-id", datalist.resourceId);
343
									$itemlist.find("#resourceName").text(datalist.resourceName);
344
									if(datalist.resourceType==1){
345
										$itemlist.find("#name").text(datalist.professor.name);
346
									}else{
347
										$itemlist.find("#name").text(datalist.organization.name);
348
									}
349
									if(datalist.images.length > 0) {
350
										$itemlist.find("#userimg").attr("style", "background-image: url(/data/resource/" + datalist.images[0].imageSrc + ");");
351
									}
352
								}
353
							}	
311 354
					} else {
312 355
						$(_this).next().addClass("displayNone");
313 356
					}
@ -789,33 +832,40 @@ relatCompanies("#company");
789 832
			$(this).siblings(".aboutTit").find("span").text("最多选择3家企业");
790 833
		},
791 834
		keyup: function(e) {
835
			 var ti=$(this).val();
836
			 orgr=ti;
837
			 var $this=$(this);
792 838
			if($(this).val().trim()) {
793 839
				var lNum = $.trim($(this).val()).length;
794 840
				if(0 < lNum) {
795
					var $this = $(this)
841
					setTimeout(function(){
842
						if( ti===orgr && ti!== orgrEnd) {
843
							var tt=ti;
844
							orgrEnd=tt;
796 845
					$("#companylist").parent().show();
797
					console.log($(this).val())
798 846
					$.ajax({
799 847
						"url": "/ajax/org/qr",
800 848
						"type": "GET",
801 849
						"data":{
802
							kw: $(this).val(),
850
							kw: $this.val(),
803 851
							limit:3
804 852
						},
805 853
						"success": function(data) {
806 854
							console.log(data);
807 855
							if(data.success) {
808
								if(data.data.length == 0) {
809
									$this.siblings(".form-drop").addClass("displayNone");
810
									$this.siblings(".form-drop").find("ul").html("");
811
								} else {
812
									$this.siblings(".form-drop").removeClass("displayNone");
813
									var oSr = "";
814
									for(var i = 0; i < data.data.length; i++) {
815
										var busName=(data.data[i].forShort)?data.data[i].forShort:data.data[i].name;
816
										oSr += '<li style="min-height:40px;position:static;"data-id="'+data.data[i].id+'">' + busName + '</li>';
856
								if(orgrEnd==tt) {
857
									if(data.data.length == 0) {
858
										$this.siblings(".form-drop").addClass("displayNone");
859
										$this.siblings(".form-drop").find("ul").html("");
860
									} else {
861
										$this.siblings(".form-drop").removeClass("displayNone");
862
										var oSr = "";
863
										for(var i = 0; i < data.data.length; i++) {
864
											var busName=(data.data[i].forShort)?data.data[i].forShort:data.data[i].name;
865
											oSr += '<li style="min-height:40px;position:static;"data-id="'+data.data[i].id+'">' + busName + '</li>';
866
										}
867
										$this.siblings(".form-drop").find("ul").html(oSr);
817 868
									}
818
									$this.siblings(".form-drop").find("ul").html(oSr);
819 869
								}
820 870
							} else {
821 871
								$this.siblings(".form-drop").addClass("displayNone");
@ -827,6 +877,8 @@ relatCompanies("#company");
827 877
							$.MsgBox.Alert('提示', '服务器连接超时!');
828 878
						}
829 879
					});
880
					}
881
					},500)
830 882
				}
831 883
			} else {
832 884
				$(this).siblings(".form-drop").addClass("displayNone");

+ 43 - 29
cmp-portal/js/resourceIssue.js

@ -11,6 +11,7 @@ $(document).ready(function() {
11 11
	var temp = [];
12 12
	var array = [];
13 13
	var oProfessor=[];
14
	var hbur,hburEnd;
14 15
	ue = UE.getEditor('editor', {});
15 16
	/*获取资源信息*/
16 17
	function getRecourceMe() {
@ -214,47 +215,60 @@ $(document).ready(function() {
214 215
			$("#keywordPrompt").show().text('最多可添加5个关键词,每个关键词15字以内');
215 216
		},
216 217
		blur: function() {
217
			$("#keywordPrompt").hide();
218
			$("#keywordPrompt").text('');
218 219
		},
219 220
		keyup: function() {
221
			var ti=$(this).val();
222
			hbur=ti;
220 223
			var lNum=$.trim($(this).val()).length;
224
			console.log(lNum);
221 225
			if(lNum > 15) {
222 226
				$(this).val($(this).val().substr(0, 15));
223
			} else if(0 < lNum && lNum < 15) {
224
				$("#addKeyword").show();
225
				$.ajax({
226
					"url": "/ajax/dataDict/qaHotKey",
227
					"type": "GET",
228
					"success": function(data) {
229
						console.log(data);
230
						if(data.success) {
231
							if(data.data.length==0) {
232
									$("#keyList").addClass("displayNone");
233
									$("#keyList ul").html("");
234
								}else{
235
									$("#keyList").removeClass("displayNone");
236
								var oSr = "";
237
								for(var i = 0; i < 5; i++) {
238
									oSr += '<li><p class="h2Font">' + data.data[i].caption + '</p></li>'
239
								}
240
								$("#keyList ul").html(oSr);
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("");
241 254
							}
255
						},
256
						"data": {
257
							"key":$('#keywordName').val()
258
						},
259
						dataType: "json",
260
						'error':function() {
261
							$.MsgBox.Alert('提示', '服务器连接超时!');
242 262
						}
243
					},
244
					"data": {
245
						"key": $(this).val()
246
								},
247
					dataType: "json",
248
					'error': function() {
249
						$.MsgBox.Alert('提示', '服务器连接超时!');
250
					}
251 263
				});
252
			}if(lNum == 0){
264
				}
265
				},500)
266
			}else if(lNum == 0){
253 267
				 $("#addKeyword").hide();
254 268
				 $("#keyList ul").html("");
255 269
			}
256 270
		}
257
	})
271
	});
258 272
	$("#keyList ul").on("click","li",function(){
259 273
		 keyWord($(this).find("p").text());
260 274
		 $("#keyList ul").html("");

+ 78 - 53
js/articalIssue.js

@ -8,6 +8,8 @@ $(function() {
8 8
	var fa = false;
9 9
  	var userid = $.cookie("userid");
10 10
  	var hbur,hburEnd;
11
  	var pr,prEnd;
12
  	var re,reEnd;
11 13
	//校验标题
12 14
	$("#newstitle").on({
13 15
		focus: function() {
@ -46,9 +48,6 @@ $(function() {
46 48
				$(this).val($(this).val().substr(0, 15));
47 49
			}
48 50
			setTimeout(function(){
49
				console.log(ti);
50
				console.log(hbur);
51
				console.log(hburEnd)
52 51
				if( ti===hbur && ti!== hburEnd) {
53 52
					KeyWordList(ti);
54 53
				}
@ -161,18 +160,38 @@ $(function() {
161 160
	})
162 161
	$("#checkZj,#checkZy").on("blur", function() {
163 162
		$(this).prev().find("span").text("");
164
		//$(this).val("");
165
		//$(this).parents(".otherBlock").find(".form-drop").addClass("displayNone");
166 163
	})
167 164

168 165
	$("#checkZj").on("keyup", function() {
169 166
		var _this = this;
170
		checkZj(_this);
167
		var ti=$(this).val();
168
		pr=ti;
169
		if($(this).val()=="") {
170
			return;
171
		}
172
		setTimeout(function(){
173
				if( ti===pr && ti!== prEnd) {
174
					checkZj(_this,ti);
175
				}
176
				
177
			},500)
178
		
171 179
	})
172 180

173 181
	$("#checkZy").on("keyup", function() {
182
		var ti=$(this).val();
183
		re=ti;
184
		if($(this).val()=="") {
185
			return;
186
		}
174 187
		var _this = this;
175
		checkZy(_this);
188
		setTimeout(function(){
189
				if( ti===re && ti!== reEnd) {
190
					checkZy(_this,ti);
191
				}
192
				
193
			},500)
194
		
176 195
	})
177 196

178 197
	$("#expertlist").on("click", "li", function() {
@ -217,7 +236,8 @@ $(function() {
217 236
		$(this).parent().remove();
218 237
	})
219 238

220
	function checkZj(_this) {
239
	function checkZj(_this,prd) {
240
		prEnd=prd;
221 241
		$.ajax({
222 242
			"url": "/ajax/professor/qaByName",
223 243
			"type": "get",
@ -229,26 +249,28 @@ $(function() {
229 249
				console.log(data);
230 250
				if(data.success) {
231 251
					if(data.data != "") {
232
						$(_this).next().removeClass("displayNone");
233
						var itemlist = '';
234
						$("#expertlist").html("");
235
						for(var i = 0; i < data.data.length; i++) {
236
							var itemlist = '<li id="usid" class="flexCenter">';
237
							itemlist += '<div class="madiaHead useHead" id="userimg"></div>';
238
							itemlist += '<div class="madiaInfo">';
239
							itemlist += '<p class="ellipsisSty"><span class="h1Font" id="name"></span><span class="h2Font" style="margin-left:10px;" id="title"></span></p>';
240
							itemlist += '<p class="h2Font ellipsisSty" id="orgName"></p>';
241
							itemlist += '</div><div class="deleteThis"></div></li>';
242
							$itemlist = $(itemlist);
243
							$("#expertlist").append($itemlist);
244
							var datalist = data.data[i];
245
							$itemlist.attr("data-id", datalist.id);
246
							$itemlist.find("#name").text(datalist.name);
247
							$itemlist.find("#title").text(datalist.title);
248
							$itemlist.find("#orgName").text(datalist.orgName);
249
							if(datalist.hasHeadImage == 1) {
250
								$itemlist.find("#userimg").attr("style", "background-image: url(/images/head/" + datalist.id + "_l.jpg);");
251
							}
252
							if(prEnd == prd){
253
								$(_this).next().removeClass("displayNone");
254
								var itemlist = '';
255
								$("#expertlist").html("");
256
								for(var i = 0; i < data.data.length; i++) {
257
									var itemlist = '<li id="usid" class="flexCenter">';
258
									itemlist += '<div class="madiaHead useHead" id="userimg"></div>';
259
									itemlist += '<div class="madiaInfo">';
260
									itemlist += '<p class="ellipsisSty"><span class="h1Font" id="name"></span><span class="h2Font" style="margin-left:10px;" id="title"></span></p>';
261
									itemlist += '<p class="h2Font ellipsisSty" id="orgName"></p>';
262
									itemlist += '</div><div class="deleteThis"></div></li>';
263
									$itemlist = $(itemlist);
264
									$("#expertlist").append($itemlist);
265
									var datalist = data.data[i];
266
									$itemlist.attr("data-id", datalist.id);
267
									$itemlist.find("#name").text(datalist.name);
268
									$itemlist.find("#title").text(datalist.title);
269
									$itemlist.find("#orgName").text(datalist.orgName);
270
									if(datalist.hasHeadImage == 1) {
271
										$itemlist.find("#userimg").attr("style", "background-image: url(/images/head/" + datalist.id + "_l.jpg);");
272
									}
273
							}		
252 274
						}
253 275
					} else {
254 276
						$(_this).next().addClass("displayNone");
@ -263,7 +285,8 @@ $(function() {
263 285
		});
264 286
	}
265 287

266
	function checkZy(_this) {
288
	function checkZy(_this,prd) {
289
		reEnd=prd;
267 290
		$.ajax({
268 291
			"url": "/ajax/resource/qaByName",
269 292
			"type": "get",
@ -275,30 +298,32 @@ $(function() {
275 298
				console.log(data);
276 299
				if(data.success) {
277 300
					if(data.data != "") {
278
						$(_this).next().removeClass("displayNone");
279
						var itemlist = '';
280
						$("#resouselist").html("");
281
						for(var i = 0; i < data.data.length; i++) {
282
							var itemlist = '<li id="usid" class="flexCenter">';
283
							itemlist += '<div class="madiaHead resouseHead" id="userimg"></div>';
284
							itemlist += '<div class="madiaInfo">';
285
							itemlist += '<p class="h1Font ellipsisSty" id="resourceName"></p>';
286
							itemlist += '<p class="h2Font ellipsisSty" id="name"></p>';
287
							itemlist += '</div><div class="deleteThis"></div></li>';
288
							$itemlist = $(itemlist);
289
							$("#resouselist").append($itemlist);
290
							var datalist = data.data[i];
291
							$itemlist.attr("data-id", datalist.resourceId);
292
							$itemlist.find("#resourceName").text(datalist.resourceName);
293
							if(datalist.resourceType==1){
294
								$itemlist.find("#name").text(datalist.professor.name);
295
							}else{
296
								$itemlist.find("#name").text(datalist.organization.name);
297
							}
298
							if(datalist.images.length > 0) {
299
								$itemlist.find("#userimg").attr("style", "background-image: url(/data/resource/" + datalist.images[0].imageSrc + ");");
300
							}
301
						}
301
						if(reEnd==prd) {
302
								$(_this).next().removeClass("displayNone");
303
								var itemlist = '';
304
								$("#resouselist").html("");
305
								for(var i = 0; i < data.data.length; i++) {
306
									var itemlist = '<li id="usid" class="flexCenter">';
307
									itemlist += '<div class="madiaHead resouseHead" id="userimg"></div>';
308
									itemlist += '<div class="madiaInfo">';
309
									itemlist += '<p class="h1Font ellipsisSty" id="resourceName"></p>';
310
									itemlist += '<p class="h2Font ellipsisSty" id="name"></p>';
311
									itemlist += '</div><div class="deleteThis"></div></li>';
312
									$itemlist = $(itemlist);
313
									$("#resouselist").append($itemlist);
314
									var datalist = data.data[i];
315
									$itemlist.attr("data-id", datalist.resourceId);
316
									$itemlist.find("#resourceName").text(datalist.resourceName);
317
									if(datalist.resourceType==1){
318
										$itemlist.find("#name").text(datalist.professor.name);
319
									}else{
320
										$itemlist.find("#name").text(datalist.organization.name);
321
									}
322
									if(datalist.images.length > 0) {
323
										$itemlist.find("#userimg").attr("style", "background-image: url(/data/resource/" + datalist.images[0].imageSrc + ");");
324
									}
325
								}
326
							}	
302 327
					} else {
303 328
						$(_this).next().addClass("displayNone");
304 329
					}

+ 107 - 69
js/articalModify.js

@ -7,7 +7,9 @@ $(function() {
7 7
    var $data = {};
8 8
    var modifyTimeval;
9 9
    var settime = false;
10
	
10
	var hbur,hburEnd;
11
  	var pr,prEnd;
12
  	var re,reEnd;
11 13
	articleshow();
12 14
	relevantExperts();
13 15
	relevantResources();
@ -36,17 +38,25 @@ $(function() {
36 38
			$("#keyPrompt").text("");
37 39
		},
38 40
		keyup: function() {
41
			var ti=$(this).val();
42
			hbur=ti;
39 43
			if($(this).val()==""){
40 44
				$(".frmadd").addClass("displayNone");
41 45
				$(".keydrop ul").html("");
42 46
				$(".keydrop").addClass("displayNone");
47
				return;
43 48
			}else{
44 49
				$(".frmadd").removeClass("displayNone");
45 50
			}
46 51
			if($(this).val().length > 15) {
47 52
				$(this).val($(this).val().substr(0, 15));
48 53
			}
49
			KeyWordList();
54
			setTimeout(function(){
55
				if( ti===hbur && ti!== hburEnd) {
56
					KeyWordList(ti);
57
				}
58
				
59
			},500)
50 60
		}
51 61
	})
52 62

@ -109,8 +119,8 @@ $(function() {
109 119
			$("#keyWordlist").append("<li class='delkeylist'><p class='h2Font'>" + keyWord + "</p><div class='closeThis'></div></li>");
110 120
		}
111 121
	}
112
	
113
	function KeyWordList() {
122
	function KeyWordList(seValue) {
123
		hburEnd=seValue;
114 124
		$.ajax({
115 125
			"url": "/ajax/dataDict/qaHotKey",
116 126
			"type": "get",
@ -119,19 +129,21 @@ $(function() {
119 129
			},
120 130
			"success": function(data) {
121 131
				console.log(data);
122
				if(data.success && data.data != "") {
123
					var itemlist = '';
124
					$("#keydropList").html("");
125
					for(var i = 0; i < 5; i++) {
126
						var itemlist = '<li><p class="h2Font"></p></li>';
127
						$itemlist = $(itemlist);
128
						$("#keydropList").append($itemlist);
129
						$itemlist.find(".h2Font").text(data.data[i].caption);
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");
130 143
					}
131
					$(".keydrop").removeClass("displayNone");
132 144
				} else {
133
					$(".keydrop").addClass("displayNone");
134
					$(".keydrop ul").html("");
145
					//$(".keydrop").addClass("displayNone");
146
					//$(".keydrop ul").html("");
135 147
				}
136 148
			},
137 149
			"error": function() {
@ -174,12 +186,32 @@ $(function() {
174 186
	
175 187
	$("#checkZj").on("keyup", function() {
176 188
		var _this = this;
177
		checkZj(_this);
189
		var ti=$(this).val();
190
		pr=ti;
191
		if($(this).val()=="") {
192
			return;
193
		}
194
		setTimeout(function(){
195
				if( ti===pr && ti!== prEnd) {
196
					checkZj(_this,ti);
197
				}
198
				
199
			},500)
178 200
	})
179 201

180 202
	$("#checkZy").on("keyup", function() {
203
		var ti=$(this).val();
204
		re=ti;
205
		if($(this).val()=="") {
206
			return;
207
		}
181 208
		var _this = this;
182
		checkZy(_this);
209
		setTimeout(function(){
210
				if( ti===re && ti!== reEnd) {
211
					checkZy(_this,ti);
212
				}
213
				
214
			},500)
183 215
	})
184 216
	
185 217
	$("#expertlist").on("click","li",function(){
@ -224,43 +256,46 @@ $(function() {
224 256
		$(this).parent().remove();
225 257
	})
226 258
	
227
	function checkZj(_this){
259
	function checkZj(_this,prd) {
260
		prEnd=prd;
228 261
		$.ajax({
229 262
			"url": "/ajax/professor/qaByName",
230 263
			"type": "get",
231 264
			"data": {
232 265
				"name": $("#checkZj").val(),
233
				"total":3
266
				"total": 3
234 267
			},
235 268
			"success": function(data) {
236 269
				console.log(data);
237
				if(data.success ) {
238
					if(data.data != ""){
239
						$(_this).next().removeClass("displayNone");
240
						var itemlist = '';
241
						$("#expertlist").html("");
242
						for(var i = 0; i < data.data.length; i++) {
243
							var itemlist = '<li id="usid" class="flexCenter">';
244
							itemlist += '<div class="madiaHead useHead" id="userimg"></div>';
245
							itemlist += '<div class="madiaInfo">';
246
							itemlist += '<p class="ellipsisSty"><span class="h1Font" id="name"></span><span class="h2Font" style="margin-left:10px;" id="title"></span></p>';
247
							itemlist += '<p class="h2Font ellipsisSty" id="orgName"></p>';
248
							itemlist += '</div><div class="deleteThis"></div></li>';
249
							$itemlist = $(itemlist);
250
							$("#expertlist").append($itemlist);
251
							var datalist = data.data[i];
252
							$itemlist.attr("data-id",datalist.id);
253
							$itemlist.find("#name").text(datalist.name);
254
							$itemlist.find("#title").text(datalist.title);
255
							$itemlist.find("#orgName").text(datalist.orgName);
256
							if(datalist.hasHeadImage==1) {
257
								$itemlist.find("#userimg").attr("style", "background-image: url(/images/head/" + datalist.id + "_l.jpg);");
258
							}
270
				if(data.success) {
271
					if(data.data != "") {
272
							if(prEnd == prd){
273
								$(_this).next().removeClass("displayNone");
274
								var itemlist = '';
275
								$("#expertlist").html("");
276
								for(var i = 0; i < data.data.length; i++) {
277
									var itemlist = '<li id="usid" class="flexCenter">';
278
									itemlist += '<div class="madiaHead useHead" id="userimg"></div>';
279
									itemlist += '<div class="madiaInfo">';
280
									itemlist += '<p class="ellipsisSty"><span class="h1Font" id="name"></span><span class="h2Font" style="margin-left:10px;" id="title"></span></p>';
281
									itemlist += '<p class="h2Font ellipsisSty" id="orgName"></p>';
282
									itemlist += '</div><div class="deleteThis"></div></li>';
283
									$itemlist = $(itemlist);
284
									$("#expertlist").append($itemlist);
285
									var datalist = data.data[i];
286
									$itemlist.attr("data-id", datalist.id);
287
									$itemlist.find("#name").text(datalist.name);
288
									$itemlist.find("#title").text(datalist.title);
289
									$itemlist.find("#orgName").text(datalist.orgName);
290
									if(datalist.hasHeadImage == 1) {
291
										$itemlist.find("#userimg").attr("style", "background-image: url(/images/head/" + datalist.id + "_l.jpg);");
292
									}
293
							}		
259 294
						}
260
					}else{
295
					} else {
261 296
						$(_this).next().addClass("displayNone");
262 297
					}
263
				}else{
298
				} else {
264 299
					$(_this).next().addClass("displayNone");
265 300
				}
266 301
			},
@ -269,8 +304,9 @@ $(function() {
269 304
			}
270 305
		});
271 306
	}
272
	
273
		function checkZy(_this) {
307

308
	function checkZy(_this,prd) {
309
		reEnd=prd;
274 310
		$.ajax({
275 311
			"url": "/ajax/resource/qaByName",
276 312
			"type": "get",
@ -282,30 +318,32 @@ $(function() {
282 318
				console.log(data);
283 319
				if(data.success) {
284 320
					if(data.data != "") {
285
						$(_this).next().removeClass("displayNone");
286
						var itemlist = '';
287
						$("#resouselist").html("");
288
						for(var i = 0; i < data.data.length; i++) {
289
							var itemlist = '<li id="usid" class="flexCenter">';
290
							itemlist += '<div class="madiaHead resouseHead" id="userimg"></div>';
291
							itemlist += '<div class="madiaInfo">';
292
							itemlist += '<p class="h1Font ellipsisSty" id="resourceName"></p>';
293
							itemlist += '<p class="h2Font ellipsisSty" id="name"></p>';
294
							itemlist += '</div><div class="deleteThis"></div></li>';
295
							$itemlist = $(itemlist);
296
							$("#resouselist").append($itemlist);
297
							var datalist = data.data[i];
298
							$itemlist.attr("data-id", datalist.resourceId);
299
							$itemlist.find("#resourceName").text(datalist.resourceName);
300
							if(datalist.resourceType==1){
301
								$itemlist.find("#name").text(datalist.professor.name);
302
							}else{
303
								$itemlist.find("#name").text(datalist.organization.name);
304
							}
305
							if(datalist.images.length > 0) {
306
								$itemlist.find("#userimg").attr("style", "background-image: url(/data/resource/" + datalist.images[0].imageSrc + ");");
307
							}
308
						}
321
						if(reEnd==prd) {
322
								$(_this).next().removeClass("displayNone");
323
								var itemlist = '';
324
								$("#resouselist").html("");
325
								for(var i = 0; i < data.data.length; i++) {
326
									var itemlist = '<li id="usid" class="flexCenter">';
327
									itemlist += '<div class="madiaHead resouseHead" id="userimg"></div>';
328
									itemlist += '<div class="madiaInfo">';
329
									itemlist += '<p class="h1Font ellipsisSty" id="resourceName"></p>';
330
									itemlist += '<p class="h2Font ellipsisSty" id="name"></p>';
331
									itemlist += '</div><div class="deleteThis"></div></li>';
332
									$itemlist = $(itemlist);
333
									$("#resouselist").append($itemlist);
334
									var datalist = data.data[i];
335
									$itemlist.attr("data-id", datalist.resourceId);
336
									$itemlist.find("#resourceName").text(datalist.resourceName);
337
									if(datalist.resourceType==1){
338
										$itemlist.find("#name").text(datalist.professor.name);
339
									}else{
340
										$itemlist.find("#name").text(datalist.organization.name);
341
									}
342
									if(datalist.images.length > 0) {
343
										$itemlist.find("#userimg").attr("style", "background-image: url(/data/resource/" + datalist.images[0].imageSrc + ");");
344
									}
345
								}
346
							}	
309 347
					} else {
310 348
						$(_this).next().addClass("displayNone");
311 349
					}

+ 22 - 11
js/resourceIssue.js

@ -9,6 +9,7 @@ $(document).ready(function() {
9 9
	var userid = $.cookie("userid");
10 10
	var temp = [];
11 11
	var array=[];
12
	var hbur,hburEnd;
12 13
	ue = UE.getEditor('editor', {});
13 14
	/*获取资源信息*/
14 15
	function getRecourceMe() {
@ -223,41 +224,51 @@ $(document).ready(function() {
223 224
			$("#keywordPrompt").text('');
224 225
		},
225 226
		keyup: function() {
227
			var ti=$(this).val();
228
			hbur=ti;
226 229
			var lNum=$.trim($(this).val()).length;
227 230
			console.log(lNum);
228 231
			if(lNum > 15) {
229 232
				$(this).val($(this).val().substr(0, 15));
230 233
			} else if(0 < lNum&& lNum < 15) {
231 234
					$("#addKeyword").show();
235
					setTimeout(function(){
236
						if( ti===hbur && ti!== hburEnd) {
237
							var tt=ti;
238
							hburEnd=tt;
232 239
						$.ajax({
233 240
						"url": "/ajax/dataDict/qaHotKey",
234 241
						"type": "GET",
235 242
						"success": function(data) {
236 243
							console.log(data);
237 244
							if(data.success) {
238
								if(data.data.length==0) {
239
									$("#keyList").addClass("displayNone");
240
									$("#keyList ul").html("");
241
								}else{
242
									$("#keyList").removeClass("displayNone");
243
									var oSr="";
244
									for(var i=0;i<5;i++) {
245
										oSr+='<li><p class="h2Font">'+data.data[i].caption+'</p></li>'
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);
246 256
									}
247
									$("#keyList ul").html(oSr);
248
								}
257
								}	
249 258
							}else {
250 259
								$("#keyList ul").html("");
251 260
							}
252 261
						},
253 262
						"data": {
254
							"key":$(this).val()
263
							"key":$('#keywordName').val()
255 264
						},
256 265
						dataType: "json",
257 266
						'error':function() {
258 267
							$.MsgBox.Alert('提示', '服务器连接超时!');
259 268
						}
260 269
				});
270
				}
271
				},500)
261 272
			}else if(lNum == 0){
262 273
				 $("#addKeyword").hide();
263 274
				 $("#keyList ul").html("");