Fix download filename
This commit is contained in:
parent
2806af6403
commit
cc7891b178
@ -133,7 +133,7 @@ const columns: TableColumnsType<DataType> = [
|
|||||||
key: 'snImeiAAR',
|
key: 'snImeiAAR',
|
||||||
width: '130px',
|
width: '130px',
|
||||||
render: (_, record) => {
|
render: (_, record) => {
|
||||||
const isAbnormal = record.snImeiAAR * 100 < 98;
|
const isAbnormal = record.snImeiAAR * 100 < 95;
|
||||||
return (
|
return (
|
||||||
<span style={{ color: isAbnormal ? 'red' : '' }}>
|
<span style={{ color: isAbnormal ? 'red' : '' }}>
|
||||||
{(record.snImeiAAR * 100)?.toFixed(2)}
|
{(record.snImeiAAR * 100)?.toFixed(2)}
|
||||||
|
@ -94,8 +94,10 @@ export async function downloadReport(report_id: string) {
|
|||||||
let filename = "report.xlsx";
|
let filename = "report.xlsx";
|
||||||
try {
|
try {
|
||||||
let basename = response.headers['content-disposition'].split('filename=')[1].split('.')[0];
|
let basename = response.headers['content-disposition'].split('filename=')[1].split('.')[0];
|
||||||
let extension = response.headers['content-disposition'].split('.')[1].split(';')[0];
|
if (basename[0] == '_') {
|
||||||
filename = `${basename}.${extension}`
|
basename = basename.substring(1);
|
||||||
|
}
|
||||||
|
filename = `${basename}.xlsx`
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
@ -123,8 +125,10 @@ export async function downloadDashboardReport(duration='30d', subsidiary='ALL')
|
|||||||
let filename = "report.xlsx";
|
let filename = "report.xlsx";
|
||||||
try {
|
try {
|
||||||
let basename = response.headers['content-disposition'].split('filename=')[1].split('.')[0];
|
let basename = response.headers['content-disposition'].split('filename=')[1].split('.')[0];
|
||||||
let extension = response.headers['content-disposition'].split('.')[1].split(';')[0];
|
if (basename[0] == '_') {
|
||||||
filename = `${basename}.${extension}`
|
basename = basename.substring(1);
|
||||||
|
}
|
||||||
|
filename = `${basename}.xlsx`
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user