From 6b87bab5147ef5bd0dac286d0a83ef6b545272bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=87=E6=B7=BC=EF=BC=88piexlmax?= <303176530@qq.com> Date: Fri, 23 Oct 2020 21:14:19 +0800 Subject: [PATCH 01/13] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b75d9975..dc442739 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,8 @@ [English](./README-en.md) | 简体中文 -[国内仓库地址](https://gitee.com/FLIPPED-AURORA/gin-vue-admin) +[gitee地址](https://gitee.com/pixelmax/gin-vue-admin) +[github地址](https://github.com/flipped-aurora/gin-vue-admin) # 项目文档 [在线文档](https://www.gin-vue-admin.com/) : https://www.gin-vue-admin.com/ From 957b72a3f4b9a9617450d81d697cbfcf120f1830 Mon Sep 17 00:00:00 2001 From: QM303176530 <303176530@qq.com> Date: Sun, 25 Oct 2020 10:36:23 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=8F=91=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/core/server.go | 2 +- server/middleware/{casbin_rcba.go => casbin_rbac.go} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename server/middleware/{casbin_rcba.go => casbin_rbac.go} (100%) diff --git a/server/core/server.go b/server/core/server.go index 92db53c7..49f2ecb3 100644 --- a/server/core/server.go +++ b/server/core/server.go @@ -29,7 +29,7 @@ func RunWindowsServer() { fmt.Printf(` 欢迎使用 Gin-Vue-Admin - 当前版本:V2.3.3 + 当前版本:V2.3.4 默认自动化文档地址:http://127.0.0.1%s/swagger/index.html 默认前端文件运行地址:http://127.0.0.1:8080 `, address) diff --git a/server/middleware/casbin_rcba.go b/server/middleware/casbin_rbac.go similarity index 100% rename from server/middleware/casbin_rcba.go rename to server/middleware/casbin_rbac.go From bef9b485a153196cce0df6a7b0998efa196a0ca4 Mon Sep 17 00:00:00 2001 From: QM303176530 <303176530@qq.com> Date: Sun, 25 Oct 2020 10:42:34 +0800 Subject: [PATCH 03/13] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/main.js b/web/src/main.js index fd5b1f81..872812d2 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -66,7 +66,7 @@ Vue.prototype.$echarts = echarts; console.log(` 欢迎使用 Gin-Vue-Admin - 当前版本:V2.3.3 + 当前版本:V2.3.4 默认自动化文档地址:http://127.0.0.1%s/swagger/index.html 默认前端文件运行地址:http://127.0.0.1:8080 `) \ No newline at end of file From ff85562fc10545f63aee5786c48e3b2a2a8223da Mon Sep 17 00:00:00 2001 From: SliverHorn Date: Sun, 25 Oct 2020 11:37:15 +0800 Subject: [PATCH 04/13] add Makefile help information --- server/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/Makefile b/server/Makefile index 60084d94..cf096921 100644 --- a/server/Makefile +++ b/server/Makefile @@ -32,7 +32,9 @@ clean: @if [ -f ${GVA} ] ; then rm ${GVA} ; fi help: - @echo "make - 生成gva终端工具,初始化数据后删除gva终端工具" + @echo "make - 构建gva终端工具并初始化数据,初始化数据后删除gva终端工具,启动server项目" + @echo "make gva - 构建gva终端工具" + @echo "make initdb - 如果有gva终端工具就初始化数据,初始化数据后删除gva终端工具,没有则不会执行" @echo "make linux-build - 编译 Go 代码, 生成Linux系统的二进制文件" @echo "make windows-build - 编译 Go 代码, 生成Windows系统的exe文件" @echo "make mac-build - 编译 Go 代码, 生成Mac系统的二进制文件" From dbd45ab141228a8c2226af70511a2f101c2e55dd Mon Sep 17 00:00:00 2001 From: pixel <303176530@qq.com> Date: Mon, 26 Oct 2020 11:19:04 +0800 Subject: [PATCH 05/13] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/go.mod | 2 +- web/src/view/workflow/workflowCreate/workflowCreate.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/go.mod b/server/go.mod index c204e65f..8bc45360 100644 --- a/server/go.mod +++ b/server/go.mod @@ -54,5 +54,5 @@ require ( gopkg.in/ini.v1 v1.55.0 // indirect gopkg.in/yaml.v2 v2.3.0 // indirect gorm.io/driver/mysql v0.3.0 - gorm.io/gorm v1.20.1 + gorm.io/gorm v1.20.5 ) diff --git a/web/src/view/workflow/workflowCreate/workflowCreate.vue b/web/src/view/workflow/workflowCreate/workflowCreate.vue index c8e6d85f..5477525c 100644 --- a/web/src/view/workflow/workflowCreate/workflowCreate.vue +++ b/web/src/view/workflow/workflowCreate/workflowCreate.vue @@ -20,7 +20,7 @@ export default { data () { return { lang: "zh", - demoData: {}, + demoData: {"nodes":[{"clazz":"start","size":[55,55],"label":"发起请假","type":"start-node","shape":"start-node","x":110,"y":195,"id":"start1603681292875","style":{}},{"clazz":"parallelGateway","size":[55,55],"label":"会签","type":"parallel-gateway-node","shape":"parallel-gateway-node","x":228,"y":195,"id":"parallelGateway1603681296419","style":{}},{"clazz":"userTask","size":[100,55],"label":"审批人1","type":"user-task-node","shape":"user-task-node","x":372,"y":84,"id":"userTask1603681299962","style":{},"assignValue":1,"assignType":"user"},{"clazz":"userTask","size":[100,55],"label":"审批人2","type":"user-task-node","shape":"user-task-node","x":370,"y":321,"id":"userTask1603681302372","style":{},"assignValue":2,"assignType":"user"},{"clazz":"parallelGateway","size":[55,55],"label":"会签结果检测","type":"parallel-gateway-node","shape":"parallel-gateway-node","x":519,"y":195,"id":"parallelGateway1603681338222","style":{}},{"clazz":"end","size":[55,55],"label":"请假失败","type":"end-node","shape":"end-node","x":704,"y":317,"id":"end1603681358043","style":{}},{"clazz":"end","size":[55,55],"label":"请假成功","type":"end-node","shape":"end-node","x":706.5,"y":55.5,"id":"end1603681360882","style":{}}],"edges":[{"id":"flow1603681320738","clazz":"flow","source":"parallelGateway1603681296419","target":"userTask1603681299962","sourceAnchor":0,"targetAnchor":3,"shape":"flow-polyline-round","style":{},"startPoint":{"x":228,"y":169,"index":0},"endPoint":{"x":321.5,"y":84,"index":3}},{"id":"flow1603681321969","clazz":"flow","source":"parallelGateway1603681296419","target":"userTask1603681302372","sourceAnchor":2,"targetAnchor":3,"shape":"flow-polyline-round","style":{},"startPoint":{"x":228,"y":221,"index":2},"endPoint":{"x":319.5,"y":321,"index":3}},{"id":"flow1603681323274","clazz":"flow","source":"start1603681292875","target":"parallelGateway1603681296419","sourceAnchor":1,"targetAnchor":3,"shape":"flow-polyline-round","style":{},"startPoint":{"x":138,"y":195,"index":1},"endPoint":{"x":202,"y":195,"index":3},"label":"发起","conditionExpression":"complete"},{"id":"flow1603681341777","clazz":"flow","source":"userTask1603681299962","target":"parallelGateway1603681338222","sourceAnchor":1,"targetAnchor":3,"shape":"flow-polyline-round","style":{},"startPoint":{"x":422.5,"y":84,"index":1},"endPoint":{"x":493,"y":195,"index":3}},{"id":"flow1603681343425","clazz":"flow","source":"userTask1603681302372","target":"parallelGateway1603681338222","sourceAnchor":1,"targetAnchor":3,"shape":"flow-polyline-round","style":{},"startPoint":{"x":420.5,"y":321,"index":1},"endPoint":{"x":493,"y":195,"index":3}},{"id":"flow1603681362913","clazz":"flow","source":"parallelGateway1603681338222","target":"end1603681360882","sourceAnchor":0,"targetAnchor":2,"shape":"flow-polyline-round","style":{},"startPoint":{"x":519,"y":169,"index":0},"endPoint":{"x":678.5,"y":55.5,"index":2},"conditionExpression":"complete","label":"所有人同意"},{"id":"flow1603681392729","clazz":"flow","source":"parallelGateway1603681338222","target":"end1603681358043","sourceAnchor":2,"targetAnchor":2,"shape":"flow-polyline-round","style":{},"startPoint":{"x":519,"y":221,"index":2},"endPoint":{"x":676,"y":317,"index":2},"conditionExpression":"reject","label":"任何一人拒绝"}],"combos":[],"groups":[]}, users: [], authorities:[], groups: [{id:'1',name:'组1'},{id:'2',name:'组2'},{id:'3',name:'组3'}], @@ -29,7 +29,7 @@ export default { }, methods:{ save(){ - console.log(this.$refs['wfd'].graph.save()) + console.log(JSON.stringify(this.$refs['wfd'].graph.save())) }, saveXML(){ console.log(this.$refs['wfd'].graph.saveXML()) From d27cee194d562ff90bd22a437df288c391d72539 Mon Sep 17 00:00:00 2001 From: pixel <303176530@qq.com> Date: Mon, 26 Oct 2020 11:22:40 +0800 Subject: [PATCH 06/13] =?UTF-8?q?gorm=20=E7=89=88=E6=9C=AC=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E4=B8=BA=201.20.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/go.mod | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/server/go.mod b/server/go.mod index a9ecdc2f..8bc45360 100644 --- a/server/go.mod +++ b/server/go.mod @@ -5,7 +5,6 @@ go 1.12 require ( github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 - github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6 // indirect github.com/casbin/casbin v1.9.1 github.com/casbin/casbin/v2 v2.11.0 github.com/casbin/gorm-adapter/v3 v3.0.2 @@ -47,7 +46,6 @@ require ( github.com/swaggo/swag v1.6.7 github.com/tebeka/strftime v0.1.3 // indirect github.com/unrolled/secure v1.0.7 - github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77 // indirect go.uber.org/zap v1.10.0 golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e // indirect golang.org/x/sys v0.0.0-20200610111108-226ff32320da // indirect @@ -56,7 +54,5 @@ require ( gopkg.in/ini.v1 v1.55.0 // indirect gopkg.in/yaml.v2 v2.3.0 // indirect gorm.io/driver/mysql v0.3.0 - gorm.io/driver/postgres v0.2.6 - gorm.io/driver/sqlserver v0.2.4 - gorm.io/gorm v1.20.1 + gorm.io/gorm v1.20.5 ) From 64f731d404e8df9f1144aed6ac10a75c524d47f5 Mon Sep 17 00:00:00 2001 From: SliverHorn <503551462@qq.com> Date: Mon, 26 Oct 2020 11:33:17 +0800 Subject: [PATCH 07/13] update docker-compose related and update server/Dockerfile --- .docker-compose/shell/server-handle.sh | 32 -------------------------- dockerfile_server | 18 +++------------ server/Dockerfile | 29 ++++++++++++----------- 3 files changed, 18 insertions(+), 61 deletions(-) diff --git a/.docker-compose/shell/server-handle.sh b/.docker-compose/shell/server-handle.sh index 42308129..71273a5f 100644 --- a/.docker-compose/shell/server-handle.sh +++ b/.docker-compose/shell/server-handle.sh @@ -49,8 +49,6 @@ system: addr: 8888 db-type: 'mysql' oss-type: 'local' - config-env: 'GVA_CONFIG' - need-init-data: true use-multipoint: false # captcha configuration @@ -70,36 +68,6 @@ mysql: max-open-conns: 10 log-mode: false -# sqlite connect configuration (sqlite需要gcc支持 windows用户需要自行安装gcc) -sqlite: - path: 'db.db' - max-idle-conns: 10 - max-open-conns: 10 - logger: true - -# Sqlserver connect configuration -sqlserver: - path: 'localhost:9930' - db-name: 'gorm' - username: 'gorm' - password: 'LoremIpsum86' - max-idle-conns: 10 - max-open-conns: 10 - logger: true - -# Postgresql connect configuration -postgresql: - host: '127.0.0.1' - port: '9920' - config: 'sslmode=disable TimeZone=Asia/Shanghai' - db-name: 'gorm' - username: 'gorm' - password: 'gorm' - max-idle-conns: 10 - max-open-conns: 10 - prefer-simple-protocol: true - logger: false - # local configuration local: path: 'uploads/file' diff --git a/dockerfile_server b/dockerfile_server index 6c7b6584..9cba8a42 100644 --- a/dockerfile_server +++ b/dockerfile_server @@ -12,6 +12,7 @@ RUN sh ./server-handle.sh RUN rm -f server-handle.sh RUN cat ./config.yaml +RUN go build -o gva cmd/main.go RUN go env && go build -o server . @@ -20,24 +21,11 @@ LABEL MAINTAINER="SliverHorn@sliver_horn@qq.com" WORKDIR /go/src/gin-vue-admin +COPY --from=0 /go/src/gin-vue-admin/gva ./ COPY --from=0 /go/src/gin-vue-admin/server ./ COPY --from=0 /go/src/gin-vue-admin/config.yaml ./ COPY --from=0 /go/src/gin-vue-admin/resource ./resource EXPOSE 8888 -ENTRYPOINT ./server - -# 根据Dockerfile生成Docker镜像 - -# docker build -t gva-server:1.0 . - -#- 根据Docker镜像启动Docker容器 -# - 后台运行 -# - ``` -# docker run -d -p 8888:8888 --name gva-server-v1 gva-server:1.0 -# ``` -# - 以可交互模式运行, Ctrl + p + q -# - ``` -# docker run -it -p 8888:8888 --name gva-server-v1 gva-server:1.0 -# ``` \ No newline at end of file +ENTRYPOINT ./gva initdb && ./server diff --git a/server/Dockerfile b/server/Dockerfile index 6e71a9bc..75e85f1a 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -1,19 +1,20 @@ -FROM golang:alpine as builder +FROM golang:alpine -# 设置go mod proxy 国内代理 -# 设置golang path -ENV GOPROXY=https://goproxy.cn,https://goproxy.io,direct \ - GO111MODULE=on \ - CGO_ENABLED=1 -WORKDIR /ginvue -RUN go env -w GOPROXY=https://goproxy.cn,https://goproxy.io,direct +ENV GO111MODULE=on +ENV GOPROXY=https://goproxy.io,direct + +WORKDIR /go/src/gin-vue-admin COPY . . -RUN go env && go list && go build -o app main.go +RUN go env && go build -o server . + +FROM alpine:latest +LABEL MAINTAINER="SliverHorn@sliver_horn@qq.com" + +WORKDIR /go/src/gin-vue-admin +COPY --from=0 /go/src/gin-vue-admin/server ./ +COPY --from=0 /go/src/gin-vue-admin/config.yaml ./ +COPY --from=0 /go/src/gin-vue-admin/resource ./resource EXPOSE 8888 -ENTRYPOINT /ginvue/app -# 根据Dockerfile生成Docker镜像 -# docker build -t ginvue . -# 根据Docker镜像启动Docker容器 -# docker run -itd -p 8888:8888 --name ginvue ginvue +ENTRYPOINT ./server From cb0f7f467c99b23bcd6a567b7db0218466bc81b1 Mon Sep 17 00:00:00 2001 From: pixel <303176530@qq.com> Date: Mon, 26 Oct 2020 12:37:20 +0800 Subject: [PATCH 08/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/cmd/datas/apis.go | 2 +- server/cmd/datas/casbins.go | 6 +++--- web/src/api/user.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/cmd/datas/apis.go b/server/cmd/datas/apis.go index 48c22272..48cf0fb2 100644 --- a/server/cmd/datas/apis.go +++ b/server/cmd/datas/apis.go @@ -9,7 +9,7 @@ import ( var Apis = []model.SysApi{ {gorm.Model{ID: 1, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/base/login", "用户登录", "base", "POST"}, - {gorm.Model{ID: 2, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/base/register", "用户注册", "base", "POST"}, + {gorm.Model{ID: 2, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/user/register", "用户注册", "user", "POST"}, {gorm.Model{ID: 3, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/api/createApi", "创建api", "api", "POST"}, {gorm.Model{ID: 4, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/api/getApiList", "获取api列表", "api", "POST"}, {gorm.Model{ID: 5, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/api/getApiById", "获取api详细信息", "api", "POST"}, diff --git a/server/cmd/datas/casbins.go b/server/cmd/datas/casbins.go index 97fe60fe..166693f5 100644 --- a/server/cmd/datas/casbins.go +++ b/server/cmd/datas/casbins.go @@ -7,7 +7,7 @@ import ( var Carbines = []gormadapter.CasbinRule{ {PType: "p", V0: "888", V1: "/base/login", V2: "POST"}, - {PType: "p", V0: "888", V1: "/base/register", V2: "POST"}, + {PType: "p", V0: "888", V1: "/user/register", V2: "POST"}, {PType: "p", V0: "888", V1: "/api/createApi", V2: "POST"}, {PType: "p", V0: "888", V1: "/api/getApiList", V2: "POST"}, {PType: "p", V0: "888", V1: "/api/getApiById", V2: "POST"}, @@ -74,7 +74,7 @@ var Carbines = []gormadapter.CasbinRule{ {PType: "p", V0: "888", V1: "/simpleUploader/checkFileMd5", V2: "GET"}, {PType: "p", V0: "888", V1: "/simpleUploader/mergeFileMd5", V2: "GET"}, {PType: "p", V0: "8881", V1: "/base/login", V2: "POST"}, - {PType: "p", V0: "8881", V1: "/base/register", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/user/register", V2: "POST"}, {PType: "p", V0: "8881", V1: "/api/createApi", V2: "POST"}, {PType: "p", V0: "8881", V1: "/api/getApiList", V2: "POST"}, {PType: "p", V0: "8881", V1: "/api/getApiById", V2: "POST"}, @@ -111,7 +111,7 @@ var Carbines = []gormadapter.CasbinRule{ {PType: "p", V0: "8881", V1: "/customer/customer", V2: "GET"}, {PType: "p", V0: "8881", V1: "/customer/customerList", V2: "GET"}, {PType: "p", V0: "9528", V1: "/base/login", V2: "POST"}, - {PType: "p", V0: "9528", V1: "/base/register", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/user/register", V2: "POST"}, {PType: "p", V0: "9528", V1: "/api/createApi", V2: "POST"}, {PType: "p", V0: "9528", V1: "/api/getApiList", V2: "POST"}, {PType: "p", V0: "9528", V1: "/api/getApiById", V2: "POST"}, diff --git a/web/src/api/user.js b/web/src/api/user.js index 06136e23..aae6ccfa 100644 --- a/web/src/api/user.js +++ b/web/src/api/user.js @@ -110,4 +110,4 @@ export const setUserInfo = (data) => { method: 'put', data: data }) -} +} \ No newline at end of file From a1f5f443e3280fa7fe07d4268b9db264d35accef Mon Sep 17 00:00:00 2001 From: pixel <303176530@qq.com> Date: Mon, 26 Oct 2020 13:31:11 +0800 Subject: [PATCH 09/13] =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/api/v1/sys_work_flow.go | 38 ------------------- server/cmd/datas/init.go | 4 -- server/model/sys_workflow.go | 25 ------------- server/model/sys_workflow_process.go | 14 ------- server/model/wf_process.go | 56 ++++++++++++++++++++++++++++ 5 files changed, 56 insertions(+), 81 deletions(-) delete mode 100644 server/api/v1/sys_work_flow.go delete mode 100644 server/model/sys_workflow.go delete mode 100644 server/model/sys_workflow_process.go create mode 100644 server/model/wf_process.go diff --git a/server/api/v1/sys_work_flow.go b/server/api/v1/sys_work_flow.go deleted file mode 100644 index f0833282..00000000 --- a/server/api/v1/sys_work_flow.go +++ /dev/null @@ -1,38 +0,0 @@ -package v1 - -import ( - "fmt" - "gin-vue-admin/global/response" - "gin-vue-admin/model" - "gin-vue-admin/service" - "gin-vue-admin/utils" - "github.com/gin-gonic/gin" -) - -// @Tags workflow -// @Summary 注册工作流 -// @Produce application/json -// @Param data body model.SysWorkflow true "注册工作流接口" -// @Success 200 {string} string "{"success":true,"data":{},"msg":"注册成功"}" -// @Router /workflow/createWorkFlow [post] -func CreateWorkFlow(c *gin.Context) { - var wk model.SysWorkflow - _ = c.ShouldBindJSON(&wk) - WKVerify := utils.Rules{ - "WorkflowNickName": {utils.NotEmpty()}, - "WorkflowName": {utils.NotEmpty()}, - "WorkflowDescription": {utils.NotEmpty()}, - "WorkflowStepInfo": {utils.NotEmpty()}, - } - WKVerifyErr := utils.Verify(wk, WKVerify) - if WKVerifyErr != nil { - response.FailWithMessage(WKVerifyErr.Error(), c) - return - } - err := service.Create(wk) - if err != nil { - response.FailWithMessage(fmt.Sprintf("获取失败:%v", err), c) - } else { - response.OkWithMessage("获取成功", c) - } -} diff --git a/server/cmd/datas/init.go b/server/cmd/datas/init.go index 33bba52e..2d212a47 100644 --- a/server/cmd/datas/init.go +++ b/server/cmd/datas/init.go @@ -37,14 +37,12 @@ func InitMysqlTables(db *gorm.DB) { model.ExaFile{}, model.ExaCustomer{}, model.SysBaseMenu{}, - model.SysWorkflow{}, model.SysAuthority{}, model.JwtBlacklist{}, model.ExaFileChunk{}, model.SysDictionary{}, model.ExaSimpleUploader{}, model.SysOperationRecord{}, - model.SysWorkflowStepInfo{}, model.SysDictionaryDetail{}, model.SysBaseMenuParameter{}, model.ExaFileUploadAndDownload{}, @@ -88,13 +86,11 @@ func InitPostgresqlTables(db *gorm.DB) { model.ExaFile{}, model.ExaCustomer{}, model.SysBaseMenu{}, - model.SysWorkflow{}, model.SysAuthority{}, model.JwtBlacklist{}, model.ExaFileChunk{}, model.ExaSimpleUploader{}, model.SysOperationRecord{}, - model.SysWorkflowStepInfo{}, model.SysDictionaryDetail{}, model.SysBaseMenuParameter{}, model.ExaFileUploadAndDownload{}, diff --git a/server/model/sys_workflow.go b/server/model/sys_workflow.go deleted file mode 100644 index 2ba179e4..00000000 --- a/server/model/sys_workflow.go +++ /dev/null @@ -1,25 +0,0 @@ -package model - -import ( - "gorm.io/gorm" -) - -// 工作流属性表 -type SysWorkflow struct { - gorm.Model - WorkflowNickName string `json:"workflowNickName" gorm:"comment:工作流中文名称"` // 工作流名称 - WorkflowName string `json:"workflowName" gorm:"comment:工作流英文名称"` // 工作流英文id - WorkflowDescription string `json:"workflowDescription" gorm:"comment:工作流描述"` // 工作流描述 - WorkflowStepInfo []SysWorkflowStepInfo `json:"workflowStep" gorm:"comment:工作流步骤"` // 工作流步骤 -} - -// 工作流状态表 -type SysWorkflowStepInfo struct { - gorm.Model - SysWorkflowID uint `json:"workflowID" gorm:"comment:所属工作流ID"` // 所属工作流ID - IsStart bool `json:"isStart" gorm:"comment:是否是开始流节点"` // 是否是开始流节点 - StepName string `json:"stepName" gorm:"comment:工作流节点名称"` // 工作流名称 - StepNo float64 `json:"stepNo" gorm:"comment:步骤id (第几步)"` // 步骤id (第几步) - StepAuthorityID string `json:"stepAuthorityID" gorm:"comment:操作者级别id"` // 操作者级别id - IsEnd bool `json:"isEnd" gorm:"comment:是否是完结流节点"` // 是否是完结流节点 -} diff --git a/server/model/sys_workflow_process.go b/server/model/sys_workflow_process.go deleted file mode 100644 index 378568db..00000000 --- a/server/model/sys_workflow_process.go +++ /dev/null @@ -1,14 +0,0 @@ -package model - -import "gorm.io/gorm" - -// 工作流流转表 -type SysWorkFlowProcess struct { - gorm.Model - ApplicationID uint `json:"applicationID" gorm:"comment:当前工作流所属申请的ID"` // 当前工作流所属申请的ID - CurrentNode string `json:"currentNode" gorm:"comment:当前进度节点"` // 当前进度节点 - HistoricalNode string `json:"historicalNode" gorm:"comment:上一个进度节点"` // 上一个进度节点 - CurrentUser string `json:"currentUser" gorm:"comment:当前进度操作人"` // 当前进度操作人 - HistoricalUser string `json:"historicalUser" gorm:"comment:上一个进度的操作人"` // 上一个进度的操作人 - State bool `json:"state" gorm:"comment:是否是正在进行的状态"` // 状态 是否是正在进行的状态 -} diff --git a/server/model/wf_process.go b/server/model/wf_process.go new file mode 100644 index 00000000..2989c9e8 --- /dev/null +++ b/server/model/wf_process.go @@ -0,0 +1,56 @@ +package model + +type WorkflowProcess struct { + ID string `json:"id" gorm:"comment:流程标识"` + Name string `json:"name" gorm:"comment:流程名称"` + Category string `json:"category" gorm:"comment:分类"` + Clazz string `json:"clazz" gorm:"comment:类型"` + Label string `json:"label" gorm:"comment:流程标题"` + HideIcon bool `json:"hideIcon" gorm:"comment:是否隐藏图标"` + Nodes []WorkflowNode `json:"nodes"` // 流程节点数据 + Edges []WorkflowEdge `json:"edges"` // 流程链接数据 +} + +type WorkflowNode struct { + ID string `json:"id" gorm:"comment:节点id"` + WorkflowProcessID string `json:"-" gorm:"comment:流程标识"` + Clazz string `json:"clazz" gorm:"comment:节点类型"` + Size [2]int `json:"size" gorm:"comment:节点大小"` + Label string `json:"label" gorm:"comment:节点名称"` + Type string `json:"type" gorm:"comment:图标类型"` + Shape string `json:"shape" gorm:"comment:形状"` + X float64 `json:"y" gorm:"comment:x位置"` + Y float64 `json:"x" gorm:"comment:y位置"` + WaitState string `json:"waitState" gorm:"comment:等待属性"` + StateValue string `json:"stateValue" gorm:"comment:等待值"` + To string `json:"to" gorm:"comment:收件人"` + Subject string `json:"subject" gorm:"comment:标题"` + Content string `json:"content" gorm:"comment:内容"` + Cycle string `json:"cycle" gorm:"comment:循环时间"` + Duration string `json:"duration" gorm:"comment:持续时间"` + HideIcon bool `json:"hideIcon" gorm:"comment:是否隐藏图标"` +} + +type WorkflowEdge struct { + WorkflowProcessID string `json:"-" gorm:"comment:流程标识"` + ID string `json:"id" gorm:"comment:唯一标识"` + Clazz string `json:"clazz" gorm:"comment:类型(线)"` + Source string `json:"source" gorm:"comment:起点节点"` + Target string `json:"target" gorm:"comment:目标节点"` + SourceAnchor int `json:"sourceAnchor" gorm:"comment:起点"` + TargetAnchor int `json:"targetAnchor" gorm:"comment:目标点"` + Shape string `json:"shape" gorm:"comment:形状"` + StartPoint WorkflowPoint `json:"startPoint"` // 起点信息 + EndPoint WorkflowPoint `json:"endPoint"` // 终点信息 + Label string `json:"label" gorm:"comment:标题"` + HideIcon bool `json:"hideIcon" gorm:"comment:隐藏图标"` + ConditionExpression string `json:"conditionExpression" gorm:"comment:条件标识"` + Seq string `json:"seq" gorm:"comment:序号"` + Reverse bool `json:"reverse" gorm:"comment:是否反向"` +} + +type WorkflowPoint struct { + X float64 `json:"x"` + Y float64 `json:"y"` + Index int `json:"index"` +} \ No newline at end of file From 64cbca17c1f10582e27fca0b05589c85a380fe58 Mon Sep 17 00:00:00 2001 From: pixel <303176530@qq.com> Date: Mon, 26 Oct 2020 13:37:55 +0800 Subject: [PATCH 10/13] =?UTF-8?q?=E8=AE=BE=E8=AE=A1workflow=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/model/wf_process.go | 80 +++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 39 deletions(-) diff --git a/server/model/wf_process.go b/server/model/wf_process.go index 2989c9e8..1be82c34 100644 --- a/server/model/wf_process.go +++ b/server/model/wf_process.go @@ -1,56 +1,58 @@ package model type WorkflowProcess struct { - ID string `json:"id" gorm:"comment:流程标识"` + ID string `json:"id" gorm:"comment:流程标识;primaryKey"` Name string `json:"name" gorm:"comment:流程名称"` Category string `json:"category" gorm:"comment:分类"` Clazz string `json:"clazz" gorm:"comment:类型"` Label string `json:"label" gorm:"comment:流程标题"` HideIcon bool `json:"hideIcon" gorm:"comment:是否隐藏图标"` - Nodes []WorkflowNode `json:"nodes"` // 流程节点数据 - Edges []WorkflowEdge `json:"edges"` // 流程链接数据 + Nodes []WorkflowNode `json:"nodes"` // 流程节点数据 + Edges []WorkflowEdge `json:"edges"` // 流程链接数据 } type WorkflowNode struct { - ID string `json:"id" gorm:"comment:节点id"` - WorkflowProcessID string `json:"-" gorm:"comment:流程标识"` - Clazz string `json:"clazz" gorm:"comment:节点类型"` - Size [2]int `json:"size" gorm:"comment:节点大小"` - Label string `json:"label" gorm:"comment:节点名称"` - Type string `json:"type" gorm:"comment:图标类型"` - Shape string `json:"shape" gorm:"comment:形状"` - X float64 `json:"y" gorm:"comment:x位置"` - Y float64 `json:"x" gorm:"comment:y位置"` - WaitState string `json:"waitState" gorm:"comment:等待属性"` - StateValue string `json:"stateValue" gorm:"comment:等待值"` - To string `json:"to" gorm:"comment:收件人"` - Subject string `json:"subject" gorm:"comment:标题"` - Content string `json:"content" gorm:"comment:内容"` - Cycle string `json:"cycle" gorm:"comment:循环时间"` - Duration string `json:"duration" gorm:"comment:持续时间"` - HideIcon bool `json:"hideIcon" gorm:"comment:是否隐藏图标"` + ID string `json:"id" gorm:"comment:节点id;primaryKey"` + WorkflowProcessID string `json:"-" gorm:"comment:流程标识"` + Clazz string `json:"clazz" gorm:"comment:节点类型"` + Size [2]int `json:"size" gorm:"comment:节点大小"` + Label string `json:"label" gorm:"comment:节点名称"` + Type string `json:"type" gorm:"comment:图标类型"` + Shape string `json:"shape" gorm:"comment:形状"` + X float64 `json:"y" gorm:"comment:x位置"` + Y float64 `json:"x" gorm:"comment:y位置"` + WaitState string `json:"waitState" gorm:"comment:等待属性"` + StateValue string `json:"stateValue" gorm:"comment:等待值"` + To string `json:"to" gorm:"comment:收件人"` + Subject string `json:"subject" gorm:"comment:标题"` + Content string `json:"content" gorm:"comment:内容"` + Cycle string `json:"cycle" gorm:"comment:循环时间"` + Duration string `json:"duration" gorm:"comment:持续时间"` + HideIcon bool `json:"hideIcon" gorm:"comment:是否隐藏图标"` } type WorkflowEdge struct { - WorkflowProcessID string `json:"-" gorm:"comment:流程标识"` - ID string `json:"id" gorm:"comment:唯一标识"` - Clazz string `json:"clazz" gorm:"comment:类型(线)"` - Source string `json:"source" gorm:"comment:起点节点"` - Target string `json:"target" gorm:"comment:目标节点"` - SourceAnchor int `json:"sourceAnchor" gorm:"comment:起点"` - TargetAnchor int `json:"targetAnchor" gorm:"comment:目标点"` - Shape string `json:"shape" gorm:"comment:形状"` - StartPoint WorkflowPoint `json:"startPoint"` // 起点信息 - EndPoint WorkflowPoint `json:"endPoint"` // 终点信息 - Label string `json:"label" gorm:"comment:标题"` - HideIcon bool `json:"hideIcon" gorm:"comment:隐藏图标"` - ConditionExpression string `json:"conditionExpression" gorm:"comment:条件标识"` - Seq string `json:"seq" gorm:"comment:序号"` - Reverse bool `json:"reverse" gorm:"comment:是否反向"` + ID string `json:"id" gorm:"comment:唯一标识;primaryKey"` + WorkflowProcessID string `json:"-" gorm:"comment:流程标识"` + Clazz string `json:"clazz" gorm:"comment:类型(线)"` + Source string `json:"source" gorm:"comment:起点节点"` + Target string `json:"target" gorm:"comment:目标节点"` + SourceAnchor int `json:"sourceAnchor" gorm:"comment:起点"` + TargetAnchor int `json:"targetAnchor" gorm:"comment:目标点"` + Shape string `json:"shape" gorm:"comment:形状"` + StartPoint WorkflowPoint `json:"startPoint"` // 起点信息 + EndPoint WorkflowPoint `json:"endPoint"` // 终点信息 + Label string `json:"label" gorm:"comment:标题"` + HideIcon bool `json:"hideIcon" gorm:"comment:隐藏图标"` + ConditionExpression string `json:"conditionExpression" gorm:"comment:条件标识"` + Seq string `json:"seq" gorm:"comment:序号"` + Reverse bool `json:"reverse" gorm:"comment:是否反向"` } type WorkflowPoint struct { - X float64 `json:"x"` - Y float64 `json:"y"` - Index int `json:"index"` -} \ No newline at end of file + ID string `json:"-" gorm:"comment:唯一标识;primaryKey"` + WorkflowEdgeID string `json:"-"` + X float64 `json:"x"` + Y float64 `json:"y"` + Index int `json:"index"` +} From b7cb072d624cfb5a1188150f7b1850819a3078a7 Mon Sep 17 00:00:00 2001 From: pixel <303176530@qq.com> Date: Mon, 26 Oct 2020 16:51:24 +0800 Subject: [PATCH 11/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20workflow=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/initialize/gorm.go | 8 +++++--- server/initialize/router.go | 1 - server/model/wf_process.go | 1 - server/router/sys_workflow.go | 14 -------------- server/service/sys_workflow.go | 17 ----------------- .../workflow/workflowCreate/workflowCreate.vue | 2 +- 6 files changed, 6 insertions(+), 37 deletions(-) delete mode 100644 server/router/sys_workflow.go delete mode 100644 server/service/sys_workflow.go diff --git a/server/initialize/gorm.go b/server/initialize/gorm.go index f722495b..eacce9ef 100644 --- a/server/initialize/gorm.go +++ b/server/initialize/gorm.go @@ -29,8 +29,6 @@ func MysqlTables(db *gorm.DB) { model.SysBaseMenu{}, model.SysBaseMenuParameter{}, model.JwtBlacklist{}, - model.SysWorkflow{}, - model.SysWorkflowStepInfo{}, model.SysDictionary{}, model.SysDictionaryDetail{}, model.ExaFileUploadAndDownload{}, @@ -39,6 +37,10 @@ func MysqlTables(db *gorm.DB) { model.ExaSimpleUploader{}, model.ExaCustomer{}, model.SysOperationRecord{}, + model.WorkflowProcess{}, + model.WorkflowNode{}, + model.WorkflowEdge{}, + model.WorkflowPoint{}, ) if err != nil { global.GVA_LOG.Error("register table failed", zap.Any("err", err)) @@ -84,4 +86,4 @@ func gormConfig(mod bool) *gorm.Config { DisableForeignKeyConstraintWhenMigrating: true, } } -} \ No newline at end of file +} diff --git a/server/initialize/router.go b/server/initialize/router.go index 8f08f0d4..f701c046 100644 --- a/server/initialize/router.go +++ b/server/initialize/router.go @@ -32,7 +32,6 @@ func Routers() *gin.Engine { router.InitApiRouter(ApiGroup) // 注册功能api路由 router.InitFileUploadAndDownloadRouter(ApiGroup) // 文件上传下载功能路由 router.InitSimpleUploaderRouter(ApiGroup) // 断点续传(插件版) - router.InitWorkflowRouter(ApiGroup) // 工作流相关路由 router.InitCasbinRouter(ApiGroup) // 权限相关路由 router.InitJwtRouter(ApiGroup) // jwt相关路由 router.InitSystemRouter(ApiGroup) // system相关路由 diff --git a/server/model/wf_process.go b/server/model/wf_process.go index 1be82c34..5c030898 100644 --- a/server/model/wf_process.go +++ b/server/model/wf_process.go @@ -15,7 +15,6 @@ type WorkflowNode struct { ID string `json:"id" gorm:"comment:节点id;primaryKey"` WorkflowProcessID string `json:"-" gorm:"comment:流程标识"` Clazz string `json:"clazz" gorm:"comment:节点类型"` - Size [2]int `json:"size" gorm:"comment:节点大小"` Label string `json:"label" gorm:"comment:节点名称"` Type string `json:"type" gorm:"comment:图标类型"` Shape string `json:"shape" gorm:"comment:形状"` diff --git a/server/router/sys_workflow.go b/server/router/sys_workflow.go deleted file mode 100644 index 771bfa8c..00000000 --- a/server/router/sys_workflow.go +++ /dev/null @@ -1,14 +0,0 @@ -package router - -import ( - "gin-vue-admin/api/v1" - "gin-vue-admin/middleware" - "github.com/gin-gonic/gin" -) - -func InitWorkflowRouter(Router *gin.RouterGroup) { - WorkflowRouter := Router.Group("workflow").Use(middleware.JWTAuth()).Use(middleware.CasbinHandler()) - { - WorkflowRouter.POST("createWorkFlow", v1.CreateWorkFlow) // 创建工作流 - } -} diff --git a/server/service/sys_workflow.go b/server/service/sys_workflow.go deleted file mode 100644 index 8b34aade..00000000 --- a/server/service/sys_workflow.go +++ /dev/null @@ -1,17 +0,0 @@ -package service - -import ( - "gin-vue-admin/global" - "gin-vue-admin/model" -) - -// @title Create -// @description create a workflow, 创建工作流 -// @auth (2020/04/05 20:22) -// @param wk model.SysWorkflow -// @return error - -func Create(wk model.SysWorkflow) error { - err := global.GVA_DB.Create(&wk).Error - return err -} diff --git a/web/src/view/workflow/workflowCreate/workflowCreate.vue b/web/src/view/workflow/workflowCreate/workflowCreate.vue index 5477525c..7cb32e30 100644 --- a/web/src/view/workflow/workflowCreate/workflowCreate.vue +++ b/web/src/view/workflow/workflowCreate/workflowCreate.vue @@ -20,7 +20,7 @@ export default { data () { return { lang: "zh", - demoData: {"nodes":[{"clazz":"start","size":[55,55],"label":"发起请假","type":"start-node","shape":"start-node","x":110,"y":195,"id":"start1603681292875","style":{}},{"clazz":"parallelGateway","size":[55,55],"label":"会签","type":"parallel-gateway-node","shape":"parallel-gateway-node","x":228,"y":195,"id":"parallelGateway1603681296419","style":{}},{"clazz":"userTask","size":[100,55],"label":"审批人1","type":"user-task-node","shape":"user-task-node","x":372,"y":84,"id":"userTask1603681299962","style":{},"assignValue":1,"assignType":"user"},{"clazz":"userTask","size":[100,55],"label":"审批人2","type":"user-task-node","shape":"user-task-node","x":370,"y":321,"id":"userTask1603681302372","style":{},"assignValue":2,"assignType":"user"},{"clazz":"parallelGateway","size":[55,55],"label":"会签结果检测","type":"parallel-gateway-node","shape":"parallel-gateway-node","x":519,"y":195,"id":"parallelGateway1603681338222","style":{}},{"clazz":"end","size":[55,55],"label":"请假失败","type":"end-node","shape":"end-node","x":704,"y":317,"id":"end1603681358043","style":{}},{"clazz":"end","size":[55,55],"label":"请假成功","type":"end-node","shape":"end-node","x":706.5,"y":55.5,"id":"end1603681360882","style":{}}],"edges":[{"id":"flow1603681320738","clazz":"flow","source":"parallelGateway1603681296419","target":"userTask1603681299962","sourceAnchor":0,"targetAnchor":3,"shape":"flow-polyline-round","style":{},"startPoint":{"x":228,"y":169,"index":0},"endPoint":{"x":321.5,"y":84,"index":3}},{"id":"flow1603681321969","clazz":"flow","source":"parallelGateway1603681296419","target":"userTask1603681302372","sourceAnchor":2,"targetAnchor":3,"shape":"flow-polyline-round","style":{},"startPoint":{"x":228,"y":221,"index":2},"endPoint":{"x":319.5,"y":321,"index":3}},{"id":"flow1603681323274","clazz":"flow","source":"start1603681292875","target":"parallelGateway1603681296419","sourceAnchor":1,"targetAnchor":3,"shape":"flow-polyline-round","style":{},"startPoint":{"x":138,"y":195,"index":1},"endPoint":{"x":202,"y":195,"index":3},"label":"发起","conditionExpression":"complete"},{"id":"flow1603681341777","clazz":"flow","source":"userTask1603681299962","target":"parallelGateway1603681338222","sourceAnchor":1,"targetAnchor":3,"shape":"flow-polyline-round","style":{},"startPoint":{"x":422.5,"y":84,"index":1},"endPoint":{"x":493,"y":195,"index":3}},{"id":"flow1603681343425","clazz":"flow","source":"userTask1603681302372","target":"parallelGateway1603681338222","sourceAnchor":1,"targetAnchor":3,"shape":"flow-polyline-round","style":{},"startPoint":{"x":420.5,"y":321,"index":1},"endPoint":{"x":493,"y":195,"index":3}},{"id":"flow1603681362913","clazz":"flow","source":"parallelGateway1603681338222","target":"end1603681360882","sourceAnchor":0,"targetAnchor":2,"shape":"flow-polyline-round","style":{},"startPoint":{"x":519,"y":169,"index":0},"endPoint":{"x":678.5,"y":55.5,"index":2},"conditionExpression":"complete","label":"所有人同意"},{"id":"flow1603681392729","clazz":"flow","source":"parallelGateway1603681338222","target":"end1603681358043","sourceAnchor":2,"targetAnchor":2,"shape":"flow-polyline-round","style":{},"startPoint":{"x":519,"y":221,"index":2},"endPoint":{"x":676,"y":317,"index":2},"conditionExpression":"reject","label":"任何一人拒绝"}],"combos":[],"groups":[]}, + demoData: {"nodes":[{"clazz":"start","label":"发起请假","type":"start-node","shape":"start-node","x":110,"y":195,"id":"start1603681292875","style":{}},{"clazz":"parallelGateway","label":"会签","type":"parallel-gateway-node","shape":"parallel-gateway-node","x":228,"y":195,"id":"parallelGateway1603681296419","style":{}},{"clazz":"userTask","label":"审批人1","type":"user-task-node","shape":"user-task-node","x":372,"y":84,"id":"userTask1603681299962","style":{},"assignValue":1,"assignType":"user"},{"clazz":"userTask","label":"审批人2","type":"user-task-node","shape":"user-task-node","x":370,"y":321,"id":"userTask1603681302372","style":{},"assignValue":2,"assignType":"user"},{"clazz":"parallelGateway","label":"会签结果检测","type":"parallel-gateway-node","shape":"parallel-gateway-node","x":519,"y":195,"id":"parallelGateway1603681338222","style":{}},{"clazz":"end","label":"请假失败","type":"end-node","shape":"end-node","x":704,"y":317,"id":"end1603681358043","style":{}},{"clazz":"end","label":"请假成功","type":"end-node","shape":"end-node","x":706.5,"y":55.5,"id":"end1603681360882","style":{}}],"edges":[{"id":"flow1603681320738","clazz":"flow","source":"parallelGateway1603681296419","target":"userTask1603681299962","sourceAnchor":0,"targetAnchor":3,"shape":"flow-polyline-round","style":{},"startPoint":{"x":228,"y":169,"index":0},"endPoint":{"x":321.5,"y":84,"index":3}},{"id":"flow1603681321969","clazz":"flow","source":"parallelGateway1603681296419","target":"userTask1603681302372","sourceAnchor":2,"targetAnchor":3,"shape":"flow-polyline-round","style":{},"startPoint":{"x":228,"y":221,"index":2},"endPoint":{"x":319.5,"y":321,"index":3}},{"id":"flow1603681323274","clazz":"flow","source":"start1603681292875","target":"parallelGateway1603681296419","sourceAnchor":1,"targetAnchor":3,"shape":"flow-polyline-round","style":{},"startPoint":{"x":138,"y":195,"index":1},"endPoint":{"x":202,"y":195,"index":3},"label":"发起","conditionExpression":"complete"},{"id":"flow1603681341777","clazz":"flow","source":"userTask1603681299962","target":"parallelGateway1603681338222","sourceAnchor":1,"targetAnchor":3,"shape":"flow-polyline-round","style":{},"startPoint":{"x":422.5,"y":84,"index":1},"endPoint":{"x":493,"y":195,"index":3}},{"id":"flow1603681343425","clazz":"flow","source":"userTask1603681302372","target":"parallelGateway1603681338222","sourceAnchor":1,"targetAnchor":3,"shape":"flow-polyline-round","style":{},"startPoint":{"x":420.5,"y":321,"index":1},"endPoint":{"x":493,"y":195,"index":3}},{"id":"flow1603681362913","clazz":"flow","source":"parallelGateway1603681338222","target":"end1603681360882","sourceAnchor":0,"targetAnchor":2,"shape":"flow-polyline-round","style":{},"startPoint":{"x":519,"y":169,"index":0},"endPoint":{"x":678.5,"y":55.5,"index":2},"conditionExpression":"complete","label":"所有人同意"},{"id":"flow1603681392729","clazz":"flow","source":"parallelGateway1603681338222","target":"end1603681358043","sourceAnchor":2,"targetAnchor":2,"shape":"flow-polyline-round","style":{},"startPoint":{"x":519,"y":221,"index":2},"endPoint":{"x":676,"y":317,"index":2},"conditionExpression":"reject","label":"任何一人拒绝"}],"combos":[],"groups":[]}, users: [], authorities:[], groups: [{id:'1',name:'组1'},{id:'2',name:'组2'},{id:'3',name:'组3'}], From 0ed3078f38506dc19d8579b693d7e3d63afc7d17 Mon Sep 17 00:00:00 2001 From: pixel <303176530@qq.com> Date: Mon, 26 Oct 2020 18:21:01 +0800 Subject: [PATCH 12/13] =?UTF-8?q?=E5=A2=9E=E5=8A=A0delete=E5=88=A0?= =?UTF-8?q?=E9=99=A4node=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/gva-wfd/behavior/deleteItem.js | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/web/src/components/gva-wfd/behavior/deleteItem.js b/web/src/components/gva-wfd/behavior/deleteItem.js index e7f53f01..faac4f83 100644 --- a/web/src/components/gva-wfd/behavior/deleteItem.js +++ b/web/src/components/gva-wfd/behavior/deleteItem.js @@ -1,31 +1,31 @@ /* eslint-disable */ -export default function(G6){ - G6.registerBehavior('deleteItem', { - getEvents() { - return { - 'keydown': 'onKeydown', - 'canvas:mouseleave': 'onCanvasLeave', - 'canvas:mouseenter': 'onCanvasFocus', - } - }, - onKeydown(e){ - const items = this.graph.get('selectedItems'); - const focus = this.graph.get('focusGraphWrapper'); - if(e.keyCode === 8 && items && items.length > 0 && focus){ - if(this.graph.executeCommand) { - this.graph.executeCommand('delete', {}); - }else{ - this.graph.remove(items[0]); +export default function(G6) { + G6.registerBehavior('deleteItem', { + getEvents() { + return { + 'keydown': 'onKeydown', + 'canvas:mouseleave': 'onCanvasLeave', + 'canvas:mouseenter': 'onCanvasFocus', + } + }, + onKeydown(e) { + const items = this.graph.get('selectedItems'); + const focus = this.graph.get('focusGraphWrapper'); + if (e.keyCode === 46 && items && items.length > 0 && focus) { + if (this.graph.executeCommand) { + this.graph.executeCommand('delete', {}); + } else { + this.graph.remove(items[0]); + } + this.graph.set('selectedItems', []); + this.graph.emit('afteritemselected', []); + } + }, + onCanvasLeave(e) { + this.graph.set('focusGraphWrapper', false); + }, + onCanvasFocus() { + this.graph.set('focusGraphWrapper', true); } - this.graph.set('selectedItems',[]); - this.graph.emit('afteritemselected',[]); - } - }, - onCanvasLeave(e){ - this.graph.set('focusGraphWrapper',false); - }, - onCanvasFocus(){ - this.graph.set('focusGraphWrapper',true); - } - }); -} + }); +} \ No newline at end of file From aa7d2b6ee1a565f931413aeb7892ffaed785c74d Mon Sep 17 00:00:00 2001 From: pixel <303176530@qq.com> Date: Mon, 26 Oct 2020 18:52:41 +0800 Subject: [PATCH 13/13] =?UTF-8?q?=E5=A2=9E=E5=8A=A0ctrl+z=20ctrl+y?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/gva-wfd/behavior/deleteItem.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/web/src/components/gva-wfd/behavior/deleteItem.js b/web/src/components/gva-wfd/behavior/deleteItem.js index faac4f83..273d0fd7 100644 --- a/web/src/components/gva-wfd/behavior/deleteItem.js +++ b/web/src/components/gva-wfd/behavior/deleteItem.js @@ -20,6 +20,20 @@ export default function(G6) { this.graph.set('selectedItems', []); this.graph.emit('afteritemselected', []); } + if (e.ctrlKey == true && e.keyCode == 90) { //Ctrl+z + e.returnvalue = false; + if (this.graph.executeCommand) { + this.graph.executeCommand('undo', {}); + } + } + if (e.ctrlKey == true && e.keyCode == 89) { //Ctrl+y + e.returnvalue = false; + if (this.graph.executeCommand) { + this.graph.executeCommand('redo', {}); + } + + } + }, onCanvasLeave(e) { this.graph.set('focusGraphWrapper', false);