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 @@ + + +