Authored by xwx

Merge branch 'master' of http://113.200.75.45:82/monitor_v3/hg-monitor-web into master-v32-xwx

@@ -446,7 +446,11 @@ layui.define(['table', 'admin', 'form', 'common', 'sessions', 'reslist', 'common @@ -446,7 +446,11 @@ layui.define(['table', 'admin', 'form', 'common', 'sessions', 'reslist', 'common
446 //删除收藏夹下的资源 446 //删除收藏夹下的资源
447 function deleteFavoriteResource(favId,resIds) { 447 function deleteFavoriteResource(favId,resIds) {
448 //确认提示框 448 //确认提示框
449 - layer.confirm('删除后将无法恢复,您确定要删除当前收藏夹吗?', { 449 + /*
  450 + * 提示语更改
  451 + * 2021-12-24 by lushangqing
  452 + * */
  453 + layer.confirm('您确定要删除资源吗?删除后将无法恢复!', {
450 btn: ['确定', '取消'] //按钮 454 btn: ['确定', '取消'] //按钮
451 }, function () { 455 }, function () {
452 layer.closeAll(); 456 layer.closeAll();
@@ -7890,3 +7890,6 @@ form[lay-filter="activewarning-form"] .layui-inline { @@ -7890,3 +7890,6 @@ form[lay-filter="activewarning-form"] .layui-inline {
7890 pointer-events: none!important; 7890 pointer-events: none!important;
7891 cursor:not-allowed!important; 7891 cursor:not-allowed!important;
7892 } 7892 }
  7893 +.padding-left-10{
  7894 + padding-left:10px;
  7895 +}
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 </div> 21 </div>
22 <div class="layui-inline"> 22 <div class="layui-inline">
23 <label class="layui-form-label">是否默认</label> 23 <label class="layui-form-label">是否默认</label>
24 - <div class="layui-input-inline"> 24 + <div class="layui-input-inline padding-left-10">
25 <input type="radio" name="policyType" value="1" title="默认"> 25 <input type="radio" name="policyType" value="1" title="默认">
26 <input type="radio" name="policyType" value="0" title="非默认" checked> 26 <input type="radio" name="policyType" value="0" title="非默认" checked>
27 </div> 27 </div>
@@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
24 </div> 24 </div>
25 <div class="layui-inline"> 25 <div class="layui-inline">
26 <label class="layui-form-label">是否默认</label> 26 <label class="layui-form-label">是否默认</label>
27 - <div class="layui-input-inline"> 27 + <div class="layui-input-inline padding-left-10">
28 <input type="radio" name="policyType" lay-filter="rdo-policyType" value="1" title="默认"> 28 <input type="radio" name="policyType" lay-filter="rdo-policyType" value="1" title="默认">
29 <input type="radio" name="policyType" lay-filter="rdo-policyType" value="0" title="非默认" checked> 29 <input type="radio" name="policyType" lay-filter="rdo-policyType" value="0" title="非默认" checked>
30 </div> 30 </div>
@@ -436,6 +436,9 @@ @@ -436,6 +436,9 @@
436 width:30px; 436 width:30px;
437 height:30px; 437 height:30px;
438 } 438 }
  439 +.icon-step img{
  440 + width:100%;
  441 +}
439 .cursorClass{ 442 .cursorClass{
440 cursor: pointer; 443 cursor: pointer;
441 } 444 }
@@ -162,19 +162,30 @@ export default { @@ -162,19 +162,30 @@ export default {
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){
  165 + if(res.count==0){
  166 + proxy.$global.showMsg(res.msg,'warning');
  167 +
  168 + }else{
165 proxy.$global.showMsg('添加成功','success'); 169 proxy.$global.showMsg('添加成功','success');
166 - proxy.targetId=res.src; 170 + proxy.targetId=res.str;
167 proxy.saveModel(); 171 proxy.saveModel();
168 // proxy.APMVisible=false; 172 // proxy.APMVisible=false;
  173 + }
  174 +
169 }else{ 175 }else{
170 proxy.$global.showMsg('添加失败','warning'); 176 proxy.$global.showMsg('添加失败','warning');
171 177
172 } 178 }
173 179
174 }) 180 })
  181 +
  182 +
175 }} 183 }}
176 //表格全选事件 184 //表格全选事件
177 let selectionChange=(val)=>{ 185 let selectionChange=(val)=>{
  186 + proxy.tableDataList.map((v,i)=>{
  187 + v.checked=false;
  188 + })
178 let selectData=val; 189 let selectData=val;
179 if(selectData.length>0){ 190 if(selectData.length>0){
180 selectData.map((item,index)=>{ 191 selectData.map((item,index)=>{
@@ -8,18 +8,7 @@ export default { @@ -8,18 +8,7 @@ export default {
8 titleName:'应用配置', 8 titleName:'应用配置',
9 // applicationMonitorVisible: true, 9 // applicationMonitorVisible: true,
10 columns:[ 10 columns:[
11 - /*{  
12 - prop: 'busTypeName',  
13 - label: '业务系统',  
14 - sortable: true,  
15 - align: 'center',  
16 - },*/  
17 - /*{  
18 - prop: 'streamId',  
19 - label: '链路id',  
20 - sortable: true,  
21 - align: 'center',  
22 - },*/ 11 +
23 { 12 {
24 prop: 'streamName', 13 prop: 'streamName',
25 label: '链路名称', 14 label: '链路名称',
@@ -139,29 +128,42 @@ export default { @@ -139,29 +128,42 @@ export default {
139 proxy.$global.showMsg('暂无配置','warning'); 128 proxy.$global.showMsg('暂无配置','warning');
140 }else{ 129 }else{
141 proxy.isLoading=true; 130 proxy.isLoading=true;
142 -  
143 let params={ 131 let params={
144 busId:proxy.bizId, 132 busId:proxy.bizId,
145 targetId:proxy.targetId, 133 targetId:proxy.targetId,
146 } 134 }
147 -  
148 proxy.$http.post('/api-web/fault/conf/npm/AddAllNpm',params,function (res){ 135 proxy.$http.post('/api-web/fault/conf/npm/AddAllNpm',params,function (res){
149 if(res && res.success){ 136 if(res && res.success){
  137 + if(res.count==0){
  138 + proxy.$global.showMsg(res.msg,'warning');
  139 + }else{
150 proxy.$global.showMsg('添加成功','success'); 140 proxy.$global.showMsg('添加成功','success');
151 proxy.targetId=res.str; 141 proxy.targetId=res.str;
152 proxy.saveModel(); 142 proxy.saveModel();
153 // proxy.applicationMonitorVisible=false; 143 // proxy.applicationMonitorVisible=false;
  144 + }
  145 +
154 }else{ 146 }else{
155 proxy.$global.showMsg('添加失败','warning'); 147 proxy.$global.showMsg('添加失败','warning');
156 } 148 }
157 proxy.isLoading=false; 149 proxy.isLoading=false;
158 150
  151 + },function (err){
  152 + proxy.isLoading=false;
  153 +
159 }) 154 })
  155 +
  156 +
160 } 157 }
161 158
162 } 159 }
163 //表格全选事件 160 //表格全选事件
164 let selectionChange=(val)=>{ 161 let selectionChange=(val)=>{
  162 + proxy.tableDataList.map((v,i)=>{
  163 +
  164 + v.checked=false;
  165 +
  166 + })
165 let selectData=val; 167 let selectData=val;
166 if(selectData.length>0){ 168 if(selectData.length>0){
167 selectData.map((item,index)=>{ 169 selectData.map((item,index)=>{
@@ -177,6 +179,7 @@ export default { @@ -177,6 +179,7 @@ export default {
177 v.checked=false; 179 v.checked=false;
178 }) 180 })
179 } 181 }
  182 + console.log("selectchange",val,proxy.tableDataList)
180 } 183 }
181 184
182 //添加选中的 185 //添加选中的
@@ -34,10 +34,10 @@ @@ -34,10 +34,10 @@
34 </el-row> 34 </el-row>
35 <el-row class="margin-bottom-50"> 35 <el-row class="margin-bottom-50">
36 <el-col :span="24" class="overflow-scroll-y"> 36 <el-col :span="24" class="overflow-scroll-y">
37 - <cm-table-page :columns="columns" :dataList="tableDataList" @loaddata="loadTableDataList" 37 + <cm-table-page v-if="tableDataList" :columns="columns" :dataList="tableDataList" @loaddata="loadTableDataList"
38 :showIndex="true" :total="count" 38 :showIndex="true" :total="count"
39 :showBorder="true" :loading="false" :pageSize="pageSize" 39 :showBorder="true" :loading="false" :pageSize="pageSize"
40 - :showPage="true" :showTools="isDetail" :height="(height - 500)"> 40 + :showPage="true" :showTools="true" :height="(height - 500)">
41 <!-- <template #default="{row,prop,column}"> 41 <!-- <template #default="{row,prop,column}">
42 <div v-if="prop == 'kpiName'" class="list-data"> 42 <div v-if="prop == 'kpiName'" class="list-data">
43 <span class="list-data-text">{{row.kpiName }}</span> 43 <span class="list-data-text">{{row.kpiName }}</span>
@@ -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'], 5 + props:['propsData','isBaseDetail'],
6 data () { 6 data () {
7 return { 7 return {
8 columns:[ 8 columns:[
@@ -42,37 +42,7 @@ export default { @@ -42,37 +42,7 @@ export default {
42 width:'150' 42 width:'150'
43 } 43 }
44 ], 44 ],
45 - environmentTableData: [  
46 - {  
47 - name: '服务器',  
48 - address: 'CPU使用率,内存使用率,文件系统使用率',  
49 - },  
50 - {  
51 - name: '服务器',  
52 - address: 'CPU使用率,内存使用率,文件系统使用率',  
53 - },  
54 - {  
55 - name: '服务器',  
56 - address: 'CPU使用率,内存使用率,文件系统使用率',  
57 - },  
58 - {  
59 - name: '服务器',  
60 - address: 'CPU使用率,内存使用率,文件系统使用率',  
61 - },  
62 - {  
63 - name: '服务器',  
64 - address: 'CPU使用率,内存使用率,文件系统使用率',  
65 - },  
66 - {  
67 - name: '服务器',  
68 - address: 'CPU使用率,内存使用率,文件系统使用率',  
69 - },  
70 - {  
71 - name: '服务器',  
72 - address: 'CPU使用率,内存使用率,文件系统使用率',  
73 - },  
74 45
75 - ],//基础环境表格数据  
76 } 46 }
77 }, 47 },
78 computed: {}, 48 computed: {},
@@ -130,11 +100,18 @@ export default { @@ -130,11 +100,18 @@ export default {
130 proxy.targetId=props.propsData.targetId; 100 proxy.targetId=props.propsData.targetId;
131 proxy.busTypeArr=[props.propsData.bizId]; 101 proxy.busTypeArr=[props.propsData.bizId];
132 } 102 }
  103 + if(proxy.targetId){
  104 + proxy.isDetail=true;
  105 + }else{
  106 + proxy.isDetail=false;
  107 + }
133 console.log("*",props.propsData,proxy.bizId,proxy.busTypeArr) 108 console.log("*",props.propsData,proxy.bizId,proxy.busTypeArr)
134 109
135 } 110 }
136 // 监听编辑状态 111 // 监听编辑状态
137 - Vue.watch(() => props.propsData.bizId, (newValue, oldVlaue) => { 112 + Vue.watch(() => [props.propsData.bizId,props.isBaseDetail], ([newValue,newValueDetail], [oldValue,oldValueDetail]) => {
  113 + console.log('newValueDetail',newValueDetail)
  114 + proxy.isDetail=newValueDetail;
138 proxy.bizId=newValue; 115 proxy.bizId=newValue;
139 proxy.resTypeArr=''; 116 proxy.resTypeArr='';
140 proxy.setBizId(); 117 proxy.setBizId();
@@ -154,7 +131,32 @@ export default { @@ -154,7 +131,32 @@ export default {
154 proxy.pageSize=limit; 131 proxy.pageSize=limit;
155 proxy.getEnvironmentData() 132 proxy.getEnvironmentData()
156 } 133 }
  134 + //获取基础环境资源列表数据
  135 + let getEnvironmentData=()=>{
  136 + let params={
  137 + targetId:proxy.targetId,
  138 + // busId:proxy.bizId,
  139 + // resId:proxy.resTypeArr,
  140 + page:proxy.page,
  141 + pageSize:proxy.pageSize
  142 +
  143 + }
  144 + console.log("*/*/*",proxy.targetId)
  145 +
  146 + proxy.$http.get('/api-web/fault/conf/base/getFaultBaseAllResInfo',params,function (res){
  147 + if(res && res.data){
  148 + proxy.count = res.count;
  149 + proxy.tableDataList=res.data;
  150 + proxy.$emit('baseCount',proxy.count);
  151 + }
  152 + })
  153 +
  154 +
  155 + }
  156 +
157 return { 157 return {
  158 +
  159 + getEnvironmentData,
158 loadTableDataList, 160 loadTableDataList,
159 page, 161 page,
160 pageSize, 162 pageSize,
@@ -181,21 +183,7 @@ export default { @@ -181,21 +183,7 @@ export default {
181 }, 183 },
182 methods: { 184 methods: {
183 185
184 - //取消节点列表配置  
185 - cancleList(){  
186 - this.APMVisible=false;  
187 -  
188 - },  
189 - //保存节点添加配置  
190 - saveList(){  
191 - this.APMVisible=false;  
192 - },  
193 -  
194 186
195 - //关闭弹框  
196 - closeDialog(){  
197 - this.$emit('callbackLog', 'base');  
198 - },  
199 //删除表格指标 187 //删除表格指标
200 deleteItem(item){ 188 deleteItem(item){
201 let that=this; 189 let that=this;
@@ -215,39 +203,7 @@ export default { @@ -215,39 +203,7 @@ export default {
215 }) 203 })
216 204
217 }, 205 },
218 - //获取基础环境资源列表数据  
219 - getEnvironmentData(){  
220 - let that=this;  
221 - let params={  
222 - busId:this.bizId,  
223 - resId:this.resTypeArr,  
224 - page:this.page,  
225 - pageSize:this.pageSize  
226 -  
227 - }  
228 - console.log("*/*/*",this.targetId)  
229 - if(this.targetId){  
230 - //详情页面  
231 - this.isDetail=true;  
232 - this.$http.get('/api-web/fault/conf/base/getFaultBaseAllResInfo',params,function (res){  
233 - if(res && res.data){  
234 - that.count = res.count;  
235 - that.tableDataList=res.data;  
236 - that.$emit('baseCount',that.count);  
237 - }  
238 - })  
239 - }else{  
240 - this.isDetail=false;  
241 - this.$http.get('/api-web/fault/base/config/page',params,function (res){  
242 - if(res && res.data){  
243 - that.count = res.count;  
244 - that.tableDataList=res.data;  
245 - that.$emit('baseCount',that.count);  
246 - }  
247 - })  
248 - }  
249 206
250 - }  
251 207
252 208
253 209
  1 +<cm-dialog :title="titleName" width="90%" :showDialogVisible="baseVisible" @hidedialog="closeDialog" :showFooter="false">
  2 + <template v-slot>
  3 + <el-row>
  4 + <el-col :span="24">
  5 +
  6 + <div class="set-add-div margin-30">
  7 + <el-row>
  8 + <el-col :span="24">
  9 + <div class="flex-div-start margin-top-bottom-10">
  10 + <!-- <span class="fault-book-input-text context-select-text">选择类型</span>-->
  11 + <!-- <el-select class="margin-right-10" v-model="busTypeArr" filterable clearable collapse-tags placeholder="从业务选择">
  12 + <el-option
  13 + v-for="item in busTypeList"
  14 + :label="item.busTypeName" :value="item.busId"></el-option>
  15 + </el-select>-->
  16 +
  17 + <!--<el-dropdown class="margin-right-10">
  18 + <cm-res-type-tree-input multiple clearable collapseTags @callback="getResType"/>
  19 + </el-dropdown>
  20 + -->
  21 +
  22 + <!--<el-select class="margin-right-10" v-model="resTypeArr" @change="changeRes" filterable clearable collapse-tags placeholder="从资源选择">
  23 + <el-option
  24 + v-for="item in resTypeList"
  25 + :label="item.resName" :value="item.resId"></el-option>
  26 + </el-select>-->
  27 +
  28 + <!--<el-input style="width:160px;" class="margin-right-10" v-model="keyWords" placeholder="输入关键字" />-->
  29 +
  30 + <div class="flex-div-start">
  31 + <!-- <el-button type="primary" @click="onReset()">重置</el-button>
  32 + <el-button type="primary" @click="onBtnSearch()" style="margin-left: 10px">查询</el-button>-->
  33 + <el-button type="primary" :disabled="isLoading" @click="saveAll()">批量添加</el-button>
  34 + <el-button type="primary" :disabled="isLoading" @click="saveAlldata()" style="margin-left: 10px">全部添加</el-button>
  35 + </div>
  36 + </div>
  37 + </el-col>
  38 + </el-row>
  39 + <el-row class="margin-bottom-50">
  40 + <el-col :span="24" class="overflow-scroll-y">
  41 + <cm-table-page v-if="tableDataList" :columns="columns" :dataList="tableDataList" @loaddata="loadTableDataList"
  42 + :showIndex="true" :total="count" :showSelection="true" @selectionChange="selectionChange"
  43 + :showBorder="true" :loading="false" :pageSize="pageSize"
  44 + :showPage="true" :showTools="true" :height="(height - 500)">
  45 + <!-- <template #default="{row,prop,column}">
  46 + <div v-if="prop == 'kpiName'" class="list-data">
  47 + <span class="list-data-text">{{row.kpiName }}</span>
  48 + <img :id="row.index" @click="deleteItem(row)" src="./src/assets/images/faultDiagnosis/icon-item-delete.png" class="img-delete cursorClass">
  49 +
  50 + </div>
  51 + </template>-->
  52 + <template #tools="{scope}">
  53 + <el-button type="text" size="small" @click.prevent="addRes(scope.row,scope.$index)">
  54 + <i class="el-icon-plus"/> 添加
  55 + </el-button>
  56 + </template>
  57 + </cm-table-page>
  58 + </el-col>
  59 +
  60 + </el-row>
  61 +
  62 +
  63 + </div>
  64 +
  65 +
  66 + </el-col>
  67 +
  68 +
  69 + </el-row>
  70 + <div class="margin-top flex-center position-bottom">
  71 + <el-button @click="cancleList">取消</el-button>
  72 +<!-- <el-button @click="saveList" type="primary">保存</el-button>-->
  73 + </div>
  74 + </template>
  75 +</cm-dialog>
  1 +export default {
  2 + name: 'basicEnvironmentAdd',
  3 + template: '',
  4 + components: {},
  5 + props:['propsData','isDisplay'],
  6 + data () {
  7 + return {
  8 + columns:[
  9 + {
  10 + prop: 'resTypeName',
  11 + label: '资源类型',
  12 + sortable: true,
  13 + align: 'center',
  14 + width:'120'
  15 + },
  16 + {
  17 + prop: 'resName',
  18 + label: '资源名称',
  19 + sortable: true,
  20 + align: 'center',
  21 + },
  22 + {
  23 + prop: 'ipAddr',
  24 + label: 'ip地址',
  25 + sortable: true,
  26 + align: 'center',
  27 + width:'150'
  28 + },
  29 +
  30 + {
  31 + prop: 'kpiName',
  32 + label: '指标名称',
  33 + sortable: true,
  34 + align: 'center',
  35 + width:'180'
  36 + },
  37 + {
  38 + prop: 'flag',
  39 + label: '指标标识',
  40 + sortable: true,
  41 + align: 'center',
  42 + width:'150'
  43 + }
  44 + ]
  45 +
  46 + }
  47 + },
  48 + computed: {},
  49 + setup(props){
  50 + const {proxy} = Vue.getCurrentInstance();
  51 + let id = proxy.$global.getQueryVariable('configId') ;
  52 + let config = Vue.ref(id == false ? null : id);
  53 + let count=Vue.ref(0);
  54 + let tableDataList = Vue.ref([]);
  55 + let resTypeArr = Vue.ref();
  56 + let kpiTypeArr = Vue.ref([]);
  57 + let busTypeArr = Vue.ref([]);
  58 + let keyWords= Vue.ref('');
  59 + let resTypeList = Vue.ref([]);
  60 + let kpiList = Vue.ref([]);
  61 + let busTypeList = Vue.ref([]);
  62 + let bizId=Vue.ref();//所属业务id
  63 + let targetId=Vue.ref();//所属模块id
  64 + let page=Vue.ref(1);//当前页
  65 + let pageSize=Vue.ref(10);//每页显示条数
  66 + //是否是详情页面
  67 + let isDetail=Vue.ref(false);
  68 + let titleName=Vue.ref('基础环境配置');
  69 + let modleId=Vue.ref();//模块id
  70 + let faultConfId=Vue.ref();
  71 + let bizName=Vue.ref();
  72 + let name=Vue.ref();
  73 + let baseVisible=Vue.ref(false);
  74 + let isLoading=Vue.ref(false);
  75 +
  76 + // 监听编辑状态
  77 + Vue.watch(()=>props.isDisplay,(newValue, oldValue)=>{
  78 + console.log("base",newValue)
  79 + proxy.baseVisible=newValue;
  80 + if(newValue){
  81 + proxy.setBizId();
  82 + proxy.getEnvironmentData();
  83 + }
  84 +
  85 + })
  86 +
  87 + let init = () =>{
  88 + let params={
  89 + busId: proxy.bizId
  90 + }
  91 + proxy.$http.get("/api-web/fault/conf/resource/getResourceByBusId", params, function(res) {
  92 + if (res && res.data) {
  93 + proxy.resTypeList = res.data;
  94 + }
  95 + })
  96 +
  97 + /* proxy.$http.get("/api-web/home/business/findAllBusType", {}, function(res) {
  98 + if (res && res.data) {
  99 + proxy.busTypeList = res.data;
  100 + }
  101 + })*/
  102 + }
  103 + let onReset = () => {
  104 + proxy.keyWords = '';
  105 + proxy.resTypeArr = '';
  106 + proxy.kpiTypeArr = [];
  107 + proxy.busTypeArr = [];
  108 + }
  109 + // 点击按钮搜索
  110 + let onBtnSearch = () => {
  111 + proxy.getEnvironmentData();
  112 + }
  113 + //获取接收到的传值 bizid
  114 + let setBizId=()=>{
  115 + console.log("props.propsData",props.propsData)
  116 + if(props.propsData){
  117 + proxy.bizId=props.propsData.bizId;
  118 + proxy.targetId=props.propsData.targetId;
  119 + proxy.busTypeArr=[props.propsData.bizId];
  120 + proxy.faultConfId=props.propsData.faultConfId;
  121 + proxy.bizName=props.propsData.bizName;
  122 + proxy.modleId=props.propsData.modleId;
  123 + proxy.name=props.propsData.name;
  124 + }
  125 +
  126 + }
  127 +
  128 +
  129 + //资源类型改变查找基础列表
  130 + let changeRes=(val)=>{
  131 + console.log(val)
  132 + proxy.getEnvironmentData();
  133 +
  134 + }
  135 + //重新加载表格数据
  136 + let loadTableDataList = ({page, limit}) => {
  137 + proxy.page=page;
  138 + proxy.pageSize=limit;
  139 + proxy.getEnvironmentData()
  140 + }
  141 + //获取基础环境资源列表数据
  142 + let getEnvironmentData=()=>{
  143 + let params={
  144 + busId:proxy.bizId,
  145 + resId:proxy.resTypeArr,
  146 + page:proxy.page,
  147 + pageSize:proxy.pageSize
  148 +
  149 + }
  150 +
  151 + proxy.$http.get('/api-web/fault/base/config/page',params,function (res){
  152 +
  153 + if(res && res.data){
  154 + proxy.count = res.count;
  155 + proxy.tableDataList=res.data;
  156 + // proxy.$emit('baseCount',proxy.count);
  157 + }
  158 + })
  159 +
  160 +
  161 + }
  162 + //单个添加基础环境
  163 + let addRes=(row,index)=>{
  164 + let baseList=row;
  165 +
  166 + let params={
  167 + targetId:proxy.targetId,
  168 + baseList:[baseList]
  169 + }
  170 +
  171 + proxy.$http.post('/api-web/fault/conf/base/batchAddBaseInfo',params,function (res){
  172 + if(res && res.success){
  173 + proxy.$global.showMsg('添加成功','success');
  174 + proxy.targetId=res.str;
  175 + proxy.saveModel();
  176 + // proxy.applicationMonitorVisible=false;
  177 + }else{
  178 + proxy.$global.showMsg('添加失败','warning');
  179 +
  180 + }
  181 +
  182 + })
  183 + }
  184 + //全部添加
  185 + let saveAlldata=()=>{
  186 + if(proxy.count==0){
  187 + proxy.$global.showMsg('暂无配置','warning');
  188 + }else{
  189 + proxy.isLoading=true;
  190 + let params={
  191 + busId:proxy.bizId,
  192 + targetId:proxy.targetId,
  193 + }
  194 + proxy.$http.post('/api-web/fault/conf/base/saveOrUpdate',params,function (res){
  195 + if(res && res.success){
  196 + if(res.count==0){
  197 + proxy.$global.showMsg(res.msg,'warning');
  198 + }else{
  199 + proxy.$global.showMsg('添加成功','success');
  200 + proxy.targetId=res.str;
  201 + proxy.saveModel();
  202 + }
  203 +
  204 + }else{
  205 + proxy.$global.showMsg('基础环境保存失败','warning')
  206 +
  207 + }
  208 + proxy.isLoading=false;
  209 +
  210 + },function (err){
  211 + proxy.isLoading=false;
  212 +
  213 + })
  214 + }
  215 +
  216 + }
  217 + //表格全选事件
  218 + let selectionChange=(val)=>{
  219 + proxy.tableDataList.map((v,i)=>{
  220 +
  221 + v.checked=false;
  222 +
  223 + })
  224 + let selectData=val;
  225 + if(selectData.length>0){
  226 + selectData.map((item,index)=>{
  227 + proxy.tableDataList.map((v,i)=>{
  228 + if(item.id==v.id){
  229 + v.checked=true;
  230 + }
  231 + })
  232 + })
  233 +
  234 + }else{
  235 + proxy.tableDataList.map((v,i)=>{
  236 + v.checked=false;
  237 + })
  238 + }
  239 + }
  240 + //添加选中的
  241 + let saveAll=()=>{
  242 + let baseListSelectData=[];
  243 + proxy.tableDataList.map(item=>{
  244 + if(item.checked){
  245 + baseListSelectData.push(item)
  246 + }
  247 +
  248 + })
  249 + if(baseListSelectData.length==0){
  250 + proxy.$global.showMsg('请选择配置','warning');
  251 + }else{
  252 + proxy.isLoading=true;
  253 +
  254 + let params={
  255 + targetId:proxy.targetId,
  256 + baseList:baseListSelectData
  257 + }
  258 +
  259 + proxy.$http.post('/api-web/fault/conf/base/batchAddBaseInfo',params,function (res){
  260 + if(res && res.success){
  261 + proxy.$global.showMsg('添加成功','success');
  262 + proxy.targetId=res.str;
  263 + proxy.saveModel();
  264 + // proxy.applicationMonitorVisible=false;
  265 + }else{
  266 + proxy.$global.showMsg('添加失败','warning');
  267 +
  268 + }
  269 + proxy.isLoading=false;
  270 +
  271 + })
  272 + }
  273 +
  274 + }
  275 + //关闭弹框
  276 + let closeDialog=()=>{
  277 + let obj={
  278 + targetId:proxy.targetId,
  279 + faultConfId:proxy.faultConfId,
  280 +
  281 + }
  282 + proxy.$emit('callbackBase',obj);
  283 + }
  284 + return {
  285 + isLoading,
  286 + closeDialog,
  287 + addRes,
  288 + saveAlldata,
  289 + saveAll,
  290 + selectionChange,
  291 + titleName,
  292 + faultConfId,
  293 + bizName,
  294 + name,
  295 + modleId,
  296 + baseVisible,
  297 + getEnvironmentData,
  298 + loadTableDataList,
  299 + page,
  300 + pageSize,
  301 + isDetail,
  302 + changeRes,
  303 + setBizId,
  304 + bizId,
  305 + targetId,
  306 + config,
  307 + count,
  308 + tableDataList,
  309 + kpiList,
  310 + busTypeList,
  311 + keyWords,
  312 + resTypeArr,
  313 + kpiTypeArr,
  314 + busTypeArr,
  315 + resTypeList,
  316 + init,
  317 + onReset,
  318 + onBtnSearch
  319 + }
  320 +
  321 + },
  322 + methods: {
  323 +
  324 + //取消节点列表配置
  325 + cancleList(){
  326 + this.baseVisible=false;
  327 +
  328 + },
  329 + //保存节点添加配置
  330 + saveList(){
  331 + this.baseVisible=false;
  332 + },
  333 +
  334 + //删除表格指标
  335 + deleteItem(item){
  336 + let that=this;
  337 + this.$global.confirm("确认删除指标吗?", function () {
  338 + let params = {
  339 + id: item.id
  340 + }
  341 + that.$http.get('/api-web/fault/conf/base/deleteById', params, function (res) {
  342 + if (res) {
  343 + that.$global.showMsg('删除成功');
  344 + that.getEnvironmentData();
  345 +
  346 + }
  347 + that.$emit('callbackDelete', item)
  348 +
  349 + })
  350 + })
  351 +
  352 + },
  353 + //保存模块
  354 + saveModel(){
  355 + let that=this;
  356 + let params={
  357 + type:'base',
  358 + targetId:this.targetId,
  359 + state:'1',
  360 + id:this.modleId,
  361 + faultConfig:{
  362 + id:this.faultConfId,
  363 + name:this.name,
  364 + bizId: this.bizId,
  365 + bizName:this.bizName,
  366 + createBy:localStorage.getItem("lgn")
  367 + }
  368 + }
  369 + this.$http.post('/api-web/fault/conf/detail/saveConfigDetail',params,function (res){
  370 + if(res && res.success){
  371 + that.targetId=res.map.configDetail.targetId;
  372 + that.faultConfId=res.map.configDetail.faultConfig.id;
  373 +
  374 + // that.$global.showMsg('保存成功','success')
  375 + // that.switchModel();
  376 + that.baseVisible=false;
  377 +
  378 + }else{
  379 + that.$global.showMsg('模块保存失败','warning')
  380 +
  381 + }
  382 +
  383 + })
  384 + }
  385 +
  386 +
  387 +
  388 +
  389 + },
  390 + mounted () {
  391 +
  392 + this.setBizId();
  393 + this.init();
  394 + this.getEnvironmentData();
  395 + },
  396 + unmounted () {}
  397 +
  398 +}
@@ -230,15 +230,21 @@ @@ -230,15 +230,21 @@
230 </el-col> 230 </el-col>
231 </el-row> 231 </el-row>
232 <el-row> 232 <el-row>
233 - <el-col :span="24"> 233 + <el-col :span="24" class="flex-div-start">
234 <div class="context-radio flex-div-start margin-30"> 234 <div class="context-radio flex-div-start margin-30">
235 <span class="fault-book-input-text">状态选择</span> 235 <span class="fault-book-input-text">状态选择</span>
236 <el-radio v-model="faultEnvironmentRadio" label="1">启用</el-radio> 236 <el-radio v-model="faultEnvironmentRadio" label="1">启用</el-radio>
237 <el-radio v-model="faultEnvironmentRadio" label="0">不启用</el-radio> 237 <el-radio v-model="faultEnvironmentRadio" label="0">不启用</el-radio>
238 </div> 238 </div>
  239 + <div class="flex-div margin-30 btn-el-btn margin-bottom-10" v-if="faultEnvironmentRadio==1">
  240 + <el-button class="multiple-choice-button color-999" @click="addBaseMonitor()">添加基础环境</el-button>
  241 + <img style="top:0;" src="./src/assets/images/faultDiagnosis/icon-item-add.png" class="multiple-choice-add-icon">
  242 + </div>
239 </el-col> 243 </el-col>
  244 +
240 </el-row> 245 </el-row>
241 - <BasicEnvironment v-if="faultEnvironmentRadio==1" :propsData="propsData" @baseCount="baseCount" @callbackDelete="deleteEnvironment"></BasicEnvironment> 246 +
  247 + <BasicEnvironment ref="basic" v-if="faultEnvironmentRadio==1" :isBaseDetail="isBaseDetail" :propsData="propsData" @baseCount="baseCount" @callbackDelete="deleteEnvironment"></BasicEnvironment>
242 248
243 <!-- <el-row> 249 <!-- <el-row>
244 <el-col :span="24"> 250 <el-col :span="24">
@@ -413,6 +419,8 @@ @@ -413,6 +419,8 @@
413 <DiagnosisNet v-show="networkMonitorVisible" :isDisplay="networkMonitorVisible" :propsData="propsData" @callback="getNetworkMonitorList" ></DiagnosisNet> 419 <DiagnosisNet v-show="networkMonitorVisible" :isDisplay="networkMonitorVisible" :propsData="propsData" @callback="getNetworkMonitorList" ></DiagnosisNet>
414 <!--应用检测弹框--> 420 <!--应用检测弹框-->
415 <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 + <!--基础环境弹框-->
  423 + <BasicEnvironmentAdd v-show="baseVisible" :isDisplay="baseVisible" :propsData="propsData" @callbackBase="getBasicEnvironmentList"></BasicEnvironmentAdd>
416 <!--APM弹框--> 424 <!--APM弹框-->
417 <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>
418 <!--日志监测弹框--> 426 <!--日志监测弹框-->
@@ -8,6 +8,9 @@ export default { @@ -8,6 +8,9 @@ export default {
8 'ApplicationMoni': Vue.defineAsyncComponent( 8 'ApplicationMoni': Vue.defineAsyncComponent(
9 () => myImport('views/faultDiagnosis/components/applicationMoni/index') 9 () => myImport('views/faultDiagnosis/components/applicationMoni/index')
10 ),//应用监测组件 10 ),//应用监测组件
  11 + 'BasicEnvironmentAdd': Vue.defineAsyncComponent(
  12 + () => myImport('views/faultDiagnosis/components/basicEnvironmentAdd/index')
  13 + ),//基础环境新增组件
11 'APM': Vue.defineAsyncComponent( 14 'APM': Vue.defineAsyncComponent(
12 () => myImport('views/faultDiagnosis/components/APM/index') 15 () => myImport('views/faultDiagnosis/components/APM/index')
13 ),//APM组件 16 ),//APM组件
@@ -103,6 +106,7 @@ export default { @@ -103,6 +106,7 @@ export default {
103 setup(props){ 106 setup(props){
104 const {proxy} = Vue.getCurrentInstance(); 107 const {proxy} = Vue.getCurrentInstance();
105 let applicationMonitorVisible=Vue.ref(false); 108 let applicationMonitorVisible=Vue.ref(false);
  109 + let baseVisible=Vue.ref(false);
106 //btn加载中 110 //btn加载中
107 let isLoading=Vue.ref(false); 111 let isLoading=Vue.ref(false);
108 //所属业务id 112 //所属业务id
@@ -186,11 +190,15 @@ export default { @@ -186,11 +190,15 @@ export default {
186 let baseCount=(val)=>{ 190 let baseCount=(val)=>{
187 proxy.count=val; 191 proxy.count=val;
188 } 192 }
  193 + //基础环境是否为编辑
  194 + let isBaseDetail=Vue.ref(false);
189 return{ 195 return{
  196 + isBaseDetail,
190 count, 197 count,
191 baseCount, 198 baseCount,
192 setDetail, 199 setDetail,
193 applicationMonitorVisible, 200 applicationMonitorVisible,
  201 + baseVisible,
194 modleId, 202 modleId,
195 ruleId, 203 ruleId,
196 ruleName, 204 ruleName,
@@ -303,16 +311,14 @@ export default { @@ -303,16 +311,14 @@ export default {
303 }) 311 })
304 } 312 }
305 313
306 - this.postPropsData('base',index);  
307 - /*if(this.busTypeArr){ 314 + // this.postPropsData('base',index);
308 this.hiddenAll(); 315 this.hiddenAll();
309 this.basicEnvironmentHide = true; 316 this.basicEnvironmentHide = true;
310 this.isActiveIndex=index; 317 this.isActiveIndex=index;
311 this.type='base'; 318 this.type='base';
312 this.state=this.faultEnvironmentRadio; 319 this.state=this.faultEnvironmentRadio;
313 - }else{  
314 - this.$global.showMsg('请选择所属业务','warning')  
315 - }*/ 320 + this.setDetailConfig(this.type)
  321 + this.getBaseList();
316 322
317 }, 323 },
318 //APM 324 //APM
@@ -444,14 +450,26 @@ export default { @@ -444,14 +450,26 @@ export default {
444 break; 450 break;
445 case "base": 451 case "base":
446 //基础环境 452 //基础环境
447 - this.hiddenAll();  
448 - this.basicEnvironmentHide = true;  
449 - this.isActiveIndex=index;  
450 - this.type='base';  
451 - this.state=this.faultEnvironmentRadio; 453 +
  454 + if(this.configData){
  455 + this.configData.map((item,index)=>{
  456 + if(item.type==typeVal){
  457 + item.state='1';
  458 + }
  459 + })
  460 + }
  461 + this.baseVisible=true;
  462 +
452 break; 463 break;
453 case "apm": 464 case "apm":
454 //APM 465 //APM
  466 + if(this.configData){
  467 + this.configData.map((item,index)=>{
  468 + if(item.type==typeVal){
  469 + item.state='1';
  470 + }
  471 + })
  472 + }
455 this.APMVisible=true; 473 this.APMVisible=true;
456 break; 474 break;
457 case "log": 475 case "log":
@@ -618,6 +636,27 @@ export default { @@ -618,6 +636,27 @@ export default {
618 } 636 }
619 }) 637 })
620 }, 638 },
  639 + //点击添加基础环境弹框
  640 + addBaseMonitor(){
  641 + this.postPropsData('base')
  642 + // this.baseVisible=true;
  643 + },
  644 + //关闭基础环境弹框
  645 + getBasicEnvironmentList(itemData){
  646 + this.baseVisible=false;
  647 + if(itemData.faultConfId){
  648 + this.faultConfId=itemData.faultConfId;
  649 + }
  650 + this.setTargetId(itemData.targetId);
  651 + // this.targetId=itemData;
  652 + //获取已添加的环境基础列表
  653 + this.getBaseList();
  654 + },
  655 + getBaseList(){
  656 + console.log('basic',this.$refs.basic)
  657 + this.$refs.basic.getEnvironmentData();
  658 +
  659 + },
621 //点击添加APM弹框 660 //点击添加APM弹框
622 addAPM(){ 661 addAPM(){
623 // this.APMVisible=true; 662 // this.APMVisible=true;
@@ -625,6 +664,7 @@ export default { @@ -625,6 +664,7 @@ export default {
625 664
626 665
627 }, 666 },
  667 +
628 //关闭APM弹框 668 //关闭APM弹框
629 getAPMList(itemData){ 669 getAPMList(itemData){
630 this.APMVisible=false; 670 this.APMVisible=false;
@@ -794,7 +834,7 @@ export default { @@ -794,7 +834,7 @@ export default {
794 } 834 }
795 }else if(this.type=='apm'){ 835 }else if(this.type=='apm'){
796 if(this.apmMonitorList.length==0){ 836 if(this.apmMonitorList.length==0){
797 - this.$global.showMsg('请先选择添加apm配置','warning'); 837 + this.$global.showMsg('请先选择添加APM配置','warning');
798 return; 838 return;
799 } 839 }
800 } 840 }
@@ -841,6 +881,7 @@ export default { @@ -841,6 +881,7 @@ export default {
841 break; 881 break;
842 case "base": 882 case "base":
843 //基础环境 883 //基础环境
  884 + this.isBaseDetail=true;
844 885
845 break; 886 break;
846 case "apm": 887 case "apm":
@@ -945,24 +986,38 @@ export default { @@ -945,24 +986,38 @@ export default {
945 986
946 }else{ 987 }else{
947 this.getTargetId('base') 988 this.getTargetId('base')
948 - let params={  
949 - targetId:this.targetId,  
950 - busId:this.busTypeArr  
951 - }  
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(); 989 that.saveConfigDetailOther();
959 - }else{  
960 - that.$global.showMsg('基础环境保存失败','warning') 990 + /*if(that.faultEnvironmentRadio==1){
  991 + if(this.targetId){
  992 + this.$global.showMsg('环境基础数据已存在,不能重复保存','warning')
961 993
  994 + }else{
  995 + // let params={
  996 + // targetId:this.targetId,
  997 + // busId:this.busTypeArr
  998 + // }
  999 + // this.$http.post('/api-web/fault/conf/base/saveOrUpdate',params,function (res){
  1000 + // if(res && res.success){
  1001 + // that.targetId=res.str;
  1002 + // that.setTargetId(that.targetId)
  1003 + // // that.$global.showMsg(res.msg)
  1004 + // // that.alarmList=res.data;
  1005 + // that.saveConfigDetailOther();
  1006 + // }else{
  1007 + // that.$global.showMsg('基础环境保存失败','warning')
  1008 + //
  1009 + // }
  1010 + // that.isLoading=false;
  1011 + //
  1012 + // })
  1013 + that.saveConfigDetailOther();
962 } 1014 }
963 - that.isLoading=false; 1015 + }else{
  1016 + that.saveConfigDetailOther();
  1017 +
  1018 + }*/
  1019 +
964 1020
965 - })  
966 } 1021 }
967 1022
968 }, 1023 },