From c827675e14850dd918831ce3521f9cdefbf14bef Mon Sep 17 00:00:00 2001 From: MaysWind Date: Thu, 4 Jul 2024 23:48:41 +0800 Subject: [PATCH] code refactor --- src/router/desktop.js | 4 ++-- src/stores/transaction.js | 4 ++-- src/views/desktop/transactions/ListPage.vue | 16 ++++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/router/desktop.js b/src/router/desktop.js index 65d183ac..2127496e 100644 --- a/src/router/desktop.js +++ b/src/router/desktop.js @@ -98,8 +98,8 @@ const router = createRouter({ initMaxTime: route.query.maxTime, initMinTime: route.query.minTime, initType: route.query.type, - initCategoryId: route.query.categoryId, - initAccountId: route.query.accountId, + initCategoryIds: route.query.categoryIds, + initAccountIds: route.query.accountIds, initAmountFilter: route.query.amountFilter, initKeyword: route.query.keyword }) diff --git a/src/stores/transaction.js b/src/stores/transaction.js index 1f988c9e..64cd6da0 100644 --- a/src/stores/transaction.js +++ b/src/stores/transaction.js @@ -467,11 +467,11 @@ export const useTransactionsStore = defineStore('transactions', { } if (this.transactionsFilter.accountId && this.transactionsFilter.accountId !== '0') { - querys.push('accountId=' + this.transactionsFilter.accountId); + querys.push('accountIds=' + this.transactionsFilter.accountId); } if (this.transactionsFilter.categoryId && this.transactionsFilter.categoryId !== '0') { - querys.push('categoryId=' + this.transactionsFilter.categoryId); + querys.push('categoryIds=' + this.transactionsFilter.categoryId); } querys.push('dateType=' + this.transactionsFilter.dateType); diff --git a/src/views/desktop/transactions/ListPage.vue b/src/views/desktop/transactions/ListPage.vue index cbd468b0..d8a1db6c 100644 --- a/src/views/desktop/transactions/ListPage.vue +++ b/src/views/desktop/transactions/ListPage.vue @@ -455,8 +455,8 @@ export default { 'initMaxTime', 'initMinTime', 'initType', - 'initCategoryId', - 'initAccountId', + 'initCategoryIds', + 'initAccountIds', 'initAmountFilter', 'initKeyword' ], @@ -714,8 +714,8 @@ export default { minTime: this.initMinTime, maxTime: this.initMaxTime, type: this.initType, - categoryId: this.initCategoryId, - accountId: this.initAccountId, + categoryIds: this.initCategoryIds, + accountIds: this.initAccountIds, amountFilter: this.initAmountFilter, keyword: this.initKeyword }); @@ -743,8 +743,8 @@ export default { minTime: to.query.minTime, maxTime: to.query.maxTime, type: to.query.type, - categoryId: to.query.categoryId, - accountId: to.query.accountId, + categoryIds: to.query.categoryIds, + accountIds: to.query.accountIds, amountFilter: to.query.amountFilter, keyword: to.query.keyword }); @@ -769,8 +769,8 @@ export default { maxTime: dateRange ? dateRange.maxTime : undefined, minTime: dateRange ? dateRange.minTime : undefined, type: parseInt(query.type) > 0 ? parseInt(query.type) : undefined, - categoryId: query.categoryId, - accountId: query.accountId, + categoryId: query.categoryIds, + accountId: query.accountIds, amountFilter: query.amountFilter || '', keyword: query.keyword || '' });