fix bug for waterflow component

This commit is contained in:
RockYang 2024-05-05 10:52:29 +08:00
parent c2bf5e845a
commit 6c47551b03
5 changed files with 30 additions and 19 deletions

View File

@ -1,5 +1,9 @@
# 更新日志 # 更新日志
## v4.0.6
* Bug修复修复PC端画廊页面的瀑布流组件样式错乱问题
## v4.0.5 ## v4.0.5
* 功能优化:已授权系统在后台显示授权信息 * 功能优化:已授权系统在后台显示授权信息

View File

@ -105,7 +105,7 @@
</div> </div>
<h2>创作记录</h2> <h2>创作记录</h2>
<div class="finish-job-list" v-loading="loading" element-loading-background="rgba(0, 0, 0, 0.5)"> <div class="finish-job-list">
<div v-if="finishedJobs.length > 0"> <div v-if="finishedJobs.length > 0">
<ItemList :items="finishedJobs" :width="240" :gap="16"> <ItemList :items="finishedJobs" :width="240" :gap="16">
<template #default="scope"> <template #default="scope">
@ -272,7 +272,6 @@ const initData = () => {
fetchFinishJobs(1) fetchFinishJobs(1)
connect() connect()
}).catch(() => { }).catch(() => {
loading.value = false
}); });
} }
@ -341,6 +340,9 @@ const connect = () => {
} }
const fetchRunningJobs = () => { const fetchRunningJobs = () => {
if (!isLogin.value) {
return
}
// //
httpGet(`/api/dall/jobs?status=0`).then(res => { httpGet(`/api/dall/jobs?status=0`).then(res => {
const jobs = res.data const jobs = res.data
@ -367,10 +369,11 @@ const fetchRunningJobs = () => {
const page = ref(1) const page = ref(1)
const pageSize = ref(15) const pageSize = ref(15)
const isOver = ref(false) const isOver = ref(false)
const loading = ref(false)
// //
const fetchFinishJobs = (page) => { const fetchFinishJobs = (page) => {
loading.value = true if (!isLogin.value) {
return
}
httpGet(`/api/dall/jobs?status=1&page=${page}&page_size=${pageSize.value}`).then(res => { httpGet(`/api/dall/jobs?status=1&page=${page}&page_size=${pageSize.value}`).then(res => {
if (res.data.length < pageSize.value) { if (res.data.length < pageSize.value) {
isOver.value = true isOver.value = true
@ -380,9 +383,7 @@ const fetchFinishJobs = (page) => {
} else { } else {
finishedJobs.value = finishedJobs.value.concat(res.data) finishedJobs.value = finishedJobs.value.concat(res.data)
} }
loading.value = false
}).catch(e => { }).catch(e => {
loading.value = false
ElMessage.error("获取任务失败:" + e.message) ElMessage.error("获取任务失败:" + e.message)
}) })
} }

View File

@ -493,7 +493,7 @@
</div> </div>
<h2>创作记录</h2> <h2>创作记录</h2>
<div class="finish-job-list" v-loading="loading" element-loading-background="rgba(0, 0, 0, 0.5)"> <div class="finish-job-list">
<div v-if="finishedJobs.length > 0"> <div v-if="finishedJobs.length > 0">
<ItemList :items="finishedJobs" :width="240" :gap="16"> <ItemList :items="finishedJobs" :width="240" :gap="16">
<template #default="scope"> <template #default="scope">
@ -593,7 +593,7 @@
</template> </template>
<script setup> <script setup>
import {nextTick, onMounted, onUnmounted, ref} from "vue" import {onMounted, onUnmounted, ref} from "vue"
import {ChromeFilled, Delete, DocumentCopy, InfoFilled, Picture, Plus, UploadFilled} from "@element-plus/icons-vue"; import {ChromeFilled, Delete, DocumentCopy, InfoFilled, Picture, Plus, UploadFilled} from "@element-plus/icons-vue";
import Compressor from "compressorjs"; import Compressor from "compressorjs";
import {httpGet, httpPost} from "@/utils/http"; import {httpGet, httpPost} from "@/utils/http";
@ -793,6 +793,10 @@ httpGet("/api/config/get?key=system").then(res => {
// //
const fetchRunningJobs = () => { const fetchRunningJobs = () => {
if (!isLogin.value) {
return
}
httpGet(`/api/mj/jobs?status=0`).then(res => { httpGet(`/api/mj/jobs?status=0`).then(res => {
const jobs = res.data const jobs = res.data
const _jobs = [] const _jobs = []
@ -832,9 +836,11 @@ const handleScrollEnd = () => {
const page = ref(1) const page = ref(1)
const pageSize = ref(15) const pageSize = ref(15)
const isOver = ref(false) const isOver = ref(false)
const loading = ref(false)
const fetchFinishJobs = (page) => { const fetchFinishJobs = (page) => {
loading.value = true if (!isLogin.value) {
return
}
// //
httpGet(`/api/mj/jobs?status=1&page=${page}&page_size=${pageSize.value}`).then(res => { httpGet(`/api/mj/jobs?status=1&page=${page}&page_size=${pageSize.value}`).then(res => {
const jobs = res.data const jobs = res.data
@ -861,9 +867,7 @@ const fetchFinishJobs = (page) => {
} else { } else {
finishedJobs.value = finishedJobs.value.concat(jobs) finishedJobs.value = finishedJobs.value.concat(jobs)
} }
nextTick(() => loading.value = false)
}).catch(e => { }).catch(e => {
loading.value = false
ElMessage.error("获取任务失败:" + e.message) ElMessage.error("获取任务失败:" + e.message)
}) })
} }

View File

@ -315,7 +315,7 @@
<el-empty :image-size="100" v-else/> <el-empty :image-size="100" v-else/>
</div> </div>
<h2>创作记录</h2> <h2>创作记录</h2>
<div class="finish-job-list" v-loading="loading" element-loading-background="rgba(0, 0, 0, 0.5)"> <div class="finish-job-list">
<div v-if="finishedJobs.length > 0"> <div v-if="finishedJobs.length > 0">
<ItemList :items="finishedJobs" :width="240" :gap="16"> <ItemList :items="finishedJobs" :width="240" :gap="16">
<template #default="scope"> <template #default="scope">
@ -632,11 +632,14 @@ const initData = () => {
fetchFinishJobs() fetchFinishJobs()
connect() connect()
}).catch(() => { }).catch(() => {
loading.value = false
}); });
} }
const fetchRunningJobs = () => { const fetchRunningJobs = () => {
if (!isLogin.value) {
return
}
// //
httpGet(`/api/sd/jobs?status=0`).then(res => { httpGet(`/api/sd/jobs?status=0`).then(res => {
const jobs = res.data const jobs = res.data
@ -671,10 +674,11 @@ const handleScrollEnd = () => {
const page = ref(1) const page = ref(1)
const pageSize = ref(15) const pageSize = ref(15)
const isOver = ref(false) const isOver = ref(false)
const loading = ref(false)
// //
const fetchFinishJobs = (page) => { const fetchFinishJobs = (page) => {
loading.value = true if (!isLogin.value) {
return
}
httpGet(`/api/sd/jobs?status=1&page=${page}&page_size=${pageSize.value}`).then(res => { httpGet(`/api/sd/jobs?status=1&page=${page}&page_size=${pageSize.value}`).then(res => {
if (res.data.length < pageSize.value) { if (res.data.length < pageSize.value) {
isOver.value = true isOver.value = true
@ -684,9 +688,7 @@ const fetchFinishJobs = (page) => {
} else { } else {
finishedJobs.value = finishedJobs.value.concat(res.data) finishedJobs.value = finishedJobs.value.concat(res.data)
} }
loading.value = false
}).catch(e => { }).catch(e => {
loading.value = false
ElMessage.error("获取任务失败:" + e.message) ElMessage.error("获取任务失败:" + e.message)
}) })
} }

View File

@ -72,7 +72,7 @@
</template> </template>
</v3-waterfall> </v3-waterfall>
<v3-waterfall v-if="imgType === 'dall'" <v3-waterfall v-else-if="imgType === 'dall'"
id="waterfall" id="waterfall"
:list="data['dall']" :list="data['dall']"
srcKey="img_thumb" srcKey="img_thumb"