2018-11-30 07:42:04 +00:00
|
|
|
<template>
|
|
|
|
<div class="import">
|
|
|
|
<h1>Analyse</h1>
|
2018-12-03 11:15:22 +00:00
|
|
|
<div class="analysis" v-if="datas_present">
|
2019-01-27 06:18:50 +00:00
|
|
|
<h2> Sur le temps </h2>
|
|
|
|
<graph-time></graph-time>
|
2018-11-30 14:15:23 +00:00
|
|
|
|
2019-01-27 06:18:50 +00:00
|
|
|
<h2> Par mois</h2>
|
|
|
|
<b-container fluid>
|
|
|
|
<b-row class="date-selector">
|
|
|
|
<b-button @click="prev_month" variant="link">
|
|
|
|
<font-awesome-icon icon="angle-left" class="fa" />
|
|
|
|
</b-button>
|
|
|
|
<span class="text-muted btn" disabled="true">
|
|
|
|
{{ month.format('MMMM YYYY') }}
|
|
|
|
</span>
|
|
|
|
<b-button @click="next_month" variant="link">
|
|
|
|
<font-awesome-icon icon="angle-right" class="fa" />
|
|
|
|
</b-button>
|
|
|
|
</b-row>
|
|
|
|
</b-container>
|
2018-11-30 17:36:30 +00:00
|
|
|
|
2019-01-28 08:47:41 +00:00
|
|
|
<b-card-group deck class="mb-3">
|
|
|
|
<div v-for="categorie in categories">
|
2019-01-30 14:41:27 +00:00
|
|
|
<card-categorie @click.native="set_categories_filter([categorie.name])" :categoriename="categorie.name"></card-categorie>
|
2019-01-28 08:47:41 +00:00
|
|
|
</div>
|
2019-01-27 06:18:50 +00:00
|
|
|
</b-card-group>
|
2018-12-02 15:43:23 +00:00
|
|
|
|
2019-01-27 06:18:50 +00:00
|
|
|
<tags-comparison></tags-comparison>
|
|
|
|
|
|
|
|
<b-table striped hover :items="filtered_rows" :fields='fields'>
|
|
|
|
<template slot="tags" slot-scope="data">
|
2019-01-30 14:41:27 +00:00
|
|
|
<div v-if="data.item.tags.length > 0">
|
|
|
|
<div v-for="tag in data.item.tags" :key="tag.name">
|
2019-01-27 06:18:50 +00:00
|
|
|
<font-awesome-icon :icon="tag.icon" class="fa"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-01-30 14:41:27 +00:00
|
|
|
<div v-else>
|
|
|
|
<b-btn v-b-modal="data.item.Libellé">
|
|
|
|
<font-awesome-icon icon="plus" class="fa"/>
|
|
|
|
</b-btn>
|
|
|
|
|
|
|
|
<!-- Modal Component -->
|
|
|
|
<b-modal :id="data.item.Libellé"
|
|
|
|
title="Tag pour le mot clé"
|
|
|
|
hide-footer
|
|
|
|
>
|
|
|
|
<associate-tag-keyword
|
|
|
|
:libelle="data.item.Libellé">
|
|
|
|
</associate-tag-keyword>
|
|
|
|
</b-modal>
|
|
|
|
</div>
|
2019-01-27 06:18:50 +00:00
|
|
|
</template>
|
|
|
|
</b-table>
|
2018-12-03 11:09:28 +00:00
|
|
|
</div>
|
|
|
|
<div v-else>
|
2019-01-27 06:18:50 +00:00
|
|
|
<div class="nodata">
|
|
|
|
<h1>
|
|
|
|
<font-awesome-icon icon="dizzy" class="fa"/>
|
|
|
|
Pas de données
|
|
|
|
<font-awesome-icon icon="dizzy" class="fa"/>
|
|
|
|
</h1>
|
|
|
|
<p>
|
|
|
|
Penser à en importer!
|
|
|
|
</p>
|
|
|
|
</div>
|
2018-12-03 11:09:28 +00:00
|
|
|
</div>
|
2018-11-30 07:42:04 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
2018-11-30 10:53:50 +00:00
|
|
|
|
|
|
|
<script>
|
2018-12-01 13:49:02 +00:00
|
|
|
import { mapGetters, mapActions } from 'vuex'
|
2019-01-27 17:59:09 +00:00
|
|
|
import cardCategorie from '../components/card_categorie'
|
2019-01-27 17:01:37 +00:00
|
|
|
import tagsComparison from '../components/graph_tags_comparison'
|
2019-01-27 06:18:50 +00:00
|
|
|
import graphTime from '../components/graph_time'
|
2019-01-30 14:41:27 +00:00
|
|
|
import associateTagKeyword from '../components/associate_tag_keyword'
|
2019-01-21 11:33:24 +00:00
|
|
|
import moment from 'moment'
|
2018-11-30 10:53:50 +00:00
|
|
|
|
2019-01-24 10:50:27 +00:00
|
|
|
moment.locale('fr')
|
|
|
|
|
2018-11-30 10:53:50 +00:00
|
|
|
export default {
|
2018-11-30 14:47:13 +00:00
|
|
|
name: 'home',
|
2018-11-30 10:53:50 +00:00
|
|
|
components: {
|
2019-01-27 17:59:09 +00:00
|
|
|
cardCategorie: cardCategorie,
|
2019-01-27 06:18:50 +00:00
|
|
|
tagsComparison: tagsComparison,
|
2019-01-30 14:41:27 +00:00
|
|
|
graphTime: graphTime,
|
|
|
|
associateTagKeyword: associateTagKeyword
|
2018-11-30 10:53:50 +00:00
|
|
|
},
|
|
|
|
data () {
|
|
|
|
return {
|
2018-11-30 14:15:23 +00:00
|
|
|
fields: [
|
|
|
|
{
|
|
|
|
key: 'Date',
|
2018-11-30 15:34:05 +00:00
|
|
|
sortable: true,
|
2018-12-03 13:38:03 +00:00
|
|
|
formatter: d => d.format('DD/MM/YYYY')
|
2018-11-30 14:15:23 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
key: 'Montant',
|
|
|
|
sortable: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key: 'Libellé',
|
|
|
|
sortable: true
|
2018-12-03 08:49:36 +00:00
|
|
|
},
|
|
|
|
{
|
2018-12-03 11:09:28 +00:00
|
|
|
key: 'tags'
|
2018-11-30 14:15:23 +00:00
|
|
|
}
|
2018-11-30 14:56:18 +00:00
|
|
|
],
|
2018-12-03 11:00:41 +00:00
|
|
|
default_tag: {
|
2018-12-03 09:41:57 +00:00
|
|
|
name: 'Tout',
|
|
|
|
variant: 'info',
|
|
|
|
icon: 'file-invoice-dollar'
|
|
|
|
},
|
2019-01-30 14:41:27 +00:00
|
|
|
categories_filter: [],
|
|
|
|
keyword: ''
|
2018-11-30 10:53:50 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapGetters({
|
2018-11-30 14:56:18 +00:00
|
|
|
'csvs': 'datas/csvs',
|
2019-01-27 18:48:31 +00:00
|
|
|
'categorie_filter_rows': 'datas/categorie_filter_rows',
|
2018-12-03 11:15:22 +00:00
|
|
|
'datas_present': 'datas/present',
|
2019-01-24 10:50:27 +00:00
|
|
|
'month': 'datas/month',
|
2021-06-10 19:56:51 +00:00
|
|
|
'months': 'datas/months',
|
2019-01-27 17:59:09 +00:00
|
|
|
'tags': 'config/tags',
|
|
|
|
'categories': 'config/categories'
|
2018-12-03 09:41:57 +00:00
|
|
|
}),
|
|
|
|
filtered_rows () {
|
2019-01-27 18:48:31 +00:00
|
|
|
return this.categorie_filter_rows(this.categories_filter)
|
|
|
|
}
|
2018-11-30 10:53:50 +00:00
|
|
|
},
|
|
|
|
methods: {
|
2018-12-01 13:49:02 +00:00
|
|
|
...mapActions('datas', [
|
2019-01-24 10:50:27 +00:00
|
|
|
'next_month',
|
2019-01-27 18:48:31 +00:00
|
|
|
'prev_month'
|
2018-12-01 13:49:02 +00:00
|
|
|
]),
|
2019-01-27 18:48:31 +00:00
|
|
|
set_categories_filter (categorienames) {
|
|
|
|
this.categories_filter = categorienames
|
2019-01-30 14:41:27 +00:00
|
|
|
},
|
|
|
|
showModal (name) {
|
|
|
|
console.log(name)
|
2019-01-27 18:48:31 +00:00
|
|
|
}
|
2018-11-30 10:53:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
2018-11-30 14:15:23 +00:00
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.date-selector {
|
2018-12-03 11:15:22 +00:00
|
|
|
padding: 1rem;
|
|
|
|
}
|
|
|
|
.nodata{
|
|
|
|
text-align: center;
|
2018-11-30 14:15:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|