lsc 1 rok temu
rodzic
commit
67b2bc8894

+ 1 - 1
dist/index.html

@@ -32,7 +32,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: 'Source Han Sans SC', sans-serif;
-    }</style><link href=./static/css/app.ccf0b50d6aed0399e1a9a9dc8f341556.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.571c38d63f24b1ae9e16.js></script><script type=text/javascript src=./static/js/vendor.11d8a4dfbebdec332b5f.js></script><script type=text/javascript src=./static/js/app.b1311e10f474d0353efd.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.2b2f96a72ff6e47201f37589c781c6f1.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.571c38d63f24b1ae9e16.js></script><script type=text/javascript src=./static/js/vendor.11d8a4dfbebdec332b5f.js></script><script type=text/javascript src=./static/js/app.d37b7157f72cf0816c8d.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

Plik diff jest za duży
+ 0 - 0
dist/static/css/app.2b2f96a72ff6e47201f37589c781c6f1.css


Plik diff jest za duży
+ 0 - 0
dist/static/css/app.2b2f96a72ff6e47201f37589c781c6f1.css.map


Plik diff jest za duży
+ 0 - 0
dist/static/css/app.ccf0b50d6aed0399e1a9a9dc8f341556.css.map


Plik diff jest za duży
+ 0 - 0
dist/static/js/app.d37b7157f72cf0816c8d.js


Plik diff jest za duży
+ 0 - 0
dist/static/js/app.d37b7157f72cf0816c8d.js.map


Plik diff jest za duży
+ 0 - 0
dist/static/js/manifest.571c38d63f24b1ae9e16.js.map


+ 14 - 2
src/components/pages/student.vue

@@ -382,6 +382,12 @@ export default {
       //   this.$message.error("学生手机号不能为空");
       //   return;
       // }
+      let mail = '';
+      if(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(this.sMail)){
+        mail = this.sMail;
+      }else{
+        this.sMail + "@" + this.userSuffix
+      }
       if (this.time()) {
         // let params = { un: this.sPhone };
         // this.ajax
@@ -390,7 +396,7 @@ export default {
         //     if (res.data[0].length > 0) {
         //       this.$message.error("此学生手机号码已被注册");
         //     } else {
-        let params = { un: this.sMail + '@' + this.userSuffix };
+        let params = { un: mail };
         this.ajax
           .get(this.$store.state.api + "findMail", params)
           .then((res) => {
@@ -423,9 +429,15 @@ export default {
       }
     },
     add_Student() {
+      let mail = '';
+      if(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(this.sMail)){
+        mail = this.sMail;
+      }else{
+        this.sMail + "@" + this.userSuffix
+      }
       let params = [
         {
-          username: this.sMail + '@' + this.userSuffix,
+          username: mail,
           userpassword: 123456,
           alias: this.sName,
           oid: this.oid,

+ 14 - 2
src/components/pages/studentManage/student.vue

@@ -401,6 +401,12 @@ export default {
       //   this.$message.error("学生手机号不能为空");
       //   return;
       // }
+      let mail = '';
+      if(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(this.sMail)){
+        mail = this.sMail;
+      }else{
+        this.sMail + "@" + this.userSuffix
+      }
       if (this.time()) {
         // let params = { un: this.sPhone };
         // this.ajax
@@ -409,7 +415,7 @@ export default {
         //     if (res.data[0].length > 0) {
         //       this.$message.error("此学生手机号码已被注册");
         //     } else {
-        let params = { un: this.sMail + '@' + this.userSuffix };
+        let params = { un: mail };
         this.ajax
           .get(this.$store.state.api + "findMail", params)
           .then((res) => {
@@ -442,9 +448,15 @@ export default {
       }
     },
     add_Student() {
+      let mail = '';
+      if(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(this.sMail)){
+        mail = this.sMail;
+      }else{
+        this.sMail + "@" + this.userSuffix
+      }
       let params = [
         {
-          username: this.sMail + '@' + this.userSuffix,
+          username: mail,
           userpassword: 123456,
           alias: this.sName,
           oid: this.oid,

+ 17 - 2
src/components/pages/sz/teacher.vue

@@ -536,9 +536,16 @@ export default {
         }
       }
 
+      let mail = '';
+      if(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(this.sMail)){
+        mail = this.sMail;
+      }else{
+        this.sMail + "@" + this.userSuffix
+      }
+      
       if (this.time()) {
         // let params = { un: this.sMail };
-        let params = { un: this.sMail + "@" + this.userSuffix };
+        let params = { un:  mail};
 
         this.ajax
           .get(this.$store.state.api + "findMail", params)
@@ -564,9 +571,16 @@ export default {
         AddT = 1;
         addR = 0;
       }
+
+      let mail = '';
+      if(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(this.sMail)){
+        mail = this.sMail;
+      }else{
+        this.sMail + "@" + this.userSuffix
+      }
       let params = [
         {
-          username: this.sMail  + '@' + this.userSuffix,
+          username: mail,
           userpassword: 123456,
           alias: this.sName,
           org:
@@ -1112,6 +1126,7 @@ export default {
 
 .delete {
   width: 25px;
+  height: 25px;
   cursor: pointer;
   margin-left: 10px;
 }

+ 114 - 3
src/components/pages/test/check/index.vue

@@ -73,7 +73,13 @@
                 <span class="serach_icon" @click="searchCourse"></span>
               </div>
               <div class="btnA" v-if="stype == 1 && !pdfLoading" @click="exportPDF">导出PDF</div>
-              <div class="btnA" v-if="stype == 2" @click="exportAllWord">导出人员数据</div>
+              <div class="btnA" v-if="stype == 2" @mouseenter="btnDisplay = true" @mouseleave="btnDisplay = false">
+                导出数据
+                <div v-show="btnDisplay" class="buttonBox">
+                  <div type="primary" @click="exportExcel">下载汇总表格</div>
+                  <div type="primary" @click="exportAllWord">导出人员数据</div>
+                </div>
+              </div>
               <div class="btnA" v-if="stype == 3" @click="exportAllWord2">导出人员数据</div>
             </div>
           </div>
@@ -159,7 +165,7 @@
           </div>
           <div class="table_content" v-if="stype == 2">
             <el-table class="el-table" ref="table" :data="worksArray" border :fit="true" :key="2"
-              v-loading="isLoading" style="width: 100%" :header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }">
+              v-loading="isLoading" style="width: 100%" :header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }"  @filter-change="handleFilterChange">
               <el-table-column fixed label="序号" width="80px" align="left">
                 <template slot-scope="scope">
                   {{ scope.$index + 1 }}
@@ -265,6 +271,9 @@ import { downloadPDF } from '../../../tools/pdf'
 import JSZip from "jszip";
 import FileSaver from "file-saver";
 
+import XLSX from "xlsx-js-style";
+
+
 export default {
   components: {
     shareBox,
@@ -318,7 +327,8 @@ export default {
       wurl: "",
       chapters: [],
       filterPlacement: 'bottom-end',
-      pdfLoading: false
+      pdfLoading: false,
+      btnDisplay: false
     };
   },
   watch: {},
@@ -1096,6 +1106,78 @@ export default {
         }, 2000);
       });
     },
+    handleFilterChange(){
+      console.log( this.$refs.table.store.states.data);
+    },
+    exportExcel(){
+      let res =  this.$refs.table.store.states.data
+      if(!res.length){
+        this.$message.error('无导出数据')
+        return
+      }
+      this.isLoading = true;
+      let chapters = this.chapters
+
+      var array = [];
+      for (var i = 0; i < res.length; i++) {
+        var _json = {};
+        _json["序号"] = i+1;
+        _json["提交人"] = res[i].name;
+        _json["提交时间"] = res[i].time;
+        for(var j = 0; j < chapters.length; j++){
+          _json[j+1+"."+chapters[j].json.title] = '';
+          if(res[i].array[j].type == 1 && res[i].array[j].json.answer2){
+            let a = []
+            for(var answer2 = 0;answer2 < res[i].array[j].json.answer2.length; answer2++){
+              a.push(res[i].array[j].json.array[answer2].option)
+            }
+            _json[j+1+"."+chapters[j].json.title] = a.join('、')
+          }else if(res[i].array[j].type == 3 && res[i].array[j].json.answer2){
+            _json[j+1+"."+chapters[j].json.title] = res[i].array[j].json.answer2
+          }else if(res[i].array[j].type == 5 && res[i].array[j].json.file){
+            let files = []
+            for (let file = 0; file < res[i].array[j].json.file.length; file++) {
+              let check = res[i].array[j].json.file[file]
+              files.push(file+1+'.'+check.name+'----'+check.url)
+            }
+            _json[j+1+"."+chapters[j].json.title] = files.join('\n')
+          }
+        }
+        array.push(_json);
+      }
+      let widthJson = []
+      let widthArray = Object.keys(array[0])
+      for(let i = 0; i < widthArray.length; i++){
+        if(i == 0){
+          widthJson.push({wch: 5})
+        }else{
+          widthJson.push({wch: 30})
+        }
+      }
+
+      const workbook = XLSX.utils.book_new(); //创建一个新的工作簿对象
+      let ws = XLSX.utils.json_to_sheet(array); //将json对象数组转化成工作表
+      ws["!cols"] = widthJson;
+      const styleObj = { alignment: { 
+        horizontal: "center",
+        vertical: "center" // 设置垂直居中
+     } }; // 设置居中对齐和加粗样式
+
+      for (let cell in ws) {
+        if (!cell[0].startsWith("!")) {
+          ws[cell]["s"] = styleObj;
+        }
+      }
+
+      XLSX.utils.book_append_sheet(workbook, ws, "sheet1"); //把sheet添加到workbook里,第三个参数是sheet名
+
+      XLSX.writeFile(workbook, this.testJson.title+".xlsx");
+      this.isLoading = false;
+      this.$message({
+        message: "导出成功",
+        type: "success"
+      });
+    },
   },
   beforeDestroy() {
     document.getElementsByTagName('html')[0].style.overflow = ''
@@ -1659,5 +1741,34 @@ export default {
   justify-content: center;
   line-height: 1;
   margin-right: 10px;
+  position: relative;
+}
+
+.buttonBox {
+  position: absolute;
+  bottom: -0;
+  transform: translateY(100%);
+  background: #fff;
+  border-radius: 5px;
+  box-shadow: 0 0 3px 1px #e3e3e3;
+  width: 100%;
+  z-index: 999;
+}
+
+.buttonBox>div {
+  height: 40px;
+  line-height: 40px;
+  width: 100%;
+  text-align: center;
+  color: #000;
+  box-sizing: border-box;
+}
+
+.buttonBox>div+div {
+  border-top: 1px solid #e0e0e0;
+}
+
+.buttonBox>div:hover {
+  background: #f6f8ff;
 }
 </style>

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików