Commit 42591206 by chenwq

feat(提现页面自定义标签抽屉): 添加根标签节点的折叠展开功能

新增rootExpanded状态变量控制根节点展开收起状态,添加toggleRoot方法处理点击切换逻辑,动态切换根节点箭头图标,收起时隐藏标签树,同时为根名称添加指针光标和禁止选中样式
1 parent 99963a37
......@@ -6,13 +6,13 @@
</div>
<div class="tag-tree-body">
<div class="tag-root-node">
<span class="tag-root-name">
<i class="el-icon-caret-bottom"></i>
<span class="tag-root-name" @click="toggleRoot">
<i :class="rootExpanded ? 'el-icon-caret-bottom' : 'el-icon-caret-right'"></i>
全部
</span>
<i class="el-icon-plus tag-root-add" @click="handleAddRoot"></i>
</div>
<el-tree ref="tagTree" :data="tagTree" :props="treeProps" node-key="id" default-expand-all :expand-on-click-node="false" :highlight-current="true" empty-text="暂无标签">
<el-tree v-show="rootExpanded" ref="tagTree" :data="tagTree" :props="treeProps" node-key="id" default-expand-all :expand-on-click-node="false" :highlight-current="true" empty-text="暂无标签">
<div class="tag-tree-node" slot-scope="{ node, data }">
<span class="tag-node-name" :title="data.name">{{ data.name }}</span>
<el-popover v-model="data.popoverVisible" placement="bottom-end" width="128" trigger="click" popper-class="tag-node-popover">
......@@ -52,6 +52,7 @@ export default {
isVisible: false,
loading: false,
tagTree: [],
rootExpanded: true,
tagDialogVisible: false,
tagFormInfo: {},
treeProps: {
......@@ -108,6 +109,9 @@ export default {
}
this.tagDialogVisible = true
},
toggleRoot() {
this.rootExpanded = !this.rootExpanded
},
handleAdd(data) {
data.popoverVisible = false
this.tagFormInfo = {
......@@ -209,6 +213,8 @@ export default {
.tag-root-name {
display: flex;
align-items: center;
cursor: pointer;
user-select: none;
i {
margin-right: 6px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!