Commit 42591206 by chenwq

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

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