yujialong 4 years ago
parent 97d2f4fb4a
commit 8818e0bea3
  1. 151
      package-lock.json
  2. 1
      package.json
  3. 2
      src/layouts/navbar/index.vue
  4. 4
      src/libs/util.js
  5. 25
      src/mixins/examDo/index.js
  6. 77
      src/mixins/file/index.js
  7. 41
      src/pages/achievement/assessment/index.vue
  8. 34
      src/pages/achievement/practice/index.vue
  9. 15
      src/pages/exam/do/index.vue
  10. 2
      src/pages/exam/list/index.vue
  11. 15
      src/pages/practice/do/index.vue
  12. 7
      src/pages/setting/person/index.vue
  13. 8
      src/styles/pages/testPaperDetail.scss

151
package-lock.json generated

@ -1018,6 +1018,11 @@
"@types/node": "*" "@types/node": "*"
} }
}, },
"@types/json-schema": {
"version": "7.0.7",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz",
"integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA=="
},
"@types/minimatch": { "@types/minimatch": {
"version": "3.0.3", "version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",
@ -1568,8 +1573,7 @@
"ajv-keywords": { "ajv-keywords": {
"version": "3.4.1", "version": "3.4.1",
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz",
"integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==", "integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ=="
"dev": true
}, },
"alphanum-sort": { "alphanum-sort": {
"version": "1.0.2", "version": "1.0.2",
@ -1998,6 +2002,11 @@
"resolve": "^1.4.0" "resolve": "^1.4.0"
} }
}, },
"babel-plugin-syntax-dynamic-import": {
"version": "6.18.0",
"resolved": "https://registry.npmjs.org/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz",
"integrity": "sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo="
},
"babel-polyfill": { "babel-polyfill": {
"version": "6.26.0", "version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz",
@ -9154,6 +9163,11 @@
"sha.js": "^2.4.8" "sha.js": "^2.4.8"
} }
}, },
"pdfjs-dist": {
"version": "2.5.207",
"resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-2.5.207.tgz",
"integrity": "sha512-xGDUhnCYPfHy+unMXCLCJtlpZaaZ17Ew3WIL0tnSgKFUZXHAPD49GO9xScyszSsQMoutNDgRb+rfBXIaX/lJbw=="
},
"performance-now": { "performance-now": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
@ -10233,6 +10247,76 @@
"unpipe": "1.0.0" "unpipe": "1.0.0"
} }
}, },
"raw-loader": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-4.0.2.tgz",
"integrity": "sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA==",
"requires": {
"loader-utils": "^2.0.0",
"schema-utils": "^3.0.0"
},
"dependencies": {
"ajv": {
"version": "6.12.6",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
"requires": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
}
},
"ajv-keywords": {
"version": "3.5.2",
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ=="
},
"emojis-list": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz",
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q=="
},
"fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
},
"json5": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz",
"integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==",
"requires": {
"minimist": "^1.2.5"
}
},
"loader-utils": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
},
"schema-utils": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz",
"integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==",
"requires": {
"@types/json-schema": "^7.0.6",
"ajv": "^6.12.5",
"ajv-keywords": "^3.5.2"
}
}
}
},
"read-pkg": { "read-pkg": {
"version": "5.2.0", "version": "5.2.0",
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz",
@ -12616,6 +12700,44 @@
"vue-style-loader": "^4.1.0" "vue-style-loader": "^4.1.0"
} }
}, },
"vue-pdf": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/vue-pdf/-/vue-pdf-4.2.0.tgz",
"integrity": "sha512-GpAbZfM48Hom1R8f4XL5ZzoVBLlbyy+4z0VYmTQORVOSieVIIu+XtnNl0RY6EXg60Qni6T6nIgrmsCcCkWv39A==",
"requires": {
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"loader-utils": "^1.4.0",
"pdfjs-dist": "^2.5.207",
"raw-loader": "^4.0.1",
"vue-resize-sensor": "^2.0.0",
"worker-loader": "^2.0.0"
},
"dependencies": {
"emojis-list": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz",
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q=="
},
"json5": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
"requires": {
"minimist": "^1.2.0"
}
},
"loader-utils": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz",
"integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==",
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^1.0.1"
}
}
}
},
"vue-quill-editor": { "vue-quill-editor": {
"version": "3.0.6", "version": "3.0.6",
"resolved": "https://registry.npmjs.org/vue-quill-editor/-/vue-quill-editor-3.0.6.tgz", "resolved": "https://registry.npmjs.org/vue-quill-editor/-/vue-quill-editor-3.0.6.tgz",
@ -12625,6 +12747,11 @@
"quill": "^1.3.4" "quill": "^1.3.4"
} }
}, },
"vue-resize-sensor": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/vue-resize-sensor/-/vue-resize-sensor-2.0.0.tgz",
"integrity": "sha512-W+y2EAI/BxS4Vlcca9scQv8ifeBFck56DRtSwWJ2H4Cw1GLNUYxiZxUHHkuzuI5JPW/cYtL1bPO5xPyEXx4LmQ=="
},
"vue-router": { "vue-router": {
"version": "3.1.3", "version": "3.1.3",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.1.3.tgz", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.1.3.tgz",
@ -13105,6 +13232,26 @@
"errno": "~0.1.7" "errno": "~0.1.7"
} }
}, },
"worker-loader": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/worker-loader/-/worker-loader-2.0.0.tgz",
"integrity": "sha512-tnvNp4K3KQOpfRnD20m8xltE3eWh89Ye+5oj7wXEEHKac1P4oZ6p9oTj8/8ExqoSBnk9nu5Pr4nKfQ1hn2APJw==",
"requires": {
"loader-utils": "^1.0.0",
"schema-utils": "^0.4.0"
},
"dependencies": {
"schema-utils": {
"version": "0.4.7",
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz",
"integrity": "sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==",
"requires": {
"ajv": "^6.1.0",
"ajv-keywords": "^3.1.0"
}
}
}
},
"wrap-ansi": { "wrap-ansi": {
"version": "6.2.0", "version": "6.2.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",

@ -20,6 +20,7 @@
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-cropperjs": "^3.0.0", "vue-cropperjs": "^3.0.0",
"vue-i18n": "^8.10.0", "vue-i18n": "^8.10.0",
"vue-pdf": "^4.2.0",
"vue-quill-editor": "^3.0.6", "vue-quill-editor": "^3.0.6",
"vue-router": "^3.0.3", "vue-router": "^3.0.3",
"vue-schart": "^2.0.0", "vue-schart": "^2.0.0",

@ -15,7 +15,7 @@ export default {
{ {
icon: 'el-icon-folder-checked', icon: 'el-icon-folder-checked',
index: '/index/list', index: '/index/list',
title: '首页' title: '我的首页'
}, },
{ {
icon: 'el-icon-lx-home', icon: 'el-icon-lx-home',

@ -85,6 +85,10 @@ const util = {
}) })
return list return list
}, },
// 传入文件名获取文件后缀
getFileExt(fileName) {
return fileName.substring(fileName.lastIndexOf('.') + 1)
},
} }
export default util export default util

