Skip to content

Commit

Permalink
fix: fix status groups in print history filter
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Dej <meteyou@gmail.com>
  • Loading branch information
meteyou committed Sep 23, 2024
1 parent 19f0116 commit 59b07e1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/components/charts/HistoryAllPrintStatusChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default class HistoryAllPrintStatusChart extends Mixins(BaseMixin, ThemeM
series: [
{
type: 'pie',
data: this.printStatusArray,
data: this.groupedPrintStatusArray,
avoidLabelOverlap: false,
radius: ['35%', '60%'],
emphasis: {
Expand All @@ -83,8 +83,8 @@ export default class HistoryAllPrintStatusChart extends Mixins(BaseMixin, ThemeM
if (this.chart) this.chart.dispose()
}
@Watch('printStatusArray')
printStatusArrayChanged(newVal: any) {
@Watch('groupedPrintStatusArray')
groupedPrintStatusArrayChanged(newVal: any) {
this.chart?.setOption(
{
series: {
Expand Down
6 changes: 4 additions & 2 deletions src/components/mixins/historyStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export default class HistoryStatsMixin extends Vue {
const countSelected = this.$store.getters['server/history/getSelectedJobs'].length
const orgArray = countSelected ? this.selectedPrintStatusChartData : this.allPrintStatusChartData

const output = orgArray.map((status) => ({
return orgArray.map((status) => ({
...status,
name: status.displayName,
value:
Expand All @@ -116,7 +116,9 @@ export default class HistoryStatsMixin extends Vue {
? status.valueTime
: status.value,
}))
}

return this.groupSmallEntries(output, 0.05)
get groupedPrintStatusArray() {
return this.groupSmallEntries(this.printStatusArray, 0.05)
}
}
10 changes: 4 additions & 6 deletions src/components/panels/HistoryListPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,8 @@
@change="showPrintJobs = !showPrintJobs" />
</v-list-item>
<v-divider />
<template v-if="allPrintStatusArray.length">
<v-list-item
v-for="status of allPrintStatusArray"
:key="status.key"
class="minHeight36">
<template v-if="printStatusArray.length">
<v-list-item v-for="status of printStatusArray" :key="status.key" class="minHeight36">
<v-checkbox
class="mt-0"
hide-details
Expand Down Expand Up @@ -179,6 +176,7 @@ import { GuiMaintenanceStateEntry, HistoryListRowMaintenance } from '@/store/gui
import HistoryListEntryMaintenance from '@/components/panels/History/HistoryListEntryMaintenance.vue'
import HistoryListPanelDeleteSelectedDialog from '@/components/dialogs/HistoryListPanelDeleteSelectedDialog.vue'
import HistoryMixin from '@/components/mixins/history'
import HistoryStatsMixin from '@/components/mixins/historyStats'
export type HistoryListPanelRow = HistoryListRowJob | HistoryListRowMaintenance
Expand All @@ -202,7 +200,7 @@ export interface HistoryListPanelCol {
Panel,
},
})
export default class HistoryListPanel extends Mixins(BaseMixin, HistoryMixin) {
export default class HistoryListPanel extends Mixins(BaseMixin, HistoryMixin, HistoryStatsMixin) {
mdiCloseThick = mdiCloseThick
mdiCog = mdiCog
mdiDatabaseArrowDownOutline = mdiDatabaseArrowDownOutline
Expand Down

0 comments on commit 59b07e1

Please sign in to comment.