+
+
+
+
+ {{ element.name }}
+
+ {{ accountCurrency(element) }}
+
+
+
+
+ {{ $t('Drag and Drop to Change Order') }}
+
+
-
-
-
- {{ $t('All') }}
-
-
-
- {{ subAccount.name }}
-
-
+
+
+
+ {{ $t('All') }}
+
+
+
+ {{ subAccount.name }}
+
+
+
+
+
+
+
+
+ {{ accountComment(element) }}
+
+
+
+
+
+ {{ $t('Transaction List') }}
+
+
+ {{ $t('Edit') }}
+
+
+ {{ $t('Hide') }}
+
+
+ {{ $t('Show') }}
+
+
+ {{ $t('Delete') }}
+
+
+ {{ accountBalance(element) }}
+
+
+
-
-
-
-
- {{ accountComment(account) }}
-
-
-
-
-
- {{ $t('Edit') }}
-
-
- {{ $t('Hide') }}
-
-
- {{ $t('Show') }}
-
-
- {{ $t('Delete') }}
-
-
- {{ accountBalance(account) }}
-
-
-
+
@@ -221,6 +235,7 @@ import {
mdiPencilOutline,
mdiDeleteOutline,
mdiListBoxOutline,
+ mdiDrag,
mdiDotsVertical,
} from '@mdi/js';
@@ -231,6 +246,7 @@ export default {
activeTab: 'accountPage',
activeSubAccount: {},
loading: true,
+ displayOrderModified: false,
showHidden: false,
icons: {
eye: mdiEyeOutline,
@@ -241,6 +257,7 @@ export default {
hide: mdiEyeOffOutline,
remove: mdiDeleteOutline,
transactions: mdiListBoxOutline,
+ drag: mdiDrag,
more: mdiDotsVertical
}
};
@@ -277,6 +294,27 @@ export default {
activeAccountCategoryTotalBalance() {
return this.accountCategoryTotalBalance(this.activeAccountCategory);
},
+ activeAccountCategoryVisibleAccountCount() {
+ if (!this.categorizedAccounts[this.activeAccountCategory.id] || !this.categorizedAccounts[this.activeAccountCategory.id].accounts) {
+ return 0;
+ }
+
+ const accounts = this.categorizedAccounts[this.activeAccountCategory.id].accounts;
+
+ if (this.showHidden) {
+ return accounts.length;
+ }
+
+ let visibleCount = 0;
+
+ for (let i = 0; i < accounts.length; i++) {
+ if (!accounts[i].hidden) {
+ visibleCount++;
+ }
+ }
+
+ return visibleCount;
+ },
showAccountBalance: {
get: function () {
return this.settingsStore.appSettings.showAccountBalance;
@@ -299,6 +337,7 @@ export default {
force: force
}).then(() => {
self.loading = false;
+ self.displayOrderModified = false;
if (force) {
self.$refs.snackbar.showMessage('Account list has been updated');
@@ -306,6 +345,10 @@ export default {
}).catch(error => {
self.loading = false;
+ if (error && error.message === 'Account list is up to date') {
+ self.displayOrderModified = false;
+ }
+
if (!error.processed) {
self.$refs.snackbar.showError(error);
}
@@ -357,6 +400,50 @@ export default {
const totalBalance = this.accountsStore.getAccountCategoryTotalBalance(this.showAccountBalance, accountCategory);
return this.getDisplayCurrency(totalBalance, this.defaultCurrency);
},
+ onMove(event) {
+ if (!event || !event.moved) {
+ return;
+ }
+
+ const self = this;
+ const moveEvent = event.moved;
+
+ if (!moveEvent.element || !moveEvent.element.id) {
+ self.$refs.snackbar.showMessage('Unable to move account');
+ return;
+ }
+
+ self.accountsStore.changeAccountDisplayOrder({
+ accountId: moveEvent.element.id,
+ from: moveEvent.oldIndex,
+ to: moveEvent.newIndex,
+ onlyUpdateGlobalList: true
+ }).then(() => {
+ self.displayOrderModified = true;
+ }).catch(error => {
+ self.$refs.snackbar.showError(error);
+ });
+ },
+ saveSortResult() {
+ const self = this;
+
+ if (!self.displayOrderModified) {
+ return;
+ }
+
+ self.loading = true;
+
+ self.accountsStore.updateAccountDisplayOrders().then(() => {
+ self.loading = false;
+ self.displayOrderModified = false;
+ }).catch(error => {
+ self.loading = false;
+
+ if (!error.processed) {
+ self.$toast(error.message || error);
+ }
+ });
+ },
add() {
},
@@ -437,6 +524,10 @@ export default {
line-height: 1.5rem !important;
}
+.account-card .account-title .account-name {
+ color: rgba(var(--v-theme-on-background), var(--v-high-emphasis-opacity));
+}
+
.account-card .account-currency {
font-size: 0.8rem;
color: rgba(var(--v-theme-on-background), var(--v-medium-emphasis-opacity));
diff --git a/third-patry-dependencies.json b/third-patry-dependencies.json
index 71679b44..8f25f71a 100644
--- a/third-patry-dependencies.json
+++ b/third-patry-dependencies.json
@@ -224,6 +224,12 @@
"url": "https://github.com/brix/crypto-js",
"licenseUrl": "https://github.com/brix/crypto-js/blob/4.1.1/LICENSE"
},
+ {
+ "name": "vuedraggable",
+ "copyright": "Copyright (c) 2016-2019 David Desmaisons",
+ "url": "https://github.com/SortableJS/vue.draggable.next",
+ "licenseUrl": "https://github.com/SortableJS/vue.draggable.next/blob/fae4944e7227f8f0ca06e19be01b14b584cfa973/LICENSE"
+ },
{
"name": "cbor-js",
"copyright": "Copyright (c) 2014 Patrick Gansterer
",
diff --git a/vite.config.js b/vite.config.js
index c507665d..711f0e37 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -150,7 +150,7 @@ export default defineConfig(async () => {
return 'moment';
} else if (/[\\/]node_modules[\\/](dom7|framework7.*|skeleton-elements|swiper)[\\/]/i.test(id)) {
return 'vendor-mobile';
- } else if (/[\\/]node_modules[\\/](vuetify|vue-router|vue3-perfect-scrollbar|perfect-scrollbar|@mdi.*)[\\/]/i.test(id)) {
+ } else if (/[\\/]node_modules[\\/](vuetify|vue-router|vue3-perfect-scrollbar|perfect-scrollbar|vuedraggable|sortablejs|@mdi.*)[\\/]/i.test(id)) {
return 'vendor-desktop';
} else if (/[\\/]node_modules[\\/](echarts|zrender|tslib|resize-detector|vue-echarts)[\\/]/i.test(id)) {
return 'vendor-desktop';