Blame view

src/views/basic/device/index.vue 45.3 KB
4c4f7640   梁保满   路由表,路由前端文件
1
  <template>
e3b0e3e7   梁保满   季度时间格式调整
2
    <div ref="main" class="page-content">
bb778c90   阿宝   设备状态
3
4
5
6
      <back-box>
        <template slot="title">
          <span>设备管理</span>
        </template>
47a01cb6   梁保满   v1.3测试问题
7
        <template slot="btns">
78ea6110   梁保满   设备导出提示
8
9
          <template v-if="tableData.length">
            <el-tooltip effect="dark" content="设备导出" placement="bottom">
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
10
11
12
13
14
15
16
17
              <el-button
                type="primary"
                icon="fa fa-cloud-download"
                size="mini"
                plain
                circle
                @click="downExl"
              ></el-button>
78ea6110   梁保满   设备导出提示
18
19
            </el-tooltip>
          </template>
47a01cb6   梁保满   v1.3测试问题
20
21
          <template v-if="role == 'ROLE_XUEXIAO' && type == 1">
            <el-tooltip effect="dark" content="设备导入" placement="bottom">
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
22
23
24
25
26
27
28
29
              <el-button
                type="primary"
                icon="el-icon-upload2"
                size="mini"
                plain
                circle
                @click="diaUp = true"
              ></el-button>
47a01cb6   梁保满   v1.3测试问题
30
31
            </el-tooltip>
            <el-tooltip effect="dark" content="添加基站" placement="bottom">
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
32
33
34
35
36
37
38
39
40
              <el-button
                type="primary"
                icon="el-icon-receiving"
                size="mini"
                plain
                circle
                @click="addDev"
              ></el-button> </el-tooltip
          ></template>
bb778c90   阿宝   设备状态
41
42
        </template>
      </back-box>
1365ef5e   梁保满   优化
43
      <div>
db11048f   阿宝   设备状态,学校管理
44
45
46
47
48
49
50
        <div class="tab-box">
          <el-radio-group v-model="type">
            <el-radio-button :label="1">基站管理</el-radio-button>
            <el-radio-button :label="2">答题器管理</el-radio-button>
            <el-radio-button :label="3">授课端管理</el-radio-button>
          </el-radio-group>
        </div>
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
51
52
53
54
        <p
          v-show="(type == 1 && stationCount) || (type == 2 && clickerCount)"
          class="error-tips"
        >
d4b9eb45   梁保满   设备异常信息
55
56
          有{{
            type == 1 ? stationCount : clickerCount
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
57
58
59
60
          }}条设备异常信息,<router-link
            :to="{ path: '/deviceError', query: { type: type } }"
            >点击查看&gt;&gt;</router-link
          >
8ef22809   梁保满   软件下载页面添加.net环境下载
61
        </p>
db11048f   阿宝   设备状态,学校管理
62
        <div class="content">
8ea67428   梁保满   飞书bug
63
          <div v-show="type == 1">
225a00b6   梁保满   飞书问题解决
64
            <div class="chart-box" v-if="count">
db11048f   阿宝   设备状态,学校管理
65
              <div class="device-num">
225a00b6   梁保满   飞书问题解决
66
                <p class="p1">{{ count }}</p>
db11048f   阿宝   设备状态,学校管理
67
68
69
                <p class="p2">基站数量</p>
              </div>
              <div class="chart">
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
70
71
72
73
74
                <pie-chart
                  id="pieChart"
                  :params="chartData"
                  @clickPieChart="clickPieChart"
                ></pie-chart>
db11048f   阿宝   设备状态,学校管理
75
76
77
78
79
              </div>
            </div>
            <div class="table-box">
              <div class="answer-header">
                <div class="sel-box">
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
                  <el-cascader
                    size="small"
                    class="sel sel2"
                    clearable
                    placeholder="选择班级"
                    v-model="query.classId"
                    :options="gradeList"
                    :props="props"
                    collapse-tags
                    :show-all-levels="false"
                  ></el-cascader>
                  <el-select
                    class="sel"
                    v-model="query.onlineStatus"
                    placeholder="选择状态"
                    @change="_QueryData(true)"
                  >
                    <el-option
                      v-for="item in statusList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    >
db11048f   阿宝   设备状态,学校管理
103
104
                    </el-option>
                  </el-select>
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
105
106
107
108
109
110
111
112
113
114
115
116
                  <el-input
                    placeholder="请输入设备编码"
                    v-model="query.sn"
                    class="input-with-select"
                    clearable
                    @keyup.enter.native="_QueryData(true)"
                  >
                    <el-button
                      slot="append"
                      icon="el-icon-search"
                      @click="_QueryData(true)"
                    ></el-button>
db11048f   阿宝   设备状态,学校管理
117
                  </el-input>
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
118
119
120
                  <el-button class="serach-box" round @click="_QueryData(true)"
                    >筛选</el-button
                  >
db11048f   阿宝   设备状态,学校管理
121
122
                </div>
              </div>
47a01cb6   梁保满   v1.3测试问题
123
124
125
126
              <p class="loading" v-if="!tableData.length && loading">
                加载中<i class="el-icon-loading"></i>
              </p>
              <el-table v-else :data="tableData" border style="width: 100%">
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
                <el-table-column
                  prop="sn"
                  label="设备编码"
                  align="center"
                ></el-table-column>
                <el-table-column
                  prop="frequency"
                  label="频点"
                  align="center"
                  width="60"
                ></el-table-column>
                <el-table-column
                  prop="pairingCode"
                  label="配对码"
                  align="center"
                ></el-table-column>
                <el-table-column
                  v-if="role == 'ROLE_JITUAN'"
                  prop="schoolName"
                  label="学校"
                  align="center"
                ></el-table-column>
                <el-table-column prop="gradeName" label="年级" align="center"
                  ><template slot-scope="scoped">
e5e4a3e6   梁保满   v1.3
151
152
153
                    <p v-for="(item, index) in scoped.row.classList" :key="index">
                      {{ item.gradeName }}
                    </p>
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
154
155
156
157
158
159
160
                  </template></el-table-column
                >
                <el-table-column
                  prop="roomName"
                  label="所在教室"
                  align="center"
                ></el-table-column>
23a6dc5f   阿宝   学校管理相关接口简单对接
161
162
                <el-table-column label="关联班级" align="center">
                  <template slot-scope="scoped">
e3b0e3e7   梁保满   季度时间格式调整
163
                    <p v-for="(item, index) in scoped.row.classList" :key="index">
23a6dc5f   阿宝   学校管理相关接口简单对接
164
165
166
167
                      {{ item.className }}
                    </p>
                  </template>
                </el-table-column>
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
                <el-table-column
                  prop="otaVersionName"
                  label="固件版本号"
                  align="center"
                ></el-table-column>
                <el-table-column
                  prop="onlineTime"
                  label="最近上报"
                  align="center"
                  width="160"
                ></el-table-column>
                <el-table-column
                  prop="createdTime"
                  label="创建时间"
                  align="center"
                  width="160"
                ></el-table-column>
                <el-table-column label="状态" align="center" width="60"
                  ><template slot-scope="scope">
db11048f   阿宝   设备状态,学校管理
187
                    {{
6d7bd862   梁保满   飞书bug
188
                      scope.row.onlineStatus == 1
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
189
190
                        ? "在线"
                        : scope.row.onlineStatus == 2
6d7bd862   梁保满   飞书bug
191
192
                        ? "异常"
                        : "离线"
db11048f   阿宝   设备状态,学校管理
193
                    }}
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
                  </template></el-table-column
                >
                <el-table-column label="操作" align="center" width="130"
                  ><template slot-scope="scoped">
                    <el-tooltip
                      effect="dark"
                      v-if="role != 'ROLE_JITUAN'"
                      content="修改基站"
                      placement="top"
                    >
                      <el-button
                        type="primary"
                        circle
                        size="mini"
                        icon="fa fa-edit"
                        @click="edit(scoped.row)"
                      ></el-button>
db11048f   阿宝   设备状态,学校管理
211
212
                    </el-tooltip>
                    <el-tooltip effect="dark" content="日志" placement="top">
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
213
214
215
216
217
218
219
                      <el-button
                        type="warning"
                        circle
                        size="mini"
                        icon="fa fa-eye"
                        @click="linkTo(scoped.row, 1)"
                      ></el-button>
29319cfb   梁保满   设备。教师管理
220
                    </el-tooltip>
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
221
                    <el-popconfirm
