This commit is contained in:
2026-02-08 17:01:33 +08:00
parent 0668eea99b
commit 3211cc32ce
76 changed files with 5054 additions and 2423 deletions

View File

@@ -17,6 +17,39 @@ export function useFormSchema(): VbenFormSchema[] {
label: '描述',
rules: 'required',
},
{
component: 'Switch',
fieldName: 'no_offline',
label: '不支持下架',
defaultValue: false,
help: '勾选后该模块不开放下架功能,提交时白名单价格传 -1',
},
{
component: 'InputNumber',
fieldName: 'whitelist_price',
label: '白名单屏蔽价格(元)',
componentProps: {
min: 0,
precision: 2,
placeholder: '0=免费下架,>0=付费下架;勾选「不支持下架」时此项忽略',
},
dependencies: {
triggerFields: ['no_offline'],
if(values) {
return !values?.no_offline;
},
},
},
{
component: 'InputNumber',
componentProps: {
min: 0,
precision: 2,
},
fieldName: 'cost_price',
label: '成本价(元)',
rules: 'required',
},
];
}
@@ -51,6 +84,28 @@ export function useColumns<T = FeatureApi.FeatureItem>(
title: '描述',
minWidth: 200,
},
{
field: 'whitelist_price',
title: '白名单屏蔽价格(元)',
minWidth: 150,
cellRender: {
name: 'VxeCellRender',
props: {
render: ({ row }: { row: FeatureApi.FeatureItem }) => {
const price = (row as FeatureApi.FeatureItem).whitelist_price ?? 0;
if (price < 0) return '不支持下架';
if (price === 0) return '免费下架';
return `¥${price.toFixed(2)}`;
},
},
},
},
{
field: 'cost_price',
formatter: ({ cellValue }) => `¥${(cellValue || 0).toFixed(2)}`,
title: '成本价(元)',
minWidth: 120,
},
{
field: 'create_time',
title: '创建时间',