fix
This commit is contained in:
@ -21,6 +21,7 @@
|
||||
:bpmn-modeler="modeler"
|
||||
:prefix="controlForm.prefix"
|
||||
class="process-panel"
|
||||
ref="bmpnProcessPenalRef"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@ -34,6 +35,7 @@ import "@/plugins/package/theme/index.scss";
|
||||
import CustomContentPadProvider from "@/plugins/package/designer/plugins/content-pad";
|
||||
import CustomPaletteProvider from "@/plugins/package/designer/plugins/palette";
|
||||
import { ref } from "vue";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
|
||||
const props = defineProps({
|
||||
bpmnXml: {
|
||||
@ -47,6 +49,7 @@ const props = defineProps({
|
||||
});
|
||||
const { bpmnXml, designerForm } = toRefs(props);
|
||||
let element;
|
||||
let msgInstance;
|
||||
const modeler = ref(null);
|
||||
const height = ref(document.documentElement.clientHeight - 94.5 + "px;");
|
||||
const xmlString = ref(bpmnXml.value);
|
||||
@ -64,52 +67,67 @@ const data = reactive({
|
||||
},
|
||||
});
|
||||
const { controlForm } = toRefs(data);
|
||||
|
||||
const bmpnProcessPenalRef = ref();
|
||||
function elementClick(elementArgv) {
|
||||
element = elementArgv;
|
||||
// if(elementArgv)
|
||||
debugger;
|
||||
goToFormSelect();
|
||||
}
|
||||
function initModeler(modelerArgv) {
|
||||
setTimeout(() => {
|
||||
modeler.value = modelerArgv;
|
||||
}, 10);
|
||||
}
|
||||
function handlerEvent(eventName, element) {}
|
||||
function handlerEvent(eventName) {
|
||||
if (eventName === "connection-added") {
|
||||
goToFormSelect();
|
||||
}
|
||||
}
|
||||
|
||||
function goToFormSelect() {
|
||||
if (!window.bpmnInstances) return;
|
||||
const formKeyExist =
|
||||
!!window.bpmnInstances.elementRegistry.find(
|
||||
(el) => el.type == "bpmn:StartEvent"
|
||||
)?.businessObject?.formKey ?? false;
|
||||
|
||||
if (!formKeyExist) {
|
||||
// msgInstance?.close();
|
||||
ElMessageBox.alert("请为开始节点选择表单", "未选择表单", {
|
||||
confirmButtonText: "去选择",
|
||||
callback: () => {
|
||||
const startEle = window.bpmnInstances.elementRegistry.find(
|
||||
(el) => el.type == "bpmn:StartEvent"
|
||||
);
|
||||
const EventBus = window.bpmnInstances.eventBus;
|
||||
if (element.type != "bpmn:StartEvent") {
|
||||
startEle && EventBus.fire("element.click", { element: startEle });
|
||||
}
|
||||
},
|
||||
});
|
||||
// return;
|
||||
// msgInstance = ElMessage.warning({
|
||||
// message: "请为开始节点选择表单",
|
||||
// showClose: true,
|
||||
// duration: 0,
|
||||
// onClose: () => {
|
||||
// const startEle = window.bpmnInstances.elementRegistry.find(
|
||||
// (el) => el.type == "bpmn:StartEvent"
|
||||
// );
|
||||
// const EventBus = window.bpmnInstances.eventBus;
|
||||
// if (element.type != "bpmn:StartEvent") {
|
||||
// startEle && EventBus.fire("element.click", { element: startEle });
|
||||
// }
|
||||
// // startEle && bmpnProcessPenalRef.value.initFormOnChanged(startEle);
|
||||
// },
|
||||
// });
|
||||
}
|
||||
}
|
||||
function onSaveProcess(saveData) {
|
||||
emit("save", saveData);
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
|
||||
<script>
|
||||
// import Vue from 'vue';
|
||||
import { BpmnProcessDesigner, BmpnProcessPenal } from "@/plugins/package/index";
|
||||
// 自定义元素选中时的弹出菜单(修改 默认任务 为 用户任务)
|
||||
import CustomContentPadProvider from "@/plugins/package/designer/plugins/content-pad";
|
||||
// 自定义左侧菜单(修改 默认任务 为 用户任务)
|
||||
import CustomPaletteProvider from "@/plugins/package/designer/plugins/palette";
|
||||
import vuePlugin from "@/plugins/package/highlight";
|
||||
// import "highlight.js/styles/atom-one-dark-reasonable.css";
|
||||
// Vue.use(vuePlugin);
|
||||
|
||||
export default {
|
||||
name: "ProcessDesigner",
|
||||
|
||||
components: {
|
||||
BpmnProcessDesigner,
|
||||
BmpnProcessPenal,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
-->
|
||||
|
||||
<style lang="scss">
|
||||
body {
|
||||
|
Reference in New Issue
Block a user