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', fieldName: 'productName', label: $t('abp.OneNETManagement.ProductName'), }, ]); export const tableSchema: any = computed((): VxeGridProps['columns'] => [ { title: $t('common.seq'), type: 'seq', width: 50 }, { field: 'oneNETProductId', title: $t('abp.OneNETManagement.OneNETProductId'), minWidth: '150', }, { field: 'productName', title: $t('abp.OneNETManagement.ProductName'), minWidth: '150', }, { field: 'productKey', title: $t('abp.OneNETManagement.ProductKey'), minWidth: '150', }, { field: 'productSecret', title: $t('abp.OneNETManagement.ProductSecret'), minWidth: '150', }, { 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' }, }, ]); export const addProductFormSchema: any = computed(() => [ { component: 'Input', fieldName: 'oneNETProductId', label: $t('abp.OneNETManagement.OneNETProductId'), rules: z.string().min(1, { message: `${$t('common.pleaseInput')}${$t('common.info')}${$t('abp.OneNETManagement.OneNETProductId')}`, }), }, { component: 'Input', 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', 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', 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', 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', }, fieldName: 'enabled', label: $t('common.isEnable'), }, ]); export const editProductFormSchemaEdit: any = computed(() => [ { component: 'Input', fieldName: 'oneNETProductId', label: $t('abp.OneNETManagement.OneNETProductId'), disabled: true, }, { component: 'Input', 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', 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', 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', 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', }, fieldName: 'enabled', label: $t('common.isEnable'), }, ]);