Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 160bf1ad
authored
Jun 10, 2026
by
前端
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'sass-5.8.2-ccw' into 'SAAS+V5.8.2'
Sass 5.8.2 ccw See merge request
!703
2 parents
d27db8d2
1da2cb6c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
90 additions
and
77 deletions
src/views/systemConfig/manageProjectGroup/add.vue
src/views/systemConfig/manageProjectGroup/add.vue
View file @
160bf1a
...
@@ -13,9 +13,9 @@
...
@@ -13,9 +13,9 @@
<el-form-item
label=
"项目组名称"
<el-form-item
label=
"项目组名称"
prop=
"name"
>
prop=
"name"
>
<el-input
v-model
.
trim=
"form.name"
<el-input
v-model
.
trim=
"form.name"
style=
"width: 530px"
maxlength=
"10"
maxlength=
"10"
placeholder=
"请输入项目组名称"
placeholder=
"请输入项目组名称"
style=
"width: 530px"
show-word-limit
/>
show-word-limit
/>
</el-form-item>
</el-form-item>
<!--
<el-form-item
label=
"备注"
<!--
<el-form-item
label=
"备注"
...
@@ -161,7 +161,7 @@
...
@@ -161,7 +161,7 @@
</
template
>
</
template
>
</el-input>
</el-input>
</el-form-item>
</el-form-item>
<span
class=
"range-sep"
>
≤
</span>
<span
class=
"range-sep"
>
<
</span>
<span
class=
"range-mid"
>
选中的指标值
</span>
<span
class=
"range-mid"
>
选中的指标值
</span>
<span
class=
"range-sep"
>
<
</span>
<span
class=
"range-sep"
>
<
</span>
<el-form-item
class=
"condition-row__item condition-row__item--range-end"
<el-form-item
class=
"condition-row__item condition-row__item--range-end"
...
@@ -878,8 +878,8 @@ export default {
...
@@ -878,8 +878,8 @@ export default {
},
},
getRangePlaceholder
(
group
,
cond
)
{
getRangePlaceholder
(
group
,
cond
)
{
return
this
.
isRatioMetricKind
(
this
.
getMetricKindForCond
(
group
,
cond
))
return
this
.
isRatioMetricKind
(
this
.
getMetricKindForCond
(
group
,
cond
))
?
"0-100
,最多两位小数
"
?
"0-100
%
"
:
"0-99999999
,最多两位小数
"
;
:
"0-99999999"
;
},
},
validateThresholdValue
(
group
,
cond
,
value
)
{
validateThresholdValue
(
group
,
cond
,
value
)
{
const
kind
=
this
.
getMetricKindForCond
(
group
,
cond
);
const
kind
=
this
.
getMetricKindForCond
(
group
,
cond
);
...
@@ -963,11 +963,11 @@ export default {
...
@@ -963,11 +963,11 @@ export default {
if
(
count
<=
1
)
if
(
count
<=
1
)
return
;
return
;
this
.
$message
.
info
(
"预警类型与应用业务组合不能重复"
);
this
.
$message
.
info
(
"预警类型与应用业务组合不能重复"
);
if
(
changedField
===
"warningType"
)
if
(
changedField
===
"warningType"
)
{
group
.
warningType
=
""
;
group
.
warningType
=
""
;
else
if
(
changedField
===
"bizType"
)
}
else
if
(
changedField
===
"bizType"
)
{
group
.
bizType
=
""
;
group
.
bizType
=
""
;
else
{
}
else
{
group
.
warningType
=
""
;
group
.
warningType
=
""
;
group
.
bizType
=
""
;
group
.
bizType
=
""
;
}
}
...
@@ -1203,88 +1203,101 @@ export default {
...
@@ -1203,88 +1203,101 @@ export default {
this
.
validateConditionRangeFields
(
groupIndex
,
condIndex
);
this
.
validateConditionRangeFields
(
groupIndex
,
condIndex
);
});
});
},
},
async
handleSubmit
()
{
handleSubmit
()
{
this
.
$refs
.
formRef
.
validate
(
async
(
valid
)
=>
{
if
(
this
.
submitLoading
)
return
;
this
.
$refs
.
formRef
.
validate
((
valid
)
=>
{
if
(
!
valid
)
if
(
!
valid
)
return
;
return
;
if
(
!
this
.
form
.
ruleGroups
.
length
)
{
this
.
submitForm
();
this
.
$message
.
info
(
"请至少添加1个预警类型"
);
});
return
;
},
}
async
submitForm
()
{
if
(
this
.
form
.
ruleGroups
.
length
>
this
.
maxRuleGroups
)
{
if
(
this
.
submitLoading
)
this
.
$message
.
info
(
`预警类型最多
${
this
.
maxRuleGroups
}
个`
);
return
;
return
;
if
(
!
this
.
form
.
ruleGroups
.
length
)
{
}
const
overConditions
=
this
.
form
.
ruleGroups
.
some
(
group
=>
(
group
.
conditions
||
[]).
length
>
this
.
maxConditionsPerGroup
,
);
if
(
overConditions
)
{
this
.
$message
.
info
(
`每个预警类型最多
${
this
.
maxConditionsPerGroup
}
个条件`
);
return
;
}
const
missingRule
=
this
.
form
.
ruleGroups
.
some
((
group
)
=>
{
return
(
group
.
conditions
||
[]).
some
((
cond
)
=>
{
const
hasMetric
=
Boolean
(
cond
.
metricId
&&
this
.
getMetricMeta
(
group
,
cond
));
const
hasRange
=
cond
.
startVal
!==
""
&&
cond
.
endVal
!==
""
;
const
needCategory
=
this
.
hasCategory
(
group
,
cond
);
const
hasCategoryVal
=
!
needCategory
||
cond
.
category
;
return
!
hasMetric
||
!
hasRange
||
!
hasCategoryVal
;
});
});
if
(
missingRule
)
{
this
.
$message
.
info
(
"请完善预警条件中的指标、拓展业务与阈值区间"
);
return
;
}
const
pairKeys
=
new
Set
();
const
duplicatePair
=
this
.
form
.
ruleGroups
.
some
((
group
)
=>
{
const
key
=
this
.
getRuleGroupPairKey
(
group
);
if
(
!
key
)
return
false
;
if
(
pairKeys
.
has
(
key
))
return
true
;
pairKeys
.
add
(
key
);
return
false
;
});
if
(
duplicatePair
)
{
this
.
$message
.
info
(
"预警类型与应用业务组合不能重复"
);
return
;
}
const
invalidRangeFields
=
[];
this
.
form
.
ruleGroups
.
forEach
((
group
,
groupIndex
)
=>
{
(
group
.
conditions
||
[]).
forEach
((
cond
,
condIndex
)
=>
{
if
(
cond
.
startVal
!==
""
&&
cond
.
endVal
!==
""
&&
!
this
.
isRangeEndGreaterThanStart
(
cond
.
startVal
,
cond
.
endVal
)
)
{
const
base
=
`ruleGroups.
${
groupIndex
}
.conditions.
${
condIndex
}
`
;
invalidRangeFields
.
push
(
`
${
base
}
.startVal`
,
`
${
base
}
.endVal`
);
}
});
});
if
(
invalidRangeFields
.
length
)
{
this
.
$refs
.
formRef
.
validateField
(
invalidRangeFields
);
return
;
}
if
(
this
.
submitLoading
)
return
;
this
.
submitLoading
=
true
;
this
.
submitLoading
=
true
;
try
{
try
{
const
params
=
this
.
buildSaveParams
();
const
params
=
this
.
buildSaveParams
();
params
.
warningConfigs
=
(
params
.
warningConfigs
||
[]).
map
((
cfg
)
=>
{
const
ruleJson
=
cfg
.
ruleJson
;
return
{
...
cfg
,
ruleJson
:
typeof
ruleJson
===
"string"
?
ruleJson
:
JSON
.
stringify
(
ruleJson
||
[]),
};
});
await
saveProjectGroup
(
params
);
await
saveProjectGroup
(
params
);
this
.
$message
.
success
(
this
.
isEdit
?
"保存成功"
:
"新增成功"
);
this
.
$message
.
success
(
this
.
isEdit
?
"保存成功"
:
"新增成功"
);
this
.
$router
.
back
();
this
.
$router
.
back
();
}
finally
{
}
finally
{
this
.
submitLoading
=
false
;
this
.
submitLoading
=
false
;
}
}
return
;
}
if
(
this
.
form
.
ruleGroups
.
length
>
this
.
maxRuleGroups
)
{
this
.
$message
.
info
(
`预警类型最多
${
this
.
maxRuleGroups
}
个`
);
return
;
}
const
overConditions
=
this
.
form
.
ruleGroups
.
some
(
group
=>
(
group
.
conditions
||
[]).
length
>
this
.
maxConditionsPerGroup
,
);
if
(
overConditions
)
{
this
.
$message
.
info
(
`每个预警类型最多
${
this
.
maxConditionsPerGroup
}
个条件`
);
return
;
}
const
missingRule
=
this
.
form
.
ruleGroups
.
some
((
group
)
=>
{
return
(
group
.
conditions
||
[]).
some
((
cond
)
=>
{
const
hasMetric
=
Boolean
(
cond
.
metricId
&&
this
.
getMetricMeta
(
group
,
cond
));
const
hasRange
=
cond
.
startVal
!==
""
&&
cond
.
endVal
!==
""
;
const
needCategory
=
this
.
hasCategory
(
group
,
cond
);
const
hasCategoryVal
=
!
needCategory
||
cond
.
category
;
return
!
hasMetric
||
!
hasRange
||
!
hasCategoryVal
;
});
});
if
(
missingRule
)
{
this
.
$message
.
info
(
"请完善预警条件中的指标、拓展业务与阈值区间"
);
return
;
}
const
pairKeys
=
new
Set
();
const
duplicatePair
=
this
.
form
.
ruleGroups
.
some
((
group
)
=>
{
const
key
=
this
.
getRuleGroupPairKey
(
group
);
if
(
!
key
)
return
false
;
if
(
pairKeys
.
has
(
key
))
return
true
;
pairKeys
.
add
(
key
);
return
false
;
});
});
if
(
duplicatePair
)
{
this
.
$message
.
info
(
"预警类型与应用业务组合不能重复"
);
return
;
}
const
invalidRangeFields
=
[];
this
.
form
.
ruleGroups
.
forEach
((
group
,
groupIndex
)
=>
{
(
group
.
conditions
||
[]).
forEach
((
cond
,
condIndex
)
=>
{
if
(
cond
.
startVal
!==
""
&&
cond
.
endVal
!==
""
&&
!
this
.
isRangeEndGreaterThanStart
(
cond
.
startVal
,
cond
.
endVal
)
)
{
const
base
=
`ruleGroups.
${
groupIndex
}
.conditions.
${
condIndex
}
`
;
invalidRangeFields
.
push
(
`
${
base
}
.startVal`
,
`
${
base
}
.endVal`
);
}
});
});
if
(
invalidRangeFields
.
length
)
{
this
.
$refs
.
formRef
.
validateField
(
invalidRangeFields
);
return
;
}
this
.
submitLoading
=
true
;
try
{
const
params
=
this
.
buildSaveParams
();
params
.
warningConfigs
=
(
params
.
warningConfigs
||
[]).
map
((
cfg
)
=>
{
const
ruleJson
=
cfg
.
ruleJson
;
return
{
...
cfg
,
ruleJson
:
typeof
ruleJson
===
"string"
?
ruleJson
:
JSON
.
stringify
(
ruleJson
||
[]),
};
});
await
saveProjectGroup
(
params
);
this
.
$message
.
success
(
this
.
isEdit
?
"保存成功"
:
"新增成功"
);
this
.
$router
.
back
();
}
finally
{
this
.
submitLoading
=
false
;
}
},
},
handleCancel
()
{
handleCancel
()
{
this
.
$router
.
back
();
this
.
$router
.
back
();
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment