Commit 5983515a authored by xiexingan's avatar xiexingan

调整

parent b05cc6f8
...@@ -6,115 +6,114 @@ ...@@ -6,115 +6,114 @@
<script> <script>
export default { export default {
name: "myPies", name: 'myPies',
data() { data() {
return { return {
myPies: null, myPies: null
}; }
}, },
mounted() { mounted() {
this.initPie(); this.initPie()
}, },
methods: { methods: {
initPie() { initPie() {
let myPie = document.getElementById("myPies"); let myPie = document.getElementById('myPies')
this.myPies = this.$echarts.init(myPie); this.myPies = this.$echarts.init(myPie)
const data = [ const data = [
{ name: "冷", value: 150 }, { name: '冷', value: 150 },
{ name: "适中", value: 80 }, { name: '适中', value: 80 },
{ name: "热", value: 80 }, { name: '热', value: 80 }
]; ]
const option = { const option = {
tooltip: { tooltip: {
trigger: "item", trigger: 'item',
formatter: "{a} <br/>{b}: {c} ({d}%)", formatter: '{a} <br/>{b}: {c} ({d}%)'
}, },
legend: { legend: {
show: true, show: true,
orient: 'vertical', orient: 'horizontal',
// left: "center", // left: "center",
bottom: "40", bottom: '40',
itemHeight: 13, itemHeight: 13,
itemWidth: 13, itemWidth: 13,
itemGap: 35, itemGap: 35,
icon: "circle", icon: 'circle',
data: data, data: data,
formatter: function (name) { formatter: function (name) {
var total = 0; var total = 0
var target; var target
var value; var value
for (let i = 0, l = data.length; i < l; i++) { for (let i = 0, l = data.length; i < l; i++) {
value = data[i].value; value = data[i].value
total += data[i].value; total += data[i].value
if (data[i].name == name) { if (data[i].name == name) {
target = data[i].value; target = data[i].value
} }
} }
return name + ' ' +((target/total)*100).toFixed(0) + '%' return name + ' ' + ((target / total) * 100).toFixed(0) + '%'
}, },
textStyle: { textStyle: {
rich: { rich: {
a: { a: {
color: "#333333", color: '#333333',
// verticalAlign: "top", // verticalAlign: "top",
// align: "center", // align: "center",
// fontSize: 12, // fontSize: 12,
// padding: [10, 0, 28, 0] // padding: [10, 0, 28, 0]
padding:20 padding: 20
}, },
b: { b: {
// align: "left", // align: "left",
// fontSize: 18, // fontSize: 18,
padding: [10, 10, 10, 0], padding: [10, 10, 10, 0],
// // lineHeight: 25, // // lineHeight: 25,
color: "#333333" color: '#333333'
}, }
}, }
}, }
}, },
color:['rgba(72,154,254,1)','rgba(247,243,204,1)','rgba(236,73,104,1)'], color: ['rgba(72,154,254,1)', 'rgba(247,243,204,1)', 'rgba(236,73,104,1)'],
series: [ series: [
{ {
name: "访问来源", name: '访问来源',
type: "pie", type: 'pie',
radius: ["50%", "70%"], radius: ['50%', '70%'],
center: ["50%", "40%"], center: ['50%', '40%'],
avoidLabelOverlap: false, avoidLabelOverlap: false,
label: { label: {
// show: true, // show: true,
position: "center", position: 'center',
normal: { normal: {
show: true, show: true,
position: "center", position: 'center',
formatter: function () { formatter: function () {
return `调查总数\r\n \r\n20000`; return `调查总数\r\n \r\n20000`
}, },
textStyle: { textStyle: {
fontSize: 30, fontSize: 30,
color: "#333", color: '#333'
}, }
}, }
}, },
emphasis: { emphasis: {
label: { label: {
show: false, show: false,
fontSize: "30", fontSize: '30',
fontWeight: "bold", fontWeight: 'bold'
}, }
}, },
labelLine: { labelLine: {
show: false, show: false
}, },
data: [...data ], data: [...data ]
}, }
], ]
}; }
this.myPies.setOption(option); this.myPies.setOption(option)
}, }
}, }
}; }
</script> </script>
\ No newline at end of file
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<span v-if="index == 0" v-html="item.cardText"></span> <span v-if="index == 0" v-html="item.cardText"></span>
<span v-else-if="index == 1" v-html="item.cardText"></span> <span v-else-if="index == 1" v-html="item.cardText"></span>
<span v-else>{{ item.cardText }}</span> <span v-else>{{ item.cardText }}</span>
<p >{{ item.state }}</p>
</div> </div>
</div> </div>
</div> </div>
...@@ -153,17 +154,22 @@ export default { ...@@ -153,17 +154,22 @@ export default {
{ {
iconUrl: require('./image/sun_icon.png'), iconUrl: require('./image/sun_icon.png'),
cardDesc: '供暖模式', cardDesc: '供暖模式',
cardText: '办公区域供暖模式已开启' cardText: '办公区域供暖模式',
state: '已开启'
}, },
{ {
iconUrl: require('./image/fan_icon.png'), iconUrl: require('./image/fan_icon.png'),
cardDesc: '机械通风模式', cardDesc: '机械通风模式',
cardText: '办公区域机械通风模式已开启' cardText: '办公区域机械通风模式',
state: '已开启'
}, },
{ {
iconUrl: require('./image/nan_fan_icon.png'), iconUrl: require('./image/nan_fan_icon.png'),
cardDesc: '自然通风模式', cardDesc: '自然通风模式',
cardText: '办公区域自然通风模式已开启' cardText: '办公区域自然通风模式',
state: '已开启'
} }
], ],
dateList: [ dateList: [
...@@ -224,7 +230,7 @@ export default { ...@@ -224,7 +230,7 @@ export default {
img { img {
width: 50px; width: 50px;
height: 50px; height: 50px;
padding-bottom: 19px; padding-bottom: 13px;
} }
.card-desc { .card-desc {
font-size: 16px; font-size: 16px;
...@@ -234,7 +240,7 @@ export default { ...@@ -234,7 +240,7 @@ export default {
// padding-bottom: 16px; // padding-bottom: 16px;
} }
.card-text { .card-text {
font-size: 30px; font-size: 26px;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 600; font-weight: 600;
color: #333333; color: #333333;
......
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