|
@@ -27,9 +27,16 @@
|
|
|
</el-input>
|
|
</el-input>
|
|
|
<el-divider />
|
|
<el-divider />
|
|
|
<el-breadcrumb separator-class="el-icon-arrow-right">
|
|
<el-breadcrumb separator-class="el-icon-arrow-right">
|
|
|
- <el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">全部文件</el-breadcrumb-item>
|
|
|
|
|
- <el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹1</el-breadcrumb-item>
|
|
|
|
|
- <el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹2</el-breadcrumb-item>
|
|
|
|
|
|
|
+ <el-breadcrumb-item
|
|
|
|
|
+ v-for="(item, index) in pathList"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ style="padding: 1px"
|
|
|
|
|
+ :replace="true"
|
|
|
|
|
+ :to="{ path: item.path }"
|
|
|
|
|
+ >
|
|
|
|
|
+ {{ item.name }}
|
|
|
|
|
+ </el-breadcrumb-item>
|
|
|
|
|
+ <!--<el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹2</el-breadcrumb-item>
|
|
|
<el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹3</el-breadcrumb-item>
|
|
<el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹3</el-breadcrumb-item>
|
|
|
<el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹4</el-breadcrumb-item>
|
|
<el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹4</el-breadcrumb-item>
|
|
|
<el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹5</el-breadcrumb-item>
|
|
<el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹5</el-breadcrumb-item>
|
|
@@ -37,7 +44,7 @@
|
|
|
<el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹7</el-breadcrumb-item>
|
|
<el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹7</el-breadcrumb-item>
|
|
|
<el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹8</el-breadcrumb-item>
|
|
<el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹8</el-breadcrumb-item>
|
|
|
<el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹9</el-breadcrumb-item>
|
|
<el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹9</el-breadcrumb-item>
|
|
|
- <el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹10</el-breadcrumb-item>
|
|
|
|
|
|
|
+ <el-breadcrumb-item style="padding: 1px" :to="{ path: '/disk/file' }">文件夹10</el-breadcrumb-item>-->
|
|
|
</el-breadcrumb>
|
|
</el-breadcrumb>
|
|
|
<el-divider />
|
|
<el-divider />
|
|
|
<el-table
|
|
<el-table
|
|
@@ -77,39 +84,139 @@
|
|
|
label="修改时间"
|
|
label="修改时间"
|
|
|
/>
|
|
/>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
+ <el-pagination
|
|
|
|
|
+ background
|
|
|
|
|
+ :small="screenWidth <= 768"
|
|
|
|
|
+ layout="prev, pager, next"
|
|
|
|
|
+ :page-size="pageSize"
|
|
|
|
|
+ :current-page="currentPage"
|
|
|
|
|
+ :total="totalSize"
|
|
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
|
|
+ @prev-click="handleCurrentChange"
|
|
|
|
|
+ @next-click="handleCurrentChange"
|
|
|
|
|
+ />
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
+
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ :visible.sync="showPreviewDialog"
|
|
|
|
|
+ :before-close="handleClose"
|
|
|
|
|
+ width="100%"
|
|
|
|
|
+ center
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-card v-if="fileDetail !== null" class="box-card" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
|
|
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
|
|
+ <span>{{ fileDetail.filename }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="text item">
|
|
|
|
|
+ <el-col v-if="fileType === 1001" :md="12">
|
|
|
|
|
+ <div class="imgs">
|
|
|
|
|
+ <el-image
|
|
|
|
|
+ lazy
|
|
|
|
|
+ fit="cover"
|
|
|
|
|
+ class="coverImg"
|
|
|
|
|
+ :src="fileDetail.url"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col v-else-if="fileType === 1002" :md="12">
|
|
|
|
|
+ <video
|
|
|
|
|
+ :src="fileDetail.url"
|
|
|
|
|
+ controls
|
|
|
|
|
+ autoplay
|
|
|
|
|
+ class="video"
|
|
|
|
|
+ width="100%"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col v-else-if="fileType === 1003" :md="12">
|
|
|
|
|
+ <audio
|
|
|
|
|
+ :src="fileDetail.url"
|
|
|
|
|
+ controls
|
|
|
|
|
+ autoplay
|
|
|
|
|
+ class="audio"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col v-else-if="fileType === 1004" :md="12">
|
|
|
|
|
+ 文档
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col v-else-if="fileType === 1005" :md="12">
|
|
|
|
|
+ 文件
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-card>
|
|
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { getDiskFile } from '@/api/disk'
|
|
|
|
|
|
|
+import { getDiskFile, getFileDetail } from '@/api/disk'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'DiskFile',
|
|
name: 'DiskFile',
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ // 屏幕宽度, 为了控制分页条的大小
|
|
|
|
|
+ screenWidth: document.body.clientWidth,
|
|
|
|
|
+ currentPage: 1,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ totalSize: 0,
|
|
|
dataList: [],
|
|
dataList: [],
|
|
|
- // 所有题目的对话框中表格被选中
|
|
|
|
|
|
|
+ // 所有文件的对话框被选中
|
|
|
selectedTable: [],
|
|
selectedTable: [],
|
|
|
- inputData: ''
|
|
|
|
|
|
|
+ inputData: '',
|
|
|
|
|
+ showPreviewDialog: false,
|
|
|
|
|
+ fileDetail: null,
|
|
|
|
|
+ fileType: 0,
|
|
|
|
|
+ videoProp: null,
|
|
|
|
|
+ pathList: [
|
|
|
|
|
+ { path: '/disk', name: '全部文件' },
|
|
|
|
|
+ { path: '/disk?path=/1', name: '1' },
|
|
|
|
|
+ { path: '/disk?path=/1/2', name: '2' },
|
|
|
|
|
+ { path: '/disk?path=/1/2/3', name: '3' }
|
|
|
|
|
+ ],
|
|
|
|
|
+ queryForm: {
|
|
|
|
|
+ pn: this.currentPage,
|
|
|
|
|
+ path: '/',
|
|
|
|
|
+ fileType: null,
|
|
|
|
|
+ filename: null
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
|
|
+ const pn = this.$route.query.pn
|
|
|
|
|
+ if (pn !== undefined) {
|
|
|
|
|
+ this.queryForm.pn = pn
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const path = this.$route.query.path
|
|
|
|
|
+ if (path === undefined) {
|
|
|
|
|
+ this.queryForm.path = path
|
|
|
|
|
+ }
|
|
|
document.title = '所有文件'
|
|
document.title = '所有文件'
|
|
|
this.getData()
|
|
this.getData()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ handleClose() {
|
|
|
|
|
+ this.showPreviewDialog = false
|
|
|
|
|
+ this.fileDetail = null
|
|
|
|
|
+ this.fileType = 0
|
|
|
|
|
+ },
|
|
|
|
|
+ handleCurrentChange(pageNumber) {
|
|
|
|
|
+ this.currentPage = pageNumber
|
|
|
|
|
+ this.queryForm.pn = this.currentPage
|
|
|
|
|
+ this.getData()
|
|
|
|
|
+ // 回到顶部
|
|
|
|
|
+ scrollTo(0, 0)
|
|
|
|
|
+ },
|
|
|
getData() {
|
|
getData() {
|
|
|
- const queryForm = {
|
|
|
|
|
- pageNo: 1,
|
|
|
|
|
- path: '/',
|
|
|
|
|
- fileType: null,
|
|
|
|
|
- filename: null
|
|
|
|
|
- }
|
|
|
|
|
- getDiskFile(queryForm).then(resp => {
|
|
|
|
|
|
|
+ getDiskFile(this.queryForm).then(resp => {
|
|
|
if (resp.code === 0) {
|
|
if (resp.code === 0) {
|
|
|
const respData = resp.data
|
|
const respData = resp.data
|
|
|
- this.dataList = respData.list
|
|
|
|
|
|
|
+ this.pathList = respData.pathList
|
|
|
|
|
+ this.dataList = respData.pageList.list
|
|
|
|
|
+ this.totalSize = respData.pageList.totalSize
|
|
|
|
|
+ if (this.pathList.length === 0) {
|
|
|
|
|
+ this.pathList.push({ path: '/disk', name: '全部文件' })
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
@@ -130,16 +237,27 @@ export default {
|
|
|
this.$message.info('search file')
|
|
this.$message.info('search file')
|
|
|
},
|
|
},
|
|
|
onClickFilename(row) {
|
|
onClickFilename(row) {
|
|
|
- const fileId = row.fileId
|
|
|
|
|
- const fileType = row.fileType
|
|
|
|
|
- if (fileType === 1001) {
|
|
|
|
|
- this.$message.info(fileId + ' 是图片')
|
|
|
|
|
- } else if (fileType === 1002) {
|
|
|
|
|
- this.$message.info(fileId + ' 是视频')
|
|
|
|
|
- } else if (fileType === 1003) {
|
|
|
|
|
- this.$message.info(fileId + ' 是音频')
|
|
|
|
|
- } else if (fileType === 1004) {
|
|
|
|
|
- this.$message.info(fileId + ' 是文档')
|
|
|
|
|
|
|
+ this.fileType = row.fileType
|
|
|
|
|
+ if (this.fileType === 1000) {
|
|
|
|
|
+ const filename = row.filename
|
|
|
|
|
+ const nextPath = this.pathList[this.pathList.length - 1].path + '/' + filename
|
|
|
|
|
+ console.log(nextPath)
|
|
|
|
|
+ this.currentPage = 1
|
|
|
|
|
+ this.queryForm.pn = this.currentPage
|
|
|
|
|
+ this.queryForm.path = '/pv'
|
|
|
|
|
+ this.getData()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ getFileDetail(row.fileId).then(resp => {
|
|
|
|
|
+ if (resp.code === 0) {
|
|
|
|
|
+ this.showPreviewDialog = true
|
|
|
|
|
+ this.fileDetail = resp.data
|
|
|
|
|
+ if (this.fileType === 1002) {
|
|
|
|
|
+ this.videoProp = {
|
|
|
|
|
+ videoUrl: this.fileDetail.url
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -147,4 +265,16 @@ export default {
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
<style>
|
|
|
|
|
+/*处于手机屏幕时*/
|
|
|
|
|
+@media screen and (max-width: 768px){
|
|
|
|
|
+ .coverImg {
|
|
|
|
|
+ height: 120px !important;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.coverImg {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 320px;
|
|
|
|
|
+ display: block;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|