feat: 回滚

This commit is contained in:
骑着蜗牛追导弹 2024-11-11 21:15:09 +08:00
parent 2966897d25
commit f82c90a8f8
2 changed files with 18 additions and 25 deletions

View File

@ -75,5 +75,16 @@ export default ({ service, request, faker, tools }) => ({
method: 'post', method: 'post',
data data
}) })
},
/**
* @description 分页查询变更历史记录
* @param {Object} data
*/
CORE_ROLLBACK (data = {}) {
return request({
url: '/rollback',
method: 'post',
data
})
} }
}) })

View File

@ -29,7 +29,7 @@
label="操作" label="操作"
width="160"> width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button @click="handleRemoveClick(scope.row)" type="text" size="small" :disabled="scope.row.isRelease === 1">回滚</el-button> <el-button @click="handleRollbackClick(scope.row)" type="text" size="small" :disabled="scope.row.isRelease === 1">回滚</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -85,41 +85,23 @@ export default {
this.pageSize = pageSize this.pageSize = pageSize
this.queryPage(1, this.pageSize) this.queryPage(1, this.pageSize)
}, },
async handleTestClick (row) { handleRollbackClick (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) {
const _this = this const _this = this
_this.$confirm('确认删除选中的解析记录, 是否继续?', '确认删除', { _this.$confirm('确认回滚选中的版本记录, 是否继续?', '确认回滚', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
_this.doDelete(row) _this.doRollback(row)
_this.queryPage(1, this.pageSize)
}).catch(() => { }).catch(() => {
}) })
}, },
async doDelete (row) { async doRollback (row) {
const res = await api.CORE_DELETE({ ...row, type: row.recordType }) const res = await api.CORE_ROLLBACK({ ...row })
if (res.code === 0) { if (res.code === 0) {
Message.success(res.message) Message.success(res.message)
this.onSearchFormSubmit() this.onSearchFormSubmit()
this.modifyFormVisible = false
} }
} }
} }