From eef6d75da2f934f397081e7dd45e21208050ecf5 Mon Sep 17 00:00:00 2001 From: lq Date: Tue, 22 Apr 2025 10:48:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B5=84=E9=87=91=E6=B5=81=E6=B0=B4?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/finance/fund-water/api/index.ts | 10 ++ .../views/finance/fund-water/config/search.ts | 29 ++++++ .../views/finance/fund-water/config/table.ts | 81 +++++++++++++++ .../src/views/finance/fund-water/index.vue | 99 +++++++++++++++++++ 4 files changed, 219 insertions(+) create mode 100644 apps/web-antd/src/views/finance/fund-water/api/index.ts create mode 100644 apps/web-antd/src/views/finance/fund-water/config/search.ts create mode 100644 apps/web-antd/src/views/finance/fund-water/config/table.ts create mode 100644 apps/web-antd/src/views/finance/fund-water/index.vue diff --git a/apps/web-antd/src/views/finance/fund-water/api/index.ts b/apps/web-antd/src/views/finance/fund-water/api/index.ts new file mode 100644 index 00000000..927e57e4 --- /dev/null +++ b/apps/web-antd/src/views/finance/fund-water/api/index.ts @@ -0,0 +1,10 @@ +import { requestClient } from '#/api/request'; + +const prefix = 'fund-water/'; +/** + * 资金流水记录 + * @param data + */ +export async function getFundWaterListApi(data: any) { + return requestClient.get(`${prefix}list`, { params: data }); +} diff --git a/apps/web-antd/src/views/finance/fund-water/config/search.ts b/apps/web-antd/src/views/finance/fund-water/config/search.ts new file mode 100644 index 00000000..07d0ed21 --- /dev/null +++ b/apps/web-antd/src/views/finance/fund-water/config/search.ts @@ -0,0 +1,29 @@ +import type { VbenFormProps } from '#/adapter/form'; + +import dayjs from 'dayjs'; + +export const formOptions: VbenFormProps = { + // 默认展开 + collapsed: false, + schema: [ + { + component: 'RangePicker', + componentProps: { + format: 'YYYY-MM-DD', // 确保格式与你需要的一致 + }, + defaultValue: [dayjs().startOf('month'), dayjs()], + fieldName: 'search_time', + label: '时间范围', + }, + ], + // 控制表单是否显示折叠按钮 + showCollapseButton: true, + submitButtonOptions: { + content: '查询', + }, + // 是否在字段值改变时提交表单 + // submitOnChange: true, + // submitOnChange: true, + // 按下回车时是否提交表单 + submitOnEnter: true, +}; diff --git a/apps/web-antd/src/views/finance/fund-water/config/table.ts b/apps/web-antd/src/views/finance/fund-water/config/table.ts new file mode 100644 index 00000000..82756ad1 --- /dev/null +++ b/apps/web-antd/src/views/finance/fund-water/config/table.ts @@ -0,0 +1,81 @@ +import type { VxeGridProps } from '#/adapter/vxe-table'; + +import { getFundWaterListApi } from '../api'; + +interface RowType { + id: string; + name: string; + logo: string; + introduce: string; + created_at: string; +} + +export const gridOptions: VxeGridProps = { + checkboxConfig: { + highlight: true, + labelField: '', + }, + columns: [ + { field: 'id', align: 'left', title: 'ID' }, + { field: 'store.name', title: '诊所' }, + { field: 'doctor_info.name', title: '医生' }, + { field: 'price', title: '金额' }, + { field: 'order_type', title: '订单类型', slots: { default: 'order-type' } }, + { field: 'type', title: '流水类型', slots: { default: 'type' } }, + { field: 'created_at', title: '记录时间' }, + { + type: 'html', + title: '操作', + align: 'right', + slots: { default: 'action' }, + width: 200, + }, + ], + keepSource: true, + pagerConfig: {}, + columnConfig: { + useKey: true, + }, + rowConfig: { + useKey: true, + }, + // scrollY: { + // enabled: true, + // gt: 0, + // }, + proxyConfig: { + ajax: { + // 请求后端接口方法 + query: async ({ page }, formValues) => { + return await getFundWaterListApi({ + page: page.currentPage, + pageSize: page.pageSize, + ...formValues, + }); + }, + }, + }, + height: 'auto', + border: false, + toolbarConfig: { + // 是否显示搜索表单控制按钮 + // @ts-ignore 正式环境时有完整的类型声明 + search: true, + refresh: true, // 刷新 + print: false, // 打印 + export: false, // 导出 + // custom: true, // 自定义列 + zoom: true, // 最大化最小化 + slots: { + buttons: 'toolbar-buttons', + }, + custom: { + // 自定义列-图标 + icon: 'vxe-icon-menu', + }, + }, + expandConfig: { + // expandAll: true, + }, + showOverflow: false, +}; diff --git a/apps/web-antd/src/views/finance/fund-water/index.vue b/apps/web-antd/src/views/finance/fund-water/index.vue new file mode 100644 index 00000000..18168d22 --- /dev/null +++ b/apps/web-antd/src/views/finance/fund-water/index.vue @@ -0,0 +1,99 @@ + + + +