From c9c3767d00dbc41bed71ae78b64887271eab593a Mon Sep 17 00:00:00 2001 From: likexuan Date: Tue, 12 Jul 2022 15:06:27 +0800 Subject: [PATCH] =?UTF-8?q?fix=20:=20asset=20list=20Box=20=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=89=93=E5=BC=80=E6=97=B6=E8=AF=B7=E6=B1=82=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/rightBox/asset/assetBox.vue | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue b/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue index 4cd892a05..1107fb0b5 100644 --- a/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue +++ b/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue @@ -820,26 +820,28 @@ export default { }, getModelData () { return new Promise(resolve => { - this.$get('asset/model?pageSize=-1&typeIds=' + this.editAsset.typeId).then(response => { - if (response.code === 200) { - this.options.modelOptions = response.data.list - const titleSearchData = {} - this.options.modelOptions.forEach(m => { - if (titleSearchData[m.brand.name]) { - titleSearchData[m.brand.name].children.push(m) + if (this.editAsset.typeId) { + this.$get('asset/model?pageSize=-1&typeIds=' + this.editAsset.typeId).then(response => { + if (response.code === 200) { + this.options.modelOptions = response.data.list + const titleSearchData = {} + this.options.modelOptions.forEach(m => { + if (titleSearchData[m.brand.name]) { + titleSearchData[m.brand.name].children.push(m) + } else { + titleSearchData[m.brand.name] = { ...m.brand, children: [m] } + } + }) + this.options.brandAndModelOptions = Object.keys(titleSearchData).map(b => titleSearchData[b]) + if (!this.editAsset.type.name) { + this.judgeTypes = true } else { - titleSearchData[m.brand.name] = { ...m.brand, children: [m] } + this.judgeTypes = false } - }) - this.options.brandAndModelOptions = Object.keys(titleSearchData).map(b => titleSearchData[b]) - if (!this.editAsset.type.name) { - this.judgeTypes = true - } else { - this.judgeTypes = false } - } - resolve() - }) + resolve() + }) + } }) }, checkLocation (rule, value, callback) {