去除标签;修改在线看,允许未下载的本子在线看(同步更新);修复里站搜索时切换页面不会回到顶部;修复里站搜索时不会显示加载图标
This commit is contained in:
parent
f1270e3ebb
commit
61c4dbc8e8
@ -20,24 +20,21 @@
|
|||||||
<el-button @click="isConfig = true">配置</el-button><br>
|
<el-button @click="isConfig = true">配置</el-button><br>
|
||||||
<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>
|
|
||||||
<el-button @click="isQuerying = true">里站搜索</el-button>
|
|
||||||
<el-button @click="isViewingTag = true">查看标签</el-button>
|
|
||||||
<br>
|
<br>
|
||||||
<el-button v-if="isLion" @click="resetUndone">重置任务</el-button>
|
<el-button v-if="isLion" @click="resetUndone">重置任务</el-button>
|
||||||
<div v-show="thumbnailGallery.url !== undefined">
|
<div v-show="thumbnailGallery.thumb_link !== undefined">
|
||||||
<span>
|
<span>
|
||||||
{{thumbnailGallery.shortName}}
|
{{thumbnailGallery.shortName}}
|
||||||
</span><br>
|
</span><br>
|
||||||
<picture>
|
<picture>
|
||||||
<el-image :src="thumbnailGallery.url" :preview-src-list="[thumbnailGallery.images[0],]" :initial-index="0" class="preview"
|
<el-image :src="thumbnailGallery.thumb_link" :preview-src-list="[thumbnailGallery.thumb_link,]" class="preview"
|
||||||
style="height: 30vh" fit="contain"/>
|
style="height: 30vh" fit="contain"/>
|
||||||
</picture>
|
</picture>
|
||||||
</div>
|
</div>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
|
|
||||||
<el-dialog title="查询本子" v-model="chosenGallery" width="100%">
|
<el-dialog title="查询本子" v-model="chosenGallery" width="100%">
|
||||||
<el-image v-if='chosenGallery.thumb_link !== undefined' style="float: right; width: 250px; height: 250px" fit="contain"
|
<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="'https://downloader.lionwebsite.xyz/GalleryManage/ehThumbnail?path=' + chosenGallery.thumb_link"/>
|
||||||
<table>
|
<table>
|
||||||
<tr>本子名字:{{chosenGallery.name}}</tr>
|
<tr>本子名字:{{chosenGallery.name}}</tr>
|
||||||
@ -52,13 +49,6 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-if="chosenGallery.availableResolution">
|
|
||||||
下载模式:<el-select v-model="targetDownloadMode" style="width: 200px" default-first-option>
|
|
||||||
<el-option :value="1" label="仅下载"/>
|
|
||||||
<el-option :value="2" label="仅在线看"/>
|
|
||||||
<el-option :value="3" label="在线看并下载"/>
|
|
||||||
</el-select>
|
|
||||||
</tr>
|
|
||||||
<tr v-if="chosenGallery.availableResolution">
|
<tr v-if="chosenGallery.availableResolution">
|
||||||
标签:<el-tag v-for="tid in paramForTags" closable @close="removeQueryTag(tid)">
|
标签:<el-tag v-for="tid in paramForTags" closable @close="removeQueryTag(tid)">
|
||||||
{{store.state.tags.get(tid).tag}}
|
{{store.state.tags.get(tid).tag}}
|
||||||
@ -66,13 +56,13 @@
|
|||||||
<el-autocomplete v-model="param" :fetch-suggestions="completeQueryTag" @select="handleTagSelect" ref="tagInputForSubmit"/>
|
<el-autocomplete v-model="param" :fetch-suggestions="completeQueryTag" @select="handleTagSelect" ref="tagInputForSubmit"/>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<el-button @click="postTask" v-if="chosenGallery.availableResolution">下载</el-button>
|
<template #footer>
|
||||||
<el-button @click="removeAllQueryTag" v-if="chosenGallery.availableResolution">清空标签</el-button>
|
<el-button @click="onlineGalleryReader(chosenGallery)">在线预览</el-button>
|
||||||
<tr v-if="chosenGallery.status === '下载完成'">
|
<el-button @click="postTask" v-if="chosenGallery.availableResolution">下载</el-button>
|
||||||
<el-button @click="onlineGalleryReader(chosenGallery.gid)">在线预览</el-button>
|
<tr v-if="chosenGallery.status === '下载完成'">
|
||||||
<el-button @click="showThumbnail(chosenGallery)">查看封面图</el-button>
|
<el-button @click="deleteGallery">删除</el-button>
|
||||||
<el-button @click="deleteGallery">删除</el-button>
|
</tr>
|
||||||
</tr>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<HentaiSearch :is-querying="isQuerying" @close="isQuerying = false"></HentaiSearch>
|
<HentaiSearch :is-querying="isQuerying" @close="isQuerying = false"></HentaiSearch>
|
||||||
@ -123,33 +113,6 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<el-dialog title="查看标签" v-model="isViewingTag" style="margin-top: 0; width: 100%">
|
|
||||||
<div style="text-align: center">
|
|
||||||
输入关键字:<el-input style="width: 150px" v-model="tagKeyWord"></el-input><br>
|
|
||||||
<el-button @click="tagKeyWord = ''">重置关键字</el-button>
|
|
||||||
<el-button @click="pullNewTag">刷新</el-button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<el-table :data="tags" height="350px" stripe>
|
|
||||||
<el-table-column prop="id" label="id" width="50px" sortable/>
|
|
||||||
<el-table-column prop="tag" label="标签" width="150px"/>
|
|
||||||
<el-table-column prop="usage" label="用量" width="75px" sortable/>
|
|
||||||
|
|
||||||
<el-table-column width="75px">
|
|
||||||
<template #default="scoped">
|
|
||||||
<el-button v-if="scoped.row.usage === 0" @click="deleteTag(scoped.row.id)">删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<span style="color: red; font: bold 15px sans-serif">
|
|
||||||
创建标签前先看看有没有符合的,尽量用统一一点的标签,比如已经有个图包就不要创建图集之类的了。毕竟标签多起来数据挺多的。
|
|
||||||
</span>
|
|
||||||
<template #footer>
|
|
||||||
输入新标签:<el-input v-model="tag" style="width: 100px"></el-input>
|
|
||||||
<el-button @click="postTag">创建标签</el-button>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
<div class="DashBoard" v-show="!loadComplete">
|
<div class="DashBoard" v-show="!loadComplete">
|
||||||
<div class="validate">
|
<div class="validate">
|
||||||
<el-input v-model="AuthCode" placeholder="请输入授权码" />
|
<el-input v-model="AuthCode" placeholder="请输入授权码" />
|
||||||
@ -163,7 +126,6 @@
|
|||||||
import store from "../store";
|
import store from "../store";
|
||||||
import {computed, ref, onMounted} from "vue";
|
import {computed, ref, onMounted} from "vue";
|
||||||
import {ElMessage} from "element-plus"
|
import {ElMessage} from "element-plus"
|
||||||
import axios from "axios";
|
|
||||||
import HentaiSearch from "./HentaiSearch.vue";
|
import HentaiSearch from "./HentaiSearch.vue";
|
||||||
|
|
||||||
//授权码相关
|
//授权码相关
|
||||||
@ -174,7 +136,6 @@ let newAuthCode = ref("")
|
|||||||
let tempAuthCode = ref("")
|
let tempAuthCode = ref("")
|
||||||
|
|
||||||
let isQuerying = ref(false)
|
let isQuerying = ref(false)
|
||||||
let isViewingTag = ref(false)
|
|
||||||
let isConfig = ref(false)
|
let isConfig = ref(false)
|
||||||
let isDark = ref(false)
|
let isDark = ref(false)
|
||||||
let keyword = ref("furry yaoi")
|
let keyword = ref("furry yaoi")
|
||||||
@ -184,19 +145,15 @@ let lengthPerPage = ref(0)
|
|||||||
//查询相关
|
//查询相关
|
||||||
let type = ref("link")
|
let type = ref("link")
|
||||||
let param = ref("")
|
let param = ref("")
|
||||||
let paramForTags = ref([]) //tidS
|
|
||||||
|
|
||||||
let targetResolution = ref("")
|
let targetResolution = ref("")
|
||||||
let targetDownloadMode = ref("")
|
let targetDownloadMode = ref("")
|
||||||
let tag = ref("")
|
|
||||||
let tagKeyWord = ref("") //查询tag的关键字
|
|
||||||
|
|
||||||
let realAuthCode = computed(() => {
|
let realAuthCode = computed(() => {
|
||||||
return store.state.AuthCode
|
return store.state.AuthCode
|
||||||
})
|
})
|
||||||
|
|
||||||
let chosenGallery = computed(() => {
|
let chosenGallery = computed(() => {
|
||||||
paramForTags.value.splice(0)
|
|
||||||
param.value = ''
|
param.value = ''
|
||||||
return store.state.chosenGallery
|
return store.state.chosenGallery
|
||||||
})
|
})
|
||||||
@ -208,27 +165,8 @@ let loadComplete = computed(() => {
|
|||||||
let weekUsed = computed(() => {
|
let weekUsed = computed(() => {
|
||||||
return store.state.weekUsed
|
return store.state.weekUsed
|
||||||
})
|
})
|
||||||
let tags = computed(() => {
|
|
||||||
let tags = store.state.tags
|
|
||||||
let result = []
|
|
||||||
tags.forEach((tag) => {
|
|
||||||
result.push(tag)
|
|
||||||
})
|
|
||||||
|
|
||||||
if(isViewingTag.value) { //正在查看标签
|
|
||||||
if (tagKeyWord.value.trim() === '')
|
|
||||||
return result
|
|
||||||
else
|
|
||||||
return result.filter((tag) => {
|
|
||||||
return tag.tag.includes(tagKeyWord.value)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return result
|
|
||||||
})
|
|
||||||
|
|
||||||
let thumbnailGallery = computed(() => {
|
let thumbnailGallery = computed(() => {
|
||||||
if(store.state.thumbnailGallery.images === undefined)
|
|
||||||
store.state.thumbnailGallery.images = []
|
|
||||||
return store.state.thumbnailGallery
|
return store.state.thumbnailGallery
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -236,18 +174,6 @@ let isLion = computed(() => {
|
|||||||
return store.state.userId === 3
|
return store.state.userId === 3
|
||||||
})
|
})
|
||||||
|
|
||||||
function pullNewTag(){
|
|
||||||
store.dispatch("loadTags")
|
|
||||||
}
|
|
||||||
|
|
||||||
function postTag(){
|
|
||||||
store.dispatch("postTag", tag.value)
|
|
||||||
}
|
|
||||||
|
|
||||||
function deleteTag(tid){
|
|
||||||
store.dispatch("deleteTag", tid)
|
|
||||||
}
|
|
||||||
|
|
||||||
//修改授权码
|
//修改授权码
|
||||||
function alterAuthCode(){
|
function alterAuthCode(){
|
||||||
if(newAuthCode.value.trim() === "" || tempAuthCode.value.trim() === "" || newAuthCode.value !== tempAuthCode.value)
|
if(newAuthCode.value.trim() === "" || tempAuthCode.value.trim() === "" || newAuthCode.value !== tempAuthCode.value)
|
||||||
@ -281,8 +207,7 @@ function postTask(){
|
|||||||
store.dispatch("postGalleryTask",
|
store.dispatch("postGalleryTask",
|
||||||
{link: chosenGallery.value.link,
|
{link: chosenGallery.value.link,
|
||||||
targetResolution: targetResolution.value,
|
targetResolution: targetResolution.value,
|
||||||
mode: targetDownloadMode.value,
|
mode: targetDownloadMode.value})
|
||||||
tags:tag.value})
|
|
||||||
targetResolution.value = ""
|
targetResolution.value = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,44 +229,8 @@ function queryLocalTask(){
|
|||||||
case "keyword":
|
case "keyword":
|
||||||
store.commit("_searchLocalByKeyword", param.value)
|
store.commit("_searchLocalByKeyword", param.value)
|
||||||
break
|
break
|
||||||
case "tag":
|
|
||||||
store.commit("_searchLocalByTag", paramForTags.value)
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let tagInput = ref({}) //用于查询
|
|
||||||
let tagInputForSubmit = ref({}) //用于提交
|
|
||||||
function completeQueryTag(keyWord, cb) {
|
|
||||||
if(keyWord.includes(' ')) { //查询多个标签的时候
|
|
||||||
let temp = keyWord.split(' ')
|
|
||||||
keyWord = temp[temp.length - 1]
|
|
||||||
}else{ //只有一个标签的时候
|
|
||||||
keyWord = param.value
|
|
||||||
}
|
|
||||||
let result = []
|
|
||||||
let skip
|
|
||||||
let hit = false //用于检测是否有重复标签
|
|
||||||
tags.value.forEach((tag) => {
|
|
||||||
if(tag.tag.includes(keyWord)) {
|
|
||||||
skip = false
|
|
||||||
for (let id of paramForTags.value) { //跳过已选中的标签
|
|
||||||
if(tag.id === id){
|
|
||||||
if(!hit && tag.tag === keyWord){ //是否命中标签
|
|
||||||
hit = true
|
|
||||||
}
|
|
||||||
skip = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!skip)
|
|
||||||
result.push({value: tag.tag, tid: tag.id})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if(result.length === 0 && !keyWord.includes("#") && chosenGallery.value.gid !== undefined && !hit){ //未命中结果并且准备与下载任务一并提交
|
|
||||||
result.push({value: '新建 #' + keyWord + ' 标签?', tag:keyWord})
|
|
||||||
}
|
|
||||||
cb(result)
|
|
||||||
}
|
|
||||||
|
|
||||||
function removeQueryTag(tid){
|
function removeQueryTag(tid){
|
||||||
for (let i=0; i<paramForTags.value.length; i++){
|
for (let i=0; i<paramForTags.value.length; i++){
|
||||||
@ -354,46 +243,6 @@ function removeQueryTag(tid){
|
|||||||
queryLocalTask()
|
queryLocalTask()
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeAllQueryTag(){
|
|
||||||
paramForTags.value.splice(0)
|
|
||||||
if(chosenGallery.value.gid === undefined) //查询本地标签
|
|
||||||
queryLocalTask()
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleTagSelect(data){
|
|
||||||
if('tag' in data){ //需要新建,不知道怎么处理回调,直接把axios搬到vue里面
|
|
||||||
axios.post("https://downloader.lionwebsite.xyz/GalleryManage/tag?" + qs.stringify({
|
|
||||||
tag:data.tag,
|
|
||||||
AuthCode: store.state.AuthCode
|
|
||||||
})
|
|
||||||
).then((res) => {
|
|
||||||
if (res.data.result === 'success') {
|
|
||||||
ElMessage('创建标签成功')
|
|
||||||
paramForTags.value.push(parseInt(res.data.tid))
|
|
||||||
tagInputForSubmit.value.blur()
|
|
||||||
store.dispatch("loadTags", false).then()
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ElMessage(res.data.data)
|
|
||||||
})}else{
|
|
||||||
paramForTags.value.push(data.tid)
|
|
||||||
console.log(chosenGallery)
|
|
||||||
if(chosenGallery.value.gid === undefined){
|
|
||||||
queryLocalTask()
|
|
||||||
tagInput.value.blur()
|
|
||||||
}else{
|
|
||||||
tagInputForSubmit.value.blur()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
param.value = ''
|
|
||||||
}
|
|
||||||
|
|
||||||
function resetLocalQuery(){
|
|
||||||
store.commit("_searchLocalByKeyword", "")
|
|
||||||
store.commit("_searchLocalByTag", [''])
|
|
||||||
param.value = ""
|
|
||||||
}
|
|
||||||
|
|
||||||
//删除任务
|
//删除任务
|
||||||
function deleteGallery(){
|
function deleteGallery(){
|
||||||
store.dispatch("deleteGallery", chosenGallery.value.gid)
|
store.dispatch("deleteGallery", chosenGallery.value.gid)
|
||||||
@ -411,7 +260,7 @@ function validate(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//验证链接以及伪装链接
|
//验证链接
|
||||||
function validateLink(rawLink){
|
function validateLink(rawLink){
|
||||||
if(rawLink.trim() === "")
|
if(rawLink.trim() === "")
|
||||||
return false
|
return false
|
||||||
@ -422,11 +271,8 @@ function validateLink(rawLink){
|
|||||||
}
|
}
|
||||||
|
|
||||||
//打开面板以及在线阅读
|
//打开面板以及在线阅读
|
||||||
function openPanel(){
|
function onlineGalleryReader(gallery){
|
||||||
store.commit("_openHistoryPanel")
|
store.dispatch("readOnlineGallery", gallery)
|
||||||
}
|
|
||||||
function onlineGalleryReader(gid){
|
|
||||||
store.dispatch("queryOnlineLinks", gid)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//重新给节点发送未完成任务
|
//重新给节点发送未完成任务
|
||||||
@ -445,12 +291,6 @@ function toggleStyle(){
|
|||||||
light()
|
light()
|
||||||
}
|
}
|
||||||
|
|
||||||
//显示缩略图
|
|
||||||
function showThumbnail(gallery){
|
|
||||||
store.commit("_changeThumbnailGallery", gallery)
|
|
||||||
setTimeout(() => {document.querySelector(".preview > img").click()}, 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const auth = localStorage.getItem("auth")
|
const auth = localStorage.getItem("auth")
|
||||||
adjustForStyle()
|
adjustForStyle()
|
||||||
|
|||||||
@ -14,7 +14,6 @@ let queryPage = ref({})
|
|||||||
let galleries = ref([])
|
let galleries = ref([])
|
||||||
let param = ref()
|
let param = ref()
|
||||||
let isShowUp = ref()
|
let isShowUp = ref()
|
||||||
let isLoading = ref()
|
|
||||||
watch(props, () => {
|
watch(props, () => {
|
||||||
isShowUp.value = props.isQuerying
|
isShowUp.value = props.isQuerying
|
||||||
})
|
})
|
||||||
@ -28,11 +27,11 @@ function queryGalleries(link){
|
|||||||
tempParam = keyword.value
|
tempParam = keyword.value
|
||||||
}
|
}
|
||||||
tempParam = tempParam.replace(" ", "+")
|
tempParam = tempParam.replace(" ", "+")
|
||||||
isLoading = true
|
document.getElementById("loading").style.display = "inline-block";
|
||||||
|
|
||||||
axios.get("https://downloader.lionwebsite.xyz/query?keyword=" + tempParam)
|
axios.get("https://downloader.lionwebsite.xyz/query?keyword=" + tempParam)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
isLoading = false
|
document.getElementById("loading").style.display = "none";
|
||||||
if (res.data.result === "success") {
|
if (res.data.result === "success") {
|
||||||
let tempGalleries = JSON.parse(res.data.data)
|
let tempGalleries = JSON.parse(res.data.data)
|
||||||
queryPage.value.first = 'first' in res.data ? res.data.first : undefined
|
queryPage.value.first = 'first' in res.data ? res.data.first : undefined
|
||||||
@ -44,6 +43,8 @@ function queryGalleries(link){
|
|||||||
tempGalleries.forEach((gallery) => {
|
tempGalleries.forEach((gallery) => {
|
||||||
galleries.value.push(gallery)
|
galleries.value.push(gallery)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
scrollBar.value.setScrollTop(0)
|
||||||
}else {
|
}else {
|
||||||
ElMessage({message: res.data.data, type: "error"})
|
ElMessage({message: res.data.data, type: "error"})
|
||||||
}
|
}
|
||||||
@ -94,7 +95,7 @@ function adjustGalleryName(name, length) {
|
|||||||
<template>
|
<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">
|
<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" v-if="isLoading"/>
|
<el-input v-model="keyword" style="width: 50vw"></el-input> <el-button @click="queryGalleries(null)">查询</el-button> <div id="loading"/>
|
||||||
</div>
|
</div>
|
||||||
<el-scrollbar height="75vh" ref="scrollBar">
|
<el-scrollbar height="75vh" ref="scrollBar">
|
||||||
<div style="height: 20vh; width: 100%; border-radius: 5px; padding-bottom: 2vh" v-for="gallery in galleries">
|
<div style="height: 20vh; width: 100%; border-radius: 5px; padding-bottom: 2vh" v-for="gallery in galleries">
|
||||||
@ -110,7 +111,10 @@ function adjustGalleryName(name, length) {
|
|||||||
<span>页数:{{gallery.page}}</span><br>
|
<span>页数:{{gallery.page}}</span><br>
|
||||||
<span class="ct6">类型:{{gallery.type}}</span><br>
|
<span class="ct6">类型:{{gallery.type}}</span><br>
|
||||||
<a :href="gallery.link">链接</a><br>
|
<a :href="gallery.link">链接</a><br>
|
||||||
<el-button style="position: relative; margin-left: 65%;" @click="param=gallery.link; queryRemoteTask()" type="primary">下载</el-button>
|
<el-button-group style=" margin-left: 50%; margin-top: -5vh">
|
||||||
|
<el-button @click="store.dispatch('readOnlineGallery', gallery)">在线看</el-button>
|
||||||
|
<el-button @click="param=gallery.link; queryRemoteTask()">查看详情</el-button>
|
||||||
|
</el-button-group>
|
||||||
</div>
|
</div>
|
||||||
</div><br>
|
</div><br>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
@ -135,7 +139,7 @@ function adjustGalleryName(name, length) {
|
|||||||
border-top-color: #3498db;
|
border-top-color: #3498db;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
animation: spin 1s linear infinite;
|
animation: spin 1s linear infinite;
|
||||||
display: inline-block;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes spin {
|
@keyframes spin {
|
||||||
|
|||||||
@ -1,9 +1,6 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import {computed, ref, watch} from "vue";
|
import {computed, ref} from "vue";
|
||||||
import store from "../store/index.js";
|
import store from "../store/index.js";
|
||||||
let props = defineProps(['currentGallery', 'isOnlineReading'])
|
|
||||||
let emit = defineEmits(['close'])
|
|
||||||
let isShowUp = ref()
|
|
||||||
let onlineReadingScrollbar = ref()
|
let onlineReadingScrollbar = ref()
|
||||||
let links = ref()
|
let links = ref()
|
||||||
let index = ref(0)
|
let index = ref(0)
|
||||||
@ -13,19 +10,21 @@ let current_page = 0
|
|||||||
let lengthPerPage = computed(() => {
|
let lengthPerPage = computed(() => {
|
||||||
return store.state.lengthPerPage
|
return store.state.lengthPerPage
|
||||||
})
|
})
|
||||||
|
let readingGallery = computed(() => {
|
||||||
watch(props, (props)=>{
|
return store.state.readingGallery
|
||||||
isShowUp.value = props.isOnlineReading
|
})
|
||||||
|
let isShowUp = computed(() => {
|
||||||
alterPage()
|
alterPage()
|
||||||
|
return store.state.isReading
|
||||||
})
|
})
|
||||||
|
|
||||||
//切换本子
|
//切换本子
|
||||||
function alterPage(){
|
function alterPage(){
|
||||||
if(props.currentGallery.images.length > lengthPerPage.value){
|
if(readingGallery.value.images.length > lengthPerPage.value){
|
||||||
links.value = props.currentGallery.images.slice(0, lengthPerPage.value)
|
links.value = readingGallery.value.images.slice(0, lengthPerPage.value)
|
||||||
max.value = Math.ceil(props.currentGallery.images.length / lengthPerPage.value)
|
max.value = Math.ceil(readingGallery.value.images.length / lengthPerPage.value)
|
||||||
}else{
|
}else{
|
||||||
links.value = props.currentGallery.images
|
links.value = readingGallery.value.images
|
||||||
max.value = 0
|
max.value = 0
|
||||||
}
|
}
|
||||||
index.value = 0
|
index.value = 0
|
||||||
@ -34,7 +33,7 @@ function alterPage(){
|
|||||||
|
|
||||||
//跳转到对应页数
|
//跳转到对应页数
|
||||||
function jump(targetIndex){
|
function jump(targetIndex){
|
||||||
links.value = props.currentGallery.images.slice(targetIndex * lengthPerPage.value, (targetIndex + 1) * lengthPerPage.value)
|
links.value = readingGallery.value.images.slice(targetIndex * lengthPerPage.value, (targetIndex + 1) * lengthPerPage.value)
|
||||||
index.value = targetIndex
|
index.value = targetIndex
|
||||||
temp_index.value = targetIndex + 1
|
temp_index.value = targetIndex + 1
|
||||||
onlineReadingScrollbar.value.setScrollTop(0)
|
onlineReadingScrollbar.value.setScrollTop(0)
|
||||||
@ -42,14 +41,12 @@ function jump(targetIndex){
|
|||||||
|
|
||||||
function closeDialog(){
|
function closeDialog(){
|
||||||
onlineReadingScrollbar.value.setScrollTop(0)
|
onlineReadingScrollbar.value.setScrollTop(0)
|
||||||
emit('close')
|
store.commit("_closeReader")
|
||||||
}
|
}
|
||||||
|
|
||||||
function switch_page(target_page){
|
function switch_page(target_page){
|
||||||
console.log(current_page, target_page)
|
|
||||||
//上一页
|
//上一页
|
||||||
if(target_page > (current_page + 1) && current_page === 0 && index.value > 0) {
|
if(target_page > (current_page + 1) && current_page === 0 && index.value > 0) {
|
||||||
console.log("上一页")
|
|
||||||
document.querySelector("span.el-image-viewer__btn.el-image-viewer__close").click()
|
document.querySelector("span.el-image-viewer__btn.el-image-viewer__close").click()
|
||||||
jump(index.value - 1)
|
jump(index.value - 1)
|
||||||
onlineReadingScrollbar.value.setScrollTop(onlineReadingScrollbar.value.wrapRef.scrollHeight)
|
onlineReadingScrollbar.value.setScrollTop(onlineReadingScrollbar.value.wrapRef.scrollHeight)
|
||||||
@ -66,7 +63,6 @@ function switch_page(target_page){
|
|||||||
|
|
||||||
//下一页
|
//下一页
|
||||||
}else if(target_page === 0 && current_page === lengthPerPage.value - 1 && index.value < max.value){
|
}else if(target_page === 0 && current_page === lengthPerPage.value - 1 && index.value < max.value){
|
||||||
console.log("下一页")
|
|
||||||
jump(index.value + 1)
|
jump(index.value + 1)
|
||||||
current_page = 0
|
current_page = 0
|
||||||
document.querySelector("div.el-scrollbar__wrap.el-scrollbar__wrap--hidden-default > div > div:nth-child(1) > img").click()
|
document.querySelector("div.el-scrollbar__wrap.el-scrollbar__wrap--hidden-default > div > div:nth-child(1) > img").click()
|
||||||
@ -84,15 +80,15 @@ function set_current_page(page){
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog v-model="isShowUp" @close="closeDialog" width="100%" top="0" fullscreen >
|
<el-dialog v-model="isShowUp" @close="closeDialog" width="100%" top="0" fullscreen >
|
||||||
<template #header style="padding-bottom: 0">
|
<template #header style="padding-bottom: 0">
|
||||||
在线预览: {{currentGallery.name}} 页数:{{currentGallery.pages}}<br>
|
在线预览: {{readingGallery.name}} 页数:{{readingGallery.pages}}<br>
|
||||||
<div style="font-size: 3vh; display: inline" v-if="max > 0">
|
<div style="font-size: 3vh; display: inline" v-if="max > 0">
|
||||||
{{ index + 1 }} - {{ (index) * lengthPerPage + 1 }} ~
|
{{ index + 1 }} - {{ (index) * lengthPerPage + 1 }} ~
|
||||||
{{ (index + 1) * lengthPerPage + 1 > currentGallery.images.length ? currentGallery.images.length : (index + 1) * lengthPerPage }}
|
{{ (index + 1) * lengthPerPage + 1 > readingGallery.images.length ? readingGallery.images.length : (index + 1) * lengthPerPage }}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-scrollbar height="75vh" ref="onlineReadingScrollbar">
|
<el-scrollbar height="75vh" ref="onlineReadingScrollbar">
|
||||||
<el-image v-for="(link, i) in links" :src="link" :style="{'width': 'auto', 'text-align': 'center', 'background-color': 'ghostwhite'}"
|
<el-image v-for="(link, i) in links" :src="link" :style="{'width': 'auto', 'text-align': 'center', 'background-color': 'ghostwhite'}"
|
||||||
:preview-src-list="links" :initial-index="i" @switch="switch_page" @show="set_current_page(i)"/>
|
:preview-src-list="links" :initial-index="i" @switch="switch_page" @show="set_current_page(i)" loading="lazy"/>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
|
|
||||||
<!--五页以下-->
|
<!--五页以下-->
|
||||||
|
|||||||
@ -1,12 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="side">
|
<div class="side">
|
||||||
<div v-show="loadComplete" class="load_complete">
|
<div v-show="loadComplete" class="load_complete">
|
||||||
|
|
||||||
<el-scrollbar max-height="80vh">
|
<el-scrollbar max-height="80vh">
|
||||||
|
<div v-if="currentTasks.length === 0">
|
||||||
|
{{emptyText}}
|
||||||
|
</div>
|
||||||
<div v-for="gallery in currentTasks" :style="{'height': '20vh', 'background': isDark() ? '': 'FloralWhite', 'border-radius': '1%',
|
<div v-for="gallery in currentTasks" :style="{'height': '20vh', 'background': isDark() ? '': 'FloralWhite', 'border-radius': '1%',
|
||||||
'margin-bottom': '10px'}"
|
'margin-bottom': '10px'}"
|
||||||
@click="viewInfo(gallery)" id="gallery">
|
@click="viewInfo(gallery)" id="gallery">
|
||||||
<el-image :src="getGalleryThumb(gallery)"
|
<el-image :src="gallery.thumb_link"
|
||||||
style="height: 20vh; width: 35vw; float:left"
|
style="height: 20vh; width: 35vw; float:left"
|
||||||
fit="contain"
|
fit="contain"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
@ -25,26 +27,16 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-button @click="store.state.isShowHistory = true">三</el-button>
|
<el-button @click="store.state.isShowHistory = true">三</el-button>
|
||||||
<el-select style="width: 22vw" v-model="type">
|
<el-select style="width: 22vw" v-model="type">
|
||||||
|
<el-option value="link" label="链接"/>
|
||||||
<el-option value="keyword" label="关键字"/>
|
<el-option value="keyword" label="关键字"/>
|
||||||
<el-option value="tag" label="标签"/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-input style="width: 60vw" v-model="param" v-show="type === 'keyword'" placeholder="关键字搜索">
|
<el-input style="width: 60vw" v-model="param" placeholder="搜索">
|
||||||
<template #append>
|
<template #append>
|
||||||
<el-button @click="queryLocalTask">搜索</el-button>
|
<el-button @click="queryLocalTask">搜索</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<el-autocomplete v-model="param" :fetch-suggestions="generateQueryTag"
|
|
||||||
@select="handleQueryTagSelect" placeholder="检索标签"
|
|
||||||
style="width: 60vw" v-if="type === 'tag'">
|
|
||||||
<template #append>
|
|
||||||
<el-button :disabled="paramForTags.length === 0" @click="removeAllQueryTag">清空tag</el-button>
|
|
||||||
</template>
|
|
||||||
</el-autocomplete>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-tag v-for="tid in paramForTags" closable @close="removeQueryTag(tid)" size="large" style="display: inline-block" v-if="paramForTags.length !== 0">
|
|
||||||
{{store.state.tags.get(tid).tag}}
|
|
||||||
</el-tag>
|
|
||||||
|
|
||||||
<el-row class="pageChanger">
|
<el-row class="pageChanger">
|
||||||
<el-col>
|
<el-col>
|
||||||
@ -89,25 +81,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-dialog v-model="isEditingTag" title="编辑本子标签" width="100%">
|
|
||||||
<el-form>
|
|
||||||
<el-form-item>
|
|
||||||
<template #label>
|
|
||||||
标签:
|
|
||||||
</template>
|
|
||||||
<template #default>
|
|
||||||
<el-tag v-for="tid in galleryForTag.tags" closable @close="disMark(galleryForTag.gid, tid)">
|
|
||||||
{{tags.get(tid).tag}}
|
|
||||||
</el-tag>
|
|
||||||
<el-autocomplete v-model="newTag" :fetch-suggestions="querySimilarTag" @select="handleTagSelect" ref="tagInput"/>
|
|
||||||
</template>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
<el-dialog v-model="isViewing" width="100%" top="0" style="padding: 0">
|
<el-dialog v-model="isViewing" width="100%" top="0" style="padding: 0">
|
||||||
<div style="height: 20vh; font: bold 16px semi-expanded">
|
<div style="height: 20vh; font: bold 16px semi-expanded">
|
||||||
<el-image :src="getGalleryThumb(currentGallery)"
|
<el-image :src="currentGallery.thumb_link"
|
||||||
style="float: left; width: 40vw; height: 20vh" fit="contain"/>
|
style="float: left; width: 40vw; height: 20vh" fit="contain"/>
|
||||||
{{adjustGalleryName(currentGallery.name, 150)}}
|
{{adjustGalleryName(currentGallery.name, 150)}}
|
||||||
</div>
|
</div>
|
||||||
@ -119,7 +95,6 @@
|
|||||||
分辨率:{{currentGallery.resolution}} <br>
|
分辨率:{{currentGallery.resolution}} <br>
|
||||||
链接:<a :href="currentGallery.link">link</a> <br>
|
链接:<a :href="currentGallery.link">link</a> <br>
|
||||||
下载链接:<a :href="currentGallery.download">link</a><br>
|
下载链接:<a :href="currentGallery.download">link</a><br>
|
||||||
标签:{{currentGallery.tag === '' ? '无': currentGallery.tag}} <br>
|
|
||||||
<span v-show="isLion">
|
<span v-show="isLion">
|
||||||
downloader:{{currentGallery.downloader}}
|
downloader:{{currentGallery.downloader}}
|
||||||
</span>
|
</span>
|
||||||
@ -132,18 +107,14 @@
|
|||||||
size="large">下载</el-button>
|
size="large">下载</el-button>
|
||||||
<el-button @click="deleteGallery(currentGallery.gid)" :disabled="currentGallery.status !== '下载完成'"
|
<el-button @click="deleteGallery(currentGallery.gid)" :disabled="currentGallery.status !== '下载完成'"
|
||||||
size="large">删除</el-button>
|
size="large">删除</el-button>
|
||||||
<el-button @click="shareGallery({gid:currentGallery.gid, shortName:currentGallery.shortName + '.zip'})" v-if="isLion"
|
|
||||||
size="large">分享</el-button>
|
|
||||||
<el-button @click="changeGalleryCollect(currentGallery.gid, currentGallery.isCollect)" :disabled="currentGallery.status !== '下载完成'"
|
<el-button @click="changeGalleryCollect(currentGallery.gid, currentGallery.isCollect)" :disabled="currentGallery.status !== '下载完成'"
|
||||||
size="large">{{currentGallery.isCollect ? '取消收藏' : '收藏'}}</el-button>
|
size="large">{{currentGallery.isCollect ? '取消收藏' : '收藏'}}</el-button>
|
||||||
<el-button @click="onlineGalleryReader" :disabled="currentGallery.status !== '下载完成' || currentGallery.mode === 1"
|
<el-button @click="readOnlineGallery(currentGallery)" :disabled="currentGallery.status !== '下载完成' || currentGallery.mode === 1"
|
||||||
size="large">在线看</el-button>
|
size="large">在线看</el-button>
|
||||||
<el-button @click="editGalleryTag(currentGallery)" :disabled="currentGallery.status !== '下载完成'"
|
|
||||||
size="large">编辑标签</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<OnlineReader :current-gallery="currentGallery" :isOnlineReading="isOnlineReading" @close="isOnlineReading = false"/>
|
<OnlineReader/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@ -153,35 +124,23 @@ import axios from "axios";
|
|||||||
import {ElMessage} from "element-plus";
|
import {ElMessage} from "element-plus";
|
||||||
import OnlineReader from "./OnlineReader.vue";
|
import OnlineReader from "./OnlineReader.vue";
|
||||||
|
|
||||||
let link = "https://downloader.lionwebsite.xyz/GalleryManage/"
|
let GalleryManagePrefix = "https://downloader.lionwebsite.xyz/GalleryManage/"
|
||||||
|
|
||||||
//输入
|
//输入
|
||||||
let inputNode = ref(null)
|
let inputNode = ref(null)
|
||||||
//是否正在编辑页数
|
//是否正在编辑页数
|
||||||
let isEditingPage = ref(false)
|
let isEditingPage = ref(false)
|
||||||
//是否正在编辑标签
|
|
||||||
let isEditingTag = ref(false)
|
|
||||||
//是否预览本子
|
|
||||||
let isOnlineReading = ref(false)
|
|
||||||
//是否查看详情
|
//是否查看详情
|
||||||
let isViewing = ref(false)
|
let isViewing = ref(false)
|
||||||
|
|
||||||
//临时变量
|
|
||||||
let galleryForTag = ref({})
|
|
||||||
|
|
||||||
let category = ref("myDownload") //myDownload myCollect total
|
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 type = ref("keyword")
|
let type = ref("keyword")
|
||||||
let param = ref("")
|
let param = ref("")
|
||||||
let paramForTags = ref([]) //tidS
|
|
||||||
|
|
||||||
|
|
||||||
let onlineReadingScrollbar = ref(null)
|
|
||||||
|
|
||||||
let loadComplete = computed(() => {
|
let loadComplete = computed(() => {
|
||||||
return store.state.loadComplete
|
return store.state.loadComplete
|
||||||
@ -191,13 +150,6 @@ let currentTasks = computed(() => {
|
|||||||
return store.getters.currentTasks ? store.getters.currentTasks: null
|
return store.getters.currentTasks ? store.getters.currentTasks: null
|
||||||
})
|
})
|
||||||
|
|
||||||
//标签
|
|
||||||
let tags = computed(() => {
|
|
||||||
return store.state.tags
|
|
||||||
})
|
|
||||||
let newTag = ref("")
|
|
||||||
|
|
||||||
|
|
||||||
let min = computed(() => {
|
let min = computed(() => {
|
||||||
return store.getters.min
|
return store.getters.min
|
||||||
})
|
})
|
||||||
@ -219,7 +171,7 @@ let emptyText = computed(() => {
|
|||||||
return '您未' + action + '本子'
|
return '您未' + action + '本子'
|
||||||
})
|
})
|
||||||
|
|
||||||
//在线预览
|
//查看详情
|
||||||
let currentGallery = ref({name:"name"})
|
let currentGallery = ref({name:"name"})
|
||||||
|
|
||||||
//翻页
|
//翻页
|
||||||
@ -249,9 +201,8 @@ function changePage(){
|
|||||||
}
|
}
|
||||||
function reverseEditMode(){
|
function reverseEditMode(){
|
||||||
isEditingPage.value = !isEditingPage.value
|
isEditingPage.value = !isEditingPage.value
|
||||||
if(isEditingPage){
|
if(isEditingPage)
|
||||||
inputNode.value.focus()
|
inputNode.value.focus()
|
||||||
}
|
|
||||||
targetPage.value = page.value
|
targetPage.value = page.value
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,118 +217,24 @@ function changeSortType(){
|
|||||||
store.commit("_setSortType", sortType.value)
|
store.commit("_setSortType", sortType.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//收藏,编辑标签,提交编辑
|
//收藏
|
||||||
function changeGalleryCollect(gid, isCollect){
|
function changeGalleryCollect(gid, isCollect){
|
||||||
if(isCollect)
|
if(isCollect)
|
||||||
store.dispatch("disCollectGallery", gid)
|
store.dispatch("disCollectGallery", gid)
|
||||||
else
|
else
|
||||||
store.dispatch("collectGallery", gid)
|
store.dispatch("collectGallery", gid)
|
||||||
}
|
}
|
||||||
function editGalleryTag(gallery){
|
|
||||||
galleryForTag.value = gallery
|
|
||||||
isEditingTag.value = true
|
|
||||||
}
|
|
||||||
let tagInput = ref()
|
|
||||||
|
|
||||||
function querySimilarTag(keyWord, cb){
|
|
||||||
let result = []
|
|
||||||
let hit = false //用于检测是否有重复标签
|
|
||||||
let skip //用于过滤已经有了的标签
|
|
||||||
for(const [key, tag] of store.state.tags){
|
|
||||||
skip = false
|
|
||||||
for(let id of galleryForTag.value.tags)
|
|
||||||
if(id === key) {
|
|
||||||
if (!hit && tag.tag === keyWord) //是否命中标签
|
|
||||||
hit = true
|
|
||||||
skip = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
if(skip)
|
|
||||||
continue
|
|
||||||
if(tag.tag.includes(keyWord))
|
|
||||||
result.push({value: tag.tag, tag:tag})
|
|
||||||
}
|
|
||||||
|
|
||||||
if(keyWord.trim() !== '' && !keyWord.includes("#") && !hit && !keyWord.includes("?") && result.length === 0)
|
|
||||||
result.push({value: '新建 #' + keyWord + ' 标签?', tag:{tag:keyWord}})
|
|
||||||
cb(result)
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleTagSelect(data){
|
|
||||||
if(data.value.includes('#')) {
|
|
||||||
if(data.tag.tag.includes("?")) {
|
|
||||||
ElMessage("非法字符?")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
else
|
|
||||||
store.dispatch("createTagAndMark", {tag: data.tag.tag.replace('#', ''), gid: galleryForTag.value.gid})
|
|
||||||
}
|
|
||||||
else
|
|
||||||
store.dispatch("mark", {gid:galleryForTag.value.gid, tid:data.tag.id})
|
|
||||||
newTag.value = ""
|
|
||||||
tagInput.value.blur()
|
|
||||||
}
|
|
||||||
|
|
||||||
function generateQueryTag(keyWord, cb){
|
|
||||||
let result = []
|
|
||||||
let hit = false //用于检测是否有重复标签
|
|
||||||
let skip //用于过滤已经有了的标签
|
|
||||||
for(const [key, tag] of store.state.tags){
|
|
||||||
skip = false
|
|
||||||
if(paramForTags.value.length !== 0) {
|
|
||||||
for (let id of paramForTags.value)
|
|
||||||
if (id === key) {
|
|
||||||
if (!hit && tag.tag === keyWord) //是否命中标签
|
|
||||||
hit = true
|
|
||||||
skip = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
if(skip)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if(tag.tag.includes(keyWord))
|
|
||||||
result.push({value: tag.tag, tag:tag})
|
|
||||||
}
|
|
||||||
cb(result)
|
|
||||||
}
|
|
||||||
function removeQueryTag(tid){
|
|
||||||
for (let i=0; i<paramForTags.value.length; i++){
|
|
||||||
if(paramForTags.value[i] === tid){
|
|
||||||
paramForTags.value.splice(i, 1)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
queryLocalTask()
|
|
||||||
}
|
|
||||||
function removeAllQueryTag(){
|
|
||||||
paramForTags.value.splice(0)
|
|
||||||
queryLocalTask()
|
|
||||||
}
|
|
||||||
function handleQueryTagSelect(data) {
|
|
||||||
console.log(data)
|
|
||||||
paramForTags.value.push(data.tag.id)
|
|
||||||
param.value = ''
|
|
||||||
queryLocalTask()
|
|
||||||
}
|
|
||||||
function queryLocalTask(){
|
function queryLocalTask(){
|
||||||
switch (type.value){
|
switch (type.value){
|
||||||
|
case "link":
|
||||||
|
store.commit("_searchLocalByLink", param.value)
|
||||||
|
break
|
||||||
case "keyword":
|
case "keyword":
|
||||||
store.commit("_searchLocalByKeyword", param.value)
|
store.commit("_searchLocalByKeyword", param.value)
|
||||||
break
|
break
|
||||||
case "tag":
|
|
||||||
store.commit("_searchLocalByTag", paramForTags.value)
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function mark(gid, tid){
|
|
||||||
store.dispatch("mark", {gid, tid})
|
|
||||||
}
|
|
||||||
|
|
||||||
function disMark(gid, tid){
|
|
||||||
store.dispatch("disMark", {gid, tid})
|
|
||||||
}
|
|
||||||
|
|
||||||
//下载,删除,在线看
|
//下载,删除,在线看
|
||||||
function downloadTask(link){
|
function downloadTask(link){
|
||||||
window.open(link)
|
window.open(link)
|
||||||
@ -387,31 +244,13 @@ function deleteGallery(gid){
|
|||||||
isViewing.value = false
|
isViewing.value = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
function onlineGalleryReader(){
|
function readOnlineGallery(gallery){
|
||||||
isOnlineReading.value = true;
|
store.dispatch("readOnlineGallery", gallery)
|
||||||
}
|
}
|
||||||
function viewInfo(gallery){
|
function viewInfo(gallery){
|
||||||
currentGallery.value = gallery
|
currentGallery.value = gallery
|
||||||
isViewing.value = true;
|
isViewing.value = true;
|
||||||
}
|
}
|
||||||
function shareGallery(data){
|
|
||||||
const {gid, shortName} = data
|
|
||||||
let link
|
|
||||||
axios.post("https://downloader.lionwebsite.xyz/GalleryManage/share?userId=3&expireHour=3&gid=" + gid).then((res) => {
|
|
||||||
if(res.data.result === "success"){
|
|
||||||
let data = JSON.parse(res.data.data)
|
|
||||||
link = 'https://lionwebsite.xyz/GetFile/{0}?ShareCode={1}'.replace('{0}', encodeURIComponent(shortName)).replace('{1}', data.shareCode)
|
|
||||||
ElMessage({dangerouslyUseHTMLString: true,
|
|
||||||
message: "<span>分享成功, 过期时间:" + data.expireTime + "</span><br><a href=" + link + ">链接</a>",
|
|
||||||
duration: 0,
|
|
||||||
'show-close': true
|
|
||||||
})
|
|
||||||
navigator.clipboard.writeText(link)
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ElMessage(res.data.data)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function adjustGalleryName(name, length) {
|
function adjustGalleryName(name, length) {
|
||||||
let truncated = '';
|
let truncated = '';
|
||||||
@ -432,19 +271,6 @@ function adjustGalleryName(name, length) {
|
|||||||
return truncated;
|
return truncated;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getGalleryThumb(gallery){
|
|
||||||
if(gallery.status !== '下载完成')
|
|
||||||
return ''
|
|
||||||
|
|
||||||
if(gallery.mode === 2 || gallery.mode === 3)
|
|
||||||
return 'https://downloader.lionwebsite.xyz/GalleryManage/onlineImage/0?gid=' + gallery.gid
|
|
||||||
|
|
||||||
if(gallery.thumb_link !== undefined)
|
|
||||||
return 'https://downloader.lionwebsite.xyz/GalleryManage/ehThumbnail?path=' + gallery.thumb_link
|
|
||||||
|
|
||||||
return ''
|
|
||||||
}
|
|
||||||
|
|
||||||
function isDark(){
|
function isDark(){
|
||||||
return document.querySelector('html').classList.contains('dark')
|
return document.querySelector('html').classList.contains('dark')
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,8 +42,7 @@ const actions = {
|
|||||||
if(res.data.result === "success") {
|
if(res.data.result === "success") {
|
||||||
ElMessage("提交成功")
|
ElMessage("提交成功")
|
||||||
context.commit("_setChosenGallery", {gallery: false,
|
context.commit("_setChosenGallery", {gallery: false,
|
||||||
resolution: data.targetResolution,
|
resolution: data.targetResolution})
|
||||||
tags: data.tags})
|
|
||||||
if(state.galleryRefreshTimer === 0)
|
if(state.galleryRefreshTimer === 0)
|
||||||
state.galleryRefreshTimer = setInterval(() => {
|
state.galleryRefreshTimer = setInterval(() => {
|
||||||
context.dispatch("updateGalleryTasks", "undone").then()
|
context.dispatch("updateGalleryTasks", "undone").then()
|
||||||
@ -61,13 +60,12 @@ const actions = {
|
|||||||
axios.get(GalleryManageUrl, {
|
axios.get(GalleryManageUrl, {
|
||||||
params:{
|
params:{
|
||||||
param: link,
|
param: link,
|
||||||
type:'link',
|
type: 'link',
|
||||||
AuthCode: state.AuthCode
|
AuthCode: state.AuthCode
|
||||||
}
|
}
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if(res.data.result === 'success')
|
if(res.data.result === 'success')
|
||||||
context.commit("_setChosenGallery", {gallery: JSON.parse(res.data.data)})
|
context.commit("_setChosenGallery", {gallery: JSON.parse(res.data.data)})
|
||||||
|
|
||||||
else
|
else
|
||||||
ElMessage("查询失败")
|
ElMessage("查询失败")
|
||||||
})
|
})
|
||||||
@ -76,12 +74,10 @@ const actions = {
|
|||||||
axios.post(BaseUrl + "validate?AuthCode=" + AuthCode).then((res)=>{
|
axios.post(BaseUrl + "validate?AuthCode=" + AuthCode).then((res)=>{
|
||||||
if(res.data.result === 'success'){
|
if(res.data.result === 'success'){
|
||||||
let data = JSON.parse(res.data.data);
|
let data = JSON.parse(res.data.data);
|
||||||
if(!data.isAvailable){
|
if(!data.isAvailable)
|
||||||
ElMessage({duration:0, message:"节点挂了,不能下也不能看,找狮子处理", type: "error"})
|
ElMessage({duration:0, message:"节点挂了,不能下也不能看,找狮子处理", type: "error"})
|
||||||
}
|
|
||||||
context.commit("_authed", {AuthCode, ...data})
|
context.commit("_authed", {AuthCode, ...data})
|
||||||
//初始化
|
//初始化
|
||||||
context.dispatch("loadTags", true).then()
|
|
||||||
context.dispatch("loadWeekUsedAmount").then()
|
context.dispatch("loadWeekUsedAmount").then()
|
||||||
context.dispatch("updateGalleryTasks", "all").then(() => confirmCurrentTask(context.state))
|
context.dispatch("updateGalleryTasks", "all").then(() => confirmCurrentTask(context.state))
|
||||||
|
|
||||||
@ -104,85 +100,9 @@ const actions = {
|
|||||||
ElMessage("查询用量失败")
|
ElMessage("查询用量失败")
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
loadTags(context, isShowTip){
|
|
||||||
axios.get(GalleryManageUrl + "/allTag", {
|
|
||||||
params: {
|
|
||||||
AuthCode: state.AuthCode
|
|
||||||
}
|
|
||||||
}).then((res) => {
|
|
||||||
if(res.data.result === "success"){
|
|
||||||
context.commit("_loadTags", JSON.parse(res.data.data))
|
|
||||||
if(isShowTip)
|
|
||||||
ElMessage("加载标签成功")
|
|
||||||
}else
|
|
||||||
ElMessage(res.data.data)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
postTag(context, tag){
|
|
||||||
axios.post(GalleryManageUrl + "/tag?" + qs.stringify({
|
|
||||||
tag,
|
|
||||||
AuthCode: state.AuthCode
|
|
||||||
})
|
|
||||||
).then((res) => {
|
|
||||||
if (res.data.result === 'success') {
|
|
||||||
ElMessage('创建标签成功')
|
|
||||||
context.commit("_postTag", {tag:tag, id:parseInt(res.data.tid), usage: 0})
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ElMessage(res.data.data)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
deleteTag(context, tid){
|
|
||||||
axios.delete(GalleryManageUrl + "/tag?" + qs.stringify({
|
|
||||||
tid,
|
|
||||||
AuthCode: state.AuthCode
|
|
||||||
})).then((res) => {
|
|
||||||
if (res.data.result === 'success') {
|
|
||||||
ElMessage('删除标签成功')
|
|
||||||
context.commit("_deleteTag", tid)
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ElMessage(res.data.data)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
mark(context, data){
|
|
||||||
data.AuthCode = context.state.AuthCode
|
|
||||||
axios.post(GalleryManageUrl + "/mark?" + qs.stringify(data)).then((res) => {
|
|
||||||
if(res.data.result === 'success'){
|
|
||||||
ElMessage("标记成功")
|
|
||||||
context.commit("_mark", data)
|
|
||||||
}else{
|
|
||||||
ElMessage(res.data.data)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
disMark(context, data){
|
|
||||||
data.AuthCode = context.state.AuthCode
|
|
||||||
axios.post(GalleryManageUrl + "/disMark?" + qs.stringify(data)).then((res) => {
|
|
||||||
if(res.data.result === 'success'){
|
|
||||||
ElMessage("取消标记成功")
|
|
||||||
context.commit("_disMark", data)
|
|
||||||
}else {
|
|
||||||
ElMessage(res.data.data)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
createTagAndMark(context, data){
|
|
||||||
data.AuthCode = context.state.AuthCode
|
|
||||||
axios.post(GalleryManageUrl + '/tagAndMark?' + qs.stringify(data)).then((res) => {
|
|
||||||
if(res.data.result === 'success') {
|
|
||||||
ElMessage("创建标签并标记成功")
|
|
||||||
context.commit("_mark", {tid:parseInt(res.data.tid), gid: data.gid, usage: 1, tag:data.tag})
|
|
||||||
|
|
||||||
}else {
|
|
||||||
ElMessage(res.data.data)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
collectGallery(context, gid){
|
collectGallery(context, gid){
|
||||||
axios.post(GalleryManageUrl + "/collect?" +qs.stringify( {
|
axios.post(GalleryManageUrl + "/collect?" +qs.stringify( {
|
||||||
gid,
|
gid, AuthCode:state.AuthCode
|
||||||
AuthCode:state.AuthCode
|
|
||||||
})).then((res) => {
|
})).then((res) => {
|
||||||
ElMessage(res.data.data)
|
ElMessage(res.data.data)
|
||||||
if(res.data.result === 'success')
|
if(res.data.result === 'success')
|
||||||
@ -192,26 +112,17 @@ const actions = {
|
|||||||
disCollectGallery(context, gid){
|
disCollectGallery(context, gid){
|
||||||
axios.post(GalleryManageUrl + "/disCollect?" + qs.stringify(
|
axios.post(GalleryManageUrl + "/disCollect?" + qs.stringify(
|
||||||
{
|
{
|
||||||
gid,
|
gid, AuthCode:state.AuthCode
|
||||||
AuthCode:state.AuthCode
|
|
||||||
})).then((res) => {
|
})).then((res) => {
|
||||||
ElMessage(res.data.data)
|
ElMessage(res.data.data)
|
||||||
if(res.data.result === 'success')
|
if(res.data.result === 'success')
|
||||||
context.commit("_disCollectGallery", gid)
|
context.commit("_disCollectGallery", gid)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
updateGalleryTag(context, data){
|
|
||||||
axios.post(GalleryManageUrl + "/tag?" + qs.stringify(data)).then((res) => {
|
|
||||||
ElMessage(res.data.data)
|
|
||||||
if(res.data.result === 'success')
|
|
||||||
context.commit("_updateGalleryTag", data)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
deleteGallery(context, gid){
|
deleteGallery(context, gid){
|
||||||
axios.delete(GalleryManageUrl, {
|
axios.delete(GalleryManageUrl, {
|
||||||
params:{
|
params:{
|
||||||
AuthCode:state.AuthCode,
|
AuthCode:state.AuthCode, gid
|
||||||
gid
|
|
||||||
}}).then((res) => {
|
}}).then((res) => {
|
||||||
if(res.data.result === "success"){
|
if(res.data.result === "success"){
|
||||||
ElMessage("删除成功")
|
ElMessage("删除成功")
|
||||||
@ -221,6 +132,17 @@ const actions = {
|
|||||||
ElMessage(res.data.data)
|
ElMessage(res.data.data)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
readOnlineGallery(context, gallery){
|
||||||
|
if(gallery.images !== undefined && gallery.images.length !== 0)
|
||||||
|
context.commit("_setReadingGallery", gallery)
|
||||||
|
else
|
||||||
|
axios.post(GalleryManageUrl + "/cache?url=" + gallery.link).then((res) => {
|
||||||
|
gallery.pages = res.data.data.pages
|
||||||
|
setTimeout(() => {
|
||||||
|
context.commit("_setReadingGallery", gallery)
|
||||||
|
}, 100)
|
||||||
|
})
|
||||||
|
},
|
||||||
alterAuthCode(context, AuthCode){
|
alterAuthCode(context, AuthCode){
|
||||||
axios.put(BaseUrl + "AuthCode?" + qs.stringify({'AuthCode': state.AuthCode, 'newAuthCode': AuthCode}))
|
axios.put(BaseUrl + "AuthCode?" + qs.stringify({'AuthCode': state.AuthCode, 'newAuthCode': AuthCode}))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
@ -253,12 +175,11 @@ const mutations = {
|
|||||||
},
|
},
|
||||||
_disCollectGallery(state, gid){
|
_disCollectGallery(state, gid){
|
||||||
let index
|
let index
|
||||||
for(let i=0; i < state.collectGallery.length; i++){
|
for(let i=0; i < state.collectGallery.length; i++)
|
||||||
if(state.collectGallery[i].gid === gid){
|
if(state.collectGallery[i].gid === gid){
|
||||||
index = i
|
index = i
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
|
||||||
state.collectGallery[index].isCollect = false
|
state.collectGallery[index].isCollect = false
|
||||||
state.collectGallery.splice(index, 1)
|
state.collectGallery.splice(index, 1)
|
||||||
},
|
},
|
||||||
@ -272,6 +193,7 @@ const mutations = {
|
|||||||
tasks.forEach((task) => {
|
tasks.forEach((task) => {
|
||||||
//处理名字
|
//处理名字
|
||||||
task.shortName = getShortname(task.name)
|
task.shortName = getShortname(task.name)
|
||||||
|
task.thumb_link = GalleryManageUrl + "/ehThumbnail?path=" + task.thumb_link
|
||||||
|
|
||||||
//处理进度相关
|
//处理进度相关
|
||||||
switch (task.status) {
|
switch (task.status) {
|
||||||
@ -283,15 +205,7 @@ const mutations = {
|
|||||||
break;
|
break;
|
||||||
case "下载完成":
|
case "下载完成":
|
||||||
task.progress = "下载完成"
|
task.progress = "下载完成"
|
||||||
if(task.mode === 1 || task.mode === 3)
|
task.download = GalleryManageUrl + "/file/" + encodeURI(task.name) + ".zip?AuthCode=" + state.AuthCode + "&gid=" + task.gid
|
||||||
task.download = GalleryManageUrl + "/file/" + encodeURI(task.name) + ".zip?AuthCode=" + state.AuthCode + "&gid=" + task.gid
|
|
||||||
|
|
||||||
if(task.mode === 2 || task.mode === 3) {
|
|
||||||
let links = []
|
|
||||||
for (let i = 1; i <= task.pages; i++)
|
|
||||||
links.push(GalleryManageUrl + "/onlineImage/" + i + "?gid=" + task.gid);
|
|
||||||
task.images = links
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case "压缩中":
|
case "压缩中":
|
||||||
task.progress = "压缩中"
|
task.progress = "压缩中"
|
||||||
@ -301,19 +215,6 @@ const mutations = {
|
|||||||
//处理时间戳
|
//处理时间戳
|
||||||
task.createTimeDisplay = new Date(task.createTime * 1000).toLocaleString("zh")
|
task.createTimeDisplay = new Date(task.createTime * 1000).toLocaleString("zh")
|
||||||
|
|
||||||
//处理标签
|
|
||||||
if ('tags' in task) {
|
|
||||||
task.tag = ''
|
|
||||||
task.tags.forEach((tid) => {
|
|
||||||
task.tag += ' ' + state.tags.get(tid).tag
|
|
||||||
})
|
|
||||||
task.tag = task.tag.trim()
|
|
||||||
|
|
||||||
}else{
|
|
||||||
task.tag = ""
|
|
||||||
task.tags = []
|
|
||||||
}
|
|
||||||
|
|
||||||
//处理是否收藏
|
//处理是否收藏
|
||||||
if('isCollect' in task)
|
if('isCollect' in task)
|
||||||
state.collectGallery.push(task)
|
state.collectGallery.push(task)
|
||||||
@ -326,8 +227,7 @@ const mutations = {
|
|||||||
|
|
||||||
state.totalGalleryTask.push(task)
|
state.totalGalleryTask.push(task)
|
||||||
})
|
})
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
let tempArray = Array.from(state.totalGalleryTask)
|
let tempArray = Array.from(state.totalGalleryTask)
|
||||||
state.totalGalleryTask.splice(0)
|
state.totalGalleryTask.splice(0)
|
||||||
let preDeleteIndex
|
let preDeleteIndex
|
||||||
@ -390,44 +290,6 @@ const mutations = {
|
|||||||
ElMessage("授权码错误")
|
ElMessage("授权码错误")
|
||||||
localStorage.removeItem("auth")
|
localStorage.removeItem("auth")
|
||||||
},
|
},
|
||||||
_loadTags(state, tags){
|
|
||||||
state.tags.clear()
|
|
||||||
for(let i in tags)
|
|
||||||
state.tags.set(parseInt(i), tags[i])
|
|
||||||
},
|
|
||||||
_postTag(state, tag){
|
|
||||||
state.tags.set(tag.id, tag)
|
|
||||||
},
|
|
||||||
_deleteTag(state, tid){
|
|
||||||
state.tags.delete(tid)
|
|
||||||
},
|
|
||||||
_mark(state, data){
|
|
||||||
state.totalGalleryTask.forEach((gallery) => {
|
|
||||||
if(gallery.gid === data.gid){
|
|
||||||
gallery.tags.push(data.tid)
|
|
||||||
if('tag' in data) //新建的tag
|
|
||||||
state.tags.set(data.tid, {id:data.tid, tag: data.tag, usage:data.usage})
|
|
||||||
else
|
|
||||||
state.tags.get(data.tid).usage++
|
|
||||||
generateNewTag(state, gallery)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
_disMark(state, data){
|
|
||||||
state.totalGalleryTask.forEach((gallery) => {
|
|
||||||
if(gallery.gid === data.gid){
|
|
||||||
let index
|
|
||||||
for(index=0; index<gallery.tags.length; index++){
|
|
||||||
if(gallery.tags[index] === data.tid){
|
|
||||||
gallery.tags.splice(index, 1) //删除tid
|
|
||||||
state.tags.get(data.tid).usage--
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
generateNewTag(state, gallery)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
_searchLocalByLink(state, link){
|
_searchLocalByLink(state, link){
|
||||||
let tasks = state.currentTasks
|
let tasks = state.currentTasks
|
||||||
let i = 0
|
let i = 0
|
||||||
@ -478,41 +340,6 @@ const mutations = {
|
|||||||
confirmCurrentTask(state)
|
confirmCurrentTask(state)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_searchLocalByTag(state, tidS) {
|
|
||||||
state.searchTask.splice(0)
|
|
||||||
state.page = 1
|
|
||||||
|
|
||||||
let hitAmount
|
|
||||||
let tasks = state.currentTasks
|
|
||||||
|
|
||||||
if (tidS.length > 0) {
|
|
||||||
tasks.forEach((task) => {
|
|
||||||
if(tidS.length <= task.tags.length) {
|
|
||||||
|
|
||||||
hitAmount = 0
|
|
||||||
for(let i=0; i<task.tag.length; i++){
|
|
||||||
for(let j=0; j<tidS.length; j++){
|
|
||||||
if(task.tags[i] === tidS[j])
|
|
||||||
hitAmount ++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (hitAmount === tidS.length)
|
|
||||||
state.searchTask.push(task)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
if (state.searchTask.length === 0) {
|
|
||||||
ElMessage("未找到符合这些tag的任务")
|
|
||||||
state.isSearch = false
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
state.isSearch = true
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
state.isSearch = false
|
|
||||||
confirmCurrentTask(state)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
_deleteGallery(state, gid){
|
_deleteGallery(state, gid){
|
||||||
let tasks = [state.totalGalleryTask, state.downloadGallery, state.collectGallery]
|
let tasks = [state.totalGalleryTask, state.downloadGallery, state.collectGallery]
|
||||||
deleteTask(tasks, 'gid', gid)
|
deleteTask(tasks, 'gid', gid)
|
||||||
@ -524,14 +351,7 @@ const mutations = {
|
|||||||
state.chosenGallery.fileSize = "等待下载完成后再查看"
|
state.chosenGallery.fileSize = "等待下载完成后再查看"
|
||||||
state.chosenGallery.createTimeDisplay = "等待下载完成后再查看"
|
state.chosenGallery.createTimeDisplay = "等待下载完成后再查看"
|
||||||
state.chosenGallery.progress = "已提交"
|
state.chosenGallery.progress = "已提交"
|
||||||
state.chosenGallery.tags = []
|
|
||||||
state.chosenGallery.downloader = state.userId
|
state.chosenGallery.downloader = state.userId
|
||||||
if(data.tags.length > 0){
|
|
||||||
for (let tag of data.tags) {
|
|
||||||
state.chosenGallery.tags.push(parseInt(tag))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
generateNewTag(state, state.chosenGallery)
|
|
||||||
state.chosenGallery.downloader = state.userId
|
state.chosenGallery.downloader = state.userId
|
||||||
state.totalGalleryTask.push(state.chosenGallery)
|
state.totalGalleryTask.push(state.chosenGallery)
|
||||||
state.downloadGallery.push(state.chosenGallery)
|
state.downloadGallery.push(state.chosenGallery)
|
||||||
@ -553,33 +373,40 @@ const mutations = {
|
|||||||
else
|
else
|
||||||
state.length = state.defaultLength
|
state.length = state.defaultLength
|
||||||
},
|
},
|
||||||
|
_setReadingGallery(state, gallery){
|
||||||
|
if(gallery.images === undefined) {
|
||||||
|
gallery.images = []
|
||||||
|
for(let i=1; i<=gallery.pages; i++)
|
||||||
|
gallery.images.push(GalleryManageUrl + "/onlineImage/" + i + "?gid=" + gallery.gid);
|
||||||
|
}
|
||||||
|
state.readingGallery = gallery
|
||||||
|
state.isReading = true;
|
||||||
|
},
|
||||||
|
_closeReader(state){
|
||||||
|
state.isReading = false;
|
||||||
|
},
|
||||||
|
_changeThumbnailGallery(state, gallery){
|
||||||
|
state.thumbnailGallery = gallery
|
||||||
|
},
|
||||||
_openHistoryPanel(state){
|
_openHistoryPanel(state){
|
||||||
state.isShowHistory = true
|
state.isShowHistory = true
|
||||||
},
|
},
|
||||||
_closeHistoryPanel(state){
|
_closeHistoryPanel(state){
|
||||||
state.isShowHistory = false
|
state.isShowHistory = false
|
||||||
},
|
|
||||||
_changeThumbnailGallery(state, gallery){
|
|
||||||
if(gallery.mode === 2 || gallery.mode === 3) {
|
|
||||||
state.thumbnailGallery = gallery
|
|
||||||
state.thumbnailGallery.url = GalleryManageUrl + "/onlineImage/1?gid=" + gallery.gid
|
|
||||||
} else if(gallery.thumb_link !== undefined){
|
|
||||||
state.thumbnailGallery = gallery
|
|
||||||
state.thumbnailGallery.url = GalleryManageUrl + "/ehThumbnail?path=" + gallery.thumb_link
|
|
||||||
state.thumbnailGallery.images = [GalleryManageUrl + "/ehThumbnail?path=" + gallery.thumb_link,]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const state = {
|
const state = {
|
||||||
totalGalleryTask: [], //存放本子数据的数组
|
totalGalleryTask: [], //存放本子数据的数组
|
||||||
chosenGallery: false, //准备下载的本子
|
chosenGallery: false, //准备下载的本子
|
||||||
thumbnailGallery: {}, //预览本子
|
thumbnailGallery: {}, //缩略图本子
|
||||||
collectGallery: [], //收藏的本子
|
collectGallery: [], //收藏的本子
|
||||||
downloadGallery: [], //下载的本子
|
downloadGallery: [], //下载的本子
|
||||||
tags: new Map(), //可用tag
|
|
||||||
isSearch: false, //用于决定是否显示搜索结果
|
isSearch: false, //用于决定是否显示搜索结果
|
||||||
|
|
||||||
|
readingGallery: {'name': '', 'images': []}, //在线看本子
|
||||||
|
isReading: false, //是否正在看
|
||||||
|
|
||||||
currentGid: "", //当前GID
|
currentGid: "", //当前GID
|
||||||
lengthPerPage: 0, //在线预览每页图片数量
|
lengthPerPage: 0, //在线预览每页图片数量
|
||||||
|
|
||||||
@ -714,14 +541,4 @@ function deleteTask(tasks, key, value){
|
|||||||
tasks[j].splice(i, 1)
|
tasks[j].splice(i, 1)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function generateNewTag(state, gallery){
|
|
||||||
let tag = ''
|
|
||||||
console.log(state.tags)
|
|
||||||
console.log(gallery.tags)
|
|
||||||
gallery.tags.forEach((tid) => {
|
|
||||||
tag += state.tags.get(tid).tag + ' '
|
|
||||||
})
|
|
||||||
gallery.tag = tag.trim()
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user