update store for sibling components in Main Page
This commit is contained in:
parent
70cb21c9af
commit
e2dee69e71
@ -17,14 +17,14 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters('machines', ['selectedSelects', 'selectsData', 'toggleFilter', 'selectedData']),
|
...mapGetters('layoutMachines', ['selectedSelects', 'selectsData', 'toggleFilter', 'selectedData']),
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations('machines', ['setSelectedSelect', 'setToggleFilter']),
|
...mapMutations('layoutMachines', ['setSelectedSelect', 'setToggleFilter']),
|
||||||
...mapActions('machines', ['updateSelects']),
|
...mapActions('layoutMachines', ['updateSelects']),
|
||||||
updateSelectedSelects: function(value) {
|
updateSelectedSelects: function(value) {
|
||||||
if (value.length > 0) {
|
if (value.length > 0) {
|
||||||
this.updateSelects({key: 'set', value: value})
|
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 = 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 updatedData = isHistoryData ? historyData.slice(0, 50) : []
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
store.commit('machines/setHistoryData', updatedData)
|
store.commit('layoutMachines/setHistoryData', updatedData)
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters('machines', ['historyData']),
|
...mapGetters('layoutMachines', ['historyData']),
|
||||||
tabulatorOtps() {
|
tabulatorOtps() {
|
||||||
return {
|
return {
|
||||||
dataSource: this.historyData,
|
dataSource: this.historyData,
|
||||||
@ -51,7 +51,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations('machines', ['setHistoryData']),
|
...mapMutations('layoutMachines', ['setHistoryData']),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -29,14 +29,14 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters('machines', ['machinesData', 'historyData', 'historyMachines']),
|
...mapGetters('layoutMachines', ['machinesData', 'historyData', 'historyMachines']),
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations('machines', ['setInitHistory', 'setHistoryData', 'setHistoryMachines']),
|
...mapMutations('layoutMachines', ['setInitHistory', 'setHistoryData', 'setHistoryMachines']),
|
||||||
...mapActions('machines', ['openMapModal', 'openDataModal']),
|
...mapActions('layoutMachines', ['openMapModal', 'openDataModal']),
|
||||||
buttonClass: function(value) {
|
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}`
|
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: {
|
computed: {
|
||||||
...mapGetters('machines', ['tableData', 'pagination']),
|
...mapGetters('layoutMachines', ['tableData', 'pagination']),
|
||||||
tabulatorOtps() {
|
tabulatorOtps() {
|
||||||
return {
|
return {
|
||||||
dataSource: this.tableData,
|
dataSource: this.tableData,
|
||||||
@ -81,8 +81,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations('machines', ['setHistoryData']),
|
...mapMutations('layoutMachines', ['setHistoryData']),
|
||||||
...mapActions('machines', ['updatePagination']),
|
...mapActions('layoutMachines', ['updatePagination']),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user