|
@@ -89,13 +89,15 @@
|
|
|
<el-icon><Aim /></el-icon>
|
|
|
</el-button>
|
|
|
</el-tooltip>
|
|
|
- <el-tooltip content="提交" placement="top">
|
|
|
- <el-button size="small" :class="{ active: scope.row._action_clicked_submit }" @click="tableEvents.handleSubmit(scope.$index, scope.row)">
|
|
|
+ <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-icon><Promotion /></el-icon>
|
|
|
</el-button>
|
|
|
</el-tooltip>
|
|
|
- <el-tooltip content="回退" placement="top">
|
|
|
- <el-button size="small" :class="{ active: scope.row._action_clicked_rollback }" @click="tableEvents.handleRollback(scope.$index, scope.row)">
|
|
|
+ <el-tooltip content="回退" placement="top" v-if="showListRollbackButton">
|
|
|
+ <!-- 爬虫状态是待完成,才可点击回退 -->
|
|
|
+ <el-button size="small" :disabled="scope.row.state !== 0" :class="{ active: scope.row._action_clicked_rollback }" @click="tableEvents.handleRollback(scope.$index, scope.row)">
|
|
|
<el-icon><DArrowLeft /></el-icon>
|
|
|
</el-button>
|
|
|
</el-tooltip>
|
|
@@ -207,10 +209,14 @@ const prevClickedRow = ref({})
|
|
|
|
|
|
// 用户身份标识
|
|
|
const userRole = computed(() => store.getters.userRole)
|
|
|
-// 是否展示维护人模块
|
|
|
+// 是否展示维护人模块(管理员和审核员展示)
|
|
|
const showModifyUserFilter = computed(() => [USER_ROLE_ADMIN, USER_ROLE_REVIEWER].includes(userRole.value))
|
|
|
-// 是否展示认领按钮
|
|
|
+// 是否展示认领按钮(仅开发人员展示)
|
|
|
const showRenLingButton = computed(() => [USER_ROLE_DEVELOPER].includes(userRole.value))
|
|
|
+// 是否展示提交按钮(仅开发人员展示)
|
|
|
+const showListDevelopeButton = computed(() => [USER_ROLE_DEVELOPER].includes(userRole.value))
|
|
|
+// 是否展示回退按钮(仅开发人员展示)
|
|
|
+const showListRollbackButton = computed(() => [USER_ROLE_DEVELOPER].includes(userRole.value))
|
|
|
|
|
|
// 实现待认领不能和维护人同时筛选
|
|
|
// 是否禁用维护人模块(待认领筛选下,禁用维护人筛选模块)
|
|
@@ -483,6 +489,25 @@ const dialogEvents = {
|
|
|
},
|
|
|
}
|
|
|
|
|
|
+const getMarkWithRow = row => {
|
|
|
+ const baseInfo = {
|
|
|
+ code: row.code,
|
|
|
+ site: row.site,
|
|
|
+ channel: row.channel,
|
|
|
+ href: row.href,
|
|
|
+ modifyuser: row.modifyuser,
|
|
|
+ }
|
|
|
+
|
|
|
+ if (row.cssmark) {
|
|
|
+ return {
|
|
|
+ ...row.cssmark,
|
|
|
+ ...baseInfo,
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return baseInfo
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
// table的按钮事件集合
|
|
|
const tableEvents = {
|
|
|
handleDataTag(index, row) {
|
|
@@ -524,14 +549,7 @@ const tableEvents = {
|
|
|
duration: 3000,
|
|
|
})
|
|
|
}
|
|
|
- const mark = {
|
|
|
- ...row.cssmark,
|
|
|
- code: row.code,
|
|
|
- site: row.site,
|
|
|
- channel: row.channel,
|
|
|
- href: row.href,
|
|
|
- modifyuser: row.modifyuser,
|
|
|
- }
|
|
|
+ const mark = getMarkWithRow(row)
|
|
|
VerifySpiderConfig(mark).then(r => {
|
|
|
console.log("验证爬虫结果", r)
|
|
|
if (r.err === 1 && r.ret) {
|
|
@@ -550,25 +568,62 @@ const tableEvents = {
|
|
|
},
|
|
|
handleSubmit(index, row) {
|
|
|
onlyClickHighlight(row, '_action_clicked_submit')
|
|
|
- console.log('handleSubmit', row)
|
|
|
+ const mark = getMarkWithRow(row)
|
|
|
+ console.log(mark)
|
|
|
+ // ServerActionUpdateCodeState(mark, 1).then(r => {
|
|
|
+ // if (r.err === 1) {
|
|
|
+ // ElMessage({
|
|
|
+ // message: '提交成功',
|
|
|
+ // type: 'error',
|
|
|
+ // duration: 3000,
|
|
|
+ // })
|
|
|
+ // getTableList()
|
|
|
+ // } else {
|
|
|
+ // return ElMessage({
|
|
|
+ // message: r.msg || '提交失败',
|
|
|
+ // type: 'error',
|
|
|
+ // duration: 3000,
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
},
|
|
|
handleRollback(index, row) {
|
|
|
onlyClickHighlight(row, '_action_clicked_rollback')
|
|
|
- console.log('handleRollback', row)
|
|
|
+ const mark = getMarkWithRow(row)
|
|
|
+ console.log(mark)
|
|
|
+ // ServerActionUpdateCodeState(mark, -1).then(r => {
|
|
|
+ // if (r.err === 1) {
|
|
|
+ // ElMessage({
|
|
|
+ // message: '回退成功',
|
|
|
+ // type: 'error',
|
|
|
+ // duration: 3000,
|
|
|
+ // })
|
|
|
+ // getTableList()
|
|
|
+ // } else {
|
|
|
+ // return ElMessage({
|
|
|
+ // message: r.msg || '回退失败',
|
|
|
+ // type: 'error',
|
|
|
+ // duration: 3000,
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
},
|
|
|
}
|
|
|
|
|
|
//Wails事件绑定
|
|
|
EventsOn("spiderConfigChange", data => {
|
|
|
- const { key, sc } = data
|
|
|
- refreshAndAsyncEditDialog(key, sc[key])
|
|
|
- // listState.list.forEach((v, i) => {
|
|
|
- // if (v.code == data.code) {
|
|
|
- // let rowData = { ...data }
|
|
|
- // listState.list[i] = rowData
|
|
|
- // spiderTable.value.toggleRowSelection(listState.list[i], true);
|
|
|
- // }
|
|
|
- // })
|
|
|
+ const { key, css, url } = data
|
|
|
+ // 判断标注url和编辑url是否相同
|
|
|
+ const editUrl = currentEditRow.href
|
|
|
+ if (url === editUrl) {
|
|
|
+ refreshAndAsyncEditDialog(key, css[key])
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ message: `标注url和编辑url不匹配,此次更新取消。标注url: ${url},编辑url: ${editUrl}`,
|
|
|
+ type: 'warn',
|
|
|
+ duration: 4000,
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
</script>
|
|
|
|