Commit e3b0e3e7e62cdc0e439b8fb84b6dc895b6adcc82
1 parent
2d6a1682
季度时间格式调整
Showing
10 changed files
with
124 additions
and
70 deletions
src/api/apis/apis.js
| ... | ... | @@ -521,6 +521,14 @@ export default { | 
| 521 | 521 | data, | 
| 522 | 522 | }); | 
| 523 | 523 | }, | 
| 524 | + // 新增基站 | |
| 525 | + addStation(data) { | |
| 526 | + return service({ | |
| 527 | + url: setUpUrls.addStation, | |
| 528 | + method: "POST", | |
| 529 | + data, | |
| 530 | + }); | |
| 531 | + }, | |
| 524 | 532 | // 查询下载配置列表 | 
| 525 | 533 | appConfigList(data) { | 
| 526 | 534 | return service({ | ... | ... | 
src/api/urls/apis.js
| ... | ... | @@ -132,6 +132,8 @@ export default { | 
| 132 | 132 | modifyUpgradeFlag: "/api_html/school/manager/modifyUpgradeFlag", | 
| 133 | 133 | // 修改基站信息 | 
| 134 | 134 | updateDevice: "/api_html/school/manager/updateDevice", | 
| 135 | + // 新增基站 | |
| 136 | + addStation: "/api_html/school/manager/addStation", | |
| 135 | 137 | // 查询下载配置列表 | 
| 136 | 138 | appConfigList: "/api_html/school/manager/appConfigList", | 
| 137 | 139 | // 查询最新的授课端应用版本 | ... | ... | 
src/i18n/lang/cn.js
src/router/index.js
| ... | ... | @@ -89,14 +89,14 @@ let addrouters = [ //测试用,后续后端获取 | 
| 89 | 89 | { | 
| 90 | 90 | path: "/examinationPaper", | 
| 91 | 91 | iconCls: "fa fa-file-text", // 图标样式class | 
| 92 | - name: "", | |
| 92 | + name: "examinationPaper", | |
| 93 | 93 | component: ExaminationPaper, | 
| 94 | 94 | children: [] | 
| 95 | 95 | }, | 
| 96 | 96 | { | 
| 97 | 97 | path: "/examinationPaperAdd", | 
| 98 | 98 | iconCls: "", // 图标样式class | 
| 99 | - name: "添加答题卡", | |
| 99 | + name: "examinationPaperAdd", | |
| 100 | 100 | component: ExaminationPaperAdd, | 
| 101 | 101 | parent: "examinationPaper", | 
| 102 | 102 | children: [] | 
| ... | ... | @@ -129,7 +129,8 @@ let addrouters = [ //测试用,后续后端获取 | 
| 129 | 129 | { | 
| 130 | 130 | path: "/ask", | 
| 131 | 131 | iconCls: "fa fa-bar-chart", // 图标样式class | 
| 132 | - name: "", | |
| 132 | + name: "ask", | |
| 133 | + name: "随堂问报表", | |
| 133 | 134 | component: Ask, | 
| 134 | 135 | meta: { | 
| 135 | 136 | keepAlive: true, | ... | ... | 
src/views/analysis/index.vue
| ... | ... | @@ -251,11 +251,11 @@ export default { | 
| 251 | 251 | break; | 
| 252 | 252 | case 4: | 
| 253 | 253 | if (aMonth > 0 && aMonth < 4) { | 
| 254 | - aMonth = "01"; | |
| 254 | + aMonth = "1"; | |
| 255 | 255 | } else if (aMonth > 3 && aMonth < 7) { | 
| 256 | - aMonth = "04"; | |
| 256 | + aMonth = "4"; | |
| 257 | 257 | } else if (aMonth > 6 && aMonth < 10) { | 
| 258 | - aMonth = "07"; | |
| 258 | + aMonth = "7"; | |
| 259 | 259 | } else { | 
| 260 | 260 | aMonth = "10"; | 
| 261 | 261 | } | ... | ... | 
src/views/ask/index.vue
| ... | ... | @@ -566,11 +566,11 @@ export default { | 
| 566 | 566 | break; | 
| 567 | 567 | case 4: | 
| 568 | 568 | if (aMonth > 0 && aMonth < 4) { | 
| 569 | - aMonth = "01"; | |
| 569 | + aMonth = "1"; | |
| 570 | 570 | } else if (aMonth > 3 && aMonth < 7) { | 
| 571 | - aMonth = "04"; | |
| 571 | + aMonth = "4"; | |
| 572 | 572 | } else if (aMonth > 6 && aMonth < 10) { | 
| 573 | - aMonth = "07"; | |
| 573 | + aMonth = "7"; | |
| 574 | 574 | } else { | 
| 575 | 575 | aMonth = "10"; | 
| 576 | 576 | } | ... | ... | 
src/views/device/index.vue
| 1 | 1 | <template> | 
| 2 | - <div ref="main" class="page-content"> | |
| 2 | + <div ref="main" class="page-content"> | |
| 3 | 3 | <back-box> | 
| 4 | 4 | <template slot="title"> | 
| 5 | 5 | <span>设备管理</span> | 
| 6 | 6 | </template> | 
| 7 | - <template | |
| 8 | - slot="btns" | |
| 9 | - v-if="role != 'ROLE_JITUAN' && type == 1 && !code" | |
| 10 | - > | |
| 11 | - <!-- 暂未有接口 --> | |
| 7 | + <template slot="btns" v-if="role != 'ROLE_JITUAN' && type == 1 && !code"> | |
| 12 | 8 | <!-- <el-tooltip effect="dark" content="设备导入" placement="bottom"> | 
| 13 | 9 | <el-button | 
| 14 | 10 | type="primary" | 
| ... | ... | @@ -19,16 +15,21 @@ | 
| 19 | 15 | @click="diaUp = true" | 
| 20 | 16 | ></el-button> | 
| 21 | 17 | </el-tooltip> --> | 
| 22 | - <!-- <el-tooltip effect="dark" content="添加基站" placement="bottom"> | |
| 18 | + <el-tooltip | |
| 19 | + v-if="role == 'ROLE_XUEXIAO'" | |
| 20 | + effect="dark" | |
| 21 | + content="添加基站" | |
| 22 | + placement="bottom" | |
| 23 | + > | |
| 23 | 24 | <el-button | 
| 24 | 25 | type="primary" | 
| 25 | 26 | icon="el-icon-receiving" | 
| 26 | 27 | size="mini" | 
| 27 | 28 | plain | 
| 28 | 29 | circle | 
| 29 | - @click="diaAnswerEqu = true" | |
| 30 | + @click="addDev" | |
| 30 | 31 | ></el-button> | 
| 31 | - </el-tooltip> --> | |
| 32 | + </el-tooltip> | |
| 32 | 33 | </template> | 
| 33 | 34 | </back-box> | 
| 34 | 35 | <div> | 
| ... | ... | @@ -121,7 +122,7 @@ | 
| 121 | 122 | ></el-table-column> | 
| 122 | 123 | <el-table-column label="关联班级" align="center"> | 
| 123 | 124 | <template slot-scope="scoped"> | 
| 124 | - <p v-for="(item,index) in scoped.row.classList" :key="index"> | |
| 125 | + <p v-for="(item, index) in scoped.row.classList" :key="index"> | |
| 125 | 126 | {{ item.className }} | 
| 126 | 127 | </p> | 
| 127 | 128 | </template> | 
| ... | ... | @@ -389,7 +390,12 @@ | 
| 389 | 390 | </div> | 
| 390 | 391 | </div> | 
| 391 | 392 | <el-dialog title="设备导入" :visible.sync="diaUp" width="400"> | 
| 392 | - <up-load id="downDevice" :url="url" @upSuccess="upSuccess" fileName="设备信息"> | |
| 393 | + <up-load | |
| 394 | + id="downDevice" | |
| 395 | + :url="url" | |
| 396 | + @upSuccess="upSuccess" | |
| 397 | + fileName="设备信息" | |
| 398 | + > | |
| 393 | 399 | <p class="down-txt" slot="down"> | 
| 394 | 400 | 通过Excel名单导入设备,需要提供设备编码,点击 | 
| 395 | 401 | <el-link type="danger" @click="downExcel">模板下载</el-link> 。 | 
| ... | ... | @@ -399,7 +405,7 @@ | 
| 399 | 405 | <el-button @click="diaUp = false">取 消</el-button> | 
| 400 | 406 | </div> | 
| 401 | 407 | </el-dialog> | 
| 402 | - <el-dialog title="修改基站" :visible.sync="diaAnswerEqu" width="400"> | |
| 408 | + <el-dialog :title="isAdd?'添加基站':'修改基站'" :visible.sync="diaAnswerEqu" width="400"> | |
| 403 | 409 | <el-form ref="forms" :model="form" :rules="formRules" label-width="140px"> | 
| 404 | 410 | <el-form-item label="设备编码:" prop="sn"> | 
| 405 | 411 | <el-col :span="16" | 
| ... | ... | @@ -410,6 +416,7 @@ | 
| 410 | 416 | maxlength="30" | 
| 411 | 417 | size="45" | 
| 412 | 418 | show-word-limit | 
| 419 | + :disabled="!isAdd" | |
| 413 | 420 | > | 
| 414 | 421 | </el-input | 
| 415 | 422 | ></el-col> | 
| ... | ... | @@ -447,7 +454,7 @@ | 
| 447 | 454 | clearable | 
| 448 | 455 | v-model="form.classIds" | 
| 449 | 456 | :options="gradeList" | 
| 450 | - :props="{ expandTrigger: 'hover'}" | |
| 457 | + :props="{ expandTrigger: 'hover' }" | |
| 451 | 458 | :show-all-levels="false" | 
| 452 | 459 | ></el-cascader> | 
| 453 | 460 | </el-col> | 
| ... | ... | @@ -501,6 +508,7 @@ export default { | 
| 501 | 508 | }, | 
| 502 | 509 | data() { | 
| 503 | 510 | return { | 
| 511 | + isAdd:false,//添加还是修改基站 | |
| 504 | 512 | role: "", | 
| 505 | 513 | code: "", | 
| 506 | 514 | loading: false, | 
| ... | ... | @@ -510,6 +518,7 @@ export default { | 
| 510 | 518 | gradeList: [], | 
| 511 | 519 | gradeListAll: [], | 
| 512 | 520 | schoolAll: [], | 
| 521 | + school: {}, //校园账号所属学校信息 | |
| 513 | 522 | props: { | 
| 514 | 523 | multiple: true, | 
| 515 | 524 | checkStrictly: true, | 
| ... | ... | @@ -545,9 +554,7 @@ export default { | 
| 545 | 554 | roomName: "", | 
| 546 | 555 | }, | 
| 547 | 556 | formRules: { | 
| 548 | - sn: [ | |
| 549 | - { required: true, message: "请输入设备编码", trigger: "blur" }, | |
| 550 | - ], | |
| 557 | + sn: [{ required: true, message: "请输入设备编码", trigger: "blur" }], | |
| 551 | 558 | frequency: [{ required: true, message: "请输入频点", trigger: "blur" }], | 
| 552 | 559 | pairingCode: [ | 
| 553 | 560 | { required: true, message: "请输入配对码", trigger: "blur" }, | 
| ... | ... | @@ -565,7 +572,7 @@ export default { | 
| 565 | 572 | }; | 
| 566 | 573 | }, | 
| 567 | 574 | created() { | 
| 568 | - this.code = localStorage.getItem("csCode")||"" | |
| 575 | + this.code = localStorage.getItem("csCode") || ""; | |
| 569 | 576 | let role = ""; | 
| 570 | 577 | this.$store.getters.info.permissions.map((item) => { | 
| 571 | 578 | if (item.roleName == this.$store.getters.info.showRoleName) { | 
| ... | ... | @@ -574,31 +581,34 @@ export default { | 
| 574 | 581 | }); | 
| 575 | 582 | this.role = role ? role : this.$store.getters.info.permissions[0].role; | 
| 576 | 583 | if (this.role == "ROLE_JITUAN") { | 
| 577 | - this.props.lazy = true, | |
| 578 | - this.props.lazyLoad = function (node, resolve) { | |
| 579 | - const { level } = node; | |
| 580 | - if (level == 2) { | |
| 581 | - console.log(node); | |
| 582 | - api | |
| 583 | - .tenantClassList({ | |
| 584 | - schoolId: node.data.value, | |
| 585 | - }) | |
| 586 | - .then((res) => { | |
| 587 | - let children = formatGradeNameClass(res.data?.list).sort( | |
| 588 | - (a, b) => { | |
| 589 | - return a.grade - b.grade; | |
| 590 | - } | |
| 591 | - ); | |
| 592 | - console.log(); | |
| 584 | + (this.props.lazy = true), | |
| 585 | + (this.props.lazyLoad = function (node, resolve) { | |
| 586 | + const { level } = node; | |
| 587 | + if (level == 2) { | |
| 588 | + console.log(node); | |
| 589 | + api | |
| 590 | + .tenantClassList({ | |
| 591 | + schoolId: node.data.value, | |
| 592 | + }) | |
| 593 | + .then((res) => { | |
| 594 | + let children = formatGradeNameClass(res.data?.list).sort( | |
| 595 | + (a, b) => { | |
| 596 | + return a.grade - b.grade; | |
| 597 | + } | |
| 598 | + ); | |
| 599 | + console.log(); | |
| 593 | 600 | |
| 594 | - const nodes = [...children]; | |
| 595 | - // 通过调用resolve将子节点数据返回,通知组件数据加载完成 | |
| 596 | - resolve(nodes); | |
| 597 | - }); | |
| 598 | - } else { | |
| 599 | - resolve(node); | |
| 600 | - } | |
| 601 | - }; | |
| 601 | + const nodes = [...children]; | |
| 602 | + // 通过调用resolve将子节点数据返回,通知组件数据加载完成 | |
| 603 | + resolve(nodes); | |
| 604 | + }); | |
| 605 | + } else { | |
| 606 | + resolve(node); | |
| 607 | + } | |
| 608 | + }); | |
| 609 | + } | |
| 610 | + if (this.role == "ROLE_XUEXIAO") { | |
| 611 | + this._QueryDataSchool(); | |
| 602 | 612 | } | 
| 603 | 613 | this.stationReport(); | 
| 604 | 614 | this._QueryGradeList(); | 
| ... | ... | @@ -608,19 +618,22 @@ export default { | 
| 608 | 618 | } | 
| 609 | 619 | }, | 
| 610 | 620 | methods: { | 
| 611 | - upSuccess(){//导入成功 | |
| 612 | - this.diaUp = false | |
| 621 | + upSuccess() { | |
| 622 | + //导入成功 | |
| 623 | + this.diaUp = false; | |
| 613 | 624 | this._QueryData(); | 
| 614 | 625 | }, | 
| 615 | 626 | edit(obj) { | 
| 627 | + this.isAdd=false | |
| 616 | 628 | for (let key in this.form) { | 
| 617 | 629 | if (key == "classIds") { | 
| 618 | - this.form[key] = obj.classList[0]?.classId | |
| 630 | + this.form[key] = obj.classList[0]?.classId; | |
| 619 | 631 | } else { | 
| 620 | 632 | this.form[key] = obj[key]; | 
| 621 | 633 | } | 
| 622 | 634 | } | 
| 623 | - this.form.deviceId = obj.id | |
| 635 | + delete this.form.schoolId | |
| 636 | + this.form.deviceId = obj.id; | |
| 624 | 637 | this.diaAnswerEqu = true; | 
| 625 | 638 | }, | 
| 626 | 639 | linkTo(obj, type) { | 
| ... | ... | @@ -674,6 +687,17 @@ export default { | 
| 674 | 687 | this.page = page; | 
| 675 | 688 | this._QueryData(false); | 
| 676 | 689 | }, | 
| 690 | + addDev() { | |
| 691 | + this.form.sn = ""; | |
| 692 | + this.form.frequency = ""; | |
| 693 | + this.form.pairingCode = ""; | |
| 694 | + this.form.classIds = ""; | |
| 695 | + this.form.roomName = ""; | |
| 696 | + this.form.schoolId= this.school.id | |
| 697 | + delete this.form.deviceId | |
| 698 | + this.isAdd = true | |
| 699 | + this.diaAnswerEqu = true; | |
| 700 | + }, | |
| 677 | 701 | async showSchool() { | 
| 678 | 702 | const { data, status, info } = await this.$request.schoolList(); | 
| 679 | 703 | if (status === 0) { | 
| ... | ... | @@ -759,8 +783,14 @@ export default { | 
| 759 | 783 | // query.classIds = query.classIds.map((item) => { | 
| 760 | 784 | // return item[1]; | 
| 761 | 785 | // }); | 
| 762 | - query.classIds = [query.classIds] | |
| 763 | - const { data, status, info } = await this.$request.updateDevice({ | |
| 786 | + if(typeof query.classIds == 'string' || typeof query.classIds == 'number'){ | |
| 787 | + query.classIds = [query.classIds]; | |
| 788 | + }else{ | |
| 789 | + query.classIds = [query.classIds[1]]; | |
| 790 | + } | |
| 791 | + | |
| 792 | + let deviceApi = this.isAdd?this.$request.addStation:this.$request.updateDevice | |
| 793 | + const { data, status, info } = await deviceApi({ | |
| 764 | 794 | ...query, | 
| 765 | 795 | }); | 
| 766 | 796 | this.loadingAnswerEqu = false; | 
| ... | ... | @@ -769,6 +799,9 @@ export default { | 
| 769 | 799 | this.diaAnswerEqu = false; | 
| 770 | 800 | this.$message.success(info); | 
| 771 | 801 | this._QueryData(); | 
| 802 | + if(this.isAdd){ | |
| 803 | + this.stationReport() | |
| 804 | + } | |
| 772 | 805 | } else { | 
| 773 | 806 | this.$message.error(info); | 
| 774 | 807 | } | 
| ... | ... | @@ -777,6 +810,14 @@ export default { | 
| 777 | 810 | } | 
| 778 | 811 | }); | 
| 779 | 812 | }, | 
| 813 | + async _QueryDataSchool() { | |
| 814 | + const { data, status, info } = await this.$request.schoolDetail(); | |
| 815 | + if (status === 0) { | |
| 816 | + this.school = { ...data }; | |
| 817 | + } else { | |
| 818 | + this.$message.error(info); | |
| 819 | + } | |
| 820 | + }, | |
| 780 | 821 | // 查找班级 | 
| 781 | 822 | async _QueryGradeList() { | 
| 782 | 823 | this.loading = true; | 
| ... | ... | @@ -990,9 +1031,9 @@ export default { | 
| 990 | 1031 | })) || | 
| 991 | 1032 | []; | 
| 992 | 1033 | this.total = data.count; | 
| 993 | - this.$nextTick(function(){ | |
| 994 | - this.$refs.main.scrollTop = 0 | |
| 995 | - }) | |
| 1034 | + this.$nextTick(function () { | |
| 1035 | + this.$refs.main.scrollTop = 0; | |
| 1036 | + }); | |
| 996 | 1037 | } else { | 
| 997 | 1038 | this.$message.error(info); | 
| 998 | 1039 | } | 
| ... | ... | @@ -1008,7 +1049,7 @@ export default { | 
| 1008 | 1049 | overflow-y: auto; | 
| 1009 | 1050 | } | 
| 1010 | 1051 | .tab-box { | 
| 1011 | - padding:20px 0 12px | |
| 1052 | + padding: 20px 0 12px; | |
| 1012 | 1053 | } | 
| 1013 | 1054 | .sel { | 
| 1014 | 1055 | width: 100%; | ... | ... | 
src/views/device/log.vue
| ... | ... | @@ -206,11 +206,11 @@ export default { | 
| 206 | 206 | break; | 
| 207 | 207 | case 4: | 
| 208 | 208 | if (aMonth > 0 && aMonth < 4) { | 
| 209 | - aMonth = "01"; | |
| 209 | + aMonth = "1"; | |
| 210 | 210 | } else if (aMonth > 3 && aMonth < 7) { | 
| 211 | - aMonth = "04"; | |
| 211 | + aMonth = "4"; | |
| 212 | 212 | } else if (aMonth > 6 && aMonth < 10) { | 
| 213 | - aMonth = "07"; | |
| 213 | + aMonth = "7"; | |
| 214 | 214 | } else { | 
| 215 | 215 | aMonth = "10"; | 
| 216 | 216 | } | ... | ... | 
src/views/login/index.vue
| ... | ... | @@ -95,14 +95,14 @@ export default { | 
| 95 | 95 | loginForm: { | 
| 96 | 96 | // username: "15911715665", | 
| 97 | 97 | // password: "715665", | 
| 98 | - // username: "18314340313", | |
| 99 | - // password: "Pw340313#", | |
| 98 | + username: "18314340313", | |
| 99 | + password: "Pw340313#", | |
| 100 | 100 | // username: "18687826606", | 
| 101 | 101 | // password: "Pw826606#", | 
| 102 | 102 | // username: "18893712576", | 
| 103 | 103 | // password: "712576", | 
| 104 | - username: "13247726488", | |
| 105 | - password: "726488", | |
| 104 | + // username: "13247726488", | |
| 105 | + // password: "726488", | |
| 106 | 106 | }, | 
| 107 | 107 | loginRules: { | 
| 108 | 108 | username: [ | ... | ... | 
src/views/test/index.vue
| ... | ... | @@ -583,11 +583,11 @@ export default { | 
| 583 | 583 | break; | 
| 584 | 584 | case 4: | 
| 585 | 585 | if (aMonth > 0 && aMonth < 4) { | 
| 586 | - aMonth = "01"; | |
| 586 | + aMonth = "1"; | |
| 587 | 587 | } else if (aMonth > 3 && aMonth < 7) { | 
| 588 | - aMonth = "04"; | |
| 588 | + aMonth = "4"; | |
| 589 | 589 | } else if (aMonth > 6 && aMonth < 10) { | 
| 590 | - aMonth = "07"; | |
| 590 | + aMonth = "7"; | |
| 591 | 591 | } else { | 
| 592 | 592 | aMonth = "10"; | 
| 593 | 593 | } | ... | ... |