工作流表单+模型代码提交
This commit is contained in:
@@ -9,9 +9,9 @@
|
||||
<script lang="ts" setup>
|
||||
import BpmnViewer from 'bpmn-js/lib/Viewer'
|
||||
import DefaultEmptyXML from './plugins/defaultEmpty'
|
||||
// import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
// import { formatDate } from '@/utils/formatTime'
|
||||
// import { isEmpty } from '@/utils/is'
|
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import { isEmpty } from '@/utils/is'
|
||||
|
||||
defineOptions({ name: 'MyProcessViewer' })
|
||||
|
||||
@@ -231,11 +231,11 @@ const highlightDiagram = async () => {
|
||||
}
|
||||
}
|
||||
})
|
||||
// if (!isEmpty(removeTaskDefinitionKeyList)) {
|
||||
// taskList.value = taskList.value.filter(
|
||||
// (item) => !removeTaskDefinitionKeyList.includes(item.taskDefinitionKey)
|
||||
// )
|
||||
// }
|
||||
if (!isEmpty(removeTaskDefinitionKeyList)) {
|
||||
taskList.value = taskList.value.filter(
|
||||
(item) => !removeTaskDefinitionKeyList.includes(item.taskDefinitionKey)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const getActivityHighlightCss = (activity) => {
|
||||
@@ -314,75 +314,75 @@ const elementHover = (element) => {
|
||||
if (!activity) {
|
||||
return
|
||||
}
|
||||
// if (!elementOverlayIds.value[element.value.id] && element.value.type !== 'bpmn:Process') {
|
||||
// let html = `<div class="element-overlays">
|
||||
// <p>Elemet id: ${element.value.id}</p>
|
||||
// <p>Elemet type: ${element.value.type}</p>
|
||||
// </div>` // 默认值
|
||||
// if (element.value.type === 'bpmn:StartEvent' && processInstance.value) {
|
||||
// html = `<p>发起人:${processInstance.value.startUser.nickname}</p>
|
||||
// <p>部门:${processInstance.value.startUser.deptName}</p>
|
||||
// <p>创建时间:${formatDate(processInstance.value.createTime)}`
|
||||
// } else if (element.value.type === 'bpmn:UserTask') {
|
||||
// let task = taskList.value.find((m) => m.id === activity.taskId) // 找到活动对应的 taskId
|
||||
// if (!task) {
|
||||
// return
|
||||
// }
|
||||
// // let optionData = getIntDictOptions(DICT_TYPE.BPM_TASK_STATUS)
|
||||
// let dataResult = ''
|
||||
// // optionData.forEach((element) => {
|
||||
// // if (element.value == task.status) {
|
||||
// // dataResult = element.label
|
||||
// // }
|
||||
// // })
|
||||
// html = `<p>审批人:${task.assigneeUser.nickname}</p>
|
||||
// <p>部门:${task.assigneeUser.deptName}</p>
|
||||
// <p>结果:${dataResult}</p>
|
||||
// <p>创建时间:${formatDate(task.createTime)}</p>`
|
||||
// // html = `<p>审批人:${task.assigneeUser.nickname}</p>
|
||||
// // <p>部门:${task.assigneeUser.deptName}</p>
|
||||
// // <p>结果:${getIntDictOptions(
|
||||
// // DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT,
|
||||
// // task.status
|
||||
// // )}</p>
|
||||
// // <p>创建时间:${formatDate(task.createTime)}</p>`
|
||||
// if (task.endTime) {
|
||||
// html += `<p>结束时间:${formatDate(task.endTime)}</p>`
|
||||
// }
|
||||
// if (task.reason) {
|
||||
// html += `<p>审批建议:${task.reason}</p>`
|
||||
// }
|
||||
// } else if (element.value.type === 'bpmn:ServiceTask' && processInstance.value) {
|
||||
// if (activity.startTime > 0) {
|
||||
// html = `<p>创建时间:${formatDate(activity.startTime)}</p>`
|
||||
// }
|
||||
// if (activity.endTime > 0) {
|
||||
// html += `<p>结束时间:${formatDate(activity.endTime)}</p>`
|
||||
// }
|
||||
// console.log(html)
|
||||
// } else if (element.value.type === 'bpmn:EndEvent' && processInstance.value) {
|
||||
// // let optionData = getIntDictOptions(DICT_TYPE.BPM_TASK_STATUS)
|
||||
// let dataResult = ''
|
||||
// // optionData.forEach((element) => {
|
||||
// // if (element.value == processInstance.value.status) {
|
||||
// // dataResult = element.label
|
||||
// // }
|
||||
// // })
|
||||
// html = `<p>结果:${dataResult}</p>`
|
||||
// // html = `<p>结果:${getIntDictOptions(
|
||||
// // DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT,
|
||||
// // processInstance.value.status
|
||||
// // )}</p>`
|
||||
// if (processInstance.value.endTime) {
|
||||
// html += `<p>结束时间:${formatDate(processInstance.value.endTime)}</p>`
|
||||
// }
|
||||
// }
|
||||
// // console.log(html, 'html111111111111111')
|
||||
// elementOverlayIds.value[element.value.id] = toRaw(overlays.value)?.add(element.value, {
|
||||
// position: { left: 0, bottom: 0 },
|
||||
// html: `<div class="element-overlays">${html}</div>`
|
||||
// })
|
||||
// }
|
||||
if (!elementOverlayIds.value[element.value.id] && element.value.type !== 'bpmn:Process') {
|
||||
let html = `<div class="element-overlays">
|
||||
<p>Elemet id: ${element.value.id}</p>
|
||||
<p>Elemet type: ${element.value.type}</p>
|
||||
</div>` // 默认值
|
||||
if (element.value.type === 'bpmn:StartEvent' && processInstance.value) {
|
||||
html = `<p>发起人:${processInstance.value.startUser.nickname}</p>
|
||||
<p>部门:${processInstance.value.startUser.deptName}</p>
|
||||
<p>创建时间:${formatDate(processInstance.value.createTime)}`
|
||||
} else if (element.value.type === 'bpmn:UserTask') {
|
||||
let task = taskList.value.find((m) => m.id === activity.taskId) // 找到活动对应的 taskId
|
||||
if (!task) {
|
||||
return
|
||||
}
|
||||
let optionData = getIntDictOptions(DICT_TYPE.BPM_TASK_STATUS)
|
||||
let dataResult = ''
|
||||
optionData.forEach((element) => {
|
||||
if (element.value == task.status) {
|
||||
dataResult = element.label
|
||||
}
|
||||
})
|
||||
html = `<p>审批人:${task.assigneeUser.nickname}</p>
|
||||
<p>部门:${task.assigneeUser.deptName}</p>
|
||||
<p>结果:${dataResult}</p>
|
||||
<p>创建时间:${formatDate(task.createTime)}</p>`
|
||||
// html = `<p>审批人:${task.assigneeUser.nickname}</p>
|
||||
// <p>部门:${task.assigneeUser.deptName}</p>
|
||||
// <p>结果:${getIntDictOptions(
|
||||
// DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT,
|
||||
// task.status
|
||||
// )}</p>
|
||||
// <p>创建时间:${formatDate(task.createTime)}</p>`
|
||||
if (task.endTime) {
|
||||
html += `<p>结束时间:${formatDate(task.endTime)}</p>`
|
||||
}
|
||||
if (task.reason) {
|
||||
html += `<p>审批建议:${task.reason}</p>`
|
||||
}
|
||||
} else if (element.value.type === 'bpmn:ServiceTask' && processInstance.value) {
|
||||
if (activity.startTime > 0) {
|
||||
html = `<p>创建时间:${formatDate(activity.startTime)}</p>`
|
||||
}
|
||||
if (activity.endTime > 0) {
|
||||
html += `<p>结束时间:${formatDate(activity.endTime)}</p>`
|
||||
}
|
||||
console.log(html)
|
||||
} else if (element.value.type === 'bpmn:EndEvent' && processInstance.value) {
|
||||
let optionData = getIntDictOptions(DICT_TYPE.BPM_TASK_STATUS)
|
||||
let dataResult = ''
|
||||
optionData.forEach((element) => {
|
||||
if (element.value == processInstance.value.status) {
|
||||
dataResult = element.label
|
||||
}
|
||||
})
|
||||
html = `<p>结果:${dataResult}</p>`
|
||||
// html = `<p>结果:${getIntDictOptions(
|
||||
// DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT,
|
||||
// processInstance.value.status
|
||||
// )}</p>`
|
||||
if (processInstance.value.endTime) {
|
||||
html += `<p>结束时间:${formatDate(processInstance.value.endTime)}</p>`
|
||||
}
|
||||
}
|
||||
// console.log(html, 'html111111111111111')
|
||||
elementOverlayIds.value[element.value.id] = toRaw(overlays.value)?.add(element.value, {
|
||||
position: { left: 0, bottom: 0 },
|
||||
html: `<div class="element-overlays">${html}</div>`
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 流程图的元素被 out
|
||||
|
||||
Reference in New Issue
Block a user