Blame view

src/views/basic/setUp/teacher.vue 35.9 KB
4c4f7640   梁保满   路由表,路由前端文件
1
  <template>
23a6dc5f   阿宝   学校管理相关接口简单对接
2
3
4
5
6
    <div>
      <back-box>
        <template slot="title">
          <span>教师管理</span>
        </template>
b21d90ef   梁保满   长水登录
7
        <template slot="btns" v-if="!code">
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
8
          <el-tooltip effect="dark" content="导入教师名单" placement="bottom">
f45b3c05   LH_PC   云平台新UI界面
9
            <el-button type="primary" icon="el-icon-upload2" size="mini" plain circle @click="diaUp = true"></el-button>
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
10
11
          </el-tooltip>
          <el-tooltip effect="dark" content="导出教师名单" placement="bottom">
f45b3c05   LH_PC   云平台新UI界面
12
13
            <el-button type="primary" icon="el-icon-download" size="mini" plain circle
              @click="exportTeacherExl"></el-button>
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
14
          </el-tooltip>
23a6dc5f   阿宝   学校管理相关接口简单对接
15
          <el-tooltip effect="dark" content="添加教师" placement="bottom">
f45b3c05   LH_PC   云平台新UI界面
16
            <el-button type="primary" icon="el-icon-plus" size="mini" plain circle @click="addTeacherDia"></el-button>
23a6dc5f   阿宝   学校管理相关接口简单对接
17
18
19
20
21
22
          </el-tooltip>
        </template>
      </back-box>
  
      <div class="answer-header">
        <div class="sel-box">
f45b3c05   LH_PC   云平台新UI界面
23
          <el-select class="sel" v-model="query.classType" @change="changeType" placeholder="选择类型">
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
24
            <el-option disabled label="全部" value=""></el-option>
29319cfb   梁保满   设备。教师管理
25
26
27
            <el-option label="行政班" :value="0"></el-option>
            <el-option label="教学班" :value="1"></el-option>
          </el-select>
ef16e57e   LH_PC   fix:前端版本迭代
28
29
30
31
32
33
          <el-select class="sel" @change="_QueryData(5)" v-model="query.role" placeholder="选择角色">
            <el-option disabled label="请选择" :value="9"></el-option>
            <el-option label="年级组长" :value="'年级组长'"></el-option>
            <el-option label="班主任" :value="'班主任'"></el-option>
            <el-option label="任课老师" :value="'任课老师'"></el-option>
          </el-select>
f45b3c05   LH_PC   云平台新UI界面
34
35
36
37
38
39
          <el-cascader size="small" class="sel sel2" clearable placeholder="选择范围" @change="_QueryData(1)"
            v-model="query.gradeClassSub" :options="gradeClassSubList" :props="{
          multiple: true,
          checkStrictly: true,
        }" collapse-tags :show-all-levels="false"></el-cascader>
          <el-select class="sel" v-model="query.type" @change="_QueryData(4)" placeholder="选择类型">
5cfb0264   梁保满   班级管理交互优化
40
            <el-option disabled label="请选择" :value="9"></el-option>
55eb13fd   梁保满   中天提出的交互优化
41
42
            <el-option label="已分配任课信息" :value="0"></el-option>
            <el-option label="未分配任课信息" :value="1"></el-option>
23a6dc5f   阿宝   学校管理相关接口简单对接
43
          </el-select>
f45b3c05   LH_PC   云平台新UI界面
44
45
46
          <el-input placeholder="请输入老师姓名" v-model="query.teacherName" class="input-with-select" maxlength="30" clearable
            @keyup.enter.native="_QueryData(2)">
            <el-button slot="append" icon="el-icon-search" @click="_QueryData(2)"></el-button>
23a6dc5f   阿宝   学校管理相关接口简单对接
47
          </el-input>
f45b3c05   LH_PC   云平台新UI界面
48
49
50
          <el-input type="number" oninput="if(value.length > 11) value = value.slice(0,11)" placeholder="请输入老师手机号"
            v-model="query.phone" clearable class="input-with-select" @keyup.enter.native="_QueryData(3)">
            <el-button slot="append" icon="el-icon-search" @click="_QueryData(3)"></el-button>
23a6dc5f   阿宝   学校管理相关接口简单对接
51
          </el-input>
a4074db8   梁保满   使用分析,集团管理元交互
52
          <!-- <el-button class="serach-box" round @click="_QueryData(4)"
53424e83   梁保满   教师管理筛选条件
53
            >筛选</el-button
a4074db8   梁保满   使用分析,集团管理元交互
54
          > -->
23a6dc5f   阿宝   学校管理相关接口简单对接
55
56
        </div>
      </div>
99713685   梁保满   学生调班,班级数据重新请求,使用过...
57
58
59
      <p class="total" v-if="teacherList.length">
        共筛选出{{ teacherList.length }}名教师。
      </p>
23a6dc5f   阿宝   学校管理相关接口简单对接
60
      <div class="page-content">
f45b3c05   LH_PC   云平台新UI界面
61
        <el-empty :image-size="100" v-if="!teacherList.length && loading == false" description="没有更多数据"></el-empty>
23a6dc5f   阿宝   学校管理相关接口简单对接
62
63
        <div class="teacher-box" v-loading="loading" v-else>
          <div class="teacher-list">
29319cfb   梁保满   设备。教师管理
64
            <p class="h-title" v-loading="removeLoading">
f45b3c05   LH_PC   云平台新UI界面
65
66
              <el-checkbox v-show="showDel" v-model="AllTeacher" :indeterminate="indeterminate"
                @change="handleCheckAllChange">{{ "" }}</el-checkbox>
29319cfb   梁保满   设备。教师管理
67
              <span class="txt">教师列表</span>
ef16e57e   LH_PC   fix:前端版本迭代
68
              <el-popconfirm v-show="showDel" title="确定清除所选教师的任课信息吗?" @confirm="remove">
f45b3c05   LH_PC   云平台新UI界面
69
                <img slot="reference" class="clear" src="../../../assets/images/shuazi.svg" alt="" />
0f3dca29   梁保满   教师格式化确认,报表列表添加去筛选按钮
70
              </el-popconfirm>
29319cfb   梁保满   设备。教师管理
71
            </p>
f45b3c05   LH_PC   云平台新UI界面
72
            <el-checkbox-group v-model="clearTeacher" @change="handleCheckedChange">
29319cfb   梁保满   设备。教师管理
73
              <ul class="teacher-ul">
f45b3c05   LH_PC   云平台新UI界面
74
                <li class="teacher-item" v-for="item in teacherList" :key="item.id">
ef16e57e   LH_PC   fix:前端版本迭代
75
                  <el-checkbox v-show="showDel" :label="item.id">{{ "" }}</el-checkbox>
f45b3c05   LH_PC   云平台新UI界面
76
                  <p class="name" :class="showTId == item.id ? 'active' : ''" @click="showTeacher(item)">
ef16e57e   LH_PC   fix:前端版本迭代
77
78
                    {{ item.realName }}
                    <template v-if="setClass(item)">({{ setClass(item) }})</template>
b0cd2598   梁保满   fix:测试问题
79
                  </p>
29319cfb   梁保满   设备。教师管理
80
81
82
                </li>
              </ul>
            </el-checkbox-group>
23a6dc5f   阿宝   学校管理相关接口简单对接
83
84
          </div>
          <div class="teacher-detail">
b21d90ef   梁保满   长水登录
85
            <div class="icon-box" v-if="!code">
0a4de034   阿宝   教师管理,学生管理班级设置
86
              <i class="icon el-icon-edit-outline" @click="editTeacher(1)"></i>
f45b3c05   LH_PC   云平台新UI界面
87
              <i class="icon el-icon-circle-plus-outline" @click="editTeacher(2)"></i>
23a6dc5f   阿宝   学校管理相关接口简单对接
88
89
90
91
            </div>
            <div class="detail-top">
              <p class="p-item">手机号码:{{ teacherDetail.loginName }}</p>
              <p class="p-item">
