update 调整查询流程图渲染空指针错误,优化流程图样式
This commit is contained in:
parent
ca0fe5ebae
commit
1878f49e8d
@ -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'
|
||||
});
|
||||
};
|
||||
|
@ -8,8 +8,7 @@ export default {
|
||||
query: {
|
||||
id: routerJumpVo.businessId,
|
||||
type: routerJumpVo.type,
|
||||
taskId: routerJumpVo.taskId,
|
||||
instanceId: routerJumpVo.instanceId
|
||||
taskId: routerJumpVo.taskId
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -4,7 +4,6 @@ export interface RouterJumpVo {
|
||||
type: string;
|
||||
formCustom: string;
|
||||
formPath: string;
|
||||
instanceId: string | number;
|
||||
}
|
||||
|
||||
export interface StartProcessBo {
|
||||
|
@ -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) {
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
};
|
||||
|
@ -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);
|
||||
};
|
||||
|
@ -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);
|
||||
};
|
||||
|
@ -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);
|
||||
};
|
||||
|
@ -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);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user