From d77405ea25e2e148398b169a6fa7cb02ce37c894 Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Wed, 3 Apr 2024 11:06:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=94=A8=E4=BE=8B=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E7=BC=96=E8=BE=91=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E5=AD=97=E6=AE=B5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1038303 --user=王旭 【功能用例】设置自定义字段必填,列表点击ID,自定义属性非必填 https://www.tapd.cn/55049933/s/1487085 --- .../components/caseDetailDrawer.vue | 1 + .../components/tabContent/tabDetail.vue | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/case-management/caseManagementFeature/components/caseDetailDrawer.vue b/frontend/src/views/case-management/caseManagementFeature/components/caseDetailDrawer.vue index c507509198..7e3838cfb0 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/caseDetailDrawer.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/caseDetailDrawer.vue @@ -131,6 +131,7 @@ :form="detailInfo" :allow-edit="true" :form-rules="formItem" + :form-api="fApi" @update-success="updateSuccess" /> diff --git a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDetail.vue b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDetail.vue index 3b217fa020..e7e7ebdbcb 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDetail.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabDetail.vue @@ -326,6 +326,7 @@ form: DetailCase; allowEdit?: boolean; // 是否允许编辑 formRules?: FormRuleItem[]; // 编辑表单 + formApi?: any; }>(), { allowEdit: true, // 是否允许编辑 @@ -504,13 +505,17 @@ caseFormRef.value?.validate().then(async (res: any) => { if (!res) { try { - confirmLoading.value = true; - await updateCaseRequest(getParams()); - Message.success(t('caseManagement.featureCase.editSuccess')); - isEditPreposition.value = false; - emit('updateSuccess'); + props.formApi?.validate().then(async (valid: any) => { + if (valid === true) { + confirmLoading.value = true; + await updateCaseRequest(getParams()); + Message.success(t('caseManagement.featureCase.editSuccess')); + isEditPreposition.value = false; + emit('updateSuccess'); + } + }); } catch (error) { - console.log(error); + // console.log(error); } finally { confirmLoading.value = false; }