560c12f2   阿宝   学校设置,软件下载
92
                状态:{{ teacherDetail.available == 1 ? "不可用" : "正常" }}
23a6dc5f   阿宝   学校管理相关接口简单对接
93
94
95
              </p>
              <p class="p-item">
                性别:{{
f45b3c05   LH_PC   云平台新UI界面
96
97
98
99
100
101
          teacherDetail.sex == 1
            ? "男"
            : teacherDetail.sex == 2
              ? "女"
              : "未知"
        }}
23a6dc5f   阿宝   学校管理相关接口简单对接
102
103
              </p>
            </div>
ef16e57e   LH_PC   fix:前端版本迭代
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
            <div class="grade-box" v-if="teacherDetail.teacherGradeList && teacherDetail.teacherGradeList.length">
              <p class="h-title">年级组长</p>
              <ul class="grade-info">
                <li class="grade-li" v-for="item in teacherDetail.teacherGradeList" :key="item.classId">
                  <el-popconfirm title="确定删除吗?" @confirm="delTeacherManager(item, 0)" v-if="!code">
                    <i class="el-icon-delete" slot="reference"></i>
                  </el-popconfirm>
                  <div class="grade-item">
                    <p class="grade-name">
                      {{ item.gradeName }}
                    </p>
                    <div class="grade-class">
                      <p>
                        <i class="fa fa-address-book-o"></i>学生:{{ item.studentNum }}个
                      </p>
                    </div>
                  </div>
                </li>
              </ul>
            </div>
f45b3c05   LH_PC   云平台新UI界面
124
            <div class="grade-box" v-if="teacherDetail.managerList && teacherDetail.managerList.length">
23a6dc5f   阿宝   学校管理相关接口简单对接
125
126
              <p class="h-title">班主任</p>
              <ul class="grade-info">
f45b3c05   LH_PC   云平台新UI界面
127
128
                <li class="grade-li" v-for="item in teacherDetail.managerList" :key="item.classId">
                  <el-popconfirm title="确定删除吗?" @confirm="delTeacherManager(item, 1)" v-if="!code">
bb4c8454   阿宝   添加,修改教师
129
130
                    <i class="el-icon-delete" slot="reference"></i>
                  </el-popconfirm>
23a6dc5f   阿宝   学校管理相关接口简单对接
131
                  <div class="grade-item">
ec6394d1   梁保满   v1.3.1。细节调整
132
                    <p class="grade-name">
0ca11cc2   梁保满   学段参数调整,发卡记录类型增加
133
                      {{ item.gradeName }}-{{ item.className }}
ec6394d1   梁保满   v1.3.1。细节调整
134
                    </p>
23a6dc5f   阿宝   学校管理相关接口简单对接
135
136
137
                    <div class="grade-class">
                      <p>
                        <i class="fa fa-address-book-o"></i>学生:{{
f45b3c05   LH_PC   云平台新UI界面
138
139
          item.studentCount
        }}个
23a6dc5f   阿宝   学校管理相关接口简单对接
140
141
142
143
144
145
                      </p>
                    </div>
                  </div>
                </li>
              </ul>
            </div>
ef16e57e   LH_PC   fix:前端版本迭代
146
            <div class="grade-box" v-if="teacherDetail.teacherCourseList && teacherDetail.teacherCourseList.length">
23a6dc5f   阿宝   学校管理相关接口简单对接
147
148
              <p class="h-title">任课老师</p>
              <ul class="grade-info">
f45b3c05   LH_PC   云平台新UI界面
149
150
151
                <li class="grade-li" v-for="item in teacherDetail.teacherCourseList"
                  :key="item.classId + item.subjectName">
                  <el-popconfirm title="确定删除吗?" @confirm="delTeacherManager(item, 2)" v-if="!code">
bb4c8454   阿宝   添加,修改教师
152
153
                    <i class="el-icon-delete" slot="reference"></i>
                  </el-popconfirm>
23a6dc5f   阿宝   学校管理相关接口简单对接
154
155
                  <div class="grade-item">
                    <p class="grade-name">
0ca11cc2   梁保满   学段参数调整,发卡记录类型增加
156
                      {{ item.gradeName }}-{{ item.className }}({{
f45b3c05   LH_PC   云平台新UI界面
157
158
          item.subjectName
        }})
23a6dc5f   阿宝   学校管理相关接口简单对接
159
160
161
162
                    </p>
                    <div class="grade-class">
                      <p>
                        <i class="fa fa-address-book-o"></i>学生:{{
f45b3c05   LH_PC   云平台新UI界面
163
164
            item.studentCount
          }}个
23a6dc5f   阿宝   学校管理相关接口简单对接
165
166
167
168
169
170
                      </p>
                    </div>
                  </div>
                </li>
              </ul>
            </div>
23a6dc5f   阿宝   学校管理相关接口简单对接
171
172
173
          </div>
        </div>
      </div>
f45b3c05   LH_PC   云平台新UI界面
174
175
      <el-dialog :append-to-body="true" :close-on-click-modal="false" title="导入教师名单" :visible.sync="diaUp" width="600">
        <upload id="downTeacher" :url="url" @upSuccess="upSuccess" fileName="教师名单">
23a6dc5f   阿宝   学校管理相关接口简单对接
176
177
178
179
          <p class="down-txt" slot="down">
            通过Excel名单导入教师名单,点击
            <el-link type="danger" @click="downExcel">模板下载</el-link> 。
          </p>
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
180
        </upload>
23a6dc5f   阿宝   学校管理相关接口简单对接
181
182
183
184
        <div class="dialog-footer" slot="footer">
          <el-button @click="diaUp = false">取 消</el-button>
        </div>
      </el-dialog>
f45b3c05   LH_PC   云平台新UI界面
185
186
187
      <el-dialog :append-to-body="true" :close-on-click-modal="false" :title="isAdd ? '添加教师' : setTercherType == 1 ? '编辑教师信息' : '管理班级'
          " :visible.sync="diaTeacher" width="400" append-to-body>
        <el-form class="form-box" ref="formTeacher" :model="formTeacher" :rules="rulesTeacher" label="" width="160px">
e5ff81a1   阿宝   集团管理员接口
188
189
          <el-form-item v-show="!isAdd && setTercherType == 2" label="教师姓名:">
            <span>{{ formTeacher.teacherName }}</span>
0a4de034   阿宝   教师管理,学生管理班级设置
190
          </el-form-item>
f45b3c05   LH_PC   云平台新UI界面
191
          <el-form-item v-show="isAdd || (!isAdd && setTercherType == 1)" label="手机号码:" prop="loginName">
dd5150c5   阿宝   数据同步
192
            <el-col :span="10">
f45b3c05   LH_PC   云平台新UI界面
193
194
              <el-input type="number" oninput="if(value.length > 11) value = value.slice(0,11)"
                v-model.trim="formTeacher.loginName" />
dd5150c5   阿宝   数据同步
195
196
            </el-col>
          </el-form-item>
f45b3c05   LH_PC   云平台新UI界面
197
          <el-form-item v-show="isAdd || (!isAdd && setTercherType == 1)" label="教师姓名:" prop="teacherName">
dd5150c5   阿宝   数据同步
198
199
200
201
            <el-col :span="10">
              <el-input maxlength="30" v-model.trim="formTeacher.teacherName" />
            </el-col>
          </el-form-item>
f45b3c05   LH_PC   云平台新UI界面
202
          <el-form-item v-show="isAdd || (!isAdd && setTercherType == 1)" label="性别:" prop="sex">
dd5150c5   阿宝   数据同步
203
204
205
206
207
            <el-radio-group v-model="formTeacher.sex">
              <el-radio :label="1">男</el-radio>
              <el-radio :label="2">女</el-radio>
            </el-radio-group>
          </el-form-item>
