| | |
| | | <el-divider /> |
| | | <div class="mainBox"> |
| | | <div class="leftTree"> |
| | | <el-input v-model="filterInput"></el-input> |
| | | <div style="width:450px"> |
| | | <el-tree |
| | | :data="domainData" |
| | | :props="defaultProps" |
| | | :default-expand-all="true" |
| | | @node-click="toggleTabs" |
| | | :filter-node-method="filterNode" |
| | | ref="tree" |
| | | ></el-tree> |
| | | </div> |
| | | </div> |
| | |
| | | components: { MyBread }, |
| | | data() { |
| | | return { |
| | | filterInput: '', |
| | | domainOptions: [], |
| | | multipleSelection: [], |
| | | behavior: '', |
| | |
| | | return this.$store.state.cataNode.id; |
| | | }, |
| | | }, |
| | | |
| | | methods: { |
| | | filterNode(value, data) { |
| | | if (!value) return true; |
| | | |
| | | return data.val.indexOf(value) !== -1; |
| | | }, |
| | | async toggleTabs(data) { |
| | | this.fullscreenLoading = true; |
| | | this.listData.ns = data.ns; |
| | |
| | | let bdres = res.result.filter((item) => item.ns == 'bd'); |
| | | let bsres = res.result.filter((item) => item.ns == 'bs'); |
| | | for (var i in bdres) { |
| | | bdres[i].val = bdres[i].tabDesc + '(' + bdres[i].tab + ')'; |
| | | // bdres[i].val = bdres[i].tabDesc + '(' + bdres[i].tab + ')'; |
| | | bdres[i].val = bdres[i].tabDesc; |
| | | } |
| | | for (var i in bsres) { |
| | | bsres[i].val = bsres[i].tabDesc + '(' + bsres[i].tab + ')'; |
| | | // bsres[i].val = bsres[i].tabDesc + '(' + bsres[i].tab + ')'; |
| | | bsres[i].val = bsres[i].tabDesc; |
| | | } |
| | | this.domainData[0].children = bdres; |
| | | this.domainData[1].children = bsres; |
| | |
| | | immediate: true, |
| | | handler(val) { }, |
| | | }, |
| | | filterInput(val) { |
| | | this.$refs.tree.filter(val); |
| | | } |
| | | }, |
| | | }; |
| | | </script> |