From 4a090d54a90d0831b60a8fdaf47c497f55237cb2 Mon Sep 17 00:00:00 2001 From: Kane Wang Date: Mon, 16 Mar 2026 15:55:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E8=BF=9B=E5=BA=A6=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/console/data/NewRegulatory.vue | 44 +++++++++++++++++-- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/code/web/regulatory-management-util/src/views/console/data/NewRegulatory.vue b/code/web/regulatory-management-util/src/views/console/data/NewRegulatory.vue index ce4e2ba..707cb33 100644 --- a/code/web/regulatory-management-util/src/views/console/data/NewRegulatory.vue +++ b/code/web/regulatory-management-util/src/views/console/data/NewRegulatory.vue @@ -33,7 +33,10 @@ Copyright © CPIC All rights reserved 发布、修订年份 - + @@ -42,6 +45,7 @@ Copyright © CPIC All rights reserved ( null ); + const departmentName = ref( null ); + const releaseYear = ref( null ); + const comment = ref( null ); const render: Render = function ( response: AddNewRegulatoryResponse ) :void @@ -411,7 +418,7 @@ export default { const onBeforeUpload = ( uploadFile: UploadFile ): boolean => { - let result = true; + const result = true; console.log( "上传的文件名", uploadFile.name ); @@ -431,11 +438,40 @@ export default { console.log( "制度对象:", ui.newRegulatory ); // 防御验证 - if ( ui.newRegulatory.department_name.length === 0 ) + if ( ui.newRegulatory.regulatory_name.length === 0 ) { - ElMessage.error( "制度名称为空!" ); + ElMessage.error( "制度名称名称不能为空!" ); console.log( regulatoryName ); regulatoryName.value.focus(); + + return; + } + + if ( ui.newRegulatory.department_name.length === 0 ) + { + ElMessage.error( "部门名称不能为空!" ); + console.log( regulatoryName ); + departmentName.value.focus(); + + return; + } + + if ( ui.newRegulatory.release_year.length === 0 ) + { + ElMessage.error( "发布年份不能为空!" ); + + releaseYear.value.focus(); + + return; + } + + if ( ui.newRegulatory.regulatory_files.length === 0 ) + { + ElMessage.error( "没有上传相关制度文件!" ); + + console.log( ui.newRegulatory.regulatory_files ); + + return; } };