Explorar o código

学生记录添加平均数

yuanyiming hai 1 ano
pai
achega
aa6b1d1889

+ 2 - 1
src/components/pages/kindStudentEva/index.vue

@@ -14,7 +14,7 @@
       <panelA :userid="suid" :oid="oid" :org="org" :key="suid+num"></panelA>
     </div>
     <div class="tp_right">
-      <testA :userid="suid" :oid="oid" @updatePanelA="updatePanelA" :org="org" :cid="cid" :key="suid+'c'"></testA>
+      <testA :userid="suid" :oid="oid" @updatePanelA="updatePanelA" :org="org" :cid="cid" :fathType="fathType" :key="suid+'c'"></testA>
     </div>
   </div>
 </template>
@@ -39,6 +39,7 @@ export default {
       cid: this.$route.query.cid,
       suid: this.$route.query.suid,
       role: this.$route.query.role,
+      fathType: this.$route.query.fathType,
       num:0
     };
   },

+ 8 - 5
src/components/pages/kindStudentEva/test/component/verColumnar.vue

@@ -19,8 +19,8 @@ export default {
   },
   data() {
     return {
-        bLeg: [ "第一次评估" ,  "第二次评估" ,  "第三次评估" ],
-    }
+      bLeg: ["第一次评估", "第二次评估", "第三次评估"]
+    };
   },
   mounted() {
     this.initializeChart();
@@ -44,6 +44,9 @@ export default {
           data: this.bLeg,
           bottom: 0 // 将图例显示在底部
         },
+        grid: {
+          containLabel: true //设置自适应画布大小状态为开,也可通过设置left左移实现相同效果。
+        },
         yAxis: {
           type: "category",
           data: this.verCategories
@@ -51,10 +54,10 @@ export default {
         series: this.bLeg.map((legendItem, index) => ({
           name: legendItem,
           data: this.verChartData[index],
-          type: 'bar',
-          barCategoryGap: '30%'
+          type: "bar",
+          barCategoryGap: "30%"
         }))
-        
+
         // [
         //   {
         //     data: this.verChartData,

+ 4 - 1
src/components/pages/kindStudentEva/test/index.vue

@@ -71,6 +71,9 @@ export default {
     },
     cid: {
       type: String
+    },
+    fathType: {
+      type: String
     }
   },
   components: {
@@ -96,7 +99,7 @@ export default {
     },
     backClaBtn() {
       this.$router.push(
-        `/studentEva?userid=${this.userid}&oid=${this.oid}&org=${this.org}&cid=${this.cid}&role=${this.role}`
+        `/studentEva?userid=${this.userid}&oid=${this.oid}&org=${this.org}&cid=${this.cid}&role=${this.role}&fathType=${this.fathType}`
       );
     }
   },

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 507 - 135
src/components/pages/record/class.vue


+ 50 - 23
src/components/pages/studentEva.vue

@@ -15,18 +15,7 @@
           <el-button
             type="primary"
             class="bgColor student_button"
-            @click="
-              goTo(
-                '/class?userid=' +
-                  userid +
-                  '&oid=' +
-                  oid +
-                  '&org=' +
-                  org +
-                  '&role=' +
-                  role
-              )
-            "
+            @click="backPath"
             >返回</el-button
           >
         </div>
@@ -127,7 +116,9 @@
                         '&suid=' +
                         scope.row.userid +
                         '&role=' +
-                        role
+                        role+
+                        '&fathType=' +
+                        fathType
                     )
                   "
                   >查看评价</el-button
@@ -171,7 +162,9 @@ export default {
       classJuri: [],
       yearJuri: [],
       page: 1,
-      total: 0
+      total: 0,
+      // 储存判断跳转路由
+      fathType: null
     };
   },
   methods: {
@@ -185,26 +178,54 @@ export default {
         return "";
       }
     },
