...
|
...
|
@@ -9,6 +9,7 @@ export default { |
|
|
apiUrl1:'/api-web/fault/conf/netLink/saveLinkAndNodeInfo',//保存网络链路信息一节链路节点
|
|
|
apiUrl2:'/api-web/fault/conf/netLink/getNetLinkList',//根据targetId获取链路信息列表
|
|
|
tableVisible:false,//添加配置列表是否显示
|
|
|
flag:true,//是否是点进入true 还是线进入false
|
|
|
networkMonitorVisible: true,
|
|
|
isClickNet:-1,//配置链接选择
|
|
|
//网络检测配置链路列表
|
...
|
...
|
@@ -30,7 +31,7 @@ export default { |
|
|
}
|
|
|
],
|
|
|
//网络监测配置链路节点数据
|
|
|
nodeData:[{name:'',img:''}],
|
|
|
nodeData:[],
|
|
|
columns:[
|
|
|
{
|
|
|
prop: 'busTypeName',
|
...
|
...
|
@@ -85,8 +86,14 @@ export default { |
|
|
let resTypeList = Vue.ref([]);
|
|
|
let kpiList = Vue.ref([]);
|
|
|
let busTypeList = Vue.ref([]);
|
|
|
//链路节点名称
|
|
|
let nodeName=Vue.ref();
|
|
|
//配置链路名称
|
|
|
let linkName=Vue.ref();
|
|
|
//配置链路id
|
|
|
let linkId=Vue.ref();
|
|
|
//所有图标数据
|
|
|
let iconArr=Vue.ref([]);
|
|
|
let init = () =>{
|
|
|
//根据业务id获取资源列表
|
|
|
let paramsRes={
|
...
|
...
|
@@ -140,49 +147,105 @@ export default { |
|
|
|
|
|
}
|
|
|
proxy.$http.get(proxy.apiUrl2,params,function (res){
|
|
|
if(res){
|
|
|
if(res && res.data){
|
|
|
proxy.networkMonitorList=res.data;
|
|
|
if(proxy.networkMonitorList.length>0){
|
|
|
proxy.isClickNet=0;
|
|
|
proxy.linkId=proxy.networkMonitorList[0].id;
|
|
|
}
|
|
|
proxy.getNodeData();
|
|
|
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
//保存网络链路信息及链路节点
|
|
|
let saveLinkAndNodeInfo=(row)=>{
|
|
|
let params={
|
|
|
bNetLink:{
|
|
|
linkName:proxy.linkName,
|
|
|
bizId:proxy.bizId,
|
|
|
targetId:proxy.targetId,
|
|
|
},
|
|
|
bNetNodeList:[
|
|
|
row
|
|
|
]
|
|
|
let saveLinkAndNodeInfo=()=>{
|
|
|
if(proxy.linkName){
|
|
|
let bNetNodeList=proxy.nodeData.flat(2);
|
|
|
console.log('aarr--',bNetNodeList)
|
|
|
// bNetNodeList.nodeName=proxy.nodeName;
|
|
|
bNetNodeList.splice(bNetNodeList.length-1,1);
|
|
|
console.log('&&',bNetNodeList)
|
|
|
bNetNodeList.map((item,index)=>{
|
|
|
item.sort=index;
|
|
|
})
|
|
|
if(proxy.linkId){
|
|
|
// bNetNodeList.linkId=proxy.linkId;
|
|
|
}
|
|
|
let params={
|
|
|
bNetLink:{
|
|
|
linkName:proxy.linkName,
|
|
|
bizId:proxy.bizId,
|
|
|
targetId:proxy.targetId,
|
|
|
},
|
|
|
bNetNodeList:bNetNodeList
|
|
|
}
|
|
|
proxy.$http.post(proxy.apiUrl1,params,function (res){
|
|
|
if(res){
|
|
|
proxy.$global.showMsg("添加成功", "success")
|
|
|
// proxy.tableVisible=false;
|
|
|
if(res.object){
|
|
|
proxy.targetId=res.object.targetId
|
|
|
|
|
|
}
|
|
|
|
|
|
proxy.getNetLinkList();
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
|
proxy.$global.showMsg("请输入配置链路名称", "warning")
|
|
|
}
|
|
|
proxy.$http.post(proxy.apiUrl1,params,function (res){
|
|
|
if(res){
|
|
|
proxy.$global.showMsg("添加成功", "success")
|
|
|
proxy.tableVisible=false;
|
|
|
proxy.targetId=res.object.targetId
|
|
|
|
|
|
proxy.getNetLinkList();
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
//添加节点
|
|
|
let addRes=(row,index)=>{
|
|
|
console.log("row",!proxy.linkName)
|
|
|
if(!proxy.linkName){
|
|
|
console.log("1*1")
|
|
|
proxy.$global.showMsg('请填写配置链路名称','warning')
|
|
|
console.log("row",row,proxy.nodeData)
|
|
|
let bNetNodeList=row;
|
|
|
|
|
|
if(proxy.flag){
|
|
|
if(!proxy.nodeName){
|
|
|
proxy.$global.showMsg('请填写链路节点名称','warning')
|
|
|
}else{
|
|
|
console.log("2*2")
|
|
|
bNetNodeList.nodeName=proxy.nodeName;
|
|
|
bNetNodeList.type='dot';
|
|
|
|
|
|
proxy.backLink(bNetNodeList);
|
|
|
}
|
|
|
}else{
|
|
|
console.log("2*2")
|
|
|
proxy.saveLinkAndNodeInfo(row);
|
|
|
bNetNodeList.type='line';
|
|
|
proxy.backLink(bNetNodeList);
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
let backLink=(row)=>{
|
|
|
proxy.tableVisible=false;
|
|
|
|
|
|
let arr=proxy.nodeData;
|
|
|
|
|
|
// proxy.nodeData.push(row);
|
|
|
if(proxy.nodeData.length>0){
|
|
|
let length=proxy.nodeData.length;
|
|
|
|
|
|
if(proxy.flag){
|
|
|
//插入的是点
|
|
|
proxy.nodeData.splice(length-1,0,[row]);
|
|
|
}else{
|
|
|
//插入的是线
|
|
|
proxy.nodeData[length-2].push(row);
|
|
|
}
|
|
|
|
|
|
|
|
|
}else{
|
|
|
proxy.nodeData.push([row]);
|
|
|
proxy.nodeData.push([{nodeName:'',id:''}])
|
|
|
|
|
|
}
|
|
|
console.log(" proxy.nodeData", proxy.nodeData,proxy.nodeData.length)
|
|
|
|
|
|
proxy.addSetLIstVisible=false;
|
|
|
|
|
|
|
|
|
}
|
|
|
let setBizId=()=>{
|
...
|
...
|
@@ -217,7 +280,11 @@ export default { |
|
|
onBtnSearch,
|
|
|
getResData,
|
|
|
changeRes,
|
|
|
linkName
|
|
|
nodeName,
|
|
|
linkName,
|
|
|
linkId,
|
|
|
backLink,
|
|
|
iconArr
|
|
|
}
|
|
|
|
|
|
},
|
...
|
...
|
@@ -227,20 +294,12 @@ export default { |
|
|
clickList(item,index){
|
|
|
this.isClickNet=index;
|
|
|
this.addSetLIstVisible=false;
|
|
|
this.nodeData=[
|
|
|
{
|
|
|
name:'节点1',
|
|
|
img:'123'
|
|
|
},
|
|
|
{
|
|
|
name:'节点2',
|
|
|
img:'123'
|
|
|
}
|
|
|
]
|
|
|
this.nodeData.push({name:'',img:''})
|
|
|
this.linkId=item.id;
|
|
|
this.getNodeData();
|
|
|
|
|
|
},
|
|
|
|
|
|
//新增配置链路节点
|
|
|
//新增配置链路节点-左侧下方添加按钮
|
|
|
addSet(){
|
|
|
// this.tableVisible=false;
|
|
|
this.addSetLIstVisible=true;
|
...
|
...
|
@@ -248,14 +307,28 @@ export default { |
|
|
this.isClickNet=-1;
|
|
|
|
|
|
},
|
|
|
//删除链路
|
|
|
deleteNetLink(item,index){
|
|
|
let that=this;
|
|
|
this.$global.confirm("确认删除链路及节点吗?", function () {
|
|
|
that.$global.showMsg("删除成功!")
|
|
|
that.networkMonitorList.splice(index, 1);
|
|
|
if(that.networkMonitorList.length==0){
|
|
|
that.addSetLIstVisible=true;
|
|
|
}
|
|
|
|
|
|
// that.getNodeData();
|
|
|
})
|
|
|
},
|
|
|
//删除配置节点
|
|
|
deleteNode(item,index){
|
|
|
let that=this;
|
|
|
this.$global.confirm("确认删除节点吗?", function () {
|
|
|
that.$global.showMsg("删除成功!")
|
|
|
that.nodeData.splice(index, 1);
|
|
|
console.log("delette",that.nodeData.length)
|
|
|
if(that.nodeData.length==1){
|
|
|
this.addSetLIstVisible=true;
|
|
|
that.addSetLIstVisible=true;
|
|
|
}
|
|
|
|
|
|
// that.getNodeData();
|
...
|
...
|
@@ -263,29 +336,51 @@ export default { |
|
|
},
|
|
|
//获取配置链接节点数据
|
|
|
getNodeData(){
|
|
|
if(this.networkMonitorList.length==0){
|
|
|
this.addSetLIstVisible=true;
|
|
|
/*this.nodeData=[
|
|
|
{
|
|
|
name:'节点1',
|
|
|
img:'123'
|
|
|
},
|
|
|
{
|
|
|
name:'节点2',
|
|
|
img:'123'
|
|
|
let that=this;
|
|
|
// if(this.networkMonitorList.length>0){
|
|
|
// this.addSetLIstVisible=true;
|
|
|
this.$http.get('/api-web/fault/conf/netNode/'+this.linkId,{},function (res){
|
|
|
if(res && res.data){
|
|
|
let resData=res.data.reverse();
|
|
|
resData.map((item,index)=>{
|
|
|
that.iconArr.map((v,i)=>{
|
|
|
if(item.resType==v.resType){
|
|
|
item.path=v.path;
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
let arr=[];
|
|
|
for(let i=0;i<resData.length;i+=2){
|
|
|
arr.push(resData.slice(i,i+2))
|
|
|
}
|
|
|
console.log("有节点",arr,arr.length)
|
|
|
that.nodeData=arr;
|
|
|
console.log('nodedata',that.nodeData,that.nodeData.length)
|
|
|
if(that.nodeData.length>0){
|
|
|
that.addSetLIstVisible=false;
|
|
|
that.nodeData.push([{nodeName:'',id:''}])
|
|
|
|
|
|
}else{
|
|
|
that.addSetLIstVisible=true;
|
|
|
}
|
|
|
}
|
|
|
]*/
|
|
|
}
|
|
|
})
|
|
|
|
|
|
// }else{
|
|
|
// this.addSetLIstVisible=true;
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
if(this.nodeData.length>1){
|
|
|
this.addSetLIstVisible=false;
|
|
|
this.isClickNet=0;
|
|
|
}
|
|
|
this.nodeData.push({name:'',img:''})
|
|
|
},
|
|
|
//点击添加节点
|
|
|
addTableList(){
|
|
|
//点击进入添加节点页面
|
|
|
addTableList(flag){
|
|
|
this.flag=flag;
|
|
|
this.tableVisible=true;
|
|
|
if(flag){
|
|
|
this.addSetLIstVisible=false;
|
|
|
|
|
|
}
|
|
|
this.titleName='添加内容';
|
|
|
this.init();
|
|
|
this.getNodeList();
|
...
|
...
|
@@ -324,19 +419,34 @@ export default { |
|
|
resId: this.resTypeArr,
|
|
|
kpiId: this.kpiTypeArr,
|
|
|
busId: this.busTypeArr.join(','),
|
|
|
page: 1,
|
|
|
page: 0,
|
|
|
pageSize: 5
|
|
|
}
|
|
|
},
|
|
|
//关闭弹框
|
|
|
closeDialog(){
|
|
|
this.$emit('callback', '111');
|
|
|
this.$emit('callback', this.networkMonitorList);
|
|
|
},
|
|
|
|
|
|
|
|
|
//获取所有的图标
|
|
|
getAllIcon(){
|
|
|
let that=this;
|
|
|
let iconArrAll=[]
|
|
|
this.$http.get(`/api-web/topoIcon/getAll`, {}, function (res) {
|
|
|
if (res && res.data) {
|
|
|
iconArrAll=res.data;
|
|
|
iconArrAll.map((item,index)=>{
|
|
|
that.iconArr.push({path:item.path,resType:item.resTypeCode})
|
|
|
})
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
},
|
|
|
mounted () {
|
|
|
this.getAllIcon();
|
|
|
this.setBizId();
|
|
|
this.getNetLinkList();
|
|
|
// this.getNodeData();
|
...
|
...
|
|