add 添加节点悬浮信息
This commit is contained in:
parent
b5e8454aeb
commit
a8d9d85572
@ -6,7 +6,7 @@ import { getToken } from '@/utils/auth';
|
|||||||
* 通过流程实例id获取历史流程图
|
* 通过流程实例id获取历史流程图
|
||||||
*/
|
*/
|
||||||
export const getHistoryProcessImage = (processInstanceId: string) => {
|
export const getHistoryProcessImage = (processInstanceId: string) => {
|
||||||
return baseUrl + `/workflow/processInstance/getHistoryProcessImage/${processInstanceId}` + '?Authorization=Bearer ' + getToken();
|
return baseUrl + `/workflow/processInstance/getHistoryProcessImage/${processInstanceId}` + '?Authorization=Bearer ' + getToken()+'&t'+ Math.random()
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,7 +1,42 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog v-model="visible" title="审批记录" :width="width" :height="height" append-to-body :close-on-click-modal="false">
|
<el-dialog v-model="visible" title="审批记录" :width="width" :height="height" append-to-body :close-on-click-modal="false">
|
||||||
<div v-loading="loading">
|
<div v-loading="loading">
|
||||||
<div style="width: 100%;height: 300px;overflow-y: auto;">
|
<div style="width: 100%;height: 300px;overflow-y: auto;position: relative;">
|
||||||
|
<div
|
||||||
|
v-for="(graphic, index) in graphicInfoVos"
|
||||||
|
:key="index"
|
||||||
|
:style="{
|
||||||
|
position: 'absolute',
|
||||||
|
left: `${graphic.x}px`,
|
||||||
|
top: `${graphic.y}px`,
|
||||||
|
width: `${graphic.width}px`,
|
||||||
|
height: `${graphic.height}px`,
|
||||||
|
color: 'red',
|
||||||
|
cursor: 'pointer',
|
||||||
|
zIndex: 99
|
||||||
|
}"
|
||||||
|
@mouseover="handleMouseOver(graphic)"
|
||||||
|
@mouseleave="handleMouseLeave()"
|
||||||
|
></div>
|
||||||
|
<!-- 弹出的 div 元素 -->
|
||||||
|
<div
|
||||||
|
v-show="popupVisible"
|
||||||
|
:style="{
|
||||||
|
position: 'absolute',
|
||||||
|
left: `${graphicX}px`,
|
||||||
|
top: `${graphicY}px`,
|
||||||
|
backgroundColor: '#fff',
|
||||||
|
border: '1px solid #ccc',
|
||||||
|
padding: '10px',
|
||||||
|
zIndex: 100
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<p>审批人员: {{ nodeInfo.nickName }}</p>
|
||||||
|
<p>节点状态:{{ nodeInfo.status }}</p>
|
||||||
|
<p>开始时间:{{ nodeInfo.startTime }}</p>
|
||||||
|
<p>结束时间:{{ nodeInfo.endTime }}</p>
|
||||||
|
<p>审批耗时:{{ nodeInfo.runDuration }}</p>
|
||||||
|
</div>
|
||||||
<el-image :src="src" />
|
<el-image :src="src" />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@ -27,32 +62,61 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
width: {
|
width: {
|
||||||
type: String,
|
type: String,
|
||||||
default:"70%"
|
default: '70%'
|
||||||
},
|
},
|
||||||
height: {
|
height: {
|
||||||
type: String,
|
type: String,
|
||||||
default:"100%"
|
default: '100%'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
src:"",
|
src: '',
|
||||||
visible: false,
|
visible: false,
|
||||||
historyList: [],
|
historyList: [],
|
||||||
graphicInfoVos:[]
|
graphicInfoVos: [],
|
||||||
|
nodeListInfo: [],
|
||||||
|
popupVisible: false,
|
||||||
|
nodeInfo: {},
|
||||||
|
graphicX:'',
|
||||||
|
graphicY:''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init(processInstanceId) {
|
init(processInstanceId) {
|
||||||
this.visible = true
|
this.visible = true;
|
||||||
this.loading = true
|
this.loading = true;
|
||||||
this.src = getHistoryProcessImage(processInstanceId)
|
this.historyList = [];
|
||||||
getHistoryRecord(processInstanceId).then(response => {
|
this.graphicInfoVos = [];
|
||||||
this.historyList = response.data.historyRecordList
|
this.src = getHistoryProcessImage(processInstanceId);
|
||||||
this.graphicInfoVos = response.data.graphicInfoVos
|
getHistoryRecord(processInstanceId).then((response) => {
|
||||||
this.loading = false
|
this.historyList = response.data.historyRecordList;
|
||||||
})
|
this.graphicInfoVos = response.data.graphicInfoVos;
|
||||||
|
this.nodeListInfo = response.data.nodeListInfo;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleMouseOver(graphic) {
|
||||||
|
this.graphicX = graphic.x+graphic.width
|
||||||
|
this.graphicY = graphic.y-graphic.height
|
||||||
|
this.nodeInfo = {};
|
||||||
|
if (this.nodeListInfo && this.nodeListInfo.length > 0) {
|
||||||
|
let info = this.nodeListInfo.find((e) => (e.taskDefinitionKey == graphic.nodeId));
|
||||||
|
if (info) {
|
||||||
|
this.nodeInfo = {
|
||||||
|
nickName: info.nickName,
|
||||||
|
status: info.status,
|
||||||
|
startTime: info.startTime,
|
||||||
|
endTime: info.endTime,
|
||||||
|
runDuration: info.runDuration
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.popupVisible = true;
|
||||||
|
},
|
||||||
|
handleMouseLeave() {
|
||||||
|
this.popupVisible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user