diff --git a/nezha-fronted/src/components/common/header.vue b/nezha-fronted/src/components/common/header.vue index 594e70f6e..dced436fe 100644 --- a/nezha-fronted/src/components/common/header.vue +++ b/nezha-fronted/src/components/common/header.vue @@ -275,7 +275,8 @@ } else if (item.type == 5) { this.$refs.alertConfigBox.show(true, true); } else if (item.type == 4) { - this.addUnitShow = true + this.addUnitShow = true; + this.$refs.assetAddUnit.resetAsset(); } }, jumpToAsset(id) { diff --git a/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue b/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue index 1ad8cac86..f8058bdb1 100644 --- a/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue +++ b/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue @@ -516,7 +516,7 @@ response.data.list[i].paramObj.push({key: k, value: tempObj[k]}) } } catch(err) { - console.info(response.data.list[i], err); + //console.info(response.data.list[i], err); } } this.moduleList = response.data.list; diff --git a/nezha-fronted/src/components/common/rightBox/assetBox.vue b/nezha-fronted/src/components/common/rightBox/assetBox.vue index aa8952d26..7de7e0a33 100644 --- a/nezha-fronted/src/components/common/rightBox/assetBox.vue +++ b/nezha-fronted/src/components/common/rightBox/assetBox.vue @@ -722,25 +722,7 @@ } }) } else { - this.pageObj.id = ''; - this.assetData = { - id: '', - sn: '', - host: '', - state: '', - purchaseDate: '', - idcId: '', - cabinetId: '', - modelId: '', - assetType: '', - accounts: [{ - id: '', - authType: 1, - user: '', - pwd: '', - port: '', - }] - }; + this.resetAsset(); } }, openModuleBox(module) { @@ -807,7 +789,7 @@ getModelOptionData(assetType, vendorCode) { this.$get('model?typeCode=' + assetType + '&vendorCode=' + vendorCode).then(response => { if (response.code === 200) { - this.modelUlData = response.data.list + this.modelUlData = response.data.list; this.markOptionData(this.modelUlData) } }) @@ -820,6 +802,35 @@ } }) }, + resetAsset() { + this.pageObj.id = ''; + this.assetData = { + id: '', + sn: '', + host: '', + state: '', + purchaseDate: '', + idcId: '', + cabinetId: '', + modelId: '', + assetType: '', + accounts: [{ + id: '', + authType: 1, + user: '', + pwd: '', + port: '', + }] + }; + this.assetType = ''; + this.idcSelectedData = { + id: '', + name: '', + location: '', + principal: '', + tel: '' + } + }, editData(data, item, mark) { let obj = { id: '', @@ -835,7 +846,10 @@ tel: '' } if (data === 'asset') { - this.assetData.modelId = this.assetData.modelId.join(',').split(',')[1]; + if (this.assetData.modelId) { + console.info(this.assetData.modelId) + this.assetData.modelId = this.assetData.modelId.join(',').split(',')[1]; + } // let modelId = this.assetData.modelId.join(',').split(',')[1]; // let form = new FormData(); // form.append("id", this.pageObj.id); @@ -870,7 +884,7 @@ if (valid&&this.accountValideResult) { if (this.pageObj.id) { this.assetData.id=this.pageObj.id; - console.log(JSON.stringify(this.assetData)); + //console.log(JSON.stringify(this.assetData)); this.$put('asset', this.assetData).then(res => { const h = this.$createElement; if (res.code === 200) { diff --git a/nezha-fronted/src/components/common/rightBox/editEndpointBox.vue b/nezha-fronted/src/components/common/rightBox/editEndpointBox.vue index 9783844da..57d155859 100644 --- a/nezha-fronted/src/components/common/rightBox/editEndpointBox.vue +++ b/nezha-fronted/src/components/common/rightBox/editEndpointBox.vue @@ -348,7 +348,7 @@ response.data.list[i].paramObj.push({key: k, value: tempObj[k]}) } } catch(err) { - console.info(response.data.list[i], err); + //console.info(response.data.list[i], err); } } this.moduleList = response.data.list; diff --git a/nezha-fronted/src/components/page/asset/asset.vue b/nezha-fronted/src/components/page/asset/asset.vue index d94f618f6..8052a2721 100644 --- a/nezha-fronted/src/components/page/asset/asset.vue +++ b/nezha-fronted/src/components/page/asset/asset.vue @@ -638,6 +638,7 @@ //this.addUnitShow = true; this.editUnitShow = true; this.$refs['assetEditUnit'].getAssetData(''); + this.$refs['assetEditUnit'].resetAsset(); } if (data === 'showEdit') { this.editUnitShow = true;