From 5c8103de425c4ebaac699fe3286f9845c65ca9ec Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Sat, 31 Jan 2026 15:33:25 +0800
Subject: [PATCH] feat:不显示下拉按钮
---
applications/task-work-order/src/views/orderView/organizational/agenciesManagement/index.vue | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/applications/task-work-order/src/views/orderView/organizational/agenciesManagement/index.vue b/applications/task-work-order/src/views/orderView/organizational/agenciesManagement/index.vue
index 9bb277c..549eab1 100644
--- a/applications/task-work-order/src/views/orderView/organizational/agenciesManagement/index.vue
+++ b/applications/task-work-order/src/views/orderView/organizational/agenciesManagement/index.vue
@@ -181,7 +181,11 @@
const treeSelectProps = {
value: 'id',
label: 'name',
- children: 'children'
+ children: 'children',
+ // 添加isLeaf配置,告诉组件如何判断叶子节点
+ isLeaf: (data, node) => {
+ return data.leaf === true
+ }
}
// 导入机构相关
const isShowImportView = ref(false)
@@ -214,7 +218,6 @@
// 懒加载获取区域节点数据
async function loadRegionNode(node, resolve) {
-
try {
// 限制只加载两级,当前节点 level >= 1 时不加载子节点
if (node.level >= 2) {
@@ -229,10 +232,15 @@
// 处理返回的节点数据
const processedNodes = nodes.map(item => {
+ // 判断是否为叶子节点:如果是第二级(node.level === 1)则为叶子节点
+ const isLeaf = node.level === 1
+
return {
id: item.id || item.value,
name: item.name || item.title || item.label,
- hasChildren: item.hasChildren || false
+ hasChildren: item.hasChildren || false,
+ // 关键:设置leaf属性,告知Tree组件该节点是否为叶子节点
+ leaf: isLeaf
}
})
--
Gitblit v1.9.3