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

master
ynmlzdwsp 11 months ago
parent e736fcb2e0
commit bd3496195d

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

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

Loading…
Cancel
Save