优化代码
This commit is contained in:
parent
aee27de0c0
commit
8ba8a5d125
@ -5,7 +5,7 @@
|
||||
<hr>
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-input style="width: 200px;" v-model="param" v-if="type !== 'tag'">
|
||||
<el-input style="width: 200px;" v-model="param">
|
||||
<template #prepend>
|
||||
链接:
|
||||
</template>
|
||||
@ -14,7 +14,7 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<hr>
|
||||
<el-button @click="isQuerying = true">里站搜索</el-button>
|
||||
<el-button @click="isQuerying = true">在线搜索</el-button>
|
||||
<el-button @click="isAlterAuthCode = true">修改授权码</el-button>
|
||||
<el-button @click="deleteAuthCode">删除本地授权码</el-button>
|
||||
<el-button @click="isConfig = true">配置</el-button><br>
|
||||
@ -24,15 +24,15 @@
|
||||
<el-button v-if="isLion" @click="resetUndone">重置任务</el-button>
|
||||
</el-drawer>
|
||||
|
||||
<el-dialog title="查询本子" v-model="chosenGallery" width="100%">
|
||||
<el-dialog title="查询" v-model="chosenGallery" width="100%">
|
||||
<el-image v-show='chosenGallery.thumb_link !== undefined' style="float: right; width: 250px; height: 250px" fit="contain"
|
||||
:src="chosenGallery.thumb_link !== undefined ? 'https://downloader.lionwebsite.xyz/GalleryManage/ehThumbnail?path=' + chosenGallery.thumb_link: ''"/>
|
||||
<table>
|
||||
<tr>本子名字:{{chosenGallery.name}}</tr>
|
||||
<tr>本子页数:{{chosenGallery.pages}}</tr>
|
||||
<tr>本子语言:{{chosenGallery.language}}</tr>
|
||||
<tr>本子大小:{{chosenGallery.fileSize}}</tr>
|
||||
<tr>本子状态:{{chosenGallery.status}}</tr>
|
||||
<tr>名字:{{chosenGallery.name}}</tr>
|
||||
<tr>页数:{{chosenGallery.pages}}</tr>
|
||||
<tr>语言:{{chosenGallery.language}}</tr>
|
||||
<tr>大小:{{chosenGallery.fileSize}}</tr>
|
||||
<tr>状态:{{chosenGallery.status}}</tr>
|
||||
<tr v-if="chosenGallery.availableResolution">
|
||||
目标分辨率:<el-select v-model="targetResolution">
|
||||
<el-option v-for="(fileSize, resolution) in chosenGallery.availableResolution" :value="resolution"
|
||||
@ -40,12 +40,6 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</tr>
|
||||
<tr v-if="chosenGallery.availableResolution">
|
||||
标签:<el-tag v-for="tid in paramForTags" closable @close="removeQueryTag(tid)">
|
||||
{{store.state.tags.get(tid).tag}}
|
||||
</el-tag>
|
||||
<el-autocomplete v-model="param" :fetch-suggestions="completeQueryTag" @select="handleTagSelect" ref="tagInputForSubmit"/>
|
||||
</tr>
|
||||
</table>
|
||||
<template #footer>
|
||||
<el-button @click="onlineGalleryReader(chosenGallery)">在线预览</el-button>
|
||||
@ -132,7 +126,6 @@ let type = ref("link")
|
||||
let param = ref("")
|
||||
|
||||
let targetResolution = ref("")
|
||||
let targetDownloadMode = ref("")
|
||||
|
||||
let realAuthCode = computed(() => {
|
||||
return store.state.AuthCode
|
||||
@ -185,14 +178,9 @@ function postTask(){
|
||||
ElMessage("请选择分辨率再提交")
|
||||
return
|
||||
}
|
||||
if(targetDownloadMode.value === ''){
|
||||
ElMessage("请选择下载模式再提交")
|
||||
return
|
||||
}
|
||||
store.dispatch("postGalleryTask",
|
||||
{link: chosenGallery.value.link,
|
||||
targetResolution: targetResolution.value,
|
||||
mode: targetDownloadMode.value})
|
||||
targetResolution: targetResolution.value})
|
||||
targetResolution.value = ""
|
||||
}
|
||||
|
||||
@ -206,27 +194,6 @@ function queryRemoteTask(){
|
||||
param.value = param.value.replace("e-hentai", "exhentai")
|
||||
store.dispatch("queryGalleryTask", param.value)
|
||||
}
|
||||
function queryLocalTask(){
|
||||
switch (type.value){
|
||||
case "link":
|
||||
store.commit("_searchLocalByLink", param.value)
|
||||
break
|
||||
case "keyword":
|
||||
store.commit("_searchLocalByKeyword", param.value)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
function removeQueryTag(tid){
|
||||
for (let i=0; i<paramForTags.value.length; i++){
|
||||
if(paramForTags.value[i] === tid){
|
||||
paramForTags.value.splice(i, 1)
|
||||
break
|
||||
}
|
||||
}
|
||||
if(chosenGallery.value.gid === undefined) //查询本地标签
|
||||
queryLocalTask()
|
||||
}
|
||||
|
||||
//删除任务
|
||||
function deleteGallery(){
|
||||
|
||||
@ -93,7 +93,7 @@ function adjustGalleryName(name, length) {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-dialog title="里站搜索" v-model="isShowUp" top="0" style="margin-bottom: 0" fullscreen class="el-dialogClass" @close="close">
|
||||
<el-dialog title="在线搜索" v-model="isShowUp" top="0" style="margin-bottom: 0" fullscreen class="el-dialogClass" @close="close">
|
||||
<div style="text-align: center">
|
||||
<el-input v-model="keyword" style="width: 50vw"></el-input> <el-button @click="queryGalleries(null)">查询</el-button> <div id="loading"/>
|
||||
</div>
|
||||
|
||||
@ -25,7 +25,7 @@ watch((store.state), (value) => {
|
||||
}
|
||||
})
|
||||
|
||||
//切换本子
|
||||
//切换
|
||||
function alterPage(){
|
||||
if(readingGallery.value.images.length > lengthPerPage.value){
|
||||
links.value = readingGallery.value.images.slice(0, lengthPerPage.value)
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
</el-col>
|
||||
|
||||
<el-row class="pageChanger">
|
||||
<el-col>
|
||||
<el-col v-if="username !== 'test'">
|
||||
<el-select v-model="category" @change="changeCategory">
|
||||
<template #prefix>
|
||||
分类
|
||||
@ -130,6 +130,9 @@ let category = ref("myDownload") //myDownload myCollect total
|
||||
let galleryNameType = ref("shortName") // shortName name
|
||||
let sortType = ref("shortName") // shortName name createTime
|
||||
let targetPage = ref(1) // 当前页数
|
||||
let username = computed(() => {
|
||||
return store.state.username
|
||||
})
|
||||
|
||||
//查询相关
|
||||
let type = ref("keyword")
|
||||
@ -161,7 +164,7 @@ let isLion = computed(() => {
|
||||
|
||||
let emptyText = computed(() => {
|
||||
let action = category.value === 'myDownload' ? '下载': '收藏'
|
||||
return '您未' + action + '本子'
|
||||
return '您未' + action + '过'
|
||||
})
|
||||
|
||||
//查看详情
|
||||
|
||||
@ -370,13 +370,13 @@ const mutations = {
|
||||
const state = {
|
||||
websocket: {}, //websocket
|
||||
|
||||
totalGalleryTask: [], //存放本子数据的数组
|
||||
chosenGallery: false, //准备下载的本子
|
||||
collectGallery: [], //收藏的本子
|
||||
downloadGallery: [], //下载的本子
|
||||
totalGalleryTask: [], //存放数据的数组
|
||||
chosenGallery: false, //准备下载
|
||||
collectGallery: [], //收藏
|
||||
downloadGallery: [], //下载
|
||||
isSearch: false, //用于决定是否显示搜索结果
|
||||
|
||||
readingGallery: {'name': '', 'images': []}, //在线看本子
|
||||
readingGallery: {'name': '', 'images': []}, //在线看
|
||||
isReading: false, //是否正在看
|
||||
|
||||
currentGid: "", //当前GID
|
||||
@ -392,7 +392,7 @@ const state = {
|
||||
isAuth: false, //是否授权
|
||||
AuthCode: '', //授权码
|
||||
loadComplete: false, //是否加载完成
|
||||
galleryRefreshTimer: 0, //本子更新计时器id
|
||||
galleryRefreshTimer: 0, //更新计时器id
|
||||
|
||||
isInclude: false, //是否搜索到任务
|
||||
searchTask: [], //搜索到的任务
|
||||
|
||||
Loading…
Reference in New Issue
Block a user