实现自动脚本修改产品状态
This commit is contained in:
@@ -63,6 +63,7 @@
|
||||
|
||||
<template #col-status="{ row }">
|
||||
<el-switch
|
||||
v-if="row.jobId != null"
|
||||
v-model="row.status"
|
||||
active-value="0"
|
||||
inactive-value="1"
|
||||
@@ -308,8 +309,14 @@ function handleDelete(jobIds) {
|
||||
|
||||
// 任务状态修改
|
||||
function handleStatusChange(row) {
|
||||
// 行数据不完整(jobId 缺失,常见于加载瞬间/新增未刷新),把开关拨回并拦截,避免弹 "undefined" 确认框
|
||||
if (!row || row.jobId == null) {
|
||||
if (row) row.status = row.status === "0" ? "1" : "0"
|
||||
proxy.$modal.msgWarning("任务数据无效,请刷新列表后重试")
|
||||
return
|
||||
}
|
||||
let text = row.status === "0" ? "启用" : "停用"
|
||||
proxy.$modal.confirm('确认要"' + text + '""' + row.jobName + '"任务吗?').then(function () {
|
||||
proxy.$modal.confirm('确认要"' + text + '""' + (row.jobName || row.jobId) + '"任务吗?').then(function () {
|
||||
return changeJobStatus(row.jobId, row.status)
|
||||
}).then(() => {
|
||||
proxy.$modal.msgSuccess(text + "成功")
|
||||
|
||||
Reference in New Issue
Block a user