mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-10 00:55:07 +08:00
fix: 代码生成器
This commit is contained in:
@ -15,7 +15,8 @@ const props = defineProps({
|
||||
default: () => null
|
||||
}
|
||||
})
|
||||
const defaultProps = {
|
||||
const menuProps = {
|
||||
checkStrictly: true,
|
||||
children: 'children',
|
||||
label: 'name',
|
||||
value: 'id'
|
||||
@ -31,7 +32,6 @@ const rules = reactive({
|
||||
})
|
||||
const templateTypeOptions = getIntDictOptions(DICT_TYPE.INFRA_CODEGEN_TEMPLATE_TYPE)
|
||||
const sceneOptions = getIntDictOptions(DICT_TYPE.INFRA_CODEGEN_SCENE)
|
||||
const parentMenuId = ref()
|
||||
const treeRef = ref<InstanceType<typeof ElTreeSelect>>()
|
||||
const menuOptions = ref<any>([]) // 树形结构
|
||||
const getTree = async () => {
|
||||
@ -112,9 +112,13 @@ const schema = reactive<FormSchema[]>([
|
||||
const { register, methods, elFormRef } = useForm({
|
||||
schema
|
||||
})
|
||||
const parentMenuId = ref<number>()
|
||||
//子组件像父组件传值
|
||||
const emit = defineEmits(['menu'])
|
||||
const handleNodeClick = () => {
|
||||
console.log(parentMenuId.value)
|
||||
emit('menu', parentMenuId.value)
|
||||
}
|
||||
|
||||
// ========== 初始化 ==========
|
||||
onMounted(async () => {
|
||||
await getTree()
|
||||
@ -143,10 +147,9 @@ defineExpose({
|
||||
v-model="parentMenuId"
|
||||
ref="treeRef"
|
||||
node-key="id"
|
||||
check-on-click-node
|
||||
expand-on-click-node="false"
|
||||
:props="defaultProps"
|
||||
:props="menuProps"
|
||||
:data="menuOptions"
|
||||
check-strictly
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</template>
|
||||
|
Reference in New Issue
Block a user