|
|
export default {
|
|
|
name: 'faultDiagnosis',
|
|
|
name: 'diagnosisNet',
|
|
|
template: '',
|
|
|
components: {},
|
|
|
// props:['networkMonitorList'],
|
|
|
props:['propsData'],
|
|
|
data () {
|
|
|
return {
|
|
|
titleName:'故障新增内容',
|
|
|
apiUrl1:'/api-web/fault/conf/netLink/saveLinkAndNodeInfo',//保存网络链路信息一节链路节点
|
|
|
apiUrl2:'/api-web/fault/conf/netLink/getNetLinkList',//根据targetId获取链路信息列表
|
|
|
tableVisible:false,//添加配置列表是否显示
|
|
|
networkMonitorVisible: true,
|
|
|
isClickNet:-1,//配置链接选择
|
...
|
...
|
@@ -36,12 +38,7 @@ export default { |
|
|
sortable: true,
|
|
|
align: 'center',
|
|
|
},
|
|
|
{
|
|
|
prop: 'resTypeName',
|
|
|
label: '资源类型',
|
|
|
sortable: true,
|
|
|
align: 'center',
|
|
|
},
|
|
|
|
|
|
{
|
|
|
prop: 'resName',
|
|
|
label: '资源名称',
|
...
|
...
|
@@ -49,12 +46,6 @@ export default { |
|
|
align: 'center',
|
|
|
},
|
|
|
{
|
|
|
prop: 'ip',
|
|
|
label: 'ip地址',
|
|
|
sortable: true,
|
|
|
align: 'center',
|
|
|
},
|
|
|
{
|
|
|
prop: 'kpiName',
|
|
|
label: '指标名称',
|
|
|
sortable: true,
|
...
|
...
|
@@ -65,53 +56,157 @@ export default { |
|
|
label: '指标标识',
|
|
|
sortable: true,
|
|
|
align: 'center',
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
prop: 'name',
|
|
|
label: '标识名称',
|
|
|
sortable: true,
|
|
|
align: 'center',
|
|
|
},
|
|
|
],
|
|
|
// tabSecondList:[],//节点配置列表数据
|
|
|
addSetLIstVisible:true,//无节点配置列表是的添加配置
|
|
|
}
|
|
|
},
|
|
|
computed: {},
|
|
|
setup(){
|
|
|
setup(props){
|
|
|
const {proxy} = Vue.getCurrentInstance();
|
|
|
let id = proxy.$global.getQueryVariable('configId') ;
|
|
|
let config = Vue.ref(id == false ? null : id);
|
|
|
let count=Vue.ref(0);
|
|
|
let tableDataList = Vue.ref([]);
|
|
|
let resTypeArr = Vue.ref([]);
|
|
|
let resTypeArr = Vue.ref();
|
|
|
let kpiTypeArr = Vue.ref([]);
|
|
|
// let busTypeArr = Vue.ref([]);
|
|
|
let targetId=Vue.ref();//所属模块id
|
|
|
let bizId=Vue.ref();//所属业务id
|
|
|
let busTypeArr = Vue.ref([]);
|
|
|
let keyWords= Vue.ref('');
|
|
|
let resTypeList = Vue.ref([]);
|
|
|
let kpiList = Vue.ref([]);
|
|
|
let busTypeList = Vue.ref([]);
|
|
|
//配置链路名称
|
|
|
let linkName=Vue.ref();
|
|
|
let init = () =>{
|
|
|
proxy.$http.get("/api-web/manage/kpi/list", {}, function(res) {
|
|
|
//根据业务id获取资源列表
|
|
|
let paramsRes={
|
|
|
busId:proxy.bizId
|
|
|
}
|
|
|
proxy.$http.get("/api-web/fault/conf/resource/getResourceByBusId", paramsRes, function(res) {
|
|
|
if (res && res.data) {
|
|
|
proxy.kpiList = res.data;
|
|
|
proxy.resTypeList = res.data;
|
|
|
}
|
|
|
})
|
|
|
proxy.getResData();
|
|
|
|
|
|
proxy.$http.get("/api-web/home/business/findAllBusType", {}, function(res) {
|
|
|
if (res && res.data) {
|
|
|
proxy.busTypeList = res.data;
|
|
|
}
|
|
|
})
|
|
|
|
|
|
}
|
|
|
let getResData=()=>{
|
|
|
//根据业务id获取指标列表
|
|
|
let paramsKpi={
|
|
|
resId:proxy.resTypeArr
|
|
|
}
|
|
|
proxy.$http.get("/api-web/fault/conf/kpi/getKpiByResId", paramsKpi, function(res) {
|
|
|
if (res && res.data) {
|
|
|
proxy.kpiList = res.data;
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
let changeRes=(val)=>{
|
|
|
proxy.getResData();
|
|
|
|
|
|
}
|
|
|
let onReset = () => {
|
|
|
proxy.keyWords = '';
|
|
|
proxy.resTypeArr = [];
|
|
|
proxy.kpiTypeArr = [];
|
|
|
proxy.resTypeArr = '';
|
|
|
proxy.kpiTypeArr = '';
|
|
|
proxy.busTypeArr = [];
|
|
|
}
|
|
|
// 点击按钮搜索
|
|
|
let onBtnSearch = () => {
|
|
|
proxy.loadTableDataList();
|
|
|
}
|
|
|
|
|
|
//获取链路信息列表
|
|
|
let getNetLinkList=()=>{
|
|
|
console.log("333",proxy.targetId)
|
|
|
let params={
|
|
|
targetId:proxy.targetId
|
|
|
|
|
|
}
|
|
|
proxy.$http.get(proxy.apiUrl2,params,function (res){
|
|
|
if(res){
|
|
|
proxy.networkMonitorList=res.data;
|
|
|
proxy.getNodeData();
|
|
|
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
//保存网络链路信息及链路节点
|
|
|
let saveLinkAndNodeInfo=(row)=>{
|
|
|
let params={
|
|
|
bNetLink:{
|
|
|
linkName:proxy.linkName,
|
|
|
bizId:proxy.bizId,
|
|
|
targetId:proxy.targetId,
|
|
|
},
|
|
|
bNetNodeList:[
|
|
|
row
|
|
|
]
|
|
|
|
|
|
}
|
|
|
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')
|
|
|
|
|
|
}else{
|
|
|
console.log("2*2")
|
|
|
proxy.saveLinkAndNodeInfo(row);
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
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)
|
|
|
|
|
|
}
|
|
|
|
|
|
return {
|
|
|
addRes,
|
|
|
setBizId,
|
|
|
saveLinkAndNodeInfo,
|
|
|
getNetLinkList,
|
|
|
bizId,
|
|
|
targetId,
|
|
|
config,
|
|
|
count,
|
|
|
tableDataList,
|
|
|
kpiList,
|
|
|
busTypeList,
|
|
|
keyWords,
|
|
|
resTypeArr,
|
|
|
kpiTypeArr,
|
...
|
...
|
@@ -119,7 +214,10 @@ export default { |
|
|
resTypeList,
|
|
|
init,
|
|
|
onReset,
|
|
|
onBtnSearch
|
|
|
onBtnSearch,
|
|
|
getResData,
|
|
|
changeRes,
|
|
|
linkName
|
|
|
}
|
|
|
|
|
|
},
|
...
|
...
|
@@ -165,16 +263,20 @@ export default { |
|
|
},
|
|
|
//获取配置链接节点数据
|
|
|
getNodeData(){
|
|
|
this.nodeData=[
|
|
|
{
|
|
|
name:'节点1',
|
|
|
img:'123'
|
|
|
},
|
|
|
{
|
|
|
name:'节点2',
|
|
|
img:'123'
|
|
|
}
|
|
|
]
|
|
|
if(this.networkMonitorList.length==0){
|
|
|
this.addSetLIstVisible=true;
|
|
|
/*this.nodeData=[
|
|
|
{
|
|
|
name:'节点1',
|
|
|
img:'123'
|
|
|
},
|
|
|
{
|
|
|
name:'节点2',
|
|
|
img:'123'
|
|
|
}
|
|
|
]*/
|
|
|
}
|
|
|
|
|
|
if(this.nodeData.length>1){
|
|
|
this.addSetLIstVisible=false;
|
|
|
this.isClickNet=0;
|
...
|
...
|
@@ -198,6 +300,7 @@ export default { |
|
|
saveList(){
|
|
|
this.tableVisible=false;
|
|
|
this.titleName='故障新增内容';
|
|
|
|
|
|
},
|
|
|
//重新加载表格数据
|
|
|
loadTableDataList(){
|
...
|
...
|
@@ -206,8 +309,10 @@ export default { |
|
|
//获取配置节点列表数据
|
|
|
getNodeList(){
|
|
|
let that=this;
|
|
|
this.$http.get(`/api-web/ContrastAnalysis/notAdded`, this.getParams(), function (res) {
|
|
|
if (res && res.success) {
|
|
|
|
|
|
// this.$http.get(`/api-web/ContrastAnalysis/notAdded`, this.getParams(), function (res) {
|
|
|
this.$http.get(`/api-web/fault/conf/netLink/queryLinkDataByBusId`, this.getParams(), function (res) {
|
|
|
if (res && res.data) {
|
|
|
that.count = res.count;
|
|
|
that.tableDataList = res.data;
|
|
|
}
|
...
|
...
|
@@ -216,24 +321,25 @@ export default { |
|
|
//配置参数
|
|
|
getParams(){
|
|
|
return {
|
|
|
keyWords: this.keyWords,
|
|
|
resType: this.resTypeArr.join(','),
|
|
|
kpiId: this.kpiTypeArr.join(','),
|
|
|
resId: this.resTypeArr,
|
|
|
kpiId: this.kpiTypeArr,
|
|
|
busId: this.busTypeArr.join(','),
|
|
|
configId: this.config,
|
|
|
page: 1,
|
|
|
limit: 5
|
|
|
pageSize: 5
|
|
|
}
|
|
|
},
|
|
|
//关闭弹框
|
|
|
closeDialog(){
|
|
|
this.$emit('callback', '111');
|
|
|
}
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
mounted () {
|
|
|
this.getNodeData();
|
|
|
this.setBizId();
|
|
|
this.getNetLinkList();
|
|
|
// this.getNodeData();
|
|
|
},
|
|
|
unmounted () {}
|
|
|
|
...
|
...
|
|