分页修复

chengdu V1.0.1
yujialong 4 years ago
parent aef27ebccd
commit 6028c3bb7c
  1. 10
      src/components/page/Assessment.vue
  2. 10
      src/components/page/Project.vue

@ -11,14 +11,14 @@
<div> <div>
<el-form label-width="80px"> <el-form label-width="80px">
<el-form-item label="实验班级" class="userRadio"> <el-form-item label="实验班级" class="userRadio">
<el-radio-group v-model="form.classId" @change="getData"> <el-radio-group v-model="form.classId" @change="initData">
<el-radio label="" border>不限</el-radio> <el-radio label="" border>不限</el-radio>
<el-radio v-for="(item,index) in classList" :key="index" :label="item.classId" border>{{item.className}}</el-radio> <el-radio v-for="(item,index) in classList" :key="index" :label="item.classId" border>{{item.className}}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<div class="flex-between no-mb"> <div class="flex-between no-mb">
<el-form-item label="考核状态"> <el-form-item label="考核状态">
<el-select v-model="form.status" clearable placeholder="请选择实验状态" @change="getData"> <el-select v-model="form.status" clearable placeholder="请选择实验状态" @change="initData">
<el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.value"></el-option> <el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -140,7 +140,7 @@ export default {
keyword: function(val) { keyword: function(val) {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.getData() this.initData()
},500) },500)
} }
}, },
@ -214,6 +214,10 @@ export default {
this.handlePage() this.handlePage()
}).catch(err => {}) }).catch(err => {})
}, },
initData(){
this.pageNo = 1
this.getData()
},
handlePage(){ handlePage(){
let list = this.listDataAll let list = this.listDataAll
this.listData = list.slice((this.pageNo - 1) * this.pageSize,this.pageNo * this.pageSize) this.listData = list.slice((this.pageNo - 1) * this.pageSize,this.pageNo * this.pageSize)

@ -11,7 +11,7 @@
<div> <div>
<el-form label-width="80px"> <el-form label-width="80px">
<el-form-item label="实验时间" class="userRadio"> <el-form-item label="实验时间" class="userRadio">
<el-radio-group v-model="form.month" @change="getData"> <el-radio-group v-model="form.month" @change="initData">
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio> <el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio>
</el-radio-group> </el-radio-group>
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" <el-date-picker v-model="date" align="right" unlink-panels type="daterange"
@ -19,7 +19,7 @@
</el-form-item> </el-form-item>
<div class="flex-between no-mb"> <div class="flex-between no-mb">
<el-form-item label="实验状态"> <el-form-item label="实验状态">
<el-select v-model="form.status" clearable placeholder="请选择实验状态" @change="getData"> <el-select v-model="form.status" clearable placeholder="请选择实验状态" @change="initData">
<el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.value"></el-option> <el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -182,7 +182,7 @@ export default {
keyword: function(val) { keyword: function(val) {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.getData() this.initData()
},500) },500)
} }
}, },
@ -234,6 +234,10 @@ export default {
}).catch(err => {}) }).catch(err => {})
}).catch(res => {}); }).catch(res => {});
}, },
initData(){
this.pageNo = 1
this.getData()
},
add(){ add(){
this.$store.commit("customerData", { customer_id : ''}); this.$store.commit("customerData", { customer_id : ''});
this.$router.push('/addclass'); this.$router.push('/addclass');

Loading…
Cancel
Save