uploaders.blade.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <!--- uploaders --->
  2. <div class="modal fade" id="modal-uploaders" aria-hidden="true" data-backdrop="static" style="z-index: 1050; overflow: auto;">
  3. <div class="modal-dialog m-auto pt-4" style="width: 620px;">
  4. <div class="modal-content">
  5. <div class="modal-header bg-danger-10 ">
  6. <h4 class="modal-title text-white" id="myModalLabel">업로더</h4>
  7. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fas fa-times"></i></button>
  8. </div>
  9. <div class="modal-body p-2" style="background-color: #f5f5f5;">
  10. <div class="mt-4 card">
  11. <div class="d-flex flex-column p-2">
  12. <label class="m-0">-중요코드(예:품목코드)중복시 에러</label>
  13. <label class="m-0">-타이틀 추가시 에러</label>
  14. <label class="m-0"></label>
  15. <label class="m-0">타이틀제거 Line수</label>
  16. <input type="number" id="rows-delete-num-txt" class="rounded w-100" value="1" min="0">
  17. </div>
  18. <div class="dropzone" id="fileDropzone">
  19. </div>
  20. </div>
  21. <div class="position-absolute" style="top: 3px; right: 10px;">
  22. <button type="button" class="font-weight-bold btn btn-danger btn-sm icon-copy3 complete-memo-btn"
  23. id="btn-upload-file">
  24. </button>
  25. </div>
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. @once
  31. <link href="{{ csset('/css/uploaders/dropzone.css') }}" rel="stylesheet" type="text/css">
  32. <script src="{{ csset('/js/plugins/uploaders/dropzone.js') }}"></script>
  33. <script>
  34. Dropzone.options.fileDropzone = {
  35. paramName: 'file',
  36. url: '/excel-import',
  37. headers: {
  38. 'x-csrf-token': $('meta[name="csrf-token"]').attr('content'),
  39. },
  40. acceptedFiles: ".csv,.xlsx,.xlsm,.xlsb,.xltx,.xltm,.xls,.xml,.xlt,.xlam,.xla,.xlw",
  41. init: function () {
  42. var submitButton = document.querySelector("#btn-upload-file");
  43. var myDropzone = this;
  44. submitButton.addEventListener("click", function () {
  45. myDropzone.processQueue();
  46. });
  47. },
  48. autoProcessQueue: false, // 자동업로드 여부 (true일 경우, 바로 업로드 되어지며, false일 경우, 서버에는 올라가지 않은 상태임 processQueue() 호출시 올라간다.)
  49. clickable: true, // 클릭가능여부
  50. thumbnailHeight: 90, // Upload icon size
  51. thumbnailWidth: 90, // Upload icon size
  52. // maxFiles: 1, // 업로드 파일수
  53. // maxFilesize: 100, // 최대업로드용량 : 100MB
  54. parallelUploads: 1, // 동시파일업로드 수(이걸 지정한 수 만큼 여러파일을 한번에 컨트롤러에 넘긴다.)
  55. addRemoveLinks: true, // 삭제버튼 표시 여부
  56. dictRemoveFile: '삭제', // 삭제버튼 표시 텍스트
  57. uploadMultiple: false, // 다중업로드 기능
  58. success: function(file, response)
  59. {
  60. if (isEmptyArr(response)) {
  61. iziToast.error({ title: 'Error', message: $('#no-data-found').text() });
  62. return;
  63. }
  64. $('#modal-uploaders').trigger('excel.upload', [response, $('#rows-delete-num-txt').val()]);
  65. iziToast.success({ title: 'Success', message: '** Please WAIT UNTIL tmp table created **' });
  66. },
  67. error: function(file, response)
  68. {
  69. iziToast.error({ title: 'Error', message: 'excel upload error' });
  70. return false;
  71. }
  72. };
  73. // $(document).on('shown.bs.modal','#modal-uploaders', function (e) {
  74. // })
  75. </script>
  76. @endonce