Commit 87053bc89835da860e8a93a14954043e61a4a551

Authored by 梁保满
1 parent 2ae837b1

设备状态模版下载更新

public/index.html
... ... @@ -8,21 +8,13 @@
8 8 <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
9 9 <meta http-equiv="Pragma" content="no-cache" />
10 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 12 <title>
13 13 <%= htmlWebpackPlugin.options.title %>
14 14 </title>
15 15 </head>
16 16  
17 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 18 <noscript>
27 19 <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
28 20 Please enable it to continue.</strong>
... ...
src/api/apis/apis.js
... ... @@ -606,13 +606,21 @@ export default {
606 606 data,
607 607 });
608 608 },
609   - // 导入基站模板下载地址
  609 + // 导入基站模板下载地址
610 610 stationTemplateUrl() {
611 611 return service({
612 612 url: setUpUrls.stationTemplateUrl,
613 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 625 appConfigList(data) {
618 626 return service({
... ...
src/api/urls/apis.js
... ... @@ -150,8 +150,10 @@ export default {
150 150 updateDevice: "/api_html/school/manager/updateDevice",
151 151 // 新增基站
152 152 addStation: "/api_html/school/manager/addStation",
153   - // 导入基站模板下载地址
  153 + // 导入基站模板下载地址
154 154 stationTemplateUrl: "/api_html/school/manager/stationTemplateUrl",
  155 + // 导入基站模板下载新地址
  156 + stationTemplate: "/api_html/school/manager/stationTemplate",
155 157 // 查询下载配置列表
156 158 appConfigList: "/api_html/school/manager/appConfigList",
157 159 // 查询最新的授课端应用版本
... ...
src/views/standard/device/index.vue
... ... @@ -15,11 +15,7 @@
15 15 @click="diaUp = true"
16 16 ></el-button>
17 17 </el-tooltip>
18   - <el-tooltip
19   - effect="dark"
20   - content="添加基站"
21   - placement="bottom"
22   - >
  18 + <el-tooltip effect="dark" content="添加基站" placement="bottom">
23 19 <el-button
24 20 type="primary"
25 21 icon="el-icon-receiving"
... ... @@ -580,7 +576,9 @@ export default {
580 576 },
581 577 created() {
582 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 582 if (this.role == "ROLE_JITUAN") {
585 583 (this.props.lazy = true),
586 584 (this.props.lazyLoad = function (node, resolve) {
... ... @@ -799,17 +797,16 @@ export default {
799 797 }
800 798 },
801 799 async downExcel() {
802   - let { data, status, info } = await this.$request.stationTemplateUrl({
  800 + let data = await this.$request.stationTemplate({
803 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 808 } else {
812   - this.$message.error(info);
  809 + this.$message.error("下载失败");
813 810 }
814 811 },
815 812  
... ...