diff --git a/admin-client/src/core/utils/Tools.ts b/admin-client/src/core/utils/Tools.ts index eb2c331..384adaa 100644 --- a/admin-client/src/core/utils/Tools.ts +++ b/admin-client/src/core/utils/Tools.ts @@ -441,81 +441,37 @@ class Tools { fileInput.click(); }); } - /** - * 图片上传 - * @param imgaeId imageId - * @param imageType 图片类型 - * @param modelName 模块 - * @returns - */ - static async imageFileUpload( - imgaeId: number, - imageType: number, - modelName?: string, - ): Promise { - //#region 创建文件选择器 - const file = await this.selectFile(); - if (file == null) { - return null; - } - return await this.imageUpdate(file, imgaeId, imageType, modelName); - //#endregion + static PlayGameStatus = [ + { value: 0, name: "初始化", color: "#00FF00" }, + { value: 1, name: "启动游戏", color: "#00FF00" }, + { value: 2, name: "排队中", color: "#00FF00" }, + { value: 3, name: "排队成功", color: "#00FF00" }, + { value: 4, name: "取消排队", color: "#FFFF00" }, + { value: 5, name: "排队掉线", color: "#FFFF00" }, + { value: 6, name: "排队掉线结束游戏", color: "red" }, + { value: 10, name: "游戏启动失败", color: "red" }, + { value: 11, name: "用户钻石不足", color: "red" }, + { value: 12, name: "用户游玩时钻石不足", color: "red" }, + { value: 13, name: "用户游玩时钻石不足退出游戏", color: "red" }, + { value: 14, name: "排队异常", color: "red" }, + { value: 15, name: "用户扣款错误", color: "red" }, + { value: 20, name: "开始游戏", color: "#00FF00" }, + { value: 21, name: "游戏中", color: "#00FF00" }, + { value: 22, name: "用户主动结束游戏", color: "#00FF00" }, + { value: 23, name: "游戏掉线", color: "#FFFF00" }, + { value: 24, name: "游戏掉线结束", color: "red" }, + { value: 40, name: "游戏结束", color: "#00FF00" }, + { value: 50, name: "游戏暂停", color: "#00FF00" }, + { value: 51, name: "切换视频等级", color: "#00FF00" } + ]; + static getStatusNameByValue(value: number) { + const status = this.PlayGameStatus.find(status => status.value === value); + return status ? status.name : null; // 如果找到对应的状态,返回其名称,否则返回null } - /** - * 上传图片 - * @param file 文件流 - * @param imgaeId 图片编号 - * @param imageType 图片类型 - * @param modelName 模块 - * @returns - */ - static async imageUpdate( - file: File, - imgaeId: number, - imageType: number, - modelName?: string, - tenantId?: string, - ): Promise { - // const key = "updatable"; - // AntdvMessage.loading({ content: "上传图片中", key }); - // try { - // if (modelName == null || modelName == "") { - // if (imageType == 0) { - // modelName = "images/common"; - // } else { - // modelName = "images/common"; - // } - // } - // const fileInfo = await this.cosUploadFile(file, modelName); - // if (imgaeId == undefined || imgaeId == null) { - // imgaeId = 0; - // } - // const fromData = await TImageConfigService.findForm(imgaeId); - // const _data = fromData.data; - // //#region 处理数据 - // _data.form.url = fileInfo.imageUrl; - // if (_data.form.name == null || _data.form.name == "") { - // _data.form.name = Tools.getFileNameWithoutExtension(file); - // } - // _data.form.ossPath = fileInfo._cosData.filePath; - // _data.form.region = fileInfo._cosData.bucket; - // // _data.form.imageId = imgaeId; - // _data.form.imageType = imageType; - // if (tenantId != null) { - // console.log('租户==》', tenantId); - // _data.form.tenantId = tenantId; - // } - // //#endregion - // const result = await TImageConfigService.saveForm(_data.id, _data.form); - // AntdvMessage.success({ content: "上传成功", key, duration: 2 }); - // return { imageId: result.data, imageUrl: fileInfo.imageUrl }; - // } catch (error) { - // console.log(error); - // AntdvMessage.error({ content: "上传失败", key, duration: 2 }); - // } - - return null; + static getStatusNameByColor(value: number) { + const status = this.PlayGameStatus.find(status => status.value === value); + return status ? status.color : null; // 如果找到对应的状态,返回其名称,否则返回null } } diff --git a/admin-client/src/views/Apps/App/T_Game_PlayGameLogs/GameUserOperationJson.vue b/admin-client/src/views/Apps/App/T_Game_PlayGameLogs/GameUserOperationJson.vue index fdd42b9..f509ef0 100644 --- a/admin-client/src/views/Apps/App/T_Game_PlayGameLogs/GameUserOperationJson.vue +++ b/admin-client/src/views/Apps/App/T_Game_PlayGameLogs/GameUserOperationJson.vue @@ -9,7 +9,7 @@ import { } from "vue"; import * as monaco from "monaco-editor"; import "monaco-editor/min/vs/editor/editor.main.css"; - +import Tools from "@/core/utils/Tools"; const props = defineProps<{ onSuccess: () => void }>(); let editorContainer = ref(); let editorInstance: monaco.editor.IStandaloneCodeEditor | null = null; @@ -82,7 +82,7 @@ defineExpose({ totalMilliseconds.value = 0; nextTick(() => { const data = JSON.parse(jsonstr || "{}"); - jsonData.value.slice(0, jsonData.value.length); + jsonData.value.splice(0, jsonData.value.length); jsonData.value.push(...data); setTimeout(() => { if (editorInstance) { @@ -118,6 +118,8 @@ function showJyRequestData(t: any) { editorInstance.setValue( JSON.stringify(JSON.parse(t.RequestContent), null, 2) ); + console.log(t); + } totalMilliseconds.value = t.TotalMilliseconds; } @@ -143,15 +145,12 @@ function showJyRequestData(t: any) { width="80%" > - +
@@ -203,6 +203,6 @@ function showJyRequestData(t: any) { diff --git a/admin-client/src/views/Apps/App/T_Game_PlayGameLogs/Index.vue b/admin-client/src/views/Apps/App/T_Game_PlayGameLogs/Index.vue index 737d657..69b51ea 100644 --- a/admin-client/src/views/Apps/App/T_Game_PlayGameLogs/Index.vue +++ b/admin-client/src/views/Apps/App/T_Game_PlayGameLogs/Index.vue @@ -257,6 +257,12 @@ onMounted(() => { findList(); }); +function chongzhi() { + state.search.vm.gameid = undefined; + state.search.vm.gamename = undefined; + state.search.vm.userid = undefined; +} + /** *获取数据 */ @@ -379,7 +385,7 @@ function exportExcel() { @@ -467,7 +473,10 @@ function exportExcel() { diff --git a/admin-client/src/views/home/Index.vue b/admin-client/src/views/home/Index.vue index 47f4099..2eab700 100644 --- a/admin-client/src/views/home/Index.vue +++ b/admin-client/src/views/home/Index.vue @@ -2,6 +2,10 @@ import {ref} from "vue"; import WorkOrder from "./components/WorkOrder.vue"; import WorkOrderStatistics from "./components/WorkOrderStatistics.vue"; +import UserSignStatistics from "./components/UserSignStatistics.vue"; +import PlayGameTimeStatistics from "./components/PlayGameTimeStatistics.vue"; + + import HomeChart1 from "./components/HomeChart1.vue"; import HomeChart2 from "./components/HomeChart2.vue"; import HomeChart3 from "./components/HomeChart3.vue"; @@ -26,59 +30,17 @@ let visible = ref(false);
- + - - - - - - -
- - -
- - - - - - - - - - - -
- - -
- - - - - - - - - - - - - - - + + + + + +
diff --git a/admin-client/src/views/home/components/PlayGameTimeStatistics.vue b/admin-client/src/views/home/components/PlayGameTimeStatistics.vue new file mode 100644 index 0000000..531a43f --- /dev/null +++ b/admin-client/src/views/home/components/PlayGameTimeStatistics.vue @@ -0,0 +1,70 @@ + + + + + diff --git a/admin-client/src/views/home/components/UserSignStatistics.vue b/admin-client/src/views/home/components/UserSignStatistics.vue new file mode 100644 index 0000000..22b19c3 --- /dev/null +++ b/admin-client/src/views/home/components/UserSignStatistics.vue @@ -0,0 +1,70 @@ + + + + + diff --git a/admin-client/src/views/home/components/WorkOrder.vue b/admin-client/src/views/home/components/WorkOrder.vue index 58b558a..55c99b0 100644 --- a/admin-client/src/views/home/components/WorkOrder.vue +++ b/admin-client/src/views/home/components/WorkOrder.vue @@ -2,76 +2,115 @@ import { ref, onBeforeUnmount } from "vue"; import AppIcon from "@/core/components/AppIcon.vue"; -let value1 = ref(12); -let value2 = ref(26); -let value3 = ref(107); -let value4 = ref(5); -let iconSize = ref(60); -let timer = ref(null); -timer.value = setInterval(() => { - value1.value = Math.floor(Math.random() * 90); - value2.value = Math.floor(Math.random() * 90); - value3.value = Math.floor(Math.random() * 1000); - value4.value = Math.floor(Math.random() * 500); -}, 2 * 1000); +interface CardData { + title: string; + unit: string; + value: number; + icon: string; + color: string; +} -onBeforeUnmount(() => { - if (timer.value) { - clearInterval(timer.value); - } -}); +const iconSize = ref(60); +const timer = ref(null); +const cards = ref([ + { + title: "今日注册人数", + unit: "人", + value: 107, + icon: "UserAddOutlined", + color: "#32CD32", + }, + { + title: "今日登录人数", + unit: "人", + value: 5, + icon: "UserOutlined", + color: "#9370DB", + }, + { + title: "当前在线人数", + unit: "人", + value: 0, + icon: "TeamOutlined", + color: "#00BFFF", + }, + { + title: "当前玩游戏人数", + unit: "人", + value: 0, + icon: "UserSwitchOutlined", + color: "#FF8C00", + }, + { + title: "当前排队人数", + unit: "人", + value: 0, + icon: "UserSwitchOutlined", + color: "#FF7F50", + }, + { + title: "今日意向订单", + unit: "次", + value: 5, + icon: "SolutionOutlined", + color: "#FFD700", + }, + { + title: "今日支付订单", + unit: "次", + value: 5, + icon: "AccountBookOutlined", + color: "#FF4500", + }, + { + title: "今日充值金额", + unit: "次", + value: 5, + icon: "AccountBookOutlined", + color: "#FF6347", + }, +]); + +const updateValues = () => { + cards.value = cards.value.map((card) => { + const max = card.unit === "台" ? 1000 : card.unit === "次" ? 500 : 90; + return { ...card, value: Math.floor(Math.random() * max) }; + }); +}; + +// timer.value = setInterval(updateValues, 2000); + +// onBeforeUnmount(() => { +// if (timer.value) { +// // clearInterval(timer.value); +// } +// });