Blame view

src/views/basic/setUp/student.vue 26.2 KB
4c4f7640   梁保满   路由表,路由前端文件
1
  <template>
23a6dc5f   阿宝   学校管理相关接口简单对接
2
3
4
    <div>
      <back-box>
        <template slot="title">
560c12f2   阿宝   学校设置,软件下载
5
          <span>学生管理</span>
23a6dc5f   阿宝   学校管理相关接口简单对接
6
        </template>
f5729396   梁保满   批量设置答案
7
        <template slot="btns" v-if="role == 'ROLE_XUEXIAO'">
b0cd2598   梁保满   fix:测试问题
8
9
10
11
12
13
14
15
16
17
18
19
20
21
          <el-tooltip
            effect="dark"
            content="设置答题器"
            placement="bottom"
            v-show="query.classType == 0"
          >
            <el-button
              type="primary"
              icon="el-icon-upload2"
              size="mini"
              plain
              circle
              @click="diaUp = true"
            ></el-button>
f5729396   梁保满   批量设置答案
22
          </el-tooltip>
b0cd2598   梁保满   fix:测试问题
23
24
25
26
27
28
29
30
31
32
33
34
35
36
          <el-tooltip
            v-if="!code && query.classType == 0"
            effect="dark"
            content="添加学生"
            placement="bottom"
          >
            <el-button
              type="primary"
              icon="el-icon-plus"
              size="mini"
              plain
              circle
              @click="openAddDia"
            ></el-button>
23a6dc5f   阿宝   学校管理相关接口简单对接
37
38
39
          </el-tooltip>
        </template>
      </back-box>
ec6394d1   梁保满   v1.3.1。细节调整
40
41
      <div class="answer-header">
        <div class="sel-box">
b0cd2598   梁保满   fix:测试问题
42
43
44
45
46
47
          <el-select
            class="sel"
            v-model="query.classType"
            @change="changeGrade(query.grade)"
            placeholder="选择类型"
          >
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
48
            <el-option label="全部" value=""></el-option>
8ad80958   梁保满   教师学生管理,设备状态
49
50
51
            <el-option label="行政班" :value="0"></el-option>
            <el-option label="教学班" :value="1"></el-option>
          </el-select>
b0cd2598   梁保满   fix:测试问题
52
53
54
55
56
57
          <el-select
            class="sel"
            v-model="query.grade"
            placeholder="选择年级"
            @change="changeGrade"
          >
0454f787   梁保满   班级管理,班级列表修改,科目设置
58
            <el-option disabled label="全部" value=""></el-option>
b0cd2598   梁保满   fix:测试问题
59
60
61
62
63
64
            <el-option
              v-for="item in gradeList"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
0454f787   梁保满   班级管理,班级列表修改,科目设置
65
            </el-option>
c8c928f4   梁保满   学生管理交互优化
66
67
            <el-option label="未分配" :value="80"></el-option>
            <el-option label="已毕业" :value="81"></el-option>
0454f787   梁保满   班级管理,班级列表修改,科目设置
68
          </el-select>
b0cd2598   梁保满   fix:测试问题
69
70
71
72
73
74
75
76
77
78
79
          <el-input
            placeholder="请输入学生姓名"
            v-model="query.studentName"
            class="input-with-select"
            @keyup.enter.native="_QueryData(1)"
          >
            <el-button
              slot="append"
              icon="el-icon-search"
              @click="_QueryData(1)"
            ></el-button>
ec6394d1   梁保满   v1.3.1。细节调整
80
          </el-input>
b0cd2598   梁保满   fix:测试问题
81
82
83
84
85
86
87
88
89
90
91
          <el-input
            placeholder="请输入学生学号"
            v-model="query.studentCode"
            class="input-with-select"
            @keyup.enter.native="_QueryData(2)"
          >
            <el-button
              slot="append"
              icon="el-icon-search"
              @click="_QueryData(2)"
            ></el-button>
ec6394d1   梁保满   v1.3.1。细节调整
92
93
94
          </el-input>
        </div>
      </div>
b0cd2598   梁保满   fix:测试问题
95
96
97
98
99
100
101
      <p
        class="total"
        v-if="
          studentList.length &&
          (query.grade == 80 || query.grade == 81 || !query.grade)
        "
      >
99713685   梁保满   学生调班,班级数据重新请求,使用过...
102
103
        共筛选出{{ studentList.length }}名学生。
      </p>
b0cd2598   梁保满   fix:测试问题
104
105
106
107
108
109
      <p
        class="total"
        v-if="
          getStuTotal && query.grade && query.grade != 80 && query.grade != 81
        "
      >
99713685   梁保满   学生调班,班级数据重新请求,使用过...
110
111
        共筛选出{{ getStuTotal }}名学生。
      </p>
23a6dc5f   阿宝   学校管理相关接口简单对接
112
      <div class="page-content">
23a6dc5f   阿宝   学校管理相关接口简单对接
113
        <div class="stu-box">
b0cd2598   梁保满   fix:测试问题
114
115
116
117
          <div
            class="stu-list"
            v-show="query.grade && query.grade != 80 && query.grade != 81"
          >
0454f787   梁保满   班级管理,班级列表修改,科目设置
118
            <div class="h-title">班级列表</div>
23a6dc5f   阿宝   学校管理相关接口简单对接
119
            <ul class="stu-ul">
b0cd2598   梁保满   fix:测试问题
120
121
122
123
124
125
126
              <li
                class="stu-item"
                v-for="(item, index) in classList"
                :key="item.id"
                :class="query.classId == item.id ? 'active' : ''"
                @click="classDetail(item)"
              >
23a6dc5f   阿宝   学校管理相关接口简单对接
127
128
129
130
                {{ item.className }}({{ item.studentCount }})
              </li>
            </ul>
          </div>
b8827a72   梁保满   测试bug
131
          <div class="stu-detail" v-loading="loading">
b0cd2598   梁保满   fix:测试问题
132
133
134
135
136
137
138
139
140
            <div
              class="clazz-detail"
              v-if="
                clazzDetail.stationSn &&
                query.grade &&
                query.grade != 80 &&
                query.grade != 81
              "
            >
