Authored by 王涛

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

根据树结构的值以及接口的kpiId判断是否显示asm相关的水球,flag下拉,趋势图及预测图



See merge request !97
1 <template> 1 <template>
2 - <div :style="styleObj" v-if="isDisplay"> 2 + <div :style="styleObj" v-if="display">
3 <v-chart v-if="hackReset" :options="options" autoresize/> 3 <v-chart v-if="hackReset" :options="options" autoresize/>
4 </div> 4 </div>
5 </template> 5 </template>
@@ -18,7 +18,7 @@ export default { @@ -18,7 +18,7 @@ export default {
18 return { 18 return {
19 hackReset:true, 19 hackReset:true,
20 chartData:[], 20 chartData:[],
21 - isDisplay:true, 21 + display:true,
22 kpiUnit:'', 22 kpiUnit:'',
23 options: { 23 options: {
24 color: [], 24 color: [],
@@ -134,7 +134,7 @@ export default { @@ -134,7 +134,7 @@ export default {
134 return { 134 return {
135 position: this.ispreview ? "absolute" : "static", 135 position: this.ispreview ? "absolute" : "static",
136 width: this.optionsStyle.width + "px", 136 width: this.optionsStyle.width + "px",
137 - height: this.isDisplay?this.optionsStyle.height + "px":'0', 137 + height: this.display?this.optionsStyle.height + "px":'0',
138 left: this.optionsStyle.left + "px", 138 left: this.optionsStyle.left + "px",
139 top: this.optionsStyle.top + "px", 139 top: this.optionsStyle.top + "px",
140 background: this.optionsSetup.background 140 background: this.optionsSetup.background
@@ -284,6 +284,23 @@ export default { @@ -284,6 +284,23 @@ export default {
284 this.setOptionsLegend(); 284 this.setOptionsLegend();
285 this.setOptionsColor(); 285 this.setOptionsColor();
286 this.setOptionsToolbox(); 286 this.setOptionsToolbox();
  287 + this.setIsDisplay();
  288 + },
  289 + setIsDisplay(){
  290 + let propType=this.$route.query.propType;
  291 + if(propType=='res'){
  292 + let kpiId='';
  293 + if(this.optionsSetup.vuexFlagKpiId){
  294 + kpiId=this.optionsSetup.vuexFlagKpiId
  295 + }
  296 + if(kpiId=='KPI922F8FF7'){
  297 + this.display=this.$route.query.display=='true'?true:false;
  298 + }else{
  299 + this.display=true;
  300 + }
  301 + }else{
  302 + this.display=true;
  303 + }
287 }, 304 },
288 // 标题修改 305 // 标题修改
289 setOptionsTitle() { 306 setOptionsTitle() {
@@ -826,23 +843,6 @@ export default { @@ -826,23 +843,6 @@ export default {
826 }) 843 })
827 } 844 }
828 this.options.series=series; 845 this.options.series=series;
829 - // let arr=[];  
830 - // this.options.series.map(item=>{  
831 - // arr.push(item.data)  
832 - // })  
833 - // let min=this.calMin(arr);  
834 - // let max=this.calMax(arr);  
835 - // if(min<0){  
836 - // this.options.yAxis[1].min=-20;  
837 - // }  
838 - // this.options.yAxis[0].max=max;  
839 - // this.options.yAxis[0].min=min;  
840 - // this.options.yAxis[0].interval=(max-min)/7  
841 - /* if(this.chartData.indexOf(this.optionsData.dynamicData.contextData.flag)!=-1){  
842 - this.isDisplay=true;  
843 - }else{  
844 - this.isDisplay=false;  
845 - }*/  
846 } 846 }
847 } 847 }
848 }; 848 };
1 <template> 1 <template>
2 - <div :style="styleObj"> 2 + <div :style="styleObj" v-if="display">
3 <v-chart v-if="hackReset" :options="options" autoresize/> 3 <v-chart v-if="hackReset" :options="options" autoresize/>
4 </div> 4 </div>
5 </template> 5 </template>
@@ -17,6 +17,7 @@ export default { @@ -17,6 +17,7 @@ export default {
17 data() { 17 data() {
18 return { 18 return {
19 hackReset:true, 19 hackReset:true,
  20 + display:true,
20 options: { 21 options: {
21 grid: {}, 22 grid: {},
22 /*legend: { 23 /*legend: {
@@ -73,7 +74,7 @@ export default { @@ -73,7 +74,7 @@ export default {
73 return { 74 return {
74 position: this.ispreview ? "absolute" : "static", 75 position: this.ispreview ? "absolute" : "static",
75 width: this.optionsStyle.width + "px", 76 width: this.optionsStyle.width + "px",
76 - height: this.optionsStyle.height + "px", 77 + height: this.display?this.optionsStyle.height + "px":'0',
77 left: this.optionsStyle.left + "px", 78 left: this.optionsStyle.left + "px",
78 top: this.optionsStyle.top + "px", 79 top: this.optionsStyle.top + "px",
79 background: this.optionsSetup.background 80 background: this.optionsSetup.background
@@ -125,6 +126,23 @@ export default { @@ -125,6 +126,23 @@ export default {
125 this.setOptionsMargin(); 126 this.setOptionsMargin();
126 // this.setOptionsLegend(); 127 // this.setOptionsLegend();
127 this.setOptionsData(); 128 this.setOptionsData();
  129 + this.setIsDisplay();
  130 + },
  131 + setIsDisplay(){
  132 + let propType=this.$route.query.propType;
  133 + if(propType=='res'){
  134 + let kpiId='';
  135 + if(this.optionsData.dynamicData && this.optionsData.dynamicData.contextData){
  136 + kpiId=this.optionsData.dynamicData.contextData.kpiId
  137 + }
  138 + if(kpiId=='KPI922F8FF7'){
  139 + this.display=this.$route.query.display=='true'?true:false;
  140 + }else{
  141 + this.display=true;
  142 + }
  143 + }else{
  144 + this.display=true;
  145 + }
128 }, 146 },
129 // 标题修改 147 // 标题修改
130 setOptionsTitle() { 148 setOptionsTitle() {
1 <template> 1 <template>
2 - <div :style="styleObj"> 2 + <div :style="styleObj" v-if="display" class="fillchart">
3 <div class="fillContainer-title" :style="titleStyle"> 3 <div class="fillContainer-title" :style="titleStyle">
4 {{ optionsSetup.titleName }} 4 {{ optionsSetup.titleName }}
5 <!-- <span>(这里是结论建议及结论建议)</span>--> 5 <!-- <span>(这里是结论建议及结论建议)</span>-->
@@ -33,7 +33,6 @@ @@ -33,7 +33,6 @@
33 </template> 33 </template>
34 34
35 <script> 35 <script>
36 -var per = 60;  
37 import {mapGetters} from "vuex"; 36 import {mapGetters} from "vuex";
38 export default { 37 export default {
39 name: "customLiquidFillChart",//百分比图参考:https://www.makeapie.com/editor.html?c=xFkzKG-bpl 38 name: "customLiquidFillChart",//百分比图参考:https://www.makeapie.com/editor.html?c=xFkzKG-bpl
@@ -45,85 +44,8 @@ export default { @@ -45,85 +44,8 @@ export default {
45 data() { 44 data() {
46 return { 45 return {
47 visible:false, 46 visible:false,
48 - // topStyle:'',//水波纹的大小 47 + display:true,
49 fillData:[],//数据 48 fillData:[],//数据
50 - // topNum:0,//水波纹的大小  
51 - // nums:0,  
52 - /* options: {  
53 - title: {  
54 - text: '{nums|' + per + '}{percent|%}',  
55 - x: 'center',  
56 - y: 'center',  
57 - textStyle: {  
58 - rich: {  
59 - nums: {  
60 - fontSize: 60,  
61 - color: '#29EEF3',  
62 - },  
63 - percent: {  
64 - fontSize: 30,  
65 - color: '#29EEF3',  
66 - },  
67 - },  
68 - },  
69 - },  
70 - legend: {  
71 - type: 'plain',  
72 - orient: 'vertical',  
73 - right: 0,  
74 - top: '10%',  
75 - align: 'auto',  
76 - data: [{  
77 - name: '1',  
78 - icon: "circle"  
79 - }, {  
80 - name: '2',  
81 - icon: "circle"  
82 - }, {  
83 - name: '3',  
84 - icon: "circle"  
85 - }, {  
86 - name: '4',  
87 - icon: "circle"  
88 - }],  
89 - textStyle: {  
90 - color: 'white',  
91 - fontSize: 16,  
92 - padding: [10, 1, 10, 0],  
93 - },  
94 - selectedMode: false,  
95 - },  
96 - series: [  
97 - {  
98 - type: "liquidFill",  
99 - data: [0.47],  
100 - direction: "right", //波浪方向或者静止  
101 - radius: "80%",  
102 - // 水球颜色  
103 - color: ["#00c2ff"],  
104 - center: ["50%", "50%"], //水球位置  
105 - // outline 外边  
106 - outline: {  
107 - // show: false  
108 - borderDistance: 3, //内环padding值  
109 - itemStyle: {  
110 - borderWidth: 8, //圆边线宽度  
111 - borderColor: "#00c2ff",  
112 - shadowBlur: 10,  
113 - shadowColor: 'rgba(63, 218, 255, 0.5)'  
114 - }  
115 - },  
116 - backgroundStyle: {  
117 - // borderWidth: 5,  
118 - // borderColor: 'rgb(255,0,255,0.9)',  
119 - color: 'rgb(255,0,255,0.01)'  
120 - },  
121 - label: {  
122 - show: false  
123 - }  
124 - }  
125 - ],  
126 - },*/  
127 optionsStyle: {}, // 样式 49 optionsStyle: {}, // 样式
128 optionsData: {}, // 数据 50 optionsData: {}, // 数据
129 optionsCollapse: {}, // 图标属性 51 optionsCollapse: {}, // 图标属性
@@ -148,7 +70,7 @@ export default { @@ -148,7 +70,7 @@ export default {
148 return { 70 return {
149 position: this.ispreview ? "absolute" : "static", 71 position: this.ispreview ? "absolute" : "static",
150 width: this.optionsStyle.width + "px", 72 width: this.optionsStyle.width + "px",
151 - height: this.optionsStyle.height + "px", 73 + height: this.display?this.optionsStyle.height + "px":'0',
152 left: this.optionsStyle.left + "px", 74 left: this.optionsStyle.left + "px",
153 top: this.optionsStyle.top + "px", 75 top: this.optionsStyle.top + "px",
154 background: this.optionsSetup.background, 76 background: this.optionsSetup.background,
@@ -219,7 +141,7 @@ export default { @@ -219,7 +141,7 @@ export default {
219 titleStyle(){ 141 titleStyle(){
220 let optionsSetup=this.optionsSetup; 142 let optionsSetup=this.optionsSetup;
221 return{ 143 return{
222 - 'display':optionsSetup.isTitle?'block':'none', 144 + 'display':this.display?(optionsSetup.isTitle?'block':'none'):this.display,
223 'font-size':optionsSetup.titleFontSize+'px', 145 'font-size':optionsSetup.titleFontSize+'px',
224 color: optionsSetup.titleColor, 146 color: optionsSetup.titleColor,
225 'font-weight': optionsSetup.titleFontWeight, 147 'font-weight': optionsSetup.titleFontWeight,
@@ -286,7 +208,11 @@ export default { @@ -286,7 +208,11 @@ export default {
286 * 获取使用增长率名称 208 * 获取使用增长率名称
287 */ 209 */
288 getIndex2Name(){ 210 getIndex2Name(){
289 - switch (this.optionsData.dynamicData.contextData.dataScope) { 211 + let dataScope='';
  212 + if(this.optionsData.dynamicData && this.optionsData.dynamicData.contextData.dataScope){
  213 + dataScope=this.optionsData.dynamicData.contextData.dataScope;
  214 + }
  215 + switch (dataScope) {
290 case 'month': 216 case 'month':
291 return "月使用增长率" 217 return "月使用增长率"
292 case 'quarter': 218 case 'quarter':
@@ -299,6 +225,23 @@ export default { @@ -299,6 +225,23 @@ export default {
299 }, 225 },
300 editorOptions() { 226 editorOptions() {
301 this.setOptionsData(); 227 this.setOptionsData();
  228 + this.setIsDisplay();
  229 + },
  230 + setIsDisplay(){
  231 + let propType=this.$route.query.propType;
  232 + if(propType=='res'){
  233 + let kpiId='';
  234 + if(this.optionsData.dynamicData && this.optionsData.dynamicData.contextData){
  235 + kpiId=this.optionsData.dynamicData.contextData.kpiId
  236 + }
  237 + if(kpiId=='KPI922F8FF7'){
  238 + this.display=this.$route.query.display=='true'?true:false;
  239 + }else{
  240 + this.display=true;
  241 + }
  242 + }else{
  243 + this.display=true;
  244 + }
302 }, 245 },
303 // 数据解析 246 // 数据解析
304 setOptionsData() { 247 setOptionsData() {
@@ -352,12 +295,10 @@ export default { @@ -352,12 +295,10 @@ export default {
352 295
353 }else{ 296 }else{
354 this.fillData=[res[0].object]; 297 this.fillData=[res[0].object];
355 -  
356 } 298 }
357 }else{ 299 }else{
358 this.fillData=[{num:0,name:'当前使用率'},{num:0,name:'当前增长率'}] 300 this.fillData=[{num:0,name:'当前使用率'},{num:0,name:'当前增长率'}]
359 } 301 }
360 -  
361 }); 302 });
362 }, 303 },
363 } 304 }
1 <template> 1 <template>
2 - <div class="select-option-container" :style="styleObj"> 2 + <div class="select-option-container" :style="styleObj" v-if="display">
3 <div class="select-option-title" :style="titleStyle"> 3 <div class="select-option-title" :style="titleStyle">
4 <img :src="imgStyle.titleIcon" alt="" class="icon-title"> 4 <img :src="imgStyle.titleIcon" alt="" class="icon-title">
5 {{elTreeBtnTitleName}}{{ transStyle.titleName }} 5 {{elTreeBtnTitleName}}{{ transStyle.titleName }}
@@ -28,6 +28,7 @@ export default { @@ -28,6 +28,7 @@ export default {
28 data() { 28 data() {
29 return { 29 return {
30 selectVal:'', 30 selectVal:'',
  31 + display:true,
31 selectOption:[], 32 selectOption:[],
32 options: {}, 33 options: {},
33 optionsSetUp: {}, 34 optionsSetUp: {},
@@ -78,7 +79,7 @@ export default { @@ -78,7 +79,7 @@ export default {
78 return { 79 return {
79 position: this.ispreview ? "absolute" : "static", 80 position: this.ispreview ? "absolute" : "static",
80 width: allStyle.width + "px", 81 width: allStyle.width + "px",
81 - height: allStyle.height + "px", 82 + height: this.display?allStyle.height + "px":'0',
82 left: allStyle.left + "px", 83 left: allStyle.left + "px",
83 top: allStyle.top + "px", 84 top: allStyle.top + "px",
84 'background':this.transStyle.bgColor, 85 'background':this.transStyle.bgColor,
@@ -120,6 +121,7 @@ export default { @@ -120,6 +121,7 @@ export default {
120 this.optionsData = val.data; 121 this.optionsData = val.data;
121 this.optionsPosition = val.position; 122 this.optionsPosition = val.position;
122 this.handlerData(); 123 this.handlerData();
  124 + this.setIsDisplay();
123 125
124 }, 126 },
125 deep: true 127 deep: true
@@ -133,9 +135,26 @@ export default { @@ -133,9 +135,26 @@ export default {
133 this.optionsPosition = this.value.position; 135 this.optionsPosition = this.value.position;
134 this.handlerData(); 136 this.handlerData();
135 // this.selectChange(null) 137 // this.selectChange(null)
136 - 138 + this.setIsDisplay();
137 }, 139 },
138 methods: { 140 methods: {
  141 + setIsDisplay(){
  142 + let propType=this.$route.query.propType;
  143 + if(propType=='res'){
  144 + let kpiId='';
  145 +
  146 + if(this.optionsData.dynamicData && this.optionsData.dynamicData.contextData){
  147 + kpiId=this.optionsData.dynamicData.contextData.kpiId
  148 + }
  149 + if(kpiId=='KPI922F8FF7'){
  150 + this.display=this.$route.query.display=='true'?true:false;
  151 + }else{
  152 + this.display=true;
  153 + }
  154 + }else{
  155 + this.display=true;
  156 + }
  157 + },
139 //选项是否加全部 158 //选项是否加全部
140 pushAll(){ 159 pushAll(){
141 if(this.optionsSetUp.isAll){ 160 if(this.optionsSetUp.isAll){
@@ -249,8 +249,13 @@ export default { @@ -249,8 +249,13 @@ export default {
249 btnTitleName='&btnTitleName='+data.typeName; 249 btnTitleName='&btnTitleName='+data.typeName;
250 titleName='&titleName='+data.typeName; 250 titleName='&titleName='+data.typeName;
251 } 251 }
252 -  
253 - this.iframeSrc=srcName+tokenUrl+busId+resId+resType+btnTitleName+titleName; 252 + let display='&propType='+data.propType;
  253 + if(data.propType=='res'){
  254 + display+='&display='+(data.display?data.display:false);
  255 + }else{
  256 + display+='&display=true';
  257 + }
  258 + this.iframeSrc=srcName+tokenUrl+busId+resId+resType+btnTitleName+titleName+display;
254 }, 259 },
255 editorOptions() { 260 editorOptions() {
256 this.setOptionsData(); 261 this.setOptionsData();