Bladeren bron

流程展示代码同步

lph 1 jaar geleden
bovenliggende
commit
d8ea19ebf5

+ 14 - 4
zkqy-ui/src/api/bpmprocess/run/executeProcess.js

@@ -49,7 +49,7 @@ export function processList(query) {
     url: '/system/execute/process/list',
     method: 'get',
     params: query,
-    baseURL: process.env.VUE_APP_BASE_API1,
+    baseURL: process.env.VUE_APP_BASE_API4,
   })
 }
 
@@ -59,7 +59,7 @@ export function runProcessNodeExecution(data) {
     url: '/system/runbpm/process/processNodeExecution',
     method: 'post',
     data: data,
-    baseURL: process.env.VUE_APP_BASE_API1
+    baseURL: process.env.VUE_APP_BASE_API4
   })
 }
 
@@ -69,7 +69,7 @@ export function getProcessNodeFormTemplate(query) {
     url: '/system/runbpm/process/ProcessNodeFormTemplate',
     method: 'get',
     params: query,
-    baseURL: process.env.VUE_APP_BASE_API1,
+    baseURL: process.env.VUE_APP_BASE_API4,
   })
 }
 // 运行节点   新 请求节点的表单数据
@@ -78,6 +78,16 @@ export function getProcessNodeFormInfoData(query) {
     url: '/system/runbpm/process/processNodeFormInfoData',
     method: 'get',
     params: query,
-    baseURL: process.env.VUE_APP_BASE_API1,
+    baseURL: process.env.VUE_APP_BASE_API4,
+  })
+}
+
+// 获取节点展示列表数据
+export function getListLog(query) {
+  return request({
+    url: '/system/execute/process/listLog',
+    method: 'get',
+    params: query,
+    baseURL: process.env.VUE_APP_BASE_API4,
   })
 }

+ 111 - 14
zkqy-ui/src/views/bussiness/progressShow.vue

@@ -22,14 +22,22 @@
         </div>
         <div class="search-list">
           <div class="search-tab">
-            <el-radio-group v-model="processType">
-              <el-radio-button :label="1">进行</el-radio-button>
-              <el-radio-button :label="2">完成</el-radio-button>
+            <el-radio-group
+              v-model="queryParams.taskProcessState"
+              @change="getList"
+            >
+              <el-radio-button label="3">已完成</el-radio-button>
+              <el-radio-button label="0">进行中</el-radio-button>
+              <el-radio-button label="">所有</el-radio-button>
             </el-radio-group>
           </div>
           <div class="search-input">
             <el-input placeholder="请输入..." v-model="queryString">
-              <el-button slot="append" icon="el-icon-search"></el-button>
+              <el-button
+                slot="append"
+                @click="getList"
+                icon="el-icon-search"
+              ></el-button>
             </el-input>
           </div>
         </div>
@@ -38,6 +46,7 @@
         <TaskList
           v-for="(item, index) of tableData"
           :key="index + 1"
+          :num="index + 1"
           :cardData="item"
         ></TaskList>
         <pagination
@@ -54,7 +63,7 @@
 
 <script>
 import TaskList from "./components/taskList.vue";
