-
{{item}}
+
{{item}}
{{formData['formValue'] && formData['formValue'][key]}}
diff --git a/src/views/resource/serverRegister/handle.vue b/src/views/resource/serverRegister/handle.vue
index 3693a20..6d34031 100644
--- a/src/views/resource/serverRegister/handle.vue
+++ b/src/views/resource/serverRegister/handle.vue
@@ -77,7 +77,7 @@
mgmtMacAddress: {label: '管理网-mac地址', span: 12, type: 'input'},
mgmtInterfaceType: {label: '管理网-接口类型', span: 12, type: 'input'},
mgmtIpv4Address: {label: '管理网-IPv4地址', span: 12, type: 'input'},
- mgmt3Gateway: {label: '管理网-网关', span: 12, type: 'input'},
+ mgmtGateway: {label: '管理网-网关', span: 12, type: 'input'},
heartbeatInterval: {label: '心跳时间间隔', span: 12, type: 'input'},
heartbeatCount: {label: '心跳次数', span: 12, type: 'input'},
businessName: {label: '业务名称', span: 12, type: 'input'},
diff --git a/src/views/resource/serverRegister/index.vue b/src/views/resource/serverRegister/index.vue
index 936a23a..a28c6f7 100644
--- a/src/views/resource/serverRegister/index.vue
+++ b/src/views/resource/serverRegister/index.vue
@@ -203,7 +203,7 @@
mgmtMacAddress: { label: `管理网-mac地址`, minWidth: '150'},
mgmtInterfaceType: { label: `管理网-接口类型`, minWidth: '120'},
mgmtIpv4Address: { label: `管理网-IPv4地址`, minWidth: '120'},
- mgmt3Gateway: { label: `管理网-网关`, minWidth: '120'},
+ mgmtGateway: { label: `管理网-网关`, minWidth: '120'},
heartbeatInterval: { label: `心跳时间间隔`, minWidth: '180'},
heartbeatCount: { label: `心跳次数`, minWidth: '180'},
registrationStatus: { label: `注册状态`, slotName: 'tempStatus', minWidth: '120', visible: true },
diff --git a/src/views/resource/serverRegister/monitorChart.vue b/src/views/resource/serverRegister/monitorChart.vue
index 4c440ab..30d126e 100644
--- a/src/views/resource/serverRegister/monitorChart.vue
+++ b/src/views/resource/serverRegister/monitorChart.vue
@@ -466,7 +466,15 @@
});
this.secondChartList = {...tabNameList};
this.activeNames = [Object.keys(tabNameList)[0]];
+ this.fnSwitchNetNames(); // 第二模块名称
+ setTimeout(() => {
+ this.fnDiskNames(); // 第三模块名称
+ setTimeout(() => {
+ this.fnDockerNames(); // 第四模块名称
+ },500);
+ },500);
this.getPointDetailsData(this.currTimeList, Object.keys(tabNameList)[0]);
+ } else {
this.fnSwitchNetNames(); // 第二模块名称
setTimeout(() => {
this.fnDiskNames(); // 第三模块名称
@@ -565,23 +573,25 @@
tabNameList[item.interfaceName] = oneData;
this.$set(this.secondChartList, item.interfaceName, oneData);
});
+ if (this.activeNames && this.activeNames.length <= 0) {
+ this.activeNames = [res[0].interfaceName];
+ this.getNetDetailsData(this.currTimeList, res[0].interfaceName);
+ }
}
});
},
// 基本信息
getNetDetailsData(times, titleName) {
this.eventDataMap[titleName] = true;
- netDetails({clientId: this.paramsData.clientId, name: titleName}).then(res => {
+ netDetails({clientId: this.paramsData.clientId, name: titleName}).then(async res => {
this.secondChartList[titleName].formModel = res && res.data || [];
- this.getNetEcharts(times, titleName);
- setTimeout(() => {
+ if (await this.getNetEcharts(times, titleName)) {
this.getNetDropped(times ,titleName);
- },500);
- }).catch(() => {
- this.getNetEcharts(times, titleName);
- setTimeout(() => {
+ }
+ }).catch(async () => {
+ if (await this.getNetEcharts(times, titleName)) {
this.getNetDropped(times ,titleName);
- },500);
+ }
});
},
// 流量
@@ -591,7 +601,7 @@
let content = JSON.parse(JSON.stringify(this.linuxSystem['net']));
netEcharts.dateDataTrans['dateRange'] = this.defaultTimes;
netEcharts.fnEvent = 'getNetEcharts';
- trafficEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
+ return trafficEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) {
netEcharts.title = titleName + content.echartFors[0].title;
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
@@ -606,9 +616,9 @@
mountCollect['echartList'][0] = netEcharts;
this.$set(this.secondChartList, titleName, mountCollect);
}
- this.$modal.closeLoading();
+ return true;
}).catch(() => {
- this.$modal.closeLoading();
+ return true;
});
},
// 丢包数
@@ -618,7 +628,7 @@
let content = JSON.parse(JSON.stringify(this.linuxSystem['net']));
netEcharts.dateDataTrans['dateRange'] = this.defaultTimes;
netEcharts.fnEvent = 'getNetDropped';
- droppedEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
+ return droppedEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) {
netEcharts.title = titleName + content.echartFors[1].title;
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
@@ -634,8 +644,10 @@
this.$set(this.secondChartList, titleName, mountCollect);
}
this.$modal.closeLoading();
+ return true;
}).catch(() => {
this.$modal.closeLoading();
+ return true;
});
},
@@ -650,29 +662,29 @@
tabNameList[item.name] = oneData;
this.$set(this.secondChartList, item.name, oneData);
});
+ if (this.activeNames && this.activeNames.length <= 0) {
+ this.activeNames = [res.data[0].name];
+ this.getDiskDetailsData(this.currTimeList, res.data[0].name);
+ }
}
});
},
// 基本信息
getDiskDetailsData(times, titleName) {
this.eventDataMap[titleName] = true;
- diskDetails({clientId: this.paramsData.clientId, name: titleName}).then(res => {
+ diskDetails({clientId: this.paramsData.clientId, name: titleName}).then(async res => {
this.secondChartList[titleName].formModel = res && res.data || [];
- this.getSpeedEcharts(times, titleName);
- setTimeout(() => {
- this.getDiskTimes(times ,titleName);
- setTimeout(() => {
+ if (await this.getSpeedEcharts(times, titleName)) {
+ if (await this.getDiskTimes(times ,titleName)) {
this.getDiskBytes(times ,titleName);
- },500);
- },500);
- }).catch(() => {
- this.getSpeedEcharts(times, titleName);
- setTimeout(() => {
- this.getDiskTimes(times ,titleName);
- setTimeout(() => {
+ }
+ }
+ }).catch(async () => {
+ if (await this.getSpeedEcharts(times, titleName)) {
+ if (await this.getDiskTimes(times ,titleName)) {
this.getDiskBytes(times ,titleName);
- },500);
- },500);
+ }
+ }
});
},
//
@@ -682,7 +694,7 @@
let content = JSON.parse(JSON.stringify(this.linuxSystem['disk']));
netEcharts.dateDataTrans['dateRange'] = this.defaultTimes;
netEcharts.fnEvent = 'getSpeedEcharts';
- speedEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
+ return speedEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) {
netEcharts.title = titleName + content.echartFors[0].title;
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
@@ -697,9 +709,9 @@
mountCollect['echartList'][0] = netEcharts;
this.$set(this.secondChartList, titleName, mountCollect);
}
- this.$modal.closeLoading();
+ return true;
}).catch(() => {
- this.$modal.closeLoading();
+ return true;
});
},
//
@@ -709,7 +721,7 @@
let content = JSON.parse(JSON.stringify(this.linuxSystem['disk']));
netEcharts.dateDataTrans['dateRange'] = this.defaultTimes;
netEcharts.fnEvent = 'getDiskTimes';
- timesEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
+ return timesEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) {
netEcharts.title = titleName + content.echartFors[1].title;
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
@@ -724,9 +736,9 @@
mountCollect['echartList'][1] = netEcharts;
this.$set(this.secondChartList, titleName, mountCollect);
}
- this.$modal.closeLoading();
+ return true;
}).catch(() => {
- this.$modal.closeLoading();
+ return true;
});
},
//
@@ -736,7 +748,7 @@
let content = JSON.parse(JSON.stringify(this.linuxSystem['disk']));
netEcharts.dateDataTrans['dateRange'] = this.defaultTimes;
netEcharts.fnEvent = 'getDiskBytes';
- bytesEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
+ return bytesEcharts(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) {
netEcharts.title = titleName + content.echartFors[2].title;
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
@@ -752,8 +764,10 @@
this.$set(this.secondChartList, titleName, mountCollect);
}
this.$modal.closeLoading();
+ return true;
}).catch(() => {
this.$modal.closeLoading();
+ return true;
});
},
@@ -768,29 +782,29 @@
tabNameList[item.id] = oneData;
this.$set(this.secondChartList, item.id, oneData);
});
+ if (this.activeNames && this.activeNames.length <= 0) {
+ this.activeNames = [res.data[0].id];
+ this.getDockerDetailsData(this.currTimeList, res.data[0].id);
+ }
}
});
},
// 基本信息
getDockerDetailsData(times, titleName) {
this.eventDataMap[titleName] = true;
- dockerDetails({clientId: this.paramsData.clientId, id: titleName}).then(res => {
+ dockerDetails({clientId: this.paramsData.clientId, id: titleName}).then(async res => {
this.secondChartList[titleName].formModel = res && res.data || [];
- this.getCpuEcharts(times, titleName);
- setTimeout(() => {
- this.getDockerMem(times ,titleName);
- setTimeout(() => {
+ if (await this.getCpuEcharts(times, titleName)) {
+ if (await this.getDockerMem(times ,titleName)) {
this.getDockerSpeed(times ,titleName);
- },500);
- },500);
- }).catch(() => {
- this.getCpuEcharts(times, titleName);
- setTimeout(() => {
- this.getDockerMem(times ,titleName);
- setTimeout(() => {
+ }
+ }
+ }).catch(async () => {
+ if (await this.getCpuEcharts(times, titleName)) {
+ if (await this.getDockerMem(times ,titleName)) {
this.getDockerSpeed(times ,titleName);
- },500);
- },500);
+ }
+ }
});
},
//
@@ -800,7 +814,7 @@
let content = JSON.parse(JSON.stringify(this.linuxSystem['dock']));
netEcharts.dateDataTrans['dateRange'] = this.defaultTimes;
netEcharts.fnEvent = 'getCpuEcharts';
- cpuUtilEcharts(Object.assign({}, {id : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
+ return cpuUtilEcharts(Object.assign({}, {id : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) {
netEcharts.title = titleName + content.echartFors[0].title;
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
@@ -811,9 +825,9 @@
mountCollect['echartList'][0] = netEcharts;
this.$set(this.secondChartList, titleName, mountCollect);
}
- this.$modal.closeLoading();
+ return true;
}).catch(() => {
- this.$modal.closeLoading();
+ return true;
});
},
//
@@ -823,7 +837,7 @@
let content = JSON.parse(JSON.stringify(this.linuxSystem['dock']));
netEcharts.dateDataTrans['dateRange'] = this.defaultTimes;
netEcharts.fnEvent = 'getDockerMem';
- dockerMemEcharts(Object.assign({}, {id : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
+ return dockerMemEcharts(Object.assign({}, {id : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) {
netEcharts.title = titleName + content.echartFors[1].title;
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
@@ -834,9 +848,9 @@
mountCollect['echartList'][1] = netEcharts;
this.$set(this.secondChartList, titleName, mountCollect);
}
- this.$modal.closeLoading();
+ return true;
}).catch(() => {
- this.$modal.closeLoading();
+ return true;
});
},
//
@@ -846,7 +860,7 @@
let content = JSON.parse(JSON.stringify(this.linuxSystem['dock']));
netEcharts.dateDataTrans['dateRange'] = this.defaultTimes;
netEcharts.fnEvent = 'getDockerSpeed';
- dockerSpeedEcharts(Object.assign({}, {id : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
+ return dockerSpeedEcharts(Object.assign({}, {id : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) {
netEcharts.title = titleName + content.echartFors[2].title;
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
@@ -862,8 +876,10 @@
this.$set(this.secondChartList, titleName, mountCollect);
}
this.$modal.closeLoading();
+ return true;
}).catch(() => {
this.$modal.closeLoading();
+ return true;
});
},
diff --git a/src/views/resource/serverRegister/secondAutoFind.vue b/src/views/resource/serverRegister/secondAutoFind.vue
index c1a52bf..20591e0 100644
--- a/src/views/resource/serverRegister/secondAutoFind.vue
+++ b/src/views/resource/serverRegister/secondAutoFind.vue
@@ -5,7 +5,7 @@
- {{item}}{{val && val.formModel[key] || '-'}}
+ {{item}}{{val && val.formModel[key] || '-'}}
diff --git a/src/views/resource/switchRegister/firstMonitor.vue b/src/views/resource/switchRegister/firstMonitor.vue
index 1b55bb1..0901772 100644
--- a/src/views/resource/switchRegister/firstMonitor.vue
+++ b/src/views/resource/switchRegister/firstMonitor.vue
@@ -2,12 +2,12 @@
-
{{item}}
+
{{item}}
{{formData['formValue'] && formData['formValue'][key]}}
-
+
diff --git a/src/views/resource/switchRegister/monitorChart.vue b/src/views/resource/switchRegister/monitorChart.vue
index d6b311d..259295b 100644
--- a/src/views/resource/switchRegister/monitorChart.vue
+++ b/src/views/resource/switchRegister/monitorChart.vue
@@ -32,7 +32,7 @@
loading: false,
currTimeList: {},
defaultTimes: [],
- activeName: 'second',
+ activeName: 'first',
paramsData: {},
// 第一栏
firstChartTrans: {},
@@ -195,9 +195,9 @@
if (this.activeName === 'first') {
await Promise.all([
this.getMonitorData(),
- this.getCpuData(),
- this.getMemData(),
- this.getPowerData()
+ this.getCpuData(this.currTimeList),
+ this.getMemData(this.currTimeList),
+ this.getPowerData(this.currTimeList)
]);
this.loading = true;
} else {
@@ -215,8 +215,9 @@
},
getCpuData(val) {
let cpuData = JSON.parse(JSON.stringify(this.resultData[0]));
+ cpuData.dateDataTrans['dateRange'] = this.defaultTimes;
+ cpuData['fnEvent'] = 'getCpuData';
switchCpuData(Object.assign({},{clientId: this.paramsData.clientId}, val)).then(res => {
- cpuData['fnEvent'] = 'getCpuData';
if (res && res.data) {
cpuData.dataVal.lineXData = res.data && res.data['xData'] && res.data['xData'].length > 0 ? res.data['xData'] :
this.firstChartTrans && this.firstChartTrans['timeList'] && this.firstChartTrans['timeList'].length > 0 ? this.firstChartTrans['timeList'] : [];
@@ -230,8 +231,9 @@
},
getMemData(val) {
let memData = JSON.parse(JSON.stringify(this.resultData[1]));
+ memData.dateDataTrans['dateRange'] = this.defaultTimes;
+ memData['fnEvent'] = 'getMemData';
switchMemData(Object.assign({},{clientId: this.paramsData.clientId}, val)).then(res => {
- memData['fnEvent'] = 'getMemData';
if (res && res.data) {
memData.dataVal.lineXData = res.data && res.data['xData'] && res.data['xData'].length > 0 ? res.data['xData'] :
this.firstChartTrans && this.firstChartTrans['timeList'] && this.firstChartTrans['timeList'].length > 0 ? this.firstChartTrans['timeList'] : [];
@@ -245,8 +247,9 @@
},
getPowerData(val) {
let powerData = JSON.parse(JSON.stringify(this.resultData[2]));
+ powerData.dateDataTrans['dateRange'] = this.defaultTimes;
+ powerData['fnEvent'] = 'getPowerData';
switchPowerData(Object.assign({},{clientId: this.paramsData.clientId}, val)).then(res => {
- powerData['fnEvent'] = 'getPowerData';
if (res && res.data) {
powerData.dataVal.lineXData = res.data && res.data['xData'] && res.data['xData'].length > 0 ? res.data['xData'] :
this.firstChartTrans && this.firstChartTrans['timeList'] && this.firstChartTrans['timeList'].length > 0 ? this.firstChartTrans['timeList'] : [];
@@ -265,24 +268,37 @@
this.activeNames = [];
postInterFaceName({clientId: this.paramsData.clientId,resourceType: 2}).then(res => {
let tabNameList = {};
- res && res.forEach(async(item,index) => {
- let oneData = JSON.parse(JSON.stringify(this.linuxSystem['net']));
- oneData.title = item && item.interfaceName;
- tabNameList[item.interfaceName + '_net'] = oneData;
- });
- this.secondChartList = {...tabNameList};
- this.activeNames = [Object.keys(tabNameList)[0]];
- this.fnModuleNameList(); // 第二模块名称
- setTimeout(() => {
- this.fnMpuNameList(); // 第三模块名称
+ if (res && res.length > 0) {
+ res && res.forEach(async(item,index) => {
+ let oneData = JSON.parse(JSON.stringify(this.linuxSystem['net']));
+ oneData.title = item && item.interfaceName;
+ tabNameList[item.interfaceName + '_net'] = oneData;
+ });
+ this.secondChartList = {...tabNameList};
+ this.activeNames = [Object.keys(tabNameList)[0]];
+ this.fnModuleNameList(); // 第二模块名称
setTimeout(() => {
- this.fnPwrNameList(); // 第四模块名称
+ this.fnMpuNameList(); // 第三模块名称
setTimeout(() => {
- this.fnFanNameList(); // 第五模块名称
+ this.fnPwrNameList(); // 第四模块名称
+ setTimeout(() => {
+ this.fnFanNameList(); // 第五模块名称
+ },500);
},500);
},500);
- },500);
- this.getNetDetailsData(this.currTimeList, tabNameList[Object.keys(tabNameList)[0]].title, Object.keys(tabNameList)[0]);
+ this.getNetDetailsData(this.currTimeList, tabNameList[Object.keys(tabNameList)[0]].title, Object.keys(tabNameList)[0]);
+ } else {
+ this.fnModuleNameList(); // 第二模块名称
+ setTimeout(() => {
+ this.fnMpuNameList(); // 第三模块名称
+ setTimeout(() => {
+ this.fnPwrNameList(); // 第四模块名称
+ setTimeout(() => {
+ this.fnFanNameList(); // 第五模块名称
+ },500);
+ },500);
+ },500);
+ }
}).catch((error) => {
this.fnModuleNameList(); // 第二模块名称
setTimeout(() => {
@@ -302,21 +318,6 @@
this.eventDataMap[keyName] = true;
switchNetDetails({clientId: this.paramsData.clientId, ifDescr: titleName}).then(async res => {
this.secondChartList[keyName].formModel = res && res.data || [];
- // const [one, two, three, four] = await Promise.all([
- // this.getNetDiscards(times, titleName, keyName),
- // this.getNetTotal(times, titleName, keyName),
- // this.getNetErrDisc(times, titleName, keyName), // 原 tree 应为 three
- // this.getNetSpeed(times, titleName, keyName)
- // ]);
- // console.log('one==', one);
- // console.log('two==', two);
- // console.log('tree==', three);
- // console.log('four==', four);
- // if (one && two && three && four) {
- // console.log('vvvvvvvv========');
- // this.$modal.closeLoading();
- // }
-
if (await this.getNetDiscards(times ,titleName, keyName)) {
if (await this.getNetTotal(times, titleName, keyName)) {
if (await this.getNetErrDisc(times, titleName, keyName)) {
@@ -453,13 +454,18 @@
fnModuleNameList(val) {
moduleAllName({clientId: this.paramsData.clientId}).then(res => {
let tabNameList = {};
- res && res.data.forEach(async(item,index) => {
- let oneData = JSON.parse(JSON.stringify(this.linuxSystem['light']));
- oneData.title = item && item.fiberPortName;
- tabNameList[item.fiberPortName + '_module'] = oneData;
- this.$set(this.secondChartList, item.fiberPortName + '_module', oneData);
- });
- }).catch((error) => {
+ if (res && res.data && res.data.length > 0) {
+ res && res.data.forEach(async(item,index) => {
+ let oneData = JSON.parse(JSON.stringify(this.linuxSystem['light']));
+ oneData.title = item && item.fiberPortName;
+ tabNameList[item.fiberPortName + '_module'] = oneData;
+ this.$set(this.secondChartList, item.fiberPortName + '_module', oneData);
+ });
+ if (this.activeNames && this.activeNames.length <= 0) {
+ this.activeNames = [Object.keys(tabNameList)[0]];
+ this.getModuleDetailsData(this.currTimeList, tabNameList[Object.keys(tabNameList)[0]].title, Object.keys(tabNameList)[0]);
+ }
+ }
});
},
// 基本信息
@@ -542,13 +548,18 @@
fnMpuNameList(val) {
mpuAllName({clientId: this.paramsData.clientId}).then(res => {
let tabNameList = {};
- res && res.data.forEach(async(item,index) => {
- let oneData = JSON.parse(JSON.stringify(this.linuxSystem['mpu']));
- oneData.title = item && item.mpuName;
- tabNameList[item.mpuName + '_mpu'] = oneData;
- this.$set(this.secondChartList, item.mpuName + '_mpu', oneData);
- });
- }).catch((error) => {
+ if (res && res.data && res.data.length > 0) {
+ res && res.data.forEach(async(item,index) => {
+ let oneData = JSON.parse(JSON.stringify(this.linuxSystem['mpu']));
+ oneData.title = item && item.mpuName;
+ tabNameList[item.mpuName + '_mpu'] = oneData;
+ this.$set(this.secondChartList, item.mpuName + '_mpu', oneData);
+ });
+ if (this.activeNames && this.activeNames.length <= 0) {
+ this.activeNames = [Object.keys(tabNameList)[0]];
+ this.getMpuDetailsData(this.currTimeList, tabNameList[Object.keys(tabNameList)[0]].title, Object.keys(tabNameList)[0]);
+ }
+ }
});
},
// 基本信息
@@ -649,13 +660,18 @@
fnPwrNameList(val) {
pwrAllName({clientId: this.paramsData.clientId}).then(res => {
let tabNameList = {};
- res && res.data.forEach(async(item,index) => {
- let oneData = JSON.parse(JSON.stringify(this.linuxSystem['pw']));
- oneData.title = item && item.pwrName;
- tabNameList[item.pwrName + '_pw'] = oneData;
- this.$set(this.secondChartList, item.pwrName + '_pw', oneData);
- });
- }).catch((error) => {
+ if (res && res.data && res.data.length > 0) {
+ res && res.data.forEach(async(item,index) => {
+ let oneData = JSON.parse(JSON.stringify(this.linuxSystem['pw']));
+ oneData.title = item && item.pwrName;
+ tabNameList[item.pwrName + '_pw'] = oneData;
+ this.$set(this.secondChartList, item.pwrName + '_pw', oneData);
+ });
+ if (this.activeNames && this.activeNames.length <= 0) {
+ this.activeNames = [Object.keys(tabNameList)[0]];
+ this.getPwrDetailsData(this.currTimeList, tabNameList[Object.keys(tabNameList)[0]].title, Object.keys(tabNameList)[0]);
+ }
+ }
});
},
// 基本信息
@@ -728,13 +744,18 @@
fnFanNameList(val) {
fanAllName({clientId: this.paramsData.clientId}).then(res => {
let tabNameList = {};
- res && res.data.forEach(async(item,index) => {
- let oneData = JSON.parse(JSON.stringify(this.linuxSystem['fan']));
- oneData.title = item && item.fanName;
- tabNameList[item.fanName + '_fan'] = oneData;
- this.$set(this.secondChartList, item.fanName + '_fan', oneData);
- });
- }).catch((error) => {
+ if (res && res.data && res.data.length > 0) {
+ res && res.data.forEach(async(item,index) => {
+ let oneData = JSON.parse(JSON.stringify(this.linuxSystem['fan']));
+ oneData.title = item && item.fanName;
+ tabNameList[item.fanName + '_fan'] = oneData;
+ this.$set(this.secondChartList, item.fanName + '_fan', oneData);
+ });
+ if (this.activeNames && this.activeNames.length <= 0) {
+ this.activeNames = [Object.keys(tabNameList)[0]];
+ this.getFanDetailsData(this.currTimeList, tabNameList[Object.keys(tabNameList)[0]].title, Object.keys(tabNameList)[0]);
+ }
+ }
});
},
// 基本信息
@@ -766,13 +787,13 @@
}
});
},
- chartFnEvent(valData, fnName, tabName) {
+ chartFnEvent(valData, fnName, tabName, key) {
this.firstChartTrans = valData;
// 检查函数是否存在,避免报错
if (typeof this[fnName] === 'function') {
this.defaultTimes = valData.timeArr;
// 调用实际函数,并传递参数(如选中的值、当前项)
- this[fnName]({startTime: valData.timeArr[0], endTime: valData.timeArr[1]}, tabName);
+ this[fnName]({startTime: valData.timeArr[0], endTime: valData.timeArr[1]}, tabName, key);
} else {
console.warn(`函数 ${fnName} 未定义`);
}
diff --git a/src/views/resource/switchRegister/secondAutoFind.vue b/src/views/resource/switchRegister/secondAutoFind.vue
index 9ad2dc0..feb3d62 100644
--- a/src/views/resource/switchRegister/secondAutoFind.vue
+++ b/src/views/resource/switchRegister/secondAutoFind.vue
@@ -5,11 +5,11 @@
- {{item}}{{val && val.formModel[key] || '-'}}
+ {{item}}{{val && val.formModel[key] || '-'}}
-
+
@@ -52,8 +52,8 @@
this.activeShowList = this.activeNames;
this.$emit("collapseChangeData", val);
},
- chartDataEvent(valData, funcName, tabName) {
- this.$emit("chartFnEvent", valData, funcName, tabName);
+ chartDataEvent(valData, funcName, tabName, key) {
+ this.$emit("chartFnEvent", valData, funcName, tabName, key);
// // 检查函数是否存在,避免报错
// if (typeof this[funcName] === 'function') {
// // 调用实际函数,并传递参数(如选中的值、当前项)