业务95值新增任务、监控看板概览

1、业务95值计算新增任务表单功能修改(100%)
2、前端开发监控看板概览(开发:100%,联调:0%)
3、服务器脚本策略表单提交添加字段、交换机管理修改图形相关文字
4、拓扑管理表单添加字段
This commit is contained in:
康冉冉
2025-11-14 18:47:43 +08:00
parent cabb31a953
commit d192960db4
8 changed files with 434 additions and 45 deletions
+68 -17
View File
@@ -21,6 +21,7 @@
serverNameList: [],
serverPortList: [],
interfaceNameList: [],
formModel: {},
}
},
created() {
@@ -30,8 +31,8 @@
} else {
this.switchList();
this.fnServerNameList();
this.fnFormList();
}
this.fnFormList();
},
methods: {
@@ -43,9 +44,11 @@
id: {label: 'ID',hidden: true},
clientId: {label: '交换机名称', span: 12, type: 'select', eventName: 'change', options:[], required: true},
interfaceName: {label: '接口名称', span: 12, type: 'select', options:[],required: true},
connectedDeviceType: {label: '接口连接设备类型', span: 12, type: 'radio', options:this.dict.type.rm_topology_type, required: true},
serverClientId: {label: '服务器ClientID', span: 12, eventName: 'change', options:[], type: 'select'},
serverPort: {label: '服务器网口', span: 12, options:[], type: 'select'},
connectedDeviceType: {label: '接口连接设备类型', span: 12, type: 'radio', eventName: 'change', options:this.dict.type.rm_topology_type, required: true},
serverClientId: {label: '服务器ClientID', span: 12, eventName: 'change', options:[], type: 'select', hidden: this.ruleForm.connectedDeviceType === '1' ? false : true},
serverPort: {label: '服务器网口', span: 12, options:[], type: 'select', hidden: this.ruleForm.connectedDeviceType === '1' ? false : true},
peerSwitchName: {label: '对端交换机名称', span: 12, options:[], type: 'select', eventName: 'change', hidden: this.ruleForm.connectedDeviceType === '3' || this.ruleForm.connectedDeviceType === '4' ? false : true},
peerSwitchInterface: {label: '对端交换机端口', span: 12, options:[], type: 'select', hidden: this.ruleForm.connectedDeviceType === '3' || this.ruleForm.connectedDeviceType === '4' ? false : true},
}
}];
},
@@ -54,24 +57,33 @@
listAllSwitchName({}).then(val => {
if(val && val.data) {
this.switchNameList = val && val.data;
this.formList[0].controls.clientId['options'] = val && val.data.map(item => {
let newDataList = val && val.data.map(item => {
if (this.paramsData && this.paramsData.id) {
if (item.clientId === this.ruleForm.clientId) {
this.fnInterFaceNameList({clientId: item.clientId});
}
if (item.clientId === this.ruleForm.peerSwitchName) {
this.fnInterFaceNameList({clientId: item.clientId}, '1');
}
}
return Object.assign({label: item.switchName, value: item.clientId});
});
this.formList[0].controls.clientId['options'] = newDataList;
this.formList[0].controls.peerSwitchName['options'] = newDataList;
}
});
},
// 接口名称
fnInterFaceNameList(val) {
fnInterFaceNameList(val, num) {
postInterFaceName(Object.assign({},{resourceType: 2}, val)).then(res => {
this.interfaceNameList = res;
this.formList[0].controls.interfaceName['options'] = res && res.map(item => {
let newDataList = res && res.map(item => {
return Object.assign({label: item.interfaceName, value: item.interfaceName});
});
this.formList[0].controls.interfaceName['options'] = newDataList;
if (num === '1') {
this.formList[0].controls.peerSwitchInterface['options'] = newDataList;
}
});
},
// 获取服务器下拉
@@ -101,8 +113,10 @@
getFormDataList(id) {
getTopology(id).then(val => {
this.ruleForm = val && val.data;
this.formModel = JSON.parse(JSON.stringify(val && val.data));
this.switchList();
this.fnServerNameList();
this.fnFormList();
}).catch(() => {
this.$modal.msgError("操作失败")
});
@@ -111,6 +125,32 @@
callback(result, dataVal, formVal) {
if (result && result.fnCode) {
switch (result.fnCode) {
case 'connectedDeviceType':
if (dataVal && dataVal === '1') {
this.formList[0].controls.serverClientId['hidden'] = false;
this.formList[0].controls.serverPort['hidden'] = false;
this.formList[0].controls.peerSwitchName['hidden'] = true;
this.formList[0].controls.peerSwitchInterface['hidden'] = true;
} else if (dataVal && (dataVal === '3' || dataVal === '4')) {
if (this.formModel.connectedDeviceType != dataVal) {
this.ruleForm.peerSwitchName = '';
this.ruleForm.peerSwitchInterface = '';
} else {
this.ruleForm.peerSwitchName = this.formModel.peerSwitchName;
this.ruleForm.peerSwitchInterface = this.formModel.peerSwitchInterface;
}
this.ruleForm.connectedDeviceType = dataVal;
this.formList[0].controls.serverClientId['hidden'] = true;
this.formList[0].controls.serverPort['hidden'] = true;
this.formList[0].controls.peerSwitchName['hidden'] = false;
this.formList[0].controls.peerSwitchInterface['hidden'] = false;
} else {
this.formList[0].controls.serverClientId['hidden'] = true;
this.formList[0].controls.serverPort['hidden'] = true;
this.formList[0].controls.peerSwitchName['hidden'] = true;
this.formList[0].controls.peerSwitchInterface['hidden'] = true;
}
break;
case 'clientId':
this.ruleForm = Object.assign({}, this.ruleForm, this.$refs.formRef.$refs.ruleForm.model);
let clientId = '';
@@ -122,17 +162,28 @@
this.ruleForm['interfaceName'] = '';
this.fnInterFaceNameList({clientId: clientId});
break;
case 'serverClientId':
if (dataVal) {
// let serverIp = '';
// this.serverNameList.find(item => {
// if (item.clientId === dataVal) {
// serverIp = item.ipAddress;
// }
// });
this.fnServerPortList({clientId: dataVal});
case 'peerSwitchName':
this.ruleForm = Object.assign({}, this.ruleForm, this.$refs.formRef.$refs.ruleForm.model);
let peerVal = '';
this.switchNameList.find(item => {
if (item.clientId === dataVal) {
peerVal = item.clientId;
}
break;
});
this.ruleForm['peerSwitchInterface'] = '';
this.fnInterFaceNameList({clientId: peerVal}, '1');
break;
case 'serverClientId':
if (dataVal) {
// let serverIp = '';
// this.serverNameList.find(item => {
// if (item.clientId === dataVal) {
// serverIp = item.ipAddress;
// }
// });
this.fnServerPortList({clientId: dataVal});
}
break;
case 'submit':
this.switchNameList.find(item => {
if (item.clientId === dataVal['clientId']) {