perf: 提取tree props

This commit is contained in:
xingyu4j
2022-12-06 15:23:09 +08:00
parent 61f647b385
commit 3fd6193ac1
7 changed files with 36 additions and 51 deletions

View File

@ -6,7 +6,7 @@ import { onMounted, PropType, reactive, ref, watch } from 'vue'
import { Form } from '@/components/Form'
import { useForm } from '@/hooks/web/useForm'
import { required } from '@/utils/formRules'
import { handleTree } from '@/utils/tree'
import { handleTree, defaultProps } from '@/utils/tree'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { listSimpleMenusApi } from '@/api/system/menu'
import { CodegenTableVO } from '@/api/infra/codegen/types'
@ -17,12 +17,6 @@ const props = defineProps({
default: () => null
}
})
const menuProps = {
checkStrictly: true,
children: 'children',
label: 'name',
value: 'id'
}
const rules = reactive({
templateType: [required],
scene: [required],
@ -104,7 +98,7 @@ const schema = reactive<FormSchema[]>([
component: 'TreeSelect',
componentProps: {
data: menuOptions,
props: menuProps,
props: defaultProps,
checkStrictly: true,
nodeKey: 'id'
},