Forráskód Böngészése

Merge branch 'master' of http://121.4.203.192:9000/mingxue/front

shilipojs 2 éve
szülő
commit
e2c443a96b

+ 1 - 0
package.json

@@ -80,6 +80,7 @@
     "babel-eslint": "10.1.0",
     "babel-plugin-macros": "^3.1.0",
     "chalk": "4.1.0",
+    "compression-webpack-plugin": "5.0.2",
     "connect": "3.6.6",
     "eslint": "7.15.0",
     "eslint-plugin-vue": "7.2.0",

+ 24 - 7
src/views/elective/dispatch/master/info/student.vue

@@ -159,22 +159,39 @@ export default {
             size: A4 landscape;
         }
       }
+      .el-table__empty-block {
+        width: calc(11.7in - 1.27cm) !important;
+      }
+      th:nth-last-child(2) {
+        display: none !important;
+      }
+      td:last-child {
+        display: none;
+      }
+      .title {
+        line-height: 44px;
+        text-align: center;
+        font-size: 16px;
+        background-color: #ffffff;
+      }
       </style>`
       const iframe = document.createElement('iframe');
-      iframe.setAttribute('style', `position: absolute;top: 0;left: 0;width: 11.7in;height: 300px;z-index: -1;opacity: 0;border: none;background-color: #efefef;`)
+      iframe.setAttribute('style', `position: absolute;top: 0;left: 0;width: calc(11.7in - 1.27cm);height: 300px;z-index: -1;opacity: 0;border: none;background-color: #efefef;`)
       document.body.appendChild(iframe);
       const doc = iframe.contentDocument;
-      doc.write(style + content);
-      if (title) {
-        doc.title = title;
-      }
+      const titleDom = `<div class="title">${title}</div>`;
+      doc.write(style + titleDom + content);
+      // if (title) {
+      //   doc.title = title;
+      // }
       // 以下设置只对el-table有效,如果打印的不是el-table请注释
       const thead = doc.querySelector('.el-table__header-wrapper thead');
       thead.classList.add('el-table__header-wrapper');
-      thead.style.width='100%';
+      thead.style.width='calc(11.7in - 1.27cm)';
       const tbody = doc.querySelector('.el-table__body-wrapper table');
+      tbody.removeChild(tbody.firstElementChild);
       tbody.appendChild(thead);
-      tbody.style.width='100%';
+      tbody.style.width='calc(11.7in - 1.27cm)';
       // 打印并移除iframe
       iframe.contentWindow.print();
       document.body.removeChild(iframe);

+ 2 - 1
src/views/elective/generation/components/elective-generation-commands.vue

@@ -125,7 +125,8 @@ export default {
         this.notifyRootRefresh(true)
       })
     },
-    jumpForceAdjust() {
+    async jumpForceAdjust() {
+      await this.$confirm('确认进入调剂阶段?')
       jumpGenerationForceAdjust().finally(() => {
         this.notifyRootRefresh(true)
       })

+ 3 - 1
src/views/elective/select/components/elective-preference-command.vue

@@ -45,7 +45,9 @@ export default {
         this.group.selected = true
         this.selectedList.push(this.group)
       } else {
-        await this.$confirm(`确认填报 ${this.group.groupName}`)
+        let confirmTip = `确认填报 ${this.group.groupName}`
+        if (!group.isRecommend) confirmTip += '(非推荐)'
+        await this.$confirm(confirmTip)
         this.group.selected = true
         this.selectedList.push(this.group)
         try {

+ 16 - 6
src/views/system/user/profile/round-select.vue

@@ -4,10 +4,15 @@
       <template #header>选科信息</template>
       <el-row :gutter="20">
         <el-col :span="12">
-          <el-form ref="form" v-if="selectObj" label-position="right" label-width="80px">
+          <el-form ref="form" v-if="selectObj" label-position="right" label-width="110px">
             <el-form-item label="选科轮次" class="form-item-readonly">{{ selectObj.year }}{{ selectObj.name }}
             </el-form-item>
-            <el-form-item label="选科时间" class="form-item-readonly">{{ selectObj.beginTime }} 至 {{ selectObj.endTime }}
+            <el-form-item v-if="!generationSettings.length" label="选科时间" class="form-item-readonly">
+              {{ selectObj.beginTime }} 至 {{ selectObj.endTime }}
+            </el-form-item>
+            <el-form-item v-else v-for="s in generationSettings" :key="s.option.key" :label="s.option.title"
+                          class="form-item-readonly">
+              {{ s.begin }} 至 {{ s.end }}
             </el-form-item>
           </el-form>
         </el-col>
@@ -51,7 +56,6 @@
 </template>
 
 <script>
-import { saveStudentSelected } from '@/api/webApi/selection'
 import TestEntry from '@/views/elective/test/components/test-entry'
 import TestResult from '@/views/elective/test/components/test-result'
 import SelectSubject from '@/views/system/user/profile/components/select-subject'
@@ -61,10 +65,10 @@ import TransferMixin from '@/components/mx-transfer-mixin'
 import ElectiveToolsMixin from '../../../elective/select/components/elective-tools-mixins'
 import config from '@/common/mx-config'
 import {
-  getStudentElectiveModels,
   getOptionalMajors,
-  getStudentSelected,
-  getRecommendMajor
+  getRecommendMajor,
+  getStudentElectiveModels,
+  getStudentSelected
 } from '@/api/webApi/elective/selected-subject'
 
 export default {
@@ -133,6 +137,12 @@ export default {
         })
       }) || []
     },
+    generationSettings() {
+      if (!this.generationModels?.length) return []
+      return this.generationModels
+        .filter(m => !m.option.decisionMaking && m.setting)
+        .map(m => ({ ...m.setting, option: m.option }))
+    },
     generation() {
       if (!this.selectObj) return {}
       return {

+ 11 - 1
vue.config.js

@@ -6,6 +6,8 @@ function resolve(dir) {
   return path.join(__dirname, dir)
 }
 
+const CompressionPlugin = require("compression-webpack-plugin");
+
 const name = defaultSettings.title || '名学金榜生涯志愿系统' // 标题
 
 const port = process.env.port || process.env.npm_config_port || 80 // 端口
@@ -61,7 +63,15 @@ module.exports = {
       alias: {
         '@': resolve('src')
       }
-    }
+    },
+    plugins: [
+      new CompressionPlugin({
+        test: /\.(js|css|html)?$/i, // 压缩文件格式
+        filename: "[path].gz[query]", // 压缩后的文件名
+        algorithm: "gzip", // 使用gzip压缩
+        minRatio: 0.8, // 压缩率小于1才会压缩
+      }),
+    ],
   },
   chainWebpack(config) {
     config.plugins.delete('preload') // TODO: need test