|
@@ -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();
|