import { defineComponent, ref, reactive, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrRenderStyle, ssrRenderList, ssrInterpolate, ssrRenderClass, ssrRenderAttr, ssrIncludeBooleanAttr, ssrLooseContain, ssrLooseEqual } from 'vue/server-renderer'; import { u as useApi } from './useApi-DMQewX5_.mjs'; import { u as useToast } from './useToast-CS21XT61.mjs'; import { _ as _export_sfc } from './server.mjs'; import './auth-QFkCoU1C.mjs'; import 'pinia'; import './useLoading-D4zrSa2m.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 'perfect-debounce'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "accounts", __ssrInlineRender: true, setup(__props) { useApi(); useToast(); const ROLE = { 1: "超管", 2: "管理员", 3: "代理", 4: "运营" }; const ROLE_CLS = { 1: "badge-error", 2: "badge-primary", 3: "badge-warning", 4: "badge-info" }; const ACCESS_PAGES = [["dashboard", "仪表盘"], ["factory", "厂家管理"], ["product", "产品管理"], ["device", "生产管理"], ["code", "公码管理"], ["user", "用户查询"], ["apps", "应用注册"]]; const REGIONS = [["cn", "中国"], ["us", "美国"], ["ea", "东亚"], ["sea", "东南亚"], ["sa", "南亚"], ["me", "中东"], ["eu", "欧洲"], ["ru", "俄罗斯"], ["af", "非洲"], ["sam", "南美"], ["nam", "北美"], ["oc", "大洋洲"], ["br", "巴西"], ["in", "印度"]]; const view = ref("list"); const rows = ref([]); const apps = ref([]); const loading = ref(false); const submitting = ref(false); const editId = ref(0); const form = reactive({ username: "", password: "", identity: 2, enabled: "1", remark: "" }); const sel = reactive({ access: [], apps: [], regions: [], products: [] }); const productGroups = ref([]); const prodLoading = ref(false); function fromCsv(s) { return (s || "").split(",").map((x) => x.trim()).filter((x) => x); } function scopeParts(a) { const parts = []; if (a.apps) parts.push("应用:" + fromCsv(a.apps).length); if (a.regions) parts.push("区域:" + fromCsv(a.regions).length); if (a.products) parts.push("产品:" + fromCsv(a.products).length); if (a.access) parts.push("页面:" + fromCsv(a.access).length); return parts; } ref(null); ref(0); const topup = reactive({ name: "", cur: "", vipday: 0, trademin: 0, meetmin: 0 }); return (_ctx, _push, _parent, _attrs) => { _push(`

后台账号

超管 / 管理员 / 代理 / 运营。代理·运营可绑定应用·区域·产品,登录后仪表盘按绑定限制。

`); if (loading.value) { _push(``); } else if (!rows.value.length) { _push(``); } else { _push(``); } _push(``); ssrRenderList(rows.value, (a) => { _push(``); }); _push(`
ID用户名角色状态绑定作用域备注操作
加载中...
暂无账号(引导超管不在此列)
${ssrInterpolate(a.id)}${ssrInterpolate(a.username || "")}${ssrInterpolate(ROLE[a.identity] || a.identity)}`); if (a.enabled) { _push(`启用`); } else { _push(`停用`); } _push(``); if (a.identity === 3 || a.identity === 4) { _push(``); if (scopeParts(a).length) { _push(`${ssrInterpolate(scopeParts(a).join(" · "))}`); } else { _push(`未绑定(不限)`); } _push(``); } else { _push(`全部权限`); } if (a.identity === 3) { _push(`
余额 VIP${ssrInterpolate(a.balance_vipday || 0)}天 · 翻译${ssrInterpolate(a.balance_trademin || 0)}分 · 会议${ssrInterpolate(a.balance_meetmin || 0)}分
`); } else { _push(``); } _push(`
${ssrInterpolate(a.remark || "")}
`); if (a.identity === 3) { _push(``); } else { _push(``); } _push(`

${ssrInterpolate(editId.value ? "编辑账号 #" + editId.value : "新建账号")}

作用域绑定 (代理/运营生效;勾选可访问页面,并限制仪表盘数据范围)
可访问页面
`); ssrRenderList(ACCESS_PAGES, (p) => { _push(``); }); _push(`
绑定应用 (仪表盘只显示这些应用数据;不勾=不限)
`); if (apps.value.length) { _push(``); ssrRenderList(apps.value, (a) => { _push(``); }); _push(``); } else { _push(`无注册应用`); } _push(`
绑定区域 (不勾=不限)
`); ssrRenderList(REGIONS, (r) => { _push(``); }); _push(`
绑定产品 (按厂家分组;仪表盘只显示这些产品数据;不勾=不限)
`); if (prodLoading.value) { _push(`加载产品中...`); } else if (!productGroups.value.length) { _push(`无产品`); } else { _push(``); ssrRenderList(productGroups.value, (g) => { _push(`
🏭 ${ssrInterpolate(g.label)}
`); ssrRenderList(g.products, (p) => { _push(``); }); _push(`
`); }); _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/accounts.vue"); return _sfc_setup ? _sfc_setup(props, ctx) : void 0; }; const accounts = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-eb25cf37"]]); export { accounts as default }; //# sourceMappingURL=accounts-DMzzARF9.mjs.map