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') },