Authored by 王涛

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

故障联调 update1215



See merge request !232
... ... @@ -276,7 +276,7 @@
align-items: flex-start;
}
.list-step-name{
margin-left: 10px;
/*margin-left: 10px;*/
margin-top: 10px;
color:#999999;
}
... ... @@ -303,6 +303,16 @@
width: 84px;
border-top:5px solid #cccccc;
}
.list-line-none{
display: inline-block;
width: 34px;
}
.width-100{
width:100px;
display: inline-block;
text-align: left;
}
.list-line.isActive{
border-top-color:#3B91FF;
}
... ...
... ... @@ -124,7 +124,17 @@ export default {
}
//添加所有数据
let saveAll=()=>{
let params={
busId:proxy.bizId
}
proxy.$http.post('/api-web/fault/conf/apm/saveOrUpdate',[params],function (res){
if(res && res.object){
proxy.$global.showMsg('添加成功','success');
proxy.targetId=res.src;
proxy.APMVisible=false;
}
})
}
//切换资源获取指标列表
let changeRes=(val)=>{
... ...
... ... @@ -30,7 +30,7 @@
<div class="flex-div-start">
<el-button type="primary" @click="onReset()">重置</el-button>
<el-button type="primary" @click="onBtnSearch()" style="margin-left: 10px">查询</el-button>
<el-button type="primary" @click="saveAll()" style="margin-left: 10px">全部添加</el-button>
<el-button type="primary" :disabled="isLoading" @click="saveAll()" style="margin-left: 10px">全部添加</el-button>
</div>
</div>
</el-col>
... ...
... ... @@ -52,6 +52,7 @@ export default {
let kpiList = Vue.ref([]);
let busTypeList = Vue.ref([]);
let networkMonitorList=Vue.ref([]);
let isLoading=Vue.ref(false);//按钮加载中
let init = () =>{
proxy.$http.get("/api-web/manage/kpi/list", {}, function(res) {
if (res && res.data) {
... ... @@ -106,10 +107,27 @@ export default {
}
//全部添加
let saveAll=()=>{
proxy.isLoading=true;
let params={
targetId:proxy.targetId,
npmList:[npmList]
}
proxy.$http.post('/api-web/fault/conf/npm/batchAddNpm',params,function (res){
if(res){
proxy.$global.showMsg('添加成功','success');
proxy.targetId=res.str
proxy.applicationMonitorVisible=false;
}
})
}
return {
isLoading,
saveAll,
networkMonitorList,
setBizId,
... ... @@ -167,7 +185,7 @@ export default {
bizId: this.bizId,
configId: this.config,
page: 1,
limit: 5
pageSize: 5
}
},
//关闭弹框
... ...
... ... @@ -38,13 +38,13 @@
:showIndex="true" :total="count"
:showBorder="true" :loading="false"
:showPage="true" :showTools="true" :height="(height - 500)">
<template #default="{row,prop,column}">
<!-- <template #default="{row,prop,column}">
<div v-if="prop == 'kpiName'" class="list-data">
<span class="list-data-text">{{row.kpiName }}</span>
<!-- <img :id="row.index" @click="deleteItem(row)" src="./src/assets/images/faultDiagnosis/icon-item-delete.png" class="img-delete cursorClass">-->
<img :id="row.index" @click="deleteItem(row)" src="./src/assets/images/faultDiagnosis/icon-item-delete.png" class="img-delete cursorClass">
</div>
</template>
</template>-->
<template #tools="{scope}">
<el-button type="text" size="small" @click.prevent="deleteItem(scope.row,scope.$index)">
删除
... ...
... ... @@ -19,7 +19,7 @@ export default {
align: 'center',
},
{
prop: 'ip',
prop: 'ipAddr',
label: 'ip地址',
sortable: true,
align: 'center',
... ... @@ -204,18 +204,20 @@ export default {
//删除表格指标
deleteItem(item){
let that=this;
let params={
id:item.id
this.$global.confirm("确认删除指标吗?", function () {
let params = {
id: item.id
}
this.$http.get('/api-web/fault/conf/base/deleteById',params,function (res){
if(res){
that.$http.get('/api-web/fault/conf/base/deleteById', params, function (res) {
if (res) {
that.$global.showMsg('删除成功');
that.getEnvironmentData();
}
that.$emit('callbackDelete',item)
that.$emit('callbackDelete', item)
})
})
},
//获取基础环境资源列表数据
... ...
... ... @@ -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="name" placeholder="请输入名称" class="fault-book-input"/>
<el-input v-model="name" placeholder="请输入名称" maxlength="50" class="fault-book-input"/>
</div>
</el-col>
</el-row>
... ... @@ -30,7 +30,7 @@
<el-card :class="['fault-book-title-card-text',{'isActive':isActiveIndex==1}]" @click="clickDaultDefinitionFunc(1)" shadow="hover"><span class="card-name">故障定义</span></el-card>
</el-col>
<el-col :span="3">
<el-card :class="['fault-book-title-card-text',{'isActive':isActiveIndex==2}]" @click="clickNetworkMonitorFunc(2)" shadow="hover"><span class="card-name">网络</span></el-card>
<el-card :class="['fault-book-title-card-text',{'isActive':isActiveIndex==2}]" @click="clickNetworkMonitorFunc(2)" shadow="hover"><span class="card-name">网络</span></el-card>
</el-col>
<el-col :span="3">
<el-card :class="['fault-book-title-card-text',{'isActive':isActiveIndex==3}]" @click="applicationMonitorFunc(3)" shadow="hover"><span class="card-name">应用检测</span></el-card>
... ...
... ... @@ -130,6 +130,7 @@ export default {
logMonitionVisible:false,//日志监测弹框
subscriptionReportVisible:false,//订阅人员弹框
bizName:'',//业务名称
ruleData:[],//故障规则定义数据
}
},
setup(props){
... ... @@ -199,7 +200,16 @@ export default {
{type:'log',targetId:''},
{type:'report',targetId:''},
]
//规则名字
let ruleName=Vue.ref('产生告警时触发');
//故障规则id
let ruleId=Vue.ref();
//模块id
let modleId=Vue.ref();
return{
modleId,
ruleId,
ruleName,
isLoading,
modelData,
faultDefinitionRadio,
... ... @@ -256,6 +266,11 @@ export default {
if(!this.isSaveModel()){
return;
}
this.configData.map(item=>{
if(item.type=='netlink'){
this.modleId=item.id;
}
})
this.hiddenAll();
this.networkMonitorHide = true;
this.isActiveIndex=index;
... ... @@ -271,6 +286,11 @@ export default {
if(!this.isSaveModel()){
return;
}
this.configData.map(item=>{
if(item.type=='npm'){
this.modleId=item.id;
}
})
this.hiddenAll();
this.applicationMonitorHide = true;
this.isActiveIndex=index;
... ... @@ -285,6 +305,11 @@ export default {
if(!this.isSaveModel()){
return;
}
this.configData.map(item=>{
if(item.type=='base'){
this.modleId=item.id;
}
})
this.postPropsData('base',index);
/*if(this.busTypeArr){
this.hiddenAll();
... ... @@ -302,6 +327,11 @@ export default {
if(!this.isSaveModel()){
return;
}
this.configData.map(item=>{
if(item.type=='apm'){
this.modleId=item.id;
}
})
this.hiddenAll();
this.apmMonitorHide = true;
this.isActiveIndex=index;
... ... @@ -315,6 +345,11 @@ export default {
if(!this.isSaveModel()){
return;
}
this.configData.map(item=>{
if(item.type=='log'){
this.modleId=item.id;
}
})
this.$global.showMsg('敬请期待...','warning');
return;
this.hiddenAll();
... ... @@ -330,6 +365,11 @@ export default {
if(!this.isSaveModel()){
return;
}
this.configData.map(item=>{
if(item.type=='report'){
this.modleId=item.id;
}
})
this.$global.showMsg('敬请期待...','warning');
return;
this.hiddenAll();
... ... @@ -632,6 +672,26 @@ export default {
}
},
//获取故障规则定义的详情
getRuleDetail(){
let that=this;
let params={}
this.$http.get('/api-web/fault/conf/rule/'+this.docId,params,function (res){
if(res && res.data){
that.ruleData=res.data;
if(that.ruleData.length>0){
that.kpiId=that.ruleData[0].kpiId;
that.triggerValue=that.ruleData[0].triggerValue;
that.ruleId=that.ruleData[0].id;
}
}
})
},
//保存模块类型
saveConfigDetail(){
if(!this.busTypeArr){
... ... @@ -698,6 +758,7 @@ export default {
type:this.type,
targetId:this.targetId,
state:this.state,
id:this.modleId,
faultConfig:{
id:this.faultConfId,
name:this.name,
... ... @@ -804,6 +865,8 @@ export default {
type:'alarm',
triggerValue: this.triggerValue,
kpiId: this.kpiId,
name:this.ruleName,
id:this.ruleId,
faultConfig: {
id: this.faultConfId,
... ... @@ -834,14 +897,14 @@ export default {
let that=this;
this.getTargetId('base')
let params={
targetId:this.targetId,
bizId:this.busTypeArr
// targetId:this.targetId,
busId:this.busTypeArr
}
this.$http.post('/api-web/fault/conf/base/saveOrUpdate',params,function (res){
if(res && res.success){
that.targetId=res.object.targetId;
that.targetId=res.str;
that.setTargetId(that.targetId)
// that.$global.showMsg('保存成功')
that.$global.showMsg('保存成功')
// that.alarmList=res.data;
that.saveConfigDetailOther();
}else{
... ... @@ -859,7 +922,7 @@ export default {
let params={
id:item.id,
}
this.$http.get('/api-web/fault/conf/netLink/deleteNetLinkAndNodeById',params,function (res){
that.$http.get('/api-web/fault/conf/netLink/deleteNetLinkAndNodeById',params,function (res){
if(res){
that.$global.showMsg("删除成功!");
that.getNetLinkList();
... ... @@ -961,6 +1024,7 @@ export default {
this.init()
this.getQueryKpiInfo();
this.getDetailByid();
this.getRuleDetail();
},
unmounted () {}
... ...
... ... @@ -2,8 +2,8 @@
<el-row>
<el-col :span="6">
<div class="search-input margin-30 flex-div-start">
<el-input v-model="input" placeholder="故障诊断" class="fault-book-input-text" />
<span class="search-text" style="border-radius: 4px">搜索</span>
<el-input v-model="name" placeholder="故障诊断" class="fault-book-input-text" />
<span class="search-text" style="border-radius: 4px" @click="searchList">搜索</span>
</div>
</el-col>
... ...
... ... @@ -5,6 +5,7 @@ export default {
props:['diagnosisData'],
data () {
return {
name:'',
}
},
... ... @@ -25,6 +26,11 @@ export default {
componentName:'Diagnosis'
}
this.$emit('getItemDetail',params)
},
//搜索列表
searchList(){
this.$emit('searchList',this.name)
}
},
mounted () {
... ...
... ... @@ -9,7 +9,7 @@
</div>
<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>
<div class="multiple-choice-button text-overflow" :title="item.linkName">{{item.linkName}}</div>
<img v-show="index==isClickNet" @click="deleteNetLink(item,index)" class="img-delete" src="./src/assets/images/faultDiagnosis/icon-item-delete.png" alt="">
</div>
</div>
... ... @@ -81,11 +81,15 @@
<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="itemNode[0].nodeName" class="list-step-name">
<div v-show="itemNode[0].nodeName" class="list-step-name flex-div-start">
<span class="text-overflow width-100" :title="itemNode[0].nodeName">
{{itemNode[0].nodeName}}
</span>
<span class="list-line-none"></span>
</div>
<div v-show="!itemNode[0].nodeName" class="list-step-name">
点击添加
<div v-show="!itemNode[0].nodeName" class="list-step-name flex-div-start">
<span class="width-100">点击添加</span>
<span class="list-line-none"></span>
</div>
</div>
</el-col>
... ...
... ... @@ -330,7 +330,7 @@ export default {
let params={
id:item.id,
}
this.$http.get('/api-web/fault/conf/netLink/deleteNetLinkAndNodeById',params,function (res){
that.$http.get('/api-web/fault/conf/netLink/deleteNetLinkAndNodeById',params,function (res){
if(res){
that.$global.showMsg("删除成功!");
that.getNetLinkList();
... ... @@ -385,10 +385,14 @@ export default {
console.log("有节点",arr,arr.length)
that.nodeData=arr;
console.log('nodedata',that.nodeData,that.nodeData.length)
let length=that.nodeData.length;
if(that.nodeData.length>0){
that.addSetLIstVisible=false;
// if(that.nodeData[length-1].length>1){
that.nodeData.push([{nodeName:'',id:'',isAdd:true}])
// }
}else{
that.addSetLIstVisible=true;
}
... ...
<component :is="componentItem" :diagnosisData="diagnosisData" @backIndex="backIndexFun" @getItem="getItem" @getItemDetail="getItemDetail" :detailData="detailData" />
<component :is="componentItem" :diagnosisData="diagnosisData" @searchList="searchList" @backIndex="backIndexFun" @getItem="getItem" @getItemDetail="getItemDetail" :detailData="detailData" />
<!--<FaultAddIndex></FaultAddIndex>-->
\ No newline at end of file
... ...
... ... @@ -34,6 +34,8 @@ export default {
let diagnosisData=Vue.ref();
//选择的文档列表详情数据
let detailData=Vue.ref();
//搜索关键字
let name=Vue.ref();
// 挂载完
... ... @@ -46,7 +48,8 @@ export default {
const getListData=()=>{
let params={
page:1,
pageSize:10
pageSize:10,
name:proxy.name
}
proxy.$http.get('/api-web/fault/conf/page',params,function (res){
... ... @@ -62,6 +65,11 @@ export default {
})
}
//搜索列表
let searchList=(val)=>{
proxy.name=val;
proxy.getListData();
}
//新增故障
const getItem=(content)=>{
console.log("111",content)
... ... @@ -82,6 +90,8 @@ export default {
return {
name,
searchList,
allComponent,
componentItem,
count,
... ...