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(`
超管 / 管理员 / 代理 / 运营。代理·运营可绑定应用·区域·产品,登录后仪表盘按绑定限制。
| 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(` |