easy-ep-ui 0.1.1 → 0.1.2

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.
Files changed (101) hide show
  1. package/LICENSE +172 -0
  2. package/README.md +29 -14
  3. package/dist/easy-ep-ui.js +1 -1
  4. package/dist/style.css +1 -1
  5. package/es/charts/BaseBar/index.d.ts +2 -0
  6. package/es/charts/BaseBar/src/index.vue.d.ts +45 -0
  7. package/es/charts/BaseLine/index.d.ts +2 -0
  8. package/es/charts/BaseLine/src/index.vue.d.ts +47 -0
  9. package/es/charts/BasePie/index.d.ts +2 -0
  10. package/es/charts/BasePie/src/index.vue.d.ts +41 -0
  11. package/es/charts/BaseRadar/index.d.ts +2 -0
  12. package/es/charts/BaseRadar/src/index.vue.d.ts +47 -0
  13. package/es/charts/config.d.ts +32 -0
  14. package/es/charts/index.d.ts +8 -0
  15. package/es/charts/useChart.d.ts +21 -0
  16. package/es/components/ee-dept-cascader/index.d.ts +2 -0
  17. package/es/components/ee-dept-cascader/src/index.vue.d.ts +26 -0
  18. package/es/components/ee-dept-cascader/type.d.ts +39 -0
  19. package/es/components/ee-dict-select/src/index.vue.d.ts +19 -18
  20. package/es/components/ee-dict-select/type.d.ts +54 -0
  21. package/es/components/ee-form-dialog/src/index.vue.d.ts +108 -8
  22. package/es/components/ee-form-table/src/components/FormAuto.vue.d.ts +115 -0
  23. package/es/components/ee-form-table/src/components/FormDrawer.vue.d.ts +280 -7
  24. package/es/components/ee-form-table/src/components/TableToolbar.vue.d.ts +1 -0
  25. package/es/components/ee-form-table/src/constants.d.ts +2 -2
  26. package/es/components/ee-form-table/src/hooks/useCrud.d.ts +2 -0
  27. package/es/components/ee-form-table/src/hooks/useExport.d.ts +2 -0
  28. package/es/components/ee-form-table/src/hooks/useForm.d.ts +4 -2
  29. package/es/components/ee-form-table/src/index.vue.d.ts +13 -1
  30. package/es/components/ee-form-table/types.d.ts +41 -0
  31. package/es/components/ee-remote-select/index.d.ts +2 -0
  32. package/es/components/ee-remote-select/src/index.vue.d.ts +30 -0
  33. package/es/components/ee-remote-select/type.d.ts +53 -0
  34. package/es/components/ee-role-select/index.d.ts +2 -0
  35. package/es/components/ee-role-select/src/index.vue.d.ts +29 -0
  36. package/es/components/ee-role-select/type.d.ts +44 -0
  37. package/es/components/ee-search-bar/src/index.vue.d.ts +80 -10
  38. package/es/components/ee-status-tag/src/index.vue.d.ts +1 -1
  39. package/es/components/ee-user-select/index.d.ts +2 -0
  40. package/es/components/ee-user-select/src/index.vue.d.ts +29 -0
  41. package/es/components/ee-user-select/type.d.ts +46 -0
  42. package/es/hooks/index.d.ts +4 -0
  43. package/es/hooks/useRemoteSelectPagination.d.ts +68 -0
  44. package/es/hooks/useSelectEcho.d.ts +27 -0
  45. package/es/index.d.ts +49 -2
  46. package/es/index.mjs +2605 -966
  47. package/es/locale/en.d.ts +3 -0
  48. package/es/locale/index.d.ts +86 -0
  49. package/es/locale/useLocale.d.ts +13 -0
  50. package/es/locale/zh-cn.d.ts +3 -0
  51. package/es/style.css +1 -1
  52. package/es/utils/types.d.ts +39 -0
  53. package/lib/charts/BaseBar/index.d.ts +2 -0
  54. package/lib/charts/BaseBar/src/index.vue.d.ts +45 -0
  55. package/lib/charts/BaseLine/index.d.ts +2 -0
  56. package/lib/charts/BaseLine/src/index.vue.d.ts +47 -0
  57. package/lib/charts/BasePie/index.d.ts +2 -0
  58. package/lib/charts/BasePie/src/index.vue.d.ts +41 -0
  59. package/lib/charts/BaseRadar/index.d.ts +2 -0
  60. package/lib/charts/BaseRadar/src/index.vue.d.ts +47 -0
  61. package/lib/charts/config.d.ts +32 -0
  62. package/lib/charts/index.d.ts +8 -0
  63. package/lib/charts/useChart.d.ts +21 -0
  64. package/lib/components/ee-dept-cascader/index.d.ts +2 -0
  65. package/lib/components/ee-dept-cascader/src/index.vue.d.ts +26 -0
  66. package/lib/components/ee-dept-cascader/type.d.ts +39 -0
  67. package/lib/components/ee-dict-select/src/index.vue.d.ts +19 -18
  68. package/lib/components/ee-dict-select/type.d.ts +54 -0
  69. package/lib/components/ee-form-dialog/src/index.vue.d.ts +108 -8
  70. package/lib/components/ee-form-table/src/components/FormAuto.vue.d.ts +115 -0
  71. package/lib/components/ee-form-table/src/components/FormDrawer.vue.d.ts +280 -7
  72. package/lib/components/ee-form-table/src/components/TableToolbar.vue.d.ts +1 -0
  73. package/lib/components/ee-form-table/src/constants.d.ts +2 -2
  74. package/lib/components/ee-form-table/src/hooks/useCrud.d.ts +2 -0
  75. package/lib/components/ee-form-table/src/hooks/useExport.d.ts +2 -0
  76. package/lib/components/ee-form-table/src/hooks/useForm.d.ts +4 -2
  77. package/lib/components/ee-form-table/src/index.vue.d.ts +13 -1
  78. package/lib/components/ee-form-table/types.d.ts +41 -0
  79. package/lib/components/ee-remote-select/index.d.ts +2 -0
  80. package/lib/components/ee-remote-select/src/index.vue.d.ts +30 -0
  81. package/lib/components/ee-remote-select/type.d.ts +53 -0
  82. package/lib/components/ee-role-select/index.d.ts +2 -0
  83. package/lib/components/ee-role-select/src/index.vue.d.ts +29 -0
  84. package/lib/components/ee-role-select/type.d.ts +44 -0
  85. package/lib/components/ee-search-bar/src/index.vue.d.ts +80 -10
  86. package/lib/components/ee-status-tag/src/index.vue.d.ts +1 -1
  87. package/lib/components/ee-user-select/index.d.ts +2 -0
  88. package/lib/components/ee-user-select/src/index.vue.d.ts +29 -0
  89. package/lib/components/ee-user-select/type.d.ts +46 -0
  90. package/lib/hooks/index.d.ts +4 -0
  91. package/lib/hooks/useRemoteSelectPagination.d.ts +68 -0
  92. package/lib/hooks/useSelectEcho.d.ts +27 -0
  93. package/lib/index.cjs +1 -1
  94. package/lib/index.d.ts +49 -2
  95. package/lib/locale/en.d.ts +3 -0
  96. package/lib/locale/index.d.ts +86 -0
  97. package/lib/locale/useLocale.d.ts +13 -0
  98. package/lib/locale/zh-cn.d.ts +3 -0
  99. package/lib/style.css +1 -1
  100. package/lib/utils/types.d.ts +39 -0
  101. package/package.json +5 -2
package/LICENSE ADDED
@@ -0,0 +1,172 @@
1
+ Academic Free License ("AFL") v. 3.0
2
+
3
+ This Academic Free License (the "License") applies to any original work of
4
+ authorship (the "Original Work") whose owner (the "Licensor") has placed the
5
+ following licensing notice adjacent to the copyright notice for the Original
6
+ Work:
7
+
8
+ Licensed under the Academic Free License version 3.0
9
+
10
+ 1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free,
11
+ non-exclusive, sublicensable license, for the duration of the copyright, to do
12
+ the following:
13
+
14
+ a) to reproduce the Original Work in copies, either alone or as part of a
15
+ collective work;
16
+
17
+ b) to translate, adapt, alter, transform, modify, or arrange the Original
18
+ Work, thereby creating derivative works ("Derivative Works") based upon the
19
+ Original Work;
20
+
21
+ c) to distribute or communicate copies of the Original Work and Derivative
22
+ Works to the public, under any license of your choice that does not
23
+ contradict the terms and conditions, including Licensor's reserved rights
24
+ and remedies, in this Academic Free License;
25
+
26
+ d) to perform the Original Work publicly; and
27
+
28
+ e) to display the Original Work publicly.
29
+
30
+ 2) Grant of Patent License. Licensor grants You a worldwide, royalty-free,
31
+ non-exclusive, sublicensable license, under patent claims owned or controlled
32
+ by the Licensor that are embodied in the Original Work as furnished by the
33
+ Licensor, for the duration of the patents, to make, use, sell, offer for sale,
34
+ have made, and import the Original Work and Derivative Works.
35
+
36
+ 3) Grant of Source Code License. The term "Source Code" means the preferred
37
+ form of the Original Work for making modifications to it and all available
38
+ documentation describing how to modify the Original Work. Licensor agrees to
39
+ provide a machine-readable copy of the Source Code of the Original Work along
40
+ with each copy of the Original Work that Licensor distributes. Licensor
41
+ reserves the right to satisfy this obligation by placing a machine-readable
42
+ copy of the Source Code in an information repository reasonably calculated to
43
+ permit inexpensive and convenient access by You for as long as Licensor
44
+ continues to distribute the Original Work.
45
+
46
+ 4) Exclusions From License Grant. Neither the names of Licensor, nor the names
47
+ of any contributors to the Original Work, nor any of their trademarks or
48
+ service marks, may be used to endorse or promote products derived from this
49
+ Original Work without express prior permission of the Licensor. Except as
50
+ expressly stated herein, nothing in this License grants any license to
51
+ Licensor's trademarks, copyrights, patents, trade secrets or any other
52
+ intellectual property. No patent license is granted to make, use, sell, offer
53
+ for sale, have made, or import embodiments of any patent claims other than the
54
+ licensed claims defined in Section 2. No license is granted to the trademarks
55
+ of Licensor even if such marks are included in the Original Work. Nothing in
56
+ this License shall be interpreted to prohibit Licensor from licensing under
57
+ terms different from this License any Original Work that Licensor otherwise
58
+ would have a right to license.
59
+
60
+ 5) External Deployment. The term "External Deployment" means the use,
61
+ distribution, or communication of the Original Work or Derivative Works in any
62
+ way such that the Original Work or Derivative Works may be used by anyone
63
+ other than You, whether those works are distributed or communicated to those
64
+ persons or made available as an application intended for use over a network.
65
+ As an express condition for the grants of license hereunder, You must treat
66
+ any External Deployment by You of the Original Work or a Derivative Work as a
67
+ distribution under section 1(c).
68
+
69
+ 6) Attribution Rights. You must retain, in the Source Code of any Derivative
70
+ Works that You create, all copyright, patent, or trademark notices from the
71
+ Source Code of the Original Work, as well as any notices of licensing and any
72
+ descriptive text identified therein as an "Attribution Notice." You must cause
73
+ the Source Code for any Derivative Works that You create to carry a prominent
74
+ Attribution Notice reasonably calculated to inform recipients that You have
75
+ modified the Original Work.
76
+
77
+ 7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that
78
+ the copyright in and to the Original Work and the patent rights granted herein
79
+ by Licensor are owned by the Licensor or are sublicensed to You under the
80
+ terms of this License with the permission of the contributor(s) of those
81
+ copyrights and patent rights. Except as expressly stated in the immediately
82
+ preceding sentence, the Original Work is provided under this License on an "AS
83
+ IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without
84
+ limitation, the warranties of non-infringement, merchantability or fitness for
85
+ a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK
86
+ IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this
87
+ License. No license to the Original Work is granted by this License except
88
+ under this disclaimer.
89
+
90
+ 8) Limitation of Liability. Under no circumstances and under no legal theory,
91
+ whether in tort (including negligence), contract, or otherwise, shall the
92
+ Licensor be liable to anyone for any indirect, special, incidental, or
93
+ consequential damages of any character arising as a result of this License or
94
+ the use of the Original Work including, without limitation, damages for loss
95
+ of goodwill, work stoppage, computer failure or malfunction, or any and all
96
+ other commercial damages or losses. This limitation of liability shall not
97
+ apply to the extent applicable law prohibits such limitation.
98
+
99
+ 9) Acceptance and Termination. If, at any time, You expressly assented to this
100
+ License, that assent indicates your clear and irrevocable acceptance of this
101
+ License and all of its terms and conditions. If You distribute or communicate
102
+ copies of the Original Work or a Derivative Work, You must make a reasonable
103
+ effort under the circumstances to obtain the express assent of recipients to
104
+ the terms of this License. This License conditions your rights to undertake
105
+ the activities listed in Section 1, including your right to create Derivative
106
+ Works based upon the Original Work, and doing so without honoring these terms
107
+ and conditions is prohibited by copyright law and international treaty.
108
+ Nothing in this License is intended to affect copyright exceptions and
109
+ limitations (including "fair use" or "fair dealing"). This License shall
110
+ terminate immediately and You may no longer exercise any of the rights granted
111
+ to You by this License upon your failure to honor the conditions in Section
112
+ 1(c).
113
+
114
+ 10) Termination for Patent Action. This License shall terminate automatically
115
+ and You may no longer exercise any of the rights granted to You by this
116
+ License as of the date You commence an action, including a cross-claim or
117
+ counterclaim, against Licensor or any licensee alleging that the Original Work
118
+ infringes a patent. This termination provision shall not apply for an action
119
+ alleging patent infringement by combinations of the Original Work with other
120
+ software or hardware.
121
+
122
+ 11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this
123
+ License may be brought only in the courts of a jurisdiction wherein the
124
+ Licensor resides or in which Licensor conducts its primary business, and under
125
+ the laws of that jurisdiction excluding its conflict-of-law provisions. The
126
+ application of the United Nations Convention on Contracts for the
127
+ International Sale of Goods is expressly excluded. Any use of the Original
128
+ Work outside the scope of this License or after its termination shall be
129
+ subject to the requirements and penalties of copyright or patent law in the
130
+ appropriate jurisdiction. This section shall survive the termination of this
131
+ License.
132
+
133
+ 12) Attorneys' Fees. In any action to enforce the terms of this License or
134
+ seeking damages relating thereto, the prevailing party shall be entitled to
135
+ recover its costs and expenses, including, without limitation, reasonable
136
+ attorneys' fees and costs incurred in connection with such action, including
137
+ any appeal of such action. This section shall survive the termination of this
138
+ License.
139
+
140
+ 13) Miscellaneous. If any provision of this License is held to be
141
+ unenforceable, such provision shall be reformed only to the extent necessary
142
+ to make it enforceable.
143
+
144
+ 14) Definition of "You" in This License. "You" throughout this License,
145
+ whether in upper or lower case, means an individual or a legal entity
146
+ exercising rights under, and complying with all of the terms of, this License.
147
+ For legal entities, "You" includes any entity that controls, is controlled by,
148
+ or is under common control with you. For purposes of this definition,
149
+ "control" means (i) the power, direct or indirect, to cause the direction or
150
+ management of such entity, whether by contract or otherwise, or (ii) ownership
151
+ of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial
152
+ ownership of such entity.
153
+
154
+ 15) Right to Use. You may use the Original Work in all ways not otherwise
155
+ restricted or conditioned by this License or by law, and Licensor promises not
156
+ to interfere with or be responsible for such uses by You.
157
+
158
+ 16) Modification of This License. This License is Copyright © 2005 Lawrence
159
+ Rosen. Permission is granted to copy, distribute, or communicate this License
160
+ without modification. Nothing in this License permits You to modify this
161
+ License as applied to the Original Work or to Derivative Works. However, You
162
+ may modify the text of this License and copy, distribute or communicate your
163
+ modified version (the "Modified License") and apply it to other original works
164
+ of authorship subject to the following conditions: (i) You may not indicate in
165
+ any way that your Modified License is the "Academic Free License" or "AFL" and
166
+ you may not use those names in the name of your Modified License; (ii) You
167
+ must replace the notice specified in the first paragraph above with the notice
168
+ "Licensed under <insert your license name here>" or with a notice of your own
169
+ that is not confusingly similar to the notice in this License; and (iii) You
170
+ may not claim that your original works are open source software unless your
171
+ Modified License has been approved by Open Source Initiative (OSI) and You
172
+ comply with its license review and certification process.
package/README.md CHANGED
@@ -1,8 +1,14 @@
1
1
  # Easy EP UI
2
2
 
3
- Enterprise Element Plus 二次封装组件库。
3
+ 基于 Vue3 + TypeScript + Element Plus 的企业级二次封装组件库,面向高频 CRUD 场景,开箱即用。
4
4
 
5
- 基于 Vue3 + TypeScript + Element Plus 的企业级复合组件库,面向高频 CRUD 场景,开箱即用。
5
+ ## 特性
6
+
7
+ - 🚀 基于 Vue3 + TypeScript + Element Plus 构建
8
+ - 📦 支持全量引入和按需引入,Tree-shaking 友好
9
+ - 🌐 内置国际化支持(中英文)
10
+ - 🛠️ 面向企业高频 CRUD 场景设计
11
+ - 📚 完整的 TypeScript 类型定义
6
12
 
7
13
  ## 安装
8
14
 
@@ -10,9 +16,11 @@ Enterprise Element Plus 二次封装组件库。
10
16
  npm install easy-ep-ui
11
17
  # or
12
18
  yarn add easy-ep-ui
19
+ # or
20
+ pnpm add easy-ep-ui
13
21
  ```
14
22
 
15
- ## 使用
23
+ ## 快速开始
16
24
 
17
25
  ### 全量引入
18
26
 
@@ -47,18 +55,25 @@ app.mount('#app')
47
55
 
48
56
  ## 组件列表
49
57
 
50
- | 组件名 | 描述 |
58
+ | 组件 | 说明 |
51
59
  | --- | --- |
52
- | EeDictSelect | 字典下拉选择,支持静态数据与异步请求 |
53
- | EeStatusTag | 状态标签,值到颜色/文本的自动映射 |
54
- | EeSearchBar | 搜索栏,多字段搜索、折叠展开、一键重置 |
55
- | EeFormDialog | 弹窗表单,集成表单验证与提交流程 |
56
- | EeFormTable | 查询表格,搜索+表格+分页一体化 |
60
+ | `EeDictSelect` | 字典下拉选择,支持静态数据与异步请求 |
61
+ | `EeStatusTag` | 状态标签,值到颜色/文本的自动映射 |
62
+ | `EeSearchBar` | 搜索栏,多字段搜索、折叠展开、一键重置 |
63
+ | `EeFormDialog` | 弹窗表单,集成表单验证与提交流程 |
64
+ | `EeFormTable` | 查询表格,搜索+表格+分页一体化 |
65
+ | `EeDeptCascader` | 部门树形级联选择 |
66
+ | `EeRemoteSelect` | 通用远程下拉组件 |
67
+ | `EeRoleSelect` | 角色选择 |
68
+ | `EeUserSelect` | 人员选择 |
57
69
 
58
70
  ## 本地开发
59
71
 
60
72
  ```bash
61
- # 文档开发
73
+ # 安装依赖
74
+ npm install
75
+
76
+ # 启动文档开发服务器
62
77
  npm run docs:dev
63
78
 
64
79
  # 构建组件库
@@ -71,16 +86,16 @@ npm run docs:build
71
86
  ## 发布
72
87
 
73
88
  ```bash
74
- # 小修复版本
89
+ # 补丁版本 (0.0.x)
75
90
  npm run pub:patch
76
91
 
77
- # 新增功能版本
92
+ # 小版本 (0.x.0)
78
93
  npm run pub:minor
79
94
 
80
- # 大版本重构
95
+ # 大版本 (x.0.0)
81
96
  npm run pub:major
82
97
  ```
83
98
 
84
99
  ## License
85
100
 
