bug:国内/外标准法规,左侧节点树上方需添加节点查询功能

This commit is contained in:
fanlin
2021-07-24 14:26:45 +08:00
parent c0330e329d
commit 3a5dd8ed1d
2 changed files with 31 additions and 1 deletions
@@ -3,6 +3,10 @@
<div id="domesticStandardDatabase" :class="{ 'tree-close': sideClose }" class="demo-spin-article v-class"> <div id="domesticStandardDatabase" :class="{ 'tree-close': sideClose }" class="demo-spin-article v-class">
<div class="tree-content" :class="{ 'tree-closed': sideClose }"> <div class="tree-content" :class="{ 'tree-closed': sideClose }">
<div class="tree"> <div class="tree">
<el-input
placeholder="输入国内标准法规"
v-model="filterText">
</el-input>
<el-tree <el-tree
ref="tree" ref="tree"
node-key="id" node-key="id"
@@ -11,6 +15,7 @@
:data="treeList" :data="treeList"
highlight-current highlight-current
@node-click="treeClick" @node-click="treeClick"
:filter-node-method="filterNode"
default-expand-all default-expand-all
:expand-on-click-node="false"> :expand-on-click-node="false">
<span class="custom-tree-node" slot-scope="{ node, data }" @mouseenter="mouseenter(data)" @mouseleave="mouseleave(data)"> <span class="custom-tree-node" slot-scope="{ node, data }" @mouseenter="mouseenter(data)" @mouseleave="mouseleave(data)">
@@ -1286,6 +1291,7 @@ export default {
}, },
data () { data () {
return { return {
filterText: '', // 国内法规过滤
props: { props: {
label: 'menuName', label: 'menuName',
children: 'children' children: 'children'
@@ -1943,7 +1949,17 @@ export default {
textStatusMap: {} // 文本状态id与name对应 textStatusMap: {} // 文本状态id与name对应
} }
}, },
watch: {
filterText(val) {
this.$refs.tree.filter(val);
}
},
methods: { methods: {
// 国内标签过滤
filterNode(value, data) {
if (!value) return true;
return data.menuName.indexOf(value) !== -1;
},
choiceZRR1 (type, title, id) { choiceZRR1 (type, title, id) {
this.drawerTitle = title this.drawerTitle = title
this.modalShowFlag1 = true this.modalShowFlag1 = true
@@ -3,6 +3,10 @@
<div id="foreignStandardsAndRegulations" :class="{ 'tree-close': sideClose }" class="demo-spin-article v-class"> <div id="foreignStandardsAndRegulations" :class="{ 'tree-close': sideClose }" class="demo-spin-article v-class">
<div class="tree-content" :class="{ 'tree-closed': sideClose }"> <div class="tree-content" :class="{ 'tree-closed': sideClose }">
<div class="tree"> <div class="tree">
<el-input
placeholder="输入海外标准法规"
v-model="filterText">
</el-input>
<el-tree <el-tree
ref="tree" ref="tree"
node-key="id" node-key="id"
@@ -11,6 +15,7 @@
:data="treeList" :data="treeList"
highlight-current highlight-current
@node-click="treeClick" @node-click="treeClick"
:filter-node-method="filterNode"
default-expand-all default-expand-all
:expand-on-click-node="false"> :expand-on-click-node="false">
<span class="custom-tree-node" slot-scope="{ node, data }" @mouseenter="mouseenter(data)" @mouseleave="mouseleave(data)"> <span class="custom-tree-node" slot-scope="{ node, data }" @mouseenter="mouseenter(data)" @mouseleave="mouseleave(data)">
@@ -1741,14 +1746,23 @@ export default {
displayLocation: [], displayLocation: [],
orgData: [], orgData: [],
delLoading: false, delLoading: false,
standState: '' standState: '',
filterText: ''
} }
}, },
props: { props: {
}, },
watch: { watch: {
filterText(val) {
this.$refs.tree.filter(val);
}
}, },
methods: { methods: {
// 海外标签过滤
filterNode(value, data) {
if (!value) return true;
return data.menuName.indexOf(value) !== -1;
},
choiceZRR2 (type, title, id) { choiceZRR2 (type, title, id) {
this.drawerTitle = title this.drawerTitle = title
this.modalShowFlag2 = true this.modalShowFlag2 = true