Commit 87053bc89835da860e8a93a14954043e61a4a551
1 parent
2ae837b1
设备状态模版下载更新
Showing
4 changed files
with
24 additions
and
25 deletions
public/index.html
| @@ -8,21 +8,13 @@ | @@ -8,21 +8,13 @@ | ||
| 8 | <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> | 8 | <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> |
| 9 | <meta http-equiv="Pragma" content="no-cache" /> | 9 | <meta http-equiv="Pragma" content="no-cache" /> |
| 10 | <meta http-equiv="Expires" content="0" /> | 10 | <meta http-equiv="Expires" content="0" /> |
| 11 | - <!-- <link rel="icon" href="<%= BASE_URL %>favicon.ico"> --> | 11 | + <link rel="icon" href="<%= BASE_URL %>331icon.ico"> |
| 12 | <title> | 12 | <title> |
| 13 | <%= htmlWebpackPlugin.options.title %> | 13 | <%= htmlWebpackPlugin.options.title %> |
| 14 | </title> | 14 | </title> |
| 15 | </head> | 15 | </head> |
| 16 | 16 | ||
| 17 | <body> | 17 | <body> |
| 18 | - <script> | ||
| 19 | - var link = document.querySelector("link[rel*='icon']") || document.createElement('link'); | ||
| 20 | - link.type = 'image/x-icon'; | ||
| 21 | - link.rel = 'shortcut icon'; | ||
| 22 | - var csCode = localStorage.getItem("csCode") || "" | ||
| 23 | - link.href = csCode ? "./331icon.ico" : "./favicon.ico"; | ||
| 24 | - document.getElementsByTagName('head')[0].appendChild(link); | ||
| 25 | - </script> | ||
| 26 | <noscript> | 18 | <noscript> |
| 27 | <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. | 19 | <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. |
| 28 | Please enable it to continue.</strong> | 20 | Please enable it to continue.</strong> |
src/api/apis/apis.js
| @@ -606,13 +606,21 @@ export default { | @@ -606,13 +606,21 @@ export default { | ||
| 606 | data, | 606 | data, |
| 607 | }); | 607 | }); |
| 608 | }, | 608 | }, |
| 609 | - // 导入基站模板下载地址 | 609 | + // 导入基站模板下载老地址 |
| 610 | stationTemplateUrl() { | 610 | stationTemplateUrl() { |
| 611 | return service({ | 611 | return service({ |
| 612 | url: setUpUrls.stationTemplateUrl, | 612 | url: setUpUrls.stationTemplateUrl, |
| 613 | method: "POST", | 613 | method: "POST", |
| 614 | }); | 614 | }); |
| 615 | }, | 615 | }, |
| 616 | + // 导入基站模板下载新地址 | ||
| 617 | + stationTemplate() { | ||
| 618 | + return service({ | ||
| 619 | + url: setUpUrls.stationTemplate, | ||
| 620 | + method: "POST", | ||
| 621 | + responseType: 'arraybuffer', | ||
| 622 | + }); | ||
| 623 | + }, | ||
| 616 | // 查询下载配置列表 | 624 | // 查询下载配置列表 |
| 617 | appConfigList(data) { | 625 | appConfigList(data) { |
| 618 | return service({ | 626 | return service({ |
src/api/urls/apis.js
| @@ -150,8 +150,10 @@ export default { | @@ -150,8 +150,10 @@ export default { | ||
| 150 | updateDevice: "/api_html/school/manager/updateDevice", | 150 | updateDevice: "/api_html/school/manager/updateDevice", |
| 151 | // 新增基站 | 151 | // 新增基站 |
| 152 | addStation: "/api_html/school/manager/addStation", | 152 | addStation: "/api_html/school/manager/addStation", |
| 153 | - // 导入基站模板下载地址 | 153 | + // 导入基站模板下载老地址 |
| 154 | stationTemplateUrl: "/api_html/school/manager/stationTemplateUrl", | 154 | stationTemplateUrl: "/api_html/school/manager/stationTemplateUrl", |
| 155 | + // 导入基站模板下载新地址 | ||
| 156 | + stationTemplate: "/api_html/school/manager/stationTemplate", | ||
| 155 | // 查询下载配置列表 | 157 | // 查询下载配置列表 |
| 156 | appConfigList: "/api_html/school/manager/appConfigList", | 158 | appConfigList: "/api_html/school/manager/appConfigList", |
| 157 | // 查询最新的授课端应用版本 | 159 | // 查询最新的授课端应用版本 |
src/views/standard/device/index.vue
| @@ -15,11 +15,7 @@ | @@ -15,11 +15,7 @@ | ||
| 15 | @click="diaUp = true" | 15 | @click="diaUp = true" |
| 16 | ></el-button> | 16 | ></el-button> |
| 17 | </el-tooltip> | 17 | </el-tooltip> |
| 18 | - <el-tooltip | ||
| 19 | - effect="dark" | ||
| 20 | - content="添加基站" | ||
| 21 | - placement="bottom" | ||
| 22 | - > | 18 | + <el-tooltip effect="dark" content="添加基站" placement="bottom"> |
| 23 | <el-button | 19 | <el-button |
| 24 | type="primary" | 20 | type="primary" |
| 25 | icon="el-icon-receiving" | 21 | icon="el-icon-receiving" |
| @@ -580,7 +576,9 @@ export default { | @@ -580,7 +576,9 @@ export default { | ||
| 580 | }, | 576 | }, |
| 581 | created() { | 577 | created() { |
| 582 | this.code = localStorage.getItem("csCode") || ""; | 578 | this.code = localStorage.getItem("csCode") || ""; |
| 583 | - this.role = this.$store.getters.info.showRole || this.$store.getters.info.permissions[0].role; | 579 | + this.role = |
| 580 | + this.$store.getters.info.showRole || | ||
| 581 | + this.$store.getters.info.permissions[0].role; | ||
| 584 | if (this.role == "ROLE_JITUAN") { | 582 | if (this.role == "ROLE_JITUAN") { |
| 585 | (this.props.lazy = true), | 583 | (this.props.lazy = true), |
| 586 | (this.props.lazyLoad = function (node, resolve) { | 584 | (this.props.lazyLoad = function (node, resolve) { |
| @@ -799,17 +797,16 @@ export default { | @@ -799,17 +797,16 @@ export default { | ||
| 799 | } | 797 | } |
| 800 | }, | 798 | }, |
| 801 | async downExcel() { | 799 | async downExcel() { |
| 802 | - let { data, status, info } = await this.$request.stationTemplateUrl({ | 800 | + let data = await this.$request.stationTemplate({ |
| 803 | id: this.id, | 801 | id: this.id, |
| 804 | }); | 802 | }); |
| 805 | - if (status == 0) { | ||
| 806 | - const a = document.createElement("a"); | ||
| 807 | - a.href = data.downloadUrl; | ||
| 808 | - document.body.appendChild(a); | ||
| 809 | - a.click(); | ||
| 810 | - a.remove(); | 803 | + if (data) { |
| 804 | + let blob = new Blob([data], { | ||
| 805 | + type: "application/vnd.ms-excel;charset=utf-8", | ||
| 806 | + }); | ||
| 807 | + downloadFile(`基站模版.xlsx`, blob); | ||
| 811 | } else { | 808 | } else { |
| 812 | - this.$message.error(info); | 809 | + this.$message.error("下载失败"); |
| 813 | } | 810 | } |
| 814 | }, | 811 | }, |
| 815 | 812 |