@@ -249,10 +249,15 @@ export default {
},
methods: {
onSave () {
- if (this.bpmnModeler == null) return;
- this.bpmnModeler.saveXML({ format: true }).then(({ xml }) => {
- this.$emit('save', xml);
- });
+ return new Promise((resolve, reject) => {
+ if (this.bpmnModeler == null) {
+ reject();
+ }
+ this.bpmnModeler.saveXML({ format: true }).then(({ xml }) => {
+ this.$emit('save', xml);
+ resolve(xml);
+ });
+ })
},
initBpmnModeler() {
if (this.bpmnModeler) return;
diff --git a/ruoyi-ui/src/plugins/package/theme/process-designer.scss b/ruoyi-ui/src/plugins/package/theme/process-designer.scss
index a3b3d098..f25e98d9 100644
--- a/ruoyi-ui/src/plugins/package/theme/process-designer.scss
+++ b/ruoyi-ui/src/plugins/package/theme/process-designer.scss
@@ -6,6 +6,7 @@
}
.my-process-designer {
+ padding: 5px 0 10px 10px;
display: flex;
flex-direction: column;
width: 100%;
diff --git a/ruoyi-ui/src/views/workflow/definition/designer.vue b/ruoyi-ui/src/views/workflow/definition/designer.vue
index e0dbdc49..780f000d 100644
--- a/ruoyi-ui/src/views/workflow/definition/designer.vue
+++ b/ruoyi-ui/src/views/workflow/definition/designer.vue
@@ -1,46 +1,149 @@
-
-
+
+
+
+
+
+
+ 关闭
+ 上一步
+
+
+
+
+
+
+
+
+
+
+
+ 下一步
+ 保存
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 关闭
+
+
+
+
+
+
+
+
+
diff --git a/ruoyi-ui/src/views/workflow/definition/index.vue b/ruoyi-ui/src/views/workflow/definition/index.vue
index c254b4d6..27b3b412 100644
--- a/ruoyi-ui/src/views/workflow/definition/index.vue
+++ b/ruoyi-ui/src/views/workflow/definition/index.vue
@@ -106,9 +106,9 @@
type="text"
size="mini"
icon="el-icon-edit"
- @click="handleUpdate(scope.row)"
+ @click="handleDesigner(scope.row)"
v-hasPermi="['workflow:definition:designer']"
- >编辑
+ >设计
删除
-
- 更多
-
+
+ 更多
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -311,6 +290,9 @@
+
+
+
@@ -320,16 +302,19 @@ import { getForm, addDeployForm ,listForm } from "@/api/workflow/form";
import { listCategory } from '@/api/workflow/category'
import Parser from '@/utils/generator/parser'
import ProcessViewer from '@/components/ProcessViewer'
+import Designer from './designer'
import { getToken } from "@/utils/auth";
export default {
name: "Definition",
components: {
Parser,
- ProcessViewer
+ ProcessViewer,
+ Designer
},
data() {
return {
+ isDesignerShow: false,
// 遮罩层
loading: true,
// 选中数组
@@ -345,11 +330,7 @@ export default {
// 流程定义表格数据
definitionList: [],
categoryOptions: [],
- process: {
- title: '',
- open: false,
- form: {}
- },
+ processForm: {},
publish: {
open: false,
loading: false,
@@ -478,19 +459,6 @@ export default {
this.single = selection.length !== 1
this.multiple = !selection.length
},
- /** 跳转到流程设计页面 */
- handleLoadXml(row) {
- this.process.open = false;
- this.$router.push({
- path: '/definition/designer',
- query: {
- definitionId: row.definitionId,
- processId: row.processKey,
- processName: row.processName,
- category: row.category
- }
- })
- },
handlePublish(row) {
this.publishQueryParams.processKey = row.processKey;
this.publish.open = true;
@@ -575,18 +543,16 @@ export default {
},
handleAdd() {
const dateTime = new Date().getTime();
- this.process.title = '新增流程';
- this.process.form = {
+ this.processForm = {
processKey: `Process_${dateTime}`,
processName: `业务流程_${dateTime}`
- };
- this.process.open = true;
+ }
+ this.isDesignerShow = true;
},
- /** 修改按钮操作 */
- handleUpdate(row) {
- this.process.title = '编辑流程';
- this.process.form = JSON.parse(JSON.stringify(row));
- this.process.open = true;
+ /** 设计按钮操作 */
+ handleDesigner(row) {
+ this.processForm = JSON.parse(JSON.stringify(row));
+ this.isDesignerShow = true;
},
/** 删除按钮操作 */
handleDelete(row) {
@@ -641,6 +607,9 @@ export default {
},
categoryFormat(row, column) {
return this.categoryOptions.find(k => k.code === row.category)?.categoryName ?? '';
+ },
+ submitSave() {
+ this.getList();
}
}
};