From 1a5139677442e7a6c7aab94b63b4a3a71274a8e8 Mon Sep 17 00:00:00 2001 From: dengbf Date: Tue, 7 Nov 2023 17:53:08 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E4=BF=AE=E5=A4=8D]=20userSelect=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=9C=A8transfer=E6=A8=A1=E5=BC=8F=E4=B8=8B=EF=BC=8C?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=BB=9A=E5=8A=A8=E6=9D=A1=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A1=86=E6=B6=88=E5=A4=B1bug=20=20-=20[=E5=85=B3=E8=81=94]=20?= =?UTF-8?q?#[1019381977415680]=E9=83=A8=E5=88=86=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E7=9A=84=E6=BB=9A=E5=8A=A8=E6=9D=A1=E5=8F=AA?= =?UTF-8?q?=E8=83=BD=E9=BC=A0=E6=A0=87=E6=BB=9A=E5=8A=A8=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=8B=96=E6=8B=89=20http://192.168.0.96:8090/demo/rdm.html#/bu?= =?UTF-8?q?g-detail/939050947543040/939050947543057/1019381977415680?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/resources/components/UserSelect/UserSelect.vue | 13 ++++++++++--- src/resources/plugins/TsForm/TsFormSelect.vue | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/resources/components/UserSelect/UserSelect.vue b/src/resources/components/UserSelect/UserSelect.vue index 48274bb52..e953ec537 100644 --- a/src/resources/components/UserSelect/UserSelect.vue +++ b/src/resources/components/UserSelect/UserSelect.vue @@ -505,6 +505,7 @@ export default { }); }, focusInput() { + this.isVisible = !this.isVisible; this.$refs.input && this.$refs.input.focus(); }, toggleSelect(item) { @@ -549,13 +550,19 @@ export default { if ((!$el && $el === event.target) || $el.contains(event.target)) { return; } - this.isVisible = false; + const $contain = this.$refs.dropdownContain ? this.$refs.dropdownContain.$el || null : null; if ((!$contain && $contain === event.target) || $contain.contains(event.target)) { return; } - } else { - this.caretPosition = -1; + + if (this.transfer) { + //如果是transfer的时候下拉的区域点击时是在dropdown外层的div上 + if ($el && $el.offsetParent && ($el.offsetParent === event.target || $el.offsetParent.contains(event.target))) { + return; + } + } + this.isVisible = false; } }, updatePosition() { diff --git a/src/resources/plugins/TsForm/TsFormSelect.vue b/src/resources/plugins/TsForm/TsFormSelect.vue index c39c00d24..a39068071 100755 --- a/src/resources/plugins/TsForm/TsFormSelect.vue +++ b/src/resources/plugins/TsForm/TsFormSelect.vue @@ -1,5 +1,5 @@