mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 00:34:28 +08:00
support set show/hide account balance in account list page
This commit is contained in:
@@ -42,6 +42,10 @@
|
||||
<option value="name">{{ $t('Currency Name') }}</option>
|
||||
</select>
|
||||
</f7-list-item>
|
||||
<f7-list-item>
|
||||
<span>{{ $t('Show Account Balance') }}</span>
|
||||
<f7-toggle :checked="showAccountBalance" @toggle:change="showAccountBalance = $event"></f7-toggle>
|
||||
</f7-list-item>
|
||||
<f7-list-item>
|
||||
<span>{{ $t('Enable Animate') }}</span>
|
||||
<f7-toggle :checked="isEnableAnimate" @toggle:change="isEnableAnimate = $event"></f7-toggle>
|
||||
@@ -99,6 +103,14 @@ export default {
|
||||
this.$settings.setCurrencyDisplayMode(value);
|
||||
}
|
||||
},
|
||||
showAccountBalance: {
|
||||
get: function () {
|
||||
return this.$settings.isShowAccountBalance();
|
||||
},
|
||||
set: function (value) {
|
||||
this.$settings.setShowAccountBalance(value);
|
||||
}
|
||||
},
|
||||
isEnableAnimate: {
|
||||
get: function () {
|
||||
return this.$settings.isEnableAnimate();
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
<f7-list sortable sortable-tap-hold :sortable-enabled="sortable" @sortable:sort="onSort">
|
||||
<f7-list-item v-for="account in accounts[accountCategory.id]" v-show="showHidden || !account.hidden"
|
||||
:key="account.id" :id="account | accountDomId"
|
||||
:title="account.name" :after="account.balance | currency(account.currency)"
|
||||
:title="account.name" :after="accountBalance(account) | currency(account.currency)"
|
||||
link="#" swipeout @taphold.native="setSortable()"
|
||||
>
|
||||
<f7-swipeout-actions left v-if="sortable">
|
||||
@@ -201,6 +201,13 @@ export default {
|
||||
|
||||
return shownCount > 0;
|
||||
},
|
||||
accountBalance(account) {
|
||||
if (this.$settings.isShowAccountBalance()) {
|
||||
return account.balance;
|
||||
} else {
|
||||
return '---';
|
||||
}
|
||||
},
|
||||
setSortable() {
|
||||
this.showHidden = true;
|
||||
this.sortable = true;
|
||||
|
||||
Reference in New Issue
Block a user