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/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/ 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 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系统的二进制文件" 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/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/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/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/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/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/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 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..5c030898 --- /dev/null +++ b/server/model/wf_process.go @@ -0,0 +1,57 @@ +package model + +type WorkflowProcess struct { + 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"` // 流程链接数据 +} + +type WorkflowNode struct { + ID string `json:"id" gorm:"comment:节点id;primaryKey"` + WorkflowProcessID string `json:"-" gorm:"comment:流程标识"` + Clazz string `json:"clazz" 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 { + 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 { + ID string `json:"-" gorm:"comment:唯一标识;primaryKey"` + WorkflowEdgeID string `json:"-"` + X float64 `json:"x"` + Y float64 `json:"y"` + Index int `json:"index"` +} 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/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 diff --git a/web/src/components/gva-wfd/behavior/deleteItem.js b/web/src/components/gva-wfd/behavior/deleteItem.js index e7f53f01..273d0fd7 100644 --- a/web/src/components/gva-wfd/behavior/deleteItem.js +++ b/web/src/components/gva-wfd/behavior/deleteItem.js @@ -1,31 +1,45 @@ /* 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', []); + } + 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); + }, + 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 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 diff --git a/web/src/view/workflow/workflowCreate/workflowCreate.vue b/web/src/view/workflow/workflowCreate/workflowCreate.vue index fb6d1f3c..8cfe04ab 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","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'}], @@ -31,6 +31,7 @@ export default { save(){ console.log(this.$refs['wfd'].graph.save()) console.log(this.$refs['wfd'].processModel) + console.log(JSON.stringify(this.$refs['wfd'].graph.save())) }, saveXML(){ console.log(this.$refs['wfd'].graph.saveXML())