diff --git a/src/components/table/index.vue b/src/components/table/index.vue index 2aaa32b..728395f 100644 --- a/src/components/table/index.vue +++ b/src/components/table/index.vue @@ -115,7 +115,7 @@ @@ -374,6 +374,7 @@ }, // 按钮操作弹窗 fnFormHandle(val) { + this.formModel = {}; if (val === 'add') { this.title = '添加配置'; this.open = true; @@ -395,6 +396,8 @@ '

删除 ' + this.reserveForm.configName + ' 配置后,相应的服务器/交换机集合的总流量的相关数据都将删除

'; this.$modal.confirm(content).then(() => { delMonitorConfig(this.reserveForm.id).then(res => { + this.reserveForm = {}; + this.lineDataParams = {}; this.fnConfigName(this.groupData); }); }).catch(() => {}); @@ -419,7 +422,9 @@ }, fnDialogResult(res){ this.open = false; - this.groupListData(); + if (res && res.type === 'submit') { + this.groupListData(); + } // this.fnConfigName(this.groupData); // this.fnChartView(); }, diff --git a/src/views/resource/serverRegister/details.vue b/src/views/resource/serverRegister/details.vue index 05efeaf..73298c2 100644 --- a/src/views/resource/serverRegister/details.vue +++ b/src/views/resource/serverRegister/details.vue @@ -1,5 +1,5 @@ @@ -62,15 +62,16 @@ - + + - + @@ -105,7 +106,7 @@ import memoryImg from '@/assets/images/memory.svg'; import diskSizeImg from '@/assets/images/diskSize.png'; import {getHandle, trafficSerDetails, agentIsNew, virNetInterfaceChild, frpMsgByClient, getPppoeConfig, updateAgentManage, postInterFaceName, - mountNameList, diskNameList, trafficEcharts, spaceRate, speedEcharts, trafficIPv4Echarts, trafficIPv6Echarts,cpuTemperatureChartData, + mountNameList, diskNameList, diskAllNames, trafficEcharts, spaceRate, speedEcharts, trafficIPv4Echarts, trafficIPv6Echarts,cpuTemperatureChartData, cpuLoadData, memoryUtilization, usedSpacechartsData, networkList, pingDroppedEchars, getAlarmLogServerMsg} from "@/api/disRevenue/resource"; import {listBandWidth} from "@/api/disRevenue/earnManage"; import serRegisFormOther from './formOther'; @@ -139,7 +140,7 @@ echartFors: [ {title: '的空间利用率(%)', oneName: '利用率'}, ], - echartList: [] + echartList: [null] }, net: { title: '网络接口interface eth0', @@ -178,6 +179,8 @@ hiddenTime: true, yAxisName: ' ', gridTop: '35%', + gridLeft: '40px', + gridRight: '40px', legend: {top: '15%', left: '10%'}, lineXData: [], dataList: [ @@ -193,6 +196,8 @@ hiddenTime: true, yAxisName: ' ', gridTop: '35%', + gridLeft: '40px', + gridRight: '40px', legend: {top: '15%', left: '10%'}, lineXData: [], dataList: [ @@ -202,24 +207,27 @@ } ], echartData: { - title: 'GE1/0/1的丢包数', + title: ' ', dataVal: { hiddenTime: true, titleVal: {textAlign: 'left', left: '1%'}, yAxisName: ' ', gridTop: '30%', - // gridLeft: '7%', - // gridRight: undefined, - legend: {top: '15%', left: '10%'}, - lineXData: ['2025-9-1', '2025-9-2', '2025-9-3', '2025-9-4', '2025-9-5', '2025-9-6', '2025-9-7'], + gridLeft: '40px', + gridRight: '40px', + legend: {top: '15%', left: '90px'}, + lineXData: [], dataList: [{ - name: '入站丢包', - data: [120, 132, 101, 134, 90, 230, 210], + name: ' ', + data: [], }] } }, activeShowList: [], interCartList: {}, + eventKeyName: {}, + scrollTimeout: '', + newVersionType: true, } }, created() { @@ -234,6 +242,14 @@ this.handleClick(); }, methods: { + handleScroll() { + if (this.$refs.layoutChart && !this.scrollTimeout) { + this.scrollTimeout = setTimeout(() => { + this.$refs.layoutChart.scrollContent(); + this.scrollTimeout = null; + }, 500); // 500ms 节流间隔 + } + }, fnFormList(objVal) { this.formList = [{ config: {title: '',readonly: true}, @@ -324,9 +340,12 @@ let agentType = await this.fnAgentIsNew(model); if (agentType && agentType.newFlag) { let params = {deployDevice: model.clientId, method: '0', fileUrl: agentType.fileUrl, fileMd5: agentType.fileMd5}; - updateAgentManage(params).then(res => { - console.log('res===',res); - }); + this.$modal.confirm('是否升级到最新?').then(() => { + updateAgentManage(params).then(res => { + this.newVersionType = false; + this.$modal.msgSuccess("升级成功!"); + }); + }).catch(() => {}); } else { let content = `

