Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
work-order-web
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
张圳龙
work-order-web
Commits
54340b89
Commit
54340b89
authored
Jul 21, 2020
by
YuleiLan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加流程创建验证。
parent
e72ae80f
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
93 additions
and
14 deletions
+93
-14
DefaultDetail.vue
src/components/wfd/components/DetailPanel/DefaultDetail.vue
+2
-2
FlowDetail.vue
src/components/wfd/components/DetailPanel/FlowDetail.vue
+1
-1
HandleNodeDetail.vue
...omponents/wfd/components/DetailPanel/HandleNodeDetail.vue
+4
-4
UserTaskDetail.vue
src/components/wfd/components/DetailPanel/UserTaskDetail.vue
+4
-4
Wfd.vue
src/components/wfd/components/Wfd.vue
+43
-2
process-manager.vue
src/views/process/admin/process-manager.vue
+39
-1
No files found.
src/components/wfd/components/DetailPanel/DefaultDetail.vue
View file @
54340b89
<
template
>
<div>
<div
class=
"panelRow"
>
<div>
{{
i18n
[
'label'
]
}}
:
</div>
<div>
<span
style=
"color: red"
>
*
</span>
{{
i18n
[
'label'
]
}}
:
</div>
<el-input
style=
"width:90%; font-size:12px"
:disabled=
"readOnly"
...
...
@@ -10,7 +10,7 @@
/>
</div>
<div
class=
"panelRow"
>
<div>
顺序:
</div>
<div>
<span
style=
"color: red"
>
*
</span>
顺序:
</div>
<el-input
style=
"width:90%; font-size:12px"
:disabled=
"readOnly"
...
...
src/components/wfd/components/DetailPanel/FlowDetail.vue
View file @
54340b89
...
...
@@ -4,7 +4,7 @@
<div
class=
"panelBody"
>
<DefaultDetail
:model=
"model"
:on-change=
"onChange"
:read-only=
"readOnly"
/>
<div
class=
"panelRow"
>
<div>
属性:
</div>
<div>
<span
style=
"color: red"
>
*
</span>
属性:
</div>
<el-select
style=
"width:90%; font-size:12px"
placeholder=
"选择流转属性"
...
...
src/components/wfd/components/DetailPanel/HandleNodeDetail.vue
View file @
54340b89
...
...
@@ -19,7 +19,7 @@
</el-select>
</div>
<div
class=
"panelRow"
>
<div>
{{
i18n
[
'handleNode.assignType'
]
}}
:
</div>
<div>
<span
style=
"color: red"
>
*
</span>
{{
i18n
[
'handleNode.assignType'
]
}}
:
</div>
<el-select
style=
"width:90%; font-size: 12px"
:placeholder=
"i18n['handleNode.assignType.placeholder']"
...
...
@@ -34,7 +34,7 @@
</el-select>
</div>
<div
v-if=
"model.assignType === 'person'"
class=
"panelRow"
>
<div>
{{
i18n
[
'handleNode.assignType.person.title'
]
}}
:
</div>
<div>
<span
style=
"color: red"
>
*
</span>
{{
i18n
[
'handleNode.assignType.person.title'
]
}}
:
</div>
<el-select
style=
"width:90%; font-size:12px"
:placeholder=
"i18n['handleNode.assignType.person.placeholder']"
...
...
@@ -64,7 +64,7 @@
</el-select>
</div>
-->
<div
v-else-if=
"model.assignType === 'department'"
class=
"panelRow"
>
<div>
{{
i18n
[
'handleNode.assignType.department.title'
]
}}
:
</div>
<div>
<span
style=
"color: red"
>
*
</span>
{{
i18n
[
'handleNode.assignType.department.title'
]
}}
:
</div>
<el-select
style=
"width:90%; font-size:12px"
:placeholder=
"i18n['handleNode.assignType.department.placeholder']"
...
...
@@ -84,7 +84,7 @@
</el-select>
</div>
<div
v-else-if=
"model.assignType === 'variable'"
class=
"panelRow"
>
<div>
{{
i18n
[
'handleNode.assignType.variable.title'
]
}}
:
</div>
<div>
<span
style=
"color: red"
>
*
</span>
{{
i18n
[
'handleNode.assignType.variable.title'
]
}}
:
</div>
<el-select
v-model
.
number=
"model.assignValue"
style=
"width:90%; font-size:12px"
...
...
src/components/wfd/components/DetailPanel/UserTaskDetail.vue
View file @
54340b89
...
...
@@ -19,7 +19,7 @@
</el-select>
</div>
<div
class=
"panelRow"
>
<div>
{{
i18n
[
'userTask.assignType'
]
}}
:
</div>
<div>
<span
style=
"color: red"
>
*
</span>
{{
i18n
[
'userTask.assignType'
]
}}
:
</div>
<el-select
style=
"width:90%; font-size: 12px"
:placeholder=
"i18n['userTask.assignType.placeholder']"
...
...
@@ -34,7 +34,7 @@
</el-select>
</div>
<div
v-if=
"model.assignType === 'person'"
class=
"panelRow"
>
<div>
{{
i18n
[
'userTask.assignType.person.title'
]
}}
:
</div>
<div>
<span
style=
"color: red"
>
*
</span>
{{
i18n
[
'userTask.assignType.person.title'
]
}}
:
</div>
<el-select
style=
"width:90%; font-size:12px"
:placeholder=
"i18n['userTask.assignType.person.placeholder']"
...
...
@@ -64,7 +64,7 @@
</el-select>
</div>
-->
<div
v-else-if=
"model.assignType === 'department'"
class=
"panelRow"
>
<div>
{{
i18n
[
'userTask.assignType.department.title'
]
}}
:
</div>
<div>
<span
style=
"color: red"
>
*
</span>
{{
i18n
[
'userTask.assignType.department.title'
]
}}
:
</div>
<el-select
style=
"width:90%; font-size:12px"
:placeholder=
"i18n['userTask.assignType.department.placeholder']"
...
...
@@ -79,7 +79,7 @@
</el-select>
</div>
<div
v-else-if=
"model.assignType === 'variable'"
class=
"panelRow"
>
<div>
{{
i18n
[
'userTask.assignType.variable.title'
]
}}
:
</div>
<div>
<span
style=
"color: red"
>
*
</span>
{{
i18n
[
'userTask.assignType.variable.title'
]
}}
:
</div>
<el-select
v-model
.
number=
"model.assignValue"
style=
"width:90%; font-size:12px"
...
...
src/components/wfd/components/Wfd.vue
View file @
54340b89
...
...
@@ -95,6 +95,7 @@ export default {
return
{
resizeFunc
:
()
=>
{},
selectedModel
:
{},
previous
:
''
,
processModel
:
{
id
:
''
,
name
:
''
,
...
...
@@ -179,14 +180,49 @@ export default {
}
return
data
},
verifyProcess
(
pv
)
{
if
(
pv
.
label
===
undefined
||
pv
.
label
===
null
||
pv
.
label
===
''
)
{
return
'标题不能为空'
}
else
if
(
pv
.
sort
===
undefined
||
pv
.
sort
===
null
||
pv
.
sort
===
''
)
{
return
'顺序不能为空'
}
if
(
pv
.
clazz
===
'userTask'
||
pv
.
clazz
===
'receiveTask'
)
{
if
(
pv
.
assignType
===
undefined
||
pv
.
assignType
===
null
||
pv
.
assignType
===
''
)
{
return
'审批节点或处理节点的处理人类型不能为空'
}
else
if
(
pv
.
assignValue
===
undefined
||
pv
.
assignValue
===
null
||
pv
.
assignValue
===
''
||
pv
.
assignValue
.
length
===
0
)
{
return
'审批节点或处理节点的处理人不能为空'
}
}
if
(
pv
.
clazz
===
'flow'
)
{
if
(
pv
.
flowProperties
===
undefined
||
pv
.
flowProperties
===
null
||
pv
.
flowProperties
===
''
)
{
return
'流转属性不能为空'
}
}
return
''
},
initEvents
()
{
this
.
graph
.
on
(
'afteritemselected'
,
(
items
)
=>
{
if
(
items
&&
items
.
length
>
0
)
{
if
(
this
.
previous
!==
''
)
{
// 1. 获取之前的数据
var
previousValue
=
''
const
item
=
this
.
graph
.
findById
(
this
.
previous
[
0
])
previousValue
=
{
...
item
.
getModel
()
}
var
err
=
this
.
verifyProcess
(
previousValue
)
if
(
err
!==
''
)
{
this
.
selectedModel
=
previousValue
this
.
$message
.
error
(
err
)
return
}
}
const
item
=
this
.
graph
.
findById
(
items
[
0
])
this
.
selectedModel
=
{
...
item
.
getModel
()
}
this
.
previous
=
items
}
else
{
if
(
this
.
previous
!==
''
)
{
this
.
selectedModel
=
this
.
processModel
}
}
})
const
page
=
this
.
$refs
[
'canvas'
]
const
graph
=
this
.
graph
...
...
@@ -197,7 +233,12 @@ export default {
window
.
addEventListener
(
'resize'
,
this
.
resizeFunc
)
},
onItemCfgChange
(
key
,
value
)
{
const
items
=
this
.
graph
.
get
(
'selectedItems'
)
var
items
=
''
if
(
this
.
previous
.
length
!==
0
)
{
items
=
[
this
.
previous
[
0
]]
}
else
{
items
=
this
.
graph
.
get
(
'selectedItems'
)
}
if
(
items
&&
items
.
length
>
0
)
{
const
item
=
this
.
graph
.
findById
(
items
[
0
])
if
(
this
.
graph
.
executeCommand
)
{
...
...
src/views/process/admin/process-manager.vue
View file @
54340b89
...
...
@@ -327,8 +327,40 @@ export default {
})
})
},
submitForm
(
formName
)
{
verifyProcess
(
)
{
this
.
ruleForm
.
structure
=
this
.
$refs
.
wfd
.
graph
.
save
()
console
.
log
(
this
.
ruleForm
.
structure
)
for
(
var
r
of
this
.
ruleForm
.
structure
.
nodes
)
{
if
(
r
.
sort
===
undefined
||
r
.
sort
===
null
||
r
.
sort
===
''
)
{
return
'流程节点顺序不能为空'
}
else
if
(
r
.
label
===
undefined
||
r
.
label
===
null
||
r
.
label
===
''
)
{
return
'流程节点标题不能为空'
}
if
(
r
.
clazz
===
'userTask'
||
r
.
clazz
===
'receiveTask'
)
{
if
(
r
.
assignType
===
undefined
||
r
.
assignType
===
null
||
r
.
assignType
===
''
)
{
return
'审批节点或处理节点的处理人类型不能为空'
}
else
if
(
r
.
assignValue
===
undefined
||
r
.
assignValue
===
null
||
r
.
assignValue
===
''
||
r
.
assignValue
.
length
===
0
)
{
return
'审批节点或处理节点的处理人不能为空'
}
}
}
for
(
var
e
of
this
.
ruleForm
.
structure
.
edges
)
{
if
(
e
.
sort
===
undefined
||
e
.
sort
===
null
||
e
.
sort
===
''
)
{
return
'流转顺序不能为空'
}
else
if
(
e
.
label
===
undefined
||
e
.
label
===
null
||
e
.
label
===
''
)
{
return
'流转标题不能为空'
}
else
if
(
e
.
flowProperties
===
undefined
||
e
.
flowProperties
===
null
||
e
.
flowProperties
===
''
)
{
return
'流转属性不能为空'
}
}
return
''
},
submitForm
(
formName
)
{
var
r
=
this
.
verifyProcess
()
if
(
r
!==
''
)
{
this
.
$message
.
error
(
r
)
return
}
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
this
.
ruleForm
.
structure
.
nodes
.
length
>
0
&&
this
.
ruleForm
.
structure
.
edges
.
length
>
0
)
{
...
...
@@ -343,6 +375,12 @@ export default {
})
},
editForm
(
formName
)
{
var
r
=
this
.
verifyProcess
()
console
.
log
(
r
)
if
(
r
!==
''
)
{
this
.
$message
.
error
(
r
)
return
}
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
var
structureValue
=
this
.
$refs
.
wfd
.
graph
.
save
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment