分页缓存

dev_2022-05-11
yujialong 3 years ago
parent d3c8999921
commit 91033ece9d
  1. 19
      src/pages/achievement/list/index.vue
  2. 5
      src/pages/assessment/list/index.vue
  3. 3
      src/pages/course/list/courseManagement/index.vue
  4. 3
      src/pages/information/contentManage/contentList.vue
  5. 3
      src/pages/match/list/index.vue
  6. 2
      src/pages/project/add/index.vue
  7. 37
      src/pages/project/list/index.vue

@ -141,7 +141,7 @@ export default {
} }
], ],
date: "", date: "",
page: 1, page: +this.$route.query.page || 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
loadIns: null loadIns: null
@ -248,7 +248,13 @@ export default {
}); });
}, },
perChange(val) { perChange(val) {
this.$router.push(`list?per=${val}`) this.$router.push({
path: 'list',
query: {
...this.$route.query,
per: val
}
})
this.getData() this.getData()
}, },
initData() { initData() {
@ -317,7 +323,14 @@ export default {
this.multipleSelection = val; this.multipleSelection = val;
}, },
handleCurrentChange(val) { // handleCurrentChange(val) { //
this.page = val; this.page = val
this.$router.push({
path: 'list',
query: {
...this.$route.query,
page: val
}
})
this.getData(); this.getData();
} }
} }

@ -180,7 +180,7 @@ export default {
endTime: "", endTime: "",
month: "" month: ""
}, },
pageNum: 1, // pageNum: +this.$route.query.page || 1, //
pageSize: 10, // 10 pageSize: 10, // 10
total: 0, // total: 0, //
listData: [], // listData: [], //
@ -422,7 +422,8 @@ export default {
this.getData(); this.getData();
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.pageNum = val; this.pageNum = val
this.$router.push(`list?page=${val}`)
this.sss = 0 this.sss = 0
this.getData(); this.getData();
}, },

