<template>
  <div class="ui--form-container">
    <sdl-fileuploader
      style="width:1532px"
      ref="uploader1"
      :fileList="fileList"
      @complete="rtnUploadList"
      downloadType="A"
      :maxTotalSize="uploadFileSize"
      :modifyFlag="true"
      useExtList="zip"
      multiFileNm="정test"
    ></sdl-fileuploader>
    <sdl-fileuploader
      style="width:1532px"
      ref="uploader2"
      :fileList="fileList2"
      @complete="rtnUploadList"
      downloadType="B"
      :maxTotalSize="1073741824"
      :modifyFlag="true"
      useExtList="zip"
      multiFileNm="정test"
    ></sdl-fileuploader>
    <div>
      <button type="button" @click="fileUpload">
        upload
      </button>
      <button type="button" @click="changeFileList">
        change fileList
      </button>
      <button type="button" @click="changeFileUpSize">
        change file Upload Size
      </button>
    </div>
  </div>
</template>
<script>
import SDLUtil from '@/utils/SDLUtil';

export default {
  data() {
    return {
      fileList2: [],
      fileList: [
        {
          firstRegDatetime: 1563412831556,
          firstRegrId: 'sdp-front',
          lastModDatetime: 1563412831556,
          lastModrId: 'sdp-front',
          fileId: 'AWwCqp1KAADw5f1I',
          fileName: '정sdl_html_20190708.zip',
          filePathName: 'C:\\NAS\\SDL\\upload',
          fileSize: 14154292,
          fileExtensionName: 'b518546c12f1482a87ce44772fd56057',
          fileMimeTypeName: 'application/x-zip-compressed',
          deleted: false,
          downloadType: 'A',
          orderIdx: 0,
        },
        {
          firstRegDatetime: 1563412831602,
          firstRegrId: 'sdp-front',
          lastModDatetime: 1563412831602,
          lastModrId: 'sdp-front',
          fileId: 'AWwCqp16AAHw5f1I',
          fileName: 'sdl_html_20190709.zip',
          filePathName: 'C:\\NAS\\SDL\\upload',
          fileSize: 16225098,
          fileExtensionName: '0d0d77d474a045c2bf26de34467793ad',
          fileMimeTypeName: 'application/x-zip-compressed',
          deleted: false,
          downloadType: 'A',
          orderIdx: 0,
        },
      ],
      // fileList: [],
      uploadFileSize: 1073741824,
    };
  },
  methods: {
    getFileList() {
      return this.fileList;
    },
    uploaderInit() {
      this.$refs.uploader1.init();
    },
    fileUpload() {
      this.$refs.uploader1.onUpload();
    },
    rtnUploadList(downloadType, fileList) {
      console.log('downloadType:', downloadType);
      console.log('rtnUploadList:', fileList);
      SDLUtil.alert('받은 업로드 리스트 다음작업 할것');
    },
    changeFileUpSize() {
      this.uploadFileSize = 1000;
    },
    changeFileList() {
      // this.fileList.push({
      //   firstRegDatetime: 1563412831556,
      //   firstRegrId: 'sdp-front',
      //   lastModDatetime: 1563412831556,
      //   lastModrId: 'sdp-front',
      //   fileId: 'AWwCqp1KAADw5f1I',
      //   fileName: '정sdl_html_20190708.zip',
      //   filePathName: 'C:\\NAS\\SDL\\upload',
      //   fileSize: 14154292,
      //   fileExtensionName: 'b518546c12f1482a87ce44772fd56057',
      //   fileMimeTypeName: 'application/x-zip-compressed',
      //   deleted: false,
      //   downloadType: 'A',
      //   orderIdx: 0,
      // });

      this.fileList = [
        {
          firstRegDatetime: 1563412831556,
          firstRegrId: 'sdp-front',
          lastModDatetime: 1563412831556,
          lastModrId: 'sdp-front',
          fileId: 'AWwCqp1KAADw5f1I',
          fileName: '정sdl_html_20190708.zip',
          filePathName: 'C:\\NAS\\SDL\\upload',
          fileSize: 14154292,
          fileExtensionName: 'b518546c12f1482a87ce44772fd56057',
          fileMimeTypeName: 'application/x-zip-compressed',
          deleted: false,
          downloadType: 'A',
          orderIdx: 0,
        },
      ];

      // this.$refs.uploader1.init();
    },
  },
  computed: {},
};
</script>
<style scoped></style>