f45b3c05   LH_PC   云平台新UI界面
208
          <el-form-item v-show="isAdd || (!isAdd && setTercherType == 2)" label="教师角色:" prop="roleList">
ef16e57e   LH_PC   fix:前端版本迭代
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
            <div class="role-list-main">
              <div class="role-list" v-for="(item, index) in formTeacher.roleList" :key="item.id">
                <el-select class="sel-c" v-model="item.roleId" placeholder="选择角色" @change="item.classId = []">
                  <el-option v-for="item in teacherRoleList" :key="item.value" :label="item.label" :value="item.value">
                  </el-option>
                </el-select>
                <el-cascader size="small" v-if="item.roleId == 6" class="sel-t" collapse clearable placeholder="选择年级-班级"
                  v-model="item.classId" :options="gradeClassList" :props="{ expandTrigger: 'hover' }"></el-cascader>
                <el-cascader size="small" v-if="item.roleId == 7" class="sel-t teacher-cascader" collapse clearable
                  placeholder="选择年级-科目-班级" v-model="item.classId" :options="gradeSubListClass"
                  :props="{ expandTrigger: 'hover', multiple: true }" popperClass="cascader-clazz"></el-cascader>
                <el-cascader size="small" v-if="item.roleId == 8" class="sel-t" collapse clearable placeholder="选择年级-科目"
                  v-model="item.classId" :options="gradeList" :props="{ expandTrigger: 'hover' }"></el-cascader>
                <el-select v-if="item.roleId == 3" v-model="item.gradeId" placeholder="选择年级">
                  <el-option v-for="item in gradeList" :key="item.value" :label="item.label" :value="item.value">
                  </el-option>
                </el-select>
                <i class="el-icon-close" @click="removeRoleList(index)"></i>
              </div>
              <p class="add-box">
                <el-button icon="el-icon-plus" @click="addRoleList">添加</el-button>
              </p>
bb4c8454   阿宝   添加,修改教师
231
            </div>
dd5150c5   阿宝   数据同步
232
233
234
          </el-form-item>
        </el-form>
        <div class="dialog-footer" slot="footer">
0a4de034   阿宝   教师管理,学生管理班级设置
235
          <el-button type="primary" @click="addTeacher">确 定</el-button>
dd5150c5   阿宝   数据同步
236
237
238
          <el-button @click="diaTeacher = false">取 消</el-button>
        </div>
      </el-dialog>
23a6dc5f   阿宝   学校管理相关接口简单对接
239
    </div>
4c4f7640   梁保满   路由表,路由前端文件
240
241
242
  </template>
  
  <script>
ec6394d1   梁保满   v1.3.1。细节调整
243
244
245
246
247
248
  import {
    downloadFile,
    formatGradeClass,
    randomWord,
    setGradeName,
  } from "@/utils";
