Commit 2ecb71f2 authored by 吴冠's avatar 吴冠

分页优化

parent 70b3106b
...@@ -26,7 +26,7 @@ import Cookies from "js-cookie" ...@@ -26,7 +26,7 @@ import Cookies from "js-cookie"
export default { export default {
methods:{ methods:{
toSearch(){ toSearch(){
Cookies.set("content",this.input) Cookies.set("inputContent",this.input)
Cookies.set("contentStatus",1) Cookies.set("contentStatus",1)
if(window.location.pathname !=="/notice/all"){ if(window.location.pathname !=="/notice/all"){
this.$router.push('/notice/all') this.$router.push('/notice/all')
......
...@@ -175,13 +175,13 @@ import {getErrorList} from '@/common/list.js' ...@@ -175,13 +175,13 @@ import {getErrorList} from '@/common/list.js'
handleSizeChange(val) { handleSizeChange(val) {
let mess = {} let mess = {}
mess.size = val mess.size = val
mess.currentPage = this.getData.currentPage mess.noticeType = "ABORTIVE"
this.getErrorList(mess) this.getErrorList(mess)
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
/* this.getData.currentPage = val */ /* this.getData.currentPage = val */
let mess = {} let mess = {}
mess.size = this.getData.size mess.noticeType = "ABORTIVE"
mess.currentPage = val mess.currentPage = val
this.getErrorList(mess); this.getErrorList(mess);
//获取当前页 //获取当前页
...@@ -265,7 +265,7 @@ import {getErrorList} from '@/common/list.js' ...@@ -265,7 +265,7 @@ import {getErrorList} from '@/common/list.js'
} }
.pagination{ .pagination{
position: absolute; position: absolute;
bottom: -1%; bottom: -2%;
left: 55%; left: 55%;
transform:translateX(-50%); transform:translateX(-50%);
} }
......
...@@ -75,22 +75,26 @@ import Cookies from 'js-cookie' ...@@ -75,22 +75,26 @@ import Cookies from 'js-cookie'
Cookies.remove("content") Cookies.remove("content")
}, */ }, */
async asyncData({params}){ async asyncData({params}){
let inputContent = Cookies.get("content") let inputContent = Cookies.get("inputContent")
console.log(inputContent+'-----------------+++++++++++++++++')
let mes ={ let mes ={
currentPage:1, currentPage:1,
size:10, size:10,
title:inputContent title:inputContent
} }
/* if(inputContent!=''){
mes.title = inputContent
} */
const res = await industryList(); const res = await industryList();
const {data,total} = await getAllList(mes) const {data,total} = await getAllList(mes)
console.log(data+'------------') console.log(data+'------------')
Cookies.remove("inputContent")
return { return {
priceList : data, priceList : data,
total : total, total : total,
industryOptions:res industryOptions:res
} }
Cookies.remove("content") },
},
data() { data() {
return { return {
allList:[], allList:[],
...@@ -193,7 +197,7 @@ import Cookies from 'js-cookie' ...@@ -193,7 +197,7 @@ import Cookies from 'js-cookie'
if(contentStatus =='1'){ if(contentStatus =='1'){
if(total!='0'){ if(total!='0'){
console.log(111111111111111) console.log(111111111111111)
/* this.$message.success */alert("查询成功!") /* this.$message.success */
}else{ }else{
console.log(111111111111111111111) console.log(111111111111111111111)
this.$message.error("请输入正确的公告名称!") this.$message.error("请输入正确的公告名称!")
...@@ -219,12 +223,10 @@ import Cookies from 'js-cookie' ...@@ -219,12 +223,10 @@ import Cookies from 'js-cookie'
handleSizeChange(val) { handleSizeChange(val) {
let mess = {} let mess = {}
mess.size = val mess.size = val
mess.currentPage = this.getData.currentPage
this.getAllList(mess) this.getAllList(mess)
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
let mess = {} let mess = {}
mess.size = this.getData.size
mess.currentPage = val mess.currentPage = val
this.getAllList(mess); this.getAllList(mess);
//获取当前页 //获取当前页
...@@ -308,7 +310,7 @@ import Cookies from 'js-cookie' ...@@ -308,7 +310,7 @@ import Cookies from 'js-cookie'
} }
.pagination{ .pagination{
position: absolute; position: absolute;
bottom: -1%; bottom: -2%;
left: 55%; left: 55%;
transform:translateX(-50%); transform:translateX(-50%);
} }
......
...@@ -180,21 +180,15 @@ import citySelect from "@/components/citySelect.vue"; ...@@ -180,21 +180,15 @@ import citySelect from "@/components/citySelect.vue";
handleSizeChange(val) { handleSizeChange(val) {
let mess = {} let mess = {}
mess.size = val mess.size = val
mess.currentPage = this.getData.currentPage mess.noticeType = "BIDDING"
console.log(mess.size) this.getBidingList(mess)
console.log(mess.currentPage)
const {data} =this.getBidingList(mess)
console.log(data+"++++++++++++++++++++++++")
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
/* this.getData.currentPage = val */ /* this.getData.currentPage = val */
let mess = {} let mess = {}
mess.size = this.getData.size
mess.currentPage = val mess.currentPage = val
console.log(mess.size) mess.noticeType = "BIDDING"
console.log(mess.currentPage) this.getBidingList(mess)
const {data} =this.getBidingList(mess)
console.log(data+"++++++++++++++++++++++++")
//获取当前页 //获取当前页
}, },
dealDisabledDate(time) { dealDisabledDate(time) {
...@@ -276,7 +270,7 @@ import citySelect from "@/components/citySelect.vue"; ...@@ -276,7 +270,7 @@ import citySelect from "@/components/citySelect.vue";
} }
.pagination{ .pagination{
position: absolute; position: absolute;
bottom: -1%; bottom: -2%;
left: 55%; left: 55%;
transform:translateX(-50%); transform:translateX(-50%);
} }
......
...@@ -234,13 +234,13 @@ export default { ...@@ -234,13 +234,13 @@ export default {
handleSizeChange(val) { handleSizeChange(val) {
let mess = {} let mess = {}
mess.size = val mess.size = val
mess.currentPage = this.getData.currentPage mess.noticeType = "WIN"
this.getWinList(mess) this.getWinList(mess)
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
/* this.getData.currentPage = val */ /* this.getData.currentPage = val */
let mess = {} let mess = {}
mess.size = this.getData.size mess.noticeType = "WIN"
mess.currentPage = val mess.currentPage = val
this.getWinList(mess); this.getWinList(mess);
//获取当前页 //获取当前页
...@@ -322,7 +322,7 @@ export default { ...@@ -322,7 +322,7 @@ export default {
} }
.pagination{ .pagination{
position: absolute; position: absolute;
bottom: -1%; bottom: -2%;
left: 55%; left: 55%;
transform:translateX(-50%); transform:translateX(-50%);
} }
......
...@@ -177,13 +177,13 @@ import {getCadidateList} from '@/common/list.js' ...@@ -177,13 +177,13 @@ import {getCadidateList} from '@/common/list.js'
handleSizeChange(val) { handleSizeChange(val) {
let mess = {} let mess = {}
mess.size = val mess.size = val
mess.currentPage = this.getData.currentPage mess.noticeType = "CADIDATE"
this.getCadidateList(mess) this.getCadidateList(mess)
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
/* this.getData.currentPage = val */ /* this.getData.currentPage = val */
let mess = {} let mess = {}
mess.size = this.getData.size mess.noticeType = "CADIDATE"
mess.currentPage = val mess.currentPage = val
this.getCadidateList(mess); this.getCadidateList(mess);
//获取当前页 //获取当前页
...@@ -267,7 +267,7 @@ import {getCadidateList} from '@/common/list.js' ...@@ -267,7 +267,7 @@ import {getCadidateList} from '@/common/list.js'
} }
.pagination{ .pagination{
position: absolute; position: absolute;
bottom: -1%; bottom: -2%;
left: 55%; left: 55%;
transform:translateX(-50%); transform:translateX(-50%);
} }
......
...@@ -177,13 +177,13 @@ import {getChangeList} from '@/common/list.js' ...@@ -177,13 +177,13 @@ import {getChangeList} from '@/common/list.js'
handleSizeChange(val) { handleSizeChange(val) {
let mess = {} let mess = {}
mess.size = val mess.size = val
mess.currentPage = this.getData.currentPage mess.noticeType = "CHANGE"
this.getChangeList(mess) this.getChangeList(mess)
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
/* this.getData.currentPage = val */ /* this.getData.currentPage = val */
let mess = {} let mess = {}
mess.size = this.getData.size mess.noticeType = "CHANGE"
mess.currentPage = val mess.currentPage = val
this.getChangeList(mess); this.getChangeList(mess);
//获取当前页 //获取当前页
...@@ -267,7 +267,7 @@ import {getChangeList} from '@/common/list.js' ...@@ -267,7 +267,7 @@ import {getChangeList} from '@/common/list.js'
} }
.pagination{ .pagination{
position: absolute; position: absolute;
bottom: -1%; bottom: -2%;
left: 55%; left: 55%;
transform:translateX(-50%); transform:translateX(-50%);
} }
......
...@@ -175,13 +175,13 @@ import {getClerList} from '@/common/list.js' ...@@ -175,13 +175,13 @@ import {getClerList} from '@/common/list.js'
handleSizeChange(val) { handleSizeChange(val) {
let mess = {} let mess = {}
mess.size = val mess.size = val
mess.currentPage = this.getData.currentPage mess.noticeType = "CLARIFIES"
this.getErrorList(mess) this.getErrorList(mess)
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
/* this.getData.currentPage = val */ /* this.getData.currentPage = val */
let mess = {} let mess = {}
mess.size = this.getData.size mess.noticeType = "CLARIFIES"
mess.currentPage = val mess.currentPage = val
this.getErrorList(mess); this.getErrorList(mess);
//获取当前页 //获取当前页
...@@ -265,7 +265,7 @@ import {getClerList} from '@/common/list.js' ...@@ -265,7 +265,7 @@ import {getClerList} from '@/common/list.js'
} }
.pagination{ .pagination{
position: absolute; position: absolute;
bottom: -1%; bottom: -2%;
left: 55%; left: 55%;
transform:translateX(-50%); transform:translateX(-50%);
} }
......
...@@ -231,7 +231,8 @@ export default { ...@@ -231,7 +231,8 @@ export default {
handleSizeChange(val) { handleSizeChange(val) {
let mess = {} let mess = {}
mess.size = val mess.size = val
mess.currentPage = this.getData.currentPage mess.noticeType = "ENQUIRY"
/* mess.currentPage = this.getData.currentPage */
this.getInquiryList(mess) this.getInquiryList(mess)
/* this.getInquiryList(val,this.getData.currentPage) */ /* this.getInquiryList(val,this.getData.currentPage) */
...@@ -239,7 +240,8 @@ export default { ...@@ -239,7 +240,8 @@ export default {
handleCurrentChange(val) { handleCurrentChange(val) {
/* this.getData.currentPage = val */ /* this.getData.currentPage = val */
let mess = {} let mess = {}
mess.size = this.getData.size mess.noticeType = "ENQUIRY"
/* mess.size = this.getData.size */
mess.currentPage = val mess.currentPage = val
this.getInquiryList(mess); this.getInquiryList(mess);
/* this.getInquiryList(this.getData.size,val) */ /* this.getInquiryList(this.getData.size,val) */
...@@ -257,7 +259,7 @@ export default { ...@@ -257,7 +259,7 @@ export default {
<style scoped> <style scoped>
.pagination{ .pagination{
position: absolute; position: absolute;
bottom: -1%; bottom: -2%;
left: 55%; left: 55%;
transform:translateX(-50%); transform:translateX(-50%);
} }
......
...@@ -15,10 +15,10 @@ const service = axios.create({ ...@@ -15,10 +15,10 @@ const service = axios.create({
// request拦截器 // request拦截器
service.interceptors.request.use(config => { service.interceptors.request.use(config => {
let token=Cookies.get("token") /* let token=Cookies.get("token")
if(token||token!=="undefined"){ if(token||token!=="undefined"){
config.headers['token']=token; config.headers['token']=token;
} }*/
// if (store.getters.token) { // if (store.getters.token) {
// let test = config.data; // let test = config.data;
// if(test){ // if(test){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment