|
|
@@ -54,7 +54,6 @@
|
|
|
<el-table-column
|
|
|
prop="filename"
|
|
|
label="文件名"
|
|
|
- width="400px"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<a href="javascript:void(0)" style="text-decoration-line: none" @click="handleFile(scope.row)">
|
|
|
@@ -117,11 +116,11 @@
|
|
|
>详情</el-button>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
- @click="cache(scope.row)"
|
|
|
+ @click="share(scope.row)"
|
|
|
>分享</el-button>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
- @click="cache(scope.row)"
|
|
|
+ @click="remove(scope.row)"
|
|
|
>删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -168,28 +167,47 @@
|
|
|
</el-dialog>
|
|
|
<!--文件预览弹窗-->
|
|
|
<el-dialog
|
|
|
- title="预览文件"
|
|
|
append-to-body
|
|
|
- :visible.sync="previewFileDialog"
|
|
|
width="70%"
|
|
|
center
|
|
|
+ :visible.sync="previewFileDialog"
|
|
|
+ :before-close="handleDialogClose"
|
|
|
+ destroy-on-close
|
|
|
>
|
|
|
<div v-if="fileDetail !== null">
|
|
|
- <div v-if="fileDetail.fileType === 1001">
|
|
|
- <el-image :src="fileDetail.originalUrl" />
|
|
|
- </div>
|
|
|
- <div v-else-if="fileDetail.fileType === 1002">
|
|
|
- <span>视频文件</span>
|
|
|
- </div>
|
|
|
- <div v-else-if="fileDetail.fileType === 1003">
|
|
|
- <span>音频文件</span>
|
|
|
- </div>
|
|
|
- <div v-else-if="fileDetail.fileType === 1004">
|
|
|
- <span>文本文件</span>
|
|
|
- </div>
|
|
|
- <div v-else>
|
|
|
- <span>文件没有预览</span>
|
|
|
- </div>
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
+ <span style="left: 0;margin-bottom: 0px;color: black;">{{ fileDetail.filename }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="text item">
|
|
|
+ <div v-if="fileDetail.fileType === 1001">
|
|
|
+ <el-image
|
|
|
+ :src="fileDetail.originalUrl"
|
|
|
+ lazy
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div v-else-if="fileDetail.fileType === 1002">
|
|
|
+ <video-preview :video-prop="videoProp" />
|
|
|
+ </div>
|
|
|
+ <div v-else-if="fileDetail.fileType === 1003">
|
|
|
+ <audio-player
|
|
|
+ ref="audioPlayer"
|
|
|
+ :is-loop="false"
|
|
|
+ :show-prev-button="false"
|
|
|
+ :show-next-button="false"
|
|
|
+ :show-playback-rate="false"
|
|
|
+ :audio-list="fileDetail.audioList.map(elm => elm.url)"
|
|
|
+ theme-color="#87CEFA"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div v-else-if="fileDetail.fileType === 1004">
|
|
|
+ <span>文本文件</span>
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ <span>文件没有预览</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<!--移动/复制弹窗-->
|
|
|
@@ -226,7 +244,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import VideoPreviewPlayer from 'components/VideoPreviewPlayer'
|
|
|
+import VideoPreview from 'components/VideoPreview'
|
|
|
import {
|
|
|
getFileList,
|
|
|
deleteDiskFile,
|
|
|
@@ -236,10 +254,11 @@ import {
|
|
|
getFolderTree,
|
|
|
moveDiskFile
|
|
|
} from '@/api/disk'
|
|
|
+import DPlayer from "dplayer";
|
|
|
|
|
|
export default {
|
|
|
name: 'FileList',
|
|
|
- components: { VideoPreviewPlayer },
|
|
|
+ components: { VideoPreview },
|
|
|
data() {
|
|
|
return {
|
|
|
// 屏幕宽度, 为了控制分页条的大小
|
|
|
@@ -275,7 +294,8 @@ export default {
|
|
|
type: 1,
|
|
|
pid: null,
|
|
|
fileIds: []
|
|
|
- }
|
|
|
+ },
|
|
|
+ videoProp: null
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -323,11 +343,15 @@ export default {
|
|
|
getDetail(fileId) {
|
|
|
getFileDetail(fileId).then(resp => {
|
|
|
if (resp.code === 0) {
|
|
|
- console.log(resp.data)
|
|
|
+ this.$message(resp.data)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- cache(row) {
|
|
|
+ share(row) {
|
|
|
+ this.$message('share 未实现')
|
|
|
+ },
|
|
|
+ remove(row) {
|
|
|
+ this.$message('remove 未实现')
|
|
|
},
|
|
|
onSelect() {
|
|
|
this.currentPage = 1
|
|
|
@@ -405,7 +429,6 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
handleFile(item) {
|
|
|
- console.log(item)
|
|
|
const fileType = item.fileType
|
|
|
if (fileType === 1000) {
|
|
|
const filename = item.filename
|
|
|
@@ -432,6 +455,19 @@ export default {
|
|
|
getFileUrl(fileType, fileId).then(resp => {
|
|
|
if (resp.code === 0) {
|
|
|
this.fileDetail = resp.data
|
|
|
+ if (fileType === 1001) {
|
|
|
+ } else if (fileType === 1002) {
|
|
|
+ this.videoProp = {
|
|
|
+ videoId: this.fileDetail.fileId,
|
|
|
+ url: this.fileDetail.originalUrl,
|
|
|
+ type: 'mp4'
|
|
|
+ }
|
|
|
+ } else if (fileType === 1003) {
|
|
|
+ this.fileDetail.audioList = [
|
|
|
+ { name: this.fileDetail.filename, url: this.fileDetail.originalUrl }
|
|
|
+ ]
|
|
|
+ } else if (fileType === 1004) {
|
|
|
+ }
|
|
|
this.previewFileDialog = true
|
|
|
}
|
|
|
}).catch(error => {
|
|
|
@@ -443,6 +479,10 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ handleDialogClose(done) {
|
|
|
+ console.log('dialog close')
|
|
|
+ done()
|
|
|
+ },
|
|
|
createNewFolder() {
|
|
|
this.createFolderDialog = true
|
|
|
},
|
|
|
@@ -506,18 +546,49 @@ export default {
|
|
|
this.$refs.multipleTable.clearSelection()
|
|
|
}
|
|
|
})
|
|
|
- },
|
|
|
- share() {
|
|
|
- this.$notify({
|
|
|
- title: '提示',
|
|
|
- message: '分享文件接口未实现',
|
|
|
- type: 'info',
|
|
|
- duration: 3000
|
|
|
- })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style>
|
|
|
+/*处于手机屏幕时*/
|
|
|
+@media screen and (max-width: 768px) {
|
|
|
+ .tit {
|
|
|
+ font-weight: 600;
|
|
|
+ font-size: 12px;
|
|
|
+ height: 32px;
|
|
|
+ }
|
|
|
+ .time {
|
|
|
+ font-size: 10px;
|
|
|
+ color: #999;
|
|
|
+ }
|
|
|
+ .num {
|
|
|
+ font-size: 9px;
|
|
|
+ padding-top: 3px;
|
|
|
+ }
|
|
|
+ .bottom {
|
|
|
+ margin-top: 2px;
|
|
|
+ line-height: 7px;
|
|
|
+ }
|
|
|
+ .coverImg {
|
|
|
+ height: 120px !important;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.coverImg {
|
|
|
+ width: 100%;
|
|
|
+ height: 175px;
|
|
|
+ display: block;
|
|
|
+}
|
|
|
+
|
|
|
+.clearfix:before,
|
|
|
+.clearfix:after {
|
|
|
+ display: table;
|
|
|
+ content: "";
|
|
|
+}
|
|
|
+
|
|
|
+.clearfix:after {
|
|
|
+ clear: both;
|
|
|
+}
|
|
|
</style>
|