Procházet zdrojové kódy

feat(bpm): 已发流程添加撤回功能并修复文本内容处理

liujt před 2 měsíci
rodič
revize
7386a4e31c

+ 8 - 0
src/api/bpm/task.js

@@ -371,3 +371,11 @@ export async function ccPage(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+export function withdrawTask(query) {
+  return request({
+    url: '/bpm/task/withdraw',
+    method: 'get',
+    params: query
+  });
+}

+ 46 - 12
src/views/bpm/myInitiatedProcesses/index.vue

@@ -86,13 +86,26 @@
         </template>
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
-          <el-button
+          <!-- <el-button
             size="mini"
             type="text"
             icon="el-icon-edit"
             @click="handleAudit(row)"
           >详情</el-button
+          > -->
+
+          <el-popconfirm
+            class="ele-action"
+            title="确认撤回吗?"
+            @confirm="handleWithdraw(row)"
+            v-if="row.status == 1"
           >
+            <template v-slot:reference>
+              <el-link type="primary" :underline="false">
+                撤回
+              </el-link>
+            </template>
+          </el-popconfirm>
         </template>
       </ele-pro-table>
     </el-card>
@@ -103,7 +116,7 @@
 
 <script>
 import dictMixins from '@/mixins/dictMixins';
-import { getProcessInstancePage } from '@/api/bpm/task';
+import { getProcessInstancePage, withdrawTask } from '@/api/bpm/task';
 import {getDate} from "@/utils/dateUtils";
 // import detail from '@/views/bpm/processInstance/detail.vue';
 import detail from '@/views/bpm/done/detailDialog.vue'
@@ -207,16 +220,16 @@ export default {
         //   showOverflowTooltip: true,
         //   minWidth: 130
         // },
-        // {
-        //   columnKey: 'action',
-        //   label: '操作',
-        //   width: 230,
-        //   align: 'center',
-        //   resizable: false,
-        //   slot: 'action',
-        //   showOverflowTooltip: true,
-        //   fixed: 'right'
-        // }
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 230,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          showOverflowTooltip: true,
+          fixed: 'right'
+        }
       ]
     };
   },
@@ -259,6 +272,27 @@ export default {
       row.processInstance = processInstance;
       this.$refs.detailRef.open(row);
     },
+    handleWithdraw(row) {
+      console.log(row,'row') 
+      console.log(row.businessId,'row.businessId')
+      const processDefinitionKey = row.processDefinitionId.split(':')[0]
+      withdrawTask({
+        processInstanceId: row.id,
+        businessId: row.businessId,
+        processDefinitionKey: processDefinitionKey,
+      }).then(res => {
+        console.log(res,'res')
+        if (res.data.code == 0) {
+          this.$message({
+            message: '撤回成功',
+            type: 'success'
+          });
+          this.reload();
+        }
+      }).catch(err => {
+     
+      })
+    },
     getTimelineItemType(result) {
       if (result === '通过') {
         return 'success';

+ 1 - 1
src/views/home/index.vue

@@ -485,7 +485,7 @@ export default {
             images.push(match[1]);
           }
           // 提取纯文本内容(去除 HTML 标签和空格)
-          const textContent = content.replace(/<[^>]+>/g, '').replace(/\s+/g, '').trim();
+          const textContent = content.replace(/<[^>]+>/g, '').replace(/&nbsp;/g, '').replace(/\s+/g, '').trim();
 
           return {
             id: item.id,