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:
commit
704d3ab9af
10
src/vendor/Export2Excel.js
vendored
10
src/vendor/Export2Excel.js
vendored
@ -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
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user