Blame view

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