update 调整查询流程图渲染空指针错误,优化流程图样式
This commit is contained in:
parent
ca0fe5ebae
commit
1878f49e8d
@ -31,9 +31,9 @@ export const pageByFinish = (query: FlowInstanceQuery): AxiosPromise<FlowInstanc
|
|||||||
/**
|
/**
|
||||||
* 通过业务id获取历史流程图
|
* 通过业务id获取历史流程图
|
||||||
*/
|
*/
|
||||||
export const flowImage = (businessId: string | number) => {
|
export const flowHisTaskList = (businessId: string | number) => {
|
||||||
return request({
|
return request({
|
||||||
url: `/workflow/instance/flowImage/${businessId}` + '?t' + Math.random(),
|
url: `/workflow/instance/flowHisTaskList/${businessId}` + '?t' + Math.random(),
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -8,8 +8,7 @@ export default {
|
|||||||
query: {
|
query: {
|
||||||
id: routerJumpVo.businessId,
|
id: routerJumpVo.businessId,
|
||||||
type: routerJumpVo.type,
|
type: routerJumpVo.type,
|
||||||
taskId: routerJumpVo.taskId,
|
taskId: routerJumpVo.taskId
|
||||||
instanceId: routerJumpVo.instanceId
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@ export interface RouterJumpVo {
|
|||||||
type: string;
|
type: string;
|
||||||
formCustom: string;
|
formCustom: string;
|
||||||
formPath: string;
|
formPath: string;
|
||||||
instanceId: string | number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface StartProcessBo {
|
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-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-tabs v-model="tabActiveName" class="demo-tabs">
|
||||||
<el-tab-pane v-loading="loading" label="流程图" name="image" style="height: 68vh">
|
<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>
|
||||||
<el-tab-pane v-loading="loading" label="审批信息" name="info">
|
<el-tab-pane v-loading="loading" label="审批信息" name="info">
|
||||||
<div>
|
<div>
|
||||||
@ -59,7 +59,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { flowImage } from '@/api/workflow/instance';
|
import { flowHisTaskList } from '@/api/workflow/instance';
|
||||||
import { propTypes } from '@/utils/propTypes';
|
import { propTypes } from '@/utils/propTypes';
|
||||||
import { listByIds } from '@/api/system/oss';
|
import { listByIds } from '@/api/system/oss';
|
||||||
import FlowChart from '@/components/Process/flowChart.vue';
|
import FlowChart from '@/components/Process/flowChart.vue';
|
||||||
@ -76,15 +76,15 @@ const tabActiveName = ref('image');
|
|||||||
const insId = ref(null);
|
const insId = ref(null);
|
||||||
|
|
||||||
//初始化查询审批记录
|
//初始化查询审批记录
|
||||||
const init = async (businessId: string | number, instanceId: string | number) => {
|
const init = async (businessId: string | number) => {
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
tabActiveName.value = 'image';
|
tabActiveName.value = 'image';
|
||||||
historyList.value = [];
|
historyList.value = [];
|
||||||
insId.value = instanceId;
|
flowHisTaskList(businessId).then((resp) => {
|
||||||
flowImage(businessId).then((resp) => {
|
|
||||||
if (resp.data) {
|
if (resp.data) {
|
||||||
historyList.value = resp.data.list;
|
historyList.value = resp.data.list;
|
||||||
|
insId.value = resp.data.instanceId;
|
||||||
if (historyList.value.length > 0) {
|
if (historyList.value.length > 0) {
|
||||||
historyList.value.forEach((item) => {
|
historyList.value.forEach((item) => {
|
||||||
if (item.ext) {
|
if (item.ext) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div :style="'height:' + height">
|
<div :style="'height:' + height" class="iframe-wrapper">
|
||||||
<iframe :src="iframeUrl" style="width: 100%; height: 100%" />
|
<iframe :src="iframeUrl" style="width: 100%; height: 100%" frameborder="0" scrolling="no" class="custom-iframe" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -27,3 +27,17 @@ onMounted(async () => {
|
|||||||
iframeUrl.value = url + '&Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID;
|
iframeUrl.value = url + '&Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID;
|
||||||
});
|
});
|
||||||
</script>
|
</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 = () => {
|
const handleApprovalRecord = () => {
|
||||||
approvalRecordRef.value.init(form.value.id, routeParams.value.instanceId);
|
approvalRecordRef.value.init(form.value.id);
|
||||||
};
|
};
|
||||||
//提交回调
|
//提交回调
|
||||||
const submitCallback = async () => {
|
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(() => {
|
onMounted(() => {
|
||||||
nextTick(async () => {
|
nextTick(async () => {
|
||||||
routeParams.value = proxy.$route.query;
|
routeParams.value = proxy.$route.query;
|
||||||
|
@ -159,7 +159,7 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<div class="clearfix">
|
<div class="clearfix">
|
||||||
<span
|
<span
|
||||||
>流程定义名称:<el-tag>{{ processDefinitionName }}</el-tag></span
|
>流程定义名称:<el-tag>{{ processDefinitionName }}</el-tag></span
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -371,8 +371,7 @@ const handleView = (row) => {
|
|||||||
taskId: row.id,
|
taskId: row.id,
|
||||||
type: 'view',
|
type: 'view',
|
||||||
formCustom: row.formCustom,
|
formCustom: row.formCustom,
|
||||||
formPath: row.formPath,
|
formPath: row.formPath
|
||||||
instanceId: row.instanceId
|
|
||||||
});
|
});
|
||||||
workflowCommon.routerJump(routerJumpVo, proxy);
|
workflowCommon.routerJump(routerJumpVo, proxy);
|
||||||
};
|
};
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5" v-if="scope.row.flowStatus === 'waiting'">
|
<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 type="primary" size="small" icon="Notification" @click="handleCancelProcessApply(scope.row.businessId)"
|
||||||
>撤销</el-button
|
>撤销</el-button
|
||||||
>
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -239,8 +239,7 @@ const handleOpen = async (row, type) => {
|
|||||||
taskId: row.id,
|
taskId: row.id,
|
||||||
type: type,
|
type: type,
|
||||||
formCustom: row.formCustom,
|
formCustom: row.formCustom,
|
||||||
formPath: row.formPath,
|
formPath: row.formPath
|
||||||
instanceId: row.instanceId
|
|
||||||
});
|
});
|
||||||
workflowCommon.routerJump(routerJumpVo, proxy);
|
workflowCommon.routerJump(routerJumpVo, proxy);
|
||||||
};
|
};
|
||||||
|
@ -125,8 +125,7 @@ const handleView = (row) => {
|
|||||||
taskId: row.id,
|
taskId: row.id,
|
||||||
type: 'view',
|
type: 'view',
|
||||||
formCustom: row.formCustom,
|
formCustom: row.formCustom,
|
||||||
formPath: row.formPath,
|
formPath: row.formPath
|
||||||
instanceId: row.instanceId
|
|
||||||
});
|
});
|
||||||
workflowCommon.routerJump(routerJumpVo, proxy);
|
workflowCommon.routerJump(routerJumpVo, proxy);
|
||||||
};
|
};
|
||||||
|
@ -158,8 +158,7 @@ const handleView = (row: FlowTaskVO) => {
|
|||||||
taskId: row.id,
|
taskId: row.id,
|
||||||
type: 'view',
|
type: 'view',
|
||||||
formCustom: row.formCustom,
|
formCustom: row.formCustom,
|
||||||
formPath: row.formPath,
|
formPath: row.formPath
|
||||||
instanceId: row.instanceId
|
|
||||||
});
|
});
|
||||||
workflowCommon.routerJump(routerJumpVo, proxy);
|
workflowCommon.routerJump(routerJumpVo, proxy);
|
||||||
};
|
};
|
||||||
|
@ -160,8 +160,7 @@ const handleOpen = async (row: FlowTaskVO) => {
|
|||||||
taskId: row.id,
|
taskId: row.id,
|
||||||
type: 'approval',
|
type: 'approval',
|
||||||
formCustom: row.formCustom,
|
formCustom: row.formCustom,
|
||||||
formPath: row.formPath,
|
formPath: row.formPath
|
||||||
instanceId: row.instanceId
|
|
||||||
});
|
});
|
||||||
workflowCommon.routerJump(routerJumpVo, proxy);
|
workflowCommon.routerJump(routerJumpVo, proxy);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user