| 12345678910111213141516171819202122232425262728293031323334353637 |
- <template>
- <div>
- <el-button type="success" size="small" icon="el-icon-download" @click="submit()">导 出</el-button>
- </div>
- </template>
- <script>
- export default {
- props:['tablecols','param','excelTitle'],
- data () {
- return {}
- },
- methods:{
- async submit () {
- this.param.content.isAll = true
- const res = await this.$api.requested(this.param)
- let table = JSON.parse(JSON.stringify(this.tablecols))
- table.forEach((e,index) => {
- if (e.title === '省市县') {
- table[index].title = '省'
- table.splice(index + 1,0,{title:'市',columnname:'city'},{title:'县',columnname:'county'})
- }
- });
- let hd = table.map(e=>{
- return e.title
- })
- let ft = table.map(e=>{
- return e.columnname
- })
- this.tool.exportExcel(hd,ft,res.data,this.excelTitle)
- }
- }
- }
- </script>
- <style>
- </style>
|