dept.entity.ts 914 B

1234567891011121314151617181920
  1. import { Column, Entity } from 'typeorm';
  2. import { BaseModel } from '../../frame/BaseModel';
  3. @Entity('dept', { comment: '部门' })
  4. export class Dept extends BaseModel {
  5. @Column({ type: 'character varying', comment: '部门名称' })
  6. name: string;
  7. @Column({ type: 'jsonb', default: [], comment: '资源权限' })
  8. resource: Array<string>;
  9. @Column({ type: 'integer', nullable: true, comment: '上级部门id' })
  10. parent_id: number;
  11. @Column({ type: 'character varying', default: '0', comment: '是否使用 0使用;1禁用' })
  12. is_use: string;
  13. @Column({ type: 'character varying', default: '1', comment: '是否是总部门 0:是;1否' })
  14. is_super: string;
  15. @Column({ type: 'integer', nullable: true, comment: '排序' })
  16. order_num: number;
  17. @Column({ type: 'character varying', comment: '是否为默认目录 默认:0,非默认:1; 默认不能删除', default: '1' })
  18. is_default: string;
  19. }