014b7030   梁保满   集团管理员隐藏删除设备
222
                      v-if="role != 'ROLE_JITUAN'"
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
223
224
225
226
227
228
229
230
231
232
233
234
235
                      title="确定删除吗?"
                      @confirm="_delStation($event, scoped.row)"
                    >
                      <el-button
                        class="del"
                        slot="reference"
                        type="danger"
                        circle
                        size="mini"
                        icon="fa fa-trash-o"
                      ></el-button>
                    </el-popconfirm> </template
                ></el-table-column>
db11048f   阿宝   设备状态,学校管理
236
237
238
              </el-table>
            </div>
          </div>
8ea67428   梁保满   飞书bug
239
          <div v-show="type == 2">
225a00b6   梁保满   飞书问题解决
240
            <div class="chart-box" v-if="count">
db11048f   阿宝   设备状态,学校管理
241
              <div class="device-num">
225a00b6   梁保满   飞书问题解决
242
                <p class="p1">{{ count }}</p>
db11048f   阿宝   设备状态,学校管理
243
244
245
                <p class="p2">答题器数量</p>
              </div>
              <div class="chart">
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
246
247
248
249
250
                <scatter-chart
                  id="scatterChart"
                  :params="chartData2"
                  @clickScatterChart="clickScatterChart"
                ></scatter-chart>
db11048f   阿宝   设备状态,学校管理
251
252
253
254
255
              </div>
            </div>
            <div class="table-box">
              <div class="answer-header">
                <div class="sel-box">
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
                  <el-cascader
                    size="small"
                    class="sel sel2"
                    clearable
                    placeholder="选择班级"
                    v-model="query.classId"
                    :options="gradeList"
                    :props="props"
                    collapse-tags
                    :show-all-levels="false"
                  ></el-cascader>
                  <el-select
                    class="sel"
                    v-model="query.type"
                    placeholder="选择状态"
                    @change="_QueryData(true)"
                  >
                    <el-option
                      v-for="item in typeList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    >
db11048f   阿宝   设备状态,学校管理
279
280
                    </el-option>
                  </el-select>
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
281
282
283
284
285
286
287
288
289
290
291
292
293
                  <el-input
                    placeholder="请输入设备编码"
                    v-model="query.sn"
                    class="input-with-select"
                    clearable
                    @input.native="query.studentName = ''"
                    @keyup.enter.native="_QueryData(true)"
                  >
                    <el-button
                      slot="append"
                      icon="el-icon-search"
                      @click="_QueryData(true)"
                    ></el-button>
4c2fb560   梁保满   反馈新需求
294
                  </el-input>
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
295
296
297
298
299
300
301
302
303
304
305
306
307
                  <el-input
                    placeholder="学生姓名"
                    v-model="query.studentName"
                    class="input-with-select"
                    clearable
                    @input.native="query.sn = ''"
                    @keyup.enter.native="_QueryData(true)"
                  >
                    <el-button
                      slot="append"
                      icon="el-icon-search"
                      @click="_QueryData(true)"
                    ></el-button>
db11048f   阿宝   设备状态,学校管理
308
                  </el-input>
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
309
310
311
                  <el-button class="serach-box" round @click="_QueryData(true)"
                    >筛选</el-button
                  >
db11048f   阿宝   设备状态,学校管理
312
313
                </div>
              </div>
47a01cb6   梁保满   v1.3测试问题
314
315
316
317
              <p class="loading" v-if="!tableData.length && loading">
                加载中<i class="el-icon-loading"></i>
              </p>
              <el-table v-else :data="tableData" border style="width: 100%">
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
318
319
320
321
322
323
324
325
326
327
328
                <el-table-column
                  prop="sn"
                  label="设备编码"
                  align="center"
                ></el-table-column>
                <el-table-column label="学生信息" align="center"
                  ><template slot-scope="scoped">
                    <p
                      v-for="(item, index) in scoped.row.studentList"
                      :key="index"
                    >
23a6dc5f   阿宝   学校管理相关接口简单对接
329
                      {{ item.studentName }}
29319cfb   梁保满   设备。教师管理
330
                    </p>
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
                  </template></el-table-column
                >
                <el-table-column
                  v-if="role == 'ROLE_JITUAN'"
                  prop="schoolName"
                  label="学校"
                  align="center"
                ></el-table-column>
                <el-table-column
                  v-if="role == 'ROLE_JITUAN'"
                  prop="gradeName"
                  label="年级"
                  align="center"
                  width="120"
                  ><template slot-scope="scoped">
e5e4a3e6   梁保满   v1.3
346
347
348
                    <p v-for="(item, index) in scoped.row.classList" :key="index">
                      {{ item.gradeName }}
                    </p>
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
349
350
351
352
353
354
355
356
                  </template></el-table-column
                >
                <el-table-column
                  prop="class"
                  label="关联班级"
                  align="center"
                  width="160"
                >
23a6dc5f   阿宝   学校管理相关接口简单对接
357
                  <template slot-scope="scoped">
6d7bd862   梁保满   飞书bug
358
                    <p v-for="(item, index) in scoped.row.classList" :key="index">
23a6dc5f   阿宝   学校管理相关接口简单对接
359
360
                      {{ item.className }}
                    </p>
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
                  </template></el-table-column
                >
                <el-table-column
                  prop="pairingCode"
                  label="配对码"
                  align="center"
                ></el-table-column>
                <el-table-column
                  prop="answerTimes"
                  label="答题次数"
                  align="center"
                ></el-table-column>
                <el-table-column
                  prop="latestReportTime"
                  label="最后答题时间"
                  align="center"
                  width="160"
                ></el-table-column>
                <el-table-column label="操作" align="center" width="80"
                  ><template slot-scope="scoped">
db11048f   阿宝   设备状态,学校管理
381
                    <el-tooltip effect="dark" content="日志" placement="top">
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
382
383
384
385
386
387
388
389
390
                      <el-button
                        type="warning"
                        circle
                        size="mini"
                        icon="fa fa-eye"
                        @click="linkTo(scoped.row, 2)"
                      ></el-button>
                    </el-tooltip> </template
                ></el-table-column>
db11048f   阿宝   设备状态,学校管理
391
392
393
              </el-table>
            </div>
          </div>
8ea67428   梁保满   飞书bug
394
          <div v-show="type == 3">
db11048f   阿宝   设备状态,学校管理
395
396
397
            <div class="table-box">
              <div class="answer-header">
                <div class="sel-box">
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
                  <el-cascader
                    size="small"
                    class="sel sel2"
                    clearable
                    placeholder="选择班级"
                    v-model="query.classId"
                    :options="gradeList"
                    :props="props"
                    collapse-tags
                    :show-all-levels="false"
                    @change="_QueryData(false)"
                  ></el-cascader>
                  <span class="sel"
                    >共选择{{ selectionTabIds.length }}个授课端</span
                  >
                  <el-button plan round @click="autoUpDate(false)"
                    >开启自动更新</el-button
                  >
                  <el-button plan round @click="stopUpdate(false)"
                    >停止自动更新</el-button
                  >
db11048f   阿宝   设备状态,学校管理
419
                </div>
ec6394d1   梁保满   v1.3.1。细节调整
420
421
422
423
424
                <p class="upgrade-all" v-if="this.role == 'ROLE_XUEXIAO'">
                  <span>全校更新:</span>
                  <el-switch v-model="upgradeFlag" @change="changeUpdateBySchool">
                  </el-switch>
                </p>
db11048f   阿宝   设备状态,学校管理
425
              </div>
47a01cb6   梁保满   v1.3测试问题
426
427
428
              <p class="loading" v-if="!tableData.length && loading">
                加载中<i class="el-icon-loading"></i>
              </p>
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
429
430
431
432
433
434
435
436
              <el-table
                v-else
                ref="multipleTable"
                :data="tableData"
                border
                style="width: 100%"
                @selection-change="handleSelectionChange"
              >
6d7bd862   梁保满   飞书bug
437
                <el-table-column type="selection" width="55"></el-table-column>
29319cfb   梁保满   设备。教师管理
438
                <!-- <el-table-column prop="sn" label="设备编码" align="center"></el-table-column> -->
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
439
440
441
442
443
444
                <el-table-column
                  prop="class"
                  label="关联班级"
                  align="center"
                  width="100"
                  ><template slot-scope="scoped">
6d7bd862   梁保满   飞书bug
445
                    <p v-for="(item, index) in scoped.row.classList" :key="index">
