diff --git a/src/components/charts/HistoryAllPrintStatus.vue b/src/components/charts/HistoryAllPrintStatus.vue index 8f27b9ab..054116ab 100644 --- a/src/components/charts/HistoryAllPrintStatus.vue +++ b/src/components/charts/HistoryAllPrintStatus.vue @@ -56,17 +56,29 @@ export default class HistoryAllPrintStatus extends Mixins(BaseMixin) { ], } + get selectedJobs() { + return this.$store.state.gui.view.history.selectedJobs ?? [] + } + get allPrintStatusArray() { return this.$store.getters['server/history/getAllPrintStatusArray'] } + get selectedPrintStatusArray() { + return this.$store.getters['server/history/getSelectedPrintStatusArray'] + } + + get printStatusArray() { + return this.selectedJobs.length ? this.selectedPrintStatusArray : this.allPrintStatusArray + } + get chart(): ECharts | null { const historyAllPrintStatus = this.$refs.historyAllPrintStatus return historyAllPrintStatus?.inst ?? null } mounted() { - this.chartOptions.series[0].data = this.allPrintStatusArray + this.chartOptions.series[0].data = this.printStatusArray this.chart?.setOption(this.chartOptions) window.addEventListener('resize', this.eventListenerResize) @@ -81,8 +93,8 @@ export default class HistoryAllPrintStatus extends Mixins(BaseMixin) { if (this.chart) this.chart.dispose() } - @Watch('allPrintStatusArray') - allPrintStatusArrayChanged(newVal: any) { + @Watch('printStatusArray') + printStatusArrayChanged(newVal: any) { this.chart?.setOption({ series: { data: newVal, diff --git a/src/components/panels/HistoryListPanel.vue b/src/components/panels/HistoryListPanel.vue index 43a6b2f2..a407c7dc 100644 --- a/src/components/panels/HistoryListPanel.vue +++ b/src/components/panels/HistoryListPanel.vue @@ -1,3 +1,11 @@ + +