ExportPictureLibrary.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <div>
  3. <div class="flex-container">
  4. <div class=" flex-header">
  5. <Navbar
  6. title="导出图片库"
  7. is-go-back="true"
  8. />
  9. </div>
  10. <div class="panel panel-info">
  11. <div class="panel-heading">
  12. <h3 class="panel-title">下载图片库</h3>
  13. </div>
  14. <div class="panel-body">
  15. <a @click="download">下载</a>
  16. </div>
  17. </div>
  18. </div>
  19. <Loading v-if="loading" />
  20. </div>
  21. </template>
  22. <script>
  23. import Common from '../../common/Common.js';
  24. import { DownloadService } from 'pc-component-v3';
  25. import { Notify } from 'pc-component-v3';
  26. import dayjs from 'dayjs';
  27. export default {
  28. components: {
  29. },
  30. data: function () {
  31. return {
  32. uuid: '',
  33. loading: false,
  34. };
  35. },
  36. created: function () {
  37. this.uuid = this.$route.params.uuid;
  38. },
  39. methods: {
  40. /**
  41. * 下载图片库
  42. * @author XiongLiuJie 20210422
  43. */
  44. download: function () {
  45. var timeStr = dayjs().format('YYYYMMDD_hhmmss');
  46. let url = Common.getApiURL('AssetInstanceResource/plistDownLoad');
  47. var fileName = '导出图片库_'+ timeStr + '.zip';
  48. DownloadService.downloadFile(url, fileName);
  49. Notify.success('成功', fileName, true);
  50. },
  51. /**
  52. * 返回上一界面
  53. * @author XiongLiuJie 20210422
  54. */
  55. back: function () {
  56. history.back();
  57. },
  58. },
  59. };
  60. </script>
  61. <style scoped>
  62. .fixed-table {
  63. table-layout: fixed;
  64. width: 800px !important;
  65. min-width: 800px !important;
  66. }
  67. table.fixed-table tr {
  68. height: 40px;
  69. }
  70. table.fixed-table th,
  71. table.fixed-table td {
  72. overflow: hidden;
  73. white-space: nowrap;
  74. text-overflow: ellipsis;
  75. }
  76. .flex-container {
  77. display: flex;
  78. /* 垂直*/
  79. flex-direction: column;
  80. width: 100%;
  81. /*视口被均分为100单位的vh 占据整个窗口,扣掉顶部topNav的距离后,计算得到container的高度*/
  82. height: calc(100vh - 100px);
  83. }
  84. </style>