From df7cdd72f4d9d312ee5c2769328ccc11785d8d6f Mon Sep 17 00:00:00 2001 From: zhangyu Date: Thu, 23 Dec 2021 19:53:17 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9AclickSearch=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/common/mixin/routerPathParams.js | 10 ++++++++++ nezha-fronted/src/components/page/asset/asset.vue | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/nezha-fronted/src/components/common/mixin/routerPathParams.js b/nezha-fronted/src/components/common/mixin/routerPathParams.js index a351e9d55..bc88dcccd 100644 --- a/nezha-fronted/src/components/common/mixin/routerPathParams.js +++ b/nezha-fronted/src/components/common/mixin/routerPathParams.js @@ -9,8 +9,18 @@ export default { if (qv && val.type == 'number') { qv = lodash.toNumber(qv) } + if (qv && val.type == 'array') { + qv = qv.split(',') + } setTimeout(() => { this.setSearchInput(val, qv) + if (qv && val.type2 == 'array') { + const arr = qv.split(',').map(item => Number(item)) + qv && this.$set(val.target2, val.propertyName, arr) + } + if (qv && val.type2 == 'json') { + qv && this.$set(val.target2, val.propertyName, qv) + } }, 200) qv && this.$set(val.target, val.propertyName, qv) }) diff --git a/nezha-fronted/src/components/page/asset/asset.vue b/nezha-fronted/src/components/page/asset/asset.vue index 4b25ab4d0..c8c5b2e0d 100644 --- a/nezha-fronted/src/components/page/asset/asset.vue +++ b/nezha-fronted/src/components/page/asset/asset.vue @@ -840,8 +840,8 @@ export default { }, jsonKey: 'val' }, - dcIds: { target: this.searchCheckBox, propertyName: 'dcIds', type: 'string' }, - fields: { target: this.searchCheckBox, propertyName: 'fields', type: 'json' }, + dcIds: { target: this.searchCheckBox, propertyName: 'dcIds', type: 'string', target2: this.selectValue, type2: 'array' }, + fields: { target: this.searchCheckBox, propertyName: 'fields', type: 'json', target2: this.selectValue, type2: 'json' }, ping: { target: this.searchCheckBox, propertyName: 'ping', type: 'string' }, modelIds: { target: this.searchCheckBox, propertyName: 'modelIds', type: 'string' }, typeIds: { target: this.searchCheckBox, propertyName: 'typeIds', type: 'string' }