Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
nizhengjia888
gin-vue-admin
提交
91fd0658
G
gin-vue-admin
项目概览
nizhengjia888
/
gin-vue-admin
与 Fork 源项目一致
Fork自
FLIPPED-AURORA / gin-vue-admin
通知
3
Star
0
Fork
0
代码
文件
提交
分支
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,体验更适合开发者的 AI 搜索 >>
提交
91fd0658
编写于
10月 31, 2020
作者:
Mr.奇淼(
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
工作流增删改查功能完善
上级
7ffbdc31
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
314 addition
and
334 deletion
+314
-334
server/cmd/datas/init.go
server/cmd/datas/init.go
+0
-49
server/model/wf_process.go
server/model/wf_process.go
+3
-3
server/service/wk_process.go
server/service/wk_process.go
+59
-3
web/src/view/workflow/workflowCreate/workflowCreate.vue
web/src/view/workflow/workflowCreate/workflowCreate.vue
+181
-174
web/src/view/workflow/workflowProcess/workflowProcess.vue
web/src/view/workflow/workflowProcess/workflowProcess.vue
+71
-105
未找到文件。
server/cmd/datas/init.go
浏览文件 @
91fd0658
...
@@ -56,52 +56,3 @@ func InitMysqlTables(db *gorm.DB) {
...
@@ -56,52 +56,3 @@ func InitMysqlTables(db *gorm.DB) {
}
}
color
.
Info
.
Println
(
"[Mysql]-->初始化数据表成功"
)
color
.
Info
.
Println
(
"[Mysql]-->初始化数据表成功"
)
}
}
func
InitPostgresqlData
(
db
*
gorm
.
DB
)
{
var
err
error
err
=
InitSysApi
(
db
)
err
=
InitSysUser
(
db
)
err
=
InitExaCustomer
(
db
)
err
=
InitCasbinModel
(
db
)
err
=
InitSysAuthority
(
db
)
err
=
InitSysBaseMenus
(
db
)
err
=
InitAuthorityMenu
(
db
)
err
=
InitSysAuthorityMenus
(
db
)
err
=
InitSysDataAuthorityId
(
db
)
err
=
InitSysDictionaryDetail
(
db
)
err
=
InitExaFileUploadAndDownload
(
db
)
err
=
InitSysDictionaryToPostgresql
(
db
)
if
err
!=
nil
{
color
.
Error
.
Printf
(
"[Postgresql]-->初始化数据失败,err: %v
\n
"
,
err
)
os
.
Exit
(
0
)
}
color
.
Info
.
Println
(
"[Postgresql]-->初始化数据成功"
)
}
func
InitPostgresqlTables
(
db
*
gorm
.
DB
)
{
var
err
error
if
!
db
.
Migrator
()
.
HasTable
(
"casbin_rule"
)
{
err
=
db
.
Migrator
()
.
CreateTable
(
&
gormadapter
.
CasbinRule
{})
}
err
=
db
.
AutoMigrate
(
model
.
SysApi
{},
model
.
SysUser
{},
model
.
ExaFile
{},
model
.
ExaCustomer
{},
model
.
SysBaseMenu
{},
model
.
SysAuthority
{},
model
.
JwtBlacklist
{},
model
.
ExaFileChunk
{},
model
.
ExaSimpleUploader
{},
model
.
SysOperationRecord
{},
model
.
SysDictionaryDetail
{},
model
.
SysBaseMenuParameter
{},
model
.
ExaFileUploadAndDownload
{},
SysDictionaryToPostgresql
{},
)
if
err
!=
nil
{
color
.
Error
.
Printf
(
"[Postgresql]-->初始化数据表失败,err: %v
\n
"
,
err
)
os
.
Exit
(
0
)
}
color
.
Info
.
Println
(
"[Postgresql]-->初始化数据表成功"
)
}
server/model/wf_process.go
浏览文件 @
91fd0658
...
@@ -10,7 +10,7 @@ type WorkflowProcess struct {
...
@@ -10,7 +10,7 @@ type WorkflowProcess struct {
ID
string
`json:"id" form:"id" gorm:"comment:流程标识;primaryKey;unique;not null"`
ID
string
`json:"id" form:"id" gorm:"comment:流程标识;primaryKey;unique;not null"`
CreatedAt
time
.
Time
CreatedAt
time
.
Time
UpdatedAt
time
.
Time
UpdatedAt
time
.
Time
DeletedAt
gorm
.
DeletedAt
`gorm:"index"`
DeletedAt
gorm
.
DeletedAt
`
json:"-"
gorm:"index"`
Name
string
`json:"name" gorm:"comment:流程名称"`
Name
string
`json:"name" gorm:"comment:流程名称"`
Category
string
`json:"category" gorm:"comment:分类"`
Category
string
`json:"category" gorm:"comment:分类"`
Clazz
string
`json:"clazz" gorm:"comment:类型"`
Clazz
string
`json:"clazz" gorm:"comment:类型"`
...
@@ -25,7 +25,7 @@ type WorkflowNode struct {
...
@@ -25,7 +25,7 @@ type WorkflowNode struct {
ID
string
`json:"id" form:"id" gorm:"comment:节点id;primaryKey;unique;not null"`
ID
string
`json:"id" form:"id" gorm:"comment:节点id;primaryKey;unique;not null"`
CreatedAt
time
.
Time
CreatedAt
time
.
Time
UpdatedAt
time
.
Time
UpdatedAt
time
.
Time
DeletedAt
gorm
.
DeletedAt
`gorm:"index"`
DeletedAt
gorm
.
DeletedAt
`
json:"-"
gorm:"index"`
WorkflowProcessID
string
`json:"-" gorm:"comment:流程标识"`
WorkflowProcessID
string
`json:"-" gorm:"comment:流程标识"`
Clazz
string
`json:"clazz" gorm:"comment:节点类型"`
Clazz
string
`json:"clazz" gorm:"comment:节点类型"`
Label
string
`json:"label" gorm:"comment:节点名称"`
Label
string
`json:"label" gorm:"comment:节点名称"`
...
@@ -48,7 +48,7 @@ type WorkflowEdge struct {
...
@@ -48,7 +48,7 @@ type WorkflowEdge struct {
ID
string
`json:"id" form:"id" gorm:"comment:唯一标识;primaryKey;unique;not null"`
ID
string
`json:"id" form:"id" gorm:"comment:唯一标识;primaryKey;unique;not null"`
CreatedAt
time
.
Time
CreatedAt
time
.
Time
UpdatedAt
time
.
Time
UpdatedAt
time
.
Time
DeletedAt
gorm
.
DeletedAt
`gorm:"index"`
DeletedAt
gorm
.
DeletedAt
`
json:"-"
gorm:"index"`
WorkflowProcessID
string
`json:"-" gorm:"comment:流程标识"`
WorkflowProcessID
string
`json:"-" gorm:"comment:流程标识"`
Clazz
string
`json:"clazz" gorm:"comment:类型(线)"`
Clazz
string
`json:"clazz" gorm:"comment:类型(线)"`
Source
string
`json:"source" gorm:"comment:起点节点"`
Source
string
`json:"source" gorm:"comment:起点节点"`
...
...
server/service/wk_process.go
浏览文件 @
91fd0658
...
@@ -4,6 +4,7 @@ import (
...
@@ -4,6 +4,7 @@ import (
"gin-vue-admin/global"
"gin-vue-admin/global"
"gin-vue-admin/model"
"gin-vue-admin/model"
"gin-vue-admin/model/request"
"gin-vue-admin/model/request"
"gorm.io/gorm"
)
)
// @title CreateWorkflowProcess
// @title CreateWorkflowProcess
...
@@ -24,7 +25,27 @@ func CreateWorkflowProcess(workflowProcess model.WorkflowProcess) (err error) {
...
@@ -24,7 +25,27 @@ func CreateWorkflowProcess(workflowProcess model.WorkflowProcess) (err error) {
// @return error
// @return error
func
DeleteWorkflowProcess
(
workflowProcess
model
.
WorkflowProcess
)
(
err
error
)
{
func
DeleteWorkflowProcess
(
workflowProcess
model
.
WorkflowProcess
)
(
err
error
)
{
err
=
global
.
GVA_DB
.
Delete
(
workflowProcess
)
.
Error
err
=
global
.
GVA_DB
.
Transaction
(
func
(
tx
*
gorm
.
DB
)
error
{
var
txErr
error
txErr
=
tx
.
Delete
(
workflowProcess
)
.
Error
if
txErr
!=
nil
{
return
txErr
}
var
edges
[]
model
.
WorkflowEdge
txErr
=
tx
.
Delete
(
model
.
WorkflowNode
{},
"workflow_process_id = ?"
,
workflowProcess
.
ID
)
.
Error
if
txErr
!=
nil
{
return
txErr
}
txErr
=
tx
.
Find
(
&
edges
,
"workflow_process_id = ?"
,
workflowProcess
.
ID
)
.
Error
if
txErr
!=
nil
{
return
txErr
}
txErr
=
tx
.
Select
(
"StartPoint"
,
"EndPoint"
)
.
Delete
(
&
edges
)
.
Error
if
txErr
!=
nil
{
return
txErr
}
return
nil
})
return
err
return
err
}
}
...
@@ -46,8 +67,43 @@ func DeleteWorkflowProcessByIds(ids request.IdsReq) (err error) {
...
@@ -46,8 +67,43 @@ func DeleteWorkflowProcessByIds(ids request.IdsReq) (err error) {
// @return error
// @return error
func
UpdateWorkflowProcess
(
workflowProcess
*
model
.
WorkflowProcess
)
(
err
error
)
{
func
UpdateWorkflowProcess
(
workflowProcess
*
model
.
WorkflowProcess
)
(
err
error
)
{
err
=
global
.
GVA_DB
.
Save
(
workflowProcess
)
.
Error
return
global
.
GVA_DB
.
Transaction
(
func
(
tx
*
gorm
.
DB
)
error
{
return
err
var
txErr
error
var
edges
[]
model
.
WorkflowEdge
var
edgesIds
[]
string
txErr
=
tx
.
Unscoped
()
.
Delete
(
workflowProcess
)
.
Error
if
txErr
!=
nil
{
return
txErr
}
txErr
=
tx
.
Unscoped
()
.
Delete
(
model
.
WorkflowNode
{},
"workflow_process_id = ?"
,
workflowProcess
.
ID
)
.
Error
if
txErr
!=
nil
{
return
txErr
}
txErr
=
tx
.
Unscoped
()
.
Find
(
&
edges
,
"workflow_process_id = ?"
,
workflowProcess
.
ID
)
.
Error
if
txErr
!=
nil
{
return
txErr
}
txErr
=
tx
.
Unscoped
()
.
Delete
(
&
edges
)
.
Error
if
txErr
!=
nil
{
return
txErr
}
for
_
,
v
:=
range
edges
{
edgesIds
=
append
(
edgesIds
,
v
.
ID
)
}
txErr
=
tx
.
Unscoped
()
.
Delete
(
model
.
WorkflowStartPoint
{},
"workflow_edge_id in ?"
,
edgesIds
)
.
Error
if
txErr
!=
nil
{
return
txErr
}
txErr
=
tx
.
Unscoped
()
.
Delete
(
model
.
WorkflowEndPoint
{},
"workflow_edge_id in ?"
,
edgesIds
)
.
Error
if
txErr
!=
nil
{
return
txErr
}
txErr
=
tx
.
Create
(
&
workflowProcess
)
.
Error
if
txErr
!=
nil
{
return
txErr
}
return
nil
})
}
}
// @title GetWorkflowProcess
// @title GetWorkflowProcess
...
...
web/src/view/workflow/workflowCreate/workflowCreate.vue
浏览文件 @
91fd0658
...
@@ -51,7 +51,8 @@
...
@@ -51,7 +51,8 @@
<
script
>
<
script
>
import
{
import
{
findWorkflowProcess
,
findWorkflowProcess
,
createWorkflowProcess
createWorkflowProcess
,
updateWorkflowProcess
}
from
"
@/api/workflowProcess
"
;
// 此处请自行替换地址
}
from
"
@/api/workflowProcess
"
;
// 此处请自行替换地址
import
gvaWfd
from
"
@/components/gva-wfd
"
;
import
gvaWfd
from
"
@/components/gva-wfd
"
;
import
{
getUserList
}
from
"
@/api/user
"
;
import
{
getUserList
}
from
"
@/api/user
"
;
...
@@ -67,174 +68,174 @@ export default {
...
@@ -67,174 +68,174 @@ export default {
lang
:
"
zh
"
,
lang
:
"
zh
"
,
done
:
false
,
done
:
false
,
demoData
:
{
demoData
:
{
//
nodes: [
nodes
:
[
//
{
{
//
clazz: "start",
clazz
:
"
start
"
,
//
label: "发起请假",
label
:
"
发起请假
"
,
//
type: "start-node",
type
:
"
start-node
"
,
//
shape: "start-node",
shape
:
"
start-node
"
,
//
x: 110,
x
:
110
,
//
y: 195,
y
:
195
,
//
id: "start1603681292875",
id
:
"
start1603681292875
"
,
//
style: {}
style
:
{}
//
},
},
//
{
{
//
clazz: "parallelGateway",
clazz
:
"
parallelGateway
"
,
//
label: "会签",
label
:
"
会签
"
,
//
type: "parallel-gateway-node",
type
:
"
parallel-gateway-node
"
,
//
shape: "parallel-gateway-node",
shape
:
"
parallel-gateway-node
"
,
//
x: 228,
x
:
228
,
//
y: 195,
y
:
195
,
//
id: "parallelGateway1603681296419",
id
:
"
parallelGateway1603681296419
"
,
//
style: {}
style
:
{}
//
},
},
//
{
{
//
clazz: "userTask",
clazz
:
"
userTask
"
,
//
label: "审批人1",
label
:
"
审批人1
"
,
//
type: "user-task-node",
type
:
"
user-task-node
"
,
//
shape: "user-task-node",
shape
:
"
user-task-node
"
,
//
x: 372,
x
:
372
,
//
y: 84,
y
:
84
,
//
id: "userTask1603681299962",
id
:
"
userTask1603681299962
"
,
//
style: {},
style
:
{},
//
assignValue: 1,
assignValue
:
1
,
//
assignType: "user"
assignType
:
"
user
"
//
},
},
//
{
{
//
clazz: "userTask",
clazz
:
"
userTask
"
,
//
label: "审批人2",
label
:
"
审批人2
"
,
//
type: "user-task-node",
type
:
"
user-task-node
"
,
//
shape: "user-task-node",
shape
:
"
user-task-node
"
,
//
x: 370,
x
:
370
,
//
y: 321,
y
:
321
,
//
id: "userTask1603681302372",
id
:
"
userTask1603681302372
"
,
//
style: {},
style
:
{},
//
assignValue: 2,
assignValue
:
2
,
//
assignType: "user"
assignType
:
"
user
"
//
},
},
//
{
{
//
clazz: "parallelGateway",
clazz
:
"
parallelGateway
"
,
//
label: "会签结果检测",
label
:
"
会签结果检测
"
,
//
type: "parallel-gateway-node",
type
:
"
parallel-gateway-node
"
,
//
shape: "parallel-gateway-node",
shape
:
"
parallel-gateway-node
"
,
//
x: 519,
x
:
519
,
//
y: 195,
y
:
195
,
//
id: "parallelGateway1603681338222",
id
:
"
parallelGateway1603681338222
"
,
//
style: {}
style
:
{}
//
},
},
//
{
{
//
clazz: "end",
clazz
:
"
end
"
,
//
label: "请假失败",
label
:
"
请假失败
"
,
//
type: "end-node",
type
:
"
end-node
"
,
//
shape: "end-node",
shape
:
"
end-node
"
,
//
x: 704,
x
:
704
,
//
y: 317,
y
:
317
,
//
id: "end1603681358043",
id
:
"
end1603681358043
"
,
//
style: {}
style
:
{}
//
},
},
//
{
{
//
clazz: "end",
clazz
:
"
end
"
,
//
label: "请假成功",
label
:
"
请假成功
"
,
//
type: "end-node",
type
:
"
end-node
"
,
//
shape: "end-node",
shape
:
"
end-node
"
,
//
x: 706.5,
x
:
706.5
,
//
y: 55.5,
y
:
55.5
,
//
id: "end1603681360882",
id
:
"
end1603681360882
"
,
//
style: {}
style
:
{}
//
}
}
//
],
],
//
edges: [
edges
:
[
//
{
{
//
id: "flow1603681320738",
id
:
"
flow1603681320738
"
,
//
clazz: "flow",
clazz
:
"
flow
"
,
//
source: "parallelGateway1603681296419",
source
:
"
parallelGateway1603681296419
"
,
//
target: "userTask1603681299962",
target
:
"
userTask1603681299962
"
,
//
sourceAnchor: 0,
sourceAnchor
:
0
,
//
targetAnchor: 3,
targetAnchor
:
3
,
//
shape: "flow-polyline-round",
shape
:
"
flow-polyline-round
"
,
//
style: {},
style
:
{},
//
startPoint: { x: 228, y: 169, index: 0 },
startPoint
:
{
x
:
228
,
y
:
169
,
index
:
0
},
//
endPoint: { x: 321.5, y: 84, index: 3 }
endPoint
:
{
x
:
321.5
,
y
:
84
,
index
:
3
}
//
},
},
//
{
{
//
id: "flow1603681321969",
id
:
"
flow1603681321969
"
,
//
clazz: "flow",
clazz
:
"
flow
"
,
//
source: "parallelGateway1603681296419",
source
:
"
parallelGateway1603681296419
"
,
//
target: "userTask1603681302372",
target
:
"
userTask1603681302372
"
,
//
sourceAnchor: 2,
sourceAnchor
:
2
,
//
targetAnchor: 3,
targetAnchor
:
3
,
//
shape: "flow-polyline-round",
shape
:
"
flow-polyline-round
"
,
//
style: {},
style
:
{},
//
startPoint: { x: 228, y: 221, index: 2 },
startPoint
:
{
x
:
228
,
y
:
221
,
index
:
2
},
//
endPoint: { x: 319.5, y: 321, index: 3 }
endPoint
:
{
x
:
319.5
,
y
:
321
,
index
:
3
}
//
},
},
//
{
{
//
id: "flow1603681323274",
id
:
"
flow1603681323274
"
,
//
clazz: "flow",
clazz
:
"
flow
"
,
//
source: "start1603681292875",
source
:
"
start1603681292875
"
,
//
target: "parallelGateway1603681296419",
target
:
"
parallelGateway1603681296419
"
,
//
sourceAnchor: 1,
sourceAnchor
:
1
,
//
targetAnchor: 3,
targetAnchor
:
3
,
//
shape: "flow-polyline-round",
shape
:
"
flow-polyline-round
"
,
//
style: {},
style
:
{},
//
startPoint: { x: 138, y: 195, index: 1 },
startPoint
:
{
x
:
138
,
y
:
195
,
index
:
1
},
//
endPoint: { x: 202, y: 195, index: 3 },
endPoint
:
{
x
:
202
,
y
:
195
,
index
:
3
},
//
label: "发起",
label
:
"
发起
"
,
//
conditionExpression: "complete"
conditionExpression
:
"
complete
"
//
},
},
//
{
{
//
id: "flow1603681341777",
id
:
"
flow1603681341777
"
,
//
clazz: "flow",
clazz
:
"
flow
"
,
//
source: "userTask1603681299962",
source
:
"
userTask1603681299962
"
,
//
target: "parallelGateway1603681338222",
target
:
"
parallelGateway1603681338222
"
,
//
sourceAnchor: 1,
sourceAnchor
:
1
,
//
targetAnchor: 3,
targetAnchor
:
3
,
//
shape: "flow-polyline-round",
shape
:
"
flow-polyline-round
"
,
//
style: {},
style
:
{},
//
startPoint: { x: 422.5, y: 84, index: 1 },
startPoint
:
{
x
:
422.5
,
y
:
84
,
index
:
1
},
//
endPoint: { x: 493, y: 195, index: 3 }
endPoint
:
{
x
:
493
,
y
:
195
,
index
:
3
}
//
},
},
//
{
{
//
id: "flow1603681343425",
id
:
"
flow1603681343425
"
,
//
clazz: "flow",
clazz
:
"
flow
"
,
//
source: "userTask1603681302372",
source
:
"
userTask1603681302372
"
,
//
target: "parallelGateway1603681338222",
target
:
"
parallelGateway1603681338222
"
,
//
sourceAnchor: 1,
sourceAnchor
:
1
,
//
targetAnchor: 3,
targetAnchor
:
3
,
//
shape: "flow-polyline-round",
shape
:
"
flow-polyline-round
"
,
//
style: {},
style
:
{},
//
startPoint: { x: 420.5, y: 321, index: 1 },
startPoint
:
{
x
:
420.5
,
y
:
321
,
index
:
1
},
//
endPoint: { x: 493, y: 195, index: 3 }
endPoint
:
{
x
:
493
,
y
:
195
,
index
:
3
}
//
},
},
//
{
{
//
id: "flow1603681362913",
id
:
"
flow1603681362913
"
,
//
clazz: "flow",
clazz
:
"
flow
"
,
//
source: "parallelGateway1603681338222",
source
:
"
parallelGateway1603681338222
"
,
//
target: "end1603681360882",
target
:
"
end1603681360882
"
,
//
sourceAnchor: 0,
sourceAnchor
:
0
,
//
targetAnchor: 2,
targetAnchor
:
2
,
//
shape: "flow-polyline-round",
shape
:
"
flow-polyline-round
"
,
//
style: {},
style
:
{},
//
startPoint: { x: 519, y: 169, index: 0 },
startPoint
:
{
x
:
519
,
y
:
169
,
index
:
0
},
//
endPoint: { x: 678.5, y: 55.5, index: 2 },
endPoint
:
{
x
:
678.5
,
y
:
55.5
,
index
:
2
},
//
conditionExpression: "complete",
conditionExpression
:
"
complete
"
,
//
label: "所有人同意"
label
:
"
所有人同意
"
//
},
},
//
{
{
//
id: "flow1603681392729",
id
:
"
flow1603681392729
"
,
//
clazz: "flow",
clazz
:
"
flow
"
,
//
source: "parallelGateway1603681338222",
source
:
"
parallelGateway1603681338222
"
,
//
target: "end1603681358043",
target
:
"
end1603681358043
"
,
//
sourceAnchor: 2,
sourceAnchor
:
2
,
//
targetAnchor: 2,
targetAnchor
:
2
,
//
shape: "flow-polyline-round",
shape
:
"
flow-polyline-round
"
,
//
style: {},
style
:
{},
//
startPoint: { x: 519, y: 221, index: 2 },
startPoint
:
{
x
:
519
,
y
:
221
,
index
:
2
},
//
endPoint: { x: 676, y: 317, index: 2 },
endPoint
:
{
x
:
676
,
y
:
317
,
index
:
2
},
//
conditionExpression: "reject",
conditionExpression
:
"
reject
"
,
//
label: "任何一人拒绝"
label
:
"
任何一人拒绝
"
//
}
}
//
],
],
},
},
wkType
:
"
create
"
,
wkType
:
"
create
"
,
users
:
[],
users
:
[],
...
@@ -275,17 +276,23 @@ export default {
...
@@ -275,17 +276,23 @@ export default {
})
})
return
return
}
}
// if(this.$route.query.type == 'edit'){
if
(
this
.
$route
.
query
.
type
==
'
edit
'
){
// // 等待调用编辑功能
const
res
=
await
updateWorkflowProcess
(
processModel
)
// }else{
if
(
res
.
code
==
0
){
this
.
$message
({
type
:
"
success
"
,
message
:
"
编辑成功
"
})
}
}
else
{
const
res
=
await
createWorkflowProcess
(
processModel
)
const
res
=
await
createWorkflowProcess
(
processModel
)
if
(
res
.
success
){
if
(
res
.
code
==
0
){
this
.
$message
({
this
.
$message
({
type
:
"
success
"
,
type
:
"
success
"
,
message
:
"
创建成功
"
message
:
"
创建成功
"
})
})
}
}
//
}
}
},
},
saveXML
()
{
saveXML
()
{
console
.
log
(
this
.
$refs
[
"
wfd
"
].
graph
.
saveXML
());
console
.
log
(
this
.
$refs
[
"
wfd
"
].
graph
.
saveXML
());
...
...
web/src/view/workflow/workflowProcess/workflowProcess.vue
浏览文件 @
91fd0658
...
@@ -6,10 +6,7 @@
...
@@ -6,10 +6,7 @@
<el-input
placeholder=
"搜索条件"
v-model=
"searchInfo.name"
></el-input>
<el-input
placeholder=
"搜索条件"
v-model=
"searchInfo.name"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"流程标题"
>
<el-form-item
label=
"流程标题"
>
<el-input
<el-input
placeholder=
"搜索条件"
v-model=
"searchInfo.label"
></el-input>
placeholder=
"搜索条件"
v-model=
"searchInfo.label"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
<el-button
@
click=
"onSubmit"
type=
"primary"
>
查询
</el-button>
<el-button
@
click=
"onSubmit"
type=
"primary"
>
查询
</el-button>
...
@@ -18,20 +15,10 @@
...
@@ -18,20 +15,10 @@
<el-popover
placement=
"top"
v-model=
"deleteVisible"
width=
"160"
>
<el-popover
placement=
"top"
v-model=
"deleteVisible"
width=
"160"
>
<p>
确定要删除吗?
</p>
<p>
确定要删除吗?
</p>
<div
style=
"text-align: right; margin: 0"
>
<div
style=
"text-align: right; margin: 0"
>
<el-button
@
click=
"deleteVisible = false"
size=
"mini"
type=
"text"
<el-button
@
click=
"deleteVisible = false"
size=
"mini"
type=
"text"
>
取消
</el-button>
>
取消
</el-button
<el-button
@
click=
"onDelete"
size=
"mini"
type=
"primary"
>
确定
</el-button>
>
<el-button
@
click=
"onDelete"
size=
"mini"
type=
"primary"
>
确定
</el-button
>
</div>
</div>
<el-button
<el-button
icon=
"el-icon-delete"
size=
"mini"
slot=
"reference"
type=
"danger"
>
批量删除
</el-button>
icon=
"el-icon-delete"
size=
"mini"
slot=
"reference"
type=
"danger"
>
批量删除
</el-button
>
</el-popover>
</el-popover>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
...
@@ -49,69 +36,35 @@
...
@@ -49,69 +36,35 @@
<el-table-column
label=
"日期"
width=
"180"
>
<el-table-column
label=
"日期"
width=
"180"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
CreatedAt
|
formatDate
}}
</
template
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
CreatedAt
|
formatDate
}}
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"流程名称"
prop=
"name"
width=
"120"
></el-table-column>
label=
"流程名称"
prop=
"name"
width=
"120"
></el-table-column>
<el-table-column
<el-table-column
label=
"分类"
prop=
"category"
width=
"120"
></el-table-column>
label=
"分类"
prop=
"category"
width=
"120"
></el-table-column>
<el-table-column
label=
"类型"
prop=
"clazz"
width=
"120"
></el-table-column>
<el-table-column
label=
"类型"
prop=
"clazz"
width=
"120"
></el-table-column>
<el-table-column
<el-table-column
label=
"流程标题"
prop=
"label"
width=
"120"
></el-table-column>
label=
"流程标题"
prop=
"label"
width=
"120"
></el-table-column>
<el-table-column
label=
"是否隐藏图标"
prop=
"hideIcon"
width=
"120"
>
<el-table-column
label=
"是否隐藏图标"
prop=
"hideIcon"
width=
"120"
>
<
template
slot-scope=
"scope"
>
{{
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
hideIcon
|
formatBoolean
scope
.
row
.
hideIcon
|
formatBoolean
}}
</
template
>
}}
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"详细介绍"
prop=
"description"
width=
"120"
></el-table-column>
label=
"详细介绍"
prop=
"description"
width=
"120"
></el-table-column>
<el-table-column
label=
"按钮组"
>
<el-table-column
label=
"按钮组"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
<el-button
class=
"table-button"
@
click=
"updateWorkflowProcess(scope.row)"
size=
"small"
type=
"primary"
>
变更
</el-button>
@
click=
"updateWorkflowProcess(scope.row)"
<el-button
class=
"table-button"
@
click=
"viewWorkflowProcess(scope.row)"
size=
"small"
type=
"warning"
>
查看
</el-button>
size=
"small"
type=
"primary"
>
变更
</el-button
>
<el-popover
placement=
"top"
width=
"160"
v-model=
"scope.row.visible"
>
<el-popover
placement=
"top"
width=
"160"
v-model=
"scope.row.visible"
>
<p>
确定要删除吗?
</p>
<p>
确定要删除吗?
</p>
<div
style=
"text-align: right; margin: 0"
>
<div
style=
"text-align: right; margin: 0"
>
<el-button
<el-button
size=
"mini"
type=
"text"
@
click=
"scope.row.visible = false"
>
取消
</el-button>
size=
"mini"
<el-button
type=
"primary"
size=
"mini"
@
click=
"deleteWorkflowProcess(scope.row)"
>
确定
</el-button>
type=
"text"
@
click=
"scope.row.visible = false"
>
取消
</el-button
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"deleteWorkflowProcess(scope.row)"
>
确定
</el-button
>
</div>
</div>
<el-button
<el-button
type=
"danger"
icon=
"el-icon-delete"
size=
"mini"
slot=
"reference"
>
删除
</el-button>
type=
"danger"
icon=
"el-icon-delete"
size=
"mini"
slot=
"reference"
>
删除
</el-button
>
</el-popover>
</el-popover>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
@@ -137,7 +90,7 @@ import {
...
@@ -137,7 +90,7 @@ import {
getWorkflowProcessList
getWorkflowProcessList
}
from
"
@/api/workflowProcess
"
;
// 此处请自行替换地址
}
from
"
@/api/workflowProcess
"
;
// 此处请自行替换地址
import
{
formatTimeToStr
}
from
"
@/utils/date
"
;
import
{
formatTimeToStr
}
from
"
@/utils/date
"
;
import
infoList
from
"
@/
components/
mixins/infoList
"
;
import
infoList
from
"
@/mixins/infoList
"
;
export
default
{
export
default
{
name
:
"
WorkflowProcess
"
,
name
:
"
WorkflowProcess
"
,
...
@@ -148,7 +101,7 @@ export default {
...
@@ -148,7 +101,7 @@ export default {
dialogFormVisible
:
false
,
dialogFormVisible
:
false
,
visible
:
false
,
visible
:
false
,
deleteVisible
:
false
,
deleteVisible
:
false
,
multipleSelection
:
[]
,
multipleSelection
:
[]
};
};
},
},
filters
:
{
filters
:
{
...
@@ -162,7 +115,7 @@ export default {
...
@@ -162,7 +115,7 @@ export default {
},
},
formatBoolean
:
function
(
bool
)
{
formatBoolean
:
function
(
bool
)
{
if
(
bool
!=
null
)
{
if
(
bool
!=
null
)
{
return
bool
?
"
是
"
:
"
否
"
;
return
bool
?
"
是
"
:
"
否
"
;
}
else
{
}
else
{
return
""
;
return
""
;
}
}
...
@@ -171,37 +124,49 @@ export default {
...
@@ -171,37 +124,49 @@ export default {
methods
:
{
methods
:
{
//条件搜索前端看此方法
//条件搜索前端看此方法
onSubmit
()
{
onSubmit
()
{
this
.
page
=
1
this
.
page
=
1
;
this
.
pageSize
=
10
this
.
pageSize
=
10
;
if
(
this
.
searchInfo
.
hideIcon
==
""
)
{
if
(
this
.
searchInfo
.
hideIcon
==
""
)
{
this
.
searchInfo
.
hideIcon
=
null
this
.
searchInfo
.
hideIcon
=
null
;
}
}
this
.
getTableData
()
this
.
getTableData
();
},
},
handleSelectionChange
(
val
)
{
handleSelectionChange
(
val
)
{
this
.
multipleSelection
=
val
this
.
multipleSelection
=
val
;
},
},
async
onDelete
()
{
async
onDelete
()
{
const
ids
=
[]
const
ids
=
[];
this
.
multipleSelection
&&
this
.
multipleSelection
&&
this
.
multipleSelection
.
map
(
item
=>
{
this
.
multipleSelection
.
map
(
item
=>
{
ids
.
push
(
item
.
id
)
ids
.
push
(
item
.
id
);
})
});
const
res
=
await
deleteWorkflowProcessByIds
({
ids
})
const
res
=
await
deleteWorkflowProcessByIds
({
ids
});
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
this
.
$message
({
this
.
$message
({
type
:
'
success
'
,
type
:
"
success
"
,
message
:
'
删除成功
'
message
:
"
删除成功
"
})
});
this
.
deleteVisible
=
false
this
.
deleteVisible
=
false
;
this
.
getTableData
()
this
.
getTableData
();
}
}
},
},
async
updateWorkflowProcess
(
row
)
{
async
updateWorkflowProcess
(
row
)
{
this
.
$router
.
push
({
name
:
"
workflowCreate
"
,
query
:{
this
.
$router
.
push
({
id
:
row
.
id
,
name
:
"
workflowCreate
"
,
type
:
'
edit
'
query
:
{
}})
id
:
row
.
id
,
type
:
"
edit
"
}
});
},
async
viewWorkflowProcess
(
row
)
{
this
.
$router
.
push
({
name
:
"
workflowCreate
"
,
query
:
{
id
:
row
.
id
,
type
:
"
view
"
}
});
},
},
async
deleteWorkflowProcess
(
row
)
{
async
deleteWorkflowProcess
(
row
)
{
this
.
visible
=
false
;
this
.
visible
=
false
;
...
@@ -219,7 +184,8 @@ export default {
...
@@ -219,7 +184,8 @@ export default {
}
}
},
},
async
created
()
{
async
created
()
{
await
this
.
getTableData
();}
await
this
.
getTableData
();
}
};
};
</
script
>
</
script
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录