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