From 1f3c092f70509645ffa4a7c6b246d3a1fbc6324e Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期三, 02 八月 2023 16:47:04 +0800 Subject: [PATCH] 主题库枚举注入样式优化 --- Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue | 56 +++++++++++++++++++++++++++++++++----------------------- 1 files changed, 33 insertions(+), 23 deletions(-) diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue b/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue index 56e9efa..5c1747a 100644 --- a/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue +++ b/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue @@ -88,6 +88,12 @@ <el-dialog :visible.sync="enumVisible" append-to-body title="鏋氫妇娉ㄥ叆" :before-close="this.enumBeforeClose"> <!-- 娓叉煋琛ㄦ牸鍙婃寜閽� --> <!-- 娓叉煋琛ㄦ牸鍙婃寜閽� --> + <el-alert + title="璇锋柊澧炲悗鐐瑰嚮鍗曞厓鏍艰緭鍏ユ灇涓炬暟鎹�" + type="success" + style="margin-bottom: 10px;display: inline-block" + :closable="false"> + </el-alert> <div> <el-button icon="el-icon-plus" type="primary" @click="addRow">鏂板</el-button> <el-table :data="tableData" style="width: 100%" @cell-click="handleCellClick" @@ -1799,29 +1805,33 @@ }, //鏋氫妇娉ㄥ叆淇濆瓨 enumAddHandle() { - let hasError = false; // 娣诲姞涓�涓彉閲� - this.tableData.forEach((item, index) => { - if (item.key === '') { - this.$message.warning(`绗�${index + 1}琛岀殑閫夐」鍊间笉鑳戒负绌篳); - hasError = true; - return; - } else if (item.value === '') { - this.$message.warning(`绗�${index + 1}琛岀殑閫夐」涓枃鏍囩涓嶈兘涓虹┖`); - hasError = true; - return; - } - }); - // 淇濆瓨鎵ц閫昏緫 - if (!hasError) { - if (this.CurrentCell) { - this.$set(this.CurrentCell, 'enumString', JSON.stringify(this.tableData)); - this.enumVisible = false; - } else { - this.$set(this.attrSelectList[0], 'enumString', JSON.stringify(this.tableData)); - this.tableData=[]; - this.enumVisible = false; - } - } + if(this.tableData.length>=1){ + let hasError = false; // 娣诲姞涓�涓彉閲� + this.tableData.forEach((item, index) => { + if (item.key === '') { + this.$message.warning(`绗�${index + 1}琛岀殑閫夐」鍊间笉鑳戒负绌篳); + hasError = true; + return; + } else if (item.value === '') { + this.$message.warning(`绗�${index + 1}琛岀殑閫夐」涓枃鏍囩涓嶈兘涓虹┖`); + hasError = true; + return; + } + }); + // 淇濆瓨鎵ц閫昏緫 + if (!hasError) { + if (this.CurrentCell) { + this.$set(this.CurrentCell, 'enumString', JSON.stringify(this.tableData)); + this.enumVisible = false; + } else { + this.$set(this.attrSelectList[0], 'enumString', JSON.stringify(this.tableData)); + this.tableData=[]; + this.enumVisible = false; + } + } + }else { + this.$message.warning('璇锋坊鍔犳灇涓炬敞鍏ユ暟鎹紒') + } }, // 灏嗘鍦ㄧ紪杈戠殑琛岀殑鐘舵�佸彉涓� null锛屽嵆閫�鍑虹紪杈戠姸鎬� saveRow() { -- Gitblit v1.9.3