<template>
  <div>
    <el-tabs type="border-card">
      <el-tab-pane label="CN转换PCT">
        <cn-2-pct-form :baseUrl="baseUrl" 
        :showDownloadSampleButton="showDownloadSampleButton"
        @on-downloadSampleClick="handleDownloadSampleClick" />
      </el-tab-pane>
      <el-tab-pane label="公式转换图片">
        <visio-form :baseUrl="baseUrl"/>
      </el-tab-pane>
      <el-tab-pane label="PCT槁转CN稿">
        <Pct2CnForm :baseUrl="baseUrl" 
        :showDownloadSampleButton="showDownloadSampleButton"
        @on-downloadSampleClick="handleDownloadSampleClick" />
      </el-tab-pane>
      <el-tab-pane label="word抓取图片">
        <grab-pic :baseUrl="wordUrl"/>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import '@src/styles/theme/index.css'
import Cn2CpcForm from './components/Cn2CpcForm'
import Cn2PctForm from './components/Cn2PctForm'
import VisioForm from './components/VisioForm'
import GrabPic from './components/WordGrabPic'
import Pct2CnForm from './components/Pct2CnForm'
export default {
  name: 'ConvertTool',
  data() {
    return {
      wordUrl: 'https://dev.essenptl.com/dev2/wade_ext'
    }
  },
  props:{
    baseUrl:{
      type: String,
      require: true,
      default: 'https://dev.essenptl.com/graphAPITest/'
    },
    showDownloadSampleButton:{
      type: Boolean,
      default: false
    }
  },
  components: {
    Cn2CpcForm,
    Cn2PctForm,
    VisioForm,
    Pct2CnForm,
    GrabPic
  },
  methods: {
    handleDownloadSampleClick(type){
      this.$emit('on-downloadSampleClick', type)
    }
  },
}
</script>
