From f82c90a8f808d161b894cd91f0c375e85d06ed2d Mon Sep 17 00:00:00 2001 From: odboy Date: Mon, 11 Nov 2024 21:15:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9B=9E=E6=BB=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/sys.core.api.js | 11 +++++++++ src/views/core/versionRecord/index.vue | 32 ++++++-------------------- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/src/api/modules/sys.core.api.js b/src/api/modules/sys.core.api.js index 743bdc6..2821ce1 100644 --- a/src/api/modules/sys.core.api.js +++ b/src/api/modules/sys.core.api.js @@ -75,5 +75,16 @@ export default ({ service, request, faker, tools }) => ({ method: 'post', data }) + }, + /** + * @description 分页查询变更历史记录 + * @param {Object} data + */ + CORE_ROLLBACK (data = {}) { + return request({ + url: '/rollback', + method: 'post', + data + }) } }) diff --git a/src/views/core/versionRecord/index.vue b/src/views/core/versionRecord/index.vue index 7de04cf..ed3227f 100644 --- a/src/views/core/versionRecord/index.vue +++ b/src/views/core/versionRecord/index.vue @@ -29,7 +29,7 @@ label="操作" width="160"> @@ -85,41 +85,23 @@ export default { this.pageSize = pageSize this.queryPage(1, this.pageSize) }, - async handleTestClick (row) { - const res = await api.CORE_TEST_HOSTNAME(row) - if (res.code === 0) { - Message.success(res.message) - } - }, - handleModifyClick (row) { - this.modifyFormModel = { ...row, type: row.recordType } - this.modifyFormVisible = true - }, - async doModify () { - const res = await api.CORE_MODIFY(this.modifyFormModel) - if (res.code === 0) { - Message.success(res.message) - this.onSearchFormSubmit() - this.modifyFormVisible = false - } - }, - handleRemoveClick (row) { + handleRollbackClick (row) { const _this = this - _this.$confirm('确认删除选中的解析记录, 是否继续?', '确认删除', { + _this.$confirm('确认回滚选中的版本记录, 是否继续?', '确认回滚', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { - _this.doDelete(row) + _this.doRollback(row) + _this.queryPage(1, this.pageSize) }).catch(() => { }) }, - async doDelete (row) { - const res = await api.CORE_DELETE({ ...row, type: row.recordType }) + async doRollback (row) { + const res = await api.CORE_ROLLBACK({ ...row }) if (res.code === 0) { Message.success(res.message) this.onSearchFormSubmit() - this.modifyFormVisible = false } } }