From d9090877c6a743f4eb2f9540144154cd31476ce3 Mon Sep 17 00:00:00 2001 From: Zheng Jie <201507802@qq.com> Date: Tue, 9 Aug 2022 16:13:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=A0=91=E5=BD=A2=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E7=88=B6=E7=BA=A7=E9=80=89=E6=8B=A9=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=88=A0=E9=99=A4=E6=8C=89=E9=92=AE=E8=BF=98=E8=83=BD?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=AD=90=E8=8A=82=E7=82=B9=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/elunez/eladmin-web/commit/e4e72887bafaacd69bf15f3ea99826d0012062bc --- src/components/Crud/crud.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Crud/crud.js b/src/components/Crud/crud.js index ae36765..b5bd398 100644 --- a/src/components/Crud/crud.js +++ b/src/components/Crud/crud.js @@ -480,6 +480,7 @@ function CRUD(options) { toggleRowSelection(selection, data) { if (data.children) { data.children.forEach(val => { + selection.splice(selection.findIndex(item => this.getDataId(item) === this.getDataId(val)), 1) crud.getTable().toggleRowSelection(val, false) if (val.children) { crud.toggleRowSelection(selection, val) From 72a88e1b6d1bcc33bfc7d95e68d0dd0080a4cedb Mon Sep 17 00:00:00 2001 From: Zheng Jie <201507802@qq.com> Date: Thu, 24 Nov 2022 15:31:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mixins/crud.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/mixins/crud.js b/src/mixins/crud.js index bb90342..22c1920 100644 --- a/src/mixins/crud.js +++ b/src/mixins/crud.js @@ -5,7 +5,7 @@ import { import { parseTime, downloadFile -} from '@/utils/index' +} from '@/utils' export default { data() { @@ -57,7 +57,7 @@ export default { return new Promise((resolve, reject) => { this.loading = true // 请求数据 - initData(this.url, this.getQueryParame()).then(data => { + initData(this.url, this.getQueryParams()).then(data => { this.total = data.totalElements this.data = data.content // time 毫秒后显示表格 @@ -74,7 +74,14 @@ export default { beforeInit() { return true }, - getQueryParame: function() { + getQueryParams: function() { + // 清除参数无值的情况 + Object.keys(this.query).length !== 0 && Object.keys(this.query).forEach(item => { + if (this.query[item] === null || this.query[item] === '') this.query[item] = undefined + }) + Object.keys(this.params).length !== 0 && Object.keys(this.params).forEach(item => { + if (this.params[item] === null || this.params[item] === '') this.params[item] = undefined + }) return { page: this.page, size: this.size,