| | |
| | | {{ item }} |
| | | </el-tag> |
| | | </div> |
| | | <avue-input v-model="searchText" placeholder="查询" size="mini" prefixIcon="el-icon-search" style="width: 300px;max-width: 30%"></avue-input> |
| | | <avue-input v-model="searchText" @change="handleSearch" placeholder="查询" size="mini" prefixIcon="el-icon-search" style="width: 300px;max-width: 30%"></avue-input> |
| | | </div> |
| | | <div style="height: 60vh"> |
| | | <el-tabs v-model="activeName" @tab-click="handleTabClick"> |
| | |
| | | searchText:'', |
| | | activeName:'', |
| | | svgHtml:'', |
| | | allIconList:[], |
| | | iconList:[] |
| | | } |
| | | }, |
| | |
| | | } else { |
| | | this.iconList = getStore({ name:'icons'}); |
| | | } |
| | | this.allIconList=this.iconList; |
| | | if(this.iconList && this.iconList.length>0){ |
| | | this.activeName=this.iconList[0].label; |
| | | }else { |
| | | getIcons().then(res => { |
| | | /*getIcons().then(res => { |
| | | this.iconList=res.data.data; |
| | | this.allIconList=this.iconList; |
| | | store.dispatch("setIcons", this.iconList); |
| | | if(this.iconList&&this.iconList.length>0) { |
| | | this.activeName=this.iconList[0].label; |
| | | } |
| | | }) |
| | | })*/ |
| | | } |
| | | }, |
| | | methods:{ |
| | | dialogClose() { |
| | | this.visible = false; |
| | | }, |
| | | handleFocus() {debugger; |
| | | handleFocus() { |
| | | if (!this.disabled) { |
| | | if(this.iconList&&this.iconList.length>0) { |
| | | this.activeName=this.iconList[0].label; |
| | |
| | | } else { |
| | | this.iconList = getStore({ name:'icons'}); |
| | | } |
| | | this.allIconList=this.iconList; |
| | | if(this.iconList && this.iconList.length>0){ |
| | | this.activeName=this.iconList[0].label; |
| | | }else { |
| | | getIcons().then(res => { |
| | | /*getIcons().then(res => { |
| | | this.iconList=res.data.data; |
| | | this.allIconList=this.iconList; |
| | | store.dispatch("setIcons", this.iconList); |
| | | if(this.iconList&&this.iconList.length>0) { |
| | | this.activeName=this.iconList[0].label; |
| | | } |
| | | }) |
| | | })*/ |
| | | } |
| | | } |
| | | this.visible = true; |
| | |
| | | }else { |
| | | this.checkedTypes.push(type) |
| | | } |
| | | //按照分类过滤图标 |
| | | if(this.checkedTypes.length==0){ |
| | | this.iconList=this.allIconList |
| | | }else{ |
| | | this.iconList=this.allIconList.filter(item=> { |
| | | return this.checkedTypes.includes(item.type); |
| | | }) |
| | | } |
| | | this.activeName=this.iconList[0].label; |
| | | }, |
| | | handleTabClick(tab, event){ |
| | | |
| | | }, |
| | | handleSearch(data){ |
| | | if(data.value==''){ |
| | | this.iconList=this.allIconList; |
| | | } |
| | | let iconList=[] |
| | | this.allIconList.forEach(item=> { |
| | | iconList.push({ |
| | | label:item.label, |
| | | type:item.type, |
| | | list: item.list.filter(iconItem=>{ |
| | | return iconItem.name.replace(item.label,'').indexOf(data.value)!=-1; |
| | | }) |
| | | }) |
| | | }) |
| | | this.iconList=iconList; |
| | | }, |
| | | clearValue(){ |
| | | this.svgHtml=''; |
| | | this.$emit('input','') |