Ben Lin
2025-03-08 72675157c774fc4c6490bd1e49ca3c4aa25581f0
src/views/demo/system/dept/dept.data.ts
@@ -1,4 +1,4 @@
import { BasicColumn, FormSchema } from '/@/components/Table';
import { BasicColumn, FormSchema } from '@/components/Table';
import { h } from 'vue';
import { Tag } from 'ant-design-vue';
@@ -69,11 +69,14 @@
    field: 'parentDept',
    label: '上级部门',
    component: 'TreeSelect',
    ifShow({ values }) {
      const { deptName, parentDept } = values;
      // Hide without a parentDept when editing
      return parentDept || (!deptName && !parentDept);
    },
    componentProps: {
      fieldNames: {
        label: 'deptName',
        key: 'id',
        value: 'id',
      },
      getPopupContainer: () => document.body,