From 8d0f1cd5baa2f97486d2f951e326e0e0fca88b0b Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Thu, 21 Oct 2021 18:37:35 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-1073=20feat:=20asset=20=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=20state=20=E4=B8=8B=E6=8B=89=E6=A1=86?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=20remark=20=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/charts/chart-list.vue | 8 ++++++++ .../src/components/common/rightBox/asset/assetBox.vue | 9 +++++++-- nezha-fronted/src/components/page/asset/asset.vue | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/nezha-fronted/src/components/charts/chart-list.vue b/nezha-fronted/src/components/charts/chart-list.vue index eb5dd438b..7f4e3f867 100644 --- a/nezha-fronted/src/components/charts/chart-list.vue +++ b/nezha-fronted/src/components/charts/chart-list.vue @@ -308,6 +308,7 @@ export default { extraMarginBottom: 0, // dom额外的margin panelId: '', timer: null, + finshGetData: false, dataTotalList: [], // 懒加载:总记录数 dataTotalListBak: [], // 用于查询:懒加载,总记录备份 isPage: false, // 是否分页懒加载 @@ -596,6 +597,10 @@ export default { // 获取panel详情数据,获取panel下所有chart列表 getData (params) { + if (this.finshGetData) { + return + } + this.finshGetData = true const param = { panelId: params.panelId, query: params.query, @@ -676,6 +681,9 @@ export default { if (!params.panelId) { return } // 没有panelId不调用接口 this.$get('visual/panel/chart?panelId=' + params.panelId + '&groupId=0' + '&pageSize=-1').then(response => { if (response.code === 200) { + setTimeout(() => { + this.finshGetData = false + }, 1000) response.data.list.forEach((item, index) => { item.isLoaded = false }) diff --git a/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue b/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue index 8e3362f52..3b0d9142c 100644 --- a/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue +++ b/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue @@ -33,7 +33,12 @@ - + +
+
{{state.name}}
+
{{state.remark}}
+
+
@@ -424,7 +429,7 @@ export default { this.isEdit = true this.editAsset = JSON.parse(JSON.stringify(n)) this.editAsset.brandAndModel = [this.editAsset.brand.id, this.editAsset.model.id] - this.editAsset.stateId = n.state ? n.state.id : '' + this.editAsset.stateId = n.state ? n.state.id : 2 this.editAsset.typeId = n.type ? n.type.id : '' this.$nextTick(() => { if (n.id) { diff --git a/nezha-fronted/src/components/page/asset/asset.vue b/nezha-fronted/src/components/page/asset/asset.vue index 8ae4e38fa..82319b138 100644 --- a/nezha-fronted/src/components/page/asset/asset.vue +++ b/nezha-fronted/src/components/page/asset/asset.vue @@ -138,7 +138,7 @@ export default { pid: '', sn: '', manageIp: '', - stateId: '', + stateId: 2, purchaseDate: null, dcId: '', cabinetId: '',