From 1a081b02b885f4ab33b99dc58d0c0192f29b1b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?= <963808678@qq.com> Date: Thu, 6 Apr 2023 10:38:54 +0800 Subject: [PATCH] 4/6 --- src/views/main/DjyTenantConfig/editForm.vue | 31 +++++++++++ src/views/main/DjyTenantConfig/index.vue | 57 ++++++++++++++++++--- 2 files changed, 82 insertions(+), 6 deletions(-) diff --git a/src/views/main/DjyTenantConfig/editForm.vue b/src/views/main/DjyTenantConfig/editForm.vue index 558ff91..63592e0 100644 --- a/src/views/main/DjyTenantConfig/editForm.vue +++ b/src/views/main/DjyTenantConfig/editForm.vue @@ -98,12 +98,43 @@ export default { }, handleSearch(value) { let Rdata = [] + let UpperType = false + let LowerType = false if (value) { + let Upper = value.toUpperCase() + let Lower = value.toLowerCase() + this.FieldNameList2.forEach(item => { if (item.name.indexOf(value) > -1) { Rdata.push(item) } }) + this.FieldNameList2.forEach(item => { + if (item.name.indexOf(Upper) > -1) { + UpperType = false + Rdata.forEach(e => { + if (e.code == item.code) { + UpperType = true + } + }) + if (!UpperType) { + Rdata.push(item) + } + } + }) + this.FieldNameList2.forEach(item => { + if (item.name.indexOf(Lower) > -1) { + LowerType = false + Rdata.forEach(e => { + if (e.code == item.code) { + LowerType = true + } + }) + if (!LowerType) { + Rdata.push(item) + } + } + }) } else { Rdata = this.FieldNameList2 } diff --git a/src/views/main/DjyTenantConfig/index.vue b/src/views/main/DjyTenantConfig/index.vue index bd9bf9f..53fcaa2 100644 --- a/src/views/main/DjyTenantConfig/index.vue +++ b/src/views/main/DjyTenantConfig/index.vue @@ -125,13 +125,59 @@ export default { }, methods: { FnQuery() { - let Rdata = [] - this.loadData.forEach(item => { - if (item.fieldName.indexOf(this.queryParam.fieldName) > -1) { - Rdata.push(item) + this.loading = true + getDjyTenantConfig({ type: 'booking_default_value' }).then(res => { + if (res.code == 200) { + this.loadData = JSON.parse(res.data.configJson) + this.DisplayLoadData = this.loadData + } else { + this.loadData = [] + this.$message.warning(res.message) + } + this.loading = false + if (this.queryParam.fieldName) { + let Rdata = [] + let UpperType = false + let LowerType = false + let Upper = this.queryParam.fieldName.toUpperCase() + let Lower = this.queryParam.fieldName.toLowerCase() + this.loadData.forEach(item => { + if (item.fieldName.indexOf(this.queryParam.fieldName) > -1) { + Rdata.push(item) + } + }) + this.loadData.forEach(item => { + if (item.fieldName.indexOf(Upper) > -1) { + UpperType = false + console.log(item) + Rdata.forEach(e => { + console.log(e, item) + if (e.field == item.field) { + UpperType = true + } + }) + if (!UpperType) { + Rdata.push(item) + } + } + }) + this.loadData.forEach(item => { + if (item.fieldName.indexOf(Lower) > -1) { + LowerType = false + Rdata.forEach(e => { + if (e.field == item.field) { + LowerType = true + } + }) + if (!LowerType) { + Rdata.push(item) + } + } + }) + this.DisplayLoadData = Rdata } }) - this.DisplayLoadData = Rdata + // this.init() }, FnReset() { @@ -172,7 +218,6 @@ export default { this.loading = true getDjyTenantConfig({ type: 'booking_default_value' }).then(res => { if (res.code == 200) { - console.log(this.userInfo) this.loadData = JSON.parse(res.data.configJson) this.DisplayLoadData = this.loadData } else {