吉安感知网项目-前端
张含笑
2026-01-31 5c8103de425c4ebaac699fe3286f9845c65ca9ec
feat:不显示下拉按钮
3 files modified
48 ■■■■■ changed files
applications/task-work-order/src/views/orderView/organizational/agenciesManagement/FormDiaLog.vue 17 ●●●●● patch | view | raw | blame | history
applications/task-work-order/src/views/orderView/organizational/agenciesManagement/index.vue 14 ●●●● patch | view | raw | blame | history
applications/task-work-order/src/views/orderView/organizational/zoningManagement/FormDiaLog.vue 17 ●●●●● patch | view | raw | blame | history
applications/task-work-order/src/views/orderView/organizational/agenciesManagement/FormDiaLog.vue
@@ -49,11 +49,7 @@
              v-model="formData.areaCode"
              node-key="id"
              :default-expanded-keys="expandedKeys"
              :props="{
                value: 'id',
                label: 'name',
                children: 'children'
              }"
              :props="treeSelectProps"
              placeholder="请选择"
              clearable
              filterable
@@ -139,7 +135,16 @@
const titleEnum = ref({ edit: '编辑', view: '查看', add: '新增' })
const expandedKeys = ref([]) // 树形选择器展开的节点
const regionNodeCache = ref(new Map()) // 缓存区域节点及其父节点关系
const treeSelectProps = ref({
  value: 'id',
  label: 'name',
  children: 'children',
  // 判断叶子节点
  isLeaf: (data, node) => {
    // 如果是第二级节点,则认为是叶子节点
    return node.level >= 2
  }
})
const rules = {
  deptName: fieldRules(true),
  areaCode: fieldRules(true),
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
      }
    })
    
applications/task-work-order/src/views/orderView/organizational/zoningManagement/FormDiaLog.vue
@@ -62,11 +62,7 @@
              v-model="formData.parentCode"
              node-key="id"
              :default-expanded-keys="expandedKeys"
              :props="{
                value: 'id',
                label: 'name',
                children: 'children'
              }"
              :props="treeSelectProps"
              placeholder="请选择"
              clearable
              filterable
@@ -139,7 +135,16 @@
  zoningDetailApi,
  regionLazyTreeApi
} from './zoningApi'
const treeSelectProps = ref({
  value: 'id',
  label: 'name',
  children: 'children',
  // 判断叶子节点
  isLeaf: (data, node) => {
    // 如果是第二级节点,则认为是叶子节点
    return node.level >= 2
  }
})
// 初始化表单数据
const initForm = () => ({
  code: '',