版本更新
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
CI / CI OK (push) Has been cancelled

This commit is contained in:
hahwu 2025-09-24 14:45:13 +08:00
parent 07baf3cf1f
commit 32292a13ba
2 changed files with 114 additions and 101 deletions

View File

@ -12,8 +12,8 @@ import { eventModal } from '#/component';
import dayjs from 'dayjs';
const state = inject('globalState', globalState);
const [Modal, modalApi] = useVbenModal({
connectedComponent:eventModal,
class:'width:1800px;',
connectedComponent: eventModal,
class: 'width:1800px;',
});
interface RowType {
@ -39,104 +39,104 @@ const formatItemName = (cellValue: number) => {
return ItemData.find((item) => item.Id === cellValue)?.Name || cellValue;
}
const d = ref({
sum : 0,
psum : 0,
nsum : 0,
sum: 0,
psum: 0,
nsum: 0,
});
const startDate = dayjs().startOf('day');
const endDate = dayjs().endOf('day');
const formOptions: VbenFormProps = {
//
commonConfig: {
//
commonConfig: {
//
componentProps: {
class: 'w-full',
},
},
layout: 'horizontal',
},
layout: 'horizontal',
//
collapsed: false,
schema: [
{
component: 'Input',
componentProps: {
placeholder: 'Uid',
},
defaultValue: state.uid,
fieldName: 'Uid',
label: 'Uid',
schema: [
{
component: 'Input',
componentProps: {
placeholder: 'Uid',
},
{
component: 'DatePicker',
defaultValue: startDate,
componentProps: {
format: 'YYYY-MM-DD',
},
fieldName: 'StartTime',
label: '开始时间',
},
{
component: 'TimePicker',
componentProps: {
placeholder: '时间',
},
fieldName: 'StartTime',
label: '--',
wrapperClass: 'col-span-3 col-start-2',
},
{
component: 'Select',
componentProps: {
options: [
{ label: '增加', value: 'gain' },
{ label: '减少', value: 'consume' },
],
allowClear: true,
},
fieldName: 'Event',
label: '变化类型',
},
{
component: 'DatePicker',
defaultValue: endDate,
componentProps: {
format: 'YYYY-MM-DD',
},
fieldName: 'EndTime',
label: '结束时间',
},
{
component: 'TimePicker',
componentProps: {
placeholder: '时间',
},
fieldName: 'EndTime',
label: '--',
wrapperClass: 'col-span-3 col-start-2',
},
{
component: 'Select',
componentProps: {
options: [
{ label: '能量', value: 100001 },
{ label: '宠物币', value: '100002' },
{ label: '钻石', value: '100003' },
],
allowClear: true,
},
fieldName: 'ItemId',
label: '道具id',
},
],
//
showCollapseButton: true,
submitButtonOptions: {
content: '查询',
defaultValue: state.uid,
fieldName: 'Uid',
label: 'Uid',
},
//
submitOnChange: false,
//
submitOnEnter: false,
{
component: 'DatePicker',
defaultValue: startDate,
componentProps: {
format: 'YYYY-MM-DD',
},
fieldName: 'StartTime',
label: '开始时间',
},
{
component: 'TimePicker',
componentProps: {
placeholder: '时间',
},
fieldName: 'StartTime',
label: '--',
wrapperClass: 'col-span-3 col-start-2',
},
{
component: 'Select',
componentProps: {
options: [
{ label: '增加', value: 'gain' },
{ label: '减少', value: 'consume' },
],
allowClear: true,
},
fieldName: 'Event',
label: '变化类型',
},
{
component: 'DatePicker',
defaultValue: endDate,
componentProps: {
format: 'YYYY-MM-DD',
},
fieldName: 'EndTime',
label: '结束时间',
},
{
component: 'TimePicker',
componentProps: {
placeholder: '时间',
},
fieldName: 'EndTime',
label: '--',
wrapperClass: 'col-span-3 col-start-2',
},
{
component: 'Select',
componentProps: {
options: [
{ label: '能量', value: 100001 },
{ label: '宠物币', value: '100002' },
{ label: '钻石', value: '100003' },
],
allowClear: true,
},
fieldName: 'ItemId',
label: '道具id',
},
],
//
showCollapseButton: true,
submitButtonOptions: {
content: '查询',
},
//
submitOnChange: false,
//
submitOnEnter: false,
}
const gridEvents: VxeGridListeners<RowType> = {
cellClick: async ({ row }) => {
@ -151,15 +151,21 @@ const gridEvents: VxeGridListeners<RowType> = {
const gridOptions: VxeGridProps<RowType> = {
columns: [
{ field: 'Uid', title: 'Uid' },
{ field: 'change_type', title: '变化类型', formatter:({cellValue}) => formatType(cellValue)},
{ field: 'change_type', title: '变化类型', formatter: ({ cellValue }) => formatType(cellValue) },
{ field: 'change_num', title: '变化数值' },
{ field: 'change_after', title: '变化后数值' },
{ field: 'item_id', title: '道具名称', formatter: ({ cellValue }) => formatItemName(cellValue) },
{ field: 'item_id', title: '道具id'},
{ field: 'timestamp', title: '时间', formatter: ({ cellValue }) => new Date(cellValue*1000).toLocaleString()},
{ field: 'item_id', title: '道具id' },
{ field: 'timestamp', title: '时间', formatter: ({ cellValue }) => new Date(cellValue * 1000).toLocaleString() },
],
height: 'auto',
keepSource: true,
exportConfig: {
filename: '用户资产日志',
type: 'csv',
mode: 'current',
download: true,
},
toolbarConfig: {
custom: true,
export: true,
@ -169,8 +175,8 @@ const gridOptions: VxeGridProps<RowType> = {
pagerConfig: {},
proxyConfig: {
response: {
total: "total",
result: "data"
total: "total",
result: "data"
},
ajax: {
query: async ({ page }, formValues) => {
@ -181,11 +187,11 @@ const gridOptions: VxeGridProps<RowType> = {
state.uid = uid;
const ItemId = parseInt(formValues.ItemId, 10);
console.log(formValues.StartTime.unix());
const r = await getUserLogAssetApi({
const r = await getUserLogAssetApi({
Id: uid,
Event :formValues.Event,
Event: formValues.Event,
StartTime: formValues.StartTime.unix(),
EndTime: formValues.EndTime.unix(),
ItemId: ItemId,
@ -199,7 +205,7 @@ const gridOptions: VxeGridProps<RowType> = {
},
},
},
rowConfig: {
isHover: true,
},
@ -215,8 +221,8 @@ const [Grid] = useVbenVxeGrid({ formOptions, gridOptions, gridEvents });
<Grid>
<template #toolbar-tools>
总数:<span style="margin-right: 10px;margin-left: 5px;"> {{ d.sum }} </span>
正数和: <span style="margin-right: 10px;margin-left: 5px;color:green">{{ d.psum }} </span>
负数和: <span style="color: red;margin-left: 5px;">{{ d.nsum }} </span>
正数和: <span style="margin-right: 10px;margin-left: 5px;color:green">{{ d.psum }} </span>
负数和: <span style="color: red;margin-left: 5px;">{{ d.nsum }} </span>
</template>
</Grid>
</Page>

View File

@ -87,6 +87,12 @@ const gridOptions: VxeGridProps<RowType> = {
},
{ field: 'Param', title: '参数' },
],
exportConfig: {
filename: '用户订单日志',
type: 'csv',
mode: 'current',
download: true,
},
toolbarConfig: {
custom: true,
export: true,
@ -149,6 +155,7 @@ onMounted(async () => {
</script>
<template>
<Page auto-content-height> <Grid /> </Page>
<Page auto-content-height>
<Grid />
</Page>
</template>