diff --git a/src/renderer/src/components/thirdFile-preview/index.vue b/src/renderer/src/components/thirdFile-preview/index.vue new file mode 100644 index 0000000..391ddd6 --- /dev/null +++ b/src/renderer/src/components/thirdFile-preview/index.vue @@ -0,0 +1,35 @@ + + + + \ No newline at end of file diff --git a/src/renderer/src/views/resource/container/third-list.vue b/src/renderer/src/views/resource/container/third-list.vue index 7021b61..0039e24 100644 --- a/src/renderer/src/views/resource/container/third-list.vue +++ b/src/renderer/src/views/resource/container/third-list.vue @@ -7,12 +7,11 @@ v-for="item in sourceStore.thirdResult.list" :key="item.itemId" class="list-item" - @click="handleRow" + @click="handleRow(item)" >
-
+
-
@@ -66,14 +65,7 @@ @current-change="handleCurrentChange" />
- -
- -
-
- - - +
@@ -82,10 +74,9 @@ import { ref } from 'vue' // import { ElMessage, ElMessageBox } from 'element-plus' import { Clock,View,Folder,Search } from '@element-plus/icons-vue' import FileImage from '@/components/file-image/index.vue' -import { getFileSuffix } from '@/utils/ruoyi' +import FilePreview from '@/components/thirdFile-preview/index.vue' import useUserStore from '@/store/modules/user' import useResoureStore from '../store' -import {getImgPath} from "@/api/file/third"; const userstore = useUserStore() const sourceStore = useResoureStore() @@ -93,8 +84,7 @@ const sourceStore = useResoureStore() // const userInfo = userstore.user //判断是否预览图片 const isViewImg = ref(false) -//显示图片的路径 -const srcList = ref([]) +const thirdPreview = ref() // 分页change const handleSizeChange = (limit) => { @@ -120,20 +110,9 @@ function timestampToDate(timestamp) { return `${year}-${month}-${day}`; } //获取图片的路径 -const clickImg = (id) => { - srcList.value = [] - getImgPath({itemId:id}).then(res => { - if(res.code === 200){ - isViewImg.value = true - res.data.forEach(item => { - item.subsets.forEach(previewItem => { - previewItem.previewFiles.forEach(fileItem => { - srcList.value.push(fileItem.fileUrl) - }) - }) - }) - } - }) +const handleRow = (item) => { + isViewImg.value = true + thirdPreview.value.init(item.itemId) }