From c314f4b78e286aea687d0ec7ca69d265444f709c Mon Sep 17 00:00:00 2001 From: "DESKTOP-FUDKNA8\\znjsz" Date: Fri, 26 Jan 2024 16:48:51 +0800 Subject: [PATCH] update datapage --- src/MainPage.vue | 5 +- src/components/datapage/HourChart.vue | 116 ++++++++++++ src/components/datapage/HourChartOptions.js | 63 +++++++ src/components/datapage/TeamChartDay.vue | 74 ++++++++ .../datapage/TeamChartDayOptions.js | 68 +++++++ src/components/datapage/TeamChartMonth.vue | 73 ++++++++ .../datapage/TeamChartMonthOptions.js | 176 ++++++++++++++++++ src/pages/DataPage.vue | 50 ++--- src/pages/ThreeDimension.vue | 59 ++++++ 9 files changed, 650 insertions(+), 34 deletions(-) create mode 100644 src/components/datapage/HourChart.vue create mode 100644 src/components/datapage/HourChartOptions.js create mode 100644 src/components/datapage/TeamChartDay.vue create mode 100644 src/components/datapage/TeamChartDayOptions.js create mode 100644 src/components/datapage/TeamChartMonth.vue create mode 100644 src/components/datapage/TeamChartMonthOptions.js create mode 100644 src/pages/ThreeDimension.vue diff --git a/src/MainPage.vue b/src/MainPage.vue index c7c68f7..0631bef 100644 --- a/src/MainPage.vue +++ b/src/MainPage.vue @@ -8,7 +8,7 @@ import AppHeader from "./components/Base/Header.vue"; import AlertListPage from "./pages/AlertListPage.vue"; import DataPage from "./pages/DataPage.vue"; import DatetimeTool from "./components/HeadTime.vue"; -import TriplePage from "./pages/3D.vue"; +import ThreeDimension from "./pages/ThreeDimension.vue"; import { useSettings } from "./store/settings"; const props = defineProps(["path"]); @@ -114,7 +114,8 @@ function resetScale(elm) { @home="() => handlePageChange('3d')" />
- + + diff --git a/src/components/datapage/HourChart.vue b/src/components/datapage/HourChart.vue new file mode 100644 index 0000000..de16b53 --- /dev/null +++ b/src/components/datapage/HourChart.vue @@ -0,0 +1,116 @@ + + + + + + + diff --git a/src/components/datapage/HourChartOptions.js b/src/components/datapage/HourChartOptions.js new file mode 100644 index 0000000..c90502c --- /dev/null +++ b/src/components/datapage/HourChartOptions.js @@ -0,0 +1,63 @@ +export const options = { + grid: { + top: 10, + bottom: 0, + left: 12, + right: 10, + containLabel: true, + }, + xAxis: { + type: "category", + data: [], + axisLabel: { + fontSize: 16, + color: '#fff8' + }, + axisLine: { + show: true, + lineStyle: { + color: "#e6e6e633", + }, + }, + }, + yAxis: { + type: "value", + axisLine: { + show: true, + lineStyle: { + color: "#e6e6e633", + }, + }, + splitLine: { + lineStyle: { + color: '#e6e6e633' + } + }, + axisLabel: { + fontSize: 16, + color: '#fff8' + }, + minInterval: 1, + max: 100, + min: 1 + }, + series: [ + { + data: [], + // data: Array.from({ length: 7 }, () => Math.random() * 100), + type: "bar", + // barWidth: 20, + showBackground: true, + backgroundStyle: { + color: "rgba(180, 180, 180, 0.2)", + }, + }, + ], +}; + +export default function setup(echartInstance, timeArr, dataArr) { + const new_options = { ...options }; + new_options.xAxis.data = timeArr; + new_options.series[0].data = dataArr; + echartInstance.setOption(new_options); +} diff --git a/src/components/datapage/TeamChartDay.vue b/src/components/datapage/TeamChartDay.vue new file mode 100644 index 0000000..d09af92 --- /dev/null +++ b/src/components/datapage/TeamChartDay.vue @@ -0,0 +1,74 @@ + + + + + diff --git a/src/components/datapage/TeamChartDayOptions.js b/src/components/datapage/TeamChartDayOptions.js new file mode 100644 index 0000000..45ac40f --- /dev/null +++ b/src/components/datapage/TeamChartDayOptions.js @@ -0,0 +1,68 @@ +export const options = { + color: ['#ffd601', '#72340b'], + grid: { + top: 10, + bottom: 0, + left: 0, + right: 28, + containLabel: true, + }, + xAxis: { + max: 100, + splitLine: { + lineStyle: { + color: "#fff2", + }, + }, + axisLabel: { + fontSize: 16, + color: "#e5e5e5a3", + }, + }, + yAxis: { + type: "category", + data: ["A组", "B组", "C组"], + inverse: true, + animationDuration: 300, + animationDurationUpdate: 300, + max: 2, // only the largest 3 bars will be displayed + axisLabel: { + fontSize: 16, + color: "#e5e5e5a3", + }, + splitLine: { + lineStyle: { + color: "#e5e5e5", + }, + }, + }, + series: [ + { + realtimeSort: true, + type: "bar", + // data: [10, 20, 30], + data: [], + label: { + show: true, + position: "right", + valueAnimation: true, + formatter: "{c}%", + color: "#fff", + fontSize: 16, + }, + }, + ], + legend: { + show: false, + }, + animationDuration: 0, + animationDurationUpdate: 3000, + animationEasing: "linear", + animationEasingUpdate: "linear", +}; + +export default function setup(echartInstance, dataArr) { + const new_options = { ...options }; + new_options.series[0].data = dataArr; + echartInstance.setOption(new_options); +} diff --git a/src/components/datapage/TeamChartMonth.vue b/src/components/datapage/TeamChartMonth.vue new file mode 100644 index 0000000..be2de0e --- /dev/null +++ b/src/components/datapage/TeamChartMonth.vue @@ -0,0 +1,73 @@ + + + + + diff --git a/src/components/datapage/TeamChartMonthOptions.js b/src/components/datapage/TeamChartMonthOptions.js new file mode 100644 index 0000000..3aa26fc --- /dev/null +++ b/src/components/datapage/TeamChartMonthOptions.js @@ -0,0 +1,176 @@ +export const options = { + grid: { + top: 0, + left: 0, + right: 0, + bottom: 0 + }, + title: [ + { + text: "当前产量:" + 100 + " 片", + left: "27%", + textAlign: "center", + top: "70%", + textStyle: { + fontSize: 16, + color: '#fffa' + }, + }, + { + text: "目标产量:" + 100 + " 片", + left: "27%", + textAlign: "center", + top: "85%", + textStyle: { + fontSize: 16, + color: '#fffa' + }, + }, + { + text: "当前成品率:" + 22 + "%", + left: "72%", + textAlign: "center", + top: "70%", + textStyle: { + fontSize: 16, + color: '#fffa' + }, + }, + { + text: "目标成品率:" + 22 + "%", + left: "72%", + textAlign: "center", + top: "85%", + textStyle: { + fontSize: 16, + color: '#fffa' + }, + }, + ], + series: [ + { + type: "gauge", + startAngle: 90, + center: ["27%", "35%"], + endAngle: -270, + radius: "55%", + progress: { + show: true, + width: 12, + }, + axisLine: { + lineStyle: { + width: 12, + }, + }, + pointer: { + show: false, + }, + axisTick: { + show: false, + }, + splitLine: { + show: false, + }, + axisLabel: { + show: false, + }, + detail: { + valueAnimation: true, + fontSize: 16, + offsetCenter: [0, "0%"], + formatter: "{value}%", + color: "rgba(255, 255, 255, 1)", + }, + data: [ + { + // value: (nowProduction / targetProduction * 100).toFixed(1), + value: 100, + }, + ], + }, + { + type: "gauge", + startAngle: 90, + center: ["73%", "35%"], + endAngle: -270, + radius: "55%", + progress: { + show: true, + width: 12, + }, + axisLine: { + lineStyle: { + width: 12, + }, + }, + pointer: { + show: false, + }, + axisTick: { + show: false, + }, + splitLine: { + show: false, + }, + axisLabel: { + show: false, + }, + detail: { + show: true, + valueAnimation: true, + fontSize: 16, + offsetCenter: [0, "0%"], + // formatter: 0 + "%", + // formatter: (nowYield / targetYield * 100).toFixed(1) + '%', + color: "#fff", + }, + data: [ + { + // value: targetYield, + value: 100, + name: "Perfect", + title: { + show: false, + }, + detail: { + show: false, + valueAnimation: true, + offsetCenter: ["0%", "-20%"], + }, + }, + { + value: 100, + // value: nowYield, + name: "Good", + title: { + show: false, + }, + detail: { + show: false, + valueAnimation: true, + offsetCenter: ["0%", "10%"], + }, + }, + { + value: 0, + detail: { + show: true, + }, + }, + ], + }, + ], +}; +export default function setup(echartInstance, data) { + const new_options = { ...options }; + new_options.title[0].text = "当前产量:" + data.nowProduction + " 片"; + new_options.title[1].text = "目标产量:" + data.targetProduction + " 片"; + new_options.title[2].text = "当前成品率:" + data.nowYield + "%"; + new_options.title[3].text = "目标成品率:" + data.targetYield + "%"; + new_options.series[0].data[0].value = (data.nowProduction / data.targetProduction * 100).toFixed(1) + new_options.series[1].data[0].value = data.targetYield + new_options.series[1].data[1].value = data.nowYield + new_options.series[1].detail.formatter = (data.nowYield / data.targetYield * 100).toFixed(2) + '%', + echartInstance.setOption(new_options); +} diff --git a/src/pages/DataPage.vue b/src/pages/DataPage.vue index 0009a88..aef4d93 100644 --- a/src/pages/DataPage.vue +++ b/src/pages/DataPage.vue @@ -1,29 +1,20 @@ @@ -31,21 +22,16 @@ const props = defineProps({ .data-page { flex: 1; position: relative; + background: #cccc; + display: grid; + grid-template-columns: 1fr 1fr 1fr; + grid-template-rows: 1fr 1fr; + gap: 24px; + padding: 32px; + align-items: stretch; } -.data-list { - height: 100%; - width: 480px; - - position: absolute; - top: 0; - right: 32px; - - display: flex; - flex-direction: column; - justify-content: space-around; -} - +/* :fullscreen .data-list { width: 35%; gap: 32px; @@ -55,5 +41,5 @@ const props = defineProps({ :fullscreen .data-list>div { flex: 1; -} +} */ diff --git a/src/pages/ThreeDimension.vue b/src/pages/ThreeDimension.vue new file mode 100644 index 0000000..0009a88 --- /dev/null +++ b/src/pages/ThreeDimension.vue @@ -0,0 +1,59 @@ + + + + + +