add more function in transaction edit page

This commit is contained in:
MaysWind
2020-12-18 01:05:51 +08:00
parent eef67bcb5c
commit 7dd4be3870
10 changed files with 433 additions and 321 deletions
+3
View File
@@ -213,6 +213,9 @@ export default {
id
});
},
getTransaction: ({ id }) => {
return axios.get('v1/transactions/get.json?id=' + id);
},
getAllTransactionCategories: ({ type, parentId }) => {
return axios.get('v1/transaction/categories/list.json?type=' + (type || '0') + '&parent_id=' + (parentId || parentId === 0 ? parentId : '-1'));
},
+5
View File
@@ -37,6 +37,10 @@ function formatDate(date, format) {
return moment(date).format(format);
}
function getUnixTime(date) {
return moment(date).unix();
}
function copyObjectTo(fromObject, toObject) {
if (!isObject(fromObject)) {
return toObject;
@@ -347,6 +351,7 @@ export default {
isNumber,
isBoolean,
formatDate,
getUnixTime,
copyObjectTo,
copyArrayTo,
appendThousandsSeparator,