opt: 缩略图生成算法

This commit is contained in:
RockYang
2023-11-28 14:50:19 +08:00
parent ce8fa79206
commit 7a2ffdf39c
6 changed files with 18 additions and 9 deletions

View File

@@ -4,6 +4,7 @@
color #ffffff
overflow-x hidden
.running-job-list {
.job-item {
//border: 1px solid #454545;

View File

@@ -45,9 +45,9 @@ onMounted(() => {
})
const computeSize = () => {
const w = container.value.offsetWidth - 8 // 减去滚动条的宽度
const w = container.value.offsetWidth - 10 // 减去滚动条的宽度
let cols = Math.floor(w / props.width)
itemWidth.value = Math.ceil(w / cols)
itemWidth.value = Math.floor(w / cols)
}
window.onresize = () => {

View File

@@ -259,7 +259,7 @@ const getNext = () => {
// 生成缩略图
const imageList = res.data
for (let i = 0; i < imageList.length; i++) {
imageList[i]["img_thumb"] = imageList[i]["img_url"] + "?imageView2/4/w/300/q/75"
imageList[i]["img_thumb"] = imageList[i]["img_url"] + "?imageView2/4/w/300/h/0/q/75"
}
if (list.value.length === 0) {
list.value = imageList