UNPKG

quick-admin-vue3-core

Version:

以快(计算机执行效率、开发效率)为核心的后台管理系统开发模板

457 lines (456 loc) 8.59 kB
import { m as A, t as E, n as N, o as c } from "./index-C0qRtkRj.js"; import { u as g, t as l, b4 as O } from "./platform-DsTwHxm6.js"; const S = { //启用状态 D_EnableStatus: { 0: { text: "禁用", attrs: { type: "info" } }, 1: { text: "启用", attrs: { type: "primary" } } }, //性别:0未知 1男 2女 D_Gender: { 0: { text: "未知", attrs: { type: "primary" } }, 1: { text: "男", attrs: { type: "primary" } }, 2: { text: "女", attrs: { type: "primary" } } }, // 是否状态类型 D_YesNoStatus: { 0: { text: "否", attrs: { type: "primary" } }, 1: { text: "是", attrs: { type: "primary" } } } }, $ = { //账号状态:0=正常;1=封禁;2=注销;3=限制互动;4=脱单;5=待注销 D_AccountStatus: { 0: { text: "正常", attrs: { type: "primary" } }, 1: { text: "封禁", attrs: { type: "danger" } }, 2: { text: "注销", attrs: { type: "info" } }, 3: { text: "限制互动", attrs: { type: "warning" } }, 4: { text: "已脱单", attrs: { type: "success" } }, 5: { text: "待注销", attrs: { type: "info" } } }, //身份认证情况:1=未认证,2=学历;3=公司,4=双认证 D_AuthCase: { 1: { text: "未认证", attrs: { type: "info" } }, 2: { text: "学历认证", attrs: { color: "#06D4E0", style: { color: "#fff" } } }, 3: { text: "公司认证", attrs: { color: "#1368F9", style: { color: "#fff" } } }, 4: { text: "双认证", attrs: { type: "success" } } }, //学历类型: 0未知 1大专 2本科 3研究生 4博士 D_EducationType: { 0: { text: "未知", attrs: { type: "info" } }, 1: { text: "专科", attrs: { type: "info" } }, 2: { text: "本科", attrs: { type: "primary" } }, 3: { text: "硕士", attrs: { type: "warning" } }, 4: { text: "博士", attrs: { type: "success" } } }, //领取奖励方式:0手动 1自动 D_GetRewardWay: { 0: { text: "手动", attrs: { type: "info" } }, 1: { text: "自动", attrs: { type: "primary" } } }, //婚姻状态:0单身 1有婚姻史 2已脱单 D_MatrimonyStatus: { 0: { text: "未婚", attrs: { type: "info" } }, 1: { text: "离异", attrs: { type: "warning" } }, 2: { text: "已脱单", attrs: { type: "danger" } } }, // 任务奖励类型: 1 金币, 2 心动嘉宾 D_TaskRewards: { 1: { text: "金币", attrs: { type: "warning" } }, 2: { text: "心动嘉宾", attrs: { type: "danger" } } } }, P = { // 菜单类型 D_MenuType: { 0: { text: "目录", attrs: { type: "primary" } }, 1: { text: "菜单", attrs: { type: "primary" } }, 2: { text: "按钮", attrs: { type: "primary" } } // 3: { // text: "外链", // attrs: { // type: "primary", // }, // }, }, // 角色类型 D_RoleType: { 0: { text: "开发人员", attrs: { type: "primary" } }, 1: { text: "超级管理员", attrs: { type: "primary" } }, 2: { text: "普通管理员", attrs: { type: "primary" } }, 3: { text: "超级会员", attrs: { type: "primary" } }, 4: { text: "普通会员", attrs: { type: "primary" } }, 5: { text: "特殊用户", attrs: { type: "primary" } }, 6: { text: "普通用户", attrs: { type: "primary" } } }, // 主题名称 D_ThemeName: { red: { text: "炙烈红" // attrs: { // color: "#81B337", // style: { // color: "#81B337", // border: "1px solid #81B337", // background: "#E2F2D0", // }, // }, }, orange: { text: "流光橙" // attrs: { // color: "#81B337", // style: { // color: "#81B337", // border: "1px solid #81B337", // background: "#E2F2D0", // }, // }, }, yellow: { text: "唯美黄" // attrs: { // color: "#81B337", // style: { // color: "#81B337", // border: "1px solid #81B337", // background: "#E2F2D0", // }, // }, }, green: { text: "清新绿" // attrs: { // color: "#81B337", // style: { // color: "#81B337", // border: "1px solid #81B337", // background: "#E2F2D0", // }, // }, }, blue: { text: "淡雅蓝" // attrs: { // color: "#81B337", // style: { // color: "#81B337", // border: "1px solid #81B337", // background: "#E2F2D0", // }, // }, }, indigo: { text: "深幽靛", disabled: !0 // attrs: { // color: "#81B337", // style: { // color: "#81B337", // border: "1px solid #81B337", // background: "#E2F2D0", // }, // }, }, purple: { text: "梦幻紫" // attrs: { // color: "#81B337", // style: { // color: "#81B337", // border: "1px solid #81B337", // background: "#E2F2D0", // }, // }, }, pink: { text: "樱语粉" // attrs: { // color: "#81B337", // style: { // color: "#81B337", // border: "1px solid #81B337", // background: "#E2F2D0", // }, // }, } } }, f = { ...E, ...S, ...$, ...P, ...A }; function j(n = c(), p = c(), o = g) { var u; return ((u = n[p]) == null ? void 0 : u.text) || o; } function k(n = c(), p = c(), o = g) { return n != null && n.length ? O(n, p, void 0, o) : o; } const R = () => { n(); function n() { N().then((t) => (t.records.slice(0, 3).map((s, i) => { const e = `D_BatchInsert_${i}`, a = Array(3).fill(""); f[e] = a.map((m, y) => ({ label: `批量请求下拉${i}_选项${y}`, value: y })); }), f)); } function p(t, r) { f[t] = r; } function o(t) { const r = l(t); if (r === "Object") return t; if (r === "String") { const s = f[t]; if (!s) throw new Error(`不存在该字典:${t}`); return s; } if (r === "Promise") return t; throw new Error(`暂不支持此类型:${r}`); } function u(t, r) { return r ? ["Object", "Array", "Promise"].includes(t) : !1; } function b(t = c(), r = c(), s = g, i = 0) { const e = o(t), a = l(e); if (u(a, i) && p(t, e), a === "Object") return j(e, r, s); if (a === "Array") return k(e, r, s); if (a === "Promise") return e; if (a === "Function") return b(e(), r, s, i + 1); throw new Error(`暂未处理类型:${a}`); } function d(t, r, s, i = 0) { const e = o(t), a = l(e); if (u(a, i) && p(t, e), a === "Array") return e; if (a === "Object") { const m = []; for (const y in e) { const w = isNaN(Number(y)) ? y : Number(y), D = (r == null ? void 0 : r.includes(w)) ?? !0; if (s ? D : !D) continue; let x = e[y]; typeof x == "string" && (x = { text: x }); const { text: T, disabled: _ } = x, h = { label: T, value: w }; _ !== void 0 && (h.disabled = _), m.push(h); } return m; } if (a === "Promise") return e; if (a === "Function") return d(e(), r, s, i + 1); throw new Error(`暂未处理此种类型:${a}`); } function M(t) { } return { getMap: o, setMap: p, getText: b, getOpts: d, getNames: M }; }; export { k as g, R as u };