diff --git a/src/modules/directory/modules/users/modules/logs/components/opened-user-logs.vue b/src/modules/directory/modules/users/modules/logs/components/opened-user-logs.vue index fc63a1ce7..f51b660f8 100644 --- a/src/modules/directory/modules/users/modules/logs/components/opened-user-logs.vue +++ b/src/modules/directory/modules/users/modules/logs/components/opened-user-logs.vue @@ -100,6 +100,12 @@ export default { // const { dummy } = useDummy({ namespace: `${namespace}/${subNamespace}`, hiddenText: true }); // return { dummy }; // }, + + computed: { + getFilters() { + return this.$store.getters[`${namespace}/${subNamespace}/filters/GET_FILTERS`]; + }, + }, watch: { '$route.query': { async handler() { @@ -108,10 +114,30 @@ export default { }, }, created() { - this.initCSVExport(LogsAPI.getList, { + this.initCSVExport(this.getDataForCSVExport, { filename: `${this.itemInstance.name}-logs-at-${new Date().toLocaleString()}`, }); }, + methods: { + async getDataForCSVExport(params) { + const filters = this.getFilters; + const { items, next } = await LogsAPI.getList({ + ...filters, + ...params, + parentId: this.parentId, + }); + + const transformedItems = items.map((item) => ({ + ...item, + date: new Date(+item.date).toLocaleString(), + })); + + return { + items: transformedItems, + next, + }; + }, + }, }; diff --git a/src/modules/system/modules/changelogs/modules/logs/components/opened-changelog-logs.vue b/src/modules/system/modules/changelogs/modules/logs/components/opened-changelog-logs.vue index d49bc3201..0753e63c7 100644 --- a/src/modules/system/modules/changelogs/modules/logs/components/opened-changelog-logs.vue +++ b/src/modules/system/modules/changelogs/modules/logs/components/opened-changelog-logs.vue @@ -129,7 +129,7 @@ export default { }); }, methods: { - async getDataForCSVExport(...params) { + async getDataForCSVExport(params) { const filters = this.getFilters; const { items, next } = await LogsAPI.getList({ ...filters,