| | |
| | | <template #default="{ node }"> |
| | | <div class="tree-node"> |
| | | <!-- 节点名称 --> |
| | | <span>{{ node.label }}</span> |
| | | <span class="nodeName">{{ node.label }}</span> |
| | | <!-- 操作按钮组 --> |
| | | <div class="tree-node-actions"> |
| | | <el-button |
| | | link |
| | | |
| | | icon="el-icon-location" |
| | | @click.stop="handleLocation(node)" |
| | | >定位</el-button> |
| | | <el-button link @click.stop="handleEdit(node)">编辑</el-button> |
| | | <el-button link @click.stop="handleDelete(node)">删除</el-button> |
| | | :disabled="node.data.level === 2 && (!node.data.children || node.data.children.length === 0)" |
| | | class="location-btn" |
| | | ></el-button> |
| | | <el-button icon="el-icon-edit" link @click.stop="handleEdit(node)"></el-button> |
| | | <el-button icon="el-icon-delete" link @click.stop="handleDelete(node)"></el-button> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | }; |
| | | // 定位按钮事件 |
| | | const handleLocation = node => { |
| | | console.log('11',node.data); |
| | | |
| | | if (node.data.level === 2) { |
| | | layerParams.value.isSingleLocating = false; |
| | | // 新增:标记当前定位的文件夹ID |
| | |
| | | flex-grow: 1; |
| | | padding-right: 12px; |
| | | :deep(.el-tree-node__content) { |
| | | height: 38px !important; |
| | | line-height: 38px !important; |
| | | height: 35px !important; |
| | | line-height: 35px !important; |
| | | } |
| | | |
| | | .isTheTerritory { |
| | |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | width: 100%; |
| | | .nodeName { |
| | | font-size: 12px !important; |
| | | } |
| | | } |
| | | |
| | | .tree-node-actions { |
| | | display: flex; |
| | | // gap: 8px; // 按钮之间的间距 |
| | | // gap: 8px; |
| | | |
| | | button { |
| | | padding: 0; // 清除默认内边距 |
| | | // color: #fff; // 按钮图标颜色 |
| | | color: #409eff; |
| | | &:hover { |
| | | color: #409eff; // hover 时的颜色 |
| | | } |
| | | padding: 0; |
| | | color: #fff; |
| | | width: 17px; |
| | | height: 17px; |
| | | // color: #409eff; |
| | | // &:hover { |
| | | // color: #409eff; |
| | | // } |
| | | } |
| | | } |
| | | ::v-deep(.location-btn.el-button.is-link.is-disabled) { |
| | | color: #999 !important; |
| | | } |
| | | } |
| | | </style> |