From c41a24744932e28efa27588d1fba80f43ad37473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B4=AA=E6=B4=AA?= <2498601771@qq.com> Date: Mon, 29 May 2023 10:15:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Ddetection=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E6=90=9C=E7=B4=A2=E6=A1=86=E6=B7=BB=E5=8A=A0=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=9D=A1=E4=BB=B6=E6=97=B6=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/advancedSearch/TagMode.vue | 24 +++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/components/advancedSearch/TagMode.vue b/src/components/advancedSearch/TagMode.vue index 04f64bb1..d59d4764 100644 --- a/src/components/advancedSearch/TagMode.vue +++ b/src/components/advancedSearch/TagMode.vue @@ -29,7 +29,7 @@ > - {{meta.column.label}} + {{meta.column.label}}
{{meta.operator.value}}
@@ -38,7 +38,7 @@
- {{meta.value.label}} + {{meta.value.label}}
@@ -131,7 +131,10 @@ export default { this.metaList.push(newCondition) this.$nextTick(() => { - this.$refs.columnSelect.focus() + const selectList = this.$refs.columnSelect + if (selectList && selectList.length > 0) { + this.$refs.columnSelect[selectList.length - 1].focus() // 在for循环里生成的dom,所以是数组 + } }) } }, @@ -178,10 +181,10 @@ export default { selectConnection (value, meta) { meta.isEditing = false }, - columnClick (meta) { + columnClick (meta, index) { meta.column.isEditing = true this.$nextTick(() => { - this.$refs.columnSelect.focus() + this.$refs.columnSelect[index].focus() }) }, columnBlur (meta, index) { @@ -220,7 +223,10 @@ export default { } } this.$nextTick(() => { - this.$refs.valueInput.focus() + const selectList = this.$refs.valueInput + if (selectList && selectList.length > 0) { + this.$refs.valueInput[selectList.length - 1].focus() // 在for循环里生成的dom,所以是数组 + } }) }, operatorClick (meta) { @@ -273,10 +279,10 @@ export default { } meta.value.isEditing = !meta.isCompleteCondition() }, - valueClick (meta) { + valueClick (meta, index) { meta.value.isEditing = true this.$nextTick(() => { - this.$refs.valueInput.focus() + this.$refs.valueInput[index].focus() }) }, // 判断是否是用户自己添加的内容,用于判断是否是全局搜索 @@ -292,6 +298,7 @@ export default { } }, search () { + console.log('???????', this.metaList) if (this.metaList.length > 0) { const parser = new Parser(this.columnList) const errorList = parser.validateMeta(this.metaList) @@ -384,6 +391,7 @@ export default { const vm = this this.emitter.on('advanced-search', function () { vm.search() + console.log('打印', this.metaList) }) }, watch: {