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

@ -5,7 +5,7 @@ const { reactiveProp } = mixins
export default { export default {
name: 'pie', name: 'pie',
extends: Doughnut, extends: Doughnut,
mixins: [reactiveProp], mixins: [reactiveProp],
props: ['chartData', 'options'], props: ['chartData', 'options'],
mounted () { mounted () {
this.renderChart(this.chartData, this.options) this.renderChart(this.chartData, this.options)

View File

@ -4,7 +4,6 @@
</div> </div>
</template> </template>
<script> <script>
import pie from './charjs_donut' import pie from './charjs_donut'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
@ -40,7 +39,7 @@ export default {
labels: this.selected_tags, labels: this.selected_tags,
datasets: [ datasets: [
{ {
label: "Dépenses", label: 'Dépenses',
data: this.spendings 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 // Append row.tag
// if row.libellé contains one of words and not invert it gets tagged // if row.libellé contains one of words and not invert it gets tagged
// if row.libellé contains no words and 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])) var sum = row.map(x => parseFloat(x[field]))
.reduce((sum, x) => sum + x, 0) .reduce((sum, x) => sum + x, 0)
return Math.round(sum) return Math.round(sum)

View File

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

View File

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