vue3-element-dict 2.1.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/lib/style.css +1 -0
- package/lib/vite.svg +1 -0
- package/lib/vue3-element-dict-types/index.d.ts +350 -0
- package/lib/vue3-element-dict.js +3971 -2187
- package/package.json +5 -5
- package/lib/vue3-element-dict.umd.cjs +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue3-element-dict",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.0.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "shenxiaobu",
|
|
7
7
|
"url": "https://shenxiaobu.github.io"
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@element-plus/icons-vue": "^2.1.0",
|
|
29
29
|
"@types/node": "^18.15.12",
|
|
30
|
-
"@vitejs/plugin-vue": "^
|
|
31
|
-
"element-plus": "^2.
|
|
30
|
+
"@vitejs/plugin-vue": "^6.0.3",
|
|
31
|
+
"element-plus": "^2.12.0",
|
|
32
32
|
"typescript": "^4.9.3",
|
|
33
|
-
"vite": "^
|
|
34
|
-
"vue": "^3.
|
|
33
|
+
"vite": "^5.1.6",
|
|
34
|
+
"vue": "^3.4.21",
|
|
35
35
|
"vue-router": "^4.1.6",
|
|
36
36
|
"vue-tsc": "^1.2.0"
|
|
37
37
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(B,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(B=typeof globalThis<"u"?globalThis:B||self,t(B["vue3-element-dict"]={},B.Vue))})(this,function(B,t){"use strict";const K=(e,a,g,n)=>{const s={};for(let r in e)s[r]=a(e[r]).map(i=>({...i,[n]:g(i)||!!i[n]}));return s},$=t.reactive({dictConfig:{getLoginStatusFunc:()=>!0,loginStatusChangeFunc:null,getDictCodeApi:new Promise((e,a)=>{e({})}),filterDataFun:e=>e,disabledDataFun:e=>!1,treeSetting:{idField:"id",parentIdField:"parentId",childrenField:"children",firstId:"0",labelField:"label",labelArrField:"labelArr",idArrField:"idArr",levelField:"level",level:1,leafField:"leaf"},query:"type",versionKey:"currentVersion",dictDataKey:"dictCodeList",format:{value:"value",label:"label",disabled:"disabled",type:"type",color:"color"},formatterRequest:(e,a)=>a?{[e]:a}:{[e]:""},formatterDictList:(e,a)=>e.dictCodeList,formatterDictVersion:e=>e.version,storage:localStorage,usuallyGetDictTypes:"",isGetAll:!1,localDictCodes:{},getDictEveryTime:!1},dictCodes:{},isGettingDictTypes:[],isGettingAllDictTypes:!1,unfindDictTypes:[]}),J={SET_DICT_SETTING(e){$.dictConfig=e},SET_DICT_CODES(e){$.dictCodes=e},ADD_IS_GETTING_DICT_TYPES(e){const g=[...e.split(","),...$.isGettingDictTypes],n=new Set(g);$.isGettingDictTypes=Array.from(n)},REMOVE_IS_GETTING_DICT_TYPES(e){const a=e.split(","),g=[...new Set($.isGettingDictTypes)].filter(n=>!new Set(a).has(n));$.isGettingDictTypes=Array.from(g)},SETTING_ISGETTING_ALL_DICT_TYPES(e){$.isGettingAllDictTypes=e},ADD_UNFIND_DICT_TYPES(e){const g=[...e.split(","),...$.unfindDictTypes],n=new Set(g);$.unfindDictTypes=Array.from(n)},REMOVE_UNFIND_DICT_TYPES(e){const a=e.split(","),g=[...new Set($.unfindDictTypes)].filter(n=>!new Set(a).has(n));$.unfindDictTypes=Array.from(g)}},c={state:$,mutations:J,actions:{getDictDataObj(e){return new Promise((a,g)=>{if(!e)return;const{getLoginStatusFunc:n,storage:s,dictDataKey:r,getDictCodeApi:i,usuallyGetDictTypes:o,formatterRequest:d,query:l,versionKey:u,localDictCodes:p,formatterDictList:y,formatterDictVersion:h,isGetAll:I,filterDataFun:k,disabledDataFun:j,format:F}=$.dictConfig;if(!n()){g("请先登录");return}const E=$.dictCodes||p;if(!E[e]||E[e].length===0){if($.isGettingDictTypes.includes(e)||$.isGettingAllDictTypes)return;if(J.ADD_IS_GETTING_DICT_TYPES(e),$.unfindDictTypes.includes(e)){g(`不存在类型为:${e} 的字典字段,请确认后再填写`);return}J.ADD_UNFIND_DICT_TYPES(e),i(d(l,e)).then(O=>{J.REMOVE_IS_GETTING_DICT_TYPES(e);const C=h(O),m=s.getItem(u);if(C!==m){let b="";if(I)b="",J.SETTING_ISGETTING_ALL_DICT_TYPES(!0);else{if(o){const f=Object.keys(E),D=o.split(","),T=Object.keys(p),S=D.filter(N=>T.includes(N)?(console.warn(`注意:usuallyGetDictTypes配置与本地字典配置的字典类型${N}冲突`),!1):!0),_=f.concat(S);_.push(e),b=Array.from(new Set(_)).join(",")}else{const f=Object.keys(E);f.push(e),b=Array.from(new Set(f)).join(",")}J.ADD_IS_GETTING_DICT_TYPES(b)}i(d(l,b)).then(f=>{const D=y(f,e);if(!(D[e]&&D[e].length>0)){g(`不存在类型为:${e} 的字典字段,请确认后再填写`);return}J.REMOVE_UNFIND_DICT_TYPES(e);const T=h(f),S=Object.assign(JSON.parse(JSON.stringify(p)),D),_=K(S,k,j,F==null?void 0:F.disabled);s.setItem(r,JSON.stringify(_)),s.setItem(u,T),J.SET_DICT_CODES(_),a($.dictCodes),$.isGettingAllDictTypes?J.SETTING_ISGETTING_ALL_DICT_TYPES(!1):J.REMOVE_IS_GETTING_DICT_TYPES(b)})}else{const b=y(O,e);if(!(b[e]&&b[e].length>0)){g(`不存在类型为:${e} 的字典字段,请确认后再填写`);return}J.REMOVE_UNFIND_DICT_TYPES(e);const f=$.dictCodes||p,D=K(b,k,j,F==null?void 0:F.disabled);Object.assign(f,D),s.setItem(r,JSON.stringify(f)),J.SET_DICT_CODES(f),a($.dictCodes)}})}else J.REMOVE_UNFIND_DICT_TYPES(e),J.SET_DICT_CODES(E),a($.dictCodes)})}}},At=(e,a,g)=>new Promise((n,s)=>{const{format:r}=c.state.dictConfig,i=c.state.dictCodes;let o=[];if(!i||!i[a])if(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes){const d=setInterval(()=>{if(!(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes)){if(clearInterval(d),o=c.state.dictCodes[a],!o){s(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const l=o.find(u=>u[r.value]===e);n(l?l[r.label]:g??"")}},1e3)}else c.actions.getDictDataObj(a).then(d=>{if(o=d[a],!o){s(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const l=o.find(u=>u[r.value]===e);n(l?l[r.label]:g??"")});else{o=i[a];const d=o.find(l=>l[r.value]===e);n(d?d[r.label]:g??"")}});function W(e,a,g,n,s="--"){const r=[];for(let i=0;i<e.length;i++){const o=a.find(d=>d[g.value]===e[i]);o?r.push(o):r.push({[g.label]:n||e[i]||s,[g.value]:e[i]})}return r}const Gt=(e,a,g)=>{const n={defaultVal:"",emptyText:"--",formatFun:(s,r)=>s.map(i=>i[r.label]).join(","),spacer:","};return Object.assign(n,g),new Promise((s,r)=>{let i=[];Array.isArray(e)?i=e:typeof e=="string"&&(i=e.split(n.spacer));const{format:o}=c.state.dictConfig,d=c.state.dictCodes;let l=[];if(!d||!d[a])if(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes){const u=setInterval(()=>{if(!(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes)){if(clearInterval(u),l=c.state.dictCodes[a],!l){r(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const p=W(i,l,o,n.defaultVal,n.emptyText);s(p&&p.length>0?n.formatFun(p,o):n.defaultVal)}},1e3)}else c.actions.getDictDataObj(a).then(u=>{if(l=u[a],!l){r(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const p=W(i,l,o,n.defaultVal,n.emptyText);s(p&&p.length>0?n.formatFun(p,o):n.defaultVal)});else{l=d[a];const u=W(i,l,o,n.defaultVal,n.emptyText);s(u&&u.length>0?n.formatFun(u,o):n.defaultVal)}})},Bt=(e,a,g)=>new Promise((n,s)=>{const{format:r}=c.state.dictConfig,i=c.state.dictCodes;let o=[];if(!i||!i[a])if(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes){const d=setInterval(()=>{if(!(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes)){if(clearInterval(d),o=c.state.dictCodes[a],!o){s(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const l=o.find(u=>u[r.label]===e);n(l?l[r.value]:g??"")}},1e3)}else c.actions.getDictDataObj(a).then(d=>{if(o=d[a],!o){s(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const l=o.find(u=>u[r.label]===e);n(l?l[r.value]:g??"")});else{o=i[a];const d=o.find(l=>l[r.label]===e);n(d?d[r.value]:g??"")}});function H(e,a,g,n){const s=[];for(let r=0;r<e.length;r++){const i=a.find(o=>o[g.label]===e[r]);i?s.push(i):s.push({[g.label]:e[r],[g.value]:n})}return s}const Lt=(e,a,g)=>{const n={defaultVal:"",formatFun:(s,r)=>s.map(i=>i[r.value]).join(","),spacer:","};return Object.assign(n,g),new Promise((s,r)=>{let i=[];Array.isArray(e)?i=e:typeof e=="string"&&(i=e.split(n.spacer));const{format:o}=c.state.dictConfig,d=c.state.dictCodes;let l=[];if(!d||!d[a])if(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes){const u=setInterval(()=>{if(!(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes)){if(clearInterval(u),l=c.state.dictCodes[a],!l){r(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const p=H(i,l,o,n.defaultVal);s(p&&p.length>0?n.formatFun(p,o):n.defaultVal)}},1e3)}else c.actions.getDictDataObj(a).then(u=>{if(l=u[a],!l){r(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const p=H(i,l,o,n.defaultVal);s(p&&p.length>0?n.formatFun(p,o):n.defaultVal)});else{l=d[a];const u=H(i,l,o,n.defaultVal);s(u&&u.length>0?n.formatFun(u,o):n.defaultVal)}})},Et=e=>new Promise((a,g)=>{let n=[],s="";Array.isArray(e)?(s=e.join(","),n=e):typeof e=="string"&&(s=e,n=e.split(","));const r=c.state.dictCodes,i=c.state.dictConfig;if(!r||JSON.stringify(r)==="{}")return c.mutations.ADD_IS_GETTING_DICT_TYPES(s),i.getDictCodeApi(i.formatterRequest(i.query,s)).then(o=>{var y;c.mutations.REMOVE_IS_GETTING_DICT_TYPES(s);const d=i.formatterDictList(o,e),l=K(d,i.filterDataFun,i.disabledDataFun,(y=i==null?void 0:i.format)==null?void 0:y.disabled),u=JSON.parse(JSON.stringify(l)),p=Object.assign(c.state.dictCodes,u);i.storage.setItem(i.dictDataKey,JSON.stringify(p)),c.mutations.SET_DICT_CODES(p),a(l)});{const o=[],d={};for(let l=0;l<n.length;l++){if(r[n[l]]){d[n[l]]=r[n[l]];continue}o.push(n[l])}if(o.length>0)return c.mutations.ADD_IS_GETTING_DICT_TYPES(o.join(",")),i.getDictCodeApi(i.formatterRequest(i.query,o.join(","))).then(l=>{var j;c.mutations.REMOVE_IS_GETTING_DICT_TYPES(o.join(","));const u=i.formatterDictList(l,e),p=K(u,i.filterDataFun,i.disabledDataFun,(j=i==null?void 0:i.format)==null?void 0:j.disabled),y=JSON.parse(JSON.stringify(p)),h=Object.assign(c.state.dictCodes,y);i.storage.setItem(i.dictDataKey,JSON.stringify(h)),c.mutations.SET_DICT_CODES(h);const I=Object.assign(d,u),k=[];for(const F in I)(!I[F]||I[F].length===0)&&k.push(F);k.length>0&&g(`不存在类型为:${k.join("、")} 的字典字段,请确认后再填写`),a(p)});a(d)}}),Q=(e,a,g)=>new Promise((n,s)=>{const{format:r}=c.state.dictConfig,i=c.state.dictCodes;let o=[];if(!i||!i[a])if(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes){const d=setInterval(()=>{if(!(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes)){if(clearInterval(d),o=c.state.dictCodes[a],!o){s(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const l=o.find(u=>u[r.value]===e);n(l||(g??""))}},1e3)}else c.actions.getDictDataObj(a).then(d=>{if(o=d[a],!o){s(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const l=o.find(u=>u[r.value]===e);n(l||(g??""))});else{o=i[a];const d=o.find(l=>l[r.value]===e);n(d||(g??""))}}),Nt={name:"ElButtonDict"},tt=t.defineComponent({...Nt,props:{value:{type:[String,Number],required:!0},dictType:{type:[String],required:!0},judgeTypeFun:{type:Function},type:{type:String,default:""},judgeColorFun:{type:Function},color:{type:String,default:""},judgeDisabledFun:{type:Function},disabled:{type:Boolean}},setup(e,{expose:a}){const g=e,{value:n,dictType:s,judgeTypeFun:r,type:i,judgeColorFun:o,color:d,judgeDisabledFun:l,disabled:u}=t.toRefs(g),p=t.toRaw(c.state.dictConfig),y=t.computed(()=>r!=null&&r.value?r.value(n.value):i.value?i.value:k.value&&k.value[p.format.type]?k.value[p.format.type]:"primary"),h=t.computed(()=>o!=null&&o.value?o.value(n.value):d!=null&&d.value?d.value:k.value&&k.value[p.format.color]?k.value[p.format.color]:""),I=t.computed(()=>k.value&&k.value[p.format.disabled]?k.value[p.format.disabled]:l!=null&&l.value?l.value(n.value):!!u.value);let k=t.ref(null),j=t.ref(null);t.watchEffect(()=>{Q(n.value,s.value).then(O=>{k.value=O,j.value=O[p.format.label]})});const F=t.ref(null);return a({getRef:()=>F.value}),(O,C)=>{const m=t.resolveComponent("el-button");return t.openBlock(),t.createBlock(m,t.mergeProps({ref_key:"ElButtonDict",ref:F,type:t.unref(y),color:t.unref(h),disabled:t.unref(I)},O.$attrs),t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(j)),1)]),_:2},[t.renderList(O.$slots,(b,f,D)=>({name:f,fn:t.withCtx(T=>[t.renderSlot(O.$slots,f,t.normalizeProps(t.guardReactiveProps(T)))])}))]),1040,["type","color","disabled"])}}});tt.install=function(e){e.component(tt.name,tt)};const Vt=Object.freeze(Object.defineProperty({__proto__:null,default:tt},Symbol.toStringTag,{value:"Module"})),X=(e,a,g)=>{const n={idField:"id",parentIdField:"parentId",childrenField:"children",firstId:"0",labelField:"label",labelArrField:"labelArr",idArrField:"idArr",levelField:"level",level:0,leafField:"leaf"};a&&Object.assign(n,a),g||(g={[n.idField]:n.firstId,[n.levelField]:n.level,[n.labelArrField]:[],[n.idArrField]:[]});for(var s=[],r,i=0;i<e.length;i++)if(e[i][n.parentIdField]===g[n.idField]){var o=e[i];o[n.levelField]=g[n.levelField]+1,o[n.labelArrField]=g[n.labelArrField].concat(o[n.labelField]),o[n.idArrField]=g[n.idArrField].concat(o[n.idField]),r=X(e,a,o),r.length>0?(o[n.childrenField]=r,o[n.leafField]=!1):o[n.leafField]=!0,s.push(o)}return s},q=(e,a,g)=>{const n={idField:"id",parentIdField:"parentId"};Object.assign(n,g);const s=a.find(r=>r[n.idField]===e);return s?q(s[n.parentIdField],a,n).concat([s]):[]},Y=(e,a,g)=>{const n={idField:"id",labelField:"label",parentIdField:"parentId"};Object.assign(n,g);const s=a.find(r=>r[n.labelField]===e);return q(s[n.idField],a,n)},$t={name:"ElCascaderDict"},et=t.defineComponent({...$t,props:{maxLevel:{type:[Number,String]},dictType:{type:[String,Object],required:!0},disableObj:{type:Object},filterDataFun:{type:Function},disabledDataFun:{type:Function}},emits:["dictChange"],setup(e,{expose:a,emit:g}){const{maxLevel:n,dictType:s,disableObj:r,filterDataFun:i,disabledDataFun:o}=e,d=t.useAttrs(),l=t.ref(""),u=t.toRaw(c.state.dictConfig),p=m=>{g("dictChange",m)},y=t.reactive({list:[]}),h=(m,b)=>{for(let f=0;f<m.length;f++){const D=m[f];if(D[u.treeSetting.levelField]===b){delete D[F.value.children],D[F.value.leaf]=!0;continue}else h(D[F.value.children],b)}},I=async()=>{if(!s)return;let m=[];if(typeof s=="object"){l.value=s.type;const b=await c.actions.getDictDataObj(l.value);m=[].concat(b[l.value]);const{filters:f,filterType:D=u.format.value,reverse:T=!1}=s,S=typeof f=="string"?f.split(","):f;T?m=m.filter(_=>!S.includes(_[D])):m=m.filter(_=>S.includes(_[D]))}else{l.value=s;const b=await c.actions.getDictDataObj(l.value);m=[].concat(b[l.value])}if(i&&(m=i(m)),o&&(m=m.map(b=>({...b,[u.format.disabled]:!!b[u.format.disabled]||o(b)}))),r){const{disableValue:b,disableType:f=u.format.value,reverse:D=!1}=r,T=typeof b=="string"?b.split(","):b;D?m=m.map(S=>{const _=JSON.parse(JSON.stringify(S));return _[u.format.disabled]=!T.includes(_[f])||_[u.format.disabled],_}):m=m.map(S=>{const _=JSON.parse(JSON.stringify(S));return _[u.format.disabled]=T.includes(_[f])||_[u.format.disabled],_})}y.list=m},k=t.computed(()=>c.state.isGettingDictTypes.includes(l.value)),j=t.computed(()=>c.state.isGettingAllDictTypes),F=t.computed(()=>{const m=d.props??{};return m.disabled=m.disabled??u.format.disabled,m.value=m.value??u.format.value,m.label=m.label??u.treeSetting.labelField,m.children=m.children??u.treeSetting.childrenField,m.leaf=m.leaf??u.treeSetting.leafField,m}),E=t.computed(()=>{const m=d.props??{},b={idField:m.idField??u.treeSetting.idField,labelField:m.label??u.treeSetting.labelField,childrenField:m.children??u.treeSetting.childrenField,leafField:m.leaf??u.treeSetting.leafField},f=Object.assign(u.treeSetting,b),D=JSON.parse(JSON.stringify(y.list)),T=X(D,f);return n&&h(T,+n),T});t.watch([k,j],([m,b])=>{!m&&!b&&I()},{immediate:!0});const O=t.ref(null);return a({getRef:()=>O.value}),(m,b)=>{const f=t.resolveComponent("el-cascader");return t.openBlock(),t.createBlock(f,{ref_key:"ElCascaderDict",ref:O,options:t.unref(E),props:t.unref(F),onChange:p},t.createSlots({_:2},[t.renderList(m.$slots,(D,T,S)=>({name:T,fn:t.withCtx(_=>[t.renderSlot(m.$slots,T,t.normalizeProps(t.guardReactiveProps(_)))])}))]),1032,["options","props"])}}});et.install=function(e){e.component(et.name,et)};const wt=Object.freeze(Object.defineProperty({__proto__:null,default:et},Symbol.toStringTag,{value:"Module"})),Pt={name:"ElCheckboxButtonDict"},nt=t.defineComponent({...Pt,props:{data:{type:Array,default:()=>[]},format:{type:Object,default:()=>({label:"label",value:"value",disabled:"disabled"})},dictType:{type:[String,Object]},disableObj:{type:Object},name:{type:String,default:""},checked:{type:Boolean,default:!1},trueValue:{type:[String,Number],default:""},falseValue:{type:[String,Number],default:""},trueLabel:{type:[String,Number],default:""},falseLabel:{type:[String,Number],default:""},keyValue:{type:Boolean,default:!1},filterDataFun:{type:Function},disabledDataFun:{type:Function}},emits:["dictChange"],setup(e,{expose:a,emit:g}){const{data:n,format:s,dictType:r,disableObj:i,name:o,checked:d,trueValue:l,falseValue:u,trueLabel:p,falseLabel:y,keyValue:h,filterDataFun:I,disabledDataFun:k}=e,j=t.ref(""),F=t.toRaw(c.state.dictConfig),E=S=>{if(!h){g("dictChange",S);return}const _=O.list.filter(A=>S.includes(A[F.format.value]));g("dictChange",_)},O=t.reactive({list:[]}),C=async()=>{if(!r||n&&n.length>0)return;let S=[];if(typeof r=="object"){j.value=r.type;const _=await c.actions.getDictDataObj(j.value);S=[].concat(_[j.value]);const{filters:A,filterType:N=F.format.value,reverse:L=!1}=r,P=typeof A=="string"?A.split(","):A;L?S=S.filter(G=>!P.includes(G[N])):S=S.filter(G=>P.includes(G[N]))}else{j.value=r;const _=await c.actions.getDictDataObj(j.value);S=[].concat(_[j.value])}if(I&&(S=I(S)),k&&(S=S.map(_=>({..._,[F.format.disabled]:!!_[F.format.disabled]||k(_)}))),i){const{disableValue:_,disableType:A=F.format.value,reverse:N=!1}=i,L=typeof _=="string"?_.split(","):_;N?S=S.map(P=>{const G=JSON.parse(JSON.stringify(P));return G[F.format.disabled]=!L.includes(G[A])||G[F.format.disabled],G}):S=S.map(P=>{const G=JSON.parse(JSON.stringify(P));return G[F.format.disabled]=L.includes(G[A])||G[F.format.disabled],G})}O.list=S},m=t.computed(()=>c.state.isGettingDictTypes.includes(j.value)),b=t.computed(()=>c.state.isGettingAllDictTypes),f=t.computed(()=>n);t.watch([m,b,f],([S,_,A])=>{!S&&!_&&A&&A.length===0&&C(),A.length>0&&(O.list=JSON.parse(JSON.stringify(A)),O.list.length>0&&(Object.prototype.toString.call(O.list[0])==="[object Object]"?O.list=O.list.map(L=>({[F.format.value]:L[s.value],[F.format.label]:L[s.label],[F.format.disabled]:!!L[s.disabled],...L})):O.list=O.list.map(L=>({[F.format.value]:L,[F.format.label]:L}))))},{immediate:!0});const D=t.ref(null);return a({getRef:()=>D.value}),(S,_)=>{const A=t.resolveComponent("el-checkbox-button"),N=t.resolveComponent("el-checkbox-group");return t.openBlock(),t.createBlock(N,t.mergeProps({ref_key:"ElCheckboxButtonDict",ref:D},S.$attrs,{onChange:E}),t.createSlots({default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(O.list,L=>(t.openBlock(),t.createBlock(A,{key:L[t.unref(F).format.value],disabled:L[t.unref(F).format.disabled],value:L[t.unref(F).format.value],name:e.name,"true-value":e.trueValue,"false-value":e.falseValue,"true-label":e.trueLabel,"false-label":e.falseLabel,checked:e.checked},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(L[t.unref(F).format.label]),1)]),_:2},1032,["disabled","value","name","true-value","false-value","true-label","false-label","checked"]))),128))]),_:2},[t.renderList(S.$slots,(L,P,G)=>({name:P,fn:t.withCtx(V=>[t.renderSlot(S.$slots,P,t.normalizeProps(t.guardReactiveProps(V)))])}))]),1040)}}});nt.install=function(e){e.component(nt.name,nt)};const Rt=Object.freeze(Object.defineProperty({__proto__:null,default:nt},Symbol.toStringTag,{value:"Module"})),xt={name:"ElCheckboxDict"},at=t.defineComponent({...xt,props:{data:{type:Array,default:()=>[]},format:{type:Object,default:()=>({label:"label",value:"value",disabled:"disabled"})},dictType:{type:[String,Object]},disableObj:{type:Object},border:{type:Boolean,default:!1},size:{type:String,default:""},name:{type:String,default:""},checked:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},trueValue:{type:[String,Number],default:""},falseValue:{type:[String,Number],default:""},trueLabel:{type:[String,Number],default:""},falseLabel:{type:[String,Number],default:""},keyValue:{type:Boolean,default:!1},filterDataFun:{type:Function},disabledDataFun:{type:Function},validateEvent:{type:Boolean},tabindex:{type:[String,Number]},id:{type:String}},emits:["dictChange"],setup(e,{expose:a,emit:g}){const{data:n,format:s,dictType:r,disableObj:i,border:o,size:d,name:l,checked:u,indeterminate:p,trueValue:y,falseValue:h,trueLabel:I,falseLabel:k,keyValue:j,filterDataFun:F,disabledDataFun:E,validateEvent:O,tabindex:C,id:m}=e,b=t.ref(""),f=t.toRaw(c.state.dictConfig),D=G=>{if(!j){g("dictChange",G);return}const V=T.list.filter(R=>G.includes(R[f.format.value]));g("dictChange",V)},T=t.reactive({list:[]}),S=async()=>{if(!r||n&&n.length>0)return;let G=[];if(typeof r=="object"){b.value=r.type;const V=await c.actions.getDictDataObj(b.value);G=[].concat(V[b.value]);const{filters:R,filterType:z=f.format.value,reverse:w=!1}=r,M=typeof R=="string"?R.split(","):R;w?G=G.filter(x=>!M.includes(x[z])):G=G.filter(x=>M.includes(x[z]))}else{b.value=r;const V=await c.actions.getDictDataObj(b.value);G=[].concat(V[b.value])}if(F&&(G=F(G)),E&&(G=G.map(V=>({...V,[f.format.disabled]:!!V[f.format.disabled]||E(V)}))),i){const{disableValue:V,disableType:R=f.format.value,reverse:z=!1}=i,w=typeof V=="string"?V.split(","):V;z?G=G.map(M=>{const x=JSON.parse(JSON.stringify(M));return x[f.format.disabled]=!w.includes(x[R])||x[f.format.disabled],x}):G=G.map(M=>{const x=JSON.parse(JSON.stringify(M));return x[f.format.disabled]=w.includes(x[R])||x[f.format.disabled],x})}T.list=G},_=t.computed(()=>c.state.isGettingDictTypes.includes(b.value)),A=t.computed(()=>c.state.isGettingAllDictTypes),N=t.computed(()=>n);t.watch([_,A,N],([G,V,R])=>{!G&&!V&&R&&R.length===0&&S(),R.length>0&&(T.list=JSON.parse(JSON.stringify(R)),T.list.length>0&&(Object.prototype.toString.call(T.list[0])==="[object Object]"?T.list=T.list.map(w=>({[f.format.value]:w[s.value],[f.format.label]:w[s.label],[f.format.disabled]:!!w[s.disabled],...w})):T.list=T.list.map(w=>({[f.format.value]:w,[f.format.label]:w}))))},{immediate:!0});const L=t.ref(null);return a({getRef:()=>L.value}),(G,V)=>{const R=t.resolveComponent("el-checkbox"),z=t.resolveComponent("el-checkbox-group");return t.openBlock(),t.createBlock(z,t.mergeProps({ref_key:"ElCheckboxDict",ref:L},G.$attrs,{onChange:D}),t.createSlots({default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(T.list,w=>(t.openBlock(),t.createBlock(R,{key:w[t.unref(f).format.value],value:w[t.unref(f).format.value],"true-value":e.trueValue,"false-value":e.falseValue,"true-label":e.trueLabel,"false-label":e.falseLabel,disabled:w[t.unref(f).format.disabled],border:e.border,size:e.size,name:e.name,checked:e.checked,indeterminate:e.indeterminate,"validate-event":e.validateEvent,tabindex:e.tabindex,id:e.id},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(w[t.unref(f).format.label]),1)]),_:2},1032,["value","true-value","false-value","true-label","false-label","disabled","border","size","name","checked","indeterminate","validate-event","tabindex","id"]))),128))]),_:2},[t.renderList(G.$slots,(w,M,x)=>({name:M,fn:t.withCtx(bt=>[t.renderSlot(G.$slots,M,t.normalizeProps(t.guardReactiveProps(bt)))])}))]),1040)}}});at.install=function(e){e.component(at.name,at)};const Jt=Object.freeze(Object.defineProperty({__proto__:null,default:at},Symbol.toStringTag,{value:"Module"})),Mt={name:"ElLinkDict"},rt=t.defineComponent({...Mt,props:{value:{type:[String,Number],required:!0},dictType:{type:[String],required:!0},judgeTypeFun:{type:Function},type:{type:String,default:""},judgeDisabledFun:{type:Function},disabled:{type:Boolean}},setup(e,{expose:a}){const g=e,{value:n,dictType:s,judgeTypeFun:r,type:i,judgeDisabledFun:o,disabled:d}=t.toRefs(g),l=t.toRaw(c.state.dictConfig),u=t.computed(()=>r!=null&&r.value?r.value(n.value):i.value?i.value:y.value&&y.value[l.format.type]?y.value[l.format.type]:"primary"),p=t.computed(()=>y.value&&y.value[l.format.disabled]?y.value[l.format.disabled]:o!=null&&o.value?o.value(n.value):!!d.value);let y=t.ref(null),h=t.ref(null);t.watchEffect(()=>{Q(n.value,s.value).then(j=>{y.value=j,h.value=j[l.format.label]})});const I=t.ref(null);return a({getRef:()=>I.value}),(j,F)=>{const E=t.resolveComponent("el-link");return t.openBlock(),t.createBlock(E,t.mergeProps({ref_key:"ElLinkDict",ref:I,type:t.unref(u),disabled:t.unref(p)},j.$attrs),t.createSlots({default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(t.unref(h)),1)]),_:2},[t.renderList(j.$slots,(O,C,m)=>({name:C,fn:t.withCtx(b=>[t.renderSlot(j.$slots,C,t.normalizeProps(t.guardReactiveProps(b)))])}))]),1040,["type","disabled"])}}});rt.install=function(e){e.component(rt.name,rt)};const zt=Object.freeze(Object.defineProperty({__proto__:null,default:rt},Symbol.toStringTag,{value:"Module"})),qt={name:"ElRadioButtonDict"},lt=t.defineComponent({...qt,props:{data:{type:Array,default:()=>[]},format:{type:Object,default:()=>({label:"label",value:"value",disabled:"disabled"})},dictType:{type:[String,Object]},disableObj:{type:Object},name:{type:String,default:""},keyValue:{type:Boolean,default:!1},filterDataFun:{type:Function},disabledDataFun:{type:Function}},emits:["dictChange"],setup(e,{expose:a,emit:g}){const{data:n,format:s,dictType:r,disableObj:i,name:o,keyValue:d,filterDataFun:l,disabledDataFun:u}=e,p=t.ref(""),y=t.toRaw(c.state.dictConfig),h=m=>{if(!d){g("dictChange",m);return}const b=I.list.find(f=>f[y.format.value]===m);g("dictChange",b)},I=t.reactive({list:[]}),k=async()=>{if(!r||n&&n.length>0)return;let m=[];if(typeof r=="object"){p.value=r.type;const b=await c.actions.getDictDataObj(p.value);m=[].concat(b[p.value]);const{filters:f,filterType:D=y.format.value,reverse:T=!1}=r,S=typeof f=="string"?f.split(","):f;T?m=m.filter(_=>!S.includes(_[D])):m=m.filter(_=>S.includes(_[D]))}else{p.value=r;const b=await c.actions.getDictDataObj(p.value);m=[].concat(b[p.value])}if(l&&(m=l(m)),u&&(m=m.map(b=>({...b,[y.format.disabled]:!!b[y.format.disabled]||u(b)}))),i){const{disableValue:b,disableType:f=y.format.value,reverse:D=!1}=i,T=typeof b=="string"?b.split(","):b;D?m=m.map(S=>{const _=JSON.parse(JSON.stringify(S));return _[y.format.disabled]=!T.includes(_[f])||_[y.format.disabled],_}):m=m.map(S=>{const _=JSON.parse(JSON.stringify(S));return _[y.format.disabled]=T.includes(_[f])||_[y.format.disabled],_})}I.list=m},j=t.computed(()=>c.state.isGettingDictTypes.includes(p.value)),F=t.computed(()=>c.state.isGettingAllDictTypes),E=t.computed(()=>n);t.watch([j,F,E],([m,b,f])=>{!m&&!b&&f&&f.length===0&&k(),f.length>0&&(I.list=JSON.parse(JSON.stringify(f)),I.list.length>0&&(Object.prototype.toString.call(I.list[0])==="[object Object]"?I.list=I.list.map(T=>({[y.format.value]:T[s.value],[y.format.label]:T[s.label],[y.format.disabled]:!!T[s.disabled],...T})):I.list=I.list.map(T=>({[y.format.value]:T,[y.format.label]:T}))))},{immediate:!0});const O=t.ref(null);return a({getRef:()=>O.value}),(m,b)=>{const f=t.resolveComponent("el-radio-button"),D=t.resolveComponent("el-radio-group");return t.openBlock(),t.createBlock(D,t.mergeProps({ref_key:"ElRadioButtonDict",ref:O},m.$attrs,{onChange:h}),t.createSlots({default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(I.list,T=>(t.openBlock(),t.createBlock(f,{key:T[t.unref(y).format.value],disabled:T[t.unref(y).format.disabled],value:T[t.unref(y).format.value],name:e.name},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(T[t.unref(y).format.label]),1)]),_:2},1032,["disabled","value","name"]))),128))]),_:2},[t.renderList(m.$slots,(T,S,_)=>({name:S,fn:t.withCtx(A=>[t.renderSlot(m.$slots,S,t.normalizeProps(t.guardReactiveProps(A)))])}))]),1040)}}});lt.install=function(e){e.component(lt.name,lt)};const Kt=Object.freeze(Object.defineProperty({__proto__:null,default:lt},Symbol.toStringTag,{value:"Module"})),Yt={name:"ElRadioDict"},it=t.defineComponent({...Yt,props:{data:{type:Array,default:()=>[]},format:{type:Object,default:()=>({label:"label",value:"value",disabled:"disabled"})},dictType:{type:[String,Object]},disableObj:{type:Object},border:{type:Boolean,default:!1},size:{type:String,default:""},name:{type:String,default:""},keyValue:{type:Boolean,default:!1},filterDataFun:{type:Function},disabledDataFun:{type:Function}},emits:["dictChange"],setup(e,{expose:a,emit:g}){const{data:n,format:s,dictType:r,disableObj:i,border:o,size:d,name:l,keyValue:u,filterDataFun:p,disabledDataFun:y}=e,h=t.ref(""),I=t.toRaw(c.state.dictConfig),k=f=>{if(!u){g("dictChange",f);return}const D=j.list.find(T=>T[I.format.value]===f);g("dictChange",D)},j=t.reactive({list:[]}),F=async()=>{if(!r||n&&n.length>0)return;let f=[];if(typeof r=="object"){h.value=r.type;const D=await c.actions.getDictDataObj(h.value);f=[].concat(D[h.value]);const{filters:T,filterType:S=I.format.value,reverse:_=!1}=r,A=typeof T=="string"?T.split(","):T;_?f=f.filter(N=>!A.includes(N[S])):f=f.filter(N=>A.includes(N[S]))}else{h.value=r;const D=await c.actions.getDictDataObj(h.value);f=[].concat(D[h.value])}if(p&&(f=p(f)),y&&(f=f.map(D=>({...D,[I.format.disabled]:!!D[I.format.disabled]||y(D)}))),i){const{disableValue:D,disableType:T=I.format.value,reverse:S=!1}=i,_=typeof D=="string"?D.split(","):D;S?f=f.map(A=>{const N=JSON.parse(JSON.stringify(A));return N[I.format.disabled]=!_.includes(N[T])||N[I.format.disabled],N}):f=f.map(A=>{const N=JSON.parse(JSON.stringify(A));return N[I.format.disabled]=_.includes(N[T])||N[I.format.disabled],N})}j.list=f},E=t.computed(()=>c.state.isGettingDictTypes.includes(h.value)),O=t.computed(()=>c.state.isGettingAllDictTypes),C=t.computed(()=>n);t.watch([E,O,C],([f,D,T])=>{!f&&!D&&T&&T.length===0&&F(),T.length>0&&(j.list=JSON.parse(JSON.stringify(T)),j.list.length>0&&(Object.prototype.toString.call(j.list[0])==="[object Object]"?j.list=j.list.map(_=>({[I.format.value]:_[s.value],[I.format.label]:_[s.label],[I.format.disabled]:!!_[s.disabled],..._})):j.list=j.list.map(_=>({[I.format.value]:_,[I.format.label]:_}))))},{immediate:!0});const m=t.ref(null);return a({getRef:()=>m.value}),(f,D)=>{const T=t.resolveComponent("el-radio"),S=t.resolveComponent("el-radio-group");return t.openBlock(),t.createBlock(S,t.mergeProps({ref_key:"ElRadioDict",ref:m},f.$attrs,{onChange:k}),t.createSlots({default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(j.list,_=>(t.openBlock(),t.createBlock(T,{key:_[t.unref(I).format.value],disabled:_[t.unref(I).format.disabled],value:_[t.unref(I).format.value],border:e.border,size:e.size,name:e.name},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(_[t.unref(I).format.label]),1)]),_:2},1032,["disabled","value","border","size","name"]))),128))]),_:2},[t.renderList(f.$slots,(_,A,N)=>({name:A,fn:t.withCtx(L=>[t.renderSlot(f.$slots,A,t.normalizeProps(t.guardReactiveProps(L)))])}))]),1040)}}});it.install=function(e){e.component(it.name,it)};const Ut=Object.freeze(Object.defineProperty({__proto__:null,default:it},Symbol.toStringTag,{value:"Module"})),Wt={name:"ElSelectDict"},st=t.defineComponent({...Wt,props:{data:{type:Array,default:()=>[]},format:{type:Object,default:()=>({label:"label",value:"value",disabled:"disabled"})},dictType:{type:[String,Object]},disableObj:{type:Object},keyValue:{type:Boolean,default:!1},filterDataFun:{type:Function},disabledDataFun:{type:Function}},emits:["dictChange"],setup(e,{expose:a,emit:g}){const{data:n,format:s,dictType:r,disableObj:i,keyValue:o,filterDataFun:d,disabledDataFun:l}=e,u=t.ref(""),p=t.toRaw(c.state.dictConfig),y=C=>{g("dictChange",C)},h=t.reactive({list:[]}),I=async()=>{if(!r||n&&n.length>0)return;let C=[];if(typeof r=="object"){u.value=r.type;const m=await c.actions.getDictDataObj(u.value);C=[].concat(m[u.value]);const{filters:b,filterType:f=p.format.value,reverse:D=!1}=r,T=typeof b=="string"?b.split(","):b;D?C=C.filter(S=>!T.includes(S[f])):C=C.filter(S=>T.includes(S[f]))}else{u.value=r;const m=await c.actions.getDictDataObj(u.value);C=[].concat(m[u.value])}if(d&&(C=d(C)),l&&(C=C.map(m=>({...m,[p.format.disabled]:!!m[p.format.disabled]||l(m)}))),i){const{disableValue:m,disableType:b=p.format.value,reverse:f=!1}=i,D=typeof m=="string"?m.split(","):m;f?C=C.map(T=>{const S=JSON.parse(JSON.stringify(T));return S[p.format.disabled]=!D.includes(S[b])||S[p.format.disabled],S}):C=C.map(T=>{const S=JSON.parse(JSON.stringify(T));return S[p.format.disabled]=D.includes(S[b])||S[p.format.disabled],S})}h.list=C},k=t.computed(()=>c.state.isGettingDictTypes.includes(u.value)),j=t.computed(()=>c.state.isGettingAllDictTypes),F=t.computed(()=>n);t.watch([k,j,F],([C,m,b])=>{!C&&!m&&b&&b.length===0&&I(),b.length>0&&(h.list=JSON.parse(JSON.stringify(b)),h.list.length>0&&(Object.prototype.toString.call(h.list[0])==="[object Object]"?h.list=h.list.map(D=>({[p.format.value]:D[s.value],[p.format.label]:D[s.label],[p.format.disabled]:!!D[s.disabled],...D})):h.list=h.list.map(D=>({[p.format.value]:D,[p.format.label]:D}))))},{immediate:!0});const E=t.ref(null);return a({getRef:()=>E.value}),(C,m)=>{const b=t.resolveComponent("el-option"),f=t.resolveComponent("el-select");return t.openBlock(),t.createBlock(f,t.mergeProps({ref_key:"ElSelectDict",ref:E},C.$attrs,{"value-key":e.keyValue?t.unref(p).format.label:"",onChange:y}),t.createSlots({default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(h.list,D=>(t.openBlock(),t.createBlock(b,{key:D[t.unref(p).format.value],disabled:D[t.unref(p).format.disabled],label:D[t.unref(p).format.label],value:e.keyValue?D:D[t.unref(p).format.value]},null,8,["disabled","label","value"]))),128))]),_:2},[t.renderList(C.$slots,(D,T,S)=>({name:T,fn:t.withCtx(_=>[t.renderSlot(C.$slots,T,t.normalizeProps(t.guardReactiveProps(_)))])}))]),1040,["value-key"])}}});st.install=function(e){e.component(st.name,st)};const Ht=Object.freeze(Object.defineProperty({__proto__:null,default:st},Symbol.toStringTag,{value:"Module"})),Qt=(e,a,g)=>{const{format:n}=c.state.dictConfig,s=c.state.dictCodes;let r=[];if(!s||!s[a])c.actions.getDictDataObj(a).then(i=>{if(r=i[a],!r)return;const o=r.find(d=>d[n.value]===e);return o?o[n.label]:g??""});else{r=s[a];const i=r.find(o=>o[n.value]===e);return i?i[n.label]:g??""}},pt=(e,a,g)=>{const n={defaultVal:"",emptyText:"--",formatFun:(d,l)=>d.map(u=>u[l.label]).join(","),spacer:","};Object.assign(n,g);let s=[];Array.isArray(e)?s=e:typeof e=="string"&&(s=e.split(n.spacer));const{format:r}=c.state.dictConfig,i=c.state.dictCodes;let o=[];if(!i||!i[a])c.actions.getDictDataObj(a).then(d=>{if(o=d[a],!o)return;const l=W(s,o,r,n.defaultVal,n.emptyText);return l&&l.length>0?n.formatFun(l,r):n.defaultVal});else{o=i[a];const d=W(s,o,r,n.defaultVal,n.emptyText);return d&&d.length>0?n.formatFun(d,r):n.defaultVal}},Xt=(e,a,g)=>{const{format:n}=c.state.dictConfig,s=c.state.dictCodes;let r=[];if(!s||!s[a])c.actions.getDictDataObj(a).then(i=>{if(r=i[a],!r)return;const o=r.find(d=>d[n.label]===e);return o?o[n.value]:g??""});else{r=s[a];const i=r.find(o=>o[n.label]===e);return i?i[n.value]:g??""}},Zt=(e,a,g)=>{const n={defaultVal:"",formatFun:(d,l)=>d.map(u=>u[l.value]).join(","),spacer:","};Object.assign(n,g);let s=[];Array.isArray(e)?s=e:typeof e=="string"&&(s=e.split(n.spacer));const{format:r}=c.state.dictConfig,i=c.state.dictCodes;let o=[];if(!i||!i[a])c.actions.getDictDataObj(a).then(d=>{if(o=d[a],!o)return;const l=H(s,o,r,n.defaultVal);return l&&l.length>0?n.formatFun(l,r):n.defaultVal});else{o=i[a];const d=H(s,o,r,n.defaultVal);return d&&d.length>0?n.formatFun(d,r):n.defaultVal}},vt=(e,a,g)=>{const n={defaultVal:"",formatFun:(s,r)=>s.map(i=>i[r.labelField]).join("/"),treeSetting:{}};return Object.assign(n,g),new Promise((s,r)=>{const{treeSetting:i}=c.state.dictConfig,o=Object.assign(i,n.treeSetting),d=c.state.dictCodes;let l=[];if(!d||!d[a])if(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes){const u=setInterval(()=>{if(!(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes)){if(clearInterval(u),l=c.state.dictCodes[a],!l){r(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const p=l.find(y=>y[o.idField]===e);s(p?n.formatFun(q(p[o.idField],l,o),o):n.defaultVal)}},1e3)}else c.actions.getDictDataObj(a).then(u=>{if(l=u[a],!l){r(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const p=l.find(y=>y[o.idField]===e);s(p?n.formatFun(q(p[o.idField],l,o),o):n.defaultVal)});else{l=d[a];const u=l.find(p=>p[o.idField]===e);s(u?n.formatFun(q(u[o.idField],l,o),o):n.defaultVal)}})};function Z(e,a,g,n,s,r="--"){const i=[];for(let o=0;o<e.length;o++){const d=a.find(l=>l[s.idField]===e[o]);d?i.push(n(q(d[s.idField],a,s),s)):i.push(g||e[o]||r)}return i}const te=(e,a,g)=>{const n={defaultVal:"",emptyText:"--",formatFunIn:(s,r)=>s.map(i=>i[r.labelField]).join("/"),treeSetting:{},formatFunOut:s=>s.join(","),spacer:","};return Object.assign(n,g),new Promise((s,r)=>{let i=[];Array.isArray(e)?i=e:typeof e=="string"&&(i=e.split(n.spacer));const{treeSetting:o}=c.state.dictConfig,d=Object.assign(o,n.treeSetting),l=c.state.dictCodes;let u=[];if(!l||!l[a])if(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes){const p=setInterval(()=>{if(!(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes)){if(clearInterval(p),u=c.state.dictCodes[a],!u){r(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const y=Z(i,u,n.defaultVal,n.formatFunIn,d,n.emptyText);s(y&&y.length>0?n.formatFunOut(y):n.defaultVal)}},1e3)}else c.actions.getDictDataObj(a).then(p=>{if(u=p[a],!u){r(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const y=Z(i,u,n.defaultVal,n.formatFunIn,d,n.emptyText);s(y&&y.length>0?n.formatFunOut(y):n.defaultVal)});else{u=l[a];const p=Z(i,u,n.defaultVal,n.formatFunIn,d,n.emptyText);s(p&&p.length>0?n.formatFunOut(p):n.defaultVal)}})},ee=(e,a,g)=>{const n={defaultVal:"",formatFun:(s,r)=>s.map(i=>i[r.idField]).join("/"),treeSetting:{}};return Object.assign(n,g),new Promise((s,r)=>{const{treeSetting:i}=c.state.dictConfig,o=Object.assign(i,n.treeSetting),d=c.state.dictCodes;let l=[];if(!d||!d[a])if(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes){const u=setInterval(()=>{if(!(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes)){if(clearInterval(u),l=c.state.dictCodes[a],!l){r(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const p=l.find(y=>y[o.labelField]===e);s(p?n.formatFun(Y(p[o.labelField],l,o),o):n.defaultVal)}},1e3)}else c.actions.getDictDataObj(a).then(u=>{if(l=u[a],!l){r(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const p=l.find(y=>y[o.labelField]===e);s(p?n.formatFun(Y(p[o.labelField],l,o),o):n.defaultVal)});else{l=d[a];const u=l.find(p=>p[o.labelField]===e);s(u?n.formatFun(Y(u[o.labelField],l,o),o):n.defaultVal)}})};function v(e,a,g,n,s){const r=[];for(let i=0;i<e.length;i++){const o=a.find(d=>d[s.labelField]===e[i]);o?r.push(n(Y(o[s.labelField],a,s),s)):r.push(g)}return r}const ne=(e,a,g)=>{const n={defaultVal:"",formatFunIn:(s,r)=>s.map(i=>i[r.idField]).join("/"),treeSetting:{},formatFunOut:s=>s.join(","),spacer:","};return Object.assign(n,g),new Promise((s,r)=>{let i=[];Array.isArray(e)?i=e:typeof e=="string"&&(i=e.split(n.spacer));const{treeSetting:o}=c.state.dictConfig,d=Object.assign(o,n.treeSetting),l=c.state.dictCodes;let u=[];if(!l||!l[a])if(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes){const p=setInterval(()=>{if(!(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes)){if(clearInterval(p),u=c.state.dictCodes[a],!u){r(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const y=v(i,u,n.defaultVal,n.formatFunIn,d);s(y&&y.length>0?n.formatFunOut(y):n.defaultVal)}},1e3)}else c.actions.getDictDataObj(a).then(p=>{if(u=p[a],!u){r(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const y=v(i,u,n.defaultVal,n.formatFunIn,d);s(y&&y.length>0?n.formatFunOut(y):n.defaultVal)});else{u=l[a];const p=v(i,u,n.defaultVal,n.formatFunIn,d);s(p&&p.length>0?n.formatFunOut(p):n.defaultVal)}})},ae=(e,a,g)=>{const n={defaultVal:"",formatFun:(d,l)=>d.map(u=>u[l.labelField]).join("/"),treeSetting:{}};Object.assign(n,g);const{treeSetting:s}=c.state.dictConfig,r=Object.assign(s,n.treeSetting),i=c.state.dictCodes;let o=[];if(!i||!i[a])c.actions.getDictDataObj(a).then(d=>{if(o=d[a],!o)return new Error(`不存在类型为:${a} 的字典字段,请确认后再填写`);const l=o.find(u=>u[r.idField]===e);return l?n.formatFun(q(l[r.idField],o,r),r):n.defaultVal});else{o=i[a];const d=o.find(l=>l[r.idField]===e);return d?n.formatFun(q(d[r.idField],o,r),r):n.defaultVal}},yt=(e,a,g)=>{const n={defaultVal:"",emptyText:"--",formatFunIn:(l,u)=>l.map(p=>p[u.labelField]).join("/"),treeSetting:{},formatFunOut:l=>l.join(","),spacer:","};Object.assign(n,g);let s=[];Array.isArray(e)?s=e:typeof e=="string"&&(s=e.split(n.spacer));const{treeSetting:r}=c.state.dictConfig,i=Object.assign(r,n.treeSetting),o=c.state.dictCodes;let d=[];if(!o||!o[a])c.actions.getDictDataObj(a).then(l=>{if(d=l[a],!d)return new Error(`不存在类型为:${a} 的字典字段,请确认后再填写`);const u=Z(s,d,n.defaultVal,n.formatFunIn,i,n.emptyText);return u&&u.length>0?n.formatFunOut(u):n.defaultVal});else{d=o[a];const l=Z(s,d,n.defaultVal,n.formatFunIn,i,n.emptyText);return l&&l.length>0?n.formatFunOut(l):n.defaultVal}},re=(e,a,g)=>{const n={defaultVal:"",formatFun:(d,l)=>d.map(u=>u[l.idField]).join("/"),treeSetting:{}};Object.assign(n,g);const{treeSetting:s}=c.state.dictConfig,r=Object.assign(s,n.treeSetting),i=c.state.dictCodes;let o=[];if(!i||!i[a])c.actions.getDictDataObj(a).then(d=>{if(o=d[a],!o)return new Error(`不存在类型为:${a} 的字典字段,请确认后再填写`);const l=o.find(u=>u[r.labelField]===e);return l?n.formatFun(Y(l[r.labelField],o,r),r):n.defaultVal});else{o=i[a];const d=o.find(l=>l[r.labelField]===e);return d?n.formatFun(Y(d[r.labelField],o,r),r):n.defaultVal}},le=(e,a,g)=>{const n={defaultVal:"",formatFunIn:(l,u)=>l.map(p=>p[u.idField]).join("/"),treeSetting:{},formatFunOut:l=>l.join(","),spacer:","};Object.assign(n,g);let s=[];Array.isArray(e)?s=e:typeof e=="string"&&(s=e.split(n.spacer));const{treeSetting:r}=c.state.dictConfig,i=Object.assign(r,n.treeSetting),o=c.state.dictCodes;let d=[];if(!o||!o[a])c.actions.getDictDataObj(a).then(l=>{if(d=l[a],!d)return new Error(`不存在类型为:${a} 的字典字段,请确认后再填写`);const u=v(s,d,n.defaultVal,n.formatFunIn,i);return u&&u.length>0?n.formatFunOut(u):n.defaultVal});else{d=o[a];const l=v(s,d,n.defaultVal,n.formatFunIn,i);return l&&l.length>0?n.formatFunOut(l):n.defaultVal}},Dt={date:"yyyy-MM-dd",month:"yyyy-MM",datetime:"yyyy-MM-dd hh:mm:ss",time:"hh:mm:ss",year:"yyyy"},Tt=e=>{const a=e.replaceAll("-","/");var g=new Date(e),n=new Date(a);return!isNaN(g.getTime())||!isNaN(n.getTime())},St=(e,a="datetime",g)=>{if(!e||!a)return g??"";Object.keys(Dt).includes(a)&&(a=Dt[a]),e=ie(e),e instanceof Date||(typeof e=="number"||Tt(e)?e=new Date(e):e=new Date(Number(e)));const n={"M+":e.getMonth()+1,"d+":e.getDate(),"h+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),"q+":Math.floor((e.getMonth()+3)/3),S:e.getMilliseconds()};/(y+)/.test(a)&&(a=a.replace(RegExp.$1,String(e.getFullYear()).substr(4-RegExp.$1.length)));for(const s in n){const r=new RegExp(`(${s})`);r.test(a)&&(a=a.replace(r,RegExp.$1.length===1?n[s]:("00"+n[s]).substr(String(n[s]).length)))}return a};function ie(e){const a=String(e);if(!/^\d+$/.test(a))return a;const g=a.length;if(g===4)return`${a}/01/01`;if(g===6){const n=a.substring(0,4),s=a.substring(4,6);return`${n}/${s}/01`}else if(g===8){const n=a.substring(0,4),s=a.substring(4,6),r=a.substring(6,8);return`${n}/${s}/${r}`}else if(g===10){const n=a.substring(0,4),s=a.substring(4,6),r=a.substring(6,8),i=a.substring(8,10);return`${n}/${s}/${r} ${i}:00:00`}else if(g===12){const n=a.substring(0,4),s=a.substring(4,6),r=a.substring(6,8),i=a.substring(8,10),o=a.substring(10,12);return`${n}/${s}/${r} ${i}:${o}:00`}else if(g===14){const n=a.substring(0,4),s=a.substring(4,6),r=a.substring(6,8),i=a.substring(8,10),o=a.substring(10,12),d=a.substring(12,14);return`${n}/${s}/${r} ${i}:${o}:${d}`}else return e}const U=(e,a)=>{let n=Object.assign({start:0,end:0,middle:0,symbol:"*"},a);if(n||(n={start:0,end:0,symbol:"*"}),n.start<0||n.end<0)return"";const s=e.length;if(n.start+n.end+n.middle>s)return e;let r="";for(let d=0;d<n.start&&d<s;d++)r+=e.charAt(d);let i="";for(let d=s-1;d>=0&&d>=s-n.end;d--)i=e.charAt(d)+i;const o=n.symbol.repeat(Math.max(n.middle||s-n.start-n.end,0));return r+o+i},Ct=(e,a="*")=>{if(!e||typeof e!="string")return e;const g=["欧阳","太史","端木","上官","司马","东方","独孤","南宫","万俟","闻人","夏侯","诸葛","尉迟","公羊","赫连","澹台","皇甫","宗政","濮阳","公冶","太叔","申屠","公孙","慕容","仲孙","钟离","长孙","宇文","司徒","鲜于","司空","闾丘","子车","亓官","司寇","巫马","公西","颛孙","壤驷","公良","漆雕","乐正","宰父","谷梁","拓跋","夹谷","轩辕","令狐","段干","百里","呼延","东郭","南门","羊舌","微生","公户","公玉","公仪","梁丘","公仲","公上","公门","公山","公坚","左丘","公伯","西门","公祖","第五","公乘","贯丘","公皙","南荣","东里","东宫","仲长","子书","子桑","即墨","达奚","褚师"];if(g.some(s=>e.startsWith(s)))return e.length<=2?e:e.substring(0,2)+(e.length>2?a:"")+(e.length>3?e.substring(3):"");{if(e.length<=1)return e;const s=e.substring(0,2);return e.length>=4&&!g.includes(s)&&/^[\u4e00-\u9fa5]{2}$/.test(s)?e.substring(0,2)+(e.length>2?a:"")+(e.length>3?e.substring(3):""):e[0]+(e.length>1?a:"")+(e.length>2?e.substring(2):"")}},_t=(e,a="*")=>e?U(e,{start:4,end:4,symbol:a}):"",ht=(e,a="*")=>e?U(String(e),{start:3,end:4,symbol:a}):"",Ot=(e,a="*")=>{if(!e)return"";const g=e.trim().split(/\s+/),n=g.length;let s="";for(let r=0;r<n;r++)/^[\u4e00-\u9fa5]+$/.test(g[r])?s+=U(g[r],{start:1,symbol:a}):s+=U(g[r],{start:2,symbol:a}),r<n-1&&(s+=" ");return s},se={mobile:ht,name:Ct,address:Ot,idCard:_t},Ft=(e,a)=>{if(typeof a=="string"&&(a={maskType:a}),a.maskType==="none")return e;const g={start:0,end:0,symbol:"*",defaultVal:"",maskType:""};if(Object.assign(g,a),!e)return g.defaultVal;if(g.maskType)return se[g.maskType](e,g.symbol);const n={start:g.start,end:g.end,middle:g.middle,symbol:g.symbol};return U(e,n)},oe={name:"ElTableColumnDict"},ot=t.defineComponent({...oe,props:{emptyText:{type:String,default:"--"},dictType:{type:String,default:""},dictTreeType:{type:String,default:""},dateFormat:{type:String},defaultVal:{type:String,default:""},formatFun:{type:Function,default:null},formatFunIn:{type:Function,default:null},formatFunOut:{type:Function,default:null},spacer:{type:String,default:","},treeSetting:{type:Object,default:null},maskType:{type:String,validator(e){return["","mobile","address","idCard","name"].includes(e)}},maskStart:{type:Number},maskEnd:{type:Number},maskMiddle:{type:Number},maskSymbol:{type:String,default:"*"},dictTypeNode:{type:String,validator(e){return["","link","button","tag","text"].includes(e)}}},setup(e,{expose:a}){const{emptyText:g,dictType:n,dictTreeType:s,dateFormat:r,defaultVal:i,treeSetting:o,formatFun:d,formatFunIn:l,formatFunOut:u,spacer:p,maskType:y,maskStart:h,maskEnd:I,maskMiddle:k,maskSymbol:j}=e,F=t.useAttrs(),E=t.computed(()=>{let f={};return i&&(f.defaultVal=i),g&&(f.emptyText=g),d&&(f.formatFun=d),p&&(f.spacer=p),f}),O=t.computed(()=>{let f={};return i&&(f.defaultVal=i),g&&(f.emptyText=g),l&&(f.formatFunIn=l),u&&(f.formatFunOut=u),o&&(f.treeSetting=o),p&&(f.spacer=p),f}),C=t.computed(()=>{const f={};return i&&(f.defaultVal=i),y&&(f.maskType=y),h&&(f.start=h),I&&(f.end=I),k&&(f.middle=k),j&&(f.symbol=j),f}),m=t.ref(null);return a({getRef:()=>m.value}),(f,D)=>{const T=t.resolveComponent("el-button-dict"),S=t.resolveComponent("el-link-dict"),_=t.resolveComponent("el-tag-dict"),A=t.resolveComponent("el-text-dict"),N=t.resolveComponent("el-table-column");return t.openBlock(),t.createBlock(N,t.mergeProps({ref_key:"ElTableColumnDict",ref:m},f.$attrs),t.createSlots({default:t.withCtx(L=>{var P,G,V,R,z,w,M,x,bt;return[e.dictType?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[e.dictTypeNode==="button"?(t.openBlock(),t.createBlock(T,{key:0,value:L.row[(P=t.unref(F))==null?void 0:P.prop]||"",dictType:e.dictType},null,8,["value","dictType"])):e.dictTypeNode==="link"?(t.openBlock(),t.createBlock(S,{key:1,value:L.row[(G=t.unref(F))==null?void 0:G.prop]||"",dictType:e.dictType},null,8,["value","dictType"])):e.dictTypeNode==="tag"?(t.openBlock(),t.createBlock(_,{key:2,value:L.row[(V=t.unref(F))==null?void 0:V.prop]||"",dictType:e.dictType},null,8,["value","dictType"])):e.dictTypeNode==="text"?(t.openBlock(),t.createBlock(A,{key:3,value:L.row[(R=t.unref(F))==null?void 0:R.prop]||"",dictType:e.dictType},null,8,["value","dictType"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:4},[t.createTextVNode(t.toDisplayString(t.unref(pt)(L.row[(z=t.unref(F))==null?void 0:z.prop],e.dictType,t.unref(E))),1)],64))],64)):e.dictTreeType?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(t.unref(yt)(L.row[(w=t.unref(F))==null?void 0:w.prop],e.dictTreeType,t.unref(O))),1)],64)):e.dateFormat?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createTextVNode(t.toDisplayString(t.unref(St)(L.row[(M=t.unref(F))==null?void 0:M.prop],e.dateFormat,e.defaultVal)),1)],64)):e.maskType||e.maskStart?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.createTextVNode(t.toDisplayString(t.unref(Ft)(L.row[(x=t.unref(F))==null?void 0:x.prop],t.unref(C))),1)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:4},[t.createTextVNode(t.toDisplayString(L.row[(bt=t.unref(F))==null?void 0:bt.prop]||e.defaultVal),1)],64))]}),_:2},[t.renderList(f.$slots,(L,P,G)=>({name:P,fn:t.withCtx(V=>[t.renderSlot(f.$slots,P,t.normalizeProps(t.guardReactiveProps(V)))])}))]),1040)}}});ot.install=function(e){e.component(ot.name,ot)};const ce=Object.freeze(Object.defineProperty({__proto__:null,default:ot},Symbol.toStringTag,{value:"Module"})),de={name:"ElTabsDict"},ct=t.defineComponent({...de,props:{data:{type:Array,default:()=>[]},format:{type:Object,default:()=>({label:"label",value:"value",disabled:"disabled"})},badgeObj:{type:Object,default:()=>({})},dictType:{type:[String,Object]},disableObj:{type:Object},keyValue:{type:Boolean,default:!1},filterDataFun:{type:Function},disabledDataFun:{type:Function}},emits:["dictChange"],setup(e,{expose:a,emit:g}){const{data:n,format:s,badgeObj:r,dictType:i,disableObj:o,keyValue:d,filterDataFun:l,disabledDataFun:u}=e,p=t.useAttrs(),y=t.ref(""),h=t.toRaw(c.state.dictConfig),I=b=>{window.setTimeout(()=>{if(!d){g("dictChange",p.modelValue);return}const f=k.list.find(D=>D[h.format.value]===p.modelValue);g("dictChange",f)},0)},k=t.reactive({list:[]}),j=async()=>{if(!i||n&&n.length>0)return;let b=[];if(typeof i=="object"){y.value=i.type;const f=await c.actions.getDictDataObj(y.value);b=[].concat(f[y.value]);const{filters:D,filterType:T=h.format.value,reverse:S=!1}=i,_=typeof D=="string"?D.split(","):D;S?b=b.filter(A=>!_.includes(A[T])):b=b.filter(A=>_.includes(A[T]))}else{y.value=i;const f=await c.actions.getDictDataObj(y.value);b=[].concat(f[y.value])}if(l&&(b=l(b)),u&&(b=b.map(f=>({...f,[h.format.disabled]:!!f[h.format.disabled]||u(f)}))),o){const{disableValue:f,disableType:D=h.format.value,reverse:T=!1}=o,S=typeof f=="string"?f.split(","):f;T?b=b.map(_=>{const A=JSON.parse(JSON.stringify(_));return A[h.format.disabled]=!S.includes(A[D])||A[h.format.disabled],A}):b=b.map(_=>{const A=JSON.parse(JSON.stringify(_));return A[h.format.disabled]=S.includes(A[D])||A[h.format.disabled],A})}k.list=b},F=t.computed(()=>c.state.isGettingDictTypes.includes(y.value)),E=t.computed(()=>c.state.isGettingAllDictTypes),O=t.computed(()=>n);t.watch([F,E,O],([b,f,D])=>{!b&&!f&&D&&D.length===0&&j(),D.length>0&&(k.list=JSON.parse(JSON.stringify(D)),k.list.length>0&&(Object.prototype.toString.call(k.list[0])==="[object Object]"?k.list=k.list.map(S=>({[h.format.value]:S[s.value],[h.format.label]:S[s.label],[h.format.disabled]:!!S[s.disabled],...S})):k.list=k.list.map(S=>({[h.format.value]:S,[h.format.label]:S}))))},{immediate:!0});const C=t.ref(null);return a({getRef:()=>C.value}),(b,f)=>{const D=t.resolveComponent("el-badge"),T=t.resolveComponent("el-tab-pane"),S=t.resolveComponent("el-tabs");return t.openBlock(),t.createBlock(S,t.mergeProps({ref_key:"ElTabsDict",ref:C,class:"vue-element-dict-tabs"},b.$attrs,{onTabClick:I}),{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(k.list,_=>(t.openBlock(),t.createBlock(T,{disabled:_[t.unref(h).format.disabled],label:_[t.unref(h).format.label],key:_[t.unref(h).format.value],name:_[t.unref(h).format.value]},t.createSlots({default:t.withCtx(()=>[t.renderSlot(b.$slots,_[t.unref(h).format.value])]),_:2},[t.renderList(b.$slots,(A,N,L)=>({name:N,fn:t.withCtx(P=>[t.renderSlot(b.$slots,N,t.normalizeProps(t.guardReactiveProps(P)))])})),e.badgeObj[_[t.unref(h).format.value]]?{name:"label",fn:t.withCtx(()=>[t.createVNode(D,{type:e.badgeObj[_[t.unref(h).format.value]].type,"is-dot":e.badgeObj[_[t.unref(h).format.value]].isDot,value:e.badgeObj[_[t.unref(h).format.value]].value,max:e.badgeObj[_[t.unref(h).format.value]].max,hidden:e.badgeObj[_[t.unref(h).format.value]].hidden,class:"item"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(_[t.unref(h).format.label]),1)]),_:2},1032,["type","is-dot","value","max","hidden"])]),key:"0"}:void 0]),1032,["disabled","label","name"]))),128))]),_:3},16)}}});ct.install=function(e){e.component(ct.name,ct)};const fe=Object.freeze(Object.defineProperty({__proto__:null,default:ct},Symbol.toStringTag,{value:"Module"})),ue={name:"ElTagDict"},dt=t.defineComponent({...ue,props:{value:{type:[String,Number],required:!0},dictType:{type:[String],required:!0},judgeTypeFun:{type:Function},type:{type:String,default:""},judgeColorFun:{type:Function},color:{type:String,default:""}},setup(e,{expose:a}){const g=e,{value:n,dictType:s,judgeTypeFun:r,type:i,judgeColorFun:o,color:d}=t.toRefs(g),l=t.toRaw(c.state.dictConfig),u=t.computed(()=>r!=null&&r.value?r==null?void 0:r.value(n.value):i.value?i.value:y.value&&y.value[l.format.type]?y.value[l.format.type]:"success"),p=t.computed(()=>o!=null&&o.value?o==null?void 0:o.value(n):d.value?d.value:y.value&&y.value[l.format.color]?y.value[l.format.color]:"");let y=t.ref(null),h=t.ref(null);t.watchEffect(()=>{Q(n.value,s.value).then(j=>{y.value=j,h.value=j[l.format.label]})});const I=t.ref(null);return a({getRef:()=>I.value}),(j,F)=>{const E=t.resolveComponent("el-tag");return t.openBlock(),t.createBlock(E,t.mergeProps({ref_key:"ElTagDict",ref:I,type:t.unref(u),color:t.unref(p)},j.$attrs),t.createSlots({default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(t.unref(h)),1)]),_:2},[t.renderList(j.$slots,(O,C,m)=>({name:C,fn:t.withCtx(b=>[t.renderSlot(j.$slots,C,t.normalizeProps(t.guardReactiveProps(b)))])}))]),1040,["type","color"])}}});dt.install=function(e){e.component(dt.name,dt)};const ge=Object.freeze(Object.defineProperty({__proto__:null,default:dt},Symbol.toStringTag,{value:"Module"})),me={name:"ElTextDict"},ft=t.defineComponent({...me,props:{value:{type:[String,Number],required:!0},dictType:{type:[String],required:!0},judgeTypeFun:{type:Function},type:{type:String,default:""}},setup(e,{expose:a}){const g=e,{value:n,dictType:s,judgeTypeFun:r,type:i}=t.toRefs(g),o=t.toRaw(c.state.dictConfig),d=t.computed(()=>r!=null&&r.value?r==null?void 0:r.value(n.value):i!=null&&i.value?i.value:l.value&&l.value[o.format.type]?l.value[o.format.type]:"primary");let l=t.ref(null),u=t.ref(null);t.watchEffect(()=>{Q(n.value,s.value).then(h=>{l.value=h,u.value=h[o.format.label]})});const p=t.ref(null);return a({getRef:()=>p.value}),(h,I)=>{const k=t.resolveComponent("el-text");return t.openBlock(),t.createBlock(k,t.mergeProps({ref:"ElTextDict",type:t.unref(d)},h.$attrs),t.createSlots({default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(t.unref(u)),1)]),_:2},[t.renderList(h.$slots,(j,F,E)=>({name:F,fn:t.withCtx(O=>[t.renderSlot(h.$slots,F,t.normalizeProps(t.guardReactiveProps(O)))])}))]),1040,["type"])}}});ft.install=function(e){e.component(ft.name,ft)};const be=Object.freeze(Object.defineProperty({__proto__:null,default:ft},Symbol.toStringTag,{value:"Module"})),pe={name:"ElTreeDict"},ut=t.defineComponent({...pe,props:{maxLevel:{type:[Number,String]},dictType:{type:[String,Object],required:!0},disableObj:{type:Object},filterDataFun:{type:Function},disabledDataFun:{type:Function}},setup(e,{expose:a}){const{maxLevel:g,dictType:n,disableObj:s,filterDataFun:r,disabledDataFun:i}=e,o=t.useAttrs(),d=t.ref(""),l=t.toRaw(c.state.dictConfig),u=t.reactive({list:[]}),p=(O,C)=>{for(let m=0;m<O.length;m++){const b=O[m];if(b[l.treeSetting.levelField]===C){delete b[k.value.children],b[k.value.isLeaf]=!0;continue}else p(b[k.value.children],C)}},y=async()=>{if(!n)return;let O=[];if(typeof n=="object"){d.value=n.type;const C=await c.actions.getDictDataObj(d.value);O=[].concat(C[d.value]);const{filters:m,filterType:b=l.format.value,reverse:f=!1}=n,D=typeof m=="string"?m.split(","):m;f?O=O.filter(T=>!D.includes(T[b])):O=O.filter(T=>D.includes(T[b]))}else{d.value=n;const C=await c.actions.getDictDataObj(d.value);O=[].concat(C[d.value])}if(r&&(O=r(O)),i&&(O=O.map(C=>({...C,[l.format.disabled]:!!C[l.format.disabled]||i(C)}))),s){const{disableValue:C,disableType:m=l.format.value,reverse:b=!1}=s,f=typeof C=="string"?C.split(","):C;b?O=O.map(D=>{const T=JSON.parse(JSON.stringify(D));return T[l.format.disabled]=!f.includes(T[m])||T[l.format.disabled],T}):O=O.map(D=>{const T=JSON.parse(JSON.stringify(D));return T[l.format.disabled]=f.includes(T[m])||T[l.format.disabled],T})}u.list=O},h=t.computed(()=>c.state.isGettingDictTypes.includes(d.value)),I=t.computed(()=>c.state.isGettingAllDictTypes),k=t.computed(()=>{const O=o.props??{};return O.disabled=O.disabled??c.state.dictConfig.format.disabled,O.label=O.label??c.state.dictConfig.treeSetting.labelField,O.children=O.children??c.state.dictConfig.treeSetting.childrenField,O.isLeaf=O.leaf??c.state.dictConfig.treeSetting.leafField,O}),j=t.computed(()=>{const O=o.props??{},C={labelField:O.label??l.treeSetting.labelField,childrenField:O.children??l.treeSetting.childrenField,leafField:O.leaf??l.treeSetting.leafField},m=Object.assign(c.state.dictConfig.treeSetting,C),b=JSON.parse(JSON.stringify(u.list)),f=X(b,m);return g&&p(f,+g),f});t.watch([h,I],([O,C])=>{!O&&!C&&y()},{immediate:!0});const F=t.ref(null);return a({getRef:()=>F.value}),(O,C)=>{const m=t.resolveComponent("el-tree");return t.openBlock(),t.createBlock(m,{ref_key:"ElTreeDict",ref:F,data:t.unref(j),props:t.unref(k)},t.createSlots({_:2},[t.renderList(O.$slots,(b,f,D)=>({name:f,fn:t.withCtx(T=>[t.renderSlot(O.$slots,f,t.normalizeProps(t.guardReactiveProps(T)))])}))]),1032,["data","props"])}}});ut.install=function(e){e.component(ut.name,ut)};const ye=Object.freeze(Object.defineProperty({__proto__:null,default:ut},Symbol.toStringTag,{value:"Module"})),De={name:"ElTreeSelectDict"},gt=t.defineComponent({...De,props:{maxLevel:{type:[Number,String]},nodeKey:{type:String,default:c.state.dictConfig.treeSetting.idField},dictType:{type:[String,Object],required:!0},disableObj:{type:Object},filterDataFun:{type:Function},disabledDataFun:{type:Function}},setup(e,{expose:a}){const{maxLevel:g,nodeKey:n,dictType:s,disableObj:r,filterDataFun:i,disabledDataFun:o}=e,d=t.useAttrs(),l=t.ref(""),u=t.toRaw(c.state.dictConfig),p=t.reactive({list:[]}),y=(C,m)=>{for(let b=0;b<C.length;b++){const f=C[b];if(f[u.treeSetting.levelField]===m){delete f[j.value.children],f[j.value.isLeaf]=!0;continue}else y(f[j.value.children],m)}},h=async()=>{if(!s)return;let C=[];if(typeof s=="object"){l.value=s.type;const m=await c.actions.getDictDataObj(l.value);C=[].concat(m[l.value]);const{filters:b,filterType:f=u.format.value,reverse:D=!1}=s,T=typeof b=="string"?b.split(","):b;D?C=C.filter(S=>!T.includes(S[f])):C=C.filter(S=>T.includes(S[f]))}else{l.value=s;const m=await c.actions.getDictDataObj(l.value);C=[].concat(m[l.value])}if(i&&(C=i(C)),o&&(C=C.map(m=>({...m,[u.format.disabled]:!!m[u.format.disabled]||o(m)}))),r){const{disableValue:m,disableType:b=u.format.value,reverse:f=!1}=r,D=typeof m=="string"?m.split(","):m;f?C=C.map(T=>{const S=JSON.parse(JSON.stringify(T));return S[u.format.disabled]=!D.includes(S[b])||S[u.format.disabled],S}):C=C.map(T=>{const S=JSON.parse(JSON.stringify(T));return S[u.format.disabled]=D.includes(S[b])||S[u.format.disabled],S})}p.list=C},I=t.computed(()=>c.state.isGettingDictTypes.includes(l.value)),k=t.computed(()=>c.state.isGettingAllDictTypes),j=t.computed(()=>{const C=d.props??{};return C.disabled=C.disabled??c.state.dictConfig.format.disabled,C.label=C.label??c.state.dictConfig.treeSetting.labelField,C.children=C.children??c.state.dictConfig.treeSetting.childrenField,C.isLeaf=C.leaf??c.state.dictConfig.treeSetting.leafField,C}),F=t.computed(()=>{const C=d.props??{},m={labelField:C.label??u.treeSetting.labelField,childrenField:C.children??u.treeSetting.childrenField,leafField:C.leaf??u.treeSetting.leafField},b=Object.assign(c.state.dictConfig.treeSetting,m),f=JSON.parse(JSON.stringify(p.list)),D=X(f,b);return g&&y(D,+g),D});t.watch([I,k],([C,m])=>{!C&&!m&&h()},{immediate:!0});const E=t.ref(null);return a({getRef:()=>E.value}),(C,m)=>{const b=t.resolveComponent("el-tree-select");return t.openBlock(),t.createBlock(b,{ref_key:"ElTreeSelectDict",ref:E,data:t.unref(F),"node-key":e.nodeKey,props:t.unref(j)},t.createSlots({_:2},[t.renderList(C.$slots,(f,D,T)=>({name:D,fn:t.withCtx(S=>[t.renderSlot(C.$slots,D,t.normalizeProps(t.guardReactiveProps(S)))])}))]),1032,["data","node-key","props"])}}});gt.install=function(e){e.component(gt.name,gt)};const jt=Object.assign({"./el-button-dict/index.ts":Vt,"./el-cascader-dict/index.ts":wt,"./el-checkbox-button-dict/index.ts":Rt,"./el-checkbox-dict/index.ts":Jt,"./el-link-dict/index.ts":zt,"./el-radio-button-dict/index.ts":Kt,"./el-radio-dict/index.ts":Ut,"./el-select-dict/index.ts":Ht,"./el-table-column-dict/index.ts":ce,"./el-tabs-dict/index.ts":fe,"./el-tag-dict/index.ts":ge,"./el-text-dict/index.ts":be,"./el-tree-dict/index.ts":ye,"./el-tree-select-dict/index.ts":Object.freeze(Object.defineProperty({__proto__:null,default:gt},Symbol.toStringTag,{value:"Module"}))});let It=[];Object.keys(jt).forEach(e=>{It.push(jt[e].default)});const Te=()=>c.state.dictConfig,Se=e=>c.state.dictConfig[e],Ce=()=>c.state.dictCodes,_e=e=>c.state.dictCodes[e],he=Te,Oe=Se,Fe=Ce,je=_e,Ie=At,ke=Gt,Ae=Bt,Ge=Lt,Be=Et,Le=Q,Ee=Qt,Ne=pt,Ve=Xt,$e=Zt,we=U,Pe=Ot,Re=_t,xe=Ct,Je=ht,Me=Ft,ze=St,qe=Tt,Ke=X,Ye=q,Ue=Y,We=vt,He=ee,Qe=te,Xe=ne,Ze=ae,ve=re,tn=yt,en=le;let mt=null;async function kt(e){var o;const a=e.storage.getItem(e.dictDataKey)||"{}",g=JSON.parse(a),n=e.usuallyGetDictTypes?e.usuallyGetDictTypes.split(","):[],s=Object.keys(e.localDictCodes),r=n.filter(d=>s.includes(d)?(console.warn(`注意:usuallyGetDictTypes配置与本地字典配置的字典类型${d}冲突`),!1):!0);let i=[];if(e.usuallyGetDictTypesByApi)i=r;else if(r.length>0)for(let d=0;d<r.length;d++)g[r[d]]||i.push(r[d]);if(a==="{}"||e.isGetAll||i.length>0){let d,l="";e.isGetAll?(c.mutations.SETTING_ISGETTING_ALL_DICT_TYPES(!0),d=await e.getDictCodeApi(e.formatterRequest(e.query,l)),c.mutations.SETTING_ISGETTING_ALL_DICT_TYPES(!1)):i.length>0&&(l=i.join(","),c.mutations.ADD_IS_GETTING_DICT_TYPES(l),d=await e.getDictCodeApi(e.formatterRequest(e.query,l)),c.mutations.REMOVE_IS_GETTING_DICT_TYPES(l));const u=e.formatterDictList(d,l),p=e.formatterDictVersion(d);e.storage.setItem(e.versionKey,p);const y=Object.assign(c.state.dictCodes,u),h=K(y,e.filterDataFun,e.disabledDataFun,(o=e==null?void 0:e.format)==null?void 0:o.disabled);c.mutations.SET_DICT_CODES(h),e.storage.setItem(e.dictDataKey,JSON.stringify(h))}}let nn={async install(e,a){var u,p;const g={getLoginStatusFunc:()=>!0,loginStatusChangeFunc:null,filterDataFun:y=>y,disabledDataFun:y=>!1,treeSetting:{idField:"id",parentIdField:"parentId",childrenField:"children",firstId:"0",labelField:"label",labelArrField:"labelArr",idArrField:"idArr",levelField:"level",level:0,leafField:"leaf"},query:"dictType",versionKey:"vue3ElementDictVersion",dictDataKey:"vue3ElementDictData",format:{value:"value",label:"label",disabled:"disabled",type:"type",color:"color"},formatterRequest:(y,h)=>h?{[y]:h}:{[y]:""},formatterDictList:(y,h)=>!y||!y.dictData?{}:y.dictData,formatterDictVersion:y=>!y||!y.version?"unknow":y.version,version:"unknow",storage:localStorage,isGetAll:!1,usuallyGetDictTypes:"",usuallyGetDictTypesByApi:!1,localDictCodes:{}};a.format=Object.assign(g.format,a.format),a.treeSetting=Object.assign(g.treeSetting,a.treeSetting);const n=Object.assign(g,a);c.mutations.SET_DICT_SETTING(n);const s=JSON.parse(n.storage.getItem(n.dictDataKey))||{};let r=JSON.parse(JSON.stringify(n.localDictCodes));r=Object.assign(s,r);const i=K(r,n.filterDataFun,n.disabledDataFun,(u=n==null?void 0:n.format)==null?void 0:u.disabled);n.storage.setItem(n.dictDataKey,JSON.stringify(i)),c.mutations.SET_DICT_CODES(i);const o=n.storage.getItem(n.versionKey);if(n.version!==o){n.storage.removeItem(n.dictDataKey),n.storage.setItem(n.versionKey,n.version);const y=JSON.parse(JSON.stringify(n.localDictCodes)),h=K(y,n.filterDataFun,n.disabledDataFun,(p=n==null?void 0:n.format)==null?void 0:p.disabled);n.storage.setItem(n.dictDataKey,JSON.stringify(h)),c.mutations.SET_DICT_CODES(h)}n.getLoginStatusFunc()&&(n.isGetAll||n.usuallyGetDictTypes)&&kt(n),It.forEach(y=>{e.component(y.name,y)});const d=t.reactive({hadLogin:t.computed(()=>c.state.dictConfig.getLoginStatusFunc())});(()=>{mt&&(mt(),mt=null),mt=t.watch(()=>d.hadLogin,y=>{n.loginStatusChangeFunc&&n.loginStatusChangeFunc(y),y&&(n.isGetAll||n.usuallyGetDictTypes)&&kt(n)},{immediate:!1})})()}};B.default=nn,B.desensitization=Me,B.formatDate=ze,B.getCodeByLabel=Ae,B.getCodeByLabelFilter=Ve,B.getCodeByLabels=Ge,B.getCodeByLabelsFilter=$e,B.getDictConfig=he,B.getDictConfigByKey=Oe,B.getDictData=Fe,B.getDictDataByKey=je,B.getDictObjByDictTypes=Be,B.getItemByCode=Le,B.getLabelByCode=Ie,B.getLabelByCodeFilter=Ee,B.getLabelByCodes=ke,B.getLabelByCodesFilter=Ne,B.getTreeCodeByLabel=He,B.getTreeCodeByLabelFilter=ve,B.getTreeCodeByLabels=Xe,B.getTreeCodeByLabelsFilter=en,B.getTreeItemByCode=Ye,B.getTreeItemByLabel=Ue,B.getTreeLabelByCode=We,B.getTreeLabelByCodeFilter=Ze,B.getTreeLabelByCodes=Qe,B.getTreeLabelByCodesFilter=tn,B.isDate=qe,B.listToTree=Ke,B.mask=we,B.maskAddress=Pe,B.maskIdCard=Re,B.maskName=xe,B.maskPhone=Je,Object.defineProperties(B,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|