From 32292a13ba773d69ec308fce0d798f70954b1450 Mon Sep 17 00:00:00 2001 From: hahwu <31872165+hahwu@users.noreply.github.com> Date: Wed, 24 Sep 2025 14:45:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/userlog/assetlog/asset-table.vue | 204 +++++++++--------- .../views/userlog/orderlog/event-table.vue | 11 +- 2 files changed, 114 insertions(+), 101 deletions(-) diff --git a/apps/web-antd/src/views/userlog/assetlog/asset-table.vue b/apps/web-antd/src/views/userlog/assetlog/asset-table.vue index 49a9c77..31d4e57 100644 --- a/apps/web-antd/src/views/userlog/assetlog/asset-table.vue +++ b/apps/web-antd/src/views/userlog/assetlog/asset-table.vue @@ -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 = { cellClick: async ({ row }) => { @@ -151,15 +151,21 @@ const gridEvents: VxeGridListeners = { const gridOptions: VxeGridProps = { 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 = { pagerConfig: {}, proxyConfig: { response: { - total: "total", - result: "data" + total: "total", + result: "data" }, ajax: { query: async ({ page }, formValues) => { @@ -181,11 +187,11 @@ const gridOptions: VxeGridProps = { 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 = { }, }, }, - + rowConfig: { isHover: true, }, @@ -215,8 +221,8 @@ const [Grid] = useVbenVxeGrid({ formOptions, gridOptions, gridEvents }); diff --git a/apps/web-antd/src/views/userlog/orderlog/event-table.vue b/apps/web-antd/src/views/userlog/orderlog/event-table.vue index 5377d60..b472878 100644 --- a/apps/web-antd/src/views/userlog/orderlog/event-table.vue +++ b/apps/web-antd/src/views/userlog/orderlog/event-table.vue @@ -87,6 +87,12 @@ const gridOptions: VxeGridProps = { }, { field: 'Param', title: '参数' }, ], + exportConfig: { + filename: '用户订单日志', + type: 'csv', + mode: 'current', + download: true, + }, toolbarConfig: { custom: true, export: true, @@ -149,6 +155,7 @@ onMounted(async () => { -