修改
This commit is contained in:
@@ -23,7 +23,10 @@ export default {
|
||||
components: { BarChartBase },
|
||||
data() {
|
||||
// 城市数组的顺序必须是固定的
|
||||
const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"];
|
||||
const cities = ["瑞昌", "邯郸",
|
||||
// "株洲", "佳木斯", "成都", "凯盛", "蚌埠"
|
||||
|
||||
];
|
||||
return {
|
||||
xAxis: cities,
|
||||
};
|
||||
|
||||
@@ -23,7 +23,10 @@ export default {
|
||||
components: { BarChartBase },
|
||||
data() {
|
||||
// 城市数组的顺序必须是固定的
|
||||
const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"];
|
||||
const cities = ["瑞昌", "邯郸",
|
||||
// "株洲", "佳木斯", "成都", "凯盛", "蚌埠"
|
||||
|
||||
];
|
||||
return {
|
||||
xAxis: cities,
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-05-20 13:32:59
|
||||
* @LastEditTime: 2024-05-30 13:35:00
|
||||
* @LastEditTime: 2024-05-31 15:05:20
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@@ -151,9 +151,10 @@ export default {
|
||||
];
|
||||
}
|
||||
let titleValue =
|
||||
vt[0] != null && vt[2] != null && vt[2] !== 0
|
||||
? `${vt[1] / vt[2]}%`
|
||||
: "0%",
|
||||
vt[1] != null && vt[2] !== 0
|
||||
? this.formatNumber((vt[1] / vt[2] * 100)) + '%'
|
||||
: (vt[1] != 0 && vt[1] != null) && vt[2] == 0
|
||||
? "100%" : '0%',
|
||||
subtitle =
|
||||
this.period == "日" ? `${month}月${today}日累计` : this.period == "周" ? `本周` : this.period == "月" ? `${month}月累计产出` : `${year}年累计产出`;
|
||||
console.log(this.valueTuple[0], this.valueTuple[1], this.valueTuple[2],)
|
||||
@@ -196,6 +197,15 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
formatNumber(num) {
|
||||
// 判断是否为整数
|
||||
if (Number.isInteger(num)) {
|
||||
return num; // 如果是整数,直接转换为字符串
|
||||
} else {
|
||||
// 如果不是整数,保留两位小数并转换为字符串
|
||||
return num.toFixed(2);
|
||||
}
|
||||
}
|
||||
// fullscreen mixin 需要的回调
|
||||
// fullscreenCallback(isFullscreen) {
|
||||
// console.log("isFullscreen--->", isFullscreen);
|
||||
@@ -219,40 +229,40 @@ function calculateItems(period, valueTuple,than) {
|
||||
const year = new Date().getFullYear();
|
||||
if (period === '日' && than === '同比') {
|
||||
items = [
|
||||
{ label: `${month}月${today}日累计`, value: valueTuple[1] },
|
||||
{ label: `去年${month}月${today}日累计`, value: valueTuple[0] },
|
||||
{ label: `${month}月${today}日累计`, value: valueTuple[1] },
|
||||
];
|
||||
} else if (period === '日' && than === '环比') {
|
||||
items = [
|
||||
{ label: `${month}月${today}日累计`, value: valueTuple[1] },
|
||||
{ label: `${yesterday}日累计`, value: valueTuple[0] },
|
||||
{ label: `${month}月${today}日累计`, value: valueTuple[1] },
|
||||
];
|
||||
} else if (period === '周' && than === '同比') {
|
||||
items = [
|
||||
{ label: `本周累计`, value: valueTuple[1] },
|
||||
{ label: `去年本周累计`, value: valueTuple[0] },
|
||||
{ label: `本周累计`, value: valueTuple[1] },
|
||||
];
|
||||
} else if (period === '周' && than === '环比') {
|
||||
items = [
|
||||
{ label: `本周累计`, value: valueTuple[1] },
|
||||
{ label: `上周累计`, value: valueTuple[0] },
|
||||
{ label: `本周累计`, value: valueTuple[1] },
|
||||
];
|
||||
} else if (period === '月' && than === '同比') {
|
||||
items = [
|
||||
{ label: `${month}月累计`, value: valueTuple[1] },
|
||||
{ label: `去年${month}月累计`, value: valueTuple[0] },
|
||||
{ label: `${month}月累计`, value: valueTuple[1] },
|
||||
{ label: `${month}月目标`, value: valueTuple[2] },
|
||||
];
|
||||
} else if (period === '月' && than === '环比') {
|
||||
items = [
|
||||
{ label: `${month}月累计`, value: valueTuple[1] },
|
||||
{ label: `${lastMonth}月累计`, value: valueTuple[0] },
|
||||
{ label: `${month}月累计`, value: valueTuple[1] },
|
||||
{ label: `${month}月目标`, value: valueTuple[2] },
|
||||
];
|
||||
} else {
|
||||
items = [
|
||||
{ label: `${year}年累计`, value: valueTuple[1] },
|
||||
{ label: `${year - 1}年累计`, value: valueTuple[0] },
|
||||
{ label: `${year}年累计`, value: valueTuple[1] },
|
||||
{ label: `${year}年目标`, value: valueTuple[2] },
|
||||
];
|
||||
}
|
||||
@@ -314,17 +324,17 @@ function calculateItems(period, valueTuple,than) {
|
||||
left: -18px;
|
||||
}
|
||||
|
||||
.legend-item:nth-child(1) .legend-item__label::before {
|
||||
.legend-item:nth-child(2) .legend-item__label::before {
|
||||
background: #12fff5;
|
||||
}
|
||||
.legend-item:nth-child(1) .legend-item__value {
|
||||
.legend-item:nth-child(2) .legend-item__value {
|
||||
color: #12fff5;
|
||||
}
|
||||
|
||||
.legend-item:nth-child(2) .legend-item__label::before {
|
||||
.legend-item:nth-child(1) .legend-item__label::before {
|
||||
background: #0f65ff;
|
||||
}
|
||||
.legend-item:nth-child(2) .legend-item__value {
|
||||
.legend-item:nth-child(1) .legend-item__value {
|
||||
color: #0f65ff;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-05-30 16:00:50
|
||||
* @LastEditTime: 2024-05-31 16:15:51
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<!--
|
||||
filename: DoubleRingWrapper.vue
|
||||
author: liubin
|
||||
@@ -42,13 +49,13 @@ export default {
|
||||
return {
|
||||
factoryId: 4, // 默认成都
|
||||
cityOptions: [
|
||||
"成都",
|
||||
// "成都",
|
||||
"邯郸",
|
||||
"株洲",
|
||||
// "株洲",
|
||||
"瑞昌",
|
||||
"佳木斯",
|
||||
"凯盛光伏",
|
||||
"蚌埠兴科",
|
||||
// "佳木斯",
|
||||
// "凯盛光伏",
|
||||
// "蚌埠兴科",
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-05-24 15:15:00
|
||||
* @LastEditTime: 2024-05-28 08:42:36
|
||||
* @LastEditTime: 2024-05-31 16:16:16
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@@ -54,12 +54,12 @@ export default {
|
||||
return {
|
||||
factoryId: 4, // 默认成都
|
||||
cityOptions: [
|
||||
"成都",
|
||||
// "成都",
|
||||
"邯郸",
|
||||
"株洲",
|
||||
"佳木斯",
|
||||
"凯盛光伏",
|
||||
"蚌埠兴科",
|
||||
// "株洲",
|
||||
// "佳木斯",
|
||||
// "凯盛光伏",
|
||||
// "蚌埠兴科",
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user