KMS首页、目录模糊搜索代码提交
This commit is contained in:
parent
eeb1f7ad5f
commit
1a54793364
@ -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;
|
||||||
|
|||||||
@ -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>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user