diff --git a/src/components/u-table-view.vue/index.vue b/src/components/u-table-view.vue/index.vue index fc10059ed..ed3274536 100644 --- a/src/components/u-table-view.vue/index.vue +++ b/src/components/u-table-view.vue/index.vue @@ -1035,6 +1035,7 @@ export default { getExtraParams: this.getExtraParams, process: this.processData, filterMultiple: this.filterMultiple, + useCache: !this.usePagination, // fix:2879747503294464 大数据分页使用cache性能问题 }; if (this.treeDisplay && this.valueField && this.parentField && this.childrenField) { diff --git a/src/utils/DataSource/new.js b/src/utils/DataSource/new.js index 883d8f694..4ed2bc377 100644 --- a/src/utils/DataSource/new.js +++ b/src/utils/DataSource/new.js @@ -133,6 +133,7 @@ const VueDataSource = Vue.extend({ queryChanged: false, treeDisplay: false, + useCache: true, }; }, computed: { @@ -161,8 +162,10 @@ const VueDataSource = Vue.extend({ if (this.paging) { if (this.viewMode === 'more') return this.arrangedData.slice(0, this.offset + this.limit); - else - return this.arrangedData.slice(this.offset, this.offset + this.limit); + else { + const data = this.arrangedData.slice(this.offset, this.offset + this.limit); + return data.length === 0 ? this.arrangedData : data; + } } else return this.arrangedData; }, @@ -415,11 +418,15 @@ const VueDataSource = Vue.extend({ if (!this.remotePaging || limit === Infinity) { this.data = finalResult.data; } else { - for (let i = 0; i < limit; i++) { - const item = finalResult.data[i]; - if (item) { - this.data[offset + i] = item; + if (this.useCache) { + for (let i = 0; i < limit; i++) { + const item = finalResult.data[i]; + if (item) { + this.data[offset + i] = item; + } } + } else { + this.data = finalResult.data; } }