瀏覽代碼

update 调整查询流程图渲染空指针错误,优化流程图样式

gssong 10 月之前
父節點
當前提交
1878f49e8d

+ 2 - 2
src/api/workflow/instance/index.ts

@@ -31,9 +31,9 @@ export const pageByFinish = (query: FlowInstanceQuery): AxiosPromise<FlowInstanc
 /**
  * 通过业务id获取历史流程图
  */
-export const flowImage = (businessId: string | number) => {
+export const flowHisTaskList = (businessId: string | number) => {
   return request({
-    url: `/workflow/instance/flowImage/${businessId}` + '?t' + Math.random(),
+    url: `/workflow/instance/flowHisTaskList/${businessId}` + '?t' + Math.random(),
     method: 'get'
   });
 };

+ 1 - 2
src/api/workflow/workflowCommon/index.ts

@@ -8,8 +8,7 @@ export default {
       query: {
         id: routerJumpVo.businessId,
         type: routerJumpVo.type,
-        taskId: routerJumpVo.taskId,
-        instanceId: routerJumpVo.instanceId
+        taskId: routerJumpVo.taskId
       }
     });
   }

+ 0 - 1
src/api/workflow/workflowCommon/types.ts

@@ -4,7 +4,6 @@ export interface RouterJumpVo {
   type: string;
   formCustom: string;
   formPath: string;
-  instanceId: string | number;
 }
 
 export interface StartProcessBo {

+ 5 - 5
src/components/Process/approvalRecord.vue

@@ -3,7 +3,7 @@
     <el-dialog v-model="visible" draggable title="审批记录" :width="props.width" :height="props.height" :close-on-click-modal="false">
       <el-tabs v-model="tabActiveName" class="demo-tabs">
         <el-tab-pane v-loading="loading" label="流程图" name="image" style="height: 68vh">
-          <flowChart :ins-id="insId" v-if="insId != ''" />
+          <flowChart :ins-id="insId" v-if="insId" />
         </el-tab-pane>
         <el-tab-pane v-loading="loading" label="审批信息" name="info">
           <div>
@@ -59,7 +59,7 @@
   </div>
 </template>
 <script setup lang="ts">
-import { flowImage } from '@/api/workflow/instance';
+import { flowHisTaskList } from '@/api/workflow/instance';
 import { propTypes } from '@/utils/propTypes';
 import { listByIds } from '@/api/system/oss';
 import FlowChart from '@/components/Process/flowChart.vue';
@@ -76,15 +76,15 @@ const tabActiveName = ref('image');
 const insId = ref(null);
 
 //初始化查询审批记录
-const init = async (businessId: string | number, instanceId: string | number) => {
+const init = async (businessId: string | number) => {
   visible.value = true;
   loading.value = true;
   tabActiveName.value = 'image';
   historyList.value = [];
-  insId.value = instanceId;
-  flowImage(businessId).then((resp) => {
+  flowHisTaskList(businessId).then((resp) => {
     if (resp.data) {
       historyList.value = resp.data.list;
+      insId.value = resp.data.instanceId;
       if (historyList.value.length > 0) {
         historyList.value.forEach((item) => {
           if (item.ext) {

+ 16 - 2
src/components/Process/flowChart.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
-    <div :style="'height:' + height">
-      <iframe :src="iframeUrl" style="width: 100%; height: 100%" />
+    <div :style="'height:' + height" class="iframe-wrapper">
+      <iframe :src="iframeUrl" style="width: 100%; height: 100%" frameborder="0" scrolling="no" class="custom-iframe" />
     </div>
   </div>
 </template>
@@ -27,3 +27,17 @@ onMounted(async () => {
   iframeUrl.value = url + '&Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID;
 });
 </script>
+<style scoped>
+.iframe-wrapper {
+  border-radius: 12px;
+  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
+  overflow: hidden; /* 关键隐藏内部溢出 */
+}
+
+.custom-iframe {
+  width: 100%;
+  height: 600px;
+  border: none;
+  background: transparent;
+}
+</style>

+ 1 - 6
src/views/workflow/leave/leaveEdit.vue

@@ -270,7 +270,7 @@ const handleStartWorkFlow = async (data: LeaveForm) => {
 };
 //审批记录
 const handleApprovalRecord = () => {
-  approvalRecordRef.value.init(form.value.id, routeParams.value.instanceId);
+  approvalRecordRef.value.init(form.value.id);
 };
 //提交回调
 const submitCallback = async () => {
@@ -291,11 +291,6 @@ const submitButtonShow = computed(() => {
   );
 });
 
-//校验审批按钮是否显示
-const approvalButtonShow = computed(() => {
-  return routeParams.value.type === 'approval' && form.value.status && form.value.status === 'waiting';
-});
-
 onMounted(() => {
   nextTick(async () => {
     routeParams.value = proxy.$route.query;

+ 2 - 3
src/views/workflow/processInstance/index.vue

@@ -159,7 +159,7 @@
         <template #header>
           <div class="clearfix">
             <span
-            >流程定义名称:<el-tag>{{ processDefinitionName }}</el-tag></span
+              >流程定义名称:<el-tag>{{ processDefinitionName }}</el-tag></span
             >
           </div>
         </template>
@@ -371,8 +371,7 @@ const handleView = (row) => {
     taskId: row.id,
     type: 'view',
     formCustom: row.formCustom,
-    formPath: row.formPath,
-    instanceId: row.instanceId
+    formPath: row.formPath
   });
   workflowCommon.routerJump(routerJumpVo, proxy);
 };

+ 2 - 3
src/views/workflow/task/myDocument.vue

@@ -80,7 +80,7 @@
                   </el-col>
                   <el-col :span="1.5" v-if="scope.row.flowStatus === 'waiting'">
                     <el-button type="primary" size="small" icon="Notification" @click="handleCancelProcessApply(scope.row.businessId)"
-                    >撤销</el-button
+                      >撤销</el-button
                     >
                   </el-col>
                 </el-row>
@@ -239,8 +239,7 @@ const handleOpen = async (row, type) => {
     taskId: row.id,
     type: type,
     formCustom: row.formCustom,
-    formPath: row.formPath,
-    instanceId: row.instanceId
+    formPath: row.formPath
   });
   workflowCommon.routerJump(routerJumpVo, proxy);
 };

+ 1 - 2
src/views/workflow/task/taskCopyList.vue

@@ -125,8 +125,7 @@ const handleView = (row) => {
     taskId: row.id,
     type: 'view',
     formCustom: row.formCustom,
-    formPath: row.formPath,
-    instanceId: row.instanceId
+    formPath: row.formPath
   });
   workflowCommon.routerJump(routerJumpVo, proxy);
 };

+ 1 - 2
src/views/workflow/task/taskFinish.vue

@@ -158,8 +158,7 @@ const handleView = (row: FlowTaskVO) => {
     taskId: row.id,
     type: 'view',
     formCustom: row.formCustom,
-    formPath: row.formPath,
-    instanceId: row.instanceId
+    formPath: row.formPath
   });
   workflowCommon.routerJump(routerJumpVo, proxy);
 };

+ 1 - 2
src/views/workflow/task/taskWaiting.vue

@@ -160,8 +160,7 @@ const handleOpen = async (row: FlowTaskVO) => {
     taskId: row.id,
     type: 'approval',
     formCustom: row.formCustom,
-    formPath: row.formPath,
-    instanceId: row.instanceId
+    formPath: row.formPath
   });
   workflowCommon.routerJump(routerJumpVo, proxy);
 };