Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
CI / CI OK (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled
80 lines
1.7 KiB
TypeScript
80 lines
1.7 KiB
TypeScript
import type { VbenFormSchema } from '#/adapter/form';
|
|
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
|
|
|
import { getRebateTypeName } from '#/utils/agent';
|
|
|
|
export function useRebateColumns(): VxeTableGridOptions['columns'] {
|
|
return [
|
|
{
|
|
field: 'id',
|
|
title: 'ID',
|
|
width: 80,
|
|
},
|
|
{
|
|
field: 'agent_id',
|
|
title: '代理ID',
|
|
width: 100,
|
|
},
|
|
{
|
|
field: 'source_agent_id',
|
|
title: '来源代理ID',
|
|
width: 120,
|
|
},
|
|
{
|
|
field: 'order_id',
|
|
title: '订单ID',
|
|
width: 100,
|
|
},
|
|
{
|
|
field: 'rebate_type',
|
|
title: '返佣类型',
|
|
width: 140,
|
|
formatter: ({ cellValue }: { cellValue: number }) => {
|
|
return getRebateTypeName(cellValue);
|
|
},
|
|
},
|
|
{
|
|
field: 'amount',
|
|
title: '返佣金额',
|
|
width: 120,
|
|
formatter: ({ cellValue }: { cellValue: number }) =>
|
|
`¥${cellValue.toFixed(2)}`,
|
|
},
|
|
{
|
|
field: 'create_time',
|
|
title: '创建时间',
|
|
width: 160,
|
|
sortable: true,
|
|
},
|
|
] as const;
|
|
}
|
|
|
|
export function useRebateFormSchema(): VbenFormSchema[] {
|
|
return [
|
|
{
|
|
component: 'InputNumber',
|
|
fieldName: 'agent_id',
|
|
label: '代理ID',
|
|
},
|
|
{
|
|
component: 'InputNumber',
|
|
fieldName: 'source_agent_id',
|
|
label: '来源代理ID',
|
|
},
|
|
{
|
|
component: 'Select',
|
|
fieldName: 'rebate_type',
|
|
label: '返佣类型',
|
|
componentProps: {
|
|
allowClear: true,
|
|
options: [
|
|
{ label: '直接上级返佣', value: 1 },
|
|
{ label: '钻石上级返佣', value: 2 },
|
|
{ label: '黄金上级返佣', value: 3 },
|
|
],
|
|
},
|
|
},
|
|
];
|
|
}
|
|
|