Files
jczxw-pc/.output/server/chunks/build/_id_-BuB0HRsp.mjs
赵忠林 528fe28ffc feat(api): 添加多路由代理处理实现
- 新增api目录下多个接口路径代理处理文件,支持动态拼接目标URL
- 根据环境变量选择不同的后端服务地址(如dev和生产环境)
- 统一添加TenantId和Authorization请求头传递租户及身份信息
- 实现请求参数及搜索参数的完整转发
- 引入better-sqlite3及node内建模块支持服务端功能
- 新增专家详情页面,实现文章、成果及预约咨询功能展示
- 页面实现加载骨架屏、标签页切换及空状态提示优化体验
2026-04-28 13:50:27 +08:00

889 lines
48 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { a as _export_sfc, e as useRoute, d as useRouter, c as useHead, _ as __nuxt_component_0 } from './server.mjs';
import { defineComponent, computed, ref, watch, resolveComponent, mergeProps, withCtx, createTextVNode, createVNode, unref, toDisplayString, createBlock, createCommentVNode, openBlock, Fragment, renderList, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate, ssrRenderAttr, ssrRenderList } from 'vue/server-renderer';
import { message } from 'ant-design-vue';
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';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "[id]",
__ssrInlineRender: true,
setup(__props) {
const route = useRoute();
const router = useRouter();
const articleId = computed(() => route.params.id);
const loading = ref(true);
const article = ref({});
const prevArticle = ref(null);
const nextArticle = ref(null);
const relatedArticles = ref([]);
const hotArticles = ref([
{ id: 1, title: "广西数字经济发展报告2024", rank: 1 },
{ id: 2, title: "自治区关于优化营商环境的实施意见", rank: 2 },
{ id: 3, title: "面向东盟的产业合作政策解读", rank: 3 },
{ id: 4, title: "广西乡村振兴战略实施进展报告", rank: 4 },
{ id: 5, title: "北部湾经济区发展最新动态", rank: 5 }
]);
useHead({
title: computed(() => `${article.value?.title || "文章详情"} - 决策咨询网`),
meta: [
{ name: "description", content: computed(() => article.value?.summary || "") }
]
});
async function loadArticle() {
loading.value = true;
try {
article.value = {
id: articleId.value,
title: "广西自治区党委政府关于加快数字经济发展的实施意见",
cover: `https://picsum.photos/900/400?random=${articleId.value}`,
categoryName: "政策要闻",
categoryPath: "/news",
source: "广西壮族自治区人民政府",
author: "政策研究处",
publishTime: "2024-12-20 09:30:00",
views: 1286,
summary: "本意见旨在深入贯彻党中央、国务院关于发展数字经济的战略部署,结合广西实际,加快推进数字产业化和产业数字化,培育壮大数字经济新动能。",
content: `
<h2>一、总体要求</h2>
<p>以习近平新时代中国特色社会主义思想为指导,全面贯彻党的二十大精神,围绕建设数字中国战略部署,立足广西比较优势,坚持创新驱动、数据赋能、融合发展,加快推动数字经济与实体经济深度融合,着力打造面向东盟的数字经济发展高地。</p>
<h2>二、主要目标</h2>
<p>到2026年数字经济核心产业增加值占GDP比重达到12%数字经济总量突破1万亿元数字化转型企业数量超过5000家建成5G基站15万座。</p>
<h2>三、重点任务</h2>
<h3>(一)加快数字基础设施建设</h3>
<p>系统推进新型基础设施建设加快5G、大数据中心、工业互联网等数字基础设施部署构建高速、泛在、天地一体、云网融合、智能敏捷、绿色低碳的新型数字基础设施体系。</p>
<h3>(二)深化数字技术与实体经济融合</h3>
<p>推动制造业、农业、服务业数字化转型,加快工业互联网创新应用,推进数字农业农村建设,促进数字技术与传统产业深度融合。</p>
<h3>(三)培育壮大数字经济核心产业</h3>
<p>重点发展软件和信息技术服务业、大数据、云计算、人工智能、区块链等核心产业,打造广西数字经济核心产业集群。</p>
<h2>四、保障措施</h2>
<p>加强组织领导,完善工作机制,强化政策支持,健全评估体系,确保各项任务落到实处。</p>
`,
tags: ["数字经济", "政策解读", "广西"],
attachments: [
{ name: "广西数字经济发展实施意见(全文).pdf", url: "#", size: "2.4MB" },
{ name: "附件:实施细则.docx", url: "#", size: "856KB" }
]
};
} catch (e) {
message.error("加载失败");
} finally {
loading.value = false;
}
}
function goArticle(item) {
router.push(`/article/${item.id}`);
}
watch(articleId, () => {
loadArticle();
});
return (_ctx, _push, _parent, _attrs) => {
const _component_a_row = resolveComponent("a-row");
const _component_a_col = resolveComponent("a-col");
const _component_a_breadcrumb = resolveComponent("a-breadcrumb");
const _component_a_breadcrumb_item = resolveComponent("a-breadcrumb-item");
const _component_NuxtLink = __nuxt_component_0;
const _component_a_skeleton = resolveComponent("a-skeleton");
const _component_a_result = resolveComponent("a-result");
const _component_a_button = resolveComponent("a-button");
const _component_a_tag = resolveComponent("a-tag");
_push(`<div${ssrRenderAttrs(mergeProps({ class: "article-detail-page" }, _attrs))} data-v-5856018c><div class="mx-auto max-w-screen-xl px-4 py-8" data-v-5856018c>`);
_push(ssrRenderComponent(_component_a_row, { gutter: [32, 0] }, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_a_col, {
xs: 24,
lg: 17
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_a_breadcrumb, { class: "mb-6" }, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_breadcrumb_item, null, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(ssrRenderComponent(_component_NuxtLink, { to: "/" }, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(`首页`);
} else {
return [
createTextVNode("首页")
];
}
}),
_: 1
}, _parent5, _scopeId4));
} else {
return [
createVNode(_component_NuxtLink, { to: "/" }, {
default: withCtx(() => [
createTextVNode("首页")
]),
_: 1
})
];
}
}),
_: 1
}, _parent4, _scopeId3));
if (unref(article).categoryPath) {
_push4(ssrRenderComponent(_component_a_breadcrumb_item, null, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(ssrRenderComponent(_component_NuxtLink, {
to: unref(article).categoryPath
}, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(`${ssrInterpolate(unref(article).categoryName)}`);
} else {
return [
createTextVNode(toDisplayString(unref(article).categoryName), 1)
];
}
}),
_: 1
}, _parent5, _scopeId4));
} else {
return [
createVNode(_component_NuxtLink, {
to: unref(article).categoryPath
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(article).categoryName), 1)
]),
_: 1
}, 8, ["to"])
];
}
}),
_: 1
}, _parent4, _scopeId3));
} else {
_push4(`<!---->`);
}
_push4(ssrRenderComponent(_component_a_breadcrumb_item, null, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`${ssrInterpolate(unref(article).title || "文章详情")}`);
} else {
return [
createTextVNode(toDisplayString(unref(article).title || "文章详情"), 1)
];
}
}),
_: 1
}, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_breadcrumb_item, null, {
default: withCtx(() => [
createVNode(_component_NuxtLink, { to: "/" }, {
default: withCtx(() => [
createTextVNode("首页")
]),
_: 1
})
]),
_: 1
}),
unref(article).categoryPath ? (openBlock(), createBlock(_component_a_breadcrumb_item, { key: 0 }, {
default: withCtx(() => [
createVNode(_component_NuxtLink, {
to: unref(article).categoryPath
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(article).categoryName), 1)
]),
_: 1
}, 8, ["to"])
]),
_: 1
})) : createCommentVNode("", true),
createVNode(_component_a_breadcrumb_item, null, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(article).title || "文章详情"), 1)
]),
_: 1
})
];
}
}),
_: 1
}, _parent3, _scopeId2));
if (unref(loading)) {
_push3(`<div class="article-loading" data-v-5856018c${_scopeId2}>`);
_push3(ssrRenderComponent(_component_a_skeleton, {
active: "",
paragraph: { rows: 12 }
}, null, _parent3, _scopeId2));
_push3(`</div>`);
} else if (!unref(article).id) {
_push3(`<div class="article-empty" data-v-5856018c${_scopeId2}>`);
_push3(ssrRenderComponent(_component_a_result, {
status: "404",
title: "文章不存在",
"sub-title": "您查找的文章不存在或已被删除"
}, {
extra: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_button, {
type: "primary",
onClick: ($event) => _ctx.$router.back()
}, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`返回上一页`);
} else {
return [
createTextVNode("返回上一页")
];
}
}),
_: 1
}, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_button, {
type: "primary",
onClick: ($event) => _ctx.$router.back()
}, {
default: withCtx(() => [
createTextVNode("返回上一页")
]),
_: 1
}, 8, ["onClick"])
];
}
}),
_: 1
}, _parent3, _scopeId2));
_push3(`</div>`);
} else {
_push3(`<article class="article-container" data-v-5856018c${_scopeId2}>`);
if (unref(article).cover) {
_push3(`<div class="article-cover" data-v-5856018c${_scopeId2}><img${ssrRenderAttr("src", unref(article).cover)}${ssrRenderAttr("alt", unref(article).title)} data-v-5856018c${_scopeId2}></div>`);
} else {
_push3(`<!---->`);
}
_push3(`<div class="article-header" data-v-5856018c${_scopeId2}>`);
if (unref(article).categoryName) {
_push3(`<div class="article-category-tag" data-v-5856018c${_scopeId2}>${ssrInterpolate(unref(article).categoryName)}</div>`);
} else {
_push3(`<!---->`);
}
_push3(`<h1 class="article-title" data-v-5856018c${_scopeId2}>${ssrInterpolate(unref(article).title)}</h1><div class="article-meta" data-v-5856018c${_scopeId2}>`);
if (unref(article).source) {
_push3(`<span class="meta-item" data-v-5856018c${_scopeId2}><span class="meta-icon" data-v-5856018c${_scopeId2}>📰</span>来源:${ssrInterpolate(unref(article).source)}</span>`);
} else {
_push3(`<!---->`);
}
if (unref(article).author) {
_push3(`<span class="meta-item" data-v-5856018c${_scopeId2}><span class="meta-icon" data-v-5856018c${_scopeId2}>✍️</span>${ssrInterpolate(unref(article).author)}</span>`);
} else {
_push3(`<!---->`);
}
if (unref(article).publishTime) {
_push3(`<span class="meta-item" data-v-5856018c${_scopeId2}><span class="meta-icon" data-v-5856018c${_scopeId2}>🕐</span>${ssrInterpolate(unref(article).publishTime)}</span>`);
} else {
_push3(`<!---->`);
}
if (unref(article).views) {
_push3(`<span class="meta-item" data-v-5856018c${_scopeId2}><span class="meta-icon" data-v-5856018c${_scopeId2}>👁</span>${ssrInterpolate(unref(article).views)} 次阅读 </span>`);
} else {
_push3(`<!---->`);
}
_push3(`</div></div>`);
if (unref(article).summary) {
_push3(`<div class="article-summary" data-v-5856018c${_scopeId2}><div class="summary-label" data-v-5856018c${_scopeId2}>摘要</div><p data-v-5856018c${_scopeId2}>${ssrInterpolate(unref(article).summary)}</p></div>`);
} else {
_push3(`<!---->`);
}
_push3(`<div class="article-body" data-v-5856018c${_scopeId2}>${unref(article).content ?? ""}</div>`);
if (unref(article).attachments && unref(article).attachments.length) {
_push3(`<div class="article-attachments" data-v-5856018c${_scopeId2}><div class="attachments-title" data-v-5856018c${_scopeId2}>📎 相关附件</div><div class="attachments-list" data-v-5856018c${_scopeId2}><!--[-->`);
ssrRenderList(unref(article).attachments, (file) => {
_push3(`<a${ssrRenderAttr("href", file.url)} target="_blank" class="attachment-item" data-v-5856018c${_scopeId2}><span class="attachment-icon" data-v-5856018c${_scopeId2}>📄</span><span class="attachment-name" data-v-5856018c${_scopeId2}>${ssrInterpolate(file.name)}</span><span class="attachment-size" data-v-5856018c${_scopeId2}>${ssrInterpolate(file.size)}</span></a>`);
});
_push3(`<!--]--></div></div>`);
} else {
_push3(`<!---->`);
}
if (unref(article).tags && unref(article).tags.length) {
_push3(`<div class="article-tags" data-v-5856018c${_scopeId2}><span class="tags-label" data-v-5856018c${_scopeId2}>标签:</span><!--[-->`);
ssrRenderList(unref(article).tags, (tag) => {
_push3(ssrRenderComponent(_component_a_tag, {
key: tag,
color: "blue"
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(`${ssrInterpolate(tag)}`);
} else {
return [
createTextVNode(toDisplayString(tag), 1)
];
}
}),
_: 2
}, _parent3, _scopeId2));
});
_push3(`<!--]--></div>`);
} else {
_push3(`<!---->`);
}
_push3(`<div class="article-disclaimer" data-v-5856018c${_scopeId2}><p data-v-5856018c${_scopeId2}>声明:本文内容仅代表作者本人观点,不代表本网站立场。如有侵权请联系我们删除。</p></div><div class="article-nav" data-v-5856018c${_scopeId2}>`);
if (unref(prevArticle)) {
_push3(`<div class="nav-prev" data-v-5856018c${_scopeId2}><span class="nav-dir" data-v-5856018c${_scopeId2}>« 上一篇</span><span class="nav-title" data-v-5856018c${_scopeId2}>${ssrInterpolate(unref(prevArticle).title)}</span></div>`);
} else {
_push3(`<!---->`);
}
if (unref(nextArticle)) {
_push3(`<div class="nav-next" data-v-5856018c${_scopeId2}><span class="nav-title" data-v-5856018c${_scopeId2}>${ssrInterpolate(unref(nextArticle).title)}</span><span class="nav-dir" data-v-5856018c${_scopeId2}>下一篇 »</span></div>`);
} else {
_push3(`<!---->`);
}
_push3(`</div></article>`);
}
} else {
return [
createVNode(_component_a_breadcrumb, { class: "mb-6" }, {
default: withCtx(() => [
createVNode(_component_a_breadcrumb_item, null, {
default: withCtx(() => [
createVNode(_component_NuxtLink, { to: "/" }, {
default: withCtx(() => [
createTextVNode("首页")
]),
_: 1
})
]),
_: 1
}),
unref(article).categoryPath ? (openBlock(), createBlock(_component_a_breadcrumb_item, { key: 0 }, {
default: withCtx(() => [
createVNode(_component_NuxtLink, {
to: unref(article).categoryPath
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(article).categoryName), 1)
]),
_: 1
}, 8, ["to"])
]),
_: 1
})) : createCommentVNode("", true),
createVNode(_component_a_breadcrumb_item, null, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(article).title || "文章详情"), 1)
]),
_: 1
})
]),
_: 1
}),
unref(loading) ? (openBlock(), createBlock("div", {
key: 0,
class: "article-loading"
}, [
createVNode(_component_a_skeleton, {
active: "",
paragraph: { rows: 12 }
})
])) : !unref(article).id ? (openBlock(), createBlock("div", {
key: 1,
class: "article-empty"
}, [
createVNode(_component_a_result, {
status: "404",
title: "文章不存在",
"sub-title": "您查找的文章不存在或已被删除"
}, {
extra: withCtx(() => [
createVNode(_component_a_button, {
type: "primary",
onClick: ($event) => _ctx.$router.back()
}, {
default: withCtx(() => [
createTextVNode("返回上一页")
]),
_: 1
}, 8, ["onClick"])
]),
_: 1
})
])) : (openBlock(), createBlock("article", {
key: 2,
class: "article-container"
}, [
unref(article).cover ? (openBlock(), createBlock("div", {
key: 0,
class: "article-cover"
}, [
createVNode("img", {
src: unref(article).cover,
alt: unref(article).title
}, null, 8, ["src", "alt"])
])) : createCommentVNode("", true),
createVNode("div", { class: "article-header" }, [
unref(article).categoryName ? (openBlock(), createBlock("div", {
key: 0,
class: "article-category-tag"
}, toDisplayString(unref(article).categoryName), 1)) : createCommentVNode("", true),
createVNode("h1", { class: "article-title" }, toDisplayString(unref(article).title), 1),
createVNode("div", { class: "article-meta" }, [
unref(article).source ? (openBlock(), createBlock("span", {
key: 0,
class: "meta-item"
}, [
createVNode("span", { class: "meta-icon" }, "📰"),
createTextVNode("来源:" + toDisplayString(unref(article).source), 1)
])) : createCommentVNode("", true),
unref(article).author ? (openBlock(), createBlock("span", {
key: 1,
class: "meta-item"
}, [
createVNode("span", { class: "meta-icon" }, "✍️"),
createTextVNode(toDisplayString(unref(article).author), 1)
])) : createCommentVNode("", true),
unref(article).publishTime ? (openBlock(), createBlock("span", {
key: 2,
class: "meta-item"
}, [
createVNode("span", { class: "meta-icon" }, "🕐"),
createTextVNode(toDisplayString(unref(article).publishTime), 1)
])) : createCommentVNode("", true),
unref(article).views ? (openBlock(), createBlock("span", {
key: 3,
class: "meta-item"
}, [
createVNode("span", { class: "meta-icon" }, "👁"),
createTextVNode(toDisplayString(unref(article).views) + " 次阅读 ", 1)
])) : createCommentVNode("", true)
])
]),
unref(article).summary ? (openBlock(), createBlock("div", {
key: 1,
class: "article-summary"
}, [
createVNode("div", { class: "summary-label" }, "摘要"),
createVNode("p", null, toDisplayString(unref(article).summary), 1)
])) : createCommentVNode("", true),
createVNode("div", {
class: "article-body",
innerHTML: unref(article).content
}, null, 8, ["innerHTML"]),
unref(article).attachments && unref(article).attachments.length ? (openBlock(), createBlock("div", {
key: 2,
class: "article-attachments"
}, [
createVNode("div", { class: "attachments-title" }, "📎 相关附件"),
createVNode("div", { class: "attachments-list" }, [
(openBlock(true), createBlock(Fragment, null, renderList(unref(article).attachments, (file) => {
return openBlock(), createBlock("a", {
key: file.url,
href: file.url,
target: "_blank",
class: "attachment-item"
}, [
createVNode("span", { class: "attachment-icon" }, "📄"),
createVNode("span", { class: "attachment-name" }, toDisplayString(file.name), 1),
createVNode("span", { class: "attachment-size" }, toDisplayString(file.size), 1)
], 8, ["href"]);
}), 128))
])
])) : createCommentVNode("", true),
unref(article).tags && unref(article).tags.length ? (openBlock(), createBlock("div", {
key: 3,
class: "article-tags"
}, [
createVNode("span", { class: "tags-label" }, "标签:"),
(openBlock(true), createBlock(Fragment, null, renderList(unref(article).tags, (tag) => {
return openBlock(), createBlock(_component_a_tag, {
key: tag,
color: "blue"
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(tag), 1)
]),
_: 2
}, 1024);
}), 128))
])) : createCommentVNode("", true),
createVNode("div", { class: "article-disclaimer" }, [
createVNode("p", null, "声明:本文内容仅代表作者本人观点,不代表本网站立场。如有侵权请联系我们删除。")
]),
createVNode("div", { class: "article-nav" }, [
unref(prevArticle) ? (openBlock(), createBlock("div", {
key: 0,
class: "nav-prev",
onClick: ($event) => goArticle(unref(prevArticle))
}, [
createVNode("span", { class: "nav-dir" }, "« 上一篇"),
createVNode("span", { class: "nav-title" }, toDisplayString(unref(prevArticle).title), 1)
], 8, ["onClick"])) : createCommentVNode("", true),
unref(nextArticle) ? (openBlock(), createBlock("div", {
key: 1,
class: "nav-next",
onClick: ($event) => goArticle(unref(nextArticle))
}, [
createVNode("span", { class: "nav-title" }, toDisplayString(unref(nextArticle).title), 1),
createVNode("span", { class: "nav-dir" }, "下一篇 »")
], 8, ["onClick"])) : createCommentVNode("", true)
])
]))
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_a_col, {
xs: 0,
lg: 7,
class: "hidden lg:block"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`<div class="sidebar" data-v-5856018c${_scopeId2}><div class="sidebar-card" data-v-5856018c${_scopeId2}><div class="sidebar-title" data-v-5856018c${_scopeId2}>相关文章</div><div class="related-list" data-v-5856018c${_scopeId2}><!--[-->`);
ssrRenderList(unref(relatedArticles), (item) => {
_push3(`<div class="related-item" data-v-5856018c${_scopeId2}><span class="related-dot" data-v-5856018c${_scopeId2}></span><span class="related-title" data-v-5856018c${_scopeId2}>${ssrInterpolate(item.title)}</span></div>`);
});
_push3(`<!--]-->`);
if (!unref(relatedArticles).length) {
_push3(`<div class="related-empty" data-v-5856018c${_scopeId2}>暂无相关文章</div>`);
} else {
_push3(`<!---->`);
}
_push3(`</div></div><div class="sidebar-card mt-6" data-v-5856018c${_scopeId2}><div class="sidebar-title" data-v-5856018c${_scopeId2}>热门推荐</div><div class="related-list" data-v-5856018c${_scopeId2}><!--[-->`);
ssrRenderList(unref(hotArticles), (item) => {
_push3(`<div class="related-item hot-item" data-v-5856018c${_scopeId2}><span class="hot-rank" data-v-5856018c${_scopeId2}>${ssrInterpolate(item.rank)}</span><span class="related-title" data-v-5856018c${_scopeId2}>${ssrInterpolate(item.title)}</span></div>`);
});
_push3(`<!--]--></div></div></div>`);
} else {
return [
createVNode("div", { class: "sidebar" }, [
createVNode("div", { class: "sidebar-card" }, [
createVNode("div", { class: "sidebar-title" }, "相关文章"),
createVNode("div", { class: "related-list" }, [
(openBlock(true), createBlock(Fragment, null, renderList(unref(relatedArticles), (item) => {
return openBlock(), createBlock("div", {
key: item.id,
class: "related-item",
onClick: ($event) => goArticle(item)
}, [
createVNode("span", { class: "related-dot" }, ""),
createVNode("span", { class: "related-title" }, toDisplayString(item.title), 1)
], 8, ["onClick"]);
}), 128)),
!unref(relatedArticles).length ? (openBlock(), createBlock("div", {
key: 0,
class: "related-empty"
}, "暂无相关文章")) : createCommentVNode("", true)
])
]),
createVNode("div", { class: "sidebar-card mt-6" }, [
createVNode("div", { class: "sidebar-title" }, "热门推荐"),
createVNode("div", { class: "related-list" }, [
(openBlock(true), createBlock(Fragment, null, renderList(unref(hotArticles), (item) => {
return openBlock(), createBlock("div", {
key: item.id,
class: "related-item hot-item",
onClick: ($event) => goArticle(item)
}, [
createVNode("span", { class: "hot-rank" }, toDisplayString(item.rank), 1),
createVNode("span", { class: "related-title" }, toDisplayString(item.title), 1)
], 8, ["onClick"]);
}), 128))
])
])
])
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_a_col, {
xs: 24,
lg: 17
}, {
default: withCtx(() => [
createVNode(_component_a_breadcrumb, { class: "mb-6" }, {
default: withCtx(() => [
createVNode(_component_a_breadcrumb_item, null, {
default: withCtx(() => [
createVNode(_component_NuxtLink, { to: "/" }, {
default: withCtx(() => [
createTextVNode("首页")
]),
_: 1
})
]),
_: 1
}),
unref(article).categoryPath ? (openBlock(), createBlock(_component_a_breadcrumb_item, { key: 0 }, {
default: withCtx(() => [
createVNode(_component_NuxtLink, {
to: unref(article).categoryPath
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(article).categoryName), 1)
]),
_: 1
}, 8, ["to"])
]),
_: 1
})) : createCommentVNode("", true),
createVNode(_component_a_breadcrumb_item, null, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(article).title || "文章详情"), 1)
]),
_: 1
})
]),
_: 1
}),
unref(loading) ? (openBlock(), createBlock("div", {
key: 0,
class: "article-loading"
}, [
createVNode(_component_a_skeleton, {
active: "",
paragraph: { rows: 12 }
})
])) : !unref(article).id ? (openBlock(), createBlock("div", {
key: 1,
class: "article-empty"
}, [
createVNode(_component_a_result, {
status: "404",
title: "文章不存在",
"sub-title": "您查找的文章不存在或已被删除"
}, {
extra: withCtx(() => [
createVNode(_component_a_button, {
type: "primary",
onClick: ($event) => _ctx.$router.back()
}, {
default: withCtx(() => [
createTextVNode("返回上一页")
]),
_: 1
}, 8, ["onClick"])
]),
_: 1
})
])) : (openBlock(), createBlock("article", {
key: 2,
class: "article-container"
}, [
unref(article).cover ? (openBlock(), createBlock("div", {
key: 0,
class: "article-cover"
}, [
createVNode("img", {
src: unref(article).cover,
alt: unref(article).title
}, null, 8, ["src", "alt"])
])) : createCommentVNode("", true),
createVNode("div", { class: "article-header" }, [
unref(article).categoryName ? (openBlock(), createBlock("div", {
key: 0,
class: "article-category-tag"
}, toDisplayString(unref(article).categoryName), 1)) : createCommentVNode("", true),
createVNode("h1", { class: "article-title" }, toDisplayString(unref(article).title), 1),
createVNode("div", { class: "article-meta" }, [
unref(article).source ? (openBlock(), createBlock("span", {
key: 0,
class: "meta-item"
}, [
createVNode("span", { class: "meta-icon" }, "📰"),
createTextVNode("来源:" + toDisplayString(unref(article).source), 1)
])) : createCommentVNode("", true),
unref(article).author ? (openBlock(), createBlock("span", {
key: 1,
class: "meta-item"
}, [
createVNode("span", { class: "meta-icon" }, "✍️"),
createTextVNode(toDisplayString(unref(article).author), 1)
])) : createCommentVNode("", true),
unref(article).publishTime ? (openBlock(), createBlock("span", {
key: 2,
class: "meta-item"
}, [
createVNode("span", { class: "meta-icon" }, "🕐"),
createTextVNode(toDisplayString(unref(article).publishTime), 1)
])) : createCommentVNode("", true),
unref(article).views ? (openBlock(), createBlock("span", {
key: 3,
class: "meta-item"
}, [
createVNode("span", { class: "meta-icon" }, "👁"),
createTextVNode(toDisplayString(unref(article).views) + " 次阅读 ", 1)
])) : createCommentVNode("", true)
])
]),
unref(article).summary ? (openBlock(), createBlock("div", {
key: 1,
class: "article-summary"
}, [
createVNode("div", { class: "summary-label" }, "摘要"),
createVNode("p", null, toDisplayString(unref(article).summary), 1)
])) : createCommentVNode("", true),
createVNode("div", {
class: "article-body",
innerHTML: unref(article).content
}, null, 8, ["innerHTML"]),
unref(article).attachments && unref(article).attachments.length ? (openBlock(), createBlock("div", {
key: 2,
class: "article-attachments"
}, [
createVNode("div", { class: "attachments-title" }, "📎 相关附件"),
createVNode("div", { class: "attachments-list" }, [
(openBlock(true), createBlock(Fragment, null, renderList(unref(article).attachments, (file) => {
return openBlock(), createBlock("a", {
key: file.url,
href: file.url,
target: "_blank",
class: "attachment-item"
}, [
createVNode("span", { class: "attachment-icon" }, "📄"),
createVNode("span", { class: "attachment-name" }, toDisplayString(file.name), 1),
createVNode("span", { class: "attachment-size" }, toDisplayString(file.size), 1)
], 8, ["href"]);
}), 128))
])
])) : createCommentVNode("", true),
unref(article).tags && unref(article).tags.length ? (openBlock(), createBlock("div", {
key: 3,
class: "article-tags"
}, [
createVNode("span", { class: "tags-label" }, "标签:"),
(openBlock(true), createBlock(Fragment, null, renderList(unref(article).tags, (tag) => {
return openBlock(), createBlock(_component_a_tag, {
key: tag,
color: "blue"
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(tag), 1)
]),
_: 2
}, 1024);
}), 128))
])) : createCommentVNode("", true),
createVNode("div", { class: "article-disclaimer" }, [
createVNode("p", null, "声明:本文内容仅代表作者本人观点,不代表本网站立场。如有侵权请联系我们删除。")
]),
createVNode("div", { class: "article-nav" }, [
unref(prevArticle) ? (openBlock(), createBlock("div", {
key: 0,
class: "nav-prev",
onClick: ($event) => goArticle(unref(prevArticle))
}, [
createVNode("span", { class: "nav-dir" }, "« 上一篇"),
createVNode("span", { class: "nav-title" }, toDisplayString(unref(prevArticle).title), 1)
], 8, ["onClick"])) : createCommentVNode("", true),
unref(nextArticle) ? (openBlock(), createBlock("div", {
key: 1,
class: "nav-next",
onClick: ($event) => goArticle(unref(nextArticle))
}, [
createVNode("span", { class: "nav-title" }, toDisplayString(unref(nextArticle).title), 1),
createVNode("span", { class: "nav-dir" }, "下一篇 »")
], 8, ["onClick"])) : createCommentVNode("", true)
])
]))
]),
_: 1
}),
createVNode(_component_a_col, {
xs: 0,
lg: 7,
class: "hidden lg:block"
}, {
default: withCtx(() => [
createVNode("div", { class: "sidebar" }, [
createVNode("div", { class: "sidebar-card" }, [
createVNode("div", { class: "sidebar-title" }, "相关文章"),
createVNode("div", { class: "related-list" }, [
(openBlock(true), createBlock(Fragment, null, renderList(unref(relatedArticles), (item) => {
return openBlock(), createBlock("div", {
key: item.id,
class: "related-item",
onClick: ($event) => goArticle(item)
}, [
createVNode("span", { class: "related-dot" }, ""),
createVNode("span", { class: "related-title" }, toDisplayString(item.title), 1)
], 8, ["onClick"]);
}), 128)),
!unref(relatedArticles).length ? (openBlock(), createBlock("div", {
key: 0,
class: "related-empty"
}, "暂无相关文章")) : createCommentVNode("", true)
])
]),
createVNode("div", { class: "sidebar-card mt-6" }, [
createVNode("div", { class: "sidebar-title" }, "热门推荐"),
createVNode("div", { class: "related-list" }, [
(openBlock(true), createBlock(Fragment, null, renderList(unref(hotArticles), (item) => {
return openBlock(), createBlock("div", {
key: item.id,
class: "related-item hot-item",
onClick: ($event) => goArticle(item)
}, [
createVNode("span", { class: "hot-rank" }, toDisplayString(item.rank), 1),
createVNode("span", { class: "related-title" }, toDisplayString(item.title), 1)
], 8, ["onClick"]);
}), 128))
])
])
])
]),
_: 1
})
];
}
}),
_: 1
}, _parent));
_push(`</div></div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/article/[id].vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const _id_ = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5856018c"]]);
export { _id_ as default };
//# sourceMappingURL=_id_-BuB0HRsp.mjs.map