-
+
+
- 当前产量: {{ rawData.nowProduction }}片
+ 当前产量: {{ rawData?.nowProduction ?? 0 }}片
-
-
目标产量: {{ rawData.targetProduction }}片
+
+ 目标产量: {{ rawData?.targetProduction ?? 0 }}片
@@ -54,6 +60,7 @@ onMounted(() => {
position: relative;
}
+.chart-placeholder,
.chart-container {
margin: auto;
width: 320px;
diff --git a/src/components/Chart/rateOption.js b/src/components/Chart/rateOption.js
index 782e332..065b465 100644
--- a/src/components/Chart/rateOption.js
+++ b/src/components/Chart/rateOption.js
@@ -128,10 +128,11 @@ const targetSerie = {
};
export default (data) => {
- dataSerie.data[0].value = data.nowYield;
- dataSerie.data[1].value = 100 - data.nowYield;
- targetSerie.data[0].value = data.targetYield;
- targetSerie.data[1].value = 100 - data.targetYield;
+ title.subtext = data?.nowYield == null ? "" : "当前成品率\u2002";
+ dataSerie.data[0].value = data?.nowYield ?? 0;
+ dataSerie.data[1].value = 100 - (data?.nowYield ?? 0);
+ targetSerie.data[0].value = data?.targetYield ?? 0;
+ targetSerie.data[1].value = 100 - (data?.targetYield ?? 0);
return {
tooltip,
title,
diff --git a/src/components/HourChart.vue b/src/components/HourChart.vue
index 2d854d4..6c7aa8f 100644
--- a/src/components/HourChart.vue
+++ b/src/components/HourChart.vue
@@ -25,15 +25,9 @@ store.$subscribe((mutation, state) => {
if (chart.value) chart.value.dispose();
return;
}
- hourData.value = (state.data2?.lineHourList ?? [
- // { lineName: '001', hour: '00:00', num: 10 },
- // { lineName: '002', hour: '00:20', num: 20 },
- // { lineName: '003', hour: '00:30', num: 30 },
- // { lineName: '004', hour: '00:40', num: 14 },
- // { lineName: '005', hour: '00:50', num: 50 },
- ]).map((item, index) => ({
+ hourData.value = (state.data2?.lineHourList ?? []).map((item, index) => ({
id: `${item.lineName}_${index}`,
- hour: item.hour || '__',
+ hour: item.hour || "__",
data: item.num || 0,
}));
setupChart();
@@ -46,7 +40,7 @@ function setupChart() {
chartSetup(
chart.value,
hourData.value.map((item) => item.hour),
- hourData.value.map((item) => item.num)
+ hourData.value.map((item) => item.data)
);
});
diff --git a/src/components/datapage/LineToday.vue b/src/components/datapage/LineToday.vue
index 37bf905..1613ec8 100644
--- a/src/components/datapage/LineToday.vue
+++ b/src/components/datapage/LineToday.vue
@@ -102,13 +102,16 @@ function loadData(dailyTarget) {
>