diff --git a/src/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue b/src/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue index 3fe21944..6cbe11fa 100644 --- a/src/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue +++ b/src/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue @@ -436,7 +436,7 @@ const initBpmnModeler = () => { // bpmnModeler.createDiagram() - console.log(bpmnModeler, 'bpmnModeler111111') + // console.log(bpmnModeler, 'bpmnModeler111111') emit('init-finished', bpmnModeler) initModelListeners() } @@ -666,10 +666,10 @@ const previewProcessJson = () => { } /* ------------------------------------------------ 芋道源码 methods ------------------------------------------------------ */ const processSave = async () => { - console.log(bpmnModeler, 'bpmnModelerbpmnModelerbpmnModelerbpmnModeler') + // console.log(bpmnModeler, 'bpmnModelerbpmnModelerbpmnModelerbpmnModeler') const { err, xml } = await bpmnModeler.saveXML() - console.log(err, 'errerrerrerrerr') - console.log(xml, 'xmlxmlxmlxmlxml') + // console.log(err, 'errerrerrerrerr') + // console.log(xml, 'xmlxmlxmlxmlxml') // 读取异常时抛出异常 if (err) { // this.$modal.msgError('保存模型失败,请重试!') diff --git a/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue b/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue index 27e6151a..f5646355 100644 --- a/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue +++ b/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue @@ -368,7 +368,7 @@ const elementHover = (element) => { html += `
结束时间:${formatDate(processInstance.value.endTime)}
` } } - console.log(html, 'html111111111111111') + // console.log(html, 'html111111111111111') elementOverlayIds.value[element.value.id] = toRaw(overlays.value)?.add(element.value, { position: { left: 0, bottom: 0 }, html: ` ` diff --git a/src/components/bpmnProcessDesigner/package/penal/base/ElementBaseInfo.vue b/src/components/bpmnProcessDesigner/package/penal/base/ElementBaseInfo.vue index 03f82e76..5e77c948 100644 --- a/src/components/bpmnProcessDesigner/package/penal/base/ElementBaseInfo.vue +++ b/src/components/bpmnProcessDesigner/package/penal/base/ElementBaseInfo.vue @@ -68,13 +68,13 @@ const resetBaseInfo = () => { console.log(bpmnElement.value, 'bpmnElement') bpmnElement.value = bpmnInstances()?.bpmnElement - console.log(bpmnElement.value, 'resetBaseInfo11111111111') + // console.log(bpmnElement.value, 'resetBaseInfo11111111111') elementBaseInfo.value = bpmnElement.value.businessObject needProps.value['type'] = bpmnElement.value.businessObject.$type // elementBaseInfo.value['typess'] = bpmnElement.value.businessObject.$type // elementBaseInfo.value = JSON.parse(JSON.stringify(bpmnElement.value.businessObject)) - console.log(elementBaseInfo.value, 'elementBaseInfo22222222222') + // console.log(elementBaseInfo.value, 'elementBaseInfo22222222222') } const handleKeyUpdate = (value) => { // 校验 value 的值,只有 XML NCName 通过的情况下,才进行赋值。否则,会导致流程图报错,无法绘制的问题 @@ -121,11 +121,11 @@ const updateBaseInfo = (key) => { // id: elementBaseInfo.value[key] // // di: { id: `${elementBaseInfo.value[key]}_di` } // } - console.log(elementBaseInfo, 'elementBaseInfo11111111111') + // console.log(elementBaseInfo, 'elementBaseInfo11111111111') needProps.value = { ...elementBaseInfo.value, ...needProps.value } if (key === 'id') { - console.log('jinru') + // console.log('jinru') console.log(window, 'window') console.log(bpmnElement.value, 'bpmnElement') console.log(toRaw(bpmnElement.value), 'bpmnElement') @@ -139,21 +139,10 @@ const updateBaseInfo = (key) => { } } -// TODO 芋艿:这里延迟,可能存在覆盖 userTask 的问题。。例如说,打开的时候,立马选中某个 usertask,则它的 id 会被覆盖。。。 -onMounted(() => { - // 针对上传的 bpmn 流程图时,需要延迟 1 秒的时间,保证 key 和 name 的更新 - setTimeout(() => { - console.log(props.model, 'props.model') - handleKeyUpdate(props.model.key) - handleNameUpdate(props.model.name) - console.log(props, 'propsssssssssssssssssssss') - }, 1000) -}) - watch( () => props.businessObject, (val) => { - console.log(val, 'val11111111111111111111') + // console.log(val, 'val11111111111111111111') if (val) { // nextTick(() => { resetBaseInfo() @@ -161,6 +150,18 @@ watch( } } ) + +watch( + () => props.model?.key, + (val) => { + // 针对上传的 bpmn 流程图时,保证 key 和 name 的更新 + if (val) { + handleKeyUpdate(props.model.key) + handleNameUpdate(props.model.name) + } + } +) + // watch( // () => ({ ...props }), // (oldVal, newVal) => { diff --git a/src/components/bpmnProcessDesigner/package/penal/form/ElementForm.vue b/src/components/bpmnProcessDesigner/package/penal/form/ElementForm.vue index b12cf76f..60f374f4 100644 --- a/src/components/bpmnProcessDesigner/package/penal/form/ElementForm.vue +++ b/src/components/bpmnProcessDesigner/package/penal/form/ElementForm.vue @@ -429,7 +429,7 @@ const saveField = () => { // 移除某个 字段的 配置项 const removeFieldOptionItem = (option, index, type) => { - console.log(option, 'option') + // console.log(option, 'option') if (type === 'property') { fieldPropertiesList.value.splice(index, 1) return diff --git a/src/views/bpm/model/editor/index.vue b/src/views/bpm/model/editor/index.vue index f5c0ec6e..0dfabc75 100644 --- a/src/views/bpm/model/editor/index.vue +++ b/src/views/bpm/model/editor/index.vue @@ -89,11 +89,11 @@ onMounted(async () => { } // 查询模型 const data = await ModelApi.getModel(modelId) - xmlString.value = data.bpmnXml model.value = { ...data, bpmnXml: undefined // 清空 bpmnXml 属性 } + xmlString.value = data.bpmnXml })