feature 调度任务可以暂停/运行

feature 任务列表可以批量删除
This commit is contained in:
陈景阳
2019-12-09 10:54:55 +08:00
parent 280877a0ae
commit dccc90e451
3 changed files with 15 additions and 19 deletions

View File

@@ -214,6 +214,9 @@ export default {
'Add Schedule': '添加定时任务',
'stop': '暂停',
'running': '运行',
'error': '错误',
'Not Found Node': '节点配置错误',
'Not Found Spider': '爬虫配置错误',
// 网站
'Site': '网站',

View File

@@ -110,7 +110,14 @@
:align="col.align"
:width="col.width">
<template slot-scope="scope">
{{ scope.row[col.name] ? $t(scope.row[col.name]) : $t('NA') }}
<el-tooltip v-if="scope.row[col.name] === 'error'" :content="$t(scope.row['message'])" placement="top">
<el-tag class="status-tag" type="danger">
{{scope.row[col.name] ? $t(scope.row[col.name]) : $t('NA')}}
</el-tag>
</el-tooltip>
<el-tag class="status-tag" v-else>
{{scope.row[col.name] ? $t(scope.row[col.name]) : $t('NA')}}
</el-tag>
</template>
</el-table-column>
<el-table-column v-else :key="col.name"
@@ -289,24 +296,6 @@ export default {
})
}).catch(() => {})
}
},
onCrontabFill (value) {
value = value.replace(/[?]/g, '*')
this.$set(this.scheduleForm, 'cron', value)
this.$st.sendEv('定时任务', '提交生成Cron', 'cron', this.scheduleForm.cron)
},
onShowCronDialog () {
this.showCron = true
if (this.expression.split(' ').length < 7) {
// this.expression = (this.scheduleForm.cron + ' ').replace(/[?]/g, '*')
this.expression = this.scheduleForm.cron + ' '
} else {
// this.expression = this.scheduleForm.cron.replace(/[?]/g, '*')
this.expression = this.scheduleForm.cron
}
this.$st.sendEv('定时任务', '点击生成Cron', 'cron', this.scheduleForm.cron)
}
},
created () {
@@ -343,4 +332,7 @@ export default {
min-height: 360px;
margin-top: 10px;
}
.status-tag {
cursor: pointer;
}
</style>

View File

@@ -229,6 +229,7 @@ export default {
type: 'error',
message: '请选择要删除的任务'
})
return
}
this.$confirm('确定删除任务', '提示', {
confirmButtonText: '确定',