From 2c5663da38e977aa9ada0f0a8d1bd359c4dca02f Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期四, 07 十一月 2024 14:58:49 +0800
Subject: [PATCH] 调整业务类型和链接类型

---
 Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue |  305 ++++++++++++++++++++++++++++----------------------
 1 files changed, 171 insertions(+), 134 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue
index 70f5973..da5ebf9 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue
@@ -69,7 +69,7 @@
               </el-descriptions-item>
             </el-descriptions>
           </div>
-          <div class="descBox" style="width: 25%;">
+          <div class="descBox" style="width: 24%;">
             <el-descriptions :column="1" border class="margin-top" size="medium" title="鐗堟湰瑙勫垯">
               <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
                                     :labelStyle="descriptionOption.labelStyle">
@@ -121,7 +121,7 @@
 
             </el-descriptions>
           </div>
-          <div class="descBox" style="width: calc(35% - 40px);margin-right: 0">
+          <div class="descBox" style="width: calc(36% - 40px);margin-right: 0">
             <el-descriptions :column="1" border class="margin-top" size="medium" title="鐢熷懡鍛ㄦ湡">
               <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
                                     :labelStyle="descriptionOption.labelStyle">
@@ -129,6 +129,16 @@
                   鐢熷懡鍛ㄦ湡
                 </template>
                 <el-tag v-if="nodeRow.lifeCycleId">{{ nodeRow.lifeCycleId }}</el-tag>
+              </el-descriptions-item>
+              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
+                                    :labelStyle="descriptionOption.labelStyle">
+                <template slot="label">
+                  澶囬�夌敓鍛藉懆鏈�
+                </template>
+                <div v-if="nodeRow.lifeCycleIds">
+                  <el-tag v-for="item in nodeRow.lifeCycleIds.split(',')" style="margin-right: 5px;">{{ item }}</el-tag>
+                </div>
+
               </el-descriptions-item>
             </el-descriptions>
           </div>
@@ -215,31 +225,32 @@
                            :props="{label: 'id', value: 'id'}"
                            :dic="lifeData"></avue-select>
             </el-form-item>
-
             <el-form-item label="澶囬�夌敓鍛藉懆鏈熷垪琛細" label-width="138px">
               <avue-select multiple
                            :filterable="true"
-                           v-model="form.subLifeCycleId"
+                           v-model="form.subLifeCycleIdList"
                            placeholder="璇烽�夋嫨鐢熷懡鍛ㄦ湡"
                            :props="{label: 'id', value: 'id'}"
                            type="tree"
-                           :dic="lifeData"></avue-select>
+                           :dic="subLifeData"
+                           @change="subLifeChange"></avue-select>
             </el-form-item>
           </div>
         </div>
       </el-form>
       <div class="bottomForm">
-        <h3 style="margin-bottom: 10px;">灞炴�ф睜鍒楄〃</h3>
         <avue-crud
+          size="mini"
           :data="dialogAttrData"
           :option="dialogAttrOption"
           @row-del="dialogBottomAttrDel">
           <template slot="menuLeft">
-            <el-button icon="el-icon-plus" size="small" type="primary" @click="addDialogClickHandler">鍒涘缓</el-button>
+            <h3 style="display: inline-block;margin-right: 20px;margin-bottom: 10px;">灞炴�ф睜鍒楄〃</h3>
+            <el-button icon="el-icon-plus" size="mini" type="primary" @click="addDialogClickHandler">鍒涘缓</el-button>
           </template>
         </avue-crud>
       </div>
-      <span slot="footer" class="dialog-footer avue-dialog__footer">
+      <span slot="footer" class="dialog-footer">
          <el-button type="primary" @click="addDialogSavaHandler">纭� 瀹�</el-button>
          <el-button @click="addDialogClose">鍙� 娑�</el-button>
         </span>
@@ -271,8 +282,8 @@
       >
       </avue-crud>
       <span slot="footer" class="dialog-footer">
-         <el-button @click="dialogAttrClose">鍙� 娑�</el-button>
          <el-button type="primary" @click="dialogAttrAddClickHandler">纭� 瀹�</el-button>
+         <el-button @click="dialogAttrClose">鍙� 娑�</el-button>
         </span>
     </el-dialog>
 
