Blame view

src/views/basic/device/index.vue 37.5 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">
29319cfb   梁保满   设备。教师管理
10
              <el-button type="primary" icon="fa fa-cloud-download" size="mini" plain circle @click="downExl"></el-button>
78ea6110   梁保满   设备导出提示
11
12
            </el-tooltip>
          </template>
47a01cb6   梁保满   v1.3测试问题
13
14
          <template v-if="role == 'ROLE_XUEXIAO' && type == 1">
            <el-tooltip effect="dark" content="设备导入" placement="bottom">
29319cfb   梁保满   设备。教师管理
15
              <el-button type="primary" icon="el-icon-upload2" size="mini" plain circle @click="diaUp = true"></el-button>
47a01cb6   梁保满   v1.3测试问题
16
17
            </el-tooltip>
            <el-tooltip effect="dark" content="添加基站" placement="bottom">
29319cfb   梁保满   设备。教师管理
18
19
              <el-button type="primary" icon="el-icon-receiving" size="mini" plain circle @click="addDev"></el-button>
            </el-tooltip></template>
bb778c90   阿宝   设备状态
20
21
        </template>
      </back-box>
1365ef5e   梁保满   优化
22
      <div>
db11048f   阿宝   设备状态,学校管理
23
24
25
26
27
28
29
        <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>
29319cfb   梁保满   设备。教师管理
30
        <p v-show="(type == 1 && stationCount) || (type == 2 && clickerCount)" class="error-tips">
d4b9eb45   梁保满   设备异常信息
31
32
          有{{
            type == 1 ? stationCount : clickerCount
29319cfb   梁保满   设备。教师管理
33
          }}条设备异常信息,<router-link :to="{ path: '/deviceError', query: { type: type } }">点击查看&gt;&gt;</router-link>
8ef22809   梁保满   软件下载页面添加.net环境下载
34
        </p>
db11048f   阿宝   设备状态,学校管理
35
        <div class="content">
8ea67428   梁保满   飞书bug
36
          <div v-show="type == 1">
225a00b6   梁保满   飞书问题解决
37
            <div class="chart-box" v-if="count">
db11048f   阿宝   设备状态,学校管理
38
              <div class="device-num">
225a00b6   梁保满   飞书问题解决
39
                <p class="p1">{{ count }}</p>
db11048f   阿宝   设备状态,学校管理
40
41
42
                <p class="p2">基站数量</p>
              </div>
              <div class="chart">
29319cfb   梁保满   设备。教师管理
43
                <pie-chart id="pieChart" :params="chartData" @clickPieChart="clickPieChart"></pie-chart>
db11048f   阿宝   设备状态,学校管理
44
45
46
47
48
              </div>
            </div>
            <div class="table-box">
              <div class="answer-header">
                <div class="sel-box">
29319cfb   梁保满   设备。教师管理
49
50
51
52
                  <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   阿宝   设备状态,学校管理
53
54
                    </el-option>
                  </el-select>
29319cfb   梁保满   设备。教师管理
55
56
57
                  <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   阿宝   设备状态,学校管理
58
                  </el-input>
29319cfb   梁保满   设备。教师管理
59
                  <el-button class="serach-box" round @click="_QueryData(true)">筛选</el-button>
db11048f   阿宝   设备状态,学校管理
60
61
                </div>
              </div>
47a01cb6   梁保满   v1.3测试问题
62
63
64
65
              <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%">
29319cfb   梁保满   设备。教师管理
66
67
68
69
70
                <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
71
72
73
                    <p v-for="(item, index) in scoped.row.classList" :key="index">
                      {{ item.gradeName }}
                    </p>
29319cfb   梁保满   设备。教师管理
74
75
                  </template></el-table-column>
                <el-table-column prop="roomName" label="所在教室" align="center"></el-table-column>
23a6dc5f   阿宝   学校管理相关接口简单对接
76
77
                <el-table-column label="关联班级" align="center">
                  <template slot-scope="scoped">
e3b0e3e7   梁保满   季度时间格式调整
78
                    <p v-for="(item, index) in scoped.row.classList" :key="index">
23a6dc5f   阿宝   学校管理相关接口简单对接
79
80
81
82
                      {{ item.className }}
                    </p>
                  </template>
                </el-table-column>
29319cfb   梁保满   设备。教师管理
83
84
85
86
                <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   阿宝   设备状态,学校管理
87
                    {{
6d7bd862   梁保满   飞书bug
88
                      scope.row.onlineStatus == 1
29319cfb   梁保满   设备。教师管理
89
90
                      ? "在线"
                      : scope.row.onlineStatus == 2
6d7bd862   梁保满   飞书bug
91
92
                        ? "异常"
                        : "离线"
db11048f   阿宝   设备状态,学校管理
93
                    }}
29319cfb   梁保满   设备。教师管理
94
95
96
97
                  </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   阿宝   设备状态,学校管理
98
99
                    </el-tooltip>
                    <el-tooltip effect="dark" content="日志" placement="top">
29319cfb   梁保满   设备。教师管理
100
101
102
                      <el-button type="warning" circle size="mini" icon="fa fa-eye"
                        @click="linkTo(scoped.row, 1)"></el-button>
                    </el-tooltip>
8ad80958   梁保满   教师学生管理,设备状态
103
                    <el-popconfirm title="确定删除吗?" @confirm="_delStation($event, scoped.row)">
29319cfb   梁保满   设备。教师管理
104
105
106
107
                      <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   阿宝   设备状态,学校管理
108
109
110
              </el-table>
            </div>
          </div>
8ea67428   梁保满   飞书bug
111
          <div v-show="type == 2">
225a00b6   梁保满   飞书问题解决
112
            <div class="chart-box" v-if="count">
db11048f   阿宝   设备状态,学校管理
113
              <div class="device-num">
225a00b6   梁保满   飞书问题解决
114
                <p class="p1">{{ count }}</p>
db11048f   阿宝   设备状态,学校管理
115
116
117
                <p class="p2">答题器数量</p>
              </div>
              <div class="chart">
29319cfb   梁保满   设备。教师管理
118
119
                <scatter-chart id="scatterChart" :params="chartData2"
                  @clickScatterChart="clickScatterChart"></scatter-chart>
db11048f   阿宝   设备状态,学校管理
120
121
122
123
124
              </div>
            </div>
            <div class="table-box">
              <div class="answer-header">
                <div class="sel-box">
29319cfb   梁保满   设备。教师管理
125
126
127
128
                  <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   阿宝   设备状态,学校管理
129
130
                    </el-option>
                  </el-select>
