auth-web/src/views/configuration/menu-icon/utils/columns.ts

58 lines
1.3 KiB
TypeScript
Raw Normal View History

2025-04-24 13:43:37 +08:00
import { $t } from '@/plugins/i18n';
import { reactive } from 'vue';
2025-04-24 13:43:37 +08:00
// 表格列
export const columns: TableColumnList = [
{ type: 'selection', align: 'left' },
2025-04-29 18:18:07 +08:00
{
type: 'index',
index: (index: number) => index + 1,
label: $t("index"),
2025-04-29 18:18:07 +08:00
width: 60,
},
2025-04-24 13:43:37 +08:00
// icon 类名
{ label: $t('menuIcon_iconCode'), prop: 'iconCode', slot: 'iconCode' },
// icon 名称
{ label: $t('menuIcon_iconName'), prop: 'iconName', slot: 'iconName' },
{ label: $t('table.updateTime'), prop: 'updateTime', sortable: true },
{ label: $t('table.createTime'), prop: 'createTime', sortable: true },
2025-04-29 18:18:07 +08:00
{
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-24 13:43:37 +08:00
];
// 添加规则
export const rules = reactive({
// icon 类名
2025-04-29 18:18:07 +08:00
iconCode: [
{
required: true,
message: `${$t('input')}${$t('menuIcon_iconCode')}`,
trigger: 'blur',
},
],
2025-04-24 13:43:37 +08:00
// icon 名称
2025-04-29 18:18:07 +08:00
iconName: [
{
required: true,
message: `${$t('input')}${$t('menuIcon_iconName')}`,
trigger: 'blur',
},
],
2025-04-24 13:43:37 +08:00
});