auth-server-java/common/generator-code/src/main/resources/vms/web/columns.tsx.vm

32 lines
1.2 KiB
Plaintext
Raw Normal View History

2025-04-05 21:29:15 +08:00
import {reactive} from 'vue';
import type {FormRules} from 'element-plus';
2025-04-04 18:10:55 +08:00
import { $t } from '@/plugins/i18n';
export const columns: TableColumnList = [
2025-04-05 21:29:15 +08:00
{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'},
2025-04-04 18:10:55 +08:00
];
// 添加规则
2025-04-05 21:29:15 +08:00
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'
}],
2025-04-04 18:10:55 +08:00
#end
2025-04-05 21:29:15 +08:00
});