diff --git a/src/components/FormCreate/src/useFormCreateDesigner.ts b/src/components/FormCreate/src/useFormCreateDesigner.ts index a202bd13..b6855a99 100644 --- a/src/components/FormCreate/src/useFormCreateDesigner.ts +++ b/src/components/FormCreate/src/useFormCreateDesigner.ts @@ -14,13 +14,13 @@ export const useFormCreateDesigner = (designer: Ref) => { const uploadImgsRule = useUploadImgsRule() onMounted(() => { - // 移除自带的上传组件规则 + // 移除自带的上传组件规则,使用 uploadFileRule、uploadImgRule、uploadImgsRule 替代 designer.value?.removeMenuItem('upload') const components = [uploadFileRule, uploadImgRule, uploadImgsRule] components.forEach((component) => { - //插入组件规则 + // 插入组件规则 designer.value?.addComponent(component) - //插入拖拽按钮到`main`分类下 + // 插入拖拽按钮到 `main` 分类下 designer.value?.appendMenuItem('main', { icon: component.icon, name: component.name, diff --git a/src/views/infra/build/index.vue b/src/views/infra/build/index.vue index a29ffdbe..9cee56f0 100644 --- a/src/views/infra/build/index.vue +++ b/src/views/infra/build/index.vue @@ -51,6 +51,7 @@ const dialogTitle = ref('') // 弹窗的标题 const formType = ref(-1) // 表单的类型:0 - 生成 JSON;1 - 生成 Options;2 - 生成组件 const formData = ref('') // 表单数据 useFormCreateDesigner(designer) // 表单设计器增强 + /** 打开弹窗 */ const openModel = (title: string) => { dialogVisible.value = true