From 28a6ee45ba66f9993f2310594bb7e94ec276eb2a Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期一, 12 八月 2024 16:15:16 +0800
Subject: [PATCH] 生命周期:在非编辑状态下,左边的状态列表不显示,中间的图不能拖动。在编辑状态下,左边的生命周期列表不能切换选中项。

---
 Source/plt-web/plt-web-ui/src/store/modules/LifeFlow.js                        |   18 ++++++++++++++++++
 Source/plt-web/plt-web-ui/src/components/flow-cycle/components/Toolbar.vue     |    2 ++
 Source/plt-web/plt-web-ui/src/components/flow-cycle/components/ItemPanel.vue   |    2 +-
 Source/plt-web/plt-web-ui/src/components/flow-cycle/flowchartEditor.vue        |   25 ++++++++++++++++++++-----
 Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/lifeCycle/index.vue  |    3 +++
 Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/statusPool/index.vue |    2 +-
 6 files changed, 45 insertions(+), 7 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/components/flow-cycle/components/ItemPanel.vue b/Source/plt-web/plt-web-ui/src/components/flow-cycle/components/ItemPanel.vue
index efada5e..7a76262 100644
--- a/Source/plt-web/plt-web-ui/src/components/flow-cycle/components/ItemPanel.vue
+++ b/Source/plt-web/plt-web-ui/src/components/flow-cycle/components/ItemPanel.vue
@@ -66,7 +66,7 @@
 
 <style lang="scss" scoped>
 .item-panel {
-  width: 100%;
+  width: 210px;
   height: 77vh;
   text-align: center;
   overflow-y: scroll;
diff --git a/Source/plt-web/plt-web-ui/src/components/flow-cycle/components/Toolbar.vue b/Source/plt-web/plt-web-ui/src/components/flow-cycle/components/Toolbar.vue
index 08659ac..f656817 100644
--- a/Source/plt-web/plt-web-ui/src/components/flow-cycle/components/Toolbar.vue
+++ b/Source/plt-web/plt-web-ui/src/components/flow-cycle/components/Toolbar.vue
@@ -81,6 +81,8 @@
         type: "warning",
       }).then(() => {
         this.$store.dispatch('updateMethodBtn', false);
+        this.$store.dispatch('typeChange', '');
+        console.log(this.$s)
         // this.$emit('reset-tree'); // 瑙﹀彂鐖剁粍浠堕噸缃�
       }).catch(() => {
         this.$message({
diff --git a/Source/plt-web/plt-web-ui/src/components/flow-cycle/flowchartEditor.vue b/Source/plt-web/plt-web-ui/src/components/flow-cycle/flowchartEditor.vue
index b8ac66b..2555966 100644
--- a/Source/plt-web/plt-web-ui/src/components/flow-cycle/flowchartEditor.vue
+++ b/Source/plt-web/plt-web-ui/src/components/flow-cycle/flowchartEditor.vue
@@ -7,8 +7,8 @@
       </div>
       <div class="vfe-chart-container">
         <!-- 宸︿晶椤圭洰鏍� -->
-        <div v-if="type !== 'detail'" class="vfe-chart-sidebar">
-          <editor-item-panel :node-items="chartDataNodeItems"/>
+        <div v-if="disabledBtn" class="vfe-chart-sidebar">
+          <editor-item-panel  :node-items="chartDataNodeItems"/>
         </div>
         <!-- 涓诲浘琛� -->
         <div class="vfe-chart-main">
@@ -108,6 +108,11 @@
       currentSelectedLine: {}
     };
   },
+  computed: {
+    disabledBtn() {
+      return this.$store.state.flow.methodBtn;
+    }
+  },
 
   mounted() {
     // 缁勪欢鎸傝浇瀹屾垚鍚庯紝鑷姩缂╂斁鐢诲竷锛堜粎鍦ㄦ坊鍔犳ā寮忎笅锛�
@@ -124,7 +129,15 @@
     },
     // 澶勭悊鍥捐〃鏁版嵁鏇存敼鐨勪簨浠�
     onAfterChange(e) {
+      console.log(e)
       try {
+        if('edit' === this.$store.state.flow.type){
+          this.$refs.flowChart.propsAPI.remove(e.item);
+          if(e.action === 'remove'){
+            this.$message.error('缂栬緫鐘舵�佷笅涓嶈兘鍒囨崲閫変腑椤癸紒');
+          }
+          return;
+        }
         // 濡傛灉娣诲姞浜嗚妭鐐逛笖鑺傜偣娌℃湁琚洿鏀硅繃
         if (e.action === "add" && e.model.type === "node") {
           if (!e.model.change) {
@@ -135,6 +148,7 @@
           }
         }
       } catch (err) {
+        console.log(err)
         // 澶勭悊鑺傜偣 ID 鍐茬獊閿欒
         if (
           err.message ===
@@ -229,7 +243,8 @@
     .vfe-chart-main {
       position: relative;
       flex: 1;
-      max-height: calc(100% - 5px); // fix scroll show
+      height: 80vh; // fix scroll show
+      width: 65%;
 
       .tooltip {
         position: absolute;
@@ -257,14 +272,14 @@
       position: relative;
       display: flex;
       justify-content: center;
-      width: 16%;
+      width: 210px;
       background-color: #fafafa;
       border-right: 1px solid #e6e9ed;
     }
 
     .vfe-chart-panel {
       position: relative;
-      width: 300px;
+      width: 260px;
       background-color: #fafafa;
       border-left: 1px solid #e6e9ed;
       overflow-y: scroll;
diff --git a/Source/plt-web/plt-web-ui/src/store/modules/LifeFlow.js b/Source/plt-web/plt-web-ui/src/store/modules/LifeFlow.js
index faf34f7..10ca382 100644
--- a/Source/plt-web/plt-web-ui/src/store/modules/LifeFlow.js
+++ b/Source/plt-web/plt-web-ui/src/store/modules/LifeFlow.js
@@ -4,16 +4,34 @@
 const flow = {
   state: {
     methodBtn: false,
+    editMethodBtn:false,
+    type:"",
   },
   mutations: {
     setMethodBtn(state, value) {
       state.methodBtn = value;
+    },
+
+    setEditMethodBtn(state, value) {
+      state.methodBtn = value;
+    },
+
+    setTypeChange(state,value){
+      state.type = value;
     }
   },
   actions: {
     // 鏇存柊淇濆瓨 鍙栨秷鎸夐挳
     updateMethodBtn({commit}, value) {
       commit('setMethodBtn', value);
+    },
+
+    editNodesStatus({commit}, value){
+      commit('setEditMethodBtn', value);
+    },
+
+    typeChange({commit}, value){
+      commit('setTypeChange', value);
     }
   }
 }
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/lifeCycle/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/lifeCycle/index.vue
index 6eff104..719c75d 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/lifeCycle/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/lifeCycle/index.vue
@@ -238,6 +238,7 @@
     addClickHandler() {
       this.$store.dispatch('updateMethodBtn', true);
       this.handleResetTree();
+      this.$store.dispatch('typeChange', 'add');
     },
 
     // 淇敼鎸夐挳
@@ -247,6 +248,8 @@
         return;
       }
       this.$store.dispatch('updateMethodBtn', Object.keys(this.rowData).length > 0);
+      this.$store.dispatch('editNodesStatus', true);
+      this.$store.dispatch('typeChange', 'edit');
     },
 
     // 鍒犻櫎鎸夐挳
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/statusPool/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/statusPool/index.vue
index 2e39321..41fe5ec 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/statusPool/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/statusPool/index.vue
@@ -200,7 +200,7 @@
         this.page.total = res.data.total;
         this.loading = false;
       }).catch(err => {
-        this.$message.error(err)
+        this.$message.error(err);
       });
     },
 

--
Gitblit v1.9.3