|
@@ -464,7 +464,7 @@ $(function(){
|
|
|
liobj.next(".child-node").find("li:eq(1)").append('<div class="com-last">全国</div>');
|
|
|
}
|
|
|
}
|
|
|
- var setKeyWord = function(type,keys){
|
|
|
+ var setKeyWord = function(type,keys,searchnameIsExsit){
|
|
|
if(typeof(keys) == "undefined" || keys.length == 0){
|
|
|
return;
|
|
|
}
|
|
@@ -472,7 +472,13 @@ $(function(){
|
|
|
keys[i] = keys[i].replace(/\+/g," ");
|
|
|
KeyWordDialog.AppendNode($("#"+type+"-keyword"),keys[i]);
|
|
|
}
|
|
|
- $("#"+type+"-content li:first").append('<div class="com-last">'+keys.join(";")+'</div>');
|
|
|
+ if(!searchnameIsExsit){
|
|
|
+ $("#"+type+"-content li:first .com-last").remove();
|
|
|
+ $("#"+type+"-content li:first").append('<div class="com-last">'+keys.join(";")+'</div>');
|
|
|
+ commonAjaxReq($("#tender-keyword"),type);
|
|
|
+ }else{
|
|
|
+ $("#"+type+"-content li:first").append('<div class="com-last">'+keys.join(";")+'</div>');
|
|
|
+ }
|
|
|
}
|
|
|
var setScope = function(type,scope){
|
|
|
var dialogObj = $("#"+type+"-scope");
|
|
@@ -499,7 +505,7 @@ $(function(){
|
|
|
$("body").append($("#tender-keyword").clone().removeAttr("id").attr("id","bid-keyword"))
|
|
|
.append($("#tender-scope").clone().removeAttr("id").attr("id","bid-scope"));
|
|
|
if(typeof(msgset.tender) != "undefined"){
|
|
|
- //setKeyWord("tender",msgset.tender.a_key);
|
|
|
+ setKeyWord("tender",msgset.tender.a_key,false);
|
|
|
setScope("tender",msgset.tender.s_scope);
|
|
|
if(msgset.tender.i_switchstatus){
|
|
|
turnOn($("#tender-on-off"));
|
|
@@ -510,7 +516,7 @@ $(function(){
|
|
|
}
|
|
|
}
|
|
|
if(typeof(msgset.bid) != "undefined"){
|
|
|
- //setKeyWord("bid",msgset.bid.a_key);
|
|
|
+ setKeyWord("bid",msgset.bid.a_key,false);
|
|
|
setScope("bid",msgset.bid.s_scope);
|
|
|
if(msgset.bid.i_switchstatus){
|
|
|
turnOn($("#bid-on-off"));
|
|
@@ -581,34 +587,32 @@ $(function(){
|
|
|
alert("请输入关键字后预览。")
|
|
|
}
|
|
|
})
|
|
|
- if (searchname.length > 0 ){
|
|
|
+ if (typeof(searchname) != "undefined" && searchname.length > 0 ){
|
|
|
if(typeof(msgset[s_type]) != "undefined"){
|
|
|
var keywordes = msgset[s_type].a_key
|
|
|
if(keywordes && keywordes.length > 0){
|
|
|
- console.log(keywordes)
|
|
|
- console.log(searchname)
|
|
|
- console.log(s_type)
|
|
|
- for (var i=0;i<keywordes.length;i++){
|
|
|
- if (keywordes[i] != searchname){
|
|
|
- if (i == keywordes.length-1 ){
|
|
|
- keywordes.push(searchname)
|
|
|
+ var searchnameIsExsit = false;
|
|
|
+ for(var i=0;i<keywordes.length;i++){
|
|
|
+ var keywordesArr = keywordes[i].split("+");
|
|
|
+ for(var k=0;k<keywordesArr.length;k++){
|
|
|
+ if(keywordesArr[k] == searchname){
|
|
|
+ searchnameIsExsit = true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- console.log(keywordes)
|
|
|
- console.log(searchname)
|
|
|
- console.log(s_type)
|
|
|
- setKeyWord(s_type,keywordes);
|
|
|
+ if(!searchnameIsExsit){
|
|
|
+ keywordes.push(searchname);
|
|
|
+ }
|
|
|
}else{
|
|
|
keywordes.push(searchname)
|
|
|
- setKeyWord(s_type,keywordes);
|
|
|
}
|
|
|
- turnOn($("#"+s_type +"-on-off"));
|
|
|
+
|
|
|
}else{
|
|
|
- keywordes.push(searchname)
|
|
|
- setKeyWord(s_type,keywordes);
|
|
|
- turnOn($("#"+s_type +"-on-off"));
|
|
|
+ keywordes.push(searchname);
|
|
|
+ }
|
|
|
+ setKeyWord(s_type,keywordes,searchnameIsExsit);
|
|
|
+ if(!$("#"+s_type +"-on-off").hasClass("open")){
|
|
|
+ $("#"+s_type+"-on-off").click();
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
});
|