From 04c562bdb896d61f7f81f44a70d3593164d9f4f0 Mon Sep 17 00:00:00 2001 From: yxq Date: Mon, 2 Sep 2024 11:09:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E5=A4=9A=E9=80=89=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- monitorMobile/components/selectSearch.vue | 57 +++++++++++++---------- monitorMobile/pages/login.vue | 15 +++--- 2 files changed, 39 insertions(+), 33 deletions(-) diff --git a/monitorMobile/components/selectSearch.vue b/monitorMobile/components/selectSearch.vue index d5d9bb8..3049010 100644 --- a/monitorMobile/components/selectSearch.vue +++ b/monitorMobile/components/selectSearch.vue @@ -9,20 +9,21 @@ {{popupTitle}} - + - + - + - @@ -86,13 +87,19 @@ }; }, mounted() { - if (this.multiple) this.value_ = [] + this.value_ = JSON.parse(JSON.stringify(this.value)) if (!this.multiple) { - let obj = this.options.find(e1 => e1.value == this.value) - if (obj) this.title_ = obj.label + let obj = this.options.find(e1 => e1.value == this.value_) + if (obj) { + this.title_ = obj.label + this.$emit("update:title", this.title_) + }else{ + this.$emit("update:title", '') + } } else { - let arr = this.options.filter(e1 => this.value.includes(e1.value)) + let arr = this.options.filter(e1 => this.value_.includes(e1.value)) this.cellValue = arr.map(e => e.label) + this.$emit("update:title", this.cellValue) } }, methods: { @@ -100,15 +107,7 @@ this.show = false }, open() { - if (this.multiple) this.value_ = [] - if (!this.multiple) { - let obj = this.options.find(e1 => e1.value == this.value) - if (obj) this.title_ = obj.label - } else { - let arr = this.options.filter(e1 => this.value.includes(e1.value)) - this.cellValue = arr.map(e => e.label) - } - this.value_ = this.value + this.value_ = JSON.parse(JSON.stringify(this.value)) this.searchText = '' this.show = true }, @@ -117,10 +116,16 @@ this.$emit("change", this.value_) if (!this.multiple) { let obj = this.options.find(e1 => e1.value == this.value_) - if (obj) this.title_ = obj.label + if (obj) { + this.title_ = obj.label + this.$emit("update:title", this.title_ ) + }else{ + this.$emit("update:title", '') + } } else { let arr = this.options.filter(e1 => this.value_.includes(e1.value)) this.cellValue = arr.map(e => e.label) + this.$emit("update:title", this.cellValue) } this.close() }, @@ -136,18 +141,20 @@ line-height: 100rpx; } - .u-checkbox-group,.u-radio-group { + .u-checkbox-group, + .u-radio-group { width: 92%; height: 780rpx; overflow-y: auto; padding: 0 30rpx; box-shadow: inset 0 0 20rpx rgba(0, 0, 0, 0.08); - .u-radio,.u-checkbox { + .u-radio, + .u-checkbox { height: 98rpx; box-sizing: border-box; - padding-bottom: 0rpx!important; - margin-top: 0rpx!important; + padding-bottom: 0rpx !important; + margin-top: 0rpx !important; } } diff --git a/monitorMobile/pages/login.vue b/monitorMobile/pages/login.vue index 6d14bc3..4d0dc1a 100644 --- a/monitorMobile/pages/login.vue +++ b/monitorMobile/pages/login.vue @@ -11,14 +11,13 @@ 账号登录 - - + - - + - @@ -42,13 +41,13 @@ data() { return { form: { - name: '', - pass: '', + account: '', + password: '', }, passType: 'password', isLoading: false, rules: { - name: [{ + account: [{ required: true, message: '请输入账号', trigger: ['blur', 'change']