|
|
|
@ -17,12 +17,37 @@
|
|
|
|
|
<a-button :icon="h(BorderHorizontalOutlined)" @click="openComparisonModal">
|
|
|
|
|
变化检测
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-button :icon="h(PlusOutlined)" type="primary" @click="addFolder">
|
|
|
|
|
新建文件夹
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-button :icon="h(PlusOutlined)" @click="addFolder"> 新建文件夹 </a-button>
|
|
|
|
|
<a-button :icon="h(ColumnHeightOutlined)" @click="moveFolderOrFile">移动</a-button>
|
|
|
|
|
<a-button :icon="h(DeleteOutlined)" @click="deleteFolderOrFile">删除 </a-button>
|
|
|
|
|
<!-- <a-button :icon="h(DownloadOutlined)" @click="compressFolderOrFile">压缩</a-button> -->
|
|
|
|
|
<a-button
|
|
|
|
|
:icon="h(DownloadOutlined)"
|
|
|
|
|
:loading="downloadAloneLoading"
|
|
|
|
|
@click="downloadAloneFile"
|
|
|
|
|
>
|
|
|
|
|
单独下载
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-popover trigger="hover">
|
|
|
|
|
<template #content>
|
|
|
|
|
<div v-if="!downloadZipLoading">
|
|
|
|
|
选择下载的文件/文件夹,压缩下载成一个压缩包文件
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="downloadZipLoading">
|
|
|
|
|
<a-progress
|
|
|
|
|
type="circle"
|
|
|
|
|
:percent="downloadZipPercent"
|
|
|
|
|
:format="(downloadZipPercent) => `下载中\n${downloadZipPercent}%`"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<a-button
|
|
|
|
|
:icon="h(DownloadOutlined)"
|
|
|
|
|
:loading="downloadZipLoading"
|
|
|
|
|
@click="downloadZipOpenMoadl"
|
|
|
|
|
>
|
|
|
|
|
批量下载
|
|
|
|
|
</a-button>
|
|
|
|
|
</a-popover>
|
|
|
|
|
<a-radio-group v-model:value="tableType">
|
|
|
|
|
<a-radio-button value="table"><BarsOutlined /></a-radio-button>
|
|
|
|
|
<a-radio-button value="store"><AppstoreOutlined /></a-radio-button>
|
|
|
|
@ -97,7 +122,15 @@
|
|
|
|
|
<span
|
|
|
|
|
style="width: 100%; display: flex; align-items: center; justify-content: center"
|
|
|
|
|
>
|
|
|
|
|
{{ record.size ? parseFloat((record.size / (1024 * 1024)).toFixed(2)) + 'M' : '-' }}
|
|
|
|
|
{{
|
|
|
|
|
record.size
|
|
|
|
|
? record.size > 1024 * 1024
|
|
|
|
|
? parseFloat((record.size / (1024 * 1024)).toFixed(2)) + 'MB'
|
|
|
|
|
: record.size > 1024
|
|
|
|
|
? parseFloat((record.size / 1024).toFixed(2)) + 'KB'
|
|
|
|
|
: parseFloat(record.size) + 'B'
|
|
|
|
|
: '-'
|
|
|
|
|
}}
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="column.key === 'airLineName'">
|
|
|
|
@ -284,6 +317,41 @@
|
|
|
|
|
<Comparison @closeComparisonModal="closeComparisonModal" />
|
|
|
|
|
</a-modal>
|
|
|
|
|
|
|
|
|
|
<!-- 下载文件命名窗口 -->
|
|
|
|
|
<a-modal
|
|
|
|
|
v-model:open="downloadZipOpen"
|
|
|
|
|
title="压缩"
|
|
|
|
|
width="30%"
|
|
|
|
|
:centered="true"
|
|
|
|
|
:closable="false"
|
|
|
|
|
:destroyOnClose="true"
|
|
|
|
|
:keyboard="false"
|
|
|
|
|
:mask="false"
|
|
|
|
|
:maskClosable="false"
|
|
|
|
|
@ok="downloadZipFile"
|
|
|
|
|
@cancel="((zipFileName = null), (downloadRows = []))"
|
|
|
|
|
>
|
|
|
|
|
<div style="width: 100%; margin: 10px; padding: 10px">
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="24">
|
|
|
|
|
<div style="width: 100%; height: 40px">批量下载会先进行压缩成一个文件,然后再下载</div>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="4">
|
|
|
|
|
<div style="width: 100%"> 压缩包名称: </div>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="20">
|
|
|
|
|
<div style="width: 80%">
|
|
|
|
|
<a-input
|
|
|
|
|
v-model:value="zipFileName"
|
|
|
|
|
placeholder="请输入压缩文件的名称"
|
|
|
|
|
allowClear
|
|
|
|
|
></a-input>
|
|
|
|
|
</div>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
</div>
|
|
|
|
|
</a-modal>
|
|
|
|
|
|
|
|
|
|
<Path
|
|
|
|
|
v-if="pathDivShow"
|
|
|
|
|
:pathDivShow="pathDivShow"
|
|
|
|
@ -335,6 +403,8 @@
|
|
|
|
|
import { columns, searchFormSchema } from './modal.data';
|
|
|
|
|
import dayjs from 'dayjs';
|
|
|
|
|
import { cloneDeep } from 'lodash-es';
|
|
|
|
|
import JSZip from 'jszip';
|
|
|
|
|
import { saveAs } from 'file-saver';
|
|
|
|
|
|
|
|
|
|
const { VITE_GLOB_MEDIALIBRARY_IMAGE_URL } = getAppEnvConfig();
|
|
|
|
|
const { createConfirm, createMessage } = useMessage();
|
|
|
|
@ -348,88 +418,98 @@
|
|
|
|
|
const tableHeight: any = ref(0);
|
|
|
|
|
watch(
|
|
|
|
|
() => tableType.value,
|
|
|
|
|
(newval) => {
|
|
|
|
|
// 格子
|
|
|
|
|
if (newval === 'store') {
|
|
|
|
|
// 数据
|
|
|
|
|
let query = { ...searchParams.value, page: 1, limit: 1000 };
|
|
|
|
|
if (routeFlag.value) {
|
|
|
|
|
query = {
|
|
|
|
|
...query,
|
|
|
|
|
taskId: route.query.flightId,
|
|
|
|
|
objectKeyExist: 1,
|
|
|
|
|
};
|
|
|
|
|
} else {
|
|
|
|
|
query = {
|
|
|
|
|
...query,
|
|
|
|
|
parentKey: nowParentKey.value,
|
|
|
|
|
};
|
|
|
|
|
() => {
|
|
|
|
|
// 表格还是文件夹变化
|
|
|
|
|
getShowTableData();
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
function getShowTableData() {
|
|
|
|
|
// 格子
|
|
|
|
|
if (tableType.value === 'store') {
|
|
|
|
|
// 数据
|
|
|
|
|
let query = { ...searchParams.value, page: 1, limit: 1000 };
|
|
|
|
|
if (routeFlag.value) {
|
|
|
|
|
query = {
|
|
|
|
|
...query,
|
|
|
|
|
taskId: route.query.flightId,
|
|
|
|
|
objectKeyExist: 1,
|
|
|
|
|
};
|
|
|
|
|
} else {
|
|
|
|
|
query = {
|
|
|
|
|
...query,
|
|
|
|
|
// 总目录下展示全部的所选文件类型的文件、单个目录下只显示本文件下的所选文件类型的文件
|
|
|
|
|
parentKey: searchInfo.type
|
|
|
|
|
? nowParentKey.value == '0'
|
|
|
|
|
? ''
|
|
|
|
|
: nowParentKey.value
|
|
|
|
|
: nowParentKey.value,
|
|
|
|
|
type: searchInfo.type,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
GetMediaFile(query).then((res) => {
|
|
|
|
|
showTableData.value = res.items;
|
|
|
|
|
tableTypeAfterShow.value = tableType.value;
|
|
|
|
|
// 表格-隐藏
|
|
|
|
|
const containers = document.querySelectorAll('.ant-table-container');
|
|
|
|
|
tableHeight.value = containers[0] ? containers[0]?.scrollHeight : 0;
|
|
|
|
|
if (containers) {
|
|
|
|
|
containers.forEach((container) => {
|
|
|
|
|
container.style.display = 'none';
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
GetMediaFile(query).then((res) => {
|
|
|
|
|
showTableData.value = res.items;
|
|
|
|
|
tableTypeAfterShow.value = newval;
|
|
|
|
|
// 表格-隐藏
|
|
|
|
|
const containers = document.querySelectorAll('.ant-table-container');
|
|
|
|
|
tableHeight.value = containers[0] ? containers[0]?.scrollHeight : 0;
|
|
|
|
|
if (containers) {
|
|
|
|
|
containers.forEach((container) => {
|
|
|
|
|
container.style.display = 'none';
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// 分页-隐藏
|
|
|
|
|
const paginations = document.querySelectorAll('.ant-pagination');
|
|
|
|
|
if (paginations) {
|
|
|
|
|
paginations.forEach((pagination) => {
|
|
|
|
|
pagination.style.display = 'none';
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// 选中:表格→格子
|
|
|
|
|
let selectRowsIdArray = getSelectRows().map((item) => item.id);
|
|
|
|
|
showTableData.value.forEach((item) => {
|
|
|
|
|
if (selectRowsIdArray.includes(item.id)) {
|
|
|
|
|
item.checked = true;
|
|
|
|
|
changeStore(
|
|
|
|
|
{
|
|
|
|
|
target: {
|
|
|
|
|
checked: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
item,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
// 分页-隐藏
|
|
|
|
|
const paginations = document.querySelectorAll('.ant-pagination');
|
|
|
|
|
if (paginations) {
|
|
|
|
|
paginations.forEach((pagination) => {
|
|
|
|
|
pagination.style.display = 'none';
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// 表格
|
|
|
|
|
if (newval === 'table') {
|
|
|
|
|
reload().then((res) => {
|
|
|
|
|
tableTypeAfterShow.value = newval;
|
|
|
|
|
// 表格-显示
|
|
|
|
|
const containers = document.querySelectorAll('.ant-table-container');
|
|
|
|
|
tableHeight.value = containers[0] ? containers[0]?.scrollHeight : 0;
|
|
|
|
|
if (containers) {
|
|
|
|
|
containers.forEach((container) => {
|
|
|
|
|
container.style.display = 'block';
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// 分页-显示
|
|
|
|
|
const paginations = document.querySelectorAll('.ant-pagination');
|
|
|
|
|
if (paginations) {
|
|
|
|
|
paginations.forEach((pagination) => {
|
|
|
|
|
pagination.style.display = 'block';
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// 选中:表格→格子
|
|
|
|
|
let selectRowsIdArray = getSelectRows().map((item) => item.id);
|
|
|
|
|
showTableData.value.forEach((item) => {
|
|
|
|
|
if (selectRowsIdArray.includes(item.id)) {
|
|
|
|
|
item.checked = true;
|
|
|
|
|
changeStore(
|
|
|
|
|
{
|
|
|
|
|
target: {
|
|
|
|
|
checked: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
item,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
// 选中:格子→表格
|
|
|
|
|
let selectRowsIdArray = showTableData.value.filter((item) => item.checked);
|
|
|
|
|
setSelectedRows(selectRowsIdArray);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// 表格
|
|
|
|
|
if (tableType.value === 'table') {
|
|
|
|
|
reload().then((res) => {
|
|
|
|
|
tableTypeAfterShow.value = tableType.value;
|
|
|
|
|
// 表格-显示
|
|
|
|
|
const containers = document.querySelectorAll('.ant-table-container');
|
|
|
|
|
tableHeight.value = containers[0] ? containers[0]?.scrollHeight : 0;
|
|
|
|
|
if (containers) {
|
|
|
|
|
containers.forEach((container) => {
|
|
|
|
|
container.style.display = 'block';
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// 分页-显示
|
|
|
|
|
const paginations = document.querySelectorAll('.ant-pagination');
|
|
|
|
|
if (paginations) {
|
|
|
|
|
paginations.forEach((pagination) => {
|
|
|
|
|
pagination.style.display = 'flex';
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// 选中:格子→表格
|
|
|
|
|
let selectRowsIdArray = showTableData.value.filter((item) => item.checked);
|
|
|
|
|
setSelectedRows(selectRowsIdArray);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 单选框选择
|
|
|
|
|
const checkNameChecked = ref(false);
|
|
|
|
|
// 表格or文件夹切换
|
|
|
|
|
// 表格or文件夹切换-选择框
|
|
|
|
|
function changeStore(e, record) {
|
|
|
|
|
if (typeof record == 'string') {
|
|
|
|
|
if (e.target.checked) {
|
|
|
|
@ -545,7 +625,12 @@
|
|
|
|
|
...data,
|
|
|
|
|
page: tableTypeAfterShow.value == 'table' ? data.page : 1,
|
|
|
|
|
limit: tableTypeAfterShow.value == 'table' ? data.limit : 1000,
|
|
|
|
|
parentKey: nowParentKey.value,
|
|
|
|
|
// 总目录下展示全部的所选文件类型的文件、单个目录下只显示本文件下的所选文件类型的文件
|
|
|
|
|
parentKey: searchInfo.type
|
|
|
|
|
? nowParentKey.value == '0'
|
|
|
|
|
? ''
|
|
|
|
|
: nowParentKey.value
|
|
|
|
|
: nowParentKey.value,
|
|
|
|
|
};
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
@ -575,6 +660,19 @@
|
|
|
|
|
arr.graffitiJson = [];
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
showTableData.value = result;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
// 格子
|
|
|
|
|
if (tableType.value === 'store') {
|
|
|
|
|
// 分页-隐藏
|
|
|
|
|
const paginations = document.querySelectorAll('.ant-pagination');
|
|
|
|
|
if (paginations) {
|
|
|
|
|
paginations.forEach((pagination) => {
|
|
|
|
|
pagination.style.display = 'none';
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, 100);
|
|
|
|
|
return result;
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
@ -606,9 +704,16 @@
|
|
|
|
|
|
|
|
|
|
// 弹窗----------------------------------------------------------------------
|
|
|
|
|
// 左侧目录选择
|
|
|
|
|
function handleSelect(orgId = '') {
|
|
|
|
|
searchInfo.orgId = orgId;
|
|
|
|
|
reload();
|
|
|
|
|
function handleSelect(type = '') {
|
|
|
|
|
searchInfo.type = type;
|
|
|
|
|
// 表格
|
|
|
|
|
if (tableType.value == 'table') {
|
|
|
|
|
reload();
|
|
|
|
|
}
|
|
|
|
|
// 格子
|
|
|
|
|
if (tableType.value === 'store') {
|
|
|
|
|
getShowTableData();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 刷新表格
|
|
|
|
|
const childRef = ref<any>();
|
|
|
|
@ -641,7 +746,13 @@
|
|
|
|
|
} else {
|
|
|
|
|
query = {
|
|
|
|
|
...query,
|
|
|
|
|
parentKey: nowParentKey.value,
|
|
|
|
|
// 总目录下展示全部的所选文件类型的文件、单个目录下只显示本文件下的所选文件类型的文件
|
|
|
|
|
parentKey: searchInfo.type
|
|
|
|
|
? nowParentKey.value == '0'
|
|
|
|
|
? ''
|
|
|
|
|
: nowParentKey.value
|
|
|
|
|
: nowParentKey.value,
|
|
|
|
|
type: searchInfo.type,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
GetMediaFile(query).then((res) => {
|
|
|
|
@ -725,6 +836,147 @@
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 单独下载
|
|
|
|
|
const downloadAloneLoading = ref(false);
|
|
|
|
|
async function downloadAloneFile() {
|
|
|
|
|
// 获得所选
|
|
|
|
|
let rows = getSelectRows();
|
|
|
|
|
if (tableType.value == 'store') {
|
|
|
|
|
rows = showTableData.value.filter((item) => item.checked);
|
|
|
|
|
}
|
|
|
|
|
if (rows.length != 1) {
|
|
|
|
|
return createMessage.warn('请选择一个文件进行下载');
|
|
|
|
|
}
|
|
|
|
|
if (!rows[0].objectKey) {
|
|
|
|
|
return createMessage.warn('单独下载只能下载非文件夹的文件');
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
downloadAloneLoading.value = true;
|
|
|
|
|
const response = await fetch(VITE_GLOB_MEDIALIBRARY_IMAGE_URL + rows[0].objectKey, {
|
|
|
|
|
mode: 'cors',
|
|
|
|
|
});
|
|
|
|
|
if (!response.ok) {
|
|
|
|
|
throw new Error(`HTTP error! status: ${response.status}`);
|
|
|
|
|
}
|
|
|
|
|
const blob = await response.blob();
|
|
|
|
|
const urlObject = window.URL.createObjectURL(blob);
|
|
|
|
|
const link = document.createElement('a');
|
|
|
|
|
link.href = urlObject;
|
|
|
|
|
link.download = rows[0].name || 'download';
|
|
|
|
|
document.body.appendChild(link);
|
|
|
|
|
link.click();
|
|
|
|
|
document.body.removeChild(link);
|
|
|
|
|
window.URL.revokeObjectURL(urlObject);
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('Error downloading image:', error);
|
|
|
|
|
} finally {
|
|
|
|
|
downloadAloneLoading.value = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 压缩窗口
|
|
|
|
|
const downloadZipOpen = ref(false);
|
|
|
|
|
const downloadZipLoading = ref(false);
|
|
|
|
|
const downloadZipPercent = ref(0);
|
|
|
|
|
|
|
|
|
|
// 压缩文件名
|
|
|
|
|
let downloadRows: any = [];
|
|
|
|
|
const zipFileName = ref('');
|
|
|
|
|
// 批量下载-窗口
|
|
|
|
|
function downloadZipOpenMoadl() {
|
|
|
|
|
// 获得所选
|
|
|
|
|
let rows = getSelectRows();
|
|
|
|
|
if (tableType.value == 'store') {
|
|
|
|
|
rows = showTableData.value.filter((item) => item.checked);
|
|
|
|
|
}
|
|
|
|
|
if (rows.length == 0) {
|
|
|
|
|
return createMessage.warn('请选择一个或者多个文件/文件夹进行下载');
|
|
|
|
|
}
|
|
|
|
|
zipFileName.value = '压缩文件' + dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
|
|
|
if (floders.value.length > 1) {
|
|
|
|
|
zipFileName.value = floders.value[floders.value.length - 1].name;
|
|
|
|
|
}
|
|
|
|
|
if (rows.length == 1 && !rows[0].objectKey) {
|
|
|
|
|
zipFileName.value = rows[0].name;
|
|
|
|
|
}
|
|
|
|
|
downloadRows = rows;
|
|
|
|
|
downloadZipOpen.value = true;
|
|
|
|
|
}
|
|
|
|
|
// 批量下载-下载
|
|
|
|
|
async function downloadZipFile() {
|
|
|
|
|
if (!zipFileName.value) {
|
|
|
|
|
return createMessage.warn('压缩包名称不能为空');
|
|
|
|
|
}
|
|
|
|
|
downloadZipOpen.value = false;
|
|
|
|
|
downloadZipLoading.value = true;
|
|
|
|
|
getFileList(downloadRows).then(async (res) => {
|
|
|
|
|
let filelist: any = res;
|
|
|
|
|
const token = localStorage.getItem('X-Token');
|
|
|
|
|
const zip = new JSZip();
|
|
|
|
|
// 添加文件到ZIP
|
|
|
|
|
let index = 0;
|
|
|
|
|
for (const file of filelist) {
|
|
|
|
|
try {
|
|
|
|
|
const response = await fetch(file.url + '?t=' + Date.now(), {
|
|
|
|
|
headers: {
|
|
|
|
|
Authorization: `Bearer ${token}`,
|
|
|
|
|
},
|
|
|
|
|
mode: 'cors',
|
|
|
|
|
});
|
|
|
|
|
if (!response.ok) {
|
|
|
|
|
throw new Error(`HTTP 错误: ${response.status} - ${response.statusText}`);
|
|
|
|
|
}
|
|
|
|
|
const blob = await response.blob();
|
|
|
|
|
zip.file(`${file.path}/${file.name}`, blob, { binary: true });
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('请求失败:', error);
|
|
|
|
|
} finally {
|
|
|
|
|
index++;
|
|
|
|
|
downloadZipPercent.value = parseFloat(((index / filelist.length) * 100).toFixed(2));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 生成ZIP文件并触发下载
|
|
|
|
|
try {
|
|
|
|
|
const blob = await zip.generateAsync({ type: 'blob' });
|
|
|
|
|
saveAs(blob, zipFileName.value + '.zip'); // 下载的ZIP文件名
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('生成ZIP文件时出错:', error);
|
|
|
|
|
} finally {
|
|
|
|
|
downloadZipLoading.value = false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// 批量下载-数据
|
|
|
|
|
async function getFileList(rows) {
|
|
|
|
|
const filelist: any = [];
|
|
|
|
|
// 使用 for...of 配合 await
|
|
|
|
|
for (const item of rows) {
|
|
|
|
|
if (item.objectKey) {
|
|
|
|
|
// 直接文件
|
|
|
|
|
filelist.push({
|
|
|
|
|
name: item.name,
|
|
|
|
|
url: VITE_GLOB_MEDIALIBRARY_IMAGE_URL + item.objectKey,
|
|
|
|
|
path: '',
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
// 文件夹:获取子文件
|
|
|
|
|
const res = await GetMediaFile({
|
|
|
|
|
parentKey: item.id,
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 1000,
|
|
|
|
|
});
|
|
|
|
|
res.items.forEach((r) => {
|
|
|
|
|
filelist.push({
|
|
|
|
|
name: r.name,
|
|
|
|
|
url: VITE_GLOB_MEDIALIBRARY_IMAGE_URL + r.objectKey,
|
|
|
|
|
path: item.name, // 以文件夹名为路径
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return filelist;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 查看弹窗----------------------------------------------------------------------------
|
|
|
|
|
const openPreview = ref(false);
|
|
|
|
|
// 目前展示图片
|
|
|
|
@ -746,7 +998,13 @@
|
|
|
|
|
} else {
|
|
|
|
|
query = {
|
|
|
|
|
...query,
|
|
|
|
|
parentKey: nowParentKey.value,
|
|
|
|
|
// 总目录下展示全部的所选文件类型的文件、单个目录下只显示本文件下的所选文件类型的文件
|
|
|
|
|
parentKey: searchInfo.type
|
|
|
|
|
? nowParentKey.value == '0'
|
|
|
|
|
? ''
|
|
|
|
|
: nowParentKey.value
|
|
|
|
|
: nowParentKey.value,
|
|
|
|
|
type: searchInfo.type,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
GetMediaFile(query).then((res) => {
|
|
|
|
@ -773,6 +1031,9 @@
|
|
|
|
|
showTableData.value = res;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
clearSelectedRowKeys();
|
|
|
|
|
}, 500);
|
|
|
|
|
}
|
|
|
|
|
function uniqueByKey(arrlist, record) {
|
|
|
|
|
let resultList: any = [];
|
|
|
|
@ -851,7 +1112,13 @@
|
|
|
|
|
} else {
|
|
|
|
|
query = {
|
|
|
|
|
...query,
|
|
|
|
|
parentKey: nowParentKey.value,
|
|
|
|
|
// 总目录下展示全部的所选文件类型的文件、单个目录下只显示本文件下的所选文件类型的文件
|
|
|
|
|
parentKey: searchInfo.type
|
|
|
|
|
? nowParentKey.value == '0'
|
|
|
|
|
? ''
|
|
|
|
|
: nowParentKey.value
|
|
|
|
|
: nowParentKey.value,
|
|
|
|
|
type: searchInfo.type,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
GetMediaFile(query).then((res) => {
|
|
|
|
@ -913,7 +1180,7 @@
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
}
|
|
|
|
|
.flodersname {
|
|
|
|
|
max-width: 120px;
|
|
|
|
|
max-width: 240px;
|
|
|
|
|
white-space: nowrap; /* 禁止换行 */
|
|
|
|
|
overflow: hidden; /* 超出部分隐藏 */
|
|
|
|
|
text-overflow: ellipsis; /* 超出显示省略号 */
|
|
|
|
@ -1001,4 +1268,8 @@
|
|
|
|
|
::v-deep .ant-modal-body {
|
|
|
|
|
height: 100% !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep .ant-pagination {
|
|
|
|
|
justify-content: flex-end !important;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|