|
|
@ -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(){ |
|
|
|
this.$post(`${this.api.getTableByCondition}?showName=${this.keyword}&pageNum=${this.page}&pageSize=${this.pageSize}`).then(res => { |
|
|
|
if (this.keyword) { |
|
|
|
this.listData = res.data.records |
|
|
|
this.$post(`${this.api.getTableByCondition}?showName=${this.keyword}&pageNum=${this.page}&pageSize=${this.pageSize}`).then(res => { |
|
|
|
this.total = res.data.total |
|
|
|
this.listData = res.data.records |
|
|
|
}).catch(res => {}) |
|
|
|
this.total = res.data.total |
|
|
|
|
|
|
|
}).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){ |
|
|
|
this.$router.push(`/data?typeId=${row.categoryTwoId}`) |
|
|
|
if (this.routes.find(e => e.path === '/data/list')) { |
|
|
|
|
|
|
|
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() |
|
|
|
} |
|
|
|
} |
|
|
|