From 222c109727ed1da438f3371a2b0934d6cef85ee5 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期六, 05 八月 2023 21:26:45 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue |   92 ++++++++++++++++++++++++++++------------------
 1 files changed, 56 insertions(+), 36 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
index 9738222..2868e1a 100644
--- a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
+++ b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
@@ -26,7 +26,7 @@
         <!--        鏍戣妭鐐规坊鍔犲璇濇-->
         <el-dialog :title="this.TreeFlag ? '娣诲姞鍒嗙被' :'娣诲姞涓婚搴�'" :before-close="TreeEscHandler" :visible.sync="TreeAddFormVisible"  v-loading="AddLoading" append-to-body
                    style="width: 1700px;margin: auto">
-          <el-form :model="TreeAddform" :rules="rules">
+          <el-form ref="myForm" :model="TreeAddform" :rules="rules">
             <el-form-item :label="this.TreeFlag ? '鍒嗙被缂栧彿锛�' :'涓婚搴撶紪鍙凤細'" label-width="150px" style="display: inline-block" prop="id">
               <el-input v-model="TreeAddform.id" autocomplete="off" style="width: 170px"></el-input>
             </el-form-item>
@@ -231,7 +231,11 @@
             <el-input style="width: 260px;margin-left: 15px" placeholder="杈撳叆鍊煎悗杩涜妯$硦鏌ヨ" v-model="SelectFInd"></el-input>
             <el-button size="small"  type="primary" plain @click="SelectFindeHandler" style="margin-left: 20px">鏌ヨ</el-button>
           </template>
-          <avue-crud :data="masterData" :option="masterOption" @select="masterSelect"></avue-crud>
+          <avue-crud :data="masterData" :option="masterOption" @row-click="masterSelect">
+            <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.TreeAddform.coderuleoidName ==''?'鏈缃��':this.TreeAddform.coderuleoidName}}]</div>
             <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" >
@@ -255,7 +259,11 @@
             <el-input style="width: 260px;margin-left: 15px" placeholder="杈撳叆鍊煎悗杩涜妯$硦鏌ヨ" v-model="SelectFInd"></el-input>
             <el-button size="small"  type="primary" plain @click="KeySelectFindeHandler" style="margin-left: 20px">鏌ヨ</el-button>
           </template>
-          <avue-crud :data="KeyData" :option="masterOption" @select="KeySelect"></avue-crud>
+          <avue-crud :data="KeyData" :option="masterOption" @row-click="KeySelect">
+            <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 #eeeeee;padding: 5px;margin-top: 5px;font-size: 14px " >宸茶缃殑鍊间负:[{{this.TreeAddform.codeKeyAttrRepeatOidName ==''?'鏈缃��':this.TreeAddform.codekeyattrrepeatoidName}}]</div>
             <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" >
@@ -279,7 +287,11 @@
             <el-input style="width: 260px;margin-left: 15px" placeholder="杈撳叆鍊煎悗杩涜妯$硦鏌ヨ" v-model="SelectFInd"></el-input>
             <el-button size="small"  type="primary" plain @click="SimSelectFindeHandler" style="margin-left: 20px">鏌ヨ</el-button>
           </template>
-          <avue-crud :data="simData" :option="masterOption" @select="simSelect"></avue-crud>
+          <avue-crud :data="simData" :option="masterOption" @row-click="simSelect">
+            <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.TreeAddform.codeResembleRuleOidName ==''?'鏈缃��':this.TreeAddform.codeResembleRuleOidName}}]</div>
             <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" >
@@ -772,11 +784,11 @@
     },
     //缂栫爜澶氶��
     masterSelect(row){
-    if(row.length>0){
+      this.masterRow=row.$index;
       this.masterSelectList=row;
-      this.masterName=row[0].name;
-      this.masterOid=row[0].oid;
-    }
+      this.masterName=row.name;
+      this.masterOid=row.oid;
+
     },
     //缂栫爜瑙勫垯鏌ヨ
     SelectFindeHandler(){
@@ -859,9 +871,10 @@
     },
     // 鍏抽敭澶氶��
     KeySelect(row){
+      this.masterRow=row.$index;
       this.KeySelectLIst=row;
-      this.KeyName=row[0].name;
-      this.KeyOid=row[0].oid;
+      this.KeyName=row.name;
+      this.KeyOid=row.oid;
     },
     //鍏抽敭澶辩劍
     simFouce(){
@@ -898,9 +911,10 @@
     },
     //  鐩镐技椤瑰閫�
     simSelect(row){
+      this.masterRow=row.$index;
       this.simSelectList=row;
-      this.simName=row[0].name;
-      this.simOid=row[0].oid;
+      this.simName=row.name;
+      this.simOid=row.oid;
     },
     //鐩镐技椤归」鎺ュ彛
     simdefaultRend(){
@@ -1027,34 +1041,40 @@
     //鏍戣妭鐐瑰彇娑堜簨浠�
     TreeEscHandler(){
       this.TreeAddform={};
-      this.TreeAddFormVisible=false
+      this.TreeAddFormVisible=false;
+      // 鍏抽棴寮圭獥娓呯┖鏍¢獙
+      this.$refs.myForm.clearValidate();
     },
     //鏍戣妭鐐规坊鍔犱簨浠�
     TreeAddHandler() {
-      const data = this.TreeAddform;
-      // data.btmtypename= this.TreeList.btmtypename
-      this.$set(data, "parentCodeClassifyOid", this.nodeClickList.oid);
-      TreeSave(data)
-        .then(() => {
-          this.$message({
-            type: "success",
-            message: "娣诲姞鎴愬姛!",
+      if ((!this.TreeAddform.id || !this.TreeAddform.name) || (this.TreeFlagCode && !this.TreeAddform.btmTypeName)) {
+        this.$message.warning('璇疯緭鍏ュ唴瀹癸紒');
+      }else {
+        const data = this.TreeAddform;
+        // data.btmtypename= this.TreeList.btmtypename
+        this.$set(data, "parentCodeClassifyOid", this.nodeClickList.oid);
+        TreeSave(data)
+          .then(() => {
+            this.$message({
+              type: "success",
+              message: "娣诲姞鎴愬姛!",
+            });
+            Object.keys(this.TreeAddform).forEach(key => {
+              this.TreeAddform[key] = "";
+            });
+            this.getAttr();
+            this.TreeAddFormVisible = false;
+            //娣诲姞瀹屾垚鍚庡彸渚ф竻绌�
+            this.ProData=[];
+            this.Formlist=[];
+          })
+          .catch((res) => {
+            this.$message({
+              type: "warning",
+              message: res,
+            });
           });
-          Object.keys(this.TreeAddform).forEach(key => {
-            this.TreeAddform[key] = "";
-          });
-          this.getAttr();
-          this.TreeAddFormVisible = false;
-          //娣诲姞瀹屾垚鍚庡彸渚ф竻绌�
-          this.ProData=[];
-          this.Formlist=[];
-        })
-        .catch((res) => {
-          this.$message({
-            type: "warning",
-            message: res,
-          });
-        });
+      }
     },
     //鏍戣妭鐐瑰垹闄ゆ寜閽�
     TreeDel() {

--
Gitblit v1.9.3