From 3e0bf8da0785a08ed2fc6ed98b0e4846c1674786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=96=AA=E5=90=8D?= <942005050@qq.com> Date: Mon, 11 Mar 2024 15:56:12 +0800 Subject: [PATCH] =?UTF-8?q?basicForm=E7=BB=84=E4=BB=B6=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=BA=95=E9=83=A8=E6=8C=89=E9=92=AE=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BasicForm/src/BasicForm.vue | 41 +++++++++++++--------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index 91fa42e04..cbb764b65 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -240,13 +240,18 @@ const props = defineProps({ required: false, default: null }, + // 窗体底部按钮:保存,关闭 + isShowFooterButtton: { + type: Boolean, + required: false, + default: true + } }) const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗 const dialogWidth = ref() if (props.basicFormWidth) { - console.log('111111111111111') dialogWidth.value = props.basicFormWidth } else { dialogWidth.value = props.isBusiness ? '60%' : '40%' @@ -263,19 +268,19 @@ const tableAllSchemas = ref(props.tableAllSchemas) const tableFormRules = ref(props.tableFormRules) // 列表-按钮 -const buttondata = [ - defaultButtons.mainListEditBtn(null), // 编辑 - defaultButtons.mainListDeleteBtn(null) -] -// 列表-操作按钮事件 -const buttonTableClick = async (val, row) => { - if (val == 'edit') { +// const buttondata = [ +// defaultButtons.mainListEditBtn(null), // 编辑 +// defaultButtons.mainListDeleteBtn(null) +// ] +// // 列表-操作按钮事件 +// const buttonTableClick = async (val, row) => { +// if (val == 'edit') { - } else if (val == 'delete') { +// } else if (val == 'delete') { - } else { - } -} +// } else { +// } +// } /** 弹层操作 */ // formField form表单中的字段 @@ -392,10 +397,13 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any defineExpose({ open, formRef, opensearchTable, dialogVisible, formLoading }) // 提供 open 方法,用于打开弹窗 /** 弹窗按钮 */ -const Butttondata = [ - defaultButtons.formSaveBtn(null), // 保存 - defaultButtons.formCloseBtn(null) // 关闭 -] +let Butttondata:any = [] +if (props.isShowFooterButtton) { + Butttondata = [ + defaultButtons.formSaveBtn(null), // 保存 + defaultButtons.formCloseBtn(null) // 关闭 + ] +} /** 按钮事件 */ const buttonBaseClick = (val) => { @@ -436,7 +444,6 @@ const submitForm = async () => { // 主子表——提交请求 try { const data = unref(formRef)?.formModel - console.log('data',data) emit('submitForm', formType.value, data) } finally { }