@ -69,23 +69,19 @@ export default {
) )
}, },
beforeUpload(file,item){ beforeUpload(file,item){
if(util.isDoc(file.name.substring(file.name.lastIndexOf('.') + 1)) && (file.size / 1024 / 1024) > this.maxSize){ let ext = util.getFileExt(file.name)
if(util.isDoc(ext) && (file.size / 1024 / 1024) > this.maxSize){
this.$message.error(`请上传${this.maxSize}M以内的文件`) this.$message.error(`请上传${this.maxSize}M以内的文件`)
return false return false
} }
item.fileName = file.name
console.log('上传前:',item,file)
}, },
uploadSuccess(res, file, fileList, item) { uploadSuccess(res, file, fileList, item) {
console.log('上传成功:',res, file, fileList, item)
let ext = file.response.data.filesResult.fileType let ext = file.response.data.filesResult.fileType
item.fileExt = ext
if(util.isVideo(ext)){ if(util.isVideo(ext)){
item.video = res.data.filesResult.fileId item.video[file.name] = res.data.filesResult.fileId
}else{ }else{
item.fileUrl = res.data.filesResult.fileUrl item.fileUrl[file.name] = res.data.filesResult.fileUrl
} }
console.log('上传成功:',item)
}, },
uploadError(err, file, fileList) { uploadError(err, file, fileList) {
this.$message({ this.$message({
@ -98,18 +94,15 @@ export default {
return this.$confirm(`确定移除 ${file.name}`) return this.$confirm(`确定移除 ${file.name}`)
}, },
handleRemove(file, fileList, item) { handleRemove(file, fileList, item) {
console.log('删除:',item) if(util.isVideo(util.getFileExt(file.name))){
if(util.isVideo(item.fileExt)){ this.$del(`${this.api.removeVideo}/${item.video[file.name]}`).then(res => {
this.$del(`${this.api.removeVideo}/${item.video}`).then(res => { delete item.video[file.name]
item.video = ''
}).catch(res => {}) }).catch(res => {})
}else{ }else{
console.log('删除前:',item.fileUrl) let fileName = item.fileUrl[file.name].replace('https://cj-oss.oss-cn-guangzhou.aliyuncs.com/','')
let fileName = item.fileUrl.replace('https://cj-oss.oss-cn-guangzhou.aliyuncs.com/','')
console.log('删除前:',fileName)
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
item.fileUrl = '' delete item.fileUrl[file.name]
}).catch(res => {}) }).catch(res => {})
} }
}, },

@ -0,0 +1,77 @@
import util from '@/libs/util'
export default {
data() {
return {
playAuth: '',
player: null,
iframeSrc: '',
pdfVisible: false,
pdfSrc: '',
imgName: '',
imgSrc: ''
}
},
mounted() {
this.insertScript()
},
methods: {
preview(url,isVideo){
let ext = util.getFileExt(url)
if(isVideo){
this.$get(`${this.api.getPlayAuth}/${url}`).then(res => {
this.playAuth = res.data.playAuth
if(this.player){
this.player.replayByVidAndPlayAuth(url,this.playAuth)
}else{
this.player = new Aliplayer({
id: 'player',
width: '100%',
autoplay: false,
vid : url,
playauth : this.playAuth,
encryptType:1, //当播放私有加密流时需要设置。
})
}
}).catch(res => {})
}else if(ext == 'pdf'){
this.pdfSrc = url
this.pdfVisible = true
}else if(util.isDoc(ext)){
window.open(`https://view.officeapps.live.com/op/view.aspx?src=${url}`)
}else if(util.isImg(ext)){
window.open(url)
}
},
insertScript(){
const linkTag = document.createElement('link')
linkTag.id = 'aliplayerLink'
linkTag.rel = 'stylesheet'
linkTag.href = 'https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css'
document.body.appendChild(linkTag)
const scriptTag = document.createElement('script')
scriptTag.id = 'aliplayerScript'
scriptTag.type = 'text/javascript'
scriptTag.src = 'https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js'
document.body.appendChild(scriptTag)
this.$once('hook:beforeDestroy', function () {
document.body.removeChild(document.querySelector('#aliplayerLink'))
document.body.removeChild(document.querySelector('#aliplayerScript'))
})
},
closePlayer(){
this.playAuth = ''
this.player.pause()
},
download(fileName,url){
let ext = util.getFileExt(url)
if(util.isImg(ext)){
this.imgName = fileName
this.imgSrc = url
this.$refs.picLink.click()
}else{
window.open(url)
}
}
}
}

@ -58,19 +58,46 @@
<p class="val">{{item.user_answer}}</p> <p class="val">{{item.user_answer}}</p>
</div> </div>
</div> </div>
<div class="meta" v-if="item.typeName == '简答题'">
<p class="key">附件</p>
<div class="val">
<template v-if="item.fileUrl">
<div v-for="(url,fileName) in item.fileUrl" :key="fileName">
<el-button type="text" @click="preview(url,0)">{{fileName}}</el-button>
<el-button type="primary" size="mini" @click="download(fileName,url)">下载</el-button>
</div>
</template>
<template v-if="item.videoAudio">
<div v-for="(url,fileName) in item.videoAudio" :key="fileName">
<el-button type="text" @click="preview(url,1)">{{fileName}}</el-button>
<!-- <el-button type="primary" size="mini" @click="download(url)">下载</el-button> -->
</div>
</template>
</div>
</div>
<div class="meta"> <div class="meta">
<p class="key">答案解析</p> <p class="key">答案解析</p>
<p class="val" v-html="item.answer_analysis"></p> <p class="val" v-html="item.answer_analysis"></p>
</div> </div>
</div> </div>
</div> </div>
<div v-show="playAuth" class="el-image-viewer__wrapper" :class="{active: playAuth}" style="z-index: 2000">
<div class="el-image-viewer__mask"></div>
<span class="el-image-viewer__btn el-image-viewer__close" @click="closePlayer"><i class="el-icon-circle-close" style="color: #fff"></i></span>
<div class="player" id="player"></div>
</div>
<pdf :visible.sync="pdfVisible" :src.sync="pdfSrc"></pdf>
<a ref="picLink" style="display: none;" crossOrigin="anonymous" download="用户上传图片.png" :href="imgSrc">下载图片</a>
</div> </div>
</template> </template>
<script> <script>
import mixins from '@/mixins/setBackground' import setBackground from '@/mixins/setBackground'
import file from '@/mixins/file'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import pdf from '@/components/pdf'
export default { export default {
mixins: [ mixins ], mixins: [ setBackground,file ],
data() { data() {
return { return {
paperName: '', paperName: '',
@ -104,6 +131,7 @@ export default {
curType: [] curType: []
}; };
}, },
components: { pdf },
computed: { computed: {
...mapState('user', [ ...mapState('user', [
'userId' 'userId'
@ -122,7 +150,14 @@ export default {
this.paperName = res.paperName this.paperName = res.paperName
this.time = res.time this.time = res.time
this.ranking = res.ranking this.ranking = res.ranking
this.allData = res.data let list = res.data
for(let i in list){
list[i].map(n => {
if(n.fileUrl) n.fileUrl = JSON.parse(n.fileUrl)
if(n.videoAudio) n.videoAudio = JSON.parse(n.videoAudio)
})
}
this.allData = list
let tabs = this.tabs let tabs = this.tabs
res.data.list1.length && (tabs[0].show = true) res.data.list1.length && (tabs[0].show = true)
res.data.list2.length && (tabs[1].show = true) res.data.list2.length && (tabs[1].show = true)

@ -54,19 +54,46 @@
<p class="val">{{item.userAnswer}}</p> <p class="val">{{item.userAnswer}}</p>
</div> </div>
</div> </div>
<div class="meta" v-if="item.isSub">
<p class="key">附件</p>
<div class="val">
<template v-if="item.fileUrl">
<div v-for="(url,fileName) in item.fileUrl" :key="fileName">
<el-button type="text" @click="preview(url,0)">{{fileName}}</el-button>
<el-button type="primary" size="mini" @click="download(fileName,url)">下载</el-button>
</div>
</template>
<template v-if="item.videoAudio">
<div v-for="(url,fileName) in item.videoAudio" :key="fileName">
<el-button type="text" @click="preview(url,1)">{{fileName}}</el-button>
<!-- <el-button type="primary" size="mini" @click="download(url)">下载</el-button> -->
</div>
</template>
</div>
</div>
<div class="meta"> <div class="meta">
<p class="key">答案解析</p> <p class="key">答案解析</p>
<p class="val" v-html="item.answerAnalysis"></p> <p class="val" v-html="item.answerAnalysis"></p>
</div> </div>
</div> </div>
</div> </div>
<div v-show="playAuth" class="el-image-viewer__wrapper" :class="{active: playAuth}" style="z-index: 2000">
<div class="el-image-viewer__mask"></div>
<span class="el-image-viewer__btn el-image-viewer__close" @click="closePlayer"><i class="el-icon-circle-close" style="color: #fff"></i></span>
<div class="player" id="player"></div>
</div>
<pdf :visible.sync="pdfVisible" :src.sync="pdfSrc"></pdf>
<a ref="picLink" style="display: none;" crossOrigin="anonymous" download="用户上传图片.png" :href="imgSrc">下载图片</a>
</div> </div>
</template> </template>
<script> <script>
import mixins from '@/mixins/setBackground' import setBackground from '@/mixins/setBackground'
import file from '@/mixins/file'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import pdf from '@/components/pdf'
export default { export default {
mixins: [ mixins ], mixins: [ setBackground,file ],
data() { data() {
return { return {
paperName: '', paperName: '',
@ -102,6 +129,7 @@ export default {
curType: [] curType: []
}; };
}, },
components: { pdf },
computed: { computed: {
...mapState('user', [ ...mapState('user', [
'userId' 'userId'
@ -129,6 +157,8 @@ export default {
n.answer = answer.join('|') n.answer = answer.join('|')
n.userAnswer = n.userAnswer ? n.userAnswer.replace(/&lt;&gt;/g,'|') : '' n.userAnswer = n.userAnswer ? n.userAnswer.replace(/&lt;&gt;/g,'|') : ''
} }
if(n.fileUrl) n.fileUrl = JSON.parse(n.fileUrl)
if(n.videoAudio) n.videoAudio = JSON.parse(n.videoAudio)
}) })
this.list = data.list this.list = data.list
let tabs = this.tabs let tabs = this.tabs

@ -79,7 +79,6 @@
:on-error="uploadError" :on-error="uploadError"
:on-success="(res, file, fileList) => uploadSuccess(res, file, fileList, item)" :on-success="(res, file, fileList) => uploadSuccess(res, file, fileList, item)"
:before-remove="beforeRemove" :before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed" :on-exceed="handleExceed"
:action="api.fileupload" :action="api.fileupload"
> >
@ -282,6 +281,8 @@ export default {
} }
n.options = options n.options = options
} }
n.video = {}
n.fileUrl = {}
}) })
}) })
this.subjects = subjects this.subjects = subjects
@ -326,13 +327,11 @@ export default {
}else{ }else{
userAnswer = n.val userAnswer = n.val
} }
if(userAnswer || n.fileUrl || n.video){ n.fileUrl = JSON.stringify(n.fileUrl)
if(n.fileUrl){ n.video = JSON.stringify(n.video)
n.fileUrl = n.fileName + ',' + n.fileUrl if(userAnswer || n.fileUrl != '{}' || n.video != '{}'){
} if(n.fileUrl == '{}') n.fileUrl = ''
if(n.video){ if(n.video == '{}') n.video = ''
n.video = n.fileName + ',' + n.video
}
data1.push({ data1.push({
assessmentId: this.assessmentId, assessmentId: this.assessmentId,
questionId: n.id, questionId: n.id,

@ -39,7 +39,7 @@
<el-table-column prop="endTime" label="考试结束时间" align="center"></el-table-column> <el-table-column prop="endTime" label="考试结束时间" align="center"></el-table-column>
<el-table-column prop="timeCost" label="用时(分钟)" width="120" align="center"> <el-table-column prop="timeCost" label="用时(分钟)" width="120" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{(scope.row.timeCost / 60).toFixed(2)}} {{scope.row.timeCost != '--' ? (scope.row.timeCost / 60).toFixed(2) : scope.row.timeCost}}
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="score" label="得分" width="100" align="center"> --> <!-- <el-table-column prop="score" label="得分" width="100" align="center"> -->

@ -79,7 +79,6 @@
:on-error="uploadError" :on-error="uploadError"
:on-success="(res, file, fileList) => uploadSuccess(res, file, fileList, item)" :on-success="(res, file, fileList) => uploadSuccess(res, file, fileList, item)"
:before-remove="beforeRemove" :before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed" :on-exceed="handleExceed"
:action="api.fileupload" :action="api.fileupload"
> >
@ -206,6 +205,8 @@ export default {
n.options = options n.options = options
} }
n.questionStatus = 0 n.questionStatus = 0
n.video = {}
n.fileUrl = {}
}) })
}) })
this.subjects = subjects this.subjects = subjects
@ -283,13 +284,11 @@ export default {
}else{ }else{
userAnswer = n.val userAnswer = n.val
} }
if(userAnswer || n.fileUrl || n.video){ n.fileUrl = JSON.stringify(n.fileUrl)
if(n.fileUrl){ n.video = JSON.stringify(n.video)
n.fileUrl = n.fileName + ',' + n.fileUrl if(userAnswer || n.fileUrl != '{}' || n.video != '{}'){
} if(n.fileUrl == '{}') n.fileUrl = ''
if(n.video){ if(n.video == '{}') n.video = ''
n.video = n.fileName + ',' + n.video
}
data1.push({ data1.push({
identification: this.identification, identification: this.identification,
practiseId: this.practiseId, practiseId: this.practiseId,

@ -135,12 +135,12 @@
</el-select> </el-select>
</div> </div>
<div class="block"> <!-- <div class="block">
<p class="block-left">当前所在学校</p> <p class="block-left">当前所在学校</p>
<el-select v-model="personalInformation.clientId" filterable placeholder="请选择学校"> <el-select v-model="personalInformation.clientId" filterable placeholder="请选择学校">
<el-option v-for="(item,index) in schoolList" :key="index" :label="item.clientName" :value="item.id"></el-option> <el-option v-for="(item,index) in schoolList" :key="index" :label="item.clientName" :value="item.id"></el-option>
</el-select> </el-select>
</div> </div> -->
</div> </div>
</div> </div>
@ -393,6 +393,7 @@ export default {
.then(res => { .then(res => {
this.personalInformation = res.data.userInfo this.personalInformation = res.data.userInfo
this.personalInformation.countries = '中国' this.personalInformation.countries = '中国'
this.personalInformation.clientName = this.schoolList.find(n => n.id == this.personalInformation.clientId).clientName
this.curPassword = this.personalInformation.password this.curPassword = this.personalInformation.password
this.$nextTick(() => { this.$nextTick(() => {
if(this.personalInformation.provinceId){ if(this.personalInformation.provinceId){
@ -460,7 +461,7 @@ export default {
phone: personalInformation.phone, phone: personalInformation.phone,
provinceId: personalInformation.provinceId, provinceId: personalInformation.provinceId,
clientId: personalInformation.clientId, clientId: personalInformation.clientId,
clientName: this.schoolList.find(n => n.id == personalInformation.clientId).clientName, clientName: personalInformation.clientName,
sex: personalInformation.sex, sex: personalInformation.sex,
userId: personalInformation.userId, userId: personalInformation.userId,
userName: personalInformation.userName, userName: personalInformation.userName,

@ -93,3 +93,11 @@
} }
} }
} }
.player{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
width: 1200px !important;
height: 600px !important;
}
Loading…
Cancel
Save