From 3e20408521d46b1086a5e77b914d04afb9630ab0 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期五, 28 七月 2023 10:37:02 +0800
Subject: [PATCH] 主题库开启编辑分类注入bug

---
 Source/UBCS-WEB/src/components/Tree/classifyTrees.vue |   77 +++++++++++++++++++++++++++-----------
 1 files changed, 54 insertions(+), 23 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/Tree/classifyTrees.vue b/Source/UBCS-WEB/src/components/Tree/classifyTrees.vue
index c40093b..03fec95 100644
--- a/Source/UBCS-WEB/src/components/Tree/classifyTrees.vue
+++ b/Source/UBCS-WEB/src/components/Tree/classifyTrees.vue
@@ -33,14 +33,14 @@
             <el-form-item :label="this.TreeFlag ? '鍒嗙被鍚嶇О锛�' :'涓婚搴撳悕绉帮細'" label-width="110px" style="display: inline-block" prop="name">
               <el-input v-model="TreeAddform.name" autocomplete="off" style="width: 170px"></el-input>
             </el-form-item>
+            <el-form-item label="瀛樺偍鐨勪笟鍔$被鍨嬶細" label-width="150px" v-if="TreeFlagCode==false" prop="btmTypeName">
+              <el-input v-model="TreeAddform.btmTypeName" autocomplete="off" style="width: 585px" @focus="btmFoucus"></el-input>
+            </el-form-item>
             <el-form-item label="鎻忚堪锛�" label-width="150px">
               <el-input v-model="TreeAddform.description" autocomplete="off" style="width: 585px"></el-input>
             </el-form-item>
             <el-form-item label="缂栫爜瑙勫垯锛�" label-width="150px">
               <el-input v-model="TreeAddform.codeRuleOidName" autocomplete="off" style="width: 585px" @focus="CodeFoucus"></el-input>
-            </el-form-item>
-            <el-form-item label="涓氬姟绫诲瀷锛�" label-width="150px" v-if="TreeFlagCode==false">
-              <el-input v-model="TreeAddform.btmTypeName" autocomplete="off" style="width: 585px" @focus="btmFoucus"></el-input>
             </el-form-item>
             <el-form-item label="鍏抽敭灞炴�ф煡璇㈣鍒欙細" label-width="150px">
                 <el-input v-model="TreeAddform.codeKeyAttrRepeatOidName" autocomplete="off" @focus="Keyfouce"
@@ -83,9 +83,12 @@
                           @row-save="CrudRowSave"
                           @row-del="CrudRowDel"
                           @row-update="CrudRowUpdata"
-                          :before-close="beforeClose"
-                          @select="selectHandle"
+                          @row-click="rowHandle"
                >
+                  <template slot="radio" slot-scope="{row}">
+                       <el-radio v-model="selectRow" :label="row.$index" style="padding-left: 10px !important;">{{''}}</el-radio>
+                  </template>
+
             <template slot="menuLeft">
               <el-button plain size="small" type="primary" @click="FindeHanler">鏌ヨ</el-button>
               <el-button plain size="small" type="primary" @click="TemRefresh">鍒锋柊</el-button>
@@ -210,9 +213,8 @@
                 >
               </template>
           </avue-crud>
-
           </basic-container>
-          <templatePro :ProData="this.ProData" :crudOid="this.crudOid" :crudLCStatus="this.crudLCStatus" :crudArray="this.crudArray" :Formlist="this.Formlist" :codeClassifyOid="this.codeClassifyOid"></templatePro>
+          <templatePro :ProData="this.ProData" :rowIndex="this.selectRow" :crudOid="this.crudOid" :crudLCStatus="this.crudLCStatus" :crudArray="this.crudArray" :Formlist="this.Formlist" :codeClassifyOid="this.codeClassifyOid"></templatePro>
         </span>
         <!--     缂栫爜瑙勫垯-->
         <el-dialog  :visible.sync="MasterdialogVisible"   title="涓恒�愮紪鐮佽鍒欍�戦�夊彇鍊�" append-to-body>
