From 61c4dbc8e827d89ca36ec506cffe7882002424f5 Mon Sep 17 00:00:00 2001 From: chuzhongzai Date: Mon, 25 Dec 2023 20:38:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=A0=87=E7=AD=BE;=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=9C=A8=E7=BA=BF=E7=9C=8B=EF=BC=8C=E5=85=81=E8=AE=B8?= =?UTF-8?q?=E6=9C=AA=E4=B8=8B=E8=BD=BD=E7=9A=84=E6=9C=AC=E5=AD=90=E5=9C=A8?= =?UTF-8?q?=E7=BA=BF=E7=9C=8B(=E5=90=8C=E6=AD=A5=E6=9B=B4=E6=96=B0);?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=87=8C=E7=AB=99=E6=90=9C=E7=B4=A2=E6=97=B6?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E9=A1=B5=E9=9D=A2=E4=B8=8D=E4=BC=9A=E5=9B=9E?= =?UTF-8?q?=E5=88=B0=E9=A1=B6=E9=83=A8;=E4=BF=AE=E5=A4=8D=E9=87=8C?= =?UTF-8?q?=E7=AB=99=E6=90=9C=E7=B4=A2=E6=97=B6=E4=B8=8D=E4=BC=9A=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=8A=A0=E8=BD=BD=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DashBoard.vue | 188 ++--------------------- src/components/HentaiSearch.vue | 16 +- src/components/OnlineReader.vue | 34 ++--- src/components/Side.vue | 210 +++---------------------- src/store/index.js | 263 +++++--------------------------- 5 files changed, 97 insertions(+), 614 deletions(-) diff --git a/src/components/DashBoard.vue b/src/components/DashBoard.vue index 573c127..db0be17 100644 --- a/src/components/DashBoard.vue +++ b/src/components/DashBoard.vue @@ -20,24 +20,21 @@ 配置
夜间模式 夜间模式 -
- 里站搜索 - 查看标签
重置任务 -
+
{{thumbnailGallery.shortName}}
-
- 本子名字:{{chosenGallery.name}} @@ -52,13 +49,6 @@ - - 下载模式: - - - - - 标签: {{store.state.tags.get(tid).tag}} @@ -66,13 +56,13 @@
- 下载 - 清空标签 - - 在线预览 - 查看封面图 - 删除 - +
@@ -123,33 +113,6 @@ - -
- 输入关键字:
- 重置关键字 - 刷新 -
- - - - - - - - - - - - 创建标签前先看看有没有符合的,尽量用统一一点的标签,比如已经有个图包就不要创建图集之类的了。毕竟标签多起来数据挺多的。 - - -
-
@@ -163,7 +126,6 @@ import store from "../store"; import {computed, ref, onMounted} from "vue"; import {ElMessage} from "element-plus" -import axios from "axios"; import HentaiSearch from "./HentaiSearch.vue"; //授权码相关 @@ -174,7 +136,6 @@ let newAuthCode = ref("") let tempAuthCode = ref("") let isQuerying = ref(false) -let isViewingTag = ref(false) let isConfig = ref(false) let isDark = ref(false) let keyword = ref("furry yaoi") @@ -184,19 +145,15 @@ let lengthPerPage = ref(0) //查询相关 let type = ref("link") let param = ref("") -let paramForTags = ref([]) //tidS let targetResolution = ref("") let targetDownloadMode = ref("") -let tag = ref("") -let tagKeyWord = ref("") //查询tag的关键字 let realAuthCode = computed(() => { return store.state.AuthCode }) let chosenGallery = computed(() => { - paramForTags.value.splice(0) param.value = '' return store.state.chosenGallery }) @@ -208,27 +165,8 @@ let loadComplete = computed(() => { let weekUsed = computed(() => { 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(() => { - if(store.state.thumbnailGallery.images === undefined) - store.state.thumbnailGallery.images = [] return store.state.thumbnailGallery }) @@ -236,18 +174,6 @@ let isLion = computed(() => { 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(){ if(newAuthCode.value.trim() === "" || tempAuthCode.value.trim() === "" || newAuthCode.value !== tempAuthCode.value) @@ -281,8 +207,7 @@ function postTask(){ store.dispatch("postGalleryTask", {link: chosenGallery.value.link, targetResolution: targetResolution.value, - mode: targetDownloadMode.value, - tags:tag.value}) + mode: targetDownloadMode.value}) targetResolution.value = "" } @@ -304,44 +229,8 @@ function queryLocalTask(){ case "keyword": store.commit("_searchLocalByKeyword", param.value) 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){ for (let i=0; i { - 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(){ store.dispatch("deleteGallery", chosenGallery.value.gid) @@ -411,7 +260,7 @@ function validate(){ } } -//验证链接以及伪装链接 +//验证链接 function validateLink(rawLink){ if(rawLink.trim() === "") return false @@ -422,11 +271,8 @@ function validateLink(rawLink){ } //打开面板以及在线阅读 -function openPanel(){ - store.commit("_openHistoryPanel") -} -function onlineGalleryReader(gid){ - store.dispatch("queryOnlineLinks", gid) +function onlineGalleryReader(gallery){ + store.dispatch("readOnlineGallery", gallery) } //重新给节点发送未完成任务 @@ -445,12 +291,6 @@ function toggleStyle(){ light() } -//显示缩略图 -function showThumbnail(gallery){ - store.commit("_changeThumbnailGallery", gallery) - setTimeout(() => {document.querySelector(".preview > img").click()}, 1) -} - onMounted(() => { const auth = localStorage.getItem("auth") adjustForStyle() diff --git a/src/components/HentaiSearch.vue b/src/components/HentaiSearch.vue index 7cd1d06..7caf0f7 100644 --- a/src/components/HentaiSearch.vue +++ b/src/components/HentaiSearch.vue @@ -14,7 +14,6 @@ let queryPage = ref({}) let galleries = ref([]) let param = ref() let isShowUp = ref() -let isLoading = ref() watch(props, () => { isShowUp.value = props.isQuerying }) @@ -28,11 +27,11 @@ function queryGalleries(link){ tempParam = keyword.value } tempParam = tempParam.replace(" ", "+") - isLoading = true + document.getElementById("loading").style.display = "inline-block"; axios.get("https://downloader.lionwebsite.xyz/query?keyword=" + tempParam) .then((res) => { - isLoading = false + document.getElementById("loading").style.display = "none"; if (res.data.result === "success") { let tempGalleries = JSON.parse(res.data.data) queryPage.value.first = 'first' in res.data ? res.data.first : undefined @@ -44,6 +43,8 @@ function queryGalleries(link){ tempGalleries.forEach((gallery) => { galleries.value.push(gallery) }) + + scrollBar.value.setScrollTop(0) }else { ElMessage({message: res.data.data, type: "error"}) } @@ -94,7 +95,7 @@ function adjustGalleryName(name, length) {