Export tables in iview. How to configure exportCsv parameters if you want to export all the data?

now the data in the current page number is exported by default, and you want to export all

Jun.19,2021

you can use the code to request all the paged data to come back, and then call the interface for exporting the table.


has just made such a requirement. Request all the data individually, and then give an array, which is processed with iview's exportCsv, array. The table after $ref is the component name of the paging table, and the interface method derived by it is used, as shown in figure code


.

if there are 100 pieces of data in the background, the front-end page displays 10 pieces of data when loading

first of all, do you use the interface for paging
that is, you submit page numbers through the interface to render the table data. The page:1, backend returns an array of 10 in length and returns all items to you

.

if this is the case, then the function of exporting the table should be implemented at the back end, because you only have 10 pieces of data at the front end

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37eac-2c0eb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37eac-2c0eb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?