Răsfoiți Sursa

fix: bug(某些情况下,row类型节点无法删除问题)

肖阳 3 ani în urmă
părinte
comite
f74e6f02db

+ 9 - 7
src/components/DrawFlow/src/components/DrawRow/FlowNode.vue

@@ -13,7 +13,7 @@ export default {
         return {
           pid: "root",
           id: "1",
-          type: "root", // 1:发起人 2:审批人 3 抄送人 4条件框
+          type: "1", // 1:发起人 2:审批人 3 抄送人 4条件框
           title: "所有人12",
           content: "内容2",
           isRow: true,
@@ -53,12 +53,14 @@ export default {
                 tabindex="-1"
                 class="anticon anticon-close close"
               >
-                <i
-                  class="el-icon-close"
-                  onClick={event => {
-                    this.closeNode(event, this.nodeConfig);
-                  }}
-                ></i>
+                {type !== "1" && (
+                  <i
+                    class="el-icon-close"
+                    onClick={event => {
+                      this.closeNode(event, this.nodeConfig);
+                    }}
+                  ></i>
+                )}
               </i>
             </div>
           </div>

+ 20 - 3
src/views/Home.vue

@@ -16,6 +16,17 @@
 </style>
 
 <script>
+const json = {
+  flowDefinitionId: "2ed2599e083240b5aedb2b176aa95357",
+  flowName: "孔令奇测试",
+  currentVersionId: "2ed2599e083240b5aedb2b176aa95357:0",
+  rejectRuleCode: 0,
+  description: "",
+  icon: 0,
+  groupId: "22P0000000366433",
+  nodes:
+    '[{"isRoot":true,"data":{},"type":"1","title":"申请人","isRow":true,"content":"","id":"ajl4dxaxg1gohbxu","pids":[]},{"isRoot":false,"data":{"ccOptional":1,"ccOneself":1,"ccInfoList":[{"userId":"bae6492276af498fb9c18e7fc0624e67","name":"孔令奇(13180814966)"}],"assigneeInfoList":[{"userId":"d8b948389b6142c2bde62d18fa27f7cd","name":"倪小慧(15137880976)"}],"ccType":0,"assigneeType":0,"multiUserDealStrategy":1,"assigneeSelectionStrategy":0},"groupId":"ajl4dxaxg1gohbxu","type":"2","title":"节点1","isRow":true,"content":"倪小慧(15137880976)孔令奇(13180814966)","id":"ahygmvvp3zbgxqw5","pids":["ajl4dxaxg1gohbxu"]}]'
+};
 const arr = [
   {
     id: "a78x4anxe",
@@ -1063,6 +1074,9 @@ export default {
     nodeChange() {
       this.node.content = "nihao";
       this.node.titile = "titile";
+      this.node.data = {
+        a: 1
+      };
       this.$refs.flow.nodeChange(this.node);
     },
     /**
@@ -1076,10 +1090,13 @@ export default {
       return this.FlowConfig;
     },
     init() {
-      setTimeout(() => {
-        this.FlowConfig = arr;
+      const result = JSON.parse(json.nodes);
+      console.log(result, arr);
+
+      this.$nextTick(() => {
+        this.FlowConfig = result;
         this.$forceUpdate();
-      }, 1000);
+      });
       // this.FlowConfig = this.transform(this.FlowConfig);
     },
     clickNode(node) {