diff --git a/src/api/task.js b/src/api/task.js index 7c59d57..2c44b9d 100644 --- a/src/api/task.js +++ b/src/api/task.js @@ -28,3 +28,11 @@ export const delTaskApi = taskId => { method: 'POST', }) } + +export const updateOperByTaskIdApi = (taskId, data) => { + return request({ + url: `/task/update/${taskId}`, + method: 'POST', + data, + }) +} diff --git a/src/components/Nuclear.vue b/src/components/Nuclear.vue index 780f437..383154d 100644 --- a/src/components/Nuclear.vue +++ b/src/components/Nuclear.vue @@ -50,7 +50,6 @@ { + const res = await delStationApi(id) + if (res?.code == 200) { + if (res?.data?.result) { + this.$message.success('删除成功') + this.getStationList() + } + } else { + this.$message.error(res?.msg) + } + confirmDia.destroy() + }, + onClose: ({ e, trigger }) => { + confirmDia.hide() + }, + }) }, async delCore(id) { - const res = await delCoreApi(id) - if (res?.code == 200) { - if (res?.data?.result) { - this.$message.success('删除成功') - this.getCoreList() - } - } + const confirmDia = this.$dialog.confirm({ + header: '删除', + body: '你确定要删除该项吗?', + confirmBtn: '确定', + cancelBtn: '取消', + onConfirm: async ({ e }) => { + const res = await delCoreApi(id) + if (res?.code == 200) { + if (res?.data?.result) { + this.$message.success('删除成功') + this.getCoreList() + } + } + confirmDia.destroy() + }, + onClose: ({ e, trigger }) => { + confirmDia.hide() + }, + }) }, stationClose() { this.stationVisible = false diff --git a/src/components/Task.vue b/src/components/Task.vue index dcccba9..f714232 100644 --- a/src/components/Task.vue +++ b/src/components/Task.vue @@ -28,6 +28,49 @@ :onClose="closeDelDialog" :cancelBtn="null" /> + + + diff --git a/src/components/User.vue b/src/components/User.vue index 5462943..88e05e1 100644 --- a/src/components/User.vue +++ b/src/components/User.vue @@ -71,7 +71,6 @@ { - return moment(row.createTime).format('YYYY-MM-DD') + return moment(row.createTime).format('YYYY-MM-DD HH:mm') }, }, { @@ -201,15 +200,27 @@ export default { this.$message.success('重置成功') }, async delUser(username) { - const res = await deleteUserApi(username) - if (res?.code == 200) { - if (res?.data?.result) { - this.$message.success('删除成功!') - this.getUserList() - } - } else { - this.$message.error(res?.msg) - } + const confirmDia = this.$dialog.confirm({ + header: '删除用户', + body: '你确定要删除该用户吗?', + confirmBtn: '确定', + cancelBtn: '取消', + onConfirm: async ({ e }) => { + const res = await deleteUserApi(username) + if (res?.code == 200) { + if (res?.data?.result) { + this.$message.success('删除成功!') + this.getUserList() + } + } else { + this.$message.error(res?.msg) + } + confirmDia.destroy() + }, + onClose: ({ e, trigger }) => { + confirmDia.hide() + }, + }) }, async onSubmit({ validateResult, firstError }) { if (validateResult === true) { diff --git a/src/pages/index.vue b/src/pages/index.vue index 4c7c834..2defc02 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -66,7 +66,7 @@ - +