优化代码

This commit is contained in:
chuzhongzai 2024-03-04 23:12:05 +08:00
parent b02e96a021
commit 5e4b700e0c
5 changed files with 22 additions and 20 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="DashBoard" v-show="loadComplete"> <div class="DashBoard" v-show="loadComplete">
<span>E站额度本周已用:{{weekUsed.weekUsedAmount}} 上次重置时间:{{weekUsed.lastResetAmountTime}}</span><br> <span>本周已用额度:{{weekUsed.weekUsedAmount}} 上次重置时间:{{weekUsed.lastResetAmountTime}}</span><br>
<el-button @click="queryWeekUsedAmount">查询用量</el-button> <el-button @click="queryWeekUsedAmount">查询用量</el-button>
<hr> <hr>
<el-row> <el-row>
@ -28,7 +28,7 @@
<span style="display: inline">夜间模式</span> <span style="display: inline">夜间模式</span>
<el-switch @click="toggleStyle" v-model="isDark">夜间模式</el-switch> <el-switch @click="toggleStyle" v-model="isDark">夜间模式</el-switch>
<hr> <hr>
<el-button @click="isQuerying = true">里站搜索</el-button> <el-button @click="isQuerying = true">在线搜索</el-button>
<hr> <hr>
<el-button v-if="isLion" @click="resetUndone">重置任务</el-button> <el-button v-if="isLion" @click="resetUndone">重置任务</el-button>
<div v-show="thumbnailGallery.thumb_link !== undefined"> <div v-show="thumbnailGallery.thumb_link !== undefined">
@ -42,16 +42,16 @@
</div> </div>
</div> </div>
<el-dialog title="查询本子" v-model="chosenGallery" style="height: 350px"> <el-dialog title="查询" v-model="chosenGallery" style="height: 350px">
<el-image v-show='chosenGallery.thumb_link !== undefined' <el-image v-show='chosenGallery.thumb_link !== undefined'
style="float: right; width: 250px; height: 250px;" fit="contain" style="float: right; width: 250px; height: 250px;" fit="contain"
:src="chosenGallery.thumb_link !== undefined ? '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> <table>
<tr>本子名字:{{chosenGallery.name}}</tr> <tr>名字:{{chosenGallery.name}}</tr>
<tr>本子页数:{{chosenGallery.pages}}</tr> <tr>页数:{{chosenGallery.pages}}</tr>
<tr>本子语言:{{chosenGallery.language}}</tr> <tr>语言:{{chosenGallery.language}}</tr>
<tr>本子大小:{{chosenGallery.fileSize}}</tr> <tr>大小:{{chosenGallery.fileSize}}</tr>
<tr>本子状态:{{chosenGallery.status}}</tr> <tr>状态:{{chosenGallery.status}}</tr>
<tr v-if="chosenGallery.availableResolution"> <tr v-if="chosenGallery.availableResolution">
目标分辨率:<el-select v-model="targetResolution" style="width: 200px"> 目标分辨率:<el-select v-model="targetResolution" style="width: 200px">
<el-option v-for="(fileSize, resolution) in chosenGallery.availableResolution" :value="resolution" <el-option v-for="(fileSize, resolution) in chosenGallery.availableResolution" :value="resolution"

View File

@ -74,7 +74,7 @@ function close(){
</script> </script>
<template> <template>
<el-dialog title="里站搜索" v-model="isShowUp" top="0" style="margin-bottom: 0" @close="close"> <el-dialog title="在线搜索" v-model="isShowUp" top="0" style="margin-bottom: 0" @close="close">
<div style="text-align: center"> <div style="text-align: center">
<el-input v-model="keyword"></el-input> <el-button @click="queryGalleries(null)">查询</el-button> <div id="loading"/> <el-input v-model="keyword"></el-input> <el-button @click="queryGalleries(null)">查询</el-button> <div id="loading"/>
</div> </div>

View File

@ -25,7 +25,7 @@ watch((store.state), (value) => {
} }
}) })
// //
function alterPage(){ function alterPage(){
if(readingGallery.value.images.length > lengthPerPage.value){ if(readingGallery.value.images.length > lengthPerPage.value){
links.value = readingGallery.value.images.slice(0, lengthPerPage.value) links.value = readingGallery.value.images.slice(0, lengthPerPage.value)

View File

@ -1,6 +1,5 @@
<template> <template>
<div class="side" style="width: 100%"> <div class="side" style="width: 100%">
<span v-show="loadComplete">本子历史</span>
<div v-show="loadComplete" class="load_complete"> <div v-show="loadComplete" class="load_complete">
<el-table :data="currentTasks" <el-table :data="currentTasks"
:empty-text="emptyText" :empty-text="emptyText"
@ -49,7 +48,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-row class="pageChanger"> <el-row class="pageChanger">
<el-col> <el-col v-if="username !== 'test'">
<el-select v-model="category" @change="changeCategory"> <el-select v-model="category" @change="changeCategory">
<template #prefix> <template #prefix>
分类 分类
@ -109,6 +108,9 @@ let category = ref("myDownload") //myDownload myCollect total
let galleryNameType = ref("shortName") // shortName name let galleryNameType = ref("shortName") // shortName name
let sortType = ref("shortName") // shortName name createTime let sortType = ref("shortName") // shortName name createTime
let targetPage = ref(1) // let targetPage = ref(1) //
let username = computed(() => {
return store.state.username
})
// //
let debounceTimer = 0 let debounceTimer = 0
@ -139,7 +141,7 @@ let isLion = computed(() => {
let emptyText = computed(() => { let emptyText = computed(() => {
let action = category.value === 'myDownload' ? '下载': '收藏' let action = category.value === 'myDownload' ? '下载': '收藏'
return '您未' + action + "本子" return '您未' + action + ""
}) })
// //

View File

@ -368,14 +368,14 @@ const mutations = {
const state = { const state = {
websocket: {}, //websocket websocket: {}, //websocket
totalGalleryTask: [], //存放本子数据的数组 totalGalleryTask: [], //存放数据的数组
chosenGallery: false, //准备下载的本子 chosenGallery: false, //准备下载
thumbnailGallery: {}, //缩略图本子 thumbnailGallery: {}, //缩略图
collectGallery: [], //收藏的本子 collectGallery: [], //收藏
downloadGallery: [], //下载的本子 downloadGallery: [], //下载
isSearch: false, //用于决定是否显示搜索结果 isSearch: false, //用于决定是否显示搜索结果
readingGallery: {'name': '', 'images': []}, //在线看本子 readingGallery: {'name': '', 'images': []}, //在线看
isReading: false, //是否正在看 isReading: false, //是否正在看
currentGid: "", //当前GID currentGid: "", //当前GID
@ -391,7 +391,7 @@ const state = {
isAuth: false, //是否授权 isAuth: false, //是否授权
AuthCode: '', //授权码 AuthCode: '', //授权码
loadComplete: false, //是否加载完成 loadComplete: false, //是否加载完成
galleryRefreshTimer: 0, //本子更新计时器id galleryRefreshTimer: 0, //更新计时器id
isInclude: false, //是否搜索到任务 isInclude: false, //是否搜索到任务
searchTask: [], //搜索到的任务 searchTask: [], //搜索到的任务