import { a as _export_sfc, c as useHead, n as navigateTo } from './server.mjs';
import { defineComponent, ref, reactive, computed, watch, resolveComponent, mergeProps, withCtx, unref, createTextVNode, createVNode, toDisplayString, createBlock, openBlock, Fragment, renderList, isRef, createCommentVNode, withDirectives, vShow, nextTick, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderList, ssrRenderClass, ssrInterpolate, ssrRenderAttr, ssrRenderStyle } from 'vue/server-renderer';
import { PlusOutlined, ReloadOutlined, LinkOutlined, PictureOutlined, UnorderedListOutlined, OrderedListOutlined, MinusOutlined, FullscreenOutlined, FullscreenExitOutlined } from '@ant-design/icons-vue';
import { message } from 'ant-design-vue';
import { l as listAppArticle, u as updateAppArticle, r as removeAppArticle, a as addAppArticle } from './index-DLTWNMRy.mjs';
import { u as uploadFile } from './index-SD8M3klL.mjs';
import { marked } from 'marked';
import hljs from 'highlight.js';
import '../nitro/nitro.mjs';
import 'node:http';
import 'node:https';
import 'node:events';
import 'node:buffer';
import 'node:fs';
import 'node:path';
import 'node:crypto';
import 'node:url';
import 'better-sqlite3';
import 'vue-router';
import '@babel/runtime/helpers/esm/extends';
import 'stylis';
import 'dayjs';
import '../routes/renderer.mjs';
import 'vue-bundle-renderer/runtime';
import 'unhead/server';
import 'devalue';
import 'unhead/plugins';
import 'unhead/utils';
import './request-BIxQh2im.mjs';
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
__name: "MarkdownEditor",
__ssrInlineRender: true,
props: {
modelValue: {},
placeholder: { default: "请输入 Markdown 内容..." },
showPreview: { type: Boolean, default: true },
minHeight: { default: "300px" }
},
emits: ["update:modelValue"],
setup(__props, { expose: __expose, emit: __emit }) {
const props = __props;
const emit = __emit;
marked.setOptions({
highlight: function(code, lang) {
if (lang && hljs.getLanguage(lang)) {
return hljs.highlight(code, { language: lang }).value;
}
return hljs.highlightAuto(code).value;
},
breaks: true,
gfm: true
});
const textareaRef = ref(null);
const uploadRef = ref(null);
const localValue = ref(props.modelValue);
const isFullscreen = ref(false);
const showLinkModal = ref(false);
const linkForm = reactive({
text: "",
url: ""
});
watch(() => props.modelValue, (newVal) => {
if (newVal !== localValue.value) {
localValue.value = newVal;
}
});
const renderedHtml = computed(() => {
if (!localValue.value) return '
`);
_push(ssrRenderComponent(_component_a_space, null, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_a_tooltip, { title: "标题" }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_a_button, {
size: "small",
onClick: ($event) => insertAtCursor("# ")
}, {
icon: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`H`);
} else {
return [
createVNode("span", { class: "toolbar-icon" }, "H")
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_a_button, {
size: "small",
onClick: ($event) => insertAtCursor("# ")
}, {
icon: withCtx(() => [
createVNode("span", { class: "toolbar-icon" }, "H")
]),
_: 1
}, 8, ["onClick"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_a_divider, { type: "vertical" }, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_a_tooltip, { title: "加粗" }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_a_button, {
size: "small",
onClick: ($event) => insertWrap("**", "**")
}, {
icon: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`B`);
} else {
return [
createVNode("span", { class: "toolbar-icon bold" }, "B")
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_a_button, {
size: "small",
onClick: ($event) => insertWrap("**", "**")
}, {
icon: withCtx(() => [
createVNode("span", { class: "toolbar-icon bold" }, "B")
]),
_: 1
}, 8, ["onClick"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_a_tooltip, { title: "斜体" }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_a_button, {
size: "small",
onClick: ($event) => insertWrap("*", "*")
}, {
icon: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`I`);
} else {
return [
createVNode("span", { class: "toolbar-icon italic" }, "I")
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_a_button, {
size: "small",
onClick: ($event) => insertWrap("*", "*")
}, {
icon: withCtx(() => [
createVNode("span", { class: "toolbar-icon italic" }, "I")
]),
_: 1
}, 8, ["onClick"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_a_tooltip, { title: "删除线" }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_a_button, {
size: "small",
onClick: ($event) => insertWrap("~~", "~~")
}, {
icon: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`S`);
} else {
return [
createVNode("span", { class: "toolbar-icon" }, "S")
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_a_button, {
size: "small",
onClick: ($event) => insertWrap("~~", "~~")
}, {
icon: withCtx(() => [
createVNode("span", { class: "toolbar-icon" }, "S")
]),
_: 1
}, 8, ["onClick"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_a_divider, { type: "vertical" }, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_a_tooltip, { title: "引用" }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_a_button, {
size: "small",
onClick: ($event) => insertAtCursor("> ")
}, {
icon: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`>`);
} else {
return [
createVNode("span", { class: "toolbar-icon" }, ">")
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_a_button, {
size: "small",
onClick: ($event) => insertAtCursor("> ")
}, {
icon: withCtx(() => [
createVNode("span", { class: "toolbar-icon" }, ">")
]),
_: 1
}, 8, ["onClick"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_a_tooltip, { title: "代码块" }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_a_button, {
size: "small",
onClick: insertCodeBlock
}, {
icon: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`</>`);
} else {
return [
createVNode("span", { class: "toolbar-icon" }, ">")
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_a_button, {
size: "small",
onClick: insertCodeBlock
}, {
icon: withCtx(() => [
createVNode("span", { class: "toolbar-icon" }, ">")
]),
_: 1
})
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_a_tooltip, { title: "行内代码" }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_a_button, {
size: "small",
onClick: ($event) => insertWrap("`", "`")
}, {
icon: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`\``);
} else {
return [
createVNode("span", { class: "toolbar-icon" }, "`")
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_a_button, {
size: "small",
onClick: ($event) => insertWrap("`", "`")
}, {
icon: withCtx(() => [
createVNode("span", { class: "toolbar-icon" }, "`")
]),
_: 1
}, 8, ["onClick"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_a_divider, { type: "vertical" }, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_a_tooltip, { title: "链接" }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_a_button, {
size: "small",
onClick: insertLink
}, {
icon: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(unref(LinkOutlined), null, null, _parent4, _scopeId3));
} else {
return [
createVNode(unref(LinkOutlined))
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_a_button, {
size: "small",
onClick: insertLink
}, {
icon: withCtx(() => [
createVNode(unref(LinkOutlined))
]),
_: 1
})
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_a_tooltip, { title: "图片" }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_a_button, {
size: "small",
onClick: handleImageUpload
}, {
icon: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(unref(PictureOutlined), null, null, _parent4, _scopeId3));
} else {
return [
createVNode(unref(PictureOutlined))
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_a_button, {
size: "small",
onClick: handleImageUpload
}, {
icon: withCtx(() => [
createVNode(unref(PictureOutlined))
]),
_: 1
})
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_a_divider, { type: "vertical" }, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_a_tooltip, { title: "有序列表" }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_a_button, {
size: "small",
onClick: ($event) => insertAtCursor("1. ")
}, {
icon: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(unref(UnorderedListOutlined), null, null, _parent4, _scopeId3));
} else {
return [
createVNode(unref(UnorderedListOutlined))
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_a_button, {
size: "small",
onClick: ($event) => insertAtCursor("1. ")
}, {
icon: withCtx(() => [
createVNode(unref(UnorderedListOutlined))
]),
_: 1
}, 8, ["onClick"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_a_tooltip, { title: "无序列表" }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_a_button, {
size: "small",
onClick: ($event) => insertAtCursor("- ")
}, {
icon: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(unref(OrderedListOutlined), null, null, _parent4, _scopeId3));
} else {
return [
createVNode(unref(OrderedListOutlined))
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_a_button, {
size: "small",
onClick: ($event) => insertAtCursor("- ")
}, {
icon: withCtx(() => [
createVNode(unref(OrderedListOutlined))
]),
_: 1
}, 8, ["onClick"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_a_divider, { type: "vertical" }, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_a_tooltip, { title: "水平线" }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_a_button, {
size: "small",
onClick: ($event) => insertAtCursor("\n---\n")
}, {
icon: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(unref(MinusOutlined), null, null, _parent4, _scopeId3));
} else {
return [
createVNode(unref(MinusOutlined))
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_a_button, {
size: "small",
onClick: ($event) => insertAtCursor("\n---\n")
}, {
icon: withCtx(() => [
createVNode(unref(MinusOutlined))
]),
_: 1
}, 8, ["onClick"])
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_a_tooltip, { title: "标题" }, {
default: withCtx(() => [
createVNode(_component_a_button, {
size: "small",
onClick: ($event) => insertAtCursor("# ")
}, {
icon: withCtx(() => [
createVNode("span", { class: "toolbar-icon" }, "H")
]),
_: 1
}, 8, ["onClick"])
]),
_: 1
}),
createVNode(_component_a_divider, { type: "vertical" }),
createVNode(_component_a_tooltip, { title: "加粗" }, {
default: withCtx(() => [
createVNode(_component_a_button, {
size: "small",
onClick: ($event) => insertWrap("**", "**")
}, {
icon: withCtx(() => [
createVNode("span", { class: "toolbar-icon bold" }, "B")
]),
_: 1
}, 8, ["onClick"])
]),
_: 1
}),
createVNode(_component_a_tooltip, { title: "斜体" }, {
default: withCtx(() => [
createVNode(_component_a_button, {
size: "small",
onClick: ($event) => insertWrap("*", "*")
}, {
icon: withCtx(() => [
createVNode("span", { class: "toolbar-icon italic" }, "I")
]),
_: 1
}, 8, ["onClick"])
]),
_: 1
}),
createVNode(_component_a_tooltip, { title: "删除线" }, {
default: withCtx(() => [
createVNode(_component_a_button, {
size: "small",
onClick: ($event) => insertWrap("~~", "~~")
}, {
icon: withCtx(() => [
createVNode("span", { class: "toolbar-icon" }, "S")
]),
_: 1
}, 8, ["onClick"])
]),
_: 1
}),
createVNode(_component_a_divider, { type: "vertical" }),
createVNode(_component_a_tooltip, { title: "引用" }, {
default: withCtx(() => [
createVNode(_component_a_button, {
size: "small",
onClick: ($event) => insertAtCursor("> ")
}, {
icon: withCtx(() => [
createVNode("span", { class: "toolbar-icon" }, ">")
]),
_: 1
}, 8, ["onClick"])
]),
_: 1
}),
createVNode(_component_a_tooltip, { title: "代码块" }, {
default: withCtx(() => [
createVNode(_component_a_button, {
size: "small",
onClick: insertCodeBlock
}, {
icon: withCtx(() => [
createVNode("span", { class: "toolbar-icon" }, ">")
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_tooltip, { title: "行内代码" }, {
default: withCtx(() => [
createVNode(_component_a_button, {
size: "small",
onClick: ($event) => insertWrap("`", "`")
}, {
icon: withCtx(() => [
createVNode("span", { class: "toolbar-icon" }, "`")
]),
_: 1
}, 8, ["onClick"])
]),
_: 1
}),
createVNode(_component_a_divider, { type: "vertical" }),
createVNode(_component_a_tooltip, { title: "链接" }, {
default: withCtx(() => [
createVNode(_component_a_button, {
size: "small",
onClick: insertLink
}, {
icon: withCtx(() => [
createVNode(unref(LinkOutlined))
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_tooltip, { title: "图片" }, {
default: withCtx(() => [
createVNode(_component_a_button, {
size: "small",
onClick: handleImageUpload
}, {
icon: withCtx(() => [
createVNode(unref(PictureOutlined))
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_divider, { type: "vertical" }),
createVNode(_component_a_tooltip, { title: "有序列表" }, {
default: withCtx(() => [
createVNode(_component_a_button, {
size: "small",
onClick: ($event) => insertAtCursor("1. ")
}, {
icon: withCtx(() => [
createVNode(unref(UnorderedListOutlined))
]),
_: 1
}, 8, ["onClick"])
]),
_: 1
}),
createVNode(_component_a_tooltip, { title: "无序列表" }, {
default: withCtx(() => [
createVNode(_component_a_button, {
size: "small",
onClick: ($event) => insertAtCursor("- ")
}, {
icon: withCtx(() => [
createVNode(unref(OrderedListOutlined))
]),
_: 1
}, 8, ["onClick"])
]),
_: 1
}),
createVNode(_component_a_divider, { type: "vertical" }),
createVNode(_component_a_tooltip, { title: "水平线" }, {
default: withCtx(() => [
createVNode(_component_a_button, {
size: "small",
onClick: ($event) => insertAtCursor("\n---\n")
}, {
icon: withCtx(() => [
createVNode(unref(MinusOutlined))
]),
_: 1
}, 8, ["onClick"])
]),
_: 1
})
];
}
}),
_: 1
}, _parent));
_push(`
`);
_push(ssrRenderComponent(_component_a_button, {
size: "small",
onClick: toggleFullscreen
}, {
icon: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
if (!unref(isFullscreen)) {
_push2(ssrRenderComponent(unref(FullscreenOutlined), null, null, _parent2, _scopeId));
} else {
_push2(ssrRenderComponent(unref(FullscreenExitOutlined), null, null, _parent2, _scopeId));
}
} else {
return [
!unref(isFullscreen) ? (openBlock(), createBlock(unref(FullscreenOutlined), { key: 0 })) : (openBlock(), createBlock(unref(FullscreenExitOutlined), { key: 1 }))
];
}
}),
_: 1
}, _parent));
_push(`
`);
if (__props.showPreview) {
_push(`
预览
${unref(renderedHtml) ?? ""}
`);
} else {
_push(``);
}
_push(`
`);
_push(ssrRenderComponent(_component_a_upload, {
ref_key: "uploadRef",
ref: uploadRef,
accept: "image/*",
"show-upload-list": false,
"before-upload": beforeImageUpload,
"custom-request": handleCoverUpload,
style: { "display": "none" }
}, null, _parent));
_push(ssrRenderComponent(_component_a_modal, {
open: unref(showLinkModal),
"onUpdate:open": ($event) => isRef(showLinkModal) ? showLinkModal.value = $event : null,
title: "插入链接",
width: 400,
onOk: insertLinkConfirm
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_a_form, {
model: unref(linkForm),
layout: "vertical"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_a_form_item, {
label: "链接文本",
required: ""
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_input, {
value: unref(linkForm).text,
"onUpdate:value": ($event) => unref(linkForm).text = $event,
placeholder: "显示的文本"
}, null, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_input, {
value: unref(linkForm).text,
"onUpdate:value": ($event) => unref(linkForm).text = $event,
placeholder: "显示的文本"
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_a_form_item, {
label: "链接地址",
required: ""
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_input, {
value: unref(linkForm).url,
"onUpdate:value": ($event) => unref(linkForm).url = $event,
placeholder: "https://..."
}, null, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_input, {
value: unref(linkForm).url,
"onUpdate:value": ($event) => unref(linkForm).url = $event,
placeholder: "https://..."
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_a_form_item, {
label: "链接文本",
required: ""
}, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(linkForm).text,
"onUpdate:value": ($event) => unref(linkForm).text = $event,
placeholder: "显示的文本"
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_a_form_item, {
label: "链接地址",
required: ""
}, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(linkForm).url,
"onUpdate:value": ($event) => unref(linkForm).url = $event,
placeholder: "https://..."
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
})
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_a_form, {
model: unref(linkForm),
layout: "vertical"
}, {
default: withCtx(() => [
createVNode(_component_a_form_item, {
label: "链接文本",
required: ""
}, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(linkForm).text,
"onUpdate:value": ($event) => unref(linkForm).text = $event,
placeholder: "显示的文本"
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_a_form_item, {
label: "链接地址",
required: ""
}, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(linkForm).url,
"onUpdate:value": ($event) => unref(linkForm).url = $event,
placeholder: "https://..."
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
})
]),
_: 1
}, 8, ["model"])
];
}
}),
_: 1
}, _parent));
_push(`
`);
};
}
});
const _sfc_setup$2 = _sfc_main$2.setup;
_sfc_main$2.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/admin/MarkdownEditor.vue");
return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
};
const MarkdownEditor = /* @__PURE__ */ Object.assign(_export_sfc(_sfc_main$2, [["__scopeId", "data-v-32212c95"]]), { __name: "AdminMarkdownEditor" });
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
__name: "MarkdownRenderer",
__ssrInlineRender: true,
props: {
content: {}
},
setup(__props) {
const props = __props;
marked.setOptions({
highlight: function(code, lang) {
if (lang && hljs.getLanguage(lang)) {
return hljs.highlight(code, { language: lang }).value;
}
return hljs.highlightAuto(code).value;
},
breaks: true,
gfm: true
});
const renderedHtml = computed(() => {
if (!props.content) return "";
try {
return marked.parse(props.content);
} catch (e) {
return "`);
_push(ssrRenderComponent(_component_a_row, {
gutter: [16, 16],
class: "mb-6"
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(``);
ssrRenderList(unref(statCards), (stat) => {
_push2(ssrRenderComponent(_component_a_col, {
xs: 12,
md: 6,
key: stat.key
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`
${ssrInterpolate(stat.icon)}
${ssrInterpolate(stat.value)}
${ssrInterpolate(stat.label)}
`);
} else {
return [
createVNode("div", {
class: ["stat-card", [
stat.color,
{
active: unref(filterStatus) === void 0 && stat.key === -1 || unref(filterStatus) === stat.key
}
]],
onClick: ($event) => handleStatFilter(stat.key)
}, [
createVNode("div", { class: "stat-icon" }, toDisplayString(stat.icon), 1),
createVNode("div", { class: "stat-info" }, [
createVNode("div", { class: "stat-value" }, toDisplayString(stat.value), 1),
createVNode("div", { class: "stat-label" }, toDisplayString(stat.label), 1)
])
], 10, ["onClick"])
];
}
}),
_: 2
}, _parent2, _scopeId));
});
_push2(``);
} else {
return [
(openBlock(true), createBlock(Fragment, null, renderList(unref(statCards), (stat) => {
return openBlock(), createBlock(_component_a_col, {
xs: 12,
md: 6,
key: stat.key
}, {
default: withCtx(() => [
createVNode("div", {
class: ["stat-card", [
stat.color,
{
active: unref(filterStatus) === void 0 && stat.key === -1 || unref(filterStatus) === stat.key
}
]],
onClick: ($event) => handleStatFilter(stat.key)
}, [
createVNode("div", { class: "stat-icon" }, toDisplayString(stat.icon), 1),
createVNode("div", { class: "stat-info" }, [
createVNode("div", { class: "stat-value" }, toDisplayString(stat.value), 1),
createVNode("div", { class: "stat-label" }, toDisplayString(stat.label), 1)
])
], 10, ["onClick"])
]),
_: 2
}, 1024);
}), 128))
];
}
}),
_: 1
}, _parent));
_push(`
`);
_push(ssrRenderComponent(_component_a_table, {
columns,
"data-source": unref(pagedArticles),
loading: unref(loading),
pagination: unref(tablePagination),
"row-key": "articleId",
onChange: handleTableChange,
size: "middle"
}, {
bodyCell: withCtx(({ column, record }, _push2, _parent2, _scopeId) => {
if (_push2) {
if (column.key === "info") {
_push2(`
`);
if (record.image) {
_push2(`
![]()
`);
} else {
_push2(`
📄
`);
}
_push2(`
${ssrInterpolate(record.title)}
`);
if (record.author) {
_push2(`✍️ ${ssrInterpolate(record.author)}`);
} else {
_push2(``);
}
if (resolveCategoryName(record)) {
_push2(`📁 ${ssrInterpolate(resolveCategoryName(record))}`);
} else {
_push2(``);
}
_push2(`
${ssrInterpolate(record.overview || "暂无摘要")}
`);
} else {
_push2(``);
}
if (column.key === "status") {
_push2(ssrRenderComponent(_component_a_tag, {
color: statusColor(record.status)
}, {
default: withCtx((_, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(statusText(record.status))}`);
} else {
return [
createTextVNode(toDisplayString(statusText(record.status)), 1)
];
}
}),
_: 2
}, _parent2, _scopeId));
} else {
_push2(``);
}
if (column.key === "metrics") {
_push2(`
👁 ${ssrInterpolate(record.actualViews || 0)} 次阅读
❤️ ${ssrInterpolate(record.likes || 0)} 点赞
`);
} else {
_push2(``);
}
if (column.key === "recommend") {
_push2(ssrRenderComponent(_component_a_switch, {
checked: !!record.recommend,
size: "small",
onChange: (val) => handleToggleRecommend(record, val)
}, null, _parent2, _scopeId));
} else {
_push2(``);
}
if (column.key === "createTime") {
_push2(`
${ssrInterpolate(record.createTime?.substring(0, 10) || "-")}`);
} else {
_push2(``);
}
if (column.key === "action") {
_push2(ssrRenderComponent(_component_a_space, null, {
default: withCtx((_, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_a_button, {
type: "link",
size: "small",
onClick: ($event) => handleView(record)
}, {
default: withCtx((_2, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`预览`);
} else {
return [
createTextVNode("预览")
];
}
}),
_: 2
}, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_a_button, {
type: "link",
size: "small",
onClick: ($event) => handleEdit(record)
}, {
default: withCtx((_2, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`编辑`);
} else {
return [
createTextVNode("编辑")
];
}
}),
_: 2
}, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_a_popconfirm, {
title: "确认删除此文章?",
onConfirm: ($event) => handleDelete(record)
}, {
default: withCtx((_2, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_button, {
type: "link",
size: "small",
danger: ""
}, {
default: withCtx((_3, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`删除`);
} else {
return [
createTextVNode("删除")
];
}
}),
_: 2
}, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_button, {
type: "link",
size: "small",
danger: ""
}, {
default: withCtx(() => [
createTextVNode("删除")
]),
_: 1
})
];
}
}),
_: 2
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_a_button, {
type: "link",
size: "small",
onClick: ($event) => handleView(record)
}, {
default: withCtx(() => [
createTextVNode("预览")
]),
_: 1
}, 8, ["onClick"]),
createVNode(_component_a_button, {
type: "link",
size: "small",
onClick: ($event) => handleEdit(record)
}, {
default: withCtx(() => [
createTextVNode("编辑")
]),
_: 1
}, 8, ["onClick"]),
createVNode(_component_a_popconfirm, {
title: "确认删除此文章?",
onConfirm: ($event) => handleDelete(record)
}, {
default: withCtx(() => [
createVNode(_component_a_button, {
type: "link",
size: "small",
danger: ""
}, {
default: withCtx(() => [
createTextVNode("删除")
]),
_: 1
})
]),
_: 1
}, 8, ["onConfirm"])
];
}
}),
_: 2
}, _parent2, _scopeId));
} else {
_push2(``);
}
} else {
return [
column.key === "info" ? (openBlock(), createBlock("div", {
key: 0,
class: "article-info-cell"
}, [
record.image ? (openBlock(), createBlock("img", {
key: 0,
src: record.image,
class: "article-thumb"
}, null, 8, ["src"])) : (openBlock(), createBlock("div", {
key: 1,
class: "article-thumb-empty"
}, "📄")),
createVNode("div", { class: "article-info-text" }, [
createVNode("div", { class: "article-title" }, toDisplayString(record.title), 1),
createVNode("div", { class: "article-meta" }, [
record.author ? (openBlock(), createBlock("span", { key: 0 }, "✍️ " + toDisplayString(record.author), 1)) : createCommentVNode("", true),
resolveCategoryName(record) ? (openBlock(), createBlock("span", {
key: 1,
class: "meta-item"
}, "📁 " + toDisplayString(resolveCategoryName(record)), 1)) : createCommentVNode("", true)
]),
createVNode("div", { class: "article-overview" }, toDisplayString(record.overview || "暂无摘要"), 1)
])
])) : createCommentVNode("", true),
column.key === "status" ? (openBlock(), createBlock(_component_a_tag, {
key: 1,
color: statusColor(record.status)
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(statusText(record.status)), 1)
]),
_: 2
}, 1032, ["color"])) : createCommentVNode("", true),
column.key === "metrics" ? (openBlock(), createBlock("div", {
key: 2,
class: "metrics-cell"
}, [
createVNode("div", null, "👁 " + toDisplayString(record.actualViews || 0) + " 次阅读", 1),
createVNode("div", null, "❤️ " + toDisplayString(record.likes || 0) + " 点赞", 1)
])) : createCommentVNode("", true),
column.key === "recommend" ? (openBlock(), createBlock(_component_a_switch, {
key: 3,
checked: !!record.recommend,
size: "small",
onChange: (val) => handleToggleRecommend(record, val)
}, null, 8, ["checked", "onChange"])) : createCommentVNode("", true),
column.key === "createTime" ? (openBlock(), createBlock("span", {
key: 4,
class: "text-sm text-gray"
}, toDisplayString(record.createTime?.substring(0, 10) || "-"), 1)) : createCommentVNode("", true),
column.key === "action" ? (openBlock(), createBlock(_component_a_space, { key: 5 }, {
default: withCtx(() => [
createVNode(_component_a_button, {
type: "link",
size: "small",
onClick: ($event) => handleView(record)
}, {
default: withCtx(() => [
createTextVNode("预览")
]),
_: 1
}, 8, ["onClick"]),
createVNode(_component_a_button, {
type: "link",
size: "small",
onClick: ($event) => handleEdit(record)
}, {
default: withCtx(() => [
createTextVNode("编辑")
]),
_: 1
}, 8, ["onClick"]),
createVNode(_component_a_popconfirm, {
title: "确认删除此文章?",
onConfirm: ($event) => handleDelete(record)
}, {
default: withCtx(() => [
createVNode(_component_a_button, {
type: "link",
size: "small",
danger: ""
}, {
default: withCtx(() => [
createTextVNode("删除")
]),
_: 1
})
]),
_: 1
}, 8, ["onConfirm"])
]),
_: 2
}, 1024)) : createCommentVNode("", true)
];
}
}),
_: 1
}, _parent));
_push(`
`);
_push(ssrRenderComponent(_component_a_modal, {
open: unref(showFormModal),
"onUpdate:open": ($event) => isRef(showFormModal) ? showFormModal.value = $event : null,
title: unref(editingArticle)?.articleId ? "编辑文章" : "新增文章",
width: "760px",
"confirm-loading": unref(saving),
onOk: handleSave,
onCancel: ($event) => showFormModal.value = false
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_a_form, {
model: unref(formData),
layout: "vertical"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_a_form_item, {
label: "文章标题",
required: ""
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_input, {
value: unref(formData).title,
"onUpdate:value": ($event) => unref(formData).title = $event,
placeholder: "请输入文章标题",
maxlength: 200,
"show-count": ""
}, null, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_input, {
value: unref(formData).title,
"onUpdate:value": ($event) => unref(formData).title = $event,
placeholder: "请输入文章标题",
maxlength: 200,
"show-count": ""
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_a_row, { gutter: 16 }, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_col, { span: 12 }, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(ssrRenderComponent(_component_a_form_item, { label: "作者" }, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(ssrRenderComponent(_component_a_input, {
value: unref(formData).author,
"onUpdate:value": ($event) => unref(formData).author = $event,
placeholder: "文章作者"
}, null, _parent6, _scopeId5));
} else {
return [
createVNode(_component_a_input, {
value: unref(formData).author,
"onUpdate:value": ($event) => unref(formData).author = $event,
placeholder: "文章作者"
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent5, _scopeId4));
} else {
return [
createVNode(_component_a_form_item, { label: "作者" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(formData).author,
"onUpdate:value": ($event) => unref(formData).author = $event,
placeholder: "文章作者"
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
})
];
}
}),
_: 1
}, _parent4, _scopeId3));
_push4(ssrRenderComponent(_component_a_col, { span: 12 }, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(ssrRenderComponent(_component_a_form_item, { label: "来源" }, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(ssrRenderComponent(_component_a_input, {
value: unref(formData).source,
"onUpdate:value": ($event) => unref(formData).source = $event,
placeholder: "文章来源"
}, null, _parent6, _scopeId5));
} else {
return [
createVNode(_component_a_input, {
value: unref(formData).source,
"onUpdate:value": ($event) => unref(formData).source = $event,
placeholder: "文章来源"
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent5, _scopeId4));
} else {
return [
createVNode(_component_a_form_item, { label: "来源" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(formData).source,
"onUpdate:value": ($event) => unref(formData).source = $event,
placeholder: "文章来源"
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
})
];
}
}),
_: 1
}, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "作者" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(formData).author,
"onUpdate:value": ($event) => unref(formData).author = $event,
placeholder: "文章作者"
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "来源" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(formData).source,
"onUpdate:value": ($event) => unref(formData).source = $event,
placeholder: "文章来源"
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
})
]),
_: 1
})
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_a_row, { gutter: 16 }, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_col, { span: 12 }, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(ssrRenderComponent(_component_a_form_item, { label: "文章分类" }, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(ssrRenderComponent(_component_a_select, {
value: unref(formData).categoryId,
"onUpdate:value": ($event) => unref(formData).categoryId = $event,
"allow-clear": "",
"show-search": "",
"option-filter-prop": "label",
placeholder: "请选择文章分类",
options: unref(categorySelectOptions)
}, null, _parent6, _scopeId5));
} else {
return [
createVNode(_component_a_select, {
value: unref(formData).categoryId,
"onUpdate:value": ($event) => unref(formData).categoryId = $event,
"allow-clear": "",
"show-search": "",
"option-filter-prop": "label",
placeholder: "请选择文章分类",
options: unref(categorySelectOptions)
}, null, 8, ["value", "onUpdate:value", "options"])
];
}
}),
_: 1
}, _parent5, _scopeId4));
} else {
return [
createVNode(_component_a_form_item, { label: "文章分类" }, {
default: withCtx(() => [
createVNode(_component_a_select, {
value: unref(formData).categoryId,
"onUpdate:value": ($event) => unref(formData).categoryId = $event,
"allow-clear": "",
"show-search": "",
"option-filter-prop": "label",
placeholder: "请选择文章分类",
options: unref(categorySelectOptions)
}, null, 8, ["value", "onUpdate:value", "options"])
]),
_: 1
})
];
}
}),
_: 1
}, _parent4, _scopeId3));
_push4(ssrRenderComponent(_component_a_col, { span: 12 }, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(ssrRenderComponent(_component_a_form_item, { label: "状态" }, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(ssrRenderComponent(_component_a_select, {
value: unref(formData).status,
"onUpdate:value": ($event) => unref(formData).status = $event
}, {
default: withCtx((_6, _push7, _parent7, _scopeId6) => {
if (_push7) {
_push7(ssrRenderComponent(_component_a_select_option, { value: 0 }, {
default: withCtx((_7, _push8, _parent8, _scopeId7) => {
if (_push8) {
_push8(`已发布`);
} else {
return [
createTextVNode("已发布")
];
}
}),
_: 1
}, _parent7, _scopeId6));
_push7(ssrRenderComponent(_component_a_select_option, { value: 1 }, {
default: withCtx((_7, _push8, _parent8, _scopeId7) => {
if (_push8) {
_push8(`待审核`);
} else {
return [
createTextVNode("待审核")
];
}
}),
_: 1
}, _parent7, _scopeId6));
_push7(ssrRenderComponent(_component_a_select_option, { value: 2 }, {
default: withCtx((_7, _push8, _parent8, _scopeId7) => {
if (_push8) {
_push8(`已驳回`);
} else {
return [
createTextVNode("已驳回")
];
}
}),
_: 1
}, _parent7, _scopeId6));
_push7(ssrRenderComponent(_component_a_select_option, { value: 3 }, {
default: withCtx((_7, _push8, _parent8, _scopeId7) => {
if (_push8) {
_push8(`违规`);
} else {
return [
createTextVNode("违规")
];
}
}),
_: 1
}, _parent7, _scopeId6));
} else {
return [
createVNode(_component_a_select_option, { value: 0 }, {
default: withCtx(() => [
createTextVNode("已发布")
]),
_: 1
}),
createVNode(_component_a_select_option, { value: 1 }, {
default: withCtx(() => [
createTextVNode("待审核")
]),
_: 1
}),
createVNode(_component_a_select_option, { value: 2 }, {
default: withCtx(() => [
createTextVNode("已驳回")
]),
_: 1
}),
createVNode(_component_a_select_option, { value: 3 }, {
default: withCtx(() => [
createTextVNode("违规")
]),
_: 1
})
];
}
}),
_: 1
}, _parent6, _scopeId5));
} else {
return [
createVNode(_component_a_select, {
value: unref(formData).status,
"onUpdate:value": ($event) => unref(formData).status = $event
}, {
default: withCtx(() => [
createVNode(_component_a_select_option, { value: 0 }, {
default: withCtx(() => [
createTextVNode("已发布")
]),
_: 1
}),
createVNode(_component_a_select_option, { value: 1 }, {
default: withCtx(() => [
createTextVNode("待审核")
]),
_: 1
}),
createVNode(_component_a_select_option, { value: 2 }, {
default: withCtx(() => [
createTextVNode("已驳回")
]),
_: 1
}),
createVNode(_component_a_select_option, { value: 3 }, {
default: withCtx(() => [
createTextVNode("违规")
]),
_: 1
})
]),
_: 1
}, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent5, _scopeId4));
} else {
return [
createVNode(_component_a_form_item, { label: "状态" }, {
default: withCtx(() => [
createVNode(_component_a_select, {
value: unref(formData).status,
"onUpdate:value": ($event) => unref(formData).status = $event
}, {
default: withCtx(() => [
createVNode(_component_a_select_option, { value: 0 }, {
default: withCtx(() => [
createTextVNode("已发布")
]),
_: 1
}),
createVNode(_component_a_select_option, { value: 1 }, {
default: withCtx(() => [
createTextVNode("待审核")
]),
_: 1
}),
createVNode(_component_a_select_option, { value: 2 }, {
default: withCtx(() => [
createTextVNode("已驳回")
]),
_: 1
}),
createVNode(_component_a_select_option, { value: 3 }, {
default: withCtx(() => [
createTextVNode("违规")
]),
_: 1
})
]),
_: 1
}, 8, ["value", "onUpdate:value"])
]),
_: 1
})
];
}
}),
_: 1
}, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "文章分类" }, {
default: withCtx(() => [
createVNode(_component_a_select, {
value: unref(formData).categoryId,
"onUpdate:value": ($event) => unref(formData).categoryId = $event,
"allow-clear": "",
"show-search": "",
"option-filter-prop": "label",
placeholder: "请选择文章分类",
options: unref(categorySelectOptions)
}, null, 8, ["value", "onUpdate:value", "options"])
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "状态" }, {
default: withCtx(() => [
createVNode(_component_a_select, {
value: unref(formData).status,
"onUpdate:value": ($event) => unref(formData).status = $event
}, {
default: withCtx(() => [
createVNode(_component_a_select_option, { value: 0 }, {
default: withCtx(() => [
createTextVNode("已发布")
]),
_: 1
}),
createVNode(_component_a_select_option, { value: 1 }, {
default: withCtx(() => [
createTextVNode("待审核")
]),
_: 1
}),
createVNode(_component_a_select_option, { value: 2 }, {
default: withCtx(() => [
createTextVNode("已驳回")
]),
_: 1
}),
createVNode(_component_a_select_option, { value: 3 }, {
default: withCtx(() => [
createTextVNode("违规")
]),
_: 1
})
]),
_: 1
}, 8, ["value", "onUpdate:value"])
]),
_: 1
})
]),
_: 1
})
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_a_form_item, { label: "封面图" }, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`
`);
if (unref(formData).image) {
_push4(`
![]()
`);
_push4(ssrRenderComponent(_component_a_button, {
size: "small",
onClick: ($event) => handlePreviewImage(unref(formData).image)
}, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`预览`);
} else {
return [
createTextVNode("预览")
];
}
}),
_: 1
}, _parent4, _scopeId3));
_push4(ssrRenderComponent(_component_a_button, {
size: "small",
danger: "",
onClick: handleRemoveCover
}, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`移除`);
} else {
return [
createTextVNode("移除")
];
}
}),
_: 1
}, _parent4, _scopeId3));
_push4(`
`);
} else {
_push4(``);
}
_push4(ssrRenderComponent(_component_a_upload, {
accept: "image/*",
"show-upload-list": false,
"before-upload": beforeImageUpload,
"custom-request": handleCoverUpload
}, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(ssrRenderComponent(_component_a_button, { loading: unref(imageUploading) }, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(`上传封面`);
} else {
return [
createTextVNode("上传封面")
];
}
}),
_: 1
}, _parent5, _scopeId4));
} else {
return [
createVNode(_component_a_button, { loading: unref(imageUploading) }, {
default: withCtx(() => [
createTextVNode("上传封面")
]),
_: 1
}, 8, ["loading"])
];
}
}),
_: 1
}, _parent4, _scopeId3));
_push4(`
支持 jpg/png/webp,建议横版封面,单张不超过 5MB
`);
} else {
return [
createVNode("div", { class: "cover-upload-wrap" }, [
unref(formData).image ? (openBlock(), createBlock("div", {
key: 0,
class: "cover-preview-card"
}, [
createVNode("img", {
src: unref(formData).image,
class: "cover-preview-image"
}, null, 8, ["src"]),
createVNode("div", { class: "cover-preview-actions" }, [
createVNode(_component_a_button, {
size: "small",
onClick: ($event) => handlePreviewImage(unref(formData).image)
}, {
default: withCtx(() => [
createTextVNode("预览")
]),
_: 1
}, 8, ["onClick"]),
createVNode(_component_a_button, {
size: "small",
danger: "",
onClick: handleRemoveCover
}, {
default: withCtx(() => [
createTextVNode("移除")
]),
_: 1
})
])
])) : createCommentVNode("", true),
createVNode(_component_a_upload, {
accept: "image/*",
"show-upload-list": false,
"before-upload": beforeImageUpload,
"custom-request": handleCoverUpload
}, {
default: withCtx(() => [
createVNode(_component_a_button, { loading: unref(imageUploading) }, {
default: withCtx(() => [
createTextVNode("上传封面")
]),
_: 1
}, 8, ["loading"])
]),
_: 1
}),
createVNode("div", { class: "field-hint" }, "支持 jpg/png/webp,建议横版封面,单张不超过 5MB")
])
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_a_form_item, { label: "文章摘要" }, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_textarea, {
value: unref(formData).overview,
"onUpdate:value": ($event) => unref(formData).overview = $event,
rows: 3,
placeholder: "文章简短描述",
maxlength: 500,
"show-count": ""
}, null, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_textarea, {
value: unref(formData).overview,
"onUpdate:value": ($event) => unref(formData).overview = $event,
rows: 3,
placeholder: "文章简短描述",
maxlength: 500,
"show-count": ""
}, null, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_a_form_item, {
label: "文章内容",
required: ""
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`
`);
_push4(ssrRenderComponent(_component_a_radio_group, {
value: unref(editorMode),
"onUpdate:value": ($event) => isRef(editorMode) ? editorMode.value = $event : null,
"button-style": "solid",
size: "small"
}, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(ssrRenderComponent(_component_a_radio_button, { value: "edit" }, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(`编辑`);
} else {
return [
createTextVNode("编辑")
];
}
}),
_: 1
}, _parent5, _scopeId4));
_push5(ssrRenderComponent(_component_a_radio_button, { value: "preview" }, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(`预览`);
} else {
return [
createTextVNode("预览")
];
}
}),
_: 1
}, _parent5, _scopeId4));
} else {
return [
createVNode(_component_a_radio_button, { value: "edit" }, {
default: withCtx(() => [
createTextVNode("编辑")
]),
_: 1
}),
createVNode(_component_a_radio_button, { value: "preview" }, {
default: withCtx(() => [
createTextVNode("预览")
]),
_: 1
})
];
}
}),
_: 1
}, _parent4, _scopeId3));
_push4(`
`);
_push4(ssrRenderComponent(MarkdownEditor, {
modelValue: unref(formData).content,
"onUpdate:modelValue": ($event) => unref(formData).content = $event,
placeholder: "请输入 Markdown 内容,支持 # 标题、**加粗**、*斜体*、[链接](url)、、代码块等语法",
"show-preview": false,
"min-height": "320px"
}, null, _parent4, _scopeId3));
_push4(`
`);
if (unref(formData).content) {
_push4(ssrRenderComponent(MarkdownRenderer, {
content: unref(formData).content
}, null, _parent4, _scopeId3));
} else {
_push4(`
暂无内容
`);
}
_push4(`
`);
} else {
return [
createVNode("div", { class: "content-editor-wrap" }, [
createVNode("div", { class: "editor-tabs" }, [
createVNode(_component_a_radio_group, {
value: unref(editorMode),
"onUpdate:value": ($event) => isRef(editorMode) ? editorMode.value = $event : null,
"button-style": "solid",
size: "small"
}, {
default: withCtx(() => [
createVNode(_component_a_radio_button, { value: "edit" }, {
default: withCtx(() => [
createTextVNode("编辑")
]),
_: 1
}),
createVNode(_component_a_radio_button, { value: "preview" }, {
default: withCtx(() => [
createTextVNode("预览")
]),
_: 1
})
]),
_: 1
}, 8, ["value", "onUpdate:value"])
]),
withDirectives(createVNode("div", null, [
createVNode(MarkdownEditor, {
modelValue: unref(formData).content,
"onUpdate:modelValue": ($event) => unref(formData).content = $event,
placeholder: "请输入 Markdown 内容,支持 # 标题、**加粗**、*斜体*、[链接](url)、、代码块等语法",
"show-preview": false,
"min-height": "320px"
}, null, 8, ["modelValue", "onUpdate:modelValue"])
], 512), [
[vShow, unref(editorMode) === "edit"]
]),
withDirectives(createVNode("div", { class: "preview-only-mode" }, [
unref(formData).content ? (openBlock(), createBlock(MarkdownRenderer, {
key: 0,
content: unref(formData).content
}, null, 8, ["content"])) : (openBlock(), createBlock("div", {
key: 1,
class: "empty-preview"
}, "暂无内容"))
], 512), [
[vShow, unref(editorMode) === "preview"]
])
])
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_a_form_item, { label: "内容格式" }, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_tag, {
color: unref(isMarkdown) ? "blue" : "default"
}, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`${ssrInterpolate(unref(isMarkdown) ? "Markdown" : "纯文本/HTML")}`);
} else {
return [
createTextVNode(toDisplayString(unref(isMarkdown) ? "Markdown" : "纯文本/HTML"), 1)
];
}
}),
_: 1
}, _parent4, _scopeId3));
_push4(`
当前编辑器支持 Markdown 语法编写 `);
} else {
return [
createVNode(_component_a_tag, {
color: unref(isMarkdown) ? "blue" : "default"
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(isMarkdown) ? "Markdown" : "纯文本/HTML"), 1)
]),
_: 1
}, 8, ["color"]),
createVNode("span", { class: "format-hint" }, " 当前编辑器支持 Markdown 语法编写 ")
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_a_form_item, { label: "是否推荐" }, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_switch, {
checked: unref(formRecommend),
"onUpdate:checked": ($event) => isRef(formRecommend) ? formRecommend.value = $event : null
}, null, _parent4, _scopeId3));
_push4(`
推荐文章将优先出现在列表与前台推荐位`);
} else {
return [
createVNode(_component_a_switch, {
checked: unref(formRecommend),
"onUpdate:checked": ($event) => isRef(formRecommend) ? formRecommend.value = $event : null
}, null, 8, ["checked", "onUpdate:checked"]),
createVNode("span", { class: "switch-tip" }, "推荐文章将优先出现在列表与前台推荐位")
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_a_form_item, {
label: "文章标题",
required: ""
}, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(formData).title,
"onUpdate:value": ($event) => unref(formData).title = $event,
placeholder: "请输入文章标题",
maxlength: 200,
"show-count": ""
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_a_row, { gutter: 16 }, {
default: withCtx(() => [
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "作者" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(formData).author,
"onUpdate:value": ($event) => unref(formData).author = $event,
placeholder: "文章作者"
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "来源" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(formData).source,
"onUpdate:value": ($event) => unref(formData).source = $event,
placeholder: "文章来源"
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
})
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_row, { gutter: 16 }, {
default: withCtx(() => [
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "文章分类" }, {
default: withCtx(() => [
createVNode(_component_a_select, {
value: unref(formData).categoryId,
"onUpdate:value": ($event) => unref(formData).categoryId = $event,
"allow-clear": "",
"show-search": "",
"option-filter-prop": "label",
placeholder: "请选择文章分类",
options: unref(categorySelectOptions)
}, null, 8, ["value", "onUpdate:value", "options"])
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "状态" }, {
default: withCtx(() => [
createVNode(_component_a_select, {
value: unref(formData).status,
"onUpdate:value": ($event) => unref(formData).status = $event
}, {
default: withCtx(() => [
createVNode(_component_a_select_option, { value: 0 }, {
default: withCtx(() => [
createTextVNode("已发布")
]),
_: 1
}),
createVNode(_component_a_select_option, { value: 1 }, {
default: withCtx(() => [
createTextVNode("待审核")
]),
_: 1
}),
createVNode(_component_a_select_option, { value: 2 }, {
default: withCtx(() => [
createTextVNode("已驳回")
]),
_: 1
}),
createVNode(_component_a_select_option, { value: 3 }, {
default: withCtx(() => [
createTextVNode("违规")
]),
_: 1
})
]),
_: 1
}, 8, ["value", "onUpdate:value"])
]),
_: 1
})
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_form_item, { label: "封面图" }, {
default: withCtx(() => [
createVNode("div", { class: "cover-upload-wrap" }, [
unref(formData).image ? (openBlock(), createBlock("div", {
key: 0,
class: "cover-preview-card"
}, [
createVNode("img", {
src: unref(formData).image,
class: "cover-preview-image"
}, null, 8, ["src"]),
createVNode("div", { class: "cover-preview-actions" }, [
createVNode(_component_a_button, {
size: "small",
onClick: ($event) => handlePreviewImage(unref(formData).image)
}, {
default: withCtx(() => [
createTextVNode("预览")
]),
_: 1
}, 8, ["onClick"]),
createVNode(_component_a_button, {
size: "small",
danger: "",
onClick: handleRemoveCover
}, {
default: withCtx(() => [
createTextVNode("移除")
]),
_: 1
})
])
])) : createCommentVNode("", true),
createVNode(_component_a_upload, {
accept: "image/*",
"show-upload-list": false,
"before-upload": beforeImageUpload,
"custom-request": handleCoverUpload
}, {
default: withCtx(() => [
createVNode(_component_a_button, { loading: unref(imageUploading) }, {
default: withCtx(() => [
createTextVNode("上传封面")
]),
_: 1
}, 8, ["loading"])
]),
_: 1
}),
createVNode("div", { class: "field-hint" }, "支持 jpg/png/webp,建议横版封面,单张不超过 5MB")
])
]),
_: 1
}),
createVNode(_component_a_form_item, { label: "文章摘要" }, {
default: withCtx(() => [
createVNode(_component_a_textarea, {
value: unref(formData).overview,
"onUpdate:value": ($event) => unref(formData).overview = $event,
rows: 3,
placeholder: "文章简短描述",
maxlength: 500,
"show-count": ""
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_a_form_item, {
label: "文章内容",
required: ""
}, {
default: withCtx(() => [
createVNode("div", { class: "content-editor-wrap" }, [
createVNode("div", { class: "editor-tabs" }, [
createVNode(_component_a_radio_group, {
value: unref(editorMode),
"onUpdate:value": ($event) => isRef(editorMode) ? editorMode.value = $event : null,
"button-style": "solid",
size: "small"
}, {
default: withCtx(() => [
createVNode(_component_a_radio_button, { value: "edit" }, {
default: withCtx(() => [
createTextVNode("编辑")
]),
_: 1
}),
createVNode(_component_a_radio_button, { value: "preview" }, {
default: withCtx(() => [
createTextVNode("预览")
]),
_: 1
})
]),
_: 1
}, 8, ["value", "onUpdate:value"])
]),
withDirectives(createVNode("div", null, [
createVNode(MarkdownEditor, {
modelValue: unref(formData).content,
"onUpdate:modelValue": ($event) => unref(formData).content = $event,
placeholder: "请输入 Markdown 内容,支持 # 标题、**加粗**、*斜体*、[链接](url)、、代码块等语法",
"show-preview": false,
"min-height": "320px"
}, null, 8, ["modelValue", "onUpdate:modelValue"])
], 512), [
[vShow, unref(editorMode) === "edit"]
]),
withDirectives(createVNode("div", { class: "preview-only-mode" }, [
unref(formData).content ? (openBlock(), createBlock(MarkdownRenderer, {
key: 0,
content: unref(formData).content
}, null, 8, ["content"])) : (openBlock(), createBlock("div", {
key: 1,
class: "empty-preview"
}, "暂无内容"))
], 512), [
[vShow, unref(editorMode) === "preview"]
])
])
]),
_: 1
}),
createVNode(_component_a_form_item, { label: "内容格式" }, {
default: withCtx(() => [
createVNode(_component_a_tag, {
color: unref(isMarkdown) ? "blue" : "default"
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(isMarkdown) ? "Markdown" : "纯文本/HTML"), 1)
]),
_: 1
}, 8, ["color"]),
createVNode("span", { class: "format-hint" }, " 当前编辑器支持 Markdown 语法编写 ")
]),
_: 1
}),
createVNode(_component_a_form_item, { label: "是否推荐" }, {
default: withCtx(() => [
createVNode(_component_a_switch, {
checked: unref(formRecommend),
"onUpdate:checked": ($event) => isRef(formRecommend) ? formRecommend.value = $event : null
}, null, 8, ["checked", "onUpdate:checked"]),
createVNode("span", { class: "switch-tip" }, "推荐文章将优先出现在列表与前台推荐位")
]),
_: 1
})
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_a_form, {
model: unref(formData),
layout: "vertical"
}, {
default: withCtx(() => [
createVNode(_component_a_form_item, {
label: "文章标题",
required: ""
}, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(formData).title,
"onUpdate:value": ($event) => unref(formData).title = $event,
placeholder: "请输入文章标题",
maxlength: 200,
"show-count": ""
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_a_row, { gutter: 16 }, {
default: withCtx(() => [
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "作者" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(formData).author,
"onUpdate:value": ($event) => unref(formData).author = $event,
placeholder: "文章作者"
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "来源" }, {
default: withCtx(() => [
createVNode(_component_a_input, {
value: unref(formData).source,
"onUpdate:value": ($event) => unref(formData).source = $event,
placeholder: "文章来源"
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
})
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_row, { gutter: 16 }, {
default: withCtx(() => [
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "文章分类" }, {
default: withCtx(() => [
createVNode(_component_a_select, {
value: unref(formData).categoryId,
"onUpdate:value": ($event) => unref(formData).categoryId = $event,
"allow-clear": "",
"show-search": "",
"option-filter-prop": "label",
placeholder: "请选择文章分类",
options: unref(categorySelectOptions)
}, null, 8, ["value", "onUpdate:value", "options"])
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_col, { span: 12 }, {
default: withCtx(() => [
createVNode(_component_a_form_item, { label: "状态" }, {
default: withCtx(() => [
createVNode(_component_a_select, {
value: unref(formData).status,
"onUpdate:value": ($event) => unref(formData).status = $event
}, {
default: withCtx(() => [
createVNode(_component_a_select_option, { value: 0 }, {
default: withCtx(() => [
createTextVNode("已发布")
]),
_: 1
}),
createVNode(_component_a_select_option, { value: 1 }, {
default: withCtx(() => [
createTextVNode("待审核")
]),
_: 1
}),
createVNode(_component_a_select_option, { value: 2 }, {
default: withCtx(() => [
createTextVNode("已驳回")
]),
_: 1
}),
createVNode(_component_a_select_option, { value: 3 }, {
default: withCtx(() => [
createTextVNode("违规")
]),
_: 1
})
]),
_: 1
}, 8, ["value", "onUpdate:value"])
]),
_: 1
})
]),
_: 1
})
]),
_: 1
}),
createVNode(_component_a_form_item, { label: "封面图" }, {
default: withCtx(() => [
createVNode("div", { class: "cover-upload-wrap" }, [
unref(formData).image ? (openBlock(), createBlock("div", {
key: 0,
class: "cover-preview-card"
}, [
createVNode("img", {
src: unref(formData).image,
class: "cover-preview-image"
}, null, 8, ["src"]),
createVNode("div", { class: "cover-preview-actions" }, [
createVNode(_component_a_button, {
size: "small",
onClick: ($event) => handlePreviewImage(unref(formData).image)
}, {
default: withCtx(() => [
createTextVNode("预览")
]),
_: 1
}, 8, ["onClick"]),
createVNode(_component_a_button, {
size: "small",
danger: "",
onClick: handleRemoveCover
}, {
default: withCtx(() => [
createTextVNode("移除")
]),
_: 1
})
])
])) : createCommentVNode("", true),
createVNode(_component_a_upload, {
accept: "image/*",
"show-upload-list": false,
"before-upload": beforeImageUpload,
"custom-request": handleCoverUpload
}, {
default: withCtx(() => [
createVNode(_component_a_button, { loading: unref(imageUploading) }, {
default: withCtx(() => [
createTextVNode("上传封面")
]),
_: 1
}, 8, ["loading"])
]),
_: 1
}),
createVNode("div", { class: "field-hint" }, "支持 jpg/png/webp,建议横版封面,单张不超过 5MB")
])
]),
_: 1
}),
createVNode(_component_a_form_item, { label: "文章摘要" }, {
default: withCtx(() => [
createVNode(_component_a_textarea, {
value: unref(formData).overview,
"onUpdate:value": ($event) => unref(formData).overview = $event,
rows: 3,
placeholder: "文章简短描述",
maxlength: 500,
"show-count": ""
}, null, 8, ["value", "onUpdate:value"])
]),
_: 1
}),
createVNode(_component_a_form_item, {
label: "文章内容",
required: ""
}, {
default: withCtx(() => [
createVNode("div", { class: "content-editor-wrap" }, [
createVNode("div", { class: "editor-tabs" }, [
createVNode(_component_a_radio_group, {
value: unref(editorMode),
"onUpdate:value": ($event) => isRef(editorMode) ? editorMode.value = $event : null,
"button-style": "solid",
size: "small"
}, {
default: withCtx(() => [
createVNode(_component_a_radio_button, { value: "edit" }, {
default: withCtx(() => [
createTextVNode("编辑")
]),
_: 1
}),
createVNode(_component_a_radio_button, { value: "preview" }, {
default: withCtx(() => [
createTextVNode("预览")
]),
_: 1
})
]),
_: 1
}, 8, ["value", "onUpdate:value"])
]),
withDirectives(createVNode("div", null, [
createVNode(MarkdownEditor, {
modelValue: unref(formData).content,
"onUpdate:modelValue": ($event) => unref(formData).content = $event,
placeholder: "请输入 Markdown 内容,支持 # 标题、**加粗**、*斜体*、[链接](url)、、代码块等语法",
"show-preview": false,
"min-height": "320px"
}, null, 8, ["modelValue", "onUpdate:modelValue"])
], 512), [
[vShow, unref(editorMode) === "edit"]
]),
withDirectives(createVNode("div", { class: "preview-only-mode" }, [
unref(formData).content ? (openBlock(), createBlock(MarkdownRenderer, {
key: 0,
content: unref(formData).content
}, null, 8, ["content"])) : (openBlock(), createBlock("div", {
key: 1,
class: "empty-preview"
}, "暂无内容"))
], 512), [
[vShow, unref(editorMode) === "preview"]
])
])
]),
_: 1
}),
createVNode(_component_a_form_item, { label: "内容格式" }, {
default: withCtx(() => [
createVNode(_component_a_tag, {
color: unref(isMarkdown) ? "blue" : "default"
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(isMarkdown) ? "Markdown" : "纯文本/HTML"), 1)
]),
_: 1
}, 8, ["color"]),
createVNode("span", { class: "format-hint" }, " 当前编辑器支持 Markdown 语法编写 ")
]),
_: 1
}),
createVNode(_component_a_form_item, { label: "是否推荐" }, {
default: withCtx(() => [
createVNode(_component_a_switch, {
checked: unref(formRecommend),
"onUpdate:checked": ($event) => isRef(formRecommend) ? formRecommend.value = $event : null
}, null, 8, ["checked", "onUpdate:checked"]),
createVNode("span", { class: "switch-tip" }, "推荐文章将优先出现在列表与前台推荐位")
]),
_: 1
})
]),
_: 1
}, 8, ["model"])
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_a_modal, {
open: unref(showPreviewModal),
"onUpdate:open": ($event) => isRef(showPreviewModal) ? showPreviewModal.value = $event : null,
title: unref(previewData)?.title || "文章预览",
width: "760px",
footer: null
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
if (unref(previewData)) {
_push2(`
`);
_push2(ssrRenderComponent(_component_a_tag, {
color: statusColor(unref(previewData).status)
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(statusText(unref(previewData).status))}`);
} else {
return [
createTextVNode(toDisplayString(statusText(unref(previewData).status)), 1)
];
}
}),
_: 1
}, _parent2, _scopeId));
if (unref(previewData).recommend) {
_push2(ssrRenderComponent(_component_a_tag, { color: "gold" }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`推荐`);
} else {
return [
createTextVNode("推荐")
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(``);
}
if (unref(previewData).categoryName) {
_push2(ssrRenderComponent(_component_a_tag, { color: "blue" }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(unref(previewData).categoryName)}`);
} else {
return [
createTextVNode(toDisplayString(unref(previewData).categoryName), 1)
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(``);
}
_push2(`${ssrInterpolate(unref(previewData).createTime?.substring(0, 16) || "-")}
`);
if (unref(previewData).image) {
_push2(`
`);
} else {
_push2(``);
}
if (unref(previewData).overview) {
_push2(`
${ssrInterpolate(unref(previewData).overview)}
`);
} else {
_push2(``);
}
_push2(ssrRenderComponent(_component_a_divider, null, null, _parent2, _scopeId));
_push2(`
`);
if (unref(isPreviewMarkdown)) {
_push2(ssrRenderComponent(MarkdownRenderer, {
content: unref(previewData).content
}, null, _parent2, _scopeId));
} else {
_push2(`
${(unref(previewData).content || unref(previewData).overview || "暂无内容") ?? ""}
`);
}
_push2(`
`);
} else {
_push2(``);
}
} else {
return [
unref(previewData) ? (openBlock(), createBlock(Fragment, { key: 0 }, [
createVNode("div", { class: "preview-meta" }, [
createVNode(_component_a_tag, {
color: statusColor(unref(previewData).status)
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(statusText(unref(previewData).status)), 1)
]),
_: 1
}, 8, ["color"]),
unref(previewData).recommend ? (openBlock(), createBlock(_component_a_tag, {
key: 0,
color: "gold"
}, {
default: withCtx(() => [
createTextVNode("推荐")
]),
_: 1
})) : createCommentVNode("", true),
unref(previewData).categoryName ? (openBlock(), createBlock(_component_a_tag, {
key: 1,
color: "blue"
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(previewData).categoryName), 1)
]),
_: 1
})) : createCommentVNode("", true),
createVNode("span", { class: "preview-meta-text" }, toDisplayString(unref(previewData).createTime?.substring(0, 16) || "-"), 1)
]),
unref(previewData).image ? (openBlock(), createBlock("div", {
key: 0,
class: "preview-cover-wrap"
}, [
createVNode("img", {
src: unref(previewData).image,
class: "preview-cover"
}, null, 8, ["src"])
])) : createCommentVNode("", true),
unref(previewData).overview ? (openBlock(), createBlock("div", {
key: 1,
class: "preview-summary"
}, toDisplayString(unref(previewData).overview), 1)) : createCommentVNode("", true),
createVNode(_component_a_divider),
createVNode("div", { class: "preview-content" }, [
unref(isPreviewMarkdown) ? (openBlock(), createBlock(MarkdownRenderer, {
key: 0,
content: unref(previewData).content
}, null, 8, ["content"])) : (openBlock(), createBlock("div", {
key: 1,
innerHTML: unref(previewData).content || unref(previewData).overview || "暂无内容"
}, null, 8, ["innerHTML"]))
])
], 64)) : createCommentVNode("", true)
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_a_modal, {
open: unref(showImagePreview),
"onUpdate:open": ($event) => isRef(showImagePreview) ? showImagePreview.value = $event : null,
title: "封面预览",
footer: null,
width: "640px"
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
if (unref(previewImageUrl)) {
_push2(`
![]()
`);
} else {
_push2(``);
}
} else {
return [
unref(previewImageUrl) ? (openBlock(), createBlock("img", {
key: 0,
src: unref(previewImageUrl),
class: "image-preview-modal"
}, null, 8, ["src"])) : createCommentVNode("", true)
];
}
}),
_: 1
}, _parent));
_push(`
`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/admin/articles.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const articles = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-fea264b4"]]);
export { articles as default };
//# sourceMappingURL=articles-DR9-Jw1_.mjs.map