Skip to content

Commit ed0b849

Browse files
author
piexlmax
committed
增加删表回滚确认次数
1 parent 3c7d4e7 commit ed0b849

File tree

1 file changed

+37
-11
lines changed
  • web/src/view/systemTools/autoCodeAdmin

1 file changed

+37
-11
lines changed

web/src/view/systemTools/autoCodeAdmin/index.vue

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,43 @@ const deleteRow = async(row) => {
122122
})
123123
}
124124
const rollbackFunc = async(row, flag) => {
125-
ElMessageBox.confirm(`此操作将删除自动创建的文件和api${flag ? '(包含数据库表!)' : ''}, 是否继续?`, '提示', {
126-
confirmButtonText: '确定',
127-
cancelButtonText: '取消',
128-
type: 'warning'
129-
}).then(async() => {
130-
const res = await rollback({ id: Number(row.ID), deleteTable: flag })
131-
if (res.code === 0) {
132-
ElMessage.success('回滚成功')
133-
getTableData()
134-
}
135-
})
125+
if (flag) {
126+
ElMessageBox.confirm(`此操作将删除自动创建的文件和api(会删除表!!!), 是否继续?`, '提示', {
127+
confirmButtonText: '确定',
128+
cancelButtonText: '取消',
129+
type: 'warning'
130+
}).then(async() => {
131+
ElMessageBox.confirm(`此操作将删除自动创建的文件和api(会删除表!!!), 请继续确认!!!`, '会删除表', {
132+
confirmButtonText: '确定',
133+
cancelButtonText: '取消',
134+
type: 'warning'
135+
}).then(async() => {
136+
ElMessageBox.confirm(`此操作将删除自动创建的文件和api(会删除表!!!), 请继续确认!!!`, '会删除表', {
137+
confirmButtonText: '确定',
138+
cancelButtonText: '取消',
139+
type: 'warning'
140+
}).then(async() => {
141+
const res = await rollback({ id: Number(row.ID), deleteTable: flag })
142+
if (res.code === 0) {
143+
ElMessage.success('回滚成功')
144+
getTableData()
145+
}
146+
})
147+
})
148+
})
149+
} else {
150+
ElMessageBox.confirm(`此操作将删除自动创建的文件和api, 是否继续?`, '提示', {
151+
confirmButtonText: '确定',
152+
cancelButtonText: '取消',
153+
type: 'warning'
154+
}).then(async() => {
155+
const res = await rollback({ id: Number(row.ID), deleteTable: flag })
156+
if (res.code === 0) {
157+
ElMessage.success('回滚成功')
158+
getTableData()
159+
}
160+
})
161+
}
136162
}
137163
const goAutoCode = (row) => {
138164
if (row) {

0 commit comments

Comments
 (0)