Authored by 王涛

Merge branch 'master-v32-lushangqing' into 'master'

故障诊断 网络监测接口联调,应用监测接口联调



See merge request !208
... ... @@ -8,12 +8,12 @@
<el-col :span="24">
<div class="flex-div-start margin-top-bottom-10">
<el-select class="margin-right-10" v-model="busTypeArr" multiple filterable clearable collapse-tags placeholder="请选择业务">
<!-- <el-select class="margin-right-10" v-model="busTypeArr" filterable clearable collapse-tags placeholder="请选择业务">
<el-option
v-for="item in busTypeList"
:label="item.busTypeName" :value="item.busId"></el-option>
</el-select>
-->
<!-- <el-dropdown class="margin-right-10">
<cm-res-type-tree-input multiple clearable collapseTags @callback="getResType"/>
</el-dropdown>
... ...
... ... @@ -2,6 +2,7 @@ export default {
name: 'applicationMoni',
template: '',
components: {},
props:['propsData'],
data () {
return {
titleName:'添加内容',
... ... @@ -14,13 +15,19 @@ export default {
align: 'center',
},
{
prop: 'resTypeName',
prop: 'url',
label: 'url',
sortable: true,
align: 'center',
},
{
prop: 'streamId',
label: '链路id',
sortable: true,
align: 'center',
},
{
prop: 'resName',
prop: 'streamName',
label: '链路名称',
sortable: true,
align: 'center',
... ... @@ -29,7 +36,7 @@ export default {
}
},
computed: {},
setup(){
setup(props){
const {proxy} = Vue.getCurrentInstance();
let id = proxy.$global.getQueryVariable('configId') ;
let config = Vue.ref(id == false ? null : id);
... ... @@ -38,10 +45,12 @@ export default {
let resTypeArr = Vue.ref([]);
let kpiTypeArr = Vue.ref([]);
let busTypeArr = Vue.ref([]);
let bizId=Vue.ref();//所属业务id
let keyWords= Vue.ref('');
let resTypeList = Vue.ref([]);
let kpiList = Vue.ref([]);
let busTypeList = Vue.ref([]);
let networkMonitorList=Vue.ref([]);
let init = () =>{
proxy.$http.get("/api-web/manage/kpi/list", {}, function(res) {
if (res && res.data) {
... ... @@ -65,7 +74,43 @@ export default {
let onBtnSearch = () => {
proxy.loadTableDataList();
}
//获取接收到的传值 bizid
let setBizId=()=>{
if(props.propsData){
proxy.bizId=props.propsData.bizId;
proxy.targetId=props.propsData.targetId;
proxy.busTypeArr=[props.propsData.bizId];
}
console.log("*",props.propsData,proxy.bizId,proxy.busTypeArr)
}
//添加应用
let addRes=(row,index)=>{
let params={
}
proxy.$http.post('/api-web/fault/conf/npm/batchAddNpm',[row],function (res){
if(res){
proxy.$global.showMsg('添加成功','success');
proxy.applicationMonitorVisible=false;
if(res.object){
proxy.targetId=res.object.targetId
}
proxy.getAppList();
}
})
}
return {
networkMonitorList,
setBizId,
addRes,
// getAppList,
config,
count,
tableDataList,
... ... @@ -76,6 +121,7 @@ export default {
kpiTypeArr,
busTypeArr,
resTypeList,
bizId,
init,
onReset,
onBtnSearch
... ... @@ -97,10 +143,10 @@ export default {
loadTableDataList(){
this.getNodeList()
},
//获取配置节点列表数据
//获取应用监测配置列表数据
getNodeList(){
let that=this;
this.$http.get(`/api-web/ContrastAnalysis/notAdded`, this.getParams(), function (res) {
this.$http.get(`/api-web/fault/conf/npmBase/list`, this.getParams(), function (res) {
if (res && res.success) {
that.count = res.count;
that.tableDataList = res.data;
... ... @@ -113,7 +159,8 @@ export default {
keyWords: this.keyWords,
resType: this.resTypeArr.join(','),
kpiId: this.kpiTypeArr.join(','),
busId: this.busTypeArr.join(','),
// busId: this.busTypeArr.join(','),
bizId: this.bizId,
configId: this.config,
page: 1,
limit: 5
... ... @@ -121,13 +168,14 @@ export default {
},
//关闭弹框
closeDialog(){
this.$emit('callbackApp', '1应用');
this.$emit('callbackApp', this.targetId);
}
},
mounted () {
this.init();
// this.init();
this.setBizId();
this.getNodeList();
},
unmounted () {}
... ...
... ... @@ -2,7 +2,7 @@
<!--搜索输入框部分-->
<div class="margin-30">
<el-row>
<el-col :span="6">
<el-col :span="6" class="flex-div-start">
<div class="grid-content bg-purple">
<span class="fault-book-input-text">所属业务</span>
<!-- <el-input v-model="input" placeholder="Please input 1" class="fault-book-input"/>-->
... ... @@ -16,7 +16,7 @@
<el-col :span="6">
<div class="grid-content bg-purple">
<span class="fault-book-input-text">名称</span>
<el-input v-model="input" placeholder="Please input 2" class="fault-book-input"/>
<el-input v-model="name" placeholder="请输入名称" class="fault-book-input"/>
</div>
</el-col>
</el-row>
... ... @@ -155,8 +155,8 @@
<div class="context-multiple-choice flex-div-start margin-30">
<div v-for="(item, index) in networkMonitorList" :key="index">
<div>
<el-button class="multiple-choice-button" type="primary">{{item.title}}</el-button>
<img :id="item.id" @click="deleteItem(item.id, networkMonitorList)" src="./src/assets/images/faultDiagnosis/icon-item-delete.png" class="multiple-choice-icon">
<el-button class="multiple-choice-button" type="primary">{{item.linkName}}</el-button>
<img :id="item.id" @click="deleteItem(item.id, networkMonitorList)" src="./src/assets/images/faultDiagnosis/icon-item-delete.png" class="multiple-choice-icon cursorClass">
</div>
</div>
<div class=" flex-div">
... ... @@ -389,7 +389,7 @@
<!--取消和保存-->
<div class="btn-faultDiagnosis">
<el-button>取消</el-button>
<el-button type="primary">保存</el-button>
<el-button @click="saveConfigDetail" type="primary">保存</el-button>
</div>
... ... @@ -397,13 +397,13 @@
<!--网络检测弹窗-->
<DiagnosisNet v-if="networkMonitorVisible" :propsData="propsData" @callback="getNetworkMonitorList" ></DiagnosisNet>
<!--应用监测弹框-->
<ApplicationMoni v-if="applicationMonitorVisible" @callbackApp="getApplicationMoniList"></ApplicationMoni>
<ApplicationMoni v-if="applicationMonitorVisible" :propsData="propsData" @callbackApp="getApplicationMoniList"></ApplicationMoni>
<!--APM弹框-->
<APM v-if="APMVisible" @callbackAPM="getAPMList"></APM>
<APM v-if="APMVisible" :propsData="propsData" @callbackAPM="getAPMList"></APM>
<!--日志监测弹框-->
<LogMonition v-if="logMonitionVisible" @callbackLog="getLogMonitionList"></LogMonition>
<LogMonition v-if="logMonitionVisible" :propsData="propsData" @callbackLog="getLogMonitionList"></LogMonition>
<!--订阅人员弹框-->
<SubscriptionReport v-if="subscriptionReportVisible" @callbackSub="getSubscriptionReportList"></SubscriptionReport>
<SubscriptionReport v-if="subscriptionReportVisible" :propsData="propsData" @callbackSub="getSubscriptionReportList"></SubscriptionReport>
</div>
... ...
... ... @@ -141,17 +141,29 @@ export default {
let busTypeArr = props.detailData?props.detailData.bizId:Vue.ref();
//诊断文档id
let docId= props.detailData?props.detailData.id:Vue.ref();
//faultConfId 故障配置id
let faultConfId=props.detailData?props.detailData.faultConfId:Vue.ref();
//模块id--网络监测,应用监测...
let targetId=Vue.ref();
let propsData=Vue.ref();//向子组件传值所属业务id
//配置详情数据
let configData=Vue.ref();
//模块类型 诊断类型 netlink网络监测,npm应用监测,base基础环境,apm APM
let type=Vue.ref();
//状态是否启用 0禁用 1启用
let state=Vue.ref(0);
//故障名称
let name=Vue.ref();
return{
busTypeArr,
propsData,
docId,
targetId,
configData
configData,
type,
state,
faultConfId,
name
}
},
computed: {},
... ... @@ -178,42 +190,58 @@ export default {
this.hiddenAll();
this.faultDefinitionHide = true;
this.isActiveIndex=index;
this.type='';
},
//打开网络监测卡片
clickNetworkMonitorFunc(index){
this.hiddenAll();
this.networkMonitorHide = true;
this.isActiveIndex=index;
this.type='netlink';
this.state=this.faultStateRadio;
// if(this.targetId){
this.getNetLinkList();
// }
},
//打开应用监测卡片
applicationMonitorFunc(index){
this.hiddenAll();
this.applicationMonitorHide = true;
this.isActiveIndex=index;
this.type='npm';
this.state=this.faultApplicationRadio;
},
//打开基础环境卡片
basicEnvironmentFunc(index){
this.hiddenAll();
this.basicEnvironmentHide = true;
this.isActiveIndex=index;
this.type='base';
this.state=this.faultEnvironmentRadio;
},
//APM
apmMonitorFunc(index){
this.hiddenAll();
this.apmMonitorHide = true;
this.isActiveIndex=index;
this.type='apm';
this.state=this.faultAPMRadio;
},
//日志检测
logDetectionFunc(index){
this.hiddenAll();
this.logDetectionHide = true;
this.isActiveIndex=index;
this.type='log';
this.state=this.faultLogRadio;
},
//报告订阅
subscriptionReportFunc(index){
this.hiddenAll();
this.subscriptionReportHide = true;
this.isActiveIndex=index;
this.type='report';
},
//遍历集合,动态增加集合内item
showItemList(){
... ... @@ -236,7 +264,7 @@ export default {
this.networkMonitorList = newList;
break;
case "applicationMonitor":
//网络检测
//应用检测
this.applicationMonitorList = newList;
break;
case "apmMonitor":
... ... @@ -260,16 +288,46 @@ export default {
}
},
//匹配展示弹框
switchModelDialog(typeVal){
switch (typeVal) {
case "netlink":
//网络检测
this.networkMonitorVisible = true;
break;
case "npm":
//应用检测
this.applicationMonitorVisible=true;
break;
case "base":
//基础环境
break;
case "apm":
//APM
this.APMVisible=true;
break;
case "log":
//日志检测
this.logMonitionVisible=true;
break;
case "report":
//订阅人员
this.subscriptionReportVisible=true;
break;
//点击添加网络监测,type==npm
addNetNode(){
}
},
//给弹框传值分类型
postPropsData(typeVal){
let that=this;
if(this.busTypeArr){
this.networkMonitorVisible = true;
console.log("this.busTypeArr",this.busTypeArr,this.configData)
this.switchModelDialog(typeVal)
if(this.configData){
this.configData.map((item,index)=>{
if(item.type=='npm'){
if(item.type==typeVal){
that.targetId=item.targetId;
}
})
... ... @@ -283,28 +341,54 @@ export default {
}else{
this.$global.showMsg('请选择所属业务','warning')
}
},
//点击添加网络监测,type==netlink
addNetNode(){
this.postPropsData('netlink')
},
//关闭网络测试添加配置节点弹框
getNetworkMonitorList(itemData){
console.log("itemdata",itemData)
this.networkMonitorVisible=false;
// this.networkMonitorList=itemData;
this.networkMonitorList=itemData;
},
//点击添加应用检测
addApplicationMonitor(){
this.applicationMonitorVisible=true;
this.postPropsData('npm')
},
//关闭应用监测添加弹框
getApplicationMoniList(itemData){
this.applicationMonitorVisible=false;
this.targetId=itemData;
// this.applicationMonitorList=itemData;
this.getAppList();
},
//获取应用列表数据--待测
getAppList(){
let params={
targetId:this.targetId,
bizId:this.bizId
}
this.$http.get('/api-web/fault/conf/npm/npmLis',params,function (res){
if(res && res.data){
this.networkMonitorList=res.data;
}
})
},
//点击添加APM弹框
addAPM(){
this.APMVisible=true;
// this.APMVisible=true;
this.postPropsData('apm')
},
//关闭APM弹框
getAPMList(itemData){
... ... @@ -313,7 +397,8 @@ export default {
},
//点击添加日志监测弹框
addLogMonitor(){
this.logMonitionVisible=true;
this.postPropsData('log')
},
//关闭日志监测弹框
getLogMonitionList(itemData){
... ... @@ -322,7 +407,8 @@ export default {
},
//点击添加订阅人员报告弹框
addSubscriptionReport(){
this.subscriptionReportVisible=true;
this.postPropsData('report')
},
//关闭订阅人员报告弹框
getSubscriptionReportList(itemData){
... ... @@ -347,6 +433,73 @@ export default {
})
}
},
//保存模块类型
saveConfigDetail(){
let that=this;
let params={
type:this.type,
state:this.state,
faultConfId:this.faultConfId,
name:this.name,
createBy:localStorage.getItem("lgn")
}
this.$http.post('/api-web/fault/conf/detail/saveConfigDetail',params,function (res){
if(res && res.success){
that.targetId=res.str;
that.$global.showMsg('保存成功','success')
that.switchModel();
}else{
that.$global.showMsg('保存失败','warning')
}
})
},
//判断当前在哪个模块下
switchModel(){
switch (this.type) {
case "netlink":
//网络检测
this.getNetLinkList();
break;
case "npm":
//应用检测
break;
case "base":
//基础环境
break;
case "apm":
//APM
break;
case "log":
//日志检测
break;
case "report":
//订阅人员
break;
}
},
//获取网络监测链路信息列表
getNetLinkList(){
let that=this;
let params={
targetId:this.targetId
}
this.$http.get('/api-web/fault/conf/netLink/getNetLinkList',params,function (res){
if(res && res.data){
that.networkMonitorList=res.data;
}
})
}
... ...
... ... @@ -10,7 +10,7 @@
<div @click="clickList(item,index)" :class="['list-net',{'isActive':index==isClickNet}]" v-for="(item, index) in networkMonitorList" :key="index">
<div class="flex-div-center ">
<div class="multiple-choice-button">{{item.linkName}}</div>
<img v-show="index==isClickNet" class="img-delete" src="./src/assets/images/faultDiagnosis/icon-item-delete.png" alt="">
<img v-show="index==isClickNet" @click="deleteNetLink(item,index)" class="img-delete" src="./src/assets/images/faultDiagnosis/icon-item-delete.png" alt="">
</div>
</div>
<div class="list-net">
... ... @@ -30,37 +30,79 @@
<img src="./src/assets/images/faultDiagnosis/icon-popup-right-delete.png">
</div>
</div>
<el-row v-if="!addSetLIstVisible" class="flex-div-start" style="margin: 20px 0 10px 4%;" >
<span>配置链路名称</span>
<el-input style="flex:1;margin-left:10px;" class="margin-right-10" v-model="linkName" placeholder="输入链路名称" />
</el-row>
<div class="context-body">
<el-row v-if="!addSetLIstVisible">
<el-col :span="4" v-for="(item,index) in nodeData">
<el-col :span="4" v-for="(itemNode,index) in nodeData">
<div class="list-step flex-div-start">
<div class="list-step-top flex-div">
<div @click="addTableList" :class="['step-img',{'isActive':item.name}]">
<i v-if="item.name" class="icon-delete-right" @click.stop="deleteNode(item,index)"></i>
<i class="icon-step"></i>
</div>
<!-- <span :class="['list-line',{'isActive':item.name && index<nodeData.length}]"></span>-->
<span :class="['list-line',{'isActive':index<nodeData.length}]"></span>
<el-tooltip
class="item"
effect="dark"
placement="bottom"
>
<template #content >
<ul v-if="itemNode[0].nodeName">
<li><span>资源名称:</span>{{itemNode[0].resName}}</li>
<li><span>指标名称:</span>{{itemNode[0].kpiName}}</li>
<li><span>标识名称:</span>{{itemNode[0].name}}</li>
</ul>
<ul v-if="!itemNode[0].nodeName">
<li>添加节点</li>
</ul>
</template>
<div @click="addTableList(true)" :class="['step-img',{'isActive':itemNode[0].nodeName}]">
<i v-if="itemNode[0].nodeName" class="icon-delete-right" @click.stop="deleteNode(item,index)"></i>
<i class="icon-step"><img :src="'/src/style/img/restypeimg/'+itemNode[0].path" alt=""></i>
</div>
</el-tooltip>
<!-- <span :class="['list-line',{'isActive':item.nodeName && index<nodeData.length}]"></span>-->
<span @click="addTableList(false)" v-if="index+1<nodeData.length && itemNode.length<=1" :class="['list-line','cursorClass',{'isActive':itemNode.length>1}]"></span>
<el-tooltip
class="item"
effect="dark"
placement="bottom"
v-if="itemNode.length>1"
>
<template #content>
<ul >
<li><span>资源名称:</span>{{itemNode[1].resName}}</li>
<li><span>指标名称:</span>{{itemNode[1].kpiName}}</li>
<li><span>标识名称:</span>{{itemNode[1].name}}</li>
</ul>
</template>
<span @click="addTableList(false)" v-if="index+1<nodeData.length" :class="['list-line','cursorClass',{'isActive':itemNode.length>1}]"></span>
</el-tooltip>
</div>
<div v-show="item.name" class="list-step-name">
{{item.name}}
<div v-show="itemNode[0].nodeName" class="list-step-name">
{{itemNode[0].nodeName}}
</div>
<div v-show="!item.name" class="list-step-name">
<div v-show="!itemNode[0].nodeName" class="list-step-name">
点击添加
</div>
</div>
</el-col>
</el-row>
<el-row>
<div class="flex-div" v-if="addSetLIstVisible">
<img class="cursorClass" @click="addTableList" src="/vue3/src/assets/images/faultDiagnosis/icon-add-node.png" alt="">
<el-row v-if="addSetLIstVisible">
<div class="flex-div">
<img class="cursorClass" @click="addTableList(true)" src="/vue3/src/assets/images/faultDiagnosis/icon-add-node.png" alt="">
</div>
</el-row>
<div v-if="!addSetLIstVisible" class="margin-top flex-center position-bottom">
<el-button @click="saveLinkAndNodeInfo" type="primary">保存</el-button>
</div>
</div>
</div>
</div>
</el-col>
</el-row>
... ... @@ -103,9 +145,9 @@
</div>
</el-col>
</el-row>
<el-row class="flex-div-start" style="margin-bottom: 10px;margin-top: 10px;padding-top:10px;border-top:1px solid #ebeef5" >
<span>配置链路名称</span>
<el-input style="flex:1;margin-left:10px;" class="margin-right-10" v-model="linkName" placeholder="输入链路名称" />
<el-row v-if="flag" class="flex-div-start" style="margin-bottom: 10px;margin-top: 10px;padding-top:10px;border-top:1px solid #ebeef5" >
<span>节点名称</span>
<el-input style="flex:1;margin-left:10px;" class="margin-right-10" v-model="nodeName" placeholder="输入节点名称" />
</el-row>
<el-row class="margin-bottom-50">
<el-col :span="24">
... ... @@ -133,6 +175,6 @@
</el-row>
<div v-if="tableVisible" class="margin-top flex-center position-bottom">
<el-button @click="cancleList">取消</el-button>
<el-button @click="saveList" type="primary">保存</el-button>
<!-- <el-button @click="saveList" type="primary">保存</el-button>-->
</div>
</el-dialog>
... ...
... ... @@ -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();
... ...