<template>
  <div>
    <div class="flex-container">
      <div class=" flex-header">
        <Navbar
          title="导出图片库"
          is-go-back="true"
        />
      </div>
      <div class="panel panel-info">
        <div class="panel-heading">
          <h3 class="panel-title">下载图片库</h3>
        </div>
        <div class="panel-body">
          <a @click="download">下载</a>
        </div>
      </div>
    </div>
    <Loading v-if="loading" />
  </div>
</template>

<script>
import Common from '../../common/Common.js';
import { DownloadService } from 'pc-component-v3';
import { Notify } from 'pc-component-v3';
import dayjs from 'dayjs';



export default {
  components: {
    
  },
  data: function () {
    return {
      uuid: '',
      loading: false,
           
    };
  },

  created: function () {
    this.uuid = this.$route.params.uuid;
  },
  methods: {
    /**
         * 下载图片库
         * @author XiongLiuJie 20210422
         */
    download: function () {
      var timeStr = dayjs().format('YYYYMMDD_hhmmss');
      let url = Common.getApiURL('AssetInstanceResource/plistDownLoad');
          
      var fileName = '导出图片库_'+ timeStr + '.zip';
      DownloadService.downloadFile(url, fileName);
      Notify.success('成功', fileName, true);
    },
    /**
         * 返回上一界面
         * @author XiongLiuJie 20210422
         */
    back: function () {
      history.back();
    },

        
  },
   
};
</script>

<style scoped>
.fixed-table {
    table-layout: fixed;
    width: 800px !important;
    min-width: 800px !important;
}

table.fixed-table tr {
    height: 40px;
}

table.fixed-table th,
table.fixed-table td {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.flex-container {
    display: flex;
    /* 垂直*/
    flex-direction: column;
    width: 100%;
    /*视口被均分为100单位的vh 占据整个窗口，扣掉顶部topNav的距离后，计算得到container的高度*/
    height: calc(100vh - 100px);
}
</style>