fix print history hide columns
Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
parent
08900f5442
commit
ddd0c61c26
@ -250,20 +250,20 @@ import VueLoadImage from 'vue-load-image'
|
||||
{ text: '', value: '', align: 'left', configable: false, visible: true, filterable: false },
|
||||
{ text: this.$t("History.Filename"), value: 'filename', align: 'left', configable: false, visible: true },
|
||||
{ text: '', value: 'status', align: 'left', configable: false, visible: true, filterable: false },
|
||||
{ text: this.$t("History.Filesize"), value: 'size', align: 'left', configable: true, visible: false },
|
||||
{ text: this.$t("History.LastModified"), value: 'modified', align: 'left', configable: true, visible: false },
|
||||
{ text: this.$t("History.Filesize"), value: 'size', align: 'left', configable: true, visible: true },
|
||||
{ text: this.$t("History.LastModified"), value: 'modified', align: 'left', configable: true, visible: true },
|
||||
{ text: this.$t("History.StartTime"), value: 'start_time', align: 'left', configable: true, visible: true },
|
||||
{ text: this.$t("History.EndTime"), value: 'end_time', align: 'left', configable: true, visible: false },
|
||||
{ text: this.$t("History.EndTime"), value: 'end_time', align: 'left', configable: true, visible: true },
|
||||
{ text: this.$t("History.EstimatedTime"), value: 'estimated_time', align: 'left', configable: true, visible: true },
|
||||
{ text: this.$t("History.PrintTime"), value: 'print_duration', align: 'left', configable: true, visible: true },
|
||||
{ text: this.$t("History.TotalTime"), value: 'total_duration', align: 'left', configable: true, visible: false },
|
||||
{ text: this.$t("History.FilamentCalc"), value: 'filament_total', align: 'left', configable: true, visible: false },
|
||||
{ text: this.$t("History.TotalTime"), value: 'total_duration', align: 'left', configable: true, visible: true },
|
||||
{ text: this.$t("History.FilamentCalc"), value: 'filament_total', align: 'left', configable: true, visible: true },
|
||||
{ text: this.$t("History.FilamentUsed"), value: 'filament_used', align: 'left', configable: true, visible: true },
|
||||
{ text: this.$t("History.FirstLayerExtTemp"), value: 'first_layer_extr_temp', align: 'left', configable: true, visible: false },
|
||||
{ text: this.$t("History.FirstLayerBedTemp"), value: 'first_layer_bed_temp', align: 'left', configable: true, visible: false },
|
||||
{ text: this.$t("History.FirstLayerHeight"), value: 'first_layer_height', align: 'left', configable: true, visible: false },
|
||||
{ text: this.$t("History.LayerHeight"), value: 'layer_height', align: 'left', configable: true, visible: false },
|
||||
{ text: this.$t("History.ObjectHeight"), value: 'object_height', align: 'left', configable: true, visible: false },
|
||||
{ text: this.$t("History.FirstLayerExtTemp"), value: 'first_layer_extr_temp', align: 'left', configable: true, visible: true },
|
||||
{ text: this.$t("History.FirstLayerBedTemp"), value: 'first_layer_bed_temp', align: 'left', configable: true, visible: true },
|
||||
{ text: this.$t("History.FirstLayerHeight"), value: 'first_layer_height', align: 'left', configable: true, visible: true },
|
||||
{ text: this.$t("History.LayerHeight"), value: 'layer_height', align: 'left', configable: true, visible: true },
|
||||
{ text: this.$t("History.ObjectHeight"), value: 'object_height', align: 'left', configable: true, visible: true },
|
||||
{ text: this.$t("History.Slicer"), value: 'slicer', align: 'left', configable: true, visible: true },
|
||||
],
|
||||
options: {
|
||||
@ -320,9 +320,12 @@ import VueLoadImage from 'vue-load-image'
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.hideColums.forEach((key) => {
|
||||
let headerElement = this.headers.find(element => element.value === key)
|
||||
if (headerElement) headerElement.visible = false
|
||||
this.headers.forEach((header) => {
|
||||
if (header.visible && this.hideColums.includes(header.value)) {
|
||||
header.visible = false
|
||||
} else if (!header.visible && !this.hideColums.includes(header.value)) {
|
||||
header.visible = true
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
@ -487,9 +490,12 @@ import VueLoadImage from 'vue-load-image'
|
||||
},
|
||||
watch: {
|
||||
hideColums: function(newVal) {
|
||||
newVal.forEach((key) => {
|
||||
let headerElement = this.headers.find(element => element.value === key)
|
||||
if (headerElement) headerElement.visible = false
|
||||
this.headers.forEach((header) => {
|
||||
if (header.visible && newVal.includes(header.value)) {
|
||||
header.visible = false
|
||||
} else if (!header.visible && !newVal.includes(header.value)) {
|
||||
header.visible = true
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -70,7 +70,18 @@ export function getDefaultState() {
|
||||
history: {
|
||||
countPerPage: 10,
|
||||
toggleChartCol3: 'filament_usage',
|
||||
hideColums: []
|
||||
hideColums: [
|
||||
'size',
|
||||
'modified',
|
||||
'end_time',
|
||||
'total_duration',
|
||||
'filament_total',
|
||||
'first_layer_extr_temp',
|
||||
'first_layer_bed_temp',
|
||||
'first_layer_height',
|
||||
'layer_height',
|
||||
'object_height',
|
||||
]
|
||||
},
|
||||
settings: {
|
||||
configfiles: {
|
||||
|
@ -13,7 +13,9 @@ export default {
|
||||
Object.entries(payload).forEach(([key, value]) => {
|
||||
if (typeof value === 'object' && !Array.isArray(value) && key in currentState) {
|
||||
setDataDeep(currentState[key], value)
|
||||
} else if (key in currentState) Vue.set(currentState, key, value)
|
||||
} else if (key in currentState) {
|
||||
Vue.set(currentState, key, value)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user