4c4f7640   梁保满   路由表,路由前端文件
249
  export default {
23a6dc5f   阿宝   学校管理相关接口简单对接
250
251
    data() {
      return {
b21d90ef   梁保满   长水登录
252
        code: "",
dd5150c5   阿宝   数据同步
253
        loading: false,
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
254
        url: "/api_html/school/manager/importTeacher",
23a6dc5f   阿宝   学校管理相关接口简单对接
255
        diaUp: false,
bb4c8454   阿宝   添加,修改教师
256
257
        diaTeacher: false,
        isAdd: false,
0a4de034   阿宝   教师管理,学生管理班级设置
258
        setTercherType: 1,
23a6dc5f   阿宝   学校管理相关接口简单对接
259
        query: {
29319cfb   梁保满   设备。教师管理
260
          classType: 0,
53424e83   梁保满   教师管理筛选条件
261
262
          gradeClassSub: [],
          type: 0,
23a6dc5f   阿宝   学校管理相关接口简单对接
263
264
265
          teacherName: "",
          phone: "",
        },
23a6dc5f   阿宝   学校管理相关接口简单对接
266
        gradeList: [],
bb4c8454   阿宝   添加,修改教师
267
        classList: [],
53424e83   梁保满   教师管理筛选条件
268
        gradeClassSubList: [],
8ad80958   梁保满   教师学生管理,设备状态
269
        gradeClassList: [],
55eb13fd   梁保满   中天提出的交互优化
270
        gradeSubListClass: [],
dd5150c5   阿宝   数据同步
271
        teacherList: [],
4d5235d7   梁保满   学生,教师修改,顶部返回备题组卷记...
272
273
274
        RoleList: [
          //角色
          {
f45b3c05   LH_PC   云平台新UI界面
275
276
277
278
            value: 3,
            label: "年级组长"
          },
          {
4d5235d7   梁保满   学生,教师修改,顶部返回备题组卷记...
279
280
281
282
283
284
285
            value: 6,
            label: "班主任",
          },
          {
            value: 7,
            label: "任课老师",
          },
b0cd2598   梁保满   fix:测试问题
286
287
288
289
          // {
          //   value: 8,
          //   label: "备课组长",
          // },
4d5235d7   梁保满   学生,教师修改,顶部返回备题组卷记...
290
        ],
0a4de034   阿宝   教师管理,学生管理班级设置
291
292
        teacherRoleList: [
          //角色
bb4c8454   阿宝   添加,修改教师
293
          {
f45b3c05   LH_PC   云平台新UI界面
294
295
296
297
            value: 3,
            label: "年级组长"
          },
          {
bb4c8454   阿宝   添加,修改教师
298
299
300
301
302
303
304
            value: 6,
            label: "班主任",
          },
          {
            value: 7,
            label: "任课老师",
          },
b0cd2598   梁保满   fix:测试问题
305
306
307
308
          // {
          //   value: 8,
          //   label: "备课组长",
          // },
bb4c8454   阿宝   添加,修改教师
309
        ],
23a6dc5f   阿宝   学校管理相关接口简单对接
310
311
312
313
314
315
316
317
318
319
        teacherDetail: {
          teacherName: "",
          loginName: "",
          sex: "",
          available: "",
          managerList: [],
          teacherCourseList: [],
          teacherGradeList: [],
        },
        showTId: "", //显示详情 教师ID
bb4c8454   阿宝   添加,修改教师
320
321
322
323
324
325
326
327
328
        roleList: [],
        formTeacher: {
          teacherName: "",
          loginName: "",
          sex: 1,
          roleList: [],
        },
        rulesTeacher: {
          teacherName: [
b0cd2598   梁保满   fix:测试问题
329
            { required: true, message: "请输入教师姓名", trigger: "blur" },
bb4c8454   阿宝   添加,修改教师
330
331
          ],
          loginName: [
b0cd2598   梁保满   fix:测试问题
332
            { required: true, message: "请输入联系电话", trigger: "blur" },
bb4c8454   阿宝   添加,修改教师
333
334
335
          ],
          sex: [{ required: true, message: "请选择性别", trigger: "blur" }],
          roleList: [
ef16e57e   LH_PC   fix:前端版本迭代
336
            { required: false, message: "请选择角色信息", trigger: "blur" },
bb4c8454   阿宝   添加,修改教师
337
          ],
dd5150c5   阿宝   数据同步
338
        },
29319cfb   梁保满   设备。教师管理
339
340
341
342
  
        AllTeacher: false,
        indeterminate: false,
        clearTeacher: [],
b0cd2598   梁保满   fix:测试问题
343
        removeLoading: false,
23a6dc5f   阿宝   学校管理相关接口简单对接
344
345
      };
    },
29319cfb   梁保满   设备。教师管理
346
347
    computed: {
      showDel: function () {
b0cd2598   梁保满   fix:测试问题
348
349
350
351
        return !this.query.gradeClassSub.some((item) => {
          return item.length > 1;
        });
      },
29319cfb   梁保满   设备。教师管理
352
    },
23a6dc5f   阿宝   学校管理相关接口简单对接
353
    async created() {
7812e986   梁保满   班主任查看报表添加额外信息
354
      this.code = this.$store.getters.csCode;
b8827a72   梁保满   测试bug
355
      this._QueryData(4);
696f2d42   梁保满   fix:报表导出问题
356
357
      await this._QueryDataGrade(1); //筛选用
      await this._QueryDataGrade(2); //配置角色用
4623f67f   梁保满   隋唐问以及教师学生设置
358
      // this._RoleList();
23a6dc5f   阿宝   学校管理相关接口简单对接
359
360
    },
    methods: {
8ad80958   梁保满   教师学生管理,设备状态
361
      async changeType() {
b0cd2598   梁保满   fix:测试问题
362
        this.query.gradeClassSub = [];
696f2d42   梁保满   fix:报表导出问题
363
        // this.query.type = 0;
b0cd2598   梁保满   fix:测试问题
364
365
        this.query.teacherName = "";
        this.query.phone = "";
a736cb8b   梁保满   fix:教师管理班级权限问题,删除...
366
367
368
369
370
        // if (this.query.classType === 0) {
        //   this.teacherRoleList = [...this.RoleList];
        // } else {
        //   this.teacherRoleList = this.RoleList.slice(1, 3);
        // }
4d5235d7   梁保满   学生,教师修改,顶部返回备题组卷记...
371
  
8ad80958   梁保满   教师学生管理,设备状态
372
        this._QueryData(6);
696f2d42   梁保满   fix:报表导出问题
373
        await this._QueryDataGrade(1);
8ad80958   梁保满   教师学生管理,设备状态
374
      },
29319cfb   梁保满   设备。教师管理
375
376
377
378
      //选择删除
      handleCheckAllChange(val) {
        this.clearTeacher = val
          ? this.teacherList.map((item) => {
f45b3c05   LH_PC   云平台新UI界面
379
380
            return item.id;
          })
29319cfb   梁保满   设备。教师管理
381
382
383
384
385
386
387
388
389
          : [];
        this.indeterminate = false;
      },
      handleCheckedChange(value) {
        let checkedCount = value.length;
        this.checkAll = checkedCount === this.teacherList.length;
        this.indeterminate =
          checkedCount > 0 && checkedCount < this.teacherList.length;
      },
4623f67f   梁保满   隋唐问以及教师学生设置
390
      //清除教师绑定班级信息
29319cfb   梁保满   设备。教师管理
391
      async remove() {
8ad80958   梁保满   教师学生管理,设备状态
392
        if (!this.clearTeacher.length) {
b0cd2598   梁保满   fix:测试问题
393
394
          this.$message.warning("请选择要格式化的老师");
          return;
29319cfb   梁保满   设备。教师管理
395
        }
b0cd2598   梁保满   fix:测试问题
396
397
398
        this.removeLoading = true;
        let grades = [];
        this.query.gradeClassSub.map((item) => {
29319cfb   梁保满   设备。教师管理
399
400
401
402
403
          if (item.length == 1) {
            if (!grades.includes(item[0])) {
              grades.push(item[0]);
            }
          }
b0cd2598   梁保满   fix:测试问题
404
        });
8ad80958   梁保满   教师学生管理,设备状态
405
        const { data, status, info } = await this.$request.clearTeacherClasses({
29319cfb   梁保满   设备。教师管理
406
407
          ids: this.clearTeacher,
          type: this.query.classType,
b0cd2598   梁保满   fix:测试问题
408
          grades: grades,
29319cfb   梁保满   设备。教师管理
409
        });
b0cd2598   梁保满   fix:测试问题
410
        this.removeLoading = false;
29319cfb   梁保满   设备。教师管理
411
412
413
414
415
416
417
418
419
        if (status === 0) {
          this.$message.success(info);
          this._QueryData();
        } else {
          this.$message.error(info);
        }
      },
      //end
  
ec6394d1   梁保满   v1.3.1。细节调整
420
421
422
      gradeName(type) {
        return setGradeName(type);
      },
4623f67f   梁保满   隋唐问以及教师学生设置
423
      //导入成功
757a21e3   梁保满   上传成功提示成功数量
424
      upSuccess(res) {
757a21e3   梁保满   上传成功提示成功数量
425
426
427
428
429
        this.$message.closeAll();
        this.$message({
          showClose: true,
          message: `成功(${res.data.success})`,
          type: "success",
54857fa3   梁保满   下载模板跨域,集团管理员选择角色范...
430
          duration: 5000,
757a21e3   梁保满   上传成功提示成功数量
431
        });
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
432
        this.diaUp = false;
3b9f2ddb   梁保满   学生。教师筛选参数
433
        this._QueryData(5);
255e2506   梁保满   飞书bug及优化
434
      },
4623f67f   梁保满   隋唐问以及教师学生设置
435
      //添加教师角色
bb4c8454   阿宝   添加,修改教师
436
      addRoleList() {
bb4c8454   阿宝   添加,修改教师
437
438
439
440
        this.formTeacher.roleList.push({
          id: randomWord(true, 16, 20),
          roleId: "",
          classId: [],
f45b3c05   LH_PC   云平台新UI界面
441
          gradeId: "",
bb4c8454   阿宝   添加,修改教师
442
443
        });
      },
4623f67f   梁保满   隋唐问以及教师学生设置
444
      //删除教师角色
bb4c8454   阿宝   添加,修改教师
445
      removeRoleList(index) {
bb4c8454   阿宝   添加,修改教师
446
447
        this.formTeacher.roleList.splice(index, 1);
      },
4623f67f   梁保满   隋唐问以及教师学生设置
448
      //添加教师弹窗
bb4c8454   阿宝   添加,修改教师
449
      addTeacherDia() {
bb4c8454   阿宝   添加,修改教师
450
451
452
453
454
        this.isAdd = true;
        this.formTeacher = {
          teacherName: "",
          loginName: "",
          sex: 1,
9309dc5d   梁保满   任课老师接口完成
455
          roleList: [],
bb4c8454   阿宝   添加,修改教师
456
457
458
        };
        this.diaTeacher = true;
      },
4623f67f   梁保满   隋唐问以及教师学生设置
459
      //教师角色数量
23a6dc5f   阿宝   学校管理相关接口简单对接
460
      setClass(obj) {
23a6dc5f   阿宝   学校管理相关接口简单对接
461
462
463
464
465
466
        return (
          obj.managerList?.length +
          obj.teacherCourseList?.length +
          obj.teacherGradeList?.length
        );
      },
dba7b13a   梁保满   添加账号模式,修改教师角色显示问题
467
468
469
470
471
472
473
474
475
      getClassName(id) {
        let name;
        this.classList.map((item) => {
          if (item.value == id) {
            name = item.label;
          }
        });
        return name;
      },
4623f67f   梁保满   隋唐问以及教师学生设置
476
      //教师详细数据
23a6dc5f   阿宝   学校管理相关接口简单对接
477
      showTeacher(obj) {
23a6dc5f   阿宝   学校管理相关接口简单对接
478
479
480
        this.showTId = obj.id;
        this.teacherDetail = { ...obj };
      },
0a4de034   阿宝   教师管理,学生管理班级设置
481
      editTeacher(type) {
a37317f4   阿宝   使用分析,发卡记录
482
        this.diaTeacher = true;
e5ff81a1   阿宝   集团管理员接口
483
        this.setTercherType = type;
bb4c8454   阿宝   添加,修改教师
484
485
486
487
488
489
490
491
492
        this.isAdd = false;
        for (let key in this.teacherDetail) {
          if (key == "realName") {
            this.formTeacher.teacherName = this.teacherDetail.realName;
          } else {
            this.formTeacher[key] = this.teacherDetail[key];
          }
        }
        this.toTeacherForm();
bb4c8454   阿宝   添加,修改教师
493
      },
4623f67f   梁保满   隋唐问以及教师学生设置
494
      //添加教师
bb4c8454   阿宝   添加,修改教师
495
      addTeacher() {
ce278878   梁保满   2-2 bugfix
496
        if (this.setTercherType == 1) {
b0cd2598   梁保满   fix:测试问题
497
          delete this.rulesTeacher.roleList;
ce278878   梁保满   2-2 bugfix
498
499
500
        } else {
          this.rulesTeacher.roleList = [
            { required: true, message: "请选择角色信息", trigger: "blur" },
b0cd2598   梁保满   fix:测试问题
501
          ];
ce278878   梁保满   2-2 bugfix
502
        }
bb4c8454   阿宝   添加,修改教师
503
504
505
506
507
508
509
510
511
512
513
514
515
        this.$refs.formTeacher.validate(async (valid) => {
          if (valid) {
            let obj = this.setTeacharForm();
            if (!obj) {
              this.$message.error("教师角色数据有误请检查!");
              return;
            }
            let res;
            if (this.isAdd) {
              res = await this.$request.addTeacher({
                teacherName: this.formTeacher.teacherName,
                loginName: this.formTeacher.loginName,
                sex: this.formTeacher.sex,
8ad80958   梁保满   教师学生管理,设备状态
516
                type: this.query.classType,
bb4c8454   阿宝   添加,修改教师
517
518
519
                ...obj,
              });
            } else {
bb4c8454   阿宝   添加,修改教师
520
521
522
523
524
              res = await this.$request.updateTeacher({
                teacherId: this.formTeacher.id,
                teacherName: this.formTeacher.teacherName,
                loginName: this.formTeacher.loginName,
                sex: this.formTeacher.sex,
8ad80958   梁保满   教师学生管理,设备状态
525
                type: this.query.classType,
bb4c8454   阿宝   添加,修改教师
526
527
528
529
530
531
                ...obj,
              });
            }
            if (res.status === 0) {
              this.$message.success(res.info);
              this.diaTeacher = false;
ce278878   梁保满   2-2 bugfix
532
              this._QueryData(10);
bb4c8454   阿宝   添加,修改教师
533
534
535
536
            } else {
              this.$message.error(res.info);
            }
          } else {
e5ff81a1   阿宝   集团管理员接口
537
            this.$message.warning("输入有误请检查!");
bb4c8454   阿宝   添加,修改教师
538
539
540
541
            return false;
          }
        });
      },
4623f67f   梁保满   隋唐问以及教师学生设置
542
      //转换保存教师数据格式
bb4c8454   阿宝   添加,修改教师
543
      setTeacharForm() {
f45b3c05   LH_PC   云平台新UI界面
544
        let ERR_OK = this.formTeacher.roleList.length > 0;
bb4c8454   阿宝   添加,修改教师
545
546
        if (ERR_OK) {
          let [managerList, teacherCourseList, gradeGroupList] = [[], [], []];
ef16e57e   LH_PC   fix:前端版本迭代
547
          console.log(this.formTeacher.roleList)
bb4c8454   阿宝   添加,修改教师
548
549
550
551
          this.formTeacher.roleList.map((item) => {
            if (item.roleId == 6) {
              managerList.push({
                classId: item.classId[1],
ef16e57e   LH_PC   fix:前端版本迭代
552
                className: this.classList.find((items) => items.value == item.classId[1])?.label || "",
bb4c8454   阿宝   添加,修改教师
553
554
              });
            } else if (item.roleId == 7) {
55eb13fd   梁保满   中天提出的交互优化
555
556
557
              item.classId.map((clazz) => {
                teacherCourseList.push({
                  classId: clazz[2],
ef16e57e   LH_PC   fix:前端版本迭代
558
                  className: this.classList.find((items) => items.value == clazz[2])?.label || "",
55eb13fd   梁保满   中天提出的交互优化
559
560
                  subjectName: clazz[1],
                });
bb4c8454   阿宝   添加,修改教师
561
              });
bb4c8454   阿宝   添加,修改教师
562
            }
f45b3c05   LH_PC   云平台新UI界面
563
564
565
            else if (item.roleId == 3) {
              gradeGroupList.push({
                grade: item.gradeId
ef16e57e   LH_PC   fix:前端版本迭代
566
              })
f45b3c05   LH_PC   云平台新UI界面
567
            }
bb4c8454   阿宝   添加,修改教师
568
569
570
571
572
573
574
          });
          return {
            managerList,
            teacherCourseList,
            gradeGroupList,
          };
        } else {
ef16e57e   LH_PC   fix:前端版本迭代
575
576
577
          if (this.setTercherType == 2)
            return false;
          return true;
bb4c8454   阿宝   添加,修改教师
578
579
        }
      },
4623f67f   梁保满   隋唐问以及教师学生设置
580
      //教师角色数据转换为form格式数据
bb4c8454   阿宝   添加,修改教师
581
      toTeacherForm() {
bb4c8454   阿宝   添加,修改教师
582
        this.formTeacher.roleList = [];
ef16e57e   LH_PC   fix:前端版本迭代
583
        //班主任 
bb4c8454   阿宝   添加,修改教师
584
        this.formTeacher.managerList?.map((item) => {
bb4c8454   阿宝   添加,修改教师
585
586
587
          this.formTeacher.roleList.push({
            id: randomWord(true, 16, 20),
            roleId: 6,
ef16e57e   LH_PC   fix:前端版本迭代
588
            classId: [item.grade, item.classId],
bb4c8454   阿宝   添加,修改教师
589
590
          });
        });
ef16e57e   LH_PC   fix:前端版本迭代
591
        //任课老师
55eb13fd   梁保满   中天提出的交互优化
592
        let teacherClassId = [];
bb4c8454   阿宝   添加,修改教师
593
        this.formTeacher.teacherCourseList?.map((item) => {
55eb13fd   梁保满   中天提出的交互优化
594
595
596
          teacherClassId.push([
            item.grade,
            item.subjectName,
ef16e57e   LH_PC   fix:前端版本迭代
597
            this.classList.find((items) => items.value == item.classId).value,
55eb13fd   梁保满   中天提出的交互优化
598
599
600
          ]);
        });
        if (teacherClassId.length) {
bb4c8454   阿宝   添加,修改教师
601
602
603
          this.formTeacher.roleList.push({
            id: randomWord(true, 16, 20),
            roleId: 7,
55eb13fd   梁保满   中天提出的交互优化
604
            classId: [...teacherClassId],
bb4c8454   阿宝   添加,修改教师
605
          });
55eb13fd   梁保满   中天提出的交互优化
606
        }
ef16e57e   LH_PC   fix:前端版本迭代
607
608
609
610
611
612
613
614
615
        //年级组长
        this.formTeacher.teacherGradeList?.map((item) => {
          this.formTeacher.roleList.push({
            id: randomWord(true, 16, 20),
            roleId: 3,
            gradeId: item.grade
          });
        });
        console.log(this.formTeacher)
bb4c8454   阿宝   添加,修改教师
616
      },
4623f67f   梁保满   隋唐问以及教师学生设置
617
      //删除教师角色
b21d90ef   梁保满   长水登录
618
619
620
      async delTeacherManager(obj, type) {
        let query;
        switch (type) {
ef16e57e   LH_PC   fix:前端版本迭代
621
622
623
624
625
          case 0:
            query = {
              garde: obj.grade,
            };
            break;
b21d90ef   梁保满   长水登录
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
          case 1:
            query = {
              classId: obj.classId,
            };
            break;
          case 2:
            query = {
              classId: obj.classId,
              subjectName: obj.subjectName,
            };
            break;
          case 3:
            query = {
              classId: obj.classId,
              grade: obj.grade,
              subjectName: obj.subjectName,
            };
            break;
        }
        //角色
        const { data, status, info } = await this.$request.delTeacherManager({
          teacherId: obj.teacherId,
4623f67f   梁保满   隋唐问以及教师学生设置
648
          type: this.query.classType,
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
649
          ...query,
b21d90ef   梁保满   长水登录
650
651
        });
        if (status === 0) {
ce278878   梁保满   2-2 bugfix
652
          this._QueryData(10);
bb4c8454   阿宝   添加,修改教师
653
654
655
656
        } else {
          this.$message.error(info);
        }
      },
4623f67f   梁保满   隋唐问以及教师学生设置
657
658
659
660
661
662
663
664
665
      //角色列表
      // async _RoleList() {
      //   const { data, status, info } = await this.$request.roleList();
      //   if (status === 0) {
      //     this.roleList = data.list || [];
      //   } else {
      //     this.$message.error(info);
      //   }
      // },
53424e83   梁保满   教师管理筛选条件
666
      setQuery(type) {
23a6dc5f   阿宝   学校管理相关接口简单对接
667
        let query = {};
b8827a72   梁保满   测试bug
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
        if (type == 1) {
          query.grades = [];
          query.classIds = [];
          query.subjectNames = [];
          this.query.gradeClassSub?.map((item) => {
            if (item.length == 1) {
              if (!query.grades.includes(item[0])) {
                query.grades.push(item[0]);
              }
            } else if (item.length == 2) {
              if (!query.classIds.includes(item[1])) {
                query.classIds.push(item[1]);
              }
              query.grades.includes(item[0]) && query.grades.remove(item[0]);
            } else if (item.length == 3) {
              if (!query.subjectNames.includes(item[2])) {
                query.subjectNames.push(item[2]);
              }
              query.grades.includes(item[0]) && query.grades.remove(item[0]);
              query.classIds.includes(item[0]) && query.classIds.remove(item[0]);
            }
          });
  
          delete query.gradeClassSub;
          query.grades.length ? "" : delete query.grades;
          query.classIds.length ? "" : delete query.classIds;
          query.subjectNames.length ? "" : delete query.subjectNames;
          this.query.teacherName = "";
          this.query.phone = "";
3b9f2ddb   梁保满   学生。教师筛选参数
697
          this.query.type = 0;
5cfb0264   梁保满   班级管理交互优化
698
        } else if (type == 2) {
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
699
          this.query.classType = "";
3b9f2ddb   梁保满   学生。教师筛选参数
700
          this.query.type = 9;
23a6dc5f   阿宝   学校管理相关接口简单对接
701
          this.query.phone = "";
53424e83   梁保满   教师管理筛选条件
702
          this.query.gradeClassSub = [];
3b9f2ddb   梁保满   学生。教师筛选参数
703
704
          query.teacherName = this.query.teacherName;
          query.type = this.query.type;
23a6dc5f   阿宝   学校管理相关接口简单对接
705
        } else if (type == 3) {
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
706
          this.query.classType = "";
3b9f2ddb   梁保满   学生。教师筛选参数
707
          this.query.type = 9;
23a6dc5f   阿宝   学校管理相关接口简单对接
708
          this.query.teacherName = "";
53424e83   梁保满   教师管理筛选条件
709
          this.query.gradeClassSub = [];
3b9f2ddb   梁保满   学生。教师筛选参数
710
711
          query.phone = this.query.phone;
          query.type = this.query.type;
b8827a72   梁保满   测试bug
712
        } else if (type == 4) {
b8827a72   梁保满   测试bug
713
714
715
716
          this.query.teacherName = "";
          this.query.phone = "";
          this.query.gradeClassSub = [];
          query.type = this.query.type;
ef16e57e   LH_PC   fix:前端版本迭代
717
718
        }
        else {
53424e83   梁保满   教师管理筛选条件
719
          query = { ...this.query };
d059a9d1   梁保满   接口调整
720
          query.grades = [];
53424e83   梁保满   教师管理筛选条件
721
722
723
724
          query.classIds = [];
          query.subjectNames = [];
          this.query.gradeClassSub?.map((item) => {
            if (item.length == 1) {
d059a9d1   梁保满   接口调整
725
726
              if (!query.grades.includes(item[0])) {
                query.grades.push(item[0]);
53424e83   梁保满   教师管理筛选条件
727
728
729
730
731
              }
            } else if (item.length == 2) {
              if (!query.classIds.includes(item[1])) {
                query.classIds.push(item[1]);
              }
b8827a72   梁保满   测试bug
732
              query.grades.includes(item[0]) && query.grades.remove(item[0]);
53424e83   梁保满   教师管理筛选条件
733
734
735
736
            } else if (item.length == 3) {
              if (!query.subjectNames.includes(item[2])) {
                query.subjectNames.push(item[2]);
              }
b8827a72   梁保满   测试bug
737
              query.grades.includes(item[0]) && query.grades.remove(item[0]);
53424e83   梁保满   教师管理筛选条件
738
739
740
741
742
              query.classIds.includes(item[0]) && query.classIds.remove(item[0]);
            }
          });
  
          delete query.gradeClassSub;
d059a9d1   梁保满   接口调整
743
          query.grades.length ? "" : delete query.grades;
53424e83   梁保满   教师管理筛选条件
744
745
746
747
          query.classIds.length ? "" : delete query.classIds;
          query.subjectNames.length ? "" : delete query.subjectNames;
          query.teacherName.length ? "" : delete query.teacherName;
          query.phone.length ? "" : delete query.phone;
ec6394d1   梁保满   v1.3.1。细节调整
748
        }
b0cd2598   梁保满   fix:测试问题
749
        query.classType = this.query.classType;
53424e83   梁保满   教师管理筛选条件
750
751
752
753
        return query;
      },
      async _QueryData(type) {
        if (this.loading) return;
5cfb0264   梁保满   班级管理交互优化
754
755
756
757
758
759
760
761
762
763
764
        if (type == 2) {
          if (this.query.teacherName == "") {
            this.$message.warning("请输入老师姓名");
            return;
          }
        } else if (type == 3) {
          if (this.query.phone == "") {
            this.$message.warning("请输入老师手机");
            return;
          }
        }
23a6dc5f   阿宝   学校管理相关接口简单对接
765
        this.loading = true;
b8827a72   梁保满   测试bug
766
        let query = this.setQuery(type);
0a4de034   阿宝   教师管理,学生管理班级设置
767
        this.teacherList = [];
b0cd2598   梁保满   fix:测试问题
768
        this.clearTeacher = [];
23a6dc5f   阿宝   学校管理相关接口简单对接
769
770
771
772
        const { data, status, info } = await this.$request.teacherList({
          ...query,
        });
        this.loading = false;
0f3dca29   梁保满   教师格式化确认,报表列表添加去筛选按钮
773
  
23a6dc5f   阿宝   学校管理相关接口简单对接
774
775
        if (status === 0) {
          this.teacherList = data.list || [];
bb4c8454   阿宝   添加,修改教师
776
777
778
779
780
781
782
783
784
785
          if (type == 10) {
            let detailArr =
              data.list.filter((item) => item.id == this.formTeacher.id) || [];
            this.teacherDetail = (detailArr.length && detailArr[0]) || {
              ...data.list[0],
            };
          } else {
            this.teacherDetail = { ...this.teacherList[0] };
          }
          this.showTId = this.teacherDetail.id;
23a6dc5f   阿宝   学校管理相关接口简单对接
786
787
788
789
        } else {
          this.$message.error(info);
        }
      },
696f2d42   梁保满   fix:报表导出问题
790
791
792
793
      async _QueryDataGrade(type) {
        let query = {};
        if (type == 1) {
          query.type = this.query.classType;
a736cb8b   梁保满   fix:教师管理班级权限问题,删除...
794
795
        } else if (type == 3) {
          query.type = 0;
696f2d42   梁保满   fix:报表导出问题
796
        }
bb4c8454   阿宝   添加,修改教师
797
        //年级数据
8ad80958   梁保满   教师学生管理,设备状态
798
        const { data, status, info } = await this.$request.gradeList({
696f2d42   梁保满   fix:报表导出问题
799
          ...query,
8ad80958   梁保满   教师学生管理,设备状态
800
        });
23a6dc5f   阿宝   学校管理相关接口简单对接
801
        if (status === 0) {
a736cb8b   梁保满   fix:教师管理班级权限问题,删除...
802
803
804
805
806
807
          if (type == 1) {
            this.gradeClassSubList = [];
            if (this.query.classType == 0) {
              this.gradeClassList = [];
            }
          }
23a6dc5f   阿宝   学校管理相关接口简单对接
808
809
          this.gradeList =
            data.list?.map((item) => {
53424e83   梁保满   教师管理筛选条件
810
811
812
813
814
815
              let subList = item.subjectNames?.map((items) => {
                return {
                  value: items,
                  label: items,
                };
              });
696f2d42   梁保满   fix:报表导出问题
816
              if (type == 2) {
696f2d42   梁保满   fix:报表导出问题
817
818
                //学校-科目-班级
                this.gradeSubListClass.push({
b0cd2598   梁保满   fix:测试问题
819
820
821
                  value: item.grade,
                  label: item.gradeName,
                  id: item.grade,
696f2d42   梁保满   fix:报表导出问题
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
                  children: item.subjectNames.map((items) => {
                    let child = [];
                    item.classList.map((clazz) => {
                      if (clazz.subjectName) {
                        if (items == clazz.subjectName) {
                          child.push({
                            value: clazz.id,
                            label: clazz.className,
                          });
                        }
                      } else {
                        child.push({
                          value: clazz.id,
                          label: clazz.className,
                        });
                      }
                    });
b0cd2598   梁保满   fix:测试问题
839
                    return {
696f2d42   梁保满   fix:报表导出问题
840
841
842
                      value: items,
                      label: items,
                      children: child,
b0cd2598   梁保满   fix:测试问题
843
844
845
                    };
                  }),
                });
a736cb8b   梁保满   fix:教师管理班级权限问题,删除...
846
              } else if (type == 1) {
696f2d42   梁保满   fix:报表导出问题
847
                if (this.query.classType == 0) {
a736cb8b   梁保满   fix:教师管理班级权限问题,删除...
848
849
850
851
852
853
854
855
856
857
858
859
860
                  // 学校-年级
                  this.gradeClassList.push({
                    value: item.grade,
                    label: item.gradeName,
                    id: item.grade,
                    children: item.classList.map((clazz) => {
                      return {
                        value: clazz.id,
                        label: clazz.className,
                        id: clazz.id,
                      };
                    }),
                  });
696f2d42   梁保满   fix:报表导出问题
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
                  //学校-年级-科目
                  this.gradeClassSubList.push({
                    value: item.grade,
                    label: item.gradeName,
                    id: item.grade,
                    children: item.classList.map((clazz) => {
                      return {
                        value: clazz.id,
                        label: clazz.className,
                        id: clazz.id,
                        children: [...subList],
                      };
                    }),
                  });
                } else {
                  //学校-年级-科目
                  this.gradeClassSubList.push({
                    value: item.grade,
                    label: item.gradeName,
                    id: item.grade,
                    children: item.classList.map((clazz) => {
                      return {
                        value: clazz.id,
                        label: clazz.className,
                        id: clazz.id,
                        children: [
                          {
                            value: clazz.subjectName,
                            label: clazz.subjectName,
                          },
                        ],
                      };
                    }),
                  });
                }
b0cd2598   梁保满   fix:测试问题
896
897
              }
  
8ad80958   梁保满   教师学生管理,设备状态
898
899
900
901
902
903
904
              let classList = item.classList.map((clazz) => {
                return {
                  value: clazz.id,
                  label: `${clazz.className}(${item.gradeName})`,
                  grade: item.grade,
                  gradeName: item.gradeName,
                };
b0cd2598   梁保满   fix:测试问题
905
906
              });
              this.classList = this.classList.concat(classList);
53424e83   梁保满   教师管理筛选条件
907
              return {
d059a9d1   梁保满   接口调整
908
                value: item.grade,
53424e83   梁保满   教师管理筛选条件
909
910
911
                label: item.gradeName,
                id: item.grade,
                children: [...subList],
23a6dc5f   阿宝   学校管理相关接口简单对接
912
913
              };
            }) || [];
23a6dc5f   阿宝   学校管理相关接口简单对接
914
915
916
917
        } else {
          this.$message.error(info);
        }
      },
23a6dc5f   阿宝   学校管理相关接口简单对接
918
      async downExcel() {
a3fcda80   梁保满   教师模版下载调整
919
        let data = await this.$request.teacherTemplate();
f20c48c9   梁保满   集团管理员添加发卡记录,并添加报表导出
920
921
922
923
924
        if (data && !data.code) {
          let blob = new Blob([data], {
            type: "application/vnd.ms-excel;charset=utf-8",
          });
          downloadFile(`教师名单模版.xlsx`, blob);
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
925
        } else {
f20c48c9   梁保满   集团管理员添加发卡记录,并添加报表导出
926
          this.$message.error(data.info);
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
927
928
929
930
931
932
933
        }
      },
      async exportTeacherExl() {
        this.loadingDown = true;
        let data = await this.$request.exportTeacher();
        this.loadingDown = false;
        if (data) {
23a6dc5f   阿宝   学校管理相关接口简单对接
934
935
936
          let blob = new Blob([data], {
            type: "application/vnd.ms-excel;charset=utf-8",
          });
236b1f0e   梁保满   周末-飞书bug
937
          downloadFile(`教师名单.xlsx`, blob);
23a6dc5f   阿宝   学校管理相关接口简单对接
938
        } else {
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
939
          this.$message.error("下载失败");
23a6dc5f   阿宝   学校管理相关接口简单对接
940
941
942
943
944
        }
      },
    },
  };
  </script>
