点这里进入ABP进阶教程目录 

功能按钮 - 导出CSV,中文信息导出为乱码。

ABP进阶教程9 - CSV导出中文乱码 

解决方案

打开展示层(即JD.CRS.Web.Mvc)的\wwwroot\view-resources\Views\Course\Index.js //用以存放Course查询相关脚本

找到DataTable/buttons参数设置

添加一行代码即可
bom: true

//Button
buttons:
[
    {// 自定义按钮-Add
        extend: 'alert',
        text: '+'
        //text: '<i class="material-icons">add</i>'
    },
    { //复制到剪贴板
        extend: 'copy',
        text: 'Copy'
    },
    { //导出CSV
        extend: 'csv',
        text: 'CSV',
        bom: true
    },
    { //导出Excel
        extend: 'excel',
        text: 'Excel'
    },
    { //导出PDF
        extend: 'pdf',
        text: 'PDF'
    },
    { //打印
        extend: 'print',
        text: 'Print'
        //text: '<i class="material-icons">print</i>'
    }
],

预览效果

ABP进阶教程9 - CSV导出中文乱码

 

相关文章:

  • 2021-07-25
  • 2021-11-22
  • 2021-09-19
  • 2022-12-23
  • 2021-12-23
  • 2022-01-30
猜你喜欢
  • 2021-12-06
  • 2022-12-23
  • 2021-06-03
  • 2022-12-23
  • 2022-12-23
  • 2022-02-28
  • 2021-06-04
相关资源
相似解决方案