mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-20 18:15:56 +08:00
fix: 解决字段中存在注解@ExcelDictFormat(readConverterExp = "0=未纳管,1=已纳管")时,导出的excel中的options下拉项为:0=未纳管,1=已纳管;而不是:未纳管,已纳管;的情况。
This commit is contained in:
parent
ded2a32fdf
commit
7494adeafc
@ -107,7 +107,11 @@ public class ExcelDownHandler implements SheetWriteHandler {
|
|||||||
options = new ArrayList<>(values);
|
options = new ArrayList<>(values);
|
||||||
} else if (StrUtil.isNotBlank(converterExp)) {
|
} else if (StrUtil.isNotBlank(converterExp)) {
|
||||||
// 如果指定了确切的值,则直接解析确切的值
|
// 如果指定了确切的值,则直接解析确切的值
|
||||||
options = StrUtil.split(converterExp, format.separator(), true, true);
|
List<String> rawOptions = StrUtil.split(converterExp, format.separator(), true, true);
|
||||||
|
for (String s : rawOptions) {
|
||||||
|
List<String> split = StrUtil.split(s, "=", true, true);
|
||||||
|
options.add(split.get(1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (field.isAnnotationPresent(ExcelEnumFormat.class)) {
|
} else if (field.isAnnotationPresent(ExcelEnumFormat.class)) {
|
||||||
// 否则如果指定了@ExcelEnumFormat,则使用枚举的逻辑
|
// 否则如果指定了@ExcelEnumFormat,则使用枚举的逻辑
|
||||||
|
|||||||
@ -362,7 +362,7 @@ public class ExcelUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (itemArray[1].equals(propertyValue)) {
|
if (propertyValue.contains(itemArray[1])) {
|
||||||
return itemArray[0];
|
return itemArray[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user