故障联调 基础环境,npm,apm,网络检测保存模块时增加无数据不保存提示
Showing
7 changed files
with
61 additions
and
35 deletions
@@ -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,6 +135,9 @@ export default { | @@ -135,6 +135,9 @@ export default { | ||
135 | } | 135 | } |
136 | //全部添加 | 136 | //全部添加 |
137 | let saveAlldata=()=>{ | 137 | let saveAlldata=()=>{ |
138 | + if(proxy.count==0){ | ||
139 | + proxy.$global.showMsg('暂无配置','warning'); | ||
140 | + }else{ | ||
138 | proxy.isLoading=true; | 141 | proxy.isLoading=true; |
139 | 142 | ||
140 | let params={ | 143 | let params={ |
@@ -155,6 +158,8 @@ export default { | @@ -155,6 +158,8 @@ export default { | ||
155 | 158 | ||
156 | }) | 159 | }) |
157 | } | 160 | } |
161 | + | ||
162 | + } | ||
158 | //表格全选事件 | 163 | //表格全选事件 |
159 | let selectionChange=(val)=>{ | 164 | let selectionChange=(val)=>{ |
160 | let selectData=val; | 165 | let selectData=val; |
@@ -183,7 +188,11 @@ export default { | @@ -183,7 +188,11 @@ export default { | ||
183 | } | 188 | } |
184 | 189 | ||
185 | }) | 190 | }) |
191 | + if(npmListSelectData.length==0){ | ||
192 | + proxy.$global.showMsg('请选择配置','warning'); | ||
193 | + }else{ | ||
186 | proxy.isLoading=true; | 194 | proxy.isLoading=true; |
195 | + | ||
187 | let params={ | 196 | let params={ |
188 | targetId:proxy.targetId, | 197 | targetId:proxy.targetId, |
189 | npmList:npmListSelectData | 198 | npmList:npmListSelectData |
@@ -202,6 +211,9 @@ export default { | @@ -202,6 +211,9 @@ export default { | ||
202 | proxy.isLoading=false; | 211 | proxy.isLoading=false; |
203 | 212 | ||
204 | }) | 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,6 +939,11 @@ export default { | @@ -937,6 +939,11 @@ export default { | ||
937 | //保存基础环境 | 939 | //保存基础环境 |
938 | saveBase(){ | 940 | saveBase(){ |
939 | let that=this; | 941 | let that=this; |
942 | + if(that.faultEnvironmentRadio==1 && that.count==0){ | ||
943 | + this.$global.showMsg('暂无环境数据,不能启用模块','warning') | ||
944 | + that.isLoading=false; | ||
945 | + | ||
946 | + }else{ | ||
940 | this.getTargetId('base') | 947 | this.getTargetId('base') |
941 | let params={ | 948 | let params={ |
942 | targetId:this.targetId, | 949 | targetId:this.targetId, |
@@ -956,6 +963,8 @@ export default { | @@ -956,6 +963,8 @@ export default { | ||
956 | that.isLoading=false; | 963 | that.isLoading=false; |
957 | 964 | ||
958 | }) | 965 | }) |
966 | + } | ||
967 | + | ||
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>--> |
-
Please register or login to post a comment