ow
This commit is contained in:
1 parent
2b963e4bfe
commit
501c92d87c
13 files changed
+2374
-322
No files matched your search
@@ -21,7 +21,7 @@
|
||||
@click="onDownload"></a-button>
|
||||
</a-tooltip>
|
||||
</a-col>
|
||||
<a-col :span="2" v-if="!isDirectorySelected && isSingleItem">
|
||||
<a-col :span="2" v-if="!isDirectorySelected && (isSingleItem || isSameMediaTypeSelected)">
|
||||
<a-tooltip title="共享">
|
||||
<a-button class="nav-btn" :icon="h(ShareAltOutlined)" @click="onShare"></a-button>
|
||||
</a-tooltip>
|
||||
@@ -46,7 +46,7 @@
|
||||
</a-popconfirm>
|
||||
</a-tooltip>
|
||||
</a-col>
|
||||
<a-col :span="2" v-if="!isDirectorySelected && isSingleItem">
|
||||
<a-col :span="2" v-if="!isDirectorySelected && (isSingleItem || isSameMediaTypeSelected)">
|
||||
<a-tooltip :title="publishTooltip">
|
||||
<a-button class="nav-btn" :icon="h(NotificationOutlined)" @click="onPublish"></a-button>
|
||||
</a-tooltip>
|
||||
@@ -109,6 +109,7 @@ import {
|
||||
} from "@ant-design/icons-vue";
|
||||
import { DmsFileUploadViewDisplayData } from "@/data/auto/dmsFileUploadViewDisplayData";
|
||||
import FileUpload from "@/components/basic/FileUpload.vue";
|
||||
import fileTypePolicy from "@/policy/custom/fileTypePolicy";
|
||||
|
||||
const props = defineProps<{
|
||||
selectedItems: DmsFileUploadViewDisplayData[];
|
||||
@@ -180,6 +181,29 @@ const isSingleAudio = computed(() => {
|
||||
return isSingleItem.value && isAudio(selectedOrderKey.value);
|
||||
});
|
||||
|
||||
/**
|
||||
* 识别媒体类型,兼顾本地扩展名判断与全局 fileTypePolicy,
|
||||
* 保证与发布时的类型判断一致。
|
||||
*/
|
||||
const mediaKind = (key: string): "image" | "video" | "audio" | "" => {
|
||||
if (isImage(key) || fileTypePolicy.isImage(key)) return "image";
|
||||
if (isVideo(key) || fileTypePolicy.isVideo(key)) return "video";
|
||||
if (isAudio(key) || fileTypePolicy.isAudio(key)) return "audio";
|
||||
return "";
|
||||
};
|
||||
|
||||
/**
|
||||
* 多选时选中项是否全部属于同一媒体类型(图片/视频/音频)。
|
||||
* 满足时允许批量共享与发布。
|
||||
*/
|
||||
const isSameMediaTypeSelected = computed(() => {
|
||||
const items = props.selectedItems;
|
||||
if (items.length <= 1) return false;
|
||||
const kinds = items.map((x) => mediaKind(x.OrderKey || x.OrgFileName || ""));
|
||||
const kind = kinds[0];
|
||||
return kind !== "" && kinds.every((k) => k === kind);
|
||||
});
|
||||
|
||||
const publishTooltip = computed(() => {
|
||||
if (isImage(selectedOrderKey.value)) return "发布相册";
|
||||
if (isVideo(selectedOrderKey.value)) return "发布影视专辑";
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -470,14 +470,4 @@ const { run, current, pageSize } = usePagination(queryData, {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.page-footer {
|
||||
z-index: 999;
|
||||
padding-left: 8px;
|
||||
padding-right: 18px;
|
||||
padding-top: 8px;
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
bottom: 8px;
|
||||
border-top: 1px solid silver;
|
||||
}
|
||||
</style>
|
||||
@@ -402,6 +402,11 @@ onMounted(() => {
|
||||
resizeObserver = new ResizeObserver(() => {
|
||||
void relayout();
|
||||
});
|
||||
// 弹窗形态未显式传 is-modal 时自动识别:位于 .ant-modal-body 内即按弹窗布局
|
||||
// 否则分页栏会按「页面模式」position:fixed 钉在视口底部,压住弹窗/页面 footer
|
||||
if (!isModal.value && searchRef.value?.closest(".ant-modal-body")) {
|
||||
isModal.value = true;
|
||||
}
|
||||
rebindObserver();
|
||||
void setupModalLayout();
|
||||
});
|
||||
@@ -647,17 +652,6 @@ const { run } = usePagination(queryData, {
|
||||
min-width: 120px;
|
||||
}
|
||||
|
||||
.page-footer {
|
||||
z-index: 999;
|
||||
padding-left: 8px;
|
||||
padding-right: 18px;
|
||||
padding-top: 8px;
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
bottom: 8px;
|
||||
border-top: 1px solid silver;
|
||||
}
|
||||
|
||||
/* ==================== 结果区:卡片列表 ==================== */
|
||||
.sc-list {
|
||||
overflow-x: hidden;
|
||||
|
||||
@@ -509,11 +509,10 @@ watch(current, async (t) => {
|
||||
}
|
||||
});
|
||||
|
||||
// 曲目从无到有时默认展开播放列表(对齐原 APlayer showList 的行为)
|
||||
// 播放列表默认收起,由用户点击列表按钮展开
|
||||
watch(
|
||||
() => tracks.value.length,
|
||||
(n, o) => {
|
||||
if (n > 0 && !o) showList.value = true;
|
||||
(n) => {
|
||||
if (index.value >= n) index.value = 0;
|
||||
}
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user