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
4f241416
authored
May 13, 2024
by
jason
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
仿钉钉流程设计器- 条件规则问题修复
parent
e1fc9039
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
28 deletions
+32
-28
src/components/SimpleProcessDesignerV2/src/consts.ts
+16
-17
src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue
+16
-11
No files found.
src/components/SimpleProcessDesignerV2/src/consts.ts
View file @
4f241416
...
...
@@ -167,22 +167,21 @@ export const COMPARISON_OPERATORS : DictDataVO = [
{
value
:
'!='
,
label
:
'不等于'
,
},
{
value
:
'>'
,
label
:
'大于'
,
},
{
value
:
'>='
,
label
:
'大于等于'
,
},
{
value
:
'<'
,
label
:
'小于'
,
},
{
value
:
'<='
,
label
:
'小于等于'
,
}
// 待完善
// {
// value: '>',
// label: '大于',
// },
// {
// value: '>=',
// label: '大于等于',
// },
// {
// value: '<',
// label: '小于',
// },
// {
// value: '<=',
// label: '小于等于',
// }
]
src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue
View file @
4f241416
...
...
@@ -4,7 +4,7 @@
v-model=
"settingVisible"
:show-close=
"false"
:size=
"588"
:before-close=
"handleClose"
:before-close=
"
handleClose"
>
<template
#
header
>
<div
class=
"config-header"
>
...
...
@@ -216,12 +216,13 @@ const closeDrawer = () => {
settingVisible
.
value
=
false
}
const
handleClose
=
async
(
done
:
(
cancel
?:
boolean
)
=>
void
)
=>
{
if
(
await
saveConfig
()){
done
(
false
);
// 传入 false 阻止关闭
}
else
{
done
();
}
const
handleClose
=
async
(
done
:
(
cancel
?:
boolean
)
=>
void
)
=>
{
const
isSuccess
=
await
saveConfig
();
if
(
!
isSuccess
)
{
done
(
true
);
// 传入 true 阻止关闭
}
else
{
done
();
}
}
// 表单校验规则
const
formRules
=
reactive
({
...
...
@@ -231,13 +232,12 @@ const formRules = reactive({
const
formRef
=
ref
()
// 表单 Ref
// 保存配置
const
saveConfig
=
async
()
=>
{
const
saveConfig
=
async
()
=>
{
if
(
!
currentNode
.
value
.
attributes
.
defaultFlow
)
{
// 校验表单
// 校验表单
if
(
!
formRef
)
return
false
const
valid
=
await
formRef
.
value
.
validate
()
if
(
!
valid
)
return
false
const
showText
=
getShowText
();
if
(
!
showText
){
return
false
;
...
...
@@ -269,7 +269,7 @@ const getShowText = () : string => {
const
conditionGroup
=
conditionGroups
.
value
.
conditions
.
map
(
item
=>
{
return
'('
+
item
.
rules
.
map
(
rule
=>
{
if
(
rule
.
leftSide
&&
rule
.
rightSide
)
{
return
getFieldTitle
(
rule
.
leftSide
)
+
" "
+
rule
.
opName
+
" "
+
rule
.
rightSide
return
getFieldTitle
(
rule
.
leftSide
)
+
" "
+
getOpName
(
rule
.
opCode
)
+
" "
+
rule
.
rightSide
}
else
{
// 又一条规则不完善。提示错误
warningMesg
=
'请完善条件规则'
...
...
@@ -370,6 +370,11 @@ const getFieldTitle = (field:string) : string => {
return
item
?.
title
;
}
const
getOpName
=
(
opCode
:
string
)
:
string
=>
{
const
opName
=
COMPARISON_OPERATORS
.
find
(
item
=>
item
.
value
===
opCode
)
return
opName
?.
label
}
</
script
>
<
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