diff --git a/server/service/system/sys_export_template.go b/server/service/system/sys_export_template.go index 0879d06408..c27bf46697 100644 --- a/server/service/system/sys_export_template.go +++ b/server/service/system/sys_export_template.go @@ -223,9 +223,14 @@ func (sysExportTemplateService *SysExportTemplateService) ExportExcel(templateID var row []string for _, column := range columns { if len(template.JoinTemplate) > 0 { - columnArr := strings.Split(column, ".") - if len(columnArr) > 1 { - column = strings.Split(column, ".")[1] + columnAs := strings.Split(column, " as ") + if len(columnAs) > 1 { + column = strings.TrimSpace(strings.Split(column, " as ")[1]) + } else { + columnArr := strings.Split(column, ".") + if len(columnArr) > 1 { + column = strings.Split(column, ".")[1] + } } } row = append(row, fmt.Sprintf("%v", table[column])) diff --git a/web/src/view/systemTools/exportTemplate/exportTemplate.vue b/web/src/view/systemTools/exportTemplate/exportTemplate.vue index 7ce153b9ee..94d883e957 100644 --- a/web/src/view/systemTools/exportTemplate/exportTemplate.vue +++ b/web/src/view/systemTools/exportTemplate/exportTemplate.vue @@ -431,6 +431,7 @@ const templatePlaceholder = `模板信息格式:key标识数据库column列名 "table_column4":"第四列", } 如果增加了JOINS导出key应该列为 {table_name1.table_column1:"第一列",table_name2.table_column2:"第二列"} +如果有重复的列名导出格式应为 {table_name1.table_column1 as key:"第一列",table_name2.table_column2 as key2:"第二列"} JOINS模式下不支持导入 `