| | |
| | | v-model="formData.areaCode" |
| | | node-key="id" |
| | | :default-expanded-keys="expandedKeys" |
| | | :props="{ |
| | | value: 'id', |
| | | label: 'name', |
| | | children: 'children' |
| | | }" |
| | | :props="treeSelectProps" |
| | | placeholder="请选择" |
| | | clearable |
| | | filterable |
| | |
| | | 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), |