feat: 合并代码,增加分页默认值

This commit is contained in:
2025-08-21 21:38:58 -07:00
parent f90f431540
commit fe704d1611
4 changed files with 126 additions and 8 deletions
@@ -315,6 +315,9 @@ export default function NodeTable() {
return updatedItems;
}}
initialPagination={{
initialPageSize: 200,
}}
/>
);
}
@@ -34,6 +34,9 @@ import { z } from 'zod';
const inviteSchema = z.object({
forced_invite: z.boolean().optional(),
referral_percentage: z.number().optional(),
non_first_purchase_percentage: z.number().optional(),
first_yearly_purchase_percentage: z.number().optional(),
first_purchase_percentage: z.number().optional(),
only_first_purchase: z.boolean().optional(),
});
@@ -60,6 +63,9 @@ export default function InviteConfig() {
forced_invite: false,
referral_percentage: 0,
only_first_purchase: false,
non_first_purchase_percentage: 0,
first_yearly_purchase_percentage: 0,
first_purchase_percentage: 0,
},
});
@@ -123,7 +129,6 @@ export default function InviteConfig() {
className='float-end !mt-0'
/>
</FormControl>
<FormDescription>{t('forcedInviteDescription')}</FormDescription>
<FormMessage />
</FormItem>
)}
@@ -131,10 +136,10 @@ export default function InviteConfig() {
<FormField
control={form.control}
name='referral_percentage'
name='first_yearly_purchase_percentage'
render={({ field }) => (
<FormItem>
<FormLabel>{t('referralPercentage')}</FormLabel>
<FormLabel></FormLabel>
<FormControl>
<EnhancedInput
placeholder={t('inputPlaceholder')}
@@ -146,11 +151,108 @@ export default function InviteConfig() {
onValueBlur={(value) => field.onChange(Number(value))}
/>
</FormControl>
<FormDescription>{t('referralPercentageDescription')}</FormDescription>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name='first_purchase_percentage'
render={({ field }) => (
<FormItem>
<FormLabel></FormLabel>
<FormControl>
<EnhancedInput
placeholder={t('inputPlaceholder')}
value={field.value}
type='number'
min={0}
max={100}
suffix='%'
onValueBlur={(value) => field.onChange(Number(value))}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name='non_first_purchase_percentage'
render={({ field }) => (
<FormItem>
<FormLabel></FormLabel>
<FormControl>
<EnhancedInput
placeholder={t('inputPlaceholder')}
value={field.value}
type='number'
min={0}
max={100}
suffix='%'
onValueBlur={(value) => field.onChange(Number(value))}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
{/*
<TableRow>
<TableCell>
<Label>年付套餐首充佣金比例</Label>
<p className='text-muted-foreground text-xs'></p>
</TableCell>
<TableCell className='text-right'>
<EnhancedInput
placeholder={t('inputPlaceholder')}
value={data?.first_yearly_purchase_percentage}
type='number'
min={0}
max={100}
suffix='%'
onValueBlur={(value) => updateConfig('first_yearly_purchase_percentage', value)}
/>
</TableCell>
</TableRow>
<TableRow>
<TableCell>
<Label>月付套餐首充佣金比例</Label>
<p className='text-muted-foreground text-xs'></p>
</TableCell>
<TableCell className='text-right'>
<EnhancedInput
placeholder={t('inputPlaceholder')}
value={data?.first_purchase_percentage}
type='number'
min={0}
max={100}
suffix='%'
onValueBlur={(value) => updateConfig('first_purchase_percentage', value)}
/>
</TableCell>
</TableRow>
<TableRow>
<TableCell>
<Label>再次充值佣金比例</Label>
<p className='text-muted-foreground text-xs'></p>
</TableCell>
<TableCell className='text-right'>
<EnhancedInput
placeholder={t('inputPlaceholder')}
value={data?.non_first_purchase_percentage}
type='number'
min={0}
max={100}
suffix='%'
onValueBlur={(value) => updateConfig('non_first_purchase_percentage', value)}
/>
</TableCell>
</TableRow>
*/}
<FormField
control={form.control}