Authored by 王涛

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

故障联调 基础环境数据回显



See merge request !282
... ... @@ -245,7 +245,6 @@ export default {
//获取应用监测配置列表数据
let getNodeList=()=>{
let that=this;
proxy.$http.get(`/api-web/fault/conf/npmBase/list`, proxy.getParams(), function (res) {
if (res && res.success) {
proxy.count = res.count;
... ...
... ... @@ -2,7 +2,7 @@ export default {
name: 'basicEnvironment',
template: '',
components: {},
props:['propsData','isBaseDetail'],
props:['propsData'],
data () {
return {
columns:[
... ... @@ -109,9 +109,7 @@ export default {
}
// 监听编辑状态
Vue.watch(() => [props.propsData.bizId,props.isBaseDetail], ([newValue,newValueDetail], [oldValue,oldValueDetail]) => {
console.log('newValueDetail',newValueDetail)
proxy.isDetail=newValueDetail;
Vue.watch(() => props.propsData.bizId, (newValue,oldValue) => {
proxy.bizId=newValue;
proxy.resTypeArr='';
proxy.setBizId();
... ... @@ -148,6 +146,7 @@ export default {
proxy.count = res.count;
proxy.tableDataList=res.data;
proxy.$emit('baseCount',proxy.count);
proxy.$emit('callbackBaseList',proxy.tableDataList);
}
})
... ... @@ -155,7 +154,6 @@ export default {
}
return {
getEnvironmentData,
loadTableDataList,
page,
... ...
... ... @@ -38,7 +38,7 @@
</el-row>
<el-row class="margin-bottom-50">
<el-col :span="24" class="overflow-scroll-y">
<cm-table-page v-if="tableDataList" :columns="columns" :dataList="tableDataList" @loaddata="loadTableDataList"
<cm-table-page v-if="tableDataList" :columns="columns" :dataList="tableDataList" @loaddata="loadTableDataList" :multipleSelection="baseListChecked"
:showIndex="true" :total="count" :showSelection="true" @selectionChange="selectionChange"
:showBorder="true" :loading="false" :pageSize="pageSize"
:showPage="true" :showTools="true" :height="(height - 500)">
... ... @@ -50,7 +50,7 @@
</div>
</template>-->
<template #tools="{scope}">
<el-button type="text" size="small" @click.prevent="addRes(scope.row,scope.$index)">
<el-button v-if="!isLoading" type="text" size="small" @click.prevent="addRes(scope.row,scope.$index)">
<i class="el-icon-plus"/> 添加
</el-button>
</template>
... ...
... ... @@ -2,7 +2,7 @@ export default {
name: 'basicEnvironmentAdd',
template: '',
components: {},
props:['propsData','isDisplay'],
props:['propsData','baseList','isDisplay','baseCount'],
data () {
return {
columns:[
... ... @@ -72,6 +72,29 @@ export default {
let name=Vue.ref();
let baseVisible=Vue.ref(false);
let isLoading=Vue.ref(false);
//显示已添加过的环境列表数据
let baseListChecked=Vue.ref([]);
let setListData=()=>{
if(props.baseList){
props.baseList.map((item,index)=>{
proxy.tableDataList.map(v=>{
if(item.id==v.id){
proxy.baseListChecked.push(v)
}
})
})
console.log("baseListChecked",proxy.baseListChecked)
}
console.log("hahahah",props.baseCount,proxy.count)
if(props.baseCount==proxy.count){
proxy.isLoading=true;
}else{
proxy.isLoading=false;
}
}
// 监听编辑状态
Vue.watch(()=>props.isDisplay,(newValue, oldValue)=>{
... ... @@ -153,6 +176,7 @@ export default {
if(res && res.data){
proxy.count = res.count;
proxy.tableDataList=res.data;
proxy.setListData();
// proxy.$emit('baseCount',proxy.count);
}
})
... ... @@ -268,6 +292,9 @@ export default {
}
proxy.isLoading=false;
},function (err){
proxy.isLoading=false;
})
}
... ... @@ -279,9 +306,13 @@ export default {
faultConfId:proxy.faultConfId,
}
proxy.isLoading=false;
proxy.$emit('callbackBase',obj);
}
//
return {
setListData,
baseListChecked,
isLoading,
closeDialog,
addRes,
... ...
... ... @@ -244,7 +244,7 @@
</el-row>
<BasicEnvironment ref="basic" v-if="faultEnvironmentRadio==1" :isBaseDetail="isBaseDetail" :propsData="propsData" @baseCount="baseCount" @callbackDelete="deleteEnvironment"></BasicEnvironment>
<BasicEnvironment ref="basic" v-if="faultEnvironmentRadio==1" @callbackBaseList="callbackBaseList" :propsData="propsData" @baseCount="baseCount" @callbackDelete="deleteEnvironment"></BasicEnvironment>
<!-- <el-row>
<el-col :span="24">
... ... @@ -420,7 +420,7 @@
<!--应用检测弹框-->
<ApplicationMoni v-show="applicationMonitorVisible" :isDisplay="applicationMonitorVisible" :applicationMonitorList="applicationMonitorList" :propsData="propsData" @callbackApp="getApplicationMoniList"></ApplicationMoni>
<!--基础环境弹框-->
<BasicEnvironmentAdd v-show="baseVisible" :isDisplay="baseVisible" :propsData="propsData" @callbackBase="getBasicEnvironmentList"></BasicEnvironmentAdd>
<BasicEnvironmentAdd v-show="baseVisible" :isDisplay="baseVisible" :baseList="baseList" :baseCount="count" :propsData="propsData" @callbackBase="getBasicEnvironmentList"></BasicEnvironmentAdd>
<!--APM弹框-->
<APM v-show="APMVisible" :isDisplay="APMVisible" :apmMonitorList="apmMonitorList" :propsData="propsData" @callbackAPM="getAPMList"></APM>
<!--日志监测弹框-->
... ...
... ... @@ -190,10 +190,16 @@ export default {
let baseCount=(val)=>{
proxy.count=val;
}
//基础环境是否为编辑
let isBaseDetail=Vue.ref(false);
let baseList=Vue.ref([]);
//获取已添加的环境基础
let callbackBaseList=(val)=>{
proxy.baseList=val;
console.log("callbackBaseList",val,proxy.baseList)
}
return{
isBaseDetail,
baseList,
callbackBaseList,
count,
baseCount,
setDetail,
... ... @@ -881,7 +887,6 @@ export default {
break;
case "base":
//基础环境
this.isBaseDetail=true;
break;
case "apm":
... ...