This commit is contained in:
itcsx committed 2026-09-05 23:08:56 +08:00
1 parent 6d68eb11b7
commit 67c632715b
29 files changed
+2801 -739

No files matched your search

@@ -76,34 +76,19 @@ namespace CloudBuilder.Master.Service
if (data.Details != null && data.Details.Length > 0)
{
var webRootPath = service.Configuration[ServiceSettingsPolicy.RequestPath];
var phy = service.Configuration[ServiceSettingsPolicy.PhysicalFileDirectory];
var scale = service.Configuration[ServiceSettingsPolicy.DmsFileScaleDirectory].Replace(phy, "");
foreach (var item in data.Details)
{
if (!string.IsNullOrEmpty(item.Pic) && FileTypePolicy.GetType(item.Pic!) == FileTypePolicy.PHOTO)
{
var fileExtension = Path.GetExtension(item.Pic);
var filePathRel = Path.Combine(scale, item.CreatedBy, fileExtension.Replace(".", ""), "");
var filePath = filePathRel.Replace(Path.DirectorySeparatorChar, '/');
item.FormattedPic = service.Configuration[AppsettingsPolicy.ApplicationUrl] + webRootPath + filePath + item.Pic;
item.FormattedPic = item.FormattedPic = FileTypePolicy.PackUrl(service, item.CreatedBy, item.Pic, YesNoPolicy.NO);
}
if (!string.IsNullOrEmpty(item.Url) && FileTypePolicy.GetType(item.Url!) == FileTypePolicy.AUDIO)
{
var fileExtension = Path.GetExtension(item.Url);
var backup = service.Configuration[ServiceSettingsPolicy.DmsFileBackupDirectory].Replace(phy, "");
var filePathRel = Path.Combine(backup, item.CreatedBy, fileExtension.Replace(".", ""), "");
var filePath = filePathRel.Replace(Path.DirectorySeparatorChar, '/');
item.FormattedUrl = service.Configuration[AppsettingsPolicy.ApplicationUrl] + webRootPath + filePath + item.Url;
item.FormattedUrl = FileTypePolicy.PackUrl(service, item.CreatedBy, item.Url, YesNoPolicy.NO);
}
if (!string.IsNullOrEmpty(item.Lrc) && FileTypePolicy.GetType(item.Lrc!) == FileTypePolicy.LYRIC)
{
var fileExtension = Path.GetExtension(item.Lrc);
var upload = service.Configuration[ServiceSettingsPolicy.DmsFileUploadDirectory].Replace(phy, "");
var filePathRel = Path.Combine(upload, item.CreatedBy, fileExtension.Replace(".", ""), "");
var filePath = filePathRel.Replace(Path.DirectorySeparatorChar, '/');
item.FormattedLrc = service.Configuration[AppsettingsPolicy.ApplicationUrl] + webRootPath + filePath + item.Lrc;
item.FormattedLrc = FileTypePolicy.PackUrl(service, item.CreatedBy, item.Lrc, YesNoPolicy.NO);
}
}
@@ -80,13 +80,18 @@ namespace CloudBuilder.Master.Service
if (data.Details != null || data.Details.Length > 0)
foreach (var item in data.Details)
{
item.FileName = (isAttached ? service.Configuration[AppsettingsPolicy.ApplicationUrl] : "") + item.FileName;
item.FileName = PackImageFileName(isAttached, item.FileName);
}
return data;
}
private string PackImageFileName(bool isAttached,string fileName)
{
return (isAttached ? service.Configuration[AppsettingsPolicy.ApplicationUrl] : "")
+ fileName?.Replace("\\", "/");
}
[PermissionOperate(name: MasterPermissionPolicy.PublishPhoto, operate: Operate.Find)]
public PublishPhotoResultData FindBySearchCriteria(PublishPhotoSearchCriteria criteria)
@@ -352,7 +357,7 @@ namespace CloudBuilder.Master.Service
{
if (item.FileName.ToLower().StartsWith("http")) continue;
item.FileName = (isAttached ? service.Configuration[AppsettingsPolicy.ApplicationUrl] : "") + item.FileName;
item.FileName = PackImageFileName(isAttached, item.FileName);
}
return dtls;
@@ -416,12 +421,12 @@ namespace CloudBuilder.Master.Service
var webRootPath = service.Configuration[ServiceSettingsPolicy.RequestPath];
var phy = service.Configuration[ServiceSettingsPolicy.PhysicalFileDirectory];
var scale = service.Configuration[ServiceSettingsPolicy.DmsFileScaleDirectory].Replace(phy, "");
var backup = service.Configuration[ServiceSettingsPolicy.DmsFileBackupDirectory].Replace(phy, "").Substring(1);
var fileExtension = Path.GetExtension(dmsFile.OrderKey);
var filePathRel = Path.Combine(scale, dmsFile.CreatedBy, fileExtension.Replace(".", ""), "");
var filePath = filePathRel.Replace(Path.DirectorySeparatorChar, '/');
string path = Path.Combine(webRootPath, filePathRel, dmsFile.OrderKey);
var filePathRel = Path.Combine(webRootPath.Substring(1), backup, dmsFile.CreatedBy, fileExtension.Replace(".", ""), "");
var filePath = '/'+filePathRel.Replace(Path.DirectorySeparatorChar, '/');
string path = Path.Combine(filePath, dmsFile.OrderKey);
PublishPhotoDetailEntity[] dtls = repositoryPublishPhotoDetail.DetachedEntities.Where(x => x.PublishName == publishName).ToArray();
@@ -80,7 +80,7 @@ namespace CloudBuilder.Security.Policy
var phy = service.Configuration[ServiceSettingsPolicy.PhysicalFileDirectory] ?? "";
var fileExtension = Path.GetExtension(orderKey);//获取文件格式,拓展名
if (GetType(orderKey!) == FileTypePolicy.PHOTO)
if (GetType(orderKey!) == PHOTO)
{
if (transcodeIndc == YesNoPolicy.YES)
{
@@ -98,14 +98,14 @@ namespace CloudBuilder.Security.Policy
url = service.Configuration[AppsettingsPolicy.ApplicationUrl] + webRootPath + filePath + orderKey;
}
}
else if (GetType(orderKey!) == FileTypePolicy.AUDIO)
else if (GetType(orderKey!) == AUDIO)
{
var backup = (service.Configuration[ServiceSettingsPolicy.DmsFileBackupDirectory] ?? "").Replace(phy ?? "", "");
var filePathRel = Path.Combine(backup, createdBy, fileExtension.Replace(".", ""), "");
var filePath = filePathRel.Replace(Path.DirectorySeparatorChar, '/') + "/";
url = service.Configuration[AppsettingsPolicy.ApplicationUrl] + webRootPath + filePath + orderKey;
}
else if (GetType(orderKey!) == FileTypePolicy.VIDEO)
else if (GetType(orderKey!) == VIDEO)
{
if (transcodeIndc == YesNoPolicy.YES)
{
@@ -122,6 +122,13 @@ namespace CloudBuilder.Security.Policy
url = service.Configuration[AppsettingsPolicy.ApplicationUrl] + webRootPath + filePath + orderKey;
}
}
else if (GetType(orderKey!) == LYRIC)
{
var upload = service.Configuration[ServiceSettingsPolicy.DmsFileUploadDirectory].Replace(phy, "");
var filePathRel = Path.Combine(upload, createdBy, fileExtension.Replace(".", ""), "");
var filePath = filePathRel.Replace(Path.DirectorySeparatorChar, '/') + "/";
url = service.Configuration[AppsettingsPolicy.ApplicationUrl] + webRootPath + filePath + orderKey;
}
return url;
}
public static string PackSourceVideoUrl(IApplicationService service, string createdBy, string orderKey)
+416
View File
@@ -0,0 +1,416 @@
<template>
<div class="my-computer" ref="containerRef">
<div class="my-computer-header">
<a-checkbox :checked="isAllChecked" :indeterminate="isIndeterminate" @change="onToggleSelectAll">全选</a-checkbox>
<div class="view-toggles">
<a-tooltip title="列表视图">
<a-button size="small" :type="viewMode === 'list' ? 'primary' : 'default'" @click="viewMode = 'list'">
<UnorderedListOutlined />
</a-button>
</a-tooltip>
<a-tooltip title="图标视图">
<a-button size="small" :type="viewMode === 'icon' ? 'primary' : 'default'" @click="viewMode = 'icon'">
<AppstoreOutlined />
</a-button>
</a-tooltip>
</div>
</div>
<div class="my-computer-body" v-if="viewMode === 'icon'">
<div v-for="record in datas" :key="record.FileId + '-' + record.FileName" class="file-card-wrapper"
@click="onCardClick(record)" @dblclick="onCardDblClick(record)">
<div class="file-checkbox-wrapper">
<a-checkbox :checked="isSelected(record)" @click.stop="toggleSelect(record)" />
</div>
<div class="file-content">
<template v-if="record.IsDirectoryIndc == 'Y'">
<div class="folder-icon">
<FolderOutlined />
</div>
<div class="file-name" :title="record.OrgFileName">{{ record.OrgFileName }}</div>
</template>
<template v-else-if="isImage(record.OrderKey)">
<div class="image-thumb">
<img :src="record.Url" :title="record.OrgFileName" @click.stop="$emit('preview-image', record)" />
</div>
<div class="file-name" :title="record.OrgFileName">{{ record.OrgFileName }}</div>
</template>
<template v-else-if="isVideo(record.OrderKey)">
<div class="video-thumb">
<img :src="record.FormattedPic.replace('.m3u8', '.png')" :title="record.OrgFileName" />
<div class="play-overlay">
<PlayCircleOutlined />
</div>
</div>
<div class="file-name" :title="record.OrgFileName">{{ record.OrgFileName }}</div>
</template>
<template v-else-if="isAudio(record.OrderKey)">
<div class="audio-icon" :class="{ playing: record.IsPlay == 'Y' && record.IsPause != 'Y' }">
<cust-icon-font size="54" type="icon-playmp3" style="color: #ff7878" />
</div>
<div class="file-name" :title="record.OrgFileName">{{ record.OrgFileName }}</div>
</template>
<template v-else>
<div class="file-icon">
<FileOutlined />
</div>
<div class="file-name" :title="record.OrgFileName">{{ record.OrgFileName }}</div>
</template>
</div>
</div>
<a-empty v-if="!datas || datas.length === 0" description="暂无文件" />
</div>
<div class="my-computer-body list-body" v-else>
<div v-for="record in datas" :key="record.FileId + '-' + record.FileName" class="list-item"
:class="{ selected: isSelected(record) }" @click="onCardClick(record)" @dblclick="onCardDblClick(record)">
<a-checkbox :checked="isSelected(record)" @click.stop="toggleSelect(record)" />
<div class="list-icon">
<template v-if="record.IsDirectoryIndc == 'Y'">
<FolderOutlined style="color: #faad14" />
</template>
<template v-else-if="isImage(record.OrderKey)">
<FileImageOutlined style="color: #52c41a" />
</template>
<template v-else-if="isVideo(record.OrderKey)">
<VideoCameraOutlined style="color: #1890ff" />
</template>
<template v-else-if="isAudio(record.OrderKey)">
<PlayCircleOutlined style="color: #eb2f96" />
</template>
<template v-else>
<FileOutlined style="color: #8c8c8c" />
</template>
</div>
<div class="list-name" :title="record.OrgFileName">{{ record.OrgFileName }}</div>
<div class="list-size">{{ formatSize(record.FileSize) }}</div>
<div class="list-date">{{ formatDate(record.CreatedDatetime) }}</div>
</div>
<a-empty v-if="!datas || datas.length === 0" description="暂无文件" />
</div>
</div>
</template>
<script setup lang="ts">
import { ref, computed } from "vue";
import {
FolderOutlined,
FileOutlined,
FileImageOutlined,
VideoCameraOutlined,
PlayCircleOutlined,
UnorderedListOutlined,
AppstoreOutlined,
} from "@ant-design/icons-vue";
import { DmsFileUploadViewDisplayData } from "@/data/auto/dmsFileUploadViewDisplayData";
const props = defineProps<{
datas: DmsFileUploadViewDisplayData[];
selectedKeys: DmsFileUploadViewDisplayData[];
}>();
const emit = defineEmits([
"update:selectedKeys",
"select-change",
"open-folder",
"open-file",
"preview-image",
]);
const viewMode = ref<"icon" | "list">("icon");
const isAllChecked = computed(() => {
if (!props.datas || props.datas.length === 0) return false;
return props.datas.every((d) => props.selectedKeys.some((s) => s.FileId === d.FileId));
});
const isIndeterminate = computed(() => {
if (!props.datas || props.datas.length === 0) return false;
const checkedCount = props.datas.filter((d) =>
props.selectedKeys.some((s) => s.FileId === d.FileId),
).length;
return checkedCount > 0 && checkedCount < props.datas.length;
});
const isSelected = (record: DmsFileUploadViewDisplayData) => {
return props.selectedKeys.some((s) => s.FileId === record.FileId);
};
const toggleSelect = (record: DmsFileUploadViewDisplayData) => {
let newKeys: DmsFileUploadViewDisplayData[];
if (isSelected(record)) {
newKeys = props.selectedKeys.filter((s) => s.FileId !== record.FileId);
} else {
newKeys = [...props.selectedKeys, record];
}
emit("update:selectedKeys", newKeys);
emit("select-change", newKeys);
};
const onToggleSelectAll = (e: any) => {
if (e.target.checked) {
emit("update:selectedKeys", [...props.datas]);
emit("select-change", [...props.datas]);
} else {
emit("update:selectedKeys", []);
emit("select-change", []);
}
};
const onCardClick = (record: DmsFileUploadViewDisplayData) => {
toggleSelect(record);
};
const onCardDblClick = (record: DmsFileUploadViewDisplayData) => {
if (record.IsDirectoryIndc == "Y") {
emit("open-folder", record);
} else {
emit("open-file", record);
}
};
const isImage = (key: string) => {
if (!key) return false;
return /\.(png|jpe?g|gif|bmp|webp)$/i.test(key);
};
const isVideo = (key: string) => {
if (!key) return false;
return /\.(mp4|m3u8|rm|mpeg|mov|wmv|avi)$/i.test(key);
};
const isAudio = (key: string) => {
if (!key) return false;
return /\.(mp3|wav|flac|aac|ogg|wma)$/i.test(key);
};
const formatSize = (size: number) => {
size = size * 1024;
if (!size) return "-";
if (size < 1024) return size + " B";
if (size < 1024 * 1024) return (size / 1024).toFixed(1) + " KB";
if (size < 1024 * 1024 * 1024)
return (size / 1024 / 1024).toFixed(1) + " MB";
return (size / 1024 / 1024 / 1024).toFixed(2) + " GB";
};
const formatDate = (date: any) => {
if (!date) return "-";
const d = new Date(date);
if (isNaN(d.getTime())) return "-";
return (
d.getFullYear() +
"-" +
String(d.getMonth() + 1).padStart(2, "0") +
"-" +
String(d.getDate()).padStart(2, "0") +
" " +
String(d.getHours()).padStart(2, "0") +
":" +
String(d.getMinutes()).padStart(2, "0")
);
};
</script>
<style scoped>
.my-computer {
padding: 8px;
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
overflow: hidden;
}
.my-computer-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 4px;
border-bottom: 1px solid #f0f0f0;
margin-bottom: 8px;
}
.view-toggles {
display: flex;
gap: 4px;
}
.my-computer-body {
flex: 1;
overflow-y: auto;
padding: 4px;
display: flex;
flex-wrap: wrap;
align-content: flex-start;
gap: 16px;
}
.my-computer-body.list-body {
flex-wrap: nowrap;
flex-direction: column;
gap: 0;
}
.file-card-wrapper {
width: 120px;
display: flex;
flex-direction: column;
align-items: center;
cursor: pointer;
padding: 8px;
border-radius: 6px;
transition: all 0.2s;
position: relative;
}
.file-card-wrapper:hover {
background: #f5f5f5;
}
.file-checkbox-wrapper {
position: absolute;
top: 2px;
left: 4px;
z-index: 1;
}
.file-content {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
}
.folder-icon,
.file-icon,
.audio-icon {
font-size: 56px;
color: #faad14;
display: flex;
align-items: center;
justify-content: center;
width: 80px;
height: 80px;
}
.file-icon {
color: #8c8c8c;
}
.audio-icon {
color: #eb2f96;
}
.audio-icon.playing {
animation: rotate 2s linear infinite;
}
@keyframes rotate {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.image-thumb,
.video-thumb {
width: 100px;
height: 100px;
border-radius: 4px;
overflow: hidden;
position: relative;
background: #f0f0f0;
}
.image-thumb img,
.video-thumb img {
width: 100%;
height: 100%;
object-fit: cover;
}
.video-thumb .play-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: center;
background: rgba(0, 0, 0, 0.2);
font-size: 36px;
color: #fff;
opacity: 0;
transition: opacity 0.2s;
}
.video-thumb:hover .play-overlay {
opacity: 1;
}
.file-name {
font-size: 12px;
margin-top: 4px;
text-align: center;
max-width: 110px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.list-item {
display: flex;
align-items: center;
padding: 8px 12px;
border-bottom: 1px solid #f0f0f0;
cursor: pointer;
border-radius: 4px;
transition: background 0.15s;
gap: 12px;
}
.list-item:hover {
background: #f5f5f5;
}
.list-item.selected {
background: #e6f4ff;
}
.list-icon {
font-size: 20px;
width: 28px;
display: flex;
justify-content: center;
}
.list-name {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.list-size,
.list-date {
color: #8c8c8c;
font-size: 13px;
width: 120px;
text-align: right;
}
.list-date {
width: 160px;
}
</style>
@@ -0,0 +1,257 @@
<template>
<div class="operator-station">
<div class="operator-group main-actions">
<a-tooltip title="新增文件夹">
<a-button type="primary" v-if="canCreate" :icon="h(FolderAddOutlined)"
@click="$emit('create-folder')">新增文件夹</a-button>
</a-tooltip>
<a-tooltip title="上传文件">
<a-button type="primary" v-if="canCreate" :icon="h(UploadOutlined)" @click="triggerUpload">上传</a-button>
</a-tooltip>
</div>
<a-divider type="vertical" v-if="hasSelection" />
<div class="operator-group selection-actions" v-if="hasSelection">
<template v-if="!isDirectorySelected && isSingleItem">
<a-tooltip title="下载">
<a-button type="text" :icon="h(DownloadOutlined)" :disabled="!canAmend" @click="onDownload" >下载</a-button>
</a-tooltip>
<a-tooltip title="共享">
<a-button type="text" :icon="h(ShareAltOutlined)" @click="onShare">共享</a-button>
</a-tooltip>
<a-tooltip :title="publishTooltip">
<a-button type="text" :icon="h(NotificationOutlined)" @click="onPublish" >{{ publishTooltip }}</a-button>
</a-tooltip>
<a-tooltip :title="previewTooltip">
<a-button type="text" :icon="h(UnorderedListOutlined)" @click="onViewPreview" >{{ previewTooltip }}</a-button>
</a-tooltip>
<template v-if="isSingleVideo">
<a-tooltip title="播放">
<a-button type="text" :icon="h(PlayCircleOutlined, { style: { color: 'red' } })" @click="onPlayVideo" >播放</a-button>
</a-tooltip>
</template>
<template v-if="isSingleAudio">
<a-tooltip v-if="selectedItem.IsPlay != 'Y'" title="播放">
<a-button type="text" :icon="h(PlayCircleOutlined, { style: { color: 'red' } })" @click="onPlayAudio" >播放</a-button>
</a-tooltip>
<a-tooltip v-else-if="selectedItem.IsPause != 'Y'" title="暂停">
<a-button type="text" :icon="h(PauseCircleOutlined)" @click="onPauseAudio" >暂停</a-button>
</a-tooltip>
<a-tooltip v-else title="继续">
<a-button type="text" :icon="h(PlayCircleOutlined, { style: { color: 'red' } })" @click="onContinueAudio" >继续</a-button>
</a-tooltip>
</template>
</template>
</div>
<a-divider type="vertical" v-if="hasSelection" />
<div class="operator-group more-actions">
<a-dropdown>
<a-button>
更多
<DownOutlined />
</a-button>
<template #overlay>
<a-menu>
<a-menu-item key="preview" v-if="isImage(selectedOrderKey) && isSingleItem" :disabled="!canAmend" @click="$emit('preview', selectedItems)">
<EyeOutlined /> 预览
</a-menu-item>
<a-menu-item key="rename" v-if="isSingleItem" :disabled="!canAmend" @click="$emit('rename', selectedItems)">
<EditOutlined /> 重命名
</a-menu-item>
<a-menu-item key="move" v-if="isSingleItem" :disabled="!canView" @click="$emit('move', selectedItems)">
<ScissorOutlined /> 移动
</a-menu-item>
<a-menu-divider />
<a-menu-item key="delete":disabled="!canDelete" @click="$emit('delete', selectedItems)">
<DeleteOutlined /> 删除
</a-menu-item>
</a-menu>
</template>
</a-dropdown>
</div>
<div style="display: none">
<a-upload v-if="canCreate" v-model:file-list="fileList" name="file" :before-upload="onBeforeUpload"
:headers="headers" :show-upload-list="false" :action="uploadUrl" ref="uploadRef">
</a-upload>
</div>
</div>
</template>
<script setup lang="ts">
import { computed, ref, h } from "vue";
import {
UploadOutlined,
FolderAddOutlined,
DownloadOutlined,
ShareAltOutlined,
NotificationOutlined,
UnorderedListOutlined,
PlayCircleOutlined,
PauseCircleOutlined,
EyeOutlined,
EditOutlined,
ScissorOutlined,
DeleteOutlined,
DownOutlined,
} from "@ant-design/icons-vue";
import { DmsFileUploadViewDisplayData } from "@/data/auto/dmsFileUploadViewDisplayData";
import type { UploadProps } from "ant-design-vue";
const props = defineProps<{
selectedItems: DmsFileUploadViewDisplayData[];
uploadUrl: string;
headers: any;
canCreate: boolean;
canAmend: boolean;
canDelete: boolean;
canView: boolean;
}>();
const emit = defineEmits([
"create-folder",
"before-upload",
"download",
"share",
"publish",
"view-preview",
"play-video",
"play-audio",
"pause-audio",
"continue-audio",
"preview",
"rename",
"move",
"delete",
]);
const fileList = ref<UploadProps["fileList"]>([]);
const uploadRef = ref<any>(null);
const hasSelection = computed(() => props.selectedItems.length > 0);
const isDirectorySelected = computed(() =>
props.selectedItems.some((s) => s.IsDirectoryIndc == "Y"),
);
const isSingleItem = computed(() => props.selectedItems.length === 1);
const selectedItem = computed(() => {
return props.selectedItems[0] || ({} as DmsFileUploadViewDisplayData);
});
const selectedOrderKey = computed(() => {
return selectedItem.value?.OrderKey || selectedItem.value?.OrgFileName || "";
});
const isImage = (key: string) => {
if (!key) return false;
return /\.(png|jpe?g|gif|bmp|webp)$/i.test(key);
};
const isVideo = (key: string) => {
if (!key) return false;
return /\.(mp4|m3u8|rm|mpeg|mov|wmv|avi)$/i.test(key);
};
const isAudio = (key: string) => {
if (!key) return false;
return /\.(mp3|wav|flac|aac|ogg|wma)$/i.test(key);
};
const isSingleVideo = computed(() => {
return isSingleItem.value && isVideo(selectedOrderKey.value);
});
const isSingleAudio = computed(() => {
return isSingleItem.value && isAudio(selectedOrderKey.value);
});
const publishTooltip = computed(() => {
if (isImage(selectedOrderKey.value)) return "发布相册";
if (isVideo(selectedOrderKey.value)) return "发布影视专辑";
if (isAudio(selectedOrderKey.value)) return "发布音乐专辑";
return "发布";
});
const previewTooltip = computed(() => {
if (isImage(selectedOrderKey.value)) return "相册展览";
if (isVideo(selectedOrderKey.value)) return "影视厅播放";
if (isAudio(selectedOrderKey.value)) return "音乐厅播放";
return "预览";
});
const triggerUpload = () => {
uploadRef.value?.$el?.querySelector("input")?.click();
};
const onBeforeUpload: UploadProps["beforeUpload"] = (file) => {
emit("before-upload", file);
return false;
};
const onDownload = () => {
emit("download", props.selectedItems);
};
const onShare = () => {
emit("share", props.selectedItems);
};
const onPublish = () => {
emit("publish", props.selectedItems);
};
const onViewPreview = () => {
emit("view-preview", props.selectedItems);
};
const onPlayVideo = () => {
emit("play-video", selectedItem.value);
};
const onPlayAudio = () => {
emit("play-audio", selectedItem.value);
};
const onPauseAudio = () => {
emit("pause-audio", selectedItem.value);
};
const onContinueAudio = () => {
emit("continue-audio", selectedItem.value);
};
</script>
<style scoped>
.operator-station {
display: flex;
align-items: center;
padding: 6px 12px;
background: #fafafa;
border-bottom: 1px solid #e8e8e8;
gap: 8px;
flex-wrap: wrap;
}
.operator-group {
display: flex;
align-items: center;
gap: 4px;
}
.main-actions :deep(.ant-btn) {
height: 32px;
}
.selection-actions :deep(.ant-btn) {
padding: 4px 8px;
font-size: 16px;
}
</style>
+1 -1
View File
@@ -162,7 +162,7 @@ const paginationJ = ref(props["pagination"]);
const rowSelectionType = ref(props["rowSelectionType"]);
const tableY = ref(props["scrolly"]);
const enquiry = inject(enquiryMethodKey);
const enquiry = inject(enquiryMethodKey, undefined);
const datas = enquiry?.getDatas()!;
+179
View File
@@ -0,0 +1,179 @@
<template>
<div class="toolbar">
<div class="toolbar-left">
<a-tooltip title="返回顶层">
<a-button
type="text"
class="nav-btn"
:disabled="!canGoTop"
@click="$emit('go-top')"
>
<HomeOutlined />
</a-button>
</a-tooltip>
<a-tooltip title="返回上层">
<a-button
type="text"
class="nav-btn"
:disabled="!canGoBack"
@click="$emit('go-back')"
>
<ArrowLeftOutlined />
</a-button>
</a-tooltip>
<a-tooltip title="刷新">
<a-button
type="text"
class="nav-btn"
:loading="loading"
@click="$emit('refresh')"
>
<ReloadOutlined />
</a-button>
</a-tooltip>
</div>
<div class="toolbar-center">
<a-breadcrumb class="breadcrumb">
<a-breadcrumb-item
v-for="(item, index) in breadcrumbItems"
:key="index"
@click="onBreadcrumbClick(item, index)"
:class="{ clickable: index < breadcrumbItems.length - 1 }"
>
<template v-if="index === 0">
<LaptopOutlined style="margin-right: 4px" />
</template>
<span :style="{ cursor: index < breadcrumbItems.length - 1 ? 'pointer' : 'default',
color: index < breadcrumbItems.length - 1 ? '#1677ff' : '' }">{{ item.displayName }}</span>
</a-breadcrumb-item>
</a-breadcrumb>
</div>
<div class="toolbar-right">
<a-input-search
v-model:value="searchKeyword"
placeholder="搜索文件名称"
allow-clear
style="width: 240px"
@search="onSearch"
@pressEnter="onSearch"
>
<template #prefix>
<SearchOutlined />
</template>
</a-input-search>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, computed, watch } from "vue";
import {
HomeOutlined,
ArrowLeftOutlined,
ReloadOutlined,
LaptopOutlined,
SearchOutlined,
} from "@ant-design/icons-vue";
interface BreadcrumbItem {
value: string;
displayName: string;
}
const props = defineProps<{
pathStack: BreadcrumbItem[];
rootPath: string;
loading: boolean;
}>();
const emit = defineEmits([
"go-top",
"go-back",
"refresh",
"search",
"breadcrumb-click",
]);
const searchKeyword = ref("");
const canGoTop = computed(() => {
return props.pathStack.length > 1;
});
const canGoBack = computed(() => {
return props.pathStack.length > 1;
});
const breadcrumbItems = computed(() => {
return props.pathStack;
});
const onSearch = () => {
emit("search", searchKeyword.value);
};
const onBreadcrumbClick = (item: BreadcrumbItem, index: number) => {
emit("breadcrumb-click", item, index);
};
</script>
<style lang="less">
.toolbar {
display: flex;
align-items: center;
padding: 6px 12px;
background: #fafafa;
border-bottom: 1px solid #e8e8e8;
gap: 12px;
}
.toolbar-left {
display: flex;
gap: 2px;
flex-shrink: 0;
}
.nav-btn {
width: 36px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
}
.nav-btn:hover:not(:disabled) {
background: #e6f4ff;
color: #1677ff;
}
.nav-btn:disabled {
color: #bfbfbf;
}
.toolbar-center {
flex: 1;
overflow: hidden;
}
.breadcrumb {
margin: 0;
font-size: 14px;
}
.breadcrumb-item.clickable {
cursor: pointer;
}
.breadcrumb-item.clickable:hover {
color: #1677ff;
}
.toolbar-right {
flex-shrink: 0;
}
</style>
@@ -11,6 +11,9 @@ export class OperationToEnquiryModelOption {
public isModalFunction?: boolean = false;
public isModalTree?: boolean = false; //家谱树查询
public isModalPerson?: boolean = false; //族员人员查询
public isModalPhoto?: boolean = false;
public isModalVideo?: boolean = false;
public isModalAudio?: boolean = false;
public initBindOptionsUser?: BindOption[] = []; //初始化查询条件的值
public initBindOptionsGroup?: BindOption[] = [];
public initBindOptionsActor?: BindOption[] = [];
+1 -1
View File
@@ -14,7 +14,7 @@ provide(
}
);
# 子组件:
const actorOperationMethod = inject(operationToEnquiryMethodKey);
const actorOperationMethod =inject(operationToEnquiryMethodKey, undefined);
const modelOption = actorOperationMethod?.getOperationToEnquiryModelOption() as OperationToEnquiryModelOption;
const isModal = ref(modelOption ? modelOption.isModalActor : false);
+20 -9
View File
@@ -1,6 +1,6 @@
<template>
<a-spin size="large" :spinning="state.loading">
<a-modal v-model:open="props.showModel" title="修改用户名称" @cancel="emit('update:showModel', false)"
<a-modal v-model:open="innerShow" title="修改用户名称" @cancel="emit('update:showModel', false)"
@ok="handleSubmit">
<a-form name="basic" autocomplete="off" :label-col="{ span: 8 }" :rules="rules" :model="state.data"
ref="formRef">
@@ -38,15 +38,26 @@ const state = reactive({
});
const props = defineProps(['showModel']);
const emit = defineEmits(['update:showModel']);
computed({
get() {
return props.showModel;
},
set(value) {
emit('update:showModel', value);
}
const emit = defineEmits<{
"update:showModel": [val: boolean];
}>();
// ✅ 内部代理变量,避开直接修改props只读对象
const innerShow = ref(false);
// props改变同步到内部变量(父组件打开弹窗时同步)
watch(
() => props.showModel,
(val) => {
innerShow.value = val;
},
{ immediate: true }
);
// 内部弹窗状态变化,通知父组件更新props
watch(innerShow, (val) => {
emit("update:showModel", val);
});
const validatePass = async (_rule: Rule, value: string) => {
+15 -9
View File
@@ -1,6 +1,6 @@
<template>
<a-spin size="large" :spinning="state.loading">
<a-modal v-model:open="props.showModel" :title="t('login.changePassword.changePassword')"
<a-modal v-model:open="innerShow" :title="t('login.changePassword.changePassword')"
@cancel="emit('update:showModel', false)" @ok="handleSubmit">
<a-form name="basic" autocomplete="off" :label-col="{ span: 8 }" :rules="rules" :model="state.LoginData"
ref="formRef">
@@ -59,16 +59,22 @@ const state = reactive({
});
const props = defineProps(['showModel']);
const emit = defineEmits(['update:showModel']);
computed({
get() {
return props.showModel;
const emit = defineEmits<{
"update:showModel": [val: boolean];
}>();
// ✅ 内部代理变量,避开直接修改props只读对象
const innerShow = ref(false);
// props改变同步到内部变量(父组件打开弹窗时同步)
watch(
() => props.showModel,
(val) => {
innerShow.value = val;
},
set(value) {
emit('update:showModel', value);
}
});
{ immediate: true }
);
const validatePass = async (_rule: Rule, value: string) => {
if (value !== state.LoginData.UserPassword) {
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -630,7 +630,7 @@ onMounted(async () => {
const onViewPreview = async () => {
router.push({
name: "Previews",
name: "Preview",
params: { id: currentFamilyName.value, mode: "view" },
});
};
@@ -123,7 +123,7 @@ import {
} from "@/injections";
//page from-----------------------------------------------------------------------------------------------------------------------------------
//================inject================
const actorOperationMethod = inject(operationToEnquiryMethodKey);
const actorOperationMethod = inject(operationToEnquiryMethodKey, undefined);
const modelOption =
actorOperationMethod?.getOperationToEnquiryModelOption() as OperationToEnquiryModelOption;
@@ -68,7 +68,7 @@ import { SearchCriteriaContext } from "@/injections";
//报表名称(layout)
const layoutProviderMethod = inject(layoutProviderMethodKey);
const actorOperationMethod = inject(operationToEnquiryMethodKey);
const actorOperationMethod =inject(operationToEnquiryMethodKey, undefined);
const modelOption = actorOperationMethod?.getOperationToEnquiryModelOption() as OperationToEnquiryModelOption;
const isModal = ref(modelOption ? modelOption.isModalTree : false);
File diff suppressed because it is too large. Load diff
@@ -8,7 +8,7 @@
</template>
<template #bodyCell="{ column, record, index }">
<template v-if="column.dataIndex === PublishAudioEntity.PUBLISH_NAME">
<a-button type="link" block @click.prevent="onViewAudioPreview">{{ record.PublishName }}</a-button>
<a-button type="link" block @click.prevent="onViewPreviewAudio">{{ record.PublishName }}</a-button>
</template>
<template v-else-if="column.dataIndex === PublishAudioEntity.DEFAULT_INDC">
<template v-if="record.DefaultIndc == 'Y'">
@@ -29,7 +29,7 @@
:disabled="!(keys && keys.length > 0)" @click.prevent="onAmend">修改</a-button>
<a-button type="primary" v-if="canView" :icon="h(FileTextOutlined)"
:disabled="!(keys && keys.length > 0)"
@click.prevent="onViewAudioPreview">音乐厅</a-button>
@click.prevent="onViewPreviewAudio">音乐厅</a-button>
</a-space>
</a-row>
</a-col>
@@ -200,9 +200,9 @@ const onReset = (() => {
result.value.Total = 0;
})
const onViewAudioPreview = (() => {
const onViewPreviewAudio = (() => {
if (keys.value.length == 0) return;
router.push({ name: "AudioPreviews", params: { id: keys.value[0].PublishName, mode: 'view' } });
router.push({ name: "PreviewAudio", params: { id: keys.value[0].PublishName, mode: 'view' } });
})
const onCreate = (() => {
@@ -247,7 +247,7 @@
:disabled="!hasData" v-if="canDelete">删除</a-button>
</a-popconfirm>
<a-button type="primary" v-if="canAmend" :icon="h(EditOutlined)"
:disabled="!hasData" @click.prevent="onViewAudioPreview">音乐厅</a-button>
:disabled="!hasData" @click.prevent="onViewPreviewAudio">音乐厅</a-button>
</a-space>
</a-row>
</div>
@@ -376,7 +376,7 @@ const columnDtls = ref([
]);
//================provide================
//弹出(Function Modal)
provide("isModalAudioPublish", showModal);
provide("isModalPublishAudio", showModal);
//记录单选还是多选(Modal)
provide("selectionTypeAudioPublish", rowSelectionType);
//初始化查询条件的值(Modal)
@@ -515,8 +515,8 @@ const onReset = (() => {
const onViewAudioPreview = (async () => {
router.push({ name: "AudioPreviews", params: { id: data.value.PublishAudio.PublishName, mode: 'view' } });
const onViewPreviewAudio = (async () => {
router.push({ name: "PreviewAudio", params: { id: data.value.PublishAudio.PublishName, mode: 'view' } });
})
const onCreate = (() => {
@@ -202,7 +202,7 @@ const onReset = (() => {
const onViewPreview = (() => {
if (keys.value.length == 0) return;
router.push({ name: "Previews", params: { id: keys.value[0].PublishName, mode: 'view' } });
router.push({ name: "Preview", params: { id: keys.value[0].PublishName, mode: 'view' } });
})
const onCreate = (() => {
@@ -181,13 +181,12 @@
</template>
</a-card-meta>
<template #actions>
<span v-if="isEdit">
<span v-if="isEdit" @click="upSon(datas.index)">
<UpSquareTwoTone
:style="{ fontSize: '24px', color: '#08c' }"
@click="upSon(datas.index)"
/>上移
</span>
<span v-if="isEdit">
<span v-if="isEdit" @click="downSon(datas.index)">
<DownSquareTwoTone
:style="{
fontSize: '24px',
@@ -195,13 +194,11 @@
marginLeft: '20px',
marginRight: '20px',
}"
@click="downSon(datas.index)"
/>下移
</span>
<span v-if="isEdit">
<span v-if="isEdit" @click="deleteSon(datas.record.DetailId)">
<DeleteOutlined
:style="{ fontSize: '24px', color: 'red' }"
@click="deleteSon(datas.record.DetailId)"
/>删除
</span>
</template>
@@ -329,7 +326,7 @@
:icon="h(EditOutlined)"
:disabled="!hasData"
@click.prevent="onViewPreview"
>作品展览</a-button
>相册展览</a-button
>
</a-space>
</a-row>
@@ -563,7 +560,7 @@ const onReset = () => {
const onViewPreview = async () => {
router.push({
name: "Previews",
name: "Preview",
params: { id: data.value.PublishPhoto.PublishName, mode: "view" },
});
};
@@ -8,7 +8,7 @@
</template>
<template #bodyCell="{ column, record, index }">
<template v-if="column.dataIndex === PublishVideoEntity.PUBLISH_NAME">
<a-button type="link" block @click.prevent="onViewVideoPreview">{{ record.PublishName }}</a-button>
<a-button type="link" block @click.prevent="onViewPreviewVideo">{{ record.PublishName }}</a-button>
</template>
<template v-else-if="column.dataIndex === PublishVideoEntity.DEFAULT_INDC">
<template v-if="record.DefaultIndc == 'Y'">
@@ -29,7 +29,7 @@
:disabled="!(keys && keys.length > 0)" @click.prevent="onAmend">修改</a-button>
<a-button type="primary" v-if="canView" :icon="h(FileTextOutlined)"
:disabled="!(keys && keys.length > 0)"
@click.prevent="onViewVideoPreview">影视厅</a-button>
@click.prevent="onViewPreviewVideo">影视厅</a-button>
</a-space>
</a-row>
</a-col>
@@ -200,9 +200,9 @@ const onReset = (() => {
result.value.Total = 0;
})
const onViewVideoPreview = (() => {
const onViewPreviewVideo = (() => {
if (keys.value.length == 0) return;
router.push({ name: "VideoPreviews", params: { id: keys.value[0].PublishName, mode: 'view' } });
router.push({ name: "PreviewVideo", params: { id: keys.value[0].PublishName, mode: 'view' } });
})
const onCreate = (() => {
@@ -247,7 +247,7 @@
:disabled="!hasData" v-if="canDelete">删除</a-button>
</a-popconfirm>
<a-button type="primary" v-if="canAmend" :icon="h(EditOutlined)"
:disabled="!hasData" @click.prevent="onViewVideoPreview">影视厅</a-button>
:disabled="!hasData" @click.prevent="onViewPreviewVideo">影视厅</a-button>
</a-space>
</a-row>
</div>
@@ -375,7 +375,7 @@ const columnDtls = ref([
]);
//================provide================
//弹出(Function Modal)
provide("isModalVideoPublish", showModal);
provide("isModalPublishVideo", showModal);
//记录单选还是多选(Modal)
provide("selectionTypeVideoPublish", rowSelectionType);
//初始化查询条件的值(Modal)
@@ -515,8 +515,8 @@ const onReset = (() => {
const onViewVideoPreview = (async () => {
router.push({ name: "VideoPreviews", params: { id: data.value.PublishVideo.PublishName, mode: 'view' } });
const onViewPreviewVideo = (async () => {
router.push({ name: "PreviewVideo", params: { id: data.value.PublishVideo.PublishName, mode: 'view' } });
})
const onCreate = (() => {
+1 -1
View File
@@ -66,7 +66,7 @@ import { useOrderedChildren } from "@/hooks/use-ordered-children";
import { SearchCriteriaContext } from "@/injections";
//page from-----------------------------------------------------------------------------------------------------------------------------------
//================inject================
const actorOperationMethod = inject(operationToEnquiryMethodKey);
const actorOperationMethod = inject(operationToEnquiryMethodKey, undefined);
const modelOption = actorOperationMethod?.getOperationToEnquiryModelOption() as OperationToEnquiryModelOption;
@@ -68,7 +68,7 @@ import { SearchCriteriaContext } from "@/injections";
//报表名称(layout)
const layoutProviderMethod = inject(layoutProviderMethodKey);
const actorOperationMethod = inject(operationToEnquiryMethodKey);
const actorOperationMethod = inject(operationToEnquiryMethodKey, undefined);
const modelOption = actorOperationMethod?.getOperationToEnquiryModelOption() as OperationToEnquiryModelOption;
const isModal = ref(modelOption ? modelOption.isModalFunction : false);
+1 -1
View File
@@ -60,7 +60,7 @@ import { useOrderedChildren } from "@/hooks/use-ordered-children";
import { SearchCriteriaContext } from "@/injections";
//page from-----------------------------------------------------------------------------------------------------------------------------------
//================inject================
const actorOperationMethod = inject(operationToEnquiryMethodKey);
const actorOperationMethod =inject(operationToEnquiryMethodKey, undefined);
const modelOption = actorOperationMethod?.getOperationToEnquiryModelOption() as OperationToEnquiryModelOption;
const isModal = ref(modelOption ? modelOption.isModalGroup : false);
+1 -1
View File
@@ -66,7 +66,7 @@ import { useOrderedChildren } from "@/hooks/use-ordered-children";
import { SearchCriteriaContext } from "@/injections";
//page from-----------------------------------------------------------------------------------------------------------------------------------
//================inject================
const actorOperationMethod = inject(operationToEnquiryMethodKey);
const actorOperationMethod = inject(operationToEnquiryMethodKey, undefined);
const modelOption = actorOperationMethod?.getOperationToEnquiryModelOption() as OperationToEnquiryModelOption;
const isModal = ref(modelOption ? modelOption.isModalMaster : false);
@@ -33,7 +33,7 @@ import { useOrderedChildren } from "@/hooks/use-ordered-children";
import { SearchCriteriaContext } from "@/injections";
//page from-----------------------------------------------------------------------------------------------------------------------------------
//================inject================
const actorOperationMethod = inject(operationToEnquiryMethodKey);
const actorOperationMethod = inject(operationToEnquiryMethodKey, undefined);
const modelOption = actorOperationMethod?.getOperationToEnquiryModelOption() as OperationToEnquiryModelOption;
const isModal = ref(modelOption ? modelOption.isModalPermissionDependent : false);
@@ -60,7 +60,7 @@ import { SearchCriteriaContext } from "@/injections";
import { enquiryMethodKey, searchCriteriaManagerKey, operationToEnquiryMethodKey, OperationToEnquiryModelOption, layoutProviderMethodKey } from "@/injections";
//page from-----------------------------------------------------------------------------------------------------------------------------------
//================inject================
const actorOperationMethod = inject(operationToEnquiryMethodKey);
const actorOperationMethod =inject(operationToEnquiryMethodKey, undefined);
const modelOption = actorOperationMethod?.getOperationToEnquiryModelOption() as OperationToEnquiryModelOption;
const isModal = ref(modelOption ? modelOption.isModalPermission : false);
+1 -1
View File
@@ -66,7 +66,7 @@ import { useOrderedChildren } from "@/hooks/use-ordered-children";
import { SearchCriteriaContext } from "@/injections";
//page from-----------------------------------------------------------------------------------------------------------------------------------
//================inject================
const actorOperationMethod = inject(operationToEnquiryMethodKey);
const actorOperationMethod = inject(operationToEnquiryMethodKey, undefined);
const modelOption = actorOperationMethod?.getOperationToEnquiryModelOption() as OperationToEnquiryModelOption;
const isModal = ref(modelOption ? modelOption.isModalUser : false);