32 lines
1.2 KiB
Plaintext
32 lines
1.2 KiB
Plaintext
|
import {reactive} from 'vue';
|
||
|
import type {FormRules} from 'element-plus';
|
||
|
import { $t } from '@/plugins/i18n';
|
||
|
|
||
|
export const columns: TableColumnList = [
|
||
|
{type: 'selection', align: 'left'},
|
||
|
{type: 'index', index: (index: number) => index + 1, label: '序号', width: 60},
|
||
|
#foreach($field in $columnInfoList)
|
||
|
// $field.comment
|
||
|
{label: $t('$field.fieldName'), prop: '$field.fieldName'},
|
||
|
#end
|
||
|
{label: $t('table.updateTime'), prop: 'updateTime', sortable: true, width: 160},
|
||
|
{label: $t('table.createTime'), prop: 'createTime', sortable: true, width: 160},
|
||
|
{label: $t('table.createUser'), prop: 'createUser', slot: 'createUser', width: 130},
|
||
|
{label: $t('table.updateUser'), prop: 'updateUser', slot: 'updateUser', width: 130},
|
||
|
{label: $t('table.operation'), fixed: 'right', width: 210, slot: 'operation'},
|
||
|
];
|
||
|
|
||
|
// 添加规则
|
||
|
export const rules = reactive < FormRules > ({
|
||
|
#foreach($field in $columnInfoList)
|
||
|
// $field.comment
|
||
|
$field.fieldName: [{
|
||
|
required: true,
|
||
|
message: `$leftBrace$t('input')}$leftBrace$t('${field.fieldName}')}`,
|
||
|
trigger: 'blur'
|
||
|
}],
|
||
|
#end
|
||
|
});
|
||
|
|
||
|
|