Merge branch 'master-500-dev-xwx' into 'master-500-dev'
详情页折线图指标flag选择优化 See merge request !462
Showing
1 changed file
with
50 additions
and
3 deletions
@@ -1308,6 +1308,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -1308,6 +1308,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
1308 | linechart.on('click', function (i) { | 1308 | linechart.on('click', function (i) { |
1309 | let array = []; | 1309 | let array = []; |
1310 | var arrayList; | 1310 | var arrayList; |
1311 | + if(kpiName=='网卡上行速率'||kpiName=='网卡下行速率'){ | ||
1311 | if (data){ | 1312 | if (data){ |
1312 | $.each(data.series, function (i, v) { | 1313 | $.each(data.series, function (i, v) { |
1313 | if (v.flag!=null && v.flag!=undefined){ | 1314 | if (v.flag!=null && v.flag!=undefined){ |
@@ -1317,7 +1318,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -1317,7 +1318,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
1317 | } | 1318 | } |
1318 | }); | 1319 | }); |
1319 | arrayList= array.join(" "); | 1320 | arrayList= array.join(" "); |
1320 | - } | 1321 | + if (data.series.length>1){ |
1321 | let flagSelect =layer.open({ | 1322 | let flagSelect =layer.open({ |
1322 | title: ['指标flag选择'], | 1323 | title: ['指标flag选择'], |
1323 | type: 1, | 1324 | type: 1, |
@@ -1330,13 +1331,17 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -1330,13 +1331,17 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
1330 | $(document).on('click','#selectFlag',function(v) { | 1331 | $(document).on('click','#selectFlag',function(v) { |
1331 | layer.close(flagSelect); | 1332 | layer.close(flagSelect); |
1332 | var seriesName= data.series[i.componentIndex].name; | 1333 | var seriesName= data.series[i.componentIndex].name; |
1333 | - if (data.series[i.componentIndex].name == null ||data.series[i.componentIndex].name == undefined){ | 1334 | + if (seriesName == null ||seriesName == undefined) { |
1334 | seriesName = ''; | 1335 | seriesName = ''; |
1335 | } | 1336 | } |
1337 | + var seriesFlag= data.series[i.componentIndex].flag; | ||
1338 | + if (seriesFlag == null ||seriesFlag == undefined) { | ||
1339 | + seriesFlag = ''; | ||
1340 | + } | ||
1336 | var params = { | 1341 | var params = { |
1337 | resId: resId, | 1342 | resId: resId, |
1338 | kpiId: kpiId, | 1343 | kpiId: kpiId, |
1339 | - flag: v.currentTarget.innerHTML, | 1344 | + flag: seriesFlag, |
1340 | warning: false, | 1345 | warning: false, |
1341 | ident: true, | 1346 | ident: true, |
1342 | trend: true, | 1347 | trend: true, |
@@ -1344,6 +1349,48 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -1344,6 +1349,48 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
1344 | }; | 1349 | }; |
1345 | common.openLineChart(kpiName + ' ' + seriesName, params); | 1350 | common.openLineChart(kpiName + ' ' + seriesName, params); |
1346 | }); | 1351 | }); |
1352 | + }else { | ||
1353 | + var seriesName= data.series[i.componentIndex].name; | ||
1354 | + if (seriesName == null ||seriesName == undefined) { | ||
1355 | + seriesName = ''; | ||
1356 | + } | ||
1357 | + var seriesFlag= data.series[i.componentIndex].flag; | ||
1358 | + if (seriesFlag == null ||seriesFlag == undefined) { | ||
1359 | + seriesFlag = ''; | ||
1360 | + } | ||
1361 | + var params = { | ||
1362 | + resId: resId, | ||
1363 | + kpiId: kpiId, | ||
1364 | + flag: seriesFlag, | ||
1365 | + warning: false, | ||
1366 | + ident: true, | ||
1367 | + trend: true, | ||
1368 | + name: (kpiNames&&kpiNames.length>0)?kpiNames[i.componentIndex]:kpiName + ' ' + seriesName //当传入多个kpiName,则将对应kpiId的kpiName获取传入的性能曲线页面 | ||
1369 | + }; | ||
1370 | + common.openLineChart(kpiName + ' ' + seriesName, params); | ||
1371 | + } | ||
1372 | + } | ||
1373 | + | ||
1374 | + }else { | ||
1375 | + var seriesName= data.series[i.componentIndex].name; | ||
1376 | + if (seriesName == null ||seriesName == undefined) { | ||
1377 | + seriesName = ''; | ||
1378 | + } | ||
1379 | + var seriesFlag= data.series[i.componentIndex].flag; | ||
1380 | + if (seriesFlag == null ||seriesFlag == undefined) { | ||
1381 | + seriesFlag = ''; | ||
1382 | + } | ||
1383 | + var params = { | ||
1384 | + resId: resId, | ||
1385 | + kpiId: kpiId, | ||
1386 | + flag: seriesFlag, | ||
1387 | + warning: false, | ||
1388 | + ident: true, | ||
1389 | + trend: true, | ||
1390 | + name: (kpiNames&&kpiNames.length>0)?kpiNames[i.componentIndex]:kpiName + ' ' + seriesName //当传入多个kpiName,则将对应kpiId的kpiName获取传入的性能曲线页面 | ||
1391 | + }; | ||
1392 | + common.openLineChart(kpiName + ' ' + seriesName, params); | ||
1393 | + } | ||
1347 | }); | 1394 | }); |
1348 | }); | 1395 | }); |
1349 | }, | 1396 | }, |
-
Please register or login to post a comment