@@ -344,6 +346,7 @@
   inject: ["crudTreeData"],
   data() {
     return {
+      selectRow:'',
       //鏍戣妭鐐规樉绀洪殣钘�
       TreeFlagCode:false,
       //缂栫爜瑙勫垯
@@ -352,7 +355,7 @@
       masterSelectList:[],
       masterName:"",
       masterOid:"",
-      //鍏抽敭灞炴��
+      //鍏抽敭灞炴�tmTypeId
       KeydialogVisible:false,
       KeyName:"",
       KeyOid:"",
@@ -404,14 +407,6 @@
       ],
       SelectValue:"",
       SelectFInd:"",
-      rules: {
-        id: [
-          { required: true, message: '璇疯緭鍏ュ悕绉�', trigger: 'blur' },
-        ],
-        name:[
-          { required: true, message: '璇疯緭鍏ョ紪鍙�', trigger: 'blur' },
-        ]
-      },
       addFlag:false,
       // 琛ㄦ牸褰撳墠琛宨d
       crudOid:"",
@@ -478,6 +473,17 @@
         codeRuleOidName: "",
         //瀛樺偍鐨勪笟鍔$被鍨�
         btmTypeName: ""
+      },
+      rules: {
+        id: [
+          { required: true, message: '璇疯緭鍏ュ悕绉�', trigger: 'blur' },
+        ],
+        name:[
+          { required: true, message: '璇疯緭鍏ョ紪鍙�', trigger: 'blur' },
+        ],
+        btmTypeName:[
+          { required: true, message: '璇烽�夋嫨涓氬姟绫诲瀷', trigger: 'blur' },
+        ]
       },
       //avue-tree鏁版嵁锛屾殏鏃舵病鏈変綔鐢紝閲岄潰鍔熻兘鐢╡lement鍐欎簡锛屽彧鐢╝vue鐨勪竴涓爲缁勪欢涓嶇敤鍐呯疆琛ㄥ崟浜嗐��
       TreeAvueform: {},
@@ -663,11 +669,16 @@
         index: true,
         border: true,
         height:180,
-        selection:true,
         addBtn:this.Formlist.length<=0  && this.nodeClickList != "",
         editBtn:false,
         delBtn:false,
         column: [
+          {
+            label: '',
+            prop: 'radio',
+            width: 60,
+            hide: false,
+          },
           {
             label: "妯℃澘缂栧彿",
             prop: "id",
@@ -788,8 +799,8 @@
           'conditionMap[id]':this.SelectFInd
         }
         this.KeydefaultRend(masterParameter);
-        this.SelectValue=""
-        this.SelectFInd=""
+        this.SelectValue="";
+        this.SelectFInd="";
       }else if(this.SelectValue == 'name'){
         const masterParameter={
           'conditionMap[name]':this.SelectFInd
@@ -909,7 +920,7 @@
     btmSelect(row){
       this.btmSelectList=row;
       this.btmName=row[0].name;
-      this.btmOid=row[0].oid;
+      this.btmOid=row[0].id;
     },
     //涓氬姟绫诲瀷鎺ュ彛
     btmdefaultRend(masterParameter){
@@ -921,13 +932,32 @@
     MasterHandler(val){
       this.TreeList=val;
     },
-    //琛屽崟閫変簨浠�
-    selectHandle(selection,row){
+    rowHandle(row, column){
+      this.selectRow=row.$index;
       this.crudOid=row.oid;
       this.crudLCStatus=row.lcStatus;
-      this.crudArray=selection;
+      this.crudArray.push(row);
+      console.log(row.$index)
       gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]': row.oid}).then(res => {
         this.ProData = res.data.data;
+        //鍒嗙被娉ㄥ叆鏁版嵁鏍煎紡
+        this.ProData =  res.data.data.map((item) => {
+          //濡傛灉鍒嗙被娉ㄥ叆classifyInvokeAttr涓虹┖璇存槑鏄垵濮嬬姸鎬�
+          if(item.classifyInvokeAttr !== ''){
+            if (!item.hasOwnProperty('classifyInvokeText')) { // 妫�鏌lassifyInvokeText灞炴�ф槸鍚﹀瓨鍦�
+              item = {
+                ...item,
+                classifyInvokeText: {
+                  "娉ㄥ叆绫诲瀷": item.classifyInvokeAttr,
+                  "娉ㄥ叆绫诲瀷鍚嶇О": item.classifyInvokeAttrName,
+                  "灞傜骇璁剧疆": item.classifyInvokeLevel,
+                  "鏄惁鍙慨鏀�": item.classifyInvokeEditFlag
+                }
+              };
+            }
+          }
+          return item;
+        });
       }).catch(res => {
         this.$message.error(res)
       })
@@ -1225,6 +1255,7 @@
         });
       } else {
         this.$set(row, "codeclassifyoid", this.nodeClickList.oid)
+        console.log(this.nodeClickList)
         addSave(row).then(() => {
           this.$message({
             type: "success",

--
Gitblit v1.9.3