增加回滚不删表按钮防止误删数据库重要数据
This commit is contained in:
@@ -36,10 +36,11 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="操作" min-width="180">
|
||||
<el-table-column align="left" label="操作" min-width="240">
|
||||
<template #default="scope">
|
||||
<div>
|
||||
<el-button size="small" type="text" :disabled="scope.row.flag === 1" @click="rollbackFunc(scope.row)">回滚</el-button>
|
||||
<el-button size="small" type="text" :disabled="scope.row.flag === 1" @click="rollbackFunc(scope.row,true)">回滚(删表)</el-button>
|
||||
<el-button size="small" type="text" :disabled="scope.row.flag === 1" @click="rollbackFunc(scope.row,false)">回滚(不删表)</el-button>
|
||||
<el-button size="small" type="text" @click="goAutoCode(scope.row)">复用</el-button>
|
||||
<el-button size="small" type="text" @click="deleteRow(scope.row)">删除</el-button>
|
||||
</div>
|
||||
@@ -120,13 +121,13 @@ const deleteRow = async(row) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
const rollbackFunc = async(row) => {
|
||||
ElMessageBox.confirm('此操作将删除自动创建的文件和api, 是否继续?', '提示', {
|
||||
const rollbackFunc = async(row, flag) => {
|
||||
ElMessageBox.confirm(`此操作将删除自动创建的文件和api${flag ? '(包含数据库表!)' : ''}, 是否继续?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async() => {
|
||||
const res = await rollback({ id: Number(row.ID) })
|
||||
const res = await rollback({ id: Number(row.ID), deleteTable: flag })
|
||||
if (res.code === 0) {
|
||||
ElMessage.success('回滚成功')
|
||||
getTableData()
|
||||
|
Reference in New Issue
Block a user