Commit a6eb85ed01a5fd4dc6a3ba4d15e37685b750087a

Authored by 梁保满
1 parent 469bcf34

下载模版错误信息展示,图标根据环境切换

public/index.html
@@ -8,13 +8,22 @@ @@ -8,13 +8,22 @@
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 %>331icon.ico">  
12 <title> 11 <title>
13 <%= htmlWebpackPlugin.options.title %> 12 <%= htmlWebpackPlugin.options.title %>
14 </title> 13 </title>
15 </head> 14 </head>
16 15
17 <body> 16 <body>
  17 + <script>
  18 + window.onload = function () {
  19 + var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
  20 + link.type = 'image/x-icon';
  21 + link.rel = 'shortcut icon';
  22 + var isZS = window.location.host.includes('ezquiz.sunvotecloud')
  23 + link.href = !isZS ? "./favicon.ico" : "./331icon.ico";
  24 + document.getElementsByTagName('head')[0].appendChild(link);
  25 + }
  26 + </script>
18 <noscript> 27 <noscript>
19 <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. 28 <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
20 Please enable it to continue.</strong> 29 Please enable it to continue.</strong>
src/utils/index.js
@@ -775,9 +775,9 @@ export function tablePrint(id) { @@ -775,9 +775,9 @@ export function tablePrint(id) {
775 .hui-ul{border-top: 1px solid #e2e2e2;} 775 .hui-ul{border-top: 1px solid #e2e2e2;}
776 .hui-li{display: flex;} 776 .hui-li{display: flex;}
777 .hui-s{height: 48px;line-height: 48px;border-right: 1px solid #e2e2e2;border-bottom: 1px solid #e2e2e2;box-sizing: border-box;} 777 .hui-s{height: 48px;line-height: 48px;border-right: 1px solid #e2e2e2;border-bottom: 1px solid #e2e2e2;box-sizing: border-box;}
778 - .hui-s.s1{width: 87.5px;}  
779 - .hui-s.s2{ width: 97.5px;}  
780 - .hui-s.s3{width: 108px;} 778 + .hui-s.s1{width: 100px;}
  779 + .hui-s.s2{ width: 110px;}
  780 + .hui-s.s3{width: 120px;}
781 .info { display: flex;flex-wrap: wrap;border-left: 1px solid #e2e2e2;border-top: 1px solid #e2e2e2;margin-bottom: 12px;} 781 .info { display: flex;flex-wrap: wrap;border-left: 1px solid #e2e2e2;border-top: 1px solid #e2e2e2;margin-bottom: 12px;}
782 .info-item {width: 25%;height: 50px;box-sizing: border-box;flex-shrink: 0;background: #f8f8f8;border-right: 1px solid #e2e2e2;border-bottom: 1px solid #e2e2e2;line-height: 50px;text-align: center;} 782 .info-item {width: 25%;height: 50px;box-sizing: border-box;flex-shrink: 0;background: #f8f8f8;border-right: 1px solid #e2e2e2;border-bottom: 1px solid #e2e2e2;line-height: 50px;text-align: center;}
783 </style>`; 783 </style>`;
src/views/personal/test/index.vue
@@ -813,13 +813,13 @@ export default { @@ -813,13 +813,13 @@ export default {
813 } 813 }
814 const data = await this.$request.pExportPhaseExamReport({ ...query }); 814 const data = await this.$request.pExportPhaseExamReport({ ...query });
815 this.exportLoading = false; 815 this.exportLoading = false;
816 - if (data) { 816 + if (data && !data.code) {
817 let blob = new Blob([data], { 817 let blob = new Blob([data], {
818 type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", 818 type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
819 }); 819 });
820 downloadFile("即时测-阶段测练报表.xlsx", blob); 820 downloadFile("即时测-阶段测练报表.xlsx", blob);
821 } else { 821 } else {
822 - this.$message.error("下载失败"); 822 + this.$message.error(data.info);
823 } 823 }
824 }, 824 },
825 }, 825 },
src/views/standard/card/index.vue
@@ -77,6 +77,11 @@ @@ -77,6 +77,11 @@
77 label="答题器编码" 77 label="答题器编码"
78 prop="clickerSn" 78 prop="clickerSn"
79 ></el-table-column> 79 ></el-table-column>
  80 + <el-table-column align="center" label="年级">
  81 + <template slot-scope="scope">
  82 + <span>{{ scope.row.classList[0].gradeName }}</span>
  83 + </template>
  84 + </el-table-column>
80 <el-table-column align="center" label="班级"> 85 <el-table-column align="center" label="班级">
81 <template slot-scope="scope"> 86 <template slot-scope="scope">
82 <span v-for="item in scope.row.classList" :key="item.classCode">{{ 87 <span v-for="item in scope.row.classList" :key="item.classCode">{{
@@ -144,7 +149,7 @@ @@ -144,7 +149,7 @@
144 </template> 149 </template>
145 150
146 <script> 151 <script>
147 -import { downloadFile } from "utils"; 152 +import { downloadFile, formatDate } from "utils";
148 export default { 153 export default {
149 data() { 154 data() {
150 return { 155 return {
@@ -275,13 +280,15 @@ export default { @@ -275,13 +280,15 @@ export default {
275 this.exportLoading = true; 280 this.exportLoading = true;
276 const data = await this.$request.exportClickersLog({ ...query }); 281 const data = await this.$request.exportClickersLog({ ...query });
277 this.exportLoading = false; 282 this.exportLoading = false;
278 - if (data) { 283 + if (data && !data.code) {
279 let blob = new Blob([data], { 284 let blob = new Blob([data], {
280 type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", 285 type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
281 }); 286 });
282 - downloadFile("发卡记录.xlsx", blob); 287 + let date = formatDate(new Date().getTime(), "yyyy-MM-dd");
  288 + let name = `发卡记录_${date}.xlsx`;
  289 + downloadFile(name, blob);
283 } else { 290 } else {
284 - this.$message.error("下载失败"); 291 + this.$message.error(data.info);
285 } 292 }
286 }, 293 },
287 }, 294 },
src/views/standard/test/analysis.vue
@@ -131,6 +131,7 @@ @@ -131,6 +131,7 @@
131 :label="item.title" 131 :label="item.title"
132 :prop="'count' + index" 132 :prop="'count' + index"
133 align="center" 133 align="center"
  134 + width="120"
134 ><template slot-scope="scope" 135 ><template slot-scope="scope"
135 ><p class="persent"> 136 ><p class="persent">
136 {{ 137 {{
src/views/standard/test/index.vue
@@ -936,13 +936,13 @@ export default { @@ -936,13 +936,13 @@ export default {
936 this.exportLoading = true; 936 this.exportLoading = true;
937 const data = await exportPhaseExamReport({ ...query }); 937 const data = await exportPhaseExamReport({ ...query });
938 this.exportLoading = false; 938 this.exportLoading = false;
939 - if (data) { 939 + if (data && !data.code) {
940 let blob = new Blob([data], { 940 let blob = new Blob([data], {
941 type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", 941 type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
942 }); 942 });
943 downloadFile("即时测-阶段测练报表.xlsx", blob); 943 downloadFile("即时测-阶段测练报表.xlsx", blob);
944 } else { 944 } else {
945 - this.$message.error("下载失败"); 945 + this.$message.error(data.info);
946 } 946 }
947 }, 947 },
948 async downExcel() { 948 async downExcel() {