Blame view

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