엑셀 다운로드시 Entity코드 변환되어 노출될 수 있도록 수정

This commit is contained in:
정훈 김
2022-11-07 09:24:22 +09:00
parent e2fd670cfc
commit 66c1c26840
7 changed files with 82 additions and 0 deletions

View File

@@ -328,6 +328,13 @@ export default {
response = await custMgtApi.subsListExcel(params);
const result = response.data;
// entity code 변환
result.data.list = result.data.list.map((item) => {
return {
...item,
custNm: this.fromHtmlEntities(item.custNm)
}
});
if (result != null && result.retCode == "0000") {
return result.data;
} else {
@@ -349,6 +356,13 @@ export default {
const saveFileName = `청약고객정보_${today}.xls`;
const data = await this.getExcelDataDown();
if (!data) {
this.row.title = '청약고객관리';
this.row.msg1 = '엑셀 다운로드가 실패해습니다.';
this.$refs.commmonModal.alertModalOpen(this.row);
return false;
}
let options = {
header: this.excelHeader,
dataOrder: 'header'
@@ -410,6 +424,11 @@ export default {
let initStartDate = new Date(setYear, 0, 1);
this.startDate = initStartDate;
},
fromHtmlEntities(str) {
return (str + '').replace(/&#\d+;/gm, function (s) {
return String.fromCharCode(s.match(/\d+/gm)[0]);
});
},
},
};
</script>