You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

151 lines
3.0 KiB

import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
// 表单校验
export const BarcodeRules = reactive({
code: [
{ required: true, message: '请输入代码', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
name: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
description: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
order: [required],
length: [required],
prefixLenght: [required],
prefixChar: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
entityProperties: [
{ required: true, message: '请输入实体属性', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
encyptMethod: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
trimEnd: [
{ required: true, message: '请输入截断尾部空格', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
isEncypt: [required],
})
export const Barcode = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: 'id',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '代码',
field: 'code',
sort: 'custom',
isSearch: true,
table: {
fixed: 'left'
}
},
{
label: '标签类型',
field: 'labelType',
sort: 'custom',
dictType: DICT_TYPE.LABEL_TYPE,
dictClass: 'string',
isSearch: true,
isTable: true
},
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '描述',
field: 'description',
sort: 'custom',
},
{
label: '顺序',
field: 'order',
sort: 'custom',
form: {
component: 'InputNumber',
componentProps: {
min: 0
},
value: 0
},
},
{
label: '长度',
field: 'length',
sort: 'custom',
form: {
component: 'InputNumber',
componentProps: {
min: 0,
},
value: 0
},
},
{
label: '前缀长度',
field: 'prefixLenght',
sort: 'custom',
form: {
component: 'InputNumber',
componentProps: {
min: 0
},
value: 0
},
},
{
label: '前缀字符',
field: 'prefixChar',
sort: 'custom',
},
{
label: '实体属性',
field: 'entityProperties',
sort: 'custom',
},
{
label: '加密方法',
field: 'encyptMethod',
sort: 'custom',
},
{
label: '截断尾部空格',
field: 'trimEnd',
sort: 'custom',
},
{
label: '是否加密',
field: 'isEncypt',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))