Merge pull request 'fix/updatesyspic' (#260) from fix/updatesyspic into test

Reviewed-on: #260
pull/261/head
yaoshuli 1 year ago
commit 4a10a081f5

@ -269,6 +269,7 @@ if (searchContent) {
&-header { &-header {
padding: 12px 16px; padding: 12px 16px;
width: 100%; width: 100%;
display: table;
overflow: hidden; overflow: hidden;
.warpper { .warpper {

@ -6,6 +6,7 @@ import { clone, cloneDeep, debounce, pickBy } from 'lodash-es'
import { useDialog, useMessage } from 'naive-ui' import { useDialog, useMessage } from 'naive-ui'
import { import {
computed, computed,
nextTick,
onMounted, onMounted,
onUnmounted, onUnmounted,
onUpdated, onUpdated,
@ -37,6 +38,7 @@ const totalCount = ref(0)
let _imagesload: any let _imagesload: any
const bgLoadingImg = ref(bgLoading) const bgLoadingImg = ref(bgLoading)
const imgbigshow = ref(true) const imgbigshow = ref(true)
const isInitLoading = ref(0)
function changeimgbigshow() { function changeimgbigshow() {
imgbigshow.value = !imgbigshow.value imgbigshow.value = !imgbigshow.value
@ -132,7 +134,13 @@ function reset() {
} }
async function refreshHandler() { async function refreshHandler() {
reset() reset()
loadMore()
setTimeout(() => {
loadMore()
canloadMore = true
}, 1000)
nextTick(() => {
setTimeout(() => {
useInfiniteScroll( useInfiniteScroll(
el as any, el as any,
() => { () => {
@ -140,15 +148,26 @@ async function refreshHandler() {
}, },
{ distance: 10, canLoadMore: () => canloadMore }, { distance: 10, canLoadMore: () => canloadMore },
) )
}, 300)
})
} }
useInfiniteScroll(
el as any,
() => {
loadMore()
},
{ distance: 10, canLoadMore: () => canloadMore },
)
async function loadMore() { async function loadMore() {
if (loading.value || el.value == null) if (loading.value || el.value == null)
return return
const more = await featchList() const more = await featchList()
listData.value.push(...more) listData.value.push(...more)
console.log('listData.value11111111111111111', listData.value) loading.value = false
isInitLoading.value++
} }
async function featchList() { async function featchList() {
@ -163,7 +182,7 @@ async function featchList() {
}) })
totalCount.value = total totalCount.value = total
canloadMore = pageCount >= taskpagination.pageNo && pageCount > 0 canloadMore = (pageCount >= taskpagination.pageNo && pageCount > 0 && isInitLoading.value > 1)
return data return data
} }
catch (error) { catch (error) {
@ -175,19 +194,21 @@ async function featchList() {
const layout = debounce(() => { const layout = debounce(() => {
if (el.value == null) if (el.value == null)
return return
_imagesload = imagesloaded('.grid-item')
_imagesload.on('done', (instance) => {
if (!el.value)
return
loading.value = false loading.value = false
}) // start
// _imagesload = imagesloaded('.grid-item')
_imagesload.on('fail', (instance) => { // _imagesload.on('done', (instance) => {
message.error('图片错误') // if (!el.value)
loading.value = false // return
}) // loading.value = false
// })
// _imagesload.on('fail', (instance) => {
// message.error('')
// loading.value = false
// })
// end
}, 300) }, 300)
const fullscreenStyles = computed<any>(() => ({ const fullscreenStyles = computed<any>(() => ({
@ -202,13 +223,17 @@ const fullscreenStyles = computed<any>(() => ({
// //
function toggleFullScreen() { function toggleFullScreen() {
isFullScreen.value = !isFullScreen.value isFullScreen.value = !isFullScreen.value
if(!isFullScreen.value){ if (!isFullScreen.value)
imgbigshow.value = true imgbigshow.value = true
} }
}
onUpdated(() => { onUpdated(() => {
layout() // layout()
// nextTick(() => {
// setTimeout(() => {
// layout()
// }, 500)
// })
}) })
watch( watch(
@ -635,6 +660,7 @@ defineExpose({
<n-spin :show="loading"> <n-spin :show="loading">
<div ref="el" class="scroll"> <div ref="el" class="scroll">
<!-- <div class="scroll"> -->
<div class="wrapper-detail"> <div class="wrapper-detail">
<!-- 左侧大图 图片信息 --> <!-- 左侧大图 图片信息 -->
<div <div
@ -952,7 +978,8 @@ defineExpose({
.fullscreen-container { .fullscreen-container {
/* 可添加其他样式 */ /* 可添加其他样式 */
width: 100vw; width: 100vw;
height: 100vh; // height: 100vh;
height: 100%;
margin: 0px !important; margin: 0px !important;
} }
@ -966,9 +993,14 @@ defineExpose({
background: #fff; background: #fff;
border-radius: 3px; border-radius: 3px;
border: 1px solid rgb(239, 239, 245); border: 1px solid rgb(239, 239, 245);
:deep(.n-spin-container) {
height: calc(100% - 68px);
}
:deep(.n-spin-content) {
height: 100%;
}
.scroll { .scroll {
height: calc(100vh - 88px - 72px); height: 100%;
overflow-y: scroll; overflow-y: scroll;
} }

@ -1,18 +1,17 @@
<script lang="ts" setup> <script lang="ts" setup>
import DataHeader from "@/components/DataHeader/index.vue"; import { ref } from 'vue'
import { ref } from "vue"; import Aside from './aside/Aside.vue'
import Aside from "./aside/Aside.vue"; import Content from './content/Content.vue'
import Content from "./content/Content.vue"; import DataHeader from '@/components/DataHeader/index.vue'
import { useWorkOrder } from "@/store/modules/workOrder"; import { useWorkOrder } from '@/store/modules/workOrder'
import Robot from '@/components/Robot/index.vue' import Robot from '@/components/Robot/index.vue'
const workStore = useWorkOrder()
const workStore = useWorkOrder(); const contentRef: any = ref(null)
const contentRef: any = ref(null); function ApprovalOver(packageId) {
const ApprovalOver = (packageId) => { const id: string = workStore.getActiveId
const id: string = workStore.getActiveId; contentRef.value.queryDetail(id)
contentRef.value.queryDetail(id); }
};
</script> </script>
<template> <template>
@ -22,7 +21,7 @@ const ApprovalOver = (packageId) => {
</div> </div>
<div class="main"> <div class="main">
<!-- 侧边 --> <!-- 侧边 -->
<Aside @ApprovalOver="ApprovalOver" /> <Aside @approval-over="ApprovalOver" />
<!-- 内容 --> <!-- 内容 -->
<Content ref="contentRef" /> <Content ref="contentRef" />
@ -41,9 +40,9 @@ const ApprovalOver = (packageId) => {
flex-direction: row; flex-direction: row;
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
height: calc(100% - 170px);
} }
:deep(.ip_box){ :deep(.ip_box){
z-index: 10; z-index: 10;
} }
</style> </style>

Loading…
Cancel
Save