去除部分getters。未下载完成时,将按钮从隐藏改为禁用,修改接口路径(同步更新)
This commit is contained in:
parent
c319c420c7
commit
3f0f24dab4
@ -1,15 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="DashBoard" v-show="loadComplete">
|
<div class="DashBoard" v-show="loadComplete">
|
||||||
|
<span>E站额度本周已用:{{weekUsed.weekUsedAmount}} 上次重置时间:{{weekUsed.lastResetAmountTime}}</span><br>
|
||||||
|
<el-button @click="queryWeekUsedAmount">查询用量</el-button>
|
||||||
|
<hr>
|
||||||
<el-input v-model="link" placeholder="输入链接"/> <br>
|
<el-input v-model="link" placeholder="输入链接"/> <br>
|
||||||
|
|
||||||
<el-button @click="queryTask">查询任务</el-button>
|
<el-button @click="queryTask">查询任务</el-button>
|
||||||
<el-button @click="searchByLink">查找任务</el-button> <br>
|
<el-button @click="searchByLink">查找任务</el-button> <br>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<hr>
|
<hr>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<el-input v-model="keyword" placeholder="输入关键字" @change="searchByKeyword"/>
|
<el-input v-model="keyword" placeholder="输入关键字" @change="searchByKeyword"/>
|
||||||
<br>
|
<br>
|
||||||
<el-button>确定</el-button>
|
<el-button>确定</el-button>
|
||||||
@ -75,21 +74,29 @@ export default {
|
|||||||
let timer
|
let timer
|
||||||
|
|
||||||
let preDownloadGallery = computed(() => {
|
let preDownloadGallery = computed(() => {
|
||||||
return store.getters.preDownloadGallery
|
return store.state.preDownloadGallery
|
||||||
})
|
})
|
||||||
|
|
||||||
let preDownloadVideo = computed(() => {
|
let preDownloadVideo = computed(() => {
|
||||||
return store.getters.preDownloadVideo
|
return store.state.preDownloadVideo
|
||||||
})
|
})
|
||||||
|
|
||||||
let maskDomain = computed(() => {
|
let maskDomain = computed(() => {
|
||||||
return store.getters.maskDomain
|
return store.state.maskDomain
|
||||||
})
|
})
|
||||||
|
|
||||||
let loadComplete = computed(() => {
|
let loadComplete = computed(() => {
|
||||||
return store.getters.loadComplete
|
return store.state.loadComplete
|
||||||
})
|
})
|
||||||
|
|
||||||
|
let weekUsed = computed(() => {
|
||||||
|
return store.state.weekUsed
|
||||||
|
})
|
||||||
|
|
||||||
|
function queryWeekUsedAmount(){
|
||||||
|
store.dispatch("loadWeekUsedAmount")
|
||||||
|
}
|
||||||
|
|
||||||
function modify(str1, str2){
|
function modify(str1, str2){
|
||||||
return str1 + " " + str2
|
return str1 + " " + str2
|
||||||
}
|
}
|
||||||
@ -211,6 +218,7 @@ export default {
|
|||||||
openPanel,
|
openPanel,
|
||||||
closePanel,
|
closePanel,
|
||||||
deleteAuthCode,
|
deleteAuthCode,
|
||||||
|
queryWeekUsedAmount,
|
||||||
link,
|
link,
|
||||||
loadComplete,
|
loadComplete,
|
||||||
AuthCode,
|
AuthCode,
|
||||||
@ -218,7 +226,8 @@ export default {
|
|||||||
isRemember,
|
isRemember,
|
||||||
preDownloadGallery,
|
preDownloadGallery,
|
||||||
preDownloadVideo,
|
preDownloadVideo,
|
||||||
targetResolution
|
targetResolution,
|
||||||
|
weekUsed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,7 +42,7 @@
|
|||||||
分辨率:{{props.row.resolution}} <br>
|
分辨率:{{props.row.resolution}} <br>
|
||||||
<el-button @click="downloadTask(props.row.download)" :disabled="operational(props.row.download)">下载</el-button>
|
<el-button @click="downloadTask(props.row.download)" :disabled="operational(props.row.download)">下载</el-button>
|
||||||
<el-button @click="deleteVideo(props.row.id)" :disabled="operational(props.row.download)">删除</el-button>
|
<el-button @click="deleteVideo(props.row.id)" :disabled="operational(props.row.download)">删除</el-button>
|
||||||
<el-button @click="onlineVideoViewer(props.row.name)" :disabled="operational(props.row.download)">在线看</el-button>
|
<el-button @click="onlineVideoViewer()" :disabled="operational(props.row.download)">在线看</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
@ -111,15 +111,15 @@ export default {
|
|||||||
})
|
})
|
||||||
|
|
||||||
let isShowVideoHistory = computed(() => {
|
let isShowVideoHistory = computed(() => {
|
||||||
return store.getters.showType === "video"
|
return store.state.showType === "video"
|
||||||
})
|
})
|
||||||
|
|
||||||
let isShowGalleryHistory = computed(() => {
|
let isShowGalleryHistory = computed(() => {
|
||||||
return store.getters.showType === "gallery"
|
return store.state.showType === "gallery"
|
||||||
})
|
})
|
||||||
|
|
||||||
let isOpenHistoryPanel = computed(() => {
|
let isOpenHistoryPanel = computed(() => {
|
||||||
return store.getters.isShowHistory
|
return store.state.isShowHistory
|
||||||
})
|
})
|
||||||
|
|
||||||
let min = computed(() => {
|
let min = computed(() => {
|
||||||
@ -133,12 +133,12 @@ export default {
|
|||||||
})
|
})
|
||||||
|
|
||||||
let page = computed(() => {
|
let page = computed(() => {
|
||||||
targetPage.value = store.getters.page
|
targetPage.value = store.state.page
|
||||||
return store.getters.page
|
return store.state.page
|
||||||
})
|
})
|
||||||
|
|
||||||
let loadComplete = computed(() => {
|
let loadComplete = computed(() => {
|
||||||
return store.getters.loadComplete
|
return store.state.loadComplete
|
||||||
})
|
})
|
||||||
|
|
||||||
function next() {
|
function next() {
|
||||||
@ -165,7 +165,6 @@ export default {
|
|||||||
targetPage.value = min.value
|
targetPage.value = min.value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function changePage(){
|
function changePage(){
|
||||||
if(targetPage.value >= min.value && targetPage.value <= max.value)
|
if(targetPage.value >= min.value && targetPage.value <= max.value)
|
||||||
store.commit("_changePage", targetPage.value)
|
store.commit("_changePage", targetPage.value)
|
||||||
@ -199,8 +198,8 @@ export default {
|
|||||||
window.open("http://zfile.lionwebsite.xyz/1/gallery/" + encodeURI(name))
|
window.open("http://zfile.lionwebsite.xyz/1/gallery/" + encodeURI(name))
|
||||||
}
|
}
|
||||||
|
|
||||||
function onlineVideoViewer(name){
|
function onlineVideoViewer(){
|
||||||
window.open("http://zfile.lionwebsite.xyz/1/video/" + encodeURI(name + ".mp4"))
|
window.open("http://zfile.lionwebsite.xyz/1/video/")
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeShowType(){
|
function changeShowType(){
|
||||||
@ -214,8 +213,8 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function operational(task){
|
function operational(download){
|
||||||
return task === null
|
return download === undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,8 +3,8 @@ import axios from "axios"
|
|||||||
import {ElMessage} from "element-plus"
|
import {ElMessage} from "element-plus"
|
||||||
import qs from "qs"
|
import qs from "qs"
|
||||||
const BaseUrl = "http://downloader.lionwebsite.xyz/"
|
const BaseUrl = "http://downloader.lionwebsite.xyz/"
|
||||||
const GalleryTaskHandlerUrl = BaseUrl + "GalleryTaskHandler/"
|
const GalleryTaskHandlerUrl = BaseUrl + "GalleryManage/"
|
||||||
const VideoTaskHandlerUrl = BaseUrl + "VideoTaskHandler/"
|
const VideoTaskHandlerUrl = BaseUrl + "VideoManage/"
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
updateGalleryTasks(context){
|
updateGalleryTasks(context){
|
||||||
@ -121,6 +121,7 @@ const actions = {
|
|||||||
context.dispatch("updateGalleryTasks").then()
|
context.dispatch("updateGalleryTasks").then()
|
||||||
context.dispatch("updateVideoTasks").then()
|
context.dispatch("updateVideoTasks").then()
|
||||||
context.dispatch("loadMaskDomain").then()
|
context.dispatch("loadMaskDomain").then()
|
||||||
|
context.dispatch("loadWeekUsedAmount").then()
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
context.dispatch("update").then()
|
context.dispatch("update").then()
|
||||||
}, 30000)
|
}, 30000)
|
||||||
@ -143,6 +144,19 @@ const actions = {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
loadWeekUsedAmount(context){
|
||||||
|
axios.get(GalleryTaskHandlerUrl + "weekUsedAmount", {
|
||||||
|
params: {
|
||||||
|
AuthCode: context.state.AuthCode
|
||||||
|
}
|
||||||
|
}).then((res) => {
|
||||||
|
if(res.data.result === "success"){
|
||||||
|
context.state.weekUsed = JSON.parse(res.data.data)
|
||||||
|
}else{
|
||||||
|
ElMessage("查询用量失败")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
searchByLink(context, link){
|
searchByLink(context, link){
|
||||||
context.commit("_searchByLink", link)
|
context.commit("_searchByLink", link)
|
||||||
},
|
},
|
||||||
@ -303,6 +317,7 @@ const mutations = {
|
|||||||
if(data.gallery === false) {
|
if(data.gallery === false) {
|
||||||
state.preDownloadGallery.resolution = data.resolution
|
state.preDownloadGallery.resolution = data.resolution
|
||||||
state.preDownloadGallery.fileSize = "等待下载完成后再查看"
|
state.preDownloadGallery.fileSize = "等待下载完成后再查看"
|
||||||
|
state.preDownloadGallery.progress = "已提交"
|
||||||
state.totalGalleryTask.push(state.preDownloadGallery)
|
state.totalGalleryTask.push(state.preDownloadGallery)
|
||||||
}
|
}
|
||||||
state.preDownloadGallery = data.gallery
|
state.preDownloadGallery = data.gallery
|
||||||
@ -312,6 +327,7 @@ const mutations = {
|
|||||||
state.preDownloadVideo.resolution = data.resolution
|
state.preDownloadVideo.resolution = data.resolution
|
||||||
state.preDownloadVideo.fileSize = "下载完成后再查看"
|
state.preDownloadVideo.fileSize = "下载完成后再查看"
|
||||||
state.preDownloadVideo.duration = "下载完成后再查看"
|
state.preDownloadVideo.duration = "下载完成后再查看"
|
||||||
|
state.preDownloadVideo.progress = "已提交"
|
||||||
state.totalVideoTask.push(state.preDownloadVideo)
|
state.totalVideoTask.push(state.preDownloadVideo)
|
||||||
}
|
}
|
||||||
state.preDownloadVideo = data.video
|
state.preDownloadVideo = data.video
|
||||||
@ -347,7 +363,8 @@ const state = {
|
|||||||
isInclude:false, //是否搜索到任务
|
isInclude:false, //是否搜索到任务
|
||||||
searchTask:[], //搜索到的任务
|
searchTask:[], //搜索到的任务
|
||||||
isShowHistory:false, //是否打开面板
|
isShowHistory:false, //是否打开面板
|
||||||
showType:"gallery",
|
showType:"gallery", //展示类型
|
||||||
|
weekUsed:{},
|
||||||
|
|
||||||
maskDomain:[]
|
maskDomain:[]
|
||||||
}
|
}
|
||||||
@ -376,10 +393,10 @@ const getters = {
|
|||||||
if(state.searchTask.length !== 0){
|
if(state.searchTask.length !== 0){
|
||||||
tasks = state.searchTask
|
tasks = state.searchTask
|
||||||
}
|
}
|
||||||
else if(state.showHistory === "gallery")
|
else if(state.showType === "gallery")
|
||||||
if(state.totalGalleryTask.length !== 0)
|
if(state.totalGalleryTask.length !== 0)
|
||||||
tasks = state.totalGalleryTask
|
tasks = state.totalGalleryTask
|
||||||
else if(state.showHistory === "video")
|
else if(state.showType === "video")
|
||||||
if(state.totalVideoTask.length)
|
if(state.totalVideoTask.length)
|
||||||
tasks = state.totalVideoTask
|
tasks = state.totalVideoTask
|
||||||
if(!tasks)
|
if(!tasks)
|
||||||
@ -389,30 +406,6 @@ const getters = {
|
|||||||
max += 1
|
max += 1
|
||||||
}
|
}
|
||||||
return max
|
return max
|
||||||
},
|
|
||||||
isAuth(state){
|
|
||||||
return state.isAuth
|
|
||||||
},
|
|
||||||
page(state){
|
|
||||||
return state.page
|
|
||||||
},
|
|
||||||
loadComplete(state){
|
|
||||||
return state.loadComplete
|
|
||||||
},
|
|
||||||
preDownloadGallery(state){
|
|
||||||
return state.preDownloadGallery
|
|
||||||
},
|
|
||||||
preDownloadVideo(state){
|
|
||||||
return state.preDownloadVideo
|
|
||||||
},
|
|
||||||
isShowHistory(state){
|
|
||||||
return state.isShowHistory
|
|
||||||
},
|
|
||||||
showType(state){
|
|
||||||
return state.showType
|
|
||||||
},
|
|
||||||
maskDomain(state){
|
|
||||||
return state.maskDomain
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user