|
@@ -91,7 +91,7 @@
|
|
|
<template #default="scope">
|
|
|
<el-tooltip content="提交" placement="top" v-if="showListDevelopeButton">
|
|
|
<!-- 爬虫状态是待完成,才可点击提交 -->
|
|
|
- <el-button size="small" :disabled="scope.row.state !== 0" :class="{ active: scope.row._action_clicked_submit }" @click="tableEvents.handleSubmit(scope.$index, scope.row)">
|
|
|
+ <el-button size="small" :disabled="tableActionDisabled.submitDisabled(scope.row)" :class="{ active: scope.row._action_clicked_submit }" @click="tableEvents.handleSubmit(scope.$index, scope.row)">
|
|
|
<el-icon><Promotion /></el-icon>
|
|
|
</el-button>
|
|
|
</el-tooltip>
|
|
@@ -673,6 +673,19 @@ const tableEvents = {
|
|
|
},
|
|
|
}
|
|
|
|
|
|
+// 表格按钮是否可用
|
|
|
+const tableActionDisabled = {
|
|
|
+ // 此按钮是开发者才会展示
|
|
|
+ submitDisabled(row) {
|
|
|
+ // 开发者-爬虫状态是待完成,才可点击提交
|
|
|
+ const waitingComplete = row.state === 0
|
|
|
+ // 开发者-未通过的爬虫可点击提交
|
|
|
+ const notPass = row.state === 2
|
|
|
+ const canSubmit = waitingComplete || notPass
|
|
|
+ return !canSubmit
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
//Wails事件绑定
|
|
|
EventsOn("spiderConfigChange", data => {
|
|
|
console.log(data)
|