交换机管理的图形监控

This commit is contained in:
康冉冉
2025-10-28 18:37:03 +08:00
parent d7849c5e6d
commit 1aa53d7d90
13 changed files with 734 additions and 194 deletions

View File

@@ -542,7 +542,126 @@ export function switchNetSpeed(data) {
data: data
})
}
// 图形监控-自动发现项-光模块AllName
export function moduleAllName(data) {
return request({
url: '/rocketmq/switchOpticalModule/getAllModuleName',
method: 'post',
data: data
})
}
// 图形监控-自动发现项-光模块-基本信息
export function moduleMsg(data) {
return request({
url: '/rocketmq/switchOpticalModule/switchOpticalModuleMsg',
method: 'post',
data: data
})
}
// 图形监控-自动发现项-光模块-光衰阈值
export function moduleLowThreshold(data) {
return request({
url: '/rocketmq/switchOpticalModule/opticalModuleLowThreshold',
method: 'post',
data: data
})
}
// 图形监控-自动发现项-光模块-功率
export function modulePower(data) {
return request({
url: '/rocketmq/switchOpticalModule/opticalModulePower',
method: 'post',
data: data
})
}
// 图形监控-自动发现项-MPU1 AllName
export function mpuAllName(data) {
return request({
url: '/rocketmq/switchMpuInfo/getAllMpuName',
method: 'post',
data: data
})
}
// 图形监控-自动发现项-MPU1-基本信息
export function mpuMsg(data) {
return request({
url: '/rocketmq/switchMpuInfo/getMpuMsg',
method: 'post',
data: data
})
}
// 图形监控-自动发现项-MPU1-cpu使用率
export function mpuCpuUse(data) {
return request({
url: '/rocketmq/switchMpuInfo/getMpuCpuUse',
method: 'post',
data: data
})
}
// 图形监控-自动发现项-MPU1-内存使用率
export function mpuMemUse(data) {
return request({
url: '/rocketmq/switchMpuInfo/getMpuMemUse',
method: 'post',
data: data
})
}
// 图形监控-自动发现项-MPU1-温度
export function mpuTemperature(data) {
return request({
url: '/rocketmq/switchMpuInfo/getMpuTemperature',
method: 'post',
data: data
})
}
// 图形监控-自动发现项-电源AllName
export function pwrAllName(data) {
return request({
url: '/rocketmq/switchPowerSupply/getAllPwrName',
method: 'post',
data: data
})
}
// 图形监控-自动发现项-电源-基本信息
export function pwrMsg(data) {
return request({
url: '/rocketmq/switchPowerSupply/getPwrMsg',
method: 'post',
data: data
})
}
// 图形监控-自动发现项-电源-光衰阈值
export function pwrCurrent(data) {
return request({
url: '/rocketmq/switchPowerSupply/getPwrCurrent',
method: 'post',
data: data
})
}
// 图形监控-自动发现项-电源-功率
export function pwrVoltage(data) {
return request({
url: '/rocketmq/switchPowerSupply/getPwrVoltage',
method: 'post',
data: data
})
}
// 图形监控-自动发现项-风扇AllName
export function fanAllName(data) {
return request({
url: '/rocketmq/switchFanInfo/getAllFanName',
method: 'post',
data: data
})
}
// 图形监控-自动发现项-风扇-基本信息
export function fanMsg(data) {
return request({
url: '/rocketmq/switchFanInfo/getFanMsg',
method: 'post',
data: data
})
}
/** --------------接口备注信息--------------- */
// 查询列表
@@ -595,6 +714,13 @@ export function addMachine(query) {
data: query
})
}
export function getLogicalNode() {
return request({
url: '/system/registration/getAllLogicalNodeId',
method: 'get',
})
}
export function getRegistList(query) {
return request({
url: '/system/registration/getRegistList',

View File

@@ -29,7 +29,7 @@
<template v-if="formVal.type === 'textarea'">
<div v-if="toBoolean(formVal.disabled || formItem.config.readonly)">
<div style="color: #606266;font-weight: 700;padding-left: 15px;line-height: 1.5;" v-html="ruleForm[key]"></div>
<div style="color: #606266;font-weight: 700;padding-left: 15px;" v-html="ruleForm[key]"></div>
</div>
<template v-else>
<el-input

View File

@@ -266,7 +266,7 @@ export const dynamicRoutes = [
path: ':id?',
component: () => import('@/views/earnManage/businessIssued/details'),
name: 'BusinessIssuedDetails',
meta: { title: '业务脚本信息', noCache: true ,activeMenu: '/earnManage/businessIssued' }
meta: { title: '业务下发信息', noCache: true ,activeMenu: '/earnManage/businessIssued' }
}
]
},

View File

@@ -1,6 +1,6 @@
<template>
<div class="app-container">
<Form :formList="formList" :ruleFormData="ruleForm" :config="config" @fnClick="callback"></Form>
<Form ref="formRef" :formList="formList" :ruleFormData="ruleForm" :config="config" @fnClick="callback"></Form>
</div>
</template>
@@ -11,6 +11,28 @@
name: 'BusinessIssuedDetails',
components: {Form},
dicts: ['eps_business_review_status'],
props: {
open: {
type: String,
default: () => {}
},
dialogRowData: {
type: Object,
default: (() => {})
}
},
watch: {
open: {
handler(val) {
if (val === 'type_false') {
// 清空form
this.$refs['formRef'].$refs.ruleForm.resetFields();
}
},
deep: true,
immediate: true
},
},
data() {
return {
loading: true,
@@ -23,6 +45,10 @@
},
created() {
this.paramsData = this.$route && this.$route.query;
if (this.open) {
this.paramsData = {};
this.$set(this.ruleForm, 'deployDevice', this.dialogRowData.clientId);
}
if (this.paramsData && this.paramsData.readonly) {
this.config = {
buttonGroup: [{title: '返回', fnCode: 'goBack'}]
@@ -59,8 +85,8 @@
submitBy: {label: '提交人', span: 12, type: 'input'},
// reviewBy: {label: '审核人', span: 12, type: 'input', hidden: !(this.paramsData && this.paramsData.readonly)},
// reviewTime: {label: '审核时间', span: 12, type: 'input', hidden: !(this.paramsData && this.paramsData.readonly)},
updateTime: {label: '修改时间', span: 12, type: 'date'},
createTime: {label: '创建时间', span: 12, type: 'date'},
updateTime: {label: '修改时间', span: 12, type: 'datetime'},
createTime: {label: '创建时间', span: 12, type: 'datetime'},
reviewStatus: {label: '审核状态', span: 12, type: 'select', options: this.dict.type.eps_business_review_status,},
deployDevice: {label: '部署设备', span: 18, type: 'textarea', rows: 15, required: true},
}
@@ -85,8 +111,8 @@
reviewBy: {label: '审核人', span: 12, type: 'input', hidden: !(this.paramsData && this.paramsData.readonly)},
reviewTime: {label: '审核时间', span: 12, type: 'input', hidden: !(this.paramsData && this.paramsData.readonly)},
reviewComment: {label: '审核意见', span: 12, type: 'input', hidden: !(this.paramsData && this.paramsData.readonly)},
createTime: {label: '创建时间', span: 12, type: 'date', hidden: !(this.paramsData && this.paramsData.readonly)},
updateTime: {label: '修改时间', span: 12, type: 'date', hidden: !(this.paramsData && this.paramsData.readonly)},
createTime: {label: '创建时间', span: 12, type: 'datetime', hidden: !(this.paramsData && this.paramsData.readonly)},
updateTime: {label: '修改时间', span: 12, type: 'datetime', hidden: !(this.paramsData && this.paramsData.readonly)},
deployDevice: {label: '部署设备', span: 18, type: 'textarea', rows: 15, required: true},
}
}];
@@ -140,7 +166,11 @@
}
fnType(dataVal).then(response => {
this.$modal.msgSuccess(response.msg);
this.$router.push("/earnManage/businessIssued");
if (this.open) {
this.$emit("dialogResult", {open: false});
} else {
this.$router.push("/earnManage/businessIssued");
}
this.loading = false;
}).catch(() => {
this.$modal.msgError("操作失败");
@@ -174,7 +204,11 @@
});
break;
case 'cancel':
this.$router.push("/earnManage/businessIssued");
if (this.open) {
this.$emit("dialogResult", {open: false});
} else {
this.$router.push("/earnManage/businessIssued");
}
break;
default:
}