29319cfb   梁保满   设备。教师管理
131
132
133
                  <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   梁保满   反馈新需求
134
                  </el-input>
29319cfb   梁保满   设备。教师管理
135
136
137
                  <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   阿宝   设备状态,学校管理
138
                  </el-input>
29319cfb   梁保满   设备。教师管理
139
                  <el-button class="serach-box" round @click="_QueryData(true)">筛选</el-button>
db11048f   阿宝   设备状态,学校管理
140
141
                </div>
              </div>
47a01cb6   梁保满   v1.3测试问题
142
143
144
145
              <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%">
29319cfb   梁保满   设备。教师管理
146
147
148
                <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   阿宝   学校管理相关接口简单对接
149
                      {{ item.studentName }}
29319cfb   梁保满   设备。教师管理
150
151
152
153
154
                    </p>
                  </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
155
156
157
                    <p v-for="(item, index) in scoped.row.classList" :key="index">
                      {{ item.gradeName }}
                    </p>
29319cfb   梁保满   设备。教师管理
158
159
                  </template></el-table-column>
                <el-table-column prop="class" label="关联班级" align="center" width="160">
23a6dc5f   阿宝   学校管理相关接口简单对接
160
                  <template slot-scope="scoped">
6d7bd862   梁保满   飞书bug
161
                    <p v-for="(item, index) in scoped.row.classList" :key="index">
23a6dc5f   阿宝   学校管理相关接口简单对接
162
163
                      {{ item.className }}
                    </p>
29319cfb   梁保满   设备。教师管理
164
165
166
167
168
                  </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   阿宝   设备状态,学校管理
169
                    <el-tooltip effect="dark" content="日志" placement="top">
29319cfb   梁保满   设备。教师管理
170
171
172
                      <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   阿宝   设备状态,学校管理
173
174
175
              </el-table>
            </div>
          </div>
8ea67428   梁保满   飞书bug
176
          <div v-show="type == 3">
db11048f   阿宝   设备状态,学校管理
177
178
179
            <div class="table-box">
              <div class="answer-header">
                <div class="sel-box">
29319cfb   梁保满   设备。教师管理
180
181
182
183
184
185
                  <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   阿宝   设备状态,学校管理
186
                </div>
ec6394d1   梁保满   v1.3.1。细节调整
187
188
189
190
191
                <p class="upgrade-all" v-if="this.role == 'ROLE_XUEXIAO'">
                  <span>全校更新:</span>
                  <el-switch v-model="upgradeFlag" @change="changeUpdateBySchool">
                  </el-switch>
                </p>
db11048f   阿宝   设备状态,学校管理
192
              </div>
47a01cb6   梁保满   v1.3测试问题
193
194
195
              <p class="loading" v-if="!tableData.length && loading">
                加载中<i class="el-icon-loading"></i>
              </p>
29319cfb   梁保满   设备。教师管理
196
197
              <el-table v-else ref="multipleTable" :data="tableData" border style="width: 100%"
                @selection-change="handleSelectionChange">
6d7bd862   梁保满   飞书bug
198
                <el-table-column type="selection" width="55"></el-table-column>
29319cfb   梁保满   设备。教师管理
199
200
                <!-- <el-table-column prop="sn" label="设备编码" align="center"></el-table-column> -->
                <el-table-column prop="class" label="关联班级" align="center" width="100"><template slot-scope="scoped">
6d7bd862   梁保满   飞书bug
201
                    <p v-for="(item, index) in scoped.row.classList" :key="index">
23a6dc5f   阿宝   学校管理相关接口简单对接
202
203
                      {{ item.className }}
                    </p>
29319cfb   梁保满   设备。教师管理
204
205
206
207
                  </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   梁保满   反馈新需求
208
209
210
                    <p v-for="(item, index) in scoped.row.classList" :key="index">
                      {{ item.gradeName }}
                    </p>
29319cfb   梁保满   设备。教师管理
211
212
213
214
215
216
                  </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   阿宝   设备状态,学校管理
217
                    {{
6d7bd862   梁保满   飞书bug
218
                      scope.row.onlineStatus == 1
29319cfb   梁保满   设备。教师管理
219
220
                      ? "在线"
                      : scope.row.onlineStatus == 2
6d7bd862   梁保满   飞书bug
221
222
                        ? "异常"
                        : "离线"
db11048f   阿宝   设备状态,学校管理
223
                    }}
29319cfb   梁保满   设备。教师管理
224
225
226
                  </template></el-table-column>
                <el-table-column label="日志记录" align="center" width="80">
                  <template slot-scope="scope">
8ad80958   梁保满   教师学生管理,设备状态
227
228
                    <el-link v-if="scope.row.content" type="primary" :href="scope.row.content" download>下载</el-link>
                    <span v-else>暂无记录</span>
29319cfb   梁保满   设备。教师管理
229
230
231
232
233
                  </template>
                </el-table-column>
                <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   阿宝   设备状态,学校管理
234
235
236
              </el-table>
            </div>
          </div>
23a6dc5f   阿宝   学校管理相关接口简单对接
237
          <div class="pagination-box">
29319cfb   梁保满   设备。教师管理
238
239
            <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   阿宝   学校管理相关接口简单对接
240
241
            </el-pagination>
          </div>
db11048f   阿宝   设备状态,学校管理
242
243
        </div>
      </div>
5cfb0264   梁保满   班级管理交互优化
244
      <el-dialog :close-on-click-modal="false" title="设备导入" :visible.sync="diaUp" width="400">
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
245
        <upload :url="url" @upSuccess="upSuccess" fileName="设备信息">
db11048f   阿宝   设备状态,学校管理
246
247
          <p class="down-txt" slot="down">
            通过Excel名单导入设备,需要提供设备编码,点击
23a6dc5f   阿宝   学校管理相关接口简单对接
248
            <el-link type="danger" @click="downExcel">模板下载</el-link> 。
db11048f   阿宝   设备状态,学校管理
249
          </p>
6192eba8   梁保满   引用上传文件组件问题,备题组卷顶部
250
        </upload>
db11048f   阿宝   设备状态,学校管理
251
252
253
254
        <div class="dialog-footer" slot="footer">
          <el-button @click="diaUp = false">取 消</el-button>
        </div>
      </el-dialog>
29319cfb   梁保满   设备。教师管理
255
      <el-dialog :close-on-click-modal="false" :title="isAdd ? '添加基站' : '修改基站'" :visible.sync="diaAnswerEqu" width="400">
db11048f   阿宝   设备状态,学校管理
256
        <el-form ref="forms" :model="form" :rules="formRules" label-width="140px">
