Authored by 王涛

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

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



See merge request !282
@@ -245,7 +245,6 @@ export default { @@ -245,7 +245,6 @@ export default {
245 245
246 //获取应用监测配置列表数据 246 //获取应用监测配置列表数据
247 let getNodeList=()=>{ 247 let getNodeList=()=>{
248 - let that=this;  
249 proxy.$http.get(`/api-web/fault/conf/npmBase/list`, proxy.getParams(), function (res) { 248 proxy.$http.get(`/api-web/fault/conf/npmBase/list`, proxy.getParams(), function (res) {
250 if (res && res.success) { 249 if (res && res.success) {
251 proxy.count = res.count; 250 proxy.count = res.count;
@@ -2,7 +2,7 @@ export default { @@ -2,7 +2,7 @@ export default {
2 name: 'basicEnvironment', 2 name: 'basicEnvironment',
3 template: '', 3 template: '',
4 components: {}, 4 components: {},
5 - props:['propsData','isBaseDetail'], 5 + props:['propsData'],
6 data () { 6 data () {
7 return { 7 return {
8 columns:[ 8 columns:[
@@ -109,9 +109,7 @@ export default { @@ -109,9 +109,7 @@ export default {
109 109
110 } 110 }
111 // 监听编辑状态 111 // 监听编辑状态
112 - Vue.watch(() => [props.propsData.bizId,props.isBaseDetail], ([newValue,newValueDetail], [oldValue,oldValueDetail]) => {  
113 - console.log('newValueDetail',newValueDetail)  
114 - proxy.isDetail=newValueDetail; 112 + Vue.watch(() => props.propsData.bizId, (newValue,oldValue) => {
115 proxy.bizId=newValue; 113 proxy.bizId=newValue;
116 proxy.resTypeArr=''; 114 proxy.resTypeArr='';
117 proxy.setBizId(); 115 proxy.setBizId();
@@ -148,6 +146,7 @@ export default { @@ -148,6 +146,7 @@ export default {
148 proxy.count = res.count; 146 proxy.count = res.count;
149 proxy.tableDataList=res.data; 147 proxy.tableDataList=res.data;
150 proxy.$emit('baseCount',proxy.count); 148 proxy.$emit('baseCount',proxy.count);
  149 + proxy.$emit('callbackBaseList',proxy.tableDataList);
151 } 150 }
152 }) 151 })
153 152
@@ -155,7 +154,6 @@ export default { @@ -155,7 +154,6 @@ export default {
155 } 154 }
156 155
157 return { 156 return {
158 -  
159 getEnvironmentData, 157 getEnvironmentData,
160 loadTableDataList, 158 loadTableDataList,
161 page, 159 page,
@@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
38 </el-row> 38 </el-row>
39 <el-row class="margin-bottom-50"> 39 <el-row class="margin-bottom-50">
40 <el-col :span="24" class="overflow-scroll-y"> 40 <el-col :span="24" class="overflow-scroll-y">
41 - <cm-table-page v-if="tableDataList" :columns="columns" :dataList="tableDataList" @loaddata="loadTableDataList" 41 + <cm-table-page v-if="tableDataList" :columns="columns" :dataList="tableDataList" @loaddata="loadTableDataList" :multipleSelection="baseListChecked"
42 :showIndex="true" :total="count" :showSelection="true" @selectionChange="selectionChange" 42 :showIndex="true" :total="count" :showSelection="true" @selectionChange="selectionChange"
43 :showBorder="true" :loading="false" :pageSize="pageSize" 43 :showBorder="true" :loading="false" :pageSize="pageSize"
44 :showPage="true" :showTools="true" :height="(height - 500)"> 44 :showPage="true" :showTools="true" :height="(height - 500)">
@@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
50 </div> 50 </div>
51 </template>--> 51 </template>-->
52 <template #tools="{scope}"> 52 <template #tools="{scope}">
53 - <el-button type="text" size="small" @click.prevent="addRes(scope.row,scope.$index)"> 53 + <el-button v-if="!isLoading" type="text" size="small" @click.prevent="addRes(scope.row,scope.$index)">
54 <i class="el-icon-plus"/> 添加 54 <i class="el-icon-plus"/> 添加
55 </el-button> 55 </el-button>
56 </template> 56 </template>
@@ -2,7 +2,7 @@ export default { @@ -2,7 +2,7 @@ export default {
2 name: 'basicEnvironmentAdd', 2 name: 'basicEnvironmentAdd',
3 template: '', 3 template: '',
4 components: {}, 4 components: {},
5 - props:['propsData','isDisplay'], 5 + props:['propsData','baseList','isDisplay','baseCount'],
6 data () { 6 data () {
7 return { 7 return {
8 columns:[ 8 columns:[
@@ -72,6 +72,29 @@ export default { @@ -72,6 +72,29 @@ export default {
72 let name=Vue.ref(); 72 let name=Vue.ref();
73 let baseVisible=Vue.ref(false); 73 let baseVisible=Vue.ref(false);
74 let isLoading=Vue.ref(false); 74 let isLoading=Vue.ref(false);
  75 + //显示已添加过的环境列表数据
  76 + let baseListChecked=Vue.ref([]);
  77 + let setListData=()=>{
  78 + if(props.baseList){
  79 + props.baseList.map((item,index)=>{
  80 + proxy.tableDataList.map(v=>{
  81 + if(item.id==v.id){
  82 + proxy.baseListChecked.push(v)
  83 +
  84 + }
  85 + })
  86 +
  87 + })
  88 + console.log("baseListChecked",proxy.baseListChecked)
  89 + }
  90 + console.log("hahahah",props.baseCount,proxy.count)
  91 + if(props.baseCount==proxy.count){
  92 + proxy.isLoading=true;
  93 + }else{
  94 + proxy.isLoading=false;
  95 + }
  96 +
  97 + }
75 98
76 // 监听编辑状态 99 // 监听编辑状态
77 Vue.watch(()=>props.isDisplay,(newValue, oldValue)=>{ 100 Vue.watch(()=>props.isDisplay,(newValue, oldValue)=>{
@@ -153,6 +176,7 @@ export default { @@ -153,6 +176,7 @@ export default {
153 if(res && res.data){ 176 if(res && res.data){
154 proxy.count = res.count; 177 proxy.count = res.count;
155 proxy.tableDataList=res.data; 178 proxy.tableDataList=res.data;
  179 + proxy.setListData();
156 // proxy.$emit('baseCount',proxy.count); 180 // proxy.$emit('baseCount',proxy.count);
157 } 181 }
158 }) 182 })
@@ -268,6 +292,9 @@ export default { @@ -268,6 +292,9 @@ export default {
268 } 292 }
269 proxy.isLoading=false; 293 proxy.isLoading=false;
270 294
  295 + },function (err){
  296 + proxy.isLoading=false;
  297 +
271 }) 298 })
272 } 299 }
273 300
@@ -279,9 +306,13 @@ export default { @@ -279,9 +306,13 @@ export default {
279 faultConfId:proxy.faultConfId, 306 faultConfId:proxy.faultConfId,
280 307
281 } 308 }
  309 + proxy.isLoading=false;
282 proxy.$emit('callbackBase',obj); 310 proxy.$emit('callbackBase',obj);
283 } 311 }
  312 + //
284 return { 313 return {
  314 + setListData,
  315 + baseListChecked,
285 isLoading, 316 isLoading,
286 closeDialog, 317 closeDialog,
287 addRes, 318 addRes,
@@ -244,7 +244,7 @@ @@ -244,7 +244,7 @@
244 244
245 </el-row> 245 </el-row>
246 246
247 - <BasicEnvironment ref="basic" v-if="faultEnvironmentRadio==1" :isBaseDetail="isBaseDetail" :propsData="propsData" @baseCount="baseCount" @callbackDelete="deleteEnvironment"></BasicEnvironment> 247 + <BasicEnvironment ref="basic" v-if="faultEnvironmentRadio==1" @callbackBaseList="callbackBaseList" :propsData="propsData" @baseCount="baseCount" @callbackDelete="deleteEnvironment"></BasicEnvironment>
248 248
249 <!-- <el-row> 249 <!-- <el-row>
250 <el-col :span="24"> 250 <el-col :span="24">
@@ -420,7 +420,7 @@ @@ -420,7 +420,7 @@
420 <!--应用检测弹框--> 420 <!--应用检测弹框-->
421 <ApplicationMoni v-show="applicationMonitorVisible" :isDisplay="applicationMonitorVisible" :applicationMonitorList="applicationMonitorList" :propsData="propsData" @callbackApp="getApplicationMoniList"></ApplicationMoni> 421 <ApplicationMoni v-show="applicationMonitorVisible" :isDisplay="applicationMonitorVisible" :applicationMonitorList="applicationMonitorList" :propsData="propsData" @callbackApp="getApplicationMoniList"></ApplicationMoni>
422 <!--基础环境弹框--> 422 <!--基础环境弹框-->
423 - <BasicEnvironmentAdd v-show="baseVisible" :isDisplay="baseVisible" :propsData="propsData" @callbackBase="getBasicEnvironmentList"></BasicEnvironmentAdd> 423 + <BasicEnvironmentAdd v-show="baseVisible" :isDisplay="baseVisible" :baseList="baseList" :baseCount="count" :propsData="propsData" @callbackBase="getBasicEnvironmentList"></BasicEnvironmentAdd>
424 <!--APM弹框--> 424 <!--APM弹框-->
425 <APM v-show="APMVisible" :isDisplay="APMVisible" :apmMonitorList="apmMonitorList" :propsData="propsData" @callbackAPM="getAPMList"></APM> 425 <APM v-show="APMVisible" :isDisplay="APMVisible" :apmMonitorList="apmMonitorList" :propsData="propsData" @callbackAPM="getAPMList"></APM>
426 <!--日志监测弹框--> 426 <!--日志监测弹框-->
@@ -190,10 +190,16 @@ export default { @@ -190,10 +190,16 @@ export default {
190 let baseCount=(val)=>{ 190 let baseCount=(val)=>{
191 proxy.count=val; 191 proxy.count=val;
192 } 192 }
193 - //基础环境是否为编辑  
194 - let isBaseDetail=Vue.ref(false); 193 + let baseList=Vue.ref([]);
  194 + //获取已添加的环境基础
  195 + let callbackBaseList=(val)=>{
  196 + proxy.baseList=val;
  197 + console.log("callbackBaseList",val,proxy.baseList)
  198 + }
  199 +
195 return{ 200 return{
196 - isBaseDetail, 201 + baseList,
  202 + callbackBaseList,
197 count, 203 count,
198 baseCount, 204 baseCount,
199 setDetail, 205 setDetail,
@@ -881,7 +887,6 @@ export default { @@ -881,7 +887,6 @@ export default {
881 break; 887 break;
882 case "base": 888 case "base":
883 //基础环境 889 //基础环境
884 - this.isBaseDetail=true;  
885 890
886 break; 891 break;
887 case "apm": 892 case "apm":