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,
searchText: encodeURIComponent(keyword),
docTypes: JSON.stringify([]),// ["pdf", "doc", "ppt", "xls", "txt"]
searchType: "1"//1 2
searchType: "2"//1 2
},
}).then(function (r) {
that.isLoadingData = false;

View File

@ -1,6 +1,6 @@
<template>
<div class="knwldir">
<van-search v-model="value" placeholder="请输入文件内容关键词" @allSearch="getDimensionCardList"/>
<van-search v-model="value" placeholder="请输入文件内容关键词" />
<div class="top" ref="top">
<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>
@ -128,7 +128,8 @@
activeCardName:"",
cardId:'',
isDimensionManager:false,
isNeedBorrow:false //
isNeedBorrow:false, //
tmpList:[],
}
},
methods:{
@ -374,6 +375,7 @@
},
}).then(function (r) {
that.initLoad = false;
that.loading = false;
that.isLoadingData = false;
@ -395,31 +397,62 @@
}
that.contentH = "height:"+(window.innerHeight-54-that.$refs.top.clientHeight)+"px";
});
}
},
//
initData(){
let dimendionId='';
this.contentH = "height:"+(window.innerHeight-90)+"px";
let tmphasPerm = this.$route.params.hasPerm;
if(tmphasPerm==undefined){
tmphasPerm= localStorage.getItem("dimensionhasPerm");
dimendionId = localStorage.getItem("dimensionhasId");
this.tablist = JSON.parse(localStorage.getItem("dimensionhasPath"));
}
this.getDimensionList(dimendionId);
if(tmphasPerm!=undefined){
this.hasPerm = tmphasPerm;
}
if(this.hasPerm ){
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);
}
//this.getDimensionCardList(this.currentParentId);
that.searchCardName();
}
},
mounted() {
let dimendionId='';
this.contentH = "height:"+(window.innerHeight-90)+"px";
let tmphasPerm = this.$route.params.hasPerm;
if(tmphasPerm==undefined){
tmphasPerm= localStorage.getItem("dimensionhasPerm");
dimendionId = localStorage.getItem("dimensionhasId");
this.tablist = JSON.parse(localStorage.getItem("dimensionhasPath"));
}
this.getDimensionList(dimendionId);
if(tmphasPerm!=undefined){
this.hasPerm = tmphasPerm;
}
if(this.hasPerm ){
this.getDimensionCardList(dimendionId);
}
this.initData(); //
}
}
</script>