KMS首页、目录模糊搜索代码提交

This commit is contained in:
zhaol 2025-07-08 14:54:17 +08:00
parent eeb1f7ad5f
commit 1a54793364
2 changed files with 54 additions and 21 deletions

View File

@ -123,7 +123,7 @@
rowsPerPage: 0, rowsPerPage: 0,
searchText: encodeURIComponent(keyword), searchText: encodeURIComponent(keyword),
docTypes: JSON.stringify([]),// ["pdf", "doc", "ppt", "xls", "txt"] docTypes: JSON.stringify([]),// ["pdf", "doc", "ppt", "xls", "txt"]
searchType: "1"//1 2 searchType: "2"//1 2
}, },
}).then(function (r) { }).then(function (r) {
that.isLoadingData = false; that.isLoadingData = false;

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="knwldir"> <div class="knwldir">
<van-search v-model="value" placeholder="请输入文件内容关键词" @allSearch="getDimensionCardList"/> <van-search v-model="value" placeholder="请输入文件内容关键词" />
<div class="top" ref="top"> <div class="top" ref="top">
<span v-for="(item,index) in tablist" :key="index" > <span v-for="(item,index) in tablist" :key="index" >
<span class="tabname" :style="(index<(tablist.length-1)?'color: #378DEC;':'color: #333;')" @click="(index<(tablist.length-1)?backtop(item.id,item.parentHasPerm):'')">{{item.name}}</span> <span class="tabname" :style="(index<(tablist.length-1)?'color: #378DEC;':'color: #333;')" @click="(index<(tablist.length-1)?backtop(item.id,item.parentHasPerm):'')">{{item.name}}</span>
@ -128,7 +128,8 @@
activeCardName:"", activeCardName:"",
cardId:'', cardId:'',
isDimensionManager:false, isDimensionManager:false,
isNeedBorrow:false // isNeedBorrow:false, //
tmpList:[],
} }
}, },
methods:{ methods:{
@ -374,6 +375,7 @@
}, },
}).then(function (r) { }).then(function (r) {
that.initLoad = false; that.initLoad = false;
that.loading = false; that.loading = false;
that.isLoadingData = false; that.isLoadingData = false;
@ -395,15 +397,9 @@
} }
that.contentH = "height:"+(window.innerHeight-54-that.$refs.top.clientHeight)+"px"; that.contentH = "height:"+(window.innerHeight-54-that.$refs.top.clientHeight)+"px";
}); });
}
}, },
watch:{ //
value:function () { initData(){
this.curPage=0;
this.getDimensionCardList(this.currentParentId);
}
},
mounted() {
let dimendionId=''; let dimendionId='';
this.contentH = "height:"+(window.innerHeight-90)+"px"; this.contentH = "height:"+(window.innerHeight-90)+"px";
let tmphasPerm = this.$route.params.hasPerm; let tmphasPerm = this.$route.params.hasPerm;
@ -419,7 +415,44 @@
if(this.hasPerm ){ if(this.hasPerm ){
this.getDimensionCardList(dimendionId); this.getDimensionCardList(dimendionId);
} }
},
searchCardName(){
let that = this;
if(that.value===''){
that.initData();
} }
let resultdata = [];
that.list.forEach((item) => {
if (item.name.indexOf(that.value) > -1 ) {
resultdata.push(item);
}
})
let resultdatas = [];
that.cardlist.forEach((item) => {
if (item.cardName.indexOf(that.value) > -1 ) {
resultdatas.push(item);
}
})
that.list=resultdata;
that.cardlist=resultdatas;
},
},
watch:{
value:function () {
let that = this;
this.curPage=0;
//this.getDimensionCardList(this.currentParentId);
that.searchCardName();
}
},
mounted() {
this.initData(); //
}
} }
</script> </script>