Blame view

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