实验报告导出等修复

dev_2020-03-03
yujialong 3 years ago
parent c46165aa12
commit 19ecad3c3b
  1. 1
      src/api/index.js
  2. 18
      src/layouts/header/index.vue
  3. 2
      src/layouts/navbar/index.vue
  4. 6
      src/libs/util.cookies.js
  5. 16
      src/pages/account/login/index.vue
  6. 26
      src/pages/record/show/index.vue

@ -44,6 +44,7 @@ export default {
updateReport: `${host}occupationlab/achievement/updateReport`, // 更新成绩报告
schoolCourseByAchievement: `${host}nakadai/nakadai/curriculum/schoolCourseByAchievement`, // 获取学校购买订单后的课程
exportLabReport: `${host}occupationlab/achievement/exportLabReport`,
exportBankExperimentReport: `${host}occupationlab/achievement/exportBankExperimentReport`,
// 考核列表
pageStuAssessment: `${host}occupationlab/assessment/pageStuAssessment`, // 学生端——学生考核列表

@ -80,12 +80,12 @@ export default {
}).catch(err => {})
},
toPersonal() {
//
if (this.isIndex) {
window.open(this.$router.resolve('/setting/person').href)
} else {
this.customerName || this.$router.push("/setting/person") //
}
//
if (this.isIndex) {
window.open(this.$router.resolve('/setting/person').href)
} else {
this.customerName || this.$router.push("/setting/person") //
}
},
toIndex() {
this.$refs.nav.jump({
@ -93,7 +93,13 @@ export default {
})
},
toLogin() {
if (util.cookies.get('serverLogin') === 'true') {
window.open(process.env.NODE_ENV === 'development' ?
'http://192.168.31.125:8081/#/index' :
`${location.origin}/admin`)
} else {
window.open(this.$router.resolve('/login').href)
}
}
}
};

@ -81,7 +81,7 @@ export default {
mounted() {
const path = this.$route.path
this.menus = Setting.whiteList.find(e => e === path) ? this.touristMenu : this.loginedMenu
this.getColumns()
this.token && this.getColumns()
},
methods: {
//

@ -14,7 +14,7 @@ cookies.set = function(name = "default", value = "", cookieSetting = {}) {
expires: Setting.cookiesExpires
};
Object.assign(currentCookieSetting, cookieSetting);
Cookies.set(`admin-${name}`, value, currentCookieSetting);
Cookies.set(name, value, currentCookieSetting);
};
/**
@ -22,7 +22,7 @@ cookies.set = function(name = "default", value = "", cookieSetting = {}) {
* @param {String} name cookie name
*/
cookies.get = function(name = "default") {
return Cookies.get(`admin-${name}`);
return Cookies.get(name);
};
/**
@ -37,7 +37,7 @@ cookies.getAll = function() {
* @param {String} name cookie name
*/
cookies.remove = function(name = "default") {
return Cookies.remove(`admin-${name}`);
return Cookies.remove(`${name}`);
};
export default cookies;

@ -151,11 +151,16 @@ export default {
this.$refs.form.clearValidate();
this.loginRules.account[0].message = tab.id === "1" ? "请输入账号" : "请输入手机号/邮箱";
},
//
reloadIndex() {
window.opener && window.opener.location.reload()
},
//
setLogin() {
util.local.set(Setting.tokenKey, this.token, Setting.tokenExpires)
util.successMsg('登录成功')
window.opener && window.opener.location.reload() //
util.cookies.remove('serverLogin')
this.reloadIndex()
const redirect = this.$route.query.redirect ? decodeURIComponent(this.$route.query.redirect) : "/station"
this.$router.replace(redirect)
},
@ -200,8 +205,13 @@ export default {
if (val === 1) {
this.setLogin()
} else {
location.href = `${location.origin}/admin/#/redirect?auth=${window.btoa(this.token)}`
// location.href = 'http://192.168.31.125:8081/#/redirect?auth=' + btoa(this.token)
util.cookies.set('serverLogin', true, {
expires: new Date(Date.now() + 15 * 60 * 1000)
})
this.reloadIndex()
location.href = process.env.NODE_ENV === 'development' ?
'http://192.168.31.125:8081/#/redirect?auth=' + btoa(this.token) :
`${location.origin}/admin/#/redirect?auth=${window.btoa(this.token)}`
}
},
phoneCountdown() {

@ -63,8 +63,8 @@
</li>
<li>
<label>学生班级</label>
<el-input v-if="editing" v-model="infoData.workNumber"></el-input>
<span v-else>{{ infoData.workNumber }}</span>
<el-input v-if="editing" v-model="infoData.className"></el-input>
<span v-else>{{ infoData.className }}</span>
</li>
<li>
<label>指导老师</label>
@ -197,9 +197,22 @@ export default {
getData() { //
this.$get(`${this.api.reportDetail}?reportId=${this.reportId}`).then(res => {
this.form = res.report
this.expData = res.userScores
this.project = this.expData.find(e => e.lcRuleRecords) // lcRuleRecords
let form = this.form;
const list = res.userScores
this.project = list.find(e => e.lcRuleRecords) // lcRuleRecords
let form = this.form
form.className = this.className
if (this.project) {
list.map(e => {
e.assessmentPoint = ''
e.referenceAnswer = ''
e.answer = ''
e.lcRuleRecords.map((n, i) => {
e.assessmentPoint += `${i + 1}.${n.name}`
e.referenceAnswer += `${i + 1}.${n.ruleAnswer}`
e.answer += `${i + 1}.${n.userAnswer}`
})
})
}
this.infoData = {
workNumber: form.workNumber,
experimentalClassName: form.experimentalClassName,
@ -210,6 +223,7 @@ export default {
score: form.score,
userName: form.userName
}
this.expData = list
form.assessmentId && (this.breadPath = ['实验记录', '实验报告'])
}).catch(res => {})
},
@ -225,7 +239,7 @@ export default {
if (form[i] && typeof form[i] === 'string') form[i] = form[i].replace(/<[^>]+>/g, '')
}
form.purpose = form.purpose.replace(/<[^>]+>/g, '')
this.$post(this.api.exportLabReport, {
this.$post(this.project ? this.api.exportBankExperimentReport : this.api.exportLabReport, {
...form,
experimentalData: list
}).then(res => {

Loading…
Cancel
Save