From 3e3beca568531f5d2f943dcc0b3239efe69aa3b6 Mon Sep 17 00:00:00 2001 From: yziiy <15979918+mayday-yziiy@user.noreply.gitee.com> Date: Tue, 21 Oct 2025 17:33:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=B0=E5=8A=A0=E9=9C=80?= =?UTF-8?q?=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Financial/backRecharge/hook.tsx | 4 + src/views/room/roomList/hook.tsx | 36 ++++++- src/views/room/roomList/index.vue | 4 +- src/views/union/unionList/roomList.vue | 118 +++++++--------------- 4 files changed, 78 insertions(+), 84 deletions(-) diff --git a/src/views/Financial/backRecharge/hook.tsx b/src/views/Financial/backRecharge/hook.tsx index 45cd601..b630363 100644 --- a/src/views/Financial/backRecharge/hook.tsx +++ b/src/views/Financial/backRecharge/hook.tsx @@ -55,6 +55,10 @@ export function useData() { label: "数量(金币/钻石)", prop: "change_value" }, + { + label: "备注", + prop: "remarks", + }, { label: "支付时间", prop: "createtime", diff --git a/src/views/room/roomList/hook.tsx b/src/views/room/roomList/hook.tsx index 5f9647d..ad5e365 100644 --- a/src/views/room/roomList/hook.tsx +++ b/src/views/room/roomList/hook.tsx @@ -9,6 +9,7 @@ import ExportForm from '@/components/exportDialog/index.vue'; import { queryList, getRoomDetail, + queryClassifyList, deleteRoomData, updateRoomData } from "@/api/modules/room"; @@ -35,6 +36,30 @@ export function useData() { { label: "封禁", value: 2 }, { label: "关闭", value: 3 } ] + }, + { + label: "是否热门", + prop: "is_hot", + type: "select", + optionList: [ + { label: "是", value: 2 }, + { label: "否", value: 1 } + ] + }, + { + label: "是否置顶", + prop: "is_top", + type: "select", + optionList: [ + { label: "是", value: 2 }, + { label: "否", value: 1 } + ] + }, + { + label: "房间类型", + prop: "type_id", + type: "select", + optionList: [] } ]); const pagination = ref({ @@ -114,6 +139,14 @@ export function useData() { slot: "operation" } ]); + const getListType = async () => { + const { data, code } = await queryClassifyList({}); + if (code) { + searchLabel.value[searchLabel.value.length - 1].optionList = data.lists.map(ele => { + return { label: ele.type_name, value: ele.id } + }) + } + } const onSearch = async (formData) => { loading.value = true; searchForm.value = { ...formData } @@ -321,6 +354,7 @@ export function useData() { viewDetail, editDialog, viewTurntableData, - viewXunLeHuiData + viewXunLeHuiData, + getListType }; } diff --git a/src/views/room/roomList/index.vue b/src/views/room/roomList/index.vue index d454ef7..09da270 100644 --- a/src/views/room/roomList/index.vue +++ b/src/views/room/roomList/index.vue @@ -21,13 +21,15 @@ const { loading, exportExcel, editDialog, - viewXunLeHuiData + viewXunLeHuiData, + getListType } = useData(); defineOptions({ name: "roomList" }); onMounted(() => { onSearch(searchForm.value); + getListType() }); diff --git a/src/views/union/unionList/roomList.vue b/src/views/union/unionList/roomList.vue index 98dbb89..e5f96b9 100644 --- a/src/views/union/unionList/roomList.vue +++ b/src/views/union/unionList/roomList.vue @@ -27,6 +27,7 @@ const pagination = ref({ currentPage: 1, background: true }); +const totalConsumption = ref(0) const dynamicColumns = ref([ { label: "房间ID", @@ -64,94 +65,45 @@ const onSearch = async (formData) => { }); if (code) { tableList.value = data.lists; + totalConsumption.value = data.total_consumption; pagination.value.total = data.count; pagination.value.currentPage = data.page; } loading.value = false; } const exportFormRef = ref(null) -const exportExcel = () => { +const exportExcel = async () => { let exportTableList = [] - addDialog({ - title: `导出数据`, - props: { - formInline: { - time: '' - } - }, - width: "40%", - closeOnClickModal: false, - contentRenderer: () => h(ExportForm, { ref: exportFormRef, formInline: null }), - beforeSure: (done, { options }) => { - const FormRef = exportFormRef.value.getRef(); - const curData = options.props.formInline; - const exportData = async (formData) => { - const { data, code } = await queryUnionRoomList({ - ...formData, - guild_id: props.rowData.id, - page: 1, - page_limit: 20000 - }); - if (code) { - exportTableList = data.lists; - const res = exportTableList.map(item => { - const arr = []; - dynamicColumns.value.forEach(column => { - arr.push(item[column.prop as string]); - }); - return arr; - }); - const titleList = []; - dynamicColumns.value.forEach(column => { - titleList.push(column.label); - }); - res.unshift(titleList); - const workSheet = utils.aoa_to_sheet(res); - const workBook = utils.book_new(); - utils.book_append_sheet(workBook, workSheet, "数据报表"); - writeFile(workBook, `${props.rowData.guild_name}工会下的房间流水统计${formData.search_stime} - ${formData.search_etime}.xlsx`); - message("导出成功", { - type: "success" - }); - done() - } else { - message("获取数据失败,请重试!", { - type: "error" - }); - } - } - FormRef.validate(valid => { - if (valid) { - if (curData.time && curData.time.length) { - exportData({ search_stime: curData.time[0] || '', search_etime: curData.time[1] || '' }) - } - } - }); - } + const { data, code } = await queryUnionRoomList({ + search_stime: searchForm.value.search_stime, + search_etime: searchForm.value.search_etime, + guild_id: props.rowData.id, + page: 1, + page_limit: 20000 }); - + if (code) { + exportTableList = data.lists; + const res = exportTableList.map(item => { + const arr = []; + dynamicColumns.value.forEach(column => { + arr.push(item[column.prop as string]); + }); + return arr; + }); + const titleList = []; + dynamicColumns.value.forEach(column => { + titleList.push(column.label); + }); + res.unshift(titleList); + const workSheet = utils.aoa_to_sheet(res); + const workBook = utils.book_new(); + utils.book_append_sheet(workBook, workSheet, "数据报表"); + writeFile(workBook, `${props.rowData.guild_name}工会下的房间流水统计${searchForm.value.search_stime} - ${searchForm.value.search_etime}.xlsx`); + message("导出成功", { + type: "success" + }); + } } -// const exportExcel = () => { -// const res = tableList.value.map(item => { -// const arr = []; -// dynamicColumns.value.forEach(column => { -// arr.push(item[column.prop as string]); -// }); -// return arr; -// }); -// const titleList = []; -// dynamicColumns.value.forEach(column => { -// titleList.push(column.label); -// }); -// res.unshift(titleList); -// const workSheet = utils.aoa_to_sheet(res); -// const workBook = utils.book_new(); -// utils.book_append_sheet(workBook, workSheet, "数据报表"); -// writeFile(workBook, `房间流水统计第${pagination.value.currentPage}页.xlsx`); -// message("导出成功", { -// type: "success" -// }); -// } onMounted(() => { onSearch(searchForm.value) }) @@ -160,10 +112,12 @@ onMounted(() => {