fix: 页面优化
This commit is contained in:
@@ -23,7 +23,7 @@ export interface WithdrawVO {
|
|||||||
auditStatus: number;
|
auditStatus: number;
|
||||||
/** 到账状态:0=未支付,1=支付成功,2=支付失败 */
|
/** 到账状态:0=未支付,1=支付成功,2=支付失败 */
|
||||||
payStatus: number;
|
payStatus: number;
|
||||||
/** 流水单号 */
|
/** 第三方单号 */
|
||||||
serialNumber: string;
|
serialNumber: string;
|
||||||
/** 申请时间 */
|
/** 申请时间 */
|
||||||
createDate: string;
|
createDate: string;
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ function renderBodyCell({
|
|||||||
if (column.dataIndex === 'name') {
|
if (column.dataIndex === 'name') {
|
||||||
const maxLen = 15;
|
const maxLen = 15;
|
||||||
const raw = text || '';
|
const raw = text || '';
|
||||||
|
if (!raw) return <span>--</span>;
|
||||||
const display = raw.length > maxLen ? raw.slice(0, maxLen) + '...' : raw;
|
const display = raw.length > maxLen ? raw.slice(0, maxLen) + '...' : raw;
|
||||||
return raw.length > maxLen ? (
|
return raw.length > maxLen ? (
|
||||||
<Tooltip title={raw}>
|
<Tooltip title={raw}>
|
||||||
|
|||||||
@@ -125,22 +125,77 @@ export function useOrderModel() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{ title: '订单编号', dataIndex: 'orderNo', key: 'orderNo', width: 200 },
|
{
|
||||||
{ title: '赛事名称', dataIndex: 'name', key: 'name', width: 180 },
|
title: '订单编号',
|
||||||
{ title: '选手名称', dataIndex: 'realName', key: 'realName', width: 100 },
|
dataIndex: 'orderNo',
|
||||||
{ title: '手机号', dataIndex: 'phone', key: 'phone', width: 130 },
|
key: 'orderNo',
|
||||||
{ title: '比赛组别', dataIndex: 'categoryName', key: 'categoryName', width: 120 },
|
width: 200,
|
||||||
{ title: '报名人', dataIndex: 'creatorName', key: 'creatorName', width: 100 },
|
customRender: ({ text }: { text: string }) => text || '--',
|
||||||
{ title: '报名人手机号', dataIndex: 'creatorPhone', key: 'creatorPhone', width: 130 },
|
},
|
||||||
|
{
|
||||||
|
title: '赛事名称',
|
||||||
|
dataIndex: 'name',
|
||||||
|
key: 'name',
|
||||||
|
width: 180,
|
||||||
|
customRender: ({ text }: { text: string }) => text || '--',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '选手名称',
|
||||||
|
dataIndex: 'realName',
|
||||||
|
key: 'realName',
|
||||||
|
width: 100,
|
||||||
|
customRender: ({ text }: { text: string }) => text || '--',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '手机号',
|
||||||
|
dataIndex: 'phone',
|
||||||
|
key: 'phone',
|
||||||
|
width: 130,
|
||||||
|
customRender: ({ text }: { text: string }) => text || '--',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '比赛组别',
|
||||||
|
dataIndex: 'categoryName',
|
||||||
|
key: 'categoryName',
|
||||||
|
width: 120,
|
||||||
|
customRender: ({ text }: { text: string }) => text || '--',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '报名人',
|
||||||
|
dataIndex: 'creatorName',
|
||||||
|
key: 'creatorName',
|
||||||
|
width: 100,
|
||||||
|
customRender: ({ text }: { text: string }) => text || '--',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '报名人手机号',
|
||||||
|
dataIndex: 'creatorPhone',
|
||||||
|
key: 'creatorPhone',
|
||||||
|
width: 130,
|
||||||
|
customRender: ({ text }: { text: string }) => text || '--',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '报名人数',
|
title: '报名人数',
|
||||||
dataIndex: 'creatorSignupCount',
|
dataIndex: 'creatorSignupCount',
|
||||||
key: 'creatorSignupCount',
|
key: 'creatorSignupCount',
|
||||||
width: 90,
|
width: 90,
|
||||||
align: 'center' as const,
|
align: 'center' as const,
|
||||||
|
customRender: ({ text }: { text: number }) => (text != null ? text : '--'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '订单时间',
|
||||||
|
dataIndex: 'orderTime',
|
||||||
|
key: 'orderTime',
|
||||||
|
width: 170,
|
||||||
|
customRender: ({ text }: { text: string }) => text || '--',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '支付时间',
|
||||||
|
dataIndex: 'payTime',
|
||||||
|
key: 'payTime',
|
||||||
|
width: 170,
|
||||||
|
customRender: ({ text }: { text: string }) => text || '--',
|
||||||
},
|
},
|
||||||
{ title: '订单时间', dataIndex: 'orderTime', key: 'orderTime', width: 170 },
|
|
||||||
{ title: '支付时间', dataIndex: 'payTime', key: 'payTime', width: 170 },
|
|
||||||
{
|
{
|
||||||
title: '订单总金额',
|
title: '订单总金额',
|
||||||
dataIndex: 'creatorSignupFee',
|
dataIndex: 'creatorSignupFee',
|
||||||
|
|||||||
@@ -93,7 +93,13 @@ export function usePaymentsModel() {
|
|||||||
|
|
||||||
// ===== 表格列(dataIndex 对齐 API) =====
|
// ===== 表格列(dataIndex 对齐 API) =====
|
||||||
const columns = [
|
const columns = [
|
||||||
{ title: '流水号', dataIndex: 'serialNo', key: 'serialNo', width: 160 },
|
{
|
||||||
|
title: '第三方流水号',
|
||||||
|
dataIndex: 'serialNo',
|
||||||
|
key: 'serialNo',
|
||||||
|
width: 160,
|
||||||
|
customRender: ({ text }: { text: string }) => text || '--',
|
||||||
|
},
|
||||||
{ title: '订单编号', dataIndex: 'orderNo', key: 'orderNo', width: 160 },
|
{ title: '订单编号', dataIndex: 'orderNo', key: 'orderNo', width: 160 },
|
||||||
{
|
{
|
||||||
title: '类型',
|
title: '类型',
|
||||||
|
|||||||
@@ -124,13 +124,7 @@ export default defineComponent({
|
|||||||
customRender: ({ text }: { text: string }) => {
|
customRender: ({ text }: { text: string }) => {
|
||||||
const num = Number(text) || 0;
|
const num = Number(text) || 0;
|
||||||
const color = num > 0 ? '#52c41a' : num < 0 ? '#ff4d4f' : 'rgba(0,0,0,0.85)';
|
const color = num > 0 ? '#52c41a' : num < 0 ? '#ff4d4f' : 'rgba(0,0,0,0.85)';
|
||||||
const sign = num > 0 ? '+' : '';
|
return <span style={{ color, fontWeight: 500 }}>{text}</span>;
|
||||||
return (
|
|
||||||
<span style={{ color, fontWeight: 500 }}>
|
|
||||||
{sign}
|
|
||||||
{text}
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { Button, Input, Table, Form, Space, Pagination } from 'ant-design-vue';
|
import { Button, Input, InputNumber, Table, Form, Space, Pagination } from 'ant-design-vue';
|
||||||
import { WalletOutlined, LockOutlined, RiseOutlined } from '@ant-design/icons-vue';
|
import { WalletOutlined, LockOutlined, RiseOutlined } from '@ant-design/icons-vue';
|
||||||
import { useWalletModel } from './model/useWalletModel';
|
import { useWalletModel } from './model/useWalletModel';
|
||||||
import { useContainerSize } from '@/hooks';
|
import { useContainerSize } from '@/hooks';
|
||||||
@@ -156,13 +156,17 @@ export default defineComponent({
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="余额筛选">
|
<Form.Item label="余额筛选">
|
||||||
<Space.Compact>
|
<Space.Compact>
|
||||||
<Input
|
<InputNumber
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
style={{ width: '130px' }}
|
style={{ width: '140px' }}
|
||||||
value={filterForm.minBalance}
|
value={filterForm.minBalance || undefined}
|
||||||
onUpdate:value={(val: any) => (filterForm.minBalance = val ?? '')}
|
precision={0}
|
||||||
|
min={0}
|
||||||
|
controls={false}
|
||||||
|
onUpdate:value={(val: any) =>
|
||||||
|
(filterForm.minBalance = val != null ? String(val) : '')
|
||||||
|
}
|
||||||
onPressEnter={handleSearch}
|
onPressEnter={handleSearch}
|
||||||
allowClear
|
|
||||||
/>
|
/>
|
||||||
<Input
|
<Input
|
||||||
style={{
|
style={{
|
||||||
@@ -175,13 +179,17 @@ export default defineComponent({
|
|||||||
value="至"
|
value="至"
|
||||||
disabled
|
disabled
|
||||||
/>
|
/>
|
||||||
<Input
|
<InputNumber
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
style={{ width: '130px' }}
|
style={{ width: '140px' }}
|
||||||
value={filterForm.maxBalance}
|
value={filterForm.maxBalance || undefined}
|
||||||
onUpdate:value={(val: any) => (filterForm.maxBalance = val ?? '')}
|
precision={0}
|
||||||
|
min={0}
|
||||||
|
controls={false}
|
||||||
|
onUpdate:value={(val: any) =>
|
||||||
|
(filterForm.maxBalance = val != null ? String(val) : '')
|
||||||
|
}
|
||||||
onPressEnter={handleSearch}
|
onPressEnter={handleSearch}
|
||||||
allowClear
|
|
||||||
/>
|
/>
|
||||||
</Space.Compact>
|
</Space.Compact>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ export function useWithdrawModel() {
|
|||||||
},
|
},
|
||||||
{ title: '审核状态', dataIndex: 'auditStatus', key: 'auditStatus', width: 110 },
|
{ title: '审核状态', dataIndex: 'auditStatus', key: 'auditStatus', width: 110 },
|
||||||
{ title: '到账状态', dataIndex: 'payStatus', key: 'payStatus', width: 110 },
|
{ title: '到账状态', dataIndex: 'payStatus', key: 'payStatus', width: 110 },
|
||||||
{ title: '流水单号', dataIndex: 'serialNumber', key: 'serialNumber', width: 180 },
|
{ title: '第三方单号', dataIndex: 'serialNumber', key: 'serialNumber', width: 180 },
|
||||||
{ title: '申请时间', dataIndex: 'createDate', key: 'createDate', width: 180 },
|
{ title: '申请时间', dataIndex: 'createDate', key: 'createDate', width: 180 },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,12 @@ export const REAL_NAME_REGEX = /^[\u4e00-\u9fa5A-Za-z0-9·]{1,8}$/;
|
|||||||
*/
|
*/
|
||||||
export const IMAGE_TYPE_REGEX = /^image\//;
|
export const IMAGE_TYPE_REGEX = /^image\//;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纯数字(整数)
|
||||||
|
* - 用于过滤非数字字符
|
||||||
|
*/
|
||||||
|
export const INTEGER_ONLY_REGEX = /\D/g;
|
||||||
|
|
||||||
// ============================================================
|
// ============================================================
|
||||||
// 校验函数
|
// 校验函数
|
||||||
// ============================================================
|
// ============================================================
|
||||||
@@ -56,3 +62,8 @@ export function isValidRealName(value: unknown): boolean {
|
|||||||
export function isImageFile(file: { type: string }): boolean {
|
export function isImageFile(file: { type: string }): boolean {
|
||||||
return IMAGE_TYPE_REGEX.test(file.type);
|
return IMAGE_TYPE_REGEX.test(file.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 过滤非数字字符,只保留整数 */
|
||||||
|
export function toIntegerOnly(value: unknown): string {
|
||||||
|
return String(value ?? '').replace(INTEGER_ONLY_REGEX, '');
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user