mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 17:54:30 +08:00
support transaction tag filter type
This commit is contained in:
@@ -374,6 +374,7 @@ export const useTransactionsStore = defineStore('transactions', {
|
||||
categoryIds: '',
|
||||
accountIds: '',
|
||||
tagIds: '',
|
||||
tagFilterType: transactionConstants.defaultTransactionTagFilterType.type,
|
||||
amountFilter: '',
|
||||
keyword: ''
|
||||
},
|
||||
@@ -671,6 +672,7 @@ export const useTransactionsStore = defineStore('transactions', {
|
||||
this.transactionsFilter.categoryIds = '';
|
||||
this.transactionsFilter.accountIds = '';
|
||||
this.transactionsFilter.tagIds = '';
|
||||
this.transactionsFilter.tagFilterType = transactionConstants.defaultTransactionTagFilterType.type;
|
||||
this.transactionsFilter.amountFilter = '';
|
||||
this.transactionsFilter.keyword = '';
|
||||
this.transactions = [];
|
||||
@@ -725,6 +727,12 @@ export const useTransactionsStore = defineStore('transactions', {
|
||||
this.transactionsFilter.tagIds = '';
|
||||
}
|
||||
|
||||
if (filter && isNumber(filter.tagFilterType)) {
|
||||
this.transactionsFilter.tagFilterType = filter.tagFilterType;
|
||||
} else {
|
||||
this.transactionsFilter.tagFilterType = transactionConstants.defaultTransactionTagFilterType.type;
|
||||
}
|
||||
|
||||
if (filter && isString(filter.amountFilter)) {
|
||||
this.transactionsFilter.amountFilter = filter.amountFilter;
|
||||
} else {
|
||||
@@ -775,6 +783,11 @@ export const useTransactionsStore = defineStore('transactions', {
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (filter && isNumber(filter.tagFilterType) && this.transactionsFilter.tagFilterType !== filter.tagFilterType) {
|
||||
this.transactionsFilter.tagFilterType = filter.tagFilterType;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (filter && isString(filter.amountFilter) && this.transactionsFilter.amountFilter !== filter.amountFilter) {
|
||||
this.transactionsFilter.amountFilter = filter.amountFilter;
|
||||
changed = true;
|
||||
@@ -806,6 +819,10 @@ export const useTransactionsStore = defineStore('transactions', {
|
||||
querys.push('tagIds=' + this.transactionsFilter.tagIds);
|
||||
}
|
||||
|
||||
if (this.transactionsFilter.tagFilterType) {
|
||||
querys.push('tagFilterType=' + this.transactionsFilter.tagFilterType);
|
||||
}
|
||||
|
||||
querys.push('dateType=' + this.transactionsFilter.dateType);
|
||||
|
||||
if (this.transactionsFilter.dateType === datetimeConstants.allDateRanges.Custom.type) {
|
||||
@@ -846,6 +863,7 @@ export const useTransactionsStore = defineStore('transactions', {
|
||||
categoryIds: self.transactionsFilter.categoryIds,
|
||||
accountIds: self.transactionsFilter.accountIds,
|
||||
tagIds: self.transactionsFilter.tagIds,
|
||||
tagFilterType: self.transactionsFilter.tagFilterType,
|
||||
amountFilter: self.transactionsFilter.amountFilter,
|
||||
keyword: self.transactionsFilter.keyword
|
||||
}).then(response => {
|
||||
@@ -922,6 +940,7 @@ export const useTransactionsStore = defineStore('transactions', {
|
||||
categoryIds: self.transactionsFilter.categoryIds,
|
||||
accountIds: self.transactionsFilter.accountIds,
|
||||
tagIds: self.transactionsFilter.tagIds,
|
||||
tagFilterType: self.transactionsFilter.tagFilterType,
|
||||
amountFilter: self.transactionsFilter.amountFilter,
|
||||
keyword: self.transactionsFilter.keyword
|
||||
}).then(response => {
|
||||
|
||||
Reference in New Issue
Block a user