处理里站搜索时没有搜索结果的情况。里站搜索时增加加载图标(同步更新)
This commit is contained in:
parent
dc4960cdac
commit
db0b6319cf
@ -84,7 +84,7 @@
|
||||
|
||||
<el-dialog title="里站搜索" v-model="isQuerying" top="0" style="margin-bottom: 0">
|
||||
<div style="text-align: center">
|
||||
<el-input v-model="keyword"></el-input> <el-button @click="queryGalleries(null)">查询</el-button>
|
||||
<el-input v-model="keyword"></el-input> <el-button @click="queryGalleries(null)">查询</el-button> <div id="loading"/>
|
||||
</div>
|
||||
<el-scrollbar height="525px">
|
||||
<div style="height: 251px; width: 100%; background-color: #f5f5f5; border-radius: 5px" v-for="gallery in galleries">
|
||||
@ -228,19 +228,25 @@ function queryGalleries(link){
|
||||
tempParam = keyword.value
|
||||
}
|
||||
tempParam = tempParam.replace(" ", "+")
|
||||
document.getElementById("loading").style.display = "inline-block";
|
||||
|
||||
axios.get("http://downloader.lionwebsite.xyz/query?keyword=" + tempParam)
|
||||
.then((res) => {
|
||||
let tempGalleries = JSON.parse(res.data.data)
|
||||
queryPage.value.first = 'first' in res.data? res.data.first: undefined
|
||||
queryPage.value.previous = 'previous' in res.data? res.data.previous: undefined
|
||||
queryPage.value.next = 'next' in res.data? res.data.next: undefined
|
||||
queryPage.value.last = 'last' in res.data? res.data.last: undefined
|
||||
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
|
||||
queryPage.value.previous = 'previous' in res.data ? res.data.previous : undefined
|
||||
queryPage.value.next = 'next' in res.data ? res.data.next : undefined
|
||||
queryPage.value.last = 'last' in res.data ? res.data.last : undefined
|
||||
|
||||
galleries.value.splice(0)
|
||||
tempGalleries.forEach((gallery) => {
|
||||
galleries.value.push(gallery)
|
||||
})
|
||||
galleries.value.splice(0)
|
||||
tempGalleries.forEach((gallery) => {
|
||||
galleries.value.push(gallery)
|
||||
})
|
||||
}else {
|
||||
ElMessage({message: res.data.data, type: "error"})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@ -305,4 +311,18 @@ onMounted(() => {
|
||||
.el-input{
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
#loading {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
border: 2px solid #ccc;
|
||||
border-top-color: #3498db;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
display: none;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
</style>
|
||||
@ -2,7 +2,10 @@
|
||||
<div class="side" style="width: 100%">
|
||||
<span v-show="loadComplete">本子历史</span>
|
||||
<div v-show="loadComplete" class="load_complete">
|
||||
<el-table :data="currentTasks" :empty-text="emptyText" :row-key="gallery=>gallery.gid">
|
||||
<el-table :data="currentTasks"
|
||||
:empty-text="emptyText"
|
||||
:row-key="gallery=>gallery.gid"
|
||||
>
|
||||
|
||||
<el-table-column type="expand">
|
||||
<template #default="props">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user