Lint: linting!

This commit is contained in:
Bertrand Benjamin 2018-12-03 12:09:28 +01:00
parent 9d9f511f2c
commit 06855a1f5b
5 changed files with 42 additions and 35 deletions

View File

@ -4,7 +4,6 @@
</div>
</template>
<script>
import pie from './charjs_donut'
import { mapGetters } from 'vuex'
@ -40,7 +39,7 @@ export default {
labels: this.selected_tags,
datasets: [
{
label: "Dépenses",
label: 'Dépenses',
data: this.spendings
}
]

View File

@ -1,4 +1,4 @@
export function appendTag (row, keywords, field='Libellé') {
export function appendTag (row, keywords, field = 'Libellé') {
// Append row.tag
// if row.libellé contains one of words and not invert it gets tagged
// if row.libellé contains no words and invert it gets tagged
@ -25,7 +25,7 @@ function strContains (string, words, invert) {
}
}
export function total (row, field='Montant') {
export function total (row, field = 'Montant') {
var sum = row.map(x => parseFloat(x[field]))
.reduce((sum, x) => sum + x, 0)
return Math.round(sum)

View File

@ -30,7 +30,7 @@ export default {
}
},
actions: {
load(context) {
load (context) {
readFile(path.join(context.getters.config_dir, context.getters.config_filename), 'utf8', (err, content) => {
if (err) {
console.log(err)

View File

@ -1,37 +1,44 @@
<template>
<div class="import">
<h1>Analyse</h1>
<b-container fluid>
<b-row class="date-selector">
<b-col sm="1"><label for="start"> Entre </label> </b-col>
<b-col sm="3">
<b-form-input id="start" type="date" :value="start" @input="set_start"></b-form-input>
</b-col>
<b-col sm="1"><label for="end"> et </label></b-col>
<b-col sm="3">
<b-form-input id="end" type="date" :value="end" @input="set_end"></b-form-input>
</b-col>
</b-row>
</b-container>
<div class="analysis" v-if="rows">
<b-container fluid>
<b-row class="date-selector">
<b-col sm="1"><label for="start"> Entre </label> </b-col>
<b-col sm="3">
<b-form-input id="start" type="date" :value="start" @input="set_start"></b-form-input>
</b-col>
<b-col sm="1"><label for="end"> et </label></b-col>
<b-col sm="3">
<b-form-input id="end" type="date" :value="end" @input="set_end"></b-form-input>
</b-col>
</b-row>
</b-container>
<b-card-group deck class="mb-3">
<box @click.native="set_tags_filter([])"></box>
<box @click.native="set_tags_filter(['cash'])" tagname="cash"></box>
<box @click.native="set_tags_filter(['CB'])" tagname="CB"></box>
<box @click.native="set_tags_filter(['virements'])" tagname="virements"></box>
</b-card-group>
<b-card-group deck class="mb-3">
<box @click.native="set_tags_filter([])"></box>
<box @click.native="set_tags_filter(['cash'])" tagname="cash"></box>
<box @click.native="set_tags_filter(['CB'])" tagname="CB"></box>
<box @click.native="set_tags_filter(['virements'])" tagname="virements"></box>
</b-card-group>
<tags-comparison></tags-comparison>
<tags-comparison></tags-comparison>
<b-table striped hover :items="filtered_rows" :fields='fields'>
<template slot="tags" slot-scope="data">
<div v-for="tag in data.item.tags">
<div v-if="tag.name !== 'Tout'">
<font-awesome-icon :icon="tag.icon" class="fa"/>
</div>
</div>
</template>
</b-table>
<b-table striped hover :items="filtered_rows" :fields='fields'>
<template slot="tags" slot-scope="data">
<div v-for="tag in data.item.tags">
<div v-if="tag.name !== 'Tout'">
<font-awesome-icon :icon="tag.icon" class="fa"/>
</div>
</div>
</template>
</b-table>
</div>
<div v-else>
<font-awesome-icon icon="dizzy" class="fa"/>
Pas de données
<font-awesome-icon icon="dizzy" class="fa"/>
</div>
</div>
</template>
@ -63,7 +70,7 @@ export default {
sortable: true
},
{
key: 'tags',
key: 'tags'
}
],
default_tag: {
@ -82,6 +89,7 @@ export default {
...mapGetters({
'csvs': 'datas/csvs',
'tag_filter_rows': 'datas/tag_filter_rows',
'rows': 'datas/rows',
'start': 'datas/start',
'end': 'datas/end',
'tags': 'config/tags'