|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<Breadcrumb pageTitle="爬虫列表"></Breadcrumb>
|
|
|
<div class="space"></div>
|
|
|
- <el-card>
|
|
|
+ <el-card v-loading="loading">
|
|
|
<el-header>
|
|
|
<div class="action-bar-container">
|
|
|
<el-space class="action-bar-item-container action-bar-action-left">
|
|
@@ -113,6 +113,7 @@
|
|
|
</el-card>
|
|
|
<EditSpider ref="editSpiderDialog" @custom-event="dialogEvents.editSpiderConfigSaveEvent" />
|
|
|
<RunSpiderDialog ref="runSpiderDialog" />
|
|
|
+ <VerifySpider ref="verifySpiderDialog" />
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
@@ -121,10 +122,11 @@ import { useRouter } from 'vue-router';
|
|
|
import { useStore } from 'vuex';
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
import { BrowserOpenURL, EventsOn } from "../../wailsjs/runtime"
|
|
|
-import { SaveOrUpdateSpiderConfig, SwitchSpiderConfig } from "../../wailsjs/go/main/App"
|
|
|
+import { VerifySpiderConfig, SwitchSpiderConfig } from "../../wailsjs/go/main/App"
|
|
|
import Breadcrumb from "../components/Breadcrumb.vue"
|
|
|
import EditSpider from "../components/spider/EditSpider.vue"
|
|
|
import RunSpiderDialog from "../components/spider/RunSpiderDialog.vue"
|
|
|
+import VerifySpider from "../components/spider/VerifySpider.vue"
|
|
|
import useCodeListFiltersWithRole from '../composables/filter-options'
|
|
|
import { USER_ROLE_ADMIN, USER_ROLE_DEVELOPER, USER_ROLE_REVIEWER } from '../data/user'
|
|
|
import { Refresh, Search, Box } from '@element-plus/icons-vue'
|
|
@@ -135,6 +137,8 @@ const spiderTable = ref(null)
|
|
|
|
|
|
const { stateOptions, claimOptions } = useCodeListFiltersWithRole()
|
|
|
|
|
|
+const loading = ref(false)
|
|
|
+
|
|
|
const filterConfig = reactive({
|
|
|
// 爬虫状态备选项
|
|
|
stateOptions: stateOptions,
|
|
@@ -229,6 +233,7 @@ const stopWatch = watch(() => filters.modifyuser, (n) => {
|
|
|
|
|
|
const editSpiderDialog = ref(null)
|
|
|
const runSpiderDialog = ref(null)
|
|
|
+const verifySpiderDialog = ref(null)
|
|
|
|
|
|
// 取消prevClicked的高亮
|
|
|
const cancelOtherHighlight = () => {
|
|
@@ -475,19 +480,6 @@ const dialogEvents = {
|
|
|
duration: 3000,
|
|
|
})
|
|
|
}
|
|
|
- // SaveOrUpdateSpiderConfig(data).then(result => {
|
|
|
- // ElMessage({
|
|
|
- // message: `成功更新爬虫 ${data.site} /${data.channel}/${data.code}`,
|
|
|
- // showClose: true,
|
|
|
- // duration: 3000,
|
|
|
- // });
|
|
|
- // //表格数据更新
|
|
|
- // listState.list.forEach((v, i) => {
|
|
|
- // if (v.code == data.code) v = data
|
|
|
- // })
|
|
|
- // //更新当前选择
|
|
|
- // SwitchSpiderConfig(data.code).then(result => { })
|
|
|
- // })
|
|
|
},
|
|
|
}
|
|
|
|
|
@@ -524,7 +516,13 @@ const tableEvents = {
|
|
|
},
|
|
|
handleVerify(index, row) {
|
|
|
onlyClickHighlight(row, '_action_clicked_verify')
|
|
|
- console.log('handleVerify', row)
|
|
|
+ loading.value = true
|
|
|
+ VerifySpiderConfig().then(r => {
|
|
|
+ console.log("验证爬虫结果", r)
|
|
|
+ loading.value = false
|
|
|
+ verifySpiderDialog.value.dialogVisible = true
|
|
|
+ verifySpiderDialog.value.formData = r
|
|
|
+ })
|
|
|
},
|
|
|
handleSubmit(index, row) {
|
|
|
onlyClickHighlight(row, '_action_clicked_submit')
|