el-switch修改值

169 阅读1分钟

image.png

image.png // 任务状态修改 handleStatusChange(row) { let text = row.status === "0" ? "启用" : "停用"; this.$confirm( '确认要"' + text + '""' + row.jobName + '"任务吗?', "警告", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning", } ) .then(function () { return changeJobStatus(row.jobId, row.status); }) .then(() => { this.msgSuccess(text + "成功"); }) .catch(function () { row.status = row.status === "0" ? "1" : "0"; }); },

            export function changeJobStatus(jobId, status) {
                          const data = {
                            jobId,
                            status
                          }
                          return request({
                            url: '/monitor/job/changeStatus',
                            method: 'put',
                            data: data
                          })
                        }