Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
FLIPPED-AURORA
gin-vue-admin
提交
086815c0
G
gin-vue-admin
项目概览
FLIPPED-AURORA
/
gin-vue-admin
大约 1 年 前同步成功
通知
337
Star
18155
Fork
5506
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gin-vue-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
086815c0
编写于
11月 17, 2020
作者:
Mr.奇淼(
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加初始化参数
上级
b1233097
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
150 addition
and
189 deletion
+150
-189
server/cmd/datas/init.go
server/cmd/datas/init.go
+1
-0
server/cmd/datas/wf_process.go
server/cmd/datas/wf_process.go
+56
-0
server/initialize/router.go
server/initialize/router.go
+0
-1
server/model/wf_process.go
server/model/wf_process.go
+4
-6
web/src/api/workflowProcess.js
web/src/api/workflowProcess.js
+48
-0
web/src/components/gva-wfd/locales/zh-CN.js
web/src/components/gva-wfd/locales/zh-CN.js
+1
-1
web/src/view/workflow/userList/need.vue
web/src/view/workflow/userList/need.vue
+17
-0
web/src/view/workflow/userList/started.vue
web/src/view/workflow/userList/started.vue
+17
-0
web/src/view/workflow/workflowCreate/workflowCreate.vue
web/src/view/workflow/workflowCreate/workflowCreate.vue
+6
-181
未找到文件。
server/cmd/datas/init.go
浏览文件 @
086815c0
...
...
@@ -22,6 +22,7 @@ func InitMysqlData(db *gorm.DB) {
err
=
InitSysDataAuthorityId
(
db
)
err
=
InitSysDictionaryDetail
(
db
)
err
=
InitExaFileUploadAndDownload
(
db
)
err
=
InitWkProcess
(
db
)
if
err
!=
nil
{
color
.
Warn
.
Printf
(
"[Mysql]-->初始化数据失败,err: %v
\n
"
,
err
)
os
.
Exit
(
0
)
...
...
server/cmd/datas/wf_process.go
0 → 100644
浏览文件 @
086815c0
package
datas
import
(
"gin-vue-admin/global"
"gin-vue-admin/model"
"gorm.io/gorm"
"time"
)
var
WorkflowProcess
=
[]
model
.
WorkflowProcess
{
{
ID
:
"leaveFlow"
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
(),
Name
:
"leaveFlow"
,
Clazz
:
"process"
,
Label
:
"请假流程(演示)"
,
HideIcon
:
false
,
Description
:
"请假流程演示"
,
View
:
"view/iconList/index.vue"
},
}
var
WorkflowNodes
=
[]
model
.
WorkflowNode
{
{
ID
:
"end1603681358043"
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
(),
WorkflowProcessID
:
"leaveFlow"
,
Clazz
:
"end"
,
Label
:
"请假失败"
,
Type
:
"end-node"
,
Shape
:
"end-node"
,
Description
:
""
,
View
:
"view/exa_wf_leave/exa_wf_leaveFrom.vue"
,
X
:
302
,
Y
:
545.5
,
HideIcon
:
false
,
AssignType
:
""
,
AssignValue
:
""
,
Success
:
false
},
{
ID
:
"end1603681360882"
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
(),
WorkflowProcessID
:
"leaveFlow"
,
Clazz
:
"end"
,
Label
:
"请假成功"
,
Type
:
"end-node"
,
Shape
:
"end-node"
,
Description
:
"请假完成,具体结果等待提交"
,
View
:
"view/exa_wf_leave/exa_wf_leaveFrom.vue"
,
X
:
83.5
,
Y
:
546
,
HideIcon
:
true
,
AssignType
:
""
,
AssignValue
:
""
,
Success
:
false
},
{
ID
:
"start1603681292875"
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
(),
WorkflowProcessID
:
"leaveFlow"
,
Clazz
:
"start"
,
Label
:
"发起请假"
,
Type
:
"start-node"
,
Shape
:
"start-node"
,
Description
:
"发起一个请假流程"
,
View
:
"view/exa_wf_leave/exa_wf_leaveFrom.vue"
,
X
:
201
,
Y
:
109
,
HideIcon
:
false
,
AssignType
:
""
,
AssignValue
:
""
,
Success
:
false
},
{
ID
:
"userTask1603681299962"
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
(),
WorkflowProcessID
:
"leaveFlow"
,
Clazz
:
"userTask"
,
Label
:
"审批"
,
Type
:
"user-task-node"
,
Shape
:
"user-task-node"
,
Description
:
"审批会签"
,
DueDate
:
time
.
Date
(
2020
,
11
,
20
,
0
,
0
,
0
,
0
,
nil
),
View
:
"view/exa_wf_leave/exa_wf_leaveFrom.vue"
,
X
:
202
,
Y
:
320.5
,
HideIcon
:
false
,
AssignType
:
"user"
,
AssignValue
:
",1,2,"
,
Success
:
false
},
}
var
WorkflowEdge
=
[]
model
.
WorkflowEdge
{
{
ID
:
"flow1604985849039"
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
(),
WorkflowProcessID
:
"leaveFlow"
,
Clazz
:
"flow"
,
Source
:
"start1603681292875"
,
Target
:
"userTask1603681299962"
,
SourceAnchor
:
1
,
TargetAnchor
:
3
,
Shape
:
"flow-polyline-round"
,
Label
:
""
,
HideIcon
:
false
,
ConditionExpression
:
""
,
Reverse
:
false
},
{
ID
:
"flow1604985879574"
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
(),
WorkflowProcessID
:
"leaveFlow"
,
Clazz
:
"flow"
,
Source
:
"userTask1603681299962"
,
Target
:
"end1603681360882"
,
SourceAnchor
:
0
,
TargetAnchor
:
2
,
Shape
:
"flow-polyline-round"
,
Label
:
"同意"
,
HideIcon
:
false
,
ConditionExpression
:
"yes"
,
Reverse
:
false
},
{
ID
:
"flow1604985881207"
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
(),
WorkflowProcessID
:
"leaveFlow"
,
Clazz
:
"flow"
,
Source
:
"userTask1603681299962"
,
Target
:
"end1603681358043"
,
SourceAnchor
:
2
,
TargetAnchor
:
2
,
Shape
:
"flow-polyline-round"
,
Label
:
"不同意"
,
HideIcon
:
false
,
ConditionExpression
:
"no"
,
Reverse
:
false
},
}
var
WorkflowStartPoint
=
[]
model
.
WorkflowStartPoint
{
{
WorkflowEdgeID
:
"flow1604985849039"
,
GVA_MODEL
:
global
.
GVA_MODEL
{
ID
:
31
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
()},
X
:
137
,
Y
:
201
,
Index
:
1
},
{
WorkflowEdgeID
:
"flow1604985879574"
,
GVA_MODEL
:
global
.
GVA_MODEL
{
ID
:
32
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
()},
X
:
320.5
,
Y
:
174
,
Index
:
0
},
{
WorkflowEdgeID
:
"flow1604985881207"
,
GVA_MODEL
:
global
.
GVA_MODEL
{
ID
:
33
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
()},
X
:
320.5
,
Y
:
230
,
Index
:
2
},
}
var
WorkflowEndPoint
=
[]
model
.
WorkflowEndPoint
{
{
WorkflowEdgeID
:
"flow1604985849039"
,
GVA_MODEL
:
global
.
GVA_MODEL
{
ID
:
31
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
()},
X
:
270
,
Y
:
202
,
Index
:
3
},
{
WorkflowEdgeID
:
"flow1604985879574"
,
GVA_MODEL
:
global
.
GVA_MODEL
{
ID
:
32
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
()},
X
:
518
,
Y
:
83.5
,
Index
:
2
},
{
WorkflowEdgeID
:
"flow1604985881207"
,
GVA_MODEL
:
global
.
GVA_MODEL
{
ID
:
33
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
()},
X
:
517.5
,
Y
:
302
,
Index
:
2
},
}
func
InitWkProcess
(
db
*
gorm
.
DB
)
(
err
error
)
{
return
db
.
Transaction
(
func
(
tx
*
gorm
.
DB
)
error
{
if
err
:=
tx
.
Create
(
&
WorkflowProcess
)
.
Error
;
err
!=
nil
{
// 遇到错误时回滚事务
return
err
}
if
err
:=
tx
.
Create
(
&
WorkflowNodes
)
.
Error
;
err
!=
nil
{
// 遇到错误时回滚事务
return
err
}
if
err
:=
tx
.
Create
(
&
WorkflowEdge
)
.
Error
;
err
!=
nil
{
// 遇到错误时回滚事务
return
err
}
if
err
:=
tx
.
Create
(
&
WorkflowStartPoint
)
.
Error
;
err
!=
nil
{
// 遇到错误时回滚事务
return
err
}
if
err
:=
tx
.
Create
(
&
WorkflowEndPoint
)
.
Error
;
err
!=
nil
{
// 遇到错误时回滚事务
return
err
}
return
nil
})
}
server/initialize/router.go
浏览文件 @
086815c0
...
...
@@ -42,7 +42,6 @@ func Routers() *gin.Engine {
router
.
InitSysOperationRecordRouter
(
ApiGroup
)
// 操作记录
router
.
InitEmailRouter
(
ApiGroup
)
// 邮件相关路由
router
.
InitWorkflowProcessRouter
(
ApiGroup
)
// 工作流创建相关接口
router
.
InitExaWfLeaveRouter
(
ApiGroup
)
// 工作流创建相关接口
global
.
GVA_LOG
.
Info
(
"router register success"
)
return
Router
...
...
server/model/wf_process.go
浏览文件 @
086815c0
...
...
@@ -145,16 +145,14 @@ type WorkflowEdge struct {
type
WorkflowStartPoint
struct
{
WorkflowEdgeID
string
WorkflowPoint
global
.
GVA_MODEL
X
float64
`json:"x"`
Y
float64
`json:"y"`
Index
int
`json:"index"`
}
type
WorkflowEndPoint
struct
{
WorkflowEdgeID
string
WorkflowPoint
}
//
type
WorkflowPoint
struct
{
global
.
GVA_MODEL
X
float64
`json:"x"`
Y
float64
`json:"y"`
...
...
web/src/api/workflowProcess.js
浏览文件 @
086815c0
...
...
@@ -114,3 +114,51 @@ export const findWorkflowStep = (params) => {
params
})
}
// @Tags ExaWfLeave
// @Summary 创建ExaWfLeave
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /workflowProcess/startWorkflow [post]
export
const
startWorkflow
=
(
data
,
params
=
{
businessType
:
data
.
wf
.
businessType
})
=>
{
return
service
({
url
:
"
/workflowProcess/startWorkflow
"
,
method
:
'
post
'
,
data
,
params
})
}
// @Tags WorkflowProcess
// @Summary 我发起的工作流
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /workflowProcess/getMyStated [get]
export
const
getMyStated
=
()
=>
{
return
service
({
url
:
"
/workflowProcess/getMyStated
"
,
method
:
'
get
'
,
})
}
// @Tags WorkflowProcess
// @Summary 我发起的工作流
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /workflowProcess/getMyNeed [get]
export
const
getMyNeed
=
()
=>
{
return
service
({
url
:
"
/workflowProcess/getMyNeed
"
,
method
:
'
get
'
,
})
}
\ No newline at end of file
web/src/components/gva-wfd/locales/zh-CN.js
浏览文件 @
086815c0
...
...
@@ -36,7 +36,7 @@ export default {
'
signalEvent
'
:
'
信号节点
'
,
'
signalEvent.signal
'
:
'
信号名
'
,
'
sequenceFlow
'
:
'
连接线
'
,
'
sequenceFlow.expression
'
:
'
条件
表达式
'
,
'
sequenceFlow.expression
'
:
'
条件
参数
'
,
'
sequenceFlow.seq
'
:
'
序号
'
,
'
sequenceFlow.reverse
'
:
'
反向
'
,
'
startEvent
'
:
'
开始节点
'
,
...
...
web/src/view/workflow/userList/need.vue
0 → 100644
浏览文件 @
086815c0
<
template
>
<div>
</div>
</
template
>
<
script
>
import
{
getMyNeed
}
from
"
@/api/workflowProcess
"
export
default
{
async
created
(){
const
res
=
await
getMyNeed
()
if
(
res
.
code
==
0
){
console
.
log
(
res
.
data
)
}
}
}
</
script
>
\ No newline at end of file
web/src/view/workflow/userList/started.vue
0 → 100644
浏览文件 @
086815c0
<
template
>
<div>
</div>
</
template
>
<
script
>
import
{
getMyStated
}
from
"
@/api/workflowProcess
"
export
default
{
async
created
(){
const
res
=
await
getMyStated
()
if
(
res
.
code
==
0
){
console
.
log
(
res
.
data
)
}
}
}
</
script
>
\ No newline at end of file
web/src/view/workflow/workflowCreate/workflowCreate.vue
浏览文件 @
086815c0
...
...
@@ -68,174 +68,8 @@ export default {
lang
:
"
zh
"
,
done
:
false
,
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
:
"
任何一人拒绝
"
}
],
nodes
:
[],
edges
:
[]
},
wkType
:
"
create
"
,
users
:
[],
...
...
@@ -249,17 +83,8 @@ export default {
signalDefs
:
[],
messageDefs
:
[],
},
groups
:
[
{
id
:
"
1
"
,
name
:
"
组1
"
},
{
id
:
"
2
"
,
name
:
"
组2
"
},
{
id
:
"
3
"
,
name
:
"
组3
"
}
],
categorys
:
[
{
id
:
"
1
"
,
name
:
"
分类1
"
},
{
id
:
"
2
"
,
name
:
"
分类2
"
},
{
id
:
"
3
"
,
name
:
"
分类3
"
},
{
id
:
"
4
"
,
分组
:
"
分组4
"
}
]
groups
:
[],
categorys
:
[]
};
},
methods
:
{
...
...
@@ -271,7 +96,7 @@ export default {
processModel
.
nodes
=
JSON
.
parse
(
JSON
.
stringify
(
obj
.
nodes
))
processModel
.
nodes
.
map
(
item
=>
{
if
(
item
.
assignValue
){
item
.
assignValue
=
String
(
item
.
assignValue
)
item
.
assignValue
=
"
,
"
+
String
(
item
.
assignValue
)
+
"
,
"
}
})
if
(
!
processModel
.
id
){
...
...
@@ -328,7 +153,7 @@ export default {
if
(
res
.
code
==
0
){
res
.
data
.
reworkflowProcess
.
nodes
.
map
(
item
=>
{
if
(
item
.
assignValue
){
const
watiUseArr
=
item
.
assignValue
.
split
(
"
,
"
)
const
watiUseArr
=
item
.
assignValue
.
substr
(
1
,
item
.
assignValue
.
length
-
2
)
.
split
(
"
,
"
)
if
(
item
.
assignType
==
'
user
'
){
item
.
assignValue
=
[]
watiUseArr
.
map
(
i
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录