import { _ as __nuxt_component_0 } from './HeaderImage-92nFA80c.mjs'; import { _ as __nuxt_component_1 } from './TabsHeader-C0yMA2hS.mjs'; import { _ as __nuxt_component_1$1 } from './CustomTitle-2eWUrzRV.mjs'; import { defineComponent, computed, withAsyncContext, mergeProps, isRef, unref, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate, ssrRenderList, ssrRenderAttr } from 'vue/server-renderer'; import { u as useRequest } from './useRequest-pSRZvR3u.mjs'; import { u as useRoute, n as navigateTo } from './server.mjs'; import { u as useAsyncData } from './asyncData-D5wEK86T.mjs'; import { u as useSeoMeta } from './composables-2BFBRDmB.mjs'; import './virtual_public-Ch4_18y6.mjs'; import '../routes/renderer.mjs'; import 'vue-bundle-renderer/runtime'; 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 'unhead/server'; import 'devalue'; import 'unhead/plugins'; import 'unhead/utils'; import 'vue-router'; import 'axios'; import 'perfect-debounce'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "[id]", __ssrInlineRender: true, async setup(__props) { let __temp, __restore; const route = useRoute(); const request = useRequest(); const cateId = computed(() => String(route.params.id || "")); const { data: tabsRes } = ([__temp, __restore] = withAsyncContext(async () => useAsyncData( "business-tabs", async () => await request.get("/api/project_cates") )), __temp = await __temp, __restore(), __temp); const tabList = computed(() => { const res = tabsRes.value; if (!res || res.code !== 200 || !Array.isArray(res.data)) return []; return res.data.map((item) => ({ id: String(item.id), name: item.title })); }); const activeTabModel = computed({ get: () => cateId.value, set: (val) => { const next = String(val || ""); if (!next || next === cateId.value) return; navigateTo(`/business/${next}`); } }); const { data: detailRes } = ([__temp, __restore] = withAsyncContext(async () => useAsyncData( () => `business-detail-${cateId.value}`, async () => await request.get( `/api/project_cates/${cateId.value}` ), { watch: [cateId] } )), __temp = await __temp, __restore(), __temp); const currentTabInfoData = computed(() => { const res = detailRes.value; if (!res || res.code !== 200 || !res.data) return null; const d = res.data; return { name: d.title, description: d.description, dataList: (d.children || []).map((c) => ({ title: c.title, content: c.description || "", url: c.cover })), serviceProcess: d.flows?.cover || "", professionalEquipments: (d.photos || []).map((p) => p.cover), coreAdvantages: (d.advances || []).map((a) => ({ title: a.title, content: a.description || "", url: a.cover })) }; }); useSeoMeta({ title: () => currentTabInfoData.value?.name ? `${currentTabInfoData.value.name} - 业务范围` : "业务范围", description: () => { const first = currentTabInfoData.value?.dataList?.[0]?.content; return first ? first : "业务范围"; }, ogTitle: () => currentTabInfoData.value?.name ? `${currentTabInfoData.value.name} - 业务范围` : "业务范围", ogDescription: () => { const first = currentTabInfoData.value?.dataList?.[0]?.content; return first ? first : "业务范围"; }, ogImage: () => { const first = currentTabInfoData.value?.professionalEquipments?.[0] || currentTabInfoData.value?.serviceProcess || ""; return first || void 0; } }); return (_ctx, _push, _parent, _attrs) => { const _component_HeaderImage = __nuxt_component_0; const _component_TabsHeader = __nuxt_component_1; const _component_CustomTitle = __nuxt_component_1$1; _push(``); _push(ssrRenderComponent(_component_HeaderImage, { title: "业务范围", img: "/images/业务范围/业务范围.png" }, null, _parent)); _push(ssrRenderComponent(_component_TabsHeader, { tabs: unref(tabList), activeTab: unref(activeTabModel), "onUpdate:activeTab": ($event) => isRef(activeTabModel) ? activeTabModel.value = $event : null, title: "业务范围" }, null, _parent)); _push(`
`); if ((unref(currentTabInfoData)?.dataList || []).length > 0) { _push(`
`); _push(ssrRenderComponent(_component_CustomTitle, { title: unref(currentTabInfoData)?.name || "" }, null, _parent)); if (unref(currentTabInfoData)?.description) { _push(`

${ssrInterpolate(unref(currentTabInfoData)?.description || "")}

`); } else { _push(``); } _push(`
`); ssrRenderList(unref(currentTabInfoData)?.dataList || [], (data) => { _push(`
${ssrInterpolate(data.title)}

${ssrInterpolate(data.content)}

`); }); _push(`
`); } else { _push(``); } if (unref(currentTabInfoData)?.serviceProcess) { _push(`

服务流程

`); } else { _push(``); } if ((unref(currentTabInfoData)?.professionalEquipments || []).length > 0) { _push(`

专业设备

`); ssrRenderList(unref(currentTabInfoData)?.professionalEquipments, (cur) => { _push(`
`); }); _push(`
`); } else { _push(``); } if ((unref(currentTabInfoData)?.coreAdvantages || []).length > 0) { _push(`

核心优势

`); ssrRenderList(unref(currentTabInfoData)?.coreAdvantages || [], (coreAdvantage) => { _push(`

${ssrInterpolate(coreAdvantage.title)}

${ssrInterpolate(coreAdvantage.content)}

`); }); _push(`
`); } else { _push(``); } _push(`
`); }; } }); const _sfc_setup = _sfc_main.setup; _sfc_main.setup = (props, ctx) => { const ssrContext = useSSRContext(); (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/business/[id].vue"); return _sfc_setup ? _sfc_setup(props, ctx) : void 0; }; export { _sfc_main as default }; //# sourceMappingURL=_id_-Drbm_L59.mjs.map