抛弃轮询,使用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 = ""
}
//查询任务