23a6dc5f   阿宝   学校管理相关接口简单对接
446
447
                      {{ item.className }}
                    </p>
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
                  </template></el-table-column
                >
                <el-table-column
                  v-if="role == 'ROLE_JITUAN'"
                  prop="schoolName"
                  label="学校"
                  align="center"
                ></el-table-column>
                <el-table-column
                  v-if="role == 'ROLE_JITUAN'"
                  prop="gradeName"
                  label="年级"
                  align="center"
                  width="80"
                  ><template slot-scope="scoped">
4c2fb560   梁保满   反馈新需求
463
464
465
                    <p v-for="(item, index) in scoped.row.classList" :key="index">
                      {{ item.gradeName }}
                    </p>
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
                  </template></el-table-column
                >
                <el-table-column
                  prop="lastUpdateTime"
                  label="最近更新"
                  align="center"
                ></el-table-column>
                <el-table-column
                  prop="osInfo"
                  label="软件系统"
                  align="center"
                ></el-table-column>
                <el-table-column
                  prop="hardwareInfo"
                  label="硬件环境"
                  align="center"
                ></el-table-column>
                <el-table-column
                  prop="otaVersionName"
                  label="版本号"
                  align="center"
                  width="80"
                ></el-table-column>
                <el-table-column label="状态" align="center" width="80"
                  ><template slot-scope="scope">
db11048f   阿宝   设备状态,学校管理
491
                    {{
6d7bd862   梁保满   飞书bug
492
                      scope.row.onlineStatus == 1
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
493
494
                        ? "在线"
                        : scope.row.onlineStatus == 2
6d7bd862   梁保满   飞书bug
495
496
                        ? "异常"
                        : "离线"
db11048f   阿宝   设备状态,学校管理
497
                    }}
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
498
499
                  </template></el-table-column
                >
29319cfb   梁保满   设备。教师管理
500
501
                <el-table-column label="日志记录" align="center" width="80">
                  <template slot-scope="scope">
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
502
503
504
505
506
507
                    <el-link
                      type="primary"
                      @click="openLogia(scope.row.id)"
                      download
                      >查看</el-link
                    >
29319cfb   梁保满   设备。教师管理
508
509
                  </template>
                </el-table-column>
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
510
511
512
513
514
515
516
517
                <el-table-column label="自动更新" align="center" width="100"
                  ><template slot-scope="scoped">
                    <el-switch
                      v-model="scoped.row.upgradeFlag"
                      @change="changeUpdate($event, scoped.row, this)"
                    >
                    </el-switch> </template
                ></el-table-column>
db11048f   阿宝   设备状态,学校管理
518
519
520
              </el-table>
            </div>
          </div>
23a6dc5f   阿宝   学校管理相关接口简单对接
521
          <div class="pagination-box">
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
522
523
524
525
526
527
528
529
530
            <el-pagination
              small=""
              layout="total,prev, pager, next"
              :hide-on-single-page="true"
              :total="total"
              @current-change="changePage"
              :current-page="page"
              :page-size="size"
            >
23a6dc5f   阿宝   学校管理相关接口简单对接
531
532
            </el-pagination>
          </div>
db11048f   阿宝   设备状态,学校管理
533
534
        </div>
      </div>
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
535
536
537
538
539
540
      <el-dialog
        :close-on-click-modal="false"
        title="设备导入"
        :visible.sync="diaUp"
        width="400"
      >
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
541
        <upload :url="url" @upSuccess="upSuccess" fileName="设备信息">
db11048f   阿宝   设备状态,学校管理
542
543
          <p class="down-txt" slot="down">
            通过Excel名单导入设备,需要提供设备编码,点击
23a6dc5f   阿宝   学校管理相关接口简单对接
544
            <el-link type="danger" @click="downExcel">模板下载</el-link> 。
db11048f   阿宝   设备状态,学校管理
545
          </p>
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
546
        </upload>
db11048f   阿宝   设备状态,学校管理
547
548
549
550
        <div class="dialog-footer" slot="footer">
          <el-button @click="diaUp = false">取 消</el-button>
        </div>
      </el-dialog>
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
551
552
553
554
555
556
      <el-dialog
        :close-on-click-modal="false"
        :title="isAdd ? '添加基站' : '修改基站'"
        :visible.sync="diaAnswerEqu"
        width="400"
      >
db11048f   阿宝   设备状态,学校管理
557
        <el-form ref="forms" :model="form" :rules="formRules" label-width="140px">
1365ef5e   梁保满   优化
558
          <el-form-item label="设备编码:" prop="sn">
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
559
560
561
562
563
564
565
566
567
568
569
570
            <el-col :span="16"
              ><el-input
                type="text"
                placeholder="输入设备编码"
                v-model.trim="form.sn"
                maxlength="30"
                size="45"
                show-word-limit
                :disabled="!isAdd"
              >
              </el-input
            ></el-col>
db11048f   阿宝   设备状态,学校管理
571
          </el-form-item>
23a6dc5f   阿宝   学校管理相关接口简单对接
572
          <el-form-item label="频点:" prop="frequency">
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
573
574
575
576
577
578
579
580
581
582
583
            <el-col :span="16"
              ><el-input
                type="text"
                placeholder="输入频点"
                v-model.trim="form.frequency"
                maxlength="30"
                size="45"
                show-word-limit
              >
              </el-input
            ></el-col>
db11048f   阿宝   设备状态,学校管理
584
          </el-form-item>
23a6dc5f   阿宝   学校管理相关接口简单对接
585
          <el-form-item label="配对码:" prop="pairingCode">
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
586
587
588
589
590
591
592
593
594
595
596
            <el-col :span="16"
              ><el-input
                type="text"
                placeholder="输入配对码"
                v-model.trim="form.pairingCode"
                maxlength="30"
                size="45"
                show-word-limit
              >
              </el-input
            ></el-col>
db11048f   阿宝   设备状态,学校管理
597
          </el-form-item>
6d7bd862   梁保满   飞书bug
598
599
          <el-form-item label="选择班级:" prop="classIds">
            <el-col :span="16">
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
600
601
602
603
604
605
606
              <el-cascader
                class="sel"
                clearable
                v-model="form.classIds"
                :options="gradeList"
                :show-all-levels="false"
              ></el-cascader>
db11048f   阿宝   设备状态,学校管理
607
608
609
            </el-col>
          </el-form-item>
          <el-form-item label="所在教室:">
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
610
611
612
613
614
615
616
617
618
619
620
            <el-col :span="16"
              ><el-input
                type="text"
                placeholder="输入所在教室"
                v-model.trim="form.roomName"
                maxlength="30"
                size="45"
                show-word-limit
              >
              </el-input
            ></el-col>
db11048f   阿宝   设备状态,学校管理
621
622
623
          </el-form-item>
        </el-form>
        <div class="dialog-footer" slot="footer">
236b1f0e   梁保满   周末-飞书bug
624
          <el-button type="primary" @click="setAnswerEqu">确 定</el-button>
db11048f   阿宝   设备状态,学校管理
625
626
627
          <el-button @click="diaAnswerEqu = false">取 消</el-button>
        </div>
      </el-dialog>
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
      <el-dialog
        :close-on-click-modal="false"
        title="设备日志"
        :visible.sync="diaLog"
        width="400"
      >
        <div v-loading="logLoading">
          <p class="down-p" v-for="item in logList">
            {{ item.modifiedTime }} -
            <el-link type="primary" :href="item.content" download>下载</el-link>
          </p>
          <el-empty
            :image-size="100"
            v-if="!logList.length && !logLoading"
            description="暂无数据"
          ></el-empty>
          <div class="pagination-box">
            <el-pagination
              small=""
              layout="total,prev, pager, next"
              :hide-on-single-page="true"
              :total="logTotal"
              @current-change="logChangePage"
              :current-page="logPage"
              :page-size="logSize"
            >
            </el-pagination>
          </div>
        </div>
        <div class="dialog-footer" slot="footer">
2e5b8dea   梁保满   分数设置修改,
658
          <el-button @click="diaLog = false">取 消</el-button>
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
659
660
        </div>
      </el-dialog>
bb778c90   阿宝   设备状态
661
    </div>
4c4f7640   梁保满   路由表,路由前端文件
662
663
664
  </template>
  
  <script>
db11048f   阿宝   设备状态,学校管理
665
666
667
  import pieChart from "@/components/charts/pieChart";
  import scatterChart from "@/components/charts/scatterChart";
  import _ from "lodash";
191d5bfa   梁保满   学生管理、基站管理下载名称设置,上...
668
  import { downloadFile, getBlob, formatGradeNameClass } from "@/utils";
255e2506   梁保满   飞书bug及优化
669
  import api from "@/api/apis/apis";
db11048f   阿宝   设备状态,学校管理
670
671
  export default {
    components: { pieChart, scatterChart },
23a6dc5f   阿宝   学校管理相关接口简单对接
672
673
674
675
    watch: {
      type: function (val) {
        this.page = 1;
        this.total = 0;
225a00b6   梁保满   飞书问题解决
676
        this.count = 0;
23a6dc5f   阿宝   学校管理相关接口简单对接
677
678
679
        this.query.classId = [];
        this.query.onlineStatus = "";
        this.query.sn = "";
4c2fb560   梁保满   反馈新需求
680
        this.query.studentName = "";
23a6dc5f   阿宝   学校管理相关接口简单对接
681
682
683
684
685
686
687
688
689
        this.query.type = "";
        if (val == 1) {
          this.stationReport();
        } else if (val == 2) {
          this.keyboardReport();
        }
        this._QueryData();
      },
    },
db11048f   阿宝   设备状态,学校管理
690
691
    data() {
      return {
d32e461c   梁保满   备题组卷
692
        code: "",
4c2fb560   梁保满   反馈新需求
693
        role: "",
db11048f   阿宝   设备状态,学校管理
694
        loading: false,
4c2fb560   梁保满   反馈新需求
695
696
        exportLoading: false,
        isAdd: false, //添加还是修改基站
87abc4f3   梁保满   基站上传接口地址修改
697
        url: "/api_html/school/manager/importStation",
db11048f   阿宝   设备状态,学校管理
698
699
        diaUp: false,
        diaAnswerEqu: false,
4c2fb560   梁保满   反馈新需求
700
701
        gradeList: [], //年级列表
        schoolAll: [], //所有学校刘表
e3b0e3e7   梁保满   季度时间格式调整
702
        school: {}, //校园账号所属学校信息
255e2506   梁保满   飞书bug及优化
703
704
705
        props: {
          multiple: true,
          checkStrictly: true,
255e2506   梁保满   飞书bug及优化
706
        },
db11048f   阿宝   设备状态,学校管理
707
708
709
        type: 1,
        query: {
          classId: [],
23a6dc5f   阿宝   学校管理相关接口简单对接
710
711
712
          onlineStatus: "",
          sn: "",
          type: "",
4c2fb560   梁保满   反馈新需求
713
          studentName: "",
db11048f   阿宝   设备状态,学校管理
714
715
        },
        statusList: [
dbbfc6c5   梁保满   飞书优化及bug
716
          { label: "全部", value: "" },
23a6dc5f   阿宝   学校管理相关接口简单对接
717
          { label: "离线", value: 0 },
db11048f   阿宝   设备状态,学校管理
718
          { label: "在线", value: 1 },
23a6dc5f   阿宝   学校管理相关接口简单对接
719
720
721
722
723
724
725
726
727
728
          { label: "异常", value: 2 },
        ],
        typeList: [
          { label: "全部", value: 0 },
          { label: "1日内", value: 1 },
          { label: "3日内", value: 2 },
          { label: "7日内", value: 3 },
          { label: "1月内", value: 4 },
          { label: "3月内", value: 5 },
          { label: "3月以上", value: 6 },
db11048f   阿宝   设备状态,学校管理
729
730
        ],
        form: {
4c2fb560   梁保满   反馈新需求
731
          //修改/添加基站信息
255e2506   梁保满   飞书bug及优化
732
          deviceId: "",
1365ef5e   梁保满   优化
733
          sn: "",
23a6dc5f   阿宝   学校管理相关接口简单对接
734
735
          frequency: "",
          pairingCode: "",
183bfae8   梁保满   设备修改班级选择调整
736
          classIds: [],
23a6dc5f   阿宝   学校管理相关接口简单对接
737
          roomName: "",
db11048f   阿宝   设备状态,学校管理
738
739
        },
        formRules: {
e3b0e3e7   梁保满   季度时间格式调整
740
          sn: [{ required: true, message: "请输入设备编码", trigger: "blur" }],
23a6dc5f   阿宝   学校管理相关接口简单对接
741
742
743
744
          frequency: [{ required: true, message: "请输入频点", trigger: "blur" }],
          pairingCode: [
            { required: true, message: "请输入配对码", trigger: "blur" },
          ],
4c2fb560   梁保满   反馈新需求
745
          // classIds: [{ required: true, message: "请选择班级", trigger: "blur" }],
db11048f   阿宝   设备状态,学校管理
746
        },
23a6dc5f   阿宝   学校管理相关接口简单对接
747
748
        tableData: [],
        total: 0,
225a00b6   梁保满   飞书问题解决
749
        count: 0,
23a6dc5f   阿宝   学校管理相关接口简单对接
750
751
        chartData: [],
        chartData2: [],
4c2fb560   梁保满   反馈新需求
752
        selectionTabIds: [], //已选择授课段
23a6dc5f   阿宝   学校管理相关接口简单对接
753
754
        page: 1,
        size: 20,
4c2fb560   梁保满   反馈新需求
755
        isBack: false, //是否是日志页面回来
ec6394d1   梁保满   v1.3.1。细节调整
756
        upgradeFlag: false,
d4b9eb45   梁保满   设备异常信息
757
758
        stationCount: 0, //异常基站数量
        clickerCount: 0, //异常答题器数量
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
759
760
761
762
763
764
765
        // 设备日志相关
        diaLog: false,
        logLoading: false,
        logList: [],
        logTotal: 0,
        logPage: 1,
        logSize: 20,
db11048f   阿宝   设备状态,学校管理
766
767
768
      };
    },
    created() {
7812e986   梁保满   班主任查看报表添加额外信息
769
      this.code = this.$store.getters.csCode;
87053bc8   梁保满   设备状态模版下载更新
770
771
772
      this.role =
        this.$store.getters.info.showRole ||
        this.$store.getters.info.permissions[0].role;
d4b9eb45   梁保满   设备异常信息
773
      this._QueryErrorTotal();
255e2506   梁保满   飞书bug及优化
774
      if (this.role == "ROLE_JITUAN") {
e3b0e3e7   梁保满   季度时间格式调整
775
776
777
778
        (this.props.lazy = true),
          (this.props.lazyLoad = function (node, resolve) {
            const { level } = node;
            if (level == 2) {
e3b0e3e7   梁保满   季度时间格式调整
779
780
781
782
783
784
785
786
787
788
              api
                .tenantClassList({
                  schoolId: node.data.value,
                })
                .then((res) => {
                  let children = formatGradeNameClass(res.data?.list).sort(
                    (a, b) => {
                      return a.grade - b.grade;
                    }
                  );
e3b0e3e7   梁保满   季度时间格式调整
789
790
791
792
793
794
795
796
797
798
799
                  const nodes = [...children];
                  // 通过调用resolve将子节点数据返回,通知组件数据加载完成
                  resolve(nodes);
                });
            } else {
              resolve(node);
            }
          });
      }
      if (this.role == "ROLE_XUEXIAO") {
        this._QueryDataSchool();
255e2506   梁保满   飞书bug及优化
800
      }
23a6dc5f   阿宝   学校管理相关接口简单对接
801
      this._QueryGradeList();
11cb8ce0   梁保满   样式调整
802
      if (this.role == "ROLE_JITUAN") {
225a00b6   梁保满   飞书问题解决
803
804
        this.showSchool();
      }
db11048f   阿宝   设备状态,学校管理
805
    },
5be3bb70   梁保满   切换账号,缓存组件接口报错问题
806
807
    activated() {
      const that = this;
e5e4a3e6   梁保满   v1.3
808
      this.isBack = this.$route.query.back ? this.$route.query.back : false;
e5e4a3e6   梁保满   v1.3
809
      if (!this.isBack) {
5be3bb70   梁保满   切换账号,缓存组件接口报错问题
810
811
812
813
814
815
816
817
        that.type = 1;
        that.page = 1;
        that.total = 0;
        that.count = 0;
        that.query.classId = [];
        that.query.onlineStatus = "";
        that.query.sn = "";
        that.query.type = "";
47a01cb6   梁保满   v1.3测试问题
818
819
820
821
        if (this.role == "ROLE_XUEXIAO") {
          this._QueryDataSchool();
        }
        this._QueryGradeList();
5be3bb70   梁保满   切换账号,缓存组件接口报错问题
822
823
        that.stationReport();
        that._QueryData();
e5e4a3e6   梁保满   v1.3
824
      }
5be3bb70   梁保满   切换账号,缓存组件接口报错问题
825
    },
db11048f   阿宝   设备状态,学校管理
826
    methods: {
191d5bfa   梁保满   学生管理、基站管理下载名称设置,上...
827
      upSuccess(res) {
e3b0e3e7   梁保满   季度时间格式调整
828
        //导入成功
191d5bfa   梁保满   学生管理、基站管理下载名称设置,上...
829
830
831
        this.$message.closeAll();
        this.$message({
          showClose: true,
fc9cbff6   梁保满   上传信息显示调整
832
          message: `成功(${res.data.success})`,
191d5bfa   梁保满   学生管理、基站管理下载名称设置,上...
833
          type: "success",
183bfae8   梁保满   设备修改班级选择调整
834
          duration: 5000,
191d5bfa   梁保满   学生管理、基站管理下载名称设置,上...
835
        });
e3b0e3e7   梁保满   季度时间格式调整
836
        this.diaUp = false;
87abc4f3   梁保满   基站上传接口地址修改
837
        this.page = 1;
255e2506   梁保满   飞书bug及优化
838
839
        this._QueryData();
      },
575eb544   梁保满   账号异常提示,放开长水学校管理员设...
840
841
      edit(obj) {
        //修改设备
0e46bc25   梁保满   优化
842
        this.isAdd = false;
255e2506   梁保满   飞书bug及优化
843
844
        for (let key in this.form) {
          if (key == "classIds") {
5fb1f184   梁保满   答题器管理:不显示 题器配对码,修...
845
846
847
            this.form[key] = obj.classList.length
              ? [obj.classList[0].gradeName, obj.classList[0].classId]
              : [];
255e2506   梁保满   飞书bug及优化
848
849
          } else {
            this.form[key] = obj[key];
6d7bd862   梁保满   飞书bug
850
851
          }
        }
0e46bc25   梁保满   优化
852
        delete this.form.schoolId;
e3b0e3e7   梁保满   季度时间格式调整
853
        this.form.deviceId = obj.id;
255e2506   梁保满   飞书bug及优化
854
        this.diaAnswerEqu = true;
6d7bd862   梁保满   飞书bug
855
      },
db11048f   阿宝   设备状态,学校管理
856
857
858
859
860
861
862
863
864
      linkTo(obj, type) {
        this.$router.push({
          path: "/deviceLog",
          query: {
            id: obj.id,
            type: type,
          },
        });
      },
8ad80958   梁保满   教师学生管理,设备状态
865
      _delStation: _.debounce(async function (event, obj) {
29319cfb   梁保满   设备。教师管理
866
        const { status, info } = await this.$request.deleteStation({
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
867
          id: obj.id,
29319cfb   梁保满   设备。教师管理
868
869
870
871
872
873
874
        });
        if (status === 0) {
          this._QueryData(false);
          this.$message.success(info);
        } else {
          this.$message.error(info);
        }
8ad80958   梁保满   教师学生管理,设备状态
875
      }, 300),
db11048f   阿宝   设备状态,学校管理
876
      clickPieChart(obj) {
23a6dc5f   阿宝   学校管理相关接口简单对接
877
878
879
        this.query.onlineStatus =
          obj.name == "在线" ? 1 : obj.name == "离线" ? 0 : 2;
        this.query.sn = "";
c4eb9615   梁保满   日志页面调整
880
        this.query.classId = [];
23a6dc5f   阿宝   学校管理相关接口简单对接
881
        this.page = 1;
b21d90ef   梁保满   长水登录
882
        this._QueryData(false);
db11048f   阿宝   设备状态,学校管理
883
884
      },
      clickScatterChart(obj) {
23a6dc5f   阿宝   学校管理相关接口简单对接
885
886
887
888
        this.query.type =
          obj.name == "1日内"
            ? 1
            : obj.name == "3日内"
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
889
890
891
892
893
894
895
896
            ? 2
            : obj.name == "7日内"
            ? 3
            : obj.name == "1月内"
            ? 4
            : obj.name == "3月内"
            ? 5
            : 6;
23a6dc5f   阿宝   学校管理相关接口简单对接
897
        this.query.sn = "";
c4eb9615   梁保满   日志页面调整
898
        this.query.classId = [];
23a6dc5f   阿宝   学校管理相关接口简单对接
899
        this.page = 1;
b21d90ef   梁保满   长水登录
900
        this._QueryData(false);
db11048f   阿宝   设备状态,学校管理
901
902
      },
      handleSelectionChange(val) {
db11048f   阿宝   设备状态,学校管理
903
904
905
906
        this.selectionTabIds = val.map((item) => {
          return item.id;
        });
      },
ec6394d1   梁保满   v1.3.1。细节调整
907
908
909
      changeUpdateBySchool: _.debounce(function (event) {
        this._ModifyUpgradeFlagBySchool();
      }, 800),
db11048f   阿宝   设备状态,学校管理
910
      changeUpdate: _.debounce(function (event, obj) {
db11048f   阿宝   设备状态,学校管理
911
912
913
914
915
916
        if (event) {
          this.autoUpDate(obj.id);
        } else {
          this.stopUpdate(obj.id);
        }
      }, 800),
23a6dc5f   阿宝   学校管理相关接口简单对接
917
918
      changePage(page) {
        this.page = page;
b21d90ef   梁保满   长水登录
919
        this._QueryData(false);
23a6dc5f   阿宝   学校管理相关接口简单对接
920
      },
e3b0e3e7   梁保满   季度时间格式调整
921
922
923
924
      addDev() {
        this.form.sn = "";
        this.form.frequency = "";
        this.form.pairingCode = "";
183bfae8   梁保满   设备修改班级选择调整
925
        this.form.classIds = [];
e3b0e3e7   梁保满   季度时间格式调整
926
        this.form.roomName = "";
0e46bc25   梁保满   优化
927
928
929
        this.form.schoolId = this.school.id;
        delete this.form.deviceId;
        this.isAdd = true;
e3b0e3e7   梁保满   季度时间格式调整
930
931
        this.diaAnswerEqu = true;
      },
ec6394d1   梁保满   v1.3.1。细节调整
932
933
934
935
936
937
938
      _ModifyUpgradeFlagBySchool() {
        let data = this.$request.modifyUpgradeFlagBySchool({
          upgradeFlag: this.upgradeFlag ? 1 : 0,
        });
        if (data && !data.code) {
          this._QueryData(false);
          this.selectionTabIds = [];
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
939
940
941
          this.$message.success(
            this.upgradeFlag ? "开启自动更新成功" : "关闭/停止自动更新成功"
          );
ec6394d1   梁保满   v1.3.1。细节调整
942
943
944
945
        } else {
          this.$message.error(data.info);
        }
      },
225a00b6   梁保满   飞书问题解决
946
      async showSchool() {
296f7c47   梁保满   集团管理员接口调整
947
948
        const { data, status, info } = await this.$request.schoolList();
        if (status === 0) {
183bfae8   梁保满   设备修改班级选择调整
949
950
951
952
953
954
          let gradeListAll = data.list?.map((item) => {
            return {
              value: item.id,
              label: item.schoolName,
            };
          });
225a00b6   梁保满   飞书问题解决
955
956
957
958
          this.schoolAll = [
            {
              value: 0,
              label: "全部",
183bfae8   梁保满   设备修改班级选择调整
959
              children: [...gradeListAll],
225a00b6   梁保满   飞书问题解决
960
961
962
            },
          ];
          this.gradeList = [...this.schoolAll, ...this.gradeList];
296f7c47   梁保满   集团管理员接口调整
963
964
965
966
        } else {
          this.$message.error(info);
        }
      },
db11048f   阿宝   设备状态,学校管理
967
968
969
970
971
972
973
      async autoUpDate(id) {
        if (!this.selectionTabIds.length && !id) {
          this.$message.warning("请选择授课端~");
          return;
        }
        if (this.loadingUpDate) return;
        this.loadingUpDate = true;
23a6dc5f   阿宝   学校管理相关接口简单对接
974
        let data = await this.$request.modifyUpgradeFlag({
dd5150c5   阿宝   数据同步
975
          deviceIds: id ? [id] : this.selectionTabIds,
23a6dc5f   阿宝   学校管理相关接口简单对接
976
          upgradeFlag: 1,
db11048f   阿宝   设备状态,学校管理
977
978
979
980
        });
        this.loadingUpDate = false;
        if (data && !data.code) {
          this._QueryData(false);
e5ff81a1   阿宝   集团管理员接口
981
          this.selectionTabIds = [];
db11048f   阿宝   设备状态,学校管理
982
983
          this.$message.success("开启自动更新成功");
        } else {
236b1f0e   梁保满   周末-飞书bug
984
          this.$message.error(data.info);
db11048f   阿宝   设备状态,学校管理
985
986
987
988
989
990
991
992
993
        }
      },
      async stopUpdate(id) {
        if (!this.selectionTabIds.length && !id) {
          this.$message.warning("请选择授课端~");
          return;
        }
        if (this.loadingUpDate) return;
        this.loadingUpDate = true;
23a6dc5f   阿宝   学校管理相关接口简单对接
994
        let data = await this.$request.modifyUpgradeFlag({
dd5150c5   阿宝   数据同步
995
          deviceIds: id ? [id] : this.selectionTabIds,
23a6dc5f   阿宝   学校管理相关接口简单对接
996
          upgradeFlag: 0,
db11048f   阿宝   设备状态,学校管理
997
998
999
        });
        this.loadingUpDate = false;
        if (data && !data.code) {
e5ff81a1   阿宝   集团管理员接口
1000
          this.selectionTabIds = [];
db11048f   阿宝   设备状态,学校管理
1001
1002
1003
          this._QueryData(false);
          this.$message.success("关闭自动更新成功");
        } else {
236b1f0e   梁保满   周末-飞书bug
1004
          this.$message.error(data.info);
db11048f   阿宝   设备状态,学校管理
1005
1006
        }
      },
db11048f   阿宝   设备状态,学校管理
1007
      async downExcel() {
87053bc8   梁保满   设备状态模版下载更新
1008
        let data = await this.$request.stationTemplate({
db11048f   阿宝   设备状态,学校管理
1009
1010
          id: this.id,
        });
87053bc8   梁保满   设备状态模版下载更新
1011
1012
1013
1014
1015
        if (data) {
          let blob = new Blob([data], {
            type: "application/vnd.ms-excel;charset=utf-8",
          });
          downloadFile(`基站模版.xlsx`, blob);
db11048f   阿宝   设备状态,学校管理
1016
        } else {
87053bc8   梁保满   设备状态模版下载更新
1017
          this.$message.error("下载失败");
db11048f   阿宝   设备状态,学校管理
1018
1019
        }
      },
29319cfb   梁保满   设备。教师管理
1020
      //报表导出
ae0a304c   梁保满   学生管理-显示班级基站信息
1021
      async downExl() {
ae0a304c   梁保满   学生管理-显示班级基站信息
1022
        if (this.exportLoading == true) return;
e5e4a3e6   梁保满   v1.3
1023
        let query = this.setQuery();
4c2fb560   梁保满   反馈新需求
1024
1025
1026
1027
1028
        const exportDevice =
          this.role != "ROLE_JITUAN"
            ? this.$request.exportDevice
            : this.$request.tenantExportDevice;
  
ae0a304c   梁保满   学生管理-显示班级基站信息
1029
        this.exportLoading = true;
4c2fb560   梁保满   反馈新需求
1030
        const data = await exportDevice({
e5e4a3e6   梁保满   v1.3
1031
1032
1033
          ...query,
          deviceType: this.type,
        });
ae0a304c   梁保满   学生管理-显示班级基站信息
1034
1035
1036
1037
1038
1039
1040
1041
1042
        this.exportLoading = false;
        if (data && !data.code) {
          let blob = new Blob([data], {
            type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
          });
          let txt =
            this.type == 1
              ? "基站管理报表.xlsx"
              : this.type == 2
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
1043
1044
              ? "答题器报表.xlsx"
              : "授课端报表.xlsx";
ae0a304c   梁保满   学生管理-显示班级基站信息
1045
1046
1047
1048
1049
          downloadFile(txt, blob);
        } else {
          this.$message.error(data.info);
        }
      },
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
      //授课端日志列表
      async openLogia(id) {
        this.diaLog = true;
        this.page = 1;
        this.logLoading = true;
        const { data, info, status } = await this.$request.deviceZipLogList({
          id: id,
          page: this.logPage,
          size: this.logSize,
        });
        this.logLoading = false;
        if (status == 0) {
          this.logList = data?.list || [];
        } else {
          this.$message.error(info);
        }
      },
      async downloadLog() {
        if (this.exportLoading == true) return;
        let query = this.setQuery();
        const exportDevice =
          this.role != "ROLE_JITUAN"
            ? this.$request.exportDevice
            : this.$request.tenantExportDevice;
  
        this.exportLoading = true;
        const data = await exportDevice({
          ...query,
          deviceType: this.type,
        });
        this.exportLoading = false;
        if (data && !data.code) {
          let blob = new Blob([data], {
            type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
          });
          let txt =
            this.type == 1
              ? "基站管理报表.xlsx"
              : this.type == 2
              ? "答题器报表.xlsx"
              : "授课端报表.xlsx";
          downloadFile(txt, blob);
        } else {
          this.$message.error(data.info);
        }
      },
      logChangePage(page) {
        this.logPage = page;
        this.downloadLog();
      },
db11048f   阿宝   设备状态,学校管理
1100
  
236b1f0e   梁保满   周末-飞书bug
1101
1102
      // 修改基站
      setAnswerEqu() {
6d7bd862   梁保满   飞书bug
1103
1104
1105
1106
        this.$refs.forms.validate(async (valid) => {
          if (valid) {
            if (this.loadingAnswerEqu) return;
            this.loadingAnswerEqu = true;
255e2506   梁保满   飞书bug及优化
1107
            let query = { ...this.form };
236b1f0e   梁保满   周末-飞书bug
1108
  
5fb1f184   梁保满   答题器管理:不显示 题器配对码,修...
1109
            query.classIds = query.classIds.length ? [query.classIds[1]] : [];
0e46bc25   梁保满   优化
1110
1111
1112
            let deviceApi = this.isAdd
              ? this.$request.addStation
              : this.$request.updateDevice;
e3b0e3e7   梁保满   季度时间格式调整
1113
            const { data, status, info } = await deviceApi({
255e2506   梁保满   飞书bug及优化
1114
1115
              ...query,
            });
6d7bd862   梁保满   飞书bug
1116
            this.loadingAnswerEqu = false;
6d7bd862   梁保满   飞书bug
1117
            if (status === 0) {
255e2506   梁保满   飞书bug及优化
1118
              this.diaAnswerEqu = false;
1365ef5e   梁保满   优化
1119
              this.$message.success(info);
6d7bd862   梁保满   飞书bug
1120
              this._QueryData();
0e46bc25   梁保满   优化
1121
1122
              if (this.isAdd) {
                this.stationReport();
e3b0e3e7   梁保满   季度时间格式调整
1123
              }
6d7bd862   梁保满   飞书bug
1124
1125
1126
1127
1128
1129
1130
            } else {
              this.$message.error(info);
            }
          } else {
            this.$message.warning("数据有误,请检查!");
          }
        });
db11048f   阿宝   设备状态,学校管理
1131
      },
e3b0e3e7   梁保满   季度时间格式调整
1132
1133
1134
1135
1136
1137
1138
1139
      async _QueryDataSchool() {
        const { data, status, info } = await this.$request.schoolDetail();
        if (status === 0) {
          this.school = { ...data };
        } else {
          this.$message.error(info);
        }
      },
db11048f   阿宝   设备状态,学校管理
1140
      // 查找班级
23a6dc5f   阿宝   学校管理相关接口简单对接
1141
1142
      async _QueryGradeList() {
        this.loading = true;
e5ff81a1   阿宝   集团管理员接口
1143
1144
1145
1146
1147
        const gradeList =
          this.role != "ROLE_JITUAN"
            ? this.$request.gradeList
            : this.$request.regionList;
        const { data, status, info } = await gradeList();
23a6dc5f   阿宝   学校管理相关接口简单对接
1148
1149
        if (status === 0) {
          if (!!data.list) {
e5ff81a1   阿宝   集团管理员接口
1150
1151
1152
1153
            if (this.role != "ROLE_JITUAN") {
              this.gradeList =
                data.list?.map((item) => {
                  let gradeList = {
1b9bae95   梁保满   级联选择器调整,日志接口调整
1154
                    value: item.gradeName,
e5ff81a1   阿宝   集团管理员接口
1155
1156
1157
1158
1159
                    label: item.gradeName,
                  };
                  gradeList.children =
                    item.classList?.map((items) => {
                      return {
1365ef5e   梁保满   优化
1160
                        value: Number(items.id),
e5ff81a1   阿宝   集团管理员接口
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
                        label: items.className,
                      };
                    }) || [];
                  return gradeList;
                }) || [];
            } else {
              this.gradeList =
                data.list?.map((item) => {
                  let gradeList = {
                    value: item.id,
                    label: item.regionName,
                  };
                  gradeList.children =
                    item.schoolList?.map((items) => {
                      return {
                        value: items.id,
                        label: items.schoolName,
                      };
                    }) || [];
                  return gradeList;
                }) || [];
225a00b6   梁保满   飞书问题解决
1182
              this.gradeList = [...this.schoolAll, ...this.gradeList];
e5ff81a1   阿宝   集团管理员接口
1183
            }
23a6dc5f   阿宝   学校管理相关接口简单对接
1184
1185
1186
1187
1188
1189
1190
          }
        } else {
          this.$message.error(info);
        }
      },
      // 基站统计数据
      async stationReport() {
e5ff81a1   阿宝   集团管理员接口
1191
1192
1193
1194
1195
        const stationReport =
          this.role != "ROLE_JITUAN"
            ? this.$request.stationReport
            : this.$request.tenantStationReport;
        const { data, status, info } = await stationReport();
23a6dc5f   阿宝   学校管理相关接口简单对接
1196
1197
1198
1199
1200
        if (status === 0) {
          this.chartData =
            data.list?.map((item) => {
              return {
                name:
e5ff81a1   阿宝   集团管理员接口
1201
1202
1203
                  item.onlineStatus == "1"
                    ? "在线"
                    : item.onlineStatus == 0
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
1204
1205
                    ? "离线"
                    : "异常",
296f7c47   梁保满   集团管理员接口调整
1206
1207
                value: item.total,
                rate: item.rate,
23a6dc5f   阿宝   学校管理相关接口简单对接
1208
1209
              };
            }) || [];
225a00b6   梁保满   飞书问题解决
1210
          this.count = data.total || 0;
23a6dc5f   阿宝   学校管理相关接口简单对接
1211
1212
1213
1214
1215
1216
        } else {
          this.$message.error(info);
        }
      },
      // 答题器统计数据
      async keyboardReport() {
e5ff81a1   阿宝   集团管理员接口
1217
1218
1219
1220
1221
        const keyboardReport =
          this.role != "ROLE_JITUAN"
            ? this.$request.keyboardReport
            : this.$request.tenantKeyboardReport;
        const { data, status, info } = await keyboardReport();
23a6dc5f   阿宝   学校管理相关接口简单对接
1222
1223
1224
1225
1226
1227
1228
1229
        if (status === 0) {
          this.chartData2 =
            data.list?.map((item) => {
              return {
                name:
                  item.type == 1
                    ? "1日内"
                    : item.type == 2
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
1230
1231
1232
1233
1234
1235
1236
1237
                    ? "3日内"
                    : item.type == 3
                    ? "7日内"
                    : item.type == 4
                    ? "1月内"
                    : item.type == 5
                    ? "3月内"
                    : "3月以上",
225a00b6   梁保满   飞书问题解决
1238
1239
                count: item.total,
                value: item.rate * 100,
23a6dc5f   阿宝   学校管理相关接口简单对接
1240
1241
              };
            }) || [];
225a00b6   梁保满   飞书问题解决
1242
          this.count = data.total || 0;
23a6dc5f   阿宝   学校管理相关接口简单对接
1243
1244
1245
        } else {
          this.$message.error(info);
        }
db11048f   阿宝   设备状态,学校管理
1246
      },
225a00b6   梁保满   飞书问题解决
1247
1248
1249
      setQuery() {
        //整理传参
        let query = {};
23a6dc5f   阿宝   学校管理相关接口简单对接
1250
        if (this.query.sn) {
5e2e009a   梁保满   基站筛选条件显示问题,归档文本替换
1251
1252
1253
1254
          this.query.classId = [];
          this.query.onlineStatus = "";
          this.query.type = "";
          this.query.studentName = "";
23a6dc5f   阿宝   学校管理相关接口简单对接
1255
          query.sn = this.query.sn;
4c2fb560   梁保满   反馈新需求
1256
        } else if (this.query.studentName) {
5e2e009a   梁保满   基站筛选条件显示问题,归档文本替换
1257
1258
1259
1260
          this.query.classId = [];
          this.query.onlineStatus = "";
          this.query.type = "";
          this.query.sn = "";
4c2fb560   梁保满   反馈新需求
1261
          query.studentName = this.query.studentName;
23a6dc5f   阿宝   学校管理相关接口简单对接
1262
        } else {
23a6dc5f   阿宝   学校管理相关接口简单对接
1263
1264
1265
1266
1267
1268
1269
          if (this.type == 1) {
            this.query.onlineStatus !== ""
              ? (query.onlineStatus = this.query.onlineStatus)
              : "";
          } else if (this.type == 2) {
            this.query.type !== "" ? (query.type = this.query.type) : "";
          }
1b9bae95   梁保满   级联选择器调整,日志接口调整
1270
1271
1272
          if (this.role == "ROLE_JITUAN") {
            query.regionIds = [];
            query.schoolIds = [];
255e2506   梁保满   飞书bug及优化
1273
1274
            query.gradeNames = [];
            query.classIds = [];
1b9bae95   梁保满   级联选择器调整,日志接口调整
1275
1276
            this.query.classId?.map((item) => {
              if (item.length == 1) {
225a00b6   梁保满   飞书问题解决
1277
                if (!query.regionIds.includes(item[0])) {
1b9bae95   梁保满   级联选择器调整,日志接口调整
1278
1279
                  query.regionIds.push(item[0]);
                }
255e2506   梁保满   飞书bug及优化
1280
              } else if (item.length == 2) {
1b9bae95   梁保满   级联选择器调整,日志接口调整
1281
1282
1283
                if (!query.schoolIds.includes(item[1])) {
                  query.schoolIds.push(item[1]);
                }
255e2506   梁保满   飞书bug及优化
1284
1285
1286
1287
                query.regionIds.includes(item[0])
                  ? query.regionIds.remove(item[0])
                  : "";
              } else if (item.length == 3) {
1365ef5e   梁保满   优化
1288
1289
1290
                if (!query.schoolIds.includes(item[1])) {
                  query.schoolIds.push(item[1]);
                }
255e2506   梁保满   飞书bug及优化
1291
1292
                if (!query.gradeNames.includes(item[2])) {
                  query.gradeNames.push(item[2]);
1b9bae95   梁保满   级联选择器调整,日志接口调整
1293
                }
255e2506   梁保满   飞书bug及优化
1294
1295
1296
                query.regionIds.includes(item[0])
                  ? query.regionIds.remove(item[0])
                  : "";
255e2506   梁保满   飞书bug及优化
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
              } else if (item.length == 4) {
                if (!query.classIds.includes(item[3])) {
                  query.classIds.push(item[3]);
                }
                query.regionIds.includes(item[0])
                  ? query.regionIds.remove(item[0])
                  : "";
                query.schoolIds.includes(item[1])
                  ? query.schoolIds.remove(item[1])
                  : "";
                query.gradeNames.includes(item[2])
                  ? query.gradeNames.remove(item[2])
                  : "";
1b9bae95   梁保满   级联选择器调整,日志接口调整
1310
1311
1312
1313
1314
1315
1316
              }
            });
          } else {
            query.gradeNames = [];
            query.classIds = [];
            this.query.classId?.map((item) => {
              if (item.length == 1) {
225a00b6   梁保满   飞书问题解决
1317
                if (!query.gradeNames.includes(item[0])) {
1b9bae95   梁保满   级联选择器调整,日志接口调整
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
                  query.gradeNames.push(item[0]);
                }
              } else {
                if (!query.classIds.includes(item[1])) {
                  query.classIds.push(item[1]);
                }
                if (query.gradeNames.includes(item[0])) {
                  query.gradeNames.remove(item[0]);
                }
              }
            });
          }
          delete query.classId;
23a6dc5f   阿宝   学校管理相关接口简单对接
1331
        }
225a00b6   梁保满   飞书问题解决
1332
        return query;
1b9bae95   梁保满   级联选择器调整,日志接口调整
1333
1334
1335
      },
      // 设备列表信息
      async _QueryData(isRef) {
225a00b6   梁保满   飞书问题解决
1336
        let query = this.setQuery();
1b9bae95   梁保满   级联选择器调整,日志接口调整
1337
1338
        if (isRef) {
          this.page = 1;
b21d90ef   梁保满   长水登录
1339
        }
23a6dc5f   阿宝   学校管理相关接口简单对接
1340
        this.loading = true;
e5ff81a1   阿宝   集团管理员接口
1341
1342
1343
1344
        const deviceList =
          this.role != "ROLE_JITUAN"
            ? this.$request.deviceList
            : this.$request.tenantDeviceList;
6d7bd862   梁保满   飞书bug
1345
        this.tableData = [];
e5ff81a1   阿宝   集团管理员接口
1346
        const { data, status, info } = await deviceList({
23a6dc5f   阿宝   学校管理相关接口简单对接
1347
1348
1349
1350
1351
1352
          ...query,
          deviceType: this.type,
          page: this.page,
          size: this.size,
        });
        this.loading = false;
e5ff81a1   阿宝   集团管理员接口
1353
        if (status == 0) {
225a00b6   梁保满   飞书问题解决
1354
          this.tableData =
255e2506   梁保满   飞书bug及优化
1355
1356
1357
1358
1359
1360
            (data?.list &&
              data?.list.map((item) => {
                item.upgradeFlag = item.upgradeFlag == 1 ? true : false;
                return item;
              })) ||
            [];
0e46bc25   梁保满   优化
1361
  
225a00b6   梁保满   飞书问题解决
1362
          this.total = data.count;
e3b0e3e7   梁保满   季度时间格式调整
1363
1364
          this.$nextTick(function () {
            this.$refs.main.scrollTop = 0;
0e46bc25   梁保满   优化
1365
1366
1367
1368
1369
1370
            if (this.query.classId.length) {
              this.selectionTabIds = this.tableData.map((item) => {
                this.$refs.multipleTable.toggleRowSelection(item);
                return item.id;
              });
            }
e3b0e3e7   梁保满   季度时间格式调整
1371
          });
23a6dc5f   阿宝   学校管理相关接口简单对接
1372
1373
1374
        } else {
          this.$message.error(info);
        }
db11048f   阿宝   设备状态,学校管理
1375
      },
d4b9eb45   梁保满   设备异常信息
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
      // 异常设备数量
      async _QueryErrorTotal() {
        const abnormalDeviceCount =
          this.role != "ROLE_JITUAN"
            ? this.$request.abnormalDeviceCount
            : this.$request.tenantAbnormalDeviceCount;
        this.tableData = [];
        const { data, status, info } = await abnormalDeviceCount();
        if (status == 0) {
          this.stationCount = data?.stationCount;
          this.clickerCount = data?.clickerCount;
        } else {
          this.$message.error(info);
        }
      },
db11048f   阿宝   设备状态,学校管理
1391
1392
    },
  };
4c4f7640   梁保满   路由表,路由前端文件
1393
1394
  </script>
  
db11048f   阿宝   设备状态,学校管理
1395
1396
  <style lang="scss" scoped>
  .page-content {
1365ef5e   梁保满   优化
1397
1398
1399
    padding: 0 20px;
    height: 100%;
    overflow-y: auto;
db11048f   阿宝   设备状态,学校管理
1400
  }
29319cfb   梁保满   设备。教师管理
1401
  
db11048f   阿宝   设备状态,学校管理
1402
  .tab-box {
e3b0e3e7   梁保满   季度时间格式调整
1403
    padding: 20px 0 12px;
db11048f   阿宝   设备状态,学校管理
1404
  }
29319cfb   梁保满   设备。教师管理
1405
  
ae0a304c   梁保满   学生管理-显示班级基站信息
1406
  .down {
e5e4a3e6   梁保满   v1.3
1407
    padding: 0 0 16px 20px;
ae0a304c   梁保满   学生管理-显示班级基站信息
1408
  }
014b7030   梁保满   集团管理员隐藏删除设备
1409
1410
  .down-p {
    line-height: 24px;
50c1482f   梁保满   授课端日志下载。学生教师管理添加全部类型
1411
1412
    display: flex;
  }
d4b9eb45   梁保满   设备异常信息
1413
1414
  .error-tips {
    margin-bottom: 12px;
8ef22809   梁保满   软件下载页面添加.net环境下载
1415
  }
