Эх сурвалжийг харах

feat:增加流程运行所需接口地址

韩帛霖 1 жил өмнө
parent
commit
155faefc85

+ 1 - 37
ruoyi-ui/src/api/bpmprocess/process.js

@@ -101,6 +101,7 @@ export function updateConfiguration(data) {
     baseURL: process.env.VUE_APP_BASE_API4,
   })
 }
+
 // 查询流程节点详情
 export function getNodeData(processKey) {
   return request({
@@ -136,40 +137,3 @@ export function addScript(data) {
     data: data
   })
 }
-
-// 修改流程节点脚本
-export function updateScript(data) {
-  return request({
-    url: '/system/script',
-    method: 'put',
-    data: data
-  })
-}
-
-// 删除流程节点脚本
-export function delScript(id) {
-  return request({
-    url: '/system/script/' + id,
-    method: 'delete'
-  })
-}
-
-// 执行管道列表数据
-export function processList(query) {
-  return request({
-    url: '/system/execute/process/list',
-    method: 'get',
-    params: query,
-    baseURL: process.env.VUE_APP_BASE_API4,
-  })
-}
-
-// 运行节点
-export function btnCommonApiProcess(data) {
-  return request({
-    url: '/system/runbpm/process/processNodeExecution',
-    method: 'post',
-    data: data,
-    baseURL: process.env.VUE_APP_BASE_API4
-  })
-}

+ 45 - 0
ruoyi-ui/src/api/bpmprocess/run/executeMiddle.js

@@ -0,0 +1,45 @@
+import request from '@/utils/request'
+
+// 查询执行流程用户、节点关联脚本中间表列表
+export function listMiddle(query) {
+  return request({
+    url: '/system/middle/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询执行流程用户、节点关联脚本中间表详细
+export function getMiddle(id) {
+  return request({
+    url: '/system/middle/' + id,
+    method: 'get'
+  })
+}
+
+// 新增执行流程用户、节点关联脚本中间表
+export function addMiddle(data) {
+  return request({
+    url: '/system/middle',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改执行流程用户、节点关联脚本中间表
+export function updateMiddle(data) {
+  return request({
+    url: '/system/middle',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除执行流程用户、节点关联脚本中间表
+export function delMiddle(id) {
+  return request({
+    url: '/system/middle/' + id,
+    method: 'delete'
+  })
+}
+

+ 44 - 0
ruoyi-ui/src/api/bpmprocess/run/executeNode.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询节点执行表(记录表)列表
+export function listNode(query) {
+  return request({
+    url: '/system/node/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询节点执行表(记录表)详细
+export function getNode(id) {
+  return request({
+    url: '/system/node/' + id,
+    method: 'get'
+  })
+}
+
+// 新增节点执行表(记录表)
+export function addNode(data) {
+  return request({
+    url: '/system/node',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改节点执行表(记录表)
+export function updateNode(data) {
+  return request({
+    url: '/system/node',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除节点执行表(记录表)
+export function delNode(id) {
+  return request({
+    url: '/system/node/' + id,
+    method: 'delete'
+  })
+}

+ 64 - 0
ruoyi-ui/src/api/bpmprocess/run/executeProcess.js

@@ -0,0 +1,64 @@
+import request from '@/utils/request'
+
+// 查询流程执行任务表列表
+export function listProcess(query) {
+  return request({
+    url: '/system/process/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询流程执行任务表详细
+export function getProcess(id) {
+  return request({
+    url: '/system/process/' + id,
+    method: 'get'
+  })
+}
+
+// 新增流程执行任务表
+export function addProcess(data) {
+  return request({
+    url: '/system/process',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改流程执行任务表
+export function updateProcess(data) {
+  return request({
+    url: '/system/process',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除流程执行任务表
+export function delProcess(id) {
+  return request({
+    url: '/system/process/' + id,
+    method: 'delete'
+  })
+}
+
+// 执行管道列表数据
+export function processList(query) {
+  return request({
+    url: '/system/execute/process/list',
+    method: 'get',
+    params: query,
+    baseURL: process.env.VUE_APP_BASE_API4,
+  })
+}
+
+// 运行节点
+export function runProcessNodeExecution(data) {
+  return request({
+    url: '/system/runbpm/process/processNodeExecution',
+    method: 'post',
+    data: data,
+    baseURL: process.env.VUE_APP_BASE_API4
+  })
+}

+ 78 - 70
ruoyi-ui/src/views/bussiness/processMange.vue

@@ -57,26 +57,26 @@
         </div>
       </div>
       <div class="show-body">
+        <!--    流程任务列表    -->
         <el-table :data="tableData" border stripe>
-          <el-table-column type="selection" width="55" align="center" />
-          <el-table-column type="index" width="50" align="center" />
+          <el-table-column type="selection" width="55" align="center"/>
+          <el-table-column type="index" width="50" align="center"/>
           <el-table-column
             v-for="col in columns"
             :prop="col.prop"
             :key="col.prop"
             :label="col.label"
-            align="center"
-          >
+            align="center">
             <template slot-scope="scope">
               <span v-if="col.prop == 'benCreateTime'">{{
-                scope.row.benCreateTime.replace("T", " ")
-              }}</span>
+                  scope.row.benCreateTime.replace("T", " ")
+                }}</span>
               <span v-else-if="col.prop == 'bepTaskProcessType'">{{
-                getDictLabel(scope.row.bepTaskProcessType, dict.type.bpm_type)
-              }}</span>
+                  getDictLabel(scope.row.bepTaskProcessType, dict.type.bpm_type)
+                }}</span>
               <span v-else-if="col.prop == 'benTaskNodeState'">{{
-                scope.row.benTaskNodeState == "0" ? "已执行" : "未执行"
-              }}</span>
+                  scope.row.benTaskNodeState == "0" ? "已执行" : "未执行"
+                }}</span>
               <span v-else>{{ scope.row[col.prop] }}</span>
             </template>
           </el-table-column>
@@ -88,8 +88,7 @@
                   plain
                   size="small"
                   class="mr10 mb5"
-                  @click="runHandler(scope.row)"
-                >
+                  @click="opneExecuteNode(scope.row)">
                   运行
                 </el-button>
                 <el-dropdown>
@@ -97,52 +96,26 @@
                     处理<i class="el-icon-arrow-down el-icon--right"></i>
                   </el-button>
                   <el-dropdown-menu slot="dropdown">
-                    <el-dropdown-item
-                      ><el-button
+                    <el-dropdown-item>
+                      <el-button
                         size="mini"
                         type="text"
                         icon="el-icon-edit"
                         @click="excuteHandler(scope.row)"
                         v-hasPermi="['system:user:edit']"
-                        >处理</el-button
-                      ></el-dropdown-item
-                    >
-                    <!-- <el-dropdown-item>
-                    <el-button
-                      size="mini"
-                      type="text"
-                      icon="el-icon-delete"
-                      @click="runHandler(scope.row)"
-                      v-hasPermi="['system:user:remove']"
-                      >运行管道</el-button
-                    >
-                  </el-dropdown-item> -->
+                      >处理
+                      </el-button>
+                    </el-dropdown-item>
                     <el-dropdown-item>
-                      <el-dropdown
-                        size="mini"
-                        @command="
-                          (command) => handleCommand(command, scope.row)
-                        "
-                      >
+                      <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)">
                         <el-button
                           size="mini"
                           type="text"
                           icon="el-icon-d-arrow-right"
-                          >触发异常</el-button
+                        >触发异常
+                        </el-button
                         >
                         <el-dropdown-menu slot="dropdown">
-                          <!-- <el-dropdown-item
-                          command="handleResetPwd"
-                          icon="el-icon-key"
-                          v-hasPermi="['system:user:resetPwd']"
-                          >重置密码</el-dropdown-item
-                        >
-                        <el-dropdown-item
-                          command="handleAuthRole"
-                          icon="el-icon-circle-check"
-                          v-hasPermi="['system:user:edit']"
-                          >分配角色</el-dropdown-item
-                        > -->
                         </el-dropdown-menu>
                       </el-dropdown>
                     </el-dropdown-item>
@@ -152,6 +125,7 @@
             </template>
           </el-table-column>
         </el-table>
+        <!--    分页    -->
         <pagination
           v-show="total > 0"
           :total="total"
@@ -160,14 +134,32 @@
           @pagination="getList"
         />
       </div>
+      <div class="show-window">
+
+        <!-- 运行节点弹窗 -->
+        <el-dialog :title="nodeTitle" :visible.sync="open" width="50%">
+          <el-form label-width="100px" :model="commonData">
+            <h1> 这里会引入当前节点需要处理的表单 </h1>
+          </el-form>
+          <span slot="footer" class="dialog-footer">
+            <el-button @click="closeExecuteNode">Cancel</el-button>
+            <el-button type="primary" @click="executeNode">Execute</el-button>
+          </span>
+        </el-dialog>
+
+
+<!--     手:qweere
+        拖拽:123123
+   -->
+      </div>
     </div>
   </div>
 </template>
 
 <script>
-import { processList } from "@/api/bpmprocess/process";
-import { btnCommonApiProcess } from "@/api/bpmprocess/process";
+import {processList, runProcessNodeExecution} from "@/api/bpmprocess/run/executeProcess";
 import getNodeSequence from "@/utils/bpmn/getNodeSequence";
+
 export default {
   name: "processMange",
   props: [],
@@ -175,6 +167,11 @@ export default {
   dicts: ["bpm_type"],
   data() {
     return {
+      // 节点弹窗title
+      nodeTitle: "节点弹窗",
+      open: false,
+      // 节点弹窗对应的formData
+      commonData: {},
       taskType: 1,
       queryString: "",
       taskStatus: 3,
@@ -226,6 +223,9 @@ export default {
     };
   },
   computed: {},
+  mounted() {
+    this.getList();
+  },
   methods: {
     // 获取列表数据
     getList() {
@@ -240,23 +240,18 @@ export default {
         }
       });
     },
-    // 搜索回调
-    searchList() {
-      this.getList();
-    },
-    // 处理回调
-    excuteHandler(row) {
-      console.log("处理", row);
+    // 打开运行节点弹窗
+    opneExecuteNode(row) {
+      console.log(row);
+      this.open = true;  // 打开弹窗
+      // 根据当前节点绑定的表单信息查询对应的表单进行展示
+
     },
-    // 处理回调
-    runHandler(row) {
+    // 运行节点按钮
+    executeNode(row) {
       console.log(row);
-      let { benTaskNodeKey, bepTaskProcessXmlContent, implementationName } =
-        row;
-      let { nodeId, nextNodeId } = this.getNextNodeKey(
-        benTaskNodeKey,
-        bepTaskProcessXmlContent
-      );
+      let {benTaskNodeKey, bepTaskProcessXmlContent, implementationName} = row;
+      let {nodeId, nextNodeId} = this.getNextNodeKey(benTaskNodeKey, bepTaskProcessXmlContent);
       let payLoad = {
         basicMap: {
           taskNodeKey: nodeId,
@@ -269,11 +264,16 @@ export default {
           //formData
         },
       };
-      btnCommonApiProcess(payLoad).then((res) => {
-        console.log(res);
-      });
+      // runProcessNodeExecution(payLoad).then((res) => {
+      //   console.log(res);
+      // });
       console.log(payLoad);
     },
+    // 关闭运行节点弹窗
+    closeExecuteNode(row) {
+      console.log(row);
+      this.open = false;
+    },
     // 获取下一个节点的nodekey
     getNextNodeKey(nodeKey, xmlStr) {
       let xmlObj = this.xmlStr2XmlObj(xmlStr);
@@ -302,10 +302,7 @@ export default {
         return item.value == value;
       })?.label;
     },
-  },
-  mounted() {
-    this.getList();
-  },
+  }
 };
 </script>
 
@@ -313,6 +310,7 @@ export default {
 .process-mange-wrap {
   background-color: #f2f3f8;
   padding: 20px;
+
   .col {
     background-color: #fff;
     border-right: 1px solid #ebedf2;
@@ -324,19 +322,23 @@ export default {
       align-items: center;
       padding: 10px 17px;
       justify-content: space-between;
+
       .discription {
         display: flex;
         flex-direction: column;
+
         .title {
           line-height: 20px;
           font-size: 18px;
           font-weight: 700;
           margin-bottom: 5px;
         }
+
         .sub-title {
           font-size: 14px;
         }
       }
+
       .data {
         font-size: 20px;
         font-weight: 700;
@@ -348,6 +350,7 @@ export default {
     margin-top: 30px;
     box-shadow: 0 1px 15px 1px rgb(69 65 78 / 8%);
     background-color: #fff;
+
     .show-header {
       border-bottom: 1px solid #ebedf2;
       display: flex;
@@ -355,18 +358,23 @@ export default {
       justify-content: space-between;
       padding: 0px 20px 0px 20px;
       height: 70px;
+
       .header {
       }
+
       .search-list {
         display: flex;
+
         .search-tab {
           margin-right: 20px;
+
           .btn-list-two {
             margin-left: 10px;
           }
         }
       }
     }
+
     .show-body {
       padding: 25px;
     }