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
aa2540fa
Commit
aa2540fa
authored
Oct 24, 2025
by
yzh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:修改状态监控参数,修改任务信息内的所属爬虫
parent
f42e5124
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
45 deletions
+46
-45
taskCard.vue
src/views/os-status/components/taskCard.vue
+7
-3
taskCard.vue
src/views/os-taskInformation/components/taskCard.vue
+39
-42
No files found.
src/views/os-status/components/taskCard.vue
View file @
aa2540fa
...
...
@@ -59,6 +59,7 @@
import
{
useRouter
}
from
'vue-router'
import
{
getAllSpiderTaskStatistics
}
from
'@/api/staticData'
;
import
{
onMounted
,
ref
}
from
'vue'
;
import
{
getSpiderTaskList
}
from
'@/api/spiderTask'
const
router
=
useRouter
()
...
...
@@ -111,15 +112,18 @@ const goToSTTaskRecordPage = () => {
// 获取任务统计数据的方法
const
getData
=
async
()
=>
{
const
res
=
await
getAllSpiderTaskStatistics
({})
dsnTotalTaskNumber
.
value
=
res
.
data
.
dsn_now
.
totalCount
const
dsnTask
=
await
getSpiderTaskList
({
spiders
:
'dsn_now'
})
const
ituTask
=
await
getSpiderTaskList
({
spiders
:
'itu_space_explorer'
})
const
stTask
=
await
getSpiderTaskList
({
spiders
:
'api_spider'
})
dsnTotalTaskNumber
.
value
=
dsnTask
.
data
.
length
dsnTaskSuccessNumber
.
value
=
res
.
data
.
dsn_now
.
successCount
dsnTaskFailNumber
.
value
=
res
.
data
.
dsn_now
.
failCount
dsnErrorRate
.
value
=
res
.
data
.
dsn_now
.
errorRate
ituTotalTaskNumber
.
value
=
res
.
data
.
itu_space_explorer
.
totalCount
ituTotalTaskNumber
.
value
=
ituTask
.
data
.
length
ituTaskSuccessNumber
.
value
=
res
.
data
.
itu_space_explorer
.
successCount
ituTaskFailNumber
.
value
=
res
.
data
.
itu_space_explorer
.
failCount
ituErrorRate
.
value
=
res
.
data
.
itu_space_explorer
.
errorRate
stTotalTaskNumber
.
value
=
res
.
data
.
space_track
.
totalCount
stTotalTaskNumber
.
value
=
stTask
.
data
.
length
stTaskSuccessNumber
.
value
=
res
.
data
.
space_track
.
successCount
stTaskFailNumber
.
value
=
res
.
data
.
space_track
.
failCount
stErrorRate
.
value
=
res
.
data
.
space_track
.
errorRate
...
...
src/views/os-taskInformation/components/taskCard.vue
View file @
aa2540fa
...
...
@@ -11,8 +11,8 @@
<el-form-item>
<div>
<el-select
v-model=
"searchCondition.spiders"
placeholder=
"请选择"
style=
"width: 220px"
>
<el-option
v-for=
"item in taskSelectOptions"
:key=
"item.
value"
:label=
"item.label
"
:value=
"item.
value
"
/>
<el-option
v-for=
"item in taskSelectOptions"
:key=
"item.
spider"
:label=
"item.spider
"
:value=
"item.
spider
"
/>
</el-select>
</div>
</el-form-item>
...
...
@@ -37,7 +37,8 @@
<div
class=
"taskContent"
>
<div>
<el-form-item
class=
"form-item"
>
<span
class=
"titleStyle"
>
{{
task
.
kwargs
.
options
===
''
?
'无名称'
:
JSON
.
parse
(
task
.
kwargs
.
options
).
jobName
<span
class=
"titleStyle"
>
{{
task
.
kwargs
.
options
===
''
?
'无名称'
:
JSON
.
parse
(
task
.
kwargs
.
options
).
jobName
}}
</span>
</el-form-item>
</div>
...
...
@@ -90,8 +91,9 @@
</div>
</div>
<addTaskDialog
v-model:dialogVisible=
"showTaskDialog"
@
confirm=
"handleEdit"
:mode=
"editMode"
@
getTaskList=
"getData"
:jobId=
"jobId"
:cron=
"frequency"
:spiderType=
"belongSpiderType"
:options=
"taskOptions"
/>
<addTaskDialog
v-model:dialogVisible=
"showTaskDialog"
@
confirm=
"handleEdit"
:mode=
"editMode"
@
getTaskList=
"getData"
:jobId=
"jobId"
:cron=
"frequency"
:spiderType=
"belongSpiderType"
:options=
"taskOptions"
/>
<deleteDialog
v-model:dialogVisible=
"showDeleteDialog"
@
get-user-list=
"getData"
:jobId=
"jobId"
/>
</div>
...
...
@@ -111,6 +113,7 @@ import { AddMode } from './enum'
import
deleteDialog
from
'./deleteDialog.vue'
import
{
CronExpressionParser
}
from
'cron-parser'
;
import
{
ElMessage
}
from
'element-plus'
import
{
getSpiderList
}
from
'@/api/system.ts'
const
props
=
defineProps
({
spiderType
:
{
...
...
@@ -126,20 +129,8 @@ const props = defineProps({
default
:
''
}
})
const
taskSelectOptions
=
[
{
value
:
'api_spider'
,
label
:
'api_spider'
,
},
{
value
:
'dsn_now'
,
label
:
'dsn_now'
,
},
{
value
:
'itu_space_explorer'
,
label
:
'itu_space_explorer'
,
},
]
const
taskSelectOptions
=
ref
()
const
searchCondition
=
ref
({
spiders
:
''
,
options
:
''
...
...
@@ -205,7 +196,7 @@ const openTaskDialog = () => {
const
getData
=
async
()
=>
{
const
res
=
await
getSpiderTaskList
({
spiders
:
searchCondition
.
value
.
spiders
?
[
searchCondition
.
value
.
spiders
]
:
[]
})
const
resId
=
await
getTaskCount
({})
for
(
let
i
=
0
;
i
<
res
.
data
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
res
.
data
.
length
;
i
++
)
{
res
.
data
[
i
].
count
=
resId
.
data
[
res
.
data
[
i
].
id
]
===
undefined
?
0
:
resId
.
data
[
res
.
data
[
i
].
id
]
}
taskList
.
value
=
res
.
data
...
...
@@ -215,20 +206,20 @@ const resetData = async () => {
searchCondition
.
value
.
spiders
=
''
const
res
=
await
getSpiderTaskList
({
spiders
:
[],
options
:
JSON
.
stringify
({
jobName
:
taskName
.
value
})
})
const
resId
=
await
getTaskCount
({})
for
(
let
i
=
0
;
i
<
res
.
data
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
res
.
data
.
length
;
i
++
)
{
res
.
data
[
i
].
count
=
resId
.
data
[
res
.
data
[
i
].
id
]
===
undefined
?
0
:
resId
.
data
[
res
.
data
[
i
].
id
]
}
taskList
.
value
=
res
.
data
}
// 搜索任务的方法
const
search
=
async
()
=>
{
if
(
searchCondition
.
value
.
spiders
===
''
)
{
if
(
searchCondition
.
value
.
spiders
===
''
)
{
ElMessage
.
warning
(
'请先选择爬虫'
)
return
}
const
res
=
await
getSpiderTaskList
({
spiders
:
searchCondition
.
value
.
spiders
?
[
searchCondition
.
value
.
spiders
]
:
[],
options
:
JSON
.
stringify
({
jobName
:
taskName
.
value
})
})
const
resId
=
await
getTaskCount
({})
for
(
let
i
=
0
;
i
<
res
.
data
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
res
.
data
.
length
;
i
++
)
{
res
.
data
[
i
].
count
=
resId
.
data
[
res
.
data
[
i
].
id
]
===
undefined
?
0
:
resId
.
data
[
res
.
data
[
i
].
id
]
}
taskList
.
value
=
res
.
data
...
...
@@ -238,49 +229,55 @@ const parseCronExpression = (cronExpression: string) => {
const
res
=
cronExpression
.
split
(
'*'
).
length
-
1
if
(
res
>=
5
)
{
const
aaa
=
cronExpression
.
split
(
' '
)
for
(
let
i
=
0
;
i
<
aaa
.
length
;
i
++
)
{
if
(
aaa
[
i
]
!=
'*'
)
{
if
(
i
==
0
)
{
if
(
aaa
[
i
].
length
===
3
)
{
for
(
let
i
=
0
;
i
<
aaa
.
length
;
i
++
)
{
if
(
aaa
[
i
]
!=
'*'
)
{
if
(
i
==
0
)
{
if
(
aaa
[
i
].
length
===
3
)
{
return
`每
${
aaa
[
i
][
2
]}
秒执行一次`
}
else
{
}
else
{
return
`每
${
aaa
[
i
][
2
]
+
aaa
[
i
][
3
]}
秒执行一次`
}
}
else
if
(
i
==
1
)
{
if
(
aaa
[
i
].
length
===
3
)
{
}
else
if
(
i
==
1
)
{
if
(
aaa
[
i
].
length
===
3
)
{
return
`每
${
aaa
[
i
][
2
]}
分钟执行一次`
}
else
{
}
else
{
return
`每
${
aaa
[
i
][
2
]
+
aaa
[
i
][
3
]}
分钟执行一次`
}
}
else
if
(
i
==
2
)
{
if
(
aaa
[
i
].
length
===
3
)
{
}
else
if
(
i
==
2
)
{
if
(
aaa
[
i
].
length
===
3
)
{
return
`每
${
aaa
[
i
][
2
]}
小时执行一次`
}
else
{
}
else
{
return
`每
${
aaa
[
i
][
2
]
+
aaa
[
i
][
3
]}
小时执行一次`
}
}
else
if
(
i
==
3
)
{
if
(
aaa
[
i
].
length
===
3
)
{
}
else
if
(
i
==
3
)
{
if
(
aaa
[
i
].
length
===
3
)
{
return
`每
${
aaa
[
i
][
2
]}
天执行一次`
}
else
{
}
else
{
return
`每
${
aaa
[
i
][
2
]
+
aaa
[
i
][
3
]}
天执行一次`
}
}
else
if
(
i
==
4
)
{
if
(
aaa
[
i
].
length
===
3
)
{
}
else
if
(
i
==
4
)
{
if
(
aaa
[
i
].
length
===
3
)
{
return
`每
${
aaa
[
i
][
2
]}
月执行一次`
}
else
{
}
else
{
return
`每
${
aaa
[
i
][
2
]
+
aaa
[
i
][
3
]}
月执行一次`
}
}
}
}
}
}
const
getSpiderTypeList
=
async
()
=>
{
const
res
=
await
getSpiderList
({
scrapydServerId
:
'1'
,
project
:
'spiders'
})
console
.
log
(
res
,
8888888888888
);
taskSelectOptions
.
value
=
res
.
data
// taskSelectOptions.value = res.data
}
onMounted
(()
=>
{
onMounted
(()
=>
{
if
(
props
.
spiderType
!==
''
)
{
searchCondition
.
value
.
spiders
=
props
.
spiderType
}
getData
()
getSpiderTypeList
()
})
...
...
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