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.
65 lines
1.2 KiB
65 lines
1.2 KiB
1 year ago
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
|
||
|
import { dateFormatter } from '@/utils/formatTime'
|
||
1 year ago
|
import { string } from 'vue-types'
|
||
|
|
||
|
const trueFalse = [{
|
||
|
label: '是',
|
||
|
value: true
|
||
|
}, {
|
||
|
label: '否',
|
||
|
value: false
|
||
|
}]
|
||
1 year ago
|
|
||
|
// 表单校验
|
||
|
export const DynamicRuleRules = reactive({
|
||
1 year ago
|
description: [
|
||
|
required,
|
||
|
{ max: 1024, message: '不得超过1024个字符', trigger: 'blur' },
|
||
|
]
|
||
1 year ago
|
})
|
||
|
|
||
|
export const DynamicRule = useCrudSchemas(reactive<CrudSchema[]>([
|
||
|
{
|
||
|
label: '编码',
|
||
1 year ago
|
field: 'code',
|
||
1 year ago
|
sort: 'custom',
|
||
1 year ago
|
isSearch: true,
|
||
|
isForm: false,
|
||
1 year ago
|
fixed: 'left'
|
||
1 year ago
|
},
|
||
|
{
|
||
|
label: '描述',
|
||
1 year ago
|
field: 'description',
|
||
1 year ago
|
sort: 'custom',
|
||
|
isSearch: true
|
||
|
},
|
||
1 year ago
|
{
|
||
|
label: '是否可用',
|
||
|
field: 'available',
|
||
|
sort: 'custom',
|
||
|
dictType: DICT_TYPE.TRUE_FALSE,
|
||
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
||
|
form: {
|
||
|
component: 'Switch',
|
||
|
value: 'TRUE',
|
||
|
componentProps: {
|
||
|
inactiveValue: 'FALSE',
|
||
|
activeValue: 'TRUE'
|
||
|
}
|
||
|
},
|
||
|
table: {
|
||
|
width: 110
|
||
|
}
|
||
|
},
|
||
1 year ago
|
{
|
||
|
label: '操作',
|
||
|
field: 'action',
|
||
|
isDetail: false,
|
||
|
isForm: false,
|
||
|
table: {
|
||
|
width: 330,
|
||
|
fixed: 'right'
|
||
|
},
|
||
|
}
|
||
1 year ago
|
]))
|