mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge remote-tracking branch 'origin/master' into 00x-table-footer-componente
This commit is contained in:
commit
8260d844fb
@ -32,6 +32,7 @@
|
|||||||
:balance="balance"
|
:balance="balance"
|
||||||
:gdt-balance="GdtBalance"
|
:gdt-balance="GdtBalance"
|
||||||
:transactions="transactions"
|
:transactions="transactions"
|
||||||
|
:transactionCount="transactionCount"
|
||||||
@update-balance="updateBalance"
|
@update-balance="updateBalance"
|
||||||
@update-transactions="updateTransactions"
|
@update-transactions="updateTransactions"
|
||||||
></router-view>
|
></router-view>
|
||||||
@ -80,6 +81,7 @@ export default {
|
|||||||
GdtBalance: 0,
|
GdtBalance: 0,
|
||||||
transactions: [],
|
transactions: [],
|
||||||
bookedBalance: 0,
|
bookedBalance: 0,
|
||||||
|
transactionCount: 0,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -102,6 +104,7 @@ export default {
|
|||||||
this.transactions = result.result.data.transactions
|
this.transactions = result.result.data.transactions
|
||||||
this.balance = Number(result.result.data.decay)
|
this.balance = Number(result.result.data.decay)
|
||||||
this.bookedBalance = Number(result.result.data.balance)
|
this.bookedBalance = Number(result.result.data.balance)
|
||||||
|
this.transactionCount = result.result.data.count
|
||||||
} else {
|
} else {
|
||||||
// what to do when loading balance fails?
|
// what to do when loading balance fails?
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,6 +15,8 @@
|
|||||||
v-if="showTransactionList"
|
v-if="showTransactionList"
|
||||||
:transactions="transactions"
|
:transactions="transactions"
|
||||||
:max="5"
|
:max="5"
|
||||||
|
:timestamp="timestamp"
|
||||||
|
:transactionCount="transactionCount"
|
||||||
@update-transactions="updateTransactions"
|
@update-transactions="updateTransactions"
|
||||||
/>
|
/>
|
||||||
<gdd-table-footer :count="count"/>
|
<gdd-table-footer :count="count"/>
|
||||||
@ -38,6 +40,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showTransactionList: true,
|
showTransactionList: true,
|
||||||
|
timestamp: Date.now(),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
@ -46,6 +49,7 @@ export default {
|
|||||||
transactions: {
|
transactions: {
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
|
transactionCount: { type: Number, default: 0 },
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toggleShowList(bool) {
|
toggleShowList(bool) {
|
||||||
|
|||||||
@ -103,37 +103,25 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
transactions: { default: [] },
|
transactions: { default: [] },
|
||||||
max: { type: Number, default: 25 },
|
max: { type: Number, default: 25 },
|
||||||
|
timestamp: { type: Number, default: 0 },
|
||||||
|
transactionCount: { type: Number, default: 0 },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: [],
|
form: [],
|
||||||
fields: ['balance', 'date', 'memo', 'name', 'transaction_id', 'type', 'details'],
|
fields: ['balance', 'date', 'memo', 'name', 'transaction_id', 'type', 'details'],
|
||||||
items: [],
|
items: [],
|
||||||
count: 0,
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
watch: {
|
||||||
this.$emit('change-transactions')
|
timestamp: {
|
||||||
},
|
immediate: true,
|
||||||
computed: {
|
handler: 'updateTransactions',
|
||||||
filteredItems() {
|
|
||||||
return this.ojectToArray(this.items).reverse()
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
ojectToArray(obj) {
|
updateTransactions() {
|
||||||
let result = new Array(Object.keys(obj).length)
|
this.$emit('update-transactions')
|
||||||
Object.entries(obj).forEach((entry) => {
|
|
||||||
const [key, value] = entry
|
|
||||||
result[key] = value
|
|
||||||
})
|
|
||||||
return result
|
|
||||||
},
|
|
||||||
rowClass(item, type) {
|
|
||||||
if (!item || type !== 'row') return
|
|
||||||
if (item.type === 'receive') return 'table-success'
|
|
||||||
if (item.type === 'send') return 'table-warning'
|
|
||||||
if (item.type === 'creation') return 'table-primary'
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,12 @@
|
|||||||
<b-container fluid class="mt--6">
|
<b-container fluid class="mt--6">
|
||||||
<b-row>
|
<b-row>
|
||||||
<b-col class="order-xl-1">
|
<b-col class="order-xl-1">
|
||||||
<gdd-table :transactions="transactions" @update-transactions="updateTransactions" />
|
<gdd-table
|
||||||
|
:timestamp="timestamp"
|
||||||
|
:transactionCount="transactionCount"
|
||||||
|
:transactions="transactions"
|
||||||
|
@update-transactions="updateTransactions"
|
||||||
|
/>
|
||||||
</b-col>
|
</b-col>
|
||||||
</b-row>
|
</b-row>
|
||||||
<b-row class="text-center mb-6" v-if="transactions.length == 0">
|
<b-row class="text-center mb-6" v-if="transactions.length == 0">
|
||||||
@ -27,6 +32,12 @@ export default {
|
|||||||
transactions: {
|
transactions: {
|
||||||
default: [],
|
default: [],
|
||||||
},
|
},
|
||||||
|
transactionCount: { type: Number, default: 0 },
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
timestamp: Date.now(),
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
updateTransactions() {
|
updateTransactions() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user