feat 新增通过前端显示流程图方式
feat 办理人权限处理器,新增办理人转换接口,比如角色转用户 update 升级warm-flow-1.7.3-m1
This commit is contained in:
parent
463faba9b9
commit
a614dee5c6
@ -8,7 +8,8 @@ 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,6 +4,7 @@ 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 :defJson="defJson" v-if="defJson != ''" />
|
<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>
|
||||||
@ -73,20 +73,18 @@ const loading = ref(false);
|
|||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
const historyList = ref<Array<any>>([]);
|
const historyList = ref<Array<any>>([]);
|
||||||
const tabActiveName = ref('image');
|
const tabActiveName = ref('image');
|
||||||
const imgUrl = ref('');
|
const insId = ref(null);
|
||||||
const defJson = ref<any>('');
|
|
||||||
|
|
||||||
//初始化查询审批记录
|
//初始化查询审批记录
|
||||||
const init = async (businessId: string | number) => {
|
const init = async (businessId: string | number, instanceId: 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;
|
||||||
flowImage(businessId).then((resp) => {
|
flowImage(businessId).then((resp) => {
|
||||||
if (resp.data) {
|
if (resp.data) {
|
||||||
historyList.value = resp.data.list;
|
historyList.value = resp.data.list;
|
||||||
imgUrl.value = 'data:image/gif;base64,' + resp.data.image;
|
|
||||||
defJson.value = resp.data.defChart.defJson;
|
|
||||||
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,84 +1,29 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-header style="border-bottom: 1px solid rgb(218 218 218); height: auto">
|
<div :style="'height:' + height">
|
||||||
<div style="display: flex; padding: 10px 0px; justify-content: space-between">
|
<iframe :src="iframeUrl" style="width: 100%; height: 100%" />
|
||||||
<div>
|
</div>
|
||||||
<el-tooltip effect="dark" content="自适应屏幕" placement="bottom">
|
|
||||||
<el-button size="small" icon="Rank" @click="zoomViewport(1)">自适应屏幕</el-button>
|
|
||||||
</el-tooltip>
|
|
||||||
<el-tooltip effect="dark" content="放大" placement="bottom">
|
|
||||||
<el-button size="small" icon="ZoomIn" @click="zoomViewport(true)">放大</el-button>
|
|
||||||
</el-tooltip>
|
|
||||||
<el-tooltip effect="dark" content="缩小" placement="bottom">
|
|
||||||
<el-button size="small" icon="ZoomOut" @click="zoomViewport(false)">缩小</el-button>
|
|
||||||
</el-tooltip>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<el-button size="small" style="border: 1px solid #000">未完成</el-button>
|
|
||||||
<el-button size="small" style="background-color: #fff8dc; border: 1px solid #ffcd17">进行中</el-button>
|
|
||||||
<el-button size="small" style="background-color: #f0ffd9; border: 1px solid #9dff00">已完成</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-header>
|
|
||||||
<div class="container" ref="container"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import LogicFlow from '@logicflow/core';
|
|
||||||
import '@logicflow/core/lib/style/index.css';
|
import '@logicflow/core/lib/style/index.css';
|
||||||
import Start from './js/start.js';
|
import { getToken } from '@/utils/auth';
|
||||||
import Between from './js/between.js';
|
|
||||||
import Serial from './js/serial.js';
|
|
||||||
import Parallel from './js/parallel.js';
|
|
||||||
import End from './js/end.js';
|
|
||||||
import Skip from './js/skip.js';
|
|
||||||
import { json2LogicFlowJson } from './js/tool.js';
|
|
||||||
|
|
||||||
// Props 定义方式变化
|
// Props 定义方式变化
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
defJson: {
|
insId: {
|
||||||
type: Object,
|
type: [String, Number],
|
||||||
default: () => ({})
|
default: null
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const container = ref(null);
|
const height = document.documentElement.clientHeight - 94.5 + 'px';
|
||||||
const lf = ref(null);
|
const iframeUrl = ref('');
|
||||||
const register = () => {
|
const baseUrl = import.meta.env.VITE_APP_BASE_API;
|
||||||
lf.value.register(Start);
|
|
||||||
lf.value.register(Between);
|
|
||||||
lf.value.register(Serial);
|
|
||||||
lf.value.register(Parallel);
|
|
||||||
lf.value.register(End);
|
|
||||||
lf.value.register(Skip);
|
|
||||||
};
|
|
||||||
const zoomViewport = async (zoom) => {
|
|
||||||
lf.value.zoom(zoom);
|
|
||||||
// 将内容平移至画布中心
|
|
||||||
lf.value.translateCenter();
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
if (props.defJson) {
|
const url = baseUrl + `/warm-flow-ui/index.html?id=${props.insId}&type=FlowChart`;
|
||||||
const data = json2LogicFlowJson(props.defJson);
|
iframeUrl.value = url + '&Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID;
|
||||||
lf.value = new LogicFlow({
|
|
||||||
container: container.value,
|
|
||||||
grid: false,
|
|
||||||
isSilentMode: true,
|
|
||||||
textEdit: false
|
|
||||||
});
|
|
||||||
register();
|
|
||||||
lf.value.render(data);
|
|
||||||
lf.value.translateCenter();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
/* 样式部分保持不变 */
|
|
||||||
.container {
|
|
||||||
width: 100%;
|
|
||||||
height: 500px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
@ -270,7 +270,7 @@ const handleStartWorkFlow = async (data: LeaveForm) => {
|
|||||||
};
|
};
|
||||||
//审批记录
|
//审批记录
|
||||||
const handleApprovalRecord = () => {
|
const handleApprovalRecord = () => {
|
||||||
approvalRecordRef.value.init(form.value.id);
|
approvalRecordRef.value.init(form.value.id, routeParams.value.instanceId);
|
||||||
};
|
};
|
||||||
//提交回调
|
//提交回调
|
||||||
const submitCallback = async () => {
|
const submitCallback = async () => {
|
||||||
|
@ -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,7 +371,8 @@ 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);
|
||||||
};
|
};
|
||||||
|
@ -227,7 +227,8 @@ 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,7 +239,8 @@ 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,7 +125,8 @@ 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,7 +158,8 @@ 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,7 +160,8 @@ 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