| | |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import {ref} from '@vue/reactivity' |
| | | import {TableState} from 'ant-design-vue/lib/table/interface' |
| | | import {onMounted, reactive} from 'vue' |
| | | import {IPage} from '../api/http/type' |
| | | import {ELocalStorageKey} from '../types/enums' |
| | | import {downloadFile} from '../utils/common' |
| | | import {downloadMediaFile, getMediaFiles, MediaQueryParam} from '/@/api/media' |
| | | import {DownloadOutlined} from '@ant-design/icons-vue' |
| | | import {message, Pagination} from 'ant-design-vue' |
| | | import {TaskStatus, TaskStatusMap} from '/@/types/task' |
| | | import { ref } from '@vue/reactivity' |
| | | import { TableState } from 'ant-design-vue/lib/table/interface' |
| | | import { onMounted, reactive } from 'vue' |
| | | import { IPage } from '../api/http/type' |
| | | import { ELocalStorageKey } from '../types/enums' |
| | | import { downloadFile } from '../utils/common' |
| | | import { downloadMediaFile, getMediaFiles, MediaQueryParam } from '/@/api/media' |
| | | import { DownloadOutlined } from '@ant-design/icons-vue' |
| | | import { message, Pagination } from 'ant-design-vue' |
| | | import { TaskStatus, TaskStatusMap } from '/@/types/task' |
| | | |
| | | const workspaceId = localStorage.getItem(ELocalStorageKey.WorkspaceId)! |
| | | const loading = ref(false) |
| | |
| | | }) |
| | | |
| | | const subFileTypeOptions = [ |
| | | {value: 0, label: '普通图片'}, |
| | | {value: 1, label: '全景图'}, |
| | | { value: 0, label: '普通图片' }, |
| | | { value: 1, label: '全景图' }, |
| | | ] |
| | | |
| | | const payloadOptions = [] |
| | |
| | | title: '文件名称', |
| | | dataIndex: 'file_name', |
| | | ellipsis: true, |
| | | slots: {customRender: 'name'} |
| | | slots: { customRender: 'name' } |
| | | }, |
| | | // { |
| | | // title: '文件路径', |
| | |
| | | }, |
| | | { |
| | | title: '操作', |
| | | slots: {customRender: 'action'} |
| | | slots: { customRender: 'action' } |
| | | } |
| | | ] |
| | | const body: IPage = { |
| | |
| | | getFiles() |
| | | }) |
| | | |
| | | function dateChange(value: any) { |
| | | function dateChange (value: any) { |
| | | searchQuery.startTime = value[0] |
| | | searchQuery.endTime = value[1] |
| | | getFiles() |
| | | } |
| | | |
| | | function subFileTypeChange(value: any) { |
| | | function subFileTypeChange (value: any) { |
| | | searchQuery.subFileType = value.join(',') |
| | | getFiles() |
| | | } |
| | | |
| | | function payloadChange(value: any) { |
| | | function payloadChange (value: any) { |
| | | searchQuery.payload = value.join(',') |
| | | getFiles() |
| | | } |
| | | |
| | | function inputChange(searchValue: string) { |
| | | function inputChange (searchValue: string) { |
| | | getFiles() |
| | | } |
| | | |
| | | function getFiles() { |
| | | function getFiles () { |
| | | getMediaFiles(workspaceId, body, searchQuery).then(res => { |
| | | mediaData.data = res.data.list |
| | | paginationProp.total = res.data.pagination.total |
| | |
| | | }) |
| | | } |
| | | |
| | | function refreshData(page: Pagination) { |
| | | function refreshData (page: Pagination) { |
| | | body.page = page?.current! |
| | | body.page_size = page?.pageSize! |
| | | getFiles() |
| | | } |
| | | |
| | | function downloadMedia(media: MediaFile) { |
| | | function downloadMedia (media: MediaFile) { |
| | | loading.value = true |
| | | downloadMediaFile(workspaceId, media.file_id).then(res => { |
| | | if (!res) { |