Authored by 王涛

Merge branch 'master-500-dev-xwx' into 'master-500-dev'

网卡上行速率添加flag选择弹框



See merge request !460
@@ -1305,23 +1305,47 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele @@ -1305,23 +1305,47 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
1305 linechart.setOption(option); 1305 linechart.setOption(option);
1306 // 折线图的点击事件 1306 // 折线图的点击事件
1307 linechart.off("click"); 1307 linechart.off("click");
1308 - linechart.on('click', function (v) { 1308 + linechart.on('click', function (i) {
  1309 + let array = [];
  1310 + var arrayList;
  1311 + if (data){
  1312 + $.each(data.series, function (i, v) {
  1313 + if (v.flag!=null && v.flag!=undefined){
  1314 + array.push(`<span id="selectFlag" class="layui-badge layui-bg-blue" style="margin:2px;z-index:99999">${v.flag}</span>`+"");
  1315 + }else {
  1316 + array.push('<div style="position:absolute;top:50%;left:50%;">无指标</div>')
  1317 + }
  1318 + });
  1319 + arrayList= array.join(" ");
  1320 + }
  1321 + let flagSelect =layer.open({
  1322 + title: ['指标选择'],
  1323 + type: 1,
  1324 + area: ['30%', '30%'],
  1325 + shadeClose: true,//开启遮罩层
  1326 + id: 'flag_select_div',
  1327 + // content: laytpl(res.body).render(JSON.stringify(params)),
  1328 + content: '<div style="padding: 6px;">'+arrayList+'</div>',
  1329 + });
  1330 + $(document).on('click','#selectFlag',function(v) {
  1331 + layer.close(flagSelect);
  1332 + var seriesName= data.series[i.componentIndex].name;
  1333 + if (data.series[i.componentIndex].name == null ||data.series[i.componentIndex].name == undefined){
  1334 + seriesName = '';
  1335 + }
1309 var params = { 1336 var params = {
1310 resId: resId, 1337 resId: resId,
1311 kpiId: kpiId, 1338 kpiId: kpiId,
1312 - flag: data.series[v.componentIndex].flag, 1339 + flag: v.currentTarget.innerHTML,
1313 warning: false, 1340 warning: false,
1314 ident: true, 1341 ident: true,
1315 trend: true, 1342 trend: true,
1316 - name: (kpiNames&&kpiNames.length>0)?kpiNames[v.componentIndex]:kpiName + ' ' + data.series[v.componentIndex].name //当传入多个kpiName,则将对应kpiId的kpiName获取传入的性能曲线页面 1343 + name: (kpiNames&&kpiNames.length>0)?kpiNames[i.componentIndex]:kpiName + ' ' + seriesName //当传入多个kpiName,则将对应kpiId的kpiName获取传入的性能曲线页面
1317 }; 1344 };
1318 - var seriesName= data.series[v.componentIndex].name;  
1319 - if (data.series[v.componentIndex].name == null ||data.series[v.componentIndex].name == undefined){  
1320 - seriesName = '';  
1321 - }  
1322 common.openLineChart(kpiName + ' ' + seriesName, params); 1345 common.openLineChart(kpiName + ' ' + seriesName, params);
1323 }); 1346 });
1324 }); 1347 });
  1348 + });
1325 }, 1349 },
1326 1350
1327 /** 1351 /**