diff --git a/src/api/index.js b/src/api/index.js
index 2be1f11..919b487 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -13,11 +13,7 @@ export default {
verification: `${host}users/users/user/captcha`,// 验证码图片
//实验台
- experimentOverview: `${host}occupationlab/achievement/experimentOverview`, //实验概览
- queryAssessmentByStudent: `${host}occupationlab/achievement/queryAssessmentByStudent`, //学生端考核成绩
- queryPracticeByStudent: `${host}occupationlab/achievement/queryPracticeByStudent`, //学生端练习成绩
- exportAssessmentInfo: `${host}occupationlab/achievement/exportAssessmentInfo`, // 批量导出考核成绩
- exportPracticeInfo: `${host}occupationlab/achievement/exportPracticeInfo`, // 批量导出练习成绩
+
// 能力测评
canExperiment: `${host}occupationlab/occupationlab/evaluationrecord/can_experiment`, // 查询是否能够开启实验
@@ -31,6 +27,16 @@ export default {
experimentStart: `${host}occupationlab/occupationlab/evaluationrecord/start`, // 开始测评
experimentSubmit: `${host}occupationlab/occupationlab/evaluationrecord/submit`, // 提交测评
+ // 实验记录
+ schoolCourse: `${host}nakadai/nakadai/curriculum/schoolCourse`, // 获取学校购买订单后的课程
+ experimentOverview: `${host}occupationlab/achievement/experimentOverview`, //实验概览
+ queryAssessmentByStudent: `${host}occupationlab/achievement/queryAssessmentByStudent`, //学生端考核成绩
+ queryPracticeByStudent: `${host}occupationlab/achievement/queryPracticeByStudent`, //学生端练习成绩
+ exportAssessmentInfo: `${host}occupationlab/achievement/exportAssessmentInfo`, // 批量导出考核成绩
+ exportPracticeInfo: `${host}occupationlab/achievement/exportPracticeInfo`, // 批量导出练习成绩
+ practiceByStudentDetail: `${host}occupationlab/achievement/practiceByStudentDetail`, // 学生端练习实验情况
+ exportPracticeByStudentDetail: `${host}occupationlab/achievement/exportPracticeByStudentDetail`, // 导出学生端练习实验情况
+
// 考核列表
pageStuAssessment: `${host}occupationlab/assessment/pageStuAssessment`, // 学生端——学生考核列表
getPythonSysByStuAccountId: `${host}occupationlab/assessment/getPythonSysByStuAccountId`, // 学生端——课程名称
diff --git a/src/main.js b/src/main.js
index c476d06..0bd0b87 100644
--- a/src/main.js
+++ b/src/main.js
@@ -32,7 +32,7 @@ Vue.prototype.core = core
Vue.config.productionTip = false;
Vue.use(VueI18n);
-Vue.use(ElementUI);
+Vue.use(ElementUI, { size: "small" });
const i18n = new VueI18n({
locale: Setting.i18n.default,
messages
diff --git a/src/pages/account/login/index.vue b/src/pages/account/login/index.vue
index 60ed199..c8a7383 100644
--- a/src/pages/account/login/index.vue
+++ b/src/pages/account/login/index.vue
@@ -165,12 +165,12 @@ export default {
activeName: "1",
isReg: false,
loginForm: {
- account: "admin",
+ account: "xiaoliu",
password: "111aaa",
code: "", // 验证码
random: "", // 随机数
distinguish: null, // 区分手机号账号登录,1为账号登录,2为手机号或邮箱登录
- platform: 3 // 平台标识,1职站,2数据平台,3中台
+ platform: 1 // 平台标识,1职站,2数据平台,3中台
},
loginRules: {
account: [{ required: true, message: "请输入用户名", trigger: "blur" }],
diff --git a/src/pages/ass/list/index.vue b/src/pages/ass/list/index.vue
index c9ade44..ff362ee 100644
--- a/src/pages/ass/list/index.vue
+++ b/src/pages/ass/list/index.vue
@@ -81,7 +81,7 @@
-
+ {{ scope.row.countDown | timeFilter }}
@@ -92,10 +92,16 @@
- 未参加
- 进入
- 已提交
- 查看成绩
+ 未参加
+
+ 进入
+
+ 已提交
+
+ 查看成绩
+
@@ -154,7 +160,7 @@ export default {
endTime: "",
status: "",
systemId: "",
- classId: "",
+ classId: ""
},
keyword: "",
dateList: [
@@ -181,8 +187,8 @@ export default {
icVisible: false,
invitationCode: "",
searchTimer: null,
- timerList: [],
- curRow: {}
+ curRow: {},
+ ticker: null // 倒计时定时器
};
},
computed: {
@@ -217,71 +223,85 @@ export default {
}
},
mounted() {
+ // 页面离开的时候销毁手机和邮箱验证码定时器
+ this.$once("hook:beforeDestroy", function() {
+ clearInterval(this.ticker);
+ this.ticker = null;
+ });
this.getData();
this.getCourseData();
this.getClassData();
- this.$once("hook:beforeDestroy", function() {
- this.timerList.forEach((n, k) => {
- clearInterval(n);
- });
- this.timerList = [];
- });
},
- directives: {
- countdown: {
- bind: function(el, binding, vnode) {
- let that = vnode.context;
- let time = binding.value;
- let timer = setInterval(() => {
- let timeList = time.split(":");
- let total = Number.parseInt(timeList[0] * 60 * 60) + Number.parseInt(timeList[1] * 60) + Number.parseInt(timeList[2]);
- if (total > 0) {
- --total;
- let hours = Math.floor(total / (60 * 60));
- let minutes = Math.floor(total % (60 * 60) / 60);
- let seconds = Math.floor(total % (60 * 60) % 60);
- time = `${util.formateTime(hours)}:${util.formateTime(minutes)}:${util.formateTime(seconds)}`;
- } else {
- clearInterval(timer);
- }
- el.innerHTML = time;
- }, 1000);
- that.timerList.push(timer);
+ filters: {
+ timeFilter(countDown) {
+ if (countDown > 0) {
+ let h = Math.floor(countDown / (60 * 60));
+ let m = Math.floor(countDown % (60 * 60) / 60);
+ let s = Math.floor(countDown % (60 * 60) % 60);
+ return `${h > 9 ? h : `0${h}`}:${m > 9 ? m : `0${m}`}:${s > 9 ? s : `0${s}`}`;
+ } else {
+ return "00:00:00";
}
}
},
methods: {
- getCourseData () {
+ beginTimer() {
+ this.ticker = setInterval(() => {
+ for (let i = 0; i < this.listData.length; i++) {
+ const item = this.listData[i];
+ if (item.countDown > 0) {
+ item.countDown = item.countDown - 1;
+ }
+ this.$set(this.listData, i, item);
+ }
+ }, 1000);
+ },
+ getData() {
+ if (this.ticker) {
+ clearInterval(this.ticker);
+ }
+ let data = {
+ ...this.form,
+ pageNum: this.page,
+ pageSize: this.pageSize
+ };
+ this.$post(this.api.pageStuAssessment, data).then(res => {
+ if (res.status === 200 && res.list && res.list.length) {
+ this.listData = res.list;
+ this.totals = res.total;
+ this.listData.forEach(i => {
+ if (i.status === 2) { // 已结束
+ i.countDown = 0;
+ } else if (i.status === 1) { // 进行中
+ i.countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000;
+ } else if (i.status === 0) { // 待开始
+ i.countDown = (new Date(i.startTime).getTime() - new Date().getTime()) / 1000; // 获得两个日期时间的秒数差
+ }
+ });
+ this.beginTimer();
+ }
+ }).catch(err => {});
+ },
+ initData() {
+ this.page = 1;
+ this.getData();
+ },
+ getCourseData() {
this.$get(this.api.getPythonSysByStuAccountId).then(res => {
this.courseList = res.list;
}).catch(err => {
});
},
- getClassData () {
+ getClassData() {
this.$post(this.api.myClassByStudent).then(res => {
if (res.status === 200) {
this.classList = res.data;
} else {
util.errorMsg(res.message);
}
- }).catch(err => {});
- },
- getData() {
- let data = {
- ...this.form,
- pageNum: this.page,
- pageSize: this.pageSize,
- };
- this.$post(this.api.pageStuAssessment, data).then(res => {
- this.listData = res.list;
- this.totals = res.page.totalCount;
}).catch(err => {
});
},
- initData() {
- this.page = 1;
- this.getData();
- },
handleCurrentChange(val) { // 切换页码
this.page = val;
this.getData();
@@ -293,7 +313,7 @@ export default {
return util.warningMsg("该实验已经结束");
} else {
this.curRow = row;
- if (row.isCode == 1) {
+ if (row.isCode === 0) { // 是否启用邀请码(0、未启用 1、启用)
this.goSubSystem();
} else {
this.$get(this.api.checkInvitationCode, {
diff --git a/src/pages/record/details/index.vue b/src/pages/record/details/index.vue
index 4aaf0ad..c8a375d 100644
--- a/src/pages/record/details/index.vue
+++ b/src/pages/record/details/index.vue
@@ -7,6 +7,12 @@
+
+
-
+
-
+
实验报告
@@ -45,34 +52,42 @@
export default {
data() {
return {
- listData: [
- {id: 1, name: 111},
- {id: 2, name: 222},
- {id: 3, name: 333}
- ],
+ curriculumId: this.$route.query.curriculumId,
+ projectId: this.$route.query.projectId,
+ listData: [],
total: 0,
page: 1,
pageSize: 10,
multipleSelection: [],
}
},
+ mounted() {
+ this.getData();
+ },
methods: {
goBack() {
this.$router.back();
},
getData() {
-
+ this.$post(`${this.api.practiceByStudentDetail}?curriculumId=${this.curriculumId}&projectId=${this.projectId}&pageNum=${this.page}&pageSize=${this.pageSize}`).then(res => {
+ this.listData = res.data.records;
+ this.total = res.data.total;
+ }).catch(err => {});
},
- initData() {
- this.page = 1;
+ handleCurrentChange(val) { // 切换页码
+ this.page = val;
this.getData();
},
handleSelectionChange(val) { // 处理多选
this.multipleSelection = val;
},
- handleCurrentChange(val) { // 切换页码
- this.page = val;
- this.getData();
+ exportData() { // 导出
+ if (this.multipleSelection.length) {
+ let ids = this.multipleSelection.map(i => i.reportId);
+ location.href = `${this.api.exportPracticeByStudentDetail}?ids=${ids.toString()}`;
+ } else {
+ location.href = `${this.api.exportPracticeByStudentDetail}?ids=`;
+ }
},
tableRowStyle({ row, column, rowIndex, columnIndex }) {
if (rowIndex % 2 === 0) {
diff --git a/src/pages/record/list/ass.vue b/src/pages/record/list/ass.vue
index 5f9b49c..51af08b 100644
--- a/src/pages/record/list/ass.vue
+++ b/src/pages/record/list/ass.vue
@@ -9,18 +9,18 @@
stripe
>
-
+
-
+
- {{ scope.row.duration }}分
+ {{ scope.row.timeSum }}分
-
+
实验成绩报告
@@ -34,12 +34,8 @@