1365ef5e   梁保满   优化
257
          <el-form-item label="设备编码:" prop="sn">
29319cfb   梁保满   设备。教师管理
258
259
260
            <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   阿宝   设备状态,学校管理
261
          </el-form-item>
23a6dc5f   阿宝   学校管理相关接口简单对接
262
          <el-form-item label="频点:" prop="frequency">
29319cfb   梁保满   设备。教师管理
263
264
265
            <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   阿宝   设备状态,学校管理
266
          </el-form-item>
23a6dc5f   阿宝   学校管理相关接口简单对接
267
          <el-form-item label="配对码:" prop="pairingCode">
29319cfb   梁保满   设备。教师管理
268
269
270
            <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   阿宝   设备状态,学校管理
271
          </el-form-item>
6d7bd862   梁保满   飞书bug
272
273
          <el-form-item label="选择班级:" prop="classIds">
            <el-col :span="16">
29319cfb   梁保满   设备。教师管理
274
275
              <el-cascader class="sel" clearable v-model="form.classIds" :options="gradeList"
                :show-all-levels="false"></el-cascader>
db11048f   阿宝   设备状态,学校管理
276
277
278
            </el-col>
          </el-form-item>
          <el-form-item label="所在教室:">
29319cfb   梁保满   设备。教师管理
279
280
281
            <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   阿宝   设备状态,学校管理
282
283
284
          </el-form-item>
        </el-form>
        <div class="dialog-footer" slot="footer">
236b1f0e   梁保满   周末-飞书bug
285
          <el-button type="primary" @click="setAnswerEqu">确 定</el-button>
db11048f   阿宝   设备状态,学校管理
286
287
288
          <el-button @click="diaAnswerEqu = false">取 消</el-button>
        </div>
      </el-dialog>
bb778c90   阿宝   设备状态
289
    </div>
4c4f7640   梁保满   路由表,路由前端文件
290
291
292
  </template>
  
  <script>
db11048f   阿宝   设备状态,学校管理
293
294
295
  import pieChart from "@/components/charts/pieChart";
  import scatterChart from "@/components/charts/scatterChart";
  import _ from "lodash";
191d5bfa   梁保满   学生管理、基站管理下载名称设置,上...
296
  import { downloadFile, getBlob, formatGradeNameClass } from "@/utils";
255e2506   梁保满   飞书bug及优化
297
  import api from "@/api/apis/apis";
