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.

41 lines
1.0 KiB

  1. import axios from 'axios';
  2. import { Vue, Component, Prop } from 'vue-property-decorator';
  3. @Component
  4. export default class Home extends Vue {
  5. @Prop({ default: [] })
  6. public readonly searchers!: { [key: string]: string; }
  7. public uiBlocked = false;
  8. public uploading = false;
  9. public fileUploaded: boolean = false;
  10. public uploadResult = null;
  11. /**
  12. *
  13. */
  14. public created()
  15. {}
  16. /**
  17. * A method which uploads the files to the server for processing
  18. *
  19. * @param event The event containing the uploaded files information
  20. */
  21. public uploadFile(event: any): void {
  22. this.uploading = true;
  23. this.fileUploaded = false;
  24. this.$toast.add({severity:'success', summary: 'Success Message', detail:'Order submitted', life: 3000});
  25. let file = event.files[0];
  26. setTimeout(
  27. async () => {
  28. let response = await this.$api.uploadFile(file);
  29. this.fileUploaded = true;
  30. this.uploadResult = response;
  31. }, 500
  32. )
  33. }
  34. }