From 5a98e5f9ce50bb5de56a54cae14e5ea49fbe2c07 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期一, 17 三月 2025 16:19:29 +0800
Subject: [PATCH] 更新流程实现

---
 src/views/flowable/task/myProcess/detail/index.vue |   69 ++++++++++++++++++++++------------
 1 files changed, 45 insertions(+), 24 deletions(-)

diff --git a/src/views/flowable/task/myProcess/detail/index.vue b/src/views/flowable/task/myProcess/detail/index.vue
index fd34a07..b8e9952 100644
--- a/src/views/flowable/task/myProcess/detail/index.vue
+++ b/src/views/flowable/task/myProcess/detail/index.vue
@@ -10,27 +10,17 @@
         <!--琛ㄥ崟淇℃伅-->
         <el-tab-pane label="琛ㄥ崟淇℃伅" name="1">
           <!--鍒濆鍖栨祦绋嬪姞杞借〃鍗曚俊鎭�-->
-          <el-col :span="16" :offset="4">
+          <el-col :span="16" :offset="4" v-loading="formLoading" class="tab-min-height">
             <div v-if="formDataList && formDataList.length > 0">
               <div v-for="(formDataObj, index) in formDataList" :key="index" class="form-warp" style="position: relative">
                 <div v-if="formDataObj.current">
-                  <!--     褰撳墠鑺傜偣鍙崗鍚屻�佽浆鍔炵瓑鎿嶄綔         -->
-                  <div class="op-list">
-                    <el-button size="small" type="primary" @click="submitForm">纭骞舵彁浜�</el-button>
-                    <el-button size="small" type="primary" disabled @click="submitForm">鍗忓悓鍔炵悊(鍔熻兘寮�鍙戜腑)</el-button>
-                    <el-button size="small" type="primary" @click="openDelegation(formDataList[0].beforeNodeName)">杞姙</el-button>
-                  </div>
                   <div class="current">褰撳墠闃舵锛�<span>{{formDataObj.beforeNodeName}}</span></div>
                 </div>
                 <div v-else-if="formDataList.length > 1">
-                  <!--     鍓嶇疆鑺傜偣鍙┏鍥�         -->
-                  <div class="reject-but">
-                    <el-button type="danger" size="small" @click="openRejectTask(formDataObj.beforeNodeDefId)">椹� 鍥�</el-button>
-                  </div>
                   <div class="before">鍓嶇疆闃舵锛�<span>{{formDataObj.beforeNodeName}}</span></div>
                 </div>
-                <div v-if="formDataObj != null && formDataObj.formJson != null && formDataObj.formJson != ''">
-                  <v-form-render  :form-data="formDataObj.formJson" :ref="'form' + index"/>
+                <div v-if="formDataObj != null && formDataObj.formJsonObj != null">
+                  <v-form-render  :form-data="formDataObj.formJsonObj.formJson" :ref="'form' + index"/>
                 </div>
                 <div v-else>
                   <el-alert
@@ -40,8 +30,21 @@
                   >
                   </el-alert>
                 </div>
+                <div style="position: absolute;top: 10px; right: 20px" v-if="formDataObj.events.length > 0">
+                  <el-popover
+                    placement="right-start"
+                    title="浠诲姟鏃ュ織"
+                    width="800"
+                    trigger="hover"
+                    >
+                    <div v-if="formDataObj.events.length > 0">
+                      <log-view :log-list="formDataObj.events"/>
+                    </div>
+                    <el-button slot="reference">浠诲姟鏃ュ織</el-button>
+                  </el-popover>
+                </div>
                 <div v-if="formDataList.length <= 1">
-                  <div class="before">鍓嶇疆闃舵锛�<span>涓嶅瓨鍦ㄥ墠缃樁娈�</span></div>
+                  <div class="before_none">鍓嶇疆闃舵锛�<span>涓嶅瓨鍦ㄥ墠缃樁娈�</span></div>
                   <el-alert
                     title="涓嶅瓨鍦ㄥ墠缃樁娈�"
                     type="warning"
@@ -105,7 +108,9 @@
         </el-tab-pane>
         <!--娴佺▼鍥�-->
         <el-tab-pane label="娴佺▼鍥�" name="3">