升级警告

` + `

未找到最新版本${model.maxAgentVersion}的下载地址,请到【AGENT更新】中添加一条版本${model.maxAgentVersion}的更新策略,才可自动进行升级更新`; @@ -499,9 +518,23 @@ this.$set(this.mapDataList, keyName, [{tableList: newList, queryParams: {total: 0}}]); } }); + // diskAllNames({clientId: this.paramsData.clientId}).then(res => { + // if (res && res.data.length > 0) { + // let tabNameList = {}; + // res && res.data.forEach(async(item,index) => { + // let oneData = JSON.parse(JSON.stringify(this.linuxSystem['disk'])); + // oneData.title = item && item.name; + // oneData.toTitle = '硬盘设备'; + // oneData.clientId = this.paramsData.clientId; + // tabNameList[item.name] = oneData; + // }); + // this.$set(this.mapDataList, keyName, tabNameList); + // } + // }); }, // 回调 fnTimeChangeData(val) { + this.eventKeyName = {}; if (this.activeName && this.activeName === '网卡流量监控' && this.mapDataList[this.activeName]) { this.fnNetChartList('网卡流量监控', val.currTimeList, val.interCardName, val.onlyInterCard); } else if (this.activeName && this.activeName === '挂载文件系统监控' && this.mapDataList[this.activeName]) { @@ -525,40 +558,53 @@ } } } else { - Object.keys(this.mapDataList[keyVal]).forEach(async (keyName,index) => { + for (const keyName of Object.keys(this.mapDataList[keyVal])) { if (keyName === '网卡信息') { - // this.mapDataList[keyVal][keyName].echartList = []; if (await this.getNetEcharts(time, keyVal, keyName, interCardName)) { if (await this.getNetPingDropCharts(time, keyVal, keyName, interCardName)) { if (this.interCartList[interCardName].businessFlag) { if (await this.getNetIPv4Echarts(time, keyVal, keyName, interCardName)) { - this.getNetIPv6Echarts(time, keyVal, keyName, interCardName) + await this.getNetIPv6Echarts(time, keyVal, keyName, interCardName) } } } } } else if (keyName === 'CPU使用率') { - this.getCpuLoadData(time, keyVal, keyName) + await this.getCpuLoadData(time, keyVal, keyName) } else if (keyName === '内存使用率') { - this.getMemoryUtilizationData(time, keyVal, keyName) + await this.getMemoryUtilizationData(time, keyVal, keyName) } else if (keyName === 'HDD磁盘空间') { - this.fnUsedSpaceCharts(time, keyVal, keyName); + await this.fnUsedSpaceCharts(time, keyVal, keyName); } else if (keyName === 'CPU温度') { this.fnCpuTemperatureCharts(time, keyVal, keyName); } - }); + } + // Object.keys(this.mapDataList[keyVal]).forEach(async (keyName,index) => { + // }); } }, // 挂载文件系统监控 fnMountCharList(keyVal, time){ - Object.keys(this.mapDataList[keyVal]).forEach(async keyName => { - this.getSpaceRate(time, keyVal, keyName); + Object.keys(this.mapDataList[keyVal]).forEach(async (keyName,index) => { + if (Object.keys(this.mapDataList[keyVal]).length > 3) { + if (index <= 2) { + this.getSpaceRate(time, keyVal, keyName); + } + } else { + this.getSpaceRate(time, keyVal, keyName); + } }); }, // 硬盘设备 fnDiskCharList(keyVal, time){ - Object.keys(this.mapDataList[keyVal]).forEach(async keyName => { - this.getSpaceRate(time, keyVal, keyName); + Object.keys(this.mapDataList[keyVal]).forEach(async (keyName,index) => { + if (Object.keys(this.mapDataList[keyVal]).length > 3) { + if (index <= 2) { + this.getSpeedEcharts(time, keyVal, keyName); + } + } else { + this.getSpeedEcharts(time, keyVal, keyName); + } }); }, // 网卡 流量 @@ -723,6 +769,7 @@ }, // 挂载文件 空间利用率 getSpaceRate(times, keyVal, titleName) { + this.eventKeyName[titleName] = true; let mountCollect = JSON.parse(JSON.stringify(this.mapDataList[keyVal][titleName])); mountCollect['titleTo'] = titleName; let mountEcharts = JSON.parse(JSON.stringify(this.echartData)); @@ -737,6 +784,9 @@ name: content.echartFors[0].oneName, data: res.data && res.data.yData['vfsUtilData'] || [] }; + if (res.data && res.data.yData && res.data.yData['usedData'] && res.data.yData['usedData'].length > 0) { + mountEcharts.dataVal.otherModel = {name: '存储使用大小', value: res.data && res.data.yData['usedData'] || []}; + } } mountCollect['echartList'][0] = mountEcharts; this.$set(this.mapDataList[keyVal], titleName, mountCollect); @@ -747,6 +797,7 @@ }, // 硬盘设备 读写速率 getSpeedEcharts(times, keyVal, titleName) { + this.eventKeyName[titleName] = true; let mountCollect = JSON.parse(JSON.stringify(this.mapDataList[keyVal][titleName])); mountCollect['titleTo'] = titleName; let netEcharts = JSON.parse(JSON.stringify(this.echartData)); @@ -871,6 +922,20 @@ } }, + // 滚动监听事件 + fnLazyLoad(val) { + if (val) { + if (this.mapDataList[this.activeName]) { + if (this.mapDataList[this.activeName][val.key] && !(this.mapDataList[this.activeName][val.key].echartList[0] && this.mapDataList[this.activeName][val.key].echartList[0].title)) { + if (this.activeName === '挂载文件系统监控' && !this.eventKeyName[val.key]) { + this.getSpaceRate(val.currTimeList, this.activeName, val.key); + } else if (this.activeName === '硬盘设备监控' && !this.eventKeyName[val.key]) { + this.getSpeedEcharts(val.currTimeList, this.activeName, val.key); + } + } + } + } + }, // 监听事件 callback(result, dataVal, formVal) { diff --git a/src/views/resource/serverRegister/flowForm.vue b/src/views/resource/serverRegister/flowForm.vue index 9720e64..b2df1e3 100644 --- a/src/views/resource/serverRegister/flowForm.vue +++ b/src/views/resource/serverRegister/flowForm.vue @@ -56,13 +56,13 @@ readonly: true, paramsData: {}, ruleForm: { - detectFlag: '1', - frequency: '每天', + // detectFlag: '1', + // frequency: '每天', detectTimes: [] }, formModel: { - detectFlag: '1', - frequency: '每天', + // detectFlag: '1', + // frequency: '每天', detectTimes: [] }, inputVisible: false, @@ -154,7 +154,7 @@ if (!this.readonly) { this.formSumbit(); } else { - this.ruleForm = Object.assign({}, this.ruleForm, {typeName: 111}); + this.ruleForm = Object.assign({}, this.ruleForm, {frequency: '每天'}); this.readonly = !this.readonly; this.fnFormList(this.readonly); } diff --git a/src/views/resource/serverRegister/tabsChart.vue b/src/views/resource/serverRegister/tabsChart.vue index ee0f08b..fb4c66b 100644 --- a/src/views/resource/serverRegister/tabsChart.vue +++ b/src/views/resource/serverRegister/tabsChart.vue @@ -44,20 +44,20 @@