|
@@ -74,6 +74,18 @@
|
|
|
<el-image fit="contain" :src="file_url_https" />
|
|
|
</template>
|
|
|
|
|
|
+ <div v-else-if="fileType === 'mp3'" class="audio-file">
|
|
|
+ <audio :src="file_url_https" controls></audio>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div v-else-if="fileType === 'mp4'" class="video-file">
|
|
|
+ <video :src="file_url_https" controls></video>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div v-else-if="fileType === 'txt'" class="text-file">
|
|
|
+ <el-input v-model="text" type="textarea" :readonly="true" resize="none" />
|
|
|
+ </div>
|
|
|
+
|
|
|
<template v-else-if="fileType !== 'pdf'">
|
|
|
<iframe
|
|
|
:src="'https://view.officeapps.live.com/op/view.aspx?src=' + `${file_url_https}`"
|
|
@@ -141,7 +153,8 @@ export default {
|
|
|
curStudentName: '',
|
|
|
listTimer: null,
|
|
|
marginLeft: 0,
|
|
|
- isAlignCenter: true
|
|
|
+ isAlignCenter: true,
|
|
|
+ text: ''
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -257,6 +270,13 @@ export default {
|
|
|
if (fileType === 'pdf') {
|
|
|
this.getNumPages(file_relative_path);
|
|
|
}
|
|
|
+
|
|
|
+ if (fileType === 'txt') {
|
|
|
+ fetch(`${process.env.VUE_APP_PDF}${file_relative_path}`).then(async res => {
|
|
|
+ if (!res.ok) return;
|
|
|
+ this.text = await res.text();
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
|
|
@@ -439,13 +459,33 @@ export default {
|
|
|
}
|
|
|
|
|
|
&-container {
|
|
|
- height: calc(55vh - 117px);
|
|
|
+ max-height: calc(55vh - 117px);
|
|
|
overflow: auto;
|
|
|
|
|
|
.el-image {
|
|
|
width: 100%;
|
|
|
height: calc(100% - 4px);
|
|
|
}
|
|
|
+
|
|
|
+ .audio-file {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .video-file {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .text-file {
|
|
|
+ height: calc(55vh - 117px);
|
|
|
+
|
|
|
+ .el-textarea,
|
|
|
+ textarea {
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</style>
|