Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
so-manage-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
smart-operation
so-manage-ui
Commits
266ba0c2
Commit
266ba0c2
authored
Jul 18, 2023
by
张耀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:
修复自测bug
parent
cc97dcb3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
44 deletions
+50
-44
src/page/main/forewarning/rule-set/modules/custom.vue
src/page/main/forewarning/rule-set/modules/custom.vue
+25
-22
src/page/main/forewarning/rule-set/modules/gateway.vue
src/page/main/forewarning/rule-set/modules/gateway.vue
+25
-22
No files found.
src/page/main/forewarning/rule-set/modules/custom.vue
View file @
266ba0c2
...
@@ -215,20 +215,22 @@ const setLimits = (index) => {
...
@@ -215,20 +215,22 @@ const setLimits = (index) => {
);
);
};
};
const
inputNum
=
(
index
,
key
)
=>
{
const
inputNum
=
(
index
,
key
)
=>
{
state
.
form
.
ruleRows
[
index
][
key
]
=
+
`
${
state
.
form
.
ruleRows
[
index
][
key
]}
`
.
replace
(
/
[^\d]
/g
,
""
);
if
(
state
.
form
.
ruleRows
[
index
][
key
]
==
"
-
"
)
return
;
state
.
form
.
ruleRows
[
index
][
key
]
=
+
`
${
state
.
form
.
ruleRows
[
index
][
key
]}
`
.
replace
(
/
[^\-
?
\d
.
]
/g
,
""
);
};
};
const
changeWarningThresholdFrom
=
(
index
)
=>
{
const
changeWarningThresholdFrom
=
(
index
)
=>
{
let
{
down
,
up
}
=
limit
.
value
;
let
{
down
,
up
}
=
limit
.
value
;
if
(
down
===
""
)
return
;
let
{
from
,
to
}
=
state
.
form
.
ruleRows
[
index
];
let
{
from
,
to
}
=
state
.
form
.
ruleRows
[
index
];
if
(
+
from
>
+
up
||
(
index
==
0
&&
+
from
<
+
down
)
||
(
to
!=
""
&&
from
>
+
to
))
{
if
(
to
!=
""
&&
from
>
+
to
)
{
if
(
+
from
<
+
down
)
{
ElMessage
.
error
(
`下限不能大于上限`
);
state
.
form
.
ruleRows
[
index
].
from
=
""
;
return
;
}
else
if
(
down
!==
""
&&
+
from
<
+
down
)
{
ElMessage
.
error
(
`下限不能小于
${
down
}
`
);
ElMessage
.
error
(
`下限不能小于
${
down
}
`
);
}
else
if
(
+
from
>
+
up
)
{
state
.
form
.
ruleRows
[
index
].
from
=
""
;
return
;
}
else
if
(
up
!=
""
&&
+
from
>
+
up
)
{
ElMessage
.
error
(
`上限不能超过
${
up
}
`
);
ElMessage
.
error
(
`上限不能超过
${
up
}
`
);
}
else
{
ElMessage
.
error
(
`下限不能大于上限`
);
}
state
.
form
.
ruleRows
[
index
].
from
=
""
;
state
.
form
.
ruleRows
[
index
].
from
=
""
;
return
;
return
;
}
}
...
@@ -236,7 +238,7 @@ const changeWarningThresholdFrom = (index) => {
...
@@ -236,7 +238,7 @@ const changeWarningThresholdFrom = (index) => {
if
(
rows
.
length
==
0
)
return
;
if
(
rows
.
length
==
0
)
return
;
try
{
try
{
rows
.
forEach
((
e
)
=>
{
rows
.
forEach
((
e
)
=>
{
if
(
e
.
up
!==
""
&&
e
.
down
!==
""
&&
+
e
.
up
>=
+
from
>
+
e
.
down
)
{
if
(
e
.
up
!==
""
&&
e
.
down
!==
""
&&
+
e
.
up
>=
+
from
&&
+
from
>
+
e
.
down
)
{
throw
""
;
throw
""
;
}
}
});
});
...
@@ -247,16 +249,17 @@ const changeWarningThresholdFrom = (index) => {
...
@@ -247,16 +249,17 @@ const changeWarningThresholdFrom = (index) => {
};
};
const
changeWarningThresholdTo
=
(
index
)
=>
{
const
changeWarningThresholdTo
=
(
index
)
=>
{
let
{
down
,
up
}
=
limit
.
value
;
let
{
down
,
up
}
=
limit
.
value
;
if
(
up
===
""
)
return
;
let
{
from
,
to
}
=
state
.
form
.
ruleRows
[
index
];
let
{
from
,
to
}
=
state
.
form
.
ruleRows
[
index
];
if
((
index
==
0
&&
+
to
>
+
up
)
||
+
to
<
+
down
||
(
from
!=
""
&&
+
from
>
+
to
))
{
if
(
from
!=
""
&&
from
>
+
to
)
{
if
(
+
to
>
+
up
)
{
ElMessage
.
error
(
`下限不能大于上限`
);
ElMessage
.
error
(
`上限不能超过
${
up
}
`
);
state
.
form
.
ruleRows
[
index
].
to
=
""
;
}
else
if
(
+
to
<
+
down
)
{
return
;
}
else
if
(
down
!==
""
&&
+
to
<
+
down
)
{
ElMessage
.
error
(
`下限不能小于
${
down
}
`
);
ElMessage
.
error
(
`下限不能小于
${
down
}
`
);
}
else
{
state
.
form
.
ruleRows
[
index
].
to
=
""
;
ElMessage
.
error
(
`上限不能小于下限`
);
return
;
}
}
else
if
(
up
!=
""
&&
+
to
>
+
up
)
{
ElMessage
.
error
(
`上限不能超过
${
up
}
`
);
state
.
form
.
ruleRows
[
index
].
to
=
""
;
state
.
form
.
ruleRows
[
index
].
to
=
""
;
return
;
return
;
}
}
...
@@ -264,7 +267,7 @@ const changeWarningThresholdTo = (index) => {
...
@@ -264,7 +267,7 @@ const changeWarningThresholdTo = (index) => {
if
(
rows
.
length
==
0
)
return
;
if
(
rows
.
length
==
0
)
return
;
try
{
try
{
rows
.
forEach
((
e
)
=>
{
rows
.
forEach
((
e
)
=>
{
if
(
e
.
up
!==
""
&&
e
.
down
!==
""
&&
+
e
.
up
>
+
to
>
+
e
.
down
)
{
if
(
e
.
up
!==
""
&&
e
.
down
!==
""
&&
+
e
.
up
>
+
to
&&
+
to
>
+
e
.
down
)
{
throw
""
;
throw
""
;
}
}
});
});
...
@@ -352,7 +355,7 @@ const removeRule = (index) => {
...
@@ -352,7 +355,7 @@ const removeRule = (index) => {
state
.
form
.
ruleRows
.
splice
(
index
,
1
);
state
.
form
.
ruleRows
.
splice
(
index
,
1
);
};
};
const
info
=
()
=>
{
const
info
=
()
=>
{
if
(
!
info
)
{
if
(
!
props
.
form
)
{
createRule
();
createRule
();
return
;
return
;
}
}
...
...
src/page/main/forewarning/rule-set/modules/gateway.vue
View file @
266ba0c2
...
@@ -181,7 +181,7 @@ const isEmptyOption = computed(() => {
...
@@ -181,7 +181,7 @@ const isEmptyOption = computed(() => {
});
});
const
limit
=
computed
(()
=>
{
const
limit
=
computed
(()
=>
{
return
(
return
(
ruleTypeOptions
.
value
[
rule_type
.
valu
e
]
||
{
ruleTypeOptions
.
value
[
props
.
rule_typ
e
]
||
{
down
:
""
,
down
:
""
,
up
:
""
,
up
:
""
,
}
}
...
@@ -189,16 +189,17 @@ const limit = computed(() => {
...
@@ -189,16 +189,17 @@ const limit = computed(() => {
});
});
const
changeWarningThresholdFrom
=
(
index
)
=>
{
const
changeWarningThresholdFrom
=
(
index
)
=>
{
let
{
down
,
up
}
=
limit
.
value
;
let
{
down
,
up
}
=
limit
.
value
;
if
(
down
===
""
)
return
;
let
{
from
,
to
}
=
state
.
form
.
ruleRows
[
index
];
let
{
from
,
to
}
=
state
.
form
.
ruleRows
[
index
];
if
((
up
!=
""
&&
+
from
>
+
up
)
||
(
index
==
0
&&
+
from
<
+
down
)
||
(
to
!=
""
&&
from
>
+
to
))
{
if
(
to
!=
""
&&
from
>
+
to
)
{
if
(
+
from
<
+
down
)
{
ElMessage
.
error
(
`下限不能大于上限`
);
state
.
form
.
ruleRows
[
index
].
from
=
""
;
return
;
}
else
if
(
down
!==
""
&&
+
from
<
+
down
)
{
ElMessage
.
error
(
`下限不能小于
${
down
}
`
);
ElMessage
.
error
(
`下限不能小于
${
down
}
`
);
}
else
if
(
+
from
>
+
up
)
{
state
.
form
.
ruleRows
[
index
].
from
=
""
;
return
;
}
else
if
(
up
!=
""
&&
+
from
>
+
up
)
{
ElMessage
.
error
(
`上限不能超过
${
up
}
`
);
ElMessage
.
error
(
`上限不能超过
${
up
}
`
);
}
else
{
ElMessage
.
error
(
`下限不能大于上限`
);
}
state
.
form
.
ruleRows
[
index
].
from
=
""
;
state
.
form
.
ruleRows
[
index
].
from
=
""
;
return
;
return
;
}
}
...
@@ -206,7 +207,7 @@ const changeWarningThresholdFrom = (index) => {
...
@@ -206,7 +207,7 @@ const changeWarningThresholdFrom = (index) => {
if
(
rows
.
length
==
0
)
return
;
if
(
rows
.
length
==
0
)
return
;
try
{
try
{
rows
.
forEach
((
e
)
=>
{
rows
.
forEach
((
e
)
=>
{
if
(
e
.
up
!==
""
&&
e
.
down
!==
""
&&
+
e
.
up
>=
+
from
>
+
e
.
down
)
{
if
(
e
.
up
!==
""
&&
e
.
down
!==
""
&&
+
e
.
up
>=
+
from
&&
+
from
>
+
e
.
down
)
{
throw
""
;
throw
""
;
}
}
});
});
...
@@ -216,20 +217,22 @@ const changeWarningThresholdFrom = (index) => {
...
@@ -216,20 +217,22 @@ const changeWarningThresholdFrom = (index) => {
}
}
};
};
const
inputNum
=
(
index
,
key
)
=>
{
const
inputNum
=
(
index
,
key
)
=>
{
state
.
form
.
ruleRows
[
index
][
key
]
=
+
`
${
state
.
form
.
ruleRows
[
index
][
key
]}
`
.
replace
(
/
[^\d]
/g
,
""
);
if
(
state
.
form
.
ruleRows
[
index
][
key
]
==
"
-
"
)
return
;
state
.
form
.
ruleRows
[
index
][
key
]
=
+
`
${
state
.
form
.
ruleRows
[
index
][
key
]}
`
.
replace
(
/
[^\-
?
\d
.
]
/g
,
""
);
};
};
const
changeWarningThresholdTo
=
(
index
)
=>
{
const
changeWarningThresholdTo
=
(
index
)
=>
{
let
{
down
,
up
}
=
limit
.
value
;
let
{
down
,
up
}
=
limit
.
value
;
if
(
up
===
""
)
return
;
let
{
from
,
to
}
=
state
.
form
.
ruleRows
[
index
];
let
{
from
,
to
}
=
state
.
form
.
ruleRows
[
index
];
if
((
index
==
0
&&
+
to
>
+
up
)
||
(
down
!=
""
&&
+
to
<
+
down
)
||
(
from
!=
""
&&
+
from
>
+
to
))
{
if
(
from
!=
""
&&
from
>
+
to
)
{
if
(
+
to
>
+
up
)
{
ElMessage
.
error
(
`下限不能大于上限`
);
ElMessage
.
error
(
`上限不能超过
${
up
}
`
);
state
.
form
.
ruleRows
[
index
].
to
=
""
;
}
else
if
(
+
to
<
+
down
)
{
return
;
}
else
if
(
down
!==
""
&&
+
to
<
+
down
)
{
ElMessage
.
error
(
`下限不能小于
${
down
}
`
);
ElMessage
.
error
(
`下限不能小于
${
down
}
`
);
}
else
{
state
.
form
.
ruleRows
[
index
].
to
=
""
;
ElMessage
.
error
(
`上限不能小于下限`
);
return
;
}
}
else
if
(
up
!=
""
&&
+
to
>
+
up
)
{
ElMessage
.
error
(
`上限不能超过
${
up
}
`
);
state
.
form
.
ruleRows
[
index
].
to
=
""
;
state
.
form
.
ruleRows
[
index
].
to
=
""
;
return
;
return
;
}
}
...
@@ -237,7 +240,7 @@ const changeWarningThresholdTo = (index) => {
...
@@ -237,7 +240,7 @@ const changeWarningThresholdTo = (index) => {
if
(
rows
.
length
==
0
)
return
;
if
(
rows
.
length
==
0
)
return
;
try
{
try
{
rows
.
forEach
((
e
)
=>
{
rows
.
forEach
((
e
)
=>
{
if
(
e
.
up
!==
""
&&
e
.
down
!==
""
&&
+
e
.
up
>
+
to
>
+
e
.
down
)
{
if
(
e
.
up
!==
""
&&
e
.
down
!==
""
&&
+
e
.
up
>
+
to
&&
+
to
>
+
e
.
down
)
{
throw
""
;
throw
""
;
}
}
});
});
...
...
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