提交roll全部删除功能

This commit is contained in:
2026-07-27 10:38:57 +08:00
parent 9d0693fe19
commit b0487259ab
3 changed files with 81 additions and 16 deletions
+7
View File
@@ -95,6 +95,13 @@ export function delRoll(rollId) {
method: "delete",
});
}
export function delAllRoll() {
return request({
url: `/admin/roll/removeAll`,
method: "delete",
});
}
export function rollJackpotOrnamentDel(jackpotId, rollJackpotOrnamentsIds) {
return request({
url: `/admin/rollJackpotOrnaments/${jackpotId}/${rollJackpotOrnamentsIds}`,
+35 -6
View File
@@ -49,17 +49,27 @@
v-hasPermi="['admin:user:export']"
>导出</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-edit"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['admin:user:edit']"
>删除</el-button>
</el-col>-->
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-warning"
size="mini"
@click="handleDeleteAll"
v-hasPermi="['admin:user:edit']"
>一键删除所有</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table
@@ -314,6 +324,7 @@ import {
rollJackpotList,
roll,
delRoll,
delAllRoll,
rollChange
} from "@/api/skins/ttRoll/api";
import { generateRollCdk, getRollCdkList, deleteRollCdk } from "@/api/skins/ttRoll/api";
@@ -510,21 +521,39 @@ export default {
};
},
handleSelectionChange(selection) {
this.ids = selection.map(item => item.userId);
this.ids = selection.map(item => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
handleDelete(row) {
const ids = row ? [row] : this.ids;
if (!ids || ids.length === 0) {
this.$modal.msgWarning("请至少选择一条数据");
return;
}
this.$modal
.confirm('是否确认删除ID为"' + row + '"的Roll房?')
.confirm('是否确认删除ID为"' + ids.join(", ") + '"的Roll房?')
.then(() => {
delRoll(row).then(res => {
delRoll(ids.join(",")).then(res => {
this.getList();
this.$modal.msgSuccess("删除成功");
});
})
.catch(() => {});
},
handleDeleteAll() {
this.$modal
.confirm('此操作将删除所有Roll房,且不可恢复,是否继续?', "系统提示", {
type: "warning"
})
.then(() => {
delAllRoll().then(res => {
this.getList();
this.$modal.msgSuccess("一键删除成功");
});
})
.catch(() => {});
},
handleExport() {
this.download(
"admin/roll/export",