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.

142 lines
2.6 KiB

1 year ago
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
const { t } = useI18n() // 国际化
/**
* @returns {Array}
*/
export const Rule = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '策略代码',
field: 'strategyCode',
sort: 'custom',
table: {
fixed: 'left'
},
isSearch:true
},
{
label: '优先级',
field: 'priority',
sort: 'custom',
form: {
component: 'InputNumber',
componentProps: {
min: 0
}
},
},
// {
// label: '代码',
// field: 'code',
// sort: 'custom',
// isSearch:true
// },
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch:true
},
{
label: '条件',
field: 'condition',
sort: 'custom',
},
{
label: '配置',
field: 'configuration',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
isForm: false,
table: {
width: 180
},
formatter: dateFormatter,
detail: {
dateFormat : 'YYYY-MM-DD HH:mm:ss'
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
}
},
{
label: '创建者',
field: 'creator',
table: {
width: 130
},
isForm: false,
isTable: true
},
{
label: '最后更新时间',
field: 'updateTime',
sort: 'custom',
isDetail: true,
isForm: false,
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
}
},
{
label: '最后更新者',
field: 'updater',
isDetail: true,
isForm: false,
isTable: true,
table: {
width: 150
}
},
1 year ago
// {
// label: '操作',
// field: 'action',
// isDetail: false,
// isForm: false ,
// table: {
// width: 150,
// fixed: 'right'
// }
// }
]))
//表单校验
export const RuleRules = reactive({
strategyCode: [
{ required: true, message: '请输入策略代码', trigger: 'blur' }
],
priority: [
{ required: true, message: '请输入优先级', trigger: 'blur' }
],
// code: [
// { required: true, message: '请输入代码', trigger: 'blur' }
// ],
configuration: [
{ required: true, message: '请输入配置', trigger: 'blur' }
],
})