| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- import { listDictModel } from '/@/api/common';
- import { DescItem } from '/@/components/Description';
- import { BasicColumn, FormSchema } from '/@/components/Table';
- import { validateStr } from '/@/utils/validate';
- export const columns: BasicColumn[] = [
- {
- title: '策略编码',
- dataIndex: 'code',
- },
- {
- title: '策略名称',
- dataIndex: 'name',
- },
- {
- title: '编号前缀',
- dataIndex: 'prefix',
- },
- {
- title: '生成模式',
- dataIndex: 'type',
- },
- {
- title: '流水号长度',
- dataIndex: 'limitLen',
- },
- {
- title: '填充字符',
- dataIndex: 'fillChar',
- },
- ];
- // 表单列定义
- export const searchFormSchema: FormSchema[] = [
- {
- label: '策略编码',
- field: 'code',
- component: 'Input',
- componentProps: {
- placeholder: '请输入策略编码',
- },
- },
- {
- label: '策略名称',
- field: 'name',
- component: 'Input',
- componentProps: {
- placeholder: '请输入策略名称',
- },
- },
- ];
- // 表单新增编辑
- export const dataFormSchema: FormSchema[] = [
- {
- label: '策略编码',
- field: 'code',
- required: true,
- component: 'Input',
- componentProps: {
- placeholder: '请输入策略编码',
- },
- dynamicRules: () => {
- return [
- {
- required: true,
- validator: async (_, value) => {
- if (!value) {
- return Promise.reject('字典项编码不能为空');
- }
- if (validateStr(value)) {
- return Promise.reject('字典项编码为字母或数字组成');
- }
- return Promise.resolve();
- },
- },
- ];
- },
- },
- {
- label: '策略名称',
- field: 'name',
- required: true,
- component: 'Input',
- componentProps: {
- placeholder: '请输入策略名称',
- },
- },
- {
- label: '流水号(递增)',
- field: 'nextNum',
- required: true,
- component: 'Input',
- componentProps: {
- placeholder: '请输入流水号(递增)',
- },
- },
- {
- label: '流水号长度',
- field: 'limitLen',
- required: true,
- component: 'Input',
- componentProps: {
- placeholder: '请输入流水号长度',
- },
- },
- {
- label: '填充字符',
- field: 'fillChar',
- required: true,
- component: 'Input',
- componentProps: {
- placeholder: '请输入填充字符',
- },
- },
- {
- label: '编号前缀',
- field: 'prefix',
- component: 'Input',
- componentProps: {
- placeholder: '请输入编号前缀',
- },
- },
- {
- label: '生成模式',
- field: 'type',
- component: 'ApiSelect',
- required: true,
- componentProps: {
- api: listDictModel,
- params: {
- dictCode: 'sys_numbering_type',
- },
- },
- },
- {
- label: '备注',
- field: 'remark',
- component: 'InputTextArea',
- componentProps: {
- placeholder: '请输入备注',
- },
- },
- ];
- // 表单详情查看
- export const viewSchema: DescItem[] = [
- {
- label: '策略编码',
- field: 'code',
- },
- {
- label: '策略名称',
- field: 'name',
- },
- {
- label: '编号前缀',
- field: 'prefix',
- },
- {
- label: '生成模式',
- field: 'type',
- },
- {
- label: '流水号(递增)',
- field: 'nextNum',
- },
- {
- label: '流水号长度',
- field: 'limitLen',
- },
- {
- label: '填充字符',
- field: 'fillChar',
- },
- {
- label: '备注',
- field: 'remark',
- },
- {
- label: '下一个编号',
- field: 'nextFormatNum',
- },
- ];
|