99713685   梁保满   学生调班,班级数据重新请求,使用过...
141
142
143
              <p>基站SN:{{ clazzDetail.stationSn }}</p>
              <p>配对码:{{ clazzDetail.pairingCode }}</p>
              <p>频点:{{ clazzDetail.frequency }}</p>
d059a9d1   梁保满   接口调整
144
            </div>
b8827a72   梁保满   测试bug
145
            <ul class="s-ul">
b0cd2598   梁保满   fix:测试问题
146
147
148
149
150
151
152
153
154
155
              <li
                class="s-li"
                v-for="(item, index) in studentList"
                :key="item.id"
              >
                <el-popconfirm
                  v-if="!code"
                  title="确定删除吗?"
                  @confirm="removeStu(item, index, $event)"
                >
0a4de034   阿宝   教师管理,学生管理班级设置
156
                  <i class="el-icon-delete" slot="reference"></i>
bb4c8454   阿宝   添加,修改教师
157
                </el-popconfirm>
b0cd2598   梁保满   fix:测试问题
158
159
160
161
162
                <i
                  class="el-icon-user-solid"
                  v-if="!code && query.grade != 81"
                  @click.stop="openChangeClazz(item)"
                ></i>
0454f787   梁保满   班级管理,班级列表修改,科目设置
163
164
165
166
167
                <div class="s-li-box" @click="sayChange(item)">
                  <p class="name">
                    {{ item.studentName }}
                  </p>
                  <p class="p2" v-if="!query.classId">
86e47820   梁保满   科目添加删除操作,教师角色选择。学...
168
169
170
                    <template v-if="item.classList && item.classList.length">
                      <template v-for="(clazz, index) in item.classList">
                        <span v-if="index == 0">
b0cd2598   梁保满   fix:测试问题
171
172
173
174
                          {{ clazz.gradeName }}﹒{{ clazz.className }}</span
                        >
                      </template></template
                    >
86e47820   梁保满   科目添加删除操作,教师角色选择。学...
175
176
177
                    <template v-else>
                      {{
                        item.status == 0
b0cd2598   梁保满   fix:测试问题
178
179
                          ? "未分配"
                          : item.status == 2
86e47820   梁保满   科目添加删除操作,教师角色选择。学...
180
181
182
183
                          ? "已毕业"
                          : ""
                      }}
                    </template>
0454f787   梁保满   班级管理,班级列表修改,科目设置
184
185
186
187
188
                  </p>
                  <p class="p1">答题器:{{ item.clickerSn || "--" }}</p>
                  <p class="p1">长学号:{{ item.studentCode }}</p>
                  <p class="p1">短学号:{{ item.shortNumber || "--" }}</p>
                </div>
23a6dc5f   阿宝   学校管理相关接口简单对接
189
190
              </li>
            </ul>
b0cd2598   梁保满   fix:测试问题
191
192
193
194
195
            <el-empty
              :image-size="100"
              v-if="!studentList.length && loading == false"
              description="没有更多数据"
            ></el-empty>
23a6dc5f   阿宝   学校管理相关接口简单对接
196
197
198
          </div>
        </div>
      </div>
b0cd2598   梁保满   fix:测试问题
199
200
201
202
203
204
205
206
207
208
209
210
211
      <el-dialog
        :close-on-click-modal="false"
        title="学生调班"
        :visible.sync="diaChangeClass"
        width="400"
      >
        <el-form
          class="form-box"
          ref="formStuCla"
          :model="formStuCla"
          :rules="rulesStuCla"
          label-width="160px"
        >
e5e4a3e6   梁保满   v1.3
212
          <el-form-item label="学生姓名:">
8ad80958   梁保满   教师学生管理,设备状态
213
            <el-col :span="10">
b0cd2598   梁保满   fix:测试问题
214
215
216
217
              <el-input
                v-model="formStuCla.studentName"
                maxlength="20"
              ></el-input>
8ad80958   梁保满   教师学生管理,设备状态
218
            </el-col>
e5e4a3e6   梁保满   v1.3
219
220
221
222
          </el-form-item>
          <el-form-item label="当前班级:">
            <span>{{ formStuCla.className }}</span>
          </el-form-item>
c8c928f4   梁保满   学生管理交互优化
223
          <el-form-item label="调到班级:" prop="classId">
e5e4a3e6   梁保满   v1.3
224
            <el-col :span="10">
b0cd2598   梁保满   fix:测试问题
225
226
227
228
229
              <el-select
                class="sel"
                v-model="formStuCla.classId"
                placeholder="选择年级"
              >
c8c928f4   梁保满   学生管理交互优化
230
                <el-option disabled label="请选择" value=""></el-option>
b0cd2598   梁保满   fix:测试问题
231
232
233
234
235
236
                <el-option
                  v-for="item in classList"
                  :key="item.id"
                  :label="item.className"
                  :value="item.id"
                >
e5e4a3e6   梁保满   v1.3
237
238
239
240
241
242
                </el-option>
              </el-select>
            </el-col>
          </el-form-item>
          <el-form-item label="长学号:" prop="studentCode">
            <el-col :span="10">
b0cd2598   梁保满   fix:测试问题
243
244
245
246
247
              <el-input
                maxlength="12"
                placeholder="输入学生长学号"
                v-model.trim="formStuCla.studentCode"
              />
e5e4a3e6   梁保满   v1.3
248
249
250
251
252
253
254
255
            </el-col>
          </el-form-item>
        </el-form>
        <div class="dialog-footer" slot="footer">
          <el-button @click="changeStu">确 定</el-button>
          <el-button @click="diaChangeClass = false">取 消</el-button>
        </div>
      </el-dialog>
b0cd2598   梁保满   fix:测试问题
256
257
258
259
260
261
262
263
264
265
266
      <el-dialog
        :close-on-click-modal="false"
        title="调班轨迹"
        :visible.sync="diaChangeClassTrack"
        width="400"
      >
        <el-form
          :model="formClassTrack"
          label-width="160px"
          v-loading="loadingClassLogs"
        >
0454f787   梁保满   班级管理,班级列表修改,科目设置
267
268
269
270
          <el-form-item label="学生姓名:">
            <span>{{ formClassTrack.studentName }}</span>
          </el-form-item>
          <el-form-item label="当前班级:">
