From 1d0ae62757d9f88cb589166695a8ba6e701c0a98 Mon Sep 17 00:00:00 2001 From: pixel <303176530@qq.com> Date: Tue, 27 Oct 2020 18:59:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=E5=BD=95=E5=85=A5?= =?UTF-8?q?=20=E6=A0=B9=E6=8D=AEid=E6=9F=A5=E8=AF=A2=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/model/wf_process.go | 11 +- server/service/wk_process.go | 2 +- web/src/api/workflow.js | 15 -- .../components/DetailPanel/DefaultDetail.vue | 1 + .../components/DetailPanel/ProcessDetail.vue | 18 +- web/src/components/gva-wfd/components/Wfd.vue | 19 +- web/src/components/gva-wfd/locales/zh-CN.js | 150 +++++------ .../workflowCreate/workflowCreate.vue | 243 +++++------------- .../workflowProcess/workflowProcess.vue | 11 +- 9 files changed, 172 insertions(+), 298 deletions(-) delete mode 100644 web/src/api/workflow.js diff --git a/server/model/wf_process.go b/server/model/wf_process.go index 9d1e9485..f3906250 100644 --- a/server/model/wf_process.go +++ b/server/model/wf_process.go @@ -1,7 +1,7 @@ package model type WorkflowProcess struct { - ID string `json:"id" gorm:"comment:流程标识;primaryKey"` + ID string `json:"id" form:"id" gorm:"comment:流程标识;primaryKey"` Name string `json:"name" gorm:"comment:流程名称"` Category string `json:"category" gorm:"comment:分类"` Clazz string `json:"clazz" gorm:"comment:类型"` @@ -9,11 +9,11 @@ type WorkflowProcess struct { HideIcon bool `json:"hideIcon" gorm:"comment:是否隐藏图标"` Description string `json:"description" gorm:"comment:详细介绍"` Nodes []WorkflowNode `json:"nodes"` // 流程节点数据 - Edges []WorkflowEdge `json:"edges"` // 流程链接数据 + } type WorkflowNode struct { - ID string `json:"id" gorm:"comment:节点id;primaryKey"` + ID string `json:"id" form:"id" gorm:"comment:节点id;primaryKey"` WorkflowProcessID string `json:"-" gorm:"comment:流程标识"` Clazz string `json:"clazz" gorm:"comment:节点类型"` Label string `json:"label" gorm:"comment:节点名称"` @@ -30,11 +30,12 @@ type WorkflowNode struct { Cycle string `json:"cycle" gorm:"comment:循环时间"` Duration string `json:"duration" gorm:"comment:持续时间"` HideIcon bool `json:"hideIcon" gorm:"comment:是否隐藏图标"` + Edges []WorkflowEdge `json:"edges"` // 流程链接数据 } type WorkflowEdge struct { - ID string `json:"id" gorm:"comment:唯一标识;primaryKey"` - WorkflowProcessID string `json:"-" gorm:"comment:流程标识"` + ID string `json:"id" form:"id" gorm:"comment:唯一标识;primaryKey"` + WorkflowNodeID string `json:"-" gorm:"comment:节点标识"` Clazz string `json:"clazz" gorm:"comment:类型(线)"` Source string `json:"source" gorm:"comment:起点节点"` Target string `json:"target" gorm:"comment:目标节点"` diff --git a/server/service/wk_process.go b/server/service/wk_process.go index 11d2a7dd..538a4758 100644 --- a/server/service/wk_process.go +++ b/server/service/wk_process.go @@ -58,7 +58,7 @@ func UpdateWorkflowProcess(workflowProcess *model.WorkflowProcess) (err error) { // @return WorkflowProcess WorkflowProcess func GetWorkflowProcess(id string) (err error, workflowProcess model.WorkflowProcess) { - err = global.GVA_DB.Where("id = ?", id).First(&workflowProcess).Error + err = global.GVA_DB.Preload("Nodes").Preload("Nodes.Edges").Where("id = ?", id).First(&workflowProcess).Error return } diff --git a/web/src/api/workflow.js b/web/src/api/workflow.js deleted file mode 100644 index 0522dfea..00000000 --- a/web/src/api/workflow.js +++ /dev/null @@ -1,15 +0,0 @@ -import service from '@/utils/request' -// @Summary 删除角色 -// @Security ApiKeyAuth -// @accept application/json -// @Produce application/json -// @Param data body {authorityId uint} true "删除角色" -// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" -// @Router /authority/deleteAuthority [post] -export const createWorkFlow = (data) => { - return service({ - url: "/workflow/createWorkFlow", - method: 'post', - data - }) -} \ No newline at end of file diff --git a/web/src/components/gva-wfd/components/DetailPanel/DefaultDetail.vue b/web/src/components/gva-wfd/components/DetailPanel/DefaultDetail.vue index 871fd12a..e1403f76 100644 --- a/web/src/components/gva-wfd/components/DetailPanel/DefaultDetail.vue +++ b/web/src/components/gva-wfd/components/DetailPanel/DefaultDetail.vue @@ -5,6 +5,7 @@
diff --git a/web/src/components/gva-wfd/components/DetailPanel/ProcessDetail.vue b/web/src/components/gva-wfd/components/DetailPanel/ProcessDetail.vue index d01486dd..7110f0de 100644 --- a/web/src/components/gva-wfd/components/DetailPanel/ProcessDetail.vue +++ b/web/src/components/gva-wfd/components/DetailPanel/ProcessDetail.vue @@ -2,6 +2,14 @@
{{i18n['process']}}
+
+
{{i18n['process.id']}}:
+ +
{{i18n['process.category']}}:
@@ -15,17 +23,12 @@
-
-
{{i18n['process.id']}}:
- -
+
{{i18n['process.name']}}:
@@ -34,6 +37,7 @@
diff --git a/web/src/components/gva-wfd/components/Wfd.vue b/web/src/components/gva-wfd/components/Wfd.vue index 315c686b..f8d8fadf 100644 --- a/web/src/components/gva-wfd/components/Wfd.vue +++ b/web/src/components/gva-wfd/components/Wfd.vue @@ -83,13 +83,10 @@ categorys: { type: Array, default: () => ([]) - } - }, - data() { - return { - resizeFunc: ()=>{}, - selectedModel: {}, - processModel: { + }, + processModel:{ + type: Object, + default: () => ({ id: '', name: '', category: '', @@ -97,7 +94,13 @@ dataObjs: [], signalDefs: [], messageDefs: [], - }, + }) + } + }, + data() { + return { + resizeFunc: ()=>{}, + selectedModel: {}, graph:null, cmdPlugin: null, }; diff --git a/web/src/components/gva-wfd/locales/zh-CN.js b/web/src/components/gva-wfd/locales/zh-CN.js index 0dec5fc7..69753b78 100644 --- a/web/src/components/gva-wfd/locales/zh-CN.js +++ b/web/src/components/gva-wfd/locales/zh-CN.js @@ -1,76 +1,76 @@ export default { - 'label': '标题', - 'hideIcon': '隐藏图标', - 'userTask': '审批节点', - 'userTask.assignType': '指派类型', - 'userTask.assignType.placeholder': '选择一个类型', - 'userTask.assignType.assignee': '受理人', - 'userTask.assignType.assignee.title': '受理人', - 'userTask.assignType.assignee.placeholder': '选择受理人', - 'userTask.assignType.person': '候选人', - 'userTask.assignType.person.title': '候选人', - 'userTask.assignType.person.placeholder': '选择候选人', - 'userTask.assignType.persongroup': '候选组', - 'userTask.assignType.persongroup.title': '候选组', - 'userTask.assignType.persongroup.placeholder': '选择候选组', - 'userTask.dueDate': '到期时间', - 'userTask.dueDate.placeholder': '请选择日期', - 'userTask.counterSign': '会签', - 'scriptTask': '脚本节点', - 'scriptTask.script': '脚本', - 'javaTask': '自定义类节点', - 'javaTask.javaClass': '类名', - 'mailTask': '邮件节点', - 'mailTask.to': '收件人', - 'mailTask.subject': '标题', - 'mailTask.content': '内容', - 'receiveTask': '接收节点', - 'receiveTask.waitState': '等待属性', - 'receiveTask.stateValue': '等待值', - 'timerEvent': '定时节点', - 'timerEvent.cycle': '循环时间', - 'timerEvent.cycle.placeholder': '请选择时间', - 'timerEvent.duration': '持续时间', - 'messageEvent': '消息节点', - 'messageEvent.message': '消息名', - 'signalEvent': '信号节点', - 'signalEvent.signal': '信号名', - 'sequenceFlow': '连接线', - 'sequenceFlow.expression': '条件表达式', - 'sequenceFlow.seq': '序号', - 'sequenceFlow.reverse': '反向', - 'startEvent': '开始节点', - 'endEvent': '结束节点', - 'start': '开始事件', - 'end': '结束事件', - 'gateway': '网关', - 'exclusiveGateway': '排他网关', - 'parallelGateway': '并行网关', - 'inclusiveGateway': '包容网关', - 'task': '活动', - 'catch': '捕获事件', - 'tooltip.undo': '撤销', - 'tooltip.redo': '重复', - 'tooltip.copy': '复制', - 'tooltip.paste': '粘贴', - 'tooltip.delete': '删除', - 'tooltip.zoomIn': '放大', - 'tooltip.zoomOut': '缩小', - 'tooltip.zoomReset': '实际大小', - 'tooltip.autoFit': '适应屏幕', - 'tooltip.toFront': '移到上一层', - 'tooltip.toBack': '移到下一层', - 'tooltip.edit': '编辑', - 'process': '流程', - 'process.category': '分类', - 'process.id': '流程标识', - 'process.name': '流程名称', - 'process.dataObjs': '数据对象', - 'process.signalDefs': '信号定义', - 'process.messageDefs': '消息定义', - 'process.dataObjs.id': 'Id', - 'process.dataObjs.name': '名称', - 'process.dataObjs.type': '类型', - 'process.dataObjs.defaultValue': '默认值', - 'process.signalDef.scope': '作用域', -}; + 'label': '标题', + 'hideIcon': '隐藏图标', + 'userTask': '审批节点', + 'userTask.assignType': '指派类型', + 'userTask.assignType.placeholder': '选择一个类型', + 'userTask.assignType.assignee': '受理人', + 'userTask.assignType.assignee.title': '受理人', + 'userTask.assignType.assignee.placeholder': '选择受理人', + 'userTask.assignType.person': '候选人', + 'userTask.assignType.person.title': '候选人', + 'userTask.assignType.person.placeholder': '选择候选人', + 'userTask.assignType.persongroup': '候选组', + 'userTask.assignType.persongroup.title': '候选组', + 'userTask.assignType.persongroup.placeholder': '选择候选组', + 'userTask.dueDate': '到期时间', + 'userTask.dueDate.placeholder': '请选择日期', + 'userTask.counterSign': '会签', + 'scriptTask': '脚本节点', + 'scriptTask.script': '脚本', + 'javaTask': '自定义类节点', + 'javaTask.javaClass': '类名', + 'mailTask': '邮件节点', + 'mailTask.to': '收件人', + 'mailTask.subject': '标题', + 'mailTask.content': '内容', + 'receiveTask': '接收节点', + 'receiveTask.waitState': '等待属性', + 'receiveTask.stateValue': '等待值', + 'timerEvent': '定时节点', + 'timerEvent.cycle': '循环时间', + 'timerEvent.cycle.placeholder': '请选择时间', + 'timerEvent.duration': '持续时间', + 'messageEvent': '消息节点', + 'messageEvent.message': '消息名', + 'signalEvent': '信号节点', + 'signalEvent.signal': '信号名', + 'sequenceFlow': '连接线', + 'sequenceFlow.expression': '条件表达式', + 'sequenceFlow.seq': '序号', + 'sequenceFlow.reverse': '反向', + 'startEvent': '开始节点', + 'endEvent': '结束节点', + 'start': '开始事件', + 'end': '结束事件', + 'gateway': '网关', + 'exclusiveGateway': '排他网关', + 'parallelGateway': '并行网关', + 'inclusiveGateway': '包容网关', + 'task': '活动', + 'catch': '捕获事件', + 'tooltip.undo': '撤销', + 'tooltip.redo': '重复', + 'tooltip.copy': '复制', + 'tooltip.paste': '粘贴', + 'tooltip.delete': '删除', + 'tooltip.zoomIn': '放大', + 'tooltip.zoomOut': '缩小', + 'tooltip.zoomReset': '实际大小', + 'tooltip.autoFit': '适应屏幕', + 'tooltip.toFront': '移到上一层', + 'tooltip.toBack': '移到下一层', + 'tooltip.edit': '编辑', + 'process': '流程', + 'process.category': '分类', + 'process.id': '流程标识(id)', + 'process.name': '流程名称', + 'process.dataObjs': '数据对象', + 'process.signalDefs': '信号定义', + 'process.messageDefs': '消息定义', + 'process.dataObjs.id': 'Id', + 'process.dataObjs.name': '名称', + 'process.dataObjs.type': '类型', + 'process.dataObjs.defaultValue': '默认值', + 'process.signalDef.scope': '作用域', +}; \ No newline at end of file diff --git a/web/src/view/workflow/workflowCreate/workflowCreate.vue b/web/src/view/workflow/workflowCreate/workflowCreate.vue index 13397f25..176f151e 100644 --- a/web/src/view/workflow/workflowCreate/workflowCreate.vue +++ b/web/src/view/workflow/workflowCreate/workflowCreate.vue @@ -22,22 +22,26 @@