Authored by 王涛

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

故障联调 基础环境,npm,apm,网络检测保存模块时增加无数据不保存提示



See merge request !276
@@ -458,6 +458,9 @@ @@ -458,6 +458,9 @@
458 right:42px; 458 right:42px;
459 top:-4px; 459 top:-4px;
460 } 460 }
  461 +.max-width-134{
  462 + max-width: 134px;
  463 +}
461 .position-absolute{ 464 .position-absolute{
462 465
463 } 466 }
@@ -157,8 +157,8 @@ export default { @@ -157,8 +157,8 @@ export default {
157 busId:proxy.bizId, 157 busId:proxy.bizId,
158 targetId:proxy.targetId 158 targetId:proxy.targetId
159 } 159 }
160 - if (params.targetId==''){  
161 - proxy.$global.showMsg('请选择资源','warning'); 160 + if (proxy.count==0){
  161 + proxy.$global.showMsg('暂无配置数据','warning');
162 }else { 162 }else {
163 proxy.$http.post('/api-web/fault/conf/apm/saveOrUpdate',params,function (res){ 163 proxy.$http.post('/api-web/fault/conf/apm/saveOrUpdate',params,function (res){
164 if(res && res.success){ 164 if(res && res.success){
@@ -207,8 +207,8 @@ export default { @@ -207,8 +207,8 @@ export default {
207 /*let params={ 207 /*let params={
208 busId:proxy.bizId 208 busId:proxy.bizId
209 }*/ 209 }*/
210 - if (params.apmList==0){  
211 - proxy.$global.showMsg('请选择资源','warning'); 210 + if (npmListSelectData.length==0){
  211 + proxy.$global.showMsg('请选择配置','warning');
212 }else { 212 }else {
213 proxy.$http.post('/api-web/fault/conf/apm/batchAddApm',params,function (res){ 213 proxy.$http.post('/api-web/fault/conf/apm/batchAddApm',params,function (res){
214 if(res && res.str){ 214 if(res && res.str){
@@ -135,25 +135,30 @@ export default { @@ -135,25 +135,30 @@ export default {
135 } 135 }
136 //全部添加 136 //全部添加
137 let saveAlldata=()=>{ 137 let saveAlldata=()=>{
138 - proxy.isLoading=true;  
139 -  
140 - let params={  
141 - busId:proxy.bizId,  
142 - targetId:proxy.targetId,  
143 - } 138 + if(proxy.count==0){
  139 + proxy.$global.showMsg('暂无配置','warning');
  140 + }else{
  141 + proxy.isLoading=true;
144 142
145 - proxy.$http.post('/api-web/fault/conf/npm/AddAllNpm',params,function (res){  
146 - if(res && res.success){  
147 - proxy.$global.showMsg('添加成功','success');  
148 - proxy.targetId=res.str;  
149 - proxy.saveModel();  
150 - // proxy.applicationMonitorVisible=false;  
151 - }else{  
152 - proxy.$global.showMsg('添加失败','warning'); 143 + let params={
  144 + busId:proxy.bizId,
  145 + targetId:proxy.targetId,
153 } 146 }
154 - proxy.isLoading=false;  
155 147
156 - }) 148 + proxy.$http.post('/api-web/fault/conf/npm/AddAllNpm',params,function (res){
  149 + if(res && res.success){
  150 + proxy.$global.showMsg('添加成功','success');
  151 + proxy.targetId=res.str;
  152 + proxy.saveModel();
  153 + // proxy.applicationMonitorVisible=false;
  154 + }else{
  155 + proxy.$global.showMsg('添加失败','warning');
  156 + }
  157 + proxy.isLoading=false;
  158 +
  159 + })
  160 + }
  161 +
157 } 162 }
158 //表格全选事件 163 //表格全选事件
159 let selectionChange=(val)=>{ 164 let selectionChange=(val)=>{
@@ -183,25 +188,32 @@ export default { @@ -183,25 +188,32 @@ export default {
183 } 188 }
184 189
185 }) 190 })
186 - proxy.isLoading=true;  
187 - let params={  
188 - targetId:proxy.targetId,  
189 - npmList:npmListSelectData  
190 - }  
191 -  
192 - proxy.$http.post('/api-web/fault/conf/npm/batchAddNpm',params,function (res){  
193 - if(res && res.success){  
194 - proxy.$global.showMsg('添加成功','success');  
195 - proxy.targetId=res.str;  
196 - proxy.saveModel();  
197 - // proxy.applicationMonitorVisible=false;  
198 - }else{  
199 - proxy.$global.showMsg('添加失败','warning'); 191 + if(npmListSelectData.length==0){
  192 + proxy.$global.showMsg('请选择配置','warning');
  193 + }else{
  194 + proxy.isLoading=true;
200 195
  196 + let params={
  197 + targetId:proxy.targetId,
  198 + npmList:npmListSelectData
201 } 199 }
202 - proxy.isLoading=false;  
203 200
204 - }) 201 + proxy.$http.post('/api-web/fault/conf/npm/batchAddNpm',params,function (res){
  202 + if(res && res.success){
  203 + proxy.$global.showMsg('添加成功','success');
  204 + proxy.targetId=res.str;
  205 + proxy.saveModel();
  206 + // proxy.applicationMonitorVisible=false;
  207 + }else{
  208 + proxy.$global.showMsg('添加失败','warning');
  209 +
  210 + }
  211 + proxy.isLoading=false;
  212 +
  213 + })
  214 + }
  215 +
  216 +
205 217
206 218
207 } 219 }
@@ -233,6 +233,7 @@ export default { @@ -233,6 +233,7 @@ export default {
233 if(res && res.data){ 233 if(res && res.data){
234 that.count = res.count; 234 that.count = res.count;
235 that.tableDataList=res.data; 235 that.tableDataList=res.data;
  236 + that.$emit('baseCount',that.count);
236 } 237 }
237 }) 238 })
238 }else{ 239 }else{
@@ -241,6 +242,7 @@ export default { @@ -241,6 +242,7 @@ export default {
241 if(res && res.data){ 242 if(res && res.data){
242 that.count = res.count; 243 that.count = res.count;
243 that.tableDataList=res.data; 244 that.tableDataList=res.data;
  245 + that.$emit('baseCount',that.count);
244 } 246 }
245 }) 247 })
246 } 248 }
@@ -238,7 +238,7 @@ @@ -238,7 +238,7 @@
238 </div> 238 </div>
239 </el-col> 239 </el-col>
240 </el-row> 240 </el-row>
241 - <BasicEnvironment v-if="faultEnvironmentRadio==1" :propsData="propsData" @callbackDelete="deleteEnvironment"></BasicEnvironment> 241 + <BasicEnvironment v-if="faultEnvironmentRadio==1" :propsData="propsData" @baseCount="baseCount" @callbackDelete="deleteEnvironment"></BasicEnvironment>
242 242
243 <!-- <el-row> 243 <!-- <el-row>
244 <el-col :span="24"> 244 <el-col :span="24">
@@ -54,34 +54,11 @@ export default { @@ -54,34 +54,11 @@ export default {
54 ], 54 ],
55 55
56 //网络检测选中项集合 56 //网络检测选中项集合
57 - networkMonitorList: [  
58 - {  
59 - title: "电子税务局外用链路1",  
60 - type: "networkMonitor",  
61 - id: "networkMonitor1"  
62 - }  
63 - ], 57 + networkMonitorList: [],
64 //应用检测选中项集合 58 //应用检测选中项集合
65 - applicationMonitorList: [  
66 - {  
67 - title: "从对接过来的NPM中选择",  
68 - type: "applicationMonitor",  
69 - id: "applicationMonitor1"  
70 - }  
71 - ], 59 + applicationMonitorList: [],
72 //APM 60 //APM
73 - apmMonitorList: [  
74 - {  
75 - title: "arms",  
76 - type: "apmMonitor",  
77 - id: " apmMonitor1"  
78 - },  
79 - {  
80 - title: "arms2",  
81 - type: "apmMonitor",  
82 - id: " apmMonitor2"  
83 - }  
84 - ], 61 + apmMonitorList: [],
85 //日志检测 62 //日志检测
86 logDetectionList: [ 63 logDetectionList: [
87 { 64 {
@@ -204,7 +181,14 @@ export default { @@ -204,7 +181,14 @@ export default {
204 } 181 }
205 182
206 } 183 }
  184 + //基础环境数量
  185 + let count=Vue.ref(0);
  186 + let baseCount=(val)=>{
  187 + proxy.count=val;
  188 + }
207 return{ 189 return{
  190 + count,
  191 + baseCount,
208 setDetail, 192 setDetail,
209 applicationMonitorVisible, 193 applicationMonitorVisible,
210 modleId, 194 modleId,
@@ -628,7 +612,7 @@ export default { @@ -628,7 +612,7 @@ export default {
628 } 612 }
629 console.log("applist",params) 613 console.log("applist",params)
630 this.$http.get('/api-web/fault/conf/npm/npmList',params,function (res){ 614 this.$http.get('/api-web/fault/conf/npm/npmList',params,function (res){
631 - if(res ){ 615 + if(res && res.data){
632 that.applicationMonitorList=res.data; 616 that.applicationMonitorList=res.data;
633 617
634 } 618 }
@@ -792,10 +776,28 @@ export default { @@ -792,10 +776,28 @@ export default {
792 //保存模块类型-不包含故障定义模块 776 //保存模块类型-不包含故障定义模块
793 saveConfigDetailOther(){ 777 saveConfigDetailOther(){
794 console.log("save",this.state) 778 console.log("save",this.state)
  779 + let that=this;
795 this.setState(); 780 this.setState();
796 this.getTargetId(this.type); 781 this.getTargetId(this.type);
797 this.getBizName(this.busTypeArr); 782 this.getBizName(this.busTypeArr);
798 - let that=this; 783 + if(this.type=='netlink'){
  784 + if(this.networkMonitorList.length==0){
  785 + this.$global.showMsg('请先选择添加链路配置','warning');
  786 + return;
  787 + }
  788 +
  789 + }else if(this.type=='npm'){
  790 + console.log("aaa",this.applicationMonitorList)
  791 + if(this.applicationMonitorList.length==0){
  792 + this.$global.showMsg('请先选择添加应用配置','warning');
  793 + return;
  794 + }
  795 + }else if(this.type=='apm'){
  796 + if(this.apmMonitorList.length==0){
  797 + this.$global.showMsg('请先选择添加apm配置','warning');
  798 + return;
  799 + }
  800 + }
799 let params={ 801 let params={
800 type:this.type, 802 type:this.type,
801 targetId:this.targetId, 803 targetId:this.targetId,
@@ -937,25 +939,32 @@ export default { @@ -937,25 +939,32 @@ export default {
937 //保存基础环境 939 //保存基础环境
938 saveBase(){ 940 saveBase(){
939 let that=this; 941 let that=this;
940 - this.getTargetId('base')  
941 - let params={  
942 - targetId:this.targetId,  
943 - busId:this.busTypeArr  
944 - }  
945 - this.$http.post('/api-web/fault/conf/base/saveOrUpdate',params,function (res){  
946 - if(res && res.success){  
947 - that.targetId=res.str;  
948 - that.setTargetId(that.targetId)  
949 - that.$global.showMsg(res.msg)  
950 - // that.alarmList=res.data;  
951 - that.saveConfigDetailOther();  
952 - }else{  
953 - that.$global.showMsg('基础环境保存失败','warning') 942 + if(that.faultEnvironmentRadio==1 && that.count==0){
  943 + this.$global.showMsg('暂无环境数据,不能启用模块','warning')
  944 + that.isLoading=false;
954 945
  946 + }else{
  947 + this.getTargetId('base')
  948 + let params={
  949 + targetId:this.targetId,
  950 + busId:this.busTypeArr
955 } 951 }
956 - that.isLoading=false; 952 + this.$http.post('/api-web/fault/conf/base/saveOrUpdate',params,function (res){
  953 + if(res && res.success){
  954 + that.targetId=res.str;
  955 + that.setTargetId(that.targetId)
  956 + that.$global.showMsg(res.msg)
  957 + // that.alarmList=res.data;
  958 + that.saveConfigDetailOther();
  959 + }else{
  960 + that.$global.showMsg('基础环境保存失败','warning')
  961 +
  962 + }
  963 + that.isLoading=false;
  964 +
  965 + })
  966 + }
957 967
958 - })  
959 }, 968 },
960 //删除网络监测 969 //删除网络监测
961 deleteNetLink(item) { 970 deleteNetLink(item) {
@@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
39 <div class="context-body"> 39 <div class="context-body">
40 40
41 <el-row v-if="!addSetLIstVisible"> 41 <el-row v-if="!addSetLIstVisible">
42 - <el-col :span="3" v-for="(itemNode,index) in nodeData"> 42 + <el-col :span="3" v-for="(itemNode,index) in nodeData" class="max-width-134">
43 <div class="list-step flex-div-start"> 43 <div class="list-step flex-div-start">
44 <div class="list-step-top flex-div"> 44 <div class="list-step-top flex-div">
45 <el-tooltip 45 <el-tooltip
@@ -60,7 +60,7 @@ @@ -60,7 +60,7 @@
60 </template> 60 </template>
61 <div @click="addTableList(true,itemNode)" :class="['step-img','flex-div-center',{'isActive':itemNode[0].nodeName}]"> 61 <div @click="addTableList(true,itemNode)" :class="['step-img','flex-div-center',{'isActive':itemNode[0].nodeName}]">
62 <i v-if="itemNode[0].nodeName" class="icon-delete-right" @click.stop="deleteNode(itemNode,index)"></i> 62 <i v-if="itemNode[0].nodeName" class="icon-delete-right" @click.stop="deleteNode(itemNode,index)"></i>
63 - <i class="icon-step flex-div-center"><img :src="'/src/style/img/restypeimg/'+itemNode[0].resType+'.png'" alt=""></i> 63 + <i class="icon-step flex-div-center"><img :src="'/src/style/img/fault/'+itemNode[0].resType+'.png'" alt=""></i>
64 </div> 64 </div>
65 </el-tooltip> 65 </el-tooltip>
66 <!-- <span @click="addTableList(false)" v-if="index+1<nodeData.length && itemNode.length<=1" :class="['list-line','cursorClass',{'isActive':itemNode.length>1}]"></span>--> 66 <!-- <span @click="addTableList(false)" v-if="index+1<nodeData.length && itemNode.length<=1" :class="['list-line','cursorClass',{'isActive':itemNode.length>1}]"></span>-->