mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-21 02:04:26 +08:00
support set show/hide account balance in account list page
This commit is contained in:
@@ -7,6 +7,7 @@ const defaultSettings = {
|
|||||||
lang: 'en',
|
lang: 'en',
|
||||||
thousandsSeparator: true,
|
thousandsSeparator: true,
|
||||||
currencyDisplayMode: 'code', // or 'none' or 'name'
|
currencyDisplayMode: 'code', // or 'none' or 'name'
|
||||||
|
showAccountBalance: true,
|
||||||
animate: true,
|
animate: true,
|
||||||
autoDarkMode: true
|
autoDarkMode: true
|
||||||
};
|
};
|
||||||
@@ -71,6 +72,8 @@ export default {
|
|||||||
setEnableThousandsSeparator: value => setOption('thousandsSeparator', value),
|
setEnableThousandsSeparator: value => setOption('thousandsSeparator', value),
|
||||||
getCurrencyDisplayMode: () => getOption('currencyDisplayMode'),
|
getCurrencyDisplayMode: () => getOption('currencyDisplayMode'),
|
||||||
setCurrencyDisplayMode: value => setOption('currencyDisplayMode', value),
|
setCurrencyDisplayMode: value => setOption('currencyDisplayMode', value),
|
||||||
|
isShowAccountBalance: () => getOption('showAccountBalance'),
|
||||||
|
setShowAccountBalance: value => setOption('showAccountBalance', value),
|
||||||
isEnableAnimate: () => getOption('animate'),
|
isEnableAnimate: () => getOption('animate'),
|
||||||
setEnableAnimate: value => setOption('animate', value),
|
setEnableAnimate: value => setOption('animate', value),
|
||||||
isEnableAutoDarkMode: () => getOption('autoDarkMode'),
|
isEnableAutoDarkMode: () => getOption('autoDarkMode'),
|
||||||
|
|||||||
@@ -335,6 +335,7 @@ export default {
|
|||||||
'Currency Display Mode': 'Currency Display Mode',
|
'Currency Display Mode': 'Currency Display Mode',
|
||||||
'Currency Code': 'Currency Code',
|
'Currency Code': 'Currency Code',
|
||||||
'Currency Name': 'Currency Name',
|
'Currency Name': 'Currency Name',
|
||||||
|
'Show Account Balance': 'Show Account Balance',
|
||||||
'Enable Animate': 'Enable Animate',
|
'Enable Animate': 'Enable Animate',
|
||||||
'Enable Auto Dark Mode': 'Enable Auto Dark Mode',
|
'Enable Auto Dark Mode': 'Enable Auto Dark Mode',
|
||||||
'You have been successfully registered': 'You have been successfully registered',
|
'You have been successfully registered': 'You have been successfully registered',
|
||||||
|
|||||||
@@ -335,6 +335,7 @@ export default {
|
|||||||
'Currency Display Mode': '货币显示模式',
|
'Currency Display Mode': '货币显示模式',
|
||||||
'Currency Code': '货币代码',
|
'Currency Code': '货币代码',
|
||||||
'Currency Name': '货币名称',
|
'Currency Name': '货币名称',
|
||||||
|
'Show Account Balance': '显示账户余额',
|
||||||
'Enable Animate': '启用动画',
|
'Enable Animate': '启用动画',
|
||||||
'Enable Auto Dark Mode': '启用自动深色模式',
|
'Enable Auto Dark Mode': '启用自动深色模式',
|
||||||
'You have been successfully registered': '注册成功',
|
'You have been successfully registered': '注册成功',
|
||||||
|
|||||||
@@ -42,6 +42,10 @@
|
|||||||
<option value="name">{{ $t('Currency Name') }}</option>
|
<option value="name">{{ $t('Currency Name') }}</option>
|
||||||
</select>
|
</select>
|
||||||
</f7-list-item>
|
</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>
|
<f7-list-item>
|
||||||
<span>{{ $t('Enable Animate') }}</span>
|
<span>{{ $t('Enable Animate') }}</span>
|
||||||
<f7-toggle :checked="isEnableAnimate" @toggle:change="isEnableAnimate = $event"></f7-toggle>
|
<f7-toggle :checked="isEnableAnimate" @toggle:change="isEnableAnimate = $event"></f7-toggle>
|
||||||
@@ -99,6 +103,14 @@ export default {
|
|||||||
this.$settings.setCurrencyDisplayMode(value);
|
this.$settings.setCurrencyDisplayMode(value);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
showAccountBalance: {
|
||||||
|
get: function () {
|
||||||
|
return this.$settings.isShowAccountBalance();
|
||||||
|
},
|
||||||
|
set: function (value) {
|
||||||
|
this.$settings.setShowAccountBalance(value);
|
||||||
|
}
|
||||||
|
},
|
||||||
isEnableAnimate: {
|
isEnableAnimate: {
|
||||||
get: function () {
|
get: function () {
|
||||||
return this.$settings.isEnableAnimate();
|
return this.$settings.isEnableAnimate();
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
<f7-list sortable sortable-tap-hold :sortable-enabled="sortable" @sortable:sort="onSort">
|
<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"
|
<f7-list-item v-for="account in accounts[accountCategory.id]" v-show="showHidden || !account.hidden"
|
||||||
:key="account.id" :id="account | accountDomId"
|
: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()"
|
link="#" swipeout @taphold.native="setSortable()"
|
||||||
>
|
>
|
||||||
<f7-swipeout-actions left v-if="sortable">
|
<f7-swipeout-actions left v-if="sortable">
|
||||||
@@ -201,6 +201,13 @@ export default {
|
|||||||
|
|
||||||
return shownCount > 0;
|
return shownCount > 0;
|
||||||
},
|
},
|
||||||
|
accountBalance(account) {
|
||||||
|
if (this.$settings.isShowAccountBalance()) {
|
||||||
|
return account.balance;
|
||||||
|
} else {
|
||||||
|
return '---';
|
||||||
|
}
|
||||||
|
},
|
||||||
setSortable() {
|
setSortable() {
|
||||||
this.showHidden = true;
|
this.showHidden = true;
|
||||||
this.sortable = true;
|
this.sortable = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user