Repo for the search and displace core module including the interface to select files and search and displace operations to run on them.
https://searchanddisplace.com
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.
42 lines
1.0 KiB
42 lines
1.0 KiB
import axios from 'axios';
|
|
import { Vue, Component, Prop } from 'vue-property-decorator';
|
|
|
|
@Component
|
|
export default class Home extends Vue {
|
|
|
|
@Prop({ default: [] })
|
|
public readonly searchers!: { [key: string]: string; }
|
|
|
|
public uiBlocked = false;
|
|
public uploading = false;
|
|
public fileUploaded: boolean = false;
|
|
public uploadResult = null;
|
|
|
|
/**
|
|
*
|
|
*/
|
|
public created()
|
|
{}
|
|
|
|
/**
|
|
* A method which uploads the files to the server for processing
|
|
*
|
|
* @param event The event containing the uploaded files information
|
|
*/
|
|
public uploadFile(event: any): void {
|
|
this.uploading = true;
|
|
this.fileUploaded = false;
|
|
|
|
|
|
this.$toast.add({severity:'success', summary: 'Success Message', detail:'Order submitted', life: 3000});
|
|
let file = event.files[0];
|
|
|
|
setTimeout(
|
|
async () => {
|
|
let response = await this.$api.uploadFile(file);
|
|
this.fileUploaded = true;
|
|
this.uploadResult = response;
|
|
}, 500
|
|
)
|
|
}
|
|
}
|