vue3-element-dict 2.0.5 → 2.0.6
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 +41 -4
- package/lib/vue3-element-dict.js +2 -2
- package/lib/vue3-element-dict.umd.cjs +1 -1
- package/package.json +4 -1
- package/lib/vite.svg +0 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
**效果如下**
|
|
12
12
|
|
|
13
|
-

|
|
14
14
|
|
|
15
15
|
**示例2:实现cascader**
|
|
16
16
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<el-cascader-dict dictType="area" placeholder="请选择地区" clearable :props="props" v-model="value" @dictChange="handleDictChange"></el-cascader-dict>
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-

|
|
22
22
|
|
|
23
23
|
**此处主要讲包的配置及准备工作,具体用法可前往[vue3-element-dict官网](http://xiaobusoft.com/vue3-element-dict)查看使用文档,[备用官网](https://shenxiaobu.github.io/vue3-element-dict/),如有问题可前往[问题反馈表格进行记录](https://docs.qq.com/sheet/DVmZQb0hyTk9uc1dY), 也可关注微信公众号【爆米花小布】私信进行反馈**
|
|
24
24
|
|
|
@@ -371,18 +371,55 @@ getGlobalConfigApi().then(data => {
|
|
|
371
371
|
|
|
372
372
|
**此处主要讲包的配置及准备工作,具体用法可前往[vue3-element-dict官网](http://xiaobusoft.com/vue3-element-dict)查看使用文档,[备用官网](https://shenxiaobu.github.io/vue3-element-dict/),如有问题可前往[问题反馈表格进行记录](https://docs.qq.com/sheet/DVmZQb0hyTk9uc1dY), 也可关注微信公众号【爆米花小布】私信进行反馈**
|
|
373
373
|
|
|
374
|
-

|
|
375
375
|
|
|
376
376
|
## 微信赞助
|
|
377
377
|
|
|
378
378
|
开发不易,如果对您有所帮助,可赞助作者,利于官网服务器运营。您的支持,是我继续努力的最大动力。
|
|
379
379
|
|
|
380
|
-

|
|
381
381
|
|
|
382
382
|
|
|
383
383
|
|
|
384
384
|
## 更新日志
|
|
385
385
|
|
|
386
|
+
### 2.0.6
|
|
387
|
+
|
|
388
|
+
1. 【优化】el-cascader-dict组件的props属性新增idField字段配置用于配置数组数据根据什么id字段转化为树形结构数据
|
|
389
|
+
2. 【优化】el-cascader-dict组件的值的配置字段从原先的treeSetting.idField 改为现在的 format.value 配置
|
|
390
|
+
3. 【优化】treeSetting.idField配置作用改为仅用于数组转树形结构判断依据使用
|
|
391
|
+
|
|
392
|
+
```js
|
|
393
|
+
const setting:any = computed(() => {
|
|
394
|
+
const props:any = attrs.props??{}
|
|
395
|
+
props.disabled = props.disabled??dictConfig.format.disabled
|
|
396
|
+
props.value = props.value??dictConfig.format.value
|
|
397
|
+
props.label = props.label??dictConfig.treeSetting.labelField
|
|
398
|
+
props.children = props.children??dictConfig.treeSetting.childrenField
|
|
399
|
+
props.leaf = props.leaf??dictConfig.treeSetting.leafField
|
|
400
|
+
return props
|
|
401
|
+
})
|
|
402
|
+
const options = computed(() => {
|
|
403
|
+
const props:any = attrs.props??{}
|
|
404
|
+
const newProps = {
|
|
405
|
+
idField: props.idField??dictConfig.treeSetting.idField,
|
|
406
|
+
labelField: props.label??dictConfig.treeSetting.labelField,
|
|
407
|
+
childrenField: props.children??dictConfig.treeSetting.childrenField,
|
|
408
|
+
leafField: props.leaf??dictConfig.treeSetting.leafField
|
|
409
|
+
}
|
|
410
|
+
const treeSetting = Object.assign(dictConfig.treeSetting, newProps) as OptionalTreeSetting
|
|
411
|
+
const treeArr = JSON.parse(JSON.stringify(data.list))
|
|
412
|
+
|
|
413
|
+
const treeData = ListToTree(treeArr, treeSetting)
|
|
414
|
+
// 限制层级
|
|
415
|
+
if (maxLevel) {
|
|
416
|
+
filterLevel(treeData, +maxLevel)
|
|
417
|
+
}
|
|
418
|
+
return treeData
|
|
419
|
+
})
|
|
420
|
+
|
|
421
|
+
```
|
|
422
|
+
|
|
386
423
|
### 2.0.5
|
|
387
424
|
1. 【修复】修复同个页面使用同个字典类型时,只有第一个组件会渲染数据的bug
|
|
388
425
|
|
package/lib/vue3-element-dict.js
CHANGED
|
@@ -671,10 +671,10 @@ const ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
671
671
|
T.list = d;
|
|
672
672
|
}, C = E(() => c.state.isGettingDictTypes.includes(a.value)), F = E(() => c.state.isGettingAllDictTypes), O = E(() => {
|
|
673
673
|
const d = u.props ?? {};
|
|
674
|
-
return d.disabled = d.disabled ?? s.format.disabled, d.value = d.value ?? s.
|
|
674
|
+
return d.disabled = d.disabled ?? s.format.disabled, d.value = d.value ?? s.format.value, d.label = d.label ?? s.treeSetting.labelField, d.children = d.children ?? s.treeSetting.childrenField, d.leaf = d.leaf ?? s.treeSetting.leafField, d;
|
|
675
675
|
}), S = E(() => {
|
|
676
676
|
const d = u.props ?? {}, m = {
|
|
677
|
-
idField: d.
|
|
677
|
+
idField: d.idField ?? s.treeSetting.idField,
|
|
678
678
|
labelField: d.label ?? s.treeSetting.labelField,
|
|
679
679
|
childrenField: d.children ?? s.treeSetting.childrenField,
|
|
680
680
|
leafField: d.leaf ?? s.treeSetting.leafField
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(G,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(G=typeof globalThis<"u"?globalThis:G||self,t(G["vue3-element-dict"]={},G.Vue))})(this,function(G,t){"use strict";const M=(e,a,g,n)=>{const s={};for(let l in e)s[l]=a(e[l]).map(d=>({...d,[n]:g(d)||!!d[n]}));return s},L=t.reactive({dictConfig:{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:[]}),V={SET_DICT_SETTING(e){L.dictConfig=e},SET_DICT_CODES(e){L.dictCodes=e},ADD_IS_EGTTING_DICT_TYPES(e){const g=[...e.split(","),...L.isGettingDictTypes],n=new Set(g);L.isGettingDictTypes=Array.from(n)},REMOVE_IS_EGTTING_DICT_TYPES(e){const a=e.split(","),g=[...new Set(L.isGettingDictTypes)].filter(n=>!new Set(a).has(n));L.isGettingDictTypes=Array.from(g)},SETTING_ISGETTING_ALL_DICT_TYPES(e){L.isGettingAllDictTypes=e},ADD_UNFIND_DICT_TYPES(e){const g=[...e.split(","),...L.unfindDictTypes],n=new Set(g);L.unfindDictTypes=Array.from(n)},REMOVE_UNFIND_DICT_TYPES(e){const a=e.split(","),g=[...new Set(L.unfindDictTypes)].filter(n=>!new Set(a).has(n));L.unfindDictTypes=Array.from(g)}},c={state:L,mutations:V,actions:{getDictDataObj(e){return new Promise((a,g)=>{if(!e)return;const{storage:n,dictDataKey:s,getDictCodeApi:l,usuallyGetDictTypes:d,formatterRequest:r,query:f,versionKey:i,localDictCodes:o,formatterDictList:p,formatterDictVersion:C,isGetAll:A,filterDataFun:j,disabledDataFun:h,format:F}=L.dictConfig,O=L.dictCodes||o;if(!O[e]||O[e].length===0){if(L.isGettingDictTypes.includes(e)||L.isGettingAllDictTypes)return;if(V.ADD_IS_EGTTING_DICT_TYPES(e),L.unfindDictTypes.includes(e)){g(`不存在类型为:${e} 的字典字段,请确认后再填写`);return}V.ADD_UNFIND_DICT_TYPES(e),l(r(f,e)).then(_=>{V.REMOVE_IS_EGTTING_DICT_TYPES(e);const D=C(_),m=n.getItem(i);if(D!==m){let u="";if(A)u="",V.SETTING_ISGETTING_ALL_DICT_TYPES(!0);else{if(d){const b=Object.keys(O),y=d.split(","),T=b.concat(y);T.push(e),u=Array.from(new Set(T)).join(",")}else{const b=Object.keys(O);b.push(e),u=Array.from(new Set(b)).join(",")}V.ADD_IS_EGTTING_DICT_TYPES(u)}l(r(f,u)).then(b=>{const y=p(b,e);if(!(y[e]&&y[e].length>0)){g(`不存在类型为:${e} 的字典字段,请确认后再填写`);return}V.REMOVE_UNFIND_DICT_TYPES(e);const T=C(b),S=Object.assign(JSON.parse(JSON.stringify(o)),y),I=M(S,j,h,F==null?void 0:F.disabled);n.setItem(s,JSON.stringify(I)),n.setItem(i,T),V.SET_DICT_CODES(I),a(L.dictCodes),L.isGettingAllDictTypes?V.SETTING_ISGETTING_ALL_DICT_TYPES(!1):V.REMOVE_IS_EGTTING_DICT_TYPES(u)})}else{const u=p(_,e);if(!(u[e]&&u[e].length>0)){g(`不存在类型为:${e} 的字典字段,请确认后再填写`);return}V.REMOVE_UNFIND_DICT_TYPES(e);const b=L.dictCodes||o,y=M(u,j,h,F==null?void 0:F.disabled);Object.assign(b,y),n.setItem(s,JSON.stringify(b)),V.SET_DICT_CODES(b),a(L.dictCodes)}})}else V.REMOVE_UNFIND_DICT_TYPES(e),V.SET_DICT_CODES(O),a(L.dictCodes)})}}},It=(e,a,g)=>new Promise((n,s)=>{const{format:l}=c.state.dictConfig,d=c.state.dictCodes;let r=[];if(!d||!d[a])if(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes){const f=setInterval(()=>{if(!(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes)){if(clearInterval(f),r=c.state.dictCodes[a],!r){s(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const i=r.find(o=>o[l.value]===e);n(i?i[l.label]:g??"")}},1e3)}else c.actions.getDictDataObj(a).then(f=>{if(r=f[a],!r){s(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const i=r.find(o=>o[l.value]===e);n(i?i[l.label]:g??"")});else{r=d[a];const f=r.find(i=>i[l.value]===e);n(f?f[l.label]:g??"")}});function K(e,a,g,n){const s=[];for(let l=0;l<e.length;l++){const d=a.find(r=>r[g.value]===e[l]);d?s.push(d):s.push({[g.label]:n,[g.value]:e[l]})}return s}const kt=(e,a,g)=>{const n={defaultVal:"",formatFun:(s,l)=>s.map(d=>d[l.label]).join(","),spacer:","};return Object.assign(n,g),new Promise((s,l)=>{let d=[];Array.isArray(e)?d=e:typeof e=="string"&&(d=e.split(n.spacer));const{format:r}=c.state.dictConfig,f=c.state.dictCodes;let i=[];if(!f||!f[a])if(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes){const o=setInterval(()=>{if(!(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes)){if(clearInterval(o),i=c.state.dictCodes[a],!i){l(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const p=K(d,i,r,n.defaultVal);s(p&&p.length>0?n.formatFun(p,r):n.defaultVal)}},1e3)}else c.actions.getDictDataObj(a).then(o=>{if(i=o[a],!i){l(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const p=K(d,i,r,n.defaultVal);s(p&&p.length>0?n.formatFun(p,r):n.defaultVal)});else{i=f[a];const o=K(d,i,r,n.defaultVal);s(o&&o.length>0?n.formatFun(o,r):n.defaultVal)}})},jt=(e,a,g)=>new Promise((n,s)=>{const{format:l}=c.state.dictConfig,d=c.state.dictCodes;let r=[];if(!d||!d[a])if(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes){const f=setInterval(()=>{if(!(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes)){if(clearInterval(f),r=c.state.dictCodes[a],!r){s(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const i=r.find(o=>o[l.label]===e);n(i?i[l.value]:g??"")}},1e3)}else c.actions.getDictDataObj(a).then(f=>{if(r=f[a],!r){s(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const i=r.find(o=>o[l.label]===e);n(i?i[l.value]:g??"")});else{r=d[a];const f=r.find(i=>i[l.label]===e);n(f?f[l.value]:g??"")}});function Y(e,a,g,n){const s=[];for(let l=0;l<e.length;l++){const d=a.find(r=>r[g.label]===e[l]);d?s.push(d):s.push({[g.label]:e[l],[g.value]:n})}return s}const At=(e,a,g)=>{const n={defaultVal:"",formatFun:(s,l)=>s.map(d=>d[l.value]).join(","),spacer:","};return Object.assign(n,g),new Promise((s,l)=>{let d=[];Array.isArray(e)?d=e:typeof e=="string"&&(d=e.split(n.spacer));const{format:r}=c.state.dictConfig,f=c.state.dictCodes;let i=[];if(!f||!f[a])if(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes){const o=setInterval(()=>{if(!(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes)){if(clearInterval(o),i=c.state.dictCodes[a],!i){l(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const p=Y(d,i,r,n.defaultVal);s(p&&p.length>0?n.formatFun(p,r):n.defaultVal)}},1e3)}else c.actions.getDictDataObj(a).then(o=>{if(i=o[a],!i){l(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const p=Y(d,i,r,n.defaultVal);s(p&&p.length>0?n.formatFun(p,r):n.defaultVal)});else{i=f[a];const o=Y(d,i,r,n.defaultVal);s(o&&o.length>0?n.formatFun(o,r):n.defaultVal)}})},Gt=e=>new Promise((a,g)=>{let n=[],s="";Array.isArray(e)?(s=e.join(","),n=e):typeof e=="string"&&(n=e.split(","));const l=c.state.dictCodes,d=c.state.dictConfig;if(!l)c.mutations.ADD_IS_EGTTING_DICT_TYPES(s),d.getDictCodeApi(d.formatterRequest(d.query,s)).then(r=>{c.mutations.REMOVE_IS_EGTTING_DICT_TYPES(s);const f=d.formatterDictList(r,e),i=M(f,d.filterDataFun,d.disabledDataFun),o=JSON.parse(JSON.stringify(i)),p=Object.assign(c.state.dictCodes,o);d.storage.setItem(d.dictDataKey,JSON.stringify(p)),c.mutations.SET_DICT_CODES(p),a(i)});else{const r=[],f={};for(let i=0;i<n.length;i++){if(l[n[i]]){f[n[i]]=l[n[i]];continue}r.push(n[i])}r.length>0?(c.mutations.ADD_IS_EGTTING_DICT_TYPES(r.join(",")),d.getDictCodeApi(d.formatterRequest(d.query,r.join(","))).then(i=>{c.mutations.REMOVE_IS_EGTTING_DICT_TYPES(r.join(","));const o=d.formatterDictList(i,e),p=M(o,d.filterDataFun,d.disabledDataFun),C=JSON.parse(JSON.stringify(p)),A=Object.assign(c.state.dictCodes,C);d.storage.setItem(d.dictDataKey,JSON.stringify(A)),c.mutations.SET_DICT_CODES(A);const j=Object.assign(f,o),h=[];for(const F in j)(!j[F]||j[F].length===0)&&h.push(F);h.length>0&&g(`不存在类型为:${h.join("、")} 的字典字段,请确认后再填写`),a(p)})):a(f)}}),U=(e,a,g)=>new Promise((n,s)=>{const{format:l}=c.state.dictConfig,d=c.state.dictCodes;let r=[];if(!d||!d[a])if(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes){const f=setInterval(()=>{if(!(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes)){if(clearInterval(f),r=c.state.dictCodes[a],!r){s(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const i=r.find(o=>o[l.value]===e);n(i||(g??""))}},1e3)}else c.actions.getDictDataObj(a).then(f=>{if(r=f[a],!r){s(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const i=r.find(o=>o[l.value]===e);n(i||(g??""))});else{r=d[a];const f=r.find(i=>i[l.value]===e);n(f||(g??""))}}),Bt={name:"ElButtonDict"},X=t.defineComponent({...Bt,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:l,type:d,judgeColorFun:r,color:f,judgeDisabledFun:i,disabled:o}=t.toRefs(g),p=t.toRaw(c.state.dictConfig),C=t.computed(()=>l!=null&&l.value?l.value(n.value):d.value?d.value:h.value&&h.value[p.format.type]?h.value[p.format.type]:"primary"),A=t.computed(()=>r!=null&&r.value?r.value(n.value):f!=null&&f.value?f.value:h.value&&h.value[p.format.color]?h.value[p.format.color]:""),j=t.computed(()=>h.value&&h.value[p.format.disabled]?h.value[p.format.disabled]:i!=null&&i.value?i.value(n.value):!!o.value);let h=t.ref(null),F=t.ref(null);t.watchEffect(()=>{U(n.value,s.value).then(D=>{h.value=D,F.value=D[p.format.label]})});const O=t.ref(null);return a({getRef:()=>O.value}),(D,m)=>{const u=t.resolveComponent("el-button");return t.openBlock(),t.createBlock(u,t.mergeProps({ref_key:"ElButtonDict",ref:O,type:t.unref(C),color:t.unref(A),disabled:t.unref(j)},D.$attrs),t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(F)),1)]),_:2},[t.renderList(D.$slots,(b,y,T)=>({name:y,fn:t.withCtx(S=>[t.renderSlot(D.$slots,y,t.normalizeProps(t.guardReactiveProps(S)))])}))]),1040,["type","color","disabled"])}}});X.install=function(e){e.component(X.name,X)};const Et=Object.freeze(Object.defineProperty({__proto__:null,default:X},Symbol.toStringTag,{value:"Module"})),H=(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=[],l,d=0;d<e.length;d++)if(e[d][n.parentIdField]===g[n.idField]){var r=e[d];r[n.levelField]=g[n.levelField]+1,r[n.labelArrField]=g[n.labelArrField].concat(r[n.labelField]),r[n.idArrField]=g[n.idArrField].concat(r[n.idField]),l=H(e,a,r),l.length>0?(r[n.childrenField]=l,r[n.leafField]=!1):r[n.leafField]=!0,s.push(r)}return s},x=(e,a,g)=>{const n={idField:"id",parentIdField:"parentId"};Object.assign(n,g);const s=a.find(l=>l[n.idField]===e);return s?x(s[n.parentIdField],a,n).concat([s]):[]},z=(e,a,g)=>{const n={idField:"id",labelField:"label",parentIdField:"parentId"};Object.assign(n,g);const s=a.find(l=>l[n.labelField]===e);return x(s[n.idField],a,n)},Lt={name:"ElCascaderDict"},Z=t.defineComponent({...Lt,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:l,filterDataFun:d,disabledDataFun:r}=e,f=t.useAttrs(),i=t.ref(""),o=t.toRaw(c.state.dictConfig),p=u=>{g("dictChange",u)},C=t.reactive({list:[]}),A=(u,b)=>{for(let y=0;y<u.length;y++){const T=u[y];if(T[o.treeSetting.levelField]===b){delete T[O.value.children],T[O.value.leaf]=!0;continue}else A(T[O.value.children],b)}},j=async()=>{if(!s)return;let u=[];if(typeof s=="object"){i.value=s.type;const b=await c.actions.getDictDataObj(i.value);u=[].concat(b[i.value]);const{filters:y,filterType:T=o.format.value,reverse:S=!1}=s,I=typeof y=="string"?y.split(","):y;S?u=u.filter(B=>!I.includes(B[T])):u=u.filter(B=>I.includes(B[T]))}else{i.value=s;const b=await c.actions.getDictDataObj(i.value);u=[].concat(b[i.value])}if(d&&(u=d(u)),r&&(u=u.map(b=>({...b,[o.format.disabled]:!!b[o.format.disabled]||r(b)}))),l){const{disableValue:b,disableType:y=o.format.value,reverse:T=!1}=l,S=typeof b=="string"?b.split(","):b;T?u=u.map(I=>{const B=JSON.parse(JSON.stringify(I));return B[o.format.disabled]=!S.includes(B[y])||B[o.format.disabled],B}):u=u.map(I=>{const B=JSON.parse(JSON.stringify(I));return B[o.format.disabled]=S.includes(B[y])||B[o.format.disabled],B})}C.list=u},h=t.computed(()=>c.state.isGettingDictTypes.includes(i.value)),F=t.computed(()=>c.state.isGettingAllDictTypes),O=t.computed(()=>{const u=f.props??{};return u.disabled=u.disabled??o.format.disabled,u.value=u.value??o.treeSetting.idField,u.label=u.label??o.treeSetting.labelField,u.children=u.children??o.treeSetting.childrenField,u.leaf=u.leaf??o.treeSetting.leafField,u}),_=t.computed(()=>{const u=f.props??{},b={idField:u.value??o.treeSetting.idField,labelField:u.label??o.treeSetting.labelField,childrenField:u.children??o.treeSetting.childrenField,leafField:u.leaf??o.treeSetting.leafField},y=Object.assign(o.treeSetting,b),T=JSON.parse(JSON.stringify(C.list)),S=H(T,y);return n&&A(S,+n),S});t.watch([h,F],([u,b])=>{!u&&!b&&j()},{immediate:!0});const D=t.ref(null);return a({getRef:()=>D.value}),(u,b)=>{const y=t.resolveComponent("el-cascader");return t.openBlock(),t.createBlock(y,{ref_key:"ElCascaderDict",ref:D,options:t.unref(_),props:t.unref(O),onChange:p},t.createSlots({_:2},[t.renderList(u.$slots,(T,S,I)=>({name:S,fn:t.withCtx(B=>[t.renderSlot(u.$slots,S,t.normalizeProps(t.guardReactiveProps(B)))])}))]),1032,["options","props"])}}});Z.install=function(e){e.component(Z.name,Z)};const Nt=Object.freeze(Object.defineProperty({__proto__:null,default:Z},Symbol.toStringTag,{value:"Module"})),Vt={name:"ElCheckboxButtonDict"},v=t.defineComponent({...Vt,props:{dictType:{type:[String,Object],required:!0},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{dictType:n,disableObj:s,name:l,checked:d,trueValue:r,falseValue:f,trueLabel:i,falseLabel:o,keyValue:p,filterDataFun:C,disabledDataFun:A}=e,j=t.ref(""),h=t.toRaw(c.state.dictConfig),F=y=>{if(!p){g("dictChange",y);return}const T=O.list.filter(S=>y.includes(S[h.format.value]));g("dictChange",T)},O=t.reactive({list:[]}),_=async()=>{if(!n)return;let y=[];if(typeof n=="object"){j.value=n.type;const T=await c.actions.getDictDataObj(j.value);y=[].concat(T[j.value]);const{filters:S,filterType:I=h.format.value,reverse:B=!1}=n,w=typeof S=="string"?S.split(","):S;B?y=y.filter(k=>!w.includes(k[I])):y=y.filter(k=>w.includes(k[I]))}else{j.value=n;const T=await c.actions.getDictDataObj(j.value);y=[].concat(T[j.value])}if(C&&(y=C(y)),A&&(y=y.map(T=>({...T,[h.format.disabled]:!!T[h.format.disabled]||A(T)}))),s){const{disableValue:T,disableType:S=h.format.value,reverse:I=!1}=s,B=typeof T=="string"?T.split(","):T;I?y=y.map(w=>{const k=JSON.parse(JSON.stringify(w));return k[h.format.disabled]=!B.includes(k[S])||k[h.format.disabled],k}):y=y.map(w=>{const k=JSON.parse(JSON.stringify(w));return k[h.format.disabled]=B.includes(k[S])||k[h.format.disabled],k})}O.list=y},D=t.computed(()=>c.state.isGettingDictTypes.includes(j.value)),m=t.computed(()=>c.state.isGettingAllDictTypes);t.watch([D,m],([y,T])=>{!y&&!T&&_()},{immediate:!0});const u=t.ref(null);return a({getRef:()=>u.value}),(y,T)=>{const S=t.resolveComponent("el-checkbox-button"),I=t.resolveComponent("el-checkbox-group");return t.openBlock(),t.createBlock(I,t.mergeProps({ref_key:"ElCheckboxButtonDict",ref:u},y.$attrs,{onChange:F}),t.createSlots({default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(O.list,B=>(t.openBlock(),t.createBlock(S,{key:B[t.unref(h).format.value],disabled:B[t.unref(h).format.disabled],label:B[t.unref(h).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(B[t.unref(h).format.label]),1)]),_:2},1032,["disabled","label","name","true-value","false-value","true-label","false-label","checked"]))),128))]),_:2},[t.renderList(y.$slots,(B,w,k)=>({name:w,fn:t.withCtx(E=>[t.renderSlot(y.$slots,w,t.normalizeProps(t.guardReactiveProps(E)))])}))]),1040)}}});v.install=function(e){e.component(v.name,v)};const wt=Object.freeze(Object.defineProperty({__proto__:null,default:v},Symbol.toStringTag,{value:"Module"})),$t={name:"ElCheckboxDict"},tt=t.defineComponent({...$t,props:{dictType:{type:[String,Object],required:!0},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{dictType:n,disableObj:s,border:l,size:d,name:r,checked:f,indeterminate:i,trueValue:o,falseValue:p,trueLabel:C,falseLabel:A,keyValue:j,filterDataFun:h,disabledDataFun:F,validateEvent:O,tabindex:_,id:D}=e,m=t.ref(""),u=t.toRaw(c.state.dictConfig),b=k=>{if(!j){g("dictChange",k);return}const E=y.list.find($=>k.includes($[u.format.value]));g("dictChange",E)},y=t.reactive({list:[]}),T=async()=>{if(!n)return;let k=[];if(typeof n=="object"){m.value=n.type;const E=await c.actions.getDictDataObj(m.value);k=[].concat(E[m.value]);const{filters:$,filterType:J=u.format.value,reverse:P=!1}=n,R=typeof $=="string"?$.split(","):$;P?k=k.filter(N=>!R.includes(N[J])):k=k.filter(N=>R.includes(N[J]))}else{m.value=n;const E=await c.actions.getDictDataObj(m.value);k=[].concat(E[m.value])}if(h&&(k=h(k)),F&&(k=k.map(E=>({...E,[u.format.disabled]:!!E[u.format.disabled]||F(E)}))),s){const{disableValue:E,disableType:$=u.format.value,reverse:J=!1}=s,P=typeof E=="string"?E.split(","):E;J?k=k.map(R=>{const N=JSON.parse(JSON.stringify(R));return N[u.format.disabled]=!P.includes(N[$])||N[u.format.disabled],N}):k=k.map(R=>{const N=JSON.parse(JSON.stringify(R));return N[u.format.disabled]=P.includes(N[$])||N[u.format.disabled],N})}y.list=k},S=t.computed(()=>c.state.isGettingDictTypes.includes(m.value)),I=t.computed(()=>c.state.isGettingAllDictTypes);t.watch([S,I],([k,E])=>{!k&&!E&&T()},{immediate:!0});const B=t.ref(null);return a({getRef:()=>B.value}),(k,E)=>{const $=t.resolveComponent("el-checkbox"),J=t.resolveComponent("el-checkbox-group");return t.openBlock(),t.createBlock(J,t.mergeProps({ref_key:"ElCheckboxDict",ref:B},k.$attrs,{onChange:b}),t.createSlots({default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(y.list,P=>(t.openBlock(),t.createBlock($,{key:P[t.unref(u).format.value],label:P[t.unref(u).format.value],"true-value":e.trueValue,"false-value":e.falseValue,"true-label":e.trueLabel,"false-label":e.falseLabel,disabled:P[t.unref(u).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(P[t.unref(u).format.label]),1)]),_:2},1032,["label","true-value","false-value","true-label","false-label","disabled","border","size","name","checked","indeterminate","validate-event","tabindex","id"]))),128))]),_:2},[t.renderList(k.$slots,(P,R,N)=>({name:R,fn:t.withCtx(ft=>[t.renderSlot(k.$slots,R,t.normalizeProps(t.guardReactiveProps(ft)))])}))]),1040)}}});tt.install=function(e){e.component(tt.name,tt)};const Pt=Object.freeze(Object.defineProperty({__proto__:null,default:tt},Symbol.toStringTag,{value:"Module"})),Rt={name:"ElLinkDict"},et=t.defineComponent({...Rt,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:l,type:d,judgeDisabledFun:r,disabled:f}=t.toRefs(g),i=t.toRaw(c.state.dictConfig),o=t.computed(()=>l!=null&&l.value?l.value(n.value):d.value?d.value:C.value&&C.value[i.format.type]?C.value[i.format.type]:"primary"),p=t.computed(()=>C.value&&C.value[i.format.disabled]?C.value[i.format.disabled]:r!=null&&r.value?r.value(n.value):!!f.value);let C=t.ref(null),A=t.ref(null);t.watchEffect(()=>{U(n.value,s.value).then(F=>{C.value=F,A.value=F[i.format.label]})});const j=t.ref(null);return a({getRef:()=>j.value}),(F,O)=>{const _=t.resolveComponent("el-link");return t.openBlock(),t.createBlock(_,t.mergeProps({ref_key:"ElLinkDict",ref:j,type:t.unref(o),disabled:t.unref(p)},F.$attrs),t.createSlots({default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(t.unref(A)),1)]),_:2},[t.renderList(F.$slots,(D,m,u)=>({name:m,fn:t.withCtx(b=>[t.renderSlot(F.$slots,m,t.normalizeProps(t.guardReactiveProps(b)))])}))]),1040,["type","disabled"])}}});et.install=function(e){e.component(et.name,et)};const Jt=Object.freeze(Object.defineProperty({__proto__:null,default:et},Symbol.toStringTag,{value:"Module"})),xt={name:"ElRadioButtonDict"},nt=t.defineComponent({...xt,props:{dictType:{type:[String,Object],required:!0},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{dictType:n,disableObj:s,name:l,keyValue:d,filterDataFun:r,disabledDataFun:f}=e,i=t.ref(""),o=t.toRaw(c.state.dictConfig),p=_=>{if(!d){g("dictChange",_);return}const D=C.list.find(m=>m[o.format.value]===_);g("dictChange",D)},C=t.reactive({list:[]}),A=async()=>{if(!n)return;let _=[];if(typeof n=="object"){i.value=n.type;const D=await c.actions.getDictDataObj(i.value);_=[].concat(D[i.value]);const{filters:m,filterType:u=o.format.value,reverse:b=!1}=n,y=typeof m=="string"?m.split(","):m;b?_=_.filter(T=>!y.includes(T[u])):_=_.filter(T=>y.includes(T[u]))}else{i.value=n;const D=await c.actions.getDictDataObj(i.value);_=[].concat(D[i.value])}if(r&&(_=r(_)),f&&(_=_.map(D=>({...D,[o.format.disabled]:!!D[o.format.disabled]||f(D)}))),s){const{disableValue:D,disableType:m=o.format.value,reverse:u=!1}=s,b=typeof D=="string"?D.split(","):D;u?_=_.map(y=>{const T=JSON.parse(JSON.stringify(y));return T[o.format.disabled]=!b.includes(T[m])||T[o.format.disabled],T}):_=_.map(y=>{const T=JSON.parse(JSON.stringify(y));return T[o.format.disabled]=b.includes(T[m])||T[o.format.disabled],T})}C.list=_},j=t.computed(()=>c.state.isGettingDictTypes.includes(i.value)),h=t.computed(()=>c.state.isGettingAllDictTypes);t.watch([j,h],([_,D])=>{!_&&!D&&A()},{immediate:!0});const F=t.ref(null);return a({getRef:()=>F.value}),(_,D)=>{const m=t.resolveComponent("el-radio-button"),u=t.resolveComponent("el-radio-group");return t.openBlock(),t.createBlock(u,t.mergeProps({ref_key:"ElRadioButtonDict",ref:F},_.$attrs,{onChange:p}),t.createSlots({default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(C.list,b=>(t.openBlock(),t.createBlock(m,{key:b[t.unref(o).format.value],disabled:b[t.unref(o).format.disabled],label:b[t.unref(o).format.value],name:e.name},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(b[t.unref(o).format.label]),1)]),_:2},1032,["disabled","label","name"]))),128))]),_:2},[t.renderList(_.$slots,(b,y,T)=>({name:y,fn:t.withCtx(S=>[t.renderSlot(_.$slots,y,t.normalizeProps(t.guardReactiveProps(S)))])}))]),1040)}}});nt.install=function(e){e.component(nt.name,nt)};const Mt=Object.freeze(Object.defineProperty({__proto__:null,default:nt},Symbol.toStringTag,{value:"Module"})),zt={name:"ElRadioDict"},at=t.defineComponent({...zt,props:{dictType:{type:[String,Object],required:!0},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{dictType:n,disableObj:s,border:l,size:d,name:r,keyValue:f,filterDataFun:i,disabledDataFun:o}=e,p=t.ref(""),C=t.toRaw(c.state.dictConfig),A=m=>{if(!f){g("dictChange",m);return}const u=j.list.find(b=>b[C.format.value]===m);g("dictChange",u)},j=t.reactive({list:[]}),h=async()=>{if(!n)return;let m=[];if(typeof n=="object"){p.value=n.type;const u=await c.actions.getDictDataObj(p.value);m=[].concat(u[p.value]);const{filters:b,filterType:y=C.format.value,reverse:T=!1}=n,S=typeof b=="string"?b.split(","):b;T?m=m.filter(I=>!S.includes(I[y])):m=m.filter(I=>S.includes(I[y]))}else{p.value=n;const u=await c.actions.getDictDataObj(p.value);m=[].concat(u[p.value])}if(i&&(m=i(m)),o&&(m=m.map(u=>({...u,[C.format.disabled]:!!u[C.format.disabled]||o(u)}))),s){const{disableValue:u,disableType:b=C.format.value,reverse:y=!1}=s,T=typeof u=="string"?u.split(","):u;y?m=m.map(S=>{const I=JSON.parse(JSON.stringify(S));return I[C.format.disabled]=!T.includes(I[b])||I[C.format.disabled],I}):m=m.map(S=>{const I=JSON.parse(JSON.stringify(S));return I[C.format.disabled]=T.includes(I[b])||I[C.format.disabled],I})}j.list=m},F=t.computed(()=>c.state.isGettingDictTypes.includes(p.value)),O=t.computed(()=>c.state.isGettingAllDictTypes);t.watch([F,O],([m,u])=>{!m&&!u&&h()},{immediate:!0});const _=t.ref(null);return a({getRef:()=>_.value}),(m,u)=>{const b=t.resolveComponent("el-radio"),y=t.resolveComponent("el-radio-group");return t.openBlock(),t.createBlock(y,t.mergeProps({ref_key:"ElRadioDict",ref:_},m.$attrs,{onChange:A}),t.createSlots({default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(j.list,T=>(t.openBlock(),t.createBlock(b,{key:T[t.unref(C).format.value],disabled:T[t.unref(C).format.disabled],label:T[t.unref(C).format.value],border:e.border,size:e.size,name:e.name},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(T[t.unref(C).format.label]),1)]),_:2},1032,["disabled","label","border","size","name"]))),128))]),_:2},[t.renderList(m.$slots,(T,S,I)=>({name:S,fn:t.withCtx(B=>[t.renderSlot(m.$slots,S,t.normalizeProps(t.guardReactiveProps(B)))])}))]),1040)}}});at.install=function(e){e.component(at.name,at)};const qt=Object.freeze(Object.defineProperty({__proto__:null,default:at},Symbol.toStringTag,{value:"Module"})),Kt={name:"ElSelectDict"},it=t.defineComponent({...Kt,props:{dictType:{type:[String,Object],required:!0},disableObj:{type:Object},keyValue:{type:Boolean,default:!1},filterDataFun:{type:Function},disabledDataFun:{type:Function}},emits:["dictChange"],setup(e,{expose:a,emit:g}){const{dictType:n,disableObj:s,keyValue:l,filterDataFun:d,disabledDataFun:r}=e,f=t.ref(""),i=t.toRaw(c.state.dictConfig),o=O=>{g("dictChange",O)},p=t.reactive({list:[]}),C=async()=>{if(!n)return;let O=[];if(typeof n=="object"){f.value=n.type;const _=await c.actions.getDictDataObj(f.value);O=[].concat(_[f.value]);const{filters:D,filterType:m=i.format.value,reverse:u=!1}=n,b=typeof D=="string"?D.split(","):D;u?O=O.filter(y=>!b.includes(y[m])):O=O.filter(y=>b.includes(y[m]))}else{f.value=n;const _=await c.actions.getDictDataObj(f.value);O=[].concat(_[f.value])}if(d&&(O=d(O)),r&&(O=O.map(_=>({..._,[i.format.disabled]:!!_[i.format.disabled]||r(_)}))),s){const{disableValue:_,disableType:D=i.format.value,reverse:m=!1}=s,u=typeof _=="string"?_.split(","):_;m?O=O.map(b=>{const y=JSON.parse(JSON.stringify(b));return y[i.format.disabled]=!u.includes(y[D])||y[i.format.disabled],y}):O=O.map(b=>{const y=JSON.parse(JSON.stringify(b));return y[i.format.disabled]=u.includes(y[D])||y[i.format.disabled],y})}p.list=O},A=t.computed(()=>c.state.isGettingDictTypes.includes(f.value)),j=t.computed(()=>c.state.isGettingAllDictTypes);t.watch([A,j],([O,_])=>{!O&&!_&&C()},{immediate:!0});const h=t.ref(null);return a({getRef:()=>h.value}),(O,_)=>{const D=t.resolveComponent("el-option"),m=t.resolveComponent("el-select");return t.openBlock(),t.createBlock(m,t.mergeProps({ref_key:"ElSelectDict",ref:h},O.$attrs,{"value-key":e.keyValue?t.unref(i).format.label:"",onChange:o}),t.createSlots({default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(p.list,u=>(t.openBlock(),t.createBlock(D,{key:u[t.unref(i).format.value],disabled:u[t.unref(i).format.disabled],label:u[t.unref(i).format.label],value:e.keyValue?u:u[t.unref(i).format.value]},null,8,["disabled","label","value"]))),128))]),_:2},[t.renderList(O.$slots,(u,b,y)=>({name:b,fn:t.withCtx(T=>[t.renderSlot(O.$slots,b,t.normalizeProps(t.guardReactiveProps(T)))])}))]),1040,["value-key"])}}});it.install=function(e){e.component(it.name,it)};const Yt=Object.freeze(Object.defineProperty({__proto__:null,default:it},Symbol.toStringTag,{value:"Module"})),Ut=(e,a,g)=>{const{format:n}=c.state.dictConfig,s=c.state.dictCodes;let l=[];if(!s||!s[a])c.actions.getDictDataObj(a).then(d=>{if(l=d[a],!l)return;const r=l.find(f=>f[n.value]===e);return r?r[n.label]:g??""});else{l=s[a];const d=l.find(r=>r[n.value]===e);return d?d[n.label]:g??""}},ut=(e,a,g)=>{const n={defaultVal:"",formatFun:(f,i)=>f.map(o=>o[i.label]).join(","),spacer:","};Object.assign(n,g);let s=[];Array.isArray(e)?s=e:typeof e=="string"&&(s=e.split(n.spacer));const{format:l}=c.state.dictConfig,d=c.state.dictCodes;let r=[];if(!d||!d[a])c.actions.getDictDataObj(a).then(f=>{if(r=f[a],!r)return;const i=K(s,r,l,n.defaultVal);return i&&i.length>0?n.formatFun(i,l):n.defaultVal});else{r=d[a];const f=K(s,r,l,n.defaultVal);return f&&f.length>0?n.formatFun(f,l):n.defaultVal}},Ht=(e,a,g)=>{const{format:n}=c.state.dictConfig,s=c.state.dictCodes;let l=[];if(!s||!s[a])c.actions.getDictDataObj(a).then(d=>{if(l=d[a],!l)return;const r=l.find(f=>f[n.label]===e);return r?r[n.value]:g??""});else{l=s[a];const d=l.find(r=>r[n.label]===e);return d?d[n.value]:g??""}},Qt=(e,a,g)=>{const n={defaultVal:"",formatFun:(f,i)=>f.map(o=>o[i.value]).join(","),spacer:","};Object.assign(n,g);let s=[];Array.isArray(e)?s=e:typeof e=="string"&&(s=e.split(n.spacer));const{format:l}=c.state.dictConfig,d=c.state.dictCodes;let r=[];if(!d||!d[a])c.actions.getDictDataObj(a).then(f=>{if(r=f[a],!r)return;const i=Y(s,r,l,n.defaultVal);return i&&i.length>0?n.formatFun(i,l):n.defaultVal});else{r=d[a];const f=Y(s,r,l,n.defaultVal);return f&&f.length>0?n.formatFun(f,l):n.defaultVal}},Wt=(e,a,g)=>{const n={defaultVal:"",formatFun:(s,l)=>s.map(d=>d[l.labelField]).join(","),treeSetting:{}};return Object.assign(n,g),new Promise((s,l)=>{const{treeSetting:d}=c.state.dictConfig,r=Object.assign(d,n.treeSetting),f=c.state.dictCodes;let i=[];if(!f||!f[a])if(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes){const o=setInterval(()=>{if(!(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes)){if(clearInterval(o),i=c.state.dictCodes[a],!i){l(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const p=i.find(C=>C[r.idField]===e);s(p?n.formatFun(x(p[r.idField],i,r),r):n.defaultVal)}},1e3)}else c.actions.getDictDataObj(a).then(o=>{if(i=o[a],!i){l(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const p=i.find(C=>C[r.idField]===e);s(p?n.formatFun(x(p[r.idField],i,r),r):n.defaultVal)});else{i=f[a];const o=i.find(p=>p[r.idField]===e);s(o?n.formatFun(x(o[r.idField],i,r),r):n.defaultVal)}})};function Q(e,a,g,n,s){const l=[];for(let d=0;d<e.length;d++){const r=a.find(f=>f[s.idField]===e[d]);r?l.push(n(x(r[s.idField],a,s),s)):l.push(g)}return l}const Xt=(e,a,g)=>{const n={defaultVal:"",formatFunIn:(s,l)=>s.map(d=>d[l.labelField]).join("/"),treeSetting:{},formatFunOut:s=>s.join(","),spacer:","};return Object.assign(n,g),new Promise((s,l)=>{let d=[];Array.isArray(e)?d=e:typeof e=="string"&&(d=e.split(n.spacer));const{treeSetting:r}=c.state.dictConfig,f=Object.assign(r,n.treeSetting),i=c.state.dictCodes;let o=[];if(!i||!i[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),o=c.state.dictCodes[a],!o){l(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const C=Q(d,o,n.defaultVal,n.formatFunIn,f);s(C&&C.length>0?n.formatFunOut(C):n.defaultVal)}},1e3)}else c.actions.getDictDataObj(a).then(p=>{if(o=p[a],!o){l(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const C=Q(d,o,n.defaultVal,n.formatFunIn,f);s(C&&C.length>0?n.formatFunOut(C):n.defaultVal)});else{o=i[a];const p=Q(d,o,n.defaultVal,n.formatFunIn,f);s(p&&p.length>0?n.formatFunOut(p):n.defaultVal)}})},Zt=(e,a,g)=>{const n={defaultVal:"",formatFun:(s,l)=>s.map(d=>d[l.idField]).join(","),treeSetting:{}};return Object.assign(n,g),new Promise((s,l)=>{const{treeSetting:d}=c.state.dictConfig,r=Object.assign(d,n.treeSetting),f=c.state.dictCodes;let i=[];if(!f||!f[a])if(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes){const o=setInterval(()=>{if(!(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes)){if(clearInterval(o),i=c.state.dictCodes[a],!i){l(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const p=i.find(C=>C[r.labelField]===e);s(p?n.formatFun(z(p[r.labelField],i,r),r):n.defaultVal)}},1e3)}else c.actions.getDictDataObj(a).then(o=>{if(i=o[a],!i){l(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const p=i.find(C=>C[r.labelField]===e);s(p?n.formatFun(z(p[r.labelField],i,r),r):n.defaultVal)});else{i=f[a];const o=i.find(p=>p[r.labelField]===e);s(o?n.formatFun(z(o[r.labelField],i,r),r):n.defaultVal)}})};function W(e,a,g,n,s){const l=[];for(let d=0;d<e.length;d++){const r=a.find(f=>f[s.labelField]===e[d]);r?l.push(n(z(r[s.labelField],a,s),s)):l.push(g)}return l}const vt=(e,a,g)=>{const n={defaultVal:"",formatFunIn:(s,l)=>s.map(d=>d[l.idField]).join("/"),treeSetting:{},formatFunOut:s=>s.join(","),spacer:","};return Object.assign(n,g),new Promise((s,l)=>{let d=[];Array.isArray(e)?d=e:typeof e=="string"&&(d=e.split(n.spacer));const{treeSetting:r}=c.state.dictConfig,f=Object.assign(r,n.treeSetting),i=c.state.dictCodes;let o=[];if(!i||!i[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),o=c.state.dictCodes[a],!o){l(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const C=W(d,o,n.defaultVal,n.formatFunIn,f);s(C&&C.length>0?n.formatFunOut(C):n.defaultVal)}},1e3)}else c.actions.getDictDataObj(a).then(p=>{if(o=p[a],!o){l(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const C=W(d,o,n.defaultVal,n.formatFunIn,f);s(C&&C.length>0?n.formatFunOut(C):n.defaultVal)});else{o=i[a];const p=W(d,o,n.defaultVal,n.formatFunIn,f);s(p&&p.length>0?n.formatFunOut(p):n.defaultVal)}})},te=(e,a,g)=>{const n={defaultVal:"",formatFun:(f,i)=>f.map(o=>o[i.labelField]).join(","),treeSetting:{}};Object.assign(n,g);const{treeSetting:s}=c.state.dictConfig,l=Object.assign(s,n.treeSetting),d=c.state.dictCodes;let r=[];if(!d||!d[a])c.actions.getDictDataObj(a).then(f=>{if(r=f[a],!r)return new Error(`不存在类型为:${a} 的字典字段,请确认后再填写`);const i=r.find(o=>o[l.idField]===e);return i?n.formatFun(x(i[l.idField],r,l),l):n.defaultVal});else{r=d[a];const f=r.find(i=>i[l.idField]===e);return f?n.formatFun(x(f[l.idField],r,l),l):n.defaultVal}},gt=(e,a,g)=>{const n={defaultVal:"",formatFunIn:(i,o)=>i.map(p=>p[o.labelField]).join("/"),treeSetting:{},formatFunOut:i=>i.join(","),spacer:","};Object.assign(n,g);let s=[];Array.isArray(e)?s=e:typeof e=="string"&&(s=e.split(n.spacer));const{treeSetting:l}=c.state.dictConfig,d=Object.assign(l,n.treeSetting),r=c.state.dictCodes;let f=[];if(!r||!r[a])c.actions.getDictDataObj(a).then(i=>{if(f=i[a],!f)return new Error(`不存在类型为:${a} 的字典字段,请确认后再填写`);const o=Q(s,f,n.defaultVal,n.formatFunIn,d);return o&&o.length>0?n.formatFunOut(o):n.defaultVal});else{f=r[a];const i=Q(s,f,n.defaultVal,n.formatFunIn,d);return i&&i.length>0?n.formatFunOut(i):n.defaultVal}},ee=(e,a,g)=>{const n={defaultVal:"",formatFun:(f,i)=>f.map(o=>o[i.idField]).join(","),treeSetting:{}};Object.assign(n,g);const{treeSetting:s}=c.state.dictConfig,l=Object.assign(s,n.treeSetting),d=c.state.dictCodes;let r=[];if(!d||!d[a])c.actions.getDictDataObj(a).then(f=>{if(r=f[a],!r)return new Error(`不存在类型为:${a} 的字典字段,请确认后再填写`);const i=r.find(o=>o[l.labelField]===e);return i?n.formatFun(z(i[l.labelField],r,l),l):n.defaultVal});else{r=d[a];const f=r.find(i=>i[l.labelField]===e);return f?n.formatFun(z(f[l.labelField],r,l),l):n.defaultVal}},ne=(e,a,g)=>{const n={defaultVal:"",formatFunIn:(i,o)=>i.map(p=>p[o.idField]).join("/"),treeSetting:{},formatFunOut:i=>i.join(","),spacer:","};Object.assign(n,g);let s=[];Array.isArray(e)?s=e:typeof e=="string"&&(s=e.split(n.spacer));const{treeSetting:l}=c.state.dictConfig,d=Object.assign(l,n.treeSetting),r=c.state.dictCodes;let f=[];if(!r||!r[a])c.actions.getDictDataObj(a).then(i=>{if(f=i[a],!f)return new Error(`不存在类型为:${a} 的字典字段,请确认后再填写`);const o=W(s,f,n.defaultVal,n.formatFunIn,d);return o&&o.length>0?n.formatFunOut(o):n.defaultVal});else{f=r[a];const i=W(s,f,n.defaultVal,n.formatFunIn,d);return i&&i.length>0?n.formatFunOut(i):n.defaultVal}},mt={date:"yyyy-MM-dd",month:"yyyy-MM",datetime:"yyyy-MM-dd hh:mm:ss",time:"hh:mm:ss",year:"yyyy"},pt=e=>{const a=e.replaceAll("-","/");var g=new Date(e),n=new Date(a);return!isNaN(g.getTime())||!isNaN(n.getTime())},bt=(e,a="datetime",g)=>{if(!e||!a)return g??"";Object.keys(mt).includes(a)&&(a=mt[a]),e instanceof Date||(typeof e=="number"||pt(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 l=new RegExp(`(${s})`);l.test(a)&&(a=a.replace(l,RegExp.$1.length===1?n[s]:("00"+n[s]).substr(String(n[s]).length)))}return a},q=(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 l="";for(let f=0;f<n.start&&f<s;f++)l+=e.charAt(f);let d="";for(let f=s-1;f>=0&&f>=s-n.end;f--)d=e.charAt(f)+d;const r=n.symbol.repeat(Math.max(n.middle||s-n.start-n.end,0));return l+r+d},yt=(e,a="*")=>{if(!e)return"";const g=e.length;if(g===1)return e;const n=e.charAt(0),s=e.charAt(g-1);return q(e.substring(1,g-1),{start:1,symbol:a})?`${n}*${s}`:`${n}${s}`},Dt=(e,a="*")=>e?q(e,{start:4,end:4,symbol:a}):"",Tt=(e,a="*")=>e?q(String(e),{start:3,end:4,symbol:a}):"",Ct=(e,a="*")=>{if(!e)return"";const g=e.trim().split(/\s+/),n=g.length;let s="";for(let l=0;l<n;l++)/^[\u4e00-\u9fa5]+$/.test(g[l])?s+=q(g[l],{start:1,symbol:a}):s+=q(g[l],{start:2,symbol:a}),l<n-1&&(s+=" ");return s},ae={mobile:Tt,name:yt,address:Ct,idCard:Dt},St=(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 ae[g.maskType](e,g.symbol);const n={start:g.start,end:g.end,middle:g.middle,symbol:g.symbol};return q(e,n)},ie={name:"ElTableColumnDict"},rt=t.defineComponent({...ie,props:{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{dictType:g,dictTreeType:n,dateFormat:s,defaultVal:l,treeSetting:d,formatFun:r,formatFunIn:f,formatFunOut:i,spacer:o,maskType:p,maskStart:C,maskEnd:A,maskMiddle:j,maskSymbol:h}=e,F=t.useAttrs(),O=t.computed(()=>{let b={};return l&&(b.defaultVal=l),r&&(b.formatFun=r),o&&(b.spacer=o),b}),_=t.computed(()=>{let b={};return l&&(b.defaultVal=l),f&&(b.formatFunIn=f),i&&(b.formatFunOut=i),d&&(b.treeSetting=d),o&&(b.spacer=o),b}),D=t.computed(()=>{const b={};return l&&(b.defaultVal=l),p&&(b.maskType=p),C&&(b.start=C),A&&(b.end=A),j&&(b.middle=j),h&&(b.symbol=h),b}),m=t.ref(null);return a({getRef:()=>m.value}),(b,y)=>{const T=t.resolveComponent("el-button-dict"),S=t.resolveComponent("el-link-dict"),I=t.resolveComponent("el-tag-dict"),B=t.resolveComponent("el-text-dict"),w=t.resolveComponent("el-table-column");return t.openBlock(),t.createBlock(w,t.mergeProps({ref_key:"ElTableColumnDict",ref:m},b.$attrs),t.createSlots({default:t.withCtx(k=>{var E,$,J,P,R,N,ft,Ot,ht;return[e.dictType?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[e.dictTypeNode==="button"?(t.openBlock(),t.createBlock(T,{key:0,value:k.row[(E=t.unref(F))==null?void 0:E.prop]||"",dictType:e.dictType},null,8,["value","dictType"])):e.dictTypeNode==="link"?(t.openBlock(),t.createBlock(S,{key:1,value:k.row[($=t.unref(F))==null?void 0:$.prop]||"",dictType:e.dictType},null,8,["value","dictType"])):e.dictTypeNode==="tag"?(t.openBlock(),t.createBlock(I,{key:2,value:k.row[(J=t.unref(F))==null?void 0:J.prop]||"",dictType:e.dictType},null,8,["value","dictType"])):e.dictTypeNode==="text"?(t.openBlock(),t.createBlock(B,{key:3,value:k.row[(P=t.unref(F))==null?void 0:P.prop]||"",dictType:e.dictType},null,8,["value","dictType"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:4},[t.createTextVNode(t.toDisplayString(t.unref(ut)(k.row[(R=t.unref(F))==null?void 0:R.prop],e.dictType,t.unref(O))),1)],64))],64)):e.dictTreeType?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(t.unref(gt)(k.row[(N=t.unref(F))==null?void 0:N.prop],e.dictTreeType,t.unref(_))),1)],64)):e.dateFormat?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createTextVNode(t.toDisplayString(t.unref(bt)(k.row[(ft=t.unref(F))==null?void 0:ft.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(St)(k.row[(Ot=t.unref(F))==null?void 0:Ot.prop],t.unref(D))),1)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:4},[t.createTextVNode(t.toDisplayString(k.row[(ht=t.unref(F))==null?void 0:ht.prop]||e.defaultVal),1)],64))]}),_:2},[t.renderList(b.$slots,(k,E,$)=>({name:E,fn:t.withCtx(J=>[t.renderSlot(b.$slots,E,t.normalizeProps(t.guardReactiveProps(J)))])}))]),1040)}}});rt.install=function(e){e.component(rt.name,rt)};const re=Object.freeze(Object.defineProperty({__proto__:null,default:rt},Symbol.toStringTag,{value:"Module"})),le={name:"ElTabsDict"},lt=t.defineComponent({...le,props:{badgeObj:{type:Object,default:()=>({})},dictType:{type:[String,Object],required:!0},disableObj:{type:Object},keyValue:{type:Boolean,default:!1},filterDataFun:{type:Function},disabledDataFun:{type:Function}},emits:["dictChange"],setup(e,{expose:a,emit:g}){const{badgeObj:n,dictType:s,disableObj:l,keyValue:d,filterDataFun:r,disabledDataFun:f}=e,i=t.useAttrs(),o=t.ref(""),p=t.toRaw(c.state.dictConfig),C=D=>{window.setTimeout(()=>{if(!d){g("dictChange",i.modelValue);return}const m=A.list.find(u=>u[p.format.value]===i.modelValue);g("dictChange",m)},0)},A=t.reactive({list:[]}),j=async()=>{if(!s)return;let D=[];if(typeof s=="object"){o.value=s.type;const m=await c.actions.getDictDataObj(o.value);D=[].concat(m[o.value]);const{filters:u,filterType:b=p.format.value,reverse:y=!1}=s,T=typeof u=="string"?u.split(","):u;y?D=D.filter(S=>!T.includes(S[b])):D=D.filter(S=>T.includes(S[b]))}else{o.value=s;const m=await c.actions.getDictDataObj(o.value);D=[].concat(m[o.value])}if(r&&(D=r(D)),f&&(D=D.map(m=>({...m,[p.format.disabled]:!!m[p.format.disabled]||f(m)}))),l){const{disableValue:m,disableType:u=p.format.value,reverse:b=!1}=l,y=typeof m=="string"?m.split(","):m;b?D=D.map(T=>{const S=JSON.parse(JSON.stringify(T));return S[p.format.disabled]=!y.includes(S[u])||S[p.format.disabled],S}):D=D.map(T=>{const S=JSON.parse(JSON.stringify(T));return S[p.format.disabled]=y.includes(S[u])||S[p.format.disabled],S})}A.list=D},h=t.computed(()=>c.state.isGettingDictTypes.includes(o.value)),F=t.computed(()=>c.state.isGettingAllDictTypes);t.watch([h,F],([D,m])=>{!D&&!m&&j()},{immediate:!0});const O=t.ref(null);return a({getRef:()=>O.value}),(D,m)=>{const u=t.resolveComponent("el-badge"),b=t.resolveComponent("el-tab-pane"),y=t.resolveComponent("el-tabs");return t.openBlock(),t.createBlock(y,t.mergeProps({ref_key:"ElTabsDict",ref:O,class:"vue-element-dict-tabs"},D.$attrs,{onTabClick:C}),{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(A.list,T=>(t.openBlock(),t.createBlock(b,{disabled:T[t.unref(p).format.disabled],label:T[t.unref(p).format.label],key:T[t.unref(p).format.value],name:T[t.unref(p).format.value]},t.createSlots({default:t.withCtx(()=>[t.renderSlot(D.$slots,T[t.unref(p).format.value])]),_:2},[t.renderList(D.$slots,(S,I,B)=>({name:I,fn:t.withCtx(w=>[t.renderSlot(D.$slots,I,t.normalizeProps(t.guardReactiveProps(w)))])})),e.badgeObj[T[t.unref(p).format.value]]?{name:"label",fn:t.withCtx(()=>[t.createVNode(u,{type:e.badgeObj[T[t.unref(p).format.value]].type,"is-dot":e.badgeObj[T[t.unref(p).format.value]].isDot,value:e.badgeObj[T[t.unref(p).format.value]].value,max:e.badgeObj[T[t.unref(p).format.value]].max,hidden:e.badgeObj[T[t.unref(p).format.value]].hidden,class:"item"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(T[t.unref(p).format.label]),1)]),_:2},1032,["type","is-dot","value","max","hidden"])]),key:"0"}:void 0]),1032,["disabled","label","name"]))),128))]),_:3},16)}}});lt.install=function(e){e.component(lt.name,lt)};const se=Object.freeze(Object.defineProperty({__proto__:null,default:lt},Symbol.toStringTag,{value:"Module"})),oe={name:"ElTagDict"},st=t.defineComponent({...oe,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:l,type:d,judgeColorFun:r,color:f}=t.toRefs(g),i=t.toRaw(c.state.dictConfig),o=t.computed(()=>l!=null&&l.value?l==null?void 0:l.value(n.value):d.value?d.value:C.value&&C.value[i.format.type]?C.value[i.format.type]:"success"),p=t.computed(()=>r!=null&&r.value?r==null?void 0:r.value(n):f.value?f.value:C.value&&C.value[i.format.color]?C.value[i.format.color]:"");let C=t.ref(null),A=t.ref(null);t.watchEffect(()=>{U(n.value,s.value).then(F=>{C.value=F,A.value=F[i.format.label]})});const j=t.ref(null);return a({getRef:()=>j.value}),(F,O)=>{const _=t.resolveComponent("el-tag");return t.openBlock(),t.createBlock(_,t.mergeProps({ref_key:"ElTagDict",ref:j,type:t.unref(o),color:t.unref(p)},F.$attrs),t.createSlots({default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(t.unref(A)),1)]),_:2},[t.renderList(F.$slots,(D,m,u)=>({name:m,fn:t.withCtx(b=>[t.renderSlot(F.$slots,m,t.normalizeProps(t.guardReactiveProps(b)))])}))]),1040,["type","color"])}}});st.install=function(e){e.component(st.name,st)};const ce=Object.freeze(Object.defineProperty({__proto__:null,default:st},Symbol.toStringTag,{value:"Module"})),de={name:"ElTextDict"},ot=t.defineComponent({...de,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:l,type:d}=t.toRefs(g),r=t.toRaw(c.state.dictConfig),f=t.computed(()=>l!=null&&l.value?l==null?void 0:l.value(n.value):d!=null&&d.value?d.value:i.value&&i.value[r.format.type]?i.value[r.format.type]:"primary");let i=t.ref(null),o=t.ref(null);t.watchEffect(()=>{U(n.value,s.value).then(A=>{i.value=A,o.value=A[r.format.label]})});const p=t.ref(null);return a({getRef:()=>p.value}),(A,j)=>{const h=t.resolveComponent("el-text");return t.openBlock(),t.createBlock(h,t.mergeProps({ref:"ElTextDict",type:t.unref(f)},A.$attrs),t.createSlots({default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(t.unref(o)),1)]),_:2},[t.renderList(A.$slots,(F,O,_)=>({name:O,fn:t.withCtx(D=>[t.renderSlot(A.$slots,O,t.normalizeProps(t.guardReactiveProps(D)))])}))]),1040,["type"])}}});ot.install=function(e){e.component(ot.name,ot)};const fe=Object.freeze(Object.defineProperty({__proto__:null,default:ot},Symbol.toStringTag,{value:"Module"})),ue={name:"ElTreeDict"},ct=t.defineComponent({...ue,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:l,disabledDataFun:d}=e,r=t.useAttrs(),f=t.ref(""),i=t.toRaw(c.state.dictConfig),o=t.reactive({list:[]}),p=(D,m)=>{for(let u=0;u<D.length;u++){const b=D[u];if(b[i.treeSetting.levelField]===m){delete b[h.value.children],b[h.value.isLeaf]=!0;continue}else p(b[h.value.children],m)}},C=async()=>{if(!n)return;let D=[];if(typeof n=="object"){f.value=n.type;const m=await c.actions.getDictDataObj(f.value);D=[].concat(m[f.value]);const{filters:u,filterType:b=i.format.value,reverse:y=!1}=n,T=typeof u=="string"?u.split(","):u;y?D=D.filter(S=>!T.includes(S[b])):D=D.filter(S=>T.includes(S[b]))}else{f.value=n;const m=await c.actions.getDictDataObj(f.value);D=[].concat(m[f.value])}if(l&&(D=l(D)),d&&(D=D.map(m=>({...m,[i.format.disabled]:!!m[i.format.disabled]||d(m)}))),s){const{disableValue:m,disableType:u=i.format.value,reverse:b=!1}=s,y=typeof m=="string"?m.split(","):m;b?D=D.map(T=>{const S=JSON.parse(JSON.stringify(T));return S[i.format.disabled]=!y.includes(S[u])||S[i.format.disabled],S}):D=D.map(T=>{const S=JSON.parse(JSON.stringify(T));return S[i.format.disabled]=y.includes(S[u])||S[i.format.disabled],S})}o.list=D},A=t.computed(()=>c.state.isGettingDictTypes.includes(f.value)),j=t.computed(()=>c.state.isGettingAllDictTypes),h=t.computed(()=>{const D=r.props??{};return D.disabled=D.disabled??c.state.dictConfig.format.disabled,D.label=D.label??c.state.dictConfig.treeSetting.labelField,D.children=D.children??c.state.dictConfig.treeSetting.childrenField,D.isLeaf=D.leaf??c.state.dictConfig.treeSetting.leafField,D}),F=t.computed(()=>{const D=r.props??{},m={labelField:D.label??i.treeSetting.labelField,childrenField:D.children??i.treeSetting.childrenField,leafField:D.leaf??i.treeSetting.leafField},u=Object.assign(c.state.dictConfig.treeSetting,m),b=JSON.parse(JSON.stringify(o.list)),y=H(b,u);return g&&p(y,+g),y});t.watch([A,j],([D,m])=>{!D&&!m&&C()},{immediate:!0});const O=t.ref(null);return a({getRef:()=>O.value}),(D,m)=>{const u=t.resolveComponent("el-tree");return t.openBlock(),t.createBlock(u,{ref_key:"ElTreeDict",ref:O,data:t.unref(F),props:t.unref(h)},t.createSlots({_:2},[t.renderList(D.$slots,(b,y,T)=>({name:y,fn:t.withCtx(S=>[t.renderSlot(D.$slots,y,t.normalizeProps(t.guardReactiveProps(S)))])}))]),1032,["data","props"])}}});ct.install=function(e){e.component(ct.name,ct)};const ge=Object.freeze(Object.defineProperty({__proto__:null,default:ct},Symbol.toStringTag,{value:"Module"})),me={name:"ElTreeSelectDict"},dt=t.defineComponent({...me,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:l,filterDataFun:d,disabledDataFun:r}=e,f=t.useAttrs(),i=t.ref(""),o=t.toRaw(c.state.dictConfig),p=t.reactive({list:[]}),C=(m,u)=>{for(let b=0;b<m.length;b++){const y=m[b];if(y[o.treeSetting.levelField]===u){delete y[F.value.children],y[F.value.isLeaf]=!0;continue}else C(y[F.value.children],u)}},A=async()=>{if(!s)return;let m=[];if(typeof s=="object"){i.value=s.type;const u=await c.actions.getDictDataObj(i.value);m=[].concat(u[i.value]);const{filters:b,filterType:y=o.format.value,reverse:T=!1}=s,S=typeof b=="string"?b.split(","):b;T?m=m.filter(I=>!S.includes(I[y])):m=m.filter(I=>S.includes(I[y]))}else{i.value=s;const u=await c.actions.getDictDataObj(i.value);m=[].concat(u[i.value])}if(d&&(m=d(m)),r&&(m=m.map(u=>({...u,[o.format.disabled]:!!u[o.format.disabled]||r(u)}))),l){const{disableValue:u,disableType:b=o.format.value,reverse:y=!1}=l,T=typeof u=="string"?u.split(","):u;y?m=m.map(S=>{const I=JSON.parse(JSON.stringify(S));return I[o.format.disabled]=!T.includes(I[b])||I[o.format.disabled],I}):m=m.map(S=>{const I=JSON.parse(JSON.stringify(S));return I[o.format.disabled]=T.includes(I[b])||I[o.format.disabled],I})}p.list=m},j=t.computed(()=>c.state.isGettingDictTypes.includes(i.value)),h=t.computed(()=>c.state.isGettingAllDictTypes),F=t.computed(()=>{const m=f.props??{};return m.disabled=m.disabled??c.state.dictConfig.format.disabled,m.label=m.label??c.state.dictConfig.treeSetting.labelField,m.children=m.children??c.state.dictConfig.treeSetting.childrenField,m.isLeaf=m.leaf??c.state.dictConfig.treeSetting.leafField,m}),O=t.computed(()=>{const m=f.props??{},u={labelField:m.label??o.treeSetting.labelField,childrenField:m.children??o.treeSetting.childrenField,leafField:m.leaf??o.treeSetting.leafField},b=Object.assign(c.state.dictConfig.treeSetting,u),y=JSON.parse(JSON.stringify(p.list)),T=H(y,b);return g&&C(T,+g),T});t.watch([j,h],([m,u])=>{!m&&!u&&A()},{immediate:!0});const _=t.ref(null);return a({getRef:()=>_.value}),(m,u)=>{const b=t.resolveComponent("el-tree-select");return t.openBlock(),t.createBlock(b,{ref_key:"ElTreeSelectDict",ref:_,data:t.unref(O),"node-key":e.nodeKey,props:t.unref(F)},t.createSlots({_:2},[t.renderList(m.$slots,(y,T,S)=>({name:T,fn:t.withCtx(I=>[t.renderSlot(m.$slots,T,t.normalizeProps(t.guardReactiveProps(I)))])}))]),1032,["data","node-key","props"])}}});dt.install=function(e){e.component(dt.name,dt)};const _t=Object.assign({"./el-button-dict/index.ts":Et,"./el-cascader-dict/index.ts":Nt,"./el-checkbox-button-dict/index.ts":wt,"./el-checkbox-dict/index.ts":Pt,"./el-link-dict/index.ts":Jt,"./el-radio-button-dict/index.ts":Mt,"./el-radio-dict/index.ts":qt,"./el-select-dict/index.ts":Yt,"./el-table-column-dict/index.ts":re,"./el-tabs-dict/index.ts":se,"./el-tag-dict/index.ts":ce,"./el-text-dict/index.ts":fe,"./el-tree-dict/index.ts":ge,"./el-tree-select-dict/index.ts":Object.freeze(Object.defineProperty({__proto__:null,default:dt},Symbol.toStringTag,{value:"Module"}))});let Ft=[];Object.keys(_t).forEach(e=>{Ft.push(_t[e].default)});const pe=()=>c.state.dictConfig,be=e=>c.state.dictConfig[e],ye=()=>c.state.dictCodes,De=e=>c.state.dictCodes[e],Te=pe,Ce=be,Se=ye,_e=De,Fe=It,Oe=kt,he=jt,Ie=At,ke=Gt,je=U,Ae=Ut,Ge=ut,Be=Ht,Ee=Qt,Le=q,Ne=Ct,Ve=Dt,we=yt,$e=Tt,Pe=St,Re=bt,Je=pt,xe=H,Me=x,ze=z,qe=Wt,Ke=Zt,Ye=Xt,Ue=vt,He=te,Qe=ee,We=gt,Xe=ne;async function Ze(e){var l;const a=e.storage.getItem(e.dictDataKey)||"{}",g=JSON.parse(a),n=e.usuallyGetDictTypes?e.usuallyGetDictTypes.split(","):[];let s=[];if(e.usuallyGetDictTypesByApi)s=n;else if(n.length>0)for(let d=0;d<n.length;d++)g[n[d]]||s.push(n[d]);if(a==="{}"||e.isGetAll||s.length>0){let d,r="";e.isGetAll?(c.mutations.SETTING_ISGETTING_ALL_DICT_TYPES(!0),d=await e.getDictCodeApi(e.formatterRequest(e.query,r)),c.mutations.SETTING_ISGETTING_ALL_DICT_TYPES(!1)):s.length>0&&(r=s.join(","),c.mutations.ADD_IS_EGTTING_DICT_TYPES(r),d=await e.getDictCodeApi(e.formatterRequest(e.query,r)),c.mutations.REMOVE_IS_EGTTING_DICT_TYPES(r));const f=e.formatterDictList(d,r),i=e.formatterDictVersion(d);e.storage.setItem(e.versionKey,i);const o=Object.assign(c.state.dictCodes,f),p=M(o,e.filterDataFun,e.disabledDataFun,(l=e==null?void 0:e.format)==null?void 0:l.disabled);c.mutations.SET_DICT_CODES(p),e.storage.setItem(e.dictDataKey,JSON.stringify(p))}}let ve={async install(e,a){var f,i;const g={filterDataFun:o=>o,disabledDataFun:o=>!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:(o,p)=>p?{[o]:p}:{[o]:""},formatterDictList:(o,p)=>!o||!o.dictData?{}:o.dictData,formatterDictVersion:o=>!o||!o.version?"unknow":o.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 l=JSON.parse(JSON.stringify(n.localDictCodes));l=Object.assign(s,l);const d=M(l,n.filterDataFun,n.disabledDataFun,(f=n==null?void 0:n.format)==null?void 0:f.disabled);n.storage.setItem(n.dictDataKey,JSON.stringify(d)),c.mutations.SET_DICT_CODES(d);const r=n.storage.getItem(n.versionKey);if(n.version!==r){n.storage.removeItem(n.dictDataKey),n.storage.setItem(n.versionKey,n.version);const o=JSON.parse(JSON.stringify(n.localDictCodes)),p=M(o,n.filterDataFun,n.disabledDataFun,(i=n==null?void 0:n.format)==null?void 0:i.disabled);n.storage.setItem(n.dictDataKey,JSON.stringify(p)),c.mutations.SET_DICT_CODES(p)}(n.isGetAll||n.usuallyGetDictTypes)&&Ze(n),Ft.forEach(o=>{e.component(o.name,o)})}};G.default=ve,G.desensitization=Pe,G.formatDate=Re,G.getCodeByLabel=he,G.getCodeByLabelFilter=Be,G.getCodeByLabels=Ie,G.getCodeByLabelsFilter=Ee,G.getDictConfig=Te,G.getDictConfigByKey=Ce,G.getDictData=Se,G.getDictDataByKey=_e,G.getDictObjByDictTypes=ke,G.getItemByCode=je,G.getLabelByCode=Fe,G.getLabelByCodeFilter=Ae,G.getLabelByCodes=Oe,G.getLabelByCodesFilter=Ge,G.getTreeCodeByLabel=Ke,G.getTreeCodeByLabelFilter=Qe,G.getTreeCodeByLabels=Ue,G.getTreeCodeByLabelsFilter=Xe,G.getTreeItemByCode=Me,G.getTreeItemByLabel=ze,G.getTreeLabelByCode=qe,G.getTreeLabelByCodeFilter=He,G.getTreeLabelByCodes=Ye,G.getTreeLabelByCodesFilter=We,G.isDate=Je,G.listToTree=xe,G.mask=Le,G.maskAddress=Ne,G.maskIdCard=Ve,G.maskName=we,G.maskPhone=$e,Object.defineProperties(G,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(G,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(G=typeof globalThis<"u"?globalThis:G||self,t(G["vue3-element-dict"]={},G.Vue))})(this,function(G,t){"use strict";const M=(e,a,g,n)=>{const s={};for(let l in e)s[l]=a(e[l]).map(d=>({...d,[n]:g(d)||!!d[n]}));return s},L=t.reactive({dictConfig:{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:[]}),V={SET_DICT_SETTING(e){L.dictConfig=e},SET_DICT_CODES(e){L.dictCodes=e},ADD_IS_EGTTING_DICT_TYPES(e){const g=[...e.split(","),...L.isGettingDictTypes],n=new Set(g);L.isGettingDictTypes=Array.from(n)},REMOVE_IS_EGTTING_DICT_TYPES(e){const a=e.split(","),g=[...new Set(L.isGettingDictTypes)].filter(n=>!new Set(a).has(n));L.isGettingDictTypes=Array.from(g)},SETTING_ISGETTING_ALL_DICT_TYPES(e){L.isGettingAllDictTypes=e},ADD_UNFIND_DICT_TYPES(e){const g=[...e.split(","),...L.unfindDictTypes],n=new Set(g);L.unfindDictTypes=Array.from(n)},REMOVE_UNFIND_DICT_TYPES(e){const a=e.split(","),g=[...new Set(L.unfindDictTypes)].filter(n=>!new Set(a).has(n));L.unfindDictTypes=Array.from(g)}},c={state:L,mutations:V,actions:{getDictDataObj(e){return new Promise((a,g)=>{if(!e)return;const{storage:n,dictDataKey:s,getDictCodeApi:l,usuallyGetDictTypes:d,formatterRequest:r,query:f,versionKey:i,localDictCodes:o,formatterDictList:p,formatterDictVersion:C,isGetAll:A,filterDataFun:j,disabledDataFun:h,format:F}=L.dictConfig,O=L.dictCodes||o;if(!O[e]||O[e].length===0){if(L.isGettingDictTypes.includes(e)||L.isGettingAllDictTypes)return;if(V.ADD_IS_EGTTING_DICT_TYPES(e),L.unfindDictTypes.includes(e)){g(`不存在类型为:${e} 的字典字段,请确认后再填写`);return}V.ADD_UNFIND_DICT_TYPES(e),l(r(f,e)).then(S=>{V.REMOVE_IS_EGTTING_DICT_TYPES(e);const D=C(S),m=n.getItem(i);if(D!==m){let u="";if(A)u="",V.SETTING_ISGETTING_ALL_DICT_TYPES(!0);else{if(d){const b=Object.keys(O),y=d.split(","),T=b.concat(y);T.push(e),u=Array.from(new Set(T)).join(",")}else{const b=Object.keys(O);b.push(e),u=Array.from(new Set(b)).join(",")}V.ADD_IS_EGTTING_DICT_TYPES(u)}l(r(f,u)).then(b=>{const y=p(b,e);if(!(y[e]&&y[e].length>0)){g(`不存在类型为:${e} 的字典字段,请确认后再填写`);return}V.REMOVE_UNFIND_DICT_TYPES(e);const T=C(b),_=Object.assign(JSON.parse(JSON.stringify(o)),y),I=M(_,j,h,F==null?void 0:F.disabled);n.setItem(s,JSON.stringify(I)),n.setItem(i,T),V.SET_DICT_CODES(I),a(L.dictCodes),L.isGettingAllDictTypes?V.SETTING_ISGETTING_ALL_DICT_TYPES(!1):V.REMOVE_IS_EGTTING_DICT_TYPES(u)})}else{const u=p(S,e);if(!(u[e]&&u[e].length>0)){g(`不存在类型为:${e} 的字典字段,请确认后再填写`);return}V.REMOVE_UNFIND_DICT_TYPES(e);const b=L.dictCodes||o,y=M(u,j,h,F==null?void 0:F.disabled);Object.assign(b,y),n.setItem(s,JSON.stringify(b)),V.SET_DICT_CODES(b),a(L.dictCodes)}})}else V.REMOVE_UNFIND_DICT_TYPES(e),V.SET_DICT_CODES(O),a(L.dictCodes)})}}},It=(e,a,g)=>new Promise((n,s)=>{const{format:l}=c.state.dictConfig,d=c.state.dictCodes;let r=[];if(!d||!d[a])if(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes){const f=setInterval(()=>{if(!(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes)){if(clearInterval(f),r=c.state.dictCodes[a],!r){s(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const i=r.find(o=>o[l.value]===e);n(i?i[l.label]:g??"")}},1e3)}else c.actions.getDictDataObj(a).then(f=>{if(r=f[a],!r){s(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const i=r.find(o=>o[l.value]===e);n(i?i[l.label]:g??"")});else{r=d[a];const f=r.find(i=>i[l.value]===e);n(f?f[l.label]:g??"")}});function K(e,a,g,n){const s=[];for(let l=0;l<e.length;l++){const d=a.find(r=>r[g.value]===e[l]);d?s.push(d):s.push({[g.label]:n,[g.value]:e[l]})}return s}const kt=(e,a,g)=>{const n={defaultVal:"",formatFun:(s,l)=>s.map(d=>d[l.label]).join(","),spacer:","};return Object.assign(n,g),new Promise((s,l)=>{let d=[];Array.isArray(e)?d=e:typeof e=="string"&&(d=e.split(n.spacer));const{format:r}=c.state.dictConfig,f=c.state.dictCodes;let i=[];if(!f||!f[a])if(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes){const o=setInterval(()=>{if(!(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes)){if(clearInterval(o),i=c.state.dictCodes[a],!i){l(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const p=K(d,i,r,n.defaultVal);s(p&&p.length>0?n.formatFun(p,r):n.defaultVal)}},1e3)}else c.actions.getDictDataObj(a).then(o=>{if(i=o[a],!i){l(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const p=K(d,i,r,n.defaultVal);s(p&&p.length>0?n.formatFun(p,r):n.defaultVal)});else{i=f[a];const o=K(d,i,r,n.defaultVal);s(o&&o.length>0?n.formatFun(o,r):n.defaultVal)}})},jt=(e,a,g)=>new Promise((n,s)=>{const{format:l}=c.state.dictConfig,d=c.state.dictCodes;let r=[];if(!d||!d[a])if(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes){const f=setInterval(()=>{if(!(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes)){if(clearInterval(f),r=c.state.dictCodes[a],!r){s(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const i=r.find(o=>o[l.label]===e);n(i?i[l.value]:g??"")}},1e3)}else c.actions.getDictDataObj(a).then(f=>{if(r=f[a],!r){s(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const i=r.find(o=>o[l.label]===e);n(i?i[l.value]:g??"")});else{r=d[a];const f=r.find(i=>i[l.label]===e);n(f?f[l.value]:g??"")}});function Y(e,a,g,n){const s=[];for(let l=0;l<e.length;l++){const d=a.find(r=>r[g.label]===e[l]);d?s.push(d):s.push({[g.label]:e[l],[g.value]:n})}return s}const At=(e,a,g)=>{const n={defaultVal:"",formatFun:(s,l)=>s.map(d=>d[l.value]).join(","),spacer:","};return Object.assign(n,g),new Promise((s,l)=>{let d=[];Array.isArray(e)?d=e:typeof e=="string"&&(d=e.split(n.spacer));const{format:r}=c.state.dictConfig,f=c.state.dictCodes;let i=[];if(!f||!f[a])if(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes){const o=setInterval(()=>{if(!(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes)){if(clearInterval(o),i=c.state.dictCodes[a],!i){l(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const p=Y(d,i,r,n.defaultVal);s(p&&p.length>0?n.formatFun(p,r):n.defaultVal)}},1e3)}else c.actions.getDictDataObj(a).then(o=>{if(i=o[a],!i){l(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const p=Y(d,i,r,n.defaultVal);s(p&&p.length>0?n.formatFun(p,r):n.defaultVal)});else{i=f[a];const o=Y(d,i,r,n.defaultVal);s(o&&o.length>0?n.formatFun(o,r):n.defaultVal)}})},Gt=e=>new Promise((a,g)=>{let n=[],s="";Array.isArray(e)?(s=e.join(","),n=e):typeof e=="string"&&(n=e.split(","));const l=c.state.dictCodes,d=c.state.dictConfig;if(!l)c.mutations.ADD_IS_EGTTING_DICT_TYPES(s),d.getDictCodeApi(d.formatterRequest(d.query,s)).then(r=>{c.mutations.REMOVE_IS_EGTTING_DICT_TYPES(s);const f=d.formatterDictList(r,e),i=M(f,d.filterDataFun,d.disabledDataFun),o=JSON.parse(JSON.stringify(i)),p=Object.assign(c.state.dictCodes,o);d.storage.setItem(d.dictDataKey,JSON.stringify(p)),c.mutations.SET_DICT_CODES(p),a(i)});else{const r=[],f={};for(let i=0;i<n.length;i++){if(l[n[i]]){f[n[i]]=l[n[i]];continue}r.push(n[i])}r.length>0?(c.mutations.ADD_IS_EGTTING_DICT_TYPES(r.join(",")),d.getDictCodeApi(d.formatterRequest(d.query,r.join(","))).then(i=>{c.mutations.REMOVE_IS_EGTTING_DICT_TYPES(r.join(","));const o=d.formatterDictList(i,e),p=M(o,d.filterDataFun,d.disabledDataFun),C=JSON.parse(JSON.stringify(p)),A=Object.assign(c.state.dictCodes,C);d.storage.setItem(d.dictDataKey,JSON.stringify(A)),c.mutations.SET_DICT_CODES(A);const j=Object.assign(f,o),h=[];for(const F in j)(!j[F]||j[F].length===0)&&h.push(F);h.length>0&&g(`不存在类型为:${h.join("、")} 的字典字段,请确认后再填写`),a(p)})):a(f)}}),U=(e,a,g)=>new Promise((n,s)=>{const{format:l}=c.state.dictConfig,d=c.state.dictCodes;let r=[];if(!d||!d[a])if(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes){const f=setInterval(()=>{if(!(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes)){if(clearInterval(f),r=c.state.dictCodes[a],!r){s(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const i=r.find(o=>o[l.value]===e);n(i||(g??""))}},1e3)}else c.actions.getDictDataObj(a).then(f=>{if(r=f[a],!r){s(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const i=r.find(o=>o[l.value]===e);n(i||(g??""))});else{r=d[a];const f=r.find(i=>i[l.value]===e);n(f||(g??""))}}),Bt={name:"ElButtonDict"},X=t.defineComponent({...Bt,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:l,type:d,judgeColorFun:r,color:f,judgeDisabledFun:i,disabled:o}=t.toRefs(g),p=t.toRaw(c.state.dictConfig),C=t.computed(()=>l!=null&&l.value?l.value(n.value):d.value?d.value:h.value&&h.value[p.format.type]?h.value[p.format.type]:"primary"),A=t.computed(()=>r!=null&&r.value?r.value(n.value):f!=null&&f.value?f.value:h.value&&h.value[p.format.color]?h.value[p.format.color]:""),j=t.computed(()=>h.value&&h.value[p.format.disabled]?h.value[p.format.disabled]:i!=null&&i.value?i.value(n.value):!!o.value);let h=t.ref(null),F=t.ref(null);t.watchEffect(()=>{U(n.value,s.value).then(D=>{h.value=D,F.value=D[p.format.label]})});const O=t.ref(null);return a({getRef:()=>O.value}),(D,m)=>{const u=t.resolveComponent("el-button");return t.openBlock(),t.createBlock(u,t.mergeProps({ref_key:"ElButtonDict",ref:O,type:t.unref(C),color:t.unref(A),disabled:t.unref(j)},D.$attrs),t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(F)),1)]),_:2},[t.renderList(D.$slots,(b,y,T)=>({name:y,fn:t.withCtx(_=>[t.renderSlot(D.$slots,y,t.normalizeProps(t.guardReactiveProps(_)))])}))]),1040,["type","color","disabled"])}}});X.install=function(e){e.component(X.name,X)};const Et=Object.freeze(Object.defineProperty({__proto__:null,default:X},Symbol.toStringTag,{value:"Module"})),H=(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=[],l,d=0;d<e.length;d++)if(e[d][n.parentIdField]===g[n.idField]){var r=e[d];r[n.levelField]=g[n.levelField]+1,r[n.labelArrField]=g[n.labelArrField].concat(r[n.labelField]),r[n.idArrField]=g[n.idArrField].concat(r[n.idField]),l=H(e,a,r),l.length>0?(r[n.childrenField]=l,r[n.leafField]=!1):r[n.leafField]=!0,s.push(r)}return s},x=(e,a,g)=>{const n={idField:"id",parentIdField:"parentId"};Object.assign(n,g);const s=a.find(l=>l[n.idField]===e);return s?x(s[n.parentIdField],a,n).concat([s]):[]},z=(e,a,g)=>{const n={idField:"id",labelField:"label",parentIdField:"parentId"};Object.assign(n,g);const s=a.find(l=>l[n.labelField]===e);return x(s[n.idField],a,n)},Lt={name:"ElCascaderDict"},Z=t.defineComponent({...Lt,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:l,filterDataFun:d,disabledDataFun:r}=e,f=t.useAttrs(),i=t.ref(""),o=t.toRaw(c.state.dictConfig),p=u=>{g("dictChange",u)},C=t.reactive({list:[]}),A=(u,b)=>{for(let y=0;y<u.length;y++){const T=u[y];if(T[o.treeSetting.levelField]===b){delete T[O.value.children],T[O.value.leaf]=!0;continue}else A(T[O.value.children],b)}},j=async()=>{if(!s)return;let u=[];if(typeof s=="object"){i.value=s.type;const b=await c.actions.getDictDataObj(i.value);u=[].concat(b[i.value]);const{filters:y,filterType:T=o.format.value,reverse:_=!1}=s,I=typeof y=="string"?y.split(","):y;_?u=u.filter(B=>!I.includes(B[T])):u=u.filter(B=>I.includes(B[T]))}else{i.value=s;const b=await c.actions.getDictDataObj(i.value);u=[].concat(b[i.value])}if(d&&(u=d(u)),r&&(u=u.map(b=>({...b,[o.format.disabled]:!!b[o.format.disabled]||r(b)}))),l){const{disableValue:b,disableType:y=o.format.value,reverse:T=!1}=l,_=typeof b=="string"?b.split(","):b;T?u=u.map(I=>{const B=JSON.parse(JSON.stringify(I));return B[o.format.disabled]=!_.includes(B[y])||B[o.format.disabled],B}):u=u.map(I=>{const B=JSON.parse(JSON.stringify(I));return B[o.format.disabled]=_.includes(B[y])||B[o.format.disabled],B})}C.list=u},h=t.computed(()=>c.state.isGettingDictTypes.includes(i.value)),F=t.computed(()=>c.state.isGettingAllDictTypes),O=t.computed(()=>{const u=f.props??{};return u.disabled=u.disabled??o.format.disabled,u.value=u.value??o.format.value,u.label=u.label??o.treeSetting.labelField,u.children=u.children??o.treeSetting.childrenField,u.leaf=u.leaf??o.treeSetting.leafField,u}),S=t.computed(()=>{const u=f.props??{},b={idField:u.idField??o.treeSetting.idField,labelField:u.label??o.treeSetting.labelField,childrenField:u.children??o.treeSetting.childrenField,leafField:u.leaf??o.treeSetting.leafField},y=Object.assign(o.treeSetting,b),T=JSON.parse(JSON.stringify(C.list)),_=H(T,y);return n&&A(_,+n),_});t.watch([h,F],([u,b])=>{!u&&!b&&j()},{immediate:!0});const D=t.ref(null);return a({getRef:()=>D.value}),(u,b)=>{const y=t.resolveComponent("el-cascader");return t.openBlock(),t.createBlock(y,{ref_key:"ElCascaderDict",ref:D,options:t.unref(S),props:t.unref(O),onChange:p},t.createSlots({_:2},[t.renderList(u.$slots,(T,_,I)=>({name:_,fn:t.withCtx(B=>[t.renderSlot(u.$slots,_,t.normalizeProps(t.guardReactiveProps(B)))])}))]),1032,["options","props"])}}});Z.install=function(e){e.component(Z.name,Z)};const Nt=Object.freeze(Object.defineProperty({__proto__:null,default:Z},Symbol.toStringTag,{value:"Module"})),Vt={name:"ElCheckboxButtonDict"},v=t.defineComponent({...Vt,props:{dictType:{type:[String,Object],required:!0},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{dictType:n,disableObj:s,name:l,checked:d,trueValue:r,falseValue:f,trueLabel:i,falseLabel:o,keyValue:p,filterDataFun:C,disabledDataFun:A}=e,j=t.ref(""),h=t.toRaw(c.state.dictConfig),F=y=>{if(!p){g("dictChange",y);return}const T=O.list.filter(_=>y.includes(_[h.format.value]));g("dictChange",T)},O=t.reactive({list:[]}),S=async()=>{if(!n)return;let y=[];if(typeof n=="object"){j.value=n.type;const T=await c.actions.getDictDataObj(j.value);y=[].concat(T[j.value]);const{filters:_,filterType:I=h.format.value,reverse:B=!1}=n,w=typeof _=="string"?_.split(","):_;B?y=y.filter(k=>!w.includes(k[I])):y=y.filter(k=>w.includes(k[I]))}else{j.value=n;const T=await c.actions.getDictDataObj(j.value);y=[].concat(T[j.value])}if(C&&(y=C(y)),A&&(y=y.map(T=>({...T,[h.format.disabled]:!!T[h.format.disabled]||A(T)}))),s){const{disableValue:T,disableType:_=h.format.value,reverse:I=!1}=s,B=typeof T=="string"?T.split(","):T;I?y=y.map(w=>{const k=JSON.parse(JSON.stringify(w));return k[h.format.disabled]=!B.includes(k[_])||k[h.format.disabled],k}):y=y.map(w=>{const k=JSON.parse(JSON.stringify(w));return k[h.format.disabled]=B.includes(k[_])||k[h.format.disabled],k})}O.list=y},D=t.computed(()=>c.state.isGettingDictTypes.includes(j.value)),m=t.computed(()=>c.state.isGettingAllDictTypes);t.watch([D,m],([y,T])=>{!y&&!T&&S()},{immediate:!0});const u=t.ref(null);return a({getRef:()=>u.value}),(y,T)=>{const _=t.resolveComponent("el-checkbox-button"),I=t.resolveComponent("el-checkbox-group");return t.openBlock(),t.createBlock(I,t.mergeProps({ref_key:"ElCheckboxButtonDict",ref:u},y.$attrs,{onChange:F}),t.createSlots({default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(O.list,B=>(t.openBlock(),t.createBlock(_,{key:B[t.unref(h).format.value],disabled:B[t.unref(h).format.disabled],label:B[t.unref(h).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(B[t.unref(h).format.label]),1)]),_:2},1032,["disabled","label","name","true-value","false-value","true-label","false-label","checked"]))),128))]),_:2},[t.renderList(y.$slots,(B,w,k)=>({name:w,fn:t.withCtx(E=>[t.renderSlot(y.$slots,w,t.normalizeProps(t.guardReactiveProps(E)))])}))]),1040)}}});v.install=function(e){e.component(v.name,v)};const wt=Object.freeze(Object.defineProperty({__proto__:null,default:v},Symbol.toStringTag,{value:"Module"})),$t={name:"ElCheckboxDict"},tt=t.defineComponent({...$t,props:{dictType:{type:[String,Object],required:!0},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{dictType:n,disableObj:s,border:l,size:d,name:r,checked:f,indeterminate:i,trueValue:o,falseValue:p,trueLabel:C,falseLabel:A,keyValue:j,filterDataFun:h,disabledDataFun:F,validateEvent:O,tabindex:S,id:D}=e,m=t.ref(""),u=t.toRaw(c.state.dictConfig),b=k=>{if(!j){g("dictChange",k);return}const E=y.list.find($=>k.includes($[u.format.value]));g("dictChange",E)},y=t.reactive({list:[]}),T=async()=>{if(!n)return;let k=[];if(typeof n=="object"){m.value=n.type;const E=await c.actions.getDictDataObj(m.value);k=[].concat(E[m.value]);const{filters:$,filterType:J=u.format.value,reverse:P=!1}=n,R=typeof $=="string"?$.split(","):$;P?k=k.filter(N=>!R.includes(N[J])):k=k.filter(N=>R.includes(N[J]))}else{m.value=n;const E=await c.actions.getDictDataObj(m.value);k=[].concat(E[m.value])}if(h&&(k=h(k)),F&&(k=k.map(E=>({...E,[u.format.disabled]:!!E[u.format.disabled]||F(E)}))),s){const{disableValue:E,disableType:$=u.format.value,reverse:J=!1}=s,P=typeof E=="string"?E.split(","):E;J?k=k.map(R=>{const N=JSON.parse(JSON.stringify(R));return N[u.format.disabled]=!P.includes(N[$])||N[u.format.disabled],N}):k=k.map(R=>{const N=JSON.parse(JSON.stringify(R));return N[u.format.disabled]=P.includes(N[$])||N[u.format.disabled],N})}y.list=k},_=t.computed(()=>c.state.isGettingDictTypes.includes(m.value)),I=t.computed(()=>c.state.isGettingAllDictTypes);t.watch([_,I],([k,E])=>{!k&&!E&&T()},{immediate:!0});const B=t.ref(null);return a({getRef:()=>B.value}),(k,E)=>{const $=t.resolveComponent("el-checkbox"),J=t.resolveComponent("el-checkbox-group");return t.openBlock(),t.createBlock(J,t.mergeProps({ref_key:"ElCheckboxDict",ref:B},k.$attrs,{onChange:b}),t.createSlots({default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(y.list,P=>(t.openBlock(),t.createBlock($,{key:P[t.unref(u).format.value],label:P[t.unref(u).format.value],"true-value":e.trueValue,"false-value":e.falseValue,"true-label":e.trueLabel,"false-label":e.falseLabel,disabled:P[t.unref(u).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(P[t.unref(u).format.label]),1)]),_:2},1032,["label","true-value","false-value","true-label","false-label","disabled","border","size","name","checked","indeterminate","validate-event","tabindex","id"]))),128))]),_:2},[t.renderList(k.$slots,(P,R,N)=>({name:R,fn:t.withCtx(ft=>[t.renderSlot(k.$slots,R,t.normalizeProps(t.guardReactiveProps(ft)))])}))]),1040)}}});tt.install=function(e){e.component(tt.name,tt)};const Pt=Object.freeze(Object.defineProperty({__proto__:null,default:tt},Symbol.toStringTag,{value:"Module"})),Rt={name:"ElLinkDict"},et=t.defineComponent({...Rt,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:l,type:d,judgeDisabledFun:r,disabled:f}=t.toRefs(g),i=t.toRaw(c.state.dictConfig),o=t.computed(()=>l!=null&&l.value?l.value(n.value):d.value?d.value:C.value&&C.value[i.format.type]?C.value[i.format.type]:"primary"),p=t.computed(()=>C.value&&C.value[i.format.disabled]?C.value[i.format.disabled]:r!=null&&r.value?r.value(n.value):!!f.value);let C=t.ref(null),A=t.ref(null);t.watchEffect(()=>{U(n.value,s.value).then(F=>{C.value=F,A.value=F[i.format.label]})});const j=t.ref(null);return a({getRef:()=>j.value}),(F,O)=>{const S=t.resolveComponent("el-link");return t.openBlock(),t.createBlock(S,t.mergeProps({ref_key:"ElLinkDict",ref:j,type:t.unref(o),disabled:t.unref(p)},F.$attrs),t.createSlots({default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(t.unref(A)),1)]),_:2},[t.renderList(F.$slots,(D,m,u)=>({name:m,fn:t.withCtx(b=>[t.renderSlot(F.$slots,m,t.normalizeProps(t.guardReactiveProps(b)))])}))]),1040,["type","disabled"])}}});et.install=function(e){e.component(et.name,et)};const Jt=Object.freeze(Object.defineProperty({__proto__:null,default:et},Symbol.toStringTag,{value:"Module"})),xt={name:"ElRadioButtonDict"},nt=t.defineComponent({...xt,props:{dictType:{type:[String,Object],required:!0},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{dictType:n,disableObj:s,name:l,keyValue:d,filterDataFun:r,disabledDataFun:f}=e,i=t.ref(""),o=t.toRaw(c.state.dictConfig),p=S=>{if(!d){g("dictChange",S);return}const D=C.list.find(m=>m[o.format.value]===S);g("dictChange",D)},C=t.reactive({list:[]}),A=async()=>{if(!n)return;let S=[];if(typeof n=="object"){i.value=n.type;const D=await c.actions.getDictDataObj(i.value);S=[].concat(D[i.value]);const{filters:m,filterType:u=o.format.value,reverse:b=!1}=n,y=typeof m=="string"?m.split(","):m;b?S=S.filter(T=>!y.includes(T[u])):S=S.filter(T=>y.includes(T[u]))}else{i.value=n;const D=await c.actions.getDictDataObj(i.value);S=[].concat(D[i.value])}if(r&&(S=r(S)),f&&(S=S.map(D=>({...D,[o.format.disabled]:!!D[o.format.disabled]||f(D)}))),s){const{disableValue:D,disableType:m=o.format.value,reverse:u=!1}=s,b=typeof D=="string"?D.split(","):D;u?S=S.map(y=>{const T=JSON.parse(JSON.stringify(y));return T[o.format.disabled]=!b.includes(T[m])||T[o.format.disabled],T}):S=S.map(y=>{const T=JSON.parse(JSON.stringify(y));return T[o.format.disabled]=b.includes(T[m])||T[o.format.disabled],T})}C.list=S},j=t.computed(()=>c.state.isGettingDictTypes.includes(i.value)),h=t.computed(()=>c.state.isGettingAllDictTypes);t.watch([j,h],([S,D])=>{!S&&!D&&A()},{immediate:!0});const F=t.ref(null);return a({getRef:()=>F.value}),(S,D)=>{const m=t.resolveComponent("el-radio-button"),u=t.resolveComponent("el-radio-group");return t.openBlock(),t.createBlock(u,t.mergeProps({ref_key:"ElRadioButtonDict",ref:F},S.$attrs,{onChange:p}),t.createSlots({default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(C.list,b=>(t.openBlock(),t.createBlock(m,{key:b[t.unref(o).format.value],disabled:b[t.unref(o).format.disabled],label:b[t.unref(o).format.value],name:e.name},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(b[t.unref(o).format.label]),1)]),_:2},1032,["disabled","label","name"]))),128))]),_:2},[t.renderList(S.$slots,(b,y,T)=>({name:y,fn:t.withCtx(_=>[t.renderSlot(S.$slots,y,t.normalizeProps(t.guardReactiveProps(_)))])}))]),1040)}}});nt.install=function(e){e.component(nt.name,nt)};const Mt=Object.freeze(Object.defineProperty({__proto__:null,default:nt},Symbol.toStringTag,{value:"Module"})),zt={name:"ElRadioDict"},at=t.defineComponent({...zt,props:{dictType:{type:[String,Object],required:!0},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{dictType:n,disableObj:s,border:l,size:d,name:r,keyValue:f,filterDataFun:i,disabledDataFun:o}=e,p=t.ref(""),C=t.toRaw(c.state.dictConfig),A=m=>{if(!f){g("dictChange",m);return}const u=j.list.find(b=>b[C.format.value]===m);g("dictChange",u)},j=t.reactive({list:[]}),h=async()=>{if(!n)return;let m=[];if(typeof n=="object"){p.value=n.type;const u=await c.actions.getDictDataObj(p.value);m=[].concat(u[p.value]);const{filters:b,filterType:y=C.format.value,reverse:T=!1}=n,_=typeof b=="string"?b.split(","):b;T?m=m.filter(I=>!_.includes(I[y])):m=m.filter(I=>_.includes(I[y]))}else{p.value=n;const u=await c.actions.getDictDataObj(p.value);m=[].concat(u[p.value])}if(i&&(m=i(m)),o&&(m=m.map(u=>({...u,[C.format.disabled]:!!u[C.format.disabled]||o(u)}))),s){const{disableValue:u,disableType:b=C.format.value,reverse:y=!1}=s,T=typeof u=="string"?u.split(","):u;y?m=m.map(_=>{const I=JSON.parse(JSON.stringify(_));return I[C.format.disabled]=!T.includes(I[b])||I[C.format.disabled],I}):m=m.map(_=>{const I=JSON.parse(JSON.stringify(_));return I[C.format.disabled]=T.includes(I[b])||I[C.format.disabled],I})}j.list=m},F=t.computed(()=>c.state.isGettingDictTypes.includes(p.value)),O=t.computed(()=>c.state.isGettingAllDictTypes);t.watch([F,O],([m,u])=>{!m&&!u&&h()},{immediate:!0});const S=t.ref(null);return a({getRef:()=>S.value}),(m,u)=>{const b=t.resolveComponent("el-radio"),y=t.resolveComponent("el-radio-group");return t.openBlock(),t.createBlock(y,t.mergeProps({ref_key:"ElRadioDict",ref:S},m.$attrs,{onChange:A}),t.createSlots({default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(j.list,T=>(t.openBlock(),t.createBlock(b,{key:T[t.unref(C).format.value],disabled:T[t.unref(C).format.disabled],label:T[t.unref(C).format.value],border:e.border,size:e.size,name:e.name},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(T[t.unref(C).format.label]),1)]),_:2},1032,["disabled","label","border","size","name"]))),128))]),_:2},[t.renderList(m.$slots,(T,_,I)=>({name:_,fn:t.withCtx(B=>[t.renderSlot(m.$slots,_,t.normalizeProps(t.guardReactiveProps(B)))])}))]),1040)}}});at.install=function(e){e.component(at.name,at)};const qt=Object.freeze(Object.defineProperty({__proto__:null,default:at},Symbol.toStringTag,{value:"Module"})),Kt={name:"ElSelectDict"},it=t.defineComponent({...Kt,props:{dictType:{type:[String,Object],required:!0},disableObj:{type:Object},keyValue:{type:Boolean,default:!1},filterDataFun:{type:Function},disabledDataFun:{type:Function}},emits:["dictChange"],setup(e,{expose:a,emit:g}){const{dictType:n,disableObj:s,keyValue:l,filterDataFun:d,disabledDataFun:r}=e,f=t.ref(""),i=t.toRaw(c.state.dictConfig),o=O=>{g("dictChange",O)},p=t.reactive({list:[]}),C=async()=>{if(!n)return;let O=[];if(typeof n=="object"){f.value=n.type;const S=await c.actions.getDictDataObj(f.value);O=[].concat(S[f.value]);const{filters:D,filterType:m=i.format.value,reverse:u=!1}=n,b=typeof D=="string"?D.split(","):D;u?O=O.filter(y=>!b.includes(y[m])):O=O.filter(y=>b.includes(y[m]))}else{f.value=n;const S=await c.actions.getDictDataObj(f.value);O=[].concat(S[f.value])}if(d&&(O=d(O)),r&&(O=O.map(S=>({...S,[i.format.disabled]:!!S[i.format.disabled]||r(S)}))),s){const{disableValue:S,disableType:D=i.format.value,reverse:m=!1}=s,u=typeof S=="string"?S.split(","):S;m?O=O.map(b=>{const y=JSON.parse(JSON.stringify(b));return y[i.format.disabled]=!u.includes(y[D])||y[i.format.disabled],y}):O=O.map(b=>{const y=JSON.parse(JSON.stringify(b));return y[i.format.disabled]=u.includes(y[D])||y[i.format.disabled],y})}p.list=O},A=t.computed(()=>c.state.isGettingDictTypes.includes(f.value)),j=t.computed(()=>c.state.isGettingAllDictTypes);t.watch([A,j],([O,S])=>{!O&&!S&&C()},{immediate:!0});const h=t.ref(null);return a({getRef:()=>h.value}),(O,S)=>{const D=t.resolveComponent("el-option"),m=t.resolveComponent("el-select");return t.openBlock(),t.createBlock(m,t.mergeProps({ref_key:"ElSelectDict",ref:h},O.$attrs,{"value-key":e.keyValue?t.unref(i).format.label:"",onChange:o}),t.createSlots({default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(p.list,u=>(t.openBlock(),t.createBlock(D,{key:u[t.unref(i).format.value],disabled:u[t.unref(i).format.disabled],label:u[t.unref(i).format.label],value:e.keyValue?u:u[t.unref(i).format.value]},null,8,["disabled","label","value"]))),128))]),_:2},[t.renderList(O.$slots,(u,b,y)=>({name:b,fn:t.withCtx(T=>[t.renderSlot(O.$slots,b,t.normalizeProps(t.guardReactiveProps(T)))])}))]),1040,["value-key"])}}});it.install=function(e){e.component(it.name,it)};const Yt=Object.freeze(Object.defineProperty({__proto__:null,default:it},Symbol.toStringTag,{value:"Module"})),Ut=(e,a,g)=>{const{format:n}=c.state.dictConfig,s=c.state.dictCodes;let l=[];if(!s||!s[a])c.actions.getDictDataObj(a).then(d=>{if(l=d[a],!l)return;const r=l.find(f=>f[n.value]===e);return r?r[n.label]:g??""});else{l=s[a];const d=l.find(r=>r[n.value]===e);return d?d[n.label]:g??""}},ut=(e,a,g)=>{const n={defaultVal:"",formatFun:(f,i)=>f.map(o=>o[i.label]).join(","),spacer:","};Object.assign(n,g);let s=[];Array.isArray(e)?s=e:typeof e=="string"&&(s=e.split(n.spacer));const{format:l}=c.state.dictConfig,d=c.state.dictCodes;let r=[];if(!d||!d[a])c.actions.getDictDataObj(a).then(f=>{if(r=f[a],!r)return;const i=K(s,r,l,n.defaultVal);return i&&i.length>0?n.formatFun(i,l):n.defaultVal});else{r=d[a];const f=K(s,r,l,n.defaultVal);return f&&f.length>0?n.formatFun(f,l):n.defaultVal}},Ht=(e,a,g)=>{const{format:n}=c.state.dictConfig,s=c.state.dictCodes;let l=[];if(!s||!s[a])c.actions.getDictDataObj(a).then(d=>{if(l=d[a],!l)return;const r=l.find(f=>f[n.label]===e);return r?r[n.value]:g??""});else{l=s[a];const d=l.find(r=>r[n.label]===e);return d?d[n.value]:g??""}},Qt=(e,a,g)=>{const n={defaultVal:"",formatFun:(f,i)=>f.map(o=>o[i.value]).join(","),spacer:","};Object.assign(n,g);let s=[];Array.isArray(e)?s=e:typeof e=="string"&&(s=e.split(n.spacer));const{format:l}=c.state.dictConfig,d=c.state.dictCodes;let r=[];if(!d||!d[a])c.actions.getDictDataObj(a).then(f=>{if(r=f[a],!r)return;const i=Y(s,r,l,n.defaultVal);return i&&i.length>0?n.formatFun(i,l):n.defaultVal});else{r=d[a];const f=Y(s,r,l,n.defaultVal);return f&&f.length>0?n.formatFun(f,l):n.defaultVal}},Wt=(e,a,g)=>{const n={defaultVal:"",formatFun:(s,l)=>s.map(d=>d[l.labelField]).join(","),treeSetting:{}};return Object.assign(n,g),new Promise((s,l)=>{const{treeSetting:d}=c.state.dictConfig,r=Object.assign(d,n.treeSetting),f=c.state.dictCodes;let i=[];if(!f||!f[a])if(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes){const o=setInterval(()=>{if(!(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes)){if(clearInterval(o),i=c.state.dictCodes[a],!i){l(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const p=i.find(C=>C[r.idField]===e);s(p?n.formatFun(x(p[r.idField],i,r),r):n.defaultVal)}},1e3)}else c.actions.getDictDataObj(a).then(o=>{if(i=o[a],!i){l(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const p=i.find(C=>C[r.idField]===e);s(p?n.formatFun(x(p[r.idField],i,r),r):n.defaultVal)});else{i=f[a];const o=i.find(p=>p[r.idField]===e);s(o?n.formatFun(x(o[r.idField],i,r),r):n.defaultVal)}})};function Q(e,a,g,n,s){const l=[];for(let d=0;d<e.length;d++){const r=a.find(f=>f[s.idField]===e[d]);r?l.push(n(x(r[s.idField],a,s),s)):l.push(g)}return l}const Xt=(e,a,g)=>{const n={defaultVal:"",formatFunIn:(s,l)=>s.map(d=>d[l.labelField]).join("/"),treeSetting:{},formatFunOut:s=>s.join(","),spacer:","};return Object.assign(n,g),new Promise((s,l)=>{let d=[];Array.isArray(e)?d=e:typeof e=="string"&&(d=e.split(n.spacer));const{treeSetting:r}=c.state.dictConfig,f=Object.assign(r,n.treeSetting),i=c.state.dictCodes;let o=[];if(!i||!i[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),o=c.state.dictCodes[a],!o){l(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const C=Q(d,o,n.defaultVal,n.formatFunIn,f);s(C&&C.length>0?n.formatFunOut(C):n.defaultVal)}},1e3)}else c.actions.getDictDataObj(a).then(p=>{if(o=p[a],!o){l(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const C=Q(d,o,n.defaultVal,n.formatFunIn,f);s(C&&C.length>0?n.formatFunOut(C):n.defaultVal)});else{o=i[a];const p=Q(d,o,n.defaultVal,n.formatFunIn,f);s(p&&p.length>0?n.formatFunOut(p):n.defaultVal)}})},Zt=(e,a,g)=>{const n={defaultVal:"",formatFun:(s,l)=>s.map(d=>d[l.idField]).join(","),treeSetting:{}};return Object.assign(n,g),new Promise((s,l)=>{const{treeSetting:d}=c.state.dictConfig,r=Object.assign(d,n.treeSetting),f=c.state.dictCodes;let i=[];if(!f||!f[a])if(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes){const o=setInterval(()=>{if(!(c.state.isGettingDictTypes.includes(a)||c.state.isGettingAllDictTypes)){if(clearInterval(o),i=c.state.dictCodes[a],!i){l(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const p=i.find(C=>C[r.labelField]===e);s(p?n.formatFun(z(p[r.labelField],i,r),r):n.defaultVal)}},1e3)}else c.actions.getDictDataObj(a).then(o=>{if(i=o[a],!i){l(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const p=i.find(C=>C[r.labelField]===e);s(p?n.formatFun(z(p[r.labelField],i,r),r):n.defaultVal)});else{i=f[a];const o=i.find(p=>p[r.labelField]===e);s(o?n.formatFun(z(o[r.labelField],i,r),r):n.defaultVal)}})};function W(e,a,g,n,s){const l=[];for(let d=0;d<e.length;d++){const r=a.find(f=>f[s.labelField]===e[d]);r?l.push(n(z(r[s.labelField],a,s),s)):l.push(g)}return l}const vt=(e,a,g)=>{const n={defaultVal:"",formatFunIn:(s,l)=>s.map(d=>d[l.idField]).join("/"),treeSetting:{},formatFunOut:s=>s.join(","),spacer:","};return Object.assign(n,g),new Promise((s,l)=>{let d=[];Array.isArray(e)?d=e:typeof e=="string"&&(d=e.split(n.spacer));const{treeSetting:r}=c.state.dictConfig,f=Object.assign(r,n.treeSetting),i=c.state.dictCodes;let o=[];if(!i||!i[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),o=c.state.dictCodes[a],!o){l(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const C=W(d,o,n.defaultVal,n.formatFunIn,f);s(C&&C.length>0?n.formatFunOut(C):n.defaultVal)}},1e3)}else c.actions.getDictDataObj(a).then(p=>{if(o=p[a],!o){l(`不存在类型为:${a} 的字典字段,请确认后再填写`);return}const C=W(d,o,n.defaultVal,n.formatFunIn,f);s(C&&C.length>0?n.formatFunOut(C):n.defaultVal)});else{o=i[a];const p=W(d,o,n.defaultVal,n.formatFunIn,f);s(p&&p.length>0?n.formatFunOut(p):n.defaultVal)}})},te=(e,a,g)=>{const n={defaultVal:"",formatFun:(f,i)=>f.map(o=>o[i.labelField]).join(","),treeSetting:{}};Object.assign(n,g);const{treeSetting:s}=c.state.dictConfig,l=Object.assign(s,n.treeSetting),d=c.state.dictCodes;let r=[];if(!d||!d[a])c.actions.getDictDataObj(a).then(f=>{if(r=f[a],!r)return new Error(`不存在类型为:${a} 的字典字段,请确认后再填写`);const i=r.find(o=>o[l.idField]===e);return i?n.formatFun(x(i[l.idField],r,l),l):n.defaultVal});else{r=d[a];const f=r.find(i=>i[l.idField]===e);return f?n.formatFun(x(f[l.idField],r,l),l):n.defaultVal}},gt=(e,a,g)=>{const n={defaultVal:"",formatFunIn:(i,o)=>i.map(p=>p[o.labelField]).join("/"),treeSetting:{},formatFunOut:i=>i.join(","),spacer:","};Object.assign(n,g);let s=[];Array.isArray(e)?s=e:typeof e=="string"&&(s=e.split(n.spacer));const{treeSetting:l}=c.state.dictConfig,d=Object.assign(l,n.treeSetting),r=c.state.dictCodes;let f=[];if(!r||!r[a])c.actions.getDictDataObj(a).then(i=>{if(f=i[a],!f)return new Error(`不存在类型为:${a} 的字典字段,请确认后再填写`);const o=Q(s,f,n.defaultVal,n.formatFunIn,d);return o&&o.length>0?n.formatFunOut(o):n.defaultVal});else{f=r[a];const i=Q(s,f,n.defaultVal,n.formatFunIn,d);return i&&i.length>0?n.formatFunOut(i):n.defaultVal}},ee=(e,a,g)=>{const n={defaultVal:"",formatFun:(f,i)=>f.map(o=>o[i.idField]).join(","),treeSetting:{}};Object.assign(n,g);const{treeSetting:s}=c.state.dictConfig,l=Object.assign(s,n.treeSetting),d=c.state.dictCodes;let r=[];if(!d||!d[a])c.actions.getDictDataObj(a).then(f=>{if(r=f[a],!r)return new Error(`不存在类型为:${a} 的字典字段,请确认后再填写`);const i=r.find(o=>o[l.labelField]===e);return i?n.formatFun(z(i[l.labelField],r,l),l):n.defaultVal});else{r=d[a];const f=r.find(i=>i[l.labelField]===e);return f?n.formatFun(z(f[l.labelField],r,l),l):n.defaultVal}},ne=(e,a,g)=>{const n={defaultVal:"",formatFunIn:(i,o)=>i.map(p=>p[o.idField]).join("/"),treeSetting:{},formatFunOut:i=>i.join(","),spacer:","};Object.assign(n,g);let s=[];Array.isArray(e)?s=e:typeof e=="string"&&(s=e.split(n.spacer));const{treeSetting:l}=c.state.dictConfig,d=Object.assign(l,n.treeSetting),r=c.state.dictCodes;let f=[];if(!r||!r[a])c.actions.getDictDataObj(a).then(i=>{if(f=i[a],!f)return new Error(`不存在类型为:${a} 的字典字段,请确认后再填写`);const o=W(s,f,n.defaultVal,n.formatFunIn,d);return o&&o.length>0?n.formatFunOut(o):n.defaultVal});else{f=r[a];const i=W(s,f,n.defaultVal,n.formatFunIn,d);return i&&i.length>0?n.formatFunOut(i):n.defaultVal}},mt={date:"yyyy-MM-dd",month:"yyyy-MM",datetime:"yyyy-MM-dd hh:mm:ss",time:"hh:mm:ss",year:"yyyy"},pt=e=>{const a=e.replaceAll("-","/");var g=new Date(e),n=new Date(a);return!isNaN(g.getTime())||!isNaN(n.getTime())},bt=(e,a="datetime",g)=>{if(!e||!a)return g??"";Object.keys(mt).includes(a)&&(a=mt[a]),e instanceof Date||(typeof e=="number"||pt(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 l=new RegExp(`(${s})`);l.test(a)&&(a=a.replace(l,RegExp.$1.length===1?n[s]:("00"+n[s]).substr(String(n[s]).length)))}return a},q=(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 l="";for(let f=0;f<n.start&&f<s;f++)l+=e.charAt(f);let d="";for(let f=s-1;f>=0&&f>=s-n.end;f--)d=e.charAt(f)+d;const r=n.symbol.repeat(Math.max(n.middle||s-n.start-n.end,0));return l+r+d},yt=(e,a="*")=>{if(!e)return"";const g=e.length;if(g===1)return e;const n=e.charAt(0),s=e.charAt(g-1);return q(e.substring(1,g-1),{start:1,symbol:a})?`${n}*${s}`:`${n}${s}`},Dt=(e,a="*")=>e?q(e,{start:4,end:4,symbol:a}):"",Tt=(e,a="*")=>e?q(String(e),{start:3,end:4,symbol:a}):"",Ct=(e,a="*")=>{if(!e)return"";const g=e.trim().split(/\s+/),n=g.length;let s="";for(let l=0;l<n;l++)/^[\u4e00-\u9fa5]+$/.test(g[l])?s+=q(g[l],{start:1,symbol:a}):s+=q(g[l],{start:2,symbol:a}),l<n-1&&(s+=" ");return s},ae={mobile:Tt,name:yt,address:Ct,idCard:Dt},_t=(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 ae[g.maskType](e,g.symbol);const n={start:g.start,end:g.end,middle:g.middle,symbol:g.symbol};return q(e,n)},ie={name:"ElTableColumnDict"},rt=t.defineComponent({...ie,props:{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{dictType:g,dictTreeType:n,dateFormat:s,defaultVal:l,treeSetting:d,formatFun:r,formatFunIn:f,formatFunOut:i,spacer:o,maskType:p,maskStart:C,maskEnd:A,maskMiddle:j,maskSymbol:h}=e,F=t.useAttrs(),O=t.computed(()=>{let b={};return l&&(b.defaultVal=l),r&&(b.formatFun=r),o&&(b.spacer=o),b}),S=t.computed(()=>{let b={};return l&&(b.defaultVal=l),f&&(b.formatFunIn=f),i&&(b.formatFunOut=i),d&&(b.treeSetting=d),o&&(b.spacer=o),b}),D=t.computed(()=>{const b={};return l&&(b.defaultVal=l),p&&(b.maskType=p),C&&(b.start=C),A&&(b.end=A),j&&(b.middle=j),h&&(b.symbol=h),b}),m=t.ref(null);return a({getRef:()=>m.value}),(b,y)=>{const T=t.resolveComponent("el-button-dict"),_=t.resolveComponent("el-link-dict"),I=t.resolveComponent("el-tag-dict"),B=t.resolveComponent("el-text-dict"),w=t.resolveComponent("el-table-column");return t.openBlock(),t.createBlock(w,t.mergeProps({ref_key:"ElTableColumnDict",ref:m},b.$attrs),t.createSlots({default:t.withCtx(k=>{var E,$,J,P,R,N,ft,Ot,ht;return[e.dictType?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[e.dictTypeNode==="button"?(t.openBlock(),t.createBlock(T,{key:0,value:k.row[(E=t.unref(F))==null?void 0:E.prop]||"",dictType:e.dictType},null,8,["value","dictType"])):e.dictTypeNode==="link"?(t.openBlock(),t.createBlock(_,{key:1,value:k.row[($=t.unref(F))==null?void 0:$.prop]||"",dictType:e.dictType},null,8,["value","dictType"])):e.dictTypeNode==="tag"?(t.openBlock(),t.createBlock(I,{key:2,value:k.row[(J=t.unref(F))==null?void 0:J.prop]||"",dictType:e.dictType},null,8,["value","dictType"])):e.dictTypeNode==="text"?(t.openBlock(),t.createBlock(B,{key:3,value:k.row[(P=t.unref(F))==null?void 0:P.prop]||"",dictType:e.dictType},null,8,["value","dictType"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:4},[t.createTextVNode(t.toDisplayString(t.unref(ut)(k.row[(R=t.unref(F))==null?void 0:R.prop],e.dictType,t.unref(O))),1)],64))],64)):e.dictTreeType?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(t.unref(gt)(k.row[(N=t.unref(F))==null?void 0:N.prop],e.dictTreeType,t.unref(S))),1)],64)):e.dateFormat?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createTextVNode(t.toDisplayString(t.unref(bt)(k.row[(ft=t.unref(F))==null?void 0:ft.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(_t)(k.row[(Ot=t.unref(F))==null?void 0:Ot.prop],t.unref(D))),1)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:4},[t.createTextVNode(t.toDisplayString(k.row[(ht=t.unref(F))==null?void 0:ht.prop]||e.defaultVal),1)],64))]}),_:2},[t.renderList(b.$slots,(k,E,$)=>({name:E,fn:t.withCtx(J=>[t.renderSlot(b.$slots,E,t.normalizeProps(t.guardReactiveProps(J)))])}))]),1040)}}});rt.install=function(e){e.component(rt.name,rt)};const re=Object.freeze(Object.defineProperty({__proto__:null,default:rt},Symbol.toStringTag,{value:"Module"})),le={name:"ElTabsDict"},lt=t.defineComponent({...le,props:{badgeObj:{type:Object,default:()=>({})},dictType:{type:[String,Object],required:!0},disableObj:{type:Object},keyValue:{type:Boolean,default:!1},filterDataFun:{type:Function},disabledDataFun:{type:Function}},emits:["dictChange"],setup(e,{expose:a,emit:g}){const{badgeObj:n,dictType:s,disableObj:l,keyValue:d,filterDataFun:r,disabledDataFun:f}=e,i=t.useAttrs(),o=t.ref(""),p=t.toRaw(c.state.dictConfig),C=D=>{window.setTimeout(()=>{if(!d){g("dictChange",i.modelValue);return}const m=A.list.find(u=>u[p.format.value]===i.modelValue);g("dictChange",m)},0)},A=t.reactive({list:[]}),j=async()=>{if(!s)return;let D=[];if(typeof s=="object"){o.value=s.type;const m=await c.actions.getDictDataObj(o.value);D=[].concat(m[o.value]);const{filters:u,filterType:b=p.format.value,reverse:y=!1}=s,T=typeof u=="string"?u.split(","):u;y?D=D.filter(_=>!T.includes(_[b])):D=D.filter(_=>T.includes(_[b]))}else{o.value=s;const m=await c.actions.getDictDataObj(o.value);D=[].concat(m[o.value])}if(r&&(D=r(D)),f&&(D=D.map(m=>({...m,[p.format.disabled]:!!m[p.format.disabled]||f(m)}))),l){const{disableValue:m,disableType:u=p.format.value,reverse:b=!1}=l,y=typeof m=="string"?m.split(","):m;b?D=D.map(T=>{const _=JSON.parse(JSON.stringify(T));return _[p.format.disabled]=!y.includes(_[u])||_[p.format.disabled],_}):D=D.map(T=>{const _=JSON.parse(JSON.stringify(T));return _[p.format.disabled]=y.includes(_[u])||_[p.format.disabled],_})}A.list=D},h=t.computed(()=>c.state.isGettingDictTypes.includes(o.value)),F=t.computed(()=>c.state.isGettingAllDictTypes);t.watch([h,F],([D,m])=>{!D&&!m&&j()},{immediate:!0});const O=t.ref(null);return a({getRef:()=>O.value}),(D,m)=>{const u=t.resolveComponent("el-badge"),b=t.resolveComponent("el-tab-pane"),y=t.resolveComponent("el-tabs");return t.openBlock(),t.createBlock(y,t.mergeProps({ref_key:"ElTabsDict",ref:O,class:"vue-element-dict-tabs"},D.$attrs,{onTabClick:C}),{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(A.list,T=>(t.openBlock(),t.createBlock(b,{disabled:T[t.unref(p).format.disabled],label:T[t.unref(p).format.label],key:T[t.unref(p).format.value],name:T[t.unref(p).format.value]},t.createSlots({default:t.withCtx(()=>[t.renderSlot(D.$slots,T[t.unref(p).format.value])]),_:2},[t.renderList(D.$slots,(_,I,B)=>({name:I,fn:t.withCtx(w=>[t.renderSlot(D.$slots,I,t.normalizeProps(t.guardReactiveProps(w)))])})),e.badgeObj[T[t.unref(p).format.value]]?{name:"label",fn:t.withCtx(()=>[t.createVNode(u,{type:e.badgeObj[T[t.unref(p).format.value]].type,"is-dot":e.badgeObj[T[t.unref(p).format.value]].isDot,value:e.badgeObj[T[t.unref(p).format.value]].value,max:e.badgeObj[T[t.unref(p).format.value]].max,hidden:e.badgeObj[T[t.unref(p).format.value]].hidden,class:"item"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(T[t.unref(p).format.label]),1)]),_:2},1032,["type","is-dot","value","max","hidden"])]),key:"0"}:void 0]),1032,["disabled","label","name"]))),128))]),_:3},16)}}});lt.install=function(e){e.component(lt.name,lt)};const se=Object.freeze(Object.defineProperty({__proto__:null,default:lt},Symbol.toStringTag,{value:"Module"})),oe={name:"ElTagDict"},st=t.defineComponent({...oe,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:l,type:d,judgeColorFun:r,color:f}=t.toRefs(g),i=t.toRaw(c.state.dictConfig),o=t.computed(()=>l!=null&&l.value?l==null?void 0:l.value(n.value):d.value?d.value:C.value&&C.value[i.format.type]?C.value[i.format.type]:"success"),p=t.computed(()=>r!=null&&r.value?r==null?void 0:r.value(n):f.value?f.value:C.value&&C.value[i.format.color]?C.value[i.format.color]:"");let C=t.ref(null),A=t.ref(null);t.watchEffect(()=>{U(n.value,s.value).then(F=>{C.value=F,A.value=F[i.format.label]})});const j=t.ref(null);return a({getRef:()=>j.value}),(F,O)=>{const S=t.resolveComponent("el-tag");return t.openBlock(),t.createBlock(S,t.mergeProps({ref_key:"ElTagDict",ref:j,type:t.unref(o),color:t.unref(p)},F.$attrs),t.createSlots({default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(t.unref(A)),1)]),_:2},[t.renderList(F.$slots,(D,m,u)=>({name:m,fn:t.withCtx(b=>[t.renderSlot(F.$slots,m,t.normalizeProps(t.guardReactiveProps(b)))])}))]),1040,["type","color"])}}});st.install=function(e){e.component(st.name,st)};const ce=Object.freeze(Object.defineProperty({__proto__:null,default:st},Symbol.toStringTag,{value:"Module"})),de={name:"ElTextDict"},ot=t.defineComponent({...de,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:l,type:d}=t.toRefs(g),r=t.toRaw(c.state.dictConfig),f=t.computed(()=>l!=null&&l.value?l==null?void 0:l.value(n.value):d!=null&&d.value?d.value:i.value&&i.value[r.format.type]?i.value[r.format.type]:"primary");let i=t.ref(null),o=t.ref(null);t.watchEffect(()=>{U(n.value,s.value).then(A=>{i.value=A,o.value=A[r.format.label]})});const p=t.ref(null);return a({getRef:()=>p.value}),(A,j)=>{const h=t.resolveComponent("el-text");return t.openBlock(),t.createBlock(h,t.mergeProps({ref:"ElTextDict",type:t.unref(f)},A.$attrs),t.createSlots({default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(t.unref(o)),1)]),_:2},[t.renderList(A.$slots,(F,O,S)=>({name:O,fn:t.withCtx(D=>[t.renderSlot(A.$slots,O,t.normalizeProps(t.guardReactiveProps(D)))])}))]),1040,["type"])}}});ot.install=function(e){e.component(ot.name,ot)};const fe=Object.freeze(Object.defineProperty({__proto__:null,default:ot},Symbol.toStringTag,{value:"Module"})),ue={name:"ElTreeDict"},ct=t.defineComponent({...ue,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:l,disabledDataFun:d}=e,r=t.useAttrs(),f=t.ref(""),i=t.toRaw(c.state.dictConfig),o=t.reactive({list:[]}),p=(D,m)=>{for(let u=0;u<D.length;u++){const b=D[u];if(b[i.treeSetting.levelField]===m){delete b[h.value.children],b[h.value.isLeaf]=!0;continue}else p(b[h.value.children],m)}},C=async()=>{if(!n)return;let D=[];if(typeof n=="object"){f.value=n.type;const m=await c.actions.getDictDataObj(f.value);D=[].concat(m[f.value]);const{filters:u,filterType:b=i.format.value,reverse:y=!1}=n,T=typeof u=="string"?u.split(","):u;y?D=D.filter(_=>!T.includes(_[b])):D=D.filter(_=>T.includes(_[b]))}else{f.value=n;const m=await c.actions.getDictDataObj(f.value);D=[].concat(m[f.value])}if(l&&(D=l(D)),d&&(D=D.map(m=>({...m,[i.format.disabled]:!!m[i.format.disabled]||d(m)}))),s){const{disableValue:m,disableType:u=i.format.value,reverse:b=!1}=s,y=typeof m=="string"?m.split(","):m;b?D=D.map(T=>{const _=JSON.parse(JSON.stringify(T));return _[i.format.disabled]=!y.includes(_[u])||_[i.format.disabled],_}):D=D.map(T=>{const _=JSON.parse(JSON.stringify(T));return _[i.format.disabled]=y.includes(_[u])||_[i.format.disabled],_})}o.list=D},A=t.computed(()=>c.state.isGettingDictTypes.includes(f.value)),j=t.computed(()=>c.state.isGettingAllDictTypes),h=t.computed(()=>{const D=r.props??{};return D.disabled=D.disabled??c.state.dictConfig.format.disabled,D.label=D.label??c.state.dictConfig.treeSetting.labelField,D.children=D.children??c.state.dictConfig.treeSetting.childrenField,D.isLeaf=D.leaf??c.state.dictConfig.treeSetting.leafField,D}),F=t.computed(()=>{const D=r.props??{},m={labelField:D.label??i.treeSetting.labelField,childrenField:D.children??i.treeSetting.childrenField,leafField:D.leaf??i.treeSetting.leafField},u=Object.assign(c.state.dictConfig.treeSetting,m),b=JSON.parse(JSON.stringify(o.list)),y=H(b,u);return g&&p(y,+g),y});t.watch([A,j],([D,m])=>{!D&&!m&&C()},{immediate:!0});const O=t.ref(null);return a({getRef:()=>O.value}),(D,m)=>{const u=t.resolveComponent("el-tree");return t.openBlock(),t.createBlock(u,{ref_key:"ElTreeDict",ref:O,data:t.unref(F),props:t.unref(h)},t.createSlots({_:2},[t.renderList(D.$slots,(b,y,T)=>({name:y,fn:t.withCtx(_=>[t.renderSlot(D.$slots,y,t.normalizeProps(t.guardReactiveProps(_)))])}))]),1032,["data","props"])}}});ct.install=function(e){e.component(ct.name,ct)};const ge=Object.freeze(Object.defineProperty({__proto__:null,default:ct},Symbol.toStringTag,{value:"Module"})),me={name:"ElTreeSelectDict"},dt=t.defineComponent({...me,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:l,filterDataFun:d,disabledDataFun:r}=e,f=t.useAttrs(),i=t.ref(""),o=t.toRaw(c.state.dictConfig),p=t.reactive({list:[]}),C=(m,u)=>{for(let b=0;b<m.length;b++){const y=m[b];if(y[o.treeSetting.levelField]===u){delete y[F.value.children],y[F.value.isLeaf]=!0;continue}else C(y[F.value.children],u)}},A=async()=>{if(!s)return;let m=[];if(typeof s=="object"){i.value=s.type;const u=await c.actions.getDictDataObj(i.value);m=[].concat(u[i.value]);const{filters:b,filterType:y=o.format.value,reverse:T=!1}=s,_=typeof b=="string"?b.split(","):b;T?m=m.filter(I=>!_.includes(I[y])):m=m.filter(I=>_.includes(I[y]))}else{i.value=s;const u=await c.actions.getDictDataObj(i.value);m=[].concat(u[i.value])}if(d&&(m=d(m)),r&&(m=m.map(u=>({...u,[o.format.disabled]:!!u[o.format.disabled]||r(u)}))),l){const{disableValue:u,disableType:b=o.format.value,reverse:y=!1}=l,T=typeof u=="string"?u.split(","):u;y?m=m.map(_=>{const I=JSON.parse(JSON.stringify(_));return I[o.format.disabled]=!T.includes(I[b])||I[o.format.disabled],I}):m=m.map(_=>{const I=JSON.parse(JSON.stringify(_));return I[o.format.disabled]=T.includes(I[b])||I[o.format.disabled],I})}p.list=m},j=t.computed(()=>c.state.isGettingDictTypes.includes(i.value)),h=t.computed(()=>c.state.isGettingAllDictTypes),F=t.computed(()=>{const m=f.props??{};return m.disabled=m.disabled??c.state.dictConfig.format.disabled,m.label=m.label??c.state.dictConfig.treeSetting.labelField,m.children=m.children??c.state.dictConfig.treeSetting.childrenField,m.isLeaf=m.leaf??c.state.dictConfig.treeSetting.leafField,m}),O=t.computed(()=>{const m=f.props??{},u={labelField:m.label??o.treeSetting.labelField,childrenField:m.children??o.treeSetting.childrenField,leafField:m.leaf??o.treeSetting.leafField},b=Object.assign(c.state.dictConfig.treeSetting,u),y=JSON.parse(JSON.stringify(p.list)),T=H(y,b);return g&&C(T,+g),T});t.watch([j,h],([m,u])=>{!m&&!u&&A()},{immediate:!0});const S=t.ref(null);return a({getRef:()=>S.value}),(m,u)=>{const b=t.resolveComponent("el-tree-select");return t.openBlock(),t.createBlock(b,{ref_key:"ElTreeSelectDict",ref:S,data:t.unref(O),"node-key":e.nodeKey,props:t.unref(F)},t.createSlots({_:2},[t.renderList(m.$slots,(y,T,_)=>({name:T,fn:t.withCtx(I=>[t.renderSlot(m.$slots,T,t.normalizeProps(t.guardReactiveProps(I)))])}))]),1032,["data","node-key","props"])}}});dt.install=function(e){e.component(dt.name,dt)};const St=Object.assign({"./el-button-dict/index.ts":Et,"./el-cascader-dict/index.ts":Nt,"./el-checkbox-button-dict/index.ts":wt,"./el-checkbox-dict/index.ts":Pt,"./el-link-dict/index.ts":Jt,"./el-radio-button-dict/index.ts":Mt,"./el-radio-dict/index.ts":qt,"./el-select-dict/index.ts":Yt,"./el-table-column-dict/index.ts":re,"./el-tabs-dict/index.ts":se,"./el-tag-dict/index.ts":ce,"./el-text-dict/index.ts":fe,"./el-tree-dict/index.ts":ge,"./el-tree-select-dict/index.ts":Object.freeze(Object.defineProperty({__proto__:null,default:dt},Symbol.toStringTag,{value:"Module"}))});let Ft=[];Object.keys(St).forEach(e=>{Ft.push(St[e].default)});const pe=()=>c.state.dictConfig,be=e=>c.state.dictConfig[e],ye=()=>c.state.dictCodes,De=e=>c.state.dictCodes[e],Te=pe,Ce=be,_e=ye,Se=De,Fe=It,Oe=kt,he=jt,Ie=At,ke=Gt,je=U,Ae=Ut,Ge=ut,Be=Ht,Ee=Qt,Le=q,Ne=Ct,Ve=Dt,we=yt,$e=Tt,Pe=_t,Re=bt,Je=pt,xe=H,Me=x,ze=z,qe=Wt,Ke=Zt,Ye=Xt,Ue=vt,He=te,Qe=ee,We=gt,Xe=ne;async function Ze(e){var l;const a=e.storage.getItem(e.dictDataKey)||"{}",g=JSON.parse(a),n=e.usuallyGetDictTypes?e.usuallyGetDictTypes.split(","):[];let s=[];if(e.usuallyGetDictTypesByApi)s=n;else if(n.length>0)for(let d=0;d<n.length;d++)g[n[d]]||s.push(n[d]);if(a==="{}"||e.isGetAll||s.length>0){let d,r="";e.isGetAll?(c.mutations.SETTING_ISGETTING_ALL_DICT_TYPES(!0),d=await e.getDictCodeApi(e.formatterRequest(e.query,r)),c.mutations.SETTING_ISGETTING_ALL_DICT_TYPES(!1)):s.length>0&&(r=s.join(","),c.mutations.ADD_IS_EGTTING_DICT_TYPES(r),d=await e.getDictCodeApi(e.formatterRequest(e.query,r)),c.mutations.REMOVE_IS_EGTTING_DICT_TYPES(r));const f=e.formatterDictList(d,r),i=e.formatterDictVersion(d);e.storage.setItem(e.versionKey,i);const o=Object.assign(c.state.dictCodes,f),p=M(o,e.filterDataFun,e.disabledDataFun,(l=e==null?void 0:e.format)==null?void 0:l.disabled);c.mutations.SET_DICT_CODES(p),e.storage.setItem(e.dictDataKey,JSON.stringify(p))}}let ve={async install(e,a){var f,i;const g={filterDataFun:o=>o,disabledDataFun:o=>!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:(o,p)=>p?{[o]:p}:{[o]:""},formatterDictList:(o,p)=>!o||!o.dictData?{}:o.dictData,formatterDictVersion:o=>!o||!o.version?"unknow":o.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 l=JSON.parse(JSON.stringify(n.localDictCodes));l=Object.assign(s,l);const d=M(l,n.filterDataFun,n.disabledDataFun,(f=n==null?void 0:n.format)==null?void 0:f.disabled);n.storage.setItem(n.dictDataKey,JSON.stringify(d)),c.mutations.SET_DICT_CODES(d);const r=n.storage.getItem(n.versionKey);if(n.version!==r){n.storage.removeItem(n.dictDataKey),n.storage.setItem(n.versionKey,n.version);const o=JSON.parse(JSON.stringify(n.localDictCodes)),p=M(o,n.filterDataFun,n.disabledDataFun,(i=n==null?void 0:n.format)==null?void 0:i.disabled);n.storage.setItem(n.dictDataKey,JSON.stringify(p)),c.mutations.SET_DICT_CODES(p)}(n.isGetAll||n.usuallyGetDictTypes)&&Ze(n),Ft.forEach(o=>{e.component(o.name,o)})}};G.default=ve,G.desensitization=Pe,G.formatDate=Re,G.getCodeByLabel=he,G.getCodeByLabelFilter=Be,G.getCodeByLabels=Ie,G.getCodeByLabelsFilter=Ee,G.getDictConfig=Te,G.getDictConfigByKey=Ce,G.getDictData=_e,G.getDictDataByKey=Se,G.getDictObjByDictTypes=ke,G.getItemByCode=je,G.getLabelByCode=Fe,G.getLabelByCodeFilter=Ae,G.getLabelByCodes=Oe,G.getLabelByCodesFilter=Ge,G.getTreeCodeByLabel=Ke,G.getTreeCodeByLabelFilter=Qe,G.getTreeCodeByLabels=Ue,G.getTreeCodeByLabelsFilter=Xe,G.getTreeItemByCode=Me,G.getTreeItemByLabel=ze,G.getTreeLabelByCode=qe,G.getTreeLabelByCodeFilter=He,G.getTreeLabelByCodes=Ye,G.getTreeLabelByCodesFilter=We,G.isDate=Je,G.listToTree=xe,G.mask=Le,G.maskAddress=Ne,G.maskIdCard=Ve,G.maskName=we,G.maskPhone=$e,Object.defineProperties(G,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue3-element-dict",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.6",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "shenxiaobu",
|
|
7
7
|
"url": "https://shenxiaobu.github.io"
|
|
@@ -34,5 +34,8 @@
|
|
|
34
34
|
"vue": "^3.2.47",
|
|
35
35
|
"vue-router": "^4.1.6",
|
|
36
36
|
"vue-tsc": "^1.2.0"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"vite-plugin-compression": "^0.5.1"
|
|
37
40
|
}
|
|
38
41
|
}
|
package/lib/vite.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|