@ -85,7 +85,7 @@ export default {
courseData: [], courseData: [],
multipleSelection: [], multipleSelection: [],
classificationList: [], classificationList: [],
current: 1, // current: +this.$route.query.page || 1, //
pageSize: 10, pageSize: 10,
totals: 0 totals: 0
}; };
@ -195,6 +195,7 @@ export default {
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.current = val; this.current = val;
this.$router.push(`list?page=${val}`)
this.getData(); this.getData();
}, },
switchOff(val, row, index) { switchOff(val, row, index) {

@ -72,7 +72,7 @@ export default {
}, },
listData: [], listData: [],
multipleSelection: [], multipleSelection: [],
pageNo: 1, pageNo: +this.$route.query.page || 1,
pageSize: 10, pageSize: 10,
totals: 0 totals: 0
}; };
@ -108,6 +108,7 @@ export default {
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.pageNo = val; this.pageNo = val;
this.$router.push(`list?page=${val}`)
this.getData(); this.getData();
}, },
addArticle() { addArticle() {

@ -134,7 +134,7 @@ export default {
} }
], ],
date: [], date: [],
pageNo: 1, pageNo: +this.$route.query.page || 1,
pageSize: 10, pageSize: 10,
totals: 0, totals: 0,
transferPublishStatus: ["已发布", "未发布"] transferPublishStatus: ["已发布", "未发布"]
@ -243,6 +243,7 @@ export default {
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.pageNo = val; this.pageNo = val;
this.$router.push(`list?page=${val}`)
this.getData(); this.getData();
}, },
transferTime(date, type) { transferTime(date, type) {

@ -679,7 +679,7 @@ export default {
}, },
// //
toList() { toList() {
this.$router.push(`/project/list?founder=${this.founder}`) this.$router.back()
}, },
// //
back() { back() {

@ -9,7 +9,7 @@
<ul class="filter"> <ul class="filter">
<li> <li>
<label>创建人</label> <label>创建人</label>
<el-select v-model="queryData.founder" clearable placeholder="请选择创建人" @change="initData"> <el-select v-model="queryData.founder" clearable placeholder="请选择创建人" @change="founderChange">
<el-option <el-option
v-for="(item,index) in founderList" v-for="(item,index) in founderList"
:key="index" :key="index"
@ -148,7 +148,7 @@ export default {
curriculumList: [], curriculumList: [],
queryData: { queryData: {
platformId: 1, // :1 :3 platformId: 1, // :1 :3
founder: 2, // (0: 1: 2:) founder: +this.$route.query.founder || 2, // (0: 1: 2:)
state: "", // (0:稿 1:) state: "", // (0:稿 1:)
permissions: "", // (0: 1: 2:) permissions: "", // (0: 1: 2:)
cid: '' cid: ''
@ -209,13 +209,14 @@ export default {
0: "草稿箱", 0: "草稿箱",
1: "已发布" 1: "已发布"
}, },
page: 1, page: +this.$route.query.page || 1,
pageSize: 10, pageSize: 10,
multipleSelection: [], multipleSelection: [],
copyVisible: false, copyVisible: false,
projectName: "", projectName: "",
currentRow: {}, // currentRow: {}, //
listDataAll: [] listDataAll: [],
isFirst: true
}; };
}, },
computed: { computed: {
@ -247,11 +248,6 @@ export default {
if(this.queryDataStatus.platformId) { if(this.queryDataStatus.platformId) {
this.queryData = this.queryDataStatus this.queryData = this.queryDataStatus
} }
if(this.$route.query.founder && this.$route.query.founder != 'undefined'){
this.queryData.founder = +this.$route.query.founder
}else{
this.queryData.founder = 2
}
}, },
methods: { methods: {
...mapActions("project", [ ...mapActions("project", [
@ -266,13 +262,12 @@ export default {
this.systemListAll = res.data; this.systemListAll = res.data;
// systemIdsystemIdsystemId // systemIdsystemIdsystemId
this.getschoolCourse() this.getschoolCourse()
}else{
} }
}); });
}, },
getData() { getData() {
this.setSystemId(this.systemId); this.setSystemId(this.systemId);
if (this.isFirst) this.page = +this.$route.query.page || 1
let data = { let data = {
...this.queryData, ...this.queryData,
projectName: this.keyword, projectName: this.keyword,
@ -281,6 +276,7 @@ export default {
systemId: this.systemId systemId: this.systemId
}; };
this.$post(this.api.queryProjectManage, data).then(res => { this.$post(this.api.queryProjectManage, data).then(res => {
this.isFirst = false
this.listData = res.data.records; this.listData = res.data.records;
this.total = res.data.total; this.total = res.data.total;
}).catch(err => { }).catch(err => {
@ -301,9 +297,19 @@ export default {
courseChange(val) { courseChange(val) {
const systemIds = this.curriculumList.find(e => e.cid == this.queryData.cid).systemId.split(',') // systemId const systemIds = this.curriculumList.find(e => e.cid == this.queryData.cid).systemId.split(',') // systemId
this.systemList = this.systemListAll.filter(e => systemIds.includes(e.id + '')) // this.systemList = this.systemListAll.filter(e => systemIds.includes(e.id + '')) //
this.systemId = this.systemList[0].id if (this.systemList.length) this.systemId = this.systemList[0].id
this.initData() this.initData()
}, },
//
founderChange(val) {
this.$router.push({
path: 'list',
query: {
...this.$route.query,
founder: val
}
})
},
initData() { initData() {
this.page = 1; this.page = 1;
this.getData(); this.getData();
@ -315,6 +321,13 @@ export default {
}, },
handleCurrentChange(val) { // handleCurrentChange(val) { //
this.page = val; this.page = val;
this.$router.push({
path: 'list',
query: {
...this.$route.query,
page: val
}
})
this.getData(); this.getData();
}, },
add() { // add() { //

Loading…
Cancel
Save