+    // 判断返回上级页面
+    backPath() {
+      if (this.fathType) {
+        this.$router.push(
+          "/record" +
+            "?userid=" +
+            this.userid +
+            "&oid=" +
+            this.oid +
+            "&org=" +
+            this.org +
+            "&role=" +
+            this.role
+        );
+      }else{
+        this.$router.push(
+          "/class" +
+            "?userid=" +
+            this.userid +
+            "&oid=" +
+            this.oid +
+            "&org=" +
+            this.org +
+            "&role=" +
+            this.role
+        );
+      }
+    },
     //获取班级列表
     getClass() {
-      this.isLoading = true;
+      // this.isLoading = true;
       let params = {
         oid: this.oid
       };
       this.ajax
         .get(this.$store.state.api + "selectClassBySchool", params)
         .then(res => {
-          this.isLoading = false;
+          // this.isLoading = false;
           this.classJuri = res.data[0];
           // console.log( this.classJuri);
         })
         .catch(err => {
-          this.isLoading = false;
+          // this.isLoading = false;
           console.error(err);
         });
     },
     getYear() {
-      this.isLoading = true;
+      // this.isLoading = true;
       this.ajax
         .get(this.$store.state.api + "selectTerm")
         .then(res => {
@@ -220,7 +241,7 @@ export default {
           this.searchStudent();
         })
         .catch(err => {
-          this.isLoading = false;
+          // this.isLoading = false;
           console.error(err);
         });
     },
@@ -244,7 +265,8 @@ export default {
           this.ajax
             .get(this.$store.state.api + "selectClassAllRecord", params)
             .then(res => {
-              // return console.log(res);
+              // console.log(res.data[0]);
+              // 发现导出的数据不对,是因为导出是按学期分的,进入学生主页显示的是全部
               this.exportExcel(res.data[0]);
             });
         })
@@ -303,7 +325,7 @@ export default {
         { wch: 30 }
       ];
       XLSX.utils.book_append_sheet(workbook, ws, "sheet1"); //把sheet添加到workbook里,第三个参数是sheet名
-      XLSX.writeFile(workbook, className+'-'+ termName + "观察记录.xlsx");
+      XLSX.writeFile(workbook, className + "-" + termName + "观察记录.xlsx");
       // const wopts = { bookType: "xlsx", bookSST: false, type: "array" };//写入的样式bookType:输出的文件类型,type:输出的数据类型,bookSST: 是否生成Shared String Table,官方解释是,如果开启生成速度会下降,但在低版本IOS设备上有更好的兼容性
       // const wbout = XLSX.write(workbook, wopts);// 浏览器端和node共有的API,实际上node可以直接使用xlsx.writeFile来写入文件,但是浏览器没有该API
       // FileSaver.saveAs(new Blob([wbout], { type: "application/octet-stream" }), `${title} demo.xlsx`);//保存文件
@@ -410,7 +432,6 @@ export default {
               var count = 0;
               var sum = 0;
               // console.log("json", json);
-             
 
               allfType.forEach(e => {
                 // console.log(e);
@@ -447,7 +468,7 @@ export default {
               tableData[i].oneScore = croMapData[0];
               tableData[i].twoScore = croMapData[1];
               tableData[i].threeScore = croMapData[2];
-             
+
               // let aaa = this.combineArrays(allScore);
 
               // console.log("tableData", tableData[i]);
@@ -484,6 +505,12 @@ export default {
         });
     }
   },
+  beforeRouteEnter(to, from, next) {
+    next(vm => {
+      // console.log("从哪进", to.query.fathType, from.path);
+      vm.fathType = to.query.fathType * 1;
+    });
+  },
   created() {
     this.page = 1;
     this.getClass();

+ 3 - 1
src/components/pages/studentManage/class.vue

@@ -94,7 +94,9 @@
                         '&cid=' +
                         scope.row.id +
                         '&role=' +
-                        role
+                        role+
+                        '&fathType=' +
+                        '0'
                       )
                       ">查看评价</el-button>
                     <el-button type="primary" size="small" @click="deleteClass(scope.row.id)">删除</el-button>

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio