Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fk-spider-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周田
fk-spider-web
Commits
0c02b54f
Commit
0c02b54f
authored
Dec 25, 2025
by
liucan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:添加任务间隔时间校验
parent
4ffe9b7f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletions
+13
-1
addTaskDialog.vue
src/views/os-taskInformation/components/addTaskDialog.vue
+13
-1
No files found.
src/views/os-taskInformation/components/addTaskDialog.vue
View file @
0c02b54f
...
@@ -80,7 +80,6 @@
...
@@ -80,7 +80,6 @@
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
onMounted
,
reactive
,
ref
}
from
"vue"
;
import
{
onMounted
,
reactive
,
ref
}
from
"vue"
;
import
{
defineProps
}
from
"vue"
;
import
{
watch
}
from
"vue"
;
import
{
watch
}
from
"vue"
;
import
{
addSpiderTask
}
from
"@/api/spiderTask"
;
import
{
addSpiderTask
}
from
"@/api/spiderTask"
;
import
{
AddMode
}
from
"./enum"
;
import
{
AddMode
}
from
"./enum"
;
...
@@ -154,6 +153,7 @@ const handleConfirm = async () => {
...
@@ -154,6 +153,7 @@ const handleConfirm = async () => {
//验证表单内容是否通过,通过继续执行
//验证表单内容是否通过,通过继续执行
if
(
valid
)
{
if
(
valid
)
{
if
(
currentMode
.
value
===
AddMode
.
ADD_TASK
)
{
if
(
currentMode
.
value
===
AddMode
.
ADD_TASK
)
{
if
(
!
checkExGap
(
exGaps
))
return
;
await
addSpiderTask
({
await
addSpiderTask
({
scrapyd_server_id
:
taskParams
.
value
.
scrapyd_server_id
,
scrapyd_server_id
:
taskParams
.
value
.
scrapyd_server_id
,
schedule_type
:
taskParams
.
value
.
schedule_type
,
schedule_type
:
taskParams
.
value
.
schedule_type
,
...
@@ -167,6 +167,7 @@ const handleConfirm = async () => {
...
@@ -167,6 +167,7 @@ const handleConfirm = async () => {
emit
(
"getTaskList"
);
emit
(
"getTaskList"
);
ElMessage
.
success
(
"添加成功"
);
ElMessage
.
success
(
"添加成功"
);
}
else
if
(
currentMode
.
value
===
AddMode
.
UPDATE_TASK
)
{
}
else
if
(
currentMode
.
value
===
AddMode
.
UPDATE_TASK
)
{
if
(
!
checkExGap
(
exGaps
))
return
;
await
addSpiderTask
({
await
addSpiderTask
({
scrapyd_server_id
:
taskParams
.
value
.
scrapyd_server_id
,
scrapyd_server_id
:
taskParams
.
value
.
scrapyd_server_id
,
schedule_type
:
taskParams
.
value
.
schedule_type
,
schedule_type
:
taskParams
.
value
.
schedule_type
,
...
@@ -189,6 +190,17 @@ const handleConfirm = async () => {
...
@@ -189,6 +190,17 @@ const handleConfirm = async () => {
exGaps
.
day
=
0
;
exGaps
.
day
=
0
;
});
});
};
};
//校验设置的间隔是否合法
const
checkExGap
=
(
exGaps
:
any
)
=>
{
if
(
exGaps
.
second
<
5
&&
exGaps
.
minute
<=
0
&&
exGaps
.
hour
<=
0
&&
exGaps
.
day
<=
0
)
{
ElMessage
.
warning
(
"间隔时间不能小于5秒"
);
return
false
;
}
else
{
return
true
;
}
};
const
getData
=
async
()
=>
{
const
getData
=
async
()
=>
{
const
res
=
await
getSpiderList
({
scrapydServerId
:
"1"
,
project
:
"spiders"
});
const
res
=
await
getSpiderList
({
scrapydServerId
:
"1"
,
project
:
"spiders"
});
spiderTypeOptions
.
value
=
res
.
data
;
spiderTypeOptions
.
value
=
res
.
data
;
...
...
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