From 8226604c0096ee53bc7ad9b48a651d6ebe98cb31 Mon Sep 17 00:00:00 2001 From: Dragon <13925835632@139.com> Date: Thu, 26 Oct 2023 14:58:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BC=96=E8=BE=91=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/roomAlbumPower/RoomRed.js | 8 +++ src/views/room/RoomRed.vue | 89 +++++++++++++++++++++++++++++-- 2 files changed, 93 insertions(+), 4 deletions(-) diff --git a/src/api/roomAlbumPower/RoomRed.js b/src/api/roomAlbumPower/RoomRed.js index 1fdd805..348e182 100644 --- a/src/api/roomAlbumPower/RoomRed.js +++ b/src/api/roomAlbumPower/RoomRed.js @@ -42,6 +42,14 @@ export const saveManager = query => { params: query }); }; +// 弹窗编辑 +export const redEnvelopeUpdate = query => { + return request({ + url: '/admin/room/redEnvelope/update', + method: 'post', + params: query + }); +}; // 弹窗删除 export const delUserRoomRedEnvelope = query => { return request({ diff --git a/src/views/room/RoomRed.vue b/src/views/room/RoomRed.vue index 4aaf2d9..3fff049 100644 --- a/src/views/room/RoomRed.vue +++ b/src/views/room/RoomRed.vue @@ -102,7 +102,11 @@ 新增 @@ -142,8 +146,16 @@ : "空或未知类型" }} - + + + +
+ + +
+ +
{{ delDialogText }} @@ -223,12 +258,14 @@ import { delUserRoomRedEnvelope, userPage, saveManager, + redEnvelopeUpdate, } from "@/api/roomAlbumPower/RoomRed"; import { ElMessage } from "element-plus"; export default { name: "RoomRed", data() { return { + editDialog: false, total: 10, //总页数 currentPage: 1, //页码 pageSize: 10, //条数 @@ -256,6 +293,7 @@ export default { public: null, delTablePowerRoomUid: null, delTablePowerUid: null, + editTableData: {}, }; }, created() { @@ -333,6 +371,49 @@ export default { this.delTablePowerRoomUid = row.roomUid; this.delTablePowerUid = row.uid; }, + // 编辑弹窗权限 + editTablePower(row) { + if (row.type == 1) { + this.radioHall = true; + this.radioFull = false; + } else if (row.type == 2) { + this.radioHall = false; + this.radioFull = true; + } else if (row.type == 3) { + this.radioHall = true; + this.radioFull = true; + } + this.editTableData = row; + this.editDialog = true; + }, + // 确认编辑按钮 + editDialogClick() { + if (this.radioHall && this.radioFull) { + this.typeRadio = 3; + } else if (this.radioHall && this.radioFull == false) { + this.typeRadio = 1; + } else if (this.radioFull && this.radioHall == false) { + this.typeRadio = 2; + } else { + this.typeRadio = 0; + } + if (this.typeRadio == 0) { + ElMessage({ + message: "请勾选开启的权限", + type: "error", + }); + return; + } + redEnvelopeUpdate({ + id: this.editTableData.id, + roomUid: this.editTableData.roomUid, + uid: this.editTableData.uid, + type: this.typeRadio, + }).then((res) => { + this.editDialog = false; + this.getUserPage(this.editTableData.roomUid); + }); + }, // 确认新增房间红包弹窗按钮 addAuthority() { redEnvelopeSave({ @@ -350,13 +431,13 @@ export default { this.typeRadio = 1; } else if (this.radioFull && this.radioHall == false) { this.typeRadio = 2; - }else{ + } else { this.typeRadio = 0; } }, // 确认弹窗新增按钮 addAuthorityLimits() { - console.log(this.typeRadio); + console.log(this.typeRadio); if (this.typeRadio == 0) { ElMessage({ message: "请勾选开启的权限",