【阶段练练练】PC 端教师管理功能编写
4.2k
等4人参与

题目描述 :

PC 端教师管理功能编写

效果图:

图片描述
图片描述

任务要求:

任务分为两部分,第一要去写一下教师的增删改查接口,第二要去写教师管理的页面。

教师管理接口编写

  1. 在 water-drop-server 里,使用 npx plop 新建 teacher module。
  2. 给 commitTeacherInfo 和 getTeachers 接口上添加 @CurOrgId() orgId: string
  3. 修改 teacher.entity、teacher.input、teacher.type 的字段内容。
  4. 教师相关字段如下:
import { Organization } from '@/modules/organization/models/organization.entity';
import { Entity, Column, ManyToOne } from 'typeorm';
import { CommonEntity } from '@/common/entities/common.entity';

@Entity('teacher')
export class Teacher extends CommonEntity {
  @Column({
    comment: '名称',
  })
  name: string;

  @Column({
    comment: '照片',
    nullable: true,
  })
  photoUrl: string;

  @Column({
    comment: '教龄',
    nullable: true,
  })
  teacherTime: number;

  @Column({
    comment: '学历',
    nullable: true,
  })
  education: string;

  @Column({
    comment: '资历',
    nullable: true,
  })
  seniority: string;

  @Column({
    comment: '职业经验',
    nullable: true,
  })
  experience: string;

  @Column({
    comment: '获奖经历',
    nullable: true,
  })
  carryPrize: string;

  @Column({
    comment: '风格标签,以,隔开',
    nullable: true,
  })
  tags: string;

  @ManyToOne(() => Organization)
  org: Organization;
}
  1. 使用 http://localhost:3000/graphql 调试接口

教师管理的页面编写

  1. 借鉴商品管理的代码,完成教师管理页面。
  2. 编写列表页,需要使用 Card 组件。
  3. 编写新建和编辑抽屉
  4. 删除卡片的功能

任务提示/思路分析:

  1. 写 teacher.entity 的时候要注意,需要把 org 多对一的对应关系也加上。
  2. 教师标签和头像记得做数据转换。
我的作业
去发布

登录后即可发布作业,立即

全部作业

数据加载中...

意见反馈 帮助中心 APP下载
官方微信