import { _ as __nuxt_component_0 } from './nuxt-link-BpF9-8DI.mjs';
import { defineComponent, computed, mergeProps, unref, withCtx, openBlock, createBlock, createVNode, createTextVNode, toDisplayString, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderStyle, ssrInterpolate, ssrRenderList, ssrRenderComponent, ssrRenderAttr, ssrRenderSlot, ssrRenderClass } from 'vue/server-renderer';
import { u as useToast } from './useToast-CS21XT61.mjs';
import { u as useLoading } from './useLoading-D4zrSa2m.mjs';
import { a as useRouter, b as useRoute$1, _ as _export_sfc } from './server.mjs';
import { u as useAuthStore } from './auth-QFkCoU1C.mjs';
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 '../routes/renderer.mjs';
import 'vue-bundle-renderer/runtime';
import 'unhead/server';
import 'devalue';
import 'unhead/utils';
import 'pinia';
import 'perfect-debounce';
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
__name: "AppToast",
__ssrInlineRender: true,
setup(__props) {
const { toasts } = useToast();
function alertClass(type) {
switch (type) {
case "success":
return "alert-success";
case "error":
return "alert-error";
case "warning":
return "alert-warning";
case "info":
default:
return "alert-info";
}
}
return (_ctx, _push, _parent, _attrs) => {
_push(`
`);
ssrRenderList(unref(toasts), (t) => {
_push(`
${ssrInterpolate(t.msg)}
`);
});
_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/AppToast.vue");
return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
};
const __nuxt_component_1 = Object.assign(_sfc_main$2, { __name: "AppToast" });
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
__name: "AppLoading",
__ssrInlineRender: true,
setup(__props) {
const { loading } = useLoading();
return (_ctx, _push, _parent, _attrs) => {
if (unref(loading)) {
_push(``);
} else {
_push(``);
}
};
}
});
const _sfc_setup$1 = _sfc_main$1.setup;
_sfc_main$1.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/AppLoading.vue");
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const __nuxt_component_2 = /* @__PURE__ */ Object.assign(_export_sfc(_sfc_main$1, [["__scopeId", "data-v-c1ace0c2"]]), { __name: "AppLoading" });
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "default",
__ssrInlineRender: true,
setup(__props) {
const auth = useAuthStore();
useRouter();
const route = useRoute$1();
const identityLabel = computed(() => {
const map = { 1: "超级管理员", 2: "管理员", 3: "代理", 4: "运营" };
return map[auth.identity] ?? "";
});
const identityLabelShort = computed(() => {
const map = { 1: "超管", 2: "管理员", 3: "代理", 4: "运营" };
return map[auth.identity] ?? "";
});
const avatarChar = computed(() => (auth.account || "A").charAt(0).toUpperCase());
const menuGroups = [
{
label: "数据概览",
items: [
{ id: "dashboard", label: "仪表盘", to: "/dashboard", icon: "M9 17v-2m3 2v-4m3 4v-6m2 10H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }
]
},
{
label: "生产管理",
items: [
{ id: "provider", label: "方案商管理", to: "/provider", icon: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" },
{ id: "factory", label: "品牌商管理", to: "/factory", icon: "M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4" },
{ id: "product", label: "产品管理", to: "/product", icon: "M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4" },
{ id: "code", label: "公码管理", to: "/code", icon: "M4 4h6v6H4V4zm10 0h6v6h-6V4zM4 14h6v6H4v-6zm10 2h2m-2 4h6m-4-4v4m4-8h2m-2 0v4" },
{ id: "device", label: "生产管理", to: "/device", icon: "M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" }
]
},
{
label: "用户管理",
items: [
{ id: "user", label: "用户查询", to: "/users", icon: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }
]
},
{
label: "服务配置",
items: [
{ id: "globalconfig", label: "全局环境配置", to: "/globalconfig", icon: "M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9" },
{ id: "mcpconfig", label: "MCP配置", to: "/mcpconfig", icon: "M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-3-4h.01M16 16h.01" },
{ id: "meettemplate", label: "会议模板", to: "/meettemplates", icon: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" },
{ id: "svcconfig", label: "第三方服务配置", to: "/serviceconfig", icon: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z" },
{ id: "meetingsvc", label: "会议记录服务", to: "/meetingsvc", icon: "M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" },
{ id: "calltranslate", label: "通话翻译配置", to: "/calltranslate", icon: "M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129" }
]
},
{
label: "SaaS 管理",
items: [
{ id: "apps", label: "应用中心", to: "/apps", icon: "M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" },
{ id: "environments", label: "环境节点", to: "/environments", icon: "M5 3h14a2 2 0 012 2v4a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2zM5 13h14a2 2 0 012 2v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4a2 2 0 012-2zM7 7h.01M7 17h.01" }
]
},
{
label: "系统管理",
items: [
{ id: "systemconfig", label: "系统配置", to: "/systemconfig", icon: "M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4" },
{ id: "statlog", label: "统计日志", to: "/statlog", icon: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4" },
{ id: "admin", label: "后台账号", to: "/accounts", icon: "M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z" }
]
}
];
function hasVisibleItems(group) {
return group.items.some((item) => auth.hasAccess(item.id));
}
const pageTitle = computed(() => {
if (route.meta?.title) return route.meta.title;
for (const g of menuGroups) {
const item = g.items.find((m) => route.path.startsWith(m.to));
if (item) return item.label;
}
return "Console";
});
return (_ctx, _push, _parent, _attrs) => {
const _component_NuxtLink = __nuxt_component_0;
const _component_AppToast = __nuxt_component_1;
const _component_AppLoading = __nuxt_component_2;
_push(``);
_push(ssrRenderComponent(_component_AppToast, null, null, _parent));
_push(ssrRenderComponent(_component_AppLoading, null, null, _parent));
_push(``);
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
_push(`
`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("layouts/default.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };
//# sourceMappingURL=default-B-A39ome.mjs.map