View File

@@ -45,8 +45,8 @@
scriptPath: {label: '脚本文件地址', span: 12, type: 'input', required: true},
defaultParams: {label: '脚本默认参数', span: 12, type: 'input'},
createBy: {label: '创建人', span: 12, type: 'input', hidden: !(this.paramsData && this.paramsData.readonly)},
createTime: {label: '创建时间', span: 12, type: 'date', hidden: !(this.paramsData && this.paramsData.readonly)},
updateTime: {label: '修改时间', span: 12, type: 'date', hidden: !(this.paramsData && this.paramsData.readonly)},
createTime: {label: '创建时间', span: 12, type: 'datetime', hidden: !(this.paramsData && this.paramsData.readonly)},
updateTime: {label: '修改时间', span: 12, type: 'datetime', hidden: !(this.paramsData && this.paramsData.readonly)},
}
}];
},

View File

@@ -97,6 +97,7 @@
}
break;
case 'clientAllId':
this.$set(this.ruleForm, 'deployDevice', '');
getRegistList({resourceType: 1}).then(res => {
let str = '';
if (res && res.data) {

View File

@@ -135,6 +135,10 @@
open: {
type: String,
default: () => {}
},
dialogRowData: {
type: Object,
default: (() => {})
}
},
watch: {
@@ -185,6 +189,10 @@
created() {
this.timeOptions = this.dict.type.collection_cycle;
this.paramsData = this.$route && this.$route.query;
if (this.open) {
this.paramsData = {};
this.$set(this.ruleFormData, 'deployDevice', this.dialogRowData.clientId);
}
if (this.paramsData && this.paramsData.id) {
this.getFormDataList(this.paramsData.id);
} else {

View File

@@ -9,7 +9,7 @@
import Form from '@/components/form/index.vue';
import {addMachine, getHandle, updateTopology, getRegistList} from "@/api/disRevenue/resource"
export default {
name: 'serverRegisterEdit',
name: 'serverRegister_Edit',
components: {Form},
dicts: ['rm_register_status','rm_register_online_state'],
data() {

View File

@@ -25,9 +25,9 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="多公网IP状态" title="多公网IP状态" prop="onlineStatus">
<el-form-item label="多公网IP状态" title="多公网IP状态" prop="multiPublicIpStatus">
<el-select
v-model="queryParams.onlineStatus"
v-model="queryParams.multiPublicIpStatus"
placeholder="请选择多公网IP状态"
clearable>
<el-option
@@ -39,13 +39,13 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="注册状态" title="注册状态" prop="onlineStatus">
<el-form-item label="注册状态" title="注册状态" prop="registrationStatus">
<el-select
v-model="queryParams.onlineStatus"
v-model="queryParams.registrationStatus"
placeholder="请选择注册状态"
clearable>
<el-option
v-for="dict in dict.type.rm_register_online_state"
v-for="dict in dict.type.rm_register_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"/>
@@ -53,30 +53,30 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="业务名称" title="业务名称" prop="onlineStatus">
<el-form-item label="业务名称" title="业务名称" prop="businessName">
<el-select
v-model="queryParams.onlineStatus"
v-model="queryParams.businessName"
placeholder="请选择业务名称"
clearable>
<el-option
v-for="dict in dict.type.rm_register_online_state"
:key="dict.value"
:label="dict.label"
:value="dict.value"/>
v-for="item in busNameList"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="逻辑节点标识" title="逻辑节点标识" prop="onlineStatus">
<el-form-item label="逻辑节点标识" title="逻辑节点标识" prop="logicalNodeId">
<el-select
v-model="queryParams.onlineStatus"
v-model="queryParams.logicalNodeId"
placeholder="请选择逻辑节点标识"
clearable>
<el-option
v-for="dict in dict.type.rm_register_online_state"
:key="dict.value"
:label="dict.label"
:value="dict.value"/>
v-for="item in logicalNodeList"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
@@ -106,24 +106,27 @@
<!-- 查看执行结果弹窗 -->
<el-dialog title="命令执行结果" :visible.sync="open" width="800px" append-to-body>
<div class="block">
<el-timeline :reverse="true">
<el-timeline-item v-for="item of timelineList" :timestamp="item.createTime" placement="top">
<pre>{{item.content}}</pre>
</el-timeline-item>
</el-timeline>
<template v-if="timelineList && timelineList.length > 0">
<el-timeline :reverse="true">
<el-timeline-item v-for="item of timelineList" :timestamp="item.createTime" placement="top">
<pre>{{item.content}}</pre>
</el-timeline-item>
</el-timeline>
</template>
<el-empty v-else :image-size="200"></el-empty>
</div>
</el-dialog>
<!-- 下发业务 -->
<el-dialog :title="title" :visible.sync="issueOpen" width="800px" append-to-body style="padding-bottom: 20px;">
<Form ref="formRef" :formList="formList" :ruleFormData="ruleForm" :config="{labelWidth: '140px', buttonGroup: []}" @fnClick="callback"></Form>
<div style="text-align: right;margin-right: 20px;margin-bottom: 20px;">
<el-button type="primary" style="margin-left: 10px;" @click="submit">提交</el-button>
<el-button @click="callback({fnCode: 'cancel'})">取消</el-button>
</div>
<BusinessIssuedDetails :open="`type_${issueOpen}`" :dialogRowData="dialogRowData" @dialogResult="fnDialogResult"></BusinessIssuedDetails>
</el-dialog>
<!-- 下发脚本策略 -->
<el-dialog :title="title" :visible.sync="scriptOpen" width="800px" append-to-body style="padding-bottom: 20px;">
<severScriptStratDetails :open="`type_${scriptOpen}`" :dialogRowData="dialogRowData" @dialogResult="fnDialogResult"></severScriptStratDetails>
</el-dialog>
<!-- 添加监控策略 -->
<el-dialog title="添加监控策略" :visible.sync="stratOpen" width="1200px" append-to-body>
<MonitorStrategy :open="`type_${stratOpen}`" @dialogResult="fnDialogResult"></MonitorStrategy>
<MonitorStrategy :open="`type_${stratOpen}`" :dialogRowData="dialogRowData" @dialogResult="fnDialogResult"></MonitorStrategy>
</el-dialog>
<!-- 选择公网业务IP -->
<el-dialog title="选择公网业务IP" :visible.sync="pubilcNetOpen" width="800px" append-to-body style="padding-bottom: 20px;">
@@ -138,18 +141,22 @@
<script setup name="Register">
import Form from '@/components/form/index.vue';
import {listHandle, networkList} from '@/api/disRevenue/resource';
import {listHandle, networkList, getScriptResultBySn, getLogicalNode} from '@/api/disRevenue/resource';
import {listAllBusinessList} from "@/api/disRevenue/earnManage"
import TableList from '@/components/table/index.vue';
import MonitorStrategy from '../serverMonitorStrat/monitorStrategy';
import severScriptStratDetails from '../serverScriptStrat/details';
import BusinessIssuedDetails from '../../earnManage/businessIssued/details';
export default {
name: 'ServerRegister',
components: {TableList, MonitorStrategy,Form},
components: {TableList, MonitorStrategy,Form, BusinessIssuedDetails, severScriptStratDetails},
dicts: ['rm_moreip_status', 'rm_register_status', 'rm_register_online_state', 'policy_method'],
data() {
return {
open: false,
stratOpen: false,
roleList: [],
busNameList: [],
loading: true,
showSearch: true,
ids: [],
@@ -243,6 +250,7 @@
{content: '【服务器节点名称1】执行脚本命令', time: '2025-12-10 12:12:12'}
],
issueOpen: false,
scriptOpen: false,
title: '',
formList: [],
ruleForm: {},
@@ -259,11 +267,15 @@
}],
pubilcNetRuleForm: {publicIp: []},
ipContentList: {},
dialogRowData: {},
logicalNodeList: [],
}
},
created() {
this.getList();
this.fnBusNameList();
this.fnLogicalNode();
},
activated() {
this.$nextTick(() => {
@@ -271,6 +283,20 @@
});
},
methods: {
fnBusNameList() {
listAllBusinessList().then(val => {
this.busNameList = val && val.data.map(item => {
return Object.assign({label: item.businessName, value: item.businessName});
});
});
},
fnLogicalNode() {
getLogicalNode().then(val => {
this.logicalNodeList = val && val.map(item => {
return Object.assign({label: item.logicalNodeId, value: item.logicalNodeId});
});
});
},
// 处理子组件传递的新值
handleValueChange(newValue) {
// 父组件更新自身数据,实现同步
@@ -279,7 +305,7 @@
},
/** 查询角色列表 */
getList() {
this.loading = true
this.loading = true;
listHandle(this.addDateRange(this.queryParams)).then(response => {
this.roleList = response.rows;
this.queryParams.total = response.total;
@@ -309,6 +335,8 @@
},
fnDialogResult(res){
this.stratOpen = false;
this.issueOpen = false;
this.scriptOpen = false;
},
callback(result, rowData, selectChange) {
if (result && result.fnCode) {
@@ -335,11 +363,13 @@
});
break;
case 'result':
this.open = true;
this.timelineList = [];
// 获取详情
getScriptResultBySn({hardwareSn: rowData.hardwareSn}).then(val => {
getScriptResultBySn({clientId: rowData.clientId}).then(val => {
this.open = true;
this.timelineList = val && val.data && val.data.scriptResult || [];
}).catch(() => {
this.open = true;
this.$modal.msgError("操作失败")
});
break;
@@ -391,70 +421,12 @@
case 'issueBusiness':
this.issueOpen = true;
this.title = '下发业务任务';
this.formList = [{
config: {title: '',labelWidth: '140px', colSpan: 'disBlock m0Auto'},
controls: {
id: {label: 'ID',hidden: true},
taskName: {label: '任务名称', span: 18, type: 'input', required: true},
businessName: {label: '业务名称', span: 18, type: 'select',options: [], required: true},
scriptName: {label: '脚本名称', span: 18, type: 'select',options: [], required: true},
adress: {label: '脚本文件地址', span: 18, type: 'input', disabled: true, required: true},
params: {label: '脚本参数', span: 18, type: 'input',options: [], required: true},
deployDevice: {label: '部署设备', span: 18, type: 'textarea',rows: 15, required: true},
}
}];
this.ruleForm = {
id: '',
clientId: '',
name: '',
scriptName: '',
adress: '',
params: '',
machineCode: ''
};
this.$nextTick(() => {
this.$refs['formRef'].initFormData();
// 5. 最后执行重置
if (this.$refs['formRef']?.$refs.ruleForm) {
this.$refs['formRef'].$refs.ruleForm.resetFields();
}
});
break;
this.dialogRowData = rowData;
break;
case 'issueScript':
this.issueOpen = true;
this.scriptOpen = true;
this.title = '添加脚本策略';
this.formList = [{
config: {title: '',labelWidth: '140px', colSpan: 'disBlock m0Auto'},
controls: {
id: {label: 'ID',hidden: true},
clientId: {label: '策略名称', span: 18, type: 'input', required: true},
description: {label: '描述', span: 18, type: 'textarea', required: true},
deployDevice: {label: '部署设备', span: 18, type: 'textarea',rows: 15, required: true},
scriptName: {label: '脚本名称', span: 18, type: 'select',options: [], required: true},
scriptPath: {label: '脚本文件地址', span: 18, type: 'input', disabled: true, required: true},
scriptParams: {label: '脚本参数', span: 18, type: 'input', required: true},
executionMethod: {label: '执行方式', span: 18, type: 'select',eventName:'change', options: this.dict.type.policy_method},
scheduledTime: {label: '定时时间', span: 18, type: 'date', hidden: true},
}
}];
this.ruleForm = {
id: '',
clientId: '',
remarks: '',
scriptName: '',
adress: '',
params: '',
machineCode: '',
executionMethod: '',
scheduledTime: ''
};
this.$nextTick(() => {
this.$refs['formRef'].initFormData();
// 5. 最后执行重置
if (this.$refs['formRef']?.$refs.ruleForm) {
this.$refs['formRef'].$refs.ruleForm.resetFields();
}
});
this.dialogRowData = rowData;
break;
case 'executionMethod':
if (rowData && rowData === '1') {
@@ -465,6 +437,7 @@
break;
case 'issueMonitor':
this.stratOpen = true;
this.dialogRowData = rowData;
break;
case 'submit':
break;

View File

@@ -10,9 +10,31 @@
import {getPolicy, addPolicy, updatePolicy} from "@/api/disRevenue/resource"
import {getAllBusScriptName} from "@/api/disRevenue/earnManage"
export default {
name: 'PortRemarks',
name: 'severScriptStratDetails',
components: {Form},
dicts: ['policy_method', 'policy_status'],
props: {
open: {
type: String,
default: () => {}
},
dialogRowData: {
type: Object,
default: (() => {})
}
},
watch: {
open: {
handler(val) {
if (val === 'type_false') {
// 清空form
this.$refs['formRef'].$refs.ruleForm.resetFields();
}
},
deep: true,
immediate: true
},
},
data() {
return {
loading: false,
@@ -24,6 +46,10 @@
},
created() {
this.paramsData = this.$route && this.$route.query;
if (this.open) {
this.paramsData = {};
this.$set(this.ruleForm, 'deployDevice', this.dialogRowData.clientId);
}
if (this.paramsData && this.paramsData.id) {
this.getFormDataList(this.paramsData.id);
}
@@ -39,7 +65,7 @@
id: {label: 'ID',hidden: true},
policyName: {label: '策略名称', span: 18, type: 'input', required: true},
description: {label: '描述', span: 18, type: 'textarea'},
task: {label: '关联业务下发任务', span: 18, type: 'input', hidden: !(this.paramsData && this.paramsData.readonly)},
taskName: {label: '关联业务下发任务', span: 18, type: 'input', hidden: !(this.paramsData && this.paramsData.readonly)},
deployDevice: {label: '部署设备', span: 18, type: 'textarea',rows: 15, required: true},
scriptName: {label: '脚本名称', span: 18, type: 'select', eventName: 'change', options: [], required: true},
scriptPath: {label: '脚本文件地址', span: 18, type: 'input', disabled: true, required: true},
@@ -105,14 +131,22 @@
this.loading = true;
fnType(dataVal).then(response => {
this.$modal.msgSuccess(response.msg);
this.$router.push("/resource/serverScriptStrat");
if (this.open) {
this.$emit("dialogResult", {open: false});
} else {
this.$router.push("/resource/serverScriptStrat");
}
this.loading = false;
}).catch(() => {
this.$modal.msgError("操作失败")
});
break;
case 'cancel':
this.$router.push("/resource/serverScriptStrat");
if (this.open) {
this.$emit("dialogResult", {open: false});
} else {
this.$router.push("/resource/serverScriptStrat");
}
break;
default:
}

View File

@@ -57,16 +57,21 @@
</TableList>
<!-- 弹窗 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-checkbox-group v-model="checkboxGroup" size="min" :disabled="dialogData['timeline'] ? false : true">
<el-checkbox-button style="margin-right: 10px;" v-for="city in clientList" :label="city" :key="city">{{city}}</el-checkbox-button>
</el-checkbox-group>
<div v-if="dialogData['timeline']" class="block mt10">
<el-timeline :reverse="true">
<el-timeline-item v-for="item of dialogData.timelineList" :timestamp="item.createTime" placement="top">
<pre>{{item.content}}</pre>
</el-timeline-item>
</el-timeline>
</div>
<template v-if="clientList && clientList.length > 0">
<el-checkbox-group v-model="checkboxGroup" size="min" :disabled="dialogData['timeline'] ? false : true" @change="handleCheckedCitiesChange">
<el-checkbox-button style="margin-right: 10px;" v-for="city in clientList" :label="city" :key="city">{{city}}</el-checkbox-button>
</el-checkbox-group>
<div v-if="dialogData['timeline']" class="block mt10">
<el-timeline :reverse="true">
<template v-for="(timeline,key,index) of dialogData.timelineList">
<el-timeline-item v-for="item of timeline" :timestamp="item.createTime" placement="top">
<pre>{{item.content}}</pre>
</el-timeline-item>
</template>
</el-timeline>
</div>
</template>
<el-empty v-else :image-size="200"></el-empty>
</el-dialog>
</div>
</template>
@@ -94,7 +99,7 @@
id: { label: `ID`,width: '50'},
policyName: { label: `策略名称`, minWidth: '250', visible: true },
description: { label: `描述`,minWidth: '200'},
task: { label: `关联业务下发`,minWidth: '200',visible: true},
taskName: { label: `关联业务下发`,minWidth: '200',visible: true},
deployDevice: { label: `部署设备`,minWidth: '200'},
scriptName: { label: `脚本名称`,minWidth: '150'},
scriptPath: { label: `脚本地址`,minWidth: '200'},
@@ -128,13 +133,11 @@
title: '',
dialogData: {
timeline: false,
timelineList: [
{content: '【服务器节点名称1】执行脚本命令', time: '2025-12-12 12:12:12'},
{content: '【服务器节点名称1】执行脚本命令', time: '2025-12-11 12:12:12'},
{content: '【服务器节点名称1】执行脚本命令', time: '2025-12-10 12:12:12'}
]
timelineList: {}
},
clientList: [],
changeClientMap: [],
changeRowData: {},
}
},
created() {
@@ -176,12 +179,10 @@
},
fnDetails(num, row){
this.dialogData['timelineList'] = [];
getScriptResultBySn({clientId: row.clientId, scriptId: row.id}).then(val => {
this.dialogData['timelineList'] = val && val.data && val.data.scriptResult || [];
}).catch(() => {
this.$modal.msgError("操作失败")
});
this.checkboxGroup = [];
this.changeClientMap = [];
this.changeRowData = row;
this.dialogData['timelineList'] = {};
this.clientList = [];
this.open = true;
if (num === 1) {
@@ -192,10 +193,38 @@
this.title = '执行成功设备';
this.dialogData['timeline'] = true;
this.clientList = row.sucessClientIds;
if (this.clientList && this.clientList.length > 0) {
this.checkboxGroup = [this.clientList[0]];
this.handleCheckedCitiesChange([this.clientList[0]]);
}
} else {
this.title = '执行失败设备';
this.dialogData['timeline'] = true;
this.clientList = row.failClientIds;
if (this.clientList && this.clientList.length > 0) {
this.checkboxGroup = [this.clientList[0]];
this.handleCheckedCitiesChange([this.clientList[0]]);
}
}
},
// 选中clientId
handleCheckedCitiesChange(val) {
let differentValues = val.filter(item => !new Set(this.changeClientMap).has(item));
if (differentValues && differentValues.length > 0) {
this.changeClientMap = val;
getScriptResultBySn({clientId: differentValues[0], scriptId: this.changeRowData.id}).then(val => {
if ( val && val.data && val.data.scriptResult && val.data.scriptResult.length > 0) {
this.$set(this.dialogData['timelineList'], differentValues[0], val.data.scriptResult);
}
}).catch(() => {
this.$modal.msgError("操作失败")
});
} else {
let delDifferentVal = this.changeClientMap.filter(item => !new Set(val).has(item));
if (delDifferentVal && delDifferentVal.length > 0) {
this.changeClientMap = val;
this.$delete(this.dialogData['timelineList'], delDifferentVal[0]);
}
}
},

View File

@@ -21,7 +21,9 @@
<script>
import FirstMonitor from "./firstMonitor";
import SecondAutoFind from "./secondAutoFind";
import {switchMonitorData, switchCpuData, switchMemData,switchPowerData, postInterFaceName, switchNetDetails,switchNetDiscards,switchNeTotal,switchNetErrDiscard, switchNetSpeed} from "@/api/disRevenue/resource"
import {switchMonitorData, switchCpuData, switchMemData,switchPowerData, postInterFaceName, switchNetDetails,switchNetDiscards,switchNeTotal,
switchNetErrDiscard, switchNetSpeed, moduleAllName, moduleMsg, moduleLowThreshold, modulePower, mpuAllName, mpuMsg, mpuCpuUse, mpuMemUse,
mpuTemperature,pwrAllName, pwrMsg, pwrCurrent, pwrVoltage, fanAllName, fanMsg} from "@/api/disRevenue/resource"
export default {
name: "MonitorChart",
components: {FirstMonitor, SecondAutoFind},
@@ -118,8 +120,8 @@
net: {
title: '网络端口GE1/0/1',
type: 'net',
formList: {name: '端口名称', type: '端口类型', status: '端口状态', mbps: '端口适配速率(Mbps)'},
formModel: {name: 'GE1/0/1', type: 'ETHNET', status: 'up', mbps: '1000'},
formList: {ifDescr: '端口名称', ifType: '端口类型', ifOperStatus: '端口状态', ifSpeed: '端口适配速率(Mbps)'},
formModel: {},
echartFors: [
{title: '的丢包数', oneName: '入站丢包', twoName: '出站丢包'},
{title: '的Bites总数', oneName: '端口发送Bites总数', twoName: '端口接收Bites总数'},
@@ -134,8 +136,8 @@
formList: {name: '光模块端口名称'},
formModel: {name: 'sabc'},
echartFors: [
{title: 'sabc的光衰阈值(dBm)', oneName: '光模块发送光衰阈值', twoName: '光模块接收光衰阈值'},
{title: 'sabc的功率(dBm)', oneName: '光模块接收功率', twoName: '光模块发送功率'}
{title: '的光衰阈值(dBm)', oneName: '光模块发送光衰阈值', twoName: '光模块接收光衰阈值'},
{title: '的功率(dBm)', oneName: '光模块接收功率', twoName: '光模块发送功率'}
],
echartList: []
},
@@ -145,9 +147,9 @@
formList: {name: 'MPU名称', system: 'MPU的操作系统'},
formModel: {name: 'MPU1', system: 'xxxx'},
echartFors: [
{title: 'MPU1的CPU使用率(%)', oneName: 'CPU利用率'},
{title: 'MPU1的内存使用率(%)', oneName: '内存利用率'},
{title: 'MPU1的温度(°C)', oneName: '温度'},
{title: '的CPU使用率(%)', oneName: 'CPU利用率'},
{title: '的内存使用率(%)', oneName: '内存利用率'},
{title: '的温度(°C)', oneName: '温度'},
],
echartList: []
},
@@ -157,8 +159,8 @@
formList: {name: '电源名称', status: '电源状态'},
formModel: {name: 'PW1', status: '正在供电'},
echartFors: [
{title: '电源电流(mA)', oneName: '电源电流'},
{title: '电源电压(mV)', oneName: '电源电压'}
{title: '电流(mA)', oneName: '电源电流'},
{title: '电压(mV)', oneName: '电源电压'}
],
echartList: []
},
@@ -261,61 +263,85 @@
// 接口名称
fnInterFaceNameList(val) {
this.activeNames = [];
postInterFaceName({clientId: this.paramsData.clientId}).then(res => {
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] = oneData;
tabNameList[item.interfaceName + '_net'] = oneData;
});
this.secondChartList = {...tabNameList};
this.activeNames = [Object.keys(tabNameList)[0]];
this.getNetDetailsData(this.currTimeList, Object.keys(tabNameList)[0]);
// this.fnSwitchNetNames(); // 第二模块名称
// setTimeout(() => {
// this.fnDiskNames(); // 第三模块名称
// setTimeout(() => {
// this.fnDockerNames(); // 第四模块名称
// },500);
// },500);
}).catch((error) => {
});
},
// 基本信息
getNetDetailsData(times, titleName) {
this.$modal.loading();
this.eventDataMap[titleName] = true;
switchNetDetails({clientId: this.paramsData.clientId, name: titleName}).then(async res => {
this.secondChartList[titleName].formModel = res && res.data || [];
if (await this.getNetDiscards(times ,titleName)) {
if (await this.getNetTotal(times, titleName)) {
if (await this.getNetErrDisc(times, titleName)) {
this.getNetSpeed(times, titleName);
}
}
}
}).catch(() => {
this.getSpaceEcharts(times ,titleName);
this.fnModuleNameList(); // 第二模块名称
setTimeout(() => {
this.getNetTotal(times, titleName);
this.fnMpuNameList(); // 第三模块名称
setTimeout(() => {
this.getNetErrDisc(times, titleName);
this.fnPwrNameList(); // 第四模块名称
setTimeout(() => {
this.getNetSpeed(times, titleName);
this.fnFanNameList(); // 第五模块名称
},500);
},500);
},500);
this.getNetDetailsData(this.currTimeList, tabNameList[Object.keys(tabNameList)[0]].title, Object.keys(tabNameList)[0]);
}).catch((error) => {
this.fnModuleNameList(); // 第二模块名称
setTimeout(() => {
this.fnMpuNameList(); // 第三模块名称
setTimeout(() => {
this.fnPwrNameList(); // 第四模块名称
setTimeout(() => {
this.fnFanNameList(); // 第五模块名称
},500);
},500);
},500);
});
},
// 基本信息
getNetDetailsData(times, titleName, keyName) {
this.$modal.loading();
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)) {
this.getNetSpeed(times, titleName, keyName);
}
}
}
}).catch(async error => {
if (await this.getNetDiscards(times ,titleName, keyName)) {
if (await this.getNetTotal(times, titleName, keyName)) {
if (await this.getNetErrDisc(times, titleName, keyName)) {
this.getNetSpeed(times, titleName, keyName);
}
}
}
});
},
// 丢包
getNetDiscards(times,titleName) {
let mountCollect = JSON.parse(JSON.stringify(this.secondChartList[titleName]));
getNetDiscards(times,titleName, keyName) {
let mountCollect = JSON.parse(JSON.stringify(this.secondChartList[keyName]));
let netEcharts = JSON.parse(JSON.stringify(this.echartData));
let content = JSON.parse(JSON.stringify(this.linuxSystem['net']));
netEcharts.dateDataTrans['dateRange'] = this.defaultTimes;
netEcharts.fnEvent = 'getNetDiscards';
return switchNetDiscards(Object.assign({}, {name : titleName,clientId: this.paramsData.clientId}, times)).then(res => {
return switchNetDiscards(Object.assign({}, {ifDescr : 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'] || [];
@@ -330,7 +356,7 @@
data: res.data && res.data.yData['netOutDiscardsData'] || []
};
mountCollect['echartList'][0] = netEcharts;
this.$set(this.secondChartList, titleName, mountCollect);
this.$set(this.secondChartList, keyName, mountCollect);
return true;
}
}).catch(() => {
@@ -338,13 +364,13 @@
});
},
// 总数
getNetTotal(times,titleName) {
let mountCollect = JSON.parse(JSON.stringify(this.secondChartList[titleName]));
getNetTotal(times,titleName, keyName) {
let mountCollect = JSON.parse(JSON.stringify(this.secondChartList[keyName]));
let netEcharts = JSON.parse(JSON.stringify(this.echartData));
let content = JSON.parse(JSON.stringify(this.linuxSystem['net']));
netEcharts.dateDataTrans['dateRange'] = this.defaultTimes;
netEcharts.fnEvent = 'getNetTotal';
return switchNeTotal(Object.assign({}, {name : titleName, clientId: this.paramsData.clientId}, times)).then(res => {
return switchNeTotal(Object.assign({}, {ifDescr : 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'] || [];
@@ -359,7 +385,7 @@
data: res.data && res.data.yData['netOutTotalData'] || []
};
mountCollect['echartList'][1] = netEcharts;
this.$set(this.secondChartList, titleName, mountCollect);
this.$set(this.secondChartList, keyName, mountCollect);
return true;
}
}).catch(() => {
@@ -367,13 +393,13 @@
});
},
// 错误丢包
getNetErrDisc(times, titleName) {
let mountCollect = JSON.parse(JSON.stringify(this.secondChartList[titleName]));
getNetErrDisc(times, titleName, keyName) {
let mountCollect = JSON.parse(JSON.stringify(this.secondChartList[keyName]));
let netEcharts = JSON.parse(JSON.stringify(this.echartData));
let content = JSON.parse(JSON.stringify(this.linuxSystem['net']));
netEcharts.dateDataTrans['dateRange'] = this.defaultTimes;
netEcharts.fnEvent = 'getNetErrDisc';
return switchNetErrDiscard(Object.assign({}, {name : titleName, clientId: this.paramsData.clientId}, times)).then(res => {
return switchNetErrDiscard(Object.assign({}, {ifDescr : 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'] || [];
@@ -386,7 +412,7 @@
data: res.data && res.data.yData['netOutErrDiscardsData'] || []
};
mountCollect['echartList'][2] = netEcharts;
this.$set(this.secondChartList, titleName, mountCollect);
this.$set(this.secondChartList, keyName, mountCollect);
return true;
}
}).catch(() => {
@@ -394,13 +420,13 @@
});
},
// 实时流量
getNetSpeed(times, titleName) {
let mountCollect = JSON.parse(JSON.stringify(this.secondChartList[titleName]));
getNetSpeed(times, titleName, keyName) {
let mountCollect = JSON.parse(JSON.stringify(this.secondChartList[keyName]));
let netEcharts = JSON.parse(JSON.stringify(this.echartData));
let content = JSON.parse(JSON.stringify(this.linuxSystem['net']));
netEcharts.dateDataTrans['dateRange'] = this.defaultTimes;
netEcharts.fnEvent = 'getNetSpeed';
switchNetSpeed(Object.assign({}, {name : titleName, clientId: this.paramsData.clientId}, times)).then(res => {
return switchNetSpeed(Object.assign({}, {ifDescr : titleName, clientId: this.paramsData.clientId}, times)).then(res => {
if (res && res.data) {
netEcharts.title = titleName + content.echartFors[3].title;
netEcharts.dataVal.lineXData = res.data && res.data.xData.length > 0 ? res.data.xData : this.firstChartTrans && this.firstChartTrans['timeList'] || [];
@@ -413,10 +439,311 @@
data: res.data && res.data.yData['netOutSpeedData'] || []
};
mountCollect['echartList'][3] = netEcharts;
this.$set(this.secondChartList, titleName, mountCollect);
this.$set(this.secondChartList, keyName, mountCollect);
// return true;
this.$modal.closeLoading();
}
}).catch(() => {
// return true;
this.$modal.closeLoading();
});
},
// 光模块的所有名称 moduleAllName, moduleMsg, moduleLowThreshold, modulePower
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) => {
});
},
// 基本信息
getModuleDetailsData(times, titleName, keyName) {
this.$modal.loading();
this.eventDataMap[keyName] = true;
moduleMsg({clientId: this.paramsData.clientId, moudleName: titleName}).then(async res => {
this.secondChartList[titleName].formModel = res && res.data || [];
if (await this.getModuleLowThreshold(times ,titleName, keyName)) {
this.getModulePower(times, titleName, keyName);
}
}).catch(async error => {
if (await this.getModuleLowThreshold(times ,titleName, keyName)) {
this.getModulePower(times, titleName, keyName);
}
});
},
// 光衰阈值
getModuleLowThreshold(times,titleName, keyName) {
let mountCollect = JSON.parse(JSON.stringify(this.secondChartList[keyName]));
let netEcharts = JSON.parse(JSON.stringify(this.echartData));
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 => {
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'] || [];
// 入
netEcharts.dataVal.dataList[0] = {
name: content.echartFors[0].oneName,
data: res.data && res.data.yData['TxLowThreshold'] || []
};
// 出
netEcharts.dataVal.dataList[1] = {
name: content.echartFors[0].twoName,
data: res.data && res.data.yData['RxLowThreshold'] || []
};
mountCollect['echartList'][0] = netEcharts;
this.$set(this.secondChartList, keyName, mountCollect);
return true;
}
}).catch(() => {
return true;
});
},
// 功率
getModulePower(times,titleName, keyName) {
let mountCollect = JSON.parse(JSON.stringify(this.secondChartList[keyName]));
let netEcharts = JSON.parse(JSON.stringify(this.echartData));
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 => {
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'] || [];
// 入
netEcharts.dataVal.dataList[0] = {
name: content.echartFors[1].oneName,
data: res.data && res.data.yData['RxPower'] || []
};
// 出
netEcharts.dataVal.dataList[1] = {
name: content.echartFors[1].twoName,
data: res.data && res.data.yData['TxPower'] || []
};
mountCollect['echartList'][1] = netEcharts;
this.$set(this.secondChartList, keyName, mountCollect);
this.$modal.closeLoading();
return true;
}
}).catch(() => {
this.$modal.closeLoading();
return true;
});
},
// mpu的所有名称 mpuAllName, mpuMsg, mpuCpuUse, mpuMemUse, mpuTemperature
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) => {
});
},
// 基本信息
getMpuDetailsData(times, titleName, keyName) {
this.$modal.loading();
this.eventDataMap[keyName] = true;
mpuMsg({clientId: this.paramsData.clientId, mpuName: titleName}).then(async res => {
this.secondChartList[titleName].formModel = res && res.data || [];
if (await this.getMpuCpuUse(times ,titleName, keyName)) {
if (await this.getMpuMemUse(times, titleName, keyName)) {
this.getMpuTemperature(times, titleName, keyName);
}
}
}).catch(async error => {
if (await this.getMpuCpuUse(times ,titleName, keyName)) {
if (await this.getMpuMemUse(times, titleName, keyName)) {
this.getMpuTemperature(times, titleName, keyName);
}
}
});
},
//
getMpuCpuUse(times,titleName, keyName) {
let mountCollect = JSON.parse(JSON.stringify(this.secondChartList[keyName]));
let netEcharts = JSON.parse(JSON.stringify(this.echartData));
let content = JSON.parse(JSON.stringify(this.linuxSystem['mpu']));
netEcharts.dateDataTrans['dateRange'] = this.defaultTimes;
netEcharts.fnEvent = 'getMpuCpuUse';
return mpuCpuUse(Object.assign({}, {mpuName : 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'] || [];
// 入
netEcharts.dataVal.dataList[0] = {
name: content.echartFors[0].oneName,
data: res.data && res.data.yData['cpuUsage'] || []
};
mountCollect['echartList'][0] = netEcharts;
this.$set(this.secondChartList, keyName, mountCollect);
return true;
}
}).catch(() => {
return true;
});
},
//
getMpuMemUse(times,titleName, keyName) {
let mountCollect = JSON.parse(JSON.stringify(this.secondChartList[keyName]));
let netEcharts = JSON.parse(JSON.stringify(this.echartData));
let content = JSON.parse(JSON.stringify(this.linuxSystem['mpu']));
netEcharts.dateDataTrans['dateRange'] = this.defaultTimes;
netEcharts.fnEvent = 'getMpuMemUse';
return mpuMemUse(Object.assign({}, {mpuName : 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'] || [];
// 入
netEcharts.dataVal.dataList[0] = {
name: content.echartFors[1].oneName,
data: res.data && res.data.yData['memUsage'] || []
};
mountCollect['echartList'][1] = netEcharts;
this.$set(this.secondChartList, keyName, mountCollect);
return true;
}
}).catch(() => {
return true;
});
},
//
getMpuTemperature(times,titleName, keyName) {
let mountCollect = JSON.parse(JSON.stringify(this.secondChartList[keyName]));
let netEcharts = JSON.parse(JSON.stringify(this.echartData));
let content = JSON.parse(JSON.stringify(this.linuxSystem['mpu']));
netEcharts.dateDataTrans['dateRange'] = this.defaultTimes;
netEcharts.fnEvent = 'getMpuTemperature';
return mpuTemperature(Object.assign({}, {mpuName : 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'] || [];
// 入
netEcharts.dataVal.dataList[0] = {
name: content.echartFors[2].oneName,
data: res.data && res.data.yData['temperature'] || []
};
mountCollect['echartList'][2] = netEcharts;
this.$set(this.secondChartList, keyName, mountCollect);
this.$modal.closeLoading();
return true;
}
}).catch(() => {
this.$modal.closeLoading();
return true;
});
},
// 电源的所有名称 pwrAllName, pwrMsg, pwrCurrent, pwrVoltage
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) => {
});
},
// 基本信息
getPwrDetailsData(times, titleName, keyName) {
this.$modal.loading();
this.eventDataMap[keyName] = true;
pwrMsg({clientId: this.paramsData.clientId, pwrName: titleName}).then(async res => {
this.secondChartList[titleName].formModel = res && res.data || [];
if (await this.getPwrCurrent(times ,titleName, keyName)) {
this.getPwrVoltage(times, titleName, keyName);
}
}).catch(async error => {
if (await this.getPwrCurrent(times ,titleName, keyName)) {
this.getPwrVoltage(times, titleName, keyName);
}
});
},
//
getPwrCurrent(times,titleName, keyName) {
let mountCollect = JSON.parse(JSON.stringify(this.secondChartList[keyName]));
let netEcharts = JSON.parse(JSON.stringify(this.echartData));
let content = JSON.parse(JSON.stringify(this.linuxSystem['pw']));
netEcharts.dateDataTrans['dateRange'] = this.defaultTimes;
netEcharts.fnEvent = 'getPwrCurrent';
return pwrCurrent(Object.assign({}, {pwrName : 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'] || [];
// 入
netEcharts.dataVal.dataList[0] = {
name: content.echartFors[0].oneName,
data: res.data && res.data.yData['pwrCurrent'] || []
};
mountCollect['echartList'][0] = netEcharts;
this.$set(this.secondChartList, keyName, mountCollect);
return true;
}
}).catch(() => {
return true;
});
},
//
getPwrVoltage(times,titleName, keyName) {
let mountCollect = JSON.parse(JSON.stringify(this.secondChartList[keyName]));
let netEcharts = JSON.parse(JSON.stringify(this.echartData));
let content = JSON.parse(JSON.stringify(this.linuxSystem['pw']));
netEcharts.dateDataTrans['dateRange'] = this.defaultTimes;
netEcharts.fnEvent = 'getPwrVoltage';
return pwrVoltage(Object.assign({}, {pwrName : 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'] || [];
// 入
netEcharts.dataVal.dataList[0] = {
name: content.echartFors[1].oneName,
data: res.data && res.data.yData['pwrVoltage'] || []
};
mountCollect['echartList'][1] = netEcharts;
this.$set(this.secondChartList, keyName, mountCollect);
this.$modal.closeLoading();
return true;
}
}).catch(() => {
this.$modal.closeLoading();
return true;
});
},
// 风扇的所有名称 fanAllName, fanMsg
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) => {
});
},
// 基本信息
getFanDetailsData(times, titleName, keyName) {
this.eventDataMap[keyName] = true;
fanMsg({clientId: this.paramsData.clientId, fanName: titleName}).then(res => {
this.secondChartList[titleName].formModel = res && res.data || [];
this.$modal.closeLoading();
}).catch( error => {
this.$modal.closeLoading();
});
},
@@ -426,7 +753,15 @@
if (!this.eventDataMap[item]) {
this.$modal.loading();
if (this.secondChartList[item].type === 'net') {
this.getNetDetailsData(this.currTimeList, item);
this.getNetDetailsData(this.currTimeList, this.secondChartList[item].title, item);
} else if (this.secondChartList[item].type === 'light') {
this.getModuleDetailsData(this.currTimeList, this.secondChartList[item].title, item);
} else if (this.secondChartList[item].type === 'mpu') {
this.getMpuDetailsData(this.currTimeList, this.secondChartList[item].title, item);
} else if (this.secondChartList[item].type === 'pw') {
this.getPwrDetailsData(this.currTimeList, this.secondChartList[item].title, item);
} else if (this.secondChartList[item].type === 'fan') {
this.getFanDetailsData(this.currTimeList, this.secondChartList[item].title, item);
}
}
});

View File

@@ -1,7 +1,7 @@
<template>
<div style="padding: 8px 20px 20px;">
<el-collapse v-model="activeShowList" @change="collapseChange">
<el-collapse-item v-for="(val,key, index) of secondChartList" :title="`【${val && val.title || ''}】`" :name="val && val.title || ''">
<el-collapse-item v-for="(val,key, index) of secondChartList" :title="`【${val && val.title || ''}】`" :name="key || ''">
<div class="mt10 w100">
<div class="w100 plr-20" style="font-size: 14px">
<div v-for="(item,key,index) of val && val.formList || []" :key="`${key}-${index}`" class="w50 disInlineBlock p10">