diff --git a/ruoyi-ui/src/components/ProcessDesigner/index.vue b/ruoyi-ui/src/components/ProcessDesigner/index.vue index 7a5242d9..3d5c680f 100644 --- a/ruoyi-ui/src/components/ProcessDesigner/index.vue +++ b/ruoyi-ui/src/components/ProcessDesigner/index.vue @@ -56,6 +56,7 @@ export default { controlForm: { processId: this.designerForm.processKey || '', processName: this.designerForm.processName || '', + namespace: this.designerForm.category || '', simulation: false, labelEditing: false, labelVisible: false, diff --git a/ruoyi-ui/src/plugins/package/designer/ProcessDesigner.vue b/ruoyi-ui/src/plugins/package/designer/ProcessDesigner.vue index 31309bd9..b23c9ccc 100644 --- a/ruoyi-ui/src/plugins/package/designer/ProcessDesigner.vue +++ b/ruoyi-ui/src/plugins/package/designer/ProcessDesigner.vue @@ -116,6 +116,7 @@ export default { value: String, // xml 字符串 processId: String, processName: String, + namespace: String, translations: Object, // 自定义的翻译文件 additionalModel: [Object, Array], // 自定义model moddleExtension: Object, // 自定义moddle @@ -307,7 +308,7 @@ export default { // 将字符串转换成图显示出来 let newId = this.processId || `Process_${new Date().getTime()}`; let newName = this.processName || `业务流程_${new Date().getTime()}`; - let xmlString = xml || DefaultEmptyXML(newId, newName, this.prefix); + let xmlString = xml || DefaultEmptyXML(newId, newName, this.namespace); try { let { warnings } = await this.bpmnModeler.importXML(xmlString); if (warnings && warnings.length) { diff --git a/ruoyi-ui/src/plugins/package/designer/plugins/defaultEmpty.js b/ruoyi-ui/src/plugins/package/designer/plugins/defaultEmpty.js index 9ec1df12..c9e5f40e 100644 --- a/ruoyi-ui/src/plugins/package/designer/plugins/defaultEmpty.js +++ b/ruoyi-ui/src/plugins/package/designer/plugins/defaultEmpty.js @@ -1,5 +1,5 @@ -export default (key, name, type) => { - if (!type) type = "camunda"; +export default (key, name, namespace) => { + if (!namespace) namespace = TYPE_TARGET['flowable']; const TYPE_TARGET = { activiti: "http://activiti.org/bpmn", camunda: "http://bpmn.io/schema/bpmn", @@ -7,7 +7,7 @@ export default (key, name, type) => { }; return ` - { xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" id="diagram_${key}" - targetNamespace="${TYPE_TARGET[type]}"> + targetNamespace="${namespace}"> diff --git a/ruoyi-ui/src/views/workflow/model/index.vue b/ruoyi-ui/src/views/workflow/model/index.vue index a7cdad6b..933b9071 100644 --- a/ruoyi-ui/src/views/workflow/model/index.vue +++ b/ruoyi-ui/src/views/workflow/model/index.vue @@ -340,7 +340,8 @@ export default { modelId: null, form: { processName: null, - processKey: null + processKey: null, + namespace: null } }, designerModelId: null, @@ -541,7 +542,8 @@ export default { this.designerData.modelId = row.modelId; this.designerData.form = { processName: row.modelName, - processKey: row.modelKey + processKey: row.modelKey, + category: row.category } if (row.modelId) { this.designerData.loading = true;