-import { processList } from "@/api/bpmprocess/run/executeProcess";
+import { processList, getListLog } from "@/api/bpmprocess/run/executeProcess";
 import getNodeSequence from "@/utils/bpmn/getNodeSequence";
 import { xmlStr2XmlObj } from "@/utils/bpmn/xml";
 export default {
@@ -63,12 +72,13 @@ export default {
   components: { TaskList },
   data() {
     return {
-      processType: 1,
+      // processType: 1,
       queryString: "",
       total: 0,
       queryParams: {
         pageNum: 1,
-        pageSize: 5,
+        pageSize: 10,
+        taskProcessState: "0",
       },
       tableData: [], //列表数据
     };
@@ -77,7 +87,18 @@ export default {
   methods: {
     // 获取列表数据
     getList() {
-      processList(this.queryParams).then((res) => {
+      getListLog(this.queryParams).then((res) => {
+        if (res.code == 200) {
+          this.tableData = this.getTableData(
+            res.rows.map((item) => item.resultMap)
+          );
+          console.log(this.tableData);
+          this.total = res.total;
+        } else {
+          this.$message.error("网络异常,请稍后再试");
+        }
+
+        return;
         if (res.code == 200) {
           this.tableData = this.getTableData(
             res.rows.map((item) => item.resultMap)
@@ -93,17 +114,22 @@ export default {
       let res = [];
       res = dataList.map((item) => {
         let baseObj = {
-          benTaskProcessKey: item.bepTaskKey, //任务编号
-          bepTaskName: item.bepTaskName, //任务名称
-          benCreateTime: item.benCreateTime, //开始或结束时间  需要根据bepTaskProcessState状态 来判定
-          currentNodeKey: item.benTaskNodeKey, //当前节点key
+          benTaskProcessKey: item.taskKey, //任务编号
+          bepTaskName: item.taskName, //任务名称
+          benCreateTime: item.nodeLogList[0].taskNodeType
+            ? item.nodeLogList[0].createTime
+            : "", //开始或结束时间  需要根据bepTaskProcessState状态 来判定
+          currentNodeKey: item.taskNodeNextKey, //当前节点key
           cardList: [],
+          doneNodeList: item.nodeLogList,
         };
-        let xmlObj = xmlStr2XmlObj(item.bepTaskProcessXmlContent);
+        let xmlObj = xmlStr2XmlObj(item.taskProcessXmlContent);
         baseObj.cardList = getNodeSequence(xmlObj);
         return baseObj;
       });
-      res = this.setNodeState(res);
+      res = this.nodeHandler(res); //合并两个节点数组
+      res = this.sortHandler(res); //排序
+      // res = this.setNodeState(res);
       return res;
     },
     // 设置节点完成情况
@@ -131,6 +157,77 @@ export default {
 
       return res;
     },
+
+    // 合并两个节点数组
+    nodeHandler(processList) {
+      let res = processList.map((item, index) => {
+        console.log(
+          JSON.parse(JSON.stringify(item.cardList)),
+          JSON.parse(JSON.stringify(item.doneNodeList)),
+          item.currentNodeKey
+        );
+        item.doneNodeList.forEach((node) => {
+          Object.assign(node, {
+            isDone: true,
+            isNow: false,
+            nodeId: node.taskNodeKey,
+            nodeInfo: {
+              localName: node.taskNodeType,
+              id: "",
+              name: node.taskNodeName,
+              nodeDescription: "",
+              industryType: "",
+              normalScriptKey: "",
+              normalScriptTriggerType: node.taskNodeExecuteType,
+              executeUserType: "",
+              executeUser: "",
+              virtuallyRole: "",
+            },
+          });
+        });
+        let currentIndex = item.cardList.findIndex(
+          (node) => node.nodeId == item.currentNodeKey
+        );
+        console.log(currentIndex, item.cardList.length);
+        // while(currentIndex<item.cardList.length){}
+        for (let i = currentIndex; i < item.cardList.length; i++) {
+          if (i == currentIndex) {
+            item.cardList[i].isNow = true;
+            if (i == item.cardList.length - 1) {
+              item.cardList[i].isDone = true;
+            } else {
+              item.cardList[i].isDone = false;
+            }
+          } else {
+            item.cardList[i].isDone = false;
+            item.cardList[i].isNow = false;
+          }
+        }
+        if (currentIndex == item.cardList.length - 1) {
+          item.cardList.splice(0, currentIndex + 1);
+        } else {
+          item.cardList.splice(0, currentIndex);
+        }
+
+        item.cardList.unshift(...item.doneNodeList);
+        console.log(item.cardList);
+        item.cardList.forEach((node, index) => {
+          node.num = index + 1;
+        });
+        return item;
+      });
+      return res;
+    },
+
+    // 任务排序
+    sortHandler(processList) {
+      processList.sort((a, b) => {
+        let time_a = new Date(a.doneNodeList[0].createTime)?.getTime();
+        let time_b = new Date(b.doneNodeList[0].createTime)?.getTime();
+        return time_b - time_a;
+      });
+      return processList;
+    },
   },
   mounted() {
     this.getList();

File diff suppressed because it is too large
+ 779 - 548
zkqy-ui/src/views/tablelist/commonTable/listInfo.vue


+ 22 - 17
zkqy-ui/src/views/tablelist/commonTable/queryfrom.vue

@@ -30,6 +30,7 @@
       :inline="true"
       label-width="68px"
       @submit.native.prevent
+      v-show="showSearch"
     >
       <el-form-item label="超级查询">
         <el-input
@@ -77,17 +78,20 @@
             </el-form-item>
           </span>
           <!--      button按钮循环-->
-            <span
-              v-if="item.conditionType == 'button'"
-              style="width: 500px; height: 500px"
+          <span
+            v-if="item.conditionType == 'button'"
+            style="width: 500px; height: 500px"
+          >
+            <el-form-item
+              :label="item.conditionName"
+              :prop="item.conditionField"
             >
-            <el-form-item :label="item.conditionName"
-                          :prop="item.conditionField">
-              {{ queryParams.queryMap[item.conditionField] = item.conditionDefaultValue }}
-              <el-button
-                @keyup.enter.native="handleQuery"
-                @click="handleQuery">
-                {{ item.conditionNotes == null ? '按钮' : item.conditionNotes }}
+              {{
+                (queryParams.queryMap[item.conditionField] =
+                  item.conditionDefaultValue)
+              }}
+              <el-button @keyup.enter.native="handleQuery" @click="handleQuery">
+                {{ item.conditionNotes == null ? "按钮" : item.conditionNotes }}
               </el-button>
             </el-form-item>
           </span>
@@ -166,13 +170,12 @@
           </span>
         </span>
       </div>
-
     </el-form>
   </div>
 </template>
 
 <script>
-import cardcountpanel from "../components/cardCountPanel.vue"
+import cardcountpanel from "../components/cardCountPanel.vue";
 export default {
   name: "queryfrom",
   props: {
@@ -180,14 +183,17 @@ export default {
       type: Array,
       default: () => [],
     },
-    showCount : {
+    showCount: {
+      type: Boolean,
+    },
+    showSearch: {
       type: Boolean,
     },
-    statisticList:{
+    statisticList: {
       type: Array,
-    }
+    },
   },
-  components:{cardcountpanel},
+  components: { cardcountpanel },
   data() {
     return {
       // 时间范围临时存储
@@ -220,7 +226,6 @@ export default {
       // 单选/按钮
       radios: [],
       // card
-
     };
   },
   watch: {

Some files were not shown because too many files changed in this diff