Authored by 鲁尚清

仪表盘配置下探功能

@@ -53,7 +53,7 @@ @@ -53,7 +53,7 @@
53 您确定要对当前指标进行过滤处理? 53 您确定要对当前指标进行过滤处理?
54 </div> 54 </div>
55 <div v-if="dialogName=='performance_trends'" class="txtScroll-top"> 55 <div v-if="dialogName=='performance_trends'" class="txtScroll-top">
56 -<!-- <div>性能趋势{{pressingValue.kpiValue}}</div>--> 56 + <div>性能趋势{{trendSrc}}</div>
57 <iframe :src="trendSrc" class="layadmin-iframe" style="height: 99.5%!important;width: 100%;"/> 57 <iframe :src="trendSrc" class="layadmin-iframe" style="height: 99.5%!important;width: 100%;"/>
58 </div> 58 </div>
59 <div v-if="dialogName=='pressing_times'" class="txtScroll-top"> 59 <div v-if="dialogName=='pressing_times'" class="txtScroll-top">
@@ -88,6 +88,10 @@ export default { @@ -88,6 +88,10 @@ export default {
88 props: { 88 props: {
89 heightStyle: String, 89 heightStyle: String,
90 marginStyle: String, 90 marginStyle: String,
  91 + trendSrc:{
  92 + type:String,
  93 + default:'',
  94 + },
91 tableDataValueHead:{ 95 tableDataValueHead:{
92 type:Object, 96 type:Object,
93 default: {}, 97 default: {},
@@ -150,7 +154,6 @@ export default { @@ -150,7 +154,6 @@ export default {
150 dialogVisible:false,//表格下探后的弹框 154 dialogVisible:false,//表格下探后的弹框
151 widthStyle:';',//弹框宽度样式 155 widthStyle:';',//弹框宽度样式
152 dialogName: '', 156 dialogName: '',
153 - // trendSrc:'',//性能走势图地址  
154 // pressingVisible:'', 157 // pressingVisible:'',
155 pressingValue:'',//压制次数 158 pressingValue:'',//压制次数
156 ignoreCnt:'', 159 ignoreCnt:'',
@@ -158,7 +161,7 @@ export default { @@ -158,7 +161,7 @@ export default {
158 strategyValue:'',//告警策略值 161 strategyValue:'',//告警策略值
159 alarmListData:[],//告警列表数据 162 alarmListData:[],//告警列表数据
160 alarmListValue:[],//告警列表值 163 alarmListValue:[],//告警列表值
161 - trendSrc:'',//性能趋势图地址 164 + // trendSrc:'',//性能趋势图地址
162 } 165 }
163 }, 166 },
164 watch: { 167 watch: {
@@ -230,7 +233,7 @@ export default { @@ -230,7 +233,7 @@ export default {
230 233
231 }else if(itemMenu.type=='performance_trends'){ 234 }else if(itemMenu.type=='performance_trends'){
232 this.widthStyle=''; 235 this.widthStyle='';
233 - this.setTrend(tableDataValueHead); 236 + // this.setTrend(tableDataValueHead);
234 237
235 }else if(itemMenu.type=='pressing_times'){ 238 }else if(itemMenu.type=='pressing_times'){
236 this.widthStyle='width:400px;height: 200px;min-height: 200px;overflow: hidden;'; 239 this.widthStyle='width:400px;height: 200px;min-height: 200px;overflow: hidden;';
@@ -297,7 +300,7 @@ export default { @@ -297,7 +300,7 @@ export default {
297 }) 300 })
298 } 301 }
299 }, 302 },
300 - //设置性能趋势图 303 + /* //设置性能趋势图
301 setTrend(tableDataValueHead){ 304 setTrend(tableDataValueHead){
302 let urlParams='resId='+this.getUrlToken.resId+'&kpiId='+this.pressingValue.kpiId+'&flag='+this.pressingValue.flag+'&warning='+this.pressingValue.isWarning 305 let urlParams='resId='+this.getUrlToken.resId+'&kpiId='+this.pressingValue.kpiId+'&flag='+this.pressingValue.flag+'&warning='+this.pressingValue.isWarning
303 +'&ident='+this.pressingValue.kpiIdent 306 +'&ident='+this.pressingValue.kpiIdent
@@ -306,7 +309,7 @@ export default { @@ -306,7 +309,7 @@ export default {
306 +'&name='+this.pressingValue.kpiName + " " + tableDataValueHead.name; 309 +'&name='+this.pressingValue.kpiName + " " + tableDataValueHead.name;
307 let baseUrl=getTrendBaseUrl(); 310 let baseUrl=getTrendBaseUrl();
308 this.trendSrc=baseUrl+'/vue3/index.html#/vue3/pieDetailLine?'+urlParams+'&access_token='+this.getUrlToken.token; 311 this.trendSrc=baseUrl+'/vue3/index.html#/vue3/pieDetailLine?'+urlParams+'&access_token='+this.getUrlToken.token;
309 - }, 312 + },*/
310 //获取告警策略列表数据 313 //获取告警策略列表数据
311 async getAlarmPolicyData(kpiId){ 314 async getAlarmPolicyData(kpiId){
312 let obj=this.getUrlToken; 315 let obj=this.getUrlToken;
@@ -433,7 +433,21 @@ export const monitorGaugeRate = { @@ -433,7 +433,21 @@ export const monitorGaugeRate = {
433 relactiveDom: 'dataType', 433 relactiveDom: 'dataType',
434 relactiveDomValue: 'staticData', 434 relactiveDomValue: 'staticData',
435 value: [ 435 value: [
436 - {"num":50} 436 + {
  437 + canCA: true,
  438 + flag: "cpu",
  439 + id: "KPI7054BC34",
  440 + ident: "1",
  441 + inCAing: false,
  442 + isWarning: 0,
  443 + kpiLevel: 1,
  444 + kpiName: "CPU使用率",
  445 + kpiUnit: "%",
  446 + name: "CPU使用率",
  447 + resType: "ALI_CLOUD_ECS",
  448 + trend: 1,
  449 + value: "38"
  450 + }
437 ], 451 ],
438 }, 452 },
439 { 453 {
@@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
34 v-for="(itemChild, idx) in header" 34 v-for="(itemChild, idx) in header"
35 :key="idx" 35 :key="idx"
36 :style="[bodyTableStyle, bodyTable(index),tableFiledWidth(idx),tableRowHeight()]" 36 :style="[bodyTableStyle, bodyTable(index),tableFiledWidth(idx),tableRowHeight()]"
37 - @mouseenter="pressingTimes(index,idx)" 37 + @mouseenter="pressingTimes(index,idx,item[itemChild.key],itemChild)"
38 :data-tip="tableFiledMaxWidth('isOverflow'+index+'-'+idx,index,idx,'')" 38 :data-tip="tableFiledMaxWidth('isOverflow'+index+'-'+idx,index,idx,'')"
39 > 39 >
40 <el-tooltip v-if="!itemChild.componentName || itemChild.componentName==1" :disabled="isEllipsis[index+'-'+idx]" ref="elTooltip" trigger="hover" > 40 <el-tooltip v-if="!itemChild.componentName || itemChild.componentName==1" :disabled="isEllipsis[index+'-'+idx]" ref="elTooltip" trigger="hover" >
@@ -53,6 +53,7 @@ @@ -53,6 +53,7 @@
53 :tableDataValue="item[itemChild.key]" :flg="''" 53 :tableDataValue="item[itemChild.key]" :flg="''"
54 :tableDataValueHead="itemChild" 54 :tableDataValueHead="itemChild"
55 :heightStyle="heightStyle" :marginStyle="marginStyle" :tableName="dialogNameStyle(item[itemChild.key])" 55 :heightStyle="heightStyle" :marginStyle="marginStyle" :tableName="dialogNameStyle(item[itemChild.key])"
  56 + :trendSrc="trendSrc"
56 :resType="resType" 57 :resType="resType"
57 ></customMenuBox> 58 ></customMenuBox>
58 </div> 59 </div>
@@ -92,7 +93,7 @@ @@ -92,7 +93,7 @@
92 v-for="(itemChild, idx) in headerAll" 93 v-for="(itemChild, idx) in headerAll"
93 :key="idx" 94 :key="idx"
94 :style="[bodyTableStyle, bodyTable(index),tableFiledWidth(idx),tableRowHeight()]" 95 :style="[bodyTableStyle, bodyTable(index),tableFiledWidth(idx),tableRowHeight()]"
95 - @mouseenter="pressingTimes(index,idx)" 96 + @mouseenter="pressingTimes(index,idx,item[itemChild.key],itemChild)"
96 :data-tip="tableFiledMaxWidth('isOverflow1'+index+'-'+idx,index,idx,'more')" 97 :data-tip="tableFiledMaxWidth('isOverflow1'+index+'-'+idx,index,idx,'more')"
97 > 98 >
98 <el-tooltip v-if="!itemChild.componentName || itemChild.componentName==1" :disabled="isEllipsisMore[index+'-'+idx]" ref="elTooltip" trigger="hover" > 99 <el-tooltip v-if="!itemChild.componentName || itemChild.componentName==1" :disabled="isEllipsisMore[index+'-'+idx]" ref="elTooltip" trigger="hover" >
@@ -118,6 +119,7 @@ @@ -118,6 +119,7 @@
118 :tableDataValue="item[itemChild.key]" :flg="''" 119 :tableDataValue="item[itemChild.key]" :flg="''"
119 :tableDataValueHead="itemChild" 120 :tableDataValueHead="itemChild"
120 :heightStyle="heightStyle" :marginStyle="marginStyle" :tableName="dialogNameStyle(item[itemChild.key])" 121 :heightStyle="heightStyle" :marginStyle="marginStyle" :tableName="dialogNameStyle(item[itemChild.key])"
  122 + :trendSrc="trendSrc"
121 :resType="resType" 123 :resType="resType"
122 ></customMenuBox> 124 ></customMenuBox>
123 </div> 125 </div>
@@ -677,8 +679,10 @@ export default { @@ -677,8 +679,10 @@ export default {
677 } 679 }
678 }, 680 },
679 681
680 - pressingTimes(index,idx){ 682 + pressingTimes(index,idx,item,itemChild){
681 this.pressingVisible=index+'-'+idx; 683 this.pressingVisible=index+'-'+idx;
  684 + this.pressingValue=item;
  685 + this.setTrend(itemChild)
682 }, 686 },
683 closePressingDialog(){ 687 closePressingDialog(){
684 // this.pressingVisible=false; 688 // this.pressingVisible=false;
1 <template> 1 <template>
2 - <div :style="styleObj" @click="isDisplay=false;">  
3 - <div class="title-div flex-start" :style="styleColor" @mouseenter="isDisplay=true;"> 2 + <div :style="styleObj" >
  3 + <div class="title-div flex-start" :style="styleColor" @mouseenter.stop="isDisplay=true;">
4 <img v-if="!imgStyle.titleName" :src="imgStyle.imageAdress" alt=""> 4 <img v-if="!imgStyle.titleName" :src="imgStyle.imageAdress" alt="">
5 <div v-if="imgStyle.titleName" class="title-name">{{imgStyle.titleName}}</div> 5 <div v-if="imgStyle.titleName" class="title-name">{{imgStyle.titleName}}</div>
6 <customMenuBox ref="customMenu" v-if="imgStyle.probeDown && isDisplay" 6 <customMenuBox ref="customMenu" v-if="imgStyle.probeDown && isDisplay"
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 :tableDataValue="tableDataValue" :flg="''" 8 :tableDataValue="tableDataValue" :flg="''"
9 :tableDataValueHead="tableDataValueHead" 9 :tableDataValueHead="tableDataValueHead"
10 :heightStyle="heightStyle" :marginStyle="marginStyle" :tableName="imgStyle.titleName" 10 :heightStyle="heightStyle" :marginStyle="marginStyle" :tableName="imgStyle.titleName"
  11 + :trendSrc="trendSrc"
11 :resType="resType" 12 :resType="resType"
12 ></customMenuBox> 13 ></customMenuBox>
13 14
@@ -19,6 +20,8 @@ @@ -19,6 +20,8 @@
19 <script> 20 <script>
20 import echarts from "echarts"; 21 import echarts from "echarts";
21 import customMenuBox from "../../designerComponents/customMenuBox";//下探组件 22 import customMenuBox from "../../designerComponents/customMenuBox";//下探组件
  23 +import {getTrendBaseUrl} from "@/api/platform";
  24 +
22 export default { 25 export default {
23 name: "gaugeRate", 26 name: "gaugeRate",
24 components: {customMenuBox}, 27 components: {customMenuBox},
@@ -28,11 +31,12 @@ export default { @@ -28,11 +31,12 @@ export default {
28 }, 31 },
29 data() { 32 data() {
30 return { 33 return {
  34 + trendSrc:'',//性能趋势图地址
31 marginStyle:'',//弹框距离顶部距离 35 marginStyle:'',//弹框距离顶部距离
32 heightStyle:'',//弹框遮罩层高度 36 heightStyle:'',//弹框遮罩层高度
33 widthStyle:';',//弹框宽度样式 37 widthStyle:';',//弹框宽度样式
34 isDisplay:false, 38 isDisplay:false,
35 - tableDataValue: {}, 39 + tableDataValue: {kpiId:''},
36 tableDataValueHead: {}, 40 tableDataValueHead: {},
37 resType:'', 41 resType:'',
38 options: { 42 options: {
@@ -213,12 +217,27 @@ export default { @@ -213,12 +217,27 @@ export default {
213 } 217 }
214 return detailMenuBox; 218 return detailMenuBox;
215 }, 219 },
  220 + //设置
216 kpiIdStyle(){ 221 kpiIdStyle(){
  222 + this.$set(this.tableDataValue,'kpiId',this.optionsSetup.kpiId)
  223 + this.tableDataValue.kpiId=this.optionsSetup.kpiId;
  224 + console.log("111",this.tableDataValue)
217 let obj={ 225 let obj={
218 kpiId:this.optionsSetup.kpiId, 226 kpiId:this.optionsSetup.kpiId,
219 targetId:this.optionsSetup.targetId 227 targetId:this.optionsSetup.targetId
220 } 228 }
221 return obj; 229 return obj;
  230 + },
  231 + //获取url地址中的token
  232 + getUrlToken(){
  233 + let locationUrl=this.$route.query;
  234 + let resId=locationUrl.resId;
  235 + let token=locationUrl.access_token;
  236 + let urlObj={
  237 + resId:resId,
  238 + token:token
  239 + }
  240 + return urlObj;
222 } 241 }
223 }, 242 },
224 watch: { 243 watch: {
@@ -341,7 +360,7 @@ export default { @@ -341,7 +360,7 @@ export default {
341 staticDataFn(val) { 360 staticDataFn(val) {
342 const optionsSetup = this.optionsSetup; 361 const optionsSetup = this.optionsSetup;
343 const series = this.options.series; 362 const series = this.options.series;
344 - const num = val[0]['num']; 363 + const num = val[0]['value'];
345 const data = [ 364 const data = [
346 { 365 {
347 value: num 366 value: num
@@ -356,6 +375,8 @@ export default { @@ -356,6 +375,8 @@ export default {
356 } 375 }
357 series[0].data = data 376 series[0].data = data
358 series[0].detail = detail 377 series[0].detail = detail
  378 + console.log("val",val)
  379 + this.setTrend(val[0])
359 }, 380 },
360 dynamicDataFn(val, refreshTime) { 381 dynamicDataFn(val, refreshTime) {
361 if (!val) return; 382 if (!val) return;
@@ -371,6 +392,7 @@ export default { @@ -371,6 +392,7 @@ export default {
371 getEchartData(val) { 392 getEchartData(val) {
372 const data = this.queryEchartsData(val); 393 const data = this.queryEchartsData(val);
373 data.then(res => { 394 data.then(res => {
  395 + this.setTrend(res.map)
374 this.renderingFn(res); 396 this.renderingFn(res);
375 }); 397 });
376 }, 398 },
@@ -392,6 +414,17 @@ export default { @@ -392,6 +414,17 @@ export default {
392 series[0].data = data 414 series[0].data = data
393 series[0].detail = detail 415 series[0].detail = detail
394 }, 416 },
  417 +
  418 + //设置性能趋势图
  419 + setTrend(data){
  420 + let urlParams='resId='+this.getUrlToken.resId+'&kpiId='+this.kpiIdStyle.kpiId+'&flag='+data.flag+'&warning='+data.isWarning
  421 + +'&ident='+data.ident
  422 + +'&trend='+data.trend
  423 + +'&name='+data.name;
  424 + let baseUrl=getTrendBaseUrl();
  425 + this.resType=data.resType;
  426 + this.trendSrc=baseUrl+'/vue3/index.html#/vue3/pieDetailLine?'+urlParams+'&access_token='+this.getUrlToken.token;
  427 + },
395 handleScroll(e){ 428 handleScroll(e){
396 let serviceTop = 44; 429 let serviceTop = 44;
397 430