From b9bd31bcb6f74550aa1ddbc8b6ed1dd90dde66d5 Mon Sep 17 00:00:00 2001
From: yziiy <15979918+mayday-yziiy@user.noreply.gitee.com>
Date: Wed, 14 Jan 2026 10:39:44 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=88=BF=E9=97=B4=E8=AF=A6?=
=?UTF-8?q?=E6=83=85=E7=9A=84=E6=97=B6=E9=97=B4=E9=BB=98=E8=AE=A4=E5=80=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/Statistical/giftRecord/hook.tsx | 6 +-
src/views/Statistical/giftRecord/index.vue | 11 +-
src/views/room/roomList/detail.vue | 289 ++++++++++++---------
3 files changed, 184 insertions(+), 122 deletions(-)
diff --git a/src/views/Statistical/giftRecord/hook.tsx b/src/views/Statistical/giftRecord/hook.tsx
index 5c8a611..b52ee86 100644
--- a/src/views/Statistical/giftRecord/hook.tsx
+++ b/src/views/Statistical/giftRecord/hook.tsx
@@ -153,9 +153,9 @@ export function useData() {
tableList.value = data.lists.map(ele => {
return {
...ele,
- app_earning: parseFloat(ele.app_earning),
- room_owner_earning: parseFloat(ele.room_owner_earning),
- gift_user_earning: parseFloat(ele.gift_user_earning)
+ app_earning: ele.app_earning,
+ room_owner_earning: ele.room_owner_earning,
+ gift_user_earning: ele.gift_user_earning
};
});
diff --git a/src/views/Statistical/giftRecord/index.vue b/src/views/Statistical/giftRecord/index.vue
index c484012..15c4dfe 100644
--- a/src/views/Statistical/giftRecord/index.vue
+++ b/src/views/Statistical/giftRecord/index.vue
@@ -32,8 +32,15 @@ defineOptions({
diff --git a/src/views/room/roomList/detail.vue b/src/views/room/roomList/detail.vue
index f52143b..1106831 100644
--- a/src/views/room/roomList/detail.vue
+++ b/src/views/room/roomList/detail.vue
@@ -2,69 +2,122 @@
import { ref, h, onMounted } from "vue";
import { utils, writeFile } from "xlsx";
import { message } from "@/utils/message";
-import singView from './sing.vue';
+import singView from "./sing.vue";
+import dayjs from "dayjs";
import {
getRoomDetail,
getRoomWaterFlow,
getRoomEnterByUser
} from "@/api/modules/room";
const props = defineProps(["tableData"]);
-const dataBytable = ref({ ...props.tableData })
-const roomDetail = ref(null)
-const activeIndex = ref("1")
+const dataBytable = ref({ ...props.tableData });
+const roomDetail = ref(null);
+const activeIndex = ref("1");
const basicLable = ref([
- { label: 'ID', prop: 'id' },
- { label: '靓号', prop: 'age' },
- { label: '房主', prop: 'owner' },
- { label: '房间公告', prop: 'room_intro' },
- { label: '是否热门', prop: 'is_hot' },
- { label: '是否推荐', prop: 'is_recommend' },
- { label: '是否置顶', prop: 'is_top' },
- { label: '是否有收益', prop: 'is_earnings' },
- { label: '所属工会', prop: 'guild_name' },
- { label: '房间分类', prop: 'room_type_str' },
+ { label: "ID", prop: "id" },
+ { label: "靓号", prop: "age" },
+ { label: "房主", prop: "owner" },
+ { label: "房间公告", prop: "room_intro" },
+ { label: "是否热门", prop: "is_hot" },
+ { label: "是否推荐", prop: "is_recommend" },
+ { label: "是否置顶", prop: "is_top" },
+ { label: "是否有收益", prop: "is_earnings" },
+ { label: "所属工会", prop: "guild_name" },
+ { label: "房间分类", prop: "room_type_str" },
// { label: '审核时间', prop: 'system' },
- { label: '房间状态', prop: 'room_status' },
- { label: '是否密码房', prop: 'room_password' },
- { label: '机器人数量', prop: 'robot_num' }
-])
+ { label: "房间状态", prop: "room_status" },
+ { label: "是否密码房", prop: "room_password" },
+ { label: "机器人数量", prop: "robot_num" }
+]);
const statisticsLable = ref([
- { label: '今日收益', prefix: '¥', precision: 2, prop: 'today_earnings', tipValue: 'growth_percentage', tip: '比昨日相比' },
- { label: '昨日收益', prefix: '¥', precision: 2, prop: 'yesterday_earnings', tipValue: 'yesterday_growth_percentage', tip: '同比增长' },
- { label: '历史访客', prefix: '', prop: 'visitor', tipValue: 'growth_visitor', tip: '同比' },
- { label: '获得补贴', prefix: '', prop: 'fans_num', tipValue: 'growth_week_subsidy', tip: '同比' }
-])
+ {
+ label: "今日收益",
+ prefix: "¥",
+ precision: 2,
+ prop: "today_earnings",
+ tipValue: "growth_percentage",
+ tip: "比昨日相比"
+ },
+ {
+ label: "昨日收益",
+ prefix: "¥",
+ precision: 2,
+ prop: "yesterday_earnings",
+ tipValue: "yesterday_growth_percentage",
+ tip: "同比增长"
+ },
+ {
+ label: "历史访客",
+ prefix: "",
+ prop: "visitor",
+ tipValue: "growth_visitor",
+ tip: "同比"
+ },
+ {
+ label: "获得补贴",
+ prefix: "",
+ prop: "fans_num",
+ tipValue: "growth_week_subsidy",
+ tip: "同比"
+ }
+]);
const pagination = ref({
total: 0,
pageSize: 10,
currentPage: 1,
background: true
});
-const PriceTotal = ref(null)
+const PriceTotal = ref(null);
+
+// 获取当月第一天 00:00:00 和当前时间
+const getDefaultTimeRange = () => {
+ const now = dayjs();
+ const startOfMonth = now.startOf("month").format("YYYY-MM-DD HH:mm:ss");
+ const currentTime = now.format("YYYY-MM-DD HH:mm:ss");
+ return [startOfMonth, currentTime];
+};
+
const getAllData = async () => {
- const { data, code } = await getRoomDetail({ room_id: dataBytable.value.room_id })
- roomDetail.value = code ? {
- ...data,
- is_hot: data.is_hot === 1 ? '否' : '是',
- is_top: data.is_top === 1 ? '否' : '是',
- is_recommend: data.is_recommend === 1 ? '否' : '是',
- room_status: data.room_status === 1 ? '正常' : data.room_status === 2 ? '封禁' : '关闭',
- is_earnings: data.is_earnings === 1 ? '是' : '否',
- room_password: data.room_password === '' ? '否' : '是'
- } : null
-}
-const getFlowData = async (index) => {
+ const { data, code } = await getRoomDetail({
+ room_id: dataBytable.value.room_id
+ });
+ roomDetail.value = code
+ ? {
+ ...data,
+ is_hot: data.is_hot === 1 ? "否" : "是",
+ is_top: data.is_top === 1 ? "否" : "是",
+ is_recommend: data.is_recommend === 1 ? "否" : "是",
+ room_status:
+ data.room_status === 1
+ ? "正常"
+ : data.room_status === 2
+ ? "封禁"
+ : "关闭",
+ is_earnings: data.is_earnings === 1 ? "是" : "否",
+ room_password: data.room_password === "" ? "否" : "是"
+ }
+ : null;
+};
+const getFlowData = async index => {
if (index === 1) {
const { data, code } = await getRoomWaterFlow({
room_id: dataBytable.value.room_id,
page: pagination.value.currentPage,
page_limit: pagination.value.pageSize,
type: 1,
- stime: dateSearchValue.value ? dateSearchValue.value.length ? dateSearchValue.value[0] : '' : '',
- etime: dateSearchValue.value ? dateSearchValue.value.length ? dateSearchValue.value[1] : '' : '',
- })
+ stime: dateSearchValue.value
+ ? dateSearchValue.value.length
+ ? dateSearchValue.value[0]
+ : ""
+ : "",
+ etime: dateSearchValue.value
+ ? dateSearchValue.value.length
+ ? dateSearchValue.value[1]
+ : ""
+ : ""
+ });
if (code) {
- PriceTotal.value = data.total
+ PriceTotal.value = data.total;
flowTableList.value = data.lists;
pagination.value.total = data.count;
pagination.value.currentPage = data.page;
@@ -73,39 +126,38 @@ const getFlowData = async (index) => {
const { data, code } = await getRoomEnterByUser({
room_id: dataBytable.value.room_id,
page: pagination.value.currentPage,
- page_limit: pagination.value.pageSize,
- })
+ page_limit: pagination.value.pageSize
+ });
if (code) {
-
flowTableList.value = data.lists;
pagination.value.total = data.count;
pagination.value.currentPage = data.page;
}
}
-}
-const getExportData = async (index) => {
+};
+const getExportData = async index => {
if (index === 1) {
const { data, code } = await getRoomWaterFlow({
room_id: dataBytable.value.room_id,
page: 1,
page_limit: 10000,
type: tagValue.value
- })
+ });
if (code) {
- return data
+ return data;
}
} else {
const { data, code } = await getRoomEnterByUser({
room_id: dataBytable.value.room_id,
page: 1,
- page_limit: 10000,
- })
+ page_limit: 10000
+ });
if (code) {
- return data
+ return data;
}
}
-}
-const flowTableList = ref([])
+};
+const flowTableList = ref([]);
const dynamicflowColumns = ref([
{
label: "时间",
@@ -123,7 +175,7 @@ const dynamicflowColumns = ref([
label: "金额(金币)",
prop: "total_price"
}
-])
+]);
const dynamicUserColumns = ref([
{
label: "ID",
@@ -141,55 +193,54 @@ const dynamicUserColumns = ref([
label: "进入时间",
prop: "createtime"
}
-])
-const activeName = ref('1')
-const tagValue = ref(1)
-const dateSearchValue = ref([])
+]);
+const activeName = ref("1");
+const tagValue = ref(1);
+const dateSearchValue = ref(getDefaultTimeRange());
const tagList = ref([
- { value: 1, label: '全部流水' },
+ { value: 1, label: "全部流水" }
// { value: 2, label: '日流水' },
// { value: 3, label: '周流水' },
// { value: 4, label: '月流水' }
-])
+]);
onMounted(() => {
- getAllData()
- getFlowData(activeIndex.value == '1' ? 1 : 2)
-})
-const handleClick = (tab) => {
- const { name } = tab.props
- pagination.value.pageSize = 10
- pagination.value.currentPage = 1
- flowTableList.value = []
- activeIndex.value = name
- if (['1', '2'].includes(name)) {
- getFlowData(activeIndex.value == '1' ? 1 : 2)
+ getAllData();
+ getFlowData(activeIndex.value == "1" ? 1 : 2);
+});
+const handleClick = tab => {
+ const { name } = tab.props;
+ pagination.value.pageSize = 10;
+ pagination.value.currentPage = 1;
+ flowTableList.value = [];
+ activeIndex.value = name;
+ if (["1", "2"].includes(name)) {
+ getFlowData(activeIndex.value == "1" ? 1 : 2);
} else {
- console.log('点歌记录')
+ console.log("点歌记录");
}
-
-}
+};
const handleSizeChange = (val: number) => {
pagination.value.pageSize = val;
- getFlowData(activeIndex.value == '1' ? 1 : 2)
+ getFlowData(activeIndex.value == "1" ? 1 : 2);
};
const handleCurrentChange = (val: number) => {
pagination.value.currentPage = val;
- getFlowData(activeIndex.value == '1' ? 1 : 2)
+ getFlowData(activeIndex.value == "1" ? 1 : 2);
};
-const changeTime = (val) => {
+const changeTime = val => {
// console.log(val)
- getFlowData(activeIndex.value == '1' ? 1 : 2)
-}
-const changeType = (val) => {
- tagValue.value = val
- pagination.value.pageSize = 10
- pagination.value.currentPage = 1
- flowTableList.value = []
- getFlowData(activeIndex.value == '1' ? 1 : 2)
-}
+ getFlowData(activeIndex.value == "1" ? 1 : 2);
+};
+const changeType = val => {
+ tagValue.value = val;
+ pagination.value.pageSize = 10;
+ pagination.value.currentPage = 1;
+ flowTableList.value = [];
+ getFlowData(activeIndex.value == "1" ? 1 : 2);
+};
const exportExcal = async () => {
- let exportTableList = []
- const data = await getExportData(activeIndex.value == '1' ? 1 : 2)
+ let exportTableList = [];
+ const data = await getExportData(activeIndex.value == "1" ? 1 : 2);
if (data) {
exportTableList = data.lists;
const res = exportTableList.map(item => {
@@ -216,70 +267,74 @@ const exportExcal = async () => {
type: "error"
});
}
-}
-//
+};
+//
-
+
-
+
{{ roomDetail.room_name }}
-
+
- {{
- roomDetail[item.prop] }}
+ {{ roomDetail[item.prop]
+ }}
-
+
统计信息
-
+
- {{ roomDetail[item.tipValue] }}% {{ item.tip }}
+ :precision="item.precision || 0" :value="roomDetail[item.prop]" :title="item.label" />
+
+ {{ roomDetail[item.tipValue] }}% {{ item.tip }}
+
-
+
-
-
+
-
-
导出当前数据
- 幸运值流水总计:
{{ PriceTotal.total_lucky_coin }} ;流水总计:
{{
- PriceTotal.total_price
- }} 金币
+
+
+ 导出当前数据
+
+ 幸运值流水总计:
{{
+ PriceTotal.total_lucky_coin
+ }}
+ ;流水总计:
{{
+ PriceTotal.total_price
+ }}
+ 金币
-
-
+ }" @page-current-change="handleCurrentChange" @page-size-change="handleSizeChange" />
-
-
+ }" @page-current-change="handleCurrentChange" @page-size-change="handleSizeChange" />
-
+
@@ -300,4 +355,4 @@ const exportExcal = async () => {
}
}
}
-
\ No newline at end of file
+