update 审批记录v2改为v3

This commit is contained in:
songgaoshuai 2023-07-28 13:45:36 +08:00
parent eaf911e868
commit dbf2195468
3 changed files with 91 additions and 90 deletions

View File

@ -1,5 +1,5 @@
<template> <template>
<el-dialog v-model="visible" draggable title="审批记录" :width="width" :height="height" append-to-body :close-on-click-modal="false"> <el-dialog v-model="visible" draggable title="审批记录" :width="props.width" :height="props.height" append-to-body :close-on-click-modal="false">
<div v-loading="loading"> <div v-loading="loading">
<div style="width: 100%;height: 300px;overflow: auto;position: relative;"> <div style="width: 100%;height: 300px;overflow: auto;position: relative;">
<div <div
@ -59,10 +59,10 @@
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
<script> <script lang="ts" setup>
import { getHistoryProcessImage, getHistoryRecord } from '@/api/workflow/processInstance'; import { getHistoryProcessImage, getHistoryRecord } from '@/api/workflow/processInstance';
export default { import { ref } from 'vue';
props: { const props = defineProps({
width: { width: {
type: String, type: String,
default: '70%' default: '70%'
@ -71,60 +71,62 @@ export default {
type: String, type: String,
default: '100%' default: '100%'
} }
},
data() {
return {
loading: false,
src: '',
visible: false,
historyList: [],
deleteReason: '',
graphicInfoVos: [],
nodeListInfo: [],
popupVisible: false,
nodeInfo: {},
graphicX: '',
graphicY: ''
};
},
methods: {
init(processInstanceId) {
this.visible = true;
this.loading = true;
this.historyList = [];
this.graphicInfoVos = [];
this.src = getHistoryProcessImage(processInstanceId);
getHistoryRecord(processInstanceId).then((response) => {
this.historyList = response.data.historyRecordList;
this.graphicInfoVos = response.data.graphicInfoVos;
this.nodeListInfo = response.data.nodeListInfo;
this.deleteReason = response.data.deleteReason;
this.loading = false;
}); });
}, const loading = ref(false);
handleMouseOver(graphic) { const src = ref('');
this.graphicX = graphic.x + graphic.width + 10; const visible = ref(false);
this.graphicY = graphic.y - graphic.height + -10; const historyList = ref<Array<any>>([]);
this.nodeInfo = {}; const deleteReason = ref<string>('');
if (this.nodeListInfo && this.nodeListInfo.length > 0) { const graphicInfoVos = ref<Array<any>>([]);
let info = this.nodeListInfo.find((e) => e.taskDefinitionKey == graphic.nodeId); const nodeListInfo = ref<Array<any>>([]);
const popupVisible = ref(false);
const nodeInfo = ref<any>({});
const graphicX = ref<number | string>(0);
const graphicY = ref<number | string>(0);
//
const init = async (processInstanceId: string) => {
visible.value = true;
loading.value = true;
historyList.value = [];
graphicInfoVos.value = [];
src.value = getHistoryProcessImage(processInstanceId);
getHistoryRecord(processInstanceId).then((response) => {
historyList.value = response.data.historyRecordList;
graphicInfoVos.value = response.data.graphicInfoVos;
nodeListInfo.value = response.data.nodeListInfo;
deleteReason.value = response.data.deleteReason;
loading.value = false;
});
}
//
const handleMouseOver = async (graphic: any) => {
graphicX.value = graphic.x + graphic.width + 10;
graphicY.value = graphic.y - graphic.height + -10;
nodeInfo.value = {};
if (nodeListInfo.value && nodeListInfo.value.length > 0) {
let info = nodeListInfo.value.find((e: any) => e.taskDefinitionKey == graphic.nodeId);
if (info) { if (info) {
this.nodeInfo = { nodeInfo.value = {
nickName: info.nickName, nickName: info.nickName,
status: info.status, status: info.status,
startTime: info.startTime, startTime: info.startTime,
endTime: info.endTime, endTime: info.endTime,
runDuration: info.runDuration runDuration: info.runDuration
}; };
this.popupVisible = true; popupVisible.value = true;
} }
} }
},
handleMouseLeave() {
this.popupVisible = false;
} }
//
const handleMouseLeave = async () => {
popupVisible.value = false;
} }
}; /**
* 对外暴露子组建方法
*/
defineExpose({
init
});
</script> </script>
<style scoped> <style scoped>
.triangle { .triangle {

View File

@ -32,9 +32,9 @@ const { proxy } = getCurrentInstance() as ComponentInternalInstance;
// //
const loading = ref(true); const loading = ref(true);
// //
const businessStatus = ref(''); const businessStatus = ref<string>('');
//id //id
const taskId = ref(''); const taskId = ref<string>('');
const dialog = reactive<DialogOption>({ const dialog = reactive<DialogOption>({
visible: false, visible: false,
@ -93,4 +93,3 @@ defineExpose({
openDialog openDialog
}); });
</script> </script>

View File

@ -57,7 +57,7 @@
</el-card> </el-card>
<!-- 添加或修改流程分类对话框 --> <!-- 添加或修改流程分类对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="categoryFormRef" :model="form" :rules="rules" label-width="80px"> <el-form ref="categoryFormRef" :model="form" :rules="rules" label-width="80px" v-loading="loading">
<el-form-item label="父级分类" prop="parentId"> <el-form-item label="父级分类" prop="parentId">
<el-tree-select <el-tree-select
v-model="form.parentId" v-model="form.parentId"