导出实验报告等

dev_2020-03-03
yujialong 3 years ago
parent 9aeac73ec4
commit c46165aa12
  1. 3
      src/api/index.js
  2. 5
      src/components/breadcrumb/index.vue
  3. 95
      src/layouts/navbar/index.vue
  4. 6
      src/pages/info/details/index.vue
  5. 90
      src/pages/info/list/index.vue
  6. 2
      src/pages/record/list/practice.vue
  7. 22
      src/pages/record/show/index.vue
  8. 8
      src/pages/setting/person/info.vue
  9. 2
      src/pages/station/preview/index.vue

@ -43,6 +43,7 @@ export default {
reportDetail: `${host}occupationlab/achievement/reportDetail`, // 成绩报告详情 reportDetail: `${host}occupationlab/achievement/reportDetail`, // 成绩报告详情
updateReport: `${host}occupationlab/achievement/updateReport`, // 更新成绩报告 updateReport: `${host}occupationlab/achievement/updateReport`, // 更新成绩报告
schoolCourseByAchievement: `${host}nakadai/nakadai/curriculum/schoolCourseByAchievement`, // 获取学校购买订单后的课程 schoolCourseByAchievement: `${host}nakadai/nakadai/curriculum/schoolCourseByAchievement`, // 获取学校购买订单后的课程
exportLabReport: `${host}occupationlab/achievement/exportLabReport`,
// 考核列表 // 考核列表
pageStuAssessment: `${host}occupationlab/assessment/pageStuAssessment`, // 学生端——学生考核列表 pageStuAssessment: `${host}occupationlab/assessment/pageStuAssessment`, // 学生端——学生考核列表
@ -63,6 +64,8 @@ export default {
queryAllColumns: `${host}occupationlab/enterprise/information/column/queryAllColumns`, // 栏目树 queryAllColumns: `${host}occupationlab/enterprise/information/column/queryAllColumns`, // 栏目树
queryArticleByCondition: `${host}occupationlab/enterprise/information/article/queryArticleByCondition`, // 文章列表分页条件查询 queryArticleByCondition: `${host}occupationlab/enterprise/information/article/queryArticleByCondition`, // 文章列表分页条件查询
getArticle: `${host}occupationlab/enterprise/information/article/getArticle`, // 根据id查询文章 getArticle: `${host}occupationlab/enterprise/information/article/getArticle`, // 根据id查询文章
firstLevelColumn: `${host}occupationlab/enterprise/information/column/firstLevelColumn`,
secondaryColumnsByFirst: `${host}occupationlab/enterprise/information/column/secondaryColumnsByFirst`,
// 线上赛事 // 线上赛事
onlineContestQuery: `${host}occupationlab/enterprise/match/onlineContest/onlineContestQuery`, // 线上赛事列表分页条件查询 onlineContestQuery: `${host}occupationlab/enterprise/match/onlineContest/onlineContestQuery`, // 线上赛事列表分页条件查询

@ -6,7 +6,7 @@
<el-breadcrumb-item <el-breadcrumb-item
v-if="index != pages.length - 1" v-if="index != pages.length - 1"
:key="index" :key="index"
:to="{ path: route }"> :to="{ path: route, query }">
{{item}} {{item}}
</el-breadcrumb-item> </el-breadcrumb-item>
<el-breadcrumb-item <el-breadcrumb-item
@ -29,6 +29,9 @@ export default {
route: { route: {
type: String, type: String,
default: 'list' default: 'list'
},
query: {
type: Object
} }
}, },
data() { data() {

@ -1,7 +1,12 @@
<template> <template>
<div> <div>
<ul class="nav"> <ul class="nav">
<li v-for="(item,index) in menus" :key="index" :class="{active: active == item.index}" @click="jump(item)">{{item.title}}</li> <li v-for="(item, i) in menus" :key="i" :class="{active: active == item.index}" @click="jump(item)">
{{item.title}}
<ul :class="['children', {show: $route.path !== '/info/details' && active === '/info/list'}]" v-if="item.index === '/info/list'">
<li v-for="(column, i) in columns" :key="i" :class="{active: columnActive === column.id}" @click="toInfo($event, column)">{{ column.name }}</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</template> </template>
@ -68,14 +73,18 @@ export default {
title: "最近更新" title: "最近更新"
} }
], ],
menus: [] menus: [],
columns: [], //
columnActive: this.$route.query.parentId
}; };
}, },
mounted() { mounted() {
const path = this.$route.path const path = this.$route.path
this.menus = Setting.whiteList.find(e => e === path) ? this.touristMenu : this.loginedMenu this.menus = Setting.whiteList.find(e => e === path) ? this.touristMenu : this.loginedMenu
this.getColumns()
}, },
methods: { methods: {
//
jump(item) { jump(item) {
const { index } = item const { index } = item
// //
@ -92,10 +101,23 @@ export default {
location.reload() location.reload()
} else { } else {
this.active = index this.active = index
this.$router.push(index).catch(err => {}) this.columnActive = ''
index === '/info/list' || this.$router.push(index).catch(err => {})
token !== this.token && location.reload() // tokentoken token !== this.token && location.reload() // tokentoken
} }
} }
},
//
async getColumns() {
const res = await this.$get(this.api.firstLevelColumn)
this.columns = res.data
},
//
toInfo(e, column) {
e.stopPropagation()
const { id } = column
this.columnActive = id
this.$router.push(`/info?parentId=${id}&name=${column.name}`)
} }
} }
}; };
@ -103,25 +125,62 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.nav{ .nav{
position: absolute;
top: 0;
left: 50%;
display: flex;
transform: translateX(-50%);
& > li{
position: relative;
padding: 0 15px;
margin: 0 20px;
font-size: 16px;
line-height: 60px;
color: #3F3F3F;
white-space: nowrap;
cursor: pointer;
border-bottom: 4px solid transparent;
&.active{
color: $main-color;
border-bottom-color: $main-color;
}
}
.children {
position: absolute; position: absolute;
top: 0; top: 64px;
left: 50%; left: 50%;
display: flex; display: none;
background-color: #fff;
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.15);
transform: translateX(-50%); transform: translateX(-50%);
li{ &.show {
padding: 0 15px; display: flex;
margin: 0 20px; }
font-size: 16px; & > li {
line-height: 60px; padding: 0 20px;
color: #3F3F3F; margin: 0 20px;
white-space: nowrap; color: #333;
cursor: pointer; line-height: 64px;
border-bottom: 4px solid transparent; cursor: pointer;
&.active{ &:before {
color: $main-color; content: '';
border-bottom-color: $main-color; display: inline-block;
width: 3px;
height: 3px;
margin-right: 10px;
vertical-align: middle;
background-color: #333;
}
&.active {
color: $main-color;
&:before {
background-color: $main-color;
} }
}
} }
}
} }
@media (max-width: 1430px) { @media (max-width: 1430px) {
.nav { .nav {

@ -1,6 +1,6 @@
<template> <template>
<div class="wrap"> <div class="wrap">
<breadcrumb ref="breadcrumb" data="资讯"></breadcrumb> <breadcrumb ref="breadcrumb" data="资讯" :query="breadcrumbQuery"></breadcrumb>
<div class="page"> <div class="page">
<h6 class="title">{{title}}</h6> <h6 class="title">{{title}}</h6>
<div class="metas"> <div class="metas">
@ -29,6 +29,10 @@ export default {
return { return {
firstName: this.$route.query.first, firstName: this.$route.query.first,
secondName: this.$route.query.second, secondName: this.$route.query.second,
breadcrumbQuery: {
parentId: this.$route.query.parentId,
name: this.$route.query.first
},
id: this.$route.query.id, id: this.$route.query.id,
coverUrl: '', coverUrl: '',
author: '', author: '',

@ -10,26 +10,10 @@
:default-active="defaultIndex" :default-active="defaultIndex"
@select="initData"> @select="initData">
<template v-for="item in menuList"> <template v-for="item in menuList">
<template v-if="item.secondColumn.length"> <el-menu-item :index="item.id" :key="item.id">
<el-submenu :index="item.id" :key="item.id"> <i :class="item.icon"></i>
<template slot="title"> <span slot="title">{{ item.name }}</span>
<i :class="item.icon"></i> </el-menu-item>
<span slot="title">{{ item.name }}</span>
</template>
<template v-for="subItem in item.secondColumn">
<el-menu-item
:index="subItem.id"
:key="subItem.id"
>{{ subItem.name }}</el-menu-item>
</template>
</el-submenu>
</template>
<template v-else>
<el-menu-item :index="item.id" :key="item.id">
<i :class="item.icon"></i>
<span slot="title">{{ item.name }}</span>
</el-menu-item>
</template>
</template> </template>
</el-menu> </el-menu>
</div> </div>
@ -88,9 +72,7 @@ export default {
totals: 0, totals: 0,
listData: [], listData: [],
loadIns: null, loadIns: null,
columnId: '', columnId: ''
firstName: '',
secondName: ''
}; };
}, },
watch: { watch: {
@ -99,6 +81,9 @@ export default {
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.getData() this.getData()
},500) },500)
},
$route() {
this.getData()
} }
}, },
mounted() { mounted() {
@ -110,29 +95,25 @@ export default {
"setColumnId" "setColumnId"
]), ]),
getData() { getData() {
this.setColumnId(""); const parentId = this.$route.query.parentId
let data = { this.setColumnId('')
page: this.pageNo,
size: this.pageSize
}
this.loadIns = Loading.service() this.loadIns = Loading.service()
this.$get(this.api.queryAllColumns,data).then(res => { this.$get(this.api.secondaryColumnsByFirst, {
this.menuList = res.columnTree parentId
}).then(res => {
const { data } = res
this.menuList = data
// , // ,
if(this.historyId){ const historyId = this.historyId
this.defaultIndex = this.historyId if(historyId && data.find(e => e.id === historyId)){
this.getContent(this.historyId) this.defaultIndex = historyId
this.getContent(historyId)
}else{ }else{
// //
if(this.menuList[0].secondColumn.length){ const id = data.length ? data[0].id : parentId
this.getContent(this.menuList[0].secondColumn[0].id) this.getContent(id)
this.defaultIndex = this.menuList[0].secondColumn[0].id this.defaultIndex = id
}else{
this.getContent(this.menuList[0].id)
this.defaultIndex = this.menuList[0].id
}
} }
}).catch(res => { }).catch(res => {
this.loadIns.close() this.loadIns.close()
}); });
@ -144,28 +125,11 @@ export default {
getContent(index,indexPath){ getContent(index,indexPath){
if(indexPath) this.loadIns = Loading.service() if(indexPath) this.loadIns = Loading.service()
this.columnId = index this.columnId = index
let data = { this.$get(`${this.api.queryArticleByCondition}/${this.pageNo}/${this.pageSize}`, {
name: this.keyword, name: this.keyword,
columnId: index, columnId: index,
port: 0 port: 0
} }).then(res => {
let list = this.menuList
list.map(n => {
if(n.secondColumn.length){
n.secondColumn.map(e => {
if(e.id == index){
this.firstName = n.name
this.secondName = e.name
}
})
}else{
if(n.id == index){
this.firstName = n.name
this.secondName = ''
}
}
})
this.$get(`${this.api.queryArticleByCondition}/${this.pageNo}/${this.pageSize}`,data).then(res => {
this.listData = res.articleList this.listData = res.articleList
this.totals = res.total this.totals = res.total
this.listData.map(n => { this.listData.map(n => {
@ -181,8 +145,10 @@ export default {
this.getContent(this.columnId); this.getContent(this.columnId);
}, },
toArticle(id){ toArticle(id){
this.setColumnId(this.columnId); const columnId = this.columnId
this.$router.push(`/info/details?id=${id}&first=${this.firstName}&second=${this.secondName}`) const list = this.menuList
this.setColumnId(columnId)
this.$router.push(`/info/details?parentId=${this.$route.query.parentId}&id=${id}&first=${this.$route.query.name}&second=${list.length ? list.find(e => e.id === columnId).name : ''}`)
} }
} }
}; };

@ -68,7 +68,7 @@ export default {
}, },
toDetails(row) { toDetails(row) {
this.setCurriculum(this.curriculumId) this.setCurriculum(this.curriculumId)
this.$router.push(`/record/details?curriculumId=${this.curriculumId}&projectId=${row.projectId}`); this.$router.push(`/record/details?curriculumId=${this.$parent.curriculumList.find(e => e.curriculumName === row.curriculumName).cid}&projectId=${row.projectId}`);
} }
} }
}; };

@ -213,7 +213,27 @@ export default {
form.assessmentId && (this.breadPath = ['实验记录', '实验报告']) form.assessmentId && (this.breadPath = ['实验记录', '实验报告'])
}).catch(res => {}) }).catch(res => {})
}, },
exportPage() { // exportPage() {
const form = JSON.parse(JSON.stringify(this.form))
const list = JSON.parse(JSON.stringify(this.expData))
list.map((e, i) => {
e.id = i + 1
if (e.referenceAnswer && typeof e.referenceAnswer === 'string') e.referenceAnswer = e.referenceAnswer.replace(/<[^>]+>/g, '').replace(/(&nbsp;|&amp;|%s)/g, '').replace(/>/g, '&gt;').replace(/</g, '&lt;')
if (e.answer && typeof e.answer === 'string') e.answer = e.answer.replace(/<[^>]+>/g, '').replace(/(&nbsp;|&amp;|%s)/g, '').replace(/>/g, '&gt;').replace(/</g, '&lt;')
})
for (const i in form) {
if (form[i] && typeof form[i] === 'string') form[i] = form[i].replace(/<[^>]+>/g, '')
}
form.purpose = form.purpose.replace(/<[^>]+>/g, '')
this.$post(this.api.exportLabReport, {
...form,
experimentalData: list
}).then(res => {
console.log(res)
util.downloadFileDirect(`实验报告.docx`,new Blob([res]))
}).catch(res => {})
},
exportPage1() { //
this.loading = true; this.loading = true;
this.loadIns = Loading.service({ this.loadIns = Loading.service({
background: "#fff" background: "#fff"

@ -51,8 +51,8 @@
<el-date-picker size="small" placeholder="请选择时间" v-model="form.dateBirth" :clearable="false" type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd"></el-date-picker> <el-date-picker size="small" placeholder="请选择时间" v-model="form.dateBirth" :clearable="false" type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd"></el-date-picker>
</li> </li>
<li> <li>
<label></label> <label>身份</label>
<el-input size="small" placeholder="请输入证" v-model="form.idNumber" clearable></el-input> <el-input size="small" placeholder="请输入身份证" v-model="form.idNumber" clearable></el-input>
</li> </li>
</div> </div>
<div class="line info"> <div class="line info">
@ -64,7 +64,7 @@
</li> </li>
<li> <li>
<label>当前所在学校</label> <label>当前所在学校</label>
<el-input size="small" placeholder="请输入学校" v-model="form.schoolName" clearable></el-input> <el-input size="small" readonly placeholder="请输入学校" v-model="form.schoolName" clearable></el-input>
</li> </li>
</div> </div>
</ul> </ul>
@ -450,7 +450,7 @@ export default {
}).catch(res => {}) }).catch(res => {})
}, },
save() { save() {
if (this.form.idNumber && !/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/.test(this.form.idNumber)) return util.warningMsg("请输入正确的证号码"); if (this.form.idNumber && !/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/.test(this.form.idNumber)) return util.warningMsg("请输入正确的身份证号码");
let form = this.form; let form = this.form;
let personalFileList = [] let personalFileList = []
this.archivesList.forEach((n,k) => { this.archivesList.forEach((n,k) => {

@ -291,7 +291,7 @@ export default {
window.open(`https://danbao.czcyedu.com/#/loginFromYyyf?userId=${this.userId}&userName=${userName}&userType=${roleId}&reqType=1&reqId=eb7d8355119d449184c548b07dc01ed9&caseId=1198241070647873538&authorization=87DIVy348Oxzj3ha&classId=1876&courserId=faaedd82adb9444285a5785e4a3dd4f9`); window.open(`https://danbao.czcyedu.com/#/loginFromYyyf?userId=${this.userId}&userName=${userName}&userType=${roleId}&reqType=1&reqId=eb7d8355119d449184c548b07dc01ed9&caseId=1198241070647873538&authorization=87DIVy348Oxzj3ha&classId=1876&courserId=faaedd82adb9444285a5785e4a3dd4f9`);
} else { } else {
if(process.env.NODE_ENV === 'development') { if(process.env.NODE_ENV === 'development') {
href = 'http://192.168.1.125:8080/#/' href = 'http://192.168.31.125:8080/#/'
} else { } else {
href = `${location.origin}/pyTrials` // 8pythoncookiesystemId href = `${location.origin}/pyTrials` // 8pythoncookiesystemId
} }

Loading…
Cancel
Save