|
|
@@ -1,9 +1,8 @@
|
|
|
<template>
|
|
|
<a-spin :spinning="state.downloadLoading" tip="下载中...">
|
|
|
<div class="mediaDetail">
|
|
|
- <Search :mode="state.mode" :fetchList="fetchList" :selectedRowKeys="state.selectedRowKeys"
|
|
|
- :onClickDownload="onClickBatchDownload" :onClickDelete="onClickBatchDelete" :onClickSearch="onClickSearch"
|
|
|
- :onClickReset="onClickReset" />
|
|
|
+ <Search :fetchList="fetchList" :selectedRowKeys="state.selectedRowKeys" :onClickDownload="onClickBatchDownload"
|
|
|
+ :onClickDelete="onClickBatchDelete" :onClickSearch="onClickSearch" :onClickReset="onClickReset" />
|
|
|
<div style="background: #FFFFFF;padding: 20px;">
|
|
|
<div class="mediaDetail-info">
|
|
|
<div class="mediaDetail-info-left">
|
|
|
@@ -26,107 +25,75 @@
|
|
|
{{ state.selectedRowKeys.length }}/{{ paginationConfig.total }}
|
|
|
</div>
|
|
|
</div>
|
|
|
- <a-button style="padding:0 5px;" :type="state.mode === 'table' ? 'primary' : 'default'"
|
|
|
- :ghost="state.mode === 'table'" size="small" @click="state.mode = 'table'">
|
|
|
- <MenuOutlined />
|
|
|
- </a-button>
|
|
|
- <a-button style="padding:0 5px;" :type="state.mode === 'list' ? 'primary' : 'default'"
|
|
|
- :ghost="state.mode === 'list'" size="small" @click="state.mode = 'list'">
|
|
|
- <AppstoreOutlined />
|
|
|
- </a-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="mediaDetail-table" v-if="state.mode === 'table'">
|
|
|
- <a-table :scroll="{ x: '100%', y: 500 }" :childrenColumnName="null" rowKey="file_id"
|
|
|
- :loading="state.listLoading" :columns="columns" :dataSource="state.list" :rowClassName="rowClassName"
|
|
|
- :pagination="paginationConfig"
|
|
|
- :rowSelection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }">
|
|
|
- <!-- 文件夹名称 -->
|
|
|
- <template #file_name="{ record }">
|
|
|
- <a-tooltip :title="record.file_name">
|
|
|
- <div class="fileName">
|
|
|
- <div class="fileName-cover" @click="onClickLookFile(record)">
|
|
|
- <img class="fileName-cover-img" :src="record.thumbnail_url" />
|
|
|
- <img class="fileName-cover-icon" :src="panoramaSrc" v-if="record.media_type === 3" />
|
|
|
- <img class="fileName-cover-icon" :src="videoSrc" v-else-if="record.media_type === 4" />
|
|
|
- </div>
|
|
|
- <div style="margin-left: 5px;">
|
|
|
- <a-input v-model:value="record.file_name" v-if="state.editableData[record.file_id]" />
|
|
|
- <div @click="onClickLookFile(record)" v-else>
|
|
|
- {{ record.file_name }}
|
|
|
- </div>
|
|
|
+ <a-table :scroll="{ x: '100%', y: 500 }" :childrenColumnName="null" rowKey="file_id"
|
|
|
+ :loading="state.listLoading" :columns="columns" :dataSource="state.list" :rowClassName="rowClassName"
|
|
|
+ :pagination="paginationConfig"
|
|
|
+ :rowSelection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }">
|
|
|
+ <!-- 文件夹名称 -->
|
|
|
+ <template #file_name="{ record }">
|
|
|
+ <a-tooltip :title="record.file_name">
|
|
|
+ <div class="fileName">
|
|
|
+ <div class="fileName-cover" @click="onClickLookFile(record)">
|
|
|
+ <img class="fileName-cover-img" :src="record.thumbnail_url" />
|
|
|
+ <img class="fileName-cover-icon" :src="panoramaSrc" v-if="record.media_type === 3" />
|
|
|
+ <img class="fileName-cover-icon" :src="videoSrc" v-else-if="record.media_type === 4" />
|
|
|
+ </div>
|
|
|
+ <div style="margin-left: 5px;">
|
|
|
+ <a-input v-model:value="record.file_name" v-if="state.editableData[record.file_id]" />
|
|
|
+ <div @click="onClickLookFile(record)" v-else>
|
|
|
+ {{ record.file_name }}
|
|
|
</div>
|
|
|
</div>
|
|
|
- </a-tooltip>
|
|
|
- </template>
|
|
|
- <!-- 操作 -->
|
|
|
- <template #action="{ record }">
|
|
|
- <!-- 编辑态操作 -->
|
|
|
- <div v-if="state.editableData[record.file_id]">
|
|
|
- <a-tooltip title="确定">
|
|
|
- <CheckOutlined style="color: #28d445;margin-right: 10px;" @click="onClickSave(record)" />
|
|
|
- </a-tooltip>
|
|
|
- <a-tooltip title="取消">
|
|
|
- <CloseOutlined style="color: #e70102;" @click="() => delete state.editableData[record.file_id]" />
|
|
|
- </a-tooltip>
|
|
|
</div>
|
|
|
- <!-- 非编辑态操作 -->
|
|
|
- <div class="flex-align-center flex-row" style="color: #2d8cf0" v-else>
|
|
|
- <div v-if="[1, 3].includes(record.media_type)">
|
|
|
- <a-tooltip title="在地图上加载" v-if="!record.element_id">
|
|
|
- <AimOutlined style="margin-right: 10px;" @click="onClickCreateMapElement(record.file_id)" />
|
|
|
- </a-tooltip>
|
|
|
- <a-tooltip title="在地图上取消加载" v-else>
|
|
|
- <AimOutlined style="color: #e70102;margin-right: 10px;"
|
|
|
- @click="onClickDeleteMapElement(record.file_id)" />
|
|
|
- </a-tooltip>
|
|
|
- </div>
|
|
|
- <a-tooltip title="重命名" v-else-if="record.media_type === 4">
|
|
|
- <EditOutlined style="margin-right: 10px;" @click="onClickRechristen(record)" />
|
|
|
- </a-tooltip>
|
|
|
- <a-tooltip title="删除" v-else-if="record.media_type === 2">
|
|
|
- <DeleteOutlined style="margin-right: 10px;" @click="onClickDelete(record)" />
|
|
|
+ </a-tooltip>
|
|
|
+ </template>
|
|
|
+ <!-- 操作 -->
|
|
|
+ <template #action="{ record }">
|
|
|
+ <!-- 编辑态操作 -->
|
|
|
+ <div v-if="state.editableData[record.file_id]">
|
|
|
+ <a-tooltip title="确定">
|
|
|
+ <CheckOutlined style="color: #28d445;margin-right: 10px;" @click="onClickSave(record)" />
|
|
|
+ </a-tooltip>
|
|
|
+ <a-tooltip title="取消">
|
|
|
+ <CloseOutlined style="color: #e70102;" @click="() => delete state.editableData[record.file_id]" />
|
|
|
+ </a-tooltip>
|
|
|
+ </div>
|
|
|
+ <!-- 非编辑态操作 -->
|
|
|
+ <div class="flex-align-center flex-row" style="color: #2d8cf0" v-else>
|
|
|
+ <div v-if="[1, 3].includes(record.media_type)">
|
|
|
+ <a-tooltip title="在地图上加载" v-if="!record.element_id">
|
|
|
+ <AimOutlined style="margin-right: 10px;" @click="onClickCreateMapElement(record.file_id)" />
|
|
|
</a-tooltip>
|
|
|
- <a-tooltip title="压缩下载">
|
|
|
- <DownloadOutlined @click="onClickDownload(record)" />
|
|
|
+ <a-tooltip title="在地图上取消加载" v-else>
|
|
|
+ <AimOutlined style="color: #e70102;margin-right: 10px;"
|
|
|
+ @click="onClickDeleteMapElement(record.file_id)" />
|
|
|
</a-tooltip>
|
|
|
</div>
|
|
|
- </template>
|
|
|
- </a-table>
|
|
|
- </div>
|
|
|
- <div class="mediaDetail-list" v-else>
|
|
|
- <a-list :grid="{ gutter: 16, xs: 1, sm: 2, md: 3, lg: 4, xl: 8, xxl: 12 }" :loading="state.listLoading"
|
|
|
- :dataSource="state.list" :pagination="paginationConfig">
|
|
|
- <template #renderItem="{ item }">
|
|
|
- <a-list-item>
|
|
|
- <a-card hoverable @click="onClickLookFile(item)">
|
|
|
- <template #cover>
|
|
|
- <div style="display: flex;justify-content:center;align-items: center;">
|
|
|
- <img style="width: 70%;margin: 10px;" :src="item.thumbnail_url" />
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <a-card-meta>
|
|
|
- <template #description>
|
|
|
- <div class="mediaDetail-list-name">
|
|
|
- {{ item.file_name }}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </a-card-meta>
|
|
|
- </a-card>
|
|
|
- </a-list-item>
|
|
|
- </template>
|
|
|
- </a-list>
|
|
|
- </div>
|
|
|
+ <a-tooltip title="重命名" v-else-if="record.media_type === 4">
|
|
|
+ <EditOutlined style="margin-right: 10px;" @click="onClickRechristen(record)" />
|
|
|
+ </a-tooltip>
|
|
|
+ <a-tooltip title="删除" v-else-if="record.media_type === 2">
|
|
|
+ <DeleteOutlined style="margin-right: 10px;" @click="onClickDelete(record)" />
|
|
|
+ </a-tooltip>
|
|
|
+ <a-tooltip title="压缩下载">
|
|
|
+ <DownloadOutlined @click="onClickDownload(record)" />
|
|
|
+ </a-tooltip>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
</div>
|
|
|
</div>
|
|
|
</a-spin>
|
|
|
- <FileInfo :fileId="state.fileId" :onClose="fileInfoOnClickClose" v-if="state.fileInfoVisible" />
|
|
|
+ <FileInfo :fileId="state.fileId" :fileList="state.list" :onClose="fileInfoOnClickClose"
|
|
|
+ v-if="state.fileInfoVisible" />
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import { reactive, onMounted } from 'vue';
|
|
|
import { message } from 'ant-design-vue';
|
|
|
-import { MenuOutlined, AppstoreOutlined, EditOutlined, DeleteOutlined, DownloadOutlined, AimOutlined, CheckOutlined, CloseOutlined } from '@ant-design/icons-vue';
|
|
|
+import { EditOutlined, DeleteOutlined, DownloadOutlined, AimOutlined, CheckOutlined, CloseOutlined } from '@ant-design/icons-vue';
|
|
|
import Search from './components/Search.vue';
|
|
|
import FileInfo from './components/FileInfo.vue';
|
|
|
import panoramaSrc from '/@/assets/media/panorama.svg';
|
|
|
@@ -147,7 +114,6 @@ interface State {
|
|
|
[key: string]: string,
|
|
|
},
|
|
|
downloadLoading: boolean,
|
|
|
- mode: 'table' | 'list',
|
|
|
fileId: string,
|
|
|
fileInfoVisible: boolean,
|
|
|
};
|
|
|
@@ -160,7 +126,6 @@ const state: State = reactive({
|
|
|
selectedRowKeys: [],
|
|
|
editableData: {},
|
|
|
downloadLoading: false,
|
|
|
- mode: 'table',
|
|
|
fileId: '',
|
|
|
fileInfoVisible: false,
|
|
|
})
|
|
|
@@ -445,14 +410,6 @@ const onClickDownload = async (record: any) => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- &-list {
|
|
|
- &-name {
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
- white-space: nowrap;
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
.ant-table {
|