/
Vuex.js
119 lines (116 loc) · 1.98 KB
/
Vuex.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
import Vuex from 'vuex'
import * as AppsService from './apps/AppsService'
import * as SourcesService from './sources/SourcesService'
export default new Vuex.Store({
state: {
apiCards: [],
apiSource: [],
apiIconsCards: [{
id: 0,
icon: 'far fa-money-bill-alt'
},
{
id: 1,
icon: 'fas fa-coins'
},
{
id: 2,
icon: 'fas fa-share-alt'
},
{
id: 3,
icon: 'far fa-check-square'
},
{
id: 4,
icon: 'fas fa-car'
},
{
id: 5,
icon: 'fas fa-network-wired'
},
{
id: 6,
icon: 'fas fa-search'
},
{
id: 7,
icon: 'far fa-file'
},
{
id: 8,
icon: 'fas fa-address-card'
},
{
id: 9,
icon: 'fas fa-user-secret'
},
{
id: 10,
icon: 'fas fa-map-marker-alt'
},
{
id: 11,
icon: 'fas fa-bullseye'
}
],
apiIconsSource: [{
id: 0,
icon: 'fas fa-globe'
},
{
id: 1,
icon: 'fas fa-briefcase'
},
{
id: 2,
icon: 'fas fa-tree'
},
{
id: 3,
icon: 'fas fa-gavel'
},
{
id: 4,
icon: 'fas fa-ban'
},
{
id: 5,
icon: 'fas fa-globe-americas'
},
{
id: 6,
icon: 'fas fa-gem'
},
{
id: 7,
icon: 'fas fa-male'
},
{
id: 8,
icon: 'fas fa-piggy-bank'
}
],
FonteMenu: [],
loadig: true
},
actions: {
loadApiCards ({ commit }) {
AppsService.loadCards().then(apiCards => commit('APP_CARDS', apiCards)
)
},
loadApiSource ({ commit }) {
SourcesService.loadCards().then(apiSource => commit('SOURCE_CARDS', apiSource)
)
}
},
mutations: {
APP_CARDS (state, apiCards) {
AppsService.MutationAppCards(state, apiCards)
},
SOURCE_CARDS (state, apiSource) {
SourcesService.MutationAppCards(state, apiSource, state.FonteMenu)
state.FonteMenu = state.apiSource
}
}
})