|
@@ -124,14 +124,16 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
- // this.getDataList();
|
|
|
+ const param = this.$route.params;
|
|
|
+ if(param.currentPage){
|
|
|
+ this.inCurrentPage = param.currentPage
|
|
|
+ this.filter = param.filter
|
|
|
+ }
|
|
|
+
|
|
|
this.getTypeList();
|
|
|
- const that = this;
|
|
|
//返回时避免参数未赋值就获取列表
|
|
|
- setTimeout(function() {
|
|
|
- });
|
|
|
this.$nextTick(()=>{
|
|
|
- that.getDataList();
|
|
|
+ this.getDataList();
|
|
|
})
|
|
|
},
|
|
|
watch: {
|
|
@@ -142,13 +144,13 @@ export default {
|
|
|
deep: true
|
|
|
}
|
|
|
},
|
|
|
- beforeRouteEnter(to, from, next) {
|
|
|
- next(vm => {
|
|
|
- //const pm = to.param;
|
|
|
- Object.assign(vm, to.params);
|
|
|
- vm.inCurrentPage = to.params.currentPage;
|
|
|
- });
|
|
|
- },
|
|
|
+ // beforeRouteEnter(to, from, next) {
|
|
|
+ // next(vm => {
|
|
|
+ // //const pm = to.param;
|
|
|
+ // Object.assign(vm, to.params);
|
|
|
+ // vm.inCurrentPage = to.params.currentPage;
|
|
|
+ // });
|
|
|
+ // },
|
|
|
methods: {
|
|
|
handleSizeChange(val) {
|
|
|
this.pageSize = val;
|
|
@@ -325,8 +327,7 @@ export default {
|
|
|
} else {
|
|
|
if (this.filter.isState !== '' && this.list.length === 1) {
|
|
|
//有启用状态筛选条件且当前页只有最后一条数据删除时,删除成功后跳转到前一页
|
|
|
- this.currentPage =
|
|
|
- this.currentPage === 1 ? 1 : this.currentPage - 1;
|
|
|
+ this.currentPage = this.currentPage === 1 ? 1 : this.currentPage - 1;
|
|
|
}
|
|
|
}
|
|
|
this.warning(res.data.msg || '操作成功', 'success');
|