You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.7 KiB
48 lines
1.7 KiB
const sanlien = () => {
|
|
return {
|
|
init() {
|
|
this.search()
|
|
}, data: {
|
|
create_at_start: '',
|
|
create_at_end: '',
|
|
},
|
|
table_details: [],
|
|
searchLoading: false,
|
|
downloadLoading: false,
|
|
search() {
|
|
this.isLoading = true
|
|
const form = new FormData();
|
|
form.append('create_at_start', this.data.create_at_start);
|
|
form.append('create_at_end', this.data.create_at_end);
|
|
axios.post('./api/getSanlien.php', form).then(res => {
|
|
this.table_details = res.data
|
|
this.isLoading = false
|
|
}).catch(error => {
|
|
console.log(error.response.data)
|
|
this.isLoading = false
|
|
})
|
|
}, datatable() {
|
|
|
|
|
|
}, download() {
|
|
this.downloadLoading = true
|
|
const form = new FormData();
|
|
form.append('create_at_start', this.data.create_at_start);
|
|
form.append('create_at_end', this.data.create_at_end);
|
|
axios.post('./api/downloadExcel.php', form).then(res => {
|
|
var link = document.createElement('a');
|
|
link.setAttribute('href', window.location.origin + "/wms/excel/sanlien.xlsx");
|
|
link.setAttribute('download', '三連地震數據.xlsx');
|
|
link.style.display = 'none';
|
|
document.body.appendChild(link);
|
|
link.click();
|
|
document.body.removeChild(link);
|
|
this.downloadLoading = false
|
|
}).catch(error => {
|
|
console.log(error.response.data)
|
|
this.downloadLoading = false
|
|
})
|
|
}
|
|
}
|
|
}
|
|
|
|
|