@@ -496,6 +507,7 @@
         index: false,
         selection: false,
         refreshBtn: false,
+        header:false,
         column: [
           {
             label: '绫诲瀷鍚�',
@@ -554,6 +566,8 @@
       versionAddFlag: false,
       inheritTreeData: [],
       lifeData: [],//鐢熷懡鍛ㄦ湡涓嬫媺鏁版嵁
+      subLifeData:[],//澶囬�夌敓鍛藉懆鏈熶笅鎷夋暟鎹�
+      allLifeData:[],
       versionData: [],//鐗堟湰瑙勫垯鏁版嵁
       dialogAttrSelectList: [],
       searchAttrParams: {},
@@ -575,12 +589,16 @@
         height: 450,
         searchMenuSpan: 8,
         header: false,
+        selectable:function(row){
+          return row.selectable;
+        },
         column: [
           {
             label: '灞炴�у悕',
             prop: 'id',
             sortable: true,
             search: true,
+            width:260
           },
           {
             label: '灞炴�х被鍨�',
@@ -592,6 +610,7 @@
             label: '鍒濆鍊�',
             prop: 'defaultValue',
             sortable: true,
+            width: 200
           },
           {
             label: '璇存槑',
@@ -621,8 +640,10 @@
         editBtn: false,
         refreshBtn: false,
         selection: false,
-        height: 210,
+        height: 220,
         addBtn: false,
+        gridBtn:false,
+        columnBtn:false,
         menuWidth:100,
         // index:false,
         column: [
@@ -630,12 +651,14 @@
             label: '灞炴�у悕',
             prop: 'id',
             sortable: true,
+            width:260,
           },
           {
 
             prop: 'btmTypeId',
             label: '涓氬姟绫诲瀷',
-            sortable: true
+            sortable: true,
+            width: 200
           },
           {
             label: '灞炴�х被鍨�',
@@ -647,7 +670,7 @@
             label: '鍒濆鍊�',
             prop: 'defaultValue',
             sortable: true,
-            width:150,
+            width:200,
           },
           {
             label: '璇存槑',
@@ -671,22 +694,26 @@
           {
             prop: 'id',
             label: '灞炴�у悕',
-            sortable: true
+            sortable: true,
+            width:260
           },
           {
             prop: 'btmTypeId',
             label: '涓氬姟绫诲瀷',
-            sortable: true
+            sortable: true,
+            width:200
           },
           {
             prop: 'attributeDataType',
             label: '灞炴�х被鍨�',
-            sortable: true
+            sortable: true,
+            width:150
           },
           {
             prop: 'defaultValue',
             label: '榛樿鍊�',
-            sortable: true
+            sortable: true,
+            width: 200
           },
           {
             prop: 'description',
@@ -707,7 +734,8 @@
         delimiter: '', // 鍒嗛殧绗�
         versionRule: '0', // 鐗堟鍙疯鍒�
         lifeCycleId: '', // 鐢熷懡鍛ㄦ湡
-        subLifeCycleId: [], // 鐢熷懡鍛ㄦ湡澶囬�夊垪琛�,
+        subLifeCycleId: '', // 鐢熷懡鍛ㄦ湡澶囬�夊垪琛�,
+        subLifeCycleIdList:[],
         apNameArray: "", // 灞炴�ф睜鍒楄〃鈥欙紝鈥樺垎闅�
       },
       nodeRow: {},
@@ -731,8 +759,8 @@
         }
       ],
       descriptionOption: {
-        labelStyle: 'text-align:center;width:100px;',
-        contentStyle: 'max-width:200px;text-align:center;word-break;break-all;'
+        labelStyle: 'text-align:center;width:110px;',
+        contentStyle: 'min-width:200px;text-align:center;word-break:break-all;'
       },
       icons: {
         id: 'el-icon-finished',
@@ -748,6 +776,19 @@
     this.getLifeCycle();
   },
   mounted() {
+  },
+  watch:{
+    'form.lifeCycleId':{
+      handler(newval) {
+        if(this.form.lifeCycleId){
+          this.subLifeData = this.allLifeData.filter(item=>{
+            return item.id!=this.form.lifeCycleId
+          });
+        }else {
+          this.subLifeData = this.allLifeData
+        }
+      },
+    }
   },
   methods: {
     //鏍戣〃鏌ヨ
@@ -790,7 +831,7 @@
     //鑾峰彇鐢熷懡鍛ㄦ湡鏁版嵁
     getLifeCycle(){
       gridLifeCycle().then(res => {
-        this.lifeData = res.data.data;
+        this.allLifeData=res.data.data;
       });
     },
     // 鍒涘缓鎸夐挳
@@ -801,10 +842,107 @@
       }
       this.title = 'add';
       this.form.fName = this.nodeRow.id === 'topNode' ? "" : this.nodeRow.id;
+      this.lifeData = this.allLifeData;
+      this.subLifeData = this.allLifeData;
       this.form.inputRevisionFlag = JSON.parse(this.form.inputRevisionFlag); // 瀛楃涓瞗alse杞崲涓哄竷灏斿��
       this.visible = true;
     },
 
+    // 鏂板缂栬緫淇濆瓨
+    addDialogSavaHandler() {
+      if (this.form.revLevel !== '0' &&!this.form.inputRevisionFlag && (!this.form.revisionRuleId || this.form.revisionRuleId === "")) {
+        this.$message.error('璇锋鏌ョ増鏈彿瑙勫垯涓嶈兘涓虹┖');
+        return;
+      }
+      this.form.lifeCycleIds=this.form.subLifeCycleIdList.join(',');
+      this.form.subLifeCycleId=this.form.subLifeCycleIdList.join(',');
+      this.form.apNameArray = this.dialogAttrData ? this.dialogAttrData.map(item => item.id).join(',') : "";
+      this.$refs.form.validate((valid) => {
+        const saveFunction = this.title === 'add' ? addLifeCycle : updateLifeCycle;
+        if (valid) {
+          if (this.form.revLevel === 0) {
+            this.form.versionRule = "";
+          }
+          saveFunction(this.form).then(res => {
+            if (res.data.code === 200) {
+              this.$message.success(res.data.obj);
+              this.getTreeList();
+              this.resetForm();
+              this.visible = false;
+            }
+          })
+        } else {
+          return false;
+        }
+      });
+    },
+
+    // 缂栬緫鎸夐挳鐐瑰嚮浜嬩欢
+    editClickHandler() {
+      /**
+       * id 鍚嶇О
+       * name 鏍囩
+       * implClass 瀹炵幇绫�
+       * fName 缁ф壙鑷�
+       * description 鎻忚堪
+       * revLevel 鐗堟湰瑙勫垯
+       * revisionRuleId 鐗堟湰鍙疯鍒�
+       * inputRevisionFlag 鎵嬪伐杈撳叆
+       * delimiter 鍒嗛殧绗�
+       * versionRule 鐗堟鍙疯鍒�
+       * lifeCycleId 鐢熷懡鍛ㄦ湡
+       * lifeCycleIds 鐢熷懡鍛ㄦ湡鍒楄〃
+       * attributes 灞炴�ф睜鍒楄〃
+       */
+      if (func.isEmptyObject(this.nodeRow)) {
+        this.$message.error('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�');
+        return;
+      }
+      if (this.nodeRow.id === 'topNode') {
+        this.$message.error('璇烽�夋嫨瀛愯妭鐐硅繘琛屼慨鏀�')
+        return;
+      }
+      this.form = {...this.nodeRow};
+      this.form.inputRevisionFlag = JSON.parse(this.form.inputRevisionFlag); // 瀛楃涓瞗alse杞崲涓哄竷灏斿��
+      // this.form.fName = this.nodeRow.id === 'topNode' ? "" : this.nodeRow.id;
+      this.form.subLifeCycleIdList = this.nodeRow.lifeCycleIds?this.nodeRow.lifeCycleIds.split(','):[];
+      this.dialogAttrData = this.nodeRow.attributes ? JSON.parse(this.nodeRow.attributes) : [];
+      function  processChildren(item,fName) {
+        if (item.children && item.children.length > 0) {
+          item.children = item.children.map(child => {
+            processChildren(child,fName); // 閫掑綊澶勭悊姣忎釜瀛愯妭鐐�
+            if(fName==child.id){
+              child.disabled=true;
+            }else {
+              child.disabled=false;
+            }
+            return child;
+          });
+        }
+      };
+      const inheritTreeData=this.inheritTreeData.map(item => {
+        processChildren(item,this.form.id); // 澶勭悊姣忎釜鑺傜偣
+        if(this.form.id==item.id){
+          item.disabled=true;
+        }else {
+          item.disabled=false;
+        }
+        return item;
+      });
+      this.inheritTreeData=inheritTreeData
+      this.title = 'edit';
+      this.visible = true;
+    },
+
+    subLifeChange(data){
+      if (data.value.length == 0) {
+        this.lifeData = this.allLifeData
+      } else {
+        this.lifeData = this.allLifeData.filter(item => {
+          return !data.value.includes(item.id)
+        });
+      }
+    },
     // 瀵硅瘽妗� 灞炴�ф睜鍒楄〃澧炲姞鎸夐挳
     addDialogClickHandler() {
       this.dialogAttrLoading = true;
@@ -816,8 +954,11 @@
     // 鏌ヨ灞炴�ф睜鍒楄〃鏁版嵁
     getAttrDialogDta() {
       gridAttribute(this.attrPage.currentPage, this.attrPage.pageSize, this.searchAttrParams).then(res => {
-        const data = res.data.data;
-        this.dialogAttrSaveData = data;
+        const data = res.data.data.map(item=>{
+          item.selectable=!this.dialogAttrData.some(existingItem => existingItem.id === item.id);
+          return item;
+        });
+        this.dialogAttrSaveData=data;
         this.attrPage.total = res.data.total;
         this.dialogAttrLoading = false;
       }).catch(err => {
@@ -838,7 +979,9 @@
 
     // 娣诲姞灞炴�ф睜 琛岀偣鍑�
     dialogAttrRowClickHandler(row) {
-
+      if(!row.selectable){
+        return;
+      }
       func.rowClickHandler(
         row,
         this.$refs.dialogAttrCrud,
@@ -886,35 +1029,15 @@
 
     // 娣诲姞灞炴�ф睜 淇濆瓨
     dialogAttrAddClickHandler() {
-      let hasDuplicate = false;
-
-      // 鍏堝垱寤轰竴涓复鏃舵暟缁勬潵瀛樺偍涓嶉噸澶嶇殑椤�
-      const newItems = [];
-
       this.dialogAttrSelectList.forEach(item => {
-        const exists = this.dialogAttrData.some(existingItem => existingItem.id === item.id);
-
-        if (exists) {
-          hasDuplicate = true;
-          return;
-        }
-
-        // 濡傛灉娌℃湁閲嶅椤癸紝鍒欏皢璇ラ」娣诲姞鍒颁复鏃舵暟缁勪腑
-        newItems.push({
+        this.dialogAttrData.push({
           id: item.id,
           attributeDataType: item.attributeDataType,
           defaultValue: item.defaultValue,
           description: item.description
         });
       });
-
-      if (hasDuplicate) {
-        this.$message.error('璇锋鏌ユ槸鍚︽湁娣诲姞閲嶅椤癸紒');
-      } else {
-        // 濡傛灉娌℃湁閲嶅椤癸紝灏嗘柊椤规坊鍔犲埌 dialogAttrData
-        this.dialogAttrData.push(...newItems);
-        this.attrPollDialogVisible = false;
-      }
+      this.attrPollDialogVisible = false;
     },
 
     // 灞炴�ф睜鍒犻櫎
@@ -947,7 +1070,8 @@
         delimiter: '', // 鍒嗛殧绗�
         versionRule: '0', // 鐗堟鍙疯鍒�
         lifeCycleId: '', // 鐢熷懡鍛ㄦ湡
-        subLifeCycleId: [], // 鐢熷懡鍛ㄦ湡澶囬�夊垪琛�,
+        subLifeCycleId: '', // 鐢熷懡鍛ㄦ湡澶囬�夊垪琛�,
+        subLifeCycleIdList:[],
         lifeCycleIds:'',
         apNameArray: "", // 灞炴�ф睜鍒楄〃鈥欙紝鈥樺垎闅�
       };
@@ -968,93 +1092,6 @@
       this.form.delimiter = "";
       this.form.versionRule = "0";
       this.form.revisionRuleId = "";
-    },
-
-    // 鏂板缂栬緫淇濆瓨
-    addDialogSavaHandler() {
-      if (this.form.revLevel !== '0' &&!this.form.inputRevisionFlag && (!this.form.revisionRuleId || this.form.revisionRuleId === "")) {
-        this.$message.error('璇锋鏌ョ増鏈彿瑙勫垯涓嶈兘涓虹┖');
-        return;
-      }
-      this.form.lifeCycleIds=this.form.subLifeCycleId.join(',');
-      this.form.apNameArray = this.dialogAttrData ? this.dialogAttrData.map(item => item.id).join(',') : "";
-      this.$refs.form.validate((valid) => {
-        const saveFunction = this.title === 'add' ? addLifeCycle : updateLifeCycle;
-        if (valid) {
-          if (this.form.revLevel === 0) {
-            this.form.versionRule = "";
-          }
-          saveFunction(this.form).then(res => {
-            if (res.data.code === 200) {
-              this.$message.success(res.data.obj);
-              this.getTreeList();
-              this.resetForm();
-              this.visible = false;
-            }
-          })
-        } else {
-          return false;
-        }
-      });
-    },
-
-    // 缂栬緫鎸夐挳鐐瑰嚮浜嬩欢
-    editClickHandler() {
-      /**
-       * id 鍚嶇О
-       * name 鏍囩
-       * implClass 瀹炵幇绫�
-       * fName 缁ф壙鑷�
-       * description 鎻忚堪
-       * revLevel 鐗堟湰瑙勫垯
-       * revisionRuleId 鐗堟湰鍙疯鍒�
-       * inputRevisionFlag 鎵嬪伐杈撳叆
-       * delimiter 鍒嗛殧绗�
-       * versionRule 鐗堟鍙疯鍒�
-       * lifeCycleId 鐢熷懡鍛ㄦ湡
-       * lifeCycleIds 鐢熷懡鍛ㄦ湡鍒楄〃
-       * attributes 灞炴�ф睜鍒楄〃
-       */
-      if (func.isEmptyObject(this.nodeRow)) {
-        this.$message.error('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�');
-        return;
-      }
-      if (this.nodeRow.id === 'topNode') {
-        this.$message.error('璇烽�夋嫨瀛愯妭鐐硅繘琛屼慨鏀�')
-        return;
-      }debugger;
-      this.form = {...this.nodeRow};
-      this.form.inputRevisionFlag = JSON.parse(this.form.inputRevisionFlag); // 瀛楃涓瞗alse杞崲涓哄竷灏斿��
-      // this.form.fName = this.nodeRow.id === 'topNode' ? "" : this.nodeRow.id;
-      this.form.subLifeCycleId = (this.nodeRow.lifeCycleIds && this.nodeRow.lifeCycleIds.trim())
-        ? this.nodeRow.lifeCycleIds.split(',').map(item => ({id: item.trim()}))
-        : [];
-      this.dialogAttrData = this.nodeRow.attributes ? JSON.parse(this.nodeRow.attributes) : [];
-      function  processChildren(item,fName) {
-        if (item.children && item.children.length > 0) {
-          item.children = item.children.map(child => {
-            processChildren(child,fName); // 閫掑綊澶勭悊姣忎釜瀛愯妭鐐�
-            if(fName==child.id){
-              child.disabled=true;
-            }else {
-              child.disabled=false;
-            }
-            return child;
-          });
-        }
-      };
-      const inheritTreeData=this.inheritTreeData.map(item => {
-        processChildren(item,this.form.id); // 澶勭悊姣忎釜鑺傜偣
-        if(this.form.id==item.id){
-          item.disabled=true;
-        }else {
-          item.disabled=false;
-        }
-        return item;
-      });
-      this.inheritTreeData=inheritTreeData
-      this.title = 'edit';
-      this.visible = true;
     },
 
     // 鍒犻櫎鎸夐挳
@@ -1384,7 +1421,7 @@
 .dialogForm > div {
   border: 1px solid #EBEEF5;
   border-radius: 2px;
-  padding: 25px 20px 5px 10px; /* 涓� 鍙� 涓� 宸� */
+  padding: 15px 20px 0 10px; /* 涓� 鍙� 涓� 宸� */
   box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1); /* 娣诲姞闃村奖鏁堟灉 */
 }
 

--
Gitblit v1.9.3