husq
2023-09-29 9c9038b7b7967408d6d99babcd4e09a7936e6646
src/components/MediaPanel.vue
@@ -9,7 +9,8 @@
    </div>
    <div class="search-part">
      <a-select v-model:value="subFileTypeArr" allowClear @change="subFileTypeChange" :options="subFileTypeOptions"
            <a-select v-model:value="subFileTypeArr" allowClear @change="subFileTypeChange"
                      :options="subFileTypeOptions"
                :maxTagCount="searchPanelOptions.maxTagCount" mode="multiple"
                :size="searchPanelOptions.size" placeholder="所有类型" style="width: 300px">
      </a-select>
@@ -122,7 +123,7 @@
const showVideo = ref(false)
const videoPlayerId = ref('videoPlayerId')
// 文件前缀
const prefix = 'https://dev.jxpskj.com:9000/cloud-bucket'
const prefix = 'https://dev.jxpskj.com:8026/cloud-bucket'
// 搜索栏配置项
const searchPanelOptions = reactive({
  size: 'large',
@@ -370,6 +371,7 @@
    })
    Promise.all(promiseList).then(res => {
      console.log(res, '+++++++++++')
      res.forEach(e => {
        zip.file(e.name, e.data, { base64: true })
      })
@@ -393,10 +395,6 @@
      .then((response) => {
        const ext = url.split('.')[1]
        // 若文件名不以后缀结尾,则手动添加后缀
        if (!name.endsWith(ext)) {
          name = name + '.' + ext
        }
        resolve({
          name: name,
          data: response.data
@@ -444,17 +442,22 @@
function downloadMedia (media: MediaFile) {
  loading.value = true
  downloadMediaFile(workspaceId, media.file_id).then(res => {
    if (!res) {
      return
    }
    const data = new Blob([res])
  const url = prefix + '/' + media.object_key
  const data = new Blob([url])
    downloadFile(data, media.file_name)
    loading.value = false
  }).finally(() => {
  })
  // downloadMediaFile(workspaceId, media.file_id).then(res => {
  //     if (!res) {
  //         return
  //     }
  //
  //     const data = new Blob([url])
  //     downloadFile(data, media.file_name)
  //     loading.value = false
  // }).finally(() => {
  //     loading.value = false
  // })
}
</script>