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 ++++++++++++++++-----------
 Source/UBCS-WEB/src/components/Theme/ThemeClassifyTreeform.vue |   20 +++++++--
 2 files changed, 48 insertions(+), 28 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() {
diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTreeform.vue b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTreeform.vue
index 02f63df..7aa38b3 100644
--- a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTreeform.vue
+++ b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTreeform.vue
@@ -92,7 +92,11 @@
           <el-input style="width: 260px;margin-left: 15px" placeholder="杈撳叆鍊煎悗杩涜妯$硦鏌ヨ" v-model="SelectFInd"></el-input>
           <el-button size="small"  type="primary" plain @click="BtmSelectFindeHandler" style="margin-left: 20px">鏌ヨ</el-button>
         </template>
-        <avue-crud :data="BtmData" :option="masterOption" @select="btmSelect"></avue-crud>
+        <avue-crud :data="BtmData" :option="masterOption" @row-click="btmSelect">
+          <template slot="radio" slot-scope="{row}">
+            <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{''}}</el-radio>
+          </template>
+        </avue-crud>
         <div style="height: 30px">
           <div style="display: inline-block;float: left;border: 1px solid #eee;padding: 5px;margin-top: 5px;font-size: 14px " >宸茶缃殑鍊间负:[{{this.loneTreeNewForm.btmTypeName}}]</div>
           <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" >
@@ -113,6 +117,7 @@
   props: ['loneTreeNewForm','flag','Editclose','TreeFlag','nodeClickList'],
   data() {
     return {
+      masterRow:0,
       SelectFInd:"",
       masterName:"",
       masterOid:"",
@@ -166,10 +171,15 @@
         addBtn:false,
         index:true,
         border:true,
-        selection:true,
         menu:false,
         height:380,
         column:[
+          {
+            label: '',
+            prop: 'radio',
+            width: 60,
+            display: false
+          },
           {
             label:'鑻辨枃鍚嶇О',
             prop:'id'
@@ -567,9 +577,9 @@
     //涓氬姟绫诲瀷澶氶��
     btmSelect(row){
       this.btmSelectList=row;
-      this.btmName=row[0].name;
-      this.btmOid=row[0].oid;
-      this.btmId=row[0].id;
+      this.btmName=row.name;
+      this.btmOid=row.oid;
+      this.btmId=row.id;
     },
     //涓氬姟绫诲瀷鎺ュ彛
     btmdefaultRend(masterParameter){

--
Gitblit v1.9.3