14 changed files with 1117 additions and 446 deletions
@ -0,0 +1,114 @@ |
|||||
|
<template> |
||||
|
<div :class="{'hidden':hidden}" class="pagination-container"> |
||||
|
<el-pagination |
||||
|
:background="background" |
||||
|
:current-page.sync="currentPage" |
||||
|
:page-size.sync="pageSize" |
||||
|
:layout="layout" |
||||
|
:page-sizes="pageSizes" |
||||
|
:pager-count="pagerCount" |
||||
|
:total="total" |
||||
|
v-bind="$attrs" |
||||
|
@size-change="handleSizeChange" |
||||
|
@current-change="handleCurrentChange" |
||||
|
/> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { scrollTo } from '@/utils/scroll-to' |
||||
|
|
||||
|
export default { |
||||
|
name: 'pageInfo', |
||||
|
props: { |
||||
|
total: { |
||||
|
required: true, |
||||
|
type: Number |
||||
|
}, |
||||
|
page: { |
||||
|
type: Number, |
||||
|
default: 1 |
||||
|
}, |
||||
|
limit: { |
||||
|
type: Number, |
||||
|
default: 20 |
||||
|
}, |
||||
|
pageSizes: { |
||||
|
type: Array, |
||||
|
default() { |
||||
|
return [10, 20, 30, 50] |
||||
|
} |
||||
|
}, |
||||
|
// 移动端页码按钮的数量端默认值5 |
||||
|
pagerCount: { |
||||
|
type: Number, |
||||
|
default: document.body.clientWidth < 992 ? 5 : 7 |
||||
|
}, |
||||
|
layout: { |
||||
|
type: String, |
||||
|
default: 'prev, pager, next' |
||||
|
}, |
||||
|
background: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
autoScroll: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
hidden: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
}; |
||||
|
}, |
||||
|
computed: { |
||||
|
currentPage: { |
||||
|
get() { |
||||
|
return this.page |
||||
|
}, |
||||
|
set(val) { |
||||
|
this.$emit('update:page', val) |
||||
|
} |
||||
|
}, |
||||
|
pageSize: { |
||||
|
get() { |
||||
|
return this.limit |
||||
|
}, |
||||
|
set(val) { |
||||
|
this.$emit('update:limit', val) |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
handleSizeChange(val) { |
||||
|
if (this.currentPage * val > this.total) { |
||||
|
this.currentPage = 1 |
||||
|
} |
||||
|
this.$emit('pagination', { page: this.currentPage, limit: val }) |
||||
|
if (this.autoScroll) { |
||||
|
scrollTo(0, 800) |
||||
|
} |
||||
|
}, |
||||
|
handleCurrentChange(val) { |
||||
|
this.$emit('pagination', { page: val, limit: this.pageSize }) |
||||
|
if (this.autoScroll) { |
||||
|
scrollTo(0, 800) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.pagination-container { |
||||
|
background: transparent; |
||||
|
|
||||
|
} |
||||
|
.pagination-container.hidden { |
||||
|
display: none; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,58 @@ |
|||||
|
Math.easeInOutQuad = function(t, b, c, d) { |
||||
|
t /= d / 2 |
||||
|
if (t < 1) { |
||||
|
return c / 2 * t * t + b |
||||
|
} |
||||
|
t-- |
||||
|
return -c / 2 * (t * (t - 2) - 1) + b |
||||
|
} |
||||
|
|
||||
|
// requestAnimationFrame for Smart Animating http://goo.gl/sx5sts
|
||||
|
var requestAnimFrame = (function() { |
||||
|
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60) } |
||||
|
})() |
||||
|
|
||||
|
/** |
||||
|
* Because it's so fucking difficult to detect the scrolling element, just move them all |
||||
|
* @param {number} amount |
||||
|
*/ |
||||
|
function move(amount) { |
||||
|
document.documentElement.scrollTop = amount |
||||
|
document.body.parentNode.scrollTop = amount |
||||
|
document.body.scrollTop = amount |
||||
|
} |
||||
|
|
||||
|
function position() { |
||||
|
return document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param {number} to |
||||
|
* @param {number} duration |
||||
|
* @param {Function} callback |
||||
|
*/ |
||||
|
export function scrollTo(to, duration, callback) { |
||||
|
const start = position() |
||||
|
const change = to - start |
||||
|
const increment = 20 |
||||
|
let currentTime = 0 |
||||
|
duration = (typeof (duration) === 'undefined') ? 500 : duration |
||||
|
var animateScroll = function() { |
||||
|
// increment the time
|
||||
|
currentTime += increment |
||||
|
// find the value with the quadratic in-out easing function
|
||||
|
var val = Math.easeInOutQuad(currentTime, start, change, duration) |
||||
|
// move the document.body
|
||||
|
move(val) |
||||
|
// do the animation unless its over
|
||||
|
if (currentTime < duration) { |
||||
|
requestAnimFrame(animateScroll) |
||||
|
} else { |
||||
|
if (callback && typeof (callback) === 'function') { |
||||
|
// the animation is done so lets callback
|
||||
|
callback() |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
animateScroll() |
||||
|
} |
||||
@ -0,0 +1,59 @@ |
|||||
|
package com.main.woka.Web.Dao; |
||||
|
|
||||
|
public class DhParam { |
||||
|
|
||||
|
private String fjlx; |
||||
|
private String rwlx; |
||||
|
private String zhlx; |
||||
|
private Double fs; |
||||
|
private Double njd; |
||||
|
private Double sd; |
||||
|
|
||||
|
public String getFjlx() { |
||||
|
return fjlx; |
||||
|
} |
||||
|
|
||||
|
public void setFjlx(String fjlx) { |
||||
|
this.fjlx = fjlx; |
||||
|
} |
||||
|
|
||||
|
public String getRwlx() { |
||||
|
return rwlx; |
||||
|
} |
||||
|
|
||||
|
public void setRwlx(String rwlx) { |
||||
|
this.rwlx = rwlx; |
||||
|
} |
||||
|
|
||||
|
public String getZhlx() { |
||||
|
return zhlx; |
||||
|
} |
||||
|
|
||||
|
public void setZhlx(String zhlx) { |
||||
|
this.zhlx = zhlx; |
||||
|
} |
||||
|
|
||||
|
public Double getFs() { |
||||
|
return fs; |
||||
|
} |
||||
|
|
||||
|
public void setFs(Double fs) { |
||||
|
this.fs = fs; |
||||
|
} |
||||
|
|
||||
|
public Double getNjd() { |
||||
|
return njd; |
||||
|
} |
||||
|
|
||||
|
public void setNjd(Double njd) { |
||||
|
this.njd = njd; |
||||
|
} |
||||
|
|
||||
|
public Double getSd() { |
||||
|
return sd; |
||||
|
} |
||||
|
|
||||
|
public void setSd(Double sd) { |
||||
|
this.sd = sd; |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue