1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-04-05 19:41:51 +08:00

Merge 755609a419691a0e00dd8c3eab5c8a523f8d56ac into 6858a9ad67483025f6a9432a926beb9327037be3

This commit is contained in:
Shane 2024-11-28 00:29:17 +00:00 committed by GitHub
commit 704d3ab9af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -182,14 +182,16 @@ export function export_json_to_excel({
'wch': 10 'wch': 10
}; };
} }
/*再判断是否为中文*/ /*再判断是否存在中文*/
else if (val.toString().charCodeAt(0) > 255) { val = val.toString()
const chineseCharacters = val.match(/[\u4E00-\u9FA5]/g)
if (chineseCharacters) {
return { return {
'wch': val.toString().length * 2 'wch': chineseCharacters.length * 2 + (val.length - chineseCharacters.length)
}; };
} else { } else {
return { return {
'wch': val.toString().length 'wch': val.length
}; };
} }
})) }))