<template>
  <div class="dataImport-container">
    <div class="dataImport-seccion" >
      <div class="box-container" v-for="item in sjdrList">
        <div class="box-children">
          <img :src="item.img" alt="" @click="preImpInfo(item.name,item.type)">
          <div class="literal-description">
            <p @click="preImpManager(item.name,item.type)">导入{{item.name}}</p>
            <p>
              <span @click="importTemplate(item.name,item.type)">查看模板</span>
              <span @click="preImpManager(item.name,item.type)">历史记录</span>
            </p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  import {  importTemplate } from "@/api/dimp/dataImport";
export default {
  name: 'YunnanReportUiDataImport',

  data() {
    return {
      sjdrList:[

        {name:'专利有效数据', img:require('../assets/images/yxsj.png'),type:'dPatentEffectiveInfo'},
        {name:'专利授权数据', img:require('../assets/images/sqsj.png'),type:'dPatentAuthInfo'},
        {name:'专利PCT数据', img:require('../assets/images/pctsj.png'),type:'dPctApplyInfo'},
        {name:'云南省人口数据', img:require('../assets/images/rksj.png'),type:'dPopulationDataInfo'},
        {name:'云南省高价值数据', img:require('../assets/images/gjzsj.png'),type:'dHighValueInfo'},
        {name:'万户市场主体数', img:require('../assets/images/roots.png'),type:'dMarketsubDataInfo'},
      ]
    };
  },

  mounted() {

  },

  methods: {
    preImpInfo(title,type){

      let url=  '/dataImport2/'+type;
      console.log('preImpInfo,url:'+url);
      this.$tab.openPage(title+'', url);
    },
    preImpManager(title,type){
      let url=  '/dataImport2/'+type+'PreImp';
      console.log('preImpManager,url:'+url);
      this.$tab.openPage(title+'导入记录', url);
    },
    importTemplate(title,type){
      let url=  '/dimp/'+type+'PreImp/importTemplate';
      console.log('importTemplate,url:'+url+',type:'+type);
      this.download(url,{}, type+`_${new Date().getTime()}.xlsx`);
      // importTemplate(type).then(response => {
      //   this.download(response.msg);
      // });
    }
  },
};
</script>

<style lang="scss" scoped>
.dataImport-container {
  width: 100%;
  min-width: 1200px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 25vh 0;
.dataImport-seccion{
  display: flex;
  justify-content: space-evenly;
  padding: 10px;
  width: 100%;
  margin: 0 auto;
  .box-container {
    position: relative;
    width: 170px;
    height: 180px;
    background-color: #2a8eed;
    border-radius: 10px;
    cursor: pointer;
    .box-children {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%,-50%);
      width: 100%;
      text-align: center;
      padding: 0 20px;
      img {
        width: 55px;
        height: 55px;
      }
      .literal-description {
        margin-top: 5px;
        p {
          padding: 0;
          margin: 0;
          color: #fff;
          font-size: 14px;
          width: 140px;
        }
        &>p:nth-child(2) {
          padding: 10px 8px;
          font-size: 12px;
          display: flex;
          justify-content: space-between;
        }
      }
    }
  }
}
}

</style>
