✨ (account) add a new tab with all locations in a map
This commit is contained in:
@@ -58,6 +58,15 @@
|
||||
<awe-icon icon="dollar-sign" />
|
||||
</a>
|
||||
</li>
|
||||
<li v-if="locations.length">
|
||||
<a
|
||||
:style="colorStyle(activeTab === 'location')"
|
||||
href="#"
|
||||
@click.prevent="toggleTab('location')"
|
||||
>
|
||||
<awe-icon icon="globe-europe" />
|
||||
</a>
|
||||
</li>
|
||||
<li v-if="tagCount > 1">
|
||||
<a
|
||||
:style="colorStyle(activeTab === 'tag')"
|
||||
@@ -97,6 +106,13 @@
|
||||
:transactions="transactions"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
key="location"
|
||||
class="location-panel tab-content is-centered"
|
||||
v-if="locations.length && activeTab === 'location'"
|
||||
>
|
||||
<earth-map :locations="locations" />
|
||||
</div>
|
||||
<div
|
||||
key="tag"
|
||||
class="tag-panel tab-content is-centered"
|
||||
@@ -175,6 +191,7 @@ import { primary, main, findContrastColor, findDarkValue } from '@/utils'
|
||||
'account-share': () => import('@/components/AccountShare.vue'),
|
||||
'account-transaction-list': () =>
|
||||
import('@/components/AccountTransactionList.vue'),
|
||||
'earth-map': () => import('@/components/EarthMap.vue'),
|
||||
'tag-list': () => import('@/components/TagList.vue'),
|
||||
'chart-balance': () => import('@/components/ChartBalance.vue'),
|
||||
'online-view': () => import('@/components/OnlineView.vue'),
|
||||
@@ -359,6 +376,12 @@ export default class AccountItem extends BaseAccount {
|
||||
})
|
||||
}
|
||||
|
||||
public get locations() {
|
||||
return this.transactions
|
||||
.filter((transaction) => transaction.location)
|
||||
.map((transaction) => transaction.location)
|
||||
}
|
||||
|
||||
public get myTotalCost(): number {
|
||||
if (!this.account) {
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user