|
|
@@ -420,14 +420,14 @@
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
+ <ImgPreview :previewData="previewData" :showPreview="showPreview" @closeImgPreview="closeImgPreview"></ImgPreview>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 图片预览 -->
|
|
|
- <!-- <ImgPreview ></ImgPreview> -->
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { ref } from 'vue'
|
|
|
+import { ref, toRaw } from 'vue'
|
|
|
import myfile from '../../api/myfile/myfile'
|
|
|
import space from '../../api/space/space'
|
|
|
import documents from '../../api/document/document'
|
|
|
@@ -445,6 +445,8 @@ import grayRight from "../../assets/images/grayRight.png"
|
|
|
import sort from '../../assets/images/sort.png'
|
|
|
import squre from '../../assets/images/squre.png'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
+import ImgPreview from '@/components/ImgPreview/ImgPreview.vue'
|
|
|
+import { preview } from "@/api/common/common.js";
|
|
|
export default {
|
|
|
setup() {
|
|
|
let editOnline = ref(true)
|
|
|
@@ -641,6 +643,16 @@ export default {
|
|
|
},
|
|
|
|
|
|
])
|
|
|
+ const showPreview = ref(false)//控制图片预览组件显示
|
|
|
+ const previewData = ref()//需要预览的文件的数据
|
|
|
+ // 获取所有文件
|
|
|
+ function getAll() {
|
|
|
+ myfile.getAllFileMenu({ dirId: folderId.value }).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ fileList.value = res.rows
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
// 获取用户树
|
|
|
function getAllUser() {
|
|
|
userTree.getUserTree({}).then(res => {
|
|
|
@@ -729,6 +741,7 @@ export default {
|
|
|
// 文件名表格每一行点击事件
|
|
|
function handleRowClick(row) {
|
|
|
copyRow.value = row
|
|
|
+ console.log('row = ',toRaw(row));
|
|
|
clickRowId.value = row.docId
|
|
|
copyDirId.value = row.dirId
|
|
|
copySpaceId.value = row.spaceId
|
|
|
@@ -755,7 +768,7 @@ export default {
|
|
|
this.askTo = false
|
|
|
}
|
|
|
//mouse弹框
|
|
|
- function chooseSet(row, num) {
|
|
|
+ async function chooseSet(row, num) {
|
|
|
if (row.name == '在线编辑' || row.name == '协作') {
|
|
|
cliCC.value = true
|
|
|
} else {
|
|
|
@@ -816,6 +829,14 @@ export default {
|
|
|
editOnline.value = false
|
|
|
cliCC.value = false
|
|
|
}
|
|
|
+ if (row.name === '历史版本') {
|
|
|
+ console.log('row=', toRaw(row));
|
|
|
+ console.log('copyFileId',copyFileId.value);//文件id
|
|
|
+ showPreview.value = true
|
|
|
+ const res = await preview(copyFileId.value)
|
|
|
+ previewData.value = URL.createObjectURL(res)
|
|
|
+ console.log('res',res);
|
|
|
+ }
|
|
|
}
|
|
|
function chooseSet1() {
|
|
|
transferModal.value = true
|
|
|
@@ -1137,6 +1158,11 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ //关闭图片预览事件
|
|
|
+ const closeImgPreview = ()=>{
|
|
|
+ // console.log('close');
|
|
|
+ showPreview.value = false
|
|
|
+ }
|
|
|
return {
|
|
|
allBag,
|
|
|
folderList,//文件夹的数据
|
|
|
@@ -1246,6 +1272,10 @@ export default {
|
|
|
spaceSelect,
|
|
|
newDirId,
|
|
|
newSpaceId,
|
|
|
+ getAllFolder,
|
|
|
+ showPreview,//控制图片预览
|
|
|
+ closeImgPreview,//关闭预览事件
|
|
|
+ previewData,//预览文件数据
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -1261,6 +1291,7 @@ export default {
|
|
|
components: {
|
|
|
BreadMenu,
|
|
|
FileEdit,
|
|
|
+ ImgPreview
|
|
|
},
|
|
|
}
|
|
|
</script>
|