change download file name
This commit is contained in:
@ -43,6 +43,7 @@ function Index() {
|
||||
|
||||
const [startDate, setStartDate] = useState(null);
|
||||
const [validDates, setValidDates] = useState([]);
|
||||
const [downloadUrl, setDownloadUrl] = useState('');
|
||||
|
||||
useEffect(() => {
|
||||
async function fetchData() {
|
||||
@ -101,6 +102,7 @@ function Index() {
|
||||
else{
|
||||
url = baseUrl + "/generate" + report + "?construction_id=" +selectedcons+ "&construction_date="+getDateWithFormat(startDate);
|
||||
}
|
||||
setDownloadUrl(url)
|
||||
downloadReport(url);
|
||||
}
|
||||
else {
|
||||
@ -110,6 +112,7 @@ function Index() {
|
||||
else{
|
||||
url = baseUrl + "/generate" + report + "?construction_id=" +selectedcons;
|
||||
}
|
||||
setDownloadUrl(url)
|
||||
downloadReport(url);
|
||||
}
|
||||
}
|
||||
@ -263,7 +266,11 @@ function Index() {
|
||||
</CCardBody>
|
||||
<CCardFooter>
|
||||
{isDownload() === true ?
|
||||
<p>
|
||||
<CButton type="submit" size="sm" color="primary" onClick={doGetReport}><CIcon name="cil-scrubber" /> ダウンロード</CButton>
|
||||
<br/>
|
||||
<a href={downloadUrl}>Download</a>
|
||||
</p>
|
||||
:
|
||||
<CButton disabled type="submit" size="sm" color="primary" onClick={doGetReport}><CIcon name="cil-scrubber" /> ダウンロード</CButton>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user