去除部分移动端的属性。去除部分getters。未下载完成时,将按钮从隐藏改为禁用,修改接口路径(同步更新)
This commit is contained in:
parent
295214e39a
commit
821cf1e62d
@ -1,5 +1,8 @@
|
|||||||
<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="输入链接"/>
|
<el-input v-model="link" placeholder="输入链接"/>
|
||||||
<br>
|
<br>
|
||||||
<el-button @click="queryTask">查询任务</el-button>
|
<el-button @click="queryTask">查询任务</el-button>
|
||||||
@ -67,21 +70,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
|
||||||
})
|
})
|
||||||
|
|
||||||
const 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
|
||||||
}
|
}
|
||||||
@ -186,6 +197,7 @@ export default {
|
|||||||
searchByLink,
|
searchByLink,
|
||||||
searchByKeyword,
|
searchByKeyword,
|
||||||
modify,
|
modify,
|
||||||
|
queryWeekUsedAmount,
|
||||||
link,
|
link,
|
||||||
loadComplete,
|
loadComplete,
|
||||||
AuthCode,
|
AuthCode,
|
||||||
@ -194,6 +206,7 @@ export default {
|
|||||||
preDownloadGallery,
|
preDownloadGallery,
|
||||||
preDownloadVideo,
|
preDownloadVideo,
|
||||||
targetResolution,
|
targetResolution,
|
||||||
|
weekUsed,
|
||||||
store
|
store
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="side" style="width: 100%">
|
<div class="side" style="width: 100%">
|
||||||
<span>{{showType}}历史</span>
|
<span v-show="loadComplete">{{showType}}历史</span>
|
||||||
<div v-show="loadComplete" class="load_complete">
|
<div v-show="loadComplete" class="load_complete">
|
||||||
<el-table :data="galleryTasks" v-show="isShowGalleryHistory">
|
<el-table :data="galleryTasks" v-show="isShowGalleryHistory">
|
||||||
|
|
||||||
@ -23,10 +23,10 @@
|
|||||||
|
|
||||||
<el-table-column label="操作" width="250">
|
<el-table-column label="操作" width="250">
|
||||||
<template #default="scoped">
|
<template #default="scoped">
|
||||||
<span v-show="scoped.row.download">
|
<span>
|
||||||
<el-button @click="downloadTask(scoped.row.download)">下载</el-button>
|
<el-button @click="downloadTask(scoped.row.download)" :disabled="operational(scoped.row.download)">下载</el-button>
|
||||||
<el-button @click="deleteGallery(scoped.row.gid)">删除</el-button>
|
<el-button @click="deleteGallery(scoped.row.gid)" :disabled="operational(scoped.row.download)">删除</el-button>
|
||||||
<el-button @click="onlineGalleryReader(scoped.row.name)">在线看</el-button>
|
<el-button @click="onlineGalleryReader(scoped.row.name)" :disabled="operational(scoped.row.download)">在线看</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -57,10 +57,10 @@
|
|||||||
|
|
||||||
<el-table-column label="操作" width="250">
|
<el-table-column label="操作" width="250">
|
||||||
<template #default="scoped">
|
<template #default="scoped">
|
||||||
<span v-show="scoped.row.download">
|
<span>
|
||||||
<el-button @click="downloadTask(scoped.row.download)">下载</el-button>
|
<el-button @click="downloadTask(scoped.row.download)" :disabled="operational(scoped.row.download)">下载</el-button>
|
||||||
<el-button @click="deleteVideo(scoped.row.id)">删除</el-button>
|
<el-button @click="deleteVideo(scoped.row.id)" :disabled="operational(scoped.row.download)">删除</el-button>
|
||||||
<el-button @click="onlineVideoViewer(scoped.row.name)">在线看</el-button>
|
<el-button @click="onlineVideoViewer()" :disabled="operational(scoped.row.download)">在线看</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -123,11 +123,11 @@ 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 min = computed(() => {
|
let min = computed(() => {
|
||||||
@ -141,8 +141,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(() => {
|
||||||
|
return store.state.loadComplete
|
||||||
})
|
})
|
||||||
|
|
||||||
function next() {
|
function next() {
|
||||||
@ -169,10 +173,6 @@ export default {
|
|||||||
targetPage.value = min.value
|
targetPage.value = min.value
|
||||||
}
|
}
|
||||||
|
|
||||||
let loadComplete = computed(() => {
|
|
||||||
return store.getters.loadComplete
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
function changePage(){
|
function changePage(){
|
||||||
if(targetPage.value >= min.value && targetPage.value <= max.value)
|
if(targetPage.value >= min.value && targetPage.value <= max.value)
|
||||||
@ -203,8 +203,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(){
|
||||||
@ -218,6 +218,10 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function operational(download){
|
||||||
|
return download === undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return {galleryTasks,
|
return {galleryTasks,
|
||||||
videoTasks,
|
videoTasks,
|
||||||
@ -243,6 +247,7 @@ export default {
|
|||||||
deleteVideo,
|
deleteVideo,
|
||||||
onlineGalleryReader,
|
onlineGalleryReader,
|
||||||
onlineVideoViewer,
|
onlineVideoViewer,
|
||||||
|
operational,
|
||||||
store
|
store
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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
|
||||||
@ -321,12 +337,6 @@ const mutations = {
|
|||||||
},
|
},
|
||||||
_setMaskDomain(state, maskDomain){
|
_setMaskDomain(state, maskDomain){
|
||||||
state.maskDomain = maskDomain
|
state.maskDomain = maskDomain
|
||||||
},
|
|
||||||
_openHistoryPanel(state){
|
|
||||||
state.showHistory = true
|
|
||||||
},
|
|
||||||
_closeHistoryPanel(state){
|
|
||||||
state.showHistory = false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -347,7 +357,8 @@ const state = {
|
|||||||
isInclude:false, //是否搜索到任务
|
isInclude:false, //是否搜索到任务
|
||||||
searchTask:[], //搜索到的任务
|
searchTask:[], //搜索到的任务
|
||||||
showHistory:'', //是否打开面板
|
showHistory:'', //是否打开面板
|
||||||
showType:"gallery",
|
showType:"gallery", //展示类型
|
||||||
|
weekUsed:{},
|
||||||
|
|
||||||
maskDomain:[]
|
maskDomain:[]
|
||||||
}
|
}
|
||||||
@ -389,30 +400,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
|
|
||||||
},
|
|
||||||
showHistory(state){
|
|
||||||
return state.showHistory
|
|
||||||
},
|
|
||||||
showType(state){
|
|
||||||
return state.showType
|
|
||||||
},
|
|
||||||
maskDomain(state){
|
|
||||||
return state.maskDomain
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user