From c21ec6b25dec6983af90f80f3a1d60bafae21569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=B7=E5=86=89=E5=86=89?= Date: Sun, 4 Jan 2026 18:31:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=8F=91=E5=B9=B6=E8=81=94=E8=B0=83?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/disRevenue/resource.js | 34 +++++ src/views/earnManage/server/relevantData.vue | 37 ++++- .../resource/serverRegister/PPPoEConfig.vue | 41 ++++- src/views/resource/serverRegister/details.vue | 143 ++++++++++++++---- .../{formOrTable.vue => formOther.vue} | 16 +- src/views/resource/serverRegister/table.vue | 99 ++++++++++++ .../resource/serverRegister/tabsChart.vue | 11 ++ .../resource/switchRegister/monitorChart.vue | 6 +- 8 files changed, 334 insertions(+), 53 deletions(-) rename src/views/resource/serverRegister/{formOrTable.vue => formOther.vue} (93%) create mode 100644 src/views/resource/serverRegister/table.vue diff --git a/src/api/disRevenue/resource.js b/src/api/disRevenue/resource.js index e480ba9..b8d8789 100644 --- a/src/api/disRevenue/resource.js +++ b/src/api/disRevenue/resource.js @@ -442,6 +442,14 @@ export function delAgentManage(Ids) { method: 'delete' }) } +// 判断版本是否为最新agent版本---服务器管理详情用到了 +export function agentIsNew(query) { + return request({ + url: '/rocketmq/agentManagement/isNew', + method: 'post', + data: query + }) +} /** --------------交换机管理--------------- */ // 查询列表 @@ -805,6 +813,15 @@ export function bindBusPublic(query) { data: query }) } +// 详情顶部四个信息 +export function trafficSerDetails(query) { + return request({ + url: '/rocketmq/traffic/serverDetails', + method: 'post', + data: query + }) +} + // 图形监控-基础信息 export function serverMonitorData(data) { return request({ @@ -1326,3 +1343,20 @@ export function frpcPortMappingList(data) { data: data }) } +// FRP信息 ---应用于服务器管理详情 +export function frpMsgByClient(data) { + return request({ + url: '/rocketmq/frpcConfigManage/getFrpMsgByClientId', + method: 'post', + data: data + }) +} +/** --------------PPPoE--------------- */ +// 查询 ---应用于服务器管理详情 +export function getPppoeConfig(data) { + return request({ + url: '/rocketmq/rmPppoeConfigMain/getPppoeConfigMsg', + method: 'post', + data: data + }) +} diff --git a/src/views/earnManage/server/relevantData.vue b/src/views/earnManage/server/relevantData.vue index 864fc23..5ebe7c8 100644 --- a/src/views/earnManage/server/relevantData.vue +++ b/src/views/earnManage/server/relevantData.vue @@ -21,6 +21,25 @@ import {relatedBandWidth} from "@/api/disRevenue/earnManage"; export default { name: 'relevantData', + props: { + rowDataList: { + type: Object, + default: () => {} + } + }, + watch: { + rowDataList: { + handler(val) { + if (val && val.id) { + this.serverId = val && val.id; + this.columsList(val && val.bandwidthType); + this.getList(); + } + }, + deep: true, + immediate: true + } + }, data() { return { roleList: [], @@ -36,9 +55,11 @@ } }, created() { - this.serverId = this.$route.query && this.$route.query.id; - this.columsList(this.$route.query && this.$route.query.bandwidthType); - this.getList(); + if (!this.rowDataList) { + this.serverId = this.$route.query && this.$route.query.id; + this.columsList(this.$route.query && this.$route.query.bandwidthType); + this.getList(); + } }, methods: { columsList(num) { @@ -53,8 +74,8 @@ // {label: `有效95带宽值Mbps/日`, prop: 'effectiveAvgMonthlyBandwidth95', slotName: true, visible: type}, // {label: `包端带宽值Mbps/日`, prop: 'packageBandwidthDaily', slotName: true, visible: type}, {label: `流量端口`, prop: 'name', minWidth: '350', visible: !type}, - {label: `发送流量值(bites/s)`, minWidth: '150', prop: 'outSpeed', visible: !type}, - {label: `金山API记录的发送流量值(bites/s)`, minWidth: '220', prop: 'machineFlow', visible: !type}, + {label: `发送流量值(bites/s)`, minWidth: '160', prop: 'outSpeed', visible: !type}, + {label: `金山API记录的发送流量值(bites/s)`, minWidth: '240', prop: 'machineFlow', visible: !type}, ]; }, /** 查询角色列表 */ @@ -69,7 +90,11 @@ }); }, goBack() { - this.$router.go(-1); + if (!this.rowDataList) { + this.$router.go(-1); + } else { + this.$emit('closeDialog') + } } } } diff --git a/src/views/resource/serverRegister/PPPoEConfig.vue b/src/views/resource/serverRegister/PPPoEConfig.vue index c8d07cb..b81e991 100644 --- a/src/views/resource/serverRegister/PPPoEConfig.vue +++ b/src/views/resource/serverRegister/PPPoEConfig.vue @@ -36,9 +36,11 @@ import * as XLSX from 'xlsx'; import Form from '@/components/form/index.vue'; import TableList from '@/components/table/index.vue'; + import {networkList} from '@/api/disRevenue/resource'; export default { name: "PPPoEConfig", components: {Form, TableList}, + dicts: ['pppoe_enabled', 'pppoe_config_mode'], props: { modelVal: { type: Array, @@ -47,7 +49,13 @@ }, watch: { modelVal: { - handler(val) { + handler(val, oldVal) { + console.log(val,oldVal) + if (val && val.length > 0) { + this.ruleForm = val[0]; + this.roleList = val[0].subList; + this.poeInterfaceList(); + } }, deep: true, immediate: true @@ -82,10 +90,11 @@ config: {title: '', labelWidth: '140px', readonly: readonly}, controls: { id: {label: 'ID', hidden: true}, - businessName: {label: '启用PPPoE', span: readonly ? 12 : 24, type: 'radio', options: [], required: true}, - deployDevice: {label: 'PPPoE配置方式', span: readonly ? 10 : 24, type: 'select', options: [], required: true}, - deploy: {label: 'PPPoE网卡', span: readonly ? 12 : 24, type: 'select', options: [], required: true}, - deploed: {label: 'PPPoE配置规则', span: 24, slotName: 'tempPoeConfigRules'}, + clientId: {label: 'clientId', hidden: true}, + pppoeEnabled: {label: '启用PPPoE', span: readonly ? 12 : 24, type: 'radio', options: this.dict.type.pppoe_enabled, required: true}, + pppoeConfigMode: {label: 'PPPoE配置方式', span: readonly ? 10 : 24, type: 'select', options: this.dict.type.pppoe_config_mode, warningTitle: '使用multi_wan_conntrack.sh', required: true}, + pppoeInterface: {label: 'PPPoE网卡', span: readonly ? 12 : 24, type: 'select', options: [], required: true}, + subList: {label: 'PPPoE配置规则', span: 24, slotName: 'tempPoeConfigRules'}, } }]; this.columns = { @@ -95,11 +104,21 @@ ipv4Address: { label: `IPv4地址`, minWidth: '100',visible: true, placeholder: '如1.1.1.1', slotName: readonly ? null : 'tempEditModel'}, ipv4MaskBits: { label: `IPv4掩码位数`, minWidth: '100',visible: true, type: 'number', min: 1, max: 32, placeholder: '请输入1-32', slotName: readonly ? null : 'tempEditModel'}, ipv4Gateway:{ label: `IPv4网关`,minWidth: '100',visible: true, placeholder: '如1.1.1.1', slotName: readonly ? null : 'tempEditModel'}, - bandwidthResult: { label: `虚拟网卡上报带宽(Mbps)`, minWidth: '120', visible: true, placeholder: '请输入', slotName: readonly ? null : 'tempEditModel'}, + bandwidthResult: { label: `虚拟网卡上报带宽(Mbps)`, minWidth: '130', visible: true, placeholder: '请输入', slotName: readonly ? null : 'tempEditModel'}, macAddress: { label: `MAC地址`, minWidth: '120', visible: readonly}, status: { label: `连通状态`, minWidth: '100', visible: readonly}, }; }, + poeInterfaceList() { + networkList({clientId: this.ruleForm.clientId, newFlag: 1}).then(res => { + let ipList = []; + res && res.data.map(item => { + this.ipContentList[item.id] = item; + ipList.push({label: item.interfaceName, value: item.id}); + }); + this.formList[0].controls.pppoeInterface['options'] = ipList; + }); + }, formSubmit() { this.ruleForm = {name: '12'}; if (!this.readonly) { @@ -132,8 +151,14 @@ } }, downloadTemp() { - this.download('http://172.16.15.51:9300/statics/csvfile/macvlan_vlan.csv', { - }, `template_${new Date().getTime()}.xlsx`) + // this.download('http://172.16.15.51:9300/statics/csvfile/macvlan_vlan.csv', { + // }, `template_${new Date().getTime()}.xlsx`) + const link = document.createElement('a'); + link.href = 'http://172.16.15.51:9300/statics/csvfile/macvlan_vlan.csv'; + link.download = 'macvlan_vlan.csv'; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); }, handleFileUpload(file) { console.log('file====',file); diff --git a/src/views/resource/serverRegister/details.vue b/src/views/resource/serverRegister/details.vue index a2190d2..b754f22 100644 --- a/src/views/resource/serverRegister/details.vue +++ b/src/views/resource/serverRegister/details.vue @@ -1,12 +1,13 @@ @@ -32,7 +34,7 @@ import Form from '@/components/form/index.vue'; import TableList from '@/components/table/index.vue'; export default { - name: "serRegisFormOrTable", + name: "serRegisFormOther", components: {Form, TableList}, dicts: ['frpc_connection_status','frpc_status'], props: { @@ -47,9 +49,10 @@ }, watch: { activeName: { - handler(val) { - if (val && (val !== '收益查看' && val !== '虚拟网卡信息')) { - this.formListData(val); + handler(newVal, oldVal) { + // 只有值真正变化且非特定tab时才执行 + if (newVal && newVal !== oldVal && newVal !== '虚拟网卡信息') { + this.formListData(newVal); } }, deep: true, @@ -93,6 +96,7 @@ methods: { // 网卡信息 formListData(val){ + this.formList = []; if (val === '网卡信息') { this.formList = [{ config: {title: '', readonly: true}, @@ -143,7 +147,7 @@ id: {label: 'ID',hidden: true}, frpcConnectionStatus: { label: `FRP连接地址生成状态`,span: 8, type: 'select', options: this.dict.type.frpc_connection_status}, frpcCreateTime: { label: `链接生成时间`,span: 8, type: 'datetime'}, - frpcStatus: { label: `FRPC服务状态`,span: 8, options: this.dict.type.frpc_status}, + frpcStatus: { label: `FRPC服务状态`,span: 8, type: 'select', options: this.dict.type.frpc_status}, frpcServerAddr: { label: `FRPC_serverAddr`, span: 8, type: 'input'}, frpcServerPort: { label: `FRPC_serverPort`,span: 8, type: 'input'}, frpcName: { label: `FRPC_name`,span: 8, type: 'input'}, diff --git a/src/views/resource/serverRegister/table.vue b/src/views/resource/serverRegister/table.vue new file mode 100644 index 0000000..8531e00 --- /dev/null +++ b/src/views/resource/serverRegister/table.vue @@ -0,0 +1,99 @@ + + + + + diff --git a/src/views/resource/serverRegister/tabsChart.vue b/src/views/resource/serverRegister/tabsChart.vue index b8f80b8..20b9e41 100644 --- a/src/views/resource/serverRegister/tabsChart.vue +++ b/src/views/resource/serverRegister/tabsChart.vue @@ -35,6 +35,9 @@ 加载中... +
+
{{key}}:{{sysForm[key]}}
+
@@ -77,6 +80,14 @@ timeModel: '6', radioLayoutList: [{name: '单列显示', value: '1'}, {name: '双列显示', value: '2'}], layoutModel: '1', + systemContent: { + systemSwOsCollect: '操作系统', systemSwArchCollect: '操作系统架构', kernelMaxprocCollect: '最大进程数', systemDiskSizeTotalCollect: '硬盘-总可用空间(GB)', + systemBoottimeCollect: '系统启动时间', systemUptimeCollect: '系统正确运行时间', systemLocaltimeCollect: '系统本地时间', avg1: 'CPU的1分钟负载(%)', + avg5: 'CPU的5分钟负载(%)', avg15: 'CPU的15分钟负载(%)', uti: 'CPU使用率(%)', normal: 'CPU正常运行时间(s)', idle: 'CPU空闲时间(s)', iowait: 'CPU等待响应时间(s)', + system: 'CPU系统时间(s)', noresp: 'CPU软件无响应时间(s)', user: 'CPU运行用户进程所花费的时间(s)',runProcNum: '正在运行的进程数(个)', usersNum: '登录用户数(个)', + swapSizeFree: '交换卷/文件的可用空间(字节)', swapSizePercent: '可用交换空间百分比(%)', available: '可用内存(G)', percent: '可用内存百分比(%)' + }, + sysForm: {}, echartList: {}, echartData: { title: ' ', diff --git a/src/views/resource/switchRegister/monitorChart.vue b/src/views/resource/switchRegister/monitorChart.vue index 0b5fb8d..9e54080 100644 --- a/src/views/resource/switchRegister/monitorChart.vue +++ b/src/views/resource/switchRegister/monitorChart.vue @@ -514,7 +514,7 @@ getModuleDetailsData(times, titleName, keyName) { // this.$modal.loading(); this.eventDataMap[keyName] = true; - moduleMsg({clientId: this.paramsData.clientId, moudleName: titleName}).then(async res => { + moduleMsg({clientId: this.paramsData.clientId, fiberPortName: titleName}).then(async res => { this.secondChartList[titleName].formModel = res && res.data || []; if (await this.getModuleLowThreshold(times ,titleName, keyName)) { this.getModulePower(times, titleName, keyName); @@ -532,7 +532,7 @@ let content = JSON.parse(JSON.stringify(this.linuxSystem['light'])); netEcharts.dateDataTrans['dateRange'] = this.defaultTimes; netEcharts.fnEvent = 'getModuleLowThreshold'; - return moduleLowThreshold(Object.assign({}, {moudleName : titleName,clientId: this.paramsData.clientId}, times)).then(res => { + return moduleLowThreshold(Object.assign({}, {fiberPortName : titleName,clientId: this.paramsData.clientId}, times)).then(res => { if (res && res.data) { netEcharts.title = titleName + content.echartFors[0].title; netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ' '; @@ -562,7 +562,7 @@ let content = JSON.parse(JSON.stringify(this.linuxSystem['light'])); netEcharts.dateDataTrans['dateRange'] = this.defaultTimes; netEcharts.fnEvent = 'getModulePower'; - return modulePower(Object.assign({}, {moudleName : titleName, clientId: this.paramsData.clientId}, times)).then(res => { + return modulePower(Object.assign({}, {fiberPortName : titleName, clientId: this.paramsData.clientId}, times)).then(res => { if (res && res.data) { netEcharts.title = titleName + content.echartFors[1].title; netEcharts.dataVal.yAxisName = res && res.data && res.data.unit ? '单位' + res.data.unit : ' ';