|
|
@@ -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>
|