99713685   梁保满   学生调班,班级数据重新请求,使用过...
271
            <span>{{ formClassTrack.className }}</span>
b8827a72   梁保满   测试bug
272
273
          </el-form-item>
          <el-form-item label="历史班级:">
0454f787   梁保满   班级管理,班级列表修改,科目设置
274
            <p v-for="item in formClassTrack.classList">
b8827a72   梁保满   测试bug
275
              {{ `${item.gradeName}-${item.className}:${item.createdTime}` }}
0454f787   梁保满   班级管理,班级列表修改,科目设置
276
277
278
279
280
281
282
            </p>
          </el-form-item>
        </el-form>
        <div class="dialog-footer" slot="footer">
          <el-button @click="diaChangeClassTrack = false">关 闭</el-button>
        </div>
      </el-dialog>
b0cd2598   梁保满   fix:测试问题
283
284
285
286
287
288
289
290
291
292
293
294
295
      <el-dialog
        :close-on-click-modal="false"
        title="添加学生"
        :visible.sync="diaStu"
        width="400"
      >
        <el-form
          ref="formBox"
          class="form-box"
          :model="formStu"
          :rules="rulesStu"
          label-width="160px"
        >
dd5150c5   阿宝   数据同步
296
297
298
299
300
          <el-form-item label="所在班级:">
            <span>{{ formStu.className }}</span>
          </el-form-item>
          <el-form-item label="学生姓名:" prop="studentName">
            <el-col :span="10">
b0cd2598   梁保满   fix:测试问题
301
302
303
304
305
              <el-input
                maxlength="30"
                placeholder="输入学生姓名"
                v-model.trim="formStu.studentName"
              />
dd5150c5   阿宝   数据同步
306
307
308
309
            </el-col>
          </el-form-item>
          <el-form-item label="长学号:" prop="studentCode">
            <el-col :span="10">
b0cd2598   梁保满   fix:测试问题
310
311
312
313
314
              <el-input
                maxlength="12"
                placeholder="输入学生长学号"
                v-model.trim="formStu.studentCode"
              />
dd5150c5   阿宝   数据同步
315
316
317
318
            </el-col>
          </el-form-item>
          <el-form-item label="短学号:">
            <el-col :span="10">
aeac66d4   阿宝   飞书测试bug
319
              <el-input maxlength="12" v-model.trim="formStu.shortNumber" />
dd5150c5   阿宝   数据同步
320
321
322
323
324
325
326
327
328
329
            </el-col>
          </el-form-item>
          <el-form-item label="性别:">
            <el-radio-group v-model="formStu.sex">
              <el-radio :label="1">男</el-radio>
              <el-radio :label="2">女</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="答题器编码:">
            <el-col :span="10">
9309dc5d   梁保满   任课老师接口完成
330
              <el-input v-model.trim="formStu.clickerSn" />
dd5150c5   阿宝   数据同步
331
332
333
            </el-col>
          </el-form-item>
        </el-form>
23a6dc5f   阿宝   学校管理相关接口简单对接
334
        <div class="dialog-footer" slot="footer">
dd5150c5   阿宝   数据同步
335
336
          <el-button @click="addStu">确 定</el-button>
          <el-button @click="diaStu = false">取 消</el-button>
23a6dc5f   阿宝   学校管理相关接口简单对接
337
338
        </div>
      </el-dialog>
b0cd2598   梁保满   fix:测试问题
339
340
341
342
343
344
345
346
347
348
349
350
351
      <el-dialog
        :close-on-click-modal="false"
        title="学生答题器绑定"
        :visible.sync="diaUp"
        width="600"
      >
        <upload
          id="downTeacher"
          :url="url"
          :params="{ type: query.classType }"
          @upSuccess="upSuccess"
          fileName="学生答题器绑定模板"
        >
f5729396   梁保满   批量设置答案
352
          <p class="down-txt" slot="down">
14a23714   梁保满   学生答题卡绑定模版下载上传
353
            通过Excel名单导入学生答题器绑定模板,点击
f5729396   梁保满   批量设置答案
354
355
            <el-link type="danger" @click="downExcel">模板下载</el-link> 。
          </p>
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
356
        </upload>
f5729396   梁保满   批量设置答案
357
358
359
360
        <div class="dialog-footer" slot="footer">
          <el-button @click="diaUp = false">取 消</el-button>
        </div>
      </el-dialog>
23a6dc5f   阿宝   学校管理相关接口简单对接
361
    </div>
4c4f7640   梁保满   路由表,路由前端文件
362
363
364
  </template>
  
  <script>
e5e4a3e6   梁保满   v1.3
365
  import _ from "lodash";
ec6394d1   梁保满   v1.3.1。细节调整
366
  import { setGradeName } from "@/utils";
