导出实验报告等

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

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

@ -1,7 +1,12 @@
<template>
<div>
<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>
</div>
</template>
@ -68,14 +73,18 @@ export default {
title: "最近更新"
}
],
menus: []
menus: [],
columns: [], //
columnActive: this.$route.query.parentId
};
},
mounted() {
const path = this.$route.path
this.menus = Setting.whiteList.find(e => e === path) ? this.touristMenu : this.loginedMenu
this.getColumns()
},
methods: {
//
jump(item) {
const { index } = item
//
@ -92,10 +101,23 @@ export default {
location.reload()
} else {
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
}
}
}
},
//
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>
.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;
top: 0;
top: 64px;
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%);
li{
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;
&.show {
display: flex;
}
& > li {
padding: 0 20px;
margin: 0 20px;
color: #333;
line-height: 64px;
cursor: pointer;
&:before {
content: '';
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) {
.nav {

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

@ -10,26 +10,10 @@
:default-active="defaultIndex"
@select="initData">
<template v-for="item in menuList">
<template v-if="item.secondColumn.length">
<el-submenu :index="item.id" :key="item.id">
<template slot="title">
<i :class="item.icon"></i>
<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>
<el-menu-item :index="item.id" :key="item.id">
<i :class="item.icon"></i>
<span slot="title">{{ item.name }}</span>
</el-menu-item>
</template>
</el-menu>
</div>
@ -88,9 +72,7 @@ export default {
totals: 0,
listData: [],
loadIns: null,
columnId: '',
firstName: '',
secondName: ''
columnId: ''
};
},
watch: {
@ -99,6 +81,9 @@ export default {
this.searchTimer = setTimeout(() => {
this.getData()
},500)
},
$route() {
this.getData()
}
},
mounted() {
@ -110,29 +95,25 @@ export default {
"setColumnId"
]),
getData() {
this.setColumnId("");
let data = {
page: this.pageNo,
size: this.pageSize
}
const parentId = this.$route.query.parentId
this.setColumnId('')
this.loadIns = Loading.service()
this.$get(this.api.queryAllColumns,data).then(res => {
this.menuList = res.columnTree
this.$get(this.api.secondaryColumnsByFirst, {
parentId
}).then(res => {
const { data } = res
this.menuList = data
// ,
if(this.historyId){
this.defaultIndex = this.historyId
this.getContent(this.historyId)
const historyId = this.historyId
if(historyId && data.find(e => e.id === historyId)){
this.defaultIndex = historyId
this.getContent(historyId)
}else{
//
if(this.menuList[0].secondColumn.length){
this.getContent(this.menuList[0].secondColumn[0].id)
this.defaultIndex = this.menuList[0].secondColumn[0].id
}else{
this.getContent(this.menuList[0].id)
this.defaultIndex = this.menuList[0].id
}
const id = data.length ? data[0].id : parentId
this.getContent(id)
this.defaultIndex = id
}
}).catch(res => {
this.loadIns.close()
});
@ -144,28 +125,11 @@ export default {
getContent(index,indexPath){
if(indexPath) this.loadIns = Loading.service()
this.columnId = index
let data = {
this.$get(`${this.api.queryArticleByCondition}/${this.pageNo}/${this.pageSize}`, {
name: this.keyword,
columnId: index,
port: 0
}
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 => {
}).then(res => {
this.listData = res.articleList
this.totals = res.total
this.listData.map(n => {
@ -181,8 +145,10 @@ export default {
this.getContent(this.columnId);
},
toArticle(id){
this.setColumnId(this.columnId);
this.$router.push(`/info/details?id=${id}&first=${this.firstName}&second=${this.secondName}`)
const columnId = this.columnId
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) {
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 = ['实验记录', '实验报告'])
}).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.loadIns = Loading.service({
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>
</li>
<li>
<label></label>
<el-input size="small" placeholder="请输入证" v-model="form.idNumber" clearable></el-input>
<label>身份</label>
<el-input size="small" placeholder="请输入身份证" v-model="form.idNumber" clearable></el-input>
</li>
</div>
<div class="line info">
@ -64,7 +64,7 @@
</li>
<li>
<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>
</div>
</ul>
@ -450,7 +450,7 @@ export default {
}).catch(res => {})
},
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 personalFileList = []
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`);
} else {
if(process.env.NODE_ENV === 'development') {
href = 'http://192.168.1.125:8080/#/'
href = 'http://192.168.31.125:8080/#/'
} else {
href = `${location.origin}/pyTrials` // 8pythoncookiesystemId
}

Loading…
Cancel
Save