浏览代码

游戏记录

ssvfdn 3 月之前
父节点
当前提交
ad10e3bf32

+ 3 - 1
apps/web-antd/src/locales/langs/zh-CN/common.json

@@ -1,4 +1,6 @@
 {
     "placeholder": "请输入",
-    "placeholder_select": "请选择"
+    "placeholder_select": "请选择",
+    "range_time": "时间选择",
+    "game_method": "玩法"
 }

+ 2 - 2
apps/web-antd/src/views/game_control/game_config/index.vue

@@ -5,7 +5,7 @@ import { useVbenForm } from '#/adapter/form';
 import {$t} from "@vben/locales";
 import { useVbenVxeGrid } from '#/adapter/vxe-table';
 import {getGameList, getGameMinList} from "#/api/game_control/game_config.js";
-
+import {ref} from "vue";
 
 const filterGameList = ref([]);
 getGameMinList().then((data) => {
@@ -124,7 +124,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
 });
 
 import ExtraModal from './game_info.vue';
-import {ref} from "vue";
+
 import {reset} from "ant-design-vue/es/_util/cssinjs/hooks/useStyleRegister/cacheMapUtil.js";
 const [Modal, modalApi] = useVbenModal({
 	// 连接抽离的组件

+ 57 - 42
apps/web-antd/src/views/player_data/game_records/index.vue

@@ -4,7 +4,27 @@ import { useVbenForm } from '#/adapter/form';
 import { Page, useVbenModal } from '@vben/common-ui';
 import {Button, Card, Tag, Avatar, Switch} from "ant-design-vue";
 import {$t} from "@vben/locales";
+import {reactive, ref} from "vue";
+import dayjs from "dayjs";
+import {getGameMinList} from "#/api/game_control/game_config.js";
 
+// 列表筛选
+const filterData = reactive({
+	'search_type':"uname",
+});
+const filterGameList = ref([]);
+getGameMinList().then((data) => {
+	data.forEach((game) => {
+		filterGameList.value.push({
+			'label': `【${game.game_id}】${game.title}`,
+			'value': game.game_id,
+		})
+	})
+})
+const disabledDate = (current) => {
+	// Can not select days before today and today
+	return current && current > dayjs().endOf('day');
+};
 const [QueryForm] = useVbenForm({
 	// 默认展开
 	collapsed: false,
@@ -21,68 +41,63 @@ const [QueryForm] = useVbenForm({
 	// 水平布局,label和input在同一行
 	layout: 'horizontal',
 	schema: [
+
 		{
-			// 组件需要在 #/adapter.ts内注册,并加上类型
-			component: 'Input',
-			// 对应组件的参数
+			label:$t("common.range_time"),
+			component: 'RangePicker',
+			defaultValue: [dayjs(), dayjs()],
+			fieldName: 'range_time',
 			componentProps: {
-				placeholder: '请输入用户名',
-			},
-			// 字段名
-			fieldName: 'username',
-			// 界面显示的label
-			label: '字符串',
+				disabledDate: disabledDate,
+			}
 		},
 		{
-			component: 'InputPassword',
+			component: 'Select',
 			componentProps: {
-				placeholder: '请输入密码',
+				allowClear: true,
+				filterOption: true,
+				name:'game_id',
+				options: filterGameList,
+				placeholder: $t('common.placeholder_select'),
+				showSearch: true,
 			},
-			fieldName: 'password',
-			label: '密码',
+			fieldName: 'game_id',
+			label: $t('game_control.game'),
 		},
 		{
-			component: 'InputNumber',
-			componentProps: {
-				placeholder: '请输入',
-			},
-			fieldName: 'number',
-			label: '数字(带后缀)',
-			suffix: () => '¥',
+			// 组件需要在 #/adapter.ts内注册,并加上类型
+			component: 'Input',
+			// 对应组件的参数
+			// 字段名
+			fieldName: 'search_text',
+			// 界面显示的label
 		},
 		{
 			component: 'Select',
+			defaultValue:"",
 			componentProps: {
 				allowClear: true,
 				filterOption: true,
+				name:'game_id',
 				options: [
-					{
-						label: '选项1',
-						value: '1',
-					},
-					{
-						label: '选项2',
-						value: '2',
-					},
+					{label: "全部", value: ""},
+					{label: "连消", value: "1"},
+					{label: "免费旋转", value: "2"},
+					{label: "重转", value: "3"},
+					{label: "高倍", value: "4"},
 				],
-				placeholder: '请选择',
+				placeholder: $t('common.placeholder_select'),
 				showSearch: true,
 			},
-			fieldName: 'options',
-			label: '下拉选',
-		},
-		{
-			component: 'DatePicker',
-			fieldName: 'datePicker',
-			label: '日期选择框',
-		},
+			fieldName: 'game_id',
+			label: $t('common.game_method'),
+		}
 	],
 	// 是否可展开
-	showCollapseButton: true,
 	submitButtonOptions: {
 		content: '查询',
 	},
-	wrapperClass: 'grid-cols-1 md:grid-cols-2',
+	wrapperClass: 'grid-cols-1 md:grid-cols-3',
 });
 function onSubmit(values) {
 	message.success({
@@ -95,14 +110,14 @@ function onSubmit(values) {
 	<Page>
 		<Card>
 			<QueryForm>
-				<template #username="slotProps">
+				<template #search_text="slotProps">
 					<Input-Group compact>
-						<Select name="search_type" style="width: 20%">
+						<Select name="search_type" style="width: 30%" v-model:value="filterData.search_type">
 							<Select-Option value="uname">{{$t('player_data.search.uname')}}</Select-Option>
 							<Select-Option value="nickname">{{$t('player_data.search.nickname')}}</Select-Option>
 							<Select-Option value="user_id">{{$t('player_data.search.user_id')}}</Select-Option>
 						</Select>
-						<Input name="search_text" allowClear  v-bind="slotProps" style="width:80%"></Input>
+						<Input name="search_text" allowClear :placeholder="$t('player_data.placeholder') + '' + $t('player_data.search[\''+filterData.search_type+'\']')" v-bind="slotProps" style="width:70%"></Input>
 					</Input-Group>
 				</template>
 			</QueryForm>