From be145c476ed7ce126164e728bc146470508c22d1 Mon Sep 17 00:00:00 2001 From: kkfluous Date: Mon, 16 Mar 2026 01:40:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(energy):=20=E5=AE=9E=E7=8E=B0=E8=83=BD?= =?UTF-8?q?=E6=BA=90=E8=B4=A6=E6=88=B7=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=EF=BC=88=E5=88=97=E8=A1=A8+Drawer+=E5=85=85=E5=80=BC=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- .../web-antd/src/views/energy/account/data.ts | 103 ++++++++++++++ .../src/views/energy/account/index.vue | 130 ++++++++++++++++++ .../energy/account/modules/account-drawer.vue | 76 ++++++++++ .../energy/account/modules/recharge-modal.vue | 59 ++++++++ 4 files changed, 368 insertions(+) create mode 100644 apps/web-antd/src/views/energy/account/data.ts create mode 100644 apps/web-antd/src/views/energy/account/index.vue create mode 100644 apps/web-antd/src/views/energy/account/modules/account-drawer.vue create mode 100644 apps/web-antd/src/views/energy/account/modules/recharge-modal.vue diff --git a/apps/web-antd/src/views/energy/account/data.ts b/apps/web-antd/src/views/energy/account/data.ts new file mode 100644 index 0000000..6577499 --- /dev/null +++ b/apps/web-antd/src/views/energy/account/data.ts @@ -0,0 +1,103 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { EnergyAccountApi } from '#/api/energy/account'; + +import { useActionColumn } from '#/utils/table'; +import { getRangePickerDefaultProps } from '#/utils'; + +export const ACCOUNT_STATUS_OPTIONS = [ + { label: '正常', value: 1, color: 'green' }, + { label: '冻结', value: 0, color: 'red' }, +]; + +export const FLOW_TYPE_OPTIONS = [ + { label: '充值', value: 1, color: 'green' }, + { label: '扣款', value: 2, color: 'red' }, + { label: '退款', value: 3, color: 'blue' }, + { label: '调整', value: 4, color: 'orange' }, +]; + +/** 搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'customerName', + label: '客户名称', + component: 'Input', + componentProps: { + placeholder: '请输入客户名称', + allowClear: true, + }, + }, + { + fieldName: 'accountStatus', + label: '账户状态', + component: 'Select', + componentProps: { + options: ACCOUNT_STATUS_OPTIONS, + placeholder: '请选择账户状态', + allowClear: true, + }, + }, + { + fieldName: 'createTime', + label: '创建时间', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + class: 'w-full', + }, + }, + ]; +} + +/** 表格列配置 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'customerName', + title: '客户名称', + minWidth: 150, + fixed: 'left', + }, + { + field: 'balance', + title: '当前余额', + minWidth: 120, + align: 'right', + slots: { default: 'balance' }, + }, + { + field: 'initBalance', + title: '初始余额', + minWidth: 100, + align: 'right', + }, + { + field: 'accumulatedRecharge', + title: '累计充值', + minWidth: 120, + align: 'right', + }, + { + field: 'accumulatedConsume', + title: '累计消费', + minWidth: 120, + align: 'right', + }, + { + field: 'reminderThreshold', + title: '预警阈值', + minWidth: 100, + align: 'right', + }, + { + field: 'accountStatus', + title: '状态', + minWidth: 80, + align: 'center', + slots: { default: 'accountStatus' }, + }, + useActionColumn(3), + ]; +} diff --git a/apps/web-antd/src/views/energy/account/index.vue b/apps/web-antd/src/views/energy/account/index.vue new file mode 100644 index 0000000..11c86cf --- /dev/null +++ b/apps/web-antd/src/views/energy/account/index.vue @@ -0,0 +1,130 @@ + + + diff --git a/apps/web-antd/src/views/energy/account/modules/account-drawer.vue b/apps/web-antd/src/views/energy/account/modules/account-drawer.vue new file mode 100644 index 0000000..3999138 --- /dev/null +++ b/apps/web-antd/src/views/energy/account/modules/account-drawer.vue @@ -0,0 +1,76 @@ + + + diff --git a/apps/web-antd/src/views/energy/account/modules/recharge-modal.vue b/apps/web-antd/src/views/energy/account/modules/recharge-modal.vue new file mode 100644 index 0000000..6c38f4a --- /dev/null +++ b/apps/web-antd/src/views/energy/account/modules/recharge-modal.vue @@ -0,0 +1,59 @@ + + +