const data = {
  exportToExcel(columnList = [], dataList = [], fileName = 'data') {
    const tHeader = []
    const filterVal = []
    for (const item of columnList) {
      const jtem = item.split('=')
      tHeader.push(jtem[0])
      filterVal.push(jtem[1])
    }
    require.ensure([], () => {
      const { export_json_to_excel } = require('@utils/excel/Export2Excel.js')
      console.log(filterVal)
      const data = this.formatJson(filterVal, dataList)
      export_json_to_excel(tHeader, data, fileName)
    })
  },
  formatJson(filterVal, jsonData) {
    return jsonData.map(v => filterVal.map(j => v[j]))
  }
}
export default data
