|
@@ -52,8 +52,8 @@
|
|
|
:row-class-name="tableRowClassName"
|
|
|
>
|
|
|
|
|
|
- <el-table-column prop="originalName" label="文件名称" width="280">
|
|
|
-<template #default="scope">
|
|
|
+ <el-table-column prop="originalName" label="文件名称" >
|
|
|
+ <template #default="scope">
|
|
|
<div style="display: flex;">
|
|
|
<img style="width: 25px;height:25px" :src="gettypeicon(scope.row.fileSuffix)"/>
|
|
|
<div>{{ scope.row.originalName }}</div>
|
|
@@ -120,16 +120,16 @@
|
|
|
<el-dialog v-model="pdfviewshow" :title="`文件预览`" width="60vw" >
|
|
|
|
|
|
|
|
|
- <div style="position: relative;">
|
|
|
+ <div style="position: relative;min-height: 80vh;">
|
|
|
<el-affix :offset="400" style="width: 100%;">
|
|
|
<div style="position: absolute;">
|
|
|
- <el-button type="primary" icon="DArrowLeft"></el-button>
|
|
|
+ <el-button type="primary" icon="DArrowLeft" :disabled="ccindex<=0" @click="fileindexlook(ccindex-1)"></el-button>
|
|
|
</div>
|
|
|
<div style="float: right;">
|
|
|
- <el-button type="primary" icon="DArrowRight"></el-button>
|
|
|
+ <el-button type="primary" icon="DArrowRight" :disabled="ccindex+1>=tableData.length" @click="fileindexlook(ccindex+1)"></el-button>
|
|
|
</div>
|
|
|
</el-affix>
|
|
|
- <pdfview :src="currentfile.url"></pdfview>
|
|
|
+ <pdfview :src="currentfile.url" ></pdfview>
|
|
|
|
|
|
|
|
|
|
|
@@ -154,6 +154,7 @@
|
|
|
<script lang="ts" setup>
|
|
|
import { ref,onMounted } from "vue";
|
|
|
import {
|
|
|
+ listByIds,
|
|
|
listArchivesFileList,
|
|
|
|
|
|
} from "@/api/system/oss/index";
|
|
@@ -202,10 +203,19 @@ const tableRowClassName = ({ row, rowIndex }: { row: any; rowIndex: number }) =>
|
|
|
|
|
|
const pdfviewshow = ref(false);
|
|
|
const currentfile = ref();
|
|
|
-
|
|
|
+const ccindex = ref(0);
|
|
|
+const fileindexlook = (index) => {
|
|
|
+ var item = tableData.value[index]
|
|
|
+ filepreview(item);
|
|
|
+}
|
|
|
const filepreview = (file) => {
|
|
|
+ ccindex.value = tableData.value.indexOf(file)
|
|
|
currentfile.value = file;
|
|
|
- pdfviewshow.value = true;
|
|
|
+ listByIds(file.ossId).then((res) => {
|
|
|
+ currentfile.value.url = res.data[0].url;
|
|
|
+ pdfviewshow.value = true;
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
const downloadfile = (file) => {
|
|
|
|