mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-05 07:19:49 +00:00
some setup in frontend
This commit is contained in:
parent
b172ebdf76
commit
b5f7f578da
@ -131,6 +131,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.$store.dispatch('getDashboardItems', {userId: 1})
|
||||||
for (const m of [
|
for (const m of [
|
||||||
'MyNotifications',
|
'MyNotifications',
|
||||||
'MyAccompanyingCourses',
|
'MyAccompanyingCourses',
|
||||||
|
@ -39,10 +39,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--
|
|
||||||
<div class="mbloc col col-sm-6 col-lg-4">
|
<div class="mbloc col col-sm-6 col-lg-4">
|
||||||
<div class="custom2">
|
<div class="custom2">
|
||||||
Mon dashboard personnalisé
|
News
|
||||||
|
<MyWidget :chart-data="chartData" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mbloc col col-sm-6 col-lg-4">
|
<div class="mbloc col col-sm-6 col-lg-4">
|
||||||
@ -50,12 +51,6 @@
|
|||||||
Mon dashboard personnalisé
|
Mon dashboard personnalisé
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mbloc col col-sm-6 col-lg-4">
|
|
||||||
<div class="custom4">
|
|
||||||
Mon dashboard personnalisé
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
-->
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -70,7 +65,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
counterClass: {
|
counterClass: {
|
||||||
counter: true //hack to pass class 'counter' in i18n-t
|
counter: true //hack to pass class 'counter' in i18n-t
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -24,7 +24,7 @@ const store = createStore({
|
|||||||
workflows: {},
|
workflows: {},
|
||||||
workflowsCc: {},
|
workflowsCc: {},
|
||||||
errorMsg: [],
|
errorMsg: [],
|
||||||
newsItems: {},
|
dashboardItems: {},
|
||||||
loading: false
|
loading: false
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
@ -98,26 +98,26 @@ const store = createStore({
|
|||||||
catchError(state, error) {
|
catchError(state, error) {
|
||||||
state.errorMsg.push(error);
|
state.errorMsg.push(error);
|
||||||
},
|
},
|
||||||
addNewsItems(state, newsItems) {
|
addDashboardItems(state, dashboardItems) {
|
||||||
state.newsItems = newsItems;
|
state.dashboardItems = dashboardItems;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
getByTab({ commit, getters }, { tab, param }) {
|
getDashboardItems({commit, getters}, { userId }) {
|
||||||
switch (tab) {
|
const url = `/api/1.0/main/dashboard-item/${userId}.json`;
|
||||||
case 'MyCustoms':
|
|
||||||
const url = `/api/1.0/main/news.json`;
|
|
||||||
makeFetch('GET', url)
|
makeFetch('GET', url)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
console.log('news', response.results)
|
console.log('dashboardItems', response.results)
|
||||||
commit('addNewsItems', response);
|
commit('addDashboardItems', response);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
commit('catchError', error);
|
commit('catchError', error);
|
||||||
throw error;
|
throw error;
|
||||||
})
|
})
|
||||||
;
|
;
|
||||||
break;
|
},
|
||||||
|
getByTab({ commit, getters }, { tab, param }) {
|
||||||
|
switch (tab) {
|
||||||
// case 'MyWorks':
|
// case 'MyWorks':
|
||||||
// if (!getters.isWorksLoaded) {
|
// if (!getters.isWorksLoaded) {
|
||||||
// commit('setLoading', true);
|
// commit('setLoading', true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user