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.
89 lines
1.7 KiB
89 lines
1.7 KiB
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
|
|
|
|
/**
|
|
* @returns {Array} 单据开关
|
|
*/
|
|
export const Switch = useCrudSchemas(reactive<CrudSchema[]>([
|
|
{
|
|
label: '代码',
|
|
field: 'code',
|
|
sort: 'custom',
|
|
isSearch: true,
|
|
table: {
|
|
fixed: 'left'
|
|
},
|
|
form: {
|
|
componentProps: {
|
|
disabled: true
|
|
}
|
|
}
|
|
},
|
|
{
|
|
label: '描述',
|
|
field: 'description',
|
|
sort: 'custom',
|
|
form: {
|
|
componentProps: {
|
|
disabled: true
|
|
}
|
|
}
|
|
},
|
|
{
|
|
label: '有效设置值',
|
|
field: 'effectiveSetValue',
|
|
sort: 'custom',
|
|
dictType: DICT_TYPE.TRUE_FALSE,
|
|
dictClass: 'string',
|
|
isTable: true,
|
|
form: {
|
|
component: 'Switch',
|
|
value: 'TRUE',
|
|
componentProps: {
|
|
inactiveValue: 'FALSE',
|
|
activeValue: 'TRUE'
|
|
}
|
|
},
|
|
},
|
|
{
|
|
label: '是否可用',
|
|
field: 'available',
|
|
sort: 'custom',
|
|
dictType: DICT_TYPE.TRUE_FALSE,
|
|
dictClass: 'string',
|
|
isTable: false,
|
|
isForm: false,
|
|
form: {
|
|
component: 'Switch',
|
|
value: 'TRUE',
|
|
componentProps: {
|
|
inactiveValue: 'FALSE',
|
|
activeValue: 'TRUE'
|
|
}
|
|
},
|
|
},
|
|
{
|
|
label: '操作',
|
|
field: 'action',
|
|
isForm: false,
|
|
table: {
|
|
width: 150,
|
|
fixed: 'right'
|
|
}
|
|
}
|
|
]))
|
|
|
|
// 表单校验
|
|
export const SwitchRules = reactive({
|
|
code: [
|
|
{ required: true, message: '请输入代码', trigger: 'blur' }
|
|
],
|
|
description: [
|
|
{ required: true, message: '请输入描述', trigger: 'blur' }
|
|
],
|
|
effectiveSetValue: [
|
|
{ required: true, message: '请选择是否有效', trigger: 'change' }
|
|
],
|
|
available: [
|
|
{ required: true, message: '请选择是否可用', trigger: 'change' }
|
|
],
|
|
})
|