点击搜索按钮,页面自动下滑

master
ynmlzdwsp 11 months ago
parent e736fcb2e0
commit bd3496195d

@ -75,20 +75,14 @@
<div class="announcement background-opacity">
<i class="fa fa-volume-up" aria-hidden="true"></i>
<div>
<div v-for="(notice, index) in $store.state.webInfo.notices" :key="index">
{{ notice }}
</div>
<!-- <div v-for="(notice, index) in $store.state.webInfo.notices" :key="index">-->
<!-- {{ notice }}-->
<!-- </div>-->
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;世界上只有一种真正的英雄主义那就是看清生活的真相之后依然勇敢地热爱生活
</div>
</div>
<articleList :articleList="articles"></articleList>
<!-- <div class="pagination-wrap">-->
<!-- <div @click="pageArticles()" class="pagination" v-if="pagination.total !== articles.length">-->
<!-- 下一页-->
<!-- </div>-->
<!-- <div v-else style="user-select: none">-->
<!-- ~~到底啦~~-->
<!-- </div>-->
<!-- </div>-->
<template>
<div class="pagination-wrap">
<el-table :data="table1List">
@ -109,20 +103,17 @@
</div>
<!-- <div style="user-select: none;text-align: center">-->
<!-- ~~到底啦~~-->
<!-- </div>-->
<!--分页组件-->
<div class="block">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage4"
:page-sizes="[100, 200, 300, 400]"
:page-size="100"
:current-page="currentPage1"
:page-sizes="[7, 10, 15, 20]"
:page-size="7"
layout="total, sizes, prev, pager, next, jumper"
:total="400">
:total=this.pagination.total>
</el-pagination>
</div>
</template>
@ -141,7 +132,7 @@
</div>
</template>
<script>
import {listTable1} from "@/utils/table1";
import {listTable1, listTotal} from "@/utils/table1";
const loader = () => import( "./common/loader");
const zombie = () => import( "./common/zombie");
@ -162,9 +153,9 @@
data() {
return {
currentPage1: 5,
currentPage2: 5,
currentPage3: 5,
currentPage1: 1,
currentPage2: 2,
currentPage3: 3,
currentPage4: 4,
loading: false,
showAside: true,
@ -188,7 +179,7 @@
//
queryParams: {
pageNum: 1,
pageSize: 10,
pageSize: 7,
drug1: null,
drug2: null,
reaction: null
@ -201,23 +192,38 @@
created() {
this.getGuShi();
this.getArticles();
this.getList();
this.handleQuery();
},
mounted() {
},
methods: {
/** 查询药品作用列表条数 */
getTotal() {
listTotal(this.queryParams).then(response => {
this.pagination.total = parseInt(response);
console.log(this.pagination.total);
});
},
handleSizeChange(val) {
console.log(`每页 ${val}`);
this.queryParams.pageSize = val; //
this.getList();
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
this.queryParams.pageNum = val; //
this.getList();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.getTotal();
//
const targetElement = document.querySelector('.recent-posts');
if (targetElement) {
targetElement.scrollIntoView({ behavior: "smooth", block: "start" });
}
},
/** 查询药品作用管理列表 */
getList() {
@ -225,7 +231,6 @@
this.table1List = []; //
listTable1(this.queryParams).then(response => {
this.table1List = response;
console.log(this.table1List[0].reaction);
});
},
async selectSort(sort) {

@ -1,27 +1,27 @@
<template>
<div>
<!-- 网站信息 -->
<!-- <div class="card-content1 shadow-box background-opacity">-->
<!-- <el-avatar style="margin-top: 20px" class="user-avatar" :size="120" :src="webInfo.avatar"></el-avatar>-->
<!-- <div class="web-name">{{webInfo.webName}}</div>-->
<!-- <div class="web-info">-->
<!-- <div class="blog-info-box">-->
<!-- <span>文章</span>-->
<!-- <span class="blog-info-num">{{ $store.getters.articleTotal }}</span>-->
<!-- </div>-->
<!-- <div class="blog-info-box">-->
<!-- <span>分类</span>-->
<!-- <span class="blog-info-num">{{ sortInfo.length }}</span>-->
<!-- </div>-->
<!-- <div class="blog-info-box">-->
<!-- <span>访问量</span>-->
<!-- <span class="blog-info-num">{{ webInfo.historyAllCount }}</span>-->
<!-- </div>-->
<!-- </div>-->
<!-- <a class="collection-btn" @click="showTip()">-->
<!-- <i class="el-icon-star-off" style="margin-right: 2px"></i>朋友圈-->
<!-- </a>-->
<!-- </div>-->
<div class="card-content1 shadow-box background-opacity">
<el-avatar style="margin-top: 20px" class="user-avatar" :size="120" :src="webInfo.avatar"></el-avatar>
<div class="web-name">{{webInfo.webName}}</div>
<div class="web-info">
<div class="blog-info-box">
<span>文章</span>
<span class="blog-info-num">{{ $store.getters.articleTotal }}</span>
</div>
<div class="blog-info-box">
<span>分类</span>
<span class="blog-info-num">{{ sortInfo.length }}</span>
</div>
<div class="blog-info-box">
<span>访问量</span>
<span class="blog-info-num">{{ webInfo.historyAllCount }}</span>
</div>
</div>
<a class="collection-btn" @click="showTip()">
<i class="el-icon-star-off" style="margin-right: 2px"></i>朋友圈
</a>
</div>
<!-- 搜索 -->
<div style="padding: 15px;border-radius: 10px;margin-top: 30px;animation: hideToShow 1s ease-in-out"

@ -7,6 +7,12 @@ export function listTable1(query) {
.catch(error => console.error(error));
}
export function listTotal(query) {
const url = '/system/table1/total';
return axios.get(url, { params: query })
.then(response => response.data)
.catch(error => console.error(error));
}
// 查询药品作用管理详细
export function getTable1(id) {

Loading…
Cancel
Save