|
@@ -91,25 +91,25 @@
|
|
|
<!-- 审核人员:打回和通过 -->
|
|
|
<div v-if="isReviewer">
|
|
|
<el-tooltip content="通过" placement="top">
|
|
|
- <el-button size="small" :class="{ active: scope.row._action_clicked_submit }" @click="tableEvents.reviewerSubmit(scope.$index, scope.row)">
|
|
|
+ <el-button size="small" :class="{ active: scope.row._action_clicked_submit }" :disabled="actionButtonDisabled.reviewerSubmit(scope.row)" @click="tableEvents.reviewerSubmit(scope.$index, scope.row)">
|
|
|
<el-icon><CircleCheck /></el-icon>
|
|
|
</el-button>
|
|
|
</el-tooltip>
|
|
|
- <el-tooltip content="打回" placement="top">
|
|
|
- <el-button size="small" :class="{ active: scope.row._action_clicked_rollback }" @click="tableEvents.reviewerRollback(scope.$index, scope.row)">
|
|
|
+ <el-tooltip content="打回" placement="top" v-if="actionButtonDisabled.showRollback(scope.row)">
|
|
|
+ <el-button size="small" :class="{ active: scope.row._action_clicked_rollback }" :disabled="actionButtonDisabled.reviewerRollback(scope.row)" @click="tableEvents.reviewerRollback(scope.$index, scope.row)">
|
|
|
<el-icon><CircleClose /></el-icon>
|
|
|
</el-button>
|
|
|
</el-tooltip>
|
|
|
|
|
|
</div>
|
|
|
<!-- 管理员:上线和退回 -->
|
|
|
- <div v-if="isAdmin">
|
|
|
+ <div v-if="!isAdmin">
|
|
|
<el-tooltip content="上线" placement="top">
|
|
|
- <el-button size="small" :class="{ active: scope.row._action_clicked_submit }" @click="tableEvents.adminSubmit(scope.$index, scope.row)">
|
|
|
+ <el-button size="small" :class="{ active: scope.row._action_clicked_submit }" :disabled="actionButtonDisabled.adminSubmit(scope.row)" @click="tableEvents.adminSubmit(scope.$index, scope.row)">
|
|
|
<el-icon><UploadFilled /></el-icon>
|
|
|
</el-button>
|
|
|
</el-tooltip>
|
|
|
- <el-tooltip content="退回" placement="top">
|
|
|
+ <el-tooltip content="退回" placement="top" v-if="actionButtonDisabled.showRollback(scope.row)">
|
|
|
<el-button size="small" :class="{ active: scope.row._action_clicked_rollback }" @click="tableEvents.adminRollback(scope.$index, scope.row)">
|
|
|
<el-icon><DArrowLeft /></el-icon>
|
|
|
</el-button>
|
|
@@ -438,6 +438,29 @@ const openEditDialog = (row) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+const actionButtonDisabled = {
|
|
|
+ reviewerSubmit(row) {
|
|
|
+ // 只有待审核的才能审核
|
|
|
+ // 未通过的爬虫不能点通过和打回
|
|
|
+ const canSubmit = row.state === 1
|
|
|
+ return !canSubmit
|
|
|
+ },
|
|
|
+ reviewerRollback(row) {
|
|
|
+ // 待审核爬虫才能打回
|
|
|
+ // 未通过的爬虫不能点通过和打回
|
|
|
+ const canSubmit = row.state === 1
|
|
|
+ return !canSubmit
|
|
|
+ },
|
|
|
+ adminSubmit(row) {
|
|
|
+ // 只有审核通过才能上线,否则禁用
|
|
|
+ const canOnline = row.state === 3
|
|
|
+ return !canOnline
|
|
|
+ },
|
|
|
+ showRollback(row) {
|
|
|
+ // 审核员、管理员已通过的爬虫不显示打回按钮
|
|
|
+ return row.state !== 3
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
const dialogEvents = {
|
|
|
editSpiderConfigSaveEvent: async function (data) {
|