删除增加二次确认

This commit is contained in:
guoyue 2022-11-03 17:58:28 +08:00
parent 14f82809f6
commit 3e1ff71686
6 changed files with 138 additions and 76 deletions

View File

@ -356,6 +356,11 @@ export default {
deleteHandle2(id) {
console.log('删除========================》', id, this.dataListSelections)
this.$confirm('确认是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const ids = []
if (id) {
ids.push(id)
@ -368,8 +373,18 @@ export default {
}
this.$http.post('/resource/delete', { ids: ids }).then(res => {
console.log('删除成功', res)
this.$message({
type: 'success',
message: '删除成功!'
});
this.getDataList()
})
}).catch(() => {
// this.$message({
// type: 'info',
// message: '已取消删除'
// });
});
},
// 导出
exportHandle() {

View File

@ -70,7 +70,7 @@ export default {
mixinViewModuleOptions: {
getDataListURL: "/fuse/page",
exportURL: "/ability/bsabilityai/export",
deleteURL: "/fuse",
deleteURL: "/fuse/delete",
getDataListIsPage: true,
deleteIsBatch: false,
},
@ -93,6 +93,11 @@ export default {
},
methods: {
deleteRow(id) {
this.$confirm('确认是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http.delete('/fuse/delete', {
data: [id]
}).then(res => {
@ -111,6 +116,8 @@ export default {
}).catch(err => {
this.$message.error(err);
})
}).catch(() => {
});
},
//
searchData() {

View File

@ -12,8 +12,8 @@
v-if="dataInfo.length > 1">删除
</el-button>
</el-form-item>
<el-button class="add-btn" size="small" v-if="index == dataInfo.length - 1" @click="addItem"
type="primary">添加
<el-button class="add-btn" size="small" v-if="index == dataInfo.length - 1" @click="addItem" type="primary">
添加
</el-button>
</div>
</div>
@ -97,8 +97,19 @@ export default {
})
},
//
deleteItem(list, index) {
deleteItem(index) {
this.$confirm('确认是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message({
type: 'success',
message: '删除成功!'
});
this.dataInfo.splice(index, 1)
}).catch(() => {
});
}
}
}

View File

@ -16,8 +16,8 @@
v-if="!disabledType && dataInfo.length > 1">删除
</el-button>
</el-form-item>
<el-button class="add-btn" size="small"
v-if="!disabledType && index == dataInfo.length - 1" @click="addItem" type="primary">添加
<el-button class="add-btn" size="small" v-if="!disabledType && index == dataInfo.length - 1"
@click="addItem" type="primary">添加
</el-button>
</div>
@ -100,8 +100,19 @@ export default {
})
},
//
deleteItem(list, index) {
deleteItem(index) {
this.$confirm('确认是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message({
type: 'success',
message: '删除成功!'
});
this.dataInfo.splice(index, 1)
}).catch(() => {
});
}
}
}

View File

@ -84,6 +84,11 @@ export default {
},
methods: {
deleteRow(id) {
this.$confirm('确认是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http.delete('/fuse/delete', {
data: [id]
}).then(res => {
@ -102,6 +107,8 @@ export default {
}).catch(err => {
this.$message.error(err);
})
}).catch(() => {
});
},
//
searchData() {

View File

@ -110,8 +110,19 @@ export default {
})
},
//
deleteItem(list, index) {
deleteItem(index) {
this.$confirm('确认是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message({
type: 'success',
message: '删除成功!'
});
this.dataInfo.splice(index, 1)
}).catch(() => {
});
}
}
}