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;
}
};