mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 18:28:43 +08:00 
			
		
		
		
	bug
This commit is contained in:
		| @@ -7,22 +7,24 @@ | |||||||
|           <XButton preIcon="ep:folder-opened" title="打开文件" @click="refFile.click()" /> |           <XButton preIcon="ep:folder-opened" title="打开文件" @click="refFile.click()" /> | ||||||
|           <el-tooltip effect="light" placement="bottom"> |           <el-tooltip effect="light" placement="bottom"> | ||||||
|             <template #content> |             <template #content> | ||||||
|               <XButton type="text" title="下载为XML文件" @click="downloadProcessAsXml()" /> |               <div style="color: #409eff"> | ||||||
|               <br /> |                 <el-button link @click="downloadProcessAsXml()">下载为XML文件</el-button> | ||||||
|  |                 <br /> | ||||||
|  |  | ||||||
|               <XButton type="text" title="下载为SVG文件" @click="downloadProcessAsSvg()" /> |                 <el-button link @click="downloadProcessAsSvg()">下载为SVG文件</el-button> | ||||||
|               <br /> |                 <br /> | ||||||
|  |  | ||||||
|               <XButton type="text" title="下载为BPMN文件" @click="downloadProcessAsBpmn()" /> |                 <el-button link @click="downloadProcessAsBpmn()">下载为BPMN文件</el-button> | ||||||
|  |               </div> | ||||||
|             </template> |             </template> | ||||||
|             <XButton title="下载文件" preIcon="ep:download" /> |             <XButton title="下载文件" preIcon="ep:download" /> | ||||||
|           </el-tooltip> |           </el-tooltip> | ||||||
|           <el-tooltip effect="light"> |           <el-tooltip effect="light"> | ||||||
|             <XButton preIcon="ep:view" title="浏览" /> |             <XButton preIcon="ep:view" title="浏览" /> | ||||||
|             <template #content> |             <template #content> | ||||||
|               <el-button type="text" @click="previewProcessXML">预览XML</el-button> |               <el-button link @click="previewProcessXML">预览XML</el-button> | ||||||
|               <br /> |               <br /> | ||||||
|               <el-button type="text" @click="previewProcessJson">预览JSON</el-button> |               <el-button link @click="previewProcessJson">预览JSON</el-button> | ||||||
|             </template> |             </template> | ||||||
|           </el-tooltip> |           </el-tooltip> | ||||||
|           <el-tooltip |           <el-tooltip | ||||||
| @@ -594,10 +596,9 @@ const elementsAlign = (align) => { | |||||||
|   const Align = bpmnModeler.get('alignElements') |   const Align = bpmnModeler.get('alignElements') | ||||||
|   const Selection = bpmnModeler.get('selection') |   const Selection = bpmnModeler.get('selection') | ||||||
|   const SelectedElements = Selection.get() |   const SelectedElements = Selection.get() | ||||||
|   console.log(SelectedElements, 'SelectedElements') |  | ||||||
|   if (!SelectedElements || SelectedElements.length <= 1) { |   if (!SelectedElements || SelectedElements.length <= 1) { | ||||||
|     ElMessage.warning('请按住 Shift 键选择多个元素对齐') |     ElMessage.warning('请按住 Shift 键选择多个元素对齐') | ||||||
|     // alert('请按住 Ctrl 键选择多个元素对齐') |     // alert('请按住 Ctrl 键选择多个元素对齐 | ||||||
|     return |     return | ||||||
|   } |   } | ||||||
|   ElMessageBox.confirm('自动对齐可能造成图形变形,是否继续?', '警告', { |   ElMessageBox.confirm('自动对齐可能造成图形变形,是否继续?', '警告', { | ||||||
| @@ -636,7 +637,10 @@ const previewProcessJson = () => { | |||||||
| } | } | ||||||
| /* ------------------------------------------------ 芋道源码 methods ------------------------------------------------------ */ | /* ------------------------------------------------ 芋道源码 methods ------------------------------------------------------ */ | ||||||
| const processSave = async () => { | const processSave = async () => { | ||||||
|  |   console.log(bpmnModeler, 'bpmnModelerbpmnModelerbpmnModelerbpmnModeler') | ||||||
|   const { err, xml } = await bpmnModeler.saveXML() |   const { err, xml } = await bpmnModeler.saveXML() | ||||||
|  |   console.log(err, 'errerrerrerrerr') | ||||||
|  |   console.log(xml, 'xmlxmlxmlxmlxml') | ||||||
|   // 读取异常时抛出异常 |   // 读取异常时抛出异常 | ||||||
|   if (err) { |   if (err) { | ||||||
|     // this.$modal.msgError('保存模型失败,请重试!') |     // this.$modal.msgError('保存模型失败,请重试!') | ||||||
|   | |||||||
| @@ -89,7 +89,7 @@ const props = defineProps({ | |||||||
|   }, |   }, | ||||||
|   width: { |   width: { | ||||||
|     type: Number, |     type: Number, | ||||||
|     default: 500 |     default: 480 | ||||||
|   }, |   }, | ||||||
|   idEditDisabled: { |   idEditDisabled: { | ||||||
|     type: Boolean, |     type: Boolean, | ||||||
|   | |||||||
| @@ -45,7 +45,7 @@ const props = defineProps({ | |||||||
|   model: Object // 流程模型的数据 |   model: Object // 流程模型的数据 | ||||||
| }) | }) | ||||||
| const needProps = ref({}) | const needProps = ref({}) | ||||||
| const bpmnElement = ref() | let bpmnElement | ||||||
| const elementBaseInfo = ref({}) | const elementBaseInfo = ref({}) | ||||||
| // 流程表单的下拉框的数据 | // 流程表单的下拉框的数据 | ||||||
| // const forms = ref([]) | // const forms = ref([]) | ||||||
| @@ -59,10 +59,10 @@ const resetBaseInfo = () => { | |||||||
|   console.log(window, 'window') |   console.log(window, 'window') | ||||||
|   console.log(bpmnElement, 'bpmnElement') |   console.log(bpmnElement, 'bpmnElement') | ||||||
|  |  | ||||||
|   bpmnElement.value = window?.bpmnInstances?.bpmnElement |   bpmnElement = window?.bpmnInstances?.bpmnElement | ||||||
|   console.log(bpmnElement.value, 'resetBaseInfo11111111111') |   console.log(bpmnElement, 'resetBaseInfo11111111111') | ||||||
|   elementBaseInfo.value = bpmnElement.value.businessObject |   elementBaseInfo.value = bpmnElement.businessObject | ||||||
|   needProps.value['type'] = bpmnElement.value.businessObject.$type |   needProps.value['type'] = bpmnElement.businessObject.$type | ||||||
|   // elementBaseInfo.value['typess'] = bpmnElement.value.businessObject.$type |   // elementBaseInfo.value['typess'] = bpmnElement.value.businessObject.$type | ||||||
|  |  | ||||||
|   // elementBaseInfo.value = JSON.parse(JSON.stringify(bpmnElement.value.businessObject)) |   // elementBaseInfo.value = JSON.parse(JSON.stringify(bpmnElement.value.businessObject)) | ||||||
| @@ -113,15 +113,15 @@ const updateBaseInfo = (key) => { | |||||||
|   if (key === 'id') { |   if (key === 'id') { | ||||||
|     console.log('jinru') |     console.log('jinru') | ||||||
|     console.log(window, 'window') |     console.log(window, 'window') | ||||||
|     console.log(bpmnElement.value, 'bpmnElement') |     console.log(bpmnElement, 'bpmnElement') | ||||||
|     console.log(toRaw(bpmnElement.value), 'bpmnElement') |     console.log(toRaw(bpmnElement), 'bpmnElement') | ||||||
|     window.bpmnInstances.modeling.updateProperties(toRaw(bpmnElement.value), { |     window.bpmnInstances.modeling.updateProperties(toRaw(bpmnElement), { | ||||||
|       id: elementBaseInfo.value[key], |       id: elementBaseInfo.value[key], | ||||||
|       di: { id: `${elementBaseInfo.value[key]}_di` } |       di: { id: `${elementBaseInfo.value[key]}_di` } | ||||||
|     }) |     }) | ||||||
|   } else { |   } else { | ||||||
|     console.log(attrObj, 'attrObj') |     console.log(attrObj, 'attrObj') | ||||||
|     window.bpmnInstances.modeling.updateProperties(bpmnElement.value, attrObj) |     window.bpmnInstances.modeling.updateProperties(toRaw(bpmnElement), attrObj) | ||||||
|   } |   } | ||||||
| } | } | ||||||
| onMounted(() => { | onMounted(() => { | ||||||
| @@ -165,6 +165,6 @@ watch( | |||||||
| //   } | //   } | ||||||
| // } | // } | ||||||
| onBeforeUnmount(() => { | onBeforeUnmount(() => { | ||||||
|   bpmnElement.value = null |   bpmnElement = null | ||||||
| }) | }) | ||||||
| </script> | </script> | ||||||
|   | |||||||
| @@ -11,13 +11,12 @@ | |||||||
|       /> |       /> | ||||||
|       <el-table-column label="操作" width="90px"> |       <el-table-column label="操作" width="90px"> | ||||||
|         <template #default="scope"> |         <template #default="scope"> | ||||||
|           <el-button size="small" type="text" @click="openListenerForm(scope.row, scope.$index)" |           <el-button size="small" @click="openListenerForm(scope.row, scope.$index)" | ||||||
|             >编辑</el-button |             >编辑</el-button | ||||||
|           > |           > | ||||||
|           <el-divider direction="vertical" /> |           <el-divider direction="vertical" /> | ||||||
|           <el-button |           <el-button | ||||||
|             size="small" |             size="small" | ||||||
|             type="text" |  | ||||||
|             style="color: #ff4d4f" |             style="color: #ff4d4f" | ||||||
|             @click="removeListener(scope.row, scope.$index)" |             @click="removeListener(scope.row, scope.$index)" | ||||||
|             >移除</el-button |             >移除</el-button | ||||||
| @@ -395,10 +394,15 @@ const saveListenerConfig = async () => { | |||||||
|     bpmnElement.value.businessObject?.extensionElements?.values?.filter( |     bpmnElement.value.businessObject?.extensionElements?.values?.filter( | ||||||
|       (ex) => ex.$type !== `${prefix}:ExecutionListener` |       (ex) => ex.$type !== `${prefix}:ExecutionListener` | ||||||
|     ) ?? [] |     ) ?? [] | ||||||
|   // updateElementExtensions( |   console.log(bpmnElement.value.height, 'bpmnElement.value') | ||||||
|   //   bpmnElement.value, |   console.log( | ||||||
|   //   otherExtensionList.value.concat(bpmnElementListeners.value) |     otherExtensionList.value.concat(bpmnElementListeners.value), | ||||||
|   // ) |     'otherExtensionList.value.concat(bpmnElementListeners.value).value' | ||||||
|  |   ) | ||||||
|  |   updateElementExtensions( | ||||||
|  |     bpmnElement.value, | ||||||
|  |     otherExtensionList.value.concat(bpmnElementListeners.value) | ||||||
|  |   ) | ||||||
|   // 4. 隐藏侧边栏 |   // 4. 隐藏侧边栏 | ||||||
|   listenerFormModelVisible.value = false |   listenerFormModelVisible.value = false | ||||||
|   listenerForm.value = {} |   listenerForm.value = {} | ||||||
| @@ -407,6 +411,7 @@ const saveListenerConfig = async () => { | |||||||
| watch( | watch( | ||||||
|   () => props.id, |   () => props.id, | ||||||
|   (val) => { |   (val) => { | ||||||
|  |     console.log(val, 'propsId变化') | ||||||
|     val && |     val && | ||||||
|       val.length && |       val.length && | ||||||
|       nextTick(() => { |       nextTick(() => { | ||||||
|   | |||||||
| @@ -25,13 +25,16 @@ const props = defineProps({ | |||||||
| const documentation = ref('') | const documentation = ref('') | ||||||
| const bpmnElement = ref() | const bpmnElement = ref() | ||||||
| const updateDocumentation = () => { | const updateDocumentation = () => { | ||||||
|   ;(bpmnElement.value && bpmnElement.value.id === props.id) || |   if (bpmnElement.value && bpmnElement.value.id === props.id) { | ||||||
|     (bpmnElement.value = window.bpmnInstances.elementRegistry.get(props.id)) |     bpmnElement.value = window.bpmnInstances.elementRegistry.get(props.id) | ||||||
|   const documentation = window.bpmnInstances.bpmnFactory.create('bpmn:Documentation', { |   } | ||||||
|  |   // (bpmnElement.value && bpmnElement.value.id === props.id) || | ||||||
|  |   //   (bpmnElement.value = window.bpmnInstances.elementRegistry.get(props.id)) | ||||||
|  |   const documentations = window.bpmnInstances.bpmnFactory.create('bpmn:Documentation', { | ||||||
|     text: documentation.value |     text: documentation.value | ||||||
|   }) |   }) | ||||||
|   window.bpmnInstances.modeling.updateProperties(bpmnElement.value, { |   window.bpmnInstances.modeling.updateProperties(bpmnElement.value, { | ||||||
|     documentation: [documentation] |     documentation: [documentations] | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
| onBeforeUnmount(() => { | onBeforeUnmount(() => { | ||||||
|   | |||||||
| @@ -6,12 +6,14 @@ | |||||||
|       <el-table-column label="属性值" prop="value" min-width="100px" show-overflow-tooltip /> |       <el-table-column label="属性值" prop="value" min-width="100px" show-overflow-tooltip /> | ||||||
|       <el-table-column label="操作" width="90px"> |       <el-table-column label="操作" width="90px"> | ||||||
|         <template #default="scope"> |         <template #default="scope"> | ||||||
|           <el-button type="text" @click="openAttributesForm(scope, scope.$index)">编辑</el-button> |           <el-button type="text" @click="openAttributesForm(scope.row, scope.$index)" | ||||||
|  |             >编辑</el-button | ||||||
|  |           > | ||||||
|           <el-divider direction="vertical" /> |           <el-divider direction="vertical" /> | ||||||
|           <el-button |           <el-button | ||||||
|             type="text" |             type="text" | ||||||
|             style="color: #ff4d4f" |             style="color: #ff4d4f" | ||||||
|             @click="removeAttributes(scope, scope.$index)" |             @click="removeAttributes(scope.roww, scope.$index)" | ||||||
|             >移除</el-button |             >移除</el-button | ||||||
|           > |           > | ||||||
|         </template> |         </template> | ||||||
| @@ -84,10 +86,10 @@ const resetAttributesList = () => { | |||||||
|   otherExtensionList.value = [] // 其他扩展配置 |   otherExtensionList.value = [] // 其他扩展配置 | ||||||
|   bpmnElementProperties.value = |   bpmnElementProperties.value = | ||||||
|     bpmnElement.value.businessObject?.extensionElements?.values?.filter((ex) => { |     bpmnElement.value.businessObject?.extensionElements?.values?.filter((ex) => { | ||||||
|       if (ex.$type !== `${prefix.value}:Properties`) { |       if (ex.$type !== `${prefix}:Properties`) { | ||||||
|         otherExtensionList.value.push(ex) |         otherExtensionList.value.push(ex) | ||||||
|       } |       } | ||||||
|       return ex.$type === `${prefix.value}:Properties` |       return ex.$type === `${prefix}:Properties` | ||||||
|     }) ?? [] |     }) ?? [] | ||||||
|  |  | ||||||
|   // 保存所有的 扩展属性字段 |   // 保存所有的 扩展属性字段 | ||||||
| @@ -116,7 +118,7 @@ const removeAttributes = (attr, index) => { | |||||||
|       elementPropertyList.value.splice(index, 1) |       elementPropertyList.value.splice(index, 1) | ||||||
|       bpmnElementPropertyList.value.splice(index, 1) |       bpmnElementPropertyList.value.splice(index, 1) | ||||||
|       // 新建一个属性字段的保存列表 |       // 新建一个属性字段的保存列表 | ||||||
|       const propertiesObject = window.bpmnInstances.moddle.create(`${prefix.value}:Properties`, { |       const propertiesObject = window.bpmnInstances.moddle.create(`${prefix}:Properties`, { | ||||||
|         values: bpmnElementPropertyList.value |         values: bpmnElementPropertyList.value | ||||||
|       }) |       }) | ||||||
|       updateElementExtensions(propertiesObject) |       updateElementExtensions(propertiesObject) | ||||||
| @@ -125,8 +127,8 @@ const removeAttributes = (attr, index) => { | |||||||
|     .catch(() => console.info('操作取消')) |     .catch(() => console.info('操作取消')) | ||||||
| } | } | ||||||
| const saveAttribute = () => { | const saveAttribute = () => { | ||||||
|  |   console.log(propertyForm.value, 'propertyForm.value') | ||||||
|   const { name, value } = propertyForm.value |   const { name, value } = propertyForm.value | ||||||
|   console.log(bpmnElementPropertyList.value) |  | ||||||
|   if (editingPropertyIndex.value !== -1) { |   if (editingPropertyIndex.value !== -1) { | ||||||
|     window.bpmnInstances.modeling.updateModdleProperties( |     window.bpmnInstances.modeling.updateModdleProperties( | ||||||
|       bpmnElement.value, |       bpmnElement.value, | ||||||
| @@ -138,12 +140,12 @@ const saveAttribute = () => { | |||||||
|     ) |     ) | ||||||
|   } else { |   } else { | ||||||
|     // 新建属性字段 |     // 新建属性字段 | ||||||
|     const newPropertyObject = window.bpmnInstances.moddle.create(`${prefix.value}:Property`, { |     const newPropertyObject = window.bpmnInstances.moddle.create(`${prefix}:Property`, { | ||||||
|       name, |       name, | ||||||
|       value |       value | ||||||
|     }) |     }) | ||||||
|     // 新建一个属性字段的保存列表 |     // 新建一个属性字段的保存列表 | ||||||
|     const propertiesObject = window.bpmnInstances.moddle.create(`${prefix.value}:Properties`, { |     const propertiesObject = window.bpmnInstances.moddle.create(`${prefix}:Properties`, { | ||||||
|       values: bpmnElementPropertyList.value.concat([newPropertyObject]) |       values: bpmnElementPropertyList.value.concat([newPropertyObject]) | ||||||
|     }) |     }) | ||||||
|     updateElementExtensions(propertiesObject) |     updateElementExtensions(propertiesObject) | ||||||
|   | |||||||
| @@ -1,16 +1,16 @@ | |||||||
| // 创建监听器实例
 | // 创建监听器实例
 | ||||||
| export function createListenerObject (options, isTask, prefix) { | export function createListenerObject(options, isTask, prefix) { | ||||||
|   const listenerObj = Object.create(null) |   const listenerObj = Object.create(null) | ||||||
|   listenerObj.event = options.event |   listenerObj.event = options.event | ||||||
|   isTask && (listenerObj.id = options.id) // 任务监听器特有的 id 字段
 |   isTask && (listenerObj.id = options.id) // 任务监听器特有的 id 字段
 | ||||||
|   switch (options.listenerType) { |   switch (options.listenerType) { | ||||||
|     case "scriptListener": |     case 'scriptListener': | ||||||
|       listenerObj.script = createScriptObject(options, prefix) |       listenerObj.script = createScriptObject(options, prefix) | ||||||
|       break |       break | ||||||
|     case "expressionListener": |     case 'expressionListener': | ||||||
|       listenerObj.expression = options.expression |       listenerObj.expression = options.expression | ||||||
|       break |       break | ||||||
|     case "delegateExpressionListener": |     case 'delegateExpressionListener': | ||||||
|       listenerObj.delegateExpression = options.delegateExpression |       listenerObj.delegateExpression = options.delegateExpression | ||||||
|       break |       break | ||||||
|     default: |     default: | ||||||
| @@ -18,54 +18,59 @@ export function createListenerObject (options, isTask, prefix) { | |||||||
|   } |   } | ||||||
|   // 注入字段
 |   // 注入字段
 | ||||||
|   if (options.fields) { |   if (options.fields) { | ||||||
|     listenerObj.fields = options.fields.map(field => { |     listenerObj.fields = options.fields.map((field) => { | ||||||
|       return createFieldObject(field, prefix) |       return createFieldObject(field, prefix) | ||||||
|     }) |     }) | ||||||
|   } |   } | ||||||
|   // 任务监听器的 定时器 设置
 |   // 任务监听器的 定时器 设置
 | ||||||
|   if (isTask && options.event === "timeout" && !!options.eventDefinitionType) { |   if (isTask && options.event === 'timeout' && !!options.eventDefinitionType) { | ||||||
|     const timeDefinition = window.bpmnInstances.moddle.create("bpmn:FormalExpression", { body: options.eventTimeDefinitions }) |     const timeDefinition = window.bpmnInstances.moddle.create('bpmn:FormalExpression', { | ||||||
|     const TimerEventDefinition = window.bpmnInstances.moddle.create("bpmn:TimerEventDefinition", { |       body: options.eventTimeDefinitions | ||||||
|  |     }) | ||||||
|  |     const TimerEventDefinition = window.bpmnInstances.moddle.create('bpmn:TimerEventDefinition', { | ||||||
|       id: `TimerEventDefinition_${uuid(8)}`, |       id: `TimerEventDefinition_${uuid(8)}`, | ||||||
|       [`time${options.eventDefinitionType.replace(/^\S/, s => s.toUpperCase())}`]: timeDefinition |       [`time${options.eventDefinitionType.replace(/^\S/, (s) => s.toUpperCase())}`]: timeDefinition | ||||||
|     }) |     }) | ||||||
|     listenerObj.eventDefinitions = [TimerEventDefinition] |     listenerObj.eventDefinitions = [TimerEventDefinition] | ||||||
|   } |   } | ||||||
|   return window.bpmnInstances.moddle.create(`${prefix}:${isTask ? "TaskListener" : "ExecutionListener"}`, listenerObj) |   return window.bpmnInstances.moddle.create( | ||||||
|  |     `${prefix}:${isTask ? 'TaskListener' : 'ExecutionListener'}`, | ||||||
|  |     listenerObj | ||||||
|  |   ) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // 创建 监听器的注入字段 实例
 | // 创建 监听器的注入字段 实例
 | ||||||
| export function createFieldObject (option, prefix) { | export function createFieldObject(option, prefix) { | ||||||
|   const { name, fieldType, string, expression } = option |   const { name, fieldType, string, expression } = option | ||||||
|   const fieldConfig = fieldType === "string" ? { name, string } : { name, expression } |   const fieldConfig = fieldType === 'string' ? { name, string } : { name, expression } | ||||||
|   return window.bpmnInstances.moddle.create(`${prefix}:Field`, fieldConfig) |   return window.bpmnInstances.moddle.create(`${prefix}:Field`, fieldConfig) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // 创建脚本实例
 | // 创建脚本实例
 | ||||||
| export function createScriptObject (options, prefix) { | export function createScriptObject(options, prefix) { | ||||||
|   const { scriptType, scriptFormat, value, resource } = options |   const { scriptType, scriptFormat, value, resource } = options | ||||||
|   const scriptConfig = scriptType === "inlineScript" ? { scriptFormat, value } : { scriptFormat, resource } |   const scriptConfig = | ||||||
|  |     scriptType === 'inlineScript' ? { scriptFormat, value } : { scriptFormat, resource } | ||||||
|   return window.bpmnInstances.moddle.create(`${prefix}:Script`, scriptConfig) |   return window.bpmnInstances.moddle.create(`${prefix}:Script`, scriptConfig) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // 更新元素扩展属性
 | // 更新元素扩展属性
 | ||||||
| export function updateElementExtensions (element, extensionList) { | export function updateElementExtensions(element, extensionList) { | ||||||
|   console.log(element, 'element') |   const extensions = window.bpmnInstances.moddle.create('bpmn:ExtensionElements', { | ||||||
|   console.log(extensionList, 'extensionList') |  | ||||||
|   const extensions = window.bpmnInstances.moddle.create("bpmn:ExtensionElements", { |  | ||||||
|     values: extensionList |     values: extensionList | ||||||
|   }) |   }) | ||||||
|   console.log(extensions, 'extensionsextensions') |   console.log(element, 'elementelementelementelement') | ||||||
|   console.log(window.bpmnInstances.modeling, 'window.bpmnInstances.modeling') |   console.log(extensions.values, 'extensionsextensionsextensions') | ||||||
|   window.bpmnInstances.modeling.updateProperties(element, { |   window.bpmnInstances.modeling.updateProperties(element, { | ||||||
|     extensionElements: extensions.values |     extensionElements: extensions.values | ||||||
|   }) |   }) | ||||||
|  |   console.log('ssss') | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // 创建一个id
 | // 创建一个id
 | ||||||
| export function uuid (length = 8, chars) { | export function uuid(length = 8, chars) { | ||||||
|   let result = "" |   let result = '' | ||||||
|   let charsString = chars || "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" |   const charsString = chars || '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' | ||||||
|   for (let i = length; i > 0; --i) { |   for (let i = length; i > 0; --i) { | ||||||
|     result += charsString[Math.floor(Math.random() * charsString.length)] |     result += charsString[Math.floor(Math.random() * charsString.length)] | ||||||
|   } |   } | ||||||
| @@ -46,10 +46,12 @@ declare module '@vue/runtime-core' { | |||||||
|     ElIcon: typeof import('element-plus/es')['ElIcon'] |     ElIcon: typeof import('element-plus/es')['ElIcon'] | ||||||
|     ElImageViewer: typeof import('element-plus/es')['ElImageViewer'] |     ElImageViewer: typeof import('element-plus/es')['ElImageViewer'] | ||||||
|     ElInput: typeof import('element-plus/es')['ElInput'] |     ElInput: typeof import('element-plus/es')['ElInput'] | ||||||
|  |     ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] | ||||||
|     ElLink: typeof import('element-plus/es')['ElLink'] |     ElLink: typeof import('element-plus/es')['ElLink'] | ||||||
|     ElOption: typeof import('element-plus/es')['ElOption'] |     ElOption: typeof import('element-plus/es')['ElOption'] | ||||||
|     ElPopover: typeof import('element-plus/es')['ElPopover'] |     ElPopover: typeof import('element-plus/es')['ElPopover'] | ||||||
|     ElRadio: typeof import('element-plus/es')['ElRadio'] |     ElRadio: typeof import('element-plus/es')['ElRadio'] | ||||||
|  |     ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] | ||||||
|     ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] |     ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] | ||||||
|     ElRow: typeof import('element-plus/es')['ElRow'] |     ElRow: typeof import('element-plus/es')['ElRow'] | ||||||
|     ElSelect: typeof import('element-plus/es')['ElSelect'] |     ElSelect: typeof import('element-plus/es')['ElSelect'] | ||||||
| @@ -60,6 +62,7 @@ declare module '@vue/runtime-core' { | |||||||
|     ElTabs: typeof import('element-plus/es')['ElTabs'] |     ElTabs: typeof import('element-plus/es')['ElTabs'] | ||||||
|     ElTag: typeof import('element-plus/es')['ElTag'] |     ElTag: typeof import('element-plus/es')['ElTag'] | ||||||
|     ElTooltip: typeof import('element-plus/es')['ElTooltip'] |     ElTooltip: typeof import('element-plus/es')['ElTooltip'] | ||||||
|  |     ElTree: typeof import('element-plus/es')['ElTree'] | ||||||
|     ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect'] |     ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect'] | ||||||
|     ElUpload: typeof import('element-plus/es')['ElUpload'] |     ElUpload: typeof import('element-plus/es')['ElUpload'] | ||||||
|     Error: typeof import('./../components/Error/src/Error.vue')['default'] |     Error: typeof import('./../components/Error/src/Error.vue')['default'] | ||||||
|   | |||||||
| @@ -27,7 +27,7 @@ | |||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { ref, onMounted } from 'vue' | import { ref, onMounted, onBeforeMount } from 'vue' | ||||||
| // import { translations } from '@/components/bpmnProcessDesigner/src/translations' | // import { translations } from '@/components/bpmnProcessDesigner/src/translations' | ||||||
| // 自定义元素选中时的弹出菜单(修改 默认任务 为 用户任务) | // 自定义元素选中时的弹出菜单(修改 默认任务 为 用户任务) | ||||||
| import CustomContentPadProvider from '@/components/bpmnProcessDesigner/package/designer/plugins/content-pad' | import CustomContentPadProvider from '@/components/bpmnProcessDesigner/package/designer/plugins/content-pad' | ||||||
| @@ -39,7 +39,7 @@ import CustomPaletteProvider from '@/components/bpmnProcessDesigner/package/desi | |||||||
| import { createModelApi, getModelApi, updateModelApi } from '@/api/bpm/model' | import { createModelApi, getModelApi, updateModelApi } from '@/api/bpm/model' | ||||||
|  |  | ||||||
| import { useRouter } from 'vue-router' | import { useRouter } from 'vue-router' | ||||||
| import { onBeforeMount } from 'vue' | import { ElMessage } from 'element-plus' | ||||||
| const router = useRouter() | const router = useRouter() | ||||||
|  |  | ||||||
| // 自定义侧边栏 | // 自定义侧边栏 | ||||||
| @@ -115,12 +115,15 @@ const save = (bpmnXml) => { | |||||||
|     ...model.value, |     ...model.value, | ||||||
|     bpmnXml: bpmnXml // this.bpmnXml 只是初始化流程图,后续修改无法通过它获得 |     bpmnXml: bpmnXml // this.bpmnXml 只是初始化流程图,后续修改无法通过它获得 | ||||||
|   } |   } | ||||||
|  |   console.log(data, 'data') | ||||||
|  |  | ||||||
|   // 修改的提交 |   // 修改的提交 | ||||||
|   if (data.id) { |   if (data.id) { | ||||||
|     updateModelApi(data).then((response) => { |     updateModelApi(data).then((response) => { | ||||||
|       console.log(response, 'response') |       console.log(response, 'response') | ||||||
|       // this.$modal.msgSuccess("修改成功") |       // this.$modal.msgSuccess("修改成功") | ||||||
|  |       ElMessage.success('修改成功') | ||||||
|  |  | ||||||
|       // 跳转回去 |       // 跳转回去 | ||||||
|       close() |       close() | ||||||
|     }) |     }) | ||||||
| @@ -130,6 +133,7 @@ const save = (bpmnXml) => { | |||||||
|   createModelApi(data).then((response) => { |   createModelApi(data).then((response) => { | ||||||
|     console.log(response, 'response1') |     console.log(response, 'response1') | ||||||
|     // this.$modal.msgSuccess("保存成功") |     // this.$modal.msgSuccess("保存成功") | ||||||
|  |     ElMessage.success('保存成功') | ||||||
|     // 跳转回去 |     // 跳转回去 | ||||||
|     close() |     close() | ||||||
|   }) |   }) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 gexinzhineng/gxzn27
					gexinzhineng/gxzn27