4c4f7640   梁保满   路由表,路由前端文件
945
  
23a6dc5f   阿宝   学校管理相关接口简单对接
946
947
948
  <style lang="scss" scoped>
  .page-content {
    padding: 0 20px 20px;
4c4f7640   梁保满   路由表,路由前端文件
949
  }
29319cfb   梁保满   设备。教师管理
950
  
99713685   梁保满   学生调班,班级数据重新请求,使用过...
951
952
953
954
955
  .total {
    padding: 0 20px 10px;
    font-size: 14px;
    color: #666;
  }
29319cfb   梁保满   设备。教师管理
956
  
23a6dc5f   阿宝   学校管理相关接口简单对接
957
958
959
960
961
962
  .teacher-box {
    display: flex;
    background: #f8f8f8;
    border-radius: 10px;
    overflow: hidden;
    min-height: 400px;
29319cfb   梁保满   设备。教师管理
963
  
23a6dc5f   阿宝   学校管理相关接口简单对接
964
    .teacher-ul {
b21d90ef   梁保满   长水登录
965
      max-height: 60vh;
29319cfb   梁保满   设备。教师管理
966
967
      overflow-y: auto;
  
f20c48c9   梁保满   集团管理员添加发卡记录,并添加报表导出
968
969
970
      &::-webkit-scrollbar {
        width: 6px;
      }
29319cfb   梁保满   设备。教师管理
971
  
f20c48c9   梁保满   集团管理员添加发卡记录,并添加报表导出
972
973
974
975
      &::-webkit-scrollbar-thumb {
        border-radius: 10px;
        background-color: #ccc;
      }
23a6dc5f   阿宝   学校管理相关接口简单对接
976
    }
29319cfb   梁保满   设备。教师管理
977
  
23a6dc5f   阿宝   学校管理相关接口简单对接
978
    .teacher-list {
ef16e57e   LH_PC   fix:前端版本迭代
979
  
23a6dc5f   阿宝   学校管理相关接口简单对接
980
      width: 240px;
4c4f7640   梁保满   路由表,路由前端文件
981
  
23a6dc5f   阿宝   学校管理相关接口简单对接
982
983
984
985
      .h-title {
        height: 40px;
        line-height: 40px;
        background: #eee;
29319cfb   梁保满   设备。教师管理
986
987
988
989
990
991
992
993
994
995
996
997
        display: flex;
        justify-content: space-between;
        align-items: center;
  
        .txt {
          flex: 1;
        }
  
        .clear {
          width: 18px;
          margin-right: 10px;
          cursor: pointer;
b0cd2598   梁保满   fix:测试问题
998
          transition: all 0.3s;
29319cfb   梁保满   设备。教师管理
999
1000
1001
1002
1003
  
          &:hover {
            transform: scale(1.1);
          }
        }
23a6dc5f   阿宝   学校管理相关接口简单对接
1004
      }
29319cfb   梁保满   设备。教师管理
1005
  
23a6dc5f   阿宝   学校管理相关接口简单对接
1006
1007
1008
1009
      .teacher-item {
        font-size: 16px;
        color: #7f7f7f;
        line-height: 36px;
23a6dc5f   阿宝   学校管理相关接口简单对接
1010
        padding-left: 12px;
29319cfb   梁保满   设备。教师管理
1011
1012
        display: flex;
  
0586b4d7   梁保满   接口地址列表处理
1013
1014
        .name {
          cursor: pointer;
f45b3c05   LH_PC   云平台新UI界面
1015
  
0586b4d7   梁保满   接口地址列表处理
1016
1017
1018
          &:hover {
            color: #667ffd;
          }
f45b3c05   LH_PC   云平台新UI界面
1019
  
0586b4d7   梁保满   接口地址列表处理
1020
1021
1022
1023
          &.active {
            color: #667ffd;
            background: #eee;
          }
23a6dc5f   阿宝   学校管理相关接口简单对接
1024
1025
1026
        }
      }
    }
4c4f7640   梁保满   路由表,路由前端文件
1027
  
23a6dc5f   阿宝   学校管理相关接口简单对接
1028
1029
1030
    .teacher-detail {
      flex: 1;
      position: relative;
f20c48c9   梁保满   集团管理员添加发卡记录,并添加报表导出
1031
      padding-left: 10px;
29319cfb   梁保满   设备。教师管理
1032
  
23a6dc5f   阿宝   学校管理相关接口简单对接
1033
1034
1035
1036
      .icon-box {
        position: absolute;
        top: 12px;
        right: 20px;
29319cfb   梁保满   设备。教师管理
1037
  
23a6dc5f   阿宝   学校管理相关接口简单对接
1038
1039
1040
1041
1042
        .icon {
          font-size: 24px;
          color: #7f7f7f;
          cursor: pointer;
        }
29319cfb   梁保满   设备。教师管理
1043
  
23a6dc5f   阿宝   学校管理相关接口简单对接
1044
1045
1046
1047
        .el-icon-circle-plus-outline {
          margin-left: 10px;
        }
      }
29319cfb   梁保满   设备。教师管理
1048
  
23a6dc5f   阿宝   学校管理相关接口简单对接
1049
1050
1051
1052
1053
1054
1055
      .detail-top {
        padding: 12px 20px;
        box-sizing: border-box;
        display: flex;
        flex-wrap: wrap;
        font-size: 14px;
        color: #7f7f7f;
29319cfb   梁保满   设备。教师管理
1056
  
23a6dc5f   阿宝   学校管理相关接口简单对接
1057
1058
1059
1060
1061
        .p-item {
          width: 40%;
          line-height: 28px;
        }
      }
29319cfb   梁保满   设备。教师管理
1062
  
23a6dc5f   阿宝   学校管理相关接口简单对接
1063
1064
1065
1066
1067
      .grade-box {
        .grade-info {
          display: flex;
          flex-wrap: wrap;
          padding: 20px 20px 0;
29319cfb   梁保满   设备。教师管理
1068
  
f45b3c05   LH_PC   云平台新UI界面
1069
          &>li {
23a6dc5f   阿宝   学校管理相关接口简单对接
1070
1071
1072
            margin-right: 20px;
            margin-bottom: 20px;
            position: relative;
29319cfb   梁保满   设备。教师管理
1073
  
23a6dc5f   阿宝   学校管理相关接口简单对接
1074
1075
1076
1077
1078
1079
1080
            .el-icon-delete {
              position: absolute;
              top: 8px;
              right: 8px;
              padding: 2px;
              cursor: pointer;
              display: none;
29319cfb   梁保满   设备。教师管理
1081
  
23a6dc5f   阿宝   学校管理相关接口简单对接
1082
1083
1084
1085
              &:hover {
                color: #667ffd;
              }
            }
29319cfb   梁保满   设备。教师管理
1086
  
23a6dc5f   阿宝   学校管理相关接口简单对接
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
            &:hover {
              .el-icon-delete {
                display: block;
              }
            }
          }
  
          .grade-item {
            width: 200px;
            box-sizing: border-box;
            padding: 12px 16px;
            border-radius: 10px;
            box-shadow: 1px 1px 3px #888;
          }
29319cfb   梁保满   设备。教师管理
1101
  
23a6dc5f   阿宝   学校管理相关接口简单对接
1102
1103
1104
1105
1106
          .grade-name {
            font-size: 16px;
            font-weight: bold;
            line-height: 18px;
            padding-bottom: 12px;
ef16e57e   LH_PC   fix:前端版本迭代
1107
            padding-right: 5px;
23a6dc5f   阿宝   学校管理相关接口简单对接
1108
          }
29319cfb   梁保满   设备。教师管理
1109
  
23a6dc5f   阿宝   学校管理相关接口简单对接
1110
1111
1112
1113
1114
          .grade-class {
            display: flex;
            justify-content: space-between;
            font-size: 15px;
            padding-right: 20px;
29319cfb   梁保满   设备。教师管理
1115
  
23a6dc5f   阿宝   学校管理相关接口简单对接
1116
1117
1118
1119
1120
            .fa {
              font-size: 18px;
              margin-right: 5px;
              color: #a4a4a4;
            }
29319cfb   梁保满   设备。教师管理
1121
  
23a6dc5f   阿宝   学校管理相关接口简单对接
1122
1123
1124
1125
1126
1127
1128
1129
            .fa-book {
              font-size: 20px;
            }
          }
        }
      }
    }
  }
