go-admin icon indicating copy to clipboard operation
go-admin copied to clipboard

[BUG]连表查询结果无法正常导出

Open Zhwt opened this issue 4 years ago • 0 comments

bug 描述

  1. 当连表中存在多对多关联的连表且列表页是以 Label 标签形式显示时, 导出结果会连 Label 标签的 HTML tag 一起导出;
  2. 连表查询结果只能导出当前页内容, 如果选择导出全部会导致连表字段没有数据

复现步骤

  1. 按照教程建立一个有一对多关系和多对多关系的连表查询的表
info.AddField("Role Name", "role_name", db.Varchar).FieldJoin(types.Join{
    Table: "role",
    Field: "id",
    JoinField: "user_id",
})
info.AddField("Role Name", "role_name", db.Varchar)FieldJoin(types.Join{
	Table:     "role_users",
	JoinField: "user_id",
	Field:     "id",
}).
FieldJoin(types.Join{
	Table:     "roles",
	JoinField: "id",
	Field:     "role_id",
	BaseTable: "role_users",
})
  1. 插入几条数据
  2. 点击页面上的导出全部数据

期望结果

能够正常导出, 且使用了 Label 进行展示的字段 在导出的 Excel 中只含有 innerText 部分, 没有 HTML tag

复现代码

TBD.

版本信息:

  • GoAdmin 版本:v1.2.23
  • golang 版本:go version go1.17.3 windows/amd64
  • 浏览器环境:Firefox/95.0
  • 开发环境:windows 10

其他信息

Zhwt avatar Dec 24 '21 11:12 Zhwt