2025-07-08 16:04:14 +08:00
|
|
|
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-08 16:04:14 +08:00
|
|
|
},
|
|
|
|
|
]);
|
2025-07-28 15:24:23 +08:00
|
|
|
|
2025-07-08 16:04:14 +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'),
|
2025-07-08 16:04:14 +08:00
|
|
|
minWidth: '150',
|
|
|
|
|
},
|
|
|
|
|
{
|
2025-07-28 15:24:23 +08:00
|
|
|
field: 'productName',
|
|
|
|
|
title: $t('abp.OneNETManagement.ProductName'),
|
2025-07-08 16:04:14 +08:00
|
|
|
minWidth: '150',
|
|
|
|
|
},
|
|
|
|
|
{
|
2025-07-28 15:24:23 +08:00
|
|
|
field: 'productKey',
|
|
|
|
|
title: $t('abp.OneNETManagement.ProductKey'),
|
2025-07-08 16:04:14 +08:00
|
|
|
minWidth: '150',
|
|
|
|
|
},
|
|
|
|
|
{
|
2025-07-28 15:24:23 +08:00
|
|
|
field: 'productSecret',
|
|
|
|
|
title: $t('abp.OneNETManagement.ProductSecret'),
|
2025-07-08 16:04:14 +08:00
|
|
|
minWidth: '150',
|
|
|
|
|
},
|
|
|
|
|
{
|
2025-07-28 15:24:23 +08:00
|
|
|
field: 'accountName',
|
|
|
|
|
title: $t('abp.OneNETManagement.AccountName'),
|
2025-07-08 16:04:14 +08:00
|
|
|
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(() => [
|
2025-07-08 16:04:14 +08:00
|
|
|
{
|
|
|
|
|
component: 'Input',
|
2025-07-28 15:24:23 +08:00
|
|
|
fieldName: 'oneNETProductId',
|
|
|
|
|
label: $t('abp.OneNETManagement.OneNETProductId'),
|
2025-07-08 16:04:14 +08:00
|
|
|
rules: z.string().min(1, {
|
2025-07-28 15:24:23 +08:00
|
|
|
message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.OneNETManagement.OneNETProductId')}`,
|
2025-07-08 16:04:14 +08:00
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
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')}`,
|
|
|
|
|
}),
|
2025-07-08 16:04:14 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
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-08 16:04:14 +08:00
|
|
|
},
|
|
|
|
|
{
|
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')}`,
|
|
|
|
|
}),
|
2025-07-08 16:04:14 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
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')}`,
|
|
|
|
|
}),
|
2025-07-08 16:04:14 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
component: 'Switch',
|
|
|
|
|
componentProps: {
|
|
|
|
|
class: 'w-auto',
|
|
|
|
|
},
|
2025-07-28 15:24:23 +08:00
|
|
|
fieldName: 'enabled',
|
|
|
|
|
label: $t('common.isEnable'),
|
2025-07-08 16:04:14 +08:00
|
|
|
},
|
2025-07-28 15:24:23 +08:00
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
export const editProductFormSchemaEdit: any = computed(() => [
|
2025-07-08 16:04:14 +08:00
|
|
|
{
|
|
|
|
|
component: 'Input',
|
2025-07-28 15:24:23 +08:00
|
|
|
fieldName: 'oneNETProductId',
|
|
|
|
|
label: $t('abp.OneNETManagement.OneNETProductId'),
|
|
|
|
|
disabled: true,
|
2025-07-08 16:04:14 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
component: 'Input',
|
2025-07-28 15:24:23 +08:00
|
|
|
fieldName: 'productName',
|
|
|
|
|
label: $t('abp.OneNETManagement.ProductName'),
|
2025-07-08 16:04:14 +08:00
|
|
|
rules: z.string().min(1, {
|
2025-07-28 15:24:23 +08:00
|
|
|
message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.OneNETManagement.ProductName')}`,
|
2025-07-08 16:04:14 +08:00
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
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-08 16:04:14 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
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')}`,
|
|
|
|
|
}),
|
2025-07-08 16:04:14 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
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')}`,
|
|
|
|
|
}),
|
2025-07-08 16:04:14 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
component: 'Switch',
|
|
|
|
|
componentProps: {
|
|
|
|
|
class: 'w-auto',
|
|
|
|
|
},
|
2025-07-28 15:24:23 +08:00
|
|
|
fieldName: 'enabled',
|
|
|
|
|
label: $t('common.isEnable'),
|
2025-07-08 16:04:14 +08:00
|
|
|
},
|
|
|
|
|
]);
|