update store for sibling components in Main Page
This commit is contained in:
parent
70cb21c9af
commit
e2dee69e71
@ -17,14 +17,14 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('machines', ['selectedSelects', 'selectsData', 'toggleFilter', 'selectedData']),
|
||||
...mapGetters('layoutMachines', ['selectedSelects', 'selectsData', 'toggleFilter', 'selectedData']),
|
||||
},
|
||||
mounted () {
|
||||
|
||||
},
|
||||
methods: {
|
||||
...mapMutations('machines', ['setSelectedSelect', 'setToggleFilter']),
|
||||
...mapActions('machines', ['updateSelects']),
|
||||
...mapMutations('layoutMachines', ['setSelectedSelect', 'setToggleFilter']),
|
||||
...mapActions('layoutMachines', ['updateSelects']),
|
||||
updateSelectedSelects: function(value) {
|
||||
if (value.length > 0) {
|
||||
this.updateSelects({key: 'set', value: value})
|
||||
|
||||
@ -13,10 +13,10 @@ export default {
|
||||
// const updatedData = historyData.filter((el, idx, arr) => arr.findIndex((item) => item.machine_id === el.machine_id) === idx).slice(0, 50) // uniq values
|
||||
const updatedData = isHistoryData ? historyData.slice(0, 50) : []
|
||||
const store = useStore()
|
||||
store.commit('machines/setHistoryData', updatedData)
|
||||
store.commit('layoutMachines/setHistoryData', updatedData)
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('machines', ['historyData']),
|
||||
...mapGetters('layoutMachines', ['historyData']),
|
||||
tabulatorOtps() {
|
||||
return {
|
||||
dataSource: this.historyData,
|
||||
@ -51,7 +51,7 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapMutations('machines', ['setHistoryData']),
|
||||
...mapMutations('layoutMachines', ['setHistoryData']),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -29,14 +29,14 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('machines', ['machinesData', 'historyData', 'historyMachines']),
|
||||
...mapGetters('layoutMachines', ['machinesData', 'historyData', 'historyMachines']),
|
||||
},
|
||||
mounted () {
|
||||
|
||||
},
|
||||
methods: {
|
||||
...mapMutations('machines', ['setInitHistory', 'setHistoryData', 'setHistoryMachines']),
|
||||
...mapActions('machines', ['openMapModal', 'openDataModal']),
|
||||
...mapMutations('layoutMachines', ['setInitHistory', 'setHistoryData', 'setHistoryMachines']),
|
||||
...mapActions('layoutMachines', ['openMapModal', 'openDataModal']),
|
||||
buttonClass: function(value) {
|
||||
return `border border-slate-400 flex items-center justify-center cursor-pointer rounded transition-all text-xs text-center py-[5px] px-2 ${value}`
|
||||
},
|
||||
|
||||
@ -11,7 +11,7 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('machines', ['tableData', 'pagination']),
|
||||
...mapGetters('layoutMachines', ['tableData', 'pagination']),
|
||||
tabulatorOtps() {
|
||||
return {
|
||||
dataSource: this.tableData,
|
||||
@ -81,8 +81,8 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapMutations('machines', ['setHistoryData']),
|
||||
...mapActions('machines', ['updatePagination']),
|
||||
...mapMutations('layoutMachines', ['setHistoryData']),
|
||||
...mapActions('layoutMachines', ['updatePagination']),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user