From e9c3aee2524e40078dd6167408fa442a64775d3b Mon Sep 17 00:00:00 2001 From: Kane Wang Date: Fri, 6 Feb 2026 01:01:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E8=BF=9B=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/web/regulatory-management-util/src/main.ts | 2 -- .../src/views/console/data/NewRegulatory.vue | 17 +++++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/code/web/regulatory-management-util/src/main.ts b/code/web/regulatory-management-util/src/main.ts index 901214e..7af546e 100644 --- a/code/web/regulatory-management-util/src/main.ts +++ b/code/web/regulatory-management-util/src/main.ts @@ -15,7 +15,6 @@ import * as ElementPlusIconsVue from "@element-plus/icons-vue"; import "element-plus/dist/index.css"; -// eslint-disable-next-line const app = createApp( AppMain ); app.use( ElementPlus ); @@ -29,5 +28,4 @@ for ( const [key, component,] of Object.entries( ElementPlusIconsVue )) app.mount( "#app" ); -// eslint-disable-next-line // createApp( App ).mount( "#app" ); 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 a0109e3..d9ba2c7 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 @@ -257,6 +257,9 @@ export default { fileURL: "", }); + const regulatoryName = ref( null ); + + const render: Render = function ( response: AddNewRegulatoryResponse ) :void { // if ( response.success === true ) @@ -342,8 +345,6 @@ export default { { console.log( `行${row}设置行号${rowIndex}。` ); - const regulatoryName = ref(); - row.rowIndex = rowIndex; }; @@ -413,13 +414,25 @@ export default { ElMessage.error( "渲染文档出错!" ); }; + /** + * 创建新制度事件 + */ const onCreateNewRegulatory = () => { console.log( "制度对象:", ui.newRegulatory ); + + // 防御验证 + if ( ui.newRegulatory.department_name.length === 0 ) + { + ElMessage.error( "制度名称为空!" ); + console.log( regulatoryName ); + regulatoryName.value.focus(); + } }; return { ui, + regulatoryName, headerCellStyle, cellStyle, onUploadSuccess,