Commit a6eb85ed01a5fd4dc6a3ba4d15e37685b750087a

Authored by 梁保满
1 parent 469bcf34

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

public/index.html
... ... @@ -8,13 +8,22 @@
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 %>331icon.ico">
12 11 <title>
13 12 <%= htmlWebpackPlugin.options.title %>
14 13 </title>
15 14 </head>
16 15  
17 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 27 <noscript>
19 28 <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
20 29 Please enable it to continue.</strong>
... ...
src/utils/index.js
... ... @@ -775,9 +775,9 @@ export function tablePrint(id) {
775 775 .hui-ul{border-top: 1px solid #e2e2e2;}
776 776 .hui-li{display: flex;}
777 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 781 .info { display: flex;flex-wrap: wrap;border-left: 1px solid #e2e2e2;border-top: 1px solid #e2e2e2;margin-bottom: 12px;}
782 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 783 </style>`;
... ...
src/views/personal/test/index.vue
... ... @@ -813,13 +813,13 @@ export default {
813 813 }
814 814 const data = await this.$request.pExportPhaseExamReport({ ...query });
815 815 this.exportLoading = false;
816   - if (data) {
  816 + if (data && !data.code) {
817 817 let blob = new Blob([data], {
818 818 type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
819 819 });
820 820 downloadFile("即时测-阶段测练报表.xlsx", blob);
821 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 77 label="答题器编码"
78 78 prop="clickerSn"
79 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 85 <el-table-column align="center" label="班级">
81 86 <template slot-scope="scope">
82 87 <span v-for="item in scope.row.classList" :key="item.classCode">{{
... ... @@ -144,7 +149,7 @@
144 149 </template>
145 150  
146 151 <script>
147   -import { downloadFile } from "utils";
  152 +import { downloadFile, formatDate } from "utils";
148 153 export default {
149 154 data() {
150 155 return {
... ... @@ -275,13 +280,15 @@ export default {
275 280 this.exportLoading = true;
276 281 const data = await this.$request.exportClickersLog({ ...query });
277 282 this.exportLoading = false;
278   - if (data) {
  283 + if (data && !data.code) {
279 284 let blob = new Blob([data], {
280 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 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 131 :label="item.title"
132 132 :prop="'count' + index"
133 133 align="center"
  134 + width="120"
134 135 ><template slot-scope="scope"
135 136 ><p class="persent">
136 137 {{
... ...
src/views/standard/test/index.vue
... ... @@ -936,13 +936,13 @@ export default {
936 936 this.exportLoading = true;
937 937 const data = await exportPhaseExamReport({ ...query });
938 938 this.exportLoading = false;
939   - if (data) {
  939 + if (data && !data.code) {
940 940 let blob = new Blob([data], {
941 941 type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
942 942 });
943 943 downloadFile("即时测-阶段测练报表.xlsx", blob);
944 944 } else {
945   - this.$message.error("下载失败");
  945 + this.$message.error(data.info);
946 946 }
947 947 },
948 948 async downExcel() {
... ...