4c4f7640   梁保满   路由表,路由前端文件
367
  export default {
23a6dc5f   阿宝   学校管理相关接口简单对接
368
369
    data() {
      return {
255e2506   梁保满   飞书bug及优化
370
        code: "",
f5729396   梁保满   批量设置答案
371
        role: "",
0454f787   梁保满   班级管理,班级列表修改,科目设置
372
373
374
        loading: false,
        loadingDown: false,
        loadingClassLogs: false,
f5729396   梁保满   批量设置答案
375
        diaUp: false,
14a23714   梁保满   学生答题卡绑定模版下载上传
376
        url: "/api_html/school/manager/importStudentClicker",
dd5150c5   阿宝   数据同步
377
        diaStu: false,
e5e4a3e6   梁保满   v1.3
378
        diaChangeClass: false,
0454f787   梁保满   班级管理,班级列表修改,科目设置
379
380
381
        diaChangeClassTrack: false,
        formClassTrack: {
          studentName: "",
b8827a72   梁保满   测试bug
382
          className: "",
0454f787   梁保满   班级管理,班级列表修改,科目设置
383
384
          classList: [],
        },
ae0a304c   梁保满   学生管理-显示班级基站信息
385
        clazzDetail: { stationSn: "", pairingCode: "", frequency: "" },
23a6dc5f   阿宝   学校管理相关接口简单对接
386
        query: {
4623f67f   梁保满   隋唐问以及教师学生设置
387
          classType: 0, //0行政 1教学班
d059a9d1   梁保满   接口调整
388
          grade: "",
23a6dc5f   阿宝   学校管理相关接口简单对接
389
          classId: "",
b8827a72   梁保满   测试bug
390
          status: 0,
23a6dc5f   阿宝   学校管理相关接口简单对接
391
392
393
          studentCode: "",
          studentName: "",
        },
dd5150c5   阿宝   数据同步
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
        formStu: {
          className: "",
          studentName: "",
          studentCode: "",
          shortNumber: "",
          sex: 1,
          clickerSn: "",
        },
        rulesStu: {
          studentName: [
            { required: true, message: "请输入学生名称", trigger: "blur" },
          ],
          studentCode: [
            { required: true, message: "请输入学生长学号", trigger: "blur" },
          ],
        },
e5e4a3e6   梁保满   v1.3
410
411
412
413
414
415
416
417
418
        formStuCla: {
          studentName: "",
          studentId: "",
          oldClassId: "",
          className: "",
          classId: "",
          studentCode: "",
        },
        rulesStuCla: {
8ad80958   梁保满   教师学生管理,设备状态
419
420
421
          studentName: [
            { required: true, message: "请输入学生名称", trigger: "blur" },
          ],
c8c928f4   梁保满   学生管理交互优化
422
          classId: [{ required: true, message: "请选择班级", trigger: "blur" }],
e5e4a3e6   梁保满   v1.3
423
424
425
426
          studentCode: [
            { required: true, message: "请输入学生号", trigger: "blur" },
          ],
        },
23a6dc5f   阿宝   学校管理相关接口简单对接
427
428
429
430
431
432
433
434
435
436
437
438
439
        gradeName: "",
        gradeList: [],
        classList: [],
        studentList: [],
        teacherDetail: {
          teacherName: "",
          loginName: "",
          sex: "",
          available: "",
          managerList: [],
          teacherCourseList: [],
          teacherGradeList: [],
        },
23a6dc5f   阿宝   学校管理相关接口简单对接
440
      };
23a6dc5f   阿宝   学校管理相关接口简单对接
441
    },
99713685   梁保满   学生调班,班级数据重新请求,使用过...
442
443
444
445
446
447
448
449
    computed: {
      getStuTotal: function () {
        let num = this.classList.reduce((pre, cur) => {
          return (pre += cur.studentCount);
        }, 0);
        return num;
      },
    },
23a6dc5f   阿宝   学校管理相关接口简单对接
450
    async created() {
7812e986   梁保满   班主任查看报表添加额外信息
451
      this.code = this.$store.getters.csCode;
54857fa3   梁保满   下载模板跨域,集团管理员选择角色范...
452
453
454
      this.role =
        this.$store.getters.info.showRole ||
        this.$store.getters.info.permissions[0].role;
23a6dc5f   阿宝   学校管理相关接口简单对接
455
      await this._QueryDataGrade();
560c12f2   阿宝   学校设置,软件下载
456
      await this._QueryClass();
23a6dc5f   阿宝   学校管理相关接口简单对接
457
458
459
      this._QueryData(3);
    },
    methods: {
ec6394d1   梁保满   v1.3.1。细节调整
460
461
462
      getGradeName(type) {
        return setGradeName(type);
      },
dd5150c5   阿宝   数据同步
463
      openAddDia() {
ec6394d1   梁保满   v1.3.1。细节调整
464
465
466
        if (!this.query.classId) {
          this.$message.warning("暂无班级信息,请选择或导入班级!");
          return;
84bc1b0b   梁保满   打印样式调整,添加学生钱判断有无班级
467
        }
dd5150c5   阿宝   数据同步
468
469
470
471
472
473
474
475
        this.formStu.studentName = "";
        this.formStu.studentCode = "";
        this.formStu.shortNumber = "";
        this.formStu.sex = 1;
        this.formStu.clickerSn = "";
        this.diaStu = true;
      },
      classDetail(obj) {
ae0a304c   梁保满   学生管理-显示班级基站信息
476
477
478
        this.clazzDetail.stationSn = obj.stationSn;
        this.clazzDetail.pairingCode = obj.pairingCode;
        this.clazzDetail.frequency = obj.frequency;
dd5150c5   阿宝   数据同步
479
480
        this.query.classId = obj.id;
        this.formStu.className = obj.className;
23a6dc5f   阿宝   学校管理相关接口简单对接
481
482
        this._QueryData(3);
      },
e5e4a3e6   梁保满   v1.3
483
  
c8c928f4   梁保满   学生管理交互优化
484
      async upSuccess(res) {
191d5bfa   梁保满   学生管理、基站管理下载名称设置,上...
485
486
487
        this.$message.closeAll();
        this.$message({
          showClose: true,
fc9cbff6   梁保满   上传信息显示调整
488
          message: `成功(${res.data.success})`,
191d5bfa   梁保满   学生管理、基站管理下载名称设置,上...
489
          type: "success",
54857fa3   梁保满   下载模板跨域,集团管理员选择角色范...
490
          duration: 5000,
191d5bfa   梁保满   学生管理、基站管理下载名称设置,上...
491
        });
f5729396   梁保满   批量设置答案
492
493
        //导入成功
        this.diaUp = false;
c8c928f4   梁保满   学生管理交互优化
494
495
        await this._QueryClazz(this.query.grade);
        this._QueryData();
f5729396   梁保满   批量设置答案
496
      },
e5e4a3e6   梁保满   v1.3
497
      //添加学生
225a00b6   梁保满   飞书问题解决
498
      addStu() {
dd5150c5   阿宝   数据同步
499
500
501
502
503
504
505
        let query = {};
        for (let key in this.formStu) {
          if (key != "className" && this.formStu[key]) {
            query[key] = this.formStu[key];
          }
        }
        this.loading = true;
225a00b6   梁保满   飞书问题解决
506
507
        this.$refs.formBox.validate(async (valid) => {
          if (valid) {
255e2506   梁保满   飞书bug及优化
508
509
510
511
512
513
            let hasName = this.studentList.find((item) => {
              return item.studentName == this.formStu.studentName;
            });
            console.log(hasName);
            if (hasName) {
              this.$message.warning("学生姓名已存在");
4d5235d7   梁保满   学生,教师修改,顶部返回备题组卷记...
514
              this.loading = false;
255e2506   梁保满   飞书bug及优化
515
516
              return;
            }
225a00b6   梁保满   飞书问题解决
517
518
519
520
521
522
523
524
525
            const { data, status, info } = await this.$request.addStudent({
              classId: this.query.classId,
              ...query,
            });
            this.loading = false;
            console.log(status);
            if (status === 0) {
              this.$message.success(info);
              this.diaStu = false;
c8c928f4   梁保满   学生管理交互优化
526
              await this._QueryClazz(this.query.grade);
225a00b6   梁保满   飞书问题解决
527
528
529
530
531
              this._QueryData();
            } else {
              this.$message.error(info);
            }
          } else {
4d5235d7   梁保满   学生,教师修改,顶部返回备题组卷记...
532
            this.loading = false;
225a00b6   梁保满   飞书问题解决
533
534
            this.$message.error("数据有误,请检查!");
          }
dd5150c5   阿宝   数据同步
535
        });
dd5150c5   阿宝   数据同步
536
      },
0454f787   梁保满   班级管理,班级列表修改,科目设置
537
538
539
540
541
      //学生调班轨迹
      sayChange(obj) {
        this._StudentClassLogs(obj);
        this.diaChangeClassTrack = true;
      },
e5e4a3e6   梁保满   v1.3
542
543
      //学生调班弹窗
      openChangeClazz(obj) {
b6e2b24d   梁保满   学生班级信息调整
544
        console.log(obj);
3a9aa32b   梁保满   学生搜索调班无数据问题,使用分析默...
545
        if (this.query.grade == 80 || !this.query.grade) {
99713685   梁保满   学生调班,班级数据重新请求,使用过...
546
          this._QueryClazz(obj.grade);
99713685   梁保满   学生调班,班级数据重新请求,使用过...
547
        }
c8c928f4   梁保满   学生管理交互优化
548
        this.formStuCla.classId = "";
e5e4a3e6   梁保满   v1.3
549
        this.formStuCla.studentId = obj.id;
3a9aa32b   梁保满   学生搜索调班无数据问题,使用分析默...
550
        this.formStuCla.className = obj.classList && obj.classList[0]?.className;
e5e4a3e6   梁保满   v1.3
551
552
        this.formStuCla.studentName = obj.studentName;
        this.formStuCla.studentCode = obj.studentCode;
3a9aa32b   梁保满   学生搜索调班无数据问题,使用分析默...
553
        this.formStuCla.oldClassId = obj.classList && obj.classList[0]?.id;
e5e4a3e6   梁保满   v1.3
554
555
556
557
558
559
560
        this.diaChangeClass = true;
      },
      //学生调班
      changeStu: _.throttle(
        function () {
          this.$refs.formStuCla.validate(async (valid) => {
            if (valid) {
c0026d5f   梁保满   科目修改,学生调班
561
562
563
564
              // if (this.formStuCla.classId == this.formStuCla.oldClassId) {
              //   this.$message.warning("班级无变更~");
              //   return;
              // }
e5e4a3e6   梁保满   v1.3
565
566
              const { data, status, info } =
                await this.$request.studentChangeClass({
8ad80958   梁保满   教师学生管理,设备状态
567
                  name: this.formStuCla.studentName,
e5e4a3e6   梁保满   v1.3
568
569
570
571
572
573
574
575
                  studentId: this.formStuCla.studentId,
                  oldClassId: this.formStuCla.oldClassId,
                  classId: this.formStuCla.classId,
                  studentCode: this.formStuCla.studentCode,
                });
              if (status == 0) {
                this.diaChangeClass = false;
                this.$message.success(info);
c8c928f4   梁保满   学生管理交互优化
576
                await this._QueryClazz(this.query.grade);
e5e4a3e6   梁保满   v1.3
577
578
579
580
581
582
583
584
585
586
587
588
                this._QueryData();
              } else {
                this.$message.error(info);
              }
            } else {
              this.$message.error("数据有误请检查!");
            }
          });
        },
        2000,
        { leading: true, trailing: false }
      ),
4fab460c   梁保满   班级归档操作交互
589
  
0454f787   梁保满   班级管理,班级列表修改,科目设置
590
591
592
593
594
      //学生调班轨迹
      async _StudentClassLogs(obj) {
        this.loadingClassLogs = true;
        let { data, info, status } = await this.$request.studentClassLogs({
          studentId: obj.id,
e5e4a3e6   梁保满   v1.3
595
        });
0454f787   梁保满   班级管理,班级列表修改,科目设置
596
597
        this.loadingClassLogs = false;
        if (status == 0) {
b6e2b24d   梁保满   学生班级信息调整
598
599
          this.formClassTrack.className =
            (obj.classList && obj.classList[0]?.className) || "";
0454f787   梁保满   班级管理,班级列表修改,科目设置
600
601
          this.formClassTrack.studentName = obj.studentName;
          this.formClassTrack.classList = (data.list && [...data.list]) || [];
e5e4a3e6   梁保满   v1.3
602
603
604
605
        } else {
          this.$message.error(info);
        }
      },
0454f787   梁保满   班级管理,班级列表修改,科目设置
606
      async removeStu(obj, index, $event) {
2e5b8dea   梁保满   分数设置修改,
607
        let query = {};
9895b056   梁保满   无班级不去查找科目
608
        if (obj.classList && obj.classList.length) {
2e5b8dea   梁保满   分数设置修改,
609
610
          query.classId = obj.classList[0].id;
        }
e5e4a3e6   梁保满   v1.3
611
        const { data, status, info } = await this.$request.delStudent({
4623f67f   梁保满   隋唐问以及教师学生设置
612
          type: this.query.classType,
e5e4a3e6   梁保满   v1.3
613
          studentId: obj.id,
2e5b8dea   梁保满   分数设置修改,
614
          ...query,
e5e4a3e6   梁保满   v1.3
615
616
617
        });
        if (status === 0) {
          this.$message.success("删除成功");
c8c928f4   梁保满   学生管理交互优化
618
          await this._QueryClazz(this.query.grade);
9895b056   梁保满   无班级不去查找科目
619
620
          // this._QueryData();
          this.studentList.splice(index, 1);
e5e4a3e6   梁保满   v1.3
621
622
623
624
625
        } else {
          this.$message.error(info);
        }
      },
      async changeGrade(val) {
0454f787   梁保满   班级管理,班级列表修改,科目设置
626
        if (!val) return;
e5e4a3e6   梁保满   v1.3
627
        this.query.classId = "";
0454f787   梁保满   班级管理,班级列表修改,科目设置
628
629
        this.query.studentName = "";
        this.query.studentCode = "";
4623f67f   梁保满   隋唐问以及教师学生设置
630
631
632
633
634
  
        this.formStu.className = "";
        this.clazzDetail.stationSn = "";
        this.clazzDetail.pairingCode = "";
        this.clazzDetail.frequency = "";
c8c928f4   梁保满   学生管理交互优化
635
636
637
        if (val != 80 && val != 81) {
          await this._QueryClass(val);
        }
e5e4a3e6   梁保满   v1.3
638
639
        this._QueryData(3);
      },
b8827a72   梁保满   测试bug
640
      serQuery(type) {
23a6dc5f   阿宝   学校管理相关接口简单对接
641
        let query = {};
23a6dc5f   阿宝   学校管理相关接口简单对接
642
        if (type == 1) {
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
643
          this.query.classType = "";
ec6394d1   梁保满   v1.3.1。细节调整
644
          this.query.classId = "";
23a6dc5f   阿宝   学校管理相关接口简单对接
645
          this.query.studentCode = "";
d059a9d1   梁保满   接口调整
646
          this.query.grade = "";
a0f751c7   梁保满   学生查询条件
647
          query.studentName = this.query.studentName;
c8c928f4   梁保满   学生管理交互优化
648
          query.status = 9;
23a6dc5f   阿宝   学校管理相关接口简单对接
649
        } else if (type == 2) {
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
650
          this.query.classType = "";
ec6394d1   梁保满   v1.3.1。细节调整
651
          this.query.classId = "";
23a6dc5f   阿宝   学校管理相关接口简单对接
652
          this.query.studentName = "";
d059a9d1   梁保满   接口调整
653
          this.query.grade = "";
a0f751c7   梁保满   学生查询条件
654
          query.studentCode = this.query.studentCode;
c8c928f4   梁保满   学生管理交互优化
655
          query.status = 9;
23a6dc5f   阿宝   学校管理相关接口简单对接
656
657
658
        } else if (type == 3) {
          this.query.studentName = "";
          this.query.studentCode = "";
c8c928f4   梁保满   学生管理交互优化
659
          if (this.query.grade == 80) {
86e47820   梁保满   科目添加删除操作,教师角色选择。学...
660
            this.query.classId = "";
c8c928f4   梁保满   学生管理交互优化
661
662
            query.status = -1;
          } else if (this.query.grade == 81) {
86e47820   梁保满   科目添加删除操作,教师角色选择。学...
663
            this.query.classId = "";
c8c928f4   梁保满   学生管理交互优化
664
            query.status = 2;
b8827a72   梁保满   测试bug
665
          } else {
b8827a72   梁保满   测试bug
666
667
668
            query.grade = this.query.grade;
            query.classId = this.query.classId;
          }
225a00b6   梁保满   飞书问题解决
669
        } else {
c8c928f4   梁保满   学生管理交互优化
670
          query = { ...this.query };
23a6dc5f   阿宝   学校管理相关接口简单对接
671
        }
b8827a72   梁保满   测试bug
672
673
674
        return query;
      },
      async _QueryData(type) {
5cfb0264   梁保满   班级管理交互优化
675
676
677
678
679
680
681
682
683
684
685
        if (type == 1) {
          if (!this.query.studentName) {
            this.$message.warning("输入学生姓名~");
            return;
          }
        } else if (type == 2) {
          if (!this.query.studentCode) {
            this.$message.warning("输入学生学号~");
            return;
          }
        }
b8827a72   梁保满   测试bug
686
        let query = this.serQuery(type);
23a6dc5f   阿宝   学校管理相关接口简单对接
687
        this.loading = true;
99713685   梁保满   学生调班,班级数据重新请求,使用过...
688
        this.studentList = [];
23a6dc5f   阿宝   学校管理相关接口简单对接
689
        const { data, status, info } = await this.$request.studentList({
4623f67f   梁保满   隋唐问以及教师学生设置
690
          type: this.query.classType,
23a6dc5f   阿宝   学校管理相关接口简单对接
691
692
693
694
695
          ...query,
        });
        this.loading = false;
        console.log(status);
        if (status === 0) {
b8827a72   梁保满   测试bug
696
          this.studentList = (data.list && [...data?.list]) || [];
23a6dc5f   阿宝   学校管理相关接口简单对接
697
698
699
700
701
        } else {
          this.$message.error(info);
        }
      },
      async _QueryDataGrade() {
23a6dc5f   阿宝   学校管理相关接口简单对接
702
703
704
705
706
        const { data, status, info } = await this.$request.gradeList();
        if (status === 0) {
          this.gradeList =
            data.list?.map((item) => {
              return {
d059a9d1   梁保满   接口调整
707
                value: item.grade,
23a6dc5f   阿宝   学校管理相关接口简单对接
708
709
710
                label: item.gradeName,
              };
            }) || [];
d059a9d1   梁保满   接口调整
711
          this.query.grade = this.gradeList[0]?.value;
23a6dc5f   阿宝   学校管理相关接口简单对接
712
713
714
715
716
        } else {
          this.$message.error(info);
        }
      },
      async _QueryClass(value) {
b8827a72   梁保满   测试bug
717
        this.loading = true;
99713685   梁保满   学生调班,班级数据重新请求,使用过...
718
        this.classList = [];
23a6dc5f   阿宝   学校管理相关接口简单对接
719
        const { data, status, info } = await this.$request.schoolClassList({
d059a9d1   梁保满   接口调整
720
          grade: value || this.query.grade,
b0cd2598   梁保满   fix:测试问题
721
          type: this.query.classType,
23a6dc5f   阿宝   学校管理相关接口简单对接
722
723
        });
        if (status === 0) {
b8827a72   梁保满   测试bug
724
          this.classList = (data.list && [...data?.list]) || [];
560c12f2   阿宝   学校设置,软件下载
725
          this.query.classId = this.classList[0]?.id;
dd5150c5   阿宝   数据同步
726
          this.formStu.className = this.classList[0]?.className;
ae0a304c   梁保满   学生管理-显示班级基站信息
727
728
729
          this.clazzDetail.stationSn = this.classList[0]?.stationSn;
          this.clazzDetail.pairingCode = this.classList[0]?.pairingCode;
          this.clazzDetail.frequency = this.classList[0]?.frequency;
23a6dc5f   阿宝   学校管理相关接口简单对接
730
731
732
733
        } else {
          this.$message.error(info);
        }
      },
99713685   梁保满   学生调班,班级数据重新请求,使用过...
734
735
736
737
      async _QueryClazz(value) {
        this.classList = [];
        const { data, status, info } = await this.$request.schoolClassList({
          grade: value,
b0cd2598   梁保满   fix:测试问题
738
          type: this.query.classType,
99713685   梁保满   学生调班,班级数据重新请求,使用过...
739
740
741
        });
        if (status === 0) {
          this.classList = (data.list && [...data?.list]) || [];
99713685   梁保满   学生调班,班级数据重新请求,使用过...
742
743
744
745
        } else {
          this.$message.error(info);
        }
      },
54857fa3   梁保满   下载模板跨域,集团管理员选择角色范...
746
      async downExcel() {
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
747
748
749
750
751
        this.loadingDown = true;
        let { data, info, status } =
          await this.$request.studentClickerTemplateUrl();
        this.loadingDown = false;
        if (status == 0) {
54857fa3   梁保满   下载模板跨域,集团管理员选择角色范...
752
753
754
755
756
          const a = document.createElement("a");
          a.href = data.downloadUrl;
          document.body.appendChild(a);
          a.click();
          a.remove();
e371f2dc   梁保满   软件下载,学校,班级老师等报表导入...
757
758
759
760
        } else {
          this.$message.error(info);
        }
      },
23a6dc5f   阿宝   学校管理相关接口简单对接
761
762
    },
  };