db11048f   阿宝   设备状态,学校管理
298
299
  export default {
    components: { pieChart, scatterChart },
23a6dc5f   阿宝   学校管理相关接口简单对接
300
301
302
303
    watch: {
      type: function (val) {
        this.page = 1;
        this.total = 0;
225a00b6   梁保满   飞书问题解决
304
        this.count = 0;
23a6dc5f   阿宝   学校管理相关接口简单对接
305
306
307
        this.query.classId = [];
        this.query.onlineStatus = "";
        this.query.sn = "";
4c2fb560   梁保满   反馈新需求
308
        this.query.studentName = "";
23a6dc5f   阿宝   学校管理相关接口简单对接
309
310
311
312
313
314
315
316
317
        this.query.type = "";
        if (val == 1) {
          this.stationReport();
        } else if (val == 2) {
          this.keyboardReport();
        }
        this._QueryData();
      },
    },
db11048f   阿宝   设备状态,学校管理
318
319
    data() {
      return {
d32e461c   梁保满   备题组卷
320
        code: "",
4c2fb560   梁保满   反馈新需求
321
        role: "",
db11048f   阿宝   设备状态,学校管理
322
        loading: false,
4c2fb560   梁保满   反馈新需求
323
324
        exportLoading: false,
        isAdd: false, //添加还是修改基站
87abc4f3   梁保满   基站上传接口地址修改
325
        url: "/api_html/school/manager/importStation",
db11048f   阿宝   设备状态,学校管理
326
327
        diaUp: false,
        diaAnswerEqu: false,
4c2fb560   梁保满   反馈新需求
328
329
        gradeList: [], //年级列表
        schoolAll: [], //所有学校刘表
e3b0e3e7   梁保满   季度时间格式调整
330
        school: {}, //校园账号所属学校信息
255e2506   梁保满   飞书bug及优化
331
332
333
        props: {
          multiple: true,
          checkStrictly: true,
255e2506   梁保满   飞书bug及优化
334
        },
db11048f   阿宝   设备状态,学校管理
335
336
337
        type: 1,
        query: {
          classId: [],
23a6dc5f   阿宝   学校管理相关接口简单对接
338
339
340
          onlineStatus: "",
          sn: "",
          type: "",
4c2fb560   梁保满   反馈新需求
341
          studentName: "",
db11048f   阿宝   设备状态,学校管理
342
343
        },
        statusList: [
dbbfc6c5   梁保满   飞书优化及bug
344
          { label: "全部", value: "" },
23a6dc5f   阿宝   学校管理相关接口简单对接
345
          { label: "离线", value: 0 },
db11048f   阿宝   设备状态,学校管理
346
          { label: "在线", value: 1 },
23a6dc5f   阿宝   学校管理相关接口简单对接
347
348
349
350
351
352
353
354
355
356
          { 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   阿宝   设备状态,学校管理
357
358
        ],
        form: {
4c2fb560   梁保满   反馈新需求
359
          //修改/添加基站信息
255e2506   梁保满   飞书bug及优化
360
          deviceId: "",
1365ef5e   梁保满   优化
361
          sn: "",
23a6dc5f   阿宝   学校管理相关接口简单对接
362
363
          frequency: "",
          pairingCode: "",
183bfae8   梁保满   设备修改班级选择调整
364
          classIds: [],
23a6dc5f   阿宝   学校管理相关接口简单对接
365
          roomName: "",
db11048f   阿宝   设备状态,学校管理
366
367
        },
        formRules: {
e3b0e3e7   梁保满   季度时间格式调整
368
          sn: [{ required: true, message: "请输入设备编码", trigger: "blur" }],
23a6dc5f   阿宝   学校管理相关接口简单对接
369
370
371
372
          frequency: [{ required: true, message: "请输入频点", trigger: "blur" }],
          pairingCode: [
            { required: true, message: "请输入配对码", trigger: "blur" },
          ],
4c2fb560   梁保满   反馈新需求
373
          // classIds: [{ required: true, message: "请选择班级", trigger: "blur" }],
db11048f   阿宝   设备状态,学校管理
374
        },
23a6dc5f   阿宝   学校管理相关接口简单对接
375
376
        tableData: [],
        total: 0,
225a00b6   梁保满   飞书问题解决
377
        count: 0,
23a6dc5f   阿宝   学校管理相关接口简单对接
378
379
        chartData: [],
        chartData2: [],
4c2fb560   梁保满   反馈新需求
380
        selectionTabIds: [], //已选择授课段
23a6dc5f   阿宝   学校管理相关接口简单对接
381
382
        page: 1,
        size: 20,
4c2fb560   梁保满   反馈新需求
383
        isBack: false, //是否是日志页面回来
ec6394d1   梁保满   v1.3.1。细节调整
384
        upgradeFlag: false,
d4b9eb45   梁保满   设备异常信息
385
386
        stationCount: 0, //异常基站数量
        clickerCount: 0, //异常答题器数量
db11048f   阿宝   设备状态,学校管理
387
388
389
      };
    },
    created() {
e3b0e3e7   梁保满   季度时间格式调整
390
      this.code = localStorage.getItem("csCode") || "";
87053bc8   梁保满   设备状态模版下载更新
391
392
393
      this.role =
        this.$store.getters.info.showRole ||
        this.$store.getters.info.permissions[0].role;
d4b9eb45   梁保满   设备异常信息
394
      this._QueryErrorTotal();
255e2506   梁保满   飞书bug及优化
395
      if (this.role == "ROLE_JITUAN") {
e3b0e3e7   梁保满   季度时间格式调整
396
397
398
399
        (this.props.lazy = true),
          (this.props.lazyLoad = function (node, resolve) {
            const { level } = node;
            if (level == 2) {
e3b0e3e7   梁保满   季度时间格式调整
400
401
402
403
404
405
406
407
408
409
              api
                .tenantClassList({
                  schoolId: node.data.value,
                })
                .then((res) => {
                  let children = formatGradeNameClass(res.data?.list).sort(
                    (a, b) => {
                      return a.grade - b.grade;
                    }
                  );
e3b0e3e7   梁保满   季度时间格式调整
410
411
412
413
414
415
416
417
418
419
420
                  const nodes = [...children];
                  // 通过调用resolve将子节点数据返回,通知组件数据加载完成
                  resolve(nodes);
                });
            } else {
              resolve(node);
            }
          });
      }
      if (this.role == "ROLE_XUEXIAO") {
        this._QueryDataSchool();
255e2506   梁保满   飞书bug及优化
421
      }
23a6dc5f   阿宝   学校管理相关接口简单对接
422
      this._QueryGradeList();
11cb8ce0   梁保满   样式调整
423
      if (this.role == "ROLE_JITUAN") {
225a00b6   梁保满   飞书问题解决
424
425
        this.showSchool();
      }
db11048f   阿宝   设备状态,学校管理
426
    },
5be3bb70   梁保满   切换账号,缓存组件接口报错问题
427
428
    activated() {
      const that = this;
e5e4a3e6   梁保满   v1.3
429
      this.isBack = this.$route.query.back ? this.$route.query.back : false;
e5e4a3e6   梁保满   v1.3
430
      if (!this.isBack) {
5be3bb70   梁保满   切换账号,缓存组件接口报错问题
431
432
433
434
435
436
437
438
        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测试问题
439
440
441
442
        if (this.role == "ROLE_XUEXIAO") {
          this._QueryDataSchool();
        }
        this._QueryGradeList();
5be3bb70   梁保满   切换账号,缓存组件接口报错问题
443
444
        that.stationReport();
        that._QueryData();
e5e4a3e6   梁保满   v1.3
445
      }
5be3bb70   梁保满   切换账号,缓存组件接口报错问题
446
    },
db11048f   阿宝   设备状态,学校管理
447
    methods: {
191d5bfa   梁保满   学生管理、基站管理下载名称设置,上...
448
      upSuccess(res) {
e3b0e3e7   梁保满   季度时间格式调整
449
        //导入成功
191d5bfa   梁保满   学生管理、基站管理下载名称设置,上...
450
451
452
        this.$message.closeAll();
        this.$message({
          showClose: true,
fc9cbff6   梁保满   上传信息显示调整
453
          message: `成功(${res.data.success})`,
191d5bfa   梁保满   学生管理、基站管理下载名称设置,上...
454
          type: "success",
183bfae8   梁保满   设备修改班级选择调整
455
          duration: 5000,
191d5bfa   梁保满   学生管理、基站管理下载名称设置,上...
456
        });
e3b0e3e7   梁保满   季度时间格式调整
457
        this.diaUp = false;
87abc4f3   梁保满   基站上传接口地址修改
458
        this.page = 1;
255e2506   梁保满   飞书bug及优化
459
460
        this._QueryData();
      },
575eb544   梁保满   账号异常提示,放开长水学校管理员设...
461
462
      edit(obj) {
        //修改设备
0e46bc25   梁保满   优化
463
        this.isAdd = false;
255e2506   梁保满   飞书bug及优化
464
465
        for (let key in this.form) {
          if (key == "classIds") {
5fb1f184   梁保满   答题器管理:不显示 题器配对码,修...
466
467
468
            this.form[key] = obj.classList.length
              ? [obj.classList[0].gradeName, obj.classList[0].classId]
              : [];
255e2506   梁保满   飞书bug及优化
469
470
          } else {
            this.form[key] = obj[key];
6d7bd862   梁保满   飞书bug
471
472
          }
        }
0e46bc25   梁保满   优化
473
        delete this.form.schoolId;
e3b0e3e7   梁保满   季度时间格式调整
474
        this.form.deviceId = obj.id;
255e2506   梁保满   飞书bug及优化
475
        this.diaAnswerEqu = true;
6d7bd862   梁保满   飞书bug
476
      },
db11048f   阿宝   设备状态,学校管理
477
478
479
480
481
482
483
484
485
      linkTo(obj, type) {
        this.$router.push({
          path: "/deviceLog",
          query: {
            id: obj.id,
            type: type,
          },
        });
      },
8ad80958   梁保满   教师学生管理,设备状态
486
      _delStation: _.debounce(async function (event, obj) {
29319cfb   梁保满   设备。教师管理
487
488
489
490
491
492
493
494
495
        const { status, info } = await this.$request.deleteStation({
          id: obj.id
        });
        if (status === 0) {
          this._QueryData(false);
          this.$message.success(info);
        } else {
          this.$message.error(info);
        }
8ad80958   梁保满   教师学生管理,设备状态
496
      }, 300),
db11048f   阿宝   设备状态,学校管理
497
      clickPieChart(obj) {
23a6dc5f   阿宝   学校管理相关接口简单对接
498
499
500
        this.query.onlineStatus =
          obj.name == "在线" ? 1 : obj.name == "离线" ? 0 : 2;
        this.query.sn = "";
c4eb9615   梁保满   日志页面调整
501
        this.query.classId = [];
23a6dc5f   阿宝   学校管理相关接口简单对接
502
        this.page = 1;
b21d90ef   梁保满   长水登录
503
        this._QueryData(false);
db11048f   阿宝   设备状态,学校管理
504
505
      },
      clickScatterChart(obj) {
23a6dc5f   阿宝   学校管理相关接口简单对接
506
507
508
509
        this.query.type =
          obj.name == "1日内"
            ? 1
            : obj.name == "3日内"
29319cfb   梁保满   设备。教师管理
510
511
512
513
514
515
516
517
              ? 2
              : obj.name == "7日内"
                ? 3
                : obj.name == "1月内"
                  ? 4
                  : obj.name == "3月内"
                    ? 5
                    : 6;
23a6dc5f   阿宝   学校管理相关接口简单对接
518
        this.query.sn = "";
c4eb9615   梁保满   日志页面调整
519
        this.query.classId = [];
23a6dc5f   阿宝   学校管理相关接口简单对接
520
        this.page = 1;
b21d90ef   梁保满   长水登录
521
        this._QueryData(false);
db11048f   阿宝   设备状态,学校管理
522
523
524
525
526
527
528
      },
      handleSelectionChange(val) {
        console.log(val);
        this.selectionTabIds = val.map((item) => {
          return item.id;
        });
      },
ec6394d1   梁保满   v1.3.1。细节调整
529
530
531
      changeUpdateBySchool: _.debounce(function (event) {
        this._ModifyUpgradeFlagBySchool();
      }, 800),
db11048f   阿宝   设备状态,学校管理
532
533
534
535
536
537
538
539
      changeUpdate: _.debounce(function (event, obj) {
        console.log(this);
        if (event) {
          this.autoUpDate(obj.id);
        } else {
          this.stopUpdate(obj.id);
        }
      }, 800),
23a6dc5f   阿宝   学校管理相关接口简单对接
540
541
      changePage(page) {
        this.page = page;
b21d90ef   梁保满   长水登录
542
        this._QueryData(false);
23a6dc5f   阿宝   学校管理相关接口简单对接
543
      },
e3b0e3e7   梁保满   季度时间格式调整
544
545
546
547
      addDev() {
        this.form.sn = "";
        this.form.frequency = "";
        this.form.pairingCode = "";
183bfae8   梁保满   设备修改班级选择调整
548
        this.form.classIds = [];
e3b0e3e7   梁保满   季度时间格式调整
549
        this.form.roomName = "";
0e46bc25   梁保满   优化
550
551
552
        this.form.schoolId = this.school.id;
        delete this.form.deviceId;
        this.isAdd = true;
e3b0e3e7   梁保满   季度时间格式调整
553
554
        this.diaAnswerEqu = true;
      },
ec6394d1   梁保满   v1.3.1。细节调整
555
556
557
558
559
560
561
      _ModifyUpgradeFlagBySchool() {
        let data = this.$request.modifyUpgradeFlagBySchool({
          upgradeFlag: this.upgradeFlag ? 1 : 0,
        });
        if (data && !data.code) {
          this._QueryData(false);
          this.selectionTabIds = [];
29319cfb   梁保满   设备。教师管理
562
          this.$message.success(this.upgradeFlag ? "开启自动更新成功" : "关闭/停止自动更新成功");
ec6394d1   梁保满   v1.3.1。细节调整
563
564
565
566
        } else {
          this.$message.error(data.info);
        }
      },
225a00b6   梁保满   飞书问题解决
567
      async showSchool() {
296f7c47   梁保满   集团管理员接口调整
568
569
        const { data, status, info } = await this.$request.schoolList();
        if (status === 0) {
183bfae8   梁保满   设备修改班级选择调整
570
571
572
573
574
575
          let gradeListAll = data.list?.map((item) => {
            return {
              value: item.id,
              label: item.schoolName,
            };
          });
225a00b6   梁保满   飞书问题解决
576
577
578
579
          this.schoolAll = [
            {
              value: 0,
              label: "全部",
183bfae8   梁保满   设备修改班级选择调整
580
              children: [...gradeListAll],
225a00b6   梁保满   飞书问题解决
581
582
583
            },
          ];
          this.gradeList = [...this.schoolAll, ...this.gradeList];
296f7c47   梁保满   集团管理员接口调整
584
585
586
587
        } else {
          this.$message.error(info);
        }
      },
db11048f   阿宝   设备状态,学校管理
588
589
590
591
592
593
594
      async autoUpDate(id) {
        if (!this.selectionTabIds.length && !id) {
          this.$message.warning("请选择授课端~");
          return;
        }
        if (this.loadingUpDate) return;
        this.loadingUpDate = true;
23a6dc5f   阿宝   学校管理相关接口简单对接
595
        let data = await this.$request.modifyUpgradeFlag({
dd5150c5   阿宝   数据同步
596
          deviceIds: id ? [id] : this.selectionTabIds,
23a6dc5f   阿宝   学校管理相关接口简单对接
597
          upgradeFlag: 1,
db11048f   阿宝   设备状态,学校管理
598
599
600
601
        });
        this.loadingUpDate = false;
        if (data && !data.code) {
          this._QueryData(false);
e5ff81a1   阿宝   集团管理员接口
602
          this.selectionTabIds = [];
db11048f   阿宝   设备状态,学校管理
603
604
          this.$message.success("开启自动更新成功");
        } else {
236b1f0e   梁保满   周末-飞书bug
605
          this.$message.error(data.info);
db11048f   阿宝   设备状态,学校管理
606
607
608
609
610
611
612
613
614
        }
      },
      async stopUpdate(id) {
        if (!this.selectionTabIds.length && !id) {
          this.$message.warning("请选择授课端~");
          return;
        }
        if (this.loadingUpDate) return;
        this.loadingUpDate = true;
23a6dc5f   阿宝   学校管理相关接口简单对接
615
        let data = await this.$request.modifyUpgradeFlag({
dd5150c5   阿宝   数据同步
616
          deviceIds: id ? [id] : this.selectionTabIds,
23a6dc5f   阿宝   学校管理相关接口简单对接
617
          upgradeFlag: 0,
db11048f   阿宝   设备状态,学校管理
618
619
620
        });
        this.loadingUpDate = false;
        if (data && !data.code) {
e5ff81a1   阿宝   集团管理员接口
621
          this.selectionTabIds = [];
db11048f   阿宝   设备状态,学校管理
622
623
624
          this._QueryData(false);
          this.$message.success("关闭自动更新成功");
        } else {
236b1f0e   梁保满   周末-飞书bug
625
          this.$message.error(data.info);
db11048f   阿宝   设备状态,学校管理
626
627
        }
      },
db11048f   阿宝   设备状态,学校管理
628
      async downExcel() {
87053bc8   梁保满   设备状态模版下载更新
629
        let data = await this.$request.stationTemplate({
db11048f   阿宝   设备状态,学校管理
630
631
          id: this.id,
        });
87053bc8   梁保满   设备状态模版下载更新
632
633
634
635
636
        if (data) {
          let blob = new Blob([data], {
            type: "application/vnd.ms-excel;charset=utf-8",
          });
          downloadFile(`基站模版.xlsx`, blob);
db11048f   阿宝   设备状态,学校管理
637
        } else {
87053bc8   梁保满   设备状态模版下载更新
638
          this.$message.error("下载失败");
db11048f   阿宝   设备状态,学校管理
639
640
        }
      },
29319cfb   梁保满   设备。教师管理
641
      //报表导出
ae0a304c   梁保满   学生管理-显示班级基站信息
642
      async downExl() {
ae0a304c   梁保满   学生管理-显示班级基站信息
643
        if (this.exportLoading == true) return;
e5e4a3e6   梁保满   v1.3
644
        let query = this.setQuery();
4c2fb560   梁保满   反馈新需求
645
646
647
648
649
        const exportDevice =
          this.role != "ROLE_JITUAN"
            ? this.$request.exportDevice
            : this.$request.tenantExportDevice;
  
ae0a304c   梁保满   学生管理-显示班级基站信息
650
        this.exportLoading = true;
4c2fb560   梁保满   反馈新需求
651
        const data = await exportDevice({
e5e4a3e6   梁保满   v1.3
652
653
654
          ...query,
          deviceType: this.type,
        });
ae0a304c   梁保满   学生管理-显示班级基站信息
655
656
657
658
659
660
661
662
663
        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
29319cfb   梁保满   设备。教师管理
664
665
                ? "答题器报表.xlsx"
                : "授课端报表.xlsx";
ae0a304c   梁保满   学生管理-显示班级基站信息
666
667
668
669
670
          downloadFile(txt, blob);
        } else {
          this.$message.error(data.info);
        }
      },
db11048f   阿宝   设备状态,学校管理
671
  
236b1f0e   梁保满   周末-飞书bug
672
673
      // 修改基站
      setAnswerEqu() {
6d7bd862   梁保满   飞书bug
674
675
676
677
        this.$refs.forms.validate(async (valid) => {
          if (valid) {
            if (this.loadingAnswerEqu) return;
            this.loadingAnswerEqu = true;
255e2506   梁保满   飞书bug及优化
678
            let query = { ...this.form };
236b1f0e   梁保满   周末-飞书bug
679
  
5fb1f184   梁保满   答题器管理:不显示 题器配对码,修...
680
            query.classIds = query.classIds.length ? [query.classIds[1]] : [];
0e46bc25   梁保满   优化
681
682
683
            let deviceApi = this.isAdd
              ? this.$request.addStation
              : this.$request.updateDevice;
e3b0e3e7   梁保满   季度时间格式调整
684
            const { data, status, info } = await deviceApi({
255e2506   梁保满   飞书bug及优化
685
686
              ...query,
            });
6d7bd862   梁保满   飞书bug
687
688
689
            this.loadingAnswerEqu = false;
            console.log(status);
            if (status === 0) {
255e2506   梁保满   飞书bug及优化
690
              this.diaAnswerEqu = false;
1365ef5e   梁保满   优化
691
              this.$message.success(info);
6d7bd862   梁保满   飞书bug
692
              this._QueryData();
0e46bc25   梁保满   优化
693
694
              if (this.isAdd) {
                this.stationReport();
e3b0e3e7   梁保满   季度时间格式调整
695
              }
6d7bd862   梁保满   飞书bug
696
697
698
699
700
701
702
            } else {
              this.$message.error(info);
            }
          } else {
            this.$message.warning("数据有误,请检查!");
          }
        });
db11048f   阿宝   设备状态,学校管理
703
      },
e3b0e3e7   梁保满   季度时间格式调整
704
705
706
707
708
709
710
711
      async _QueryDataSchool() {
        const { data, status, info } = await this.$request.schoolDetail();
        if (status === 0) {
          this.school = { ...data };
        } else {
          this.$message.error(info);
        }
      },
db11048f   阿宝   设备状态,学校管理
712
      // 查找班级
23a6dc5f   阿宝   学校管理相关接口简单对接
713
714
      async _QueryGradeList() {
        this.loading = true;
e5ff81a1   阿宝   集团管理员接口
715
716
717
718
719
        const gradeList =
          this.role != "ROLE_JITUAN"
            ? this.$request.gradeList
            : this.$request.regionList;
        const { data, status, info } = await gradeList();
23a6dc5f   阿宝   学校管理相关接口简单对接
720
721
        if (status === 0) {
          if (!!data.list) {
e5ff81a1   阿宝   集团管理员接口
722
723
724
725
            if (this.role != "ROLE_JITUAN") {
              this.gradeList =
                data.list?.map((item) => {
                  let gradeList = {
1b9bae95   梁保满   级联选择器调整,日志接口调整
726
                    value: item.gradeName,
e5ff81a1   阿宝   集团管理员接口
727
728
729
730
731
                    label: item.gradeName,
                  };
                  gradeList.children =
                    item.classList?.map((items) => {
                      return {
1365ef5e   梁保满   优化
732
                        value: Number(items.id),
e5ff81a1   阿宝   集团管理员接口
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
                        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   梁保满   飞书问题解决
754
              this.gradeList = [...this.schoolAll, ...this.gradeList];
e5ff81a1   阿宝   集团管理员接口
755
            }
23a6dc5f   阿宝   学校管理相关接口简单对接
756
757
758
759
760
761
762
          }
        } else {
          this.$message.error(info);
        }
      },
      // 基站统计数据
      async stationReport() {
e5ff81a1   阿宝   集团管理员接口
763
764
765
766
767
        const stationReport =
          this.role != "ROLE_JITUAN"
            ? this.$request.stationReport
            : this.$request.tenantStationReport;
        const { data, status, info } = await stationReport();
23a6dc5f   阿宝   学校管理相关接口简单对接
768
769
770
771
772
        if (status === 0) {
          this.chartData =
            data.list?.map((item) => {
              return {
                name:
e5ff81a1   阿宝   集团管理员接口
773
774
775
                  item.onlineStatus == "1"
                    ? "在线"
                    : item.onlineStatus == 0
29319cfb   梁保满   设备。教师管理
776
777
                      ? "离线"
                      : "异常",
296f7c47   梁保满   集团管理员接口调整
778
779
                value: item.total,
                rate: item.rate,
23a6dc5f   阿宝   学校管理相关接口简单对接
780
781
              };
            }) || [];
225a00b6   梁保满   飞书问题解决
782
          this.count = data.total || 0;
23a6dc5f   阿宝   学校管理相关接口简单对接
783
784
785
786
787
788
        } else {
          this.$message.error(info);
        }
      },
      // 答题器统计数据
      async keyboardReport() {
e5ff81a1   阿宝   集团管理员接口
789
790
791
792
793
        const keyboardReport =
          this.role != "ROLE_JITUAN"
            ? this.$request.keyboardReport
            : this.$request.tenantKeyboardReport;
        const { data, status, info } = await keyboardReport();
23a6dc5f   阿宝   学校管理相关接口简单对接
794
795
796
797
798
799
800
801
        if (status === 0) {
          this.chartData2 =
            data.list?.map((item) => {
              return {
                name:
                  item.type == 1
                    ? "1日内"
                    : item.type == 2
29319cfb   梁保满   设备。教师管理
802
803
804
805
806
807
808
809
                      ? "3日内"
                      : item.type == 3
                        ? "7日内"
                        : item.type == 4
                          ? "1月内"
                          : item.type == 5
                            ? "3月内"
                            : "3月以上",
225a00b6   梁保满   飞书问题解决
810
811
                count: item.total,
                value: item.rate * 100,
23a6dc5f   阿宝   学校管理相关接口简单对接
812
813
              };
            }) || [];
225a00b6   梁保满   飞书问题解决
814
          this.count = data.total || 0;
23a6dc5f   阿宝   学校管理相关接口简单对接
815
816
817
        } else {
          this.$message.error(info);
        }
db11048f   阿宝   设备状态,学校管理
818
      },
225a00b6   梁保满   飞书问题解决
819
820
821
      setQuery() {
        //整理传参
        let query = {};
23a6dc5f   阿宝   学校管理相关接口简单对接
822
        if (this.query.sn) {
5e2e009a   梁保满   基站筛选条件显示问题,归档文本替换
823
824
825
826
          this.query.classId = [];
          this.query.onlineStatus = "";
          this.query.type = "";
          this.query.studentName = "";
23a6dc5f   阿宝   学校管理相关接口简单对接
827
          query.sn = this.query.sn;
4c2fb560   梁保满   反馈新需求
828
        } else if (this.query.studentName) {
5e2e009a   梁保满   基站筛选条件显示问题,归档文本替换
829
830
831
832
          this.query.classId = [];
          this.query.onlineStatus = "";
          this.query.type = "";
          this.query.sn = "";
4c2fb560   梁保满   反馈新需求
833
          query.studentName = this.query.studentName;
23a6dc5f   阿宝   学校管理相关接口简单对接
834
        } else {
23a6dc5f   阿宝   学校管理相关接口简单对接
835
836
837
838
839
840
841
          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   梁保满   级联选择器调整,日志接口调整
842
843
844
          if (this.role == "ROLE_JITUAN") {
            query.regionIds = [];
            query.schoolIds = [];
255e2506   梁保满   飞书bug及优化
845
846
            query.gradeNames = [];
            query.classIds = [];
1b9bae95   梁保满   级联选择器调整,日志接口调整
847
848
            this.query.classId?.map((item) => {
              if (item.length == 1) {
225a00b6   梁保满   飞书问题解决
849
                if (!query.regionIds.includes(item[0])) {
1b9bae95   梁保满   级联选择器调整,日志接口调整
850
851
                  query.regionIds.push(item[0]);
                }
255e2506   梁保满   飞书bug及优化
852
              } else if (item.length == 2) {
1b9bae95   梁保满   级联选择器调整,日志接口调整
853
854
855
                if (!query.schoolIds.includes(item[1])) {
                  query.schoolIds.push(item[1]);
                }
255e2506   梁保满   飞书bug及优化
856
857
858
859
                query.regionIds.includes(item[0])
                  ? query.regionIds.remove(item[0])
                  : "";
              } else if (item.length == 3) {
1365ef5e   梁保满   优化
860
861
862
                if (!query.schoolIds.includes(item[1])) {
                  query.schoolIds.push(item[1]);
                }
255e2506   梁保满   飞书bug及优化
863
864
                if (!query.gradeNames.includes(item[2])) {
                  query.gradeNames.push(item[2]);
1b9bae95   梁保满   级联选择器调整,日志接口调整
865
                }
255e2506   梁保满   飞书bug及优化
866
867
868
                query.regionIds.includes(item[0])
                  ? query.regionIds.remove(item[0])
                  : "";
255e2506   梁保满   飞书bug及优化
869
870
871
872
873
874
875
876
877
878
879
880
881
              } 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   梁保满   级联选择器调整,日志接口调整
882
883
884
885
886
887
888
              }
            });
          } else {
            query.gradeNames = [];
            query.classIds = [];
            this.query.classId?.map((item) => {
              if (item.length == 1) {
225a00b6   梁保满   飞书问题解决
889
                if (!query.gradeNames.includes(item[0])) {
1b9bae95   梁保满   级联选择器调整,日志接口调整
890
891
892
893
894
895
896
897
898
899
900
901
902
                  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   阿宝   学校管理相关接口简单对接
903
        }
225a00b6   梁保满   飞书问题解决
904
        return query;
1b9bae95   梁保满   级联选择器调整,日志接口调整
905
906
907
      },
      // 设备列表信息
      async _QueryData(isRef) {
225a00b6   梁保满   飞书问题解决
908
        let query = this.setQuery();
1b9bae95   梁保满   级联选择器调整,日志接口调整
909
910
        if (isRef) {
          this.page = 1;
b21d90ef   梁保满   长水登录
911
        }
23a6dc5f   阿宝   学校管理相关接口简单对接
912
        this.loading = true;
e5ff81a1   阿宝   集团管理员接口
913
914
915
916
        const deviceList =
          this.role != "ROLE_JITUAN"
            ? this.$request.deviceList
            : this.$request.tenantDeviceList;
6d7bd862   梁保满   飞书bug
917
        this.tableData = [];
e5ff81a1   阿宝   集团管理员接口
918
        const { data, status, info } = await deviceList({
23a6dc5f   阿宝   学校管理相关接口简单对接
919
920
921
922
923
924
          ...query,
          deviceType: this.type,
          page: this.page,
          size: this.size,
        });
        this.loading = false;
e5ff81a1   阿宝   集团管理员接口
925
        if (status == 0) {
225a00b6   梁保满   飞书问题解决
926
          this.tableData =
255e2506   梁保满   飞书bug及优化
927
928
929
930
931
932
            (data?.list &&
              data?.list.map((item) => {
                item.upgradeFlag = item.upgradeFlag == 1 ? true : false;
                return item;
              })) ||
            [];
0e46bc25   梁保满   优化
933
  
225a00b6   梁保满   飞书问题解决
934
          this.total = data.count;
e3b0e3e7   梁保满   季度时间格式调整
935
936
          this.$nextTick(function () {
            this.$refs.main.scrollTop = 0;
0e46bc25   梁保满   优化
937
938
939
940
941
942
            if (this.query.classId.length) {
              this.selectionTabIds = this.tableData.map((item) => {
                this.$refs.multipleTable.toggleRowSelection(item);
                return item.id;
              });
            }
e3b0e3e7   梁保满   季度时间格式调整
943
          });
23a6dc5f   阿宝   学校管理相关接口简单对接
944
945
946
        } else {
          this.$message.error(info);
        }
db11048f   阿宝   设备状态,学校管理
947
      },
d4b9eb45   梁保满   设备异常信息
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
      // 异常设备数量
      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   阿宝   设备状态,学校管理
963
964
    },
  };
4c4f7640   梁保满   路由表,路由前端文件
965
966
  </script>
  
db11048f   阿宝   设备状态,学校管理
967
968
  <style lang="scss" scoped>
  .page-content {
1365ef5e   梁保满   优化
969
970
971
    padding: 0 20px;
    height: 100%;
    overflow-y: auto;
db11048f   阿宝   设备状态,学校管理
972
  }
29319cfb   梁保满   设备。教师管理
973
  
db11048f   阿宝   设备状态,学校管理
974
  .tab-box {
e3b0e3e7   梁保满   季度时间格式调整
975
    padding: 20px 0 12px;
db11048f   阿宝   设备状态,学校管理
976
  }
29319cfb   梁保满   设备。教师管理
977
  
ae0a304c   梁保满   学生管理-显示班级基站信息
978
  .down {
e5e4a3e6   梁保满   v1.3
979
    padding: 0 0 16px 20px;
ae0a304c   梁保满   学生管理-显示班级基站信息
980
  }
29319cfb   梁保满   设备。教师管理
981
  
d4b9eb45   梁保满   设备异常信息
982
983
  .error-tips {
    margin-bottom: 12px;
8ef22809   梁保满   软件下载页面添加.net环境下载
984
  }
8ad80958   梁保满   教师学生管理,设备状态
985
986
  
  .del {
29319cfb   梁保满   设备。教师管理
987
988
989
    margin-left: 10px;
  }
  
db11048f   阿宝   设备状态,学校管理
990
991
992
993
994
  .content {
    background: #f8f8f8;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    overflow: hidden;
29319cfb   梁保满   设备。教师管理
995
  
db11048f   阿宝   设备状态,学校管理
996
997
998
    :deep(.fa-edit) {
      width: 12px;
      height: 12px;
29319cfb   梁保满   设备。教师管理
999
  
db11048f   阿宝   设备状态,学校管理
1000
1001
1002
1003
      &::before {
        margin-left: 2px;
      }
    }
29319cfb   梁保满   设备。教师管理
1004
1005
  
    :deep(.fa) {
db11048f   阿宝   设备状态,学校管理
1006
1007
      width: 12px;
      height: 12px;
29319cfb   梁保满   设备。教师管理
1008
  
db11048f   阿宝   设备状态,学校管理
1009
1010
1011
1012
      &::before {
        margin-left: 1px;
      }
    }
29319cfb   梁保满   设备。教师管理
1013
  
db11048f   阿宝   设备状态,学校管理
1014
1015
1016
1017
1018
    .chart-box {
      display: flex;
      overflow: hidden;
      height: 240px;
      border-bottom: 0.5px solid #e2e2e2;
29319cfb   梁保满   设备。教师管理
1019
  
db11048f   阿宝   设备状态,学校管理
1020
1021
1022
1023
1024
1025
1026
      .device-num {
        width: 280px;
        border-right: 0.5px solid #e2e2e2;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
29319cfb   梁保满   设备。教师管理
1027
  
db11048f   阿宝   设备状态,学校管理
1028
1029
1030
1031
        .p1 {
          font-size: 28px;
        }
      }
29319cfb   梁保满   设备。教师管理
1032
  
db11048f   阿宝   设备状态,学校管理
1033
1034
1035
1036
1037
      .chart {
        flex: 1;
        height: 100%;
      }
    }
29319cfb   梁保满   设备。教师管理
1038
  
db11048f   阿宝   设备状态,学校管理
1039
    .table-box {
e5e4a3e6   梁保满   v1.3
1040
      padding: 20px 20px 0;
29319cfb   梁保满   设备。教师管理
1041
  
47a01cb6   梁保满   v1.3测试问题
1042
1043
1044
1045
1046
1047
      .loading {
        text-align: center;
        line-height: 36px;
        font-size: 16px;
        color: #666;
      }
29319cfb   梁保满   设备。教师管理
1048
  
db11048f   阿宝   设备状态,学校管理
1049
1050
1051
      .answer-header {
        padding: 0;
        margin-bottom: 12px;
29319cfb   梁保满   设备。教师管理
1052
  
8ef22809   梁保满   软件下载页面添加.net环境下载
1053
        .upgrade-all {
ec6394d1   梁保满   v1.3.1。细节调整
1054
1055
1056
          display: flex;
          align-items: center;
        }
db11048f   阿宝   设备状态,学校管理
1057
1058
1059
      }
    }
  }
29319cfb   梁保满   设备。教师管理
1060
  
4c2fb560   梁保满   反馈新需求
1061
1062
  .answer-header .sel-box .input-with-select {
    margin-right: 20px;
29319cfb   梁保满   设备。教师管理
1063
  
4c2fb560   梁保满   反馈新需求
1064
1065
1066
    :deep(.el-input__suffix) {
      right: -5px;
    }
29319cfb   梁保满   设备。教师管理
1067
  
4c2fb560   梁保满   反馈新需求
1068
1069
1070
1071
    :deep(.el-button) {
      padding: 12px 16px 12px 10px;
    }
  }
4c4f7640   梁保满   路由表,路由前端文件
1072
  </style>