mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-16 16:07:33 +08:00
filter transaction description keywords in statistics & analysis page
This commit is contained in:
@@ -432,6 +432,10 @@ export default {
|
||||
queryParams.push(`tag_filter_type=${req.tagFilterType}`);
|
||||
}
|
||||
|
||||
if (req.keyword) {
|
||||
queryParams.push(`keyword=${encodeURIComponent(req.keyword)}`);
|
||||
}
|
||||
|
||||
return axios.get<ApiResponse<TransactionStatisticResponse>>(`v1/transactions/statistics.json?use_transaction_timezone=${req.useTransactionTimezone}` + (queryParams.length ? '&' + queryParams.join('&') : ''));
|
||||
},
|
||||
getTransactionStatisticsTrends: (req: TransactionStatisticTrendsRequest): ApiResponsePromise<TransactionStatisticTrendsResponseItem[]> => {
|
||||
@@ -453,6 +457,10 @@ export default {
|
||||
queryParams.push(`tag_filter_type=${req.tagFilterType}`);
|
||||
}
|
||||
|
||||
if (req.keyword) {
|
||||
queryParams.push(`keyword=${encodeURIComponent(req.keyword)}`);
|
||||
}
|
||||
|
||||
return axios.get<ApiResponse<TransactionStatisticTrendsResponseItem[]>>(`v1/transactions/statistics/trends.json?use_transaction_timezone=${req.useTransactionTimezone}` + (queryParams.length ? '&' + queryParams.join('&') : ''));
|
||||
},
|
||||
getTransactionAmounts: (params: TransactionAmountsRequestParams): ApiResponsePromise<TransactionAmountsResponse> => {
|
||||
|
||||
@@ -249,6 +249,37 @@ export function useI18nUIComponents() {
|
||||
});
|
||||
}
|
||||
|
||||
function showPrompt(message: string, currentValue?: string, confirmCallback?: (value: string, dialog: Dialog.Dialog, e: Event) => void, cancelCallback?: (value: string, dialog: Dialog.Dialog, e: Event) => void): void {
|
||||
f7ready((f7) => {
|
||||
f7.dialog.create({
|
||||
title: tt('global.app.title'),
|
||||
text: tt(message),
|
||||
content: `<div class="dialog-input-field input"><input type="text" class="dialog-input" value="${currentValue || ''}"></div>`,
|
||||
animate: isEnableAnimate(),
|
||||
buttons: [
|
||||
{
|
||||
text: tt('Cancel'),
|
||||
onClick: (dialog, event) => {
|
||||
if (cancelCallback) {
|
||||
const inputValue = dialog.$el.find('.dialog-input').val();
|
||||
cancelCallback(inputValue, dialog, event);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
text: tt('OK'),
|
||||
onClick: (dialog, event) => {
|
||||
if (confirmCallback) {
|
||||
const inputValue = dialog.$el.find('.dialog-input').val();
|
||||
confirmCallback(inputValue, dialog, event);
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}).open();
|
||||
});
|
||||
}
|
||||
|
||||
function showToast(message: string, timeout?: number): void {
|
||||
f7ready((f7) => {
|
||||
f7.toast.create({
|
||||
@@ -262,6 +293,7 @@ export function useI18nUIComponents() {
|
||||
return {
|
||||
showAlert: showAlert,
|
||||
showConfirm: showConfirm,
|
||||
showPrompt: showPrompt,
|
||||
showToast: showToast,
|
||||
routeBackOnError
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user