diff --git a/src/components/Form/src/components/ApiTreeSelect.vue b/src/components/Form/src/components/ApiTreeSelect.vue index e09068c5..9cdd9751 100644 --- a/src/components/Form/src/components/ApiTreeSelect.vue +++ b/src/components/Form/src/components/ApiTreeSelect.vue @@ -23,8 +23,8 @@ const props = defineProps({ immediate: { type: Boolean, default: true }, resultField: propTypes.string.def(''), handleTree: { type: String, default: '' }, - parent: { type: String, default: '' }, parentId: { type: Number, default: 0 }, + parentLabel: { type: String, default: '' }, parentFiled: { type: String, default: 'name' } }) const emit = defineEmits(['options-change', 'change']) @@ -82,9 +82,9 @@ async function fetch() { if (props.handleTree) { result = handleTree(result, props.handleTree) } - if (props.parent) { + if (props.parentLabel) { let tree: Recordable = { id: props.parentId, children: [] } - tree = set(tree, props.parentFiled, props.parent) + tree = set(tree, props.parentFiled, props.parentLabel) tree.children = (result as Recordable[]) || [] treeData.value.push(tree) } else { diff --git a/src/views/system/dept/dept.data.ts b/src/views/system/dept/dept.data.ts index 778ec573..efca803a 100644 --- a/src/views/system/dept/dept.data.ts +++ b/src/views/system/dept/dept.data.ts @@ -90,7 +90,7 @@ export const formSchema: FormSchema[] = [ component: 'ApiTreeSelect', componentProps: { api: () => listSimpleDept(), - parent: '主类目', + parentLabel: '主类目', fieldNames: { label: 'name', key: 'id', diff --git a/src/views/system/menu/menu.data.ts b/src/views/system/menu/menu.data.ts index a6c16732..069cd804 100644 --- a/src/views/system/menu/menu.data.ts +++ b/src/views/system/menu/menu.data.ts @@ -84,7 +84,7 @@ export const formSchema: FormSchema[] = [ component: 'ApiTreeSelect', componentProps: { api: () => listSimpleMenus(), - parent: '主类目', + parentLabel: '主类目', fieldNames: { label: 'name', key: 'id',