实验报告

20240205 20230705
yujialong 1 year ago
parent 2cf63091a1
commit a823365509
  1. 157
      src/App.vue
  2. 1518
      src/components/case/index.vue
  3. 380
      src/components/selectBusiness/index.vue
  4. 152
      src/layouts/header/index.vue
  5. 544
      src/pages/index/list/index.vue
  6. 653
      src/pages/report/index.vue

@ -1,84 +1,88 @@
<template> <template>
<div id="app" > <div id="app">
<select-business class="selectBusiness" :showIt.sync="showIt" v-show="!showIt && showBusiness" /> <select-business class="selectBusiness"
<router-view></router-view> :showIt.sync="showIt"
<vCase :showIt.sync="showIt"></vCase> v-show="!showIt && showBusiness" />
<tip-dialog class="Z-9999" /> <router-view></router-view>
</div> <vCase :showIt.sync="showIt"></vCase>
<tip-dialog class="Z-9999" />
</div>
</template> </template>
<script> <script>
import vCase from '@/components/case' import vCase from '@/components/case'
import Setting from '@/setting'; import Setting from '@/setting';
import util from '@/libs/util'; import util from '@/libs/util';
import selectBusiness from '@/components/selectBusiness' import selectBusiness from '@/components/selectBusiness'
import TipDialog from '@/components/tipDialog' import TipDialog from '@/components/tipDialog'
import { mapState, mapMutations } from 'vuex' import { mapState, mapMutations } from 'vuex'
export default { export default {
name: 'App', name: 'App',
components: { components: {
vCase, vCase,
selectBusiness, selectBusiness,
TipDialog TipDialog
}, },
created () { created () {
//localStorage //localStorage
if (util.local.get(Setting.storeKey) ) { if (util.local.get(Setting.storeKey)) {
this.$store.replaceState(Object.assign({}, this.$store.state,util.local.get(Setting.storeKey))) this.$store.replaceState(Object.assign({}, this.$store.state, util.local.get(Setting.storeKey)))
this.$store.system.replaceState(Object.assign({}, sessionStorage.getItem('systemData'))) this.$store.system.replaceState(Object.assign({}, sessionStorage.getItem('systemData')))
} }
//vuexlocalStorage //vuexlocalStorage
window.addEventListener("beforeunload",()=>{ window.addEventListener("beforeunload", () => {
if(this.$route.fullPath.includes('/counter/list/manage')) { if (this.$route.fullPath.includes('/counter/list/manage')) {
sessionStorage.setItem('computerPath', this.$route.fullPath) sessionStorage.setItem('computerPath', this.$route.fullPath)
} }
util.local.get(Setting.tokenKey) && util.local.set(Setting.storeKey,this.$store.state) util.local.get(Setting.tokenKey) && util.local.set(Setting.storeKey, this.$store.state)
sessionStorage.setItem('systemData', this.$store.system.state) sessionStorage.setItem('systemData', this.$store.system.state)
}) })
}, },
data() { data () {
return { return {
showIt: true, showIt: true,
showSelect: false showSelect: false
} }
}, },
methods: { methods: {
...mapMutations({ ...mapMutations({
setShowBusiness: 'system/setShowBusiness', setShowBusiness: 'system/setShowBusiness',
setTipsOperate: 'system/setTipsOperate' setTipsOperate: 'system/setTipsOperate'
}), }),
}, },
watch: { watch: {
showIt: { showIt: {
handler(newVal) { handler (newVal) {
if(!newVal && !this.businessKey) { console.log("🚀 ~ file: App.vue:58 ~ handler ~ newVal:", newVal, this.businessKey, sessionStorage.getItem('submited'))
this.setShowBusiness(true) if (!newVal && !this.businessKey && !sessionStorage.getItem('submited')) {
}else { this.setShowBusiness(true)
if(!newVal) { } else {
// if (!newVal) {
if(!this.businessKey) { //
this.$nextTick(() => { this.setShowBusiness(true) }) if (!this.businessKey && !sessionStorage.getItem('submited')) {
}else { console.log("🚀 ~ file: App.vue:65 ~ handler ~ submited:", sessionStorage.getItem('submited'))
// this.setTipsOperate('' + this.businessKey + ','); this.$nextTick(() => { this.setShowBusiness(true) })
} } else {
}else { // this.setTipsOperate('' + this.businessKey + ',');
this.$nextTick(() => { this.setShowBusiness(false) })
}
}
},
immediate: true
} }
}, } else {
computed: { this.$nextTick(() => { this.setShowBusiness(false) })
...mapState({ }
businessKey: state => state.system.businessKey, }
showBusiness: state => state.system.showBusiness, },
businessKey: state => state.system.businessKey immediate: true
})
},
} }
},
computed: {
...mapState({
businessKey: state => state.system.businessKey,
showBusiness: state => state.system.showBusiness,
businessKey: state => state.system.businessKey
})
},
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -91,11 +95,12 @@
height: 100%; height: 100%;
} }
.fade-enter-active, .fade-leave-active { .fade-enter-active,
transition: opacity .5s; .fade-leave-active {
transition: opacity 0.5s;
} }
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ { .fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
opacity: 0; opacity: 0;
} }
.Z-9999 { .Z-9999 {

File diff suppressed because it is too large Load Diff

@ -1,173 +1,190 @@
<template> <template>
<!-- 业务选择列表 --> <!-- 业务选择列表 -->
<el-dialog :visible="true" class="" :modal="false" @close="closeData" :close-on-click-modal="false" :show-close="false" custom-class="data-dia 2xl:w-7/12 xl:w-9/12 lg:w-full h-9/12"> <el-dialog :visible="true"
<div slot="title" class="dia-header2"> class=""
<div class="data-title2">业务选择</div> :modal="false"
<div class="close"><img v-lazy="closeImg" alt="" @click="showBusinessSelect(false)" /></div> @close="closeData"
</div> :close-on-click-modal="false"
<p class="tips2">请选择您要办理的业务:</p> :show-close="false"
<ul class="take-list2"> custom-class="data-dia 2xl:w-7/12 xl:w-9/12 lg:w-full h-9/12">
<li v-for="(item) in getBusinessSelectList" :class="{checked: takeCheck == item.myKey}" :key="item.myKey" @click="checkTake(item.myKey)"> <div slot="title"
<img v-lazy="businessImg" alt=""> class="dia-header2">
<p>{{ item.myKey + item.text}}</p> <div class="data-title2">业务选择</div>
</li> <div class="close"><img v-lazy="closeImg"
<li v-for="(item) in (3 - getBusinessSelectList.length%3)" class="sitting" :key="item"></li> alt=""
</ul> @click="showBusinessSelect(false)" /></div>
<div class="dia-footer2"> </div>
<div class='busyButtonBox'> <p class="tips2">请选择您要办理的业务:</p>
<el-button @click="showBusinessSelect(false)">取消</el-button> <ul class="take-list2">
<el-button type="primary" @click="selectBusiness()">确定</el-button> <li v-for="(item) in getBusinessSelectList"
</div> :class="{checked: takeCheck == item.myKey}"
</div> :key="item.myKey"
</el-dialog> @click="checkTake(item.myKey)">
<img v-lazy="businessImg"
alt="">
<p>{{ item.myKey + item.text}}</p>
</li>
<li v-for="(item) in (3 - getBusinessSelectList.length%3)"
class="sitting"
:key="item"></li>
</ul>
<div class="dia-footer2">
<div class='busyButtonBox'>
<el-button @click="showBusinessSelect(false)">取消</el-button>
<el-button type="primary"
@click="selectBusiness()">确定</el-button>
</div>
</div>
</el-dialog>
</template> </template>
<script> <script>
import { mapState, mapMutations, mapGetters } from 'vuex'; import { mapState, mapMutations, mapGetters } from 'vuex';
export default { export default {
props: { props: {
// showBusiness: { // showBusiness: {
// type: Boolean, // type: Boolean,
// default: false // default: false
// } // }
// default: '' // default: ''
},
mounted () {
if (this.businessKey) {
//
this.takeCheck = this.businessKey
}
},
data () {
return {
checkList: [],
takeCheck: '',
businessImg: require('@/assets/img/业务列表2.png'),
closeImg: require('@/assets/svg/close.svg'),
//
}
},
methods: {
...mapMutations({
setBusinessKey: 'system/setBusinessKey',
setShowBusiness: 'system/setShowBusiness',
setTipsOperate: 'system/setTipsOperate',
}),
closeData () {
this.checkList = [];
}, },
mounted() { // /
if(this.businessKey) { showBusinessSelect (judge) {
// //
this.takeCheck = this.businessKey if (!judge && !this.businessKey) {
} this.$confirm('由于您未选择一个业务,这将回到业务列表,是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
center: true,
type: 'warning'
}).then(() => {
this.$emit('update:showIt', true)
this.setShowBusiness(false)
}).catch(() => {
this.$message({
type: 'info',
message: '请选择一个业务'
});
});
return
}
this.setShowBusiness(judge)
//
this.setTipsOperate('您正在进行' + this.businessKey + ',加油!');
}, },
data() { checkTake (myKey) {
return { //
checkList: [], if (this.takeCheck === myKey) {
takeCheck: '', this.takeCheck = ''
businessImg: require('@/assets/img/业务列表2.png'), } else {
closeImg: require('@/assets/svg/close.svg'), this.takeCheck = myKey
// }
}
}, },
methods: { selectBusiness () {
...mapMutations({ //
setBusinessKey: 'system/setBusinessKey', if (!this.takeCheck) {
setShowBusiness: 'system/setShowBusiness', this.$message({
setTipsOperate: 'system/setTipsOperate', type: 'info',
}), message: '请选择一个业务'
closeData() { });
this.checkList = []; return
}, }
// / // systemselectBusinessid
showBusinessSelect (judge) { this.setBusinessKey(this.takeCheck)
// // this.$store.dispatch('system/getJudgeData')
if(!judge && !this.businessKey) { // id
this.$confirm('由于您未选择一个业务,这将回到业务列表,是否继续?', '提示', { if (!this.$store.state.system.businessSelect[this.$store.state.system.businessKey].id) {
confirmButtonText: '确定', this.$message({
cancelButtonText: '取消', type: 'info',
center: true, message: '业务开发中,尽请期待!'
type: 'warning' });
}).then(() => { return
this.$emit('update:showIt', true) }
this.setShowBusiness(false)
}).catch(() => {
this.$message({
type: 'info',
message: '请选择一个业务'
});
});
return
}
this.setShowBusiness(judge)
//
this.setTipsOperate('您正在进行' + this.businessKey + ',加油!');
},
checkTake(myKey){
//
if(this.takeCheck === myKey) {
this.takeCheck = ''
}else {
this.takeCheck = myKey
}
},
selectBusiness() {
//
if(!this.takeCheck) {
this.$message({
type: 'info',
message: '请选择一个业务'
});
return
}
// systemselectBusinessid
this.setBusinessKey(this.takeCheck)
// this.$store.dispatch('system/getJudgeData')
// id
if(!this.$store.state.system.businessSelect[this.$store.state.system.businessKey].id) {
this.$message({
type: 'info',
message: '业务开发中,尽请期待!'
});
return
}
// //
this.setShowBusiness(false) this.setShowBusiness(false)
// clearStore // clearStore
let systemData = sessionStorage.getItem('systemData') let systemData = sessionStorage.getItem('systemData')
let token = sessionStorage.getItem('token') let token = sessionStorage.getItem('token')
let cid = sessionStorage.getItem('cid') let cid = sessionStorage.getItem('cid')
let systemId = sessionStorage.getItem('systemId') let systemId = sessionStorage.getItem('systemId')
let projectId = sessionStorage.getItem('projectId') let projectId = sessionStorage.getItem('projectId')
let assessmentId = sessionStorage.getItem('assessmentId') let assessmentId = sessionStorage.getItem('assessmentId')
let classId = sessionStorage.getItem('classId') let classId = sessionStorage.getItem('classId')
let timestamp = sessionStorage.getItem('timestamp') let timestamp = sessionStorage.getItem('timestamp')
let startTime = sessionStorage.getItem('startTime') let startTime = sessionStorage.getItem('startTime')
const storeProjectId = sessionStorage.getItem('storeProjectId') const storeProjectId = sessionStorage.getItem('storeProjectId')
sessionStorage.clear() sessionStorage.clear()
sessionStorage.setItem('token', token) sessionStorage.setItem('token', token)
sessionStorage.setItem('cid', cid) sessionStorage.setItem('cid', cid)
sessionStorage.setItem('systemId', systemId) sessionStorage.setItem('systemId', systemId)
sessionStorage.setItem('projectId', projectId) sessionStorage.setItem('projectId', projectId)
if(assessmentId) { sessionStorage.removeItem('submited')
sessionStorage.setItem('assessmentId', assessmentId) if (assessmentId) {
} sessionStorage.setItem('assessmentId', assessmentId)
if(classId) { }
sessionStorage.setItem('classId', classId) if (classId) {
} sessionStorage.setItem('classId', classId)
if(timestamp) { }
sessionStorage.setItem('timestamp', timestamp) if (timestamp) {
} sessionStorage.setItem('timestamp', timestamp)
if(startTime) { }
sessionStorage.setItem('startTime', startTime) if (startTime) {
} sessionStorage.setItem('startTime', startTime)
if(storeProjectId) { }
sessionStorage.setItem('storeProjectId', storeProjectId) if (storeProjectId) {
} sessionStorage.setItem('storeProjectId', storeProjectId)
}
// sessionStorage.setItem('systemData', systemData) // sessionStorage.setItem('systemData', systemData)
sessionStorage.setItem('businessKey', this.$store.state.system.businessKey) sessionStorage.setItem('businessKey', this.$store.state.system.businessKey)
},
}, },
computed: { },
...mapState({ computed: {
showBusiness: state => state.system.showBusiness, ...mapState({
businessKey: state => state.system.businessKey showBusiness: state => state.system.showBusiness,
}), businessKey: state => state.system.businessKey
...mapGetters({ }),
getBusinessSelectList: 'system/getBusinessSelectList' ...mapGetters({
}) getBusinessSelectList: 'system/getBusinessSelectList'
}, })
watch: { },
showBusiness(newVal) { watch: {
console.log('what') showBusiness (newVal) {
if(newVal) { console.log('what')
this.takeCheck = this.businessKey if (newVal) {
} this.takeCheck = this.businessKey
} }
} }
}
} }
</script> </script>
@ -187,7 +204,7 @@ export default {
max-height: 600px; max-height: 600px;
overflow: auto; overflow: auto;
// //
.take-list2{ .take-list2 {
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
@ -195,30 +212,30 @@ export default {
flex-wrap: wrap; flex-wrap: wrap;
height: 40vh; height: 40vh;
overflow: auto; overflow: auto;
li{ li {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
width: 30%; width: 30%;
height: 10vh; height: 10vh;
font-size: 16px; font-size: 16px;
margin: 1vh 0; margin: 1vh 0;
border: 4px solid #DBDBDB; border: 4px solid #dbdbdb;
border-radius: 20px; border-radius: 20px;
cursor: pointer; cursor: pointer;
background-color: rgba(216,216,216,0.10); background-color: rgba(216, 216, 216, 0.1);
// &:first-child{ // &:first-child{
// margin: 0 0px 50px 0; // margin: 0 0px 50px 0;
// } // }
// &:last-child{ // &:last-child{
// margin-left: 50px; // margin-left: 50px;
// } // }
img{ img {
width: 15%; width: 15%;
margin: 0; margin: 0;
//height: 154px; //height: 154px;
//margin: 0 45px; //margin: 0 45px;
} }
p{ p {
font-size: 16px; font-size: 16px;
color: #000; color: #000;
text-align: left; text-align: left;
@ -231,27 +248,28 @@ export default {
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical -webkit-box-orient: vertical;
} }
&.checked{ &.checked {
background: rgba(97,145,255,0.10) url('../../assets/svg/checked.svg') 96% 7%/auto no-repeat; background: rgba(97, 145, 255, 0.1) url('../../assets/svg/checked.svg') 96% 7% / auto no-repeat;
border-color: #6191FF; border-color: #6191ff;
} }
} }
} }
.dia-header2 { .dia-header2 {
position: relative;height: 50px; position: relative;
height: 50px;
line-height: 50px; line-height: 50px;
background-color: rgb(98, 149, 243) ; background-color: rgb(98, 149, 243);
border-top-left-radius:14px; border-top-left-radius: 14px;
border-top-right-radius:14px; border-top-right-radius: 14px;
.data-title2 { .data-title2 {
position: absolute; position: absolute;
left: 15px; left: 15px;
height: 50px; height: 50px;
font-size: 16px; font-size: 16px;
line-height: 50px; line-height: 50px;
color:#fff; color: #fff;
} }
.close { .close {
height: 50px; height: 50px;
@ -280,7 +298,7 @@ export default {
margin: 0 auto; margin: 0 auto;
display: flex; display: flex;
align-items: center; align-items: center;
.img-wrap{ .img-wrap {
background: url('../../assets/img/data-frame.png') 0 0 / cover no-repeat; background: url('../../assets/img/data-frame.png') 0 0 / cover no-repeat;
width: 180px; width: 180px;
height: 180px; height: 180px;
@ -294,7 +312,7 @@ export default {
max-width: 180px; max-width: 180px;
max-height: 130px; max-height: 130px;
text-align: center; text-align: center;
margin: 10px 10px ; margin: 10px 10px;
img { img {
margin-top: 45px; margin-top: 45px;
} }
@ -308,13 +326,13 @@ export default {
color: #000; color: #000;
} }
} }
.text{ .text {
font-size: 18px; font-size: 18px;
white-space:nowrap; white-space: nowrap;
position: absolute; position: absolute;
bottom: 15px; bottom: 15px;
left: 50%; left: 50%;
transform: translate(-50%,0); transform: translate(-50%, 0);
} }
&.checked { &.checked {
background: url('../../assets/img/data-frame-checked.png') 0 0 / cover no-repeat, background: url('../../assets/img/data-frame-checked.png') 0 0 / cover no-repeat,
@ -325,19 +343,19 @@ export default {
} }
} }
} }
.seal{ .seal {
width: 1100px; width: 1100px;
padding: 0 5%; padding: 0 5%;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.box{ .box {
border: 2px solid #e6e6e6; border: 2px solid #e6e6e6;
width: 45%; width: 45%;
min-height: 300px; min-height: 300px;
border-radius: 10px; border-radius: 10px;
padding: 10px; padding: 10px;
} }
.left{ .left {
display: flex; display: flex;
width: 50%; width: 50%;
flex-wrap: wrap; flex-wrap: wrap;
@ -349,14 +367,14 @@ export default {
background: url('../../assets/img/data-frame.png') 0 0 / cover no-repeat; background: url('../../assets/img/data-frame.png') 0 0 / cover no-repeat;
cursor: pointer; cursor: pointer;
margin: 5px 7px; margin: 5px 7px;
img{ img {
width: 130px; width: 130px;
max-height: 90px; max-height: 90px;
} }
&:last-child { &:last-child {
margin-right: 0; margin-right: 0;
} }
&:nth-child(n>1){ &:nth-child(n > 1) {
margin-top: 0; margin-top: 0;
} }
img { img {
@ -394,10 +412,10 @@ export default {
} }
} }
} }
.right{ .right {
margin-left: 5%; margin-left: 5%;
} }
.else{ .else {
width: 100%; width: 100%;
} }
} }
@ -416,6 +434,6 @@ export default {
.sitting { .sitting {
opacity: 0; opacity: 0;
cursor: default!important; cursor: default !important;
} }
</style> </style>

@ -1,91 +1,97 @@
<template> <template>
<div class="header" ref="exitHeader"> <div class="header"
<div class="inner" style="width: 100%"> ref="exitHeader">
<div class="logo" @click="toIndex" style="float: left"> <div class="inner"
<img src="../../assets/img/logo.png" alt=""> style="width: 100%">
</div> <div class="logo"
<div style="float: right;margin:0 60px;font-size: 18px"> @click="toIndex"
<span style="cursor:pointer" @click="exit"> style="float: left">
退出<i class="icon el-icon-s-unfold"></i> <img src="../../assets/img/logo.png"
</span> alt="">
</div> </div>
</div> <div style="float: right;margin:0 60px;font-size: 18px">
<span style="cursor:pointer"
@click="exit">
退出<i class="icon el-icon-s-unfold"></i>
</span>
</div>
</div> </div>
</div>
</template> </template>
<script> <script>
import { mapState,mapActions } from 'vuex' import { mapState, mapActions } from 'vuex'
import Setting from '@/setting' import Setting from '@/setting'
import util from '@/libs/util' import util from '@/libs/util'
import Cookie from 'js-cookie' import Cookie from 'js-cookie'
export default { export default {
data() { data () {
return { return {
token: util.local.get(Setting.tokenKey), token: util.local.get(Setting.tokenKey),
}; };
},
mounted () {
this.$route.query.manager && Cookie.set('manager', 1)
},
methods: {
toIndex () {
this.$refs.nav.jump({
index: '/index/list',
title: '首页'
})
}, },
mounted(){ exit () {
this.$route.query.manager && Cookie.set('manager', 1) const url = location.href
let href = process.env.NODE_ENV === 'development' ?
`http://${location.hostname}:8082/#/` :
`${url.includes('huorantech.cn') ? `https://www.occupationlab.com` : location.origin}${Cookie.get('manager') ?
'/admin' :
(url.includes('huorantech.cn') || url.includes('izhixinyun.com')) ?
'' :
'/student'}/#/`
let assessmentId = sessionStorage.getItem('assessmentId')
if (assessmentId != 'null' && assessmentId != null && assessmentId != '') {
href += `ass/list`
} else {
const cid = sessionStorage.getItem('cid')
href += `station/preview?courseId=${cid}&curriculumName=银行项目`
}
location.href = href
}, },
methods: { },
toIndex(){ watch: {
this.$refs.nav.jump({ '$route.path': {
index: '/index/list', handler (newVal) {
title: '首页' this.$nextTick(() => {
}) console.log(newVal)
}, if (newVal === '/index/list') {
exit(){ this.$refs.exitHeader.style.backgroundColor = 'rgb(250, 250, 250)'
const url = location.href } else {
let href = process.env.NODE_ENV === 'development' ? this.$refs.exitHeader.style.backgroundColor = 'rgb(244, 245, 248)'
`http://${location.hostname}:8082/#/` : }
`${url.includes('huorantech.cn') ? `http://www.occupationlab.com` : location.origin}${Cookie.get('manager') ? })
'/admin' :
(url.includes('huorantech.cn') || url.includes('izhixinyun.com')) ?
'' :
'/student'}/#/`
let assessmentId = sessionStorage.getItem('assessmentId')
if (assessmentId != 'null' && assessmentId != null && assessmentId != ''){
href += `ass/list`
}else{
const cid = sessionStorage.getItem('cid')
href += `station/preview?courseId=${cid}&curriculumName=银行项目`
}
location.href = href
}, },
}, immediate: true
watch: {
'$route.path': {
handler(newVal) {
this.$nextTick(() => {
console.log(newVal)
if(newVal === '/index/list') {
this.$refs.exitHeader.style.backgroundColor = 'rgb(250, 250, 250)'
}else {
this.$refs.exitHeader.style.backgroundColor = 'rgb(244, 245, 248)'
}
})
},
immediate: true
}
} }
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.header{ .header {
width:100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
position: relative; position: relative;
height: 68px; height: 68px;
// background-color: #fff; // background-color: #fff;
background-color: rgb(244,245,248); background-color: rgb(244, 245, 248);
z-index: 1001; z-index: 1001;
.logo{ .logo {
width: 500px; width: 500px;
margin-left: 42px; margin-left: 42px;
cursor: pointer; cursor: pointer;
img{ img {
width: 100%; width: 100%;
}
} }
} }
}
</style> </style>

@ -1,300 +1,320 @@
<template> <template>
<div class="wrap"> <div class="wrap">
<img class="sth bg" src="@/assets/img/index-bg.png" alt=""> <img class="sth bg"
<div class="case" @click="setShowBusiness(true)">业务选择</div> src="@/assets/img/index-bg.png"
alt="">
<div class="case"
@click="setShowBusiness(true)">业务选择</div>
<!-- 业务选择 --弹框 -->
<!-- 业务选择 --弹框 --> <div class="sth integrated-counter cp">
<img width="100%"
v-lazy="lazy1"
<div class="sth integrated-counter cp"> alt=""
<img width="100%" v-lazy="lazy1" alt="" @click="toPart('/counter')"> @click="toPart('/counter')">
<!-- src="@/assets/img/integrated-counter.png" --> <!-- src="@/assets/img/integrated-counter.png" -->
<div class="name" @click="toPart('/counter')">综合柜台</div> <div class="name"
</div> @click="toPart('/counter')">综合柜台</div>
</div>
<div class="sth international cp">
<!-- <img width="100%" v-lazy="lazy1" alt="" @click="toPart('/counter')"> -->
<img width="100%" v-lazy="lazy2" alt="" @click="showComing" />
<!-- src="@/assets/img/integrated-counter.png" -->
<!-- <div class="name" @click="showComing">国际结算部</div> -->
</div>
<!-- <img class="sth international cp" v-lazy="lazy2" alt="" @click="showComing"> --> <div class="sth international cp">
<div class="sth manager cp" @click="toPart('/lobbyManager')"> <!-- <img width="100%" v-lazy="lazy1" alt="" @click="toPart('/counter')"> -->
<img width="100%" v-lazy="lazy3" alt=""> <img width="100%"
<div class="name">大堂经理</div> v-lazy="lazy2"
</div> alt=""
@click="showComing" />
<!-- src="@/assets/img/integrated-counter.png" -->
<!-- <div class="name" @click="showComing">国际结算部</div> -->
</div>
<img class="sth credit-dep cp" v-lazy="lazy4" alt="" @click="showComing"> <!-- <img class="sth international cp" v-lazy="lazy2" alt="" @click="showComing"> -->
<img class="sth company-finance cp" v-lazy="lazy5" alt="" @click="showComing"> <div class="sth manager cp"
<img class="sth personal-finance cp" v-lazy="lazy6" alt="" @click="showComing"> @click="toPart('/lobbyManager')">
<img width="100%"
v-lazy="lazy3"
alt="">
<div class="name">大堂经理</div>
</div>
<img class="sth credit-dep cp"
v-lazy="lazy4"
alt=""
@click="showComing">
<img class="sth company-finance cp"
v-lazy="lazy5"
alt=""
@click="showComing">
<img class="sth personal-finance cp"
v-lazy="lazy6"
alt=""
@click="showComing">
<div class="coming" :class="{active: comingVisible}"> <div class="coming"
<div style="width: 20%;margin: auto"> :class="{active: comingVisible}">
<img style="width: 100%" v-lazy="lazy7" alt=""> <div style="width: 20%;margin: auto">
</div> <img style="width: 100%"
<p class="text">敬请期待</p> v-lazy="lazy7"
</div> alt="">
</div>
<p class="text">敬请期待</p>
</div> </div>
</div>
</template> </template>
<script> <script>
import { mapMutations, mapState } from 'vuex'; import { mapMutations, mapState } from 'vuex';
import saveSystemModule from '@/mixins/saveSystemModule' import saveSystemModule from '@/mixins/saveSystemModule'
export default { export default {
name: 'index', name: 'index',
mixins: [ saveSystemModule ], mixins: [saveSystemModule],
data() { data () {
return { return {
caseVisible: true, caseVisible: true,
comingVisible: false, comingVisible: false,
timer: null, timer: null,
lazy1: require('@/assets/img/integrated-counter.png'), lazy1: require('@/assets/img/integrated-counter.png'),
lazy2: require('@/assets/img/international.png'), lazy2: require('@/assets/img/international.png'),
lazy3: require('@/assets/img/manager-index.png'), lazy3: require('@/assets/img/manager-index.png'),
lazy4: require('@/assets/img/credit-dep.png'), lazy4: require('@/assets/img/credit-dep.png'),
lazy5: require('@/assets/img/company-finance.png'), lazy5: require('@/assets/img/company-finance.png'),
lazy6: require('@/assets/img/personal-finance.png'), // @/assets/svg/coming.svg lazy6: require('@/assets/img/personal-finance.png'), // @/assets/svg/coming.svg
lazy7: require('@/assets/svg/coming.svg') lazy7: require('@/assets/svg/coming.svg')
} }
}, },
created() { created () {
if(!sessionStorage.getItem('firstLoad2')) { if (!sessionStorage.getItem('firstLoad2')) {
const loading = this.$loading({ const loading = this.$loading({
lock: true, lock: true,
// text: 'Loading', // text: 'Loading',
text: '努力加载中,请稍等...', text: '努力加载中,请稍等...',
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}); });
setTimeout(() => { setTimeout(() => {
loading.close(); loading.close();
sessionStorage.setItem('firstLoad2', true) sessionStorage.setItem('firstLoad2', true)
}, 1000); }, 1000);
} }
if(!this.businessKey) { if (!this.businessKey) {
this.setShowBusiness(true) this.setShowBusiness(true)
} }
}, },
mounted() { mounted () {
let token = this.getQueryVariable('token') let token = this.getQueryVariable('token')
let cid = this.getQueryVariable('cid') let cid = this.getQueryVariable('cid')
let systemId = this.getQueryVariable('systemId') let systemId = this.getQueryVariable('systemId')
let stopTime = this.getQueryVariable('stopTime') let stopTime = this.getQueryVariable('stopTime')
let timestamp =+stopTime; let timestamp = +stopTime;
if (token != null){ if (token != null) {
sessionStorage.setItem('token', token) sessionStorage.setItem('token', token)
sessionStorage.setItem('cid', cid) sessionStorage.setItem('cid', cid)
sessionStorage.setItem('systemId', systemId) sessionStorage.setItem('systemId', systemId)
sessionStorage.setItem('timestamp', timestamp) sessionStorage.setItem('timestamp', timestamp)
}
},
computed: {
...mapState({
showBusiness: state => state.system.showBusiness,
businessKey: state => state.system.businessKey
})
},
methods: {
...mapMutations({
setShowBusiness: 'system/setShowBusiness'
}),
getQueryVariable (name) {
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)')
if (window.location.href.split('?')[1]) {
var r = window.location.href.split('?')[1].match(reg)
if (r != null) {
return (r[2])
} else {
return null
} }
}
}, },
computed: { toPart (path) {
...mapState({ this.$router.push(path)
showBusiness: state => state.system.showBusiness,
businessKey: state => state.system.businessKey
})
}, },
methods: { showComing () {
...mapMutations({ this.comingVisible = true
setShowBusiness: 'system/setShowBusiness' clearTimeout(this.timer)
}), this.timer = setTimeout(() => {
getQueryVariable(name) { this.comingVisible = false
var reg = new RegExp('(^|&)'+name+'=([^&]*)(&|$)') }, 1500)
if( window.location.href.split('?')[1]){
var r = window.location.href.split('?')[1].match(reg)
if (r != null){
return (r[2])
}else{
return null
}
}
},
toPart(path){
this.$router.push(path)
},
showComing(){
this.comingVisible = true
clearTimeout(this.timer)
this.timer = setTimeout(() => {
this.comingVisible = false
},1500)
}
} }
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
// //
@mixin nameTip { @mixin nameTip {
width: 200px; width: 200px;
height: 70px; height: 70px;
line-height: 60px; line-height: 60px;
text-align: center; text-align: center;
font-size: 20px; font-size: 20px;
background: url(../../../assets/img/index-btn-bg.png); background: url(../../../assets/img/index-btn-bg.png);
// background-position: center center; // background-position: center center;
background-size: 100%; background-size: 100%;
color: #fff; color: #fff;
border-radius: 16px; border-radius: 16px;
// box-shadow: 0 6px 8px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04); // box-shadow: 0 6px 8px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
z-index: 100; z-index: 100;
} }
.wrap{ .wrap {
position: relative; position: relative;
min-height: calc(100vh - 68px); min-height: calc(100vh - 68px);
.sth{ .sth {
position: absolute; position: absolute;
&.cp{ &.cp {
cursor: pointer; cursor: pointer;
}
}
.bg{
top: 0;
left: 0;
width: 100%;
height: 100%;
} }
.integrated-counter{ }
top: -14%; .bg {
left: 24%; top: 0;
width: 43%; left: 0;
transition: all .5s; width: 100%;
&:hover{ height: 100%;
margin-top: -10px; }
} .integrated-counter {
.name{ top: -14%;
position: absolute; left: 24%;
top: 23%; width: 43%;
left: 20%; transition: all 0.5s;
@include nameTip; &:hover {
} margin-top: -10px;
} }
.international{ .name {
top: -9%; position: absolute;
left: 72%; top: 23%;
width: 28%; left: 20%;
transition: all .5s; @include nameTip;
// &:hover{
// margin-top: -10px;
// }
// img{
// transition: all .5s;
// &:hover{
// margin-top: -10px;
// }
// }
.name{
position: absolute;
top: 23%;
right: 0;
@include nameTip;
}
} }
.manager{ }
bottom: 0; .international {
left: 57%; top: -9%;
width: 39%; left: 72%;
transition: all .5s; width: 28%;
&:hover{ transition: all 0.5s;
bottom: 10px; // &:hover{
} // margin-top: -10px;
.name { // }
position: absolute; // img{
top: 65%; // transition: all .5s;
left: 37%; // &:hover{
@include nameTip; // margin-top: -10px;
} // }
// }
.name {
position: absolute;
top: 23%;
right: 0;
@include nameTip;
} }
.credit-dep{ }
top: 31%; .manager {
left: 0; bottom: 0;
width: 20%; left: 57%;
transition: all .5s; width: 39%;
// &:hover{ transition: all 0.5s;
// top: 29%; &:hover {
// } bottom: 10px;
} }
.company-finance{ .name {
top: 52%; position: absolute;
left: 9%; top: 65%;
width: 28%; left: 37%;
transition: all .5s; @include nameTip;
// &:hover{
// top: 50%;
// }
} }
.personal-finance{ }
bottom: 0; .credit-dep {
left: 25%; top: 31%;
width: 30%; left: 0;
transition: all .5s; width: 20%;
// &:hover{ transition: all 0.5s;
// bottom: 10px; // &:hover{
// } // top: 29%;
// }
}
.company-finance {
top: 52%;
left: 9%;
width: 28%;
transition: all 0.5s;
// &:hover{
// top: 50%;
// }
}
.personal-finance {
bottom: 0;
left: 25%;
width: 30%;
transition: all 0.5s;
// &:hover{
// bottom: 10px;
// }
}
.case {
position: absolute;
top: 92px;
left: 150px;
width: 150px;
height: 50px;
line-height: 50px;
text-align: center;
color: #fff;
font-size: 24px;
background: url(../../../assets/img/case.png) 0 0 / cover no-repeat;
background-size: 150px 50px;
cursor: pointer;
// &:hover{
// top: 76px;
// }
}
@media (max-width: 1440px) {
.credit-dep {
top: 32%;
} }
.case{ .company-finance {
position: absolute; top: 53%;
top: 92px;
left: 150px;
width: 150px;
height: 50px;
line-height: 50px;
text-align: center;
color: #fff;
font-size: 24px;
background: url(../../../assets/img/case.png) 0 0 /cover no-repeat;
background-size: 150px 50px;
cursor: pointer;
// &:hover{
// top: 76px;
// }
} }
@media(max-width: 1440px){ .personal-finance {
.credit-dep{ top: 72%;
top: 32%;
}
.company-finance{
top: 53%;
}
.personal-finance{
top: 72%;
}
.integrated-counter{
width: 44%;
}
} }
@media(max-width: 1300px){ .integrated-counter {
& { width: 44%;
min-height: calc(100vh - 76px);
}
} }
} }
.coming{ @media (max-width: 1300px) {
position: fixed; & {
top: -200%; min-height: calc(100vh - 76px);
left: 50%;
width: 376px;
padding: 40px 0;
text-align: center;
transform: translate(-50%,-50%);
border-radius: 16px;
background-color: rgba(0,0,0,0.80);
transition: all .3s;
&.active{
top: 50%;
}
.text{
margin-top: 24px;
font-size: 22px;
font-weight: 400;
color: #fff;
} }
} }
}
.coming {
position: fixed;
top: -200%;
left: 50%;
width: 376px;
padding: 40px 0;
text-align: center;
transform: translate(-50%, -50%);
border-radius: 16px;
background-color: rgba(0, 0, 0, 0.8);
transition: all 0.3s;
&.active {
top: 50%;
}
.text {
margin-top: 24px;
font-size: 22px;
font-weight: 400;
color: #fff;
}
}
</style> </style>

@ -1,142 +1,216 @@
<template> <template>
<!-- 实验报告 --> <!-- 实验报告 -->
<div class="wrap"> <div class="wrap">
<breadcrumb data="返回实验/我的数据"></breadcrumb> <breadcrumb data="返回实验/实验报告"></breadcrumb>
<div class="content" :class="{loading}" id="pdfDom"> <div class="content"
<div style="text-align: right" v-if="!loading"> :class="{loading}"
<el-button size="mini" @click="editReport"> id="pdfDom">
{{ editing ? "保存" : "编辑" }} <div style="text-align: right"
</el-button> v-if="!loading">
<el-button type="primary" size="mini" @click="exportPage">导出报告</el-button> <el-button size="mini"
</div> @click="editReport">
<h6 class="r-title">标准实验报告</h6> {{ editing ? "保存" : "编辑" }}
<div class="info"> </el-button>
<h6 class="l-title"> <el-button type="primary"
<img src="@/assets/img/report1.png" alt=""> size="mini"
基本信息 @click="exportPage">导出报告</el-button>
</h6> </div>
<ul :class="['info-list', {edit: editing}]"> <h6 class="r-title">标准实验报告</h6>
<li> <div class="info">
<label>学生姓名</label> <h6 class="l-title">
<el-input v-if="editing" v-model="infoData.userName" disabled></el-input> <img src="@/assets/img/report1.png"
<span v-else>{{ infoData.userName }}</span> alt="">
</li> 基本信息
<li> </h6>
<label>学生学号</label> <ul :class="['info-list', {edit: editing}]">
<el-input v-if="editing" v-model="infoData.workNumber" disabled></el-input> <li>
<span v-else>{{ infoData.workNumber }}</span> <label>学生姓名</label>
</li> <el-input v-if="editing"
<li> v-model="infoData.userName"
<label>实验时间</label> disabled></el-input>
<el-input v-if="editing" v-model="infoData.submitTime" disabled></el-input> <span v-else>{{ infoData.userName }}</span>
<span v-else>{{ infoData.submitTime }}</span> </li>
</li> <li>
<li> <label>学生学号</label>
<label>实验成绩</label> <el-input v-if="editing"
<el-input v-if="editing" v-model="infoData.score" disabled></el-input> v-model="infoData.workNumber"
<div v-else class="score-wrap"> disabled></el-input>
<em>{{ infoData.score }}</em> <span v-else>{{ infoData.workNumber }}</span>
<img src="@/assets/img/point.png" alt=""> </li>
</div> <li>
</li> <label>实验时间</label>
<li> <el-input v-if="editing"
<label>学生班级</label> v-model="infoData.submitTime"
<el-input v-if="editing" v-model="infoData.className"></el-input> disabled></el-input>
<span v-else>{{ infoData.className }}</span> <span v-else>{{ infoData.submitTime }}</span>
</li> </li>
<li> <li>
<label>指导老师</label> <label>实验成绩</label>
<el-input v-if="editing" v-model="infoData.instructor"></el-input> <el-input v-if="editing"
<span v-else>{{ infoData.instructor }}</span> v-model="infoData.score"
</li> disabled></el-input>
<li> <div v-else
<label>实验学时</label> class="score-wrap">
<el-input v-if="editing" v-model="infoData.period"></el-input> <em>{{ infoData.score }}</em>
<span v-else>{{ infoData.period }}</span> <img src="@/assets/img/point.png"
</li> alt="">
</ul> </div>
<div class="m-b-20"> </li>
<h6 class="l-title"> <li>
<img src="@/assets/img/report2.png" alt=""> <label>学生班级</label>
实验项目名称 <el-input v-if="editing"
</h6> v-model="infoData.className"></el-input>
<el-input v-if="editing" v-model="infoData.projectName" type="textarea"></el-input> <span v-else>{{ infoData.className }}</span>
<div v-else class="pre-wrap" v-html="infoData.projectName"></div> </li>
</div> <li>
<div class="m-b-20"> <label>指导老师</label>
<h6 class="l-title"> <el-input v-if="editing"
<img src="@/assets/img/report3.png" alt=""> v-model="infoData.instructor"></el-input>
实验目的 <span v-else>{{ infoData.instructor }}</span>
</h6> </li>
<quill v-if="editing" :border="true" v-model="infoData.purpose" :height="150" /> <li>
<div v-else :class="['pre-wrap', {edit: editing}]" v-html="infoData.purpose"></div> <label>实验学时</label>
</div> <el-input v-if="editing"
<div class="m-b-20"> v-model="infoData.period"></el-input>
<h6 class="l-title"> <span v-else>{{ infoData.period }}</span>
<img src="@/assets/img/report4.png" alt=""> </li>
实验数据 </ul>
</h6> <div class="m-b-20">
<el-table :data="expData" class="table" border stripe header-align="center"> <h6 class="l-title">
<el-table-column type="index" label="序号" align="center" width="60"> <img src="@/assets/img/report2.png"
<template slot-scope="scope"> alt="">
{{ scope.$index + 1 }} 实验项目名称
</template> </h6>
</el-table-column> <el-input v-if="editing"
<el-table-column prop="judgmentName" label="判分点" width="270" align="center"></el-table-column> v-model="infoData.projectName"
<el-table-column v-if='project' prop="judgmentName" label="考核点" align="center" width="150"> type="textarea"></el-input>
<template slot-scope="scope"> <div v-else
<div v-for="(item, index) in scope.row.lcRuleRecords" :key="index"> class="pre-wrap"
<span> v-html="infoData.projectName"></div>
<span>{{index+1}}. </span>{{item.name}} </div>
</span> <div class="m-b-20">
</div> <h6 class="l-title">
</template> <img src="@/assets/img/report3.png"
</el-table-column> alt="">
<el-table-column prop="ruleAnswer" label="参考答案" style='word-wrap: break-word'> 实验目的
<template slot-scope="scope"> </h6>
<div v-if='scope.row.lcRuleRecords'> <quill v-if="editing"
<div v-for="(item, index) in scope.row.lcRuleRecords" :key="index"> :border="true"
<span> v-model="infoData.purpose"
<span>{{index+1}}. </span>{{item.ruleAnswer}} :height="150" />
</span> <div v-else
</div> :class="['pre-wrap', {edit: editing}]"
</div> v-html="infoData.purpose"></div>
<div v-else v-html="scope.row.referenceAnswer"></div> </div>
</template> <div class="m-b-20">
</el-table-column> <h6 class="l-title">
<el-table-column prop="userAnswer" label="学生答案"> <img src="@/assets/img/report4.png"
<template slot-scope="scope"> alt="">
<div v-if='scope.row.lcRuleRecords'> 实验数据
<div v-for="(item, index) in scope.row.lcRuleRecords" :key="index"> </h6>
<span v-if='item.userAnswer'> <el-table :data="expData"
<span>{{index+1}}. </span>{{item.userAnswer}} class="table"
</span> border
<span v-else> stripe
<span>{{index+1}}. </span>未填写 header-align="center">
</span> <el-table-column type="index"
</div> label="序号"
</div> align="center"
<div v-else v-html='scope.row.answer' style='white-space: pre-wrap'></div> width="60">
<template v-if="scope.row.runThePictureList"> <template slot-scope="scope">
<img v-for="(img, i) in scope.row.runThePictureList" :key="i" width="200" class="result-pic" :src="img" alt=""> {{ scope.$index + 1 }}
</template> </template>
</template> </el-table-column>
</el-table-column> <el-table-column prop="judgmentName"
<el-table-column prop="quesScore" label="分值" width="80" align="center"></el-table-column> label="判分点"
<el-table-column prop="score" label="得分" width="80" align="center"></el-table-column> width="200"
</el-table> align="center"></el-table-column>
</div> <el-table-column v-if='project'
<div class="m-b-20"> prop="judgmentName"
<h6 class="l-title"> label="考核点"
<img src="@/assets/img/report5.png" alt=""> align="center"
实验总结与体会 width="150">
</h6> <template slot-scope="scope">
<quill v-show="editing" :border="true" v-model="infoData.summarize" :height="150" /> <div v-for="(item, index) in scope.row.lcRuleRecords"
<div v-show="!editing" class="pre-wrap" v-html="infoData.summarize"></div> :key="index">
</div> <span>
</div> <span>{{index+1}}. </span>{{item.name}}
</span>
</div>
</template>
</el-table-column>
<el-table-column prop="ruleAnswer"
label="参考答案"
width="280"
style='word-wrap: break-word'>
<template slot-scope="scope">
<div v-if='scope.row.lcRuleRecords'>
<div v-for="(item, index) in scope.row.lcRuleRecords"
:key="index">
<span>
<span>{{index+1}}. </span>{{item.ruleAnswer}}
</span>
</div>
</div>
<div v-else
v-html="scope.row.referenceAnswer"></div>
</template>
</el-table-column>
<el-table-column prop="userAnswer"
width="280"
label="学生答案">
<template slot-scope="scope">
<div v-if='scope.row.lcRuleRecords'>
<div v-for="(item, index) in scope.row.lcRuleRecords"
:key="index">
<span v-if='item.userAnswer'>
<span>{{index+1}}. </span>{{item.userAnswer}}
</span>
<span v-else>
<span>{{index+1}}. </span>未填写
</span>
</div>
</div>
<div v-else
v-html='scope.row.answer'
style='white-space: pre-wrap'></div>
<template v-if="scope.row.runThePictureList">
<img v-for="(img, i) in scope.row.runThePictureList"
:key="i"
width="200"
class="result-pic"
:src="img"
alt="">
</template>
</template>
</el-table-column>
<el-table-column prop="quesScore"
label="分值"
width="80"
align="center"></el-table-column>
<el-table-column prop="score"
label="得分"
width="80"
align="center"></el-table-column>
</el-table>
</div>
<div class="m-b-20">
<h6 class="l-title">
<img src="@/assets/img/report5.png"
alt="">
实验总结与体会
</h6>
<quill v-show="editing"
:border="true"
v-model="infoData.summarize"
:height="150" />
<div v-show="!editing"
class="pre-wrap"
v-html="infoData.summarize"></div>
</div>
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>
@ -144,153 +218,149 @@ import { Loading } from "element-ui";
import util from '@/libs/util' import util from '@/libs/util'
import breadcrumb from '@/components/breadcrumb' import breadcrumb from '@/components/breadcrumb'
import quill from "@/components/quill"; import quill from "@/components/quill";
import {reportDetail,exportBankExperimentReport,updateReport} from "@/api/http.js"; import { reportDetail, exportBankExperimentReport, updateReport } from "@/api/http.js";
export default { export default {
data() { data () {
return { return {
reportId: this.$route.query.reportId, reportId: this.$route.query.reportId,
title: "实验报告", title: "实验报告",
form: {}, form: {},
infoData: {}, infoData: {},
expData: [], expData: [],
editing: false, editing: false,
loadIns: null, loadIns: null,
loading: false, loading: false,
project:false, project: false,
userScores: [] userScores: []
}; };
},
components: {
breadcrumb,
quill
},
mounted () {
this.getData()
},
methods: {
getData () { //
const { reportId } = this
reportDetail(reportId).then(({ data }) => {
const { report, userScores } = data
this.form = report
const form = this.form
this.infoData = {
reportId,
className: form.className,
workNumber: form.workNumber,
experimentalClassName: form.experimentalClassName,
instructor: form.instructor,
period: form.period,
laboratory: form.laboratory,
submitTime: form.submitTime,
score: form.score,
userName: form.userName,
projectName: form.projectName,
purpose: form.purpose,
summarize: form.summarize
}
const expData = report.data
this.userScores = userScores
// data使
if (!expData) {
this.handleList(userScores)
this.$post(this.api.editExperimentalData, {
reportId,
data: JSON.stringify(userScores)
}).then(res => { }).catch(err => { })
} else {
this.handleList(userScores)
}
}).catch(res => { })
}, },
components: { //
breadcrumb, handleList (list) {
quill 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.expData = list
}, },
mounted() { exportPage () {
this.getData() const form = Object.assign(this.form, this.infoData)
const list = JSON.parse(JSON.stringify(this.expData))
list.map((e, i) => {
const item = this.userScores.find(n => n.judgmentId == e.judgmentId)
if (item && item.runThePicture) e.runThePicture = item.runThePicture
if (item && item.runThePictureList) e.runThePictureList = item.runThePictureList
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.loading = true;
this.loadIns = Loading.service({
background: "#fff"
});
exportBankExperimentReport({
...form,
experimentalData: list
}).then(res => {
this.loadIns.close();
this.loading = false;
util.downloadFileDirect(`实验报告.docx`, new Blob([res.data]))
}).catch(res => {
this.loadIns.close();
this.loading = false;
})
}, },
methods: { editReport () { //
getData() { // if (this.editing) {
const { reportId } = this updateReport(this.infoData).then(res => {
reportDetail({ this.editing = false;
reportId this.$message.success('修改成功')
}).then((data)=>{ }).catch(err => { });
console.log(33, data) } else {
// this.$get(`${this.api.reportDetail}?reportId=${reportId}`).then(({ report, userScores }) => { this.editing = true;
this.form = report }
const form = this.form
this.infoData = {
reportId,
className: form.className,
workNumber: form.workNumber,
experimentalClassName: form.experimentalClassName,
instructor: form.instructor,
period: form.period,
laboratory: form.laboratory,
submitTime: form.submitTime,
score: form.score,
userName: form.userName,
projectName: form.projectName,
purpose: form.purpose,
summarize: form.summarize
}
// const data = report.data
// this.userScores = userScores
// // data使
// if (!data) {
// this.handleList(userScores)
// this.$post(this.api.editExperimentalData, {
// reportId,
// data: JSON.stringify(userScores)
// }).then(res => {}).catch(err => {})
// } else {
// this.handleList(userScores.find(e => e.lcRuleRecords) ? userScores : JSON.parse(data))
// }
}).catch(res => {})
},
//
handleList(list) {
this.project = list.find(e => e.lcRuleRecords) // lcRuleRecords
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.expData = list
},
exportPage() {
const form = Object.assign(this.form, this.infoData)
const list = JSON.parse(JSON.stringify(this.expData))
list.map((e, i) => {
const item = this.userScores.find(n => n.judgmentId == e.judgmentId)
if (item && item.runThePicture) e.runThePicture = item.runThePicture
if (item && item.runThePictureList) e.runThePictureList = item.runThePictureList
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.loading = true;
this.loadIns = Loading.service({
background: "#fff"
});
this.$post(this.project ? this.api.exportBankExperimentReport : this.api.exportLabReport, {
...form,
experimentalData: list
}).then(res => {
this.loadIns.close();
this.loading = false;
util.downloadFileDirect(`实验报告.docx`,new Blob([res]))
}).catch(res => {
this.loadIns.close();
this.loading = false;
})
},
editReport() { //
if (this.editing) {
this.$post(`${this.api.updateReport}`, this.infoData).then(res => {
this.editing = false;
this.$message.success('修改成功')
}).catch(err => {});
} else {
this.editing = true;
}
}
} }
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.m-b-20 { .m-b-20 {
margin-bottom: 20px; margin-bottom: 20px;
} }
.wrap { .wrap {
padding: 12px 300px 20px; padding: 12px 300px 20px;
} }
code, kbd, samp{ code,
font-family: 'PingFang SC', "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif; kbd,
samp {
font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, 'microsoft yahei', arial, STHeiTi, sans-serif;
word-wrap: break-word; word-wrap: break-word;
white-space: pre-wrap; white-space: pre-wrap;
} }
/deep/ pre{ /deep/ pre {
white-space: pre-wrap; /* css-3 */ white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: pre-wrap; /* Opera 4-6 */ white-space: pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */ white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */ word-wrap: break-word; /* Internet Explorer 5.5+ */
word-break:break-all; word-break: break-all;
overflow:hidden; overflow: hidden;
font-size: 12px; font-size: 12px;
font-weight:400; font-weight: 400;
font-family:'PingFang SC', "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, 'microsoft yahei', arial, STHeiTi, sans-serif;
} }
.content { .content {
padding: 16px 0; padding: 16px 0;
@ -306,19 +376,19 @@ code, kbd, samp{
} }
.info { .info {
padding: 20px 16px; padding: 20px 16px;
border: 1px solid #E1E6F2; border: 1px solid #e1e6f2;
} }
.l-title{ .l-title {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 5px 8px; padding: 5px 8px;
margin-bottom: 12px; margin-bottom: 12px;
font-size: 14px; font-size: 14px;
color: #333; color: #333;
background-color: #F7F9FC; background-color: #f7f9fc;
img{ img {
margin-right: 5px; margin-right: 5px;
} }
} }
.info-list { .info-list {
display: flex; display: flex;
@ -343,7 +413,7 @@ code, kbd, samp{
span { span {
min-width: 150px; min-width: 150px;
padding: 0 10px 3px; padding: 0 10px 3px;
border-bottom: 1px solid #E1E6F2; border-bottom: 1px solid #e1e6f2;
} }
/deep/.el-input { /deep/.el-input {
width: 174px; width: 174px;
@ -352,7 +422,7 @@ code, kbd, samp{
.score-wrap { .score-wrap {
position: relative; position: relative;
min-width: 150px; min-width: 150px;
border-bottom: 1px solid #E1E6F2; border-bottom: 1px solid #e1e6f2;
em { em {
position: absolute; position: absolute;
top: -12px; top: -12px;
@ -360,7 +430,7 @@ code, kbd, samp{
font-family: din; font-family: din;
font-size: 30px; font-size: 30px;
font-weight: 600; font-weight: 600;
color: #0B1D30; color: #0b1d30;
} }
img { img {
position: absolute; position: absolute;
@ -368,16 +438,17 @@ code, kbd, samp{
left: 0; left: 0;
} }
} }
/deep/.el-textarea .el-textarea__inner, .pre-wrap { /deep/.el-textarea .el-textarea__inner,
.pre-wrap {
min-height: 72px; min-height: 72px;
padding: 10px 16px; padding: 10px 16px;
font-size: 14px; font-size: 14px;
color: #333; color: #333;
&.edit { &.edit {
color: #ABB3C6; color: #abb3c6;
border: 1px solid #CACFDB; border: 1px solid #cacfdb;
border-radius: 4px; border-radius: 4px;
background-color: #F6F7F9; background-color: #f6f7f9;
} }
} }
/deep/ .table th { /deep/ .table th {
@ -388,8 +459,20 @@ code, kbd, samp{
} }
} }
} }
/deep/ .el-table {
width: 100%;
.el-table__header-wrapper table,
.el-table__body-wrapper table {
width: 100% !important;
}
.el-table__body,
.el-table__footer,
.el-table__header {
table-layout: auto;
}
}
.result-pic { .result-pic {
margin: 10px 0; margin: 10px 0;
} }
@media (max-width: 1650px) { @media (max-width: 1650px) {
.wrap { .wrap {

Loading…
Cancel
Save