29319cfb   梁保满   设备。教师管理
1130
  
bb4c8454   阿宝   添加,修改教师
1131
1132
1133
  .add-box {
    margin-top: 10px;
  }
29319cfb   梁保满   设备。教师管理
1134
  
bb4c8454   阿宝   添加,修改教师
1135
1136
1137
1138
  .sel-c {
    width: 120px;
    margin-right: 12px;
  }
29319cfb   梁保满   设备。教师管理
1139
  
ef16e57e   LH_PC   fix:前端版本迭代
1140
1141
1142
1143
  .role-list-main {
    float: left;
  }
  
bb4c8454   阿宝   添加,修改教师
1144
1145
  .role-list {
    margin-bottom: 10px;
dba7b13a   梁保满   添加账号模式,修改教师角色显示问题
1146
    position: relative;
29319cfb   梁保满   设备。教师管理
1147
  
ef16e57e   LH_PC   fix:前端版本迭代
1148
  
dba7b13a   梁保满   添加账号模式,修改教师角色显示问题
1149
1150
1151
1152
1153
1154
1155
    .sel-p {
      position: absolute;
      left: 146px;
      top: 0;
      font-size: 13px;
      color: #606266;
    }
29319cfb   梁保满   设备。教师管理
1156
  
dba7b13a   梁保满   添加账号模式,修改教师角色显示问题
1157
1158
1159
1160
1161
    .sel-t {
      :deep(.el-input__inner) {
        background: transparent;
      }
    }
29319cfb   梁保满   设备。教师管理
1162
  
bb4c8454   阿宝   添加,修改教师
1163
1164
1165
1166
1167
1168
1169
1170
    .el-icon-close {
      padding: 5px;
      cursor: pointer;
      margin-left: 16px;
      background: #ccc;
      border-radius: 50%;
    }
  }
4c4f7640   梁保满   路由表,路由前端文件
1171
  </style>