抛弃轮询,使用websocket获取任务进度;部分优化;去除残留的条件判断;修复去除临时本子时加载不存在的预览图(同步更新)写死图片宽度;

This commit is contained in:
chuzhongzai
2023-12-28 16:34:48 +08:00
parent e0ec08c874
commit 5cf7549b35
4 changed files with 94 additions and 128 deletions
+4 -6
View File
@@ -45,7 +45,7 @@
<el-dialog title="查询本子" v-model="chosenGallery" style="height: 350px">
<el-image v-show='chosenGallery.thumb_link !== undefined'
style="float: right; width: 250px; height: 250px;" fit="contain"
:src="'https://downloader.lionwebsite.xyz/GalleryManage/ehThumbnail?path=' + chosenGallery.thumb_link"/>
:src="chosenGallery.thumb_link !== undefined ? 'https://downloader.lionwebsite.xyz/GalleryManage/ehThumbnail?path=' + chosenGallery.thumb_link: ''"/>
<table>
<tr>本子名字:{{chosenGallery.name}}</tr>
<tr>本子页数:{{chosenGallery.pages}}</tr>
@@ -62,10 +62,9 @@
</table>
<template #footer>
<el-button @click="postTask" v-if="chosenGallery.availableResolution">下载</el-button>
<el-button @click="window.open(chosenGallery.download)" v-else>下载文件</el-button>
<el-button @click="readOnlineGallery(chosenGallery)">在线预览</el-button>
<tr v-if="chosenGallery.status === '下载完成'">
<el-button @click="deleteGallery">删除</el-button>
</tr>
<el-button v-if="chosenGallery.status === '下载完成'" @click="deleteGallery">删除</el-button>
</template>
</el-dialog>
@@ -111,7 +110,6 @@
在线预览<hr>
<span style="display: inline-block">在线预览分页页数:</span>
<input v-model="lengthPerPage">
(建议为3的倍数,因为固定了一行三张)
</div>
<template #footer>
<el-button type="primary" @click="saveConfig">保存</el-button>
@@ -157,6 +155,7 @@ let realAuthCode = computed(() => {
let chosenGallery = computed(() => {
param.value = ''
targetResolution.value = ''
return store.state.chosenGallery
})
@@ -203,7 +202,6 @@ function postTask(){
store.dispatch("postGalleryTask",
{link: chosenGallery.value.link,
targetResolution: targetResolution.value})
targetResolution.value = ""
}
//查询任务
+2 -4
View File
@@ -86,13 +86,11 @@ function set_current_page(page){
</div>
</template>
<el-scrollbar height="75vh" ref="onlineReadingScrollbar">
<div v-for="(link, i) in links" style="display: inline-block; text-align: center">
<el-image :src="link" :style="{'width': store.state.imageWidth, 'padding-right': store.state.imagePadding, 'background-color': 'gary'}"
<div v-for="(link, i) in links" style="display: inline-block; text-align: center; min-height: 300px">
<el-image :src="link" :style="{'width': '66vw', 'background-color': 'gary'}"
:preview-src-list="links" :initial-index="i" @switch="switch_page" @show="set_current_page(i)" loading="lazy"/><br>
{{lengthPerPage * index + i + 1}}
</div>
</el-scrollbar>
<!-- 十页以下-->
+2 -4
View File
@@ -35,9 +35,9 @@
<el-table-column label="操作" width="300vw">
<template #default="scoped">
<span>
<el-button @click="downloadTask(scoped.row.download)" :disabled="scoped.row.status !== '下载完成' || scoped.row.mode === 2">下载</el-button>
<el-button @click="downloadTask(scoped.row.download)" :disabled="scoped.row.status !== '下载完成'">下载</el-button>
<el-button @click="changeGalleryCollect(scoped.row.gid, scoped.row.isCollect)">{{scoped.row.isCollect ? '取消收藏' : '收藏'}}</el-button>
<el-button @click="readOnlineGallery(scoped.row)" :disabled="scoped.row.status !== '下载完成' || scoped.row.mode === 1">在线看</el-button>
<el-button @click="readOnlineGallery(scoped.row)">在线看</el-button>
</span>
</template>
</el-table-column>
@@ -102,8 +102,6 @@ import axios from "axios";
import {ElMessage} from "element-plus";
import OnlineReader from "./OnlineReader.vue";
let GalleryManagePrefix = "https://downloader.lionwebsite.xyz/GalleryManage/"
//输入
let inputNode = ref(null)
//是否正在编辑页数