Blame view

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