menus.entity.ts 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import { Column, Entity } from 'typeorm';
  2. import { BaseModel } from '../../frame/BaseModel';
  3. // interface config {
  4. // comment: '中文';
  5. // code: '页面功能编码';
  6. // controller_code: '接口函数名路径';
  7. // }
  8. @Entity('menus')
  9. export class Menus extends BaseModel {
  10. @Column({ type: 'character varying', comment: '菜单名称' })
  11. name: string;
  12. @Column({ type: 'character varying', comment: '路由名称 英文' })
  13. route_name: string;
  14. @Column({ type: 'character varying', comment: '国际化编码' })
  15. i18n_code: string;
  16. @Column({ type: 'integer', nullable: true, comment: '父级菜单' })
  17. parent_id: number;
  18. @Column({ type: 'integer', nullable: true, comment: '显示顺序' })
  19. order_num: number;
  20. @Column({ type: 'character varying', nullable: true, comment: '路由地址' })
  21. path: string;
  22. @Column({ type: 'character varying', nullable: true, comment: '组件地址' })
  23. component: string;
  24. @Column({ type: 'character varying', comment: '菜单类型 0:目录;1:菜单;2:子页面' })
  25. type: string;
  26. @Column({ type: 'character varying', nullable: true, comment: '图标' })
  27. icon: string;
  28. @Column({ type: 'jsonb', nullable: true, comment: '功能列表 不在功能列表中的功能不能使用' })
  29. config: Array<any>;
  30. @Column({ type: 'character varying', comment: '是否为默认菜单 默认:0,非默认:1; 默认不能删除', default: '1' })
  31. is_default: string;
  32. @Column({ type: 'text', nullable: true, comment: '备注' })
  33. remark: string;
  34. @Column({ type: 'character varying', comment: '是否启用', default: '0' })
  35. is_use: string;
  36. }