|
|
@@ -27,7 +27,7 @@ const disabledDate = (current) => {
|
|
|
// Can not select days before today and today
|
|
|
return current && current > dayjs().endOf('day');
|
|
|
};
|
|
|
-const [QueryForm, formApi] = useVbenForm({
|
|
|
+const formOptions = {
|
|
|
// 默认展开
|
|
|
collapsed: false,
|
|
|
// 所有表单项共用,可单独在表单内覆盖
|
|
|
@@ -39,7 +39,7 @@ const [QueryForm, formApi] = useVbenForm({
|
|
|
labelWidth: 50
|
|
|
},
|
|
|
// 提交函数
|
|
|
- handleSubmit: onSubmit,
|
|
|
+ // handleSubmit: onSubmit,
|
|
|
handleReset: onReset,
|
|
|
// 垂直布局,label和input在不同行,值为vertical
|
|
|
// 水平布局,label和input在同一行
|
|
|
@@ -63,10 +63,10 @@ const [QueryForm, formApi] = useVbenForm({
|
|
|
fieldName: 'range_time',
|
|
|
componentProps: {
|
|
|
disabledDate: disabledDate,
|
|
|
- showTime:{
|
|
|
- hideDisabledOptions: true,
|
|
|
- defaultValue: [dayjs('00:00:00', 'HH:mm'), dayjs('11:59:59', 'HH:mm:ss')],
|
|
|
- }
|
|
|
+ // showTime:{
|
|
|
+ // hideDisabledOptions: true,
|
|
|
+ // defaultValue: [dayjs('00:00:00', 'HH:mm'), dayjs('11:59:59', 'HH:mm:ss')],
|
|
|
+ // }
|
|
|
}
|
|
|
},
|
|
|
],
|
|
|
@@ -74,13 +74,12 @@ const [QueryForm, formApi] = useVbenForm({
|
|
|
submitButtonOptions: {
|
|
|
content: '查询',
|
|
|
},
|
|
|
+ // 控制表单是否显示折叠按钮
|
|
|
+ showCollapseButton: false,
|
|
|
wrapperClass: 'grid-cols-1 md:grid-cols-3',
|
|
|
-});
|
|
|
-function onSubmit(values) {
|
|
|
- gridApi.reload();
|
|
|
}
|
|
|
function onReset() {
|
|
|
- formApi.resetForm();
|
|
|
+ gridApi.formApi.resetForm();
|
|
|
filterData.search_type = 'uname';
|
|
|
filterData.ip_type = 'login_ip';
|
|
|
gridApi.reload();
|
|
|
@@ -115,8 +114,8 @@ const gridOptions = {
|
|
|
keepSource: true,
|
|
|
proxyConfig: {
|
|
|
ajax: {
|
|
|
- query: async ({ page }) => {
|
|
|
- const search = await formApi.getValues();
|
|
|
+ query: async ({ page }, formValues) => {
|
|
|
+ const search = await gridApi.formApi.getValues();
|
|
|
let form = {
|
|
|
page: page.currentPage,
|
|
|
limit: page.pageSize,
|
|
|
@@ -148,15 +147,16 @@ const gridOptions = {
|
|
|
// import: true,
|
|
|
refresh: true,
|
|
|
zoom: true,
|
|
|
+ search: true
|
|
|
},
|
|
|
};
|
|
|
const [Grid, gridApi] = useVbenVxeGrid({
|
|
|
+ formOptions,
|
|
|
gridOptions,
|
|
|
});
|
|
|
|
|
|
// 查看玩家详情
|
|
|
import ExtraModal from './player_info.vue';
|
|
|
-import {useVbenForm} from "#/adapter/form.js";
|
|
|
const [Modal, modalApi] = useVbenModal({
|
|
|
// 连接抽离的组件
|
|
|
connectedComponent: ExtraModal,
|
|
|
@@ -169,60 +169,51 @@ const playerInfo = (row) => {
|
|
|
}).open();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
<Page>
|
|
|
- <Card class="mb-5">
|
|
|
- <QueryForm>
|
|
|
- <template #search_text="slotProps">
|
|
|
- <Input-Group compact>
|
|
|
- <Select name="search_type" style="width: 110px;" 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 :placeholder="$t('player_data.placeholder') + '' + $t('player_data.search[\''+filterData.search_type+'\']')" v-bind="slotProps" style="width:calc(100% - 110px)"></Input>
|
|
|
- </Input-Group>
|
|
|
- </template>
|
|
|
- <template #ip_text="slotProps">
|
|
|
- <Input-Group compact>
|
|
|
- <Select name="search_type" style="width: 110px;" v-model:value="filterData.ip_type">
|
|
|
- <Select-Option value="login_ip">{{$t('player_data.search.login_ip')}}</Select-Option>
|
|
|
- <Select-Option value="reg_ip">{{$t('player_data.search.reg_ip')}}</Select-Option>
|
|
|
- </Select>
|
|
|
- <Input name="ip_text" allowClear :placeholder="$t('player_data.placeholder') + '' + $t('player_data.search[\''+filterData.ip_type+'\']')" v-bind="slotProps" style="width:calc(100% - 110px"></Input>
|
|
|
- </Input-Group>
|
|
|
- </template>
|
|
|
- </QueryForm>
|
|
|
- </Card>
|
|
|
- <Card>
|
|
|
- <div class="vp-raw w-full">
|
|
|
- <Grid>
|
|
|
- <template #uname="{ row }">
|
|
|
- <Button type="link" @click="playerInfo(row)">{{row.uname}}</Button>
|
|
|
- </template>
|
|
|
- <template #status="{ row }">
|
|
|
- <Tag color="green">{{row.status_text}}</Tag>
|
|
|
- </template>
|
|
|
- <template #adjust-status="{ row }">
|
|
|
- <Tag>{{row.adjust_status_text}}</Tag>
|
|
|
- </template>
|
|
|
+ <Grid>
|
|
|
+ <template #uname="{ row }">
|
|
|
+ <Button type="link" @click="playerInfo(row)">{{row.uname}}</Button>
|
|
|
+ </template>
|
|
|
+ <template #status="{ row }">
|
|
|
+ <Tag color="green">{{row.status_text}}</Tag>
|
|
|
+ </template>
|
|
|
+ <template #adjust-status="{ row }">
|
|
|
+ <Tag>{{row.adjust_status_text}}</Tag>
|
|
|
+ </template>
|
|
|
+
|
|
|
|
|
|
+ <template #today-win-amount="{ row }">
|
|
|
+ <span v-if="row.today_win_amount >= 0" style="color:green">{{row.today_win_amount }}</span>
|
|
|
+ <span v-else style="color:red">{{row.today_win_amount }}</span>
|
|
|
+ </template>
|
|
|
+ <template #history-win-amount="{ row }">
|
|
|
+ <span v-if="row.history_win_amount >= 0" style="color:green">{{row.history_win_amount }}</span>
|
|
|
+ <span v-else style="color:red">{{row.history_win_amount }}</span>
|
|
|
+ </template>
|
|
|
|
|
|
- <template #today-win-amount="{ row }">
|
|
|
- <span v-if="row.today_win_amount >= 0" style="color:green">{{row.today_win_amount }}</span>
|
|
|
- <span v-else style="color:red">{{row.today_win_amount }}</span>
|
|
|
- </template>
|
|
|
- <template #history-win-amount="{ row }">
|
|
|
- <span v-if="row.history_win_amount >= 0" style="color:green">{{row.history_win_amount }}</span>
|
|
|
- <span v-else style="color:red">{{row.history_win_amount }}</span>
|
|
|
- </template>
|
|
|
- </Grid>
|
|
|
- </div>
|
|
|
- </Card>
|
|
|
+ <template #form-search_text="slotProps">
|
|
|
+ <Input-Group compact>
|
|
|
+ <Select name="search_type" style="width: 110px;" 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 :placeholder="$t('player_data.placeholder') + '' + $t('player_data.search[\''+filterData.search_type+'\']')" v-bind="slotProps" style="width:calc(100% - 110px)"></Input>
|
|
|
+ </Input-Group>
|
|
|
+ </template>
|
|
|
+ <template #form-ip_text="slotProps">
|
|
|
+ <Input-Group compact>
|
|
|
+ <Select name="search_type" style="width: 110px;" v-model:value="filterData.ip_type">
|
|
|
+ <Select-Option value="login_ip">{{$t('player_data.search.login_ip')}}</Select-Option>
|
|
|
+ <Select-Option value="reg_ip">{{$t('player_data.search.reg_ip')}}</Select-Option>
|
|
|
+ </Select>
|
|
|
+ <Input name="ip_text" allowClear :placeholder="$t('player_data.placeholder') + '' + $t('player_data.search[\''+filterData.ip_type+'\']')" v-bind="slotProps" style="width:calc(100% - 110px)"></Input>
|
|
|
+ </Input-Group>
|
|
|
+ </template>
|
|
|
+ </Grid>
|
|
|
<Modal />
|
|
|
</Page>
|
|
|
</template>
|