4c4f7640   梁保满   路由表,路由前端文件
763
764
  </script>
  
23a6dc5f   阿宝   学校管理相关接口简单对接
765
766
  <style lang="scss" scoped>
  .page-content {
ec6394d1   梁保满   v1.3.1。细节调整
767
    padding: 0 20px;
23a6dc5f   阿宝   学校管理相关接口简单对接
768
  }
8ad80958   梁保满   教师学生管理,设备状态
769
  
e5e4a3e6   梁保满   v1.3
770
771
772
773
774
775
776
  .tips {
    display: flex;
    line-height: 16px;
    font-size: 14px;
    color: #999;
    margin-bottom: 10px;
  }
8ad80958   梁保满   教师学生管理,设备状态
777
  
99713685   梁保满   学生调班,班级数据重新请求,使用过...
778
779
780
781
782
  .total {
    padding: 0 20px 10px;
    font-size: 14px;
    color: #666;
  }
8ad80958   梁保满   教师学生管理,设备状态
783
  
23a6dc5f   阿宝   学校管理相关接口简单对接
784
785
786
787
788
  .stu-box {
    display: flex;
    background: #f8f8f8;
    border-radius: 10px;
    overflow: hidden;
8ad80958   梁保满   教师学生管理,设备状态
789
  
ae0a304c   梁保满   学生管理-显示班级基站信息
790
    .answer-header {
e5e4a3e6   梁保满   v1.3
791
      padding-top: 10px;
ae0a304c   梁保满   学生管理-显示班级基站信息
792
    }
8ad80958   梁保满   教师学生管理,设备状态
793
  
23a6dc5f   阿宝   学校管理相关接口简单对接
794
    .stu-list {
0454f787   梁保满   班级管理,班级列表修改,科目设置
795
      min-width: 200px;
23a6dc5f   阿宝   学校管理相关接口简单对接
796
      max-height: 80vh;
8ad80958   梁保满   教师学生管理,设备状态
797
  
23a6dc5f   阿宝   学校管理相关接口简单对接
798
799
      .h-title {
        height: 40px;
23a6dc5f   阿宝   学校管理相关接口简单对接
800
801
802
        line-height: 40px;
        background: #eee;
      }
8ad80958   梁保满   教师学生管理,设备状态
803
  
23a6dc5f   阿宝   学校管理相关接口简单对接
804
805
806
807
808
809
810
      .stu-item {
        font-size: 16px;
        color: #7f7f7f;
        line-height: 36px;
        cursor: pointer;
        padding-left: 12px;
        position: relative;
8ad80958   梁保满   教师学生管理,设备状态
811
  
23a6dc5f   阿宝   学校管理相关接口简单对接
812
813
814
        .el-icon-edit-outline {
          position: absolute;
          top: 8px;
e5e4a3e6   梁保满   v1.3
815
          right: 4px;
23a6dc5f   阿宝   学校管理相关接口简单对接
816
817
          font-size: 20px;
          display: none;
8ad80958   梁保满   教师学生管理,设备状态
818
  
23a6dc5f   阿宝   学校管理相关接口简单对接
819
820
821
822
          &:hover {
            color: #667ffd;
          }
        }
8ad80958   梁保满   教师学生管理,设备状态
823
  
e5e4a3e6   梁保满   v1.3
824
825
826
827
828
829
830
        .popconfirm-box {
          position: absolute;
          top: 6px;
          right: 31px;
          font-size: 17px;
          line-height: 24px;
          display: none;
8ad80958   梁保满   教师学生管理,设备状态
831
  
e5e4a3e6   梁保满   v1.3
832
833
834
835
          &:hover {
            color: #667ffd;
          }
        }
8ad80958   梁保满   教师学生管理,设备状态
836
  
23a6dc5f   阿宝   学校管理相关接口简单对接
837
838
        &:hover {
          background: #eee;
8ad80958   梁保满   教师学生管理,设备状态
839
  
23a6dc5f   阿宝   学校管理相关接口简单对接
840
841
842
          .el-icon-edit-outline {
            display: block;
          }
8ad80958   梁保满   教师学生管理,设备状态
843
  
e5e4a3e6   梁保满   v1.3
844
845
846
          .popconfirm-box {
            display: block;
          }
23a6dc5f   阿宝   学校管理相关接口简单对接
847
        }
8ad80958   梁保满   教师学生管理,设备状态
848
  
23a6dc5f   阿宝   学校管理相关接口简单对接
849
850
        &.active {
          color: #667ffd;
6d7bd862   梁保满   飞书bug
851
          background: #eee;
23a6dc5f   阿宝   学校管理相关接口简单对接
852
853
        }
      }
8ad80958   梁保满   教师学生管理,设备状态
854
  
23a6dc5f   阿宝   学校管理相关接口简单对接
855
856
      .sel {
        width: 180px;
8ad80958   梁保满   教师学生管理,设备状态
857
  
23a6dc5f   阿宝   学校管理相关接口简单对接
858
859
860
861
862
863
        :deep(.el-input__inner) {
          font-size: 16px;
          padding-left: 0;
          border: none;
          background: transparent;
        }
8ad80958   梁保满   教师学生管理,设备状态
864
  
23a6dc5f   阿宝   学校管理相关接口简单对接
865
866
867
868
869
        :deep(.el-icon-arrow-up:before) {
          content: "\e78f";
        }
      }
    }
8ad80958   梁保满   教师学生管理,设备状态
870
  
23a6dc5f   阿宝   学校管理相关接口简单对接
871
872
873
    .stu-detail {
      flex: 1;
      border-left: 0.5px solid #eee;
b8827a72   梁保满   测试bug
874
      min-height: 200px;
8ad80958   梁保满   教师学生管理,设备状态
875
  
b8827a72   梁保满   测试bug
876
      &-tit {
d059a9d1   梁保满   接口调整
877
878
879
        display: flex;
        justify-content: space-between;
      }
99713685   梁保满   学生调班,班级数据重新请求,使用过...
880
  
23a6dc5f   阿宝   学校管理相关接口简单对接
881
882
883
      .s-ul {
        display: flex;
        flex-wrap: wrap;
99713685   梁保满   学生调班,班级数据重新请求,使用过...
884
        padding: 12px 0 0 20px;
8ad80958   梁保满   教师学生管理,设备状态
885
  
23a6dc5f   阿宝   学校管理相关接口简单对接
886
        .s-li {
0454f787   梁保满   班级管理,班级列表修改,科目设置
887
          position: relative;
23a6dc5f   阿宝   学校管理相关接口简单对接
888
          box-shadow: 2px 2px 5px #7f7f7f;
23a6dc5f   阿宝   学校管理相关接口简单对接
889
          margin: 0 20px 20px 0;
8ad80958   梁保满   教师学生管理,设备状态
890
  
0454f787   梁保满   班级管理,班级列表修改,科目设置
891
          .s-li-box {
c8c928f4   梁保满   学生管理交互优化
892
            width: 160px;
0454f787   梁保满   班级管理,班级列表修改,科目设置
893
894
895
896
897
            border-radius: 10px;
            min-height: 120px;
            padding: 0 12px 5px;
            cursor: pointer;
          }
8ad80958   梁保满   教师学生管理,设备状态
898
  
e5e4a3e6   梁保满   v1.3
899
900
901
902
903
904
905
906
907
          .el-icon-user-solid {
            position: absolute;
            top: 8px;
            left: 8px;
            font-size: 18px;
            color: #666;
            padding: 2px;
            display: none;
            cursor: pointer;
8ad80958   梁保满   教师学生管理,设备状态
908
  
e5e4a3e6   梁保满   v1.3
909
910
911
912
            &:hover {
              color: #667ffd;
            }
          }
8ad80958   梁保满   教师学生管理,设备状态
913
  
23a6dc5f   阿宝   学校管理相关接口简单对接
914
915
916
917
918
919
920
921
          .el-icon-delete {
            position: absolute;
            top: 8px;
            right: 8px;
            font-size: 18px;
            padding: 2px;
            display: none;
            cursor: pointer;
8ad80958   梁保满   教师学生管理,设备状态
922
  
23a6dc5f   阿宝   学校管理相关接口简单对接
923
924
925
926
            &:hover {
              color: #667ffd;
            }
          }
8ad80958   梁保满   教师学生管理,设备状态
927
  
23a6dc5f   阿宝   学校管理相关接口简单对接
928
          &:hover {
e5e4a3e6   梁保满   v1.3
929
930
931
            .el-icon-user-solid {
              display: block;
            }
8ad80958   梁保满   教师学生管理,设备状态
932
  
23a6dc5f   阿宝   学校管理相关接口简单对接
933
934
935
936
            .el-icon-delete {
              display: block;
            }
          }
8ad80958   梁保满   教师学生管理,设备状态
937
  
23a6dc5f   阿宝   学校管理相关接口简单对接
938
939
940
941
942
943
          .name {
            text-align: center;
            font-size: 16px;
            line-height: 18px;
            padding: 10px 0;
          }
8ad80958   梁保满   教师学生管理,设备状态
944
  
23a6dc5f   阿宝   学校管理相关接口简单对接
945
946
947
948
949
          .p1 {
            color: #7f7f7f;
            line-height: 20px;
            padding-bottom: 5px;
          }
8ad80958   梁保满   教师学生管理,设备状态
950
  
ec6394d1   梁保满   v1.3.1。细节调整
951
952
953
954
955
          .p2 {
            color: #333;
            line-height: 20px;
            padding-bottom: 5px;
          }
23a6dc5f   阿宝   学校管理相关接口简单对接
956
957
958
        }
      }
    }
8ad80958   梁保满   教师学生管理,设备状态
959
  
ae0a304c   梁保满   学生管理-显示班级基站信息
960
961
    .clazz-detail {
      display: flex;
99713685   梁保满   学生调班,班级数据重新请求,使用过...
962
      padding: 12px 12px 0 20px;
8ad80958   梁保满   教师学生管理,设备状态
963
  
ae0a304c   梁保满   学生管理-显示班级基站信息
964
965
966
967
968
      p {
        margin-right: 16px;
        color: #666;
      }
    }
23a6dc5f   阿宝   学校管理相关接口简单对接
969
  }
4c4f7640   梁保满   路由表,路由前端文件
970
  </style>