| | |
| | | <a-button type="primary" @click="compress">压缩打包</a-button> |
| | | </div> |
| | | |
| | | <a-spin :spinning="loading" :delay="1000" tip="downloading" size="large"> |
| | | <a-spin :spinning="loading" :delay="1000" tip="加载中" size="large"> |
| | | <div class="media-panel-wrapper"> |
| | | <a-table class="media-table" :columns="columns" :data-source="mediaData.data" row-key="fingerprint" |
| | | rowKey="file_id" :row-selection="rowSelection" |
| | |
| | | |
| | | type Key = ColumnProps['key']; |
| | | |
| | | const { baseUrl: { mediaPanelPrefix } } = window.globalApiConfig |
| | | |
| | | const workspaceId = localStorage.getItem(ELocalStorageKey.WorkspaceId)! |
| | | const loading = ref(false) |
| | | const showVideo = ref(false) |
| | | const videoPlayerId = ref('videoPlayerId') |
| | | // 文件前缀 |
| | | const prefix = 'https://dev.jxpskj.com:8026/cloud-bucket' |
| | | // const prefix = 'https://dev.jxpskj.com:8026/cloud-bucket' |
| | | const prefix = mediaPanelPrefix || import.meta.env.VITE_MEDIAPANEL_API_URL |
| | | // 搜索栏配置项 |
| | | const searchPanelOptions = reactive({ |
| | | size: 'large', |
| | |
| | | } |
| | | |
| | | function viewFile (objectKey: string) { |
| | | console.log(objectKey) |
| | | const ext = objectKey.split('.')[1] |
| | | const fileType = getFileType(ext) |
| | | let url = '' |
| | |
| | | const promiseList = [] as any |
| | | selectedRow.list.forEach(e => { |
| | | const url = prefix + e.object_key |
| | | |
| | | const promise = getFile(url, e.file_name) |
| | | promiseList.push(promise) |
| | | }) |
| | |
| | | function downloadMedia (media: MediaFile) { |
| | | loading.value = true |
| | | const url = prefix + '/' + media.object_key |
| | | const data = new Blob([url]) |
| | | downloadFile(data, media.file_name) |
| | | loading.value = false |
| | | getFile(url, media.file_name).then(res => { |
| | | downloadFile(res.data, res.name) |
| | | loading.value = false |
| | | }) |
| | | |
| | | // downloadMediaFile(workspaceId, media.file_id).then(res => { |
| | | // if (!res) { |