| | |
| | | this.selectList('page') |
| | | }, |
| | | selectList(val) { |
| | | console.log('val---', val) |
| | | console.log('this.page---', this.page) |
| | | this.loading = true |
| | | if(val===undefined){ |
| | | this.page.current = 1; |
| | | } |
| | | if (val === 'lastPage') { |
| | | this.page.current = this.page.current - 1 // 例如删除本页最后一条数据,将当前页面定为上一页,除第一页外 |
| | | } |
| | | if (this.data.isPage != undefined && this.data.isPage != true) { |
| | | this.page = { |
| | |
| | | this.total = res.data.body.total |
| | | this.tableHead = res.data.head |
| | | this.tableData = res.data.body.records |
| | | if (this.tableData.length === 0 && this.page.current > 1) { |
| | | this.selectList('lastPage') |
| | | } |
| | | if (this.isColumnWidth) { |
| | | this.tableHead.forEach(item => { |
| | | if (item.value.length === 4) { |
| | |
| | | item.width = 86 |
| | | } |
| | | }) |
| | | console.log('this.tableHead----', this.tableHead) |
| | | } |
| | | // console.log(JSON.stringify(this.tableHead)+"---------"+JSON.stringify(this.tableData)) |
| | | for (var a in this.data.selectField) { |
| | |
| | | return |
| | | } |
| | | this.$message.success('删除成功') |
| | | this.selectList() |
| | | this.selectList('page') |
| | | this.$emit('delete') |
| | | }).catch(e => { |
| | | this.$message.error('删除失败') |
| | |
| | | } |
| | | this.$message.success('修改成功') |
| | | this.upDia = false |
| | | this.selectList() |
| | | this.selectList('page') |
| | | this.$refs.eltable.doLayout(); |
| | | this.upLoad = false |
| | | }).catch(e => { |
| | |
| | | } |
| | | this.$message.success('添加成功') |
| | | this.addDia = false |
| | | this.selectList() |
| | | this.selectList('page') |
| | | this.addLoad = false |
| | | }).catch(e => { |
| | | this.addDia = false |