修改 83399,国内外政策-入库--选择政策体系页面的样式建议调整并增加搜索功能

This commit is contained in:
baoyu
2024-04-10 14:16:06 +08:00
parent 535d0c6d2e
commit 5ba01fb10b
@@ -1,17 +1,24 @@
<template>
<el-drawer
title="政策体系"
:visible.sync="visible"
title="政策体系"
:visible.sync="visible"
>
<el-input v-model="filterText" placeholder="请输入政策体系" class="filterInput" style="width: 100%;padding: 10px 5px"/>
<div style="flex: 1">
<el-tree
ref="tree"
:data="treeList"
:props="defaultProps"
node-key="id"
highlight-current
:expand-on-click-node="false"
/>
ref="tree"
:data="treeList"
:props="defaultProps"
node-key="id"
highlight-current
:filter-node-method="filterNode"
:expand-on-click-node="false"
>
<span slot-scope="{ node, data }" class="custom-tree-node">
<span :class="data.children.length !== 0 ? 'is-show' : 'is-leaf-none'" />
<span style="font-size:12px"> {{ node.label }} </span>
</span>
</el-tree>
</div>
<div class="demo-drawer-footer" style="height: 51px">
<el-button size="mini" @click="cancel">取消</el-button>
@@ -28,6 +35,7 @@ export default {
visible: false,
getListStand: 'sarResource/ts-resource/getListStandIgnoreMyCollection',
treeList: [],
filterText: '',
defaultProps: {
children: 'children',
label: 'menuName'
@@ -37,7 +45,16 @@ export default {
mounted () {
this.getList()
},
watch: {
filterText (val) {
this.$refs.tree.filter(val);
},
},
methods: {
filterNode (value, data) {
if (!value) return true;
return data.menuName.indexOf(value) !== -1;
},
getList () {
this.$http._getData(this.getListStand, {
sorDivide: 'FOREIGN_LAWS',
@@ -51,9 +68,10 @@ export default {
open (key) {
this.visible = true
this.$nextTick(() => {
this.filterText = ''
key === '' ?
this.$refs.tree.setCurrentKey() :
this.$refs.tree.setCurrentKey(key)
this.$refs.tree.setCurrentKey() :
this.$refs.tree.setCurrentKey(key)
})
},
cancel () {
@@ -76,5 +94,20 @@ export default {
</script>
<style scoped>
/deep/ .is-leaf-none{
position: relative;
display: inline-block;
width: 15px;
height: 15px;
background: url('~@/assets/images/shangqi/img/none-file-new.png');
background-size:100% 100%;
}
/deep/ .is-show{
position: relative;
display: inline-block;
width: 15px;
height: 15px;
background:url('~@/assets/images/shangqi/img/tree.png');
background-size:100% 100%;
}
</style>