86
- MIT
101
+ MIT
@@ -1 +1 @@
1
- (function(E,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus"],e):(E=typeof globalThis<"u"?globalThis:E||self,e(E.EasyEpUI={},E.Vue,E.ElementPlus))})(this,function(E,e,l){"use strict";const U=e.defineComponent({name:"EeDictSelect",__name:"index",props:{modelValue:{},options:{},request:{},valueField:{default:"value"},labelField:{default:"label"},size:{default:"default"}},emits:["update:modelValue","change","clear","focus","blur"],setup(t,{emit:r}){const o=t,a=r,i=e.ref(!1),f=e.ref([]),p=e.computed(()=>(o.options??f.value).map(m=>({value:String(m[o.valueField]??""),label:String(m[o.labelField]??""),disabled:m.disabled??!1})));async function w(){if(!o.options&&o.request){i.value=!0;try{f.value=await o.request()}finally{i.value=!1}}}return e.onMounted(w),e.watch(()=>o.request,w),(b,m)=>(e.openBlock(),e.createBlock(e.unref(l.ElSelect),e.mergeProps(b.$attrs,{"model-value":t.modelValue,loading:i.value,size:t.size,"onUpdate:modelValue":m[0]||(m[0]=n=>a("update:modelValue",n)),onChange:m[1]||(m[1]=n=>a("change",n)),onClear:m[2]||(m[2]=n=>a("clear")),onFocus:m[3]||(m[3]=n=>a("focus",n)),onBlur:m[4]||(m[4]=n=>a("blur",n))}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,n=>(e.openBlock(),e.createBlock(e.unref(l.ElOption),{key:n.value,label:n.label,value:n.value,disabled:n.disabled},null,8,["label","value","disabled"]))),128))]),_:1},16,["model-value","loading","size"]))}});U.install=t=>{t.component(U.name??"EeDictSelect",U)};const R=e.defineComponent({name:"EeStatusTag",__name:"index",props:{value:{},mapping:{},fallbackLabel:{},defaultType:{default:"info"},defaultEffect:{default:"light"}},setup(t){const r=t,o=e.computed(()=>r.mapping.find(a=>a.value===r.value));return(a,i)=>{var f,p;return e.openBlock(),e.createBlock(e.unref(l.ElTag),e.mergeProps(a.$attrs,{type:((f=o.value)==null?void 0:f.type)??t.defaultType,effect:((p=o.value)==null?void 0:p.effect)??t.defaultEffect}),{default:e.withCtx(()=>{var w;return[e.createTextVNode(e.toDisplayString(((w=o.value)==null?void 0:w.label)??t.fallbackLabel??t.value),1)]}),_:1},16,["type","effect"])}}});R.install=t=>{t.component(R.name??"EeStatusTag",R)};const re={class:"ee-search-bar"},ie=e.defineComponent({name:"EeSearchBar",__name:"index",props:{modelValue:{},fields:{},inline:{type:Boolean,default:!0},labelWidth:{default:"auto"},collapsible:{type:Boolean,default:!1},collapsedCount:{default:3},size:{default:"default"}},emits:["update:modelValue","search","reset"],setup(t,{emit:r}){const o=t,a=r,i=e.ref(),f=e.ref(!1),p=e.computed(()=>{const c=24-w.value.reduce((s,h)=>s+(h.span??6),0)%24;return c===24?6:c}),w=e.computed(()=>!o.collapsible||f.value?o.fields:o.fields.slice(0,o.collapsedCount));function b(){a("search",{...o.modelValue})}function m(){const n={};o.fields.forEach(c=>{n[c.prop]=""}),a("update:modelValue",n),a("reset")}return(n,c)=>(e.openBlock(),e.createElementBlock("div",re,[e.createVNode(e.unref(l.ElForm),e.mergeProps({ref_key:"formRef",ref:i,model:t.modelValue,inline:t.inline,"label-width":t.labelWidth,size:t.size},n.$attrs),{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElRow),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,s=>(e.openBlock(),e.createBlock(e.unref(l.ElCol),{key:s.prop,span:s.span??6},{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElFormItem),{label:s.label,prop:s.prop},{default:e.withCtx(()=>[(s.type??"input")==="input"?(e.openBlock(),e.createBlock(e.unref(l.ElInput),{key:0,modelValue:t.modelValue[s.prop],"onUpdate:modelValue":h=>t.modelValue[s.prop]=h,placeholder:s.placeholder??`请输入${s.label}`,clearable:""},null,8,["modelValue","onUpdate:modelValue","placeholder"])):s.type==="select"?(e.openBlock(),e.createBlock(e.unref(l.ElSelect),{key:1,modelValue:t.modelValue[s.prop],"onUpdate:modelValue":h=>t.modelValue[s.prop]=h,placeholder:s.placeholder??`请选择${s.label}`,clearable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.options??[],h=>(e.openBlock(),e.createBlock(e.unref(l.ElOption),{key:h.value,label:h.label,value:h.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder"])):s.type==="date"?(e.openBlock(),e.createBlock(e.unref(l.ElDatePicker),{key:2,modelValue:t.modelValue[s.prop],"onUpdate:modelValue":h=>t.modelValue[s.prop]=h,placeholder:s.placeholder??`请选择${s.label}`,style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","placeholder"])):s.type==="date-range"?(e.openBlock(),e.createBlock(e.unref(l.ElDatePicker),{key:3,modelValue:t.modelValue[s.prop],"onUpdate:modelValue":h=>t.modelValue[s.prop]=h,type:"daterange","range-separator":s.placeholder??"至","start-placeholder":s.placeholder??"开始日期","end-placeholder":s.placeholder??"结束日期",style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","range-separator","start-placeholder","end-placeholder"])):s.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.component),{key:4,modelValue:t.modelValue[s.prop],"onUpdate:modelValue":h=>t.modelValue[s.prop]=h},null,8,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)]),_:2},1032,["label","prop"])]),_:2},1032,["span"]))),128)),e.createVNode(e.unref(l.ElCol),{span:p.value},{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElButton),{type:"primary",size:t.size,round:"",onClick:b},{default:e.withCtx(()=>[...c[1]||(c[1]=[e.createTextVNode(" 搜索 ",-1)])]),_:1},8,["size"]),e.createVNode(e.unref(l.ElButton),{size:t.size,round:"",onClick:m},{default:e.withCtx(()=>[...c[2]||(c[2]=[e.createTextVNode(" 重置 ",-1)])]),_:1},8,["size"]),t.collapsible&&t.fields.length>t.collapsedCount?(e.openBlock(),e.createBlock(e.unref(l.ElButton),{key:0,text:"",size:t.size,onClick:c[0]||(c[0]=s=>f.value=!f.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.value?"收起":"展开"),1)]),_:1},8,["size"])):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["span"])]),_:1})]),_:1},16,["model","inline","label-width","size"])]))}}),X=(t,r)=>{const o=t.__vccOpts||t;for(const[a,i]of r)o[a]=i;return o},A=X(ie,[["__scopeId","data-v-b65c74a4"]]);A.install=t=>{t.component(A.name??"EeSearchBar",A)};const ce={class:"ee-form-dialog-footer"},I=X(e.defineComponent({name:"EeFormDialog",__name:"index",props:{modelValue:{type:Boolean},title:{default:"表单"},formData:{},fields:{},rules:{},width:{default:"600px"},labelWidth:{default:"auto"},loading:{type:Boolean,default:!1},size:{default:"default"}},emits:["update:modelValue","submit","cancel"],setup(t,{emit:r}){const o=t,a=r,i=e.ref(),f=e.computed(()=>{const b={};for(const m of Object.keys(o))["modelValue","title","formData","fields","rules","width","labelWidth","loading"].includes(m)||(b[m]=o[m]);return b});function p(){a("update:modelValue",!1),a("cancel")}async function w(){if(i.value)try{await i.value.validate(),a("submit",{...o.formData})}catch{}}return(b,m)=>(e.openBlock(),e.createBlock(e.unref(l.ElDialog),e.mergeProps(b.$attrs,{"model-value":t.modelValue,title:t.title,width:t.width,"onUpdate:modelValue":m[0]||(m[0]=n=>a("update:modelValue",n)),onClose:p}),{footer:e.withCtx(()=>[e.createElementVNode("span",ce,[e.createVNode(e.unref(l.ElButton),{size:t.size,round:"",onClick:p},{default:e.withCtx(()=>[...m[1]||(m[1]=[e.createTextVNode("取消",-1)])]),_:1},8,["size"]),e.createVNode(e.unref(l.ElButton),{type:"primary",size:t.size,round:"",loading:t.loading,onClick:w},{default:e.withCtx(()=>[...m[2]||(m[2]=[e.createTextVNode(" 确定 ",-1)])]),_:1},8,["size","loading"])])]),default:e.withCtx(()=>[e.createVNode(e.unref(l.ElForm),e.mergeProps({ref_key:"formRef",ref:i,model:t.formData,rules:t.rules,"label-width":t.labelWidth,size:t.size},f.value),{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElRow),{gutter:20},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fields,n=>(e.openBlock(),e.createBlock(e.unref(l.ElCol),{key:n.prop,span:n.span??24},{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElFormItem),{label:n.label,prop:n.prop},{default:e.withCtx(()=>[(n.type??"input")==="input"?(e.openBlock(),e.createBlock(e.unref(l.ElInput),{key:0,modelValue:t.formData[n.prop],"onUpdate:modelValue":c=>t.formData[n.prop]=c,placeholder:n.placeholder??`请输入${n.label}`},null,8,["modelValue","onUpdate:modelValue","placeholder"])):n.type==="textarea"?(e.openBlock(),e.createBlock(e.unref(l.ElInput),{key:1,modelValue:t.formData[n.prop],"onUpdate:modelValue":c=>t.formData[n.prop]=c,type:"textarea",placeholder:n.placeholder??`请输入${n.label}`,rows:3},null,8,["modelValue","onUpdate:modelValue","placeholder"])):n.type==="select"?(e.openBlock(),e.createBlock(e.unref(l.ElSelect),{key:2,modelValue:t.formData[n.prop],"onUpdate:modelValue":c=>t.formData[n.prop]=c,placeholder:n.placeholder??`请选择${n.label}`,style:{width:"100%"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.options??[],c=>(e.openBlock(),e.createBlock(e.unref(l.ElOption),{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder"])):n.type==="radio"?(e.openBlock(),e.createBlock(e.unref(l.ElRadioGroup),{key:3,modelValue:t.formData[n.prop],"onUpdate:modelValue":c=>t.formData[n.prop]=c},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.options??[],c=>(e.openBlock(),e.createBlock(e.unref(l.ElRadio),{key:c.value,label:c.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.label),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])):n.type==="checkbox"?(e.openBlock(),e.createBlock(e.unref(l.ElCheckboxGroup),{key:4,modelValue:t.formData[n.prop],"onUpdate:modelValue":c=>t.formData[n.prop]=c},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.options??[],c=>(e.openBlock(),e.createBlock(e.unref(l.ElCheckbox),{key:c.value,label:c.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.label),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])):n.type==="switch"?(e.openBlock(),e.createBlock(e.unref(l.ElSwitch),{key:5,modelValue:t.formData[n.prop],"onUpdate:modelValue":c=>t.formData[n.prop]=c},null,8,["modelValue","onUpdate:modelValue"])):n.type==="date"?(e.openBlock(),e.createBlock(e.unref(l.ElDatePicker),{key:6,modelValue:t.formData[n.prop],"onUpdate:modelValue":c=>t.formData[n.prop]=c,placeholder:n.placeholder??`请选择${n.label}`,style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","placeholder"])):n.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.component),{key:7,modelValue:t.formData[n.prop],"onUpdate:modelValue":c=>t.formData[n.prop]=c},null,8,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)]),_:2},1032,["label","prop"])]),_:2},1032,["span"]))),128))]),_:1})]),_:1},16,["model","rules","label-width","size"])]),_:1},16,["model-value","title","width"]))}}),[["__scopeId","data-v-560e642c"]]);I.install=t=>{t.component(I.name??"EeFormDialog",I)};const Y=[10,20,50,100],de="total, sizes, prev, pager, next, jumper",Z={show:!0,cols:3,maxRow:2,foldable:!0,foldDefault:!0},J={show:!1},G={show:!0,pageSize:20,pageSizes:Y,background:!0},se={show:!1},Q={show:!0,showView:!1,showEdit:!0,showDelete:!0,confirmDelete:!0,deleteConfirmTitle:"确认删除",deleteConfirmMessage:"确定要删除该条数据吗?"},P={show:!1},fe={show:!0,showAdd:!1,showImport:!1,showExport:!1,showBatchDelete:!1},_={show:!1},me={mode:"drawer",width:"40%",closeOnReset:!0,addTitle:"新增",editTitle:"编辑"},ue=["data","loading","size","stripe","border","height","max-height","highlight-current-row","row-key"],ge=["prop","label","width","minWidth","align","fixed","sortable","show","formatter","dictKey","slotName","search","auth","children","className"];function he(t){const r=e.computed(()=>!!t.authChecker);function o(a){return!a||!t.authChecker?!0:t.authChecker(a)}return{authPass:o,authEnabled:r}}function pe(t){function r(a,i){var f;return a||(i&&((f=t.dictMap)!=null&&f[i])?t.dictMap[i]:[])}function o(a,i){var p;if(!a||!((p=t.dictMap)!=null&&p[a]))return String(i??"");const f=t.dictMap[a].find(w=>w.value===i);return(f==null?void 0:f.label)??String(i??"")}return{resolvedDict:r,dictLabel:o}}function Ce(t){const r=e.ref(!0),o=e.reactive({}),a=e.computed(()=>t.searchConfig===!1?J:t.searchConfig===!0?{...Z}:t.searchConfig?{...Z,...t.searchConfig}:J),i=e.computed(()=>a.value.show),f=e.computed(()=>a.value.cols||3),p=e.computed(()=>t.columns.filter(u=>{var k;return(k=u.search)==null?void 0:k.enable}).map(u=>{const k=u.search;return{...k,prop:u.prop,label:u.label,field:k.field||u.prop,placeholder:k.placeholder||u.label,dictKey:u.dictKey,props:k.props||{}}})),w=e.computed(()=>a.value.maxRow||2),b=e.computed(()=>f.value*w.value),m=e.computed(()=>a.value.foldable!==!1&&p.value.length>b.value);e.onMounted(()=>{a.value.foldDefault!==!1&&(r.value=!1)});const n=e.computed(()=>!r.value&&m.value?p.value.slice(0,b.value):p.value),c=e.computed(()=>24/f.value);function s(){p.value.forEach(u=>{o[u.field]=u.defaultValue??""})}function h(){const u={};return p.value.forEach(k=>{u[k.field]=k.defaultValue??""}),u}function x(){const u={};for(const[k,S]of Object.entries(o))S!==""&&S!==null&&S!==void 0&&(u[k]=S);return u}function z(){Object.assign(o,h())}function D(){r.value=!r.value}return{searchExpanded:r,searchParams:o,searchCfg:a,showSearch:i,searchCols:f,allSearchFields:p,visibleSearchFields:n,showFoldBtn:m,actionColSpan:c,initSearchParams:s,getDefaultSearchParams:h,getActiveSearchParams:x,resetSearchParams:z,toggleFold:D}}function ke(t){const r=e.reactive({current:1,pageSize:20,total:0}),o=e.computed(()=>t.pagination===!1?se:t.pagination===!0?{...G}:t.pagination?{...G,...t.pagination}:{...G,show:!0}),a=e.computed(()=>o.value.show!==!1),i=e.computed(()=>o.value.pageSizes||Y),f=e.computed(()=>o.value.layout||de),p=e.computed(()=>o.value.background!==!1);e.onMounted(()=>{t.pagination&&typeof t.pagination=="object"&&(t.pagination.pageSize&&(r.pageSize=t.pagination.pageSize),t.pagination.total!==void 0&&(r.total=t.pagination.total))}),e.watch(()=>t.pagination,n=>{typeof n=="object"&&n&&(n.total!==void 0&&(r.total=n.total),n.pageSize&&(r.pageSize=n.pageSize))},{deep:!0});function w(n){r.current=n}function b(n){r.pageSize=n}function m(){r.current=1}return{pageState:r,paginationCfg:o,showPagination:a,pageSizesComputed:i,paginationLayoutComputed:f,paginationBgComputed:p,setPage:w,setPageSize:b,resetPage:m}}function we(t,r){const o=e.ref(),a=e.ref([]),i=e.ref(null),f=e.ref(!1),p=e.ref([]),w=e.computed(()=>({show:!1,type:"multiple",reserveSelection:!1,...t.selectionConfig})),b=e.computed(()=>({show:!1,...t.columnSetting})),m=e.computed(()=>b.value.show),n=e.computed(()=>t.columns.filter(u=>u.prop));e.onMounted(()=>{p.value=n.value.map(u=>u.prop)}),e.watch(()=>t.columns,()=>{p.value=[...new Set([...p.value.filter(u=>n.value.some(k=>k.prop===u)),...n.value.map(u=>u.prop)])]},{deep:!0});const c=e.computed(()=>n.value.filter(u=>u.show!==!1&&p.value.includes(u.prop)&&r.authPass(u.auth))),s=e.computed(()=>t.tableHeight||void 0),h=e.computed(()=>t.tableMaxHeight||void 0),x=e.computed(()=>t.autoHeight?{minHeight:`calc(100vh - ${(typeof t.autoHeight=="object"?t.autoHeight:{}).offset||200}px)`}:{});function z(u){a.value=u}function D(u){const k=t.rowKey||"id";i.value=u[k],a.value=[u]}return{tableRef:o,selection:a,singleSelection:i,columnSettingVisible:f,checkedColumns:p,selectionCfg:w,columnSettingCfg:b,showColumnSetting:m,allColumns:n,visibleColumns:c,tableComputedHeight:s,tableMaxHeightProp:h,tableWrapperStyle:x,handleSelectionChange:z,handleSingleSelect:D}}function be(t,r){const o=e.ref([]),a=e.ref(!1),i=e.computed(()=>{var c;return!!((c=t.crudConfig)!=null&&c.api.list)});async function f(){var c;if((c=t.crudConfig)!=null&&c.api.list){a.value=!0;try{const s={page:r.pageState.current,pageSize:r.pageState.pageSize,...t.crudConfig.baseParams},h=r.getActiveSearchParams();Object.assign(s,h);const x=await t.crudConfig.api.list(s);o.value=x.data||[],r.setTotal(x.total??0)}catch(s){r.emit("request-error",s),l.ElMessage.error((s==null?void 0:s.message)||"请求失败")}finally{a.value=!1}}}async function p(){r.resetPage(),await f()}async function w(c){var s;if(!((s=t.crudConfig)!=null&&s.api.delete)){r.emit("delete",c);return}a.value=!0;try{const h=c[t.rowKey||"id"];await t.crudConfig.api.delete(h),l.ElMessage.success("删除成功"),r.emit("delete-success"),await f()}catch(h){r.emit("request-error",h),l.ElMessage.error((h==null?void 0:h.message)||"删除失败")}finally{a.value=!1}}async function b(c,s,h,x){if(!s){await w(c);return}try{await l.ElMessageBox.confirm(x||"确定要删除该条数据吗?",h||"确认删除",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}),await w(c)}catch{}}async function m(c){var s;if(!((s=t.crudConfig)!=null&&s.api.batchDelete)){r.emit("batch-delete",c);return}a.value=!0;try{await t.crudConfig.api.batchDelete(c),l.ElMessage.success("批量删除成功"),r.emit("batch-delete-success"),r.selection.value=[],await f()}catch(h){r.emit("request-error",h),l.ElMessage.error((h==null?void 0:h.message)||"批量删除失败")}finally{a.value=!1}}async function n(){const c=r.selection.value;if(c.length!==0)try{await l.ElMessageBox.confirm(`确定要删除选中的 ${c.length} 条数据吗?`,"确认批量删除",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});const s=c.map(h=>h[t.rowKey||"id"]);await m(s)}catch{}}return{internalData:o,loadingState:a,hasCrud:i,fetchData:f,refreshTable:p,doDelete:w,handleDelete:b,doBatchDelete:m,handleBatchDelete:n}}function ye(t){const r=e.ref(!1),o=e.ref(!1),a=e.ref(null),i=e.ref({}),f=e.ref(!1),p={...me,...t.drawerConfig},w=p.mode||"drawer";function b(){o.value=!1,a.value=null,i.value={},r.value=!0}function m(c){o.value=!0,a.value=c,i.value={...c},r.value=!0}function n(){r.value=!1}return{formVisible:r,isEditing:o,editingRow:a,formData:i,saving:f,drawerMode:w,drawerCfg:p,openAdd:b,openEdit:m,closeForm:n}}function Be(t,r){const o=e.ref(!1);async function a(){var i,f,p,w,b;o.value=!0,r.setLoading(!0);try{const m=await import("xlsx").catch(()=>null);if(!m){l.ElMessage.warning("请安装 xlsx 依赖: npm install xlsx");return}const n=((i=t.exportConfig)==null?void 0:i.mode)||"current";let c;if(n==="all"&&((p=(f=t.crudConfig)==null?void 0:f.api)!=null&&p.list)){const u={page:1,pageSize:99999,...t.crudConfig.baseParams},k=r.getActiveSearchParams();Object.assign(u,k),c=(await t.crudConfig.api.list(u)).data||[]}else c=[...r.getCurrentData()];const s=((w=t.exportConfig)==null?void 0:w.ignoreColumn)||[],h=r.visibleColumns.value.filter(u=>!s.includes(u.prop)).map(u=>({prop:u.prop,label:u.label})),x=[h.map(u=>u.label),...c.map(u=>h.map(k=>{var O;if(k.prop==="action")return"";const S=(O=t.columns.find(j=>j.prop===k.prop))==null?void 0:O.dictKey;return S?r.dictLabel(S,u[k.prop]):u[k.prop]??""}))],z=m.utils.aoa_to_sheet(x),D=m.utils.book_new();m.utils.book_append_sheet(D,z,"Sheet1"),m.writeFile(D,((b=t.exportConfig)==null?void 0:b.fileName)||"export.xlsx"),l.ElMessage.success("导出成功")}catch(m){l.ElMessage.error((m==null?void 0:m.message)||"导出失败")}finally{r.setLoading(!1),o.value=!1}}return{handleExport:a,exporting:o}}const Ve={key:0,class:"ee-search-area"},Ee=e.defineComponent({__name:"SearchArea",props:{showSearch:{type:Boolean},searchParams:{},visibleSearchFields:{},searchCols:{},actionColSpan:{},showFoldBtn:{type:Boolean},searchExpanded:{type:Boolean},size:{},resolveDict:{type:Function}},emits:["search","reset","toggle-fold"],setup(t){return(r,o)=>t.showSearch?(e.openBlock(),e.createElementBlock("div",Ve,[e.createVNode(e.unref(l.ElForm),{model:t.searchParams,"label-width":"auto",size:t.size},{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElRow),{gutter:12},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.visibleSearchFields,a=>(e.openBlock(),e.createBlock(e.unref(l.ElCol),{key:String(a.prop),span:24/t.searchCols},{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElFormItem),{label:String(a.label)},{default:e.withCtx(()=>[a.type==="input"?(e.openBlock(),e.createBlock(e.unref(l.ElInput),e.mergeProps({key:0,modelValue:t.searchParams[a.field],"onUpdate:modelValue":i=>t.searchParams[a.field]=i,placeholder:String(a.placeholder||`请输入${a.label}`),clearable:""},{ref_for:!0},a.props||{}),null,16,["modelValue","onUpdate:modelValue","placeholder"])):a.type==="number"?(e.openBlock(),e.createBlock(e.unref(l.ElInputNumber),e.mergeProps({key:1,modelValue:t.searchParams[a.field],"onUpdate:modelValue":i=>t.searchParams[a.field]=i,placeholder:String(a.placeholder||`请输入${a.label}`),style:{width:"100%"}},{ref_for:!0},a.props||{}),null,16,["modelValue","onUpdate:modelValue","placeholder"])):a.type==="select"?(e.openBlock(),e.createBlock(e.unref(l.ElSelect),e.mergeProps({key:2,modelValue:t.searchParams[a.field],"onUpdate:modelValue":i=>t.searchParams[a.field]=i,placeholder:String(a.placeholder||`请选择${a.label}`),clearable:"",style:{width:"100%"}},{ref_for:!0},a.props||{}),{default:e.withCtx(()=>{var i;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.resolveDict((i=a.props)==null?void 0:i.options,a.dictKey),f=>(e.openBlock(),e.createBlock(e.unref(l.ElOption),{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]}),_:2},1040,["modelValue","onUpdate:modelValue","placeholder"])):a.type==="radio"?(e.openBlock(),e.createBlock(e.unref(l.ElRadioGroup),e.mergeProps({key:3,modelValue:t.searchParams[a.field],"onUpdate:modelValue":i=>t.searchParams[a.field]=i},{ref_for:!0},a.props||{}),{default:e.withCtx(()=>{var i;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.resolveDict((i=a.props)==null?void 0:i.options,a.dictKey),f=>(e.openBlock(),e.createBlock(e.unref(l.ElRadio),{key:f.value,value:f.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.label),1)]),_:2},1032,["value"]))),128))]}),_:2},1040,["modelValue","onUpdate:modelValue"])):a.type==="checkbox"?(e.openBlock(),e.createBlock(e.unref(l.ElCheckboxGroup),e.mergeProps({key:4,modelValue:t.searchParams[a.field],"onUpdate:modelValue":i=>t.searchParams[a.field]=i},{ref_for:!0},a.props||{}),{default:e.withCtx(()=>{var i;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.resolveDict((i=a.props)==null?void 0:i.options,a.dictKey),f=>(e.openBlock(),e.createBlock(e.unref(l.ElCheckbox),{key:f.value,value:f.value,label:f.label},null,8,["value","label"]))),128))]}),_:2},1040,["modelValue","onUpdate:modelValue"])):a.type==="date"?(e.openBlock(),e.createBlock(e.unref(l.ElDatePicker),e.mergeProps({key:5,modelValue:t.searchParams[a.field],"onUpdate:modelValue":i=>t.searchParams[a.field]=i,placeholder:String(a.placeholder||`请选择${a.label}`),style:{width:"100%"}},{ref_for:!0},a.props||{}),null,16,["modelValue","onUpdate:modelValue","placeholder"])):a.type==="date-range"?(e.openBlock(),e.createBlock(e.unref(l.ElDatePicker),e.mergeProps({key:6,modelValue:t.searchParams[a.field],"onUpdate:modelValue":i=>t.searchParams[a.field]=i,type:"daterange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期",style:{width:"100%"}},{ref_for:!0},a.props||{}),null,16,["modelValue","onUpdate:modelValue"])):a.type==="textarea"?(e.openBlock(),e.createBlock(e.unref(l.ElInput),e.mergeProps({key:7,modelValue:t.searchParams[a.field],"onUpdate:modelValue":i=>t.searchParams[a.field]=i,placeholder:String(a.placeholder||`请输入${a.label}`),type:"textarea"},{ref_for:!0},a.props||{}),null,16,["modelValue","onUpdate:modelValue","placeholder"])):e.createCommentVNode("",!0)]),_:2},1032,["label"])]),_:2},1032,["span"]))),128)),e.createVNode(e.unref(l.ElCol),{span:t.actionColSpan},{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElButton),{type:"primary",round:"",onClick:o[0]||(o[0]=a=>r.$emit("search"))},{default:e.withCtx(()=>[...o[3]||(o[3]=[e.createTextVNode("查询",-1)])]),_:1}),e.createVNode(e.unref(l.ElButton),{round:"",onClick:o[1]||(o[1]=a=>r.$emit("reset"))},{default:e.withCtx(()=>[...o[4]||(o[4]=[e.createTextVNode("重置",-1)])]),_:1}),t.showFoldBtn?(e.openBlock(),e.createBlock(e.unref(l.ElButton),{key:0,text:"",size:t.size,onClick:o[2]||(o[2]=a=>r.$emit("toggle-fold"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.searchExpanded?"收起":"展开"),1)]),_:1},8,["size"])):e.createCommentVNode("",!0),e.renderSlot(r.$slots,"search-action",{params:t.searchParams})]),_:3})]),_:3},8,["span"])]),_:3})]),_:3},8,["model","size"])])):e.createCommentVNode("",!0)}}),xe={key:0,class:"ee-toolbar"},Se={class:"ee-toolbar-left"},ze={class:"ee-toolbar-right"},De=e.defineComponent({__name:"TableToolbar",props:{show:{type:Boolean},toolbarCfg:{},size:{},deps:{}},emits:["add","import","export","batch-delete","refresh","column-setting"],setup(t){return(r,o)=>t.show?(e.openBlock(),e.createElementBlock("div",xe,[e.createElementVNode("div",Se,[t.toolbarCfg.showAdd&&t.deps.authPass(t.toolbarCfg.addAuth)?(e.openBlock(),e.createBlock(e.unref(l.ElButton),{key:0,type:"primary",size:t.size,round:"",onClick:o[0]||(o[0]=a=>r.$emit("add"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.toolbarCfg.addText||"新增"),1)]),_:1},8,["size"])):e.createCommentVNode("",!0),t.toolbarCfg.showImport&&t.deps.authPass(t.toolbarCfg.importAuth)?(e.openBlock(),e.createBlock(e.unref(l.ElButton),{key:1,size:t.size,round:"",onClick:o[1]||(o[1]=a=>r.$emit("import"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.toolbarCfg.importText||"导入"),1)]),_:1},8,["size"])):e.createCommentVNode("",!0),t.toolbarCfg.showExport&&t.deps.authPass(t.toolbarCfg.exportAuth)?(e.openBlock(),e.createBlock(e.unref(l.ElButton),{key:2,size:t.size,round:"",onClick:o[2]||(o[2]=a=>r.$emit("export"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.toolbarCfg.exportText||"导出"),1)]),_:1},8,["size"])):e.createCommentVNode("",!0),t.toolbarCfg.showBatchDelete&&t.deps.selectionCount>0&&t.deps.authPass(t.toolbarCfg.batchDeleteAuth)?(e.openBlock(),e.createBlock(e.unref(l.ElButton),{key:3,type:"danger",size:t.size,round:"",onClick:o[3]||(o[3]=a=>r.$emit("batch-delete"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.toolbarCfg.batchDeleteText||"批量删除"),1)]),_:1},8,["size"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.toolbarCfg.customButtons||[],a=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.code},[t.deps.authPass(a.auth)?(e.openBlock(),e.createBlock(e.unref(l.ElButton),{key:0,type:a.type,size:t.size,round:"",onClick:a.handler},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.text),1)]),_:2},1032,["type","size","onClick"])):e.createCommentVNode("",!0)],64))),128))]),e.createElementVNode("div",ze,[e.createVNode(e.unref(l.ElTooltip),{content:"刷新"},{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElButton),{icon:"Refresh",size:t.size,circle:"",onClick:o[4]||(o[4]=a=>r.$emit("refresh"))},null,8,["size"])]),_:1}),t.deps.showColumnSetting?(e.openBlock(),e.createBlock(e.unref(l.ElTooltip),{key:0,content:"列设置"},{default:e.withCtx(()=>[e.createVNode(e.unref(l.ElButton),{icon:"Setting",size:t.size,circle:"",onClick:o[5]||(o[5]=a=>r.$emit("column-setting"))},null,8,["size"])]),_:1})):e.createCommentVNode("",!0),e.renderSlot(r.$slots,"toolbar-right")])])):e.createCommentVNode("",!0)}}),Ne=e.defineComponent({__name:"FormDrawer",props:{visible:{type:Boolean},drawerMode:{},isEditing:{type:Boolean},editingRow:{},formData:{},drawerCfg:{},size:{},saving:{type:Boolean}},emits:["update:visible","save"],setup(t){return(r,o)=>t.drawerMode==="drawer"?(e.openBlock(),e.createBlock(e.unref(l.ElDrawer),{key:0,"model-value":t.visible,"onUpdate:modelValue":o[2]||(o[2]=a=>r.$emit("update:visible",a)),title:t.isEditing?t.drawerCfg.editTitle||"编辑":t.drawerCfg.addTitle||"新增",size:t.drawerCfg.width||"40%","destroy-on-close":t.drawerCfg.closeOnReset!==!1},{footer:e.withCtx(()=>[e.createVNode(e.unref(l.ElButton),{size:t.size,round:"",onClick:o[0]||(o[0]=a=>r.$emit("update:visible",!1))},{default:e.withCtx(()=>[...o[6]||(o[6]=[e.createTextVNode("取消",-1)])]),_:1},8,["size"]),e.createVNode(e.unref(l.ElButton),{type:"primary",size:t.size,round:"",loading:t.saving,onClick:o[1]||(o[1]=a=>r.$emit("save"))},{default:e.withCtx(()=>[...o[7]||(o[7]=[e.createTextVNode(" 确定 ",-1)])]),_:1},8,["size","loading"])]),default:e.withCtx(()=>[e.renderSlot(r.$slots,t.isEditing?"edit-form":"add-form",{row:t.editingRow,formData:t.formData})]),_:3},8,["model-value","title","size","destroy-on-close"])):(e.openBlock(),e.createBlock(e.unref(l.ElDialog),{key:1,"model-value":t.visible,"onUpdate:modelValue":o[5]||(o[5]=a=>r.$emit("update:visible",a)),title:t.isEditing?t.drawerCfg.editTitle||"编辑":t.drawerCfg.addTitle||"新增",width:t.drawerCfg.width||"600px","destroy-on-close":t.drawerCfg.closeOnReset!==!1},{footer:e.withCtx(()=>[e.createVNode(e.unref(l.ElButton),{size:t.size,round:"",onClick:o[3]||(o[3]=a=>r.$emit("update:visible",!1))},{default:e.withCtx(()=>[...o[8]||(o[8]=[e.createTextVNode("取消",-1)])]),_:1},8,["size"]),e.createVNode(e.unref(l.ElButton),{type:"primary",size:t.size,round:"",loading:t.saving,onClick:o[4]||(o[4]=a=>r.$emit("save"))},{default:e.withCtx(()=>[...o[9]||(o[9]=[e.createTextVNode(" 确定 ",-1)])]),_:1},8,["size","loading"])]),default:e.withCtx(()=>[e.renderSlot(r.$slots,t.isEditing?"edit-form":"add-form",{row:t.editingRow,formData:t.formData})]),_:3},8,["model-value","title","width","destroy-on-close"]))}}),Te={key:0},$e={key:1},Fe={key:2},Ue={key:0,class:"ee-pagination"},L=e.defineComponent({name:"EeFormTable",__name:"index",props:{columns:{},data:{},loading:{type:Boolean,default:!1},searchConfig:{},pagination:{},actionConfig:{type:[Object,Boolean]},toolbarConfig:{type:[Object,Boolean]},crudConfig:{},selectionConfig:{},exportConfig:{},drawerConfig:{},columnSetting:{},autoHeight:{},dictMap:{},authChecker:{},authMode:{default:"hide"},emptyText:{default:"暂无数据"},tableHeight:{},tableMaxHeight:{},size:{default:"default"},stripe:{type:Boolean,default:!1},border:{type:Boolean,default:!0},highlightCurrentRow:{type:Boolean,default:!1},rowKey:{default:"id"}},emits:["search","search-reset","page-change","selection-change","current-change","size-change","sort-change","row-click","row-dblclick","view","add","edit","delete","batch-delete","import","export","add-success","edit-success","delete-success","batch-delete-success","request-error","column-visible-change","form-save"],setup(t,{expose:r,emit:o}){const a=t,i=o,f=he(a),p=pe(a),{searchExpanded:w,searchParams:b,showSearch:m,searchCols:n,visibleSearchFields:c,showFoldBtn:s,actionColSpan:h,initSearchParams:x,getActiveSearchParams:z,resetSearchParams:D,toggleFold:u}=Ce(a),{pageState:k,showPagination:S,pageSizesComputed:O,paginationLayoutComputed:j,paginationBgComputed:Ie,setPage:Le,setPageSize:Oe,resetPage:K}=ke(a),{tableRef:ee,selection:M,singleSelection:Me,columnSettingVisible:te,checkedColumns:q,showColumnSetting:He,allColumns:Ge,visibleColumns:ae,tableComputedHeight:je,tableMaxHeightProp:Ke,tableWrapperStyle:qe,selectionCfg:$,handleSelectionChange:We,handleSingleSelect:Xe}=we(a,{authPass:f.authPass}),Ye=be(a,{searchParams:b,getActiveSearchParams:z,pageState:k,resetPage:K,setTotal:g=>{k.total=g},selection:M,emit:(g,...C)=>i(g,...C)}),{internalData:W,loadingState:oe,hasCrud:F,fetchData:N,refreshTable:le,handleDelete:Ze,handleBatchDelete:Je}=Ye,B=ye(a),{handleExport:Qe}=Be(a,{visibleColumns:ae,getActiveSearchParams:z,dictLabel:p.dictLabel,internalData:W,fetchData:N,setLoading:g=>{oe.value=g},getCurrentData:()=>a.data||W.value}),T=e.computed(()=>({visible:!!B.formVisible.value,drawerMode:B.drawerMode,isEditing:B.isEditing.value??!1,editingRow:B.editingRow.value??null,formData:B.formData.value??{},drawerCfg:B.drawerCfg,saving:B.saving.value??!1,onVisibleChange:g=>{B.formVisible.value=g}})),H=e.computed({get:()=>te.value,set:g=>{te.value=g}}),V=e.computed(()=>a.actionConfig===!1?P:a.actionConfig===!0?{...Q}:a.actionConfig?{...Q,...a.actionConfig}:P),ne=e.computed(()=>{if(a.toolbarConfig===!1)return _;const g={...fe};return a.toolbarConfig===!0?{...g,show:!0}:a.toolbarConfig?{...g,...a.toolbarConfig}:_}),Pe=e.computed(()=>F.value?W.value:a.data||[]),_e=e.computed(()=>oe.value||a.loading);function ve(){K();const g=z();i("search",g),F.value&&N()}function et(){D(),i("search-reset"),F.value?N():i("search",{})}function tt(g){Le(g),i("current-change",g),i("page-change",{currentPage:g,pageSize:k.pageSize}),F.value&&N()}function at(g){Oe(g),K(),i("size-change",g),i("page-change",{currentPage:1,pageSize:g}),F.value&&N()}function ot(){B.openAdd(),i("add")}function lt(g){B.openEdit(g),i("edit",g)}function nt(g){Ze(g,V.value.confirmDelete!==!1,V.value.deleteConfirmTitle,V.value.deleteConfirmMessage)}function rt(){Je()}function it(){i("export"),Qe()}async function ct(){var g,C;B.saving.value=!0;try{i("form-save",{...B.formData.value},B.isEditing.value??!1),B.isEditing.value&&((g=a.crudConfig)!=null&&g.api.edit)?(await a.crudConfig.api.edit(B.formData.value),l.ElMessage.success("编辑成功"),i("edit-success")):!B.isEditing.value&&((C=a.crudConfig)!=null&&C.api.add)&&(await a.crudConfig.api.add(B.formData.value),l.ElMessage.success("新增成功"),i("add-success")),B.closeForm(),await N()}catch(d){i("request-error",d)}finally{B.saving.value=!1}}const dt=e.computed(()=>{const g={};for(const C of Object.keys(a))!ue.includes(C)&&!C.startsWith("on")&&(g[C]=a[C]);return g});function st(g){const C={};for(const[d,y]of Object.entries(g))ge.includes(d)||(C[d]=y);return C}return e.onMounted(()=>{x(),F.value&&N()}),r({refresh:le,fetchData:N,getSelection:()=>M.value,tableRef:ee}),(g,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ee-form-table",[`ee-size--${t.size}`,{"ee-stripe":t.stripe,"ee-border":t.border}]])},[e.createVNode(Ee,{"show-search":!!e.unref(m),"search-params":e.unref(b),"visible-search-fields":e.unref(c),"search-cols":e.unref(n),"action-col-span":e.unref(h),"show-fold-btn":!!e.unref(s),"search-expanded":!!e.unref(w),size:t.size,"resolve-dict":e.unref(p).resolvedDict,onSearch:ve,onReset:et,onToggleFold:e.unref(u)},{"search-action":e.withCtx(({params:d})=>[e.renderSlot(g.$slots,"search-action",{params:d})]),_:3},8,["show-search","search-params","visible-search-fields","search-cols","action-col-span","show-fold-btn","search-expanded","size","resolve-dict","onToggleFold"]),e.createVNode(De,{show:!!ne.value.show,"toolbar-cfg":ne.value,size:t.size,deps:{authPass:e.unref(f).authPass,selectionCount:e.unref(M).length,showColumnSetting:!!e.unref(He)},onAdd:ot,onImport:C[0]||(C[0]=d=>g.$emit("import")),onExport:it,onBatchDelete:rt,onRefresh:C[1]||(C[1]=d=>e.unref(le)()),onColumnSetting:C[2]||(C[2]=d=>H.value=!0)},{"toolbar-right":e.withCtx(()=>[e.renderSlot(g.$slots,"toolbar-right")]),_:3},8,["show","toolbar-cfg","size","deps"]),e.createElementVNode("div",{class:"ee-table-wrapper",style:e.normalizeStyle(e.unref(qe))},[e.createVNode(e.unref(l.ElTable),e.mergeProps({ref_key:"tableRef",ref:ee,data:Pe.value,loading:_e.value,size:t.size,stripe:t.stripe,border:t.border,height:e.unref(je),"max-height":e.unref(Ke),"highlight-current-row":t.highlightCurrentRow,"row-key":t.rowKey,onSelectionChange:C[3]||(C[3]=d=>{e.unref(We)(d),g.$emit("selection-change",d)}),onRowClick:C[4]||(C[4]=d=>g.$emit("row-click",d)),onRowDblclick:C[5]||(C[5]=d=>g.$emit("row-dblclick",d)),onSortChange:C[6]||(C[6]=d=>g.$emit("sort-change",d))},dt.value),{empty:e.withCtx(()=>[e.renderSlot(g.$slots,"empty",{},()=>[e.createVNode(e.unref(l.ElEmpty),{description:t.emptyText||"暂无数据"},null,8,["description"])])]),default:e.withCtx(()=>[e.unref($).show&&e.unref($).type==="multiple"?(e.openBlock(),e.createBlock(e.unref(l.ElTableColumn),{key:0,type:"selection",width:"50",fixed:"left",selectable:e.unref($).disabledRow?d=>!e.unref($).disabledRow(d):void 0,"reserve-selection":e.unref($).reserveSelection},null,8,["selectable","reserve-selection"])):e.createCommentVNode("",!0),e.unref($).show&&e.unref($).type==="single"?(e.openBlock(),e.createBlock(e.unref(l.ElTableColumn),{key:1,width:"50",fixed:"left"},{default:e.withCtx(({row:d})=>[e.createVNode(e.unref(l.ElRadio),{"model-value":e.unref(Me)===d[t.rowKey||"id"],value:d[t.rowKey||"id"],onChange:()=>{e.unref(Xe)(d),g.$emit("selection-change",e.unref(M))}},null,8,["model-value","value","onChange"])]),_:1})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ae),d=>(e.openBlock(),e.createBlock(e.unref(l.ElTableColumn),e.mergeProps({key:d.prop,prop:d.prop,label:d.label,width:d.width,"min-width":d.minWidth,fixed:d.fixed,sortable:d.sortable,align:d.align||"center","class-name":d.className},{ref_for:!0},st(d)),{default:e.withCtx(y=>[e.renderSlot(g.$slots,d.slotName||d.prop,{row:y.row,index:y.$index,column:d},()=>[d.formatter?(e.openBlock(),e.createElementBlock("span",Te,e.toDisplayString(d.formatter(y.row,d,y.row[d.prop],y.$index)),1)):d.dictKey?(e.openBlock(),e.createElementBlock("span",$e,e.toDisplayString(e.unref(p).dictLabel(d.dictKey,y.row[d.prop])),1)):(e.openBlock(),e.createElementBlock("span",Fe,e.toDisplayString(y.row[d.prop]??"-"),1))])]),_:2},1040,["prop","label","width","min-width","fixed","sortable","align","class-name"]))),128)),V.value.show?(e.openBlock(),e.createBlock(e.unref(l.ElTableColumn),{key:2,label:V.value.label||"操作",width:V.value.width,fixed:V.value.fixed??"right",align:V.value.align||"center"},{default:e.withCtx(({row:d})=>[e.renderSlot(g.$slots,"action-before",{row:d}),V.value.showView&&e.unref(f).authPass(V.value.viewAuth)?(e.openBlock(),e.createBlock(e.unref(l.ElButton),{key:0,type:"primary",link:"",size:t.size,onClick:y=>g.$emit("view",d)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(V.value.viewText||"查看"),1)]),_:1},8,["size","onClick"])):e.createCommentVNode("",!0),V.value.showEdit&&e.unref(f).authPass(V.value.editAuth)?(e.openBlock(),e.createBlock(e.unref(l.ElButton),{key:1,type:"primary",link:"",size:t.size,onClick:y=>lt(d)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(V.value.editText||"编辑"),1)]),_:1},8,["size","onClick"])):e.createCommentVNode("",!0),V.value.showDelete&&e.unref(f).authPass(V.value.deleteAuth)?(e.openBlock(),e.createBlock(e.unref(l.ElButton),{key:2,type:"danger",link:"",size:t.size,onClick:y=>nt(d)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(V.value.deleteText||"删除"),1)]),_:1},8,["size","onClick"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value.customButtons||[],y=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:y.code},[(!y.show||y.show(d))&&e.unref(f).authPass(y.auth)?(e.openBlock(),e.createBlock(e.unref(l.ElButton),{key:0,type:y.type||"default",link:"",size:t.size,onClick:mt=>y.handler(d)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y.text),1)]),_:2},1032,["type","size","onClick"])):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(g.$slots,"action",{row:d})]),_:3},8,["label","width","fixed","align"])):e.createCommentVNode("",!0)]),_:3},16,["data","loading","size","stripe","border","height","max-height","highlight-current-row","row-key"])],4),e.unref(S)?(e.openBlock(),e.createElementBlock("div",Ue,[e.createVNode(e.unref(l.ElPagination),{"current-page":e.unref(k).current,"onUpdate:currentPage":C[7]||(C[7]=d=>e.unref(k).current=d),"page-size":e.unref(k).pageSize,"onUpdate:pageSize":C[8]||(C[8]=d=>e.unref(k).pageSize=d),"page-sizes":e.unref(O),total:e.unref(k).total,layout:e.unref(j),background:e.unref(Ie),size:t.size,onCurrentChange:tt,onSizeChange:at},null,8,["current-page","page-size","page-sizes","total","layout","background","size"])])):e.createCommentVNode("",!0),e.createVNode(Ne,{visible:T.value.visible,"drawer-mode":T.value.drawerMode,"is-editing":T.value.isEditing,"editing-row":T.value.editingRow,"form-data":T.value.formData,"drawer-cfg":T.value.drawerCfg,size:t.size,saving:T.value.saving,"onUpdate:visible":T.value.onVisibleChange,onSave:ct},e.createSlots({_:2},[e.renderList(["add-form","edit-form"],d=>({name:d,fn:e.withCtx(y=>[e.renderSlot(g.$slots,d,e.normalizeProps(e.guardReactiveProps(y)))])}))]),1032,["visible","drawer-mode","is-editing","editing-row","form-data","drawer-cfg","size","saving","onUpdate:visible"]),e.createVNode(e.unref(l.ElDialog),{modelValue:H.value,"onUpdate:modelValue":C[11]||(C[11]=d=>H.value=d),title:"列设置",width:"400px","close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createVNode(e.unref(l.ElButton),{size:t.size,round:"",onClick:C[10]||(C[10]=d=>H.value=!1)},{default:e.withCtx(()=>[...C[12]||(C[12]=[e.createTextVNode("关闭",-1)])]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createVNode(e.unref(l.ElCheckboxGroup),{modelValue:e.unref(q),"onUpdate:modelValue":C[9]||(C[9]=d=>e.isRef(q)?q.value=d:null)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Ge),d=>(e.openBlock(),e.createBlock(e.unref(l.ElCheckbox),{key:d.prop,value:d.prop,label:d.label},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])],2))}});L.install=t=>{t.component(L.name??"EeFormTable",L)};const Re=[U,R,A,I,L];function v(t){Re.forEach(r=>{t.use(r)})}const Ae={install:v};E.EeDictSelect=U,E.EeFormDialog=I,E.EeFormTable=L,E.EeSearchBar=A,E.EeStatusTag=R,E.default=Ae,E.install=v,Object.defineProperties(E,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(V,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("element-plus"),require("echarts")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus","echarts"],e):(V=typeof globalThis<"u"?globalThis:V||self,e(V.EasyEpUI={},V.Vue,V.ElementPlus,V.echarts))})(this,function(V,e,d,Re){"use strict";function Ue(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const l in t)if(l!=="default"){const r=Object.getOwnPropertyDescriptor(t,l);Object.defineProperty(a,l,r.get?r:{enumerable:!0,get:()=>t[l]})}}return a.default=t,Object.freeze(a)}const Ae=Ue(Re),P={formTable:{operation:"操作",add:"新增",edit:"编辑",delete:"删除",view:"查看",import:"导入",export:"导出",batchDelete:"批量删除",refresh:"刷新",columnSetting:"列设置",search:"查询",reset:"重置",expand:"展开",collapse:"收起",empty:"暂无数据",confirm:"确定",cancel:"取消",close:"关闭",confirmDelete:"确认删除",confirmDeleteMsg:"确定要删除该条数据吗?",confirmBatchDelete:"确认批量删除",confirmBatchDeleteMsg:"确定要删除选中的 {count} 条数据吗?",addTitle:"新增",editTitle:"编辑",viewTitle:"查看",addSuccess:"新增成功",editSuccess:"编辑成功",deleteSuccess:"删除成功",batchDeleteSuccess:"批量删除成功",refreshSuccess:"刷新成功",exportSuccess:"导出成功",exportFail:"导出失败",requestFailed:"请求失败",deleteFailed:"删除失败",batchDeleteFailed:"批量删除失败",installXlsx:"请安装 xlsx 依赖: npm install xlsx",exportFileName:"export.xlsx",inputPlaceholder:"请输入{label}",selectPlaceholder:"请选择{label}",dateRangeTo:"至",dateRangeStart:"开始日期",dateRangeEnd:"结束日期"},searchBar:{search:"搜索",reset:"重置",expand:"展开",collapse:"收起",inputPlaceholder:"请输入{label}",selectPlaceholder:"请选择{label}",dateRangeTo:"至",dateRangeStart:"开始日期",dateRangeEnd:"结束日期"},formDialog:{confirm:"确定",cancel:"取消",title:"表单",inputPlaceholder:"请输入{label}",textareaPlaceholder:"请输入{label}",selectPlaceholder:"请选择{label}",datePickerPlaceholder:"请选择{label}"},remoteSelect:{loading:"加载中...",noMore:"没有更多数据了",loadMore:"加载更多",searchPlaceholder:"请输入关键词搜索",requestFailed:"请求失败",noData:"暂无数据"}},pe="eeLocale";function N(){const t=e.inject(pe,P);function a(l,r,o){try{const m=t[l];let p=m==null?void 0:m[r];if(p==null){const u=P[l];p=u==null?void 0:u[r]}if(p==null)return r;if(o)for(const[u,k]of Object.entries(o))p=p.replace(`{${u}}`,String(k));return p}catch{return r}}return{locale:t,t:a}}function q(t){const{requestInstance:a,apiUrl:l,pageNumKey:r="pageNum",pageSizeKey:o="pageSize",pageSize:m=20,searchKey:p="keyword",extraParams:u={},labelField:k="label",valueField:h="value",debounceDelay:g=300}=t,n=a??e.inject(re);if(!n)throw new Error("[EasyEPUI] 请配置 requestInstance:可通过 app.use(EasyEpUI, { requestInstance }) 全局注入,或通过 props 传入");const s=n,{t:f}=N(),b=e.ref(!1),c=e.ref([]),C=e.ref(!1),i=e.ref(0);let w=1,E="",U=null;async function O(S,A=!0){A&&(w=1,C.value=!1,S!==void 0&&(E=S)),b.value=!0;try{const R={[r]:w,[o]:m,...u};E&&(R[p]=E);const ie=await s.get(l,{params:R}),me=ce(ie.data).map(de=>({...de,label:de[k],value:de[h]}));A?c.value=me:c.value=[...c.value,...me],i.value=se(ie.data),c.value.length>=i.value&&(C.value=!0)}catch(R){d.ElMessage.error((R==null?void 0:R.msg)||(R==null?void 0:R.message)||f("remoteSelect","requestFailed")),A&&(c.value=[])}finally{b.value=!1}}function ce(S){return Array.isArray(S)?S:S!=null&&S.rows?S.rows:S!=null&&S.list?S.list:S!=null&&S.records?S.records:S!=null&&S.data?Array.isArray(S.data)?S.data:ce(S.data):S!=null&&S.items?S.items:[]}function se(S){return S!=null&&S.total?Number(S.total):S!=null&&S.count?Number(S.count):Array.isArray(S)?S.length:S!=null&&S.data&&typeof S.data=="object"&&!Array.isArray(S.data)?se(S.data):0}async function ge(){b.value||C.value||(w++,await O(void 0,!1))}function be(){E="",w=1,c.value=[],C.value=!1,i.value=0}function ne(S){E=S,U&&clearTimeout(U),U=setTimeout(()=>{O(E,!0)},g)}return{loading:b,options:c,noMore:C,loadData:O,loadMore:ge,resetList:be,onKeywordChange:ne}}const H=e.defineComponent({name:"EeDictSelect",__name:"index",props:{modelValue:{},dictCode:{},apiUrl:{},detailEchoUrl:{},mode:{default:"single"},labelField:{default:"label"},valueField:{default:"value"},searchKey:{default:"keyword"},pageSize:{default:50},extraParams:{},requestInstance:{},options:{},placeholder:{},clearable:{type:Boolean,default:!0},disabled:{type:Boolean},readonly:{type:Boolean},filterable:{type:Boolean,default:!0},size:{default:"default"}},emits:["update:modelValue","change","clear","blur","focus","search","load-success"],setup(t,{emit:a}){const l=t,r=a;N();const{loading:o,options:m,loadData:p}=q({apiUrl:u(),pageNumKey:"pageNum",pageSizeKey:"pageSize",pageSize:l.pageSize,searchKey:l.searchKey,extraParams:k(),labelField:l.labelField,valueField:l.valueField});function u(){return l.apiUrl?l.apiUrl:"/api/system/dict/data/list"}function k(){const g={...l.extraParams||{}};return l.dictCode&&!l.apiUrl&&(g.dictCode=l.dictCode),g}const h=e.computed(()=>l.options?l.options:m.value.map(g=>({value:g[l.valueField],label:g[l.labelField],disabled:g.disabled??!1})));return e.onMounted(()=>{l.options||p(void 0,!0)}),(g,n)=>(e.openBlock(),e.createBlock(e.unref(d.ElSelect),e.mergeProps(g.$attrs,{"model-value":t.modelValue,loading:e.unref(o),multiple:t.mode==="multiple",placeholder:t.placeholder,clearable:t.clearable,disabled:t.disabled,readonly:t.readonly,filterable:t.filterable,size:t.size,"onUpdate:modelValue":n[0]||(n[0]=s=>r("update:modelValue",s)),onChange:n[1]||(n[1]=s=>r("change",s)),onClear:n[2]||(n[2]=s=>r("clear")),onBlur:n[3]||(n[3]=s=>r("blur",s)),onFocus:n[4]||(n[4]=s=>r("focus",s))}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,s=>(e.openBlock(),e.createBlock(e.unref(d.ElOption),{key:s.value,label:s.label,value:s.value,disabled:s.disabled},null,8,["label","value","disabled"]))),128))]),_:1},16,["model-value","loading","multiple","placeholder","clearable","disabled","readonly","filterable","size"]))}});H.install=t=>{t.component(H.name??"EeDictSelect",H)};const j=e.defineComponent({name:"EeStatusTag",__name:"index",props:{value:{},mapping:{},fallbackLabel:{},defaultType:{default:"info"},defaultEffect:{default:"light"}},setup(t){const a=t,l=e.computed(()=>a.mapping.find(r=>r.value===a.value));return(r,o)=>{var m,p;return e.openBlock(),e.createBlock(e.unref(d.ElTag),e.mergeProps(r.$attrs,{type:((m=l.value)==null?void 0:m.type)??t.defaultType,effect:((p=l.value)==null?void 0:p.effect)??t.defaultEffect}),{default:e.withCtx(()=>{var u;return[e.createTextVNode(e.toDisplayString(((u=l.value)==null?void 0:u.label)??t.fallbackLabel??t.value),1)]}),_:1},16,["type","effect"])}}});j.install=t=>{t.component(j.name??"EeStatusTag",j)};const Me={class:"ee-search-bar"},$e=e.defineComponent({name:"EeSearchBar",__name:"index",props:{modelValue:{},fields:{},inline:{type:Boolean,default:!0},labelWidth:{default:"auto"},collapsible:{type:Boolean,default:!1},collapsedCount:{default:3},size:{default:"default"}},emits:["update:modelValue","search","reset"],setup(t,{emit:a}){const{t:l}=N(),r=t,o=a,m=e.ref(),p=e.ref(!1),u=e.computed(()=>{const s=24-k.value.reduce((f,b)=>f+(b.span??6),0)%24;return s===24?6:s}),k=e.computed(()=>!r.collapsible||p.value?r.fields:r.fields.slice(0,r.collapsedCount));function h(){o("search",{...r.modelValue})}function g(){const n={};r.fields.forEach(s=>{n[s.prop]=""}),o("update:modelValue",n),o("reset")}return(n,s)=>(e.openBlock(),e.createElementBlock("div",Me,[e.createVNode(e.unref(d.ElForm),e.mergeProps({ref_key:"formRef",ref:m,model:t.modelValue,inline:t.inline,"label-width":t.labelWidth,size:t.size},n.$attrs),{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElRow),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,f=>(e.openBlock(),e.createBlock(e.unref(d.ElCol),{key:f.prop,span:f.span??6},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElFormItem),{label:f.label,prop:f.prop},{default:e.withCtx(()=>[(f.type??"input")==="input"?(e.openBlock(),e.createBlock(e.unref(d.ElInput),{key:0,modelValue:t.modelValue[f.prop],"onUpdate:modelValue":b=>t.modelValue[f.prop]=b,placeholder:f.placeholder??e.unref(l)("searchBar","inputPlaceholder",{label:f.label}),clearable:""},null,8,["modelValue","onUpdate:modelValue","placeholder"])):f.type==="select"?(e.openBlock(),e.createBlock(e.unref(d.ElSelect),{key:1,modelValue:t.modelValue[f.prop],"onUpdate:modelValue":b=>t.modelValue[f.prop]=b,placeholder:f.placeholder??e.unref(l)("searchBar","selectPlaceholder",{label:f.label}),clearable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.options??[],b=>(e.openBlock(),e.createBlock(e.unref(d.ElOption),{key:b.value,label:b.label,value:b.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder"])):f.type==="date"?(e.openBlock(),e.createBlock(e.unref(d.ElDatePicker),{key:2,modelValue:t.modelValue[f.prop],"onUpdate:modelValue":b=>t.modelValue[f.prop]=b,placeholder:f.placeholder??e.unref(l)("searchBar","selectPlaceholder",{label:f.label}),style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","placeholder"])):f.type==="date-range"?(e.openBlock(),e.createBlock(e.unref(d.ElDatePicker),{key:3,modelValue:t.modelValue[f.prop],"onUpdate:modelValue":b=>t.modelValue[f.prop]=b,type:"daterange","range-separator":e.unref(l)("searchBar","dateRangeTo"),"start-placeholder":e.unref(l)("searchBar","dateRangeStart"),"end-placeholder":e.unref(l)("searchBar","dateRangeEnd"),style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","range-separator","start-placeholder","end-placeholder"])):f.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f.component),{key:4,modelValue:t.modelValue[f.prop],"onUpdate:modelValue":b=>t.modelValue[f.prop]=b},null,8,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)]),_:2},1032,["label","prop"])]),_:2},1032,["span"]))),128)),e.createVNode(e.unref(d.ElCol),{span:u.value},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElButton),{type:"primary",size:t.size,round:"",onClick:h},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("searchBar","search")),1)]),_:1},8,["size"]),e.createVNode(e.unref(d.ElButton),{size:t.size,round:"",onClick:g},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("searchBar","reset")),1)]),_:1},8,["size"]),t.collapsible&&t.fields.length>t.collapsedCount?(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:0,text:"",size:t.size,onClick:s[0]||(s[0]=f=>p.value=!p.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.value?e.unref(l)("searchBar","collapse"):e.unref(l)("searchBar","expand")),1)]),_:1},8,["size"])):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["span"])]),_:1})]),_:1},16,["model","inline","label-width","size"])]))}}),G=(t,a)=>{const l=t.__vccOpts||t;for(const[r,o]of a)l[r]=o;return l},W=G($e,[["__scopeId","data-v-fe481020"]]);W.install=t=>{t.component(W.name??"EeSearchBar",W)};const Le={class:"ee-form-dialog-footer"},Y=G(e.defineComponent({name:"EeFormDialog",__name:"index",props:{modelValue:{type:Boolean},title:{default:""},formData:{},fields:{},rules:{},width:{default:"600px"},labelWidth:{default:"auto"},loading:{type:Boolean,default:!1},size:{default:"default"}},emits:["update:modelValue","submit","cancel"],setup(t,{emit:a}){const{t:l}=N(),r=t,o=a,m=e.ref(),p=e.computed(()=>{const h={};for(const g of Object.keys(r))["modelValue","title","formData","fields","rules","width","labelWidth","loading"].includes(g)||(h[g]=r[g]);return h});function u(){o("update:modelValue",!1),o("cancel")}async function k(){if(m.value)try{await m.value.validate(),o("submit",{...r.formData})}catch{}}return(h,g)=>(e.openBlock(),e.createBlock(e.unref(d.ElDialog),e.mergeProps(h.$attrs,{"model-value":t.modelValue,title:t.title,width:t.width,"onUpdate:modelValue":g[0]||(g[0]=n=>o("update:modelValue",n)),onClose:u}),{footer:e.withCtx(()=>[e.createElementVNode("span",Le,[e.createVNode(e.unref(d.ElButton),{size:t.size,round:"",onClick:u},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("formDialog","cancel")),1)]),_:1},8,["size"]),e.createVNode(e.unref(d.ElButton),{type:"primary",size:t.size,round:"",loading:t.loading,onClick:k},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("formDialog","confirm")),1)]),_:1},8,["size","loading"])])]),default:e.withCtx(()=>[e.createVNode(e.unref(d.ElForm),e.mergeProps({ref_key:"formRef",ref:m,model:t.formData,rules:t.rules,"label-width":t.labelWidth,size:t.size},p.value),{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElRow),{gutter:20},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fields,n=>(e.openBlock(),e.createBlock(e.unref(d.ElCol),{key:n.prop,span:n.span??24},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElFormItem),{label:n.label,prop:n.prop},{default:e.withCtx(()=>[(n.type??"input")==="input"?(e.openBlock(),e.createBlock(e.unref(d.ElInput),{key:0,modelValue:t.formData[n.prop],"onUpdate:modelValue":s=>t.formData[n.prop]=s,placeholder:n.placeholder??e.unref(l)("formDialog","inputPlaceholder",{label:n.label})},null,8,["modelValue","onUpdate:modelValue","placeholder"])):n.type==="textarea"?(e.openBlock(),e.createBlock(e.unref(d.ElInput),{key:1,modelValue:t.formData[n.prop],"onUpdate:modelValue":s=>t.formData[n.prop]=s,type:"textarea",placeholder:n.placeholder??e.unref(l)("formDialog","textareaPlaceholder",{label:n.label}),rows:3},null,8,["modelValue","onUpdate:modelValue","placeholder"])):n.type==="select"?(e.openBlock(),e.createBlock(e.unref(d.ElSelect),{key:2,modelValue:t.formData[n.prop],"onUpdate:modelValue":s=>t.formData[n.prop]=s,placeholder:n.placeholder??e.unref(l)("formDialog","selectPlaceholder",{label:n.label}),style:{width:"100%"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.options??[],s=>(e.openBlock(),e.createBlock(e.unref(d.ElOption),{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder"])):n.type==="radio"?(e.openBlock(),e.createBlock(e.unref(d.ElRadioGroup),{key:3,modelValue:t.formData[n.prop],"onUpdate:modelValue":s=>t.formData[n.prop]=s},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.options??[],s=>(e.openBlock(),e.createBlock(e.unref(d.ElRadio),{key:s.value,label:s.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.label),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])):n.type==="checkbox"?(e.openBlock(),e.createBlock(e.unref(d.ElCheckboxGroup),{key:4,modelValue:t.formData[n.prop],"onUpdate:modelValue":s=>t.formData[n.prop]=s},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.options??[],s=>(e.openBlock(),e.createBlock(e.unref(d.ElCheckbox),{key:s.value,label:s.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.label),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])):n.type==="switch"?(e.openBlock(),e.createBlock(e.unref(d.ElSwitch),{key:5,modelValue:t.formData[n.prop],"onUpdate:modelValue":s=>t.formData[n.prop]=s},null,8,["modelValue","onUpdate:modelValue"])):n.type==="date"?(e.openBlock(),e.createBlock(e.unref(d.ElDatePicker),{key:6,modelValue:t.formData[n.prop],"onUpdate:modelValue":s=>t.formData[n.prop]=s,placeholder:n.placeholder??e.unref(l)("formDialog","datePickerPlaceholder",{label:n.label}),style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","placeholder"])):n.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.component),{key:7,modelValue:t.formData[n.prop],"onUpdate:modelValue":s=>t.formData[n.prop]=s},null,8,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)]),_:2},1032,["label","prop"])]),_:2},1032,["span"]))),128))]),_:1})]),_:1},16,["model","rules","label-width","size"])]),_:1},16,["model-value","title","width"]))}}),[["__scopeId","data-v-929d8568"]]);Y.install=t=>{t.component(Y.name??"EeFormDialog",Y)};const Be=[10,20,50,100],Oe="total, sizes, prev, pager, next, jumper",Ce={show:!0,cols:3,maxRow:2,foldable:!0,foldDefault:!0},Se={show:!1},he={show:!0,pageSize:20,pageSizes:Be,background:!0},Ie={show:!1},Pe={show:!0,showView:!1,showEdit:!0,showDelete:!0,confirmDelete:!0,deleteConfirmTitle:"",deleteConfirmMessage:""},Ee={show:!1},Ke={show:!0,showAdd:!1,showImport:!1,showExport:!1,showBatchDelete:!1},xe={show:!1},qe={mode:"drawer",width:"40%",closeOnReset:!0,addTitle:"",editTitle:"",viewTitle:"",formCols:2,formLabelWidth:"80px"},He=["data","loading","size","stripe","border","height","max-height","highlight-current-row","row-key"],je=["prop","label","width","minWidth","align","fixed","sortable","show","formatter","dictKey","slotName","search","form","auth","children","className"];function Ge(t){const a=e.computed(()=>!!t.authChecker);function l(r){return!r||!t.authChecker?!0:t.authChecker(r)}return{authPass:l,authEnabled:a}}function We(t){function a(r,o){var m;return r||(o&&((m=t.dictMap)!=null&&m[o])?t.dictMap[o]:[])}function l(r,o){var p;if(!r||!((p=t.dictMap)!=null&&p[r]))return String(o??"");const m=t.dictMap[r].find(u=>u.value===o);return(m==null?void 0:m.label)??String(o??"")}return{resolvedDict:a,dictLabel:l}}function Ye(t){const a=e.ref(!0),l=e.reactive({}),r=e.computed(()=>t.searchConfig===!1?Se:t.searchConfig===!0?{...Ce}:t.searchConfig?{...Ce,...t.searchConfig}:Se),o=e.computed(()=>r.value.show),m=e.computed(()=>r.value.cols||3),p=e.computed(()=>t.columns.filter(i=>{var w;return(w=i.search)==null?void 0:w.enable}).map(i=>{const w=i.search;return{...w,prop:i.prop,label:i.label,field:w.field||i.prop,placeholder:w.placeholder||i.label,dictKey:i.dictKey,props:w.props||{}}})),u=e.computed(()=>r.value.maxRow||2),k=e.computed(()=>m.value*u.value),h=e.computed(()=>r.value.foldable!==!1&&p.value.length>k.value);e.onMounted(()=>{r.value.foldDefault!==!1&&(a.value=!1)});const g=e.computed(()=>!a.value&&h.value?p.value.slice(0,k.value):p.value),n=e.computed(()=>24/m.value);function s(){p.value.forEach(i=>{l[i.field]=i.defaultValue??""})}function f(){const i={};return p.value.forEach(w=>{i[w.field]=w.defaultValue??""}),i}function b(){const i={};for(const[w,E]of Object.entries(l))E!==""&&E!==null&&E!==void 0&&(i[w]=E);return i}function c(){Object.assign(l,f())}function C(){a.value=!a.value}return{searchExpanded:a,searchParams:l,searchCfg:r,showSearch:o,searchCols:m,allSearchFields:p,visibleSearchFields:g,showFoldBtn:h,actionColSpan:n,initSearchParams:s,getDefaultSearchParams:f,getActiveSearchParams:b,resetSearchParams:c,toggleFold:C}}function Xe(t){const a=e.reactive({current:1,pageSize:20,total:0}),l=e.computed(()=>t.pagination===!1?Ie:t.pagination===!0?{...he}:t.pagination?{...he,...t.pagination}:{...he,show:!0}),r=e.computed(()=>l.value.show!==!1),o=e.computed(()=>l.value.pageSizes||Be),m=e.computed(()=>l.value.layout||Oe),p=e.computed(()=>l.value.background!==!1);e.onMounted(()=>{t.pagination&&typeof t.pagination=="object"&&(t.pagination.pageSize&&(a.pageSize=t.pagination.pageSize),t.pagination.total!==void 0&&(a.total=t.pagination.total))}),e.watch(()=>t.pagination,g=>{typeof g=="object"&&g&&(g.total!==void 0&&(a.total=g.total),g.pageSize&&(a.pageSize=g.pageSize))},{deep:!0});function u(g){a.current=g}function k(g){a.pageSize=g}function h(){a.current=1}return{pageState:a,paginationCfg:l,showPagination:r,pageSizesComputed:o,paginationLayoutComputed:m,paginationBgComputed:p,setPage:u,setPageSize:k,resetPage:h}}function Qe(t,a){const l=e.ref(),r=e.ref([]),o=e.ref(null),m=e.ref(!1),p=e.ref([]),u=e.computed(()=>({show:!1,type:"multiple",reserveSelection:!1,...t.selectionConfig})),k=e.computed(()=>({show:!1,...t.columnSetting})),h=e.computed(()=>k.value.show),g=e.computed(()=>t.columns.filter(i=>i.prop));e.onMounted(()=>{p.value=g.value.map(i=>i.prop)}),e.watch(()=>t.columns,()=>{p.value=[...new Set([...p.value.filter(i=>g.value.some(w=>w.prop===i)),...g.value.map(i=>i.prop)])]},{deep:!0});const n=e.computed(()=>g.value.filter(i=>i.show!==!1&&p.value.includes(i.prop)&&a.authPass(i.auth))),s=e.computed(()=>t.tableHeight||void 0),f=e.computed(()=>t.tableMaxHeight||void 0),b=e.computed(()=>t.autoHeight?{minHeight:`calc(100vh - ${(typeof t.autoHeight=="object"?t.autoHeight:{}).offset||200}px)`}:{});function c(i){r.value=i}function C(i){const w=t.rowKey||"id";o.value=i[w],r.value=[i]}return{tableRef:l,selection:r,singleSelection:o,columnSettingVisible:m,checkedColumns:p,selectionCfg:u,columnSettingCfg:k,showColumnSetting:h,allColumns:g,visibleColumns:n,tableComputedHeight:s,tableMaxHeightProp:f,tableWrapperStyle:b,handleSelectionChange:c,handleSingleSelect:C}}function Ze(t,a){const l=e.ref([]),r=e.ref(!1),o=e.computed(()=>{var n;return!!((n=t.crudConfig)!=null&&n.api.list)});async function m(){var n;if((n=t.crudConfig)!=null&&n.api.list){r.value=!0;try{const s={page:a.pageState.current,pageSize:a.pageState.pageSize,...t.crudConfig.baseParams},f=a.getActiveSearchParams();Object.assign(s,f);const b=await t.crudConfig.api.list(s);l.value=b.data||[],a.setTotal(b.total??0)}catch(s){a.emit("request-error",s),d.ElMessage.error((s==null?void 0:s.message)||a.t("formTable","requestFailed"))}finally{r.value=!1}}}async function p(){a.resetPage(),await m()}async function u(n){var s;if(!((s=t.crudConfig)!=null&&s.api.delete)){a.emit("delete",n);return}r.value=!0;try{const f=n[t.rowKey||"id"];await t.crudConfig.api.delete(f),d.ElMessage.success(a.t("formTable","deleteSuccess")),a.emit("delete-success"),await m()}catch(f){a.emit("request-error",f),d.ElMessage.error((f==null?void 0:f.message)||a.t("formTable","deleteFailed"))}finally{r.value=!1}}async function k(n,s,f,b){if(!s){await u(n);return}try{const c=a.t("formTable","confirm"),C=a.t("formTable","cancel");await d.ElMessageBox.confirm(b||a.t("formTable","confirmDeleteMsg"),f||a.t("formTable","confirmDelete"),{confirmButtonText:c,cancelButtonText:C,type:"warning"}),await u(n)}catch{}}async function h(n){var s;if(!((s=t.crudConfig)!=null&&s.api.batchDelete)){a.emit("batch-delete",n);return}r.value=!0;try{await t.crudConfig.api.batchDelete(n),d.ElMessage.success(a.t("formTable","batchDeleteSuccess")),a.emit("batch-delete-success"),a.selection.value=[],await m()}catch(f){a.emit("request-error",f),d.ElMessage.error((f==null?void 0:f.message)||a.t("formTable","batchDeleteFailed"))}finally{r.value=!1}}async function g(){const n=a.selection.value;if(n.length!==0)try{const s=a.t("formTable","confirm"),f=a.t("formTable","cancel");await d.ElMessageBox.confirm(a.t("formTable","confirmBatchDeleteMsg",{count:n.length}),a.t("formTable","confirmBatchDelete"),{confirmButtonText:s,cancelButtonText:f,type:"warning"});const b=n.map(c=>c[t.rowKey||"id"]);await h(b)}catch{}}return{internalData:l,loadingState:r,hasCrud:o,fetchData:m,refreshTable:p,doDelete:u,handleDelete:k,doBatchDelete:h,handleBatchDelete:g}}function Je(t){const a=e.ref(!1),l=e.ref("add"),r=e.ref(null),o=e.ref({}),m=e.ref(!1),p={...qe,...t.drawerConfig},u=p.mode||"drawer";function k(){l.value="add",r.value=null,o.value={},a.value=!0}function h(s){l.value="edit",r.value=s,o.value={...s},a.value=!0}function g(s){l.value="view",r.value=s,o.value={...s},a.value=!0}function n(){a.value=!1}return{formVisible:a,formMode:l,editingRow:r,formData:o,saving:m,drawerMode:u,drawerCfg:p,openAdd:k,openEdit:h,openView:g,closeForm:n}}function _e(t,a){const l=e.ref(!1);async function r(){var o,m,p,u,k;l.value=!0,a.setLoading(!0);try{const h=await import("xlsx").catch(()=>null);if(!h){d.ElMessage.warning(a.t("formTable","installXlsx"));return}const g=((o=t.exportConfig)==null?void 0:o.mode)||"current";let n;if(g==="all"&&((p=(m=t.crudConfig)==null?void 0:m.api)!=null&&p.list)){const i={page:1,pageSize:99999,...t.crudConfig.baseParams},w=a.getActiveSearchParams();Object.assign(i,w),n=(await t.crudConfig.api.list(i)).data||[]}else n=[...a.getCurrentData()];const s=((u=t.exportConfig)==null?void 0:u.ignoreColumn)||[],f=a.visibleColumns.value.filter(i=>!s.includes(i.prop)).map(i=>({prop:i.prop,label:i.label})),b=[f.map(i=>i.label),...n.map(i=>f.map(w=>{var U;if(w.prop==="action")return"";const E=(U=t.columns.find(O=>O.prop===w.prop))==null?void 0:U.dictKey;return E?a.dictLabel(E,i[w.prop]):i[w.prop]??""}))],c=h.utils.aoa_to_sheet(b),C=h.utils.book_new();h.utils.book_append_sheet(C,c,"Sheet1"),h.writeFile(C,((k=t.exportConfig)==null?void 0:k.fileName)||a.t("formTable","exportFileName")),d.ElMessage.success(a.t("formTable","exportSuccess"))}catch(h){d.ElMessage.error((h==null?void 0:h.message)||a.t("formTable","exportFail"))}finally{a.setLoading(!1),l.value=!1}}return{handleExport:r,exporting:l}}const ve={key:0,class:"ee-search-area"},et=e.defineComponent({__name:"SearchArea",props:{showSearch:{type:Boolean},searchParams:{},visibleSearchFields:{},searchCols:{},actionColSpan:{},showFoldBtn:{type:Boolean},searchExpanded:{type:Boolean},size:{},resolveDict:{type:Function}},emits:["search","reset","toggle-fold"],setup(t){const{t:a}=N();return(l,r)=>t.showSearch?(e.openBlock(),e.createElementBlock("div",ve,[e.createVNode(e.unref(d.ElForm),{model:t.searchParams,"label-width":"auto",size:t.size},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElRow),{gutter:12},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.visibleSearchFields,o=>(e.openBlock(),e.createBlock(e.unref(d.ElCol),{key:String(o.prop),span:24/t.searchCols},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElFormItem),{label:String(o.label)},{default:e.withCtx(()=>[o.type==="input"?(e.openBlock(),e.createBlock(e.unref(d.ElInput),e.mergeProps({key:0,modelValue:t.searchParams[o.field],"onUpdate:modelValue":m=>t.searchParams[o.field]=m,placeholder:String(o.placeholder||e.unref(a)("formTable","inputPlaceholder",{label:o.label})),clearable:""},{ref_for:!0},o.props||{}),null,16,["modelValue","onUpdate:modelValue","placeholder"])):o.type==="number"?(e.openBlock(),e.createBlock(e.unref(d.ElInputNumber),e.mergeProps({key:1,modelValue:t.searchParams[o.field],"onUpdate:modelValue":m=>t.searchParams[o.field]=m,placeholder:String(o.placeholder||e.unref(a)("formTable","inputPlaceholder",{label:o.label})),style:{width:"100%"}},{ref_for:!0},o.props||{}),null,16,["modelValue","onUpdate:modelValue","placeholder"])):o.type==="select"?(e.openBlock(),e.createBlock(e.unref(d.ElSelect),e.mergeProps({key:2,modelValue:t.searchParams[o.field],"onUpdate:modelValue":m=>t.searchParams[o.field]=m,placeholder:String(o.placeholder||e.unref(a)("formTable","selectPlaceholder",{label:o.label})),clearable:"",style:{width:"100%"}},{ref_for:!0},o.props||{}),{default:e.withCtx(()=>{var m;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.resolveDict((m=o.props)==null?void 0:m.options,o.dictKey),p=>(e.openBlock(),e.createBlock(e.unref(d.ElOption),{key:p.value,label:p.label,value:p.value},null,8,["label","value"]))),128))]}),_:2},1040,["modelValue","onUpdate:modelValue","placeholder"])):o.type==="radio"?(e.openBlock(),e.createBlock(e.unref(d.ElRadioGroup),e.mergeProps({key:3,modelValue:t.searchParams[o.field],"onUpdate:modelValue":m=>t.searchParams[o.field]=m},{ref_for:!0},o.props||{}),{default:e.withCtx(()=>{var m;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.resolveDict((m=o.props)==null?void 0:m.options,o.dictKey),p=>(e.openBlock(),e.createBlock(e.unref(d.ElRadio),{key:p.value,value:p.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.label),1)]),_:2},1032,["value"]))),128))]}),_:2},1040,["modelValue","onUpdate:modelValue"])):o.type==="checkbox"?(e.openBlock(),e.createBlock(e.unref(d.ElCheckboxGroup),e.mergeProps({key:4,modelValue:t.searchParams[o.field],"onUpdate:modelValue":m=>t.searchParams[o.field]=m},{ref_for:!0},o.props||{}),{default:e.withCtx(()=>{var m;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.resolveDict((m=o.props)==null?void 0:m.options,o.dictKey),p=>(e.openBlock(),e.createBlock(e.unref(d.ElCheckbox),{key:p.value,value:p.value,label:p.label},null,8,["value","label"]))),128))]}),_:2},1040,["modelValue","onUpdate:modelValue"])):o.type==="date"?(e.openBlock(),e.createBlock(e.unref(d.ElDatePicker),e.mergeProps({key:5,modelValue:t.searchParams[o.field],"onUpdate:modelValue":m=>t.searchParams[o.field]=m,placeholder:String(o.placeholder||e.unref(a)("formTable","selectPlaceholder",{label:o.label})),style:{width:"100%"}},{ref_for:!0},o.props||{}),null,16,["modelValue","onUpdate:modelValue","placeholder"])):o.type==="date-range"?(e.openBlock(),e.createBlock(e.unref(d.ElDatePicker),e.mergeProps({key:6,modelValue:t.searchParams[o.field],"onUpdate:modelValue":m=>t.searchParams[o.field]=m,type:"daterange","range-separator":e.unref(a)("formTable","dateRangeTo"),"start-placeholder":e.unref(a)("formTable","dateRangeStart"),"end-placeholder":e.unref(a)("formTable","dateRangeEnd"),style:{width:"100%"}},{ref_for:!0},o.props||{}),null,16,["modelValue","onUpdate:modelValue","range-separator","start-placeholder","end-placeholder"])):o.type==="textarea"?(e.openBlock(),e.createBlock(e.unref(d.ElInput),e.mergeProps({key:7,modelValue:t.searchParams[o.field],"onUpdate:modelValue":m=>t.searchParams[o.field]=m,placeholder:String(o.placeholder||e.unref(a)("formTable","inputPlaceholder",{label:o.label})),type:"textarea"},{ref_for:!0},o.props||{}),null,16,["modelValue","onUpdate:modelValue","placeholder"])):e.createCommentVNode("",!0)]),_:2},1032,["label"])]),_:2},1032,["span"]))),128)),e.createVNode(e.unref(d.ElCol),{span:t.actionColSpan},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElButton),{type:"primary",round:"",onClick:r[0]||(r[0]=o=>l.$emit("search"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("formTable","search")),1)]),_:1}),e.createVNode(e.unref(d.ElButton),{round:"",onClick:r[1]||(r[1]=o=>l.$emit("reset"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("formTable","reset")),1)]),_:1}),t.showFoldBtn?(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:0,text:"",size:t.size,onClick:r[2]||(r[2]=o=>l.$emit("toggle-fold"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.searchExpanded?e.unref(a)("formTable","collapse"):e.unref(a)("formTable","expand")),1)]),_:1},8,["size"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"search-action",{params:t.searchParams})]),_:3})]),_:3},8,["span"])]),_:3})]),_:3},8,["model","size"])])):e.createCommentVNode("",!0)}});/*! Element Plus Icons Vue v2.3.2 */var tt=e.defineComponent({name:"Refresh",__name:"refresh",setup(t){return(a,l)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"})]))}}),at=tt,lt=e.defineComponent({name:"Setting",__name:"setting",setup(t){return(a,l)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M600.704 64a32 32 0 0 1 30.464 22.208l35.2 109.376c14.784 7.232 28.928 15.36 42.432 24.512l112.384-24.192a32 32 0 0 1 34.432 15.36L944.32 364.8a32 32 0 0 1-4.032 37.504l-77.12 85.12a357 357 0 0 1 0 49.024l77.12 85.248a32 32 0 0 1 4.032 37.504l-88.704 153.6a32 32 0 0 1-34.432 15.296L708.8 803.904c-13.44 9.088-27.648 17.28-42.368 24.512l-35.264 109.376A32 32 0 0 1 600.704 960H423.296a32 32 0 0 1-30.464-22.208L357.696 828.48a352 352 0 0 1-42.56-24.64l-112.32 24.256a32 32 0 0 1-34.432-15.36L79.68 659.2a32 32 0 0 1 4.032-37.504l77.12-85.248a357 357 0 0 1 0-48.896l-77.12-85.248A32 32 0 0 1 79.68 364.8l88.704-153.6a32 32 0 0 1 34.432-15.296l112.32 24.256c13.568-9.152 27.776-17.408 42.56-24.64l35.2-109.312A32 32 0 0 1 423.232 64H600.64zm-23.424 64H446.72l-36.352 113.088-24.512 11.968a294 294 0 0 0-34.816 20.096l-22.656 15.36-116.224-25.088-65.28 113.152 79.68 88.192-1.92 27.136a293 293 0 0 0 0 40.192l1.92 27.136-79.808 88.192 65.344 113.152 116.224-25.024 22.656 15.296a294 294 0 0 0 34.816 20.096l24.512 11.968L446.72 896h130.688l36.48-113.152 24.448-11.904a288 288 0 0 0 34.752-20.096l22.592-15.296 116.288 25.024 65.28-113.152-79.744-88.192 1.92-27.136a293 293 0 0 0 0-40.256l-1.92-27.136 79.808-88.128-65.344-113.152-116.288 24.96-22.592-15.232a288 288 0 0 0-34.752-20.096l-24.448-11.904L577.344 128zM512 320a192 192 0 1 1 0 384 192 192 0 0 1 0-384m0 64a128 128 0 1 0 0 256 128 128 0 0 0 0-256"})]))}}),ot=lt;const rt={key:0,class:"ee-toolbar"},nt={class:"ee-toolbar-left"},it={class:"ee-toolbar-right"},dt=e.defineComponent({__name:"TableToolbar",props:{show:{type:Boolean},toolbarCfg:{},size:{},refreshing:{type:Boolean},deps:{}},emits:["add","import","export","batch-delete","refresh","column-setting"],setup(t){const{t:a}=N();return(l,r)=>t.show?(e.openBlock(),e.createElementBlock("div",rt,[e.createElementVNode("div",nt,[t.toolbarCfg.showAdd&&t.deps.authPass(t.toolbarCfg.addAuth)?(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:0,type:"primary",size:t.size,round:"",onClick:r[0]||(r[0]=o=>l.$emit("add"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.toolbarCfg.addText||e.unref(a)("formTable","add")),1)]),_:1},8,["size"])):e.createCommentVNode("",!0),t.toolbarCfg.showImport&&t.deps.authPass(t.toolbarCfg.importAuth)?(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:1,size:t.size,round:"",onClick:r[1]||(r[1]=o=>l.$emit("import"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.toolbarCfg.importText||e.unref(a)("formTable","import")),1)]),_:1},8,["size"])):e.createCommentVNode("",!0),t.toolbarCfg.showExport&&t.deps.authPass(t.toolbarCfg.exportAuth)?(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:2,size:t.size,round:"",onClick:r[2]||(r[2]=o=>l.$emit("export"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.toolbarCfg.exportText||e.unref(a)("formTable","export")),1)]),_:1},8,["size"])):e.createCommentVNode("",!0),t.toolbarCfg.showBatchDelete&&t.deps.selectionCount>0&&t.deps.authPass(t.toolbarCfg.batchDeleteAuth)?(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:3,type:"danger",size:t.size,round:"",onClick:r[3]||(r[3]=o=>l.$emit("batch-delete"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.toolbarCfg.batchDeleteText||e.unref(a)("formTable","batchDelete")),1)]),_:1},8,["size"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.toolbarCfg.customButtons||[],o=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:o.code},[t.deps.authPass(o.auth)?(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:0,type:o.type,size:t.size,round:"",onClick:o.handler},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.text),1)]),_:2},1032,["type","size","onClick"])):e.createCommentVNode("",!0)],64))),128))]),e.createElementVNode("div",it,[e.createVNode(e.unref(d.ElTooltip),{content:e.unref(a)("formTable","refresh")},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElButton),{icon:e.unref(at),size:t.size,loading:t.refreshing,circle:"",onClick:r[4]||(r[4]=o=>l.$emit("refresh"))},null,8,["icon","size","loading"])]),_:1},8,["content"]),t.deps.showColumnSetting?(e.openBlock(),e.createBlock(e.unref(d.ElTooltip),{key:0,content:e.unref(a)("formTable","columnSetting")},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElButton),{icon:e.unref(ot),size:t.size,circle:"",onClick:r[5]||(r[5]=o=>l.$emit("column-setting"))},null,8,["icon","size"])]),_:1},8,["content"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"toolbar-right")])])):e.createCommentVNode("",!0)}}),Ve=e.defineComponent({__name:"FormAuto",props:{formData:{},columns:{},formMode:{},formCols:{},formLabelWidth:{},size:{},dictMap:{}},setup(t,{expose:a}){const{t:l}=N(),r=t,o=e.ref();a({validate:()=>{var f;return(f=o.value)==null?void 0:f.validate()},resetFields:()=>{var f;return(f=o.value)==null?void 0:f.resetFields()}});const m=e.computed(()=>r.columns.filter(f=>!f.form||f.form.hide?!1:r.formMode==="add"?f.form.add!==!1:r.formMode==="edit"?f.form.edit!==!1:!1));function p(f){var b;return((b=f.form)==null?void 0:b.type)||"input"}function u(f){var b;return((b=f.form)==null?void 0:b.props)||{}}function k(f){var c;if((c=f.form)!=null&&c.placeholder)return f.form.placeholder;const b=p(f);return b==="select"||b==="date"||b==="date-range"?l("formTable","selectPlaceholder",{label:f.label}):l("formTable","inputPlaceholder",{label:f.label})}function h(f){var b;return!!(r.formMode==="edit"&&((b=f.form)!=null&&b.readonly))}function g(f){var c;const b=((c=f.form)==null?void 0:c.colSpan)||1;return Math.round(24/r.formCols*b)}function n(f){var b,c,C;return(b=f.form)!=null&&b.dictKey&&((c=r.dictMap)!=null&&c[f.form.dictKey])?r.dictMap[f.form.dictKey]:((C=f.form)==null?void 0:C.options)||[]}function s(f){var c,C;const b=(c=f.form)==null?void 0:c.rules;if((C=f.form)!=null&&C.required){const i={required:!0,message:l("formTable","inputPlaceholder",{label:f.label}),trigger:"blur"};return b?[...b,i]:[i]}return b}return(f,b)=>(e.openBlock(),e.createBlock(e.unref(d.ElForm),{ref_key:"formRef",ref:o,model:t.formData,"label-width":t.formLabelWidth,size:t.size,"label-position":"top"},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElRow),{gutter:20},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,c=>(e.openBlock(),e.createBlock(e.unref(d.ElCol),{key:c.prop,span:g(c)},{default:e.withCtx(()=>{var C;return[e.createVNode(e.unref(d.ElFormItem),{prop:c.prop,label:c.label,rules:s(c),required:(C=c.form)==null?void 0:C.required},{default:e.withCtx(()=>[p(c)==="input"?(e.openBlock(),e.createBlock(e.unref(d.ElInput),e.mergeProps({key:0,modelValue:t.formData[c.prop],"onUpdate:modelValue":i=>t.formData[c.prop]=i},{ref_for:!0},u(c),{placeholder:k(c),disabled:h(c),clearable:""}),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):p(c)==="number"?(e.openBlock(),e.createBlock(e.unref(d.ElInputNumber),e.mergeProps({key:1,modelValue:t.formData[c.prop],"onUpdate:modelValue":i=>t.formData[c.prop]=i},{ref_for:!0},u(c),{placeholder:k(c),disabled:h(c),style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):p(c)==="select"?(e.openBlock(),e.createBlock(e.unref(d.ElSelect),e.mergeProps({key:2,modelValue:t.formData[c.prop],"onUpdate:modelValue":i=>t.formData[c.prop]=i},{ref_for:!0},u(c),{placeholder:k(c),disabled:h(c),clearable:"",style:{width:"100%"}}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n(c),i=>(e.openBlock(),e.createBlock(e.unref(d.ElOption),{key:i.value,label:i.label,value:i.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","placeholder","disabled"])):p(c)==="radio"?(e.openBlock(),e.createBlock(e.unref(d.ElRadioGroup),e.mergeProps({key:3,modelValue:t.formData[c.prop],"onUpdate:modelValue":i=>t.formData[c.prop]=i},{ref_for:!0},u(c),{disabled:h(c)}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n(c),i=>(e.openBlock(),e.createBlock(e.unref(d.ElRadio),{key:i.value,value:i.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.label),1)]),_:2},1032,["value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):p(c)==="checkbox"?(e.openBlock(),e.createBlock(e.unref(d.ElCheckboxGroup),e.mergeProps({key:4,modelValue:t.formData[c.prop],"onUpdate:modelValue":i=>t.formData[c.prop]=i},{ref_for:!0},u(c),{disabled:h(c)}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n(c),i=>(e.openBlock(),e.createBlock(e.unref(d.ElCheckbox),{key:i.value,value:i.value,label:i.label},null,8,["value","label"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue","disabled"])):p(c)==="date"?(e.openBlock(),e.createBlock(e.unref(d.ElDatePicker),e.mergeProps({key:5,modelValue:t.formData[c.prop],"onUpdate:modelValue":i=>t.formData[c.prop]=i},{ref_for:!0},u(c),{placeholder:k(c),disabled:h(c),style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):p(c)==="date-range"?(e.openBlock(),e.createBlock(e.unref(d.ElDatePicker),e.mergeProps({key:6,modelValue:t.formData[c.prop],"onUpdate:modelValue":i=>t.formData[c.prop]=i,type:"daterange"},{ref_for:!0},u(c),{placeholder:k(c),disabled:h(c),style:{width:"100%"}}),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):p(c)==="textarea"?(e.openBlock(),e.createBlock(e.unref(d.ElInput),e.mergeProps({key:7,modelValue:t.formData[c.prop],"onUpdate:modelValue":i=>t.formData[c.prop]=i,type:"textarea"},{ref_for:!0},u(c),{placeholder:k(c),disabled:h(c)}),null,16,["modelValue","onUpdate:modelValue","placeholder","disabled"])):p(c)==="switch"?(e.openBlock(),e.createBlock(e.unref(d.ElSwitch),e.mergeProps({key:8,modelValue:t.formData[c.prop],"onUpdate:modelValue":i=>t.formData[c.prop]=i},{ref_for:!0},u(c),{disabled:h(c)}),null,16,["modelValue","onUpdate:modelValue","disabled"])):e.createCommentVNode("",!0)]),_:2},1032,["prop","label","rules","required"])]}),_:2},1032,["span"]))),128))]),_:1})]),_:1},8,["model","label-width","size"]))}}),ct=e.defineComponent({__name:"FormDrawer",props:{visible:{type:Boolean},drawerMode:{},formMode:{},editingRow:{},formData:{},drawerCfg:{},columns:{},size:{},saving:{type:Boolean},dictMap:{}},emits:["update:visible","save"],setup(t,{emit:a}){const{t:l}=N(),r=t,o=a,m=e.ref();async function p(){if(m.value)try{await m.value.validate()}catch{return}o("save")}const u=e.computed(()=>r.formMode==="view"?r.drawerCfg.viewTitle||l("formTable","viewTitle"):r.formMode==="edit"?r.drawerCfg.editTitle||l("formTable","editTitle"):r.drawerCfg.addTitle||l("formTable","addTitle")),k=e.computed(()=>{var h;return(h=r.columns)!=null&&h.length?r.columns.map(g=>{const n=r.formData[g.prop];return{key:g.prop,label:g.label,value:n!=null&&n!==""?String(n):"-",isEmpty:n==null||n===""}}):Object.keys(r.formData).map(g=>{const n=r.formData[g];return{key:g,label:g,value:n!=null&&n!==""?String(n):"-",isEmpty:n==null||n===""}})});return(h,g)=>t.drawerMode==="drawer"?(e.openBlock(),e.createBlock(e.unref(d.ElDrawer),{key:0,"model-value":t.visible,"onUpdate:modelValue":g[2]||(g[2]=n=>h.$emit("update:visible",n)),title:u.value,size:t.drawerCfg.width||"40%","destroy-on-close":t.drawerCfg.closeOnReset!==!1},{footer:e.withCtx(()=>[t.formMode!=="view"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(d.ElButton),{size:t.size,round:"",onClick:g[0]||(g[0]=n=>h.$emit("update:visible",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("formTable","cancel")),1)]),_:1},8,["size"]),e.createVNode(e.unref(d.ElButton),{type:"primary",size:t.size,round:"",loading:t.saving,onClick:p},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("formTable","confirm")),1)]),_:1},8,["size","loading"])],64)):(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:1,size:t.size,round:"",onClick:g[1]||(g[1]=n=>h.$emit("update:visible",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("formTable","close")),1)]),_:1},8,["size"]))]),default:e.withCtx(()=>[t.formMode!=="view"?e.renderSlot(h.$slots,t.formMode+"-form",{key:0,row:t.editingRow,formData:t.formData},()=>[e.createVNode(Ve,{ref_key:"formAutoRef",ref:m,"form-data":t.formData,columns:t.columns||[],"form-mode":t.formMode,"form-cols":t.drawerCfg.formCols||2,"form-label-width":t.drawerCfg.formLabelWidth||"80px",size:t.size,"dict-map":t.dictMap},null,8,["form-data","columns","form-mode","form-cols","form-label-width","size","dict-map"])]):e.renderSlot(h.$slots,"view-form",{key:1,row:t.editingRow,formData:t.formData},()=>[e.createVNode(e.unref(d.ElDescriptions),{column:1,border:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,n=>(e.openBlock(),e.createBlock(e.unref(d.ElDescriptionsItem),{key:n.key,label:n.label},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.isEmpty?e.unref(l)("formTable","empty"):n.value),1)]),_:2},1032,["label"]))),128))]),_:1})])]),_:3},8,["model-value","title","size","destroy-on-close"])):(e.openBlock(),e.createBlock(e.unref(d.ElDialog),{key:1,"model-value":t.visible,"onUpdate:modelValue":g[5]||(g[5]=n=>h.$emit("update:visible",n)),title:u.value,width:t.drawerCfg.width||"600px","destroy-on-close":t.drawerCfg.closeOnReset!==!1},{footer:e.withCtx(()=>[t.formMode!=="view"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(d.ElButton),{size:t.size,round:"",onClick:g[3]||(g[3]=n=>h.$emit("update:visible",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("formTable","cancel")),1)]),_:1},8,["size"]),e.createVNode(e.unref(d.ElButton),{type:"primary",size:t.size,round:"",loading:t.saving,onClick:p},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("formTable","confirm")),1)]),_:1},8,["size","loading"])],64)):(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:1,size:t.size,round:"",onClick:g[4]||(g[4]=n=>h.$emit("update:visible",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("formTable","close")),1)]),_:1},8,["size"]))]),default:e.withCtx(()=>[t.formMode!=="view"?e.renderSlot(h.$slots,t.formMode+"-form",{key:0,row:t.editingRow,formData:t.formData},()=>[e.createVNode(Ve,{ref_key:"formAutoRef",ref:m,"form-data":t.formData,columns:t.columns||[],"form-mode":t.formMode,"form-cols":t.drawerCfg.formCols||2,"form-label-width":t.drawerCfg.formLabelWidth||"80px",size:t.size,"dict-map":t.dictMap},null,8,["form-data","columns","form-mode","form-cols","form-label-width","size","dict-map"])]):e.renderSlot(h.$slots,"view-form",{key:1,row:t.editingRow,formData:t.formData},()=>[e.createVNode(e.unref(d.ElDescriptions),{column:1,border:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,n=>(e.openBlock(),e.createBlock(e.unref(d.ElDescriptionsItem),{key:n.key,label:n.label},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.isEmpty?e.unref(l)("formTable","empty"):n.value),1)]),_:2},1032,["label"]))),128))]),_:1})])]),_:3},8,["model-value","title","width","destroy-on-close"]))}}),st={key:0},ft={key:1},mt={key:2},ut={key:0,class:"ee-pagination"},X=e.defineComponent({name:"EeFormTable",__name:"index",props:{columns:{},data:{},loading:{type:Boolean,default:!1},searchConfig:{},pagination:{},actionConfig:{type:[Object,Boolean]},toolbarConfig:{type:[Object,Boolean]},crudConfig:{},selectionConfig:{},exportConfig:{},drawerConfig:{},columnSetting:{},autoHeight:{},dictMap:{},authChecker:{},authMode:{default:"hide"},emptyText:{default:""},tableHeight:{},tableMaxHeight:{},size:{default:"default"},stripe:{type:Boolean,default:!1},border:{type:Boolean,default:!0},highlightCurrentRow:{type:Boolean,default:!1},rowKey:{default:"id"}},emits:["search","search-reset","page-change","selection-change","current-change","size-change","sort-change","row-click","row-dblclick","view","add","edit","delete","batch-delete","import","export","add-success","edit-success","delete-success","batch-delete-success","request-error","column-visible-change","form-save"],setup(t,{expose:a,emit:l}){const{t:r}=N(),o=t,m=l,p=Ge(o),u=We(o),{searchExpanded:k,searchParams:h,showSearch:g,searchCols:n,visibleSearchFields:s,showFoldBtn:f,actionColSpan:b,initSearchParams:c,getActiveSearchParams:C,resetSearchParams:i,toggleFold:w}=Ye(o),{pageState:E,showPagination:U,pageSizesComputed:O,paginationLayoutComputed:ce,paginationBgComputed:se,setPage:ge,setPageSize:be,resetPage:ne}=Xe(o),{tableRef:S,selection:A,singleSelection:R,columnSettingVisible:ie,checkedColumns:fe,showColumnSetting:me,allColumns:de,visibleColumns:ye,tableComputedHeight:zt,tableMaxHeightProp:Tt,tableWrapperStyle:Nt,selectionCfg:I,handleSelectionChange:Ft,handleSingleSelect:Rt}=Qe(o,{authPass:p.authPass}),Ut=Ze(o,{searchParams:h,getActiveSearchParams:C,pageState:E,resetPage:ne,setTotal:B=>{E.total=B},selection:A,emit:(B,...x)=>m(B,...x),t:r}),{internalData:ke,loadingState:Te,hasCrud:K,fetchData:M,refreshTable:Ne,handleDelete:At,handleBatchDelete:Mt}=Ut,D=Je(o),we=e.ref(!1),{handleExport:$t}=_e(o,{visibleColumns:ye,getActiveSearchParams:C,dictLabel:u.dictLabel,internalData:ke,fetchData:M,setLoading:B=>{Te.value=B},getCurrentData:()=>o.data||ke.value,t:r}),$=e.computed(()=>({visible:!!D.formVisible.value,drawerMode:D.drawerMode,formMode:D.formMode.value||"add",editingRow:D.editingRow.value??null,formData:D.formData.value??{},drawerCfg:D.drawerCfg,saving:D.saving.value??!1,onVisibleChange:B=>{D.formVisible.value=B}})),ue=e.computed({get:()=>ie.value,set:B=>{ie.value=B}}),T=e.computed(()=>{if(o.actionConfig===!1)return Ee;const B={...Pe,label:r("formTable","operation"),viewText:r("formTable","view"),editText:r("formTable","edit"),deleteText:r("formTable","delete"),deleteConfirmTitle:r("formTable","confirmDelete"),deleteConfirmMessage:r("formTable","confirmDeleteMsg")};return o.actionConfig===!0?B:o.actionConfig?{...B,...o.actionConfig}:Ee}),Fe=e.computed(()=>{if(o.toolbarConfig===!1)return xe;const B={...Ke};return o.toolbarConfig===!0?{...B,show:!0}:o.toolbarConfig?{...B,...o.toolbarConfig}:xe}),Lt=e.computed(()=>K.value?ke.value:o.data||[]),Ot=e.computed(()=>Te.value||o.loading);function It(){ne();const B=C();m("search",B),K.value&&M()}function Pt(){i(),m("search-reset"),K.value?M():m("search",{})}function Kt(B){ge(B),m("current-change",B),m("page-change",{currentPage:B,pageSize:E.pageSize}),K.value&&M()}function qt(B){be(B),ne(),m("size-change",B),m("page-change",{currentPage:1,pageSize:B}),K.value&&M()}function Ht(){var x;D.openAdd();const B={};for(const y of o.columns)((x=y.form)==null?void 0:x.defaultValue)!==void 0&&(B[y.prop]=y.form.defaultValue);D.formData.value={...B},m("add")}function jt(B){D.openEdit(B),m("edit",B)}function Gt(B){D.openView(B),m("view",B)}function Wt(B){At(B,T.value.confirmDelete!==!1,T.value.deleteConfirmTitle,T.value.deleteConfirmMessage)}function Yt(){Mt()}function Xt(){m("export"),$t()}async function Qt(){we.value=!0;try{await Ne(),d.ElMessage.success(r("formTable","refreshSuccess"))}finally{we.value=!1}}async function Zt(){var B,x;D.saving.value=!0;try{m("form-save",{...D.formData.value},D.formMode.value==="edit"),D.formMode.value==="edit"&&((B=o.crudConfig)!=null&&B.api.edit)?(await o.crudConfig.api.edit(D.formData.value),d.ElMessage.success(r("formTable","editSuccess")),m("edit-success")):D.formMode.value==="add"&&((x=o.crudConfig)!=null&&x.api.add)&&(await o.crudConfig.api.add(D.formData.value),d.ElMessage.success(r("formTable","addSuccess")),m("add-success")),D.closeForm(),await M()}catch(y){m("request-error",y)}finally{D.saving.value=!1}}const Jt=e.computed(()=>{const B={};for(const x of Object.keys(o))!He.includes(x)&&!x.startsWith("on")&&(B[x]=o[x]);return B});function _t(B){const x={};for(const[y,z]of Object.entries(B))je.includes(y)||(x[y]=z);return x}return e.onMounted(()=>{c(),K.value&&M()}),a({refresh:Ne,fetchData:M,getSelection:()=>A.value,tableRef:S}),(B,x)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ee-form-table",[`ee-size--${t.size}`,{"ee-stripe":t.stripe,"ee-border":t.border}]])},[e.createVNode(et,{"show-search":!!e.unref(g),"search-params":e.unref(h),"visible-search-fields":e.unref(s),"search-cols":e.unref(n),"action-col-span":e.unref(b),"show-fold-btn":!!e.unref(f),"search-expanded":!!e.unref(k),size:t.size,"resolve-dict":e.unref(u).resolvedDict,onSearch:It,onReset:Pt,onToggleFold:e.unref(w)},{"search-action":e.withCtx(({params:y})=>[e.renderSlot(B.$slots,"search-action",{params:y})]),_:3},8,["show-search","search-params","visible-search-fields","search-cols","action-col-span","show-fold-btn","search-expanded","size","resolve-dict","onToggleFold"]),e.createVNode(dt,{show:!!Fe.value.show,"toolbar-cfg":Fe.value,size:t.size,refreshing:we.value,deps:{authPass:e.unref(p).authPass,selectionCount:e.unref(A).length,showColumnSetting:!!e.unref(me)},onAdd:Ht,onImport:x[0]||(x[0]=y=>B.$emit("import")),onExport:Xt,onBatchDelete:Yt,onRefresh:Qt,onColumnSetting:x[1]||(x[1]=y=>ue.value=!0)},{"toolbar-right":e.withCtx(()=>[e.renderSlot(B.$slots,"toolbar-right")]),_:3},8,["show","toolbar-cfg","size","refreshing","deps"]),e.createElementVNode("div",{class:"ee-table-wrapper",style:e.normalizeStyle(e.unref(Nt))},[e.createVNode(e.unref(d.ElTable),e.mergeProps({ref_key:"tableRef",ref:S,data:Lt.value,loading:Ot.value,size:t.size,stripe:t.stripe,border:t.border,height:e.unref(zt),"max-height":e.unref(Tt),"highlight-current-row":t.highlightCurrentRow,"row-key":t.rowKey,onSelectionChange:x[2]||(x[2]=y=>{e.unref(Ft)(y),B.$emit("selection-change",y)}),onRowClick:x[3]||(x[3]=y=>B.$emit("row-click",y)),onRowDblclick:x[4]||(x[4]=y=>B.$emit("row-dblclick",y)),onSortChange:x[5]||(x[5]=y=>B.$emit("sort-change",y))},Jt.value),{empty:e.withCtx(()=>[e.renderSlot(B.$slots,"empty",{},()=>[e.createVNode(e.unref(d.ElEmpty),{description:t.emptyText||e.unref(r)("formTable","empty")},null,8,["description"])])]),default:e.withCtx(()=>[e.unref(I).show&&e.unref(I).type==="multiple"?(e.openBlock(),e.createBlock(e.unref(d.ElTableColumn),{key:0,type:"selection",width:"50",fixed:"left",selectable:e.unref(I).disabledRow?y=>!e.unref(I).disabledRow(y):void 0,"reserve-selection":e.unref(I).reserveSelection},null,8,["selectable","reserve-selection"])):e.createCommentVNode("",!0),e.unref(I).show&&e.unref(I).type==="single"?(e.openBlock(),e.createBlock(e.unref(d.ElTableColumn),{key:1,width:"50",fixed:"left"},{default:e.withCtx(({row:y})=>[e.createVNode(e.unref(d.ElRadio),{"model-value":e.unref(R)===y[t.rowKey||"id"],value:y[t.rowKey||"id"],onChange:()=>{e.unref(Rt)(y),B.$emit("selection-change",e.unref(A))}},null,8,["model-value","value","onChange"])]),_:1})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ye),y=>(e.openBlock(),e.createBlock(e.unref(d.ElTableColumn),e.mergeProps({key:y.prop,prop:y.prop,label:y.label,width:y.width,"min-width":y.minWidth,fixed:y.fixed,sortable:y.sortable,align:y.align||"center","class-name":y.className},{ref_for:!0},_t(y)),{default:e.withCtx(z=>[e.renderSlot(B.$slots,y.slotName||y.prop,{row:z.row,index:z.$index,column:y},()=>[y.formatter?(e.openBlock(),e.createElementBlock("span",st,e.toDisplayString(y.formatter(z.row,y,z.row[y.prop],z.$index)),1)):y.dictKey?(e.openBlock(),e.createElementBlock("span",ft,e.toDisplayString(e.unref(u).dictLabel(y.dictKey,z.row[y.prop])),1)):(e.openBlock(),e.createElementBlock("span",mt,e.toDisplayString(z.row[y.prop]??"-"),1))])]),_:2},1040,["prop","label","width","min-width","fixed","sortable","align","class-name"]))),128)),T.value.show?(e.openBlock(),e.createBlock(e.unref(d.ElTableColumn),{key:2,label:T.value.label||e.unref(r)("formTable","operation"),width:T.value.width,fixed:T.value.fixed??"right",align:T.value.align||"center"},{default:e.withCtx(({row:y})=>[e.renderSlot(B.$slots,"action-before",{row:y}),T.value.showView&&e.unref(p).authPass(T.value.viewAuth)?(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:0,type:"primary",link:"",size:t.size,onClick:z=>Gt(y)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(T.value.viewText||e.unref(r)("formTable","view")),1)]),_:1},8,["size","onClick"])):e.createCommentVNode("",!0),T.value.showEdit&&e.unref(p).authPass(T.value.editAuth)?(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:1,type:"primary",link:"",size:t.size,onClick:z=>jt(y)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(T.value.editText||e.unref(r)("formTable","edit")),1)]),_:1},8,["size","onClick"])):e.createCommentVNode("",!0),T.value.showDelete&&e.unref(p).authPass(T.value.deleteAuth)?(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:2,type:"danger",link:"",size:t.size,onClick:z=>Wt(y)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(T.value.deleteText||e.unref(r)("formTable","delete")),1)]),_:1},8,["size","onClick"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value.customButtons||[],z=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:z.code},[(!z.show||z.show(y))&&e.unref(p).authPass(z.auth)?(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:0,type:z.type||"default",link:"",size:t.size,onClick:la=>z.handler(y)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(z.text),1)]),_:2},1032,["type","size","onClick"])):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(B.$slots,"action",{row:y})]),_:3},8,["label","width","fixed","align"])):e.createCommentVNode("",!0)]),_:3},16,["data","loading","size","stripe","border","height","max-height","highlight-current-row","row-key"])],4),e.unref(U)?(e.openBlock(),e.createElementBlock("div",ut,[e.createVNode(e.unref(d.ElPagination),{"current-page":e.unref(E).current,"onUpdate:currentPage":x[6]||(x[6]=y=>e.unref(E).current=y),"page-size":e.unref(E).pageSize,"onUpdate:pageSize":x[7]||(x[7]=y=>e.unref(E).pageSize=y),"page-sizes":e.unref(O),total:e.unref(E).total,layout:e.unref(ce),background:e.unref(se),size:t.size,onCurrentChange:Kt,onSizeChange:qt},null,8,["current-page","page-size","page-sizes","total","layout","background","size"])])):e.createCommentVNode("",!0),e.createVNode(ct,{visible:$.value.visible,"drawer-mode":$.value.drawerMode,"form-mode":$.value.formMode,"editing-row":$.value.editingRow,"form-data":$.value.formData,"drawer-cfg":$.value.drawerCfg,columns:e.unref(ye),size:t.size,saving:$.value.saving,"dict-map":t.dictMap,"onUpdate:visible":$.value.onVisibleChange,onSave:Zt},e.createSlots({_:2},[B.$slots["add-form"]?{name:"add-form",fn:e.withCtx(y=>[e.renderSlot(B.$slots,"add-form",e.normalizeProps(e.guardReactiveProps(y)))]),key:"0"}:void 0,B.$slots["edit-form"]?{name:"edit-form",fn:e.withCtx(y=>[e.renderSlot(B.$slots,"edit-form",e.normalizeProps(e.guardReactiveProps(y)))]),key:"1"}:void 0,B.$slots["view-form"]?{name:"view-form",fn:e.withCtx(y=>[e.renderSlot(B.$slots,"view-form",e.normalizeProps(e.guardReactiveProps(y)))]),key:"2"}:void 0]),1032,["visible","drawer-mode","form-mode","editing-row","form-data","drawer-cfg","columns","size","saving","dict-map","onUpdate:visible"]),e.createVNode(e.unref(d.ElDialog),{modelValue:ue.value,"onUpdate:modelValue":x[10]||(x[10]=y=>ue.value=y),title:e.unref(r)("formTable","columnSetting"),width:"400px","close-on-click-modal":!1},{footer:e.withCtx(()=>[e.createVNode(e.unref(d.ElButton),{size:t.size,round:"",onClick:x[9]||(x[9]=y=>ue.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("formTable","close")),1)]),_:1},8,["size"])]),default:e.withCtx(()=>[e.createVNode(e.unref(d.ElCheckboxGroup),{modelValue:e.unref(fe),"onUpdate:modelValue":x[8]||(x[8]=y=>e.isRef(fe)?fe.value=y:null)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(de),y=>(e.openBlock(),e.createBlock(e.unref(d.ElCheckbox),{key:y.prop,value:y.prop,label:y.label},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue","title"])],2))}});X.install=t=>{t.component(X.name??"EeFormTable",X)};const pt={key:1,class:"ee-no-more"},ht={class:"ee-loading-tip"},Q=G(e.defineComponent({name:"EeRemoteSelect",__name:"index",props:{modelValue:{},apiUrl:{},detailEchoUrl:{},mode:{default:"single"},labelField:{default:"label"},valueField:{default:"value"},searchKey:{default:"keyword"},pageNumKey:{default:"pageNum"},pageSizeKey:{default:"pageSize"},pageSize:{default:20},extraParams:{},requestInstance:{},placeholder:{},clearable:{type:Boolean,default:!0},disabled:{type:Boolean},readonly:{type:Boolean},filterable:{type:Boolean,default:!0},size:{default:"default"},options:{}},emits:["update:modelValue","change","clear","blur","focus","search","load-success"],setup(t,{emit:a}){const l=t,r=a,{t:o}=N(),{loading:m,options:p,noMore:u,loadData:k,loadMore:h,resetList:g,onKeywordChange:n}=q({apiUrl:l.apiUrl,pageNumKey:l.pageNumKey,pageSizeKey:l.pageSizeKey,pageSize:l.pageSize,searchKey:l.searchKey,extraParams:l.extraParams,labelField:l.labelField,valueField:l.valueField});function s(C){return{value:C[l.valueField],label:C[l.labelField],disabled:C.disabled??!1}}const f=e.computed(()=>l.options?l.options.map(s):p.value.map(s));async function b(C=!1){l.options||await k(void 0,!0)}function c(C){C&&f.value.length===0&&!l.options&&b()}return e.onMounted(()=>{b()}),e.watch(()=>l.apiUrl,()=>{g(),b()}),(C,i)=>(e.openBlock(),e.createBlock(e.unref(d.ElSelect),e.mergeProps(C.$attrs,{"model-value":t.modelValue,loading:e.unref(m),multiple:t.mode==="multiple",placeholder:t.placeholder,clearable:t.clearable,disabled:t.disabled,readonly:t.readonly,filterable:t.filterable,size:t.size,remote:!l.options,"remote-method":l.options?void 0:e.unref(n),"onUpdate:modelValue":i[1]||(i[1]=w=>r("update:modelValue",w)),onChange:i[2]||(i[2]=w=>r("change",w)),onClear:i[3]||(i[3]=w=>r("clear")),onBlur:i[4]||(i[4]=w=>r("blur",w)),onFocus:i[5]||(i[5]=w=>r("focus",w)),onVisibleChange:c}),{loading:e.withCtx(()=>[e.createElementVNode("div",ht,[e.createElementVNode("span",null,e.toDisplayString(e.unref(o)("remoteSelect","loading")),1)])]),default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,w=>(e.openBlock(),e.createBlock(e.unref(d.ElOption),{key:w.value,label:w.label,value:w.value,disabled:w.disabled},null,8,["label","value","disabled"]))),128)),!l.options&&!e.unref(u)&&!e.unref(m)&&f.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"ee-load-more",onClick:i[0]||(i[0]=(...w)=>e.unref(h)&&e.unref(h)(...w))},[e.createElementVNode("span",null,e.toDisplayString(e.unref(o)("remoteSelect","loadMore")),1)])):e.createCommentVNode("",!0),!l.options&&e.unref(u)&&f.value.length>0?(e.openBlock(),e.createElementBlock("div",pt,[e.createElementVNode("span",null,e.toDisplayString(e.unref(o)("remoteSelect","noMore")),1)])):e.createCommentVNode("",!0)]),_:1},16,["model-value","loading","multiple","placeholder","clearable","disabled","readonly","filterable","size","remote","remote-method"]))}}),[["__scopeId","data-v-21c5d143"]]);Q.install=t=>{t.component(Q.name??"EeRemoteSelect",Q)};const Z=e.defineComponent({name:"EeDeptCascader",__name:"index",props:{modelValue:{},deptApiUrl:{default:"/api/system/dept/tree"},detailEchoUrl:{default:"/api/system/dept/detail"},labelField:{default:"label"},valueField:{default:"value"},childrenField:{default:"children"},showAllLevels:{type:Boolean,default:!0},extraParams:{},requestInstance:{},placeholder:{},clearable:{type:Boolean,default:!0},disabled:{type:Boolean},size:{default:"default"}},emits:["update:modelValue","change","clear","blur","focus","load-success"],setup(t,{emit:a}){const l=t,r=a;function o(i){r("update:modelValue",i)}function m(i){r("change",i)}function p(){r("clear")}function u(i){r("blur",i)}function k(i){r("focus",i)}const h=l.requestInstance??e.inject(re);if(!h)throw new Error("[EasyEPUI] 请配置 requestInstance:可通过 app.use(EasyEpUI, { requestInstance }) 全局注入,或通过 props 传入");const g=h,{t:n}=N(),s=e.ref([]),f=e.ref(!1),b=e.computed(()=>({label:l.labelField,value:l.valueField,children:l.childrenField,multiple:!1,checkStrictly:!0}));async function c(){f.value=!0;try{const i={...l.extraParams||{}},E=(await g.get(l.deptApiUrl,{params:i})).data,U=Array.isArray(E)?E:(E==null?void 0:E.data)??[];s.value=C(U),r("load-success",s.value)}catch(i){d.ElMessage.error((i==null?void 0:i.msg)||(i==null?void 0:i.message)||n("remoteSelect","requestFailed")),s.value=[]}finally{f.value=!1}}function C(i){return i.map(w=>{const E={...w,label:w[l.labelField]??"",value:w[l.valueField]??""};return w[l.childrenField]&&Array.isArray(w[l.childrenField])&&w[l.childrenField].length>0&&(E.children=C(w[l.childrenField])),E})}return e.onMounted(()=>{c()}),(i,w)=>(e.openBlock(),e.createBlock(e.unref(d.ElCascader),e.mergeProps(i.$attrs,{"model-value":t.modelValue,options:s.value,props:b.value,placeholder:t.placeholder,clearable:t.clearable,disabled:t.disabled,size:t.size,"show-all-levels":t.showAllLevels,"onUpdate:modelValue":w[0]||(w[0]=E=>o(E)),onChange:w[1]||(w[1]=E=>m(E)),onClear:w[2]||(w[2]=E=>p()),onBlur:w[3]||(w[3]=E=>u(E)),onFocus:w[4]||(w[4]=E=>k(E))}),null,16,["model-value","options","props","placeholder","clearable","disabled","size","show-all-levels"]))}});Z.install=t=>{t.component(Z.name??"EeDeptCascader",Z)};const gt={key:1,class:"ee-no-more"},bt={class:"ee-loading-tip"},J=G(e.defineComponent({name:"EeUserSelect",__name:"index",props:{modelValue:{},apiUrl:{default:"/api/system/user/page"},detailEchoUrl:{default:"/api/system/user/detail"},mode:{default:"single"},deptId:{},labelField:{default:"label"},valueField:{default:"value"},searchKey:{default:"keyword"},extraParams:{},requestInstance:{},placeholder:{},clearable:{type:Boolean,default:!0},disabled:{type:Boolean},readonly:{type:Boolean},filterable:{type:Boolean,default:!0},size:{default:"default"}},emits:["update:modelValue","change","clear","blur","focus","search","load-success"],setup(t,{emit:a}){const l=t,r=a,{t:o}=N(),m=e.computed(()=>{const c={...l.extraParams||{}};return l.deptId!==void 0&&l.deptId!==null&&l.deptId!==""&&(c.deptId=l.deptId),c}),{loading:p,options:u,noMore:k,loadData:h,loadMore:g,resetList:n,onKeywordChange:s}=q({apiUrl:l.apiUrl,pageSizeKey:"pageSize",pageNumKey:"pageNum",pageSize:20,searchKey:l.searchKey,extraParams:m.value,labelField:l.labelField,valueField:l.valueField}),f=e.computed(()=>u.value.map(c=>({value:c[l.valueField],label:c[l.labelField],disabled:c.disabled??!1})));function b(c){c&&f.value.length===0&&h(void 0,!0)}return e.onMounted(()=>{h(void 0,!0)}),e.watch(()=>l.deptId,()=>{n(),h(void 0,!0)}),(c,C)=>(e.openBlock(),e.createBlock(e.unref(d.ElSelect),e.mergeProps(c.$attrs,{"model-value":t.modelValue,loading:e.unref(p),multiple:t.mode==="multiple",placeholder:t.placeholder,clearable:t.clearable,disabled:t.disabled,readonly:t.readonly,filterable:t.filterable,size:t.size,remote:!0,"remote-method":e.unref(s),"onUpdate:modelValue":C[1]||(C[1]=i=>r("update:modelValue",i)),onChange:C[2]||(C[2]=i=>r("change",i)),onClear:C[3]||(C[3]=i=>r("clear")),onBlur:C[4]||(C[4]=i=>r("blur",i)),onFocus:C[5]||(C[5]=i=>r("focus",i)),onVisibleChange:b}),{loading:e.withCtx(()=>[e.createElementVNode("div",bt,[e.createElementVNode("span",null,e.toDisplayString(e.unref(o)("remoteSelect","loading")),1)])]),default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,i=>(e.openBlock(),e.createBlock(e.unref(d.ElOption),{key:i.value,label:i.label,value:i.value,disabled:i.disabled},null,8,["label","value","disabled"]))),128)),!e.unref(k)&&!e.unref(p)&&f.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"ee-load-more",onClick:C[0]||(C[0]=(...i)=>e.unref(g)&&e.unref(g)(...i))},[e.createElementVNode("span",null,e.toDisplayString(e.unref(o)("remoteSelect","loadMore")),1)])):e.createCommentVNode("",!0),e.unref(k)&&f.value.length>0?(e.openBlock(),e.createElementBlock("div",gt,[e.createElementVNode("span",null,e.toDisplayString(e.unref(o)("remoteSelect","noMore")),1)])):e.createCommentVNode("",!0)]),_:1},16,["model-value","loading","multiple","placeholder","clearable","disabled","readonly","filterable","size","remote-method"]))}}),[["__scopeId","data-v-6e78b80d"]]);J.install=t=>{t.component(J.name??"EeUserSelect",J)};const yt={key:1,class:"ee-no-more"},kt={class:"ee-loading-tip"},_=G(e.defineComponent({name:"EeRoleSelect",__name:"index",props:{modelValue:{},apiUrl:{default:"/api/system/role/page"},detailEchoUrl:{default:"/api/system/role/detail"},mode:{default:"single"},labelField:{default:"label"},valueField:{default:"value"},searchKey:{default:"keyword"},extraParams:{},requestInstance:{},placeholder:{},clearable:{type:Boolean,default:!0},disabled:{type:Boolean},readonly:{type:Boolean},filterable:{type:Boolean,default:!0},size:{default:"default"}},emits:["update:modelValue","change","clear","blur","focus","search","load-success"],setup(t,{emit:a}){const l=t,r=a,{t:o}=N(),{loading:m,options:p,noMore:u,loadData:k,loadMore:h,onKeywordChange:g}=q({apiUrl:l.apiUrl,pageSizeKey:"pageSize",pageNumKey:"pageNum",pageSize:20,searchKey:l.searchKey,extraParams:l.extraParams,labelField:l.labelField,valueField:l.valueField}),n=e.computed(()=>p.value.map(f=>({value:f[l.valueField],label:f[l.labelField],disabled:f.disabled??!1})));function s(f){f&&n.value.length===0&&k(void 0,!0)}return e.onMounted(()=>{k(void 0,!0)}),(f,b)=>(e.openBlock(),e.createBlock(e.unref(d.ElSelect),e.mergeProps(f.$attrs,{"model-value":t.modelValue,loading:e.unref(m),multiple:t.mode==="multiple",placeholder:t.placeholder,clearable:t.clearable,disabled:t.disabled,readonly:t.readonly,filterable:t.filterable,size:t.size,remote:!0,"remote-method":e.unref(g),"onUpdate:modelValue":b[1]||(b[1]=c=>r("update:modelValue",c)),onChange:b[2]||(b[2]=c=>r("change",c)),onClear:b[3]||(b[3]=c=>r("clear")),onBlur:b[4]||(b[4]=c=>r("blur",c)),onFocus:b[5]||(b[5]=c=>r("focus",c)),onVisibleChange:s}),{loading:e.withCtx(()=>[e.createElementVNode("div",kt,[e.createElementVNode("span",null,e.toDisplayString(e.unref(o)("remoteSelect","loading")),1)])]),default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,c=>(e.openBlock(),e.createBlock(e.unref(d.ElOption),{key:c.value,label:c.label,value:c.value,disabled:c.disabled},null,8,["label","value","disabled"]))),128)),!e.unref(u)&&!e.unref(m)&&n.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"ee-load-more",onClick:b[0]||(b[0]=(...c)=>e.unref(h)&&e.unref(h)(...c))},[e.createElementVNode("span",null,e.toDisplayString(e.unref(o)("remoteSelect","loadMore")),1)])):e.createCommentVNode("",!0),e.unref(u)&&n.value.length>0?(e.openBlock(),e.createElementBlock("div",yt,[e.createElementVNode("span",null,e.toDisplayString(e.unref(o)("remoteSelect","noMore")),1)])):e.createCommentVNode("",!0)]),_:1},16,["model-value","loading","multiple","placeholder","clearable","disabled","readonly","filterable","size","remote-method"]))}}),[["__scopeId","data-v-58cd12c9"]]);_.install=t=>{t.component(_.name??"EeRoleSelect",_)};const wt=["#409eff","#67c23a","#e6a23c","#f56c6c","#909399","#8b5cf6","#ec4899","#06b6d4","#f97316","#6366f1"],L="PingFang SC, Microsoft YaHei, sans-serif",v={color:wt,title:{textStyle:{fontSize:16,fontWeight:600,fontFamily:L,color:"#303133"},subtextStyle:{fontSize:12,fontFamily:L,color:"#909399"},left:0,top:0},tooltip:{trigger:"axis",backgroundColor:"rgba(255, 255, 255, 0.95)",borderWidth:0,borderRadius:4,padding:[8,12],textStyle:{fontSize:12,fontFamily:L,color:"#303133"},extraCssText:"box-shadow: 0 2px 12px rgba(0,0,0,0.1);"},legend:{type:"plain",top:30,left:0,itemWidth:14,itemHeight:10,textStyle:{fontSize:12,fontFamily:L,color:"#606266"}},grid:{top:70,right:20,bottom:30,left:50,containLabel:!0},xAxis:{type:"category",axisLine:{show:!0,lineStyle:{color:"#dcdfe6",width:1}},axisTick:{alignWithLabel:!0},axisLabel:{fontSize:11,fontFamily:L,color:"#909399"},splitLine:{show:!1}},yAxis:{type:"value",axisLine:{show:!1},axisTick:{show:!1},axisLabel:{fontSize:11,fontFamily:L,color:"#909399"},splitLine:{show:!0,lineStyle:{color:"#ebeef5",type:"dashed"}}},series:{bar:{barMaxWidth:40,itemStyle:{borderRadius:[2,2,0,0]}},line:{lineStyle:{width:2},itemStyle:{borderWidth:2}},pie:{label:{fontSize:12,fontFamily:L,color:"#606266"},labelLine:{lineStyle:{color:"#dcdfe6"}}},radar:{lineStyle:{width:2},areaStyle:{opacity:.15}}}},Bt={text:"数据加载中...",color:"#409eff",textColor:"#909399",maskColor:"rgba(255, 255, 255, 0.8)",fontSize:13};function F(t,a){if(!a)return t;const l={...t};for(const r of Object.keys(a)){const o=a[r];o!=null&&(Array.isArray(o)||Array.isArray(l[r])?l[r]=o:typeof o=="object"&&typeof l[r]=="object"?l[r]=F(l[r],o):l[r]=o)}return l}function ee(t,a={}){const l=e.shallowRef(),r=e.ref(!1);let o=null,m=null;function p(){t.value&&(l.value&&l.value.dispose(),l.value=Ae.init(t.value),r.value=!0)}function u(s,f=!1){l.value&&l.value.setOption(s,{notMerge:f})}function k(){m&&clearTimeout(m),m=setTimeout(()=>{var s;(s=l.value)==null||s.resize()},200)}function h(){var s;(s=l.value)==null||s.showLoading("default",Bt)}function g(){var s;(s=l.value)==null||s.hideLoading()}function n(){o&&(o.disconnect(),o=null),m&&(clearTimeout(m),m=null),l.value&&(l.value.dispose(),l.value=void 0),r.value=!1}return e.onMounted(()=>{e.nextTick(()=>{p(),a.isAutoResize!==!1&&t.value&&(o=new ResizeObserver(()=>k()),o.observe(t.value))})}),e.onUnmounted(()=>{n()}),{instance:l,isReady:r,setOption:u,handleResize:k,showLoading:h,hideLoading:g,destroy:n}}const te=e.defineComponent({name:"EeBaseBar",__name:"index",props:{width:{default:"100%"},height:{default:"400px"},xAxisData:{default:()=>[]},seriesData:{default:()=>[]},isStack:{type:Boolean,default:!1},barWidth:{},title:{},legendShow:{type:Boolean,default:!0},tooltipShow:{type:Boolean,default:!0},extraOption:{},isAutoResize:{type:Boolean,default:!0}},setup(t){const a=t,l=e.ref(),{isReady:r,setOption:o,showLoading:m,hideLoading:p}=ee(l,{isAutoResize:a.isAutoResize}),u=e.computed(()=>a.seriesData.map(h=>({name:h.name,type:"bar",data:h.data,barWidth:a.barWidth,stack:a.isStack?"total":h.stack||void 0,itemStyle:h.color?{color:h.color}:void 0}))),k=e.computed(()=>{let h=F({},v);return h=F(h,{tooltip:{show:a.tooltipShow,trigger:"axis"},legend:{show:a.legendShow,data:a.seriesData.map(g=>g.name)},title:a.title?{text:a.title,show:!0}:{show:!1},grid:{top:a.title?70:40},xAxis:{data:a.xAxisData},series:u.value}),a.extraOption&&(h=F(h,a.extraOption)),h});return e.watch(k,h=>{r.value&&o(h,!0)},{deep:!0}),e.onMounted(()=>{e.nextTick(()=>{(a.xAxisData.length>0||a.seriesData.length>0)&&o(k.value,!0)})}),(h,g)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({ref_key:"chartRef",ref:l,style:{width:t.width,height:t.height}},h.$attrs),null,16))}});te.install=t=>{t.component(te.name??"EeBaseBar",te)};const ae=e.defineComponent({name:"EeBaseLine",__name:"index",props:{width:{default:"100%"},height:{default:"400px"},xAxisData:{default:()=>[]},seriesData:{default:()=>[]},isSmooth:{type:Boolean,default:!1},showSymbol:{type:Boolean,default:!0},isArea:{type:Boolean,default:!1},title:{},legendShow:{type:Boolean,default:!0},tooltipShow:{type:Boolean,default:!0},extraOption:{},isAutoResize:{type:Boolean,default:!0}},setup(t){const a=t,l=e.ref(),{isReady:r,setOption:o}=ee(l,{isAutoResize:a.isAutoResize}),m=e.computed(()=>a.seriesData.map(u=>({name:u.name,type:"line",data:u.data,smooth:a.isSmooth,showSymbol:a.showSymbol,symbol:"circle",symbolSize:6,lineStyle:u.color?{color:u.color}:void 0,itemStyle:u.color?{color:u.color}:void 0,areaStyle:a.isArea?{opacity:.15}:void 0}))),p=e.computed(()=>{let u=F({},v);return u=F(u,{tooltip:{show:a.tooltipShow,trigger:"axis"},legend:{show:a.legendShow,data:a.seriesData.map(k=>k.name)},title:a.title?{text:a.title,show:!0}:{show:!1},grid:{top:a.title?70:40},xAxis:{data:a.xAxisData},series:m.value}),a.extraOption&&(u=F(u,a.extraOption)),u});return e.watch(p,u=>{r.value&&o(u,!0)},{deep:!0}),e.onMounted(()=>{e.nextTick(()=>{(a.xAxisData.length>0||a.seriesData.length>0)&&o(p.value,!0)})}),(u,k)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({ref_key:"chartRef",ref:l,style:{width:t.width,height:t.height}},u.$attrs),null,16))}});ae.install=t=>{t.component(ae.name??"EeBaseLine",ae)};const le=e.defineComponent({name:"EeBasePie",__name:"index",props:{width:{default:"100%"},height:{default:"400px"},pieData:{default:()=>[]},isRing:{type:Boolean,default:!1},radius:{},labelShow:{type:Boolean,default:!0},title:{},legendShow:{type:Boolean,default:!0},tooltipShow:{type:Boolean,default:!0},extraOption:{},isAutoResize:{type:Boolean,default:!0}},setup(t){const a=t,l=e.ref(),{isReady:r,setOption:o}=ee(l,{isAutoResize:a.isAutoResize}),m=e.computed(()=>a.radius?a.radius:a.isRing?["40%","60%"]:["0%","60%"]),p=e.computed(()=>{let u=F({},v);return u=F(u,{tooltip:{show:a.tooltipShow,trigger:"item"},legend:{show:a.legendShow,top:"bottom"},title:a.title?{text:a.title,show:!0}:{show:!1},grid:void 0,xAxis:void 0,yAxis:void 0,series:[{type:"pie",radius:m.value,center:["50%","50%"],data:a.pieData,label:{show:a.labelShow},emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.15)"}}}]}),a.extraOption&&(u=F(u,a.extraOption)),u});return e.watch(p,u=>{r.value&&o(u,!0)},{deep:!0}),e.onMounted(()=>{e.nextTick(()=>{a.pieData.length>0&&o(p.value,!0)})}),(u,k)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({ref_key:"chartRef",ref:l,style:{width:t.width,height:t.height}},u.$attrs),null,16))}});le.install=t=>{t.component(le.name??"EeBasePie",le)};const oe=e.defineComponent({name:"EeBaseRadar",__name:"index",props:{width:{default:"100%"},height:{default:"400px"},indicator:{default:()=>[]},seriesData:{default:()=>[]},isFill:{type:Boolean,default:!0},title:{},legendShow:{type:Boolean,default:!0},tooltipShow:{type:Boolean,default:!0},extraOption:{},isAutoResize:{type:Boolean,default:!0}},setup(t){const a=t,l=e.ref(),{isReady:r,setOption:o}=ee(l,{isAutoResize:a.isAutoResize}),m=e.computed(()=>a.seriesData.map(u=>({name:u.name,type:"radar",data:[u.value],symbol:"none",lineStyle:u.color?{color:u.color}:void 0,itemStyle:u.color?{color:u.color}:void 0,areaStyle:a.isFill?{opacity:.15}:void 0}))),p=e.computed(()=>{let u=F({},v);return u=F(u,{tooltip:{show:a.tooltipShow,trigger:"item"},legend:{show:a.legendShow,data:a.seriesData.map(k=>k.name)},title:a.title?{text:a.title,show:!0}:{show:!1},grid:void 0,xAxis:void 0,yAxis:void 0,radar:{indicator:a.indicator,radius:"65%",shape:"polygon",name:{textStyle:{fontSize:12,color:"#606266"}},splitLine:{lineStyle:{color:"#ebeef5"}},splitArea:{areaStyle:{color:["rgba(64,158,255,0.02)","rgba(64,158,255,0.05)"]}},axisLine:{lineStyle:{color:"#dcdfe6"}}},series:m.value}),a.extraOption&&(u=F(u,a.extraOption)),u});return e.watch(p,u=>{r.value&&o(u,!0)},{deep:!0}),e.onMounted(()=>{e.nextTick(()=>{a.indicator.length>0&&a.seriesData.length>0&&o(p.value,!0)})}),(u,k)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({ref_key:"chartRef",ref:l,style:{width:t.width,height:t.height}},u.$attrs),null,16))}});oe.install=t=>{t.component(oe.name??"EeBaseRadar",oe)};const Ct=[te,ae,le,oe],St={formTable:{operation:"Actions",add:"Add",edit:"Edit",delete:"Delete",view:"View",import:"Import",export:"Export",batchDelete:"Batch Delete",refresh:"Refresh",columnSetting:"Columns",search:"Search",reset:"Reset",expand:"Expand",collapse:"Collapse",empty:"No data",confirm:"OK",cancel:"Cancel",close:"Close",confirmDelete:"Confirm Delete",confirmDeleteMsg:"Are you sure you want to delete this item?",confirmBatchDelete:"Confirm Batch Delete",confirmBatchDeleteMsg:"Are you sure you want to delete the selected {count} items?",addTitle:"Add",editTitle:"Edit",viewTitle:"View",addSuccess:"Add successful",editSuccess:"Update successful",deleteSuccess:"Delete successful",batchDeleteSuccess:"Batch delete successful",refreshSuccess:"Refresh successful",exportSuccess:"Export successful",exportFail:"Export failed",requestFailed:"Request failed",deleteFailed:"Delete failed",batchDeleteFailed:"Batch delete failed",installXlsx:"Please install xlsx dependency: npm install xlsx",exportFileName:"export.xlsx",inputPlaceholder:"Please enter {label}",selectPlaceholder:"Please select {label}",dateRangeTo:"to",dateRangeStart:"Start date",dateRangeEnd:"End date"},searchBar:{search:"Search",reset:"Reset",expand:"Expand",collapse:"Collapse",inputPlaceholder:"Please enter {label}",selectPlaceholder:"Please select {label}",dateRangeTo:"to",dateRangeStart:"Start date",dateRangeEnd:"End date"},formDialog:{confirm:"OK",cancel:"Cancel",title:"Form",inputPlaceholder:"Please enter {label}",textareaPlaceholder:"Please enter {label}",selectPlaceholder:"Please select {label}",datePickerPlaceholder:"Please select {label}"},remoteSelect:{loading:"Loading...",noMore:"No more data",loadMore:"Load more",searchPlaceholder:"Please enter keyword",requestFailed:"Request failed",noData:"No data"}};function De(t,a){if(!t)return a;const l={};for(const r of["formTable","searchBar","formDialog","remoteSelect"])l[r]={...a[r],...t[r]};return l}function Et(t){const{requestInstance:a,detailApiUrl:l,labelField:r="label",valueField:o="value",mode:m="single"}=t,p=a??e.inject(re);if(!p)throw new Error("[EasyEPUI] 请配置 requestInstance:可通过 app.use(EasyEpUI, { requestInstance }) 全局注入,或通过 props 传入");const u=p;N();const k=e.ref("");function h(s){return typeof s=="number"?!0:typeof s=="string"?/^\d+(\.\d+)?$/.test(s.trim()):!1}async function g(s){try{const b=(await u.get(l,{params:{id:s}})).data,c=(b==null?void 0:b.data)||b;return String(c?c[r]??c[o]??"":s)}catch{return String(s)}}async function n(s){if(s==null||s===""){k.value=m==="multiple"?[]:"";return}if(m==="multiple"&&Array.isArray(s)){if(s.length===0){k.value=[];return}const f=s[0];if(h(f)){const b=await Promise.all(s.map(c=>g(c)));k.value=b}else k.value=s}else{if(m==="multiple"){k.value=[];return}const f=s;h(f)?k.value=await g(f):k.value=String(f)}}return{echoText:k,echoValue:n}}const xt={"zh-cn":P,en:St},re="eeRequestInstance",Vt=[H,j,W,Y,X,Q,Z,J,_,...Ct];function ze(t,a){let l=P;a!=null&&a.locale&&(typeof a.locale=="string"?l=xt[a.locale]||P:l=De(a.locale,P)),t.provide(pe,l),a!=null&&a.requestInstance&&t.provide(re,a.requestInstance),t.provide("eeGlobalConfig",{size:a==null?void 0:a.size,formTable:a==null?void 0:a.formTable,searchBar:a==null?void 0:a.searchBar,formDialog:a==null?void 0:a.formDialog,dictSelect:a==null?void 0:a.dictSelect,statusTag:a==null?void 0:a.statusTag,remoteSelect:a==null?void 0:a.remoteSelect,deptCascader:a==null?void 0:a.deptCascader,userSelect:a==null?void 0:a.userSelect,roleSelect:a==null?void 0:a.roleSelect}),Vt.forEach(r=>{t.use(r)})}const Dt={install:ze};V.EE_LOCALE_KEY=pe,V.EE_REQUEST_KEY=re,V.EeBaseBar=te,V.EeBaseLine=ae,V.EeBasePie=le,V.EeBaseRadar=oe,V.EeDeptCascader=Z,V.EeDictSelect=H,V.EeFormDialog=Y,V.EeFormTable=X,V.EeRemoteSelect=Q,V.EeRoleSelect=_,V.EeSearchBar=W,V.EeStatusTag=j,V.EeUserSelect=J,V.GLOBAL_CHART_CONFIG=v,V.deepMerge=F,V.default=Dt,V.install=ze,V.mergeLocale=De,V.useChart=ee,V.useRemoteSelectPagination=q,V.useSelectEcho=Et,Object.defineProperties(V,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .ee-search-bar[data-v-b65c74a4]{margin-bottom:16px}.ee-search-bar .el-form-item[data-v-b65c74a4]{margin-bottom:0}.ee-form-dialog-footer[data-v-560e642c]{display:flex;justify-content:flex-end;gap:12px}.ee-form-table{display:flex;flex-direction:column;height:100%;background:#fff;border-radius:4px}.ee-search-area{padding:16px 16px 0;border-bottom:1px solid #ebeef5}.ee-search-area .el-form-item{margin-bottom:16px}.ee-toolbar{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;flex-shrink:0}.ee-toolbar-left{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.ee-toolbar-right{display:flex;align-items:center;gap:8px}.ee-table-wrapper{flex:1;overflow:auto;padding:0 16px}.ee-table-wrapper .el-table{width:100%}.ee-pagination{display:flex;justify-content:flex-end;padding:12px 16px;border-top:1px solid #ebeef5;flex-shrink:0}.ee-size--small{font-size:13px}.ee-size--large{font-size:16px}
1
+ .ee-search-bar[data-v-fe481020]{margin-bottom:16px}.ee-search-bar .el-form-item[data-v-fe481020]{margin-bottom:0}.ee-form-dialog-footer[data-v-929d8568]{display:flex;justify-content:flex-end;gap:12px}.ee-form-table{display:flex;flex-direction:column;height:100%;background:#fff;border-radius:4px}.ee-search-area{padding:16px 16px 0;border-bottom:1px solid #ebeef5}.ee-search-area .el-form-item{margin-bottom:16px}.ee-toolbar{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;flex-shrink:0}.ee-toolbar-left{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.ee-toolbar-right{display:flex;align-items:center;gap:8px}.ee-table-wrapper{flex:1;overflow:auto;padding:0 16px}.ee-table-wrapper .el-table{width:100%}.ee-pagination{display:flex;justify-content:flex-end;padding:12px 16px;border-top:1px solid #ebeef5;flex-shrink:0}.ee-size--small{font-size:13px}.ee-size--large{font-size:16px}.ee-load-more[data-v-21c5d143],.ee-no-more[data-v-21c5d143]{display:flex;align-items:center;justify-content:center;padding:8px 0;font-size:12px;color:#999;cursor:pointer}.ee-load-more[data-v-21c5d143]:hover{color:#409eff}.ee-loading-tip[data-v-21c5d143]{display:flex;align-items:center;justify-content:center;padding:8px 0;font-size:12px;color:#999}.ee-load-more[data-v-6e78b80d],.ee-no-more[data-v-6e78b80d]{display:flex;align-items:center;justify-content:center;padding:8px 0;font-size:12px;color:#999;cursor:pointer}.ee-load-more[data-v-6e78b80d]:hover{color:#409eff}.ee-loading-tip[data-v-6e78b80d]{display:flex;align-items:center;justify-content:center;padding:8px 0;font-size:12px;color:#999}.ee-load-more[data-v-58cd12c9],.ee-no-more[data-v-58cd12c9]{display:flex;align-items:center;justify-content:center;padding:8px 0;font-size:12px;color:#999;cursor:pointer}.ee-load-more[data-v-58cd12c9]:hover{color:#409eff}.ee-loading-tip[data-v-58cd12c9]{display:flex;align-items:center;justify-content:center;padding:8px 0;font-size:12px;color:#999}
@@ -0,0 +1,2 @@
1
+ import { default as EeBaseBar } from './src/index.vue';
2
+ export default EeBaseBar;