2025-08-20 14:39:30 +08:00
|
|
|
|
import { computed, onMounted, ref } from 'vue';
|
|
|
|
|
|
import { storeToRefs } from 'pinia';
|
|
|
|
|
|
import { useBpmnStore } from '/@bpmn/store/bpmn';
|
|
|
|
|
|
import { getNodeName } from '/@bpmn/config/property';
|
|
|
|
|
|
|
|
|
|
|
|
export default function () {
|
|
|
|
|
|
const store = useBpmnStore();
|
|
|
|
|
|
const { infoId, isMainStartNode } = store;
|
|
|
|
|
|
const { info } = storeToRefs(store);
|
|
|
|
|
|
const showPanel = ref(false);
|
|
|
|
|
|
const formInfo = ref();
|
2025-10-13 11:53:54 +08:00
|
|
|
|
|
|
|
|
|
|
const processNodesInfo = ref();
|
|
|
|
|
|
const processStoreyInfo = ref([
|
|
|
|
|
|
{
|
|
|
|
|
|
id : 'Main_Storey',
|
|
|
|
|
|
name: '主干流程',
|
|
|
|
|
|
type: 'bpmn:Main_Storey',
|
|
|
|
|
|
},
|
|
|
|
|
|
]);
|
2025-08-20 14:39:30 +08:00
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
|
if (infoId) {
|
|
|
|
|
|
formInfo.value = info.value.get(infoId);
|
2025-10-13 11:53:54 +08:00
|
|
|
|
console.log("info.value",info.value);
|
|
|
|
|
|
processNodesInfo.value = [];
|
|
|
|
|
|
//遍历info.value 是Map,把type含有"UserTask"字符的节点,放到processNodesInfo中
|
|
|
|
|
|
info.value.forEach((entity,key) => {
|
|
|
|
|
|
if(entity.type.indexOf("UserTask") != -1){
|
|
|
|
|
|
processNodesInfo.value.push(entity);
|
|
|
|
|
|
}
|
|
|
|
|
|
if(entity.type.indexOf("SubProcess") != -1 || entity.type.indexOf("CallActivity") != -1){
|
|
|
|
|
|
processStoreyInfo.value.push(entity);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
// console.log("processNodesInfo.value",processNodesInfo.value);
|
2025-08-20 14:39:30 +08:00
|
|
|
|
showPanel.value = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
const nodeName = computed(() => {
|
|
|
|
|
|
if (formInfo.value && formInfo.value.type) {
|
|
|
|
|
|
const labelName = getNodeName(formInfo.value.type);
|
|
|
|
|
|
return labelName;
|
|
|
|
|
|
}
|
|
|
|
|
|
return '节点';
|
|
|
|
|
|
});
|
|
|
|
|
|
return {
|
|
|
|
|
|
formInfo,
|
|
|
|
|
|
nodeName,
|
|
|
|
|
|
showPanel,
|
|
|
|
|
|
isMainStartNode,
|
2025-10-13 11:53:54 +08:00
|
|
|
|
processNodesInfo,
|
|
|
|
|
|
processStoreyInfo
|
2025-08-20 14:39:30 +08:00
|
|
|
|
};
|
|
|
|
|
|
}
|