diff --git a/src/components/RightToolbar/index.vue b/src/components/RightToolbar/index.vue index 9c4932f..3d44206 100644 --- a/src/components/RightToolbar/index.vue +++ b/src/components/RightToolbar/index.vue @@ -11,7 +11,7 @@ - + 列展示 @@ -151,17 +151,25 @@ export default { if (Array.isArray(this.columns)) { this.columns.filter(item => item.key == key)[0].visible = event } else { - this.columns[key].visible = event + let newBackup = JSON.parse(JSON.stringify(this.columns)); + newBackup[key].visible = event; + this.$set(this.columns, key, newBackup[key]); + // this.columns[key].visible = event } this.$emit("columnsChange", this.columns); }, // 切换全选/反选 toggleCheckAll() { - const newValue = !this.isChecked + const newValue = !this.isChecked; + let newBackup = JSON.parse(JSON.stringify(this.columns)); if (Array.isArray(this.columns)) { this.columns.forEach((col) => (col.visible = newValue)) } else { - Object.values(this.columns).forEach((col) => (col.visible = newValue)) + Object.keys(newBackup).forEach(col => { + newBackup[col].visible = newValue; + this.$set(this.columns, col, newBackup[col]); + }); + // Object.values(this.columns).forEach((col) => (col.visible = newValue)) } this.$emit("columnsChange", this.columns); } diff --git a/src/components/echartsList/line.vue b/src/components/echartsList/line.vue index a7a0f33..b1b45e3 100644 --- a/src/components/echartsList/line.vue +++ b/src/components/echartsList/line.vue @@ -76,7 +76,11 @@ series.push({ name: item && item.name || '', type: 'line', - stack: 'Total', + // showSymbol: false, + symbol: 'circle', + areaStyle: { + opacity: 0.6 + }, data: item && item.data || [] }); }); diff --git a/src/router/index.js b/src/router/index.js index 773268c..ca0f83c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -181,6 +181,49 @@ export const dynamicRoutes = [ } ] }, + // 业务95值计算 + { + path: '/earnManage/busValueCount/edit', + component: Layout, + hidden: true, + permissions: ['earnManage:busValueCount:edit'], + children: [ + { + path: 'index/:id?', + component: () => import('@/views/earnManage/busValueCount/details'), + name: 'busValueCountEdit', + meta: { title: '新增任务', activeMenu: '/earnManage/busValueCount' } + } + ] + }, + { + path: '/earnManage/busValueCount/list', + component: Layout, + hidden: true, + permissions: ['earnManage:busValueCount:list'], + children: [ + { + path: 'index/:id?', + component: () => import('@/views/earnManage/busValueCount/relevantData'), + name: 'busValueCountRelevant', + meta: { title: '相关数据', activeMenu: '/earnManage/busValueCount' } + } + ] + }, + { + path: '/earnManage/busValueCount/chart', + component: Layout, + hidden: true, + permissions: ['earnManage:busValueCount:chart'], + children: [ + { + path: 'index/:id?', + component: () => import('@/views/earnManage/busValueCount/viewChart'), + name: 'busValueCountChart', + meta: { title: '查看图形', activeMenu: '/earnManage/busValueCount' } + } + ] + }, // 服务器带宽收益管理 { path: '/earnManage/server/list', @@ -225,6 +268,20 @@ export const dynamicRoutes = [ } ] }, + { + path: '/earnManage/switch/edit', + component: Layout, + hidden: true, + permissions: ['earnManage:switch:edit'], + children: [ + { + path: 'index/:switchId?', + component: () => import('@/views/earnManage/switch/details'), + name: 'SwitchDetails', + meta: { title: '相关数据', activeMenu: '/earnManage/switch' } + } + ] + }, // 业务标识管理 { path: '/earnManage/businessIdent/details', diff --git a/src/views/earnManage/busValueCount/busValueCount.vue b/src/views/earnManage/busValueCount/busValueCount.vue new file mode 100644 index 0000000..6afb52e --- /dev/null +++ b/src/views/earnManage/busValueCount/busValueCount.vue @@ -0,0 +1,248 @@ + + + + + diff --git a/src/views/earnManage/busValueCount/details.vue b/src/views/earnManage/busValueCount/details.vue new file mode 100644 index 0000000..3b70b15 --- /dev/null +++ b/src/views/earnManage/busValueCount/details.vue @@ -0,0 +1,80 @@ + + + + diff --git a/src/views/earnManage/busValueCount/index.vue b/src/views/earnManage/busValueCount/index.vue new file mode 100644 index 0000000..e591c0a --- /dev/null +++ b/src/views/earnManage/busValueCount/index.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/src/views/earnManage/busValueCount/relevantData.vue b/src/views/earnManage/busValueCount/relevantData.vue new file mode 100644 index 0000000..d81c95e --- /dev/null +++ b/src/views/earnManage/busValueCount/relevantData.vue @@ -0,0 +1,131 @@ + + + + + diff --git a/src/views/earnManage/busValueCount/viewChart.vue b/src/views/earnManage/busValueCount/viewChart.vue new file mode 100644 index 0000000..3429796 --- /dev/null +++ b/src/views/earnManage/busValueCount/viewChart.vue @@ -0,0 +1,29 @@ + + + + + diff --git a/src/views/earnManage/server/analysisChart.vue b/src/views/earnManage/server/analysisChart.vue index 8acc1d8..c249a7e 100644 --- a/src/views/earnManage/server/analysisChart.vue +++ b/src/views/earnManage/server/analysisChart.vue @@ -14,7 +14,20 @@ - +
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') { // // 调用实际函数,并传递参数(如选中的值、当前项)