158 lines
4.1 KiB
TypeScript
Raw Normal View History

import type { VxeGridProps } from '#/adapter/vxe-table';
import { computed } from 'vue';
import { z } from '@vben/common-ui';
import { $t } from '#/locales';
export const querySchema = computed(() => [
{
component: 'Input',
2025-07-28 15:24:23 +08:00
fieldName: 'productName',
label: $t('abp.OneNETManagement.ProductName'),
},
]);
2025-07-28 15:24:23 +08:00
export const tableSchema: any = computed((): VxeGridProps['columns'] => [
{ title: $t('common.seq'), type: 'seq', width: 50 },
{
2025-07-28 15:24:23 +08:00
field: 'oneNETProductId',
title: $t('abp.OneNETManagement.OneNETProductId'),
minWidth: '150',
},
{
2025-07-28 15:24:23 +08:00
field: 'productName',
title: $t('abp.OneNETManagement.ProductName'),
minWidth: '150',
},
{
2025-07-28 15:24:23 +08:00
field: 'productKey',
title: $t('abp.OneNETManagement.ProductKey'),
minWidth: '150',
},
{
2025-07-28 15:24:23 +08:00
field: 'productSecret',
title: $t('abp.OneNETManagement.ProductSecret'),
minWidth: '150',
},
{
2025-07-28 15:24:23 +08:00
field: 'accountName',
title: $t('abp.OneNETManagement.AccountName'),
minWidth: '150',
},
{
field: 'enabled',
title: $t('common.isEnable'),
minWidth: '150',
slots: { default: 'isEnable' },
},
{
title: $t('common.action'),
field: 'action',
fixed: 'right',
width: '150',
slots: { default: 'action' },
},
]);
2025-07-28 15:24:23 +08:00
export const addProductFormSchema: any = computed(() => [
{
component: 'Input',
2025-07-28 15:24:23 +08:00
fieldName: 'oneNETProductId',
label: $t('abp.OneNETManagement.OneNETProductId'),
rules: z.string().min(1, {
2025-07-28 15:24:23 +08:00
message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.OneNETManagement.OneNETProductId')}`,
}),
},
{
component: 'Input',
2025-07-28 15:24:23 +08:00
fieldName: 'productName',
label: $t('abp.OneNETManagement.ProductName'),
rules: z.string().min(1, {
message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.OneNETManagement.ProductName')}`,
}),
},
{
component: 'Input',
2025-07-28 15:24:23 +08:00
fieldName: 'productKey',
label: $t('abp.OneNETManagement.ProductKey'),
rules: z.string().min(1, {
message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.OneNETManagement.ProductKey')}`,
}),
},
{
2025-07-28 15:24:23 +08:00
component: 'Input',
fieldName: 'productSecret',
label: $t('abp.OneNETManagement.ProductSecret'),
rules: z.string().min(1, {
message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.OneNETManagement.ProductSecret')}`,
}),
},
{
component: 'Input',
2025-07-28 15:24:23 +08:00
fieldName: 'accountName',
label: $t('abp.OneNETManagement.AccountName'),
rules: z.string().min(1, {
message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.OneNETManagement.AccountName')}`,
}),
},
{
component: 'Switch',
componentProps: {
class: 'w-auto',
},
2025-07-28 15:24:23 +08:00
fieldName: 'enabled',
label: $t('common.isEnable'),
},
2025-07-28 15:24:23 +08:00
]);
export const editProductFormSchemaEdit: any = computed(() => [
{
component: 'Input',
2025-07-28 15:24:23 +08:00
fieldName: 'oneNETProductId',
label: $t('abp.OneNETManagement.OneNETProductId'),
disabled: true,
},
{
component: 'Input',
2025-07-28 15:24:23 +08:00
fieldName: 'productName',
label: $t('abp.OneNETManagement.ProductName'),
rules: z.string().min(1, {
2025-07-28 15:24:23 +08:00
message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.OneNETManagement.ProductName')}`,
}),
},
{
component: 'Input',
2025-07-28 15:24:23 +08:00
fieldName: 'productKey',
label: $t('abp.OneNETManagement.ProductKey'),
rules: z.string().min(1, {
message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.OneNETManagement.ProductKey')}`,
}),
},
{
component: 'Input',
2025-07-28 15:24:23 +08:00
fieldName: 'productSecret',
label: $t('abp.OneNETManagement.ProductSecret'),
rules: z.string().min(1, {
message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.OneNETManagement.ProductSecret')}`,
}),
},
{
component: 'Input',
2025-07-28 15:24:23 +08:00
fieldName: 'accountName',
label: $t('abp.OneNETManagement.AccountName'),
rules: z.string().min(1, {
message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.OneNETManagement.AccountName')}`,
}),
},
{
component: 'Switch',
componentProps: {
class: 'w-auto',
},
2025-07-28 15:24:23 +08:00
fieldName: 'enabled',
label: $t('common.isEnable'),
},
]);