|
@@ -32,10 +32,26 @@
|
|
|
<p>{{ $t('cusMgt.rcd.avgScore') }}:{{ item.result }}</p>
|
|
|
<img v-if="smartRate.smartRateSummary.rateInfo.RatingSource === 'StudentWork'" :src="item.material" @click="$hevueImgPreview(item.material)" />
|
|
|
<template v-else-if="smartRate.smartRateSummary.rateInfo.RatingSource === 'IRS'">
|
|
|
- <audio v-if="smartRate.smartRateSummary.mutualSummary.materialDataType === 'Audio'" controls>
|
|
|
+ <audio v-if="materialDataType === 'Audio' || (materialDataType === 'File' && item.fileType === 'audio')" controls>
|
|
|
<source :src="item.material">
|
|
|
{{ $t('teachContent.notAudio') }}
|
|
|
</audio>
|
|
|
+ <img v-else-if="materialDataType === 'Image' || (materialDataType === 'File' && item.fileType === 'image')" :src="item.material" alt="">
|
|
|
+ <div v-else-if="materialDataType === 'File'">
|
|
|
+ <video v-if="item.fileType === 'video'" :src="item.material" width="870" controls="controls" style="max-height: 800px;"></video>
|
|
|
+ <div v-else class="repair-link-wrap-item-box">
|
|
|
+ <div class="file-icon">
|
|
|
+ <img :src="$tools.getFileThum(item.fileType, item.fileName)"/>
|
|
|
+ </div>
|
|
|
+ <div class="file-info">
|
|
|
+ <p class="file-name">{{ item.fileName }}</p>
|
|
|
+ <div>
|
|
|
+ <span @click="onPreview(item)">{{ $t('ability.review.preview')}}</span>
|
|
|
+ <span @click="onDownload(item)">{{ $t('ability.review.download')}}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<p v-else v-html="item.material"></p>
|
|
|
</template>
|
|
|
</div>
|
|
@@ -117,6 +133,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
+ materialDataType() {
|
|
|
+ return this.smartRate.smartRateSummary.mutualSummary?.materialDataType
|
|
|
+ },
|
|
|
smartType() {
|
|
|
let types = {
|
|
|
value: '',
|
|
@@ -206,6 +225,8 @@ export default {
|
|
|
let s = lists.find(item => {
|
|
|
return item.id === seatID
|
|
|
})
|
|
|
+ s.fileName = ''
|
|
|
+ s.fileType = ''
|
|
|
if(this.smartRate.smartRateSummary.mutualSummary.materialInfos.length) {
|
|
|
let materialInfos = this.smartRate.smartRateSummary.mutualSummary.materialInfos.find(info => {
|
|
|
return info.id === s.id
|
|
@@ -213,9 +234,15 @@ export default {
|
|
|
// IRS:文字题 StudentWork:图片
|
|
|
if(this.smartRate.smartRateSummary.rateInfo.RatingSource === 'StudentWork') {
|
|
|
s.material = `${this.sas.url}/${this.sas.name}/records/${this.recordInfo.id}${materialInfos.material}?${this.sas.sas}`
|
|
|
+ s.fileName = materialInfos.material.substr(materialInfos.material.lastIndexOf("/Ans/") + 5)
|
|
|
} else {
|
|
|
- if(this.smartRate.smartRateSummary.mutualSummary.materialDataType === 'Audio') {
|
|
|
+ if(this.materialDataType != 'Text') {
|
|
|
s.material = `${this.sas.url}/${this.sas.name}/records/${this.recordInfo.id}${materialInfos.material}?${this.sas.sas}`
|
|
|
+ s.fileName = materialInfos.material.substr(materialInfos.material.lastIndexOf("/Ans/") + 5)
|
|
|
+ if(this.materialDataType === 'File') {
|
|
|
+ let suffix = this.$tools.getSuffix(materialInfos.material)
|
|
|
+ item.fileType = ['jpg', 'png', 'gif'].includes(suffix) ? 'image' : ['mp4', 'webm'].includes(suffix) ? 'video' : ['mp3', 'wav'].includes(suffix) ? 'audio' : (['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'pdf'].includes(suffix) ? 'doc' : 'other')
|
|
|
+ }
|
|
|
} else {
|
|
|
s.material = materialInfos.material
|
|
|
}
|
|
@@ -227,6 +254,8 @@ export default {
|
|
|
} else {
|
|
|
lists = lists.map(item => {
|
|
|
item.material = ''
|
|
|
+ item.fileName = ''
|
|
|
+ item.fileType = ''
|
|
|
if(item.result === lists[0].result) {
|
|
|
item.king = true
|
|
|
}
|
|
@@ -237,9 +266,15 @@ export default {
|
|
|
// IRS:文字题 StudentWork:图片
|
|
|
if(this.smartRate.smartRateSummary.rateInfo.RatingSource === 'StudentWork') {
|
|
|
item.material = `${this.sas.url}/${this.sas.name}/records/${this.recordInfo.id}${materialInfos.material}?${this.sas.sas}`
|
|
|
+ item.fileName = materialInfos.material.substr(materialInfos.material.lastIndexOf("/Ans/") + 5)
|
|
|
} else {
|
|
|
- if(this.smartRate.smartRateSummary.mutualSummary.materialDataType === 'Audio') {
|
|
|
+ if(this.materialDataType != 'Text') {
|
|
|
item.material = `${this.sas.url}/${this.sas.name}/records/${this.recordInfo.id}${materialInfos.material}?${this.sas.sas}`
|
|
|
+ item.fileName = materialInfos.material.substr(materialInfos.material.lastIndexOf("/Ans/") + 5)
|
|
|
+ if(this.materialDataType === 'File') {
|
|
|
+ let suffix = this.$tools.getSuffix(materialInfos.material)
|
|
|
+ item.fileType = ['jpg', 'png', 'gif'].includes(suffix) ? 'image' : ['mp4', 'webm'].includes(suffix) ? 'video' : ['mp3', 'wav'].includes(suffix) ? 'audio' : (['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'pdf'].includes(suffix) ? 'doc' : 'other')
|
|
|
+ }
|
|
|
} else {
|
|
|
item.material = materialInfos.material
|
|
|
}
|
|
@@ -310,6 +345,25 @@ export default {
|
|
|
}
|
|
|
this.isComment = true
|
|
|
},
|
|
|
+ /* 预览 */
|
|
|
+ async onPreview(item){
|
|
|
+ let url = item.material
|
|
|
+ if (this.$tools.getSuffix(item.fileName) === 'pdf') {
|
|
|
+ window.open('/web/viewer.html?file=' + encodeURIComponent(url));
|
|
|
+ } else if(item.fileType === 'doc') {
|
|
|
+ window.open('https://view.officeapps.live.com/op/view.aspx?src=' + escape(url));
|
|
|
+ } else if(item.fileType === 'image') {
|
|
|
+ this.$hevueImgPreview(url)
|
|
|
+ } else if(item.fileType === 'link') {
|
|
|
+ window.open(/^(http:|https:)/i.test(url) ? url : "http://" + url)
|
|
|
+ } else {
|
|
|
+ this.$hevueImgPreview(url)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /* 下载 */
|
|
|
+ async onDownload(item){
|
|
|
+ this.$tools.doDownloadByUrl(item.material, item.fileName)
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
@@ -365,4 +419,9 @@ export default {
|
|
|
width: 300px;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.smart-list svg {
|
|
|
+ width: 200px;
|
|
|
+ height: auto;
|
|
|
+}
|
|
|
</style>
|