Commit 23a6dc5f19257c2650d68b0800477b2de8009f0e

Authored by 阿宝
1 parent db11048f

学校管理相关接口简单对接

E/system-commandline-sentinel-files/dotnet-suggest-registration-git-credential-manager-core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null deleted
1   -Exception during registration:
2   -System.ComponentModel.Win32Exception (0x80004005): 系统找不到指定的文件。
3   - 在 System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
4   - 在 System.Diagnostics.Process.Start()
5   - 在 System.CommandLine.Invocation.Process.StartProcess(String command, String args, String workingDir, Action`1 stdOut, Action`1 stdErr, ValueTuple`2[] environmentVariables)
6   - 在 System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_1>d.MoveNext()
7 0 \ No newline at end of file
src/api/apis/setUp.js 0 → 100644
  1 +
  2 +import service from "../axios"
  3 +import setUpUrls from "../urls/setUp"
  4 +
  5 +export default {
  6 + // 学校管理员首页数据
  7 + schoolIndex(data) {
  8 + return service({
  9 + url: setUpUrls.schoolIndex,
  10 + method: 'POST',
  11 + data
  12 + })
  13 + },
  14 + // 查询角色列表
  15 + roleList(data) {
  16 + return service({
  17 + url: setUpUrls.roleList,
  18 + method: 'POST',
  19 + data
  20 + })
  21 + },
  22 + // 分页查询账号
  23 + deviceList(data) {
  24 + return service({
  25 + url: setUpUrls.deviceList,
  26 + method: 'POST',
  27 + data
  28 + })
  29 + },
  30 + // 修改账号 禁用账号、修改账号密码等
  31 + updateUser(data) {
  32 + return service({
  33 + url: setUpUrls.updateUser,
  34 + method: 'POST',
  35 + data
  36 + })
  37 + },
  38 + // 查询学校详情
  39 + schoolDetail(data) {
  40 + return service({
  41 + url: setUpUrls.schoolDetail,
  42 + method: 'POST',
  43 + data
  44 + })
  45 + },
  46 + // 修改学校信息
  47 + updateSchool(data) {
  48 + return service({
  49 + url: setUpUrls.updateSchool,
  50 + method: 'POST',
  51 + data
  52 + })
  53 + },
  54 + // 学校年级管理
  55 + gradeList(data) {
  56 + return service({
  57 + url: setUpUrls.gradeList,
  58 + method: 'POST',
  59 + data
  60 + })
  61 + },
  62 + // 查询学校所有科目
  63 + subjectList(data) {
  64 + return service({
  65 + url: setUpUrls.subjectList,
  66 + method: 'POST',
  67 + data
  68 + })
  69 + },
  70 + // 修改年级信息
  71 + updateGrade(data) {
  72 + return service({
  73 + url: setUpUrls.updateGrade,
  74 + method: 'POST',
  75 + data
  76 + })
  77 + },
  78 + // 查询学校班级列表
  79 + schoolClassList(data) {
  80 + return service({
  81 + url: setUpUrls.classList,
  82 + method: 'POST',
  83 + data
  84 + })
  85 + },
  86 + // 查询学生列表
  87 + studentList(data) {
  88 + return service({
  89 + url: setUpUrls.studentList,
  90 + method: 'POST',
  91 + data
  92 + })
  93 + },
  94 + // 修改班级信息
  95 + updateClass(data) {
  96 + return service({
  97 + url: setUpUrls.updateClass,
  98 + method: 'POST',
  99 + data
  100 + })
  101 + },
  102 + // 增加学生
  103 + addStudent(data) {
  104 + return service({
  105 + url: setUpUrls.addStudent,
  106 + method: 'POST',
  107 + data
  108 + })
  109 + },
  110 + // 删除学生
  111 + delStudent(data) {
  112 + return service({
  113 + url: setUpUrls.delStudent,
  114 + method: 'POST',
  115 + data
  116 + })
  117 + },
  118 + // 查询学校教师列表
  119 + teacherList(data) {
  120 + return service({
  121 + url: setUpUrls.teacherList,
  122 + method: 'POST',
  123 + data
  124 + })
  125 + },
  126 + // 新增教师
  127 + addTeacher(data) {
  128 + return service({
  129 + url: setUpUrls.addTeacher,
  130 + method: 'POST',
  131 + data
  132 + })
  133 + },
  134 + // 修改教师信息
  135 + updateTeacher(data) {
  136 + return service({
  137 + url: setUpUrls.updateTeacher,
  138 + method: 'POST',
  139 + data
  140 + })
  141 + },
  142 + // 删除教师管理班级或年级
  143 + delTeacherManager(data) {
  144 + return service({
  145 + url: setUpUrls.delTeacherManager,
  146 + method: 'POST',
  147 + data
  148 + })
  149 + },
  150 + // 查询基站统计数据
  151 + stationReport(data) {
  152 + return service({
  153 + url: setUpUrls.stationReport,
  154 + method: 'POST',
  155 + data
  156 + })
  157 + },
  158 + // 查询答题器统计数据
  159 + keyboardReport(data) {
  160 + return service({
  161 + url: setUpUrls.keyboardReport,
  162 + method: 'POST',
  163 + data
  164 + })
  165 + },
  166 + // 分页查询设备列表
  167 + deviceList(data) {
  168 + return service({
  169 + url: setUpUrls.deviceList,
  170 + method: 'POST',
  171 + data
  172 + })
  173 + },
  174 + // 修改设备自动升级状态
  175 + modifyUpgradeFlag(data) {
  176 + return service({
  177 + url: setUpUrls.modifyUpgradeFlag,
  178 + method: 'POST',
  179 + data
  180 + })
  181 + },
  182 + // 修改基站信息
  183 + updateDevice(data) {
  184 + return service({
  185 + url: setUpUrls.updateDevice,
  186 + method: 'POST',
  187 + data
  188 + })
  189 + },
  190 + // 查询下载配置列表
  191 + appConfigList(data) {
  192 + return service({
  193 + url: setUpUrls.appConfigList,
  194 + method: 'POST',
  195 + data
  196 + })
  197 + },
  198 + // 查询最新的授课端应用版本
  199 + latestVersion(data) {
  200 + return service({
  201 + url: setUpUrls.latestVersion,
  202 + method: 'POST',
  203 + data
  204 + })
  205 + },
  206 + // 下载指定配置的最新版本授课端
  207 + getAppDownloadUrl(data) {
  208 + return service({
  209 + url: setUpUrls.getAppDownloadUrl,
  210 + method: 'POST',
  211 + data
  212 + })
  213 + },
  214 + // 新增授课端应用配置
  215 + addAppConfig(data) {
  216 + return service({
  217 + url: setUpUrls.addAppConfig,
  218 + method: 'POST',
  219 + data
  220 + })
  221 + },
  222 + // 修改授课端应用配置
  223 + updateAppConfig(data) {
  224 + return service({
  225 + url: setUpUrls.updateAppConfig,
  226 + method: 'POST',
  227 + data
  228 + })
  229 + },
  230 +
  231 +}
... ...
src/api/urls/setUp.js 0 → 100644
  1 +
  2 +export default {
  3 + // 学校管理员首页数据
  4 + schoolIndex: "/api_html/school/manager/index",
  5 + // 查询角色列表
  6 + roleList: "/api_html/school/manager/roleList",
  7 + // 分页查询账号
  8 + deviceList: "/api_html/school/manager/userPage",
  9 + // 修改账号 禁用账号、修改账号密码等
  10 + updateUser: "/api_html/school/manager/updateUser",
  11 + // 查询学校详情
  12 + schoolDetail: "/api_html/school/manager/schoolDetail",
  13 + // 修改学校信息
  14 + updateSchool: "/api_html/school/manager/updateSchool",
  15 + // 学校年级管理
  16 + gradeList: "/api_html/school/manager/gradeList",
  17 + // 查询学校所有科目
  18 + subjectList: "/api_html/school/manager/subjectList",
  19 + // 修改年级信息
  20 + updateGrade: "/api_html/school/manager/updateGrade",
  21 + // 查询学校班级列表
  22 + classList: "/api_html/school/manager/classList",
  23 + // 查询学生列表
  24 + studentList: "/api_html/school/manager/studentList",
  25 + // 修改班级信息
  26 + updateClass: "/api_html/school/manager/updateClass",
  27 + // 增加学生
  28 + addStudent: "/api_html/school/manager/addStudent",
  29 + // 删除学生
  30 + delStudent: "/api_html/school/manager/delStudent",
  31 + // 查询学校教师列表
  32 + teacherList: "/api_html/school/manager/teacherList",
  33 + // 新增教师
  34 + addTeacher: "/api_html/school/manager/addTeacher",
  35 + // 修改教师信息
  36 + updateTeacher: "/api_html/school/manager/updateTeacher",
  37 + // 删除教师管理班级或年级
  38 + delTeacherManager: "/api_html/school/manager/delTeacherManager",
  39 + // 查询基站统计数据
  40 + stationReport: "/api_html/school/manager/stationReport",
  41 + // 查询答题器统计数据
  42 + keyboardReport: "/api_html/school/manager/keyboardReport",
  43 + // 分页查询设备列表
  44 + deviceList: "/api_html/school/manager/deviceList",
  45 + // 修改设备自动升级状态
  46 + modifyUpgradeFlag: "/api_html/school/manager/modifyUpgradeFlag",
  47 + // 修改基站信息
  48 + updateDevice: "/api_html/school/manager/updateDevice",
  49 + // 查询下载配置列表
  50 + appConfigList: "/api_html/school/manager/appConfigList",
  51 + // 查询最新的授课端应用版本
  52 + latestVersion: "/api_html/school/manager/latestVersion",
  53 + // 下载指定配置的最新版本授课端
  54 + getAppDownloadUrl: "/api_html/school/manager/getAppDownloadUrl",
  55 + // 新增授课端应用配置
  56 + addAppConfig: "/api_html/school/manager/addAppConfig",
  57 + // 修改授课端应用配置
  58 + updateAppConfig: "/api_html/school/manager/updateAppConfig",
  59 +}
... ...
src/assets/css/index.scss
... ... @@ -136,4 +136,9 @@
136 136 height:16px;
137 137 background: #2e9afe;
138 138 }
  139 +}
  140 +div,ul{
  141 + &::-webkit-scrollbar{
  142 + width:0;
  143 + }
139 144 }
140 145 \ No newline at end of file
... ...
src/components/charts/pieChart.vue
... ... @@ -31,16 +31,6 @@ export default {
31 31 methods: {
32 32 setOption() {
33 33 const that = this;
34   - let barStyle = {
35   - barGap: 0,
36   - barWidth: 16,
37   - emphasis: {
38   - focus: "series",
39   - },
40   - itemStyle: {
41   - borderRadius: [8, 8, 0, 0],
42   - },
43   - };
44 34 const options = {
45 35 color: this.colors || ["#ff80db", "#c8cc00", "#67c6b5"],
46 36 backgroundColor: "#f8f8f8",
... ... @@ -48,7 +38,7 @@ export default {
48 38 trigger: "item",
49 39 confine: true,
50 40 formatter(v) {
51   - return `${v.marker} ${v.name}-${v.value}%`
  41 + return `${v.marker} ${v.name}-${v.value}`
52 42 },
53 43 },
54 44 legend: {
... ... @@ -74,7 +64,8 @@ export default {
74 64 label: {
75 65 normal: {
76 66 formatter(v) {
77   - return v.name + v.value + "%";
  67 + console.log(v)
  68 + return v.name + v.data.rate + "%";
78 69 },
79 70 },
80 71 },
... ...
src/store/index.js
... ... @@ -68,10 +68,6 @@ const store = new Vuex.Store({
68 68 let response = res
69 69 if (response.status == 0) {
70 70 const userInfo = { ...response.data }
71   - userInfo.permissions.push({
72   - role: "ROLE_XUEXIAO",
73   - roleName: "学校管理员",
74   - },)
75 71 commit("setToken", Cookies.get("ZT_YIJIAO_TOKEN"));
76 72 commit("setInfo", { ...userInfo });
77 73  
... ...
src/views/device/index.vue
... ... @@ -59,14 +59,14 @@
59 59 clearable
60 60 placeholder="选择班级"
61 61 v-model="query.classId"
62   - :options="classList"
  62 + :options="gradeList"
63 63 :props="props"
64 64 :show-all-levels="false"
65 65 @change="_QueryData(false)"
66 66 ></el-cascader>
67 67 <el-select
68 68 class="sel"
69   - v-model="query.status"
  69 + v-model="query.onlineStatus"
70 70 placeholder="选择状态"
71 71 @change="_QueryData(false)"
72 72 >
... ... @@ -81,7 +81,7 @@
81 81 <el-input
82 82 type="number"
83 83 placeholder="请输入设备编码"
84   - v-model="query.number"
  84 + v-model="query.sn"
85 85 class="input-with-select"
86 86 @keyup.enter.native="_QueryData(true)"
87 87 >
... ... @@ -95,46 +95,48 @@
95 95 </div>
96 96 <el-table :data="tableData" border style="width: 100%">
97 97 <el-table-column
98   - prop="number"
  98 + prop="deviceId"
99 99 label="设备编码"
100 100 align="center"
101 101 ></el-table-column>
102 102 <el-table-column
103   - prop="pindian"
  103 + prop="frequency"
104 104 label="频点"
105 105 align="center"
106 106 ></el-table-column>
107 107 <el-table-column
108   - prop="peidui"
  108 + prop="pairingCode"
109 109 label="配对码"
110 110 align="center"
111 111 ></el-table-column>
112 112 <el-table-column
113   - prop="jiaoshi"
  113 + prop="roomName"
114 114 label="所在教室"
115 115 align="center"
116 116 ></el-table-column>
  117 + <el-table-column label="关联班级" align="center">
  118 + <template slot-scope="scoped">
  119 + <p v-for="item in scoped.row.classList" :key="item.classId">
  120 + {{ item.className }}
  121 + </p>
  122 + </template>
  123 + </el-table-column>
117 124 <el-table-column
118   - prop="class"
119   - label="关联班级"
  125 + prop="otaVersionNumber"
  126 + label="固件版本号"
120 127 align="center"
121 128 ></el-table-column>
122 129 <el-table-column
123   - prop="version"
124   - label="固件版本号"
  130 + prop="latestReportTime"
  131 + label="最近上报"
125 132 align="center"
126 133 ></el-table-column>
127   - <el-table-column prop="datiqi" label="配对答题器" align="center"
128   - ><template slot-scope="scope"
129   - >{{ scope.row.datiqi }}个</template
130   - ></el-table-column
131   - >
132 134 <el-table-column label="状态" align="center"
133 135 ><template slot-scope="scope">
134 136 {{
135 137 scope.row.status == 1
136 138 ? "在线"
137   - : scope.row.status == 2
  139 + : scope.row.status == 0
138 140 ? "离线"
139 141 : "异常"
140 142 }}
... ... @@ -187,19 +189,19 @@
187 189 clearable
188 190 placeholder="选择班级"
189 191 v-model="query.classId"
190   - :options="classList"
  192 + :options="gradeList"
191 193 :props="props"
192 194 :show-all-levels="false"
193 195 @change="_QueryData(false)"
194 196 ></el-cascader>
195 197 <el-select
196 198 class="sel"
197   - v-model="query.status"
  199 + v-model="query.type"
198 200 placeholder="选择状态"
199 201 @change="_QueryData(false)"
200 202 >
201 203 <el-option
202   - v-for="item in statusList"
  204 + v-for="item in typeList"
203 205 :key="item.value"
204 206 :label="item.label"
205 207 :value="item.value"
... ... @@ -209,7 +211,7 @@
209 211 <el-input
210 212 type="number"
211 213 placeholder="请输入设备编码"
212   - v-model="query.number"
  214 + v-model="query.sn"
213 215 class="input-with-select"
214 216 @keyup.enter.native="_QueryData(true)"
215 217 >
... ... @@ -223,37 +225,44 @@
223 225 </div>
224 226 <el-table :data="tableData" border style="width: 100%">
225 227 <el-table-column
226   - prop="number"
  228 + prop="deviceId"
227 229 label="设备编码"
228 230 align="center"
229 231 ></el-table-column>
  232 + <el-table-column label="学生信息" align="center"
  233 + ><template slot-scope="scoped"
  234 + ><p
  235 + v-for="item in scoped.row.studentList"
  236 + :key="item.studentId"
  237 + >
  238 + {{ item.studentName }}
  239 + </p></template
  240 + ></el-table-column
  241 + >
230 242 <el-table-column
231   - prop="xuesheng"
232   - label="学生信息"
233   - align="center"
234   - ></el-table-column>
235   - <el-table-column
236   - prop="dianliang"
  243 + prop="electricity"
237 244 label="电量"
238 245 align="center"
239 246 ></el-table-column>
  247 + <el-table-column prop="class" label="关联班级" align="center">
  248 + <template slot-scope="scoped">
  249 + <p v-for="item in scoped.row.classList" :key="item.classId">
  250 + {{ item.className }}
  251 + </p>
  252 + </template></el-table-column
  253 + >
240 254 <el-table-column
241   - prop="class"
242   - label="关联班级"
243   - align="center"
244   - ></el-table-column>
245   - <el-table-column
246   - prop="peidui"
  255 + prop="pairingCode"
247 256 label="配对码"
248 257 align="center"
249 258 ></el-table-column>
250 259 <el-table-column
251   - prop="cishu"
  260 + prop="answerTimes"
252 261 label="答题次数"
253 262 align="center"
254 263 ></el-table-column>
255 264 <el-table-column
256   - prop="time"
  265 + prop="latestReportTime"
257 266 label="最后答题时间"
258 267 align="center"
259 268 ></el-table-column>
... ... @@ -282,16 +291,16 @@
282 291 clearable
283 292 placeholder="选择班级"
284 293 v-model="query.classId"
285   - :options="classList"
  294 + :options="gradeList"
286 295 :props="props"
287 296 :show-all-levels="false"
288 297 @change="_QueryData(false)"
289 298 ></el-cascader>
290 299 <span class="sel">共选择5个授课端</span>
291   - <el-button plan round @click="autoUpDate"
  300 + <el-button plan round @click="autoUpDate(false)"
292 301 >开启自动更新</el-button
293 302 >
294   - <el-button plan round @click="stopUpdate"
  303 + <el-button plan round @click="stopUpdate(false)"
295 304 >停止自动更新</el-button
296 305 >
297 306 </div>
... ... @@ -303,28 +312,30 @@
303 312 @selection-change="handleSelectionChange"
304 313 >
305 314 <el-table-column type="selection" width="55"> </el-table-column>
  315 + <el-table-column prop="class" label="关联班级" align="center"
  316 + ><template slot-scope="scoped">
  317 + <p v-for="item in scoped.row.classList" :key="item.classId">
  318 + {{ item.className }}
  319 + </p>
  320 + </template></el-table-column
  321 + >
306 322 <el-table-column
307   - prop="class"
308   - label="关联班级"
309   - align="center"
310   - ></el-table-column>
311   - <el-table-column
312   - prop="gengxin"
  323 + prop="lastUpdateTime"
313 324 label="最近更新"
314 325 align="center"
315 326 ></el-table-column>
316 327 <el-table-column
317   - prop="xitong"
  328 + prop="osInfo"
318 329 label="软件系统"
319 330 align="center"
320 331 ></el-table-column>
321 332 <el-table-column
322   - prop="yingjian"
  333 + prop="hardwareInfo"
323 334 label="硬件环境"
324 335 align="center"
325 336 ></el-table-column>
326 337 <el-table-column
327   - prop="version"
  338 + prop="otaVersionNumber"
328 339 label="版本号"
329 340 align="center"
330 341 ></el-table-column>
... ... @@ -342,7 +353,7 @@
342 353 <el-table-column label="自动更新" align="center"
343 354 ><template slot-scope="scoped">
344 355 <el-switch
345   - v-model="scoped.row.isUp"
  356 + v-model="scoped.row.upgradeFlag"
346 357 @change="changeUpdate($event, scoped.row, this)"
347 358 >
348 359 </el-switch> </template
... ... @@ -350,13 +361,25 @@
350 361 </el-table>
351 362 </div>
352 363 </div>
  364 + <div class="pagination-box">
  365 + <el-pagination
  366 + small=""
  367 + layout="total,prev, pager, next"
  368 + :hide-on-single-page="true"
  369 + :total="total"
  370 + @current-change="changePage"
  371 + :current-page="page"
  372 + :page-size="size"
  373 + >
  374 + </el-pagination>
  375 + </div>
353 376 </div>
354 377 </div>
355 378 <el-dialog title="设备导入" :visible.sync="diaUp" width="400">
356 379 <up-load id="downDevice" :url="url" fileName="设备信息">
357 380 <p class="down-txt" slot="down">
358 381 通过Excel名单导入设备,需要提供设备编码,点击
359   - <el-link type="danger" @click="downExcel">模板下载</el-link> 。
  382 + <el-link type="danger" @click="downExcel">模板下载</el-link> 。
360 383 </p>
361 384 </up-load>
362 385 <div class="dialog-footer" slot="footer">
... ... @@ -378,12 +401,12 @@
378 401 </el-input
379 402 ></el-col>
380 403 </el-form-item>
381   - <el-form-item label="频点:" prop="pindian">
  404 + <el-form-item label="频点:" prop="frequency">
382 405 <el-col :span="10"
383 406 ><el-input
384 407 type="text"
385 408 placeholder="输入频点"
386   - v-model.trim="form.pindian"
  409 + v-model.trim="form.frequency"
387 410 maxlength="30"
388 411 size="45"
389 412 show-word-limit
... ... @@ -391,12 +414,12 @@
391 414 </el-input
392 415 ></el-col>
393 416 </el-form-item>
394   - <el-form-item label="配对码:" prop="peidui">
  417 + <el-form-item label="配对码:" prop="pairingCode">
395 418 <el-col :span="10"
396 419 ><el-input
397 420 type="text"
398 421 placeholder="输入配对码"
399   - v-model.trim="form.peidui"
  422 + v-model.trim="form.pairingCode"
400 423 maxlength="30"
401 424 size="45"
402 425 show-word-limit
... ... @@ -409,7 +432,7 @@
409 432 <el-cascader
410 433 clearable
411 434 v-model="form.classId"
412   - :options="classList"
  435 + :options="gradeList"
413 436 :props="{ expandTrigger: 'hover' }"
414 437 :show-all-levels="false"
415 438 ></el-cascader>
... ... @@ -420,7 +443,7 @@
420 443 ><el-input
421 444 type="text"
422 445 placeholder="输入所在教室"
423   - v-model.trim="form.jiaoshi"
  446 + v-model.trim="form.roomName"
424 447 maxlength="30"
425 448 size="45"
426 449 show-word-limit
... ... @@ -444,6 +467,22 @@ import _ from &quot;lodash&quot;;
444 467 import { downloadFile, formatClass } from "@/utils";
445 468 export default {
446 469 components: { pieChart, scatterChart },
  470 + watch: {
  471 + type: function (val) {
  472 + this.page = 1;
  473 + this.total = 0;
  474 + this.query.classId = [];
  475 + this.query.onlineStatus = "";
  476 + this.query.sn = "";
  477 + this.query.type = "";
  478 + if (val == 1) {
  479 + this.stationReport();
  480 + } else if (val == 2) {
  481 + this.keyboardReport();
  482 + }
  483 + this._QueryData();
  484 + },
  485 + },
447 486 data() {
448 487 return {
449 488 school: "",
... ... @@ -451,75 +490,60 @@ export default {
451 490 url: "/web/upLoadDevice",
452 491 diaUp: false,
453 492 diaAnswerEqu: false,
454   - classList: [],
455   - classListAll: [],
  493 + gradeList: [],
  494 + gradeListAll: [],
456 495 props: { multiple: true, checkStrictly: false },
457 496 type: 1,
458 497 query: {
459 498 classId: [],
460   - status: 0,
461   - number: "",
  499 + onlineStatus: "",
  500 + sn: "",
  501 + type: "",
462 502 },
463 503 statusList: [
464   - { label: "全部", value: 0 },
  504 + { label: "离线", value: 0 },
465 505 { label: "在线", value: 1 },
466   - { label: "离线", value: 2 },
467   - { label: "异常", value: 3 },
  506 + { label: "异常", value: 2 },
  507 + ],
  508 + typeList: [
  509 + { label: "全部", value: 0 },
  510 + { label: "1日内", value: 1 },
  511 + { label: "3日内", value: 2 },
  512 + { label: "7日内", value: 3 },
  513 + { label: "1月内", value: 4 },
  514 + { label: "3月内", value: 5 },
  515 + { label: "3月以上", value: 6 },
468 516 ],
469 517 form: {
470 518 number: "",
471   - pindian: "",
472   - peidui: "",
  519 + frequency: "",
  520 + pairingCode: "",
473 521 classId: "",
474   - jiaoshi: "",
  522 + roomName: "",
475 523 },
476 524 formRules: {
477 525 number: [
478 526 { required: true, message: "请输入设备编码", trigger: "blur" },
479 527 ],
480   - pindian: [{ required: true, message: "请输入频点", trigger: "blur" }],
481   - peidui: [{ required: true, message: "请输入配对码", trigger: "blur" }],
  528 + frequency: [{ required: true, message: "请输入频点", trigger: "blur" }],
  529 + pairingCode: [
  530 + { required: true, message: "请输入配对码", trigger: "blur" },
  531 + ],
482 532 classId: [{ required: true, message: "请选择班级", trigger: "blur" }],
483 533 },
484   - tableData: [
485   - {
486   - number: 32456,
487   - pindian: 12,
488   - peidui: 100123,
489   - jiaoshi: " 13号教室",
490   - class: "21班",
491   - version: "2.13",
492   - datiqi: 50,
493   - status: 1,
494   - xuesheng: "sss",
495   - dianliang: "25",
496   - cishu: "10",
497   - time: "10:00:00",
498   - gengxin: "10:00:00",
499   - xitong: "window7",
500   - yingjian: "cpu:i7,4G内存,160G硬盘",
501   - isUp: true,
502   - },
503   - ],
504   - total: 35,
505   - chartData: [
506   - { name: "在线", value: "65" },
507   - { name: "离线", value: "18" },
508   - { name: "异常", value: "17" },
509   - ],
510   - chartData2: [
511   - { name: "1日内", value: "8.6", count: 12 },
512   - { name: "3日内", value: "18", count: 30 },
513   - { name: "7日内", value: "36", count: 60 },
514   - { name: "1月内", value: "80", count: 138 },
515   - { name: "3月内", value: "20", count: 36 },
516   - { name: "3月以上", value: "8", count: 9 },
517   - ],
  534 + tableData: [],
  535 + total: 0,
  536 + chartData: [],
  537 + chartData2: [],
518 538 selectionTabIds: [],
  539 + page: 1,
  540 + size: 20,
519 541 };
520 542 },
521 543 created() {
522   - this._QueryClassList();
  544 + this.stationReport();
  545 + this._QueryGradeList();
  546 + this._QueryData();
523 547 },
524 548 methods: {
525 549 edit() {},
... ... @@ -533,12 +557,28 @@ export default {
533 557 });
534 558 },
535 559 clickPieChart(obj) {
536   - this.query.status = obj.name == "在线" ? 1 : obj.name == "离线" ? 2 : 3;
537   - this._QueryData(false);
  560 + this.query.onlineStatus =
  561 + obj.name == "在线" ? 1 : obj.name == "离线" ? 0 : 2;
  562 + this.query.sn = "";
  563 + this.page = 1;
  564 + this._QueryData();
538 565 },
539 566 clickScatterChart(obj) {
540   - console.log(obj);
541   - // this._QueryData(false)
  567 + this.query.type =
  568 + obj.name == "1日内"
  569 + ? 1
  570 + : obj.name == "3日内"
  571 + ? 2
  572 + : obj.name == "7日内"
  573 + ? 3
  574 + : obj.name == "1月内"
  575 + ? 4
  576 + : obj.name == "3月内"
  577 + ? 5
  578 + : 6;
  579 + this.query.sn = "";
  580 + this.page = 1;
  581 + this._QueryData();
542 582 },
543 583 handleSelectionChange(val) {
544 584 console.log(val);
... ... @@ -554,6 +594,10 @@ export default {
554 594 this.stopUpdate(obj.id);
555 595 }
556 596 }, 800),
  597 + changePage(page) {
  598 + this.page = page;
  599 + this._QueryData();
  600 + },
557 601 async autoUpDate(id) {
558 602 if (!this.selectionTabIds.length && !id) {
559 603 this.$message.warning("请选择授课端~");
... ... @@ -561,8 +605,9 @@ export default {
561 605 }
562 606 if (this.loadingUpDate) return;
563 607 this.loadingUpDate = true;
564   - let data = await this.$request.autoUpDate({
565   - id: id ? id : this.selectionTabIds,
  608 + let data = await this.$request.modifyUpgradeFlag({
  609 + deviceId: id ? id : this.selectionTabIds,
  610 + upgradeFlag: 1,
566 611 });
567 612 this.loadingUpDate = false;
568 613 if (data && !data.code) {
... ... @@ -579,8 +624,9 @@ export default {
579 624 }
580 625 if (this.loadingUpDate) return;
581 626 this.loadingUpDate = true;
582   - let data = await this.$request.stopUpdate({
583   - id: id ? id : this.selectionTabIds,
  627 + let data = await this.$request.modifyUpgradeFlag({
  628 + deviceId: id ? id : this.selectionTabIds,
  629 + upgradeFlag: 0,
584 630 });
585 631 this.loadingUpDate = false;
586 632 if (data && !data.code) {
... ... @@ -606,90 +652,130 @@ export default {
606 652  
607 653 // 添加设备
608 654 async addAnswerEqu() {
609   - // if(this.loadingAnswerEqu)return
610   - // this.loadingAnswerEqu = true;
611   - // const { data, status, info } = await this.$request.fetchClassList();
612   - // this.loadingAnswerEqu = false;
613   - // console.log(status);
614   - // if (status === 0) {
615   - // this._QueryData();
616   - // } else {
617   - // this.$message.error(info);
618   - // }
  655 + if (this.loadingAnswerEqu) return;
  656 + this.loadingAnswerEqu = true;
  657 + const { data, status, info } = await this.$request.fetchgradeList();
  658 + this.loadingAnswerEqu = false;
  659 + console.log(status);
  660 + if (status === 0) {
  661 + this._QueryData();
  662 + } else {
  663 + this.$message.error(info);
  664 + }
619 665 },
620 666 // 查找班级
621   - async _QueryClassList() {
622   - // this.loading = true;
623   - // const { data, status, info } = await this.$request.fetchClassList();
624   - // console.log(status);
625   - // if (status === 0) {
626   - // if (!!data.list) {
627   - // this.classList =
628   - // data.list?.map((item) => {
629   - // return {
630   - // value: item.classId,
631   - // label: item.className,
632   - // };
633   - // }) || [];
634   - // }
635   - // } else {
636   - // this.$message.error(info);
637   - // }
638   - let data = [
639   - {
640   - classId: 1,
641   - className: 1001,
642   - sectionName: 1,
643   - gradeName: 1,
644   - },
645   - {
646   - classId: 1,
647   - className: 1001,
648   - sectionName: 2,
649   - gradeName: 7,
650   - },
651   - {
652   - classId: 1,
653   - className: 1001,
654   - sectionName: 3,
655   - gradeName: 10,
656   - },
657   - {
658   - classId: 1,
659   - className: 1001,
660   - sectionName: 4,
661   - gradeName: 12,
662   - },
663   - ];
664   - this.classList = formatClass(data);
  667 + async _QueryGradeList() {
  668 + this.loading = true;
  669 + const { data, status, info } = await this.$request.gradeList();
  670 + console.log(status);
  671 + if (status === 0) {
  672 + if (!!data.list) {
  673 + this.gradeList =
  674 + data.list?.map((item) => {
  675 + let gradeList = {
  676 + value: item.grade,
  677 + label: item.gradeName,
  678 + };
  679 + gradeList.children =
  680 + item.classList?.map((items) => {
  681 + return {
  682 + value: items.classCode,
  683 + label: items.className,
  684 + };
  685 + }) || [];
  686 + return gradeList;
  687 + }) || [];
  688 + }
  689 + } else {
  690 + this.$message.error(info);
  691 + }
  692 + },
  693 + // 基站统计数据
  694 + async stationReport() {
  695 + const { data, status, info } = await this.$request.stationReport();
  696 + if (status === 0) {
  697 + this.chartData =
  698 + data.list?.map((item) => {
  699 + return {
  700 + name:
  701 + item.onlineStatus == "1" ? "在线" : item.onlineStatus == 0 ? "离线" : "异常",
  702 + value: item.rate,
  703 + count: item.count,
  704 + };
  705 + }) || [];
  706 + this.total = data.total || 0;
  707 + } else {
  708 + this.$message.error(info);
  709 + }
  710 + },
  711 + // 答题器统计数据
  712 + async keyboardReport() {
  713 + const { data, status, info } = await this.$request.keyboardReport();
  714 + if (status === 0) {
  715 + this.chartData2 =
  716 + data.list?.map((item) => {
  717 + return {
  718 + name:
  719 + item.type == 1
  720 + ? "1日内"
  721 + : item.type == 2
  722 + ? "3日内"
  723 + : item.type == 3
  724 + ? "7日内"
  725 + : item.type == 4
  726 + ? "1月内"
  727 + : item.type == 5
  728 + ? "3月内"
  729 + : "3月以上",
  730 + value: item.total,
  731 + rate: item.rate,
  732 + };
  733 + }) || [];
  734 + this.total = data.total || 0;
  735 + } else {
  736 + this.$message.error(info);
  737 + }
665 738 },
666 739 // 设备列表信息
667   - async _QueryData(type) {
668   - console.log(1);
669   - // this.loading = true;
670   - // let query = {};
671   - // if (!type) {
672   - // this.query.title = "";
673   - // query = { ...this.query };
674   - // } else {
675   - // query = { title: this.query.title };
676   - // this.query.status = "";
677   - // this.query.classId = [];
678   - // }
679   - // for (let key in query) {
680   - // if (!query[key] || query[key].length == 0) {
681   - // query[key] = null;
682   - // }
683   - // }
684   - // this.loading = true;
685   - // const { data, status, info } = await this.$request.fetchDeviceList();
686   - // this.loading = false;
687   - // console.log(status);
688   - // if (status === 0) {
689   - // this.tableData = data.list || [];
690   - // } else {
691   - // this.$message.error(info);
692   - // }
  740 + async _QueryData() {
  741 + this.loading = true;
  742 + let query = {};
  743 + let gradeNames = [];
  744 + let classIds = [];
  745 + this.query.classId.map((item) => {
  746 + if (!gradeNames.includes(item[0])) {
  747 + gradeNames.push(item[0]);
  748 + }
  749 + classIds.push(item[1]);
  750 + });
  751 + if (this.query.sn) {
  752 + query.sn = this.query.sn;
  753 + } else {
  754 + gradeNames.length ? (query.gradeNames = gradeNames) : "";
  755 + classIds.length ? (query.classIds = classIds) : "";
  756 + if (this.type == 1) {
  757 + this.query.onlineStatus !== ""
  758 + ? (query.onlineStatus = this.query.onlineStatus)
  759 + : "";
  760 + } else if (this.type == 2) {
  761 + this.query.type !== "" ? (query.type = this.query.type) : "";
  762 + }
  763 + }
  764 +
  765 + this.loading = true;
  766 + const { data, status, info } = await this.$request.deviceList({
  767 + ...query,
  768 + deviceType: this.type,
  769 + page: this.page,
  770 + size: this.size,
  771 + });
  772 + this.loading = false;
  773 + console.log(status);
  774 + if (status === 0) {
  775 + this.tableData = data.list || [];
  776 + } else {
  777 + this.$message.error(info);
  778 + }
693 779 },
694 780 },
695 781 };
... ...
src/views/device/log.vue
... ... @@ -4,32 +4,183 @@
4 4 <template slot="title">
5 5 <span>设备日志</span>
6 6 </template>
7   - <template slot="btns">
8   - <el-tooltip effect="dark" content="基站配置信息导出" placement="bottom">
9   - <el-button
10   - type="primary"
11   - icon="el-icon-download"
12   - size="mini"
13   - plain
14   - circle
15   - @click="down = true"
16   - ></el-button>
17   - </el-tooltip>
18   - </template>
19 7 </back-box>
  8 + <div class="page-content">
  9 + <el-descriptions :column="3" border>
  10 + <el-descriptions-item label="设备编码"
  11 + >kooriookami</el-descriptions-item
  12 + >
  13 + <el-descriptions-item label="电量">18100000000</el-descriptions-item>
  14 + <el-descriptions-item label="配对码">苏州市</el-descriptions-item>
  15 + <el-descriptions-item label="关联班级"
  16 + >江苏省苏州市吴中区</el-descriptions-item
  17 + >
  18 + <el-descriptions-item label="最后答题时间"
  19 + >江苏省苏州市吴中区</el-descriptions-item
  20 + >
  21 + <el-descriptions-item label="答题次数"
  22 + >江苏省苏州市吴中区</el-descriptions-item
  23 + >
  24 + </el-descriptions>
  25 + </div>
  26 + <div class="answer-header">
  27 + <div class="sel-box">
  28 + <div class="d1">
  29 + <el-date-picker
  30 + v-model="query.startDay"
  31 + type="date"
  32 + @change="handleChangeTimeStart"
  33 + placeholder="选择日期时间"
  34 + value-format="yyyy-MM-dd"
  35 + >
  36 + </el-date-picker>
  37 + ~
  38 + <el-date-picker
  39 + v-model="query.endDay"
  40 + type="date"
  41 + placeholder="选择日期时间"
  42 + @change="handleChangeTimeEnd"
  43 + value-format="yyyy-MM-dd"
  44 + >
  45 + </el-date-picker>
  46 + </div>
  47 + <p class="p1">
  48 + <span @click="setDate(1)" :class="[date == 1 ? 'active' : '', 's1']"
  49 + >今天</span
  50 + >
  51 + <span @click="setDate(2)" :class="[date == 2 ? 'active' : '', 's1']"
  52 + >本周</span
  53 + >
  54 + <span @click="setDate(3)" :class="[date == 3 ? 'active' : '', 's1']"
  55 + >本月</span
  56 + >
  57 + <span @click="setDate(4)" :class="[date == 4 ? 'active' : '', 's1']"
  58 + >本季度</span
  59 + >
  60 + </p>
  61 + </div>
  62 + </div>
20 63 </div>
21 64 </template>
22 65  
23 66 <script>
  67 +import { formatDate } from "utils";
24 68 export default {
25 69 data() {
26 70 return {
27   - down: false,
  71 + id:'',
  72 + date: "", //今天-昨天-本周
  73 + query: {
  74 + //搜索条件
  75 + startDay: "",
  76 + endDay: "",
  77 + day: "",
  78 + },
28 79 };
29 80 },
30   - methods: {},
  81 + created() {
  82 + this.id = this.$route.query.id
  83 + // await this.setDate(1);
  84 + let startDay = this.query?.startDay;
  85 + if (!startDay) {
  86 + this.query.startDay = new Date();
  87 + this.query.endDay = new Date();
  88 + }
  89 + },
  90 + methods: {
  91 + setDate(index) {
  92 + const that = this;
  93 + this.date = index == this.date ? "" : index;
  94 + let aYear = new Date().getFullYear();
  95 + let aMonth = new Date().getMonth() + 1;
  96 + that.query.day = "";
  97 + that.query.startDay = "";
  98 + that.query.endDay = "";
  99 + switch (index) {
  100 + case 1:
  101 + that.query.day = formatDate(new Date(), "yyyy-MM-dd");
  102 + that.query.startDay = that.query.day;
  103 + that.query.endDay = that.query.day;
  104 + break;
  105 + case 2:
  106 + let day = new Date().getDay();
  107 + if (day == 0) {
  108 + //中国式星期天是一周的最后一天
  109 + day = 7;
  110 + }
  111 + let aTime = new Date().getTime() - 24 * 60 * 60 * 1000 * day;
  112 + that.query.startDay = formatDate(new Date(aTime), "yyyy-MM-dd");
  113 + that.query.endDay = formatDate(new Date(), "yyyy-MM-dd");
  114 + break;
  115 + case 3:
  116 + aMonth = aMonth < 10 ? "0" + aMonth : aMonth;
  117 + that.query.startDay = `${aYear}-${aMonth}-01`;
  118 + that.query.endDay = formatDate(new Date(), "yyyy-MM-dd");
  119 + break;
  120 + case 4:
  121 + if (aMonth > 1 && aMonth < 4) {
  122 + aMonth = "01";
  123 + } else if (aMonth > 3 && aMonth < 7) {
  124 + aMonth = "04";
  125 + } else if (aMonth > 6 && aMonth < 10) {
  126 + aMonth = "07";
  127 + } else {
  128 + aMonth = "10";
  129 + }
  130 +
  131 + aMonth = aMonth < 10 ? "0" + aMonth : aMonth;
  132 + that.query.startDay = `${aYear}-${aMonth}-01`;
  133 + that.query.endDay = formatDate(new Date(), "yyyy-MM-dd");
  134 + break;
  135 + }
  136 + this.page = 1;
  137 + this._QueryData();
  138 + },
  139 + handleChangeTimeStart(val) {
  140 + this.query.day = "";
  141 + this.date = "";
  142 + if (this.query.endDay) {
  143 + if (new Date(val).getTime() > new Date(this.query.endDay).getTime()) {
  144 + this.$message.error("任务结束时间不能任务开始时间前面,请重新设置");
  145 + this.query.startDay = "";
  146 + }
  147 + }
  148 + },
  149 + handleChangeTimeEnd(val) {
  150 + this.query.day = "";
  151 + this.date = "";
  152 + if (this.query.startDay) {
  153 + if (new Date(val).getTime() < new Date(this.query.startDay).getTime()) {
  154 + this.$message.error("任务结束时间不能任务开始时间前面,请重新设置");
  155 + this.query.endDay = "";
  156 + }
  157 + }
  158 + },
  159 + async _QueryData() {
  160 + this.loading = true;
  161 + //多课时对比
  162 + let query = {};
  163 + for (let key in this.query) {
  164 + if (this.query[key] != "") {
  165 + query[key] = this.query[key];
  166 + }
  167 + }
  168 + const { data, status, info } = await this.$request.fetchQuizList({
  169 + ...query,
  170 + id:this.id
  171 + });
  172 + this.loading = false;
  173 + if (status === 0) {
  174 + } else {
  175 + this.$message.error(info);
  176 + }
  177 + },
  178 + },
31 179 };
32 180 </script>
33 181  
34   -<style>
  182 +<style lang="scss" scoped>
  183 +.page-content {
  184 + padding: 20px;
  185 +}
35 186 </style>
36 187 \ No newline at end of file
... ...
src/views/down/index.vue
1 1 <template>
2   - <div>下载软件
  2 + <div>
3 3 <router-link to="/downClient">授课端下载</router-link>
  4 + <back-box>
  5 + <template slot="title">
  6 + <span>软件下载</span>
  7 + </template>
  8 + </back-box>
  9 + <div class=""></div>
4 10 </div>
5 11 </template>
6 12  
... ...
src/views/index/mainIndex.vue
... ... @@ -5,21 +5,21 @@
5 5 <img class="icon" src="../../assets/nav/setUpAccount.png" alt="" />
6 6 <div class="text">
7 7 <p class="p1">账号管理</p>
8   - <p class="p2">管理32个任课教师,14个班主任,3个备课组长账号信息。</p>
  8 + <p class="p2">管理{{schoolInfo.teacherCourseCount}}个任课教师,{{schoolInfo.classManagerCount}}个班主任,{{schoolInfo.teacherGradeCount}}个备课组长账号信息。</p>
9 9 </div>
10 10 </li>
11 11 <li class="nav-item item1" @click="links('/setUpSchool')">
12 12 <img class="icon" src="../../assets/nav/setUpSchool.png" alt="" />
13 13 <div class="text">
14 14 <p class="p1">学校管理</p>
15   - <p class="p2">管理6个年级,3个班级,397名学生信息。</p>
  15 + <p class="p2">管理{{schoolInfo.gradeCount}}个年级,{{schoolInfo.classCount}}个班级,{{schoolInfo.studentCount}}名学生信息。</p>
16 16 </div>
17 17 </li>
18 18 <li class="nav-item item2" @click="links('/device')">
19 19 <img class="icon" src="../../assets/nav/device.png" alt="" />
20 20 <div class="text">
21 21 <p class="p1">设备状态</p>
22   - <p class="p2">管理14个基站,396套答题器设备。</p>
  22 + <p class="p2">管理{{schoolInfo.stationCount}}个基站,{{schoolInfo.keyboardCount}}套答题器设备。</p>
23 23 </div>
24 24 </li>
25 25 <li class="item3">
... ... @@ -98,6 +98,7 @@ export default {
98 98 return {
99 99 type: "",
100 100 navList: [],
  101 + schoolInfo:{}
101 102 };
102 103 },
103 104 watch:{
... ... @@ -113,6 +114,9 @@ export default {
113 114 path:item.children[0].path,
114 115 }
115 116 })
  117 + if(this.type == "ROLE_XUEXIAO"){
  118 + this.schoolIndex()
  119 + }
116 120 },
117 121 methods: {
118 122 getImgs(path) {
... ... @@ -123,6 +127,14 @@ export default {
123 127 path: path,
124 128 });
125 129 },
  130 + async schoolIndex() {
  131 + const { data, status, info } = await this.$request.schoolIndex();
  132 + if (status === 0) {
  133 + this.schoolInfo = { ...data };
  134 + } else {
  135 + this.$message.error(info);
  136 + }
  137 + },
126 138 },
127 139 };
128 140 </script>
... ... @@ -170,7 +182,7 @@ export default {
170 182 margin-right: 20px;
171 183 margin-bottom: 20px;
172 184 box-sizing: border-box;
173   - padding: 40px 80px;
  185 + padding: 40px 20px 40px 80px;
174 186 &:nth-child(2) {
175 187 margin-right: 0;
176 188 }
... ... @@ -201,7 +213,7 @@ export default {
201 213 height: calc(50% - 8px);
202 214 margin-right: 20px;
203 215 flex-wrap: wrap;
204   - padding: 12px 30px;
  216 + padding: 12px 0 12px 30px;
205 217 .icon {
206 218 width: 60px;
207 219 height: 60px;
... ...
src/views/login/index.vue
... ... @@ -90,8 +90,8 @@ export default {
90 90 disableClick: true,
91 91 passwordType: "password",
92 92 loginForm: {
93   - username: "13028102196",
94   - password: "Pw102196#",
  93 + username: "13610050254",
  94 + password: "Pw050254#",
95 95 },
96 96 loginRules: {
97 97 username: [
... ...
src/views/setUp/school.vue
... ... @@ -23,47 +23,67 @@
23 23 <ul class="school-info">
24 24 <li class="school-item">
25 25 <span class="s1">学校名称:</span>
26   - <span class="s2">{{ school.title }}</span>
  26 + <span class="s2">{{ school.schoolName || "--" }}</span>
27 27 </li>
28 28 <li class="school-item">
29 29 <span class="s1">授课端管理密码:</span>
30   - <span class="s2">{{ school.password }}</span>
  30 + <span class="s2">{{ school.managePwd || "--" }}</span>
31 31 </li>
32 32 <li class="school-item">
33 33 <span class="s1">联系人:</span>
34   - <span class="s2">{{ school.lianxiren }}</span>
  34 + <span class="s2">{{ school.contactPerson || "--" }}</span>
35 35 </li>
36 36 <li class="school-item">
37 37 <span class="s1">手机号码:</span>
38   - <span class="s2">{{ school.phone }}</span>
  38 + <span class="s2">{{ school.contactPhone || "--" }}</span>
39 39 </li>
40 40 <li class="school-item">
41 41 <span class="s1">学段:</span>
42   - <span class="s2">{{ school.xueduan }}</span>
  42 + <span class="s2">{{
  43 + school.sections | getSections(school.sections)
  44 + }}</span>
43 45 </li>
44 46 <li class="school-item">
45 47 <span class="s1">所属集团:</span>
46   - <span class="s2">{{ school.jituan }}</span>
  48 + <span class="s2">{{ school.tenantName || "--" }}</span>
47 49 </li>
48 50 </ul>
49 51 <div class="grade-box">
50 52 <p class="h-title">年级管理</p>
51 53 <ul class="grade-info">
52   - <li class="grade-item">
53   - <p class="grade-name">一年级</p>
  54 + <li
  55 + class="grade-item"
  56 + v-for="item in tableData"
  57 + :key="item.grade"
  58 + @click="setGrade(item)"
  59 + >
  60 + <p class="grade-name">{{ item.gradeName }}</p>
54 61 <div class="grade-class">
55   - <p><i class="fa fa-building"></i>班级:10个</p>
56   - <p><i class="fa fa-book"></i>科目:10个</p>
  62 + <p>
  63 + <i class="fa fa-building"></i>班级:{{
  64 + item.classList.length
  65 + }}个
  66 + </p>
  67 + <p>
  68 + <i class="fa fa-book"></i>科目:{{
  69 + item.subjectNames.length
  70 + }}个
  71 + </p>
57 72 </div>
58 73 </li>
59 74 </ul>
  75 + <el-empty
  76 + :image-size="100"
  77 + v-if="!tableData.length && loading == false"
  78 + description="没有更多数据"
  79 + ></el-empty>
60 80 </div>
61 81 </div>
62 82 </div>
63 83 <el-dialog title="导入学校名单" :visible.sync="diaUp" width="400">
64 84 <up-load id="downDevice" :url="url" fileName="学校名单">
65 85 <p class="down-txt" slot="down">
66   - 通过Excel名单导入学校名单,需要提供设备编码,点击
  86 + 通过Excel名单导入学校名单,点击
67 87 <el-link type="danger" @click="downExcel">模板下载</el-link> 。
68 88 </p>
69 89 </up-load>
... ... @@ -77,21 +97,82 @@
77 97 <script>
78 98 import { downloadFile } from "@/utils";
79 99 export default {
  100 + filters: {
  101 + getSections(val) {
  102 + let arr = val.split(",");
  103 + let sections = arr.map((item) => {
  104 + let txt;
  105 + switch (item) {
  106 + case "0":
  107 + txt = "未知";
  108 + break;
  109 + case "1":
  110 + txt = "小学";
  111 + break;
  112 + case "2":
  113 + txt = "初中";
  114 + break;
  115 + case "3":
  116 + txt = "高中";
  117 + break;
  118 + case "4":
  119 + txt = "大学";
  120 + break;
  121 + case "7":
  122 + txt = "未知";
  123 + break;
  124 + default:
  125 + txt = "未知";
  126 + }
  127 + return txt;
  128 + });
  129 + return sections.join(",");
  130 + },
  131 + },
80 132 data() {
81 133 return {
82 134 url: "xxx",
83 135 diaUp: false,
  136 + loading: false,
84 137 school: {
85   - title: "长水实验中学",
86   - password: "123456",
87   - lianxiren: "张老师",
88   - phone: "13548645321",
89   - xueduan: "初中",
90   - jituan: "长水集团",
  138 + schoolName: "长水实验中学",
  139 + managePwd: "123456",
  140 + contactPerson: "张老师",
  141 + contactPhone: "13548645321",
  142 + sections: "初中",
  143 + tenantName: "长水集团",
91 144 },
  145 + tableData: [],
92 146 };
93 147 },
  148 + created() {
  149 + this._QueryDataSchool();
  150 + this._QueryDataGrade();
  151 + },
94 152 methods: {
  153 + setGrade(obj) {},
  154 + async _QueryDataSchool() {
  155 + this.loading = true;
  156 + const { data, status, info } = await this.$request.schoolDetail();
  157 + this.loading = false;
  158 + console.log(status);
  159 + if (status === 0) {
  160 + this.school = { ...data };
  161 + } else {
  162 + this.$message.error(info);
  163 + }
  164 + },
  165 + async _QueryDataGrade() {
  166 + this.loading = true;
  167 + const { data, status, info } = await this.$request.gradeList();
  168 + this.loading = false;
  169 + console.log(status);
  170 + if (status === 0) {
  171 + this.tableData = data.list || [];
  172 + } else {
  173 + this.$message.error(info);
  174 + }
  175 + },
95 176 async downExcel() {
96 177 let data = await this.$request.downDevice({
97 178 id: this.id,
... ... @@ -120,11 +201,11 @@ export default {
120 201 position: absolute;
121 202 top: 12px;
122 203 right: 12px;
123   - padding:5px;
124   - font-size:18px;
  204 + padding: 5px;
  205 + font-size: 18px;
125 206 cursor: pointer;
126   - &:hover{
127   - color:#36f
  207 + &:hover {
  208 + color: #36f;
128 209 }
129 210 }
130 211 }
... ... @@ -132,7 +213,7 @@ export default {
132 213 display: flex;
133 214 flex-wrap: wrap;
134 215 padding: 16px 0;
135   - border-bottom:.5px solid #f2f2f2;
  216 + border-bottom: 0.5px solid #f2f2f2;
136 217 .school-item {
137 218 width: 50%;
138 219 line-height: 48px;
... ... @@ -151,37 +232,43 @@ export default {
151 232 }
152 233 .grade-box {
153 234 padding: 20px;
154   - .grade-info{
  235 + .grade-info {
155 236 display: flex;
156   - flex-wrap:wrap;
157   - padding:20px;
158   - .grade-item{
159   - width:300px;
160   - margin-right:50px;
161   - margin-bottom:40px;
  237 + flex-wrap: wrap;
  238 + padding: 20px;
  239 + .grade-item {
  240 + width: 300px;
  241 + margin-right: 50px;
  242 + margin-bottom: 40px;
162 243 box-sizing: border-box;
163   - padding:12px 16px;
164   - border-radius:10px;
  244 + padding: 12px 16px;
  245 + border-radius: 10px;
165 246 box-shadow: 1px 1px 3px #888;
  247 + cursor: pointer;
  248 + transition: all .5s;
  249 + &:hover{
  250 + transform: translate(-2px,-5px);
  251 + box-shadow: 5px 5px 10px #888;
  252 + }
166 253 }
167   - .grade-name{
168   - font-size:16px;
  254 + .grade-name {
  255 + font-size: 16px;
169 256 font-weight: bold;
170 257 line-height: 18px;
171   - padding-bottom:12px;
  258 + padding-bottom: 12px;
172 259 }
173   - .grade-class{
  260 + .grade-class {
174 261 display: flex;
175 262 justify-content: space-between;
176   - font-size:15px;
177   - padding-right:20px;
178   - .fa{
179   - font-size:18px;
180   - margin-right:5px;
181   - color:#a4a4a4
  263 + font-size: 15px;
  264 + padding-right: 20px;
  265 + .fa {
  266 + font-size: 18px;
  267 + margin-right: 5px;
  268 + color: #a4a4a4;
182 269 }
183   - .fa-book{
184   - font-size:20px;
  270 + .fa-book {
  271 + font-size: 20px;
185 272 }
186 273 }
187 274 }
... ...
src/views/setUp/student.vue
1 1 <template>
2   - <div>学生管理</div>
  2 + <div>
  3 + <back-box>
  4 + <template slot="title">
  5 + <span>教师管理</span>
  6 + </template>
  7 + <template slot="btns">
  8 + <el-tooltip effect="dark" content="添加学生" placement="bottom">
  9 + <el-button
  10 + type="primary"
  11 + icon="el-icon-plus"
  12 + size="mini"
  13 + plain
  14 + circle
  15 + ></el-button>
  16 + </el-tooltip>
  17 + </template>
  18 + </back-box>
  19 + <div class="page-content">
  20 + <div class="stu-box">
  21 + <div class="stu-list">
  22 + <div class="h-title">
  23 + <el-select
  24 + class="sel"
  25 + v-model="query.gradeName"
  26 + placeholder="选择年级"
  27 + @change="changeGrade"
  28 + >
  29 + <el-option
  30 + v-for="item in gradeList"
  31 + :key="item.value"
  32 + :label="item.label"
  33 + :value="item.value"
  34 + >
  35 + </el-option>
  36 + </el-select>
  37 + </div>
  38 + <ul class="stu-ul">
  39 + <li
  40 + class="stu-item"
  41 + v-for="item in classList"
  42 + :key="item.classCode"
  43 + :class="query.classId == item.classCode ? 'avtive' : ''"
  44 + @click="classDetail(item.classCode)"
  45 + >
  46 + <i class="el-icon-edit-outline"></i>
  47 + {{ item.className }}({{ item.studentCount }})
  48 + </li>
  49 + </ul>
  50 + </div>
  51 + <div class="stu-detail">
  52 + <div class="answer-header">
  53 + <div class="sel-box">
  54 + <el-input
  55 + placeholder="请输入学生姓名"
  56 + v-model="query.studentName"
  57 + class="input-with-select"
  58 + @keyup.enter.native="_QueryData(1)"
  59 + >
  60 + <el-button
  61 + slot="append"
  62 + icon="el-icon-search"
  63 + @click="_QueryData(1)"
  64 + ></el-button>
  65 + </el-input>
  66 + <el-input
  67 + placeholder="请输入学生学号"
  68 + v-model="query.studentCode"
  69 + class="input-with-select"
  70 + @keyup.enter.native="_QueryData(2)"
  71 + >
  72 + <el-button
  73 + slot="append"
  74 + icon="el-icon-search"
  75 + @click="_QueryData(2)"
  76 + ></el-button>
  77 + </el-input>
  78 + </div>
  79 + </div>
  80 + <ul class="s-ul" v-loading="loading">
  81 + <li class="s-li" v-for="item in studentList" :key="item.id">
  82 + <i class="el-icon-delete"></i>
  83 + <p class="name">{{ item.studentName }}</p>
  84 + <p class="p1">
  85 + 答题器:{{ (item.clickerList.length && item.clickerList[0].clickerSn) || "--" }}
  86 + </p>
  87 + <p class="p1">长学号:{{ item.studentCode }}</p>
  88 + <p class="p1">短学号:{{ item.shortNumber || "--" }}</p>
  89 + </li>
  90 + </ul>
  91 + <el-empty
  92 + :image-size="100"
  93 + v-if="!studentList.length && loading == false"
  94 + description="没有更多数据"
  95 + ></el-empty>
  96 + </div>
  97 + </div>
  98 + </div>
  99 + <el-dialog title="导入学校名单" :visible.sync="diaUp" width="400">
  100 + <up-load id="downTeacher" :url="url" fileName="教师名单">
  101 + <p class="down-txt" slot="down">
  102 + 通过Excel名单导入教师名单,点击
  103 + <el-link type="danger" @click="downExcel">模板下载</el-link> 。
  104 + </p>
  105 + </up-load>
  106 + <div class="dialog-footer" slot="footer">
  107 + <el-button @click="diaUp = false">取 消</el-button>
  108 + </div>
  109 + </el-dialog>
  110 + </div>
3 111 </template>
4 112  
5 113 <script>
  114 +import { downloadFile } from "@/utils";
6 115 export default {
7   -
8   -}
  116 + data() {
  117 + return {
  118 + url: "",
  119 + diaUp: false,
  120 + query: {
  121 + gradeName: "",
  122 + classId: "",
  123 + studentCode: "",
  124 + studentName: "",
  125 + },
  126 + gradeName: "",
  127 + gradeList: [],
  128 + classList: [],
  129 + studentList: [],
  130 + teacherDetail: {
  131 + teacherName: "",
  132 + loginName: "",
  133 + sex: "",
  134 + available: "",
  135 + managerList: [],
  136 + teacherCourseList: [],
  137 + teacherGradeList: [],
  138 + },
  139 + };
  140 + },
  141 + async created() {
  142 + await this._QueryDataGrade();
  143 + this._QueryClass();
  144 + this._QueryData(3);
  145 + },
  146 + methods: {
  147 + changeGrade(val) {
  148 + this.query.classId = "";
  149 + this._QueryClass(val);
  150 + this._QueryData(3);
  151 + },
  152 + classDetail(id) {
  153 + this.query.classId = id;
  154 + this._QueryData(3);
  155 + },
  156 + async _QueryData(type) {
  157 + let query = {};
  158 + query.gradeName = this.query.gradeName;
  159 + query.classId = this.query.classId;
  160 + if (type == 1) {
  161 + query.studentName = this.query.studentName;
  162 + this.query.studentCode = "";
  163 + } else if (type == 2) {
  164 + query.studentCode = this.query.studentCode;
  165 + this.query.studentName = "";
  166 + } else if (type == 3) {
  167 + this.query.studentName = "";
  168 + this.query.studentCode = "";
  169 + }
  170 + this.loading = true;
  171 + const { data, status, info } = await this.$request.studentList({
  172 + ...query,
  173 + });
  174 + this.loading = false;
  175 + console.log(status);
  176 + if (status === 0) {
  177 + this.studentList = data.list || [];
  178 + } else {
  179 + this.$message.error(info);
  180 + }
  181 + },
  182 + async _QueryDataGrade() {
  183 + this.loading = true;
  184 + const { data, status, info } = await this.$request.gradeList();
  185 + if (status === 0) {
  186 + this.gradeList =
  187 + data.list?.map((item) => {
  188 + return {
  189 + value: item.gradeName,
  190 + label: item.gradeName,
  191 + };
  192 + }) || [];
  193 + this.query.gradeName = this.gradeList[0]?.value;
  194 + } else {
  195 + this.$message.error(info);
  196 + }
  197 + },
  198 + async _QueryClass(value) {
  199 + const { data, status, info } = await this.$request.schoolClassList({
  200 + gradeName: value || this.query.gradeName,
  201 + });
  202 + if (status === 0) {
  203 + this.classList = [...data.list] || [];
  204 + } else {
  205 + this.$message.error(info);
  206 + }
  207 + },
  208 + async downExcel() {
  209 + let data = await this.$request.downDevice({
  210 + id: this.id,
  211 + });
  212 + if (data && !data.code) {
  213 + let blob = new Blob([data], {
  214 + type: "application/vnd.ms-excel;charset=utf-8",
  215 + });
  216 + downloadFile(`设备信息.xlsx`, blob);
  217 + } else {
  218 + this.$message.error(data.message);
  219 + }
  220 + },
  221 + },
  222 +};
9 223 </script>
10 224  
11   -<style>
12   -
  225 +<style lang="scss" scoped>
  226 +.page-content {
  227 + padding: 20px;
  228 +}
  229 +.stu-box {
  230 + display: flex;
  231 + background: #f8f8f8;
  232 + border-radius: 10px;
  233 + overflow: hidden;
  234 + .stu-list {
  235 + max-height: 80vh;
  236 + .h-title {
  237 + height: 40px;
  238 + overflow-y: scroll;
  239 + line-height: 40px;
  240 + background: #eee;
  241 + }
  242 + .stu-item {
  243 + font-size: 16px;
  244 + color: #7f7f7f;
  245 + line-height: 36px;
  246 + cursor: pointer;
  247 + padding-left: 12px;
  248 + position: relative;
  249 + .el-icon-edit-outline {
  250 + position: absolute;
  251 + top: 8px;
  252 + right: 12px;
  253 + font-size: 20px;
  254 + display: none;
  255 + &:hover {
  256 + color: #667ffd;
  257 + }
  258 + }
  259 + &:hover {
  260 + background: #eee;
  261 + .el-icon-edit-outline {
  262 + display: block;
  263 + }
  264 + }
  265 + &.active {
  266 + color: #667ffd;
  267 + }
  268 + }
  269 + .sel {
  270 + width: 180px;
  271 + :deep(.el-input__inner) {
  272 + font-size: 16px;
  273 + padding-left: 0;
  274 + border: none;
  275 + background: transparent;
  276 + }
  277 + :deep(.el-icon-arrow-up:before) {
  278 + content: "\e78f";
  279 + }
  280 + }
  281 + }
  282 + .stu-detail {
  283 + flex: 1;
  284 + border-left: 0.5px solid #eee;
  285 + .s-ul {
  286 + display: flex;
  287 + flex-wrap: wrap;
  288 + padding-left: 20px;
  289 + .s-li {
  290 + width: 180px;
  291 + height: 120px;
  292 + box-shadow: 2px 2px 5px #7f7f7f;
  293 + border-radius: 10px;
  294 + margin: 0 20px 20px 0;
  295 + padding: 0 12px 5px;
  296 + position: relative;
  297 + .el-icon-delete {
  298 + position: absolute;
  299 + top: 8px;
  300 + right: 8px;
  301 + font-size: 18px;
  302 + padding: 2px;
  303 + display: none;
  304 + cursor: pointer;
  305 + &:hover {
  306 + color: #667ffd;
  307 + }
  308 + }
  309 + &:hover {
  310 + .el-icon-delete {
  311 + display: block;
  312 + }
  313 + }
  314 + .name {
  315 + text-align: center;
  316 + font-size: 16px;
  317 + line-height: 18px;
  318 + padding: 10px 0;
  319 + }
  320 + .p1 {
  321 + color: #7f7f7f;
  322 + line-height: 20px;
  323 + padding-bottom: 5px;
  324 + }
  325 + }
  326 + }
  327 + }
  328 +}
13 329 </style>
14 330 \ No newline at end of file
... ...
src/views/setUp/teacher.vue
1 1 <template>
2   - <div>老师管理</div>
  2 + <div>
  3 + <back-box>
  4 + <template slot="title">
  5 + <span>教师管理</span>
  6 + </template>
  7 + <template slot="btns">
  8 + <el-tooltip effect="dark" content="导入教师名单" placement="bottom">
  9 + <el-button
  10 + type="primary"
  11 + icon="el-icon-upload2"
  12 + size="mini"
  13 + plain
  14 + circle
  15 + @click="diaUp = true"
  16 + ></el-button>
  17 + </el-tooltip>
  18 + <el-tooltip effect="dark" content="添加教师" placement="bottom">
  19 + <el-button
  20 + type="primary"
  21 + icon="el-icon-plus"
  22 + size="mini"
  23 + plain
  24 + circle
  25 + ></el-button>
  26 + </el-tooltip>
  27 + </template>
  28 + </back-box>
  29 +
  30 + <div class="answer-header">
  31 + <div class="sel-box">
  32 + <el-select
  33 + class="sel"
  34 + v-model="query.gradeName"
  35 + placeholder="选择年级"
  36 + @change="_QueryData(1)"
  37 + >
  38 + <el-option
  39 + v-for="item in gradeList"
  40 + :key="item.value"
  41 + :label="item.label"
  42 + :value="item.value"
  43 + >
  44 + </el-option>
  45 + </el-select>
  46 + <el-input
  47 + placeholder="请输入老师姓名"
  48 + v-model="query.teacherName"
  49 + class="input-with-select"
  50 + @keyup.enter.native="_QueryData(2)"
  51 + >
  52 + <el-button
  53 + slot="append"
  54 + icon="el-icon-search"
  55 + @click="_QueryData(2)"
  56 + ></el-button>
  57 + </el-input>
  58 + <el-input
  59 + type="number"
  60 + placeholder="请输入老师手机号"
  61 + v-model="query.phone"
  62 + class="input-with-select"
  63 + @keyup.enter.native="_QueryData(3)"
  64 + >
  65 + <el-button
  66 + slot="append"
  67 + icon="el-icon-search"
  68 + @click="_QueryData(3)"
  69 + ></el-button>
  70 + </el-input>
  71 + </div>
  72 + </div>
  73 + <div class="page-content">
  74 + <el-empty
  75 + :image-size="100"
  76 + v-if="!teacherList.length && loading == false"
  77 + description="没有更多数据"
  78 + ></el-empty>
  79 + <div class="teacher-box" v-loading="loading" v-else>
  80 + <div class="teacher-list">
  81 + <p class="h-title">教师列表</p>
  82 + <ul class="teacher-ul">
  83 + <li
  84 + class="teacher-item"
  85 + v-for="item in teacherList"
  86 + :key="item.id"
  87 + :class="showTId == item.id ? 'active' : ''"
  88 + @click="showTeacher(item)"
  89 + >
  90 + {{ item.realName }}({{ setClass(item) }})
  91 + </li>
  92 + </ul>
  93 + </div>
  94 + <div class="teacher-detail">
  95 + <div class="icon-box">
  96 + <i class="icon el-icon-edit-outline"></i>
  97 + <i class="icon el-icon-circle-plus-outline"></i>
  98 + </div>
  99 + <div class="detail-top">
  100 + <p class="p-item">手机号码:{{ teacherDetail.loginName }}</p>
  101 + <p class="p-item">
  102 + 状态:{{ teacherDetail.available == 1 ? "正常" : "不可用" }}
  103 + </p>
  104 + <p class="p-item">
  105 + 性别:{{
  106 + teacherDetail.sex == 1
  107 + ? "男"
  108 + : teacherDetail.sex == 2
  109 + ? "女"
  110 + : "未知"
  111 + }}
  112 + </p>
  113 + </div>
  114 + <div
  115 + class="grade-box"
  116 + v-if="teacherDetail.managerList && teacherDetail.managerList.length"
  117 + >
  118 + <p class="h-title">班主任</p>
  119 + <ul class="grade-info">
  120 + <li
  121 + class="grade-li"
  122 + v-for="item in teacherDetail.managerList"
  123 + :key="item.classId"
  124 + >
  125 + <i class="el-icon-delete"></i>
  126 + <div class="grade-item">
  127 + <p class="grade-name">{{ item.className }}</p>
  128 + <div class="grade-class">
  129 + <p>
  130 + <i class="fa fa-address-book-o"></i>学生:{{
  131 + item.studentCount
  132 + }}个
  133 + </p>
  134 + </div>
  135 + </div>
  136 + </li>
  137 + </ul>
  138 + </div>
  139 + <div
  140 + class="grade-box"
  141 + v-if="
  142 + teacherDetail.teacherCourseList &&
  143 + teacherDetail.teacherCourseList.length
  144 + "
  145 + >
  146 + <p class="h-title">任课老师</p>
  147 + <ul class="grade-info">
  148 + <li
  149 + class="grade-li"
  150 + v-for="item in teacherDetail.teacherCourseList"
  151 + :key="item.classId"
  152 + >
  153 + <i class="el-icon-delete"></i>
  154 + <div class="grade-item">
  155 + <p class="grade-name">
  156 + {{ item.className }}({{ item.subjectName }})
  157 + </p>
  158 + <div class="grade-class">
  159 + <p>
  160 + <i class="fa fa-address-book-o"></i>学生:{{
  161 + item.studentCount
  162 + }}个
  163 + </p>
  164 + </div>
  165 + </div>
  166 + </li>
  167 + </ul>
  168 + </div>
  169 + <div
  170 + class="grade-box"
  171 + v-if="
  172 + teacherDetail.teacherGradeList &&
  173 + teacherDetail.teacherGradeList.length
  174 + "
  175 + >
  176 + <p class="h-title">备课组长</p>
  177 + <ul
  178 + class="grade-info"
  179 + v-for="item in teacherDetail.teacherGradeList"
  180 + :key="item.grade"
  181 + >
  182 + <li class="grade-li">
  183 + <i class="el-icon-delete"></i>
  184 + <div class="grade-item">
  185 + <p class="grade-name">
  186 + {{ item.gradeName }}({{ item.subjectName }})
  187 + </p>
  188 + </div>
  189 + </li>
  190 + </ul>
  191 + </div>
  192 + </div>
  193 + </div>
  194 + </div>
  195 + <el-dialog title="导入学校名单" :visible.sync="diaUp" width="400">
  196 + <up-load id="downTeacher" :url="url" fileName="教师名单">
  197 + <p class="down-txt" slot="down">
  198 + 通过Excel名单导入教师名单,点击
  199 + <el-link type="danger" @click="downExcel">模板下载</el-link> 。
  200 + </p>
  201 + </up-load>
  202 + <div class="dialog-footer" slot="footer">
  203 + <el-button @click="diaUp = false">取 消</el-button>
  204 + </div>
  205 + </el-dialog>
  206 + </div>
3 207 </template>
4 208  
5 209 <script>
  210 +import { downloadFile } from "@/utils";
6 211 export default {
  212 + data() {
  213 + return {
  214 + loading:false,
  215 + url: "",
  216 + diaUp: false,
  217 + query: {
  218 + gradeName: "",
  219 + teacherName: "",
  220 + phone: "",
  221 + },
  222 + gradeList: [],
  223 + teacherList: [ ],
  224 + teacherDetail: {
  225 + teacherName: "",
  226 + loginName: "",
  227 + sex: "",
  228 + available: "",
  229 + managerList: [],
  230 + teacherCourseList: [],
  231 + teacherGradeList: [],
  232 + },
  233 + showTId: "", //显示详情 教师ID
  234 + };
  235 + },
  236 + async created() {
  237 + await this._QueryDataGrade();
  238 + this._QueryData(1);
  239 + },
  240 + methods: {
  241 + setClass(obj) {
  242 + return (
  243 + obj.managerList?.length +
  244 + obj.teacherCourseList?.length +
  245 + obj.teacherGradeList?.length
  246 + );
  247 + },
  248 + showTeacher(obj) {
  249 + this.showTId = obj.id;
  250 + this.teacherDetail = { ...obj };
  251 + },
  252 + async _QueryData(type) {
  253 + let query = {};
  254 + if (type == 1) {
  255 + query.gradeName = this.query.gradeName;
  256 + this.query.teacherName = "";
  257 + this.query.phone = "";
  258 + } else if (type == 2) {
  259 + query.teacherName = this.query.teacherName;
  260 + this.query.gradeName = "";
  261 + this.query.phone = "";
  262 + } else if (type == 3) {
  263 + query.phone = this.query.phone;
  264 + this.query.teacherName = "";
  265 + this.query.gradeName = "";
  266 + }
  267 + this.loading = true;
  268 + const { data, status, info } = await this.$request.teacherList({
  269 + ...query,
  270 + });
  271 + this.loading = false;
  272 + console.log(status);
  273 + if (status === 0) {
  274 + this.teacherList = data.list || [];
  275 + this.teacherDetail = { ...this.teacherList[0] };
  276 + this.showTId = this.teacherList[0]?.id;
  277 + } else {
  278 + this.$message.error(info);
  279 + }
  280 + },
  281 + async _QueryDataGrade() {
  282 + const { data, status, info } = await this.$request.gradeList();
  283 + if (status === 0) {
  284 + this.gradeList =
  285 + data.list?.map((item) => {
  286 + return {
  287 + value: item.gradeName,
  288 + label: item.gradeName,
  289 + };
  290 + }) || [];
  291 + console.log(this.gradeList);
  292 + this.query.gradeName = this.gradeList[0]?.value;
  293 + } else {
  294 + this.$message.error(info);
  295 + }
  296 + },
  297 + async downExcel() {
  298 + let data = await this.$request.downDevice({
  299 + id: this.id,
  300 + });
  301 + if (data && !data.code) {
  302 + let blob = new Blob([data], {
  303 + type: "application/vnd.ms-excel;charset=utf-8",
  304 + });
  305 + downloadFile(`设备信息.xlsx`, blob);
  306 + } else {
  307 + this.$message.error(data.message);
  308 + }
  309 + },
  310 + },
  311 +};
  312 +</script>
7 313  
  314 +<style lang="scss" scoped>
  315 +.page-content {
  316 + padding: 0 20px 20px;
8 317 }
9   -</script>
  318 +.teacher-box {
  319 + display: flex;
  320 + background: #f8f8f8;
  321 + border-radius: 10px;
  322 + overflow: hidden;
  323 + min-height: 400px;
  324 + .teacher-ul {
  325 + max-height: 70vh;
  326 + overflow-y: scroll;
  327 + }
  328 + .teacher-list {
  329 + width: 240px;
10 330  
11   -<style>
  331 + .h-title {
  332 + height: 40px;
  333 + line-height: 40px;
  334 + background: #eee;
  335 + border-radius: 10px 10px 0 0;
  336 + }
  337 + .teacher-item {
  338 + font-size: 16px;
  339 + color: #7f7f7f;
  340 + line-height: 36px;
  341 + cursor: pointer;
  342 + padding-left: 12px;
  343 + &:hover {
  344 + background: #eee;
  345 + }
  346 + &.active {
  347 + color: #667ffd;
  348 + }
  349 + }
  350 + }
12 351  
  352 + .teacher-detail {
  353 + flex: 1;
  354 + position: relative;
  355 + .icon-box {
  356 + position: absolute;
  357 + top: 12px;
  358 + right: 20px;
  359 + .icon {
  360 + font-size: 24px;
  361 + color: #7f7f7f;
  362 + cursor: pointer;
  363 + }
  364 + .el-icon-circle-plus-outline {
  365 + margin-left: 10px;
  366 + }
  367 + }
  368 + .detail-top {
  369 + padding: 12px 20px;
  370 + box-sizing: border-box;
  371 + display: flex;
  372 + flex-wrap: wrap;
  373 + font-size: 14px;
  374 + color: #7f7f7f;
  375 + .p-item {
  376 + width: 40%;
  377 + line-height: 28px;
  378 + }
  379 + }
  380 + .grade-box {
  381 + .grade-info {
  382 + display: flex;
  383 + flex-wrap: wrap;
  384 + padding: 20px 20px 0;
  385 + & > li {
  386 + margin-right: 20px;
  387 + margin-bottom: 20px;
  388 + position: relative;
  389 + .el-icon-delete {
  390 + position: absolute;
  391 + top: 8px;
  392 + right: 8px;
  393 + padding: 2px;
  394 + cursor: pointer;
  395 + display: none;
  396 + &:hover {
  397 + color: #667ffd;
  398 + }
  399 + }
  400 + &:hover {
  401 + .el-icon-delete {
  402 + display: block;
  403 + }
  404 + }
  405 + }
  406 +
  407 + .grade-item {
  408 + width: 200px;
  409 + box-sizing: border-box;
  410 + padding: 12px 16px;
  411 + border-radius: 10px;
  412 + box-shadow: 1px 1px 3px #888;
  413 + }
  414 + .grade-name {
  415 + font-size: 16px;
  416 + font-weight: bold;
  417 + line-height: 18px;
  418 + padding-bottom: 12px;
  419 + }
  420 + .grade-class {
  421 + display: flex;
  422 + justify-content: space-between;
  423 + font-size: 15px;
  424 + padding-right: 20px;
  425 + .fa {
  426 + font-size: 18px;
  427 + margin-right: 5px;
  428 + color: #a4a4a4;
  429 + }
  430 + .fa-book {
  431 + font-size: 20px;
  432 + }
  433 + }
  434 + }
  435 + }
  436 + }
  437 +}
13 438 </style>
14 439 \ No newline at end of file
... ...