首页热门下载修复

dev_2022-04-07
Jo 3 years ago
parent c5442b6a48
commit 015d1946c3
  1. 1
      src/libs/route/addRoutes.js
  2. 19
      src/pages/index/list/index.vue
  3. 2
      src/pages/stat/list/index.vue

@ -16,7 +16,6 @@ function createRoute(data){
newRoutes.push({ newRoutes.push({
name: e.path, name: e.path,
path: e.path, path: e.path,
path: () => import(`@/pages/${e.path}.vue`),
meta meta
}) })
} }

@ -5,7 +5,7 @@
<div class="search-wrap"> <div class="search-wrap">
<div class="search"> <div class="search">
<input ref="keyword" v-model="keyword" type="text" placeholder="请输入关键词"> <input ref="keyword" v-model="keyword" type="text" placeholder="请输入关键词">
<img v-if="keyword" src="../../../assets/img/remove-gray.png" alt="" class="remove" @click="keyword = ''"> <img v-if="keyword" src="../../../assets/img/remove-gray.png" alt="" class="remove" @click="clearKeyword">
<img class="icon-wrap" src="../../../assets/img/search-gray.png" alt=""> <img class="icon-wrap" src="../../../assets/img/search-gray.png" alt="">
</div> </div>
<div class="hot" v-if="hotData.length"> <div class="hot" v-if="hotData.length">
@ -205,11 +205,15 @@ export default {
...mapState('user', [ ...mapState('user', [
'schoolId' 'schoolId'
]), ]),
...mapState('auth', [
'routes'
])
}, },
watch: { watch: {
keyword: function(val) { keyword: function(val) {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
if (!this.keyword) this.listData = []
this.$refs.keyword.focus() this.$refs.keyword.focus()
this.initData() this.initData()
},500) },500)
@ -220,10 +224,14 @@ export default {
}, },
methods: { methods: {
getData(){ getData(){
if (this.keyword) {
this.$post(`${this.api.getTableByCondition}?showName=${this.keyword}&pageNum=${this.page}&pageSize=${this.pageSize}`).then(res => { this.$post(`${this.api.getTableByCondition}?showName=${this.keyword}&pageNum=${this.page}&pageSize=${this.pageSize}`).then(res => {
this.listData = res.data.records this.listData = res.data.records
this.total = res.data.total this.total = res.data.total
}).catch(res => {}) }).catch(res => {})
} else {
this.listData = []
}
}, },
// //
getHot(){ getHot(){
@ -292,10 +300,18 @@ export default {
window.open(route.href) window.open(route.href)
} }
}, },
clearKeyword() {
this.keyword = ''
this.listData = []
},
toData(row){ toData(row){
// , // ,
if(this.token){ if(this.token){
if (this.routes.find(e => e.path === '/data/list')) {
this.$router.push(`/data?typeId=${row.categoryTwoId}`) this.$router.push(`/data?typeId=${row.categoryTwoId}`)
} else {
this.keyword = row.categoryTwo
}
}else{ }else{
let route = this.$router.resolve({ let route = this.$router.resolve({
path: '/login' path: '/login'
@ -304,7 +320,6 @@ export default {
} }
}, },
toPart(i){ toPart(i){
console.log(i)
this.active = i this.active = i
document.querySelector(`#part${i}`).scrollIntoView() document.querySelector(`#part${i}`).scrollIntoView()
} }

@ -16,7 +16,7 @@
<p class="surplus"> <p class="surplus">
<span class="name">账号数量</span> <span class="name">账号数量</span>
<template v-if="item.accountNum > 1000"> <template v-if="item.accountNum > 1000">
<span></span> <span></span>
</template> </template>
<template v-else> <template v-else>
<span class="num">{{item.accountNum}}</span> <span class="num">{{item.accountNum}}</span>

Loading…
Cancel
Save