[update] 修改bug81029
This commit is contained in:
@@ -115,6 +115,7 @@ import {
|
||||
NoMatchTrackingNodes,
|
||||
StandardComplianceNodes
|
||||
} from '@/enums/commonEnums'
|
||||
import { getAction } from '../../../../api/manage'
|
||||
|
||||
export default {
|
||||
name: 'TodoList',
|
||||
@@ -264,6 +265,40 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadData (arg) {
|
||||
if (!this.url.list) {
|
||||
this.$message.warning('请设置url.list属性!')
|
||||
return
|
||||
}
|
||||
// 加载数据 若传入参数1则加载第一页的内容
|
||||
if (arg === 1) {
|
||||
this.ipagination.current = 1
|
||||
}
|
||||
const params = this.getQueryParams()// 查询条件
|
||||
this.loading = true
|
||||
getAction(this.url.list, params).then((res) => {
|
||||
if (res.success) {
|
||||
if ((res.result.records || res.result).length === 0 && this.ipagination.current !== 1) {
|
||||
this.ipagination.current--
|
||||
this.loadData()
|
||||
this.loading = false
|
||||
return
|
||||
}
|
||||
// update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
||||
this.dataSource = res.result.records || res.result
|
||||
if (res.result.total) {
|
||||
this.ipagination.total = res.result.total
|
||||
} else {
|
||||
this.ipagination.total = 0
|
||||
}
|
||||
// update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
handleTableChange (pagination, filters, sorter) {
|
||||
// 分页、排序、筛选变化时触发
|
||||
if (Object.keys(sorter).length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user