Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
40148166
authored
Jan 10, 2025
by
Lesan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 补充等式左右值form校验
parent
04f4f630
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
5 deletions
+35
-5
src/components/SimpleProcessDesignerV2/src/nodes-config/RouterNodeConfig.vue
+13
-1
src/components/SimpleProcessDesignerV2/src/nodes-config/components/Condition.vue
+22
-4
No files found.
src/components/SimpleProcessDesignerV2/src/nodes-config/RouterNodeConfig.vue
View file @
40148166
...
@@ -42,7 +42,10 @@
...
@@ -42,7 +42,10 @@
>
>
</div>
</div>
</
template
>
</
template
>
<Condition
v-model=
"routerGroups[index]"
/>
<Condition
:ref=
"($event) => (conditionRef[index] = $event)"
v-model=
"routerGroups[index]"
/>
</el-card>
</el-card>
</el-form>
</el-form>
...
@@ -84,8 +87,17 @@ const { nodeName, showInput, clickIcon, blurEvent } = useNodeName(NodeType.ROUTE
...
@@ -84,8 +87,17 @@ const { nodeName, showInput, clickIcon, blurEvent } = useNodeName(NodeType.ROUTE
const
routerGroups
=
ref
<
RouterCondition
[]
>
([])
const
routerGroups
=
ref
<
RouterCondition
[]
>
([])
const
nodeOptions
=
ref
()
const
nodeOptions
=
ref
()
const
conditionRef
=
ref
([])
// 保存配置
// 保存配置
const
saveConfig
=
async
()
=>
{
const
saveConfig
=
async
()
=>
{
// 校验表单
let
valid
=
true
for
(
const
item
of
conditionRef
.
value
)
{
if
(
!
(
await
item
.
validate
()))
{
valid
=
false
}
}
if
(
!
valid
)
return
false
const
showText
=
getShowText
()
const
showText
=
getShowText
()
if
(
!
showText
)
return
false
if
(
!
showText
)
return
false
currentNode
.
value
.
name
=
nodeName
.
value
!
currentNode
.
value
.
name
=
nodeName
.
value
!
...
...
src/components/SimpleProcessDesignerV2/src/nodes-config/components/Condition.vue
View file @
40148166
...
@@ -59,6 +59,14 @@
...
@@ -59,6 +59,14 @@
<div
class=
"flex pt-2"
v-for=
"(rule, rIdx) in equation.rules"
:key=
"rIdx"
>
<div
class=
"flex pt-2"
v-for=
"(rule, rIdx) in equation.rules"
:key=
"rIdx"
>
<div
class=
"mr-2"
>
<div
class=
"mr-2"
>
<el-form-item
:prop=
"`conditionGroups.conditions.${cIdx}.rules.${rIdx}.leftSide`"
:rules=
"{
required: true,
message: '左值不能为空',
trigger: 'change'
}"
>
<el-select
style=
"width: 160px"
v-model=
"rule.leftSide"
>
<el-select
style=
"width: 160px"
v-model=
"rule.leftSide"
>
<el-option
<el-option
v-for=
"(field, fIdx) in fieldOptions"
v-for=
"(field, fIdx) in fieldOptions"
...
@@ -68,6 +76,7 @@
...
@@ -68,6 +76,7 @@
:disabled=
"!field.required"
:disabled=
"!field.required"
/>
/>
</el-select>
</el-select>
</el-form-item>
</div>
</div>
<div
class=
"mr-2"
>
<div
class=
"mr-2"
>
<el-select
v-model=
"rule.opCode"
style=
"width: 100px"
>
<el-select
v-model=
"rule.opCode"
style=
"width: 100px"
>
...
@@ -80,7 +89,16 @@
...
@@ -80,7 +89,16 @@
</el-select>
</el-select>
</div>
</div>
<div
class=
"mr-2"
>
<div
class=
"mr-2"
>
<el-form-item
:prop=
"`conditionGroups.conditions.${cIdx}.rules.${rIdx}.rightSide`"
:rules=
"{
required: true,
message: '右值不能为空',
trigger: 'blur'
}"
>
<el-input
v-model=
"rule.rightSide"
style=
"width: 160px"
/>
<el-input
v-model=
"rule.rightSide"
style=
"width: 160px"
/>
</el-form-item>
</div>
</div>
<div
class=
"mr-1 flex items-center"
v-if=
"equation.rules.length > 1"
>
<div
class=
"mr-1 flex items-center"
v-if=
"equation.rules.length > 1"
>
<Icon
icon=
"ep:delete"
:size=
"18"
@
click=
"deleteConditionRule(equation, rIdx)"
/>
<Icon
icon=
"ep:delete"
:size=
"18"
@
click=
"deleteConditionRule(equation, rIdx)"
/>
...
@@ -122,8 +140,8 @@ import {
...
@@ -122,8 +140,8 @@ import {
ConditionType
,
ConditionType
,
ProcessVariableEnum
ProcessVariableEnum
}
from
'../../consts'
}
from
'../../consts'
import
{
BpmModelFormType
}
from
'@/utils/constants'
import
{
BpmModelFormType
}
from
'@/utils/constants'
import
{
useFormFields
}
from
'../../node'
import
{
useFormFields
}
from
'../../node'
const
props
=
defineProps
({
const
props
=
defineProps
({
modelValue
:
{
modelValue
:
{
...
@@ -202,10 +220,10 @@ const addConditionGroup = (conditions) => {
...
@@ -202,10 +220,10 @@ const addConditionGroup = (conditions) => {
const
validate
=
async
()
=>
{
const
validate
=
async
()
=>
{
if
(
!
formRef
)
return
false
if
(
!
formRef
)
return
false
return
await
formRef
.
value
.
validate
()
;
return
await
formRef
.
value
.
validate
()
}
}
defineExpose
({
validate
})
defineExpose
({
validate
})
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
...
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