8ad80958   梁保满   教师学生管理,设备状态
1416
1417
  
  .del {
29319cfb   梁保满   设备。教师管理
1418
1419
1420
    margin-left: 10px;
  }
  
db11048f   阿宝   设备状态,学校管理
1421
1422
1423
1424
1425
  .content {
    background: #f8f8f8;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    overflow: hidden;
29319cfb   梁保满   设备。教师管理
1426
  
db11048f   阿宝   设备状态,学校管理
1427
1428
1429
    :deep(.fa-edit) {
      width: 12px;
      height: 12px;
29319cfb   梁保满   设备。教师管理
1430
  
db11048f   阿宝   设备状态,学校管理
1431
1432
1433
1434
      &::before {
        margin-left: 2px;
      }
    }
29319cfb   梁保满   设备。教师管理
1435
1436
  
    :deep(.fa) {
db11048f   阿宝   设备状态,学校管理
1437
1438
      width: 12px;
      height: 12px;
29319cfb   梁保满   设备。教师管理
1439
  
db11048f   阿宝   设备状态,学校管理
1440
1441
1442
1443
      &::before {
        margin-left: 1px;
      }
    }
29319cfb   梁保满   设备。教师管理
1444
  
db11048f   阿宝   设备状态,学校管理
1445
1446
1447
1448
1449
    .chart-box {
      display: flex;
      overflow: hidden;
      height: 240px;
      border-bottom: 0.5px solid #e2e2e2;
29319cfb   梁保满   设备。教师管理
1450
  
db11048f   阿宝   设备状态,学校管理
1451
1452
1453
1454
1455
1456
1457
      .device-num {
        width: 280px;
        border-right: 0.5px solid #e2e2e2;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
29319cfb   梁保满   设备。教师管理
1458
  
db11048f   阿宝   设备状态,学校管理
1459
1460
1461
1462
        .p1 {
          font-size: 28px;
        }
      }
29319cfb   梁保满   设备。教师管理
1463
  
db11048f   阿宝   设备状态,学校管理
1464
1465
1466
1467
1468
      .chart {
        flex: 1;
        height: 100%;
      }
    }
29319cfb   梁保满   设备。教师管理
1469
  
db11048f   阿宝   设备状态,学校管理
1470
    .table-box {
e5e4a3e6   梁保满   v1.3
1471
      padding: 20px 20px 0;
29319cfb   梁保满   设备。教师管理
1472
  
47a01cb6   梁保满   v1.3测试问题
1473
1474
1475
1476
1477
1478
      .loading {
        text-align: center;
        line-height: 36px;
        font-size: 16px;
        color: #666;
      }
29319cfb   梁保满   设备。教师管理
1479
  
db11048f   阿宝   设备状态,学校管理
1480
1481
1482
      .answer-header {
        padding: 0;
        margin-bottom: 12px;
29319cfb   梁保满   设备。教师管理
1483
  
8ef22809   梁保满   软件下载页面添加.net环境下载
1484
        .upgrade-all {
ec6394d1   梁保满   v1.3.1。细节调整
1485
1486
1487
          display: flex;
          align-items: center;
        }
db11048f   阿宝   设备状态,学校管理
1488
1489
1490
      }
    }
  }
29319cfb   梁保满   设备。教师管理
1491
  
4c2fb560   梁保满   反馈新需求
1492
1493
  .answer-header .sel-box .input-with-select {
    margin-right: 20px;
29319cfb   梁保满   设备。教师管理
1494
  
4c2fb560   梁保满   反馈新需求
1495
1496
1497
    :deep(.el-input__suffix) {
      right: -5px;
    }
29319cfb   梁保满   设备。教师管理
1498
  
4c2fb560   梁保满   反馈新需求
1499
1500
1501
1502
    :deep(.el-button) {
      padding: 12px 16px 12px 10px;
    }
  }
4c4f7640   梁保满   路由表,路由前端文件
1503
  </style>