From 89a2c696acb01ccf45f4eff5278f82e824120c6e Mon Sep 17 00:00:00 2001 From: yaojn Date: Wed, 15 Oct 2025 18:46:37 +0800 Subject: [PATCH] =?UTF-8?q?-=20[=E4=BF=AE=E5=A4=8D]=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=A1=86=E7=BB=84=E4=BB=B6=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=9D=A5=E6=BA=90=E6=97=B6=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E9=80=89=E4=B8=AD=E5=AD=98=E5=9C=A8bug=20=20?= =?UTF-8?q?=20=20-=20[=E5=85=B3=E8=81=94]#[1532706377138176]=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E4=B8=8B=E6=8B=89=E6=A1=86=E7=BB=84=E4=BB=B6=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=A0=87=E7=AD=BE=E6=9D=A5=E6=BA=90=E6=97=B6=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E9=BB=98=E8=AE=A4=E9=80=89=E4=B8=AD=E5=AD=98=E5=9C=A8?= =?UTF-8?q?bug=20http://192.168.0.96:8090/demo/rdm.html#/bug-detail/939050?= =?UTF-8?q?947543040/939050947543057/1532706377138176?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TsSheet/form/component/formselect.vue | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/src/resources/plugins/TsSheet/form/component/formselect.vue b/src/resources/plugins/TsSheet/form/component/formselect.vue index e65a1c6c..f75f19f3 100644 --- a/src/resources/plugins/TsSheet/form/component/formselect.vue +++ b/src/resources/plugins/TsSheet/form/component/formselect.vue @@ -162,6 +162,27 @@ export default { } } return dataList; + }, + clearCurrentValue(dataList = []) { + if (!this.$utils.isEmpty(this.value)) { + if (this.$utils.isEmpty(dataList)) { + this.setValue(null); + } else { + let newValue = null; + if (Array.isArray(this.value)) { + newValue = this.value.filter(v => { + return dataList.find(d => d.value === v.value); + }); + if (!this.$utils.isSame(this.value, newValue)) { + this.setValue(newValue); + } + } else { + if (!dataList.find(d => d.value === this.value.value)) { + this.setValue(null); + } + } + } + } } }, filter: {}, @@ -272,27 +293,10 @@ export default { }); } } - if (!this.$utils.isEmpty(this.value)) { - if (this.$utils.isEmpty(setting.dataList)) { - this.setValue(null); - } else { - let newValue = null; - if (Array.isArray(this.value)) { - newValue = this.value.filter(v => { - return setting.dataList.find(d => d.value === v.value); - }); - if (!this.$utils.isSame(this.value, newValue)) { - this.setValue(newValue); - } - } else { - if (!setting.dataList.find(d => d.value === this.value.value)) { - this.setValue(null); - } - } - } - } + this.clearCurrentValue(setting.dataList); } else if (this.config.dataSource === 'tag') { setting.dataList = this.getTagDataList(this.formData); + this.clearCurrentValue(setting.dataList); } else { setting.showName = 'text'; setting.dataList = this.validatedDataList; -- Gitee