|
|
<template>
|
|
|
<div :style="styleObj">
|
|
|
<div :style="styleObj" v-if="display" class="fillchart">
|
|
|
<div class="fillContainer-title" :style="titleStyle">
|
|
|
{{ optionsSetup.titleName }}
|
|
|
<!-- <span>(这里是结论建议及结论建议)</span>-->
|
...
|
...
|
@@ -33,7 +33,6 @@ |
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
var per = 60;
|
|
|
import {mapGetters} from "vuex";
|
|
|
export default {
|
|
|
name: "customLiquidFillChart",//百分比图参考:https://www.makeapie.com/editor.html?c=xFkzKG-bpl
|
...
|
...
|
@@ -45,85 +44,8 @@ export default { |
|
|
data() {
|
|
|
return {
|
|
|
visible:false,
|
|
|
// topStyle:'',//水波纹的大小
|
|
|
display:true,
|
|
|
fillData:[],//数据
|
|
|
// topNum:0,//水波纹的大小
|
|
|
// nums:0,
|
|
|
/* options: {
|
|
|
title: {
|
|
|
text: '{nums|' + per + '}{percent|%}',
|
|
|
x: 'center',
|
|
|
y: 'center',
|
|
|
textStyle: {
|
|
|
rich: {
|
|
|
nums: {
|
|
|
fontSize: 60,
|
|
|
color: '#29EEF3',
|
|
|
},
|
|
|
percent: {
|
|
|
fontSize: 30,
|
|
|
color: '#29EEF3',
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
legend: {
|
|
|
type: 'plain',
|
|
|
orient: 'vertical',
|
|
|
right: 0,
|
|
|
top: '10%',
|
|
|
align: 'auto',
|
|
|
data: [{
|
|
|
name: '1',
|
|
|
icon: "circle"
|
|
|
}, {
|
|
|
name: '2',
|
|
|
icon: "circle"
|
|
|
}, {
|
|
|
name: '3',
|
|
|
icon: "circle"
|
|
|
}, {
|
|
|
name: '4',
|
|
|
icon: "circle"
|
|
|
}],
|
|
|
textStyle: {
|
|
|
color: 'white',
|
|
|
fontSize: 16,
|
|
|
padding: [10, 1, 10, 0],
|
|
|
},
|
|
|
selectedMode: false,
|
|
|
},
|
|
|
series: [
|
|
|
{
|
|
|
type: "liquidFill",
|
|
|
data: [0.47],
|
|
|
direction: "right", //波浪方向或者静止
|
|
|
radius: "80%",
|
|
|
// 水球颜色
|
|
|
color: ["#00c2ff"],
|
|
|
center: ["50%", "50%"], //水球位置
|
|
|
// outline 外边
|
|
|
outline: {
|
|
|
// show: false
|
|
|
borderDistance: 3, //内环padding值
|
|
|
itemStyle: {
|
|
|
borderWidth: 8, //圆边线宽度
|
|
|
borderColor: "#00c2ff",
|
|
|
shadowBlur: 10,
|
|
|
shadowColor: 'rgba(63, 218, 255, 0.5)'
|
|
|
}
|
|
|
},
|
|
|
backgroundStyle: {
|
|
|
// borderWidth: 5,
|
|
|
// borderColor: 'rgb(255,0,255,0.9)',
|
|
|
color: 'rgb(255,0,255,0.01)'
|
|
|
},
|
|
|
label: {
|
|
|
show: false
|
|
|
}
|
|
|
}
|
|
|
],
|
|
|
},*/
|
|
|
optionsStyle: {}, // 样式
|
|
|
optionsData: {}, // 数据
|
|
|
optionsCollapse: {}, // 图标属性
|
...
|
...
|
@@ -148,7 +70,7 @@ export default { |
|
|
return {
|
|
|
position: this.ispreview ? "absolute" : "static",
|
|
|
width: this.optionsStyle.width + "px",
|
|
|
height: this.optionsStyle.height + "px",
|
|
|
height: this.display?this.optionsStyle.height + "px":'0',
|
|
|
left: this.optionsStyle.left + "px",
|
|
|
top: this.optionsStyle.top + "px",
|
|
|
background: this.optionsSetup.background,
|
...
|
...
|
@@ -219,7 +141,7 @@ export default { |
|
|
titleStyle(){
|
|
|
let optionsSetup=this.optionsSetup;
|
|
|
return{
|
|
|
'display':optionsSetup.isTitle?'block':'none',
|
|
|
'display':this.display?(optionsSetup.isTitle?'block':'none'):this.display,
|
|
|
'font-size':optionsSetup.titleFontSize+'px',
|
|
|
color: optionsSetup.titleColor,
|
|
|
'font-weight': optionsSetup.titleFontWeight,
|
...
|
...
|
@@ -286,7 +208,11 @@ export default { |
|
|
* 获取使用增长率名称
|
|
|
*/
|
|
|
getIndex2Name(){
|
|
|
switch (this.optionsData.dynamicData.contextData.dataScope) {
|
|
|
let dataScope='';
|
|
|
if(this.optionsData.dynamicData && this.optionsData.dynamicData.contextData.dataScope){
|
|
|
dataScope=this.optionsData.dynamicData.contextData.dataScope;
|
|
|
}
|
|
|
switch (dataScope) {
|
|
|
case 'month':
|
|
|
return "月使用增长率"
|
|
|
case 'quarter':
|
...
|
...
|
@@ -299,6 +225,23 @@ export default { |
|
|
},
|
|
|
editorOptions() {
|
|
|
this.setOptionsData();
|
|
|
this.setIsDisplay();
|
|
|
},
|
|
|
setIsDisplay(){
|
|
|
let propType=this.$route.query.propType;
|
|
|
if(propType=='res'){
|
|
|
let kpiId='';
|
|
|
if(this.optionsData.dynamicData && this.optionsData.dynamicData.contextData){
|
|
|
kpiId=this.optionsData.dynamicData.contextData.kpiId
|
|
|
}
|
|
|
if(kpiId=='KPI922F8FF7'){
|
|
|
this.display=this.$route.query.display=='true'?true:false;
|
|
|
}else{
|
|
|
this.display=true;
|
|
|
}
|
|
|
}else{
|
|
|
this.display=true;
|
|
|
}
|
|
|
},
|
|
|
// 数据解析
|
|
|
setOptionsData() {
|
...
|
...
|
@@ -352,12 +295,10 @@ export default { |
|
|
|
|
|
}else{
|
|
|
this.fillData=[res[0].object];
|
|
|
|
|
|
}
|
|
|
}else{
|
|
|
this.fillData=[{num:0,name:'当前使用率'},{num:0,name:'当前增长率'}]
|
|
|
}
|
|
|
|
|
|
});
|
|
|
},
|
|
|
}
|
...
|
...
|
|