From d05c67ffaa75f439431f17c92f4d9f95b001e3d8 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 30 Mar 2024 21:15:01 +0800 Subject: [PATCH] =?UTF-8?q?infra=EF=BC=9Acode=20review=20=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E5=A2=9E=E5=BC=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FormCreate/src/useFormCreateDesigner.ts | 6 +++--- src/views/infra/build/index.vue | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) 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