-          <bpmn-viewer :flowData="flowData" :procInsId="taskForm.procInsId"/>
+          <div class="tab-min-height" v-loading="imgLoading">
+            <bpmn-viewer :flowData="flowData" :procInsId="taskForm.procInsId"/>
+          </div>
         </el-tab-pane>
     </el-tabs>
     </el-card>
@@ -117,16 +122,19 @@
 import {getProcessVariables, flowXmlAndNode} from "@/api/flowable/definition";
 import {flowTaskForm, flowTaskFormDetail} from "@/api/flowable/todo";
 import BpmnViewer from '@/components/Process/viewer';
+import LogView from "@/views/projectProcess/components/LogView";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 
 export default {
   name: "Record",
   components: {
-    BpmnViewer
+    BpmnViewer, LogView
   },
   props: {},
   data() {
     return {
+      formLoading: false, // 鍔犺浇琛ㄥ崟
+      imgLoading: false, // 鍔犺浇娴佺▼鍥�
       projectName: '',
       flowName: '',
       // 妯″瀷xml鏁版嵁
@@ -158,13 +166,15 @@
     this.projectName = this.$route.query && this.$route.query.projectName;
     this.flowName = this.$route.query && this.$route.query.flowName;
     // 娴佺▼浠诲姟閲嶈幏鍙栧彉閲忚〃鍗�
-    this.processVariables( this.taskForm.taskId)
-    this.getFlowRecordList(this.taskForm.procInsId, this.taskForm.deployId);
+    this.processVariables( this.taskForm.taskId, this.taskForm.procInsId)
+    this.getFlowRecordList(this.taskForm.procInsId);
   },
   methods: {
     handleClick(tab, event) {
       if (tab.name === '3'){
-        flowXmlAndNode({procInsId:this.taskForm.procInsId,deployId:this.taskForm.deployId}).then(res => {
+        this.imgLoading = true
+        flowXmlAndNode({processInsId:this.taskForm.procInsId,deployId:this.taskForm.deployId}).then(res => {
+          this.imgLoading = false
           this.flowData = res.data;
         })
       }
@@ -184,9 +194,9 @@
       }
     },
     /** 娴佺▼娴佽浆璁板綍 */
-    getFlowRecordList(procInsId, deployId) {
+    getFlowRecordList(procInsId) {
       const that = this
-      const params = {procInsId: procInsId, deployId: deployId}
+      const params = {procInsId: procInsId}
       flowRecord(params).then(res => {
         that.flowRecordList = res.data.flowList;
       }).catch(res => {
@@ -194,17 +204,17 @@
       })
     },
     /** 鑾峰彇娴佺▼鍙橀噺鍐呭 */
-    processVariables(taskId) {
+    processVariables(taskId, processInsId) {
       if (taskId) {
+        this.formLoading = true
         // 鎻愪氦娴佺▼鐢宠鏃跺~鍐欑殑琛ㄥ崟瀛樺叆浜嗘祦绋嬪彉閲忎腑鍚庣画浠诲姟澶勭悊鏃堕渶瑕佸睍绀�
-        flowTaskFormDetail(taskId).then(res => {
+        flowTaskFormDetail(processInsId, taskId).then(res => {
           this.formDataList = res.data
           if (this.formDataList && this.formDataList.length > 0) {
             this.$nextTick(() => {
               this.formDataList.forEach((formDataObj, index) => {
                 console.log("琛ㄥ崟鏁版嵁鍒楄〃", formDataObj.formJson)
                 let that = this
-                console.log(eval("that.$refs.form" + index)[0])
                 if (formDataObj.formJsonObj) {
                   eval("that.$refs.form" + index)[0].setFormJson(formDataObj.formJsonObj.formJson);
 
@@ -217,6 +227,7 @@
               // this.formJson = this.formDataList[0].formJsonObj.formJson
             })
           }
+          this.formLoading = false
           // this.$nextTick(() => {
           //   // 鍥炴樉琛ㄥ崟
           //   this.$refs.vFormRef.setFormJson(res.data.formJson);
@@ -289,6 +300,13 @@
     color: #F56C6C
   }
   margin-bottom: 15px;
+  color: #E6A23C
+}
+.before_none {
+  span {
+    color: #F56C6C
+  }
+  margin-bottom: 15px;
   margin-top: 15px;
   color: #E6A23C
 }
@@ -312,4 +330,7 @@
   justify-content: center;
   align-items: center;
 }
+.tab-min-height {
+  min-height: 500px;
+}
 </style>

--
Gitblit v1.8.0