实现自动脚本修改产品状态

This commit is contained in:
wuweihua
2026-09-09 17:56:53 +08:00
parent db0c5919b0
commit 06294d636a
9 changed files with 191 additions and 2 deletions
+8 -1
View File
@@ -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 + "成功")