index.js 934 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import Table from '../table'
  2. import VXETable from '../v-x-e-table'
  3. import ExportPanel from './src/export-panel'
  4. import ImportPanel from './src/import-panel'
  5. import mixin, { saveLocalFile as saveFile, readLocalFile as readFile, handlePrint } from './src/mixin'
  6. export { saveFile, readFile }
  7. export function print (options) {
  8. const opts = Object.assign({}, options, {
  9. type: 'html'
  10. })
  11. handlePrint(null, opts, opts.content)
  12. }
  13. export const Export = {
  14. ExportPanel,
  15. ImportPanel,
  16. install (Vue) {
  17. VXETable.reg('export')
  18. VXETable.saveFile = saveFile
  19. VXETable.readFile = readFile
  20. VXETable.print = print
  21. VXETable.setup({
  22. export: {
  23. types: {
  24. csv: 0,
  25. html: 0,
  26. xml: 0,
  27. txt: 0
  28. }
  29. }
  30. })
  31. Table.mixins.push(mixin)
  32. Vue.component(ExportPanel.name, ExportPanel)
  33. Vue.component(ImportPanel.name, ImportPanel)
  34. }
  35. }
  36. export default Export