UNPKG

quick-admin-vue3-core

Version:

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

2 lines (1 loc) 3.88 kB
"use strict";const n=require("./index-BC11nvhb.cjs"),u=require("./platform-Dl0zaSyI.cjs"),E={D_EnableStatus:{0:{text:"禁用",attrs:{type:"info"}},1:{text:"启用",attrs:{type:"primary"}}},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"}}}},M={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"}}},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"}}},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"}}},D_GetRewardWay:{0:{text:"手动",attrs:{type:"info"}},1:{text:"自动",attrs:{type:"primary"}}},D_MatrimonyStatus:{0:{text:"未婚",attrs:{type:"info"}},1:{text:"离异",attrs:{type:"warning"}},2:{text:"已脱单",attrs:{type:"danger"}}},D_TaskRewards:{1:{text:"金币",attrs:{type:"warning"}},2:{text:"心动嘉宾",attrs:{type:"danger"}}}},O={D_MenuType:{0:{text:"目录",attrs:{type:"primary"}},1:{text:"菜单",attrs:{type:"primary"}},2:{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:"炙烈红"},orange:{text:"流光橙"},yellow:{text:"唯美黄"},green:{text:"清新绿"},blue:{text:"淡雅蓝"},indigo:{text:"深幽靛",disabled:!0},purple:{text:"梦幻紫"},pink:{text:"樱语粉"}}},m={...n.test,...E,...M,...O,...n.global};function S(i=n.needParam(),y=n.needParam(),o=u.defaultEmptyStr){var x;return((x=i[y])==null?void 0:x.text)||o}function P(i=n.needParam(),y=n.needParam(),o=u.defaultEmptyStr){return i!=null&&i.length?u.getTextFromOptions(i,y,void 0,o):o}const A=()=>{i();function i(){n.GetMockCommon().then(t=>(t.records.slice(0,3).map((s,p)=>{const r=`D_BatchInsert_${p}`,a=Array(3).fill("");m[r]=a.map((l,c)=>({label:`批量请求下拉${p}_选项${c}`,value:c}))}),m))}function y(t,e){m[t]=e}function o(t){const e=u.typeOf(t);if(e==="Object")return t;if(e==="String"){const s=m[t];if(!s)throw new Error(`不存在该字典:${t}`);return s}if(e==="Promise")return t;throw new Error(`暂不支持此类型:${e}`)}function x(t,e){return e?["Object","Array","Promise"].includes(t):!1}function d(t=n.needParam(),e=n.needParam(),s=u.defaultEmptyStr,p=0){const r=o(t),a=u.typeOf(r);if(x(a,p)&&y(t,r),a==="Object")return S(r,e,s);if(a==="Array")return P(r,e,s);if(a==="Promise")return r;if(a==="Function")return d(r(),e,s,p+1);throw new Error(`暂未处理类型:${a}`)}function g(t,e,s,p=0){const r=o(t),a=u.typeOf(r);if(x(a,p)&&y(t,r),a==="Array")return r;if(a==="Object"){const l=[];for(const c in r){const D=isNaN(Number(c))?c:Number(c),b=(e==null?void 0:e.includes(D))??!0;if(s?b:!b)continue;let f=r[c];typeof f=="string"&&(f={text:f});const{text:h,disabled:w}=f,_={label:h,value:D};w!==void 0&&(_.disabled=w),l.push(_)}return l}if(a==="Promise")return r;if(a==="Function")return g(r(),e,s,p+1);throw new Error(`暂未处理此种类型:${a}`)}function T(t){}return{getMap:o,setMap:y,getText:d,getOpts:g,getNames:T}};exports.getCascaderText=P;exports.useDict=A;