Commit c2fc05e3 authored by 刘殿昕's avatar 刘殿昕

柱状图数据,仪表盘配色

parent 87cd7003
...@@ -10,14 +10,15 @@ export default { ...@@ -10,14 +10,15 @@ export default {
type: Object, type: Object,
default: () => { default: () => {
return { return {
data: 40, xaxis: [],
text: "模拟数据1.0" data: []
}; };
} }
}, },
bar_width: { bar_width: {
type: String, type: String,
default: "16px" default: "12px"
}, },
colors: { colors: {
type: Array, type: Array,
...@@ -47,12 +48,23 @@ export default { ...@@ -47,12 +48,23 @@ export default {
xAxis: [ xAxis: [
{ {
type: "category", type: "category",
data: ["2019Q1", "2019Q2", "2019Q3", "2019Q4"], data: self.data.xaxis,
axisLabel: { axisLabel: {
margin: 20, margin: 20,
color: "#0d1847", color: "#0d1847",
textStyle: { textStyle: {
fontSize: 12 fontSize: 12
},
interval: 0,
rotate: 30,
formatter: function(value) {
let valueTxt = "";
if (value.length > 6) {
valueTxt = value.substring(0, 5) + "...";
} else {
valueTxt = value;
}
return valueTxt;
} }
}, },
axisLine: { axisLine: {
...@@ -100,7 +112,7 @@ export default { ...@@ -100,7 +112,7 @@ export default {
series: [ series: [
{ {
type: "bar", type: "bar",
data: [40, 80, 20, 16], data: self.data.data,
barWidth: self.bar_width, barWidth: self.bar_width,
itemStyle: { itemStyle: {
normal: { normal: {
......
...@@ -10,14 +10,18 @@ export default { ...@@ -10,14 +10,18 @@ export default {
type: Object, type: Object,
default: () => { default: () => {
return { return {
data: 40, data: 0,
text: "模拟数据1.0" text: ""
}; };
} }
}, },
dangerousValue: { dangerousValue: {
type: String, type: String,
default: "" default: ""
},
is_word: {
type: Boolean,
default: false
} }
}, },
data: () => ({ data: () => ({
...@@ -31,6 +35,7 @@ export default { ...@@ -31,6 +35,7 @@ export default {
title: [ title: [
{ {
text: self.data.data + "{a|%}", text: self.data.data + "{a|%}",
show: !self.is_word,
x: "center", x: "center",
y: "center", y: "center",
textStyle: { textStyle: {
...@@ -47,6 +52,7 @@ export default { ...@@ -47,6 +52,7 @@ export default {
}, },
{ {
text: self.data.text, text: self.data.text,
show: !self.is_word,
x: "center", x: "center",
y: "58%", y: "58%",
textStyle: { textStyle: {
...@@ -54,6 +60,53 @@ export default { ...@@ -54,6 +60,53 @@ export default {
fontWeight: "normal", fontWeight: "normal",
color: "#707693" color: "#707693"
} }
},
{
text: self.data.text,
show: self.is_word,
x: "center",
y: "74%",
textStyle: {
fontSize: 14,
fontWeight: "normal",
color: "#8890a7"
}
},
{
text: self.data.data + "%",
show: self.is_word,
x: "center",
y: "64%",
textStyle: {
fontSize: 20,
fontWeight: "normal",
color: "#242c43"
}
},
{
text:
self.data.data > 75
? ""
: self.data.data > 50
? ""
: self.data.data > 25
? ""
: "",
show: self.is_word,
x: "center",
y: "40%",
textStyle: {
fontSize: 36,
fontWeight: "normal",
color:
self.data.data > 75
? "#00beb2" //green
: self.data.data > 50
? "#ff7200" //yellow
: self.data.data > 25
? "#da4251" //red
: "#da4251" //red
}
} }
], ],
angleAxis: { angleAxis: {
...@@ -110,12 +163,12 @@ export default { ...@@ -110,12 +163,12 @@ export default {
? "#f7f1d5" ? "#f7f1d5"
: "#d5f7e8" : "#d5f7e8"
: self.data.data > 75 : self.data.data > 75
? "f7f1d5" ? "#d5f7e8"
: self.data.data > 50 : self.data.data > 50
? "#ffd98f" ? "#ffd98f"
: self.data.data > 25 : self.data.data > 25
? "#d5f7e8" ? "#f7f1d5"
: "#d5f7e8" : "#f7f1d5"
}, },
{ {
offset: 1, offset: 1,
...@@ -125,12 +178,12 @@ export default { ...@@ -125,12 +178,12 @@ export default {
? "#da4251" // red ? "#da4251" // red
: "#00beb2" //green : "#00beb2" //green
: self.data.data > 75 : self.data.data > 75
? "#da4251" //red ? "#00beb2" //green
: self.data.data > 50 : self.data.data > 50
? "#ff7200" //yellow ? "#ff7200" //yellow
: self.data.data > 25 : self.data.data > 25
? "#00beb2" //green ? "#da4251" //red
: "#00beb2" //green : "#da4251" //red
} }
]) ])
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="com_card"> <div class="com_card">
<div class="com_card_top"> <div class="com_card_top">
<img <img
:src="cellData.cover" :src="cellData.logo"
class="com_card_img" class="com_card_img"
/> />
<div class="com_card_name_v"> <div class="com_card_name_v">
......
...@@ -475,8 +475,8 @@ export default { ...@@ -475,8 +475,8 @@ export default {
getAppArea() { getAppArea() {
this.$api.serviceShop.getAppArea().then(response => { this.$api.serviceShop.getAppArea().then(response => {
if (response.data.success == 1) { if (response.data.success == 1) {
this.filterLists[1].childDomains = response.data.data; this.filterLists[2].childDomains = response.data.data;
this.refresh_app_1 = true; this.refresh_app_2 = true;
} else { } else {
console.log(response.data.errMsg); console.log(response.data.errMsg);
} }
...@@ -485,8 +485,8 @@ export default { ...@@ -485,8 +485,8 @@ export default {
getAppType() { getAppType() {
this.$api.serviceShop.getAppType().then(response => { this.$api.serviceShop.getAppType().then(response => {
if (response.data.success == 1) { if (response.data.success == 1) {
this.filterLists[2].childDomains = response.data.data; this.filterLists[1].childDomains = response.data.data;
this.refresh_app_2 = true; this.refresh_app_1 = true;
} else { } else {
console.log(response.data.errMsg); console.log(response.data.errMsg);
} }
......
...@@ -11,8 +11,12 @@ ...@@ -11,8 +11,12 @@
<el-col :span="24" class="in_block"> <el-col :span="24" class="in_block">
<block-radius :show_header="true" title="服务总体概况" class="block"> <block-radius :show_header="true" title="服务总体概况" class="block">
<div class="left_1"> <div class="left_1">
<div ref="left_1_l" class="left_1_l"></div> <div ref="left_1_l" class="left_1_l">
<dashboard ref="left_1_r" class="left_1_r"></dashboard> <img :src="require('@/assets/imgs/data_img_service.gif')" class="left_1_img" />
<div class="left_1_title">服务总数</div>
<div class="left_1_num">2222</div>
</div>
<dashboard ref="left_1_r" :data="das_data" :is_word="true" class="left_1_r"></dashboard>
</div> </div>
</block-radius> </block-radius>
</el-col> </el-col>
...@@ -82,7 +86,9 @@ ...@@ -82,7 +86,9 @@
</el-col> </el-col>
<!-- 不可横向铺满,一般为最后一行 --> <!-- 不可横向铺满,一般为最后一行 -->
<el-col :span="6" class="in_block"> <el-col :span="6" class="in_block">
<block-radius class="block"></block-radius> <block-radius :show_header="true" title="服务来源机构分析" class="block">
<BarChart :data="bar_data_org" :colors="['#e56600', '#e56600']" />
</block-radius>
</el-col> </el-col>
<el-col :span="18" class="in_block default"> <el-col :span="18" class="in_block default">
<block-radius class="block"> <block-radius class="block">
...@@ -152,6 +158,10 @@ export default { ...@@ -152,6 +158,10 @@ export default {
} }
] ]
}, },
das_data: {
data: 40,
text: "健康占比"
},
bar_data: { bar_data: {
xaxis: [ xaxis: [
"01-01", "01-01",
...@@ -163,12 +173,20 @@ export default { ...@@ -163,12 +173,20 @@ export default {
"01-07", "01-07",
"01-08" "01-08"
], ],
data: [ data: [100, 120, 130, 150, 160, 120, 110, 100]
{ },
name: "开发者应用", bar_data_org: {
arr: [100, 120, 130, 150, 160, 120, 110, 100] xaxis: [
} "01-01",
] "01-02",
"01-03",
"01-04",
"01-05",
"01-06",
"01-07",
"01-08"
],
data: [100, 120, 130, 150, 160, 120, 110, 100]
} }
}), }),
mounted() {}, mounted() {},
...@@ -209,11 +227,28 @@ export default { ...@@ -209,11 +227,28 @@ export default {
.left_1 { .left_1 {
height: 100%; height: 100%;
display: flex; display: flex;
justify-content: space-between;
} }
.left_1_l { .left_1_l {
width: 50%; width: 40%;
height: 100%; height: 100%;
display: inline-block; display: inline-block;
padding: 20px 0 0 0;
}
.left_1_title {
width: 100%;
text-align: center;
}
.left_1_num {
font-size: 32px;
color: #515fe7;
width: 100%;
text-align: center;
}
.left_1_img {
width: 120px;
display: block;
margin: 0 auto;
} }
.left_1_r { .left_1_r {
width: 50%; width: 50%;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment