|
|
|
@ -30,21 +30,29 @@
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template #bodyCell="{ column, record }">
|
|
|
|
|
<div v-if="tableType == 'table'">
|
|
|
|
|
<div v-if="tableTypeAfterShow == 'table'">
|
|
|
|
|
<template v-if="column.key === 'name'">
|
|
|
|
|
<!-- 文件夹 -->
|
|
|
|
|
<FolderOpenOutlined v-if="!record.objectKey" style="font-size: 20px" />
|
|
|
|
|
<FileOutlined
|
|
|
|
|
v-if="record.objectKey && !record.objectKey.includes('jpeg')"
|
|
|
|
|
style="font-size: 20px"
|
|
|
|
|
/>
|
|
|
|
|
<!-- 图片 -->
|
|
|
|
|
<img
|
|
|
|
|
v-if="record.objectKey && record.objectKey.includes('jpeg')"
|
|
|
|
|
:src="`${VITE_MEDIALIBRARY_IMAGE_URL + (record.minipic ? record.minipic : record.objectKey)}`"
|
|
|
|
|
:width="30"
|
|
|
|
|
:height="20"
|
|
|
|
|
/>
|
|
|
|
|
<!-- 视频 -->
|
|
|
|
|
<PlaySquareTwoTone
|
|
|
|
|
v-if="record.objectKey && record.objectKey.includes('mp4')"
|
|
|
|
|
style="font-size: 20px"
|
|
|
|
|
/>
|
|
|
|
|
<!-- 文件夹或者图片、视频 -->
|
|
|
|
|
<span
|
|
|
|
|
v-if="!record.objectKey || (record.objectKey && record.objectKey.includes('jpeg'))"
|
|
|
|
|
v-if="
|
|
|
|
|
!record.objectKey ||
|
|
|
|
|
(record.objectKey &&
|
|
|
|
|
(record.objectKey.includes('jpeg') || record.objectKey.includes('mp4')))
|
|
|
|
|
"
|
|
|
|
|
@click="lookRecord(record)"
|
|
|
|
|
@mouseover="record.isHovered = true"
|
|
|
|
|
@mouseout="record.isHovered = false"
|
|
|
|
@ -55,8 +63,21 @@
|
|
|
|
|
>
|
|
|
|
|
{{ record.name }}
|
|
|
|
|
</span>
|
|
|
|
|
<!-- 其他文件 -->
|
|
|
|
|
<FileOutlined
|
|
|
|
|
v-if="
|
|
|
|
|
record.objectKey &&
|
|
|
|
|
!record.objectKey.includes('jpeg') &&
|
|
|
|
|
!record.objectKey.includes('mp4')
|
|
|
|
|
"
|
|
|
|
|
style="font-size: 20px"
|
|
|
|
|
/>
|
|
|
|
|
<span
|
|
|
|
|
v-if="record.objectKey && !record.objectKey.includes('jpeg')"
|
|
|
|
|
v-if="
|
|
|
|
|
record.objectKey &&
|
|
|
|
|
!record.objectKey.includes('jpeg') &&
|
|
|
|
|
!record.objectKey.includes('mp4')
|
|
|
|
|
"
|
|
|
|
|
:style="{
|
|
|
|
|
marginLeft: '5px',
|
|
|
|
|
}"
|
|
|
|
@ -133,12 +154,12 @@
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</BasicTable>
|
|
|
|
|
<div v-if="tableType == 'store'" class="storeDivsAllChoose">
|
|
|
|
|
<div v-if="tableTypeAfterShow == 'store'" class="storeDivsAllChoose">
|
|
|
|
|
<a-checkbox v-model:checked="checkNameChecked" @change="changeStore($event, 'allChoose')">
|
|
|
|
|
全选
|
|
|
|
|
</a-checkbox>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="tableType == 'store'" class="storeDivs">
|
|
|
|
|
<div v-if="tableTypeAfterShow == 'store'" class="storeDivList">
|
|
|
|
|
<div
|
|
|
|
|
v-for="record in showTableData"
|
|
|
|
|
:key="record.id"
|
|
|
|
@ -147,38 +168,64 @@
|
|
|
|
|
@mouseover="record.isHovered = true"
|
|
|
|
|
@mouseout="record.isHovered = false"
|
|
|
|
|
>
|
|
|
|
|
<!-- 选中 -->
|
|
|
|
|
<div style="position: absolute; top: 0px; left: 5px">
|
|
|
|
|
<a-checkbox v-model:checked="record.checked" @change="changeStore($event, record)" />
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 文件夹 -->
|
|
|
|
|
<FolderOpenOutlined
|
|
|
|
|
v-if="!record.objectKey"
|
|
|
|
|
style="font-size: 40px"
|
|
|
|
|
@click="lookRecord(record)"
|
|
|
|
|
/>
|
|
|
|
|
<!-- 图片 -->
|
|
|
|
|
<img
|
|
|
|
|
v-if="record.objectKey"
|
|
|
|
|
v-if="record.objectKey && record.objectKey.includes('jpeg')"
|
|
|
|
|
:src="`${VITE_MEDIALIBRARY_IMAGE_URL + (record.minipic ? record.minipic : record.objectKey)}`"
|
|
|
|
|
:width="60"
|
|
|
|
|
:height="40"
|
|
|
|
|
:width="100"
|
|
|
|
|
:height="60"
|
|
|
|
|
style="position: absolute; top: 10px; left: 32.5px"
|
|
|
|
|
@click="lookRecord(record)"
|
|
|
|
|
/>
|
|
|
|
|
<!-- 视频 -->
|
|
|
|
|
<PlaySquareTwoTone
|
|
|
|
|
v-if="record.objectKey && record.objectKey.includes('mp4')"
|
|
|
|
|
style="font-size: 40px"
|
|
|
|
|
/>
|
|
|
|
|
<!-- 文件夹或者图片、视频 -->
|
|
|
|
|
<span
|
|
|
|
|
v-if="
|
|
|
|
|
!record.objectKey ||
|
|
|
|
|
(record.objectKey &&
|
|
|
|
|
(record.objectKey.includes('jpeg') || record.objectKey.includes('mp4')))
|
|
|
|
|
"
|
|
|
|
|
class="storeDivSpanName"
|
|
|
|
|
:style="{
|
|
|
|
|
textDecoration: record.isHovered ? 'underline' : 'none',
|
|
|
|
|
position: 'absolute',
|
|
|
|
|
bottom: '10px',
|
|
|
|
|
left: '0px',
|
|
|
|
|
width: '100%',
|
|
|
|
|
height: '30px',
|
|
|
|
|
display: 'flex',
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
justifyContent: 'center',
|
|
|
|
|
cursor: 'pointer',
|
|
|
|
|
}"
|
|
|
|
|
@click="lookRecord(record)"
|
|
|
|
|
>
|
|
|
|
|
{{ record.name }}
|
|
|
|
|
</span>
|
|
|
|
|
<!-- 其他文件 -->
|
|
|
|
|
<FileOutlined
|
|
|
|
|
v-if="
|
|
|
|
|
record.objectKey &&
|
|
|
|
|
!record.objectKey.includes('jpeg') &&
|
|
|
|
|
!record.objectKey.includes('mp4')
|
|
|
|
|
"
|
|
|
|
|
style="font-size: 40px"
|
|
|
|
|
/>
|
|
|
|
|
<span
|
|
|
|
|
v-if="
|
|
|
|
|
record.objectKey &&
|
|
|
|
|
!record.objectKey.includes('jpeg') &&
|
|
|
|
|
!record.objectKey.includes('mp4')
|
|
|
|
|
"
|
|
|
|
|
class="storeDivSpanName"
|
|
|
|
|
>
|
|
|
|
|
{{ record.name }}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -273,6 +320,7 @@
|
|
|
|
|
PlaySquareTwoTone,
|
|
|
|
|
FileOutlined,
|
|
|
|
|
BorderInnerOutlined,
|
|
|
|
|
YoutubeOutlined,
|
|
|
|
|
} from '@ant-design/icons-vue';
|
|
|
|
|
import {
|
|
|
|
|
GetMediaFile,
|
|
|
|
@ -300,51 +348,76 @@
|
|
|
|
|
const showTableData = ref();
|
|
|
|
|
// 表格还是文件夹
|
|
|
|
|
const tableType = ref('table');
|
|
|
|
|
const tableTypeAfterShow = ref('table');
|
|
|
|
|
const tableHeight: any = ref(0);
|
|
|
|
|
watch(
|
|
|
|
|
() => tableType.value,
|
|
|
|
|
(newval) => {
|
|
|
|
|
showTableData.value = getDataSource();
|
|
|
|
|
// 表格
|
|
|
|
|
const containers = document.querySelectorAll('.ant-table-container');
|
|
|
|
|
if (newval) {
|
|
|
|
|
tableHeight.value = containers[0] ? containers[0]?.scrollHeight : 0;
|
|
|
|
|
} else {
|
|
|
|
|
tableHeight.value = 0;
|
|
|
|
|
}
|
|
|
|
|
if (containers) {
|
|
|
|
|
containers.forEach((container) => {
|
|
|
|
|
container.style.display = tableType.value === 'table' ? 'block' : 'none';
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// 分页
|
|
|
|
|
const paginations = document.querySelectorAll('.ant-pagination');
|
|
|
|
|
if (paginations) {
|
|
|
|
|
paginations.forEach((pagination) => {
|
|
|
|
|
pagination.style.display = tableType.value === 'table' ? 'block' : 'none';
|
|
|
|
|
// 格子
|
|
|
|
|
if (newval === 'store') {
|
|
|
|
|
// 数据
|
|
|
|
|
GetMediaFile({
|
|
|
|
|
parentKey: nowParentKey.value,
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 1000,
|
|
|
|
|
}).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,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// 选中
|
|
|
|
|
// 框架
|
|
|
|
|
if (tableType.value === 'store') {
|
|
|
|
|
let selectRowsIdArray = getSelectRows().map((item) => item.id);
|
|
|
|
|
showTableData.value.forEach((item) => {
|
|
|
|
|
if (selectRowsIdArray.includes(item.id)) {
|
|
|
|
|
item.checked = true;
|
|
|
|
|
changeStore(
|
|
|
|
|
{
|
|
|
|
|
target: {
|
|
|
|
|
checked: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
item,
|
|
|
|
|
);
|
|
|
|
|
// 表格
|
|
|
|
|
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 = showTableData.value.filter((item) => item.checked);
|
|
|
|
|
setSelectedRows(selectRowsIdArray);
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
// 表格
|
|
|
|
|
let selectRowsIdArray = showTableData.value.filter((item) => item.checked);
|
|
|
|
|
setSelectedRows(selectRowsIdArray);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
@ -417,6 +490,8 @@
|
|
|
|
|
// 接口请求前 参数处理
|
|
|
|
|
let temp = {
|
|
|
|
|
...data,
|
|
|
|
|
page: tableTypeAfterShow.value == 'table' ? data.page : 1,
|
|
|
|
|
limit: tableTypeAfterShow.value == 'table' ? data.limit : 1000,
|
|
|
|
|
parentKey: nowParentKey.value,
|
|
|
|
|
};
|
|
|
|
|
return temp;
|
|
|
|
@ -502,12 +577,10 @@
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 100,
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
previewRecordList.value = uniqueByKey(res.items, null);
|
|
|
|
|
getDataSource().forEach((item) => {
|
|
|
|
|
if (item.id == nowPreviewRecord.value.id) {
|
|
|
|
|
nowPreviewRecord.value = item;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
previewRecordList.value = uniqueByKey(res.items, nowPreviewRecord.value);
|
|
|
|
|
nowPreviewRecord.value = getDataSource().find(
|
|
|
|
|
(item) => item.id == nowPreviewRecord.value.id,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, 500);
|
|
|
|
@ -541,16 +614,16 @@
|
|
|
|
|
}
|
|
|
|
|
// 压缩
|
|
|
|
|
function compressFolderOrFile() {
|
|
|
|
|
let rows = getSelectRows();
|
|
|
|
|
if (rows.length > 0) {
|
|
|
|
|
const record = rows;
|
|
|
|
|
openCompressFileModal(true, {
|
|
|
|
|
tableData: getDataSource(),
|
|
|
|
|
record,
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
return createMessage.warn('请选择一个或者多个文件/文件夹压缩');
|
|
|
|
|
}
|
|
|
|
|
// let rows = getSelectRows();
|
|
|
|
|
// if (rows.length > 0) {
|
|
|
|
|
// const record = rows;
|
|
|
|
|
// openCompressFileModal(true, {
|
|
|
|
|
// tableData: getDataSource(),
|
|
|
|
|
// record,
|
|
|
|
|
// });
|
|
|
|
|
// } else {
|
|
|
|
|
// return createMessage.warn('请选择一个或者多个文件/文件夹压缩');
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
// 重命名
|
|
|
|
|
function renameRecord(record) {
|
|
|
|
@ -634,48 +707,42 @@
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 去重
|
|
|
|
|
function uniqueByKey(arrlist, record) {
|
|
|
|
|
let resultList: any = [];
|
|
|
|
|
arrlist.forEach((arr) => {
|
|
|
|
|
if (
|
|
|
|
|
arr.objectKey &&
|
|
|
|
|
!resultList.some((item) => item.objectKey === arr.objectKey) &&
|
|
|
|
|
arr.objectKey.includes('jpeg')
|
|
|
|
|
) {
|
|
|
|
|
// 保持顺序
|
|
|
|
|
if (record) {
|
|
|
|
|
if (
|
|
|
|
|
(arr.objectKey == record.objectKey && record.id == arr.id) ||
|
|
|
|
|
arr.objectKey != record.objectKey
|
|
|
|
|
) {
|
|
|
|
|
if (!arr.fileTags) {
|
|
|
|
|
arr.fileTags = [];
|
|
|
|
|
} else {
|
|
|
|
|
arr.fileTags = JSON.parse(arr.fileTags);
|
|
|
|
|
}
|
|
|
|
|
if (!arr.graffitiJson) {
|
|
|
|
|
arr.graffitiJson = [];
|
|
|
|
|
} else {
|
|
|
|
|
arr.graffitiJson = JSON.parse(arr.graffitiJson);
|
|
|
|
|
}
|
|
|
|
|
resultList.push(arr);
|
|
|
|
|
if (record.objectKey.includes('.jpeg')) {
|
|
|
|
|
arrlist
|
|
|
|
|
.filter((item) => item.objectKey && item.objectKey.includes('jpeg'))
|
|
|
|
|
.forEach((item) => {
|
|
|
|
|
if (!item.fileTags) {
|
|
|
|
|
item.fileTags = [];
|
|
|
|
|
} else {
|
|
|
|
|
item.fileTags = JSON.parse(item.fileTags);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (!arr.fileTags) {
|
|
|
|
|
arr.fileTags = [];
|
|
|
|
|
if (!item.graffitiJson) {
|
|
|
|
|
item.graffitiJson = [];
|
|
|
|
|
} else {
|
|
|
|
|
item.graffitiJson = JSON.parse(item.graffitiJson);
|
|
|
|
|
}
|
|
|
|
|
resultList.push(item);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (record.objectKey.includes('mp4')) {
|
|
|
|
|
arrlist
|
|
|
|
|
.filter((item) => item.objectKey && item.objectKey.includes('mp4'))
|
|
|
|
|
.forEach((item) => {
|
|
|
|
|
if (!item.fileTags) {
|
|
|
|
|
item.fileTags = [];
|
|
|
|
|
} else {
|
|
|
|
|
arr.fileTags = JSON.parse(arr.fileTags);
|
|
|
|
|
item.fileTags = JSON.parse(item.fileTags);
|
|
|
|
|
}
|
|
|
|
|
if (!arr.graffitiJson) {
|
|
|
|
|
arr.graffitiJson = [];
|
|
|
|
|
if (!item.graffitiJson) {
|
|
|
|
|
item.graffitiJson = [];
|
|
|
|
|
} else {
|
|
|
|
|
arr.graffitiJson = JSON.parse(arr.graffitiJson);
|
|
|
|
|
item.graffitiJson = JSON.parse(item.graffitiJson);
|
|
|
|
|
}
|
|
|
|
|
resultList.push(arr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
resultList.push(item);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
return resultList;
|
|
|
|
|
}
|
|
|
|
|
// 图片选择
|
|
|
|
@ -795,29 +862,47 @@
|
|
|
|
|
padding-left: 16px;
|
|
|
|
|
background: #ffffff;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: flex-start;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: flex-start;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.storeDivs {
|
|
|
|
|
.storeDivList {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
justify-content: flex-start;
|
|
|
|
|
align-items: flex-start;
|
|
|
|
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 566px;
|
|
|
|
|
height: 72.5%;
|
|
|
|
|
background: #ffffff;
|
|
|
|
|
margin: 0px 16px 16px 16px;
|
|
|
|
|
// gap: 20px;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
|
|
|
|
|
.storeDiv {
|
|
|
|
|
position: relative;
|
|
|
|
|
width: 160px;
|
|
|
|
|
height: 120px;
|
|
|
|
|
width: 165px;
|
|
|
|
|
height: 130px;
|
|
|
|
|
outline: 1px solid #000000;
|
|
|
|
|
margin: 16px;
|
|
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
|
|
|
|
.storeDivSpanName {
|
|
|
|
|
position: absolute;
|
|
|
|
|
bottom: 16px;
|
|
|
|
|
left: 0px;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 30px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
|
|
white-space: pre-wrap;
|
|
|
|
|
word-break: break-all;
|
|
|
|
|
overflow-wrap: break-word;
|
|
|
|
|
max-width: 100%;
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|