diff --git a/config/config.yml b/config/config.yml index 99b54a7..65a85e4 100644 --- a/config/config.yml +++ b/config/config.yml @@ -1,5 +1,5 @@ --- -postes: +tags: cash: name: Cash variant: info diff --git a/src/components/box.vue b/src/components/box.vue index ecec6cb..d2e4291 100644 --- a/src/components/box.vue +++ b/src/components/box.vue @@ -1,15 +1,15 @@ - - + {{ total() }}€ - {{ poste.name }} + {{ tag.name }} @@ -21,12 +21,12 @@ import { total } from '../libs/data_processing' export default { name: 'box', props: [ - 'postename', + 'tagname', 'rows' ], data () { return { - default_poste: { + default_tag: { name: 'Tout', variant: 'info', icon: 'file-invoice-dollar' @@ -35,25 +35,25 @@ export default { }, computed: { ...mapGetters('config', [ - 'postes' + 'tags' ]), ...mapGetters('datas', [ 'tag_filter_rows' ]), - poste () { - if (this.postename) { - return this.postes[this.postename] + tag () { + if (this.tagname) { + return this.tags[this.tagname] } else { - return this.default_poste + return this.default_tag } } }, methods: { filter_rows () { - if (this.poste === this.default_poste) { + if (this.tag === this.default_tag) { return this.tag_filter_rows([]) } else { - return this.tag_filter_rows([this.poste.name]) + return this.tag_filter_rows([this.tag.name]) } }, total () { diff --git a/src/components/postes_comparison.vue b/src/components/tags_comparison.vue similarity index 97% rename from src/components/postes_comparison.vue rename to src/components/tags_comparison.vue index 1f67766..9a9233e 100644 --- a/src/components/postes_comparison.vue +++ b/src/components/tags_comparison.vue @@ -55,7 +55,6 @@ export default { } }) tagsSpendings[tagsSpendings.length - 1] = total(this.tag_filter_rows([])) - tagsSpendings.reduce((sum, a) => sum + a, 0) - console.log(tagsSpendings) return tagsSpendings } }, diff --git a/src/store/modules/config.js b/src/store/modules/config.js index 063244e..884db79 100644 --- a/src/store/modules/config.js +++ b/src/store/modules/config.js @@ -8,7 +8,7 @@ export default { data_dir: '/home/lafrite/scripts/comptes/data/', config_dir: '/home/lafrite/scripts/comptes/config/', config_filename: 'config.yml', - postes: {} + tags: {} }, getters: { data_dir: (state) => { @@ -20,13 +20,13 @@ export default { config_filename: (state) => { return state.config_filename }, - postes: (state) => { - return state.postes + tags: (state) => { + return state.tags } }, mutations: { - SET_POSTES: (state, { postes }) => { - state.postes = postes + SET_TAGS: (state, { tags }) => { + state.tags = tags } }, actions: { @@ -39,7 +39,7 @@ export default { header: true } var parsed = yaml.safeLoad(content, parseConfig) - context.commit('SET_POSTES', { postes: parsed.postes }) + context.commit('SET_TAGS', { tags: parsed.tags }) } }) } diff --git a/src/store/modules/datas.js b/src/store/modules/datas.js index 8a9bb90..3163efc 100644 --- a/src/store/modules/datas.js +++ b/src/store/modules/datas.js @@ -136,10 +136,10 @@ export default { }) }, clean_store_data (context, parsed) { - var postes = Object.values(context.rootGetters['config/postes']) + var tags = Object.values(context.rootGetters['config/tags']) parsed.data = parsed.data.filter(x => x.Libellé !== undefined) parsed.data.forEach(row => { - appendTag(row, postes, 'Libellé') + appendTag(row, tags, 'Libellé') }) context.commit('SET_DATA', { data: parsed }) diff --git a/src/views/config.vue b/src/views/config.vue index 65b9047..dcfed9c 100644 --- a/src/views/config.vue +++ b/src/views/config.vue @@ -1,5 +1,5 @@ - - Postes + + Tags diff --git a/src/views/home.vue b/src/views/home.vue index a12f92e..a4b4314 100644 --- a/src/views/home.vue +++ b/src/views/home.vue @@ -15,13 +15,13 @@ - - - - + + + + - + @@ -32,21 +32,19 @@ - ->>>>>>> chartjs