Commit b704aae49b50b7b0e8f2e0b49299d512a53a6d3e
1 parent
3ce663c7
报错基本解决,数据绑定还有些错误
Showing
16 changed files
with
171 additions
and
132 deletions
yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue
| 1 | <template> | 1 | <template> |
| 2 | - <div class="process-panel__container" :style="{ width: `${width}px;` }"> | 2 | + <div class="process-panel__container" :style="{ width: `${width}px` }"> |
| 3 | <el-collapse v-model="activeTab"> | 3 | <el-collapse v-model="activeTab"> |
| 4 | <el-collapse-item name="base"> | 4 | <el-collapse-item name="base"> |
| 5 | <!-- class="panel-tab__title" --> | 5 | <!-- class="panel-tab__title" --> |
yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/base/ElementBaseInfo.vue
| @@ -45,7 +45,7 @@ const props = defineProps({ | @@ -45,7 +45,7 @@ const props = defineProps({ | ||
| 45 | model: Object // 流程模型的数据 | 45 | model: Object // 流程模型的数据 |
| 46 | }) | 46 | }) |
| 47 | const needProps = ref({}) | 47 | const needProps = ref({}) |
| 48 | -let bpmnElement | 48 | +const bpmnElement = ref() |
| 49 | const elementBaseInfo = ref({}) | 49 | const elementBaseInfo = ref({}) |
| 50 | // 流程表单的下拉框的数据 | 50 | // 流程表单的下拉框的数据 |
| 51 | // const forms = ref([]) | 51 | // const forms = ref([]) |
| @@ -57,12 +57,12 @@ const rules = reactive({ | @@ -57,12 +57,12 @@ const rules = reactive({ | ||
| 57 | 57 | ||
| 58 | const resetBaseInfo = () => { | 58 | const resetBaseInfo = () => { |
| 59 | console.log(window, 'window') | 59 | console.log(window, 'window') |
| 60 | - console.log(bpmnElement, 'bpmnElement') | 60 | + console.log(bpmnElement.value, 'bpmnElement') |
| 61 | 61 | ||
| 62 | - bpmnElement = window?.bpmnInstances?.bpmnElement | ||
| 63 | - console.log(bpmnElement, 'resetBaseInfo11111111111') | ||
| 64 | - elementBaseInfo.value = bpmnElement.businessObject | ||
| 65 | - needProps.value['type'] = bpmnElement.businessObject.$type | 62 | + bpmnElement.value = window?.bpmnInstances?.bpmnElement |
| 63 | + console.log(bpmnElement.value, 'resetBaseInfo11111111111') | ||
| 64 | + elementBaseInfo.value = bpmnElement.value.businessObject | ||
| 65 | + needProps.value['type'] = bpmnElement.value.businessObject.$type | ||
| 66 | // elementBaseInfo.value['typess'] = bpmnElement.value.businessObject.$type | 66 | // elementBaseInfo.value['typess'] = bpmnElement.value.businessObject.$type |
| 67 | 67 | ||
| 68 | // elementBaseInfo.value = JSON.parse(JSON.stringify(bpmnElement.value.businessObject)) | 68 | // elementBaseInfo.value = JSON.parse(JSON.stringify(bpmnElement.value.businessObject)) |
| @@ -81,7 +81,10 @@ const handleKeyUpdate = (value) => { | @@ -81,7 +81,10 @@ const handleKeyUpdate = (value) => { | ||
| 81 | 81 | ||
| 82 | // 在 BPMN 的 XML 中,流程标识 key,其实对应的是 id 节点 | 82 | // 在 BPMN 的 XML 中,流程标识 key,其实对应的是 id 节点 |
| 83 | elementBaseInfo.value['id'] = value | 83 | elementBaseInfo.value['id'] = value |
| 84 | - updateBaseInfo('id') | 84 | + |
| 85 | + setTimeout(() => { | ||
| 86 | + updateBaseInfo('id') | ||
| 87 | + }, 100) | ||
| 85 | } | 88 | } |
| 86 | const handleNameUpdate = (value) => { | 89 | const handleNameUpdate = (value) => { |
| 87 | console.log(elementBaseInfo, 'elementBaseInfo') | 90 | console.log(elementBaseInfo, 'elementBaseInfo') |
| @@ -89,7 +92,10 @@ const handleNameUpdate = (value) => { | @@ -89,7 +92,10 @@ const handleNameUpdate = (value) => { | ||
| 89 | return | 92 | return |
| 90 | } | 93 | } |
| 91 | elementBaseInfo.value['name'] = value | 94 | elementBaseInfo.value['name'] = value |
| 92 | - updateBaseInfo('name') | 95 | + |
| 96 | + setTimeout(() => { | ||
| 97 | + updateBaseInfo('name') | ||
| 98 | + }, 100) | ||
| 93 | } | 99 | } |
| 94 | // const handleDescriptionUpdate=(value)=> { | 100 | // const handleDescriptionUpdate=(value)=> { |
| 95 | // TODO 芋艿:documentation 暂时无法修改,后续在看看 | 101 | // TODO 芋艿:documentation 暂时无法修改,后续在看看 |
| @@ -113,15 +119,15 @@ const updateBaseInfo = (key) => { | @@ -113,15 +119,15 @@ const updateBaseInfo = (key) => { | ||
| 113 | if (key === 'id') { | 119 | if (key === 'id') { |
| 114 | console.log('jinru') | 120 | console.log('jinru') |
| 115 | console.log(window, 'window') | 121 | console.log(window, 'window') |
| 116 | - console.log(bpmnElement, 'bpmnElement') | ||
| 117 | - console.log(toRaw(bpmnElement), 'bpmnElement') | ||
| 118 | - window.bpmnInstances.modeling.updateProperties(toRaw(bpmnElement), { | 122 | + console.log(bpmnElement.value, 'bpmnElement') |
| 123 | + console.log(toRaw(bpmnElement.value), 'bpmnElement') | ||
| 124 | + window.bpmnInstances.modeling.updateProperties(toRaw(bpmnElement.value), { | ||
| 119 | id: elementBaseInfo.value[key], | 125 | id: elementBaseInfo.value[key], |
| 120 | di: { id: `${elementBaseInfo.value[key]}_di` } | 126 | di: { id: `${elementBaseInfo.value[key]}_di` } |
| 121 | }) | 127 | }) |
| 122 | } else { | 128 | } else { |
| 123 | console.log(attrObj, 'attrObj') | 129 | console.log(attrObj, 'attrObj') |
| 124 | - window.bpmnInstances.modeling.updateProperties(toRaw(bpmnElement), attrObj) | 130 | + window.bpmnInstances.modeling.updateProperties(toRaw(bpmnElement.value), attrObj) |
| 125 | } | 131 | } |
| 126 | } | 132 | } |
| 127 | onMounted(() => { | 133 | onMounted(() => { |
| @@ -165,6 +171,6 @@ watch( | @@ -165,6 +171,6 @@ watch( | ||
| 165 | // } | 171 | // } |
| 166 | // } | 172 | // } |
| 167 | onBeforeUnmount(() => { | 173 | onBeforeUnmount(() => { |
| 168 | - bpmnElement = null | 174 | + bpmnElement.value = null |
| 169 | }) | 175 | }) |
| 170 | </script> | 176 | </script> |
yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue
| @@ -63,7 +63,7 @@ | @@ -63,7 +63,7 @@ | ||
| 63 | </template> | 63 | </template> |
| 64 | 64 | ||
| 65 | <script setup lang="ts" name="FlowCondition"> | 65 | <script setup lang="ts" name="FlowCondition"> |
| 66 | -import { ref, nextTick, watch, onBeforeUnmount } from 'vue' | 66 | +import { ref, nextTick, watch, onBeforeUnmount, toRaw } from 'vue' |
| 67 | import { ElSelect, ElForm, ElFormItem, ElInput, ElOption } from 'element-plus' | 67 | import { ElSelect, ElForm, ElFormItem, ElInput, ElOption } from 'element-plus' |
| 68 | 68 | ||
| 69 | const props = defineProps({ | 69 | const props = defineProps({ |
| @@ -117,17 +117,17 @@ const updateFlowType = (flowType) => { | @@ -117,17 +117,17 @@ const updateFlowType = (flowType) => { | ||
| 117 | // 正常条件类 | 117 | // 正常条件类 |
| 118 | if (flowType === 'condition') { | 118 | if (flowType === 'condition') { |
| 119 | flowConditionRef.value = window.bpmnInstances.moddle.create('bpmn:FormalExpression') | 119 | flowConditionRef.value = window.bpmnInstances.moddle.create('bpmn:FormalExpression') |
| 120 | - window.bpmnInstances.modeling.updateProperties(bpmnElement.value, { | 120 | + window.bpmnInstances.modeling.updateProperties(toRaw(bpmnElement.value), { |
| 121 | conditionExpression: flowConditionRef.value | 121 | conditionExpression: flowConditionRef.value |
| 122 | }) | 122 | }) |
| 123 | return | 123 | return |
| 124 | } | 124 | } |
| 125 | // 默认路径 | 125 | // 默认路径 |
| 126 | if (flowType === 'default') { | 126 | if (flowType === 'default') { |
| 127 | - window.bpmnInstances.modeling.updateProperties(bpmnElement.value, { | 127 | + window.bpmnInstances.modeling.updateProperties(toRaw(bpmnElement.value), { |
| 128 | conditionExpression: null | 128 | conditionExpression: null |
| 129 | }) | 129 | }) |
| 130 | - window.bpmnInstances.modeling.updateProperties(bpmnElementSource.value, { | 130 | + window.bpmnInstances.modeling.updateProperties(toRaw(bpmnElementSource.value), { |
| 131 | default: bpmnElement.value | 131 | default: bpmnElement.value |
| 132 | }) | 132 | }) |
| 133 | return | 133 | return |
| @@ -137,11 +137,11 @@ const updateFlowType = (flowType) => { | @@ -137,11 +137,11 @@ const updateFlowType = (flowType) => { | ||
| 137 | bpmnElementSourceRef.value.default && | 137 | bpmnElementSourceRef.value.default && |
| 138 | bpmnElementSourceRef.value.default.id === bpmnElement.value.id | 138 | bpmnElementSourceRef.value.default.id === bpmnElement.value.id |
| 139 | ) { | 139 | ) { |
| 140 | - window.bpmnInstances.modeling.updateProperties(bpmnElementSource.value, { | 140 | + window.bpmnInstances.modeling.updateProperties(toRaw(bpmnElementSource.value), { |
| 141 | default: null | 141 | default: null |
| 142 | }) | 142 | }) |
| 143 | } | 143 | } |
| 144 | - window.bpmnInstances.modeling.updateProperties(bpmnElement.value, { | 144 | + window.bpmnInstances.modeling.updateProperties(toRaw(bpmnElement.value), { |
| 145 | conditionExpression: null | 145 | conditionExpression: null |
| 146 | }) | 146 | }) |
| 147 | } | 147 | } |
| @@ -164,7 +164,7 @@ const updateFlowCondition = () => { | @@ -164,7 +164,7 @@ const updateFlowCondition = () => { | ||
| 164 | }) | 164 | }) |
| 165 | } | 165 | } |
| 166 | } | 166 | } |
| 167 | - window.bpmnInstances.modeling.updateProperties(bpmnElement.value, { | 167 | + window.bpmnInstances.modeling.updateProperties(toRaw(bpmnElement.value), { |
| 168 | conditionExpression: condition | 168 | conditionExpression: condition |
| 169 | }) | 169 | }) |
| 170 | } | 170 | } |
yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/form/ElementForm.vue
| @@ -205,7 +205,7 @@ | @@ -205,7 +205,7 @@ | ||
| 205 | </template> | 205 | </template> |
| 206 | 206 | ||
| 207 | <script setup lang="ts" name="ElementForm"> | 207 | <script setup lang="ts" name="ElementForm"> |
| 208 | -import { ref, inject, watch, nextTick } from 'vue' | 208 | +import { ref, inject, watch, nextTick, toRaw } from 'vue' |
| 209 | import { | 209 | import { |
| 210 | ElDialog, | 210 | ElDialog, |
| 211 | ElForm, | 211 | ElForm, |
| @@ -280,10 +280,12 @@ const resetFormList = () => { | @@ -280,10 +280,12 @@ const resetFormList = () => { | ||
| 280 | updateElementExtensions() | 280 | updateElementExtensions() |
| 281 | } | 281 | } |
| 282 | const updateElementFormKey = () => { | 282 | const updateElementFormKey = () => { |
| 283 | - window.bpmnInstances.modeling.updateProperties(bpmnELement.value, { formKey: formKey.value }) | 283 | + window.bpmnInstances.modeling.updateProperties(toRaw(bpmnELement.value), { |
| 284 | + formKey: formKey.value | ||
| 285 | + }) | ||
| 284 | } | 286 | } |
| 285 | const updateElementBusinessKey = () => { | 287 | const updateElementBusinessKey = () => { |
| 286 | - window.bpmnInstances.modeling.updateModdleProperties(bpmnELement.value, formData.value, { | 288 | + window.bpmnInstances.modeling.updateModdleProperties(toRaw(bpmnELement.value), formData.value, { |
| 287 | businessKey: businessKey.value | 289 | businessKey: businessKey.value |
| 288 | }) | 290 | }) |
| 289 | } | 291 | } |
| @@ -437,7 +439,7 @@ const updateElementExtensions = () => { | @@ -437,7 +439,7 @@ const updateElementExtensions = () => { | ||
| 437 | values: otherExtensions.value.concat(formData.value) | 439 | values: otherExtensions.value.concat(formData.value) |
| 438 | }) | 440 | }) |
| 439 | // 更新到元素上 | 441 | // 更新到元素上 |
| 440 | - window.bpmnInstances.modeling.updateProperties(bpmnELement.value, { | 442 | + window.bpmnInstances.modeling.updateProperties(toRaw(bpmnELement.value), { |
| 441 | extensionElements: newElExtensionElements | 443 | extensionElements: newElExtensionElements |
| 442 | }) | 444 | }) |
| 443 | } | 445 | } |
yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/listeners/ElementListeners.vue
| @@ -249,7 +249,7 @@ | @@ -249,7 +249,7 @@ | ||
| 249 | </div> | 249 | </div> |
| 250 | </template> | 250 | </template> |
| 251 | <script setup lang="ts" name="ElementListeners"> | 251 | <script setup lang="ts" name="ElementListeners"> |
| 252 | -import { ref, inject, watch, nextTick } from 'vue' | 252 | +import { ref, inject, watch, nextTick, toRaw } from 'vue' |
| 253 | import { | 253 | import { |
| 254 | ElMessageBox, | 254 | ElMessageBox, |
| 255 | ElTable, | 255 | ElTable, |
| @@ -288,8 +288,10 @@ const listenerFormRef = ref() | @@ -288,8 +288,10 @@ const listenerFormRef = ref() | ||
| 288 | const listenerFieldFormRef = ref() | 288 | const listenerFieldFormRef = ref() |
| 289 | 289 | ||
| 290 | const resetListenersList = () => { | 290 | const resetListenersList = () => { |
| 291 | + console.log(window, 'window') | ||
| 291 | bpmnElement.value = window.bpmnInstances.bpmnElement | 292 | bpmnElement.value = window.bpmnInstances.bpmnElement |
| 292 | otherExtensionList.value = [] | 293 | otherExtensionList.value = [] |
| 294 | + console.log(bpmnElement.value, 'bpmnElement.value') | ||
| 293 | bpmnElementListeners.value = | 295 | bpmnElementListeners.value = |
| 294 | bpmnElement.value.businessObject?.extensionElements?.values?.filter( | 296 | bpmnElement.value.businessObject?.extensionElements?.values?.filter( |
| 295 | (ex) => ex.$type === `${prefix}:ExecutionListener` | 297 | (ex) => ex.$type === `${prefix}:ExecutionListener` |
| @@ -394,14 +396,15 @@ const saveListenerConfig = async () => { | @@ -394,14 +396,15 @@ const saveListenerConfig = async () => { | ||
| 394 | bpmnElement.value.businessObject?.extensionElements?.values?.filter( | 396 | bpmnElement.value.businessObject?.extensionElements?.values?.filter( |
| 395 | (ex) => ex.$type !== `${prefix}:ExecutionListener` | 397 | (ex) => ex.$type !== `${prefix}:ExecutionListener` |
| 396 | ) ?? [] | 398 | ) ?? [] |
| 397 | - console.log(bpmnElement.value.height, 'bpmnElement.value') | 399 | + console.log(bpmnElement.value, 'bpmnElement.value') |
| 400 | + console.log(toRaw(bpmnElement.value), 'toRawtoRawtoRawtoRawtoRaw') | ||
| 398 | console.log( | 401 | console.log( |
| 399 | otherExtensionList.value.concat(bpmnElementListeners.value), | 402 | otherExtensionList.value.concat(bpmnElementListeners.value), |
| 400 | 'otherExtensionList.value.concat(bpmnElementListeners.value).value' | 403 | 'otherExtensionList.value.concat(bpmnElementListeners.value).value' |
| 401 | ) | 404 | ) |
| 402 | updateElementExtensions( | 405 | updateElementExtensions( |
| 403 | - bpmnElement.value, | ||
| 404 | - otherExtensionList.value.concat(bpmnElementListeners.value) | 406 | + toRaw(bpmnElement.value), |
| 407 | + toRaw(otherExtensionList.value.concat(bpmnElementListeners.value)) | ||
| 405 | ) | 408 | ) |
| 406 | // 4. 隐藏侧边栏 | 409 | // 4. 隐藏侧边栏 |
| 407 | listenerFormModelVisible.value = false | 410 | listenerFormModelVisible.value = false |
yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/listeners/UserTaskListeners.vue
| @@ -331,6 +331,10 @@ const listenerFormRef = ref() | @@ -331,6 +331,10 @@ const listenerFormRef = ref() | ||
| 331 | const listenerFieldFormRef = ref() | 331 | const listenerFieldFormRef = ref() |
| 332 | 332 | ||
| 333 | const resetListenersList = () => { | 333 | const resetListenersList = () => { |
| 334 | + console.log( | ||
| 335 | + window.bpmnInstances.bpmnElement, | ||
| 336 | + 'window.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElement' | ||
| 337 | + ) | ||
| 334 | bpmnElement.value = window.bpmnInstances.bpmnElement | 338 | bpmnElement.value = window.bpmnInstances.bpmnElement |
| 335 | otherExtensionList.value = [] | 339 | otherExtensionList.value = [] |
| 336 | bpmnElementListeners.value = | 340 | bpmnElementListeners.value = |
yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/listeners/utilSelf.js deleted
| 1 | -// 初始化表单数据 | ||
| 2 | -export function initListenerForm(listener) { | ||
| 3 | - let self = { | ||
| 4 | - ...listener | ||
| 5 | - }; | ||
| 6 | - if (listener.script) { | ||
| 7 | - self = { | ||
| 8 | - ...listener, | ||
| 9 | - ...listener.script, | ||
| 10 | - scriptType: listener.script.resource ? "externalScript" : "inlineScript" | ||
| 11 | - }; | ||
| 12 | - } | ||
| 13 | - if (listener.event === "timeout" && listener.eventDefinitions) { | ||
| 14 | - if (listener.eventDefinitions.length) { | ||
| 15 | - let k = ""; | ||
| 16 | - for (let key in listener.eventDefinitions[0]) { | ||
| 17 | - console.log(listener.eventDefinitions, key); | ||
| 18 | - if (key.indexOf("time") !== -1) { | ||
| 19 | - k = key; | ||
| 20 | - self.eventDefinitionType = key.replace("time", "").toLowerCase(); | ||
| 21 | - } | ||
| 22 | - } | ||
| 23 | - console.log(k); | ||
| 24 | - self.eventTimeDefinitions = listener.eventDefinitions[0][k].body; | ||
| 25 | - } | ||
| 26 | - } | ||
| 27 | - return self; | ||
| 28 | -} | ||
| 29 | - | ||
| 30 | -export function initListenerType(listener) { | ||
| 31 | - let listenerType; | ||
| 32 | - if (listener.class) listenerType = "classListener"; | ||
| 33 | - if (listener.expression) listenerType = "expressionListener"; | ||
| 34 | - if (listener.delegateExpression) listenerType = "delegateExpressionListener"; | ||
| 35 | - if (listener.script) listenerType = "scriptListener"; | ||
| 36 | - return { | ||
| 37 | - ...JSON.parse(JSON.stringify(listener)), | ||
| 38 | - ...(listener.script ?? {}), | ||
| 39 | - listenerType: listenerType | ||
| 40 | - }; | ||
| 41 | -} | ||
| 42 | - | ||
| 43 | -export const listenerType = { | ||
| 44 | - classListener: "Java 类", | ||
| 45 | - expressionListener: "表达式", | ||
| 46 | - delegateExpressionListener: "代理表达式", | ||
| 47 | - scriptListener: "脚本" | ||
| 48 | -}; | ||
| 49 | - | ||
| 50 | -export const eventType = { | ||
| 51 | - create: "创建", | ||
| 52 | - assignment: "指派", | ||
| 53 | - complete: "完成", | ||
| 54 | - delete: "删除", | ||
| 55 | - update: "更新", | ||
| 56 | - timeout: "超时" | ||
| 57 | -}; | ||
| 58 | - | ||
| 59 | -export const fieldType = { | ||
| 60 | - string: "字符串", | ||
| 61 | - expression: "表达式" | ||
| 62 | -}; |
yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/listeners/utilSelf.ts
0 → 100644
| 1 | +// 初始化表单数据 | ||
| 2 | +export function initListenerForm(listener) { | ||
| 3 | + let self = { | ||
| 4 | + ...listener | ||
| 5 | + } | ||
| 6 | + if (listener.script) { | ||
| 7 | + self = { | ||
| 8 | + ...listener, | ||
| 9 | + ...listener.script, | ||
| 10 | + scriptType: listener.script.resource ? 'externalScript' : 'inlineScript' | ||
| 11 | + } | ||
| 12 | + } | ||
| 13 | + if (listener.event === 'timeout' && listener.eventDefinitions) { | ||
| 14 | + if (listener.eventDefinitions.length) { | ||
| 15 | + let k = '' | ||
| 16 | + for (const key in listener.eventDefinitions[0]) { | ||
| 17 | + console.log(listener.eventDefinitions, key) | ||
| 18 | + if (key.indexOf('time') !== -1) { | ||
| 19 | + k = key | ||
| 20 | + self.eventDefinitionType = key.replace('time', '').toLowerCase() | ||
| 21 | + } | ||
| 22 | + } | ||
| 23 | + console.log(k) | ||
| 24 | + self.eventTimeDefinitions = listener.eventDefinitions[0][k].body | ||
| 25 | + } | ||
| 26 | + } | ||
| 27 | + return self | ||
| 28 | +} | ||
| 29 | + | ||
| 30 | +export function initListenerType(listener) { | ||
| 31 | + let listenerType | ||
| 32 | + if (listener.class) listenerType = 'classListener' | ||
| 33 | + if (listener.expression) listenerType = 'expressionListener' | ||
| 34 | + if (listener.delegateExpression) listenerType = 'delegateExpressionListener' | ||
| 35 | + if (listener.script) listenerType = 'scriptListener' | ||
| 36 | + return { | ||
| 37 | + ...JSON.parse(JSON.stringify(listener)), | ||
| 38 | + ...(listener.script ?? {}), | ||
| 39 | + listenerType: listenerType | ||
| 40 | + } | ||
| 41 | +} | ||
| 42 | + | ||
| 43 | +export const listenerType = { | ||
| 44 | + classListener: 'Java 类', | ||
| 45 | + expressionListener: '表达式', | ||
| 46 | + delegateExpressionListener: '代理表达式', | ||
| 47 | + scriptListener: '脚本' | ||
| 48 | +} | ||
| 49 | + | ||
| 50 | +export const eventType = { | ||
| 51 | + create: '创建', | ||
| 52 | + assignment: '指派', | ||
| 53 | + complete: '完成', | ||
| 54 | + delete: '删除', | ||
| 55 | + update: '更新', | ||
| 56 | + timeout: '超时' | ||
| 57 | +} | ||
| 58 | + | ||
| 59 | +export const fieldType = { | ||
| 60 | + string: '字符串', | ||
| 61 | + expression: '表达式' | ||
| 62 | +} |
yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/multi-instance/ElementMultiInstance.vue
| @@ -69,7 +69,7 @@ | @@ -69,7 +69,7 @@ | ||
| 69 | </template> | 69 | </template> |
| 70 | 70 | ||
| 71 | <script setup lang="ts" name="ElementMultiInstance"> | 71 | <script setup lang="ts" name="ElementMultiInstance"> |
| 72 | -import { inject, ref, onBeforeUnmount, watch } from 'vue' | 72 | +import { inject, ref, onBeforeUnmount, watch, toRaw } from 'vue' |
| 73 | import { ElForm, ElFormItem, ElSelect, ElOption, ElCheckbox, ElInput } from 'element-plus' | 73 | import { ElForm, ElFormItem, ElSelect, ElOption, ElCheckbox, ElInput } from 'element-plus' |
| 74 | const props = defineProps({ | 74 | const props = defineProps({ |
| 75 | businessObject: Object, | 75 | businessObject: Object, |
| @@ -129,7 +129,9 @@ const changeLoopCharacteristicsType = (type) => { | @@ -129,7 +129,9 @@ const changeLoopCharacteristicsType = (type) => { | ||
| 129 | // this.loopInstanceForm = { ...this.defaultLoopInstanceForm }; // 切换类型取消原表单配置 | 129 | // this.loopInstanceForm = { ...this.defaultLoopInstanceForm }; // 切换类型取消原表单配置 |
| 130 | // 取消多实例配置 | 130 | // 取消多实例配置 |
| 131 | if (type === 'Null') { | 131 | if (type === 'Null') { |
| 132 | - window.bpmnInstances.modeling.updateProperties(bpmnElement.value, { loopCharacteristics: null }) | 132 | + window.bpmnInstances.modeling.updateProperties(toRaw(bpmnElement.value), { |
| 133 | + loopCharacteristics: null | ||
| 134 | + }) | ||
| 133 | return | 135 | return |
| 134 | } | 136 | } |
| 135 | // 配置循环 | 137 | // 配置循环 |
| @@ -137,7 +139,7 @@ const changeLoopCharacteristicsType = (type) => { | @@ -137,7 +139,7 @@ const changeLoopCharacteristicsType = (type) => { | ||
| 137 | const loopCharacteristicsObject = window.bpmnInstances.moddle.create( | 139 | const loopCharacteristicsObject = window.bpmnInstances.moddle.create( |
| 138 | 'bpmn:StandardLoopCharacteristics' | 140 | 'bpmn:StandardLoopCharacteristics' |
| 139 | ) | 141 | ) |
| 140 | - window.bpmnInstances.modeling.updateProperties(bpmnElement.value, { | 142 | + window.bpmnInstances.modeling.updateProperties(toRaw(bpmnElement.value), { |
| 141 | loopCharacteristics: loopCharacteristicsObject | 143 | loopCharacteristics: loopCharacteristicsObject |
| 142 | }) | 144 | }) |
| 143 | multiLoopInstance.value = null | 145 | multiLoopInstance.value = null |
| @@ -155,7 +157,7 @@ const changeLoopCharacteristicsType = (type) => { | @@ -155,7 +157,7 @@ const changeLoopCharacteristicsType = (type) => { | ||
| 155 | { collection: '${coll_userList}' } | 157 | { collection: '${coll_userList}' } |
| 156 | ) | 158 | ) |
| 157 | } | 159 | } |
| 158 | - window.bpmnInstances.modeling.updateProperties(bpmnElement.value, { | 160 | + window.bpmnInstances.modeling.updateProperties(toRaw(bpmnElement.value), { |
| 159 | loopCharacteristics: multiLoopInstance.value | 161 | loopCharacteristics: multiLoopInstance.value |
| 160 | }) | 162 | }) |
| 161 | } | 163 | } |
| @@ -167,9 +169,13 @@ const updateLoopCardinality = (cardinality) => { | @@ -167,9 +169,13 @@ const updateLoopCardinality = (cardinality) => { | ||
| 167 | body: cardinality | 169 | body: cardinality |
| 168 | }) | 170 | }) |
| 169 | } | 171 | } |
| 170 | - window.bpmnInstances.modeling.updateModdleProperties(bpmnElement.value, multiLoopInstance.value, { | ||
| 171 | - loopCardinality | ||
| 172 | - }) | 172 | + window.bpmnInstances.modeling.updateModdleProperties( |
| 173 | + toRaw(bpmnElement.value), | ||
| 174 | + multiLoopInstance.value, | ||
| 175 | + { | ||
| 176 | + loopCardinality | ||
| 177 | + } | ||
| 178 | + ) | ||
| 173 | } | 179 | } |
| 174 | // 完成条件 | 180 | // 完成条件 |
| 175 | const updateLoopCondition = (condition) => { | 181 | const updateLoopCondition = (condition) => { |
| @@ -179,9 +185,13 @@ const updateLoopCondition = (condition) => { | @@ -179,9 +185,13 @@ const updateLoopCondition = (condition) => { | ||
| 179 | body: condition | 185 | body: condition |
| 180 | }) | 186 | }) |
| 181 | } | 187 | } |
| 182 | - window.bpmnInstances.modeling.updateModdleProperties(bpmnElement.value, multiLoopInstance.value, { | ||
| 183 | - completionCondition | ||
| 184 | - }) | 188 | + window.bpmnInstances.modeling.updateModdleProperties( |
| 189 | + toRaw(bpmnElement.value), | ||
| 190 | + multiLoopInstance.value, | ||
| 191 | + { | ||
| 192 | + completionCondition | ||
| 193 | + } | ||
| 194 | + ) | ||
| 185 | } | 195 | } |
| 186 | // 重试周期 | 196 | // 重试周期 |
| 187 | const updateLoopTimeCycle = (timeCycle) => { | 197 | const updateLoopTimeCycle = (timeCycle) => { |
| @@ -192,16 +202,24 @@ const updateLoopTimeCycle = (timeCycle) => { | @@ -192,16 +202,24 @@ const updateLoopTimeCycle = (timeCycle) => { | ||
| 192 | }) | 202 | }) |
| 193 | ] | 203 | ] |
| 194 | }) | 204 | }) |
| 195 | - window.bpmnInstances.modeling.updateModdleProperties(bpmnElement.value, multiLoopInstance.value, { | ||
| 196 | - extensionElements | ||
| 197 | - }) | 205 | + window.bpmnInstances.modeling.updateModdleProperties( |
| 206 | + toRaw(bpmnElement.value), | ||
| 207 | + multiLoopInstance.value, | ||
| 208 | + { | ||
| 209 | + extensionElements | ||
| 210 | + } | ||
| 211 | + ) | ||
| 198 | } | 212 | } |
| 199 | // 直接更新的基础信息 | 213 | // 直接更新的基础信息 |
| 200 | const updateLoopBase = () => { | 214 | const updateLoopBase = () => { |
| 201 | - window.bpmnInstances.modeling.updateModdleProperties(bpmnElement.value, multiLoopInstance.value, { | ||
| 202 | - collection: loopInstanceForm.value.collection || null, | ||
| 203 | - elementVariable: loopInstanceForm.value.elementVariable || null | ||
| 204 | - }) | 215 | + window.bpmnInstances.modeling.updateModdleProperties( |
| 216 | + toRaw(bpmnElement.value), | ||
| 217 | + multiLoopInstance.value, | ||
| 218 | + { | ||
| 219 | + collection: loopInstanceForm.value.collection || null, | ||
| 220 | + elementVariable: loopInstanceForm.value.elementVariable || null | ||
| 221 | + } | ||
| 222 | + ) | ||
| 205 | } | 223 | } |
| 206 | // 各异步状态 | 224 | // 各异步状态 |
| 207 | const updateLoopAsync = (key) => { | 225 | const updateLoopAsync = (key) => { |
| @@ -215,7 +233,7 @@ const updateLoopAsync = (key) => { | @@ -215,7 +233,7 @@ const updateLoopAsync = (key) => { | ||
| 215 | asyncAttr[key] = loopInstanceForm.value[key] | 233 | asyncAttr[key] = loopInstanceForm.value[key] |
| 216 | } | 234 | } |
| 217 | window.bpmnInstances.modeling.updateModdleProperties( | 235 | window.bpmnInstances.modeling.updateModdleProperties( |
| 218 | - bpmnElement.value, | 236 | + toRaw(bpmnElement.value), |
| 219 | multiLoopInstance.value, | 237 | multiLoopInstance.value, |
| 220 | asyncAttr | 238 | asyncAttr |
| 221 | ) | 239 | ) |
yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/other/ElementOtherConfig.vue
| @@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
| 17 | </template> | 17 | </template> |
| 18 | 18 | ||
| 19 | <script setup lang="ts" name="ElementOtherConfig"> | 19 | <script setup lang="ts" name="ElementOtherConfig"> |
| 20 | -import { ref, watch, nextTick, onBeforeUnmount } from 'vue' | 20 | +import { ref, watch, nextTick, onBeforeUnmount, toRaw } from 'vue' |
| 21 | import { ElInput } from 'element-plus' | 21 | import { ElInput } from 'element-plus' |
| 22 | const props = defineProps({ | 22 | const props = defineProps({ |
| 23 | id: String | 23 | id: String |
| @@ -25,15 +25,26 @@ const props = defineProps({ | @@ -25,15 +25,26 @@ const props = defineProps({ | ||
| 25 | const documentation = ref('') | 25 | const documentation = ref('') |
| 26 | const bpmnElement = ref() | 26 | const bpmnElement = ref() |
| 27 | const updateDocumentation = () => { | 27 | const updateDocumentation = () => { |
| 28 | + console.log(props, 'props') | ||
| 29 | + console.log(window, 'window') | ||
| 30 | + console.log( | ||
| 31 | + window.bpmnInstances.elementRegistry.get(props.id), | ||
| 32 | + 'window.bpmnInstances.elementRegistry.get(props.id)' | ||
| 33 | + ) | ||
| 34 | + console.log(bpmnElement.value, 'bpmnElement.value ') | ||
| 28 | if (bpmnElement.value && bpmnElement.value.id === props.id) { | 35 | if (bpmnElement.value && bpmnElement.value.id === props.id) { |
| 29 | - bpmnElement.value = window.bpmnInstances.elementRegistry.get(props.id) | 36 | + bpmnElement.value = window?.bpmnInstances.elementRegistry.get(props.id) |
| 30 | } | 37 | } |
| 38 | + console.log( | ||
| 39 | + bpmnElement.value, | ||
| 40 | + 'bpmnElement.value bpmnElement.value bpmnElement.value bpmnElement.value bpmnElement.value bpmnElement.value ' | ||
| 41 | + ) | ||
| 31 | // (bpmnElement.value && bpmnElement.value.id === props.id) || | 42 | // (bpmnElement.value && bpmnElement.value.id === props.id) || |
| 32 | // (bpmnElement.value = window.bpmnInstances.elementRegistry.get(props.id)) | 43 | // (bpmnElement.value = window.bpmnInstances.elementRegistry.get(props.id)) |
| 33 | const documentations = window.bpmnInstances.bpmnFactory.create('bpmn:Documentation', { | 44 | const documentations = window.bpmnInstances.bpmnFactory.create('bpmn:Documentation', { |
| 34 | text: documentation.value | 45 | text: documentation.value |
| 35 | }) | 46 | }) |
| 36 | - window.bpmnInstances.modeling.updateProperties(bpmnElement.value, { | 47 | + window.bpmnInstances.modeling.updateProperties(toRaw(bpmnElement.value), { |
| 37 | documentation: [documentations] | 48 | documentation: [documentations] |
| 38 | }) | 49 | }) |
| 39 | } | 50 | } |
yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/properties/ElementProperties.vue
| @@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
| 13 | <el-button | 13 | <el-button |
| 14 | type="text" | 14 | type="text" |
| 15 | style="color: #ff4d4f" | 15 | style="color: #ff4d4f" |
| 16 | - @click="removeAttributes(scope.roww, scope.$index)" | 16 | + @click="removeAttributes(scope.row, scope.$index)" |
| 17 | >移除</el-button | 17 | >移除</el-button |
| 18 | > | 18 | > |
| 19 | </template> | 19 | </template> |
| @@ -52,7 +52,7 @@ | @@ -52,7 +52,7 @@ | ||
| 52 | </template> | 52 | </template> |
| 53 | 53 | ||
| 54 | <script setup lang="ts" name="ElementProperties"> | 54 | <script setup lang="ts" name="ElementProperties"> |
| 55 | -import { ref, inject, nextTick, watch } from 'vue' | 55 | +import { ref, inject, nextTick, watch, toRaw } from 'vue' |
| 56 | import { | 56 | import { |
| 57 | ElMessageBox, | 57 | ElMessageBox, |
| 58 | ElDialog, | 58 | ElDialog, |
| @@ -131,8 +131,8 @@ const saveAttribute = () => { | @@ -131,8 +131,8 @@ const saveAttribute = () => { | ||
| 131 | const { name, value } = propertyForm.value | 131 | const { name, value } = propertyForm.value |
| 132 | if (editingPropertyIndex.value !== -1) { | 132 | if (editingPropertyIndex.value !== -1) { |
| 133 | window.bpmnInstances.modeling.updateModdleProperties( | 133 | window.bpmnInstances.modeling.updateModdleProperties( |
| 134 | - bpmnElement.value, | ||
| 135 | - bpmnElementPropertyList.value[editingPropertyIndex.value], | 134 | + toRaw(bpmnElement.value), |
| 135 | + toRaw(bpmnElementPropertyList.value)[toRaw(editingPropertyIndex.value)], | ||
| 136 | { | 136 | { |
| 137 | name, | 137 | name, |
| 138 | value | 138 | value |
| @@ -157,7 +157,7 @@ const updateElementExtensions = (properties) => { | @@ -157,7 +157,7 @@ const updateElementExtensions = (properties) => { | ||
| 157 | const extensions = window.bpmnInstances.moddle.create('bpmn:ExtensionElements', { | 157 | const extensions = window.bpmnInstances.moddle.create('bpmn:ExtensionElements', { |
| 158 | values: otherExtensionList.value.concat([properties]) | 158 | values: otherExtensionList.value.concat([properties]) |
| 159 | }) | 159 | }) |
| 160 | - window.bpmnInstances.modeling.updateProperties(bpmnElement.value, { | 160 | + window.bpmnInstances.modeling.updateProperties(toRaw(bpmnElement.value), { |
| 161 | extensionElements: extensions | 161 | extensionElements: extensions |
| 162 | }) | 162 | }) |
| 163 | } | 163 | } |
yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/task/task-components/ReceiveTask.vue
| @@ -50,7 +50,7 @@ | @@ -50,7 +50,7 @@ | ||
| 50 | </template> | 50 | </template> |
| 51 | 51 | ||
| 52 | <script setup lang="ts" name="ReceiveTask"> | 52 | <script setup lang="ts" name="ReceiveTask"> |
| 53 | -import { ref, watch, onBeforeUnmount, onMounted, nextTick } from 'vue' | 53 | +import { ref, watch, onBeforeUnmount, onMounted, nextTick, toRaw } from 'vue' |
| 54 | import { ElMessage, ElFormItem, ElDialog, ElForm, ElSelect, ElOption } from 'element-plus' | 54 | import { ElMessage, ElFormItem, ElDialog, ElForm, ElSelect, ElOption } from 'element-plus' |
| 55 | const props = defineProps({ | 55 | const props = defineProps({ |
| 56 | id: String, | 56 | id: String, |
| @@ -85,11 +85,11 @@ const createNewMessage = () => { | @@ -85,11 +85,11 @@ const createNewMessage = () => { | ||
| 85 | } | 85 | } |
| 86 | const updateTaskMessage = (messageId) => { | 86 | const updateTaskMessage = (messageId) => { |
| 87 | if (messageId === '-1') { | 87 | if (messageId === '-1') { |
| 88 | - window.bpmnInstances.modeling.updateProperties(bpmnElement.value, { | 88 | + window.bpmnInstances.modeling.updateProperties(toRaw(bpmnElement.value), { |
| 89 | messageRef: null | 89 | messageRef: null |
| 90 | }) | 90 | }) |
| 91 | } else { | 91 | } else { |
| 92 | - window.bpmnInstances.modeling.updateProperties(bpmnElement.value, { | 92 | + window.bpmnInstances.modeling.updateProperties(toRaw(bpmnElement.value), { |
| 93 | messageRef: bpmnMessageRefsMap.value[messageId] | 93 | messageRef: bpmnMessageRefsMap.value[messageId] |
| 94 | }) | 94 | }) |
| 95 | } | 95 | } |
yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/task/task-components/ScriptTask.vue
| @@ -45,7 +45,7 @@ | @@ -45,7 +45,7 @@ | ||
| 45 | </template> | 45 | </template> |
| 46 | 46 | ||
| 47 | <script setup lang="ts" name="ScriptTask"> | 47 | <script setup lang="ts" name="ScriptTask"> |
| 48 | -import { ref, watch, nextTick, onBeforeUnmount } from 'vue' | 48 | +import { ref, watch, nextTick, onBeforeUnmount, toRaw } from 'vue' |
| 49 | import { ElInput, ElFormItem } from 'element-plus' | 49 | import { ElInput, ElFormItem } from 'element-plus' |
| 50 | const props = defineProps({ | 50 | const props = defineProps({ |
| 51 | id: String, | 51 | id: String, |
| @@ -78,7 +78,7 @@ const updateElementTask = () => { | @@ -78,7 +78,7 @@ const updateElementTask = () => { | ||
| 78 | taskAttr.resource = scriptTaskForm.value.resource || null | 78 | taskAttr.resource = scriptTaskForm.value.resource || null |
| 79 | taskAttr.script = null | 79 | taskAttr.script = null |
| 80 | } | 80 | } |
| 81 | - window.bpmnInstances.modeling.updateProperties(bpmnElement.value, taskAttr) | 81 | + window.bpmnInstances.modeling.updateProperties(toRaw(bpmnElement.value), taskAttr) |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | onBeforeUnmount(() => { | 84 | onBeforeUnmount(() => { |
yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/task/task-components/UserTask.vue
| @@ -38,7 +38,7 @@ | @@ -38,7 +38,7 @@ | ||
| 38 | </template> | 38 | </template> |
| 39 | 39 | ||
| 40 | <script setup lang="ts" name="UserTask"> | 40 | <script setup lang="ts" name="UserTask"> |
| 41 | -import { ref, watch, nextTick, onBeforeUnmount } from 'vue' | 41 | +import { ref, watch, nextTick, onBeforeUnmount, toRaw } from 'vue' |
| 42 | import { ElLink, ElFormItem, ElInput } from 'element-plus' | 42 | import { ElLink, ElFormItem, ElInput } from 'element-plus' |
| 43 | const props = defineProps({ | 43 | const props = defineProps({ |
| 44 | id: String, | 44 | id: String, |
| @@ -78,7 +78,7 @@ const updateElementTask = (key) => { | @@ -78,7 +78,7 @@ const updateElementTask = (key) => { | ||
| 78 | } else { | 78 | } else { |
| 79 | taskAttr[key] = userTaskForm.value[key] || null | 79 | taskAttr[key] = userTaskForm.value[key] || null |
| 80 | } | 80 | } |
| 81 | - window.bpmnInstances.modeling.updateProperties(bpmnElement.value, taskAttr) | 81 | + window.bpmnInstances.modeling.updateProperties(toRaw(bpmnElement.value), taskAttr) |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | watch( | 84 | watch( |
yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/utils.ts
| 1 | +import { toRaw } from 'vue' | ||
| 1 | // 创建监听器实例 | 2 | // 创建监听器实例 |
| 2 | export function createListenerObject(options, isTask, prefix) { | 3 | export function createListenerObject(options, isTask, prefix) { |
| 3 | const listenerObj = Object.create(null) | 4 | const listenerObj = Object.create(null) |
| @@ -59,12 +60,9 @@ export function updateElementExtensions(element, extensionList) { | @@ -59,12 +60,9 @@ export function updateElementExtensions(element, extensionList) { | ||
| 59 | const extensions = window.bpmnInstances.moddle.create('bpmn:ExtensionElements', { | 60 | const extensions = window.bpmnInstances.moddle.create('bpmn:ExtensionElements', { |
| 60 | values: extensionList | 61 | values: extensionList |
| 61 | }) | 62 | }) |
| 62 | - console.log(element, 'elementelementelementelement') | ||
| 63 | - console.log(extensions.values, 'extensionsextensionsextensions') | ||
| 64 | - window.bpmnInstances.modeling.updateProperties(element, { | 63 | + window.bpmnInstances.modeling.updateProperties(toRaw(element), { |
| 65 | extensionElements: extensions.values | 64 | extensionElements: extensions.values |
| 66 | }) | 65 | }) |
| 67 | - console.log('ssss') | ||
| 68 | } | 66 | } |
| 69 | 67 | ||
| 70 | // 创建一个id | 68 | // 创建一个id |
yudao-ui-admin-vue3/src/views/bpm/model/modelEditor.vue
| @@ -27,7 +27,7 @@ | @@ -27,7 +27,7 @@ | ||
| 27 | </template> | 27 | </template> |
| 28 | 28 | ||
| 29 | <script setup lang="ts"> | 29 | <script setup lang="ts"> |
| 30 | -import { ref, onMounted, onBeforeMount } from 'vue' | 30 | +import { ref, onMounted } from 'vue' |
| 31 | // import { translations } from '@/components/bpmnProcessDesigner/src/translations' | 31 | // import { translations } from '@/components/bpmnProcessDesigner/src/translations' |
| 32 | // 自定义元素选中时的弹出菜单(修改 默认任务 为 用户任务) | 32 | // 自定义元素选中时的弹出菜单(修改 默认任务 为 用户任务) |
| 33 | import CustomContentPadProvider from '@/components/bpmnProcessDesigner/package/designer/plugins/content-pad' | 33 | import CustomContentPadProvider from '@/components/bpmnProcessDesigner/package/designer/plugins/content-pad' |
| @@ -64,9 +64,6 @@ const controlForm = ref({ | @@ -64,9 +64,6 @@ const controlForm = ref({ | ||
| 64 | // }) | 64 | // }) |
| 65 | // 流程模型的信息 | 65 | // 流程模型的信息 |
| 66 | const model = ref({}) | 66 | const model = ref({}) |
| 67 | -onBeforeMount(() => { | ||
| 68 | - // window.bpmnInstances = {} | ||
| 69 | -}) | ||
| 70 | onMounted(() => { | 67 | onMounted(() => { |
| 71 | // 如果 modelId 非空,说明是修改流程模型 | 68 | // 如果 modelId 非空,说明是修改流程模型 |
| 72 | const modelId = router.currentRoute.value.query && router.currentRoute.value.query.modelId | 69 | const modelId = router.currentRoute.value.query && router.currentRoute.value.query.modelId |