From ae6d6b9ecb5f196cc8dc25ffd07fb63cb03abbde Mon Sep 17 00:00:00 2001 From: zhangyu Date: Wed, 23 Feb 2022 14:19:46 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-1591=20feat=EF=BC=9A=20viewport=20=E5=9C=A8?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=8A=A0=E8=BD=BD=E6=97=B6=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/App.vue | 3 +++ .../common/filterSearch/filterSearch.vue | 20 +++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/nezha-fronted/src/App.vue b/nezha-fronted/src/App.vue index dc5e136f0..d3e8ef4d3 100644 --- a/nezha-fronted/src/App.vue +++ b/nezha-fronted/src/App.vue @@ -15,6 +15,9 @@ export default { browserWindowZoom }, async created () { + if (window.outerWidth <= 1024) { // outerWidth 获取设备宽度 + document.querySelector('meta[name=viewport]').setAttribute('content', 'width=device-width, initial-scale=' + (1 / window.devicePixelRatio) + ', maximum-scale=1.0, user-scalable=0') + } const herfSpiltArr = window.location.href.split('/') if (herfSpiltArr[3] !== '#') { herfSpiltArr[3] = '#' diff --git a/nezha-fronted/src/components/common/filterSearch/filterSearch.vue b/nezha-fronted/src/components/common/filterSearch/filterSearch.vue index 2f5872d3f..d6277826e 100644 --- a/nezha-fronted/src/components/common/filterSearch/filterSearch.vue +++ b/nezha-fronted/src/components/common/filterSearch/filterSearch.vue @@ -150,13 +150,15 @@ export default { }, columnChange (meta, index) { meta.nameIsEditing = false - meta.operIsEditing = true const findTime = this.keyList.find(item => item.name === meta.name) this.compareList = findTime.opers this.rule = findTime.rule - this.$nextTick(() => { - this.$refs.operSelect[0].focus() - }) + if (!meta.oper) { + meta.operIsEditing = true + this.$nextTick(() => { + this.$refs.operSelect[0].focus() + }) + } this.$emit('update:valueList', this.metaList) this.$emit('change') }, @@ -178,10 +180,12 @@ export default { }, operChange (meta, index) { meta.operIsEditing = false - meta.valueIsEditing = true - this.$nextTick(() => { - this.$refs.valueInput[0].focus() - }) + if (!meta.value) { + meta.valueIsEditing = true + this.$nextTick(() => { + this.$refs.valueInput[0].focus() + }) + } this.$emit('update:valueList', this.metaList) this.$emit('change') },