From e50c6e6805ba8d434d3bfc66ef1a8c63b6bad085 Mon Sep 17 00:00:00 2001 From: chuzhongzai Date: Mon, 25 Dec 2023 20:38:13 +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)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DashBoard.vue | 205 ++------------------------ src/components/HentaiSearch.vue | 5 +- src/components/OnlineReader.vue | 34 ++--- src/components/Side.vue | 129 +--------------- src/store/index.js | 252 +++++--------------------------- 5 files changed, 79 insertions(+), 546 deletions(-) diff --git a/src/components/DashBoard.vue b/src/components/DashBoard.vue index 018e188..672350c 100644 --- a/src/components/DashBoard.vue +++ b/src/components/DashBoard.vue @@ -8,24 +8,16 @@ 查询参数类型: - - + -
- - {{store.state.tags.get(tid).tag}} - - -
远程查询 当前页查询 - 清空查询标签
@@ -37,24 +29,22 @@ 夜间模式
里站搜索 - 查看标签
重置任务 -
+
{{thumbnailGallery.shortName}}
- 标签:{{thumbnailGallery.tag}}

-
- + 本子名字:{{chosenGallery.name}} @@ -69,27 +59,14 @@ - - 下载模式: - - - - - - - 标签: - {{store.state.tags.get(tid).tag}} - - -
- 下载 - 清空标签 - - 在线预览 - 查看封面图 - 删除 - +
@@ -141,33 +118,6 @@ - -
- 输入关键字: - 清空 - 刷新 -
- - - - - - - - - - - - 创建标签前先看看有没有符合的,尽量用统一一点的标签,比如已经有个图包就不要创建图集之类的了。毕竟标签多起来数据挺多的。 - - -
-

是否记住授权码 @@ -191,7 +141,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("") @@ -201,19 +150,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 }) @@ -224,27 +169,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 }) @@ -252,18 +178,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) @@ -295,9 +209,7 @@ function postTask(){ } store.dispatch("postGalleryTask", {link: chosenGallery.value.link, - targetResolution: targetResolution.value, - mode: targetDownloadMode.value, - tags:paramForTags.value}) + targetResolution: targetResolution.value}) targetResolution.value = "" } @@ -319,89 +231,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", "") @@ -424,7 +255,7 @@ function validate(){ } } -//验证链接以及伪装链接 +//验证链接 function validateLink(rawLink){ if(rawLink.trim() === "") return false @@ -435,12 +266,8 @@ function validateLink(rawLink){ } //在线阅读以及展示缩略图 -function onlineGalleryReader(gid){ - store.dispatch("queryOnlineLinks", gid) -} -function showThumbnailGallery(gallery){ - store.commit("_changeThumbnailGallery", gallery) - document.querySelector(".preview > img").click() +function readOnlineGallery(gallery){ + store.dispatch("readOnlineGallery", gallery) } //重新给节点发送未完成任务 diff --git a/src/components/HentaiSearch.vue b/src/components/HentaiSearch.vue index fc14aef..85e3091 100644 --- a/src/components/HentaiSearch.vue +++ b/src/components/HentaiSearch.vue @@ -92,7 +92,10 @@ function close(){ 页数:{{gallery.page}}
类型:{{gallery.type}}
链接
- 查看 + + 在线看 + 查看详情 +
diff --git a/src/components/OnlineReader.vue b/src/components/OnlineReader.vue index a8d085f..27381c0 100644 --- a/src/components/OnlineReader.vue +++ b/src/components/OnlineReader.vue @@ -1,9 +1,6 @@