From 1c75af4ee2a40c1b0ceb3d078c4b3d7ba8ac9551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=A1=E9=A3=8E?= <18012261618@126.com> Date: Fri, 10 Nov 2023 13:39:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=80=89=E6=8B=A9=E5=99=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E6=97=B6=E5=85=88=E8=8E=B7=E5=8F=96=E5=88=B0=E5=85=A8?= =?UTF-8?q?=E9=87=8F=E6=95=B0=E6=8D=AE=E8=BF=9B=E8=A1=8C=E5=9B=9E=E6=98=BE?= =?UTF-8?q?=20(#207)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 选择器分页时先获取到全量数据进行回显 --- src/mixins/DataSource.js | 12 +++++++ src/pickerson/demo/index.vue | 56 ++++++-------------------------- src/pickerson/index.js | 7 ++-- src/utils/DataSource/index.js | 61 +++++++++++++++++++++++++++++++++++ 4 files changed, 87 insertions(+), 49 deletions(-) diff --git a/src/mixins/DataSource.js b/src/mixins/DataSource.js index 929ac69f3..29c28d2d7 100644 --- a/src/mixins/DataSource.js +++ b/src/mixins/DataSource.js @@ -33,6 +33,9 @@ export default { // treeDisplay: { type: Boolean, default: false }, // 由组件自己定义 parentField: { type: String, default: 'parentId' }, childrenField: { type: String, default: 'children' }, + + // 其他 + // needAllRemoteData: { type: Boolean, default: false }, // 由组件自己定义 }, data() { return { @@ -48,6 +51,13 @@ export default { currentData() { return this.currentDataSource && this.currentDataSource.viewData; }, + allRemoteData() { + if (this.currentDataSource.remote) { + return this.currentDataSource.allData; + } + + return this.currentDataSource.data; + }, paging() { if (this.pageable) { const paging = {}; @@ -134,6 +144,8 @@ export default { filtering: this.filtering, sorting: this.currentSorting, + needAllData: this.needAllRemoteData, + getExtraParams: this.getExtraParams, }; diff --git a/src/pickerson/demo/index.vue b/src/pickerson/demo/index.vue index d5188eff9..4f70f467b 100644 --- a/src/pickerson/demo/index.vue +++ b/src/pickerson/demo/index.vue @@ -11,31 +11,33 @@ title="标题" :show-toolbar="true" - labelField="左侧标题" - input-align="left" :pvalue.sync="pickerValue" :data-source="load" - :columnsprop="[1, 2, 3, 4]" :pageable="true" :pageSize="10" :filterable="true" @confirm="confirm111" @change="change111"> -