故障联调 update apm,npm,基础环境全部添加接口联调
Showing
5 changed files
with
55 additions
and
13 deletions
@@ -30,7 +30,8 @@ | @@ -30,7 +30,8 @@ | ||
30 | <div class="flex-div-start"> | 30 | <div class="flex-div-start"> |
31 | <el-button type="primary" @click="onReset()">重置</el-button> | 31 | <el-button type="primary" @click="onReset()">重置</el-button> |
32 | <el-button type="primary" @click="onBtnSearch()" style="margin-left: 10px">查询</el-button> | 32 | <el-button type="primary" @click="onBtnSearch()" style="margin-left: 10px">查询</el-button> |
33 | - <el-button type="primary" @click="saveAll()" style="margin-left: 10px">添加</el-button> | 33 | + <el-button type="primary" @click="saveAll()" style="margin-left: 10px">添加选中</el-button> |
34 | + <el-button type="primary" @click="saveAlldata()" style="margin-left: 10px">全部添加</el-button> | ||
34 | </div> | 35 | </div> |
35 | 36 | ||
36 | </div> | 37 | </div> |
@@ -105,18 +105,22 @@ export default { | @@ -105,18 +105,22 @@ export default { | ||
105 | } | 105 | } |
106 | //添加Apm | 106 | //添加Apm |
107 | let addRes=(row,index)=>{ | 107 | let addRes=(row,index)=>{ |
108 | - let params={ | 108 | + /* let params={ |
109 | targetId:proxy.targetId, | 109 | targetId:proxy.targetId, |
110 | resId:row.resId, | 110 | resId:row.resId, |
111 | kpiId:row.kpiId, | 111 | kpiId:row.kpiId, |
112 | flag:row.flag, | 112 | flag:row.flag, |
113 | createBy:localStorage.getItem("lgn") | 113 | createBy:localStorage.getItem("lgn") |
114 | 114 | ||
115 | + }*/ | ||
116 | + let params={ | ||
117 | + targetId:proxy.targetId, | ||
118 | + apmList:[row] | ||
115 | } | 119 | } |
116 | - proxy.$http.post('/api-web/fault/conf/apm/saveOrUpdate',[params],function (res){ | 120 | + proxy.$http.post('/fault/conf/apm/batchAddApm',params,function (res){ |
117 | if(res && res.object){ | 121 | if(res && res.object){ |
118 | proxy.$global.showMsg('添加成功','success'); | 122 | proxy.$global.showMsg('添加成功','success'); |
119 | - proxy.targetId=res.object.targetId | 123 | + proxy.targetId=res.src; |
120 | proxy.APMVisible=false; | 124 | proxy.APMVisible=false; |
121 | } | 125 | } |
122 | 126 | ||
@@ -124,6 +128,22 @@ export default { | @@ -124,6 +128,22 @@ export default { | ||
124 | 128 | ||
125 | 129 | ||
126 | } | 130 | } |
131 | + //添加全部 | ||
132 | + let saveAllData=()=>{ | ||
133 | + let params={ | ||
134 | + busId:proxy.bizId, | ||
135 | + targetId:proxy.targetId | ||
136 | + } | ||
137 | + | ||
138 | + proxy.$http.post('/api-web/fault/conf/apm/saveOrUpdate',params,function (res){ | ||
139 | + if(res && res.object){ | ||
140 | + proxy.$global.showMsg('添加成功','success'); | ||
141 | + proxy.targetId=res.src; | ||
142 | + proxy.APMVisible=false; | ||
143 | + } | ||
144 | + | ||
145 | + }) | ||
146 | + } | ||
127 | //表格全选事件 | 147 | //表格全选事件 |
128 | let selectionChange=(val)=>{ | 148 | let selectionChange=(val)=>{ |
129 | let selectData=val; | 149 | let selectData=val; |
@@ -142,7 +162,7 @@ export default { | @@ -142,7 +162,7 @@ export default { | ||
142 | }) | 162 | }) |
143 | } | 163 | } |
144 | } | 164 | } |
145 | - //添加所有数据 | 165 | + //添加选中数据 |
146 | let saveAll=()=>{ | 166 | let saveAll=()=>{ |
147 | let npmListSelectData=[]; | 167 | let npmListSelectData=[]; |
148 | proxy.tableDataList.map(item=>{ | 168 | proxy.tableDataList.map(item=>{ |
@@ -153,12 +173,12 @@ export default { | @@ -153,12 +173,12 @@ export default { | ||
153 | }) | 173 | }) |
154 | let params={ | 174 | let params={ |
155 | targetId:proxy.targetId, | 175 | targetId:proxy.targetId, |
156 | - npmList:npmListSelectData | 176 | + apmList:npmListSelectData |
157 | } | 177 | } |
158 | /*let params={ | 178 | /*let params={ |
159 | busId:proxy.bizId | 179 | busId:proxy.bizId |
160 | }*/ | 180 | }*/ |
161 | - proxy.$http.post('/api-web/fault/conf/apm/saveOrUpdate',params,function (res){ | 181 | + proxy.$http.post('/api-web/fault/conf/apm/batchAddApm',params,function (res){ |
162 | if(res && res.object){ | 182 | if(res && res.object){ |
163 | proxy.$global.showMsg('添加成功','success'); | 183 | proxy.$global.showMsg('添加成功','success'); |
164 | proxy.targetId=res.src; | 184 | proxy.targetId=res.src; |
@@ -173,6 +193,7 @@ export default { | @@ -173,6 +193,7 @@ export default { | ||
173 | 193 | ||
174 | } | 194 | } |
175 | return { | 195 | return { |
196 | + saveAllData, | ||
176 | page, | 197 | page, |
177 | pageSize, | 198 | pageSize, |
178 | selectionChange, | 199 | selectionChange, |
@@ -30,7 +30,8 @@ | @@ -30,7 +30,8 @@ | ||
30 | <div class="flex-div-start"> | 30 | <div class="flex-div-start"> |
31 | <el-button type="primary" @click="onReset()">重置</el-button> | 31 | <el-button type="primary" @click="onReset()">重置</el-button> |
32 | <el-button type="primary" @click="onBtnSearch()" style="margin-left: 10px">查询</el-button> | 32 | <el-button type="primary" @click="onBtnSearch()" style="margin-left: 10px">查询</el-button> |
33 | - <el-button type="primary" :disabled="isLoading" @click="saveAll()" style="margin-left: 10px">添加</el-button> | 33 | + <el-button type="primary" :disabled="isLoading" @click="saveAll()" style="margin-left: 10px">添加选中</el-button> |
34 | + <el-button type="primary" :disabled="isLoading" @click="saveAlldata()" style="margin-left: 10px">全部添加</el-button> | ||
34 | </div> | 35 | </div> |
35 | </div> | 36 | </div> |
36 | </el-col> | 37 | </el-col> |
@@ -110,6 +110,23 @@ export default { | @@ -110,6 +110,23 @@ export default { | ||
110 | 110 | ||
111 | 111 | ||
112 | } | 112 | } |
113 | + //全部添加 | ||
114 | + let saveAlldata=()=>{ | ||
115 | + | ||
116 | + let params={ | ||
117 | + busId:proxy.bizId, | ||
118 | + targetId:proxy.targetId, | ||
119 | + } | ||
120 | + | ||
121 | + proxy.$http.post('/api-web/fault/conf/npm/AddAllNpm',params,function (res){ | ||
122 | + if(res){ | ||
123 | + proxy.$global.showMsg('添加成功','success'); | ||
124 | + proxy.targetId=res.str | ||
125 | + proxy.applicationMonitorVisible=false; | ||
126 | + } | ||
127 | + | ||
128 | + }) | ||
129 | + } | ||
113 | //表格全选事件 | 130 | //表格全选事件 |
114 | let selectionChange=(val)=>{ | 131 | let selectionChange=(val)=>{ |
115 | console.log("selectionChange",val,val.length) | 132 | console.log("selectionChange",val,val.length) |
@@ -129,7 +146,8 @@ export default { | @@ -129,7 +146,8 @@ export default { | ||
129 | }) | 146 | }) |
130 | } | 147 | } |
131 | } | 148 | } |
132 | - //全部添加 | 149 | + |
150 | + //添加选中的 | ||
133 | let saveAll=()=>{ | 151 | let saveAll=()=>{ |
134 | console.log("alldata",proxy.tableDataList); | 152 | console.log("alldata",proxy.tableDataList); |
135 | let npmListSelectData=[]; | 153 | let npmListSelectData=[]; |
@@ -157,6 +175,7 @@ export default { | @@ -157,6 +175,7 @@ export default { | ||
157 | 175 | ||
158 | } | 176 | } |
159 | return { | 177 | return { |
178 | + saveAlldata, | ||
160 | page, | 179 | page, |
161 | pageSize, | 180 | pageSize, |
162 | selectionChange, | 181 | selectionChange, |
@@ -214,11 +233,11 @@ export default { | @@ -214,11 +233,11 @@ export default { | ||
214 | getParams(){ | 233 | getParams(){ |
215 | return { | 234 | return { |
216 | keyWords: this.keyWords, | 235 | keyWords: this.keyWords, |
217 | - resType: this.resTypeArr.join(','), | ||
218 | - kpiId: this.kpiTypeArr.join(','), | 236 | + // resType: this.resTypeArr.join(','), |
237 | + // kpiId: this.kpiTypeArr.join(','), | ||
219 | // busId: this.busTypeArr.join(','), | 238 | // busId: this.busTypeArr.join(','), |
220 | bizId: this.bizId, | 239 | bizId: this.bizId, |
221 | - configId: this.config, | 240 | + // configId: this.config, |
222 | page: this.page, | 241 | page: this.page, |
223 | pageSize: this.pageSize | 242 | pageSize: this.pageSize |
224 | } | 243 | } |
@@ -897,7 +897,7 @@ export default { | @@ -897,7 +897,7 @@ export default { | ||
897 | let that=this; | 897 | let that=this; |
898 | this.getTargetId('base') | 898 | this.getTargetId('base') |
899 | let params={ | 899 | let params={ |
900 | - // targetId:this.targetId, | 900 | + targetId:this.targetId, |
901 | busId:this.busTypeArr | 901 | busId:this.busTypeArr |
902 | } | 902 | } |
903 | this.$http.post('/api-web/fault/conf/base/saveOrUpdate',params,function (res){ | 903 | this.$http.post('/api-web/fault/conf/base/saveOrUpdate',params,function (res){ |
-
Please register or login to post a comment