@ -64,6 +64,14 @@
>
>
{ { $t ( 'Refresh' ) } }
{ { $t ( 'Refresh' ) } }
< / q - b t n >
< / q - b t n >
< q -btn
flat
size = "sm"
: loading = "$wait.is('loadConversations')"
@ click = "triggerDownloadCsv"
>
{ { $t ( 'Download CSV' ) } }
< / q - b t n >
< / template >
< / template >
< / q - t a b l e >
< / q - t a b l e >
< / div >
< / div >
@ -186,7 +194,9 @@ export default {
} ,
} ,
methods : {
methods : {
... mapWaitingActions ( 'conversations' , {
... mapWaitingActions ( 'conversations' , {
loadConversations : 'loadConversations'
loadConversations : 'loadConversations' ,
downloadCsv : 'loadConversations'
} ) ,
} ) ,
async refresh ( ) {
async refresh ( ) {
await this . fetchPaginatedConversations ( {
await this . fetchPaginatedConversations ( {
@ -224,6 +234,24 @@ export default {
this . fetchPaginatedConversations ( {
this . fetchPaginatedConversations ( {
pagination : this . pagination
pagination : this . pagination
} )
} )
} ,
triggerDownloadCsv ( ) {
const { page , rowsPerPage , sortBy , descending } = this . pagination
const { startTime , endTime , direction , type } = this . filter
this . downloadCsv ( {
page ,
rows : rowsPerPage ,
order _by : sortBy ,
direction ,
order _by _direction : descending ? 'desc' : 'asc' ,
... ( startTime !== null ? { from : startTime } : { } ) ,
... ( endTime !== null ? { to : endTime } : { } ) ,
... ( type !== null ? { type } : { } ) ,
tz : 'UTC'
} ) . catch ( ( error ) => {
showGlobalError ( error )
} )
}
}
}
}
}
}