|
@@ -11,7 +11,7 @@
|
|
|
<div class="main-container page—wrap max-w-full">
|
|
<div class="main-container page—wrap max-w-full">
|
|
|
<div class="history-section flex-col koutu-section">
|
|
<div class="history-section flex-col koutu-section">
|
|
|
|
|
|
|
|
- <div class="history-warp">
|
|
|
|
|
|
|
+ <div class="history-warp" ref="containerRef">
|
|
|
<div v-if="!goodsList.length" class="fs-14 c-666 mar-top-50">
|
|
<div v-if="!goodsList.length" class="fs-14 c-666 mar-top-50">
|
|
|
{{ loading ? '数据正在加载中,请稍候...' : '暂无数据,请先进行拍摄'}}
|
|
{{ loading ? '数据正在加载中,请稍候...' : '暂无数据,请先进行拍摄'}}
|
|
|
</div>
|
|
</div>
|
|
@@ -60,7 +60,7 @@
|
|
|
<span class="tag" v-if="!image.PhotoRecord.image_path">{{ image.action_name }}</span>
|
|
<span class="tag" v-if="!image.PhotoRecord.image_path">{{ image.action_name }}</span>
|
|
|
<el-image
|
|
<el-image
|
|
|
v-if="image.PhotoRecord.image_path"
|
|
v-if="image.PhotoRecord.image_path"
|
|
|
- :src="getFilePath(image.PhotoRecord.image_path)"
|
|
|
|
|
|
|
+ :src="thumbnailMap[image.PhotoRecord.image_path] ? thumbnailMap[image.PhotoRecord.image_path] : ''"
|
|
|
:preview-src-list="getPreviewImageList(item)"
|
|
:preview-src-list="getPreviewImageList(item)"
|
|
|
hide-on-click-modal
|
|
hide-on-click-modal
|
|
|
:initial-index="getPreviewIndex(item, index)"
|
|
:initial-index="getPreviewIndex(item, index)"
|
|
@@ -132,16 +132,13 @@
|
|
|
</template>
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import headerBar from '@/components/header-bar/index.vue'
|
|
import headerBar from '@/components/header-bar/index.vue'
|
|
|
-import { onMounted, onBeforeUnmount, ref, computed } from 'vue'
|
|
|
|
|
|
|
+import { onMounted, onBeforeUnmount, ref, computed, nextTick, watch } from 'vue'
|
|
|
import HardwareCheck from '@/components/check/index.vue'
|
|
import HardwareCheck from '@/components/check/index.vue'
|
|
|
import usePhotography from './mixin/usePhotography'
|
|
import usePhotography from './mixin/usePhotography'
|
|
|
|
|
+import { useThumbnails } from './composables/useThumbnails'
|
|
|
import generate from '@/utils/menus/generate'
|
|
import generate from '@/utils/menus/generate'
|
|
|
-import { ElMessage,ElMessageBox } from 'element-plus'
|
|
|
|
|
-import { clickLog, setLogInfo } from '@/utils/log'
|
|
|
|
|
-import {useRoute, useRouter} from "vue-router";
|
|
|
|
|
-import client from "@/stores/modules/client";
|
|
|
|
|
-import icpList from '@/utils/ipc'
|
|
|
|
|
-import { getFilePath, getRouterUrl } from '@/utils/appfun'
|
|
|
|
|
|
|
+import { ElMessageBox } from 'element-plus'
|
|
|
|
|
+// logging helpers not needed here
|
|
|
|
|
|
|
|
const {
|
|
const {
|
|
|
loading,
|
|
loading,
|
|
@@ -164,10 +161,12 @@ const {
|
|
|
totalPages,
|
|
totalPages,
|
|
|
} = usePhotography()
|
|
} = usePhotography()
|
|
|
|
|
|
|
|
|
|
+// thumbnails
|
|
|
|
|
+const containerRef = ref<HTMLElement | null>(null)
|
|
|
|
|
+const { thumbnailMap, observe, stop } = useThumbnails(getFilePath)
|
|
|
|
|
|
|
|
-const Router = useRouter()
|
|
|
|
|
-const route = useRoute();
|
|
|
|
|
-const clientStore = client();
|
|
|
|
|
|
|
+
|
|
|
|
|
+// router/client variables not needed here
|
|
|
// 覆盖 openPhotographyDetail 方法,只传递选中的货号
|
|
// 覆盖 openPhotographyDetail 方法,只传递选中的货号
|
|
|
/*const openPhotographyDetail = () => {
|
|
/*const openPhotographyDetail = () => {
|
|
|
|
|
|
|
@@ -302,10 +301,21 @@ const getPreviewIndex = (item: any, currentIndex: number) => {
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
|
await getPhotoRecords()
|
|
await getPhotoRecords()
|
|
|
initEventListeners()
|
|
initEventListeners()
|
|
|
|
|
+ nextTick(() => {
|
|
|
|
|
+ observe(containerRef, goodsList)
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
onBeforeUnmount(() => {
|
|
onBeforeUnmount(() => {
|
|
|
cleanupEventListeners()
|
|
cleanupEventListeners()
|
|
|
|
|
+ stop()
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+// 当 goodsList 变化时(翻页或刷新),重新挂载 observer
|
|
|
|
|
+watch(goodsList, () => {
|
|
|
|
|
+ nextTick(() => {
|
|
|
|
|
+ observe(containerRef, goodsList)
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|