| | |
| | | <template> |
| | | <!-- <div class="header">媒体文件</div>--> |
| | | <!--搜索栏--> |
| | | <div class="search-panel-wrapper"> |
| | | <div class="search-part"> |
| | | <a-range-picker :size="searchPanelOptions.size" :format="searchPanelOptions.dateFormat" |
| | | :valueFormat="searchPanelOptions.valueFormat" v-model:value="timeRangeArr.data" |
| | | @change="dateChange" style="width: 300px"/> |
| | | <!-- <div class="header">媒体文件</div>--> |
| | | <!--搜索栏--> |
| | | <div class="search-panel-wrapper"> |
| | | <div class="search-part"> |
| | | <a-range-picker :size="searchPanelOptions.size" :format="searchPanelOptions.dateFormat" |
| | | :valueFormat="searchPanelOptions.valueFormat" v-model:value="timeRangeArr.data" |
| | | @change="dateChange" style="width: 300px"/> |
| | | </div> |
| | | |
| | | <div class="search-part"> |
| | | <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> |
| | | </div> |
| | | |
| | | <div class="search-part"> |
| | | <a-select v-model:value="payloadArr" allowClear @change="payloadChange" :options="payloadOptions" |
| | | :maxTagCount="searchPanelOptions.maxTagCount" mode="multiple" |
| | | :size="searchPanelOptions.size" placeholder="所有负载" style="width: 300px"> |
| | | </a-select> |
| | | </div> |
| | | |
| | | <div class="search-part"> |
| | | <a-input-search :size="searchPanelOptions.size" v-model:value="searchQuery.name" @change="inputChange" |
| | | placeholder="按文件名称搜索" style="width: 300px"/> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <div class="search-part"> |
| | | <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> |
| | | <div class="button-wrapper"> |
| | | <a-button type="primary" @click="compress">压缩打包</a-button> |
| | | </div> |
| | | |
| | | <div class="search-part"> |
| | | <a-select v-model:value="payloadArr" allowClear @change="payloadChange" :options="payloadOptions" |
| | | :maxTagCount="searchPanelOptions.maxTagCount" mode="multiple" |
| | | :size="searchPanelOptions.size" placeholder="所有负载" style="width: 300px"> |
| | | </a-select> |
| | | <a-spin :spinning="loading" :delay="1000" tip="downloading" 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" |
| | | :pagination="paginationProp" :scroll="{ x: '100%', y: 600 }" @change="refreshData"> |
| | | <template v-for="col in ['name']" #[col]="{text, record}" :key="col"> |
| | | |
| | | <div> |
| | | <a-input |
| | | v-if="editableData[record.file_id]" |
| | | v-model:value="editableData[record.file_id]['file_name']" |
| | | style="margin: -5px 0" |
| | | /> |
| | | <template v-else> |
| | | <a-tooltip :title="text"> |
| | | <a @click="viewFile(record.object_key)">{{ text }}</a> |
| | | </a-tooltip> |
| | | </template> |
| | | </div> |
| | | |
| | | </template> |
| | | <template #original="{ text }"> |
| | | {{ text }} |
| | | </template> |
| | | <template #action="{ record }"> |
| | | |
| | | <div class="editable-row-operations"> |
| | | <!-- 编辑态操作 --> |
| | | <div v-if="editableData[record.file_id]"> |
| | | <a-tooltip title="保存"> |
| | | <span @click="save(record)" style="color: #28d445;"><CheckOutlined/></span> |
| | | </a-tooltip> |
| | | <a-tooltip title="取消"> |
| | | <span @click="() => delete editableData[record.file_id]" style="color: #e70102;"><CloseOutlined/></span> |
| | | </a-tooltip> |
| | | </div> |
| | | <!-- 非编辑态操作 --> |
| | | <div v-else class="flex-align-center flex-row" style="color: #2d8cf0"> |
| | | <a-tooltip title="下载"> |
| | | <a class="fz18" @click="downloadMedia(record)"> |
| | | <DownloadOutlined/> |
| | | </a> |
| | | </a-tooltip> |
| | | |
| | | <a-tooltip title="编辑"> |
| | | <a class="fz18" @click="edit(record)"> |
| | | <EditOutlined/> |
| | | </a> |
| | | </a-tooltip> |
| | | </div> |
| | | </div> |
| | | |
| | | </template> |
| | | </a-table> |
| | | </div> |
| | | </a-spin> |
| | | |
| | | <div @click.self="showVideo = false" v-if="showVideo" class="modal"> |
| | | <video class="video-js" :id="videoPlayerId"></video> |
| | | </div> |
| | | |
| | | <div class="search-part"> |
| | | <a-input-search :size="searchPanelOptions.size" v-model:value="searchQuery.name" @change="inputChange" |
| | | placeholder="按文件名称搜索" style="width: 300px"/> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <div class="button-wrapper"> |
| | | <a-button type="primary" @click="compress">压缩打包</a-button> |
| | | </div> |
| | | |
| | | <a-spin :spinning="loading" :delay="1000" tip="downloading" 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" |
| | | :pagination="paginationProp" :scroll="{ x: '100%', y: 600 }" @change="refreshData"> |
| | | <template v-for="col in ['name']" #[col]="{text, record}" :key="col"> |
| | | |
| | | <div> |
| | | <a-input |
| | | v-if="editableData[record.file_id]" |
| | | v-model:value="editableData[record.file_id]['file_name']" |
| | | style="margin: -5px 0" |
| | | /> |
| | | <template v-else> |
| | | <a-tooltip :title="text"> |
| | | <a @click="viewFile(record.object_key)">{{ text }}</a> |
| | | </a-tooltip> |
| | | </template> |
| | | </div> |
| | | |
| | | </template> |
| | | <template #original="{ text }"> |
| | | {{ text }} |
| | | </template> |
| | | <template #action="{ record }"> |
| | | |
| | | <div class="editable-row-operations"> |
| | | <!-- 编辑态操作 --> |
| | | <div v-if="editableData[record.file_id]"> |
| | | <a-tooltip title="保存"> |
| | | <span @click="save(record)" style="color: #28d445;"><CheckOutlined/></span> |
| | | </a-tooltip> |
| | | <a-tooltip title="取消"> |
| | | <span @click="() => delete editableData[record.file_id]" style="color: #e70102;"><CloseOutlined/></span> |
| | | </a-tooltip> |
| | | </div> |
| | | <!-- 非编辑态操作 --> |
| | | <div v-else class="flex-align-center flex-row" style="color: #2d8cf0"> |
| | | <a-tooltip title="下载"> |
| | | <a class="fz18" @click="downloadMedia(record)"> |
| | | <DownloadOutlined/> |
| | | </a> |
| | | </a-tooltip> |
| | | |
| | | <a-tooltip title="编辑"> |
| | | <a class="fz18" @click="edit(record)"> |
| | | <EditOutlined/> |
| | | </a> |
| | | </a-tooltip> |
| | | </div> |
| | | </div> |
| | | |
| | | </template> |
| | | </a-table> |
| | | </div> |
| | | </a-spin> |
| | | |
| | | <div @click.self="showVideo = false" v-if="showVideo" class="modal"> |
| | | <video class="video-js" :id="videoPlayerId"></video> |
| | | </div> |
| | | |
| | | </template> |
| | | |
| | |
| | | }) |
| | | |
| | | interface MediaFile { |
| | | fingerprint: string, |
| | | drone: string, |
| | | payload: string, |
| | | is_original: string, |
| | | file_name: string, |
| | | file_path: string, |
| | | create_time: string, |
| | | file_id: string, |
| | | object_key: string |
| | | fingerprint: string, |
| | | drone: string, |
| | | payload: string, |
| | | is_original: string, |
| | | file_name: string, |
| | | file_path: string, |
| | | create_time: string, |
| | | file_id: string, |
| | | object_key: string |
| | | } |
| | | |
| | | const subFileTypeOptions = [ |
| | |
| | | |
| | | function downloadMedia (media: MediaFile) { |
| | | loading.value = true |
| | | downloadMediaFile(workspaceId, media.file_id).then(res => { |
| | | if (!res) { |
| | | return |
| | | } |
| | | const url = prefix + '/' + media.object_key |
| | | const data = new Blob([url]) |
| | | downloadFile(data, media.file_name) |
| | | loading.value = false |
| | | |
| | | const data = new Blob([res]) |
| | | 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> |
| | | |
| | | <style lang="scss" scoped> |
| | | .media-panel-wrapper { |
| | | width: 100%; |
| | | padding: 16px; |
| | | width: 100%; |
| | | padding: 16px; |
| | | |
| | | .media-table { |
| | | background: #fff; |
| | | margin-top: 10px; |
| | | } |
| | | .media-table { |
| | | background: #fff; |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | .action-area { |
| | | color: $primary; |
| | | cursor: pointer; |
| | | } |
| | | .action-area { |
| | | color: $primary; |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | |
| | | .header { |
| | | width: 100%; |
| | | height: 60px; |
| | | background: #fff; |
| | | padding: 16px; |
| | | font-size: 20px; |
| | | font-weight: bold; |
| | | text-align: start; |
| | | color: #000; |
| | | width: 100%; |
| | | height: 60px; |
| | | background: #fff; |
| | | padding: 16px; |
| | | font-size: 20px; |
| | | font-weight: bold; |
| | | text-align: start; |
| | | color: #000; |
| | | } |
| | | |
| | | .search-panel-wrapper { |
| | | height: 85px; |
| | | background: #ffffff; |
| | | padding: 0 20px; |
| | | display: flex; |
| | | align-items: center; |
| | | height: 85px; |
| | | background: #ffffff; |
| | | padding: 0 20px; |
| | | display: flex; |
| | | align-items: center; |
| | | |
| | | .search-part { |
| | | margin-right: 10px; |
| | | } |
| | | .search-part { |
| | | margin-right: 10px; |
| | | } |
| | | |
| | | } |
| | | |
| | | .button-wrapper { |
| | | background: #ffffff; |
| | | padding-left: 20px; |
| | | background: #ffffff; |
| | | padding-left: 20px; |
| | | } |
| | | |
| | | .editable-row-operations { |
| | | div > span { |
| | | margin-right: 10px; |
| | | } |
| | | div > span { |
| | | margin-right: 10px; |
| | | } |
| | | } |
| | | |
| | | .modal { |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | bottom: 0; |
| | | right: 0; |
| | | background-color: rgba(0, 0, 0, 0.5); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | bottom: 0; |
| | | right: 0; |
| | | background-color: rgba(0, 0, 0, 0.5); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | |
| | | #videoPlayerId { |
| | | width: 70%; |
| | | height: 80%; |
| | | } |
| | | #videoPlayerId { |
| | | width: 70%; |
| | | height: 80%; |
| | | } |
| | | } |
| | | </style> |