From dfd7249fad876dee96480d70ff6f5ebd60207617 Mon Sep 17 00:00:00 2001
From: zhiyong.zhou <zhiyong.zhou@highdatas.com>
Date: 星期一, 04 三月 2024 18:11:06 +0800
Subject: [PATCH] 树形方法写到工具类中

---
 src/views/workspace/process/ProcessInstanceTabs.vue |   36 ++----------------------------------
 1 files changed, 2 insertions(+), 34 deletions(-)

diff --git a/src/views/workspace/process/ProcessInstanceTabs.vue b/src/views/workspace/process/ProcessInstanceTabs.vue
index ab8158f..118080f 100644
--- a/src/views/workspace/process/ProcessInstanceTabs.vue
+++ b/src/views/workspace/process/ProcessInstanceTabs.vue
@@ -23,39 +23,7 @@
     };
   },
   methods: {
-    convertToTreeData(data, parent,index,parentId) {
-      const tempJson = data.find(f =>
-          f.index_no === index
-      )
-      this.$store.state.noTakeList .push(tempJson.id)
-      parent.children = {
-        "id": tempJson.id,
-        "parentId": parentId,
-        "name": "瀹℃壒浜�",
-        "type": "APPROVAL",
-        "props":
-            {
-              "assignedType": "ASSIGN_USER",
-              "nobody": {
-                "handler": "TO_PASS",
-                "assignedUser": []
-              },
-              "refuse": {
-                "type": "TO_END",
-                "target": ""
-              },
-              "assignedUser": [{"id": tempJson.board_id||tempJson.rule_code, "name": tempJson.name,"type":tempJson.board_id!=null?"group":"staff"}],
-              "approvalGroup":tempJson.board_id!=null?{"id":tempJson.board_id,"name":tempJson.name}:"",
-              "staffGroup":tempJson.board_id!=null?"":{"id":tempJson.rule_code,"name":tempJson.name},
-            }
-      }
-      //鑺傜偣鏁扮粍鐨勫ぇ灏� 澶т簬褰撳墠寰幆鐨� 璇存槑杩樻湁瀛愰」 缁х画寰幆
-      if (data.length >index) {
-        let getChildren = this.convertToTreeData(data, parent.children, index+1,parent.children.id)
-        parent.children=getChildren
-      }
-      return parent;
-    },
+
     getProcessInfo() {
       this.loading = true;
       let param = {"id": this.processInstanceId}
@@ -92,7 +60,7 @@
     getFlowDetail(param){
       getFlowDetail(param).then(rsp => {
         let form = rsp.data.data;
-        form.process =this.convertToTreeData(form.steps, {
+        form.process =this.$Utils.convertToTreeData(form.steps, {
           "id": form.id, "parentId": null,
           "type": "ROOT",
           "name": "鍙戣捣浜�",

--
Gitblit v1.8.0