34 lines
970 B
Vue
34 lines
970 B
Vue
<template>
|
|
<article-view
|
|
:article="articleValue"
|
|
:empty-text="emptyText"
|
|
:resolve-attachment-url="resolveAttachmentUrl"
|
|
/>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import type { Article, ArticleContentType, Attachment } from "../article-editor/types";
|
|
import type { NotifyDetail } from "../notify-editor/types";
|
|
import { ArticleView } from "../article-view";
|
|
import { normalizeNotifyContentType } from "../notify-editor/content";
|
|
|
|
defineOptions({
|
|
name: "NotifyView"
|
|
});
|
|
|
|
const props = withDefaults(defineProps<{
|
|
detail?: NotifyDetail;
|
|
emptyText?: string;
|
|
resolveAttachmentUrl?: (attachmentId: string, attachment?: Attachment) => string | Promise<string>;
|
|
}>(), {
|
|
detail: () => ({}),
|
|
emptyText: "暂无通知内容"
|
|
});
|
|
|
|
const articleValue = computed<Article>(() => ({
|
|
contentType: normalizeNotifyContentType(props.detail?.contentType) as ArticleContentType,
|
|
content: props.detail?.content || "",
|
|
attachmentList: props.detail?.attachmentList
|
|
}));
|
|
</script>
|