This commit is contained in:
xingyu4j
2025-10-16 16:38:50 +08:00
48 changed files with 210 additions and 203 deletions

View File

@@ -1,17 +1,19 @@
import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '@vben/plugins/vxe-table';
import type { VxeGridPropTypes } from '#/adapter/vxe-table';
import { DICT_TYPE } from '@vben/constants'; import type { VbenFormSchema } from '#/adapter/form';
import { CommonStatusEnum, DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks'; import { getDictOptions } from '@vben/hooks';
import { z } from '#/adapter/form';
import { getRangePickerDefaultProps } from '#/utils'; import { getRangePickerDefaultProps } from '#/utils';
/** 新增/修改的表单 */ /** 新增/修改的表单 */
export function useFormSchema(): VbenFormSchema[] { export function useFormSchema(): VbenFormSchema[] {
return [ return [
{ {
component: 'Input',
fieldName: 'id', fieldName: 'id',
component: 'Input',
dependencies: { dependencies: {
triggerFields: [''], triggerFields: [''],
show: () => false, show: () => false,
@@ -19,14 +21,20 @@ export function useFormSchema(): VbenFormSchema[] {
}, },
{ {
fieldName: 'title', fieldName: 'title',
label: 'Banner标题', label: 'Banner 标题',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入 Banner 标题',
},
rules: 'required', rules: 'required',
}, },
{ {
fieldName: 'picUrl', fieldName: 'picUrl',
label: '图片地址', label: '图片地址',
component: 'ImageUpload', component: 'ImageUpload',
componentProps: {
placeholder: '请上传图片',
},
rules: 'required', rules: 'required',
}, },
{ {
@@ -44,6 +52,9 @@ export function useFormSchema(): VbenFormSchema[] {
fieldName: 'url', fieldName: 'url',
label: '跳转地址', label: '跳转地址',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入跳转地址',
},
rules: 'required', rules: 'required',
}, },
{ {
@@ -65,7 +76,7 @@ export function useFormSchema(): VbenFormSchema[] {
buttonStyle: 'solid', buttonStyle: 'solid',
optionType: 'button', optionType: 'button',
}, },
rules: 'required', rules: z.number().default(CommonStatusEnum.ENABLE),
}, },
{ {
fieldName: 'memo', fieldName: 'memo',
@@ -84,18 +95,18 @@ export function useGridFormSchema(): VbenFormSchema[] {
return [ return [
{ {
fieldName: 'title', fieldName: 'title',
label: 'Banner标题', label: 'Banner 标题',
component: 'Input', component: 'Input',
componentProps: { componentProps: {
placeholder: '请输入Banner标题', placeholder: '请输入 Banner 标题',
}, },
}, },
{ {
fieldName: 'status', fieldName: 'status',
label: '状态', label: '活动状态',
component: 'Select', component: 'Select',
componentProps: { componentProps: {
placeholder: '请选择状态', placeholder: '请选择活动状态',
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
}, },
}, },
@@ -112,16 +123,17 @@ export function useGridFormSchema(): VbenFormSchema[] {
} }
/** 表格列配置 */ /** 表格列配置 */
export function useGridColumns(): VxeGridPropTypes.Columns { export function useGridColumns(): VxeTableGridOptions['columns'] {
return [ return [
{ {
title: 'Banner标题', title: 'Banner标题',
field: 'title', field: 'title',
minWidth: 100,
}, },
{ {
title: '图片', title: '图片',
field: 'picUrl', field: 'picUrl',
width: 80, minWidth: 80,
cellRender: { cellRender: {
name: 'CellImage', name: 'CellImage',
}, },
@@ -129,7 +141,7 @@ export function useGridColumns(): VxeGridPropTypes.Columns {
{ {
title: '状态', title: '状态',
field: 'status', field: 'status',
width: 150, minWidth: 150,
cellRender: { cellRender: {
name: 'CellDictTag', name: 'CellDictTag',
props: { props: {
@@ -140,7 +152,7 @@ export function useGridColumns(): VxeGridPropTypes.Columns {
{ {
title: '定位', title: '定位',
field: 'position', field: 'position',
width: 150, minWidth: 150,
cellRender: { cellRender: {
name: 'CellDictTag', name: 'CellDictTag',
props: { props: {
@@ -151,21 +163,23 @@ export function useGridColumns(): VxeGridPropTypes.Columns {
{ {
title: '跳转地址', title: '跳转地址',
field: 'url', field: 'url',
minWidth: 200,
}, },
{ {
title: '创建时间', title: '创建时间',
field: 'createTime', field: 'createTime',
width: 180, minWidth: 180,
formatter: 'formatDateTime', formatter: 'formatDateTime',
}, },
{ {
title: '排序', title: '排序',
field: 'sort', field: 'sort',
width: 100, minWidth: 100,
}, },
{ {
title: '描述', title: '描述',
field: 'memo', field: 'memo',
minWidth: 150,
}, },
{ {
title: '操作', title: '操作',

View File

@@ -2,7 +2,7 @@
import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { MallBannerApi } from '#/api/mall/market/banner'; import type { MallBannerApi } from '#/api/mall/market/banner';
import { Page, useVbenModal } from '@vben/common-ui'; import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
@@ -23,17 +23,17 @@ function handleRefresh() {
gridApi.query(); gridApi.query();
} }
/** 创建Banner */ /** 创建 Banner */
function handleCreate() { function handleCreate() {
formModalApi.setData(null).open(); formModalApi.setData(null).open();
} }
/** 编辑Banner */ /** 编辑 Banner */
function handleEdit(row: MallBannerApi.Banner) { function handleEdit(row: MallBannerApi.Banner) {
formModalApi.setData(row).open(); formModalApi.setData(row).open();
} }
/** 删除Banner */ /** 删除 Banner */
async function handleDelete(row: MallBannerApi.Banner) { async function handleDelete(row: MallBannerApi.Banner) {
const hideLoading = message.loading({ const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting', [row.title]), content: $t('ui.actionMessage.deleting', [row.title]),
@@ -41,9 +41,7 @@ async function handleDelete(row: MallBannerApi.Banner) {
}); });
try { try {
await deleteBanner(row.id as number); await deleteBanner(row.id as number);
message.success({ message.success($t('ui.actionMessage.deleteSuccess', [row.title]));
content: $t('ui.actionMessage.deleteSuccess', [row.title]),
});
handleRefresh(); handleRefresh();
} finally { } finally {
hideLoading(); hideLoading();
@@ -71,6 +69,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
}, },
rowConfig: { rowConfig: {
keyField: 'id', keyField: 'id',
isHover: true,
}, },
toolbarConfig: { toolbarConfig: {
refresh: true, refresh: true,
@@ -82,6 +81,13 @@ const [Grid, gridApi] = useVbenVxeGrid({
<template> <template>
<Page auto-content-height> <Page auto-content-height>
<template #doc>
<DocAlert
title="【营销】内容管理"
url="https://doc.iocoder.cn/mall/promotion-content/"
/>
</template>
<FormModal @success="handleRefresh" /> <FormModal @success="handleRefresh" />
<Grid table-title="Banner列表"> <Grid table-title="Banner列表">
<template #toolbar-tools> <template #toolbar-tools>

View File

@@ -18,8 +18,7 @@ import { $t } from '#/locales';
import { useFormSchema } from '../data'; import { useFormSchema } from '../data';
const emit = defineEmits(['success']); const emit = defineEmits(['success']);
const formData = ref<SystemUserApi.User>();
const formData = ref<MallBannerApi.Banner>();
const getTitle = computed(() => { const getTitle = computed(() => {
return formData.value?.id return formData.value?.id
? $t('ui.actionTitle.edit', ['Banner']) ? $t('ui.actionTitle.edit', ['Banner'])
@@ -81,7 +80,7 @@ const [Modal, modalApi] = useVbenModal({
</script> </script>
<template> <template>
<Modal class="w-2/5" :title="getTitle"> <Modal :title="getTitle" class="w-2/5">
<Form class="mx-4" /> <Form class="mx-4" />
</Modal> </Modal>
</template> </template>

View File

@@ -60,8 +60,6 @@ const [Form, formApi] = useVbenForm({
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number'), options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number(), rules: z.number(),
}, },

View File

@@ -59,8 +59,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'), options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'),
buttonStyle: 'solid',
optionType: 'button',
}, },
defaultValue: true, defaultValue: true,
rules: 'required', rules: 'required',

View File

@@ -34,8 +34,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number'), options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
}, },
{ {

View File

@@ -34,8 +34,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number'), options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
}, },
{ {

View File

@@ -34,8 +34,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number'), options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
}, },
{ {

View File

@@ -34,8 +34,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number'), options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
}, },
{ {

View File

@@ -131,8 +131,6 @@ export function useFormSchema(): VbenFormSchema[] {
{ label: '主动模式', value: 'Active' }, { label: '主动模式', value: 'Active' },
{ label: '被动模式', value: 'Passive' }, { label: '被动模式', value: 'Passive' },
], ],
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: 'required', rules: 'required',
dependencies: { dependencies: {
@@ -202,8 +200,6 @@ export function useFormSchema(): VbenFormSchema[] {
{ label: '启用', value: true }, { label: '启用', value: true },
{ label: '禁用', value: false }, { label: '禁用', value: false },
], ],
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: 'required', rules: 'required',
dependencies: { dependencies: {
@@ -221,8 +217,6 @@ export function useFormSchema(): VbenFormSchema[] {
{ label: '公开', value: true }, { label: '公开', value: true },
{ label: '私有', value: false }, { label: '私有', value: false },
], ],
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: 'required', rules: 'required',
dependencies: { dependencies: {

View File

@@ -54,8 +54,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },

View File

@@ -78,8 +78,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },

View File

@@ -1,9 +1,10 @@
import type { VbenFormSchema } from '#/adapter/form'; import type { VbenFormSchema } from '#/adapter/form';
import type { VxeGridPropTypes } from '#/adapter/vxe-table'; import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import { DICT_TYPE } from '@vben/constants'; import { CommonStatusEnum, DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks'; import { getDictOptions } from '@vben/hooks';
import { z } from '#/adapter/form';
import { getRangePickerDefaultProps } from '#/utils'; import { getRangePickerDefaultProps } from '#/utils';
/** 新增/修改的表单 */ /** 新增/修改的表单 */
@@ -21,21 +22,28 @@ export function useFormSchema(): VbenFormSchema[] {
fieldName: 'name', fieldName: 'name',
label: '分类名称', label: '分类名称',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入分类名称',
},
rules: 'required', rules: 'required',
}, },
{ {
fieldName: 'picUrl', fieldName: 'picUrl',
label: '图标地址', label: '分类图片',
component: 'ImageUpload', component: 'ImageUpload',
componentProps: {
placeholder: '请上传分类图片',
},
}, },
{ {
fieldName: 'sort', fieldName: 'sort',
label: '序', label: '显示顺序',
component: 'InputNumber', component: 'InputNumber',
componentProps: { componentProps: {
min: 0, min: 0,
placeholder: '请输入显示顺序',
controlsPosition: 'right', controlsPosition: 'right',
placeholder: '请输入排序', class: '!w-full',
}, },
rules: 'required', rules: 'required',
}, },
@@ -45,10 +53,8 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: 'required', rules: z.number().default(CommonStatusEnum.ENABLE),
}, },
]; ];
} }
@@ -62,6 +68,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
component: 'Input', component: 'Input',
componentProps: { componentProps: {
placeholder: '请输入分类名称', placeholder: '请输入分类名称',
allowClear: true,
}, },
}, },
{ {
@@ -70,6 +77,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
component: 'Select', component: 'Select',
componentProps: { componentProps: {
placeholder: '请选择状态', placeholder: '请选择状态',
allowClear: true,
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
}, },
}, },
@@ -79,58 +87,58 @@ export function useGridFormSchema(): VbenFormSchema[] {
component: 'RangePicker', component: 'RangePicker',
componentProps: { componentProps: {
...getRangePickerDefaultProps(), ...getRangePickerDefaultProps(),
clearable: true, allowClear: true,
}, },
}, },
]; ];
} }
/** 表格列配置 */ /** 表格列配置 */
export function useGridColumns(): VxeGridPropTypes.Columns { export function useGridColumns(): VxeTableGridOptions['columns'] {
return [ return [
{ {
title: '编号',
field: 'id', field: 'id',
width: 100, title: '编号',
minWidth: 100,
}, },
{ {
title: '分类名称',
field: 'name', field: 'name',
title: '分类名称',
minWidth: 240, minWidth: 240,
align: 'left',
fixed: 'left',
}, },
{ {
title: '分类图片',
field: 'picUrl', field: 'picUrl',
width: 80, title: '分类图片',
minWidth: 80,
cellRender: { cellRender: {
name: 'CellImage', name: 'CellImage',
}, },
}, },
{ {
title: '状态',
field: 'status', field: 'status',
width: 150, title: '状态',
minWidth: 150,
cellRender: { cellRender: {
name: 'CellDictTag', name: 'CellDict',
props: { props: { type: DICT_TYPE.COMMON_STATUS },
dictType: DICT_TYPE.COMMON_STATUS,
},
}, },
}, },
{ {
title: '排序',
field: 'sort', field: 'sort',
width: 150, title: '显示顺序',
minWidth: 150,
}, },
{ {
title: '创建时间',
field: 'createTime', field: 'createTime',
width: 180, title: '创建时间',
minWidth: 180,
formatter: 'formatDateTime', formatter: 'formatDateTime',
}, },
{ {
title: '操作', title: '操作',
width: 180, minWidth: 220,
fixed: 'right', fixed: 'right',
slots: { default: 'actions' }, slots: { default: 'actions' },
}, },

View File

@@ -2,7 +2,7 @@
import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { MallArticleCategoryApi } from '#/api/mall/promotion/articleCategory'; import type { MallArticleCategoryApi } from '#/api/mall/promotion/articleCategory';
import { Page, useVbenModal } from '@vben/common-ui'; import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
import { ElLoading, ElMessage } from 'element-plus'; import { ElLoading, ElMessage } from 'element-plus';
@@ -42,7 +42,7 @@ async function handleDelete(row: MallArticleCategoryApi.ArticleCategory) {
text: $t('ui.actionMessage.deleting', [row.name]), text: $t('ui.actionMessage.deleting', [row.name]),
}); });
try { try {
await deleteArticleCategory(row.id as number); await deleteArticleCategory(row.id!);
ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name]));
handleRefresh(); handleRefresh();
} finally { } finally {
@@ -71,6 +71,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
}, },
rowConfig: { rowConfig: {
keyField: 'id', keyField: 'id',
isHover: true,
}, },
toolbarConfig: { toolbarConfig: {
refresh: true, refresh: true,
@@ -82,6 +83,13 @@ const [Grid, gridApi] = useVbenVxeGrid({
<template> <template>
<Page auto-content-height> <Page auto-content-height>
<template #doc>
<DocAlert
title="【营销】内容管理"
url="https://doc.iocoder.cn/mall/promotion-content/"
/>
</template>
<FormModal @success="handleRefresh" /> <FormModal @success="handleRefresh" />
<Grid table-title="文章分类列表"> <Grid table-title="文章分类列表">
<template #toolbar-tools> <template #toolbar-tools>

View File

@@ -32,7 +32,7 @@ const [Form, formApi] = useVbenForm({
class: 'w-full', class: 'w-full',
}, },
formItemClass: 'col-span-2', formItemClass: 'col-span-2',
labelWidth: 120, labelWidth: 80,
}, },
layout: 'horizontal', layout: 'horizontal',
schema: useFormSchema(), schema: useFormSchema(),
@@ -84,7 +84,7 @@ const [Modal, modalApi] = useVbenModal({
</script> </script>
<template> <template>
<Modal class="w-2/5" :title="getTitle"> <Modal :title="getTitle" class="w-2/5">
<Form class="mx-4" /> <Form class="mx-4" />
</Modal> </Modal>
</template> </template>

View File

@@ -1,5 +1,6 @@
import type { VbenFormSchema } from '#/adapter/form'; import type { VbenFormSchema } from '#/adapter/form';
import type { VxeGridPropTypes } from '#/adapter/vxe-table'; import type { VxeGridPropTypes } from '#/adapter/vxe-table';
import type { MallArticleCategoryApi } from '#/api/mall/promotion/articleCategory';
import { CommonStatusEnum, DICT_TYPE } from '@vben/constants'; import { CommonStatusEnum, DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks'; import { getDictOptions } from '@vben/hooks';
@@ -8,12 +9,19 @@ import { z } from '#/adapter/form';
import { getSimpleArticleCategoryList } from '#/api/mall/promotion/articleCategory'; import { getSimpleArticleCategoryList } from '#/api/mall/promotion/articleCategory';
import { getRangePickerDefaultProps } from '#/utils'; import { getRangePickerDefaultProps } from '#/utils';
let categoryList: MallArticleCategoryApi.ArticleCategory[] = [];
async function getCategoryData() {
categoryList = await getSimpleArticleCategoryList();
}
getCategoryData();
/** 新增/修改的表单 */ /** 新增/修改的表单 */
export function useFormSchema(): VbenFormSchema[] { export function useFormSchema(): VbenFormSchema[] {
return [ return [
{ {
component: 'Input',
fieldName: 'id', fieldName: 'id',
component: 'Input',
dependencies: { dependencies: {
triggerFields: [''], triggerFields: [''],
show: () => false, show: () => false,
@@ -23,6 +31,9 @@ export function useFormSchema(): VbenFormSchema[] {
fieldName: 'title', fieldName: 'title',
label: '文章标题', label: '文章标题',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入文章标题',
},
rules: 'required', rules: 'required',
}, },
{ {
@@ -33,6 +44,7 @@ export function useFormSchema(): VbenFormSchema[] {
api: getSimpleArticleCategoryList, api: getSimpleArticleCategoryList,
labelField: 'name', labelField: 'name',
valueField: 'id', valueField: 'id',
placeholder: '请选择文章分类',
}, },
rules: 'required', rules: 'required',
}, },
@@ -40,16 +52,26 @@ export function useFormSchema(): VbenFormSchema[] {
fieldName: 'author', fieldName: 'author',
label: '文章作者', label: '文章作者',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入文章作者',
},
}, },
{ {
fieldName: 'introduction', fieldName: 'introduction',
label: '文章简介', label: '文章简介',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入文章简介',
},
}, },
{ {
fieldName: 'picUrl', fieldName: 'picUrl',
label: '文章封面', label: '文章封面',
component: 'ImageUpload', component: 'ImageUpload',
formItemClass: 'col-span-2',
componentProps: {
placeholder: '请上传文章封面',
},
rules: 'required', rules: 'required',
}, },
{ {
@@ -58,9 +80,9 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'), options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: 'required',
defaultValue: true,
}, },
{ {
fieldName: 'recommendBanner', fieldName: 'recommendBanner',
@@ -68,15 +90,19 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'), options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: 'required',
defaultValue: true,
}, },
// TODO: @霖:商品关联
{ {
// TODO: @puhui999商品关联
fieldName: 'spuId', fieldName: 'spuId',
label: '商品关联', label: '商品关联',
component: 'Input', component: 'Input',
formItemClass: 'col-span-2',
componentProps: {
placeholder: '请输入商品 SPU 编号',
},
}, },
{ {
fieldName: 'sort', fieldName: 'sort',
@@ -84,10 +110,11 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'InputNumber', component: 'InputNumber',
componentProps: { componentProps: {
min: 0, min: 0,
placeholder: '请输入排序',
controlsPosition: 'right', controlsPosition: 'right',
placeholder: '请输入品牌排序', class: '!w-full',
}, },
rules: z.number().min(0).default(1), rules: 'required',
}, },
{ {
fieldName: 'status', fieldName: 'status',
@@ -95,15 +122,15 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },
{ {
fieldName: 'description', fieldName: 'content',
label: '文章内容', label: '文章内容',
component: 'RichTextarea', component: 'RichTextarea',
rules: 'required',
formItemClass: 'col-span-2',
}, },
]; ];
} }
@@ -112,19 +139,25 @@ export function useFormSchema(): VbenFormSchema[] {
export function useGridFormSchema(): VbenFormSchema[] { export function useGridFormSchema(): VbenFormSchema[] {
return [ return [
{ {
fieldName: 'name', fieldName: 'categoryId',
label: '文章分类', label: '文章分类',
component: 'ApiSelect', component: 'ApiSelect',
componentProps: { componentProps: {
api: getSimpleArticleCategoryList, api: getSimpleArticleCategoryList,
labelField: 'name', labelField: 'name',
valueField: 'id', valueField: 'id',
placeholder: '请选择文章分类',
allowClear: true,
}, },
}, },
{ {
fieldName: 'title', fieldName: 'title',
label: '文章标题', label: '文章标题',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入文章标题',
allowClear: true,
},
}, },
{ {
fieldName: 'status', fieldName: 'status',
@@ -132,6 +165,8 @@ export function useGridFormSchema(): VbenFormSchema[] {
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
placeholder: '请选择状态',
allowClear: true,
}, },
}, },
{ {
@@ -140,27 +175,29 @@ export function useGridFormSchema(): VbenFormSchema[] {
component: 'RangePicker', component: 'RangePicker',
componentProps: { componentProps: {
...getRangePickerDefaultProps(), ...getRangePickerDefaultProps(),
clearable: true, allowClear: true,
}, },
}, },
]; ];
} }
/** 表格列配置 */ /** 列表的字段 */
export function useGridColumns(): VxeGridPropTypes.Columns { export function useGridColumns(): VxeGridPropTypes.Columns {
return [ return [
{ {
field: 'id', field: 'id',
title: '编号', title: '编号',
fixed: 'left', minWidth: 100,
}, },
{ {
field: 'title', field: 'title',
title: '标题', title: '标题',
minWidth: 200,
}, },
{ {
field: 'picUrl', field: 'picUrl',
title: '封面', title: '封面',
minWidth: 120,
cellRender: { cellRender: {
name: 'CellImage', name: 'CellImage',
}, },
@@ -168,26 +205,34 @@ export function useGridColumns(): VxeGridPropTypes.Columns {
{ {
field: 'categoryId', field: 'categoryId',
title: '分类', title: '分类',
minWidth: 100,
formatter: ({ cellValue }) =>
categoryList.find((item) => item.id === cellValue)?.name || '-',
}, },
{ {
field: 'browseCount', field: 'browseCount',
title: '浏览量', title: '浏览量',
minWidth: 100,
}, },
{ {
field: 'author', field: 'author',
title: '作者', title: '作者',
minWidth: 120,
}, },
{ {
field: 'introduction', field: 'introduction',
title: '文章简介', title: '文章简介',
minWidth: 250,
}, },
{ {
field: 'sort', field: 'sort',
title: '排序', title: '排序',
minWidth: 80,
}, },
{ {
field: 'status', field: 'status',
title: '状态', title: '状态',
minWidth: 100,
cellRender: { cellRender: {
name: 'CellDict', name: 'CellDict',
props: { type: DICT_TYPE.COMMON_STATUS }, props: { type: DICT_TYPE.COMMON_STATUS },
@@ -196,6 +241,7 @@ export function useGridColumns(): VxeGridPropTypes.Columns {
{ {
field: 'createTime', field: 'createTime',
title: '创建时间', title: '创建时间',
minWidth: 180,
formatter: 'formatDateTime', formatter: 'formatDateTime',
}, },
{ {

View File

@@ -2,7 +2,7 @@
import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { MallArticleApi } from '#/api/mall/promotion/article'; import type { MallArticleApi } from '#/api/mall/promotion/article';
import { Page, useVbenModal } from '@vben/common-ui'; import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
import { ElLoading, ElMessage } from 'element-plus'; import { ElLoading, ElMessage } from 'element-plus';
@@ -23,17 +23,17 @@ function handleRefresh() {
gridApi.query(); gridApi.query();
} }
/** 创建品牌 */ /** 创建文章 */
function handleCreate() { function handleCreate() {
formModalApi.setData(null).open(); formModalApi.setData(null).open();
} }
/** 编辑品牌 */ /** 编辑文章 */
function handleEdit(row: MallArticleApi.Article) { function handleEdit(row: MallArticleApi.Article) {
formModalApi.setData(row).open(); formModalApi.setData(row).open();
} }
/** 删除品牌 */ /** 删除文章 */
async function handleDelete(row: MallArticleApi.Article) { async function handleDelete(row: MallArticleApi.Article) {
const loadingInstance = ElLoading.service({ const loadingInstance = ElLoading.service({
text: $t('ui.actionMessage.deleting', [row.title]), text: $t('ui.actionMessage.deleting', [row.title]),
@@ -68,6 +68,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
}, },
rowConfig: { rowConfig: {
keyField: 'id', keyField: 'id',
isHover: true,
}, },
toolbarConfig: { toolbarConfig: {
refresh: true, refresh: true,
@@ -79,6 +80,13 @@ const [Grid, gridApi] = useVbenVxeGrid({
<template> <template>
<Page auto-content-height> <Page auto-content-height>
<template #doc>
<DocAlert
title="【营销】内容管理"
url="https://doc.iocoder.cn/mall/promotion-content/"
/>
</template>
<FormModal @success="handleRefresh" /> <FormModal @success="handleRefresh" />
<Grid table-title="文章列表"> <Grid table-title="文章列表">
<template #toolbar-tools> <template #toolbar-tools>

View File

@@ -31,9 +31,9 @@ const [Form, formApi] = useVbenForm({
componentProps: { componentProps: {
class: 'w-full', class: 'w-full',
}, },
formItemClass: 'col-span-2',
labelWidth: 120, labelWidth: 120,
}, },
wrapperClass: 'grid-cols-2',
layout: 'horizontal', layout: 'horizontal',
schema: useFormSchema(), schema: useFormSchema(),
showDefaultActions: false, showDefaultActions: false,
@@ -81,7 +81,7 @@ const [Modal, modalApi] = useVbenModal({
</script> </script>
<template> <template>
<Modal class="w-2/5" :title="getTitle"> <Modal :title="getTitle" class="w-2/5">
<Form class="mx-4" /> <Form class="mx-4" />
</Modal> </Modal>
</template> </template>

View File

@@ -1,17 +1,19 @@
import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '@vben/plugins/vxe-table';
import type { VxeGridPropTypes } from '#/adapter/vxe-table';
import { DICT_TYPE } from '@vben/constants'; import type { VbenFormSchema } from '#/adapter/form';
import { CommonStatusEnum, DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks'; import { getDictOptions } from '@vben/hooks';
import { z } from '#/adapter/form';
import { getRangePickerDefaultProps } from '#/utils'; import { getRangePickerDefaultProps } from '#/utils';
/** 新增/修改的表单 */ /** 新增/修改的表单 */
export function useFormSchema(): VbenFormSchema[] { export function useFormSchema(): VbenFormSchema[] {
return [ return [
{ {
component: 'Input',
fieldName: 'id', fieldName: 'id',
component: 'Input',
dependencies: { dependencies: {
triggerFields: [''], triggerFields: [''],
show: () => false, show: () => false,
@@ -19,14 +21,20 @@ export function useFormSchema(): VbenFormSchema[] {
}, },
{ {
fieldName: 'title', fieldName: 'title',
label: 'Banner标题', label: 'Banner 标题',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入 Banner 标题',
},
rules: 'required', rules: 'required',
}, },
{ {
fieldName: 'picUrl', fieldName: 'picUrl',
label: '图片地址', label: '图片地址',
component: 'ImageUpload', component: 'ImageUpload',
componentProps: {
placeholder: '请上传图片',
},
rules: 'required', rules: 'required',
}, },
{ {
@@ -35,8 +43,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.PROMOTION_BANNER_POSITION, 'number'), options: getDictOptions(DICT_TYPE.PROMOTION_BANNER_POSITION, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: 'required', rules: 'required',
}, },
@@ -44,6 +50,9 @@ export function useFormSchema(): VbenFormSchema[] {
fieldName: 'url', fieldName: 'url',
label: '跳转地址', label: '跳转地址',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入跳转地址',
},
rules: 'required', rules: 'required',
}, },
{ {
@@ -52,7 +61,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'InputNumber', component: 'InputNumber',
componentProps: { componentProps: {
min: 0, min: 0,
controlsPosition: 'right',
placeholder: '请输入排序', placeholder: '请输入排序',
}, },
rules: 'required', rules: 'required',
@@ -63,10 +71,8 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: 'required', rules: z.number().default(CommonStatusEnum.ENABLE),
}, },
{ {
fieldName: 'memo', fieldName: 'memo',
@@ -85,18 +91,18 @@ export function useGridFormSchema(): VbenFormSchema[] {
return [ return [
{ {
fieldName: 'title', fieldName: 'title',
label: 'Banner标题', label: 'Banner 标题',
component: 'Input', component: 'Input',
componentProps: { componentProps: {
placeholder: '请输入Banner标题', placeholder: '请输入 Banner 标题',
}, },
}, },
{ {
fieldName: 'status', fieldName: 'status',
label: '状态', label: '活动状态',
component: 'Select', component: 'Select',
componentProps: { componentProps: {
placeholder: '请选择状态', placeholder: '请选择活动状态',
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
}, },
}, },
@@ -113,16 +119,17 @@ export function useGridFormSchema(): VbenFormSchema[] {
} }
/** 表格列配置 */ /** 表格列配置 */
export function useGridColumns(): VxeGridPropTypes.Columns { export function useGridColumns(): VxeTableGridOptions['columns'] {
return [ return [
{ {
title: 'Banner标题', title: 'Banner标题',
field: 'title', field: 'title',
minWidth: 100,
}, },
{ {
title: '图片', title: '图片',
field: 'picUrl', field: 'picUrl',
width: 80, minWidth: 80,
cellRender: { cellRender: {
name: 'CellImage', name: 'CellImage',
}, },
@@ -130,7 +137,7 @@ export function useGridColumns(): VxeGridPropTypes.Columns {
{ {
title: '状态', title: '状态',
field: 'status', field: 'status',
width: 150, minWidth: 150,
cellRender: { cellRender: {
name: 'CellDictTag', name: 'CellDictTag',
props: { props: {
@@ -141,7 +148,7 @@ export function useGridColumns(): VxeGridPropTypes.Columns {
{ {
title: '定位', title: '定位',
field: 'position', field: 'position',
width: 150, minWidth: 150,
cellRender: { cellRender: {
name: 'CellDictTag', name: 'CellDictTag',
props: { props: {
@@ -152,21 +159,23 @@ export function useGridColumns(): VxeGridPropTypes.Columns {
{ {
title: '跳转地址', title: '跳转地址',
field: 'url', field: 'url',
minWidth: 200,
}, },
{ {
title: '创建时间', title: '创建时间',
field: 'createTime', field: 'createTime',
width: 180, minWidth: 180,
formatter: 'formatDateTime', formatter: 'formatDateTime',
}, },
{ {
title: '排序', title: '排序',
field: 'sort', field: 'sort',
width: 100, minWidth: 100,
}, },
{ {
title: '描述', title: '描述',
field: 'memo', field: 'memo',
minWidth: 150,
}, },
{ {
title: '操作', title: '操作',

View File

@@ -2,7 +2,7 @@
import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { MallBannerApi } from '#/api/mall/market/banner'; import type { MallBannerApi } from '#/api/mall/market/banner';
import { Page, useVbenModal } from '@vben/common-ui'; import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
import { ElLoading, ElMessage } from 'element-plus'; import { ElLoading, ElMessage } from 'element-plus';
@@ -23,17 +23,17 @@ function handleRefresh() {
gridApi.query(); gridApi.query();
} }
/** 创建Banner */ /** 创建 Banner */
function handleCreate() { function handleCreate() {
formModalApi.setData(null).open(); formModalApi.setData(null).open();
} }
/** 编辑Banner */ /** 编辑 Banner */
function handleEdit(row: MallBannerApi.Banner) { function handleEdit(row: MallBannerApi.Banner) {
formModalApi.setData(row).open(); formModalApi.setData(row).open();
} }
/** 删除Banner */ /** 删除 Banner */
async function handleDelete(row: MallBannerApi.Banner) { async function handleDelete(row: MallBannerApi.Banner) {
const loadingInstance = ElLoading.service({ const loadingInstance = ElLoading.service({
text: $t('ui.actionMessage.deleting', [row.title]), text: $t('ui.actionMessage.deleting', [row.title]),
@@ -68,6 +68,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
}, },
rowConfig: { rowConfig: {
keyField: 'id', keyField: 'id',
isHover: true,
}, },
toolbarConfig: { toolbarConfig: {
refresh: true, refresh: true,
@@ -79,6 +80,13 @@ const [Grid, gridApi] = useVbenVxeGrid({
<template> <template>
<Page auto-content-height> <Page auto-content-height>
<template #doc>
<DocAlert
title="【营销】内容管理"
url="https://doc.iocoder.cn/mall/promotion-content/"
/>
</template>
<FormModal @success="handleRefresh" /> <FormModal @success="handleRefresh" />
<Grid table-title="Banner列表"> <Grid table-title="Banner列表">
<template #toolbar-tools> <template #toolbar-tools>

View File

@@ -18,8 +18,7 @@ import { $t } from '#/locales';
import { useFormSchema } from '../data'; import { useFormSchema } from '../data';
const emit = defineEmits(['success']); const emit = defineEmits(['success']);
const formData = ref<SystemUserApi.User>();
const formData = ref<MallBannerApi.Banner>();
const getTitle = computed(() => { const getTitle = computed(() => {
return formData.value?.id return formData.value?.id
? $t('ui.actionTitle.edit', ['Banner']) ? $t('ui.actionTitle.edit', ['Banner'])
@@ -81,7 +80,7 @@ const [Modal, modalApi] = useVbenModal({
</script> </script>
<template> <template>
<Modal class="w-2/5" :title="getTitle"> <Modal :title="getTitle" class="w-2/5">
<Form class="mx-4" /> <Form class="mx-4" />
</Modal> </Modal>
</template> </template>

View File

@@ -101,8 +101,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },

View File

@@ -59,8 +59,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: 'required', rules: 'required',
}, },

View File

@@ -60,8 +60,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },

View File

@@ -130,8 +130,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.EXPRESS_CHARGE_MODE, 'number'), options: getDictOptions(DICT_TYPE.EXPRESS_CHARGE_MODE, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(1), rules: z.number().default(1),
}, },

View File

@@ -97,8 +97,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },

View File

@@ -420,8 +420,6 @@ export function useDeliveryFormSchema(): VbenFormSchema[] {
{ label: '快递', value: 'express' }, { label: '快递', value: 'express' },
{ label: '无需发货', value: 'none' }, { label: '无需发货', value: 'none' },
], ],
buttonStyle: 'solid',
optionType: 'button',
}, },
defaultValue: 'express', defaultValue: 'express',
}, },

View File

@@ -29,8 +29,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },

View File

@@ -83,8 +83,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },

View File

@@ -64,8 +64,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },

View File

@@ -39,8 +39,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE).optional(), rules: z.number().default(CommonStatusEnum.ENABLE).optional(),
}, },
@@ -71,8 +69,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number'), options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
}, },
{ {
@@ -384,8 +380,6 @@ export function useBalanceFormSchema(): VbenFormSchema[] {
{ label: '增加', value: 1 }, { label: '增加', value: 1 },
{ label: '减少', value: -1 }, { label: '减少', value: -1 },
], ],
buttonStyle: 'solid',
optionType: 'button',
}, },
defaultValue: 1, defaultValue: 1,
}, },
@@ -461,8 +455,6 @@ export function usePointFormSchema(): VbenFormSchema[] {
{ label: '增加', value: 1 }, { label: '增加', value: 1 },
{ label: '减少', value: -1 }, { label: '减少', value: -1 },
], ],
buttonStyle: 'solid',
optionType: 'button',
}, },
defaultValue: 1, defaultValue: 1,
}, },

View File

@@ -57,8 +57,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },

View File

@@ -110,8 +110,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },

View File

@@ -50,8 +50,6 @@ export function useTypeFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },
@@ -231,8 +229,6 @@ export function useDataFormSchema(): VbenFormSchema[] {
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
placeholder: '请选择状态', placeholder: '请选择状态',
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },

View File

@@ -71,8 +71,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'), options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.boolean().default(true), rules: z.boolean().default(true),
}, },
@@ -82,8 +80,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'), options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.boolean().default(false), rules: z.boolean().default(false),
}, },

View File

@@ -78,8 +78,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },

View File

@@ -90,8 +90,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.SYSTEM_MENU_TYPE, 'number'), options: getDictOptions(DICT_TYPE.SYSTEM_MENU_TYPE, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(SystemMenuTypeEnum.DIR), rules: z.number().default(SystemMenuTypeEnum.DIR),
}, },
@@ -214,8 +212,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },
@@ -228,8 +224,6 @@ export function useFormSchema(): VbenFormSchema[] {
{ label: '总是', value: true }, { label: '总是', value: true },
{ label: '不是', value: false }, { label: '不是', value: false },
], ],
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: 'required', rules: 'required',
defaultValue: true, defaultValue: true,
@@ -250,8 +244,6 @@ export function useFormSchema(): VbenFormSchema[] {
{ label: '缓存', value: true }, { label: '缓存', value: true },
{ label: '不缓存', value: false }, { label: '不缓存', value: false },
], ],
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: 'required', rules: 'required',
defaultValue: true, defaultValue: true,

View File

@@ -29,8 +29,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.SYSTEM_NOTICE_TYPE, 'number'), options: getDictOptions(DICT_TYPE.SYSTEM_NOTICE_TYPE, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: 'required', rules: 'required',
}, },
@@ -46,8 +44,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },

View File

@@ -74,8 +74,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },

View File

@@ -64,8 +64,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },

View File

@@ -44,8 +44,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },

View File

@@ -52,8 +52,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },

View File

@@ -43,8 +43,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },

View File

@@ -65,8 +65,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },

View File

@@ -45,8 +45,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.USER_TYPE, 'number'), options: getDictOptions(DICT_TYPE.USER_TYPE, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: 'required', rules: 'required',
}, },
@@ -87,8 +85,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },

View File

@@ -113,8 +113,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },

View File

@@ -36,8 +36,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },

View File

@@ -100,8 +100,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number'), options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(1), rules: z.number().default(1),
}, },
@@ -111,8 +109,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'RadioGroup', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
}, },
rules: z.number().default(CommonStatusEnum.ENABLE), rules: z.number().default(CommonStatusEnum.ENABLE),
}, },