Browse Source

企业资源发布

jack 7 years ago
parent
commit
1ad328f037
2 changed files with 15 additions and 5 deletions
  1. 14 4
      cmp-portal/js/resourceIssue.js
  2. 1 1
      cmp-portal/resourceIssue.html

+ 14 - 4
cmp-portal/js/resourceIssue.js

@ -200,7 +200,7 @@ $(document).ready(function() {
200 200
	/*关键词*/
201 201
	$("#keywordName").bind({
202 202
		focus: function() {
203
			$("#keywordPrompt").show().text('最多可添加5个关键词每个关键词最多10个字');
203
			$("#keywordPrompt").show().text('最多可添加5个关键词每个关键词10字以内');
204 204
			$("#keyList").show();
205 205
		},
206 206
		blur: function() {
@ -210,9 +210,11 @@ $(document).ready(function() {
210 210
			}, 200)
211 211
		},
212 212
		keyup: function() {
213
			if($(this).val().length > 10) {
213
			var lNum=$.trim($(this).val()).length;
214
			if(lNum > 10) {
214 215
				$(this).val($(this).val().substr(0, 10));
215
			} else if(0 < $(this).val().length < 10) {
216
			} else if(0 < lNum && lNum < 10) {
217
				$("#addKeyword").show();
216 218
				$.ajax({
217 219
					"url": "/ajax/dataDict/qaHotKey",
218 220
					"type": "GET",
@ -238,19 +240,23 @@ $(document).ready(function() {
238 240
						$.MsgBox.Alert('提示', '服务器连接超时!');
239 241
					}
240 242
				});
243
			}if(lNum == 0){
244
				 $("#addKeyword").hide();
245
				 $("#keyList ul").html("");
241 246
			}
242 247
		}
243 248
	})
244 249
	$("#keyList ul").on("click","li",function(){
245 250
		 keyWord($(this).find("p").text());
246 251
		 $("#keyList ul").html("");
252
		  $("#addKeyword").hide();
247 253
	})
248 254
	/*添加关键词*/
249 255
	$("#addKeyword").click(function() {
250 256
		 keyWord($("#keywordName").val());
251 257
	})
252 258
	function keyWord(atl) {
253
		var oKeywordName = atl;
259
		var oKeywordName =$.trim(atl);
254 260
		var keywordListLength = $("#keywordList").find("li");
255 261
		if(oKeywordName.length == 0) {
256 262
			$("#keywordPrompt").text('关键词输入不能为空');
@ -262,11 +268,14 @@ $(document).ready(function() {
262 268
				return;
263 269
			}
264 270
		}
271
		$("#keyList ul").html("");
272
		 $("#addKeyword").hide();
265 273
		var oStr = '<li><p class="h2Font">' + oKeywordName + '</p><div class="closeThis"></div></li>'
266 274
		$("#keywordList").append(oStr);
267 275
		$("#keywordName").val("");
268 276
		if((keywordListLength.length + 1) == 5) {
269 277
			$("#keywordHide").hide();
278
			$("#keyList").css("border-top","none");
270 279
		}
271 280
	}
272 281
	/*删除关键词*/
@ -275,6 +284,7 @@ $(document).ready(function() {
275 284
		var keywordListLength = $("#keywordList").find("li");
276 285
		if(keywordListLength.length < 5) {
277 286
			$("#keywordHide").show();
287
			$(".#keyList").css("border-top","1px solid #E5E5E5");	
278 288
		}
279 289
	});
280 290
	/*应用用途*/

+ 1 - 1
cmp-portal/resourceIssue.html

@ -53,7 +53,7 @@
53 53
						<div style="position: relative;" id="keywordHide">
54 54
							<input type="text" class="frmtype frmcontype" id="keywordName" value="" placeholder="请输入关键词" />
55 55
							<!--输入框中键入内容时按钮显示,添加内容出现在结果标签中时按钮隐藏-->
56
							<button class="frmcontype frmadd" id="addKeyword">添加</button>
56
							<button class="frmcontype frmadd displayNone" id="addKeyword">添加</button>
57 57
						</div>
58 58
						<div class="form-drop keydrop displayNone"  id="keyList">
59 59
							<ul>