@web-utils/component 2.0.14 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. package/dist/chunks/config.46422d7f.js +73 -0
  2. package/dist/chunks/{3a79781b.js → confirmable-mixin.3a79781b.js} +0 -0
  3. package/dist/chunks/dataformat.fb35ee10.js +61 -0
  4. package/dist/chunks/detail.a3249549.js +28 -0
  5. package/dist/chunks/dic.5f7e3523.js +132 -0
  6. package/dist/chunks/event.50c365eb.js +235 -0
  7. package/dist/chunks/{76680a03.js → form-input-mixin.ff5b58f7.js} +2 -2
  8. package/dist/chunks/{b4acd3a6.js → form-item-mixin.79f6eaff.js} +3 -1
  9. package/dist/chunks/{61ad06b2.js → form-pick-mixin.61ad06b2.js} +0 -0
  10. package/dist/chunks/init.352281f5.js +121 -0
  11. package/dist/chunks/{41a066be.js → input-number-mixin.41a066be.js} +0 -0
  12. package/dist/chunks/{5a78e0db.js → mixins.5a78e0db.js} +0 -0
  13. package/dist/chunks/packages.5d7a86c4.js +114 -0
  14. package/dist/chunks/permission.ce5d2121.js +16 -0
  15. package/dist/chunks/slot.1b8d2b1b.js +27 -0
  16. package/dist/chunks/{8c0142e0.js → tab-mixin.8c0142e0.js} +0 -0
  17. package/dist/chunks/util.5053d54e.js +264 -0
  18. package/dist/chunks/{97652d86.js → utils.97652d86.js} +0 -0
  19. package/dist/chunks/{f71045fc.js → utils.fa73de78.js} +1 -0
  20. package/dist/chunks/{5d4282fb.js → vueComponentNormalizer.71e2aa87.js} +3 -1
  21. package/dist/components/address-input/index.js +1 -1
  22. package/dist/components/affix/index.js +102 -0
  23. package/dist/components/affix/style.css +1 -0
  24. package/dist/components/array/index.js +156 -0
  25. package/dist/components/array/style.css +1 -0
  26. package/dist/components/article/index.js +93 -0
  27. package/dist/components/article/style.css +1 -0
  28. package/dist/components/aside-menu/index.js +1 -1
  29. package/dist/components/avatar/index.js +106 -0
  30. package/dist/components/avatar/style.css +1 -0
  31. package/dist/components/awesome-button/index.js +1 -1
  32. package/dist/components/base.css +1 -1
  33. package/dist/components/capsule-tab/index.js +1 -1
  34. package/dist/components/card/index.js +130 -0
  35. package/dist/components/card/style.css +1 -0
  36. package/dist/components/carousel/index.js +70 -0
  37. package/dist/components/carousel/style.css +1 -0
  38. package/dist/components/chat/index.js +567 -0
  39. package/dist/components/chat/style.css +1 -0
  40. package/dist/components/chunk-file-uploader/index.js +2 -2
  41. package/dist/components/chunk-file-uploader-button/index.js +2 -2
  42. package/dist/components/chunk-file-uploader-drop/index.js +2 -2
  43. package/dist/components/chunk-file-uploader-file/index.js +2 -2
  44. package/dist/components/chunk-file-uploader-files/index.js +2 -2
  45. package/dist/components/chunk-file-uploader-list/index.js +2 -2
  46. package/dist/components/chunk-file-uploader-un-support/index.js +2 -2
  47. package/dist/components/code/index.js +66 -0
  48. package/dist/components/code-mirror-editor/index.js +4 -1
  49. package/dist/components/color-picker/index.js +1 -1
  50. package/dist/components/column/index.js +114 -0
  51. package/dist/components/column-default/index.js +105 -0
  52. package/dist/components/column-dynamic/index.js +93 -0
  53. package/dist/components/column-menu/index.js +286 -0
  54. package/dist/components/column-slot/index.js +265 -0
  55. package/dist/components/comment/index.js +94 -0
  56. package/dist/components/comment/style.css +1 -0
  57. package/dist/components/confirm-button/index.js +2 -2
  58. package/dist/components/confirmable/index.js +2 -2
  59. package/dist/components/context-menu/index.js +11 -1
  60. package/dist/components/count-up/index.js +120 -0
  61. package/dist/components/custom-scrollbar/index.js +2 -2
  62. package/dist/components/data-box/index.js +97 -0
  63. package/dist/components/data-box/style.css +1 -0
  64. package/dist/components/data-card/index.js +98 -0
  65. package/dist/components/data-card/style.css +1 -0
  66. package/dist/components/data-cardtext/index.js +82 -0
  67. package/dist/components/data-cardtext/style.css +1 -0
  68. package/dist/components/data-display/index.js +93 -0
  69. package/dist/components/data-display/style.css +1 -0
  70. package/dist/components/data-icons/index.js +104 -0
  71. package/dist/components/data-icons/style.css +1 -0
  72. package/dist/components/data-imgtext/index.js +106 -0
  73. package/dist/components/data-imgtext/style.css +1 -0
  74. package/dist/components/data-operatext/index.js +99 -0
  75. package/dist/components/data-operatext/style.css +1 -0
  76. package/dist/components/data-panel/index.js +93 -0
  77. package/dist/components/data-panel/style.css +1 -0
  78. package/dist/components/data-pay/index.js +149 -0
  79. package/dist/components/data-pay/style.css +1 -0
  80. package/dist/components/data-price/index.js +84 -0
  81. package/dist/components/data-price/style.css +1 -0
  82. package/dist/components/data-progress/index.js +97 -0
  83. package/dist/components/data-progress/style.css +1 -0
  84. package/dist/components/data-rotate/index.js +96 -0
  85. package/dist/components/data-rotate/style.css +1 -0
  86. package/dist/components/data-table-picker/index.js +2 -2
  87. package/dist/components/data-tabs/index.js +94 -0
  88. package/dist/components/data-tabs/style.css +1 -0
  89. package/dist/components/dialog-column/index.js +138 -0
  90. package/dist/components/dialog-excel/index.js +214 -0
  91. package/dist/components/dialog-filter/index.js +245 -0
  92. package/dist/components/dialog-form/index.js +275 -0
  93. package/dist/components/draggable/index.js +384 -0
  94. package/dist/components/draggable/style.css +1 -0
  95. package/dist/components/dynamic-table/index.js +1 -1
  96. package/dist/components/e-charts/index.js +7 -1
  97. package/dist/components/editable-progress/index.js +1 -1
  98. package/dist/components/editable-tree/index.js +2 -2
  99. package/dist/components/egd-collapse/index.js +1 -1
  100. package/dist/components/egd-collapse-item/index.js +1 -1
  101. package/dist/components/element-dialog/index.js +1 -1
  102. package/dist/components/empty/index.js +59 -0
  103. package/dist/components/empty/style.css +1 -0
  104. package/dist/components/empty-view/index.js +1 -1
  105. package/dist/components/error-view/index.js +1 -1
  106. package/dist/components/flex-column/index.js +2 -2
  107. package/dist/components/flex-item/index.js +2 -2
  108. package/dist/components/flex-row/index.js +2 -2
  109. package/dist/components/flex-scroller/index.js +1 -1
  110. package/dist/components/flow/index.js +278 -0
  111. package/dist/components/flow/style.css +1 -0
  112. package/dist/components/flow-node/index.js +102 -0
  113. package/dist/components/form-button/index.js +2 -2
  114. package/dist/components/form-cascader/index.js +4 -4
  115. package/dist/components/form-checkbox-group/index.js +4 -4
  116. package/dist/components/form-date-picker/index.js +4 -4
  117. package/dist/components/form-group/index.js +122 -0
  118. package/dist/components/form-group/style.css +1 -0
  119. package/dist/components/form-holder/index.js +23 -2
  120. package/dist/components/form-input/index.js +3 -3
  121. package/dist/components/form-input-email/index.js +3 -3
  122. package/dist/components/form-input-id-card/index.js +3 -3
  123. package/dist/components/form-input-number/index.js +4 -4
  124. package/dist/components/form-input-phone-number/index.js +3 -3
  125. package/dist/components/form-input-time/index.js +3 -3
  126. package/dist/components/form-item/index.js +2 -2
  127. package/dist/components/form-item-config-provider/index.js +1 -1
  128. package/dist/components/form-item-group/index.js +1 -1
  129. package/dist/components/form-radio-group/index.js +4 -4
  130. package/dist/components/form-select/index.js +4 -4
  131. package/dist/components/form-switch/index.js +3 -3
  132. package/dist/components/form-temp/index.js +149 -0
  133. package/dist/components/form-textarea/index.js +3 -3
  134. package/dist/components/form-view/index.js +1 -1
  135. package/dist/components/fy-cascader/index.js +132 -0
  136. package/dist/components/fy-checkbox/index.js +116 -0
  137. package/dist/components/fy-checkbox/style.css +1 -0
  138. package/dist/components/fy-curd/index.js +846 -0
  139. package/dist/components/fy-curd/style.css +1 -0
  140. package/dist/components/fy-date/index.js +84 -0
  141. package/dist/components/fy-date/style.css +1 -0
  142. package/dist/components/fy-dialog-form/index.js +278 -0
  143. package/dist/components/fy-dialog-form/style.css +1 -0
  144. package/dist/components/fy-dynamic/index.js +335 -0
  145. package/dist/components/fy-dynamic/style.css +1 -0
  146. package/dist/components/fy-form/index.js +754 -0
  147. package/dist/components/fy-form/style.css +1 -0
  148. package/dist/components/fy-form-menu/index.js +95 -0
  149. package/dist/components/fy-input/index.js +162 -0
  150. package/dist/components/fy-input-color/index.js +96 -0
  151. package/dist/components/fy-input-icon/index.js +161 -0
  152. package/dist/components/fy-input-icon/style.css +1 -0
  153. package/dist/components/fy-input-map/index.js +275 -0
  154. package/dist/components/fy-input-map/style.css +1 -0
  155. package/dist/components/fy-input-number/index.js +87 -0
  156. package/dist/components/fy-input-table/index.js +172 -0
  157. package/dist/components/fy-input-table/style.css +1 -0
  158. package/dist/components/fy-input-tree/index.js +265 -0
  159. package/dist/components/fy-input-tree/style.css +1 -0
  160. package/dist/components/fy-radio/index.js +68 -0
  161. package/dist/components/fy-radio/style.css +1 -0
  162. package/dist/components/fy-rate/index.js +105 -0
  163. package/dist/components/fy-rate/style.css +1 -0
  164. package/dist/components/fy-select/index.js +223 -0
  165. package/dist/components/fy-select/style.css +1 -0
  166. package/dist/components/fy-slider/index.js +79 -0
  167. package/dist/components/fy-switch/index.js +73 -0
  168. package/dist/components/fy-time/index.js +95 -0
  169. package/dist/components/fy-title/index.js +40 -0
  170. package/dist/components/fy-title/style.css +1 -0
  171. package/dist/components/fy-upload/index.js +704 -0
  172. package/dist/components/fy-upload/style.css +1 -0
  173. package/dist/components/guide-steps/index.js +1 -1
  174. package/dist/components/header-menu/index.js +238 -0
  175. package/dist/components/header-search/index.js +246 -0
  176. package/dist/components/icon-card/index.js +1 -1
  177. package/dist/components/icon-temp/index.js +50 -0
  178. package/dist/components/icon-temp/style.css +1 -0
  179. package/dist/components/iframe-window/index.js +1 -1
  180. package/dist/components/image-viewer/index.js +1 -1
  181. package/dist/components/input-number/index.js +2 -2
  182. package/dist/components/input-number-range/index.js +1 -1
  183. package/dist/components/keep-view-alive/index.js +6 -2
  184. package/dist/components/keyboard/index.js +389 -0
  185. package/dist/components/keyboard/style.css +1 -0
  186. package/dist/components/license/index.js +134 -0
  187. package/dist/components/loading-view/index.js +1 -1
  188. package/dist/components/login/index.js +244 -0
  189. package/dist/components/login/style.css +1 -0
  190. package/dist/components/name-avatar/index.js +66 -0
  191. package/dist/components/name-avatar/style.css +1 -0
  192. package/dist/components/nav-bar/index.js +1 -1
  193. package/dist/components/not-implement/index.js +1 -1
  194. package/dist/components/notice/index.js +143 -0
  195. package/dist/components/notice/style.css +1 -0
  196. package/dist/components/page/index.js +1 -1
  197. package/dist/components/page-header/index.js +1 -1
  198. package/dist/components/page-index/index.js +1 -1
  199. package/dist/components/page-index-top/index.js +1 -1
  200. package/dist/components/page-skeleton/index.js +1 -1
  201. package/dist/components/page-skeleton-new/index.js +1 -1
  202. package/dist/components/pageable-table/index.js +6 -2
  203. package/dist/components/pageable-view/index.js +7 -2
  204. package/dist/components/photo-swipe/index.js +7 -1
  205. package/dist/components/progress/index.js +60 -0
  206. package/dist/components/queue/index.js +76 -0
  207. package/dist/components/record-video/index.js +173 -0
  208. package/dist/components/record-video/style.css +1 -0
  209. package/dist/components/resize-observer/index.js +2 -2
  210. package/dist/components/search/index.js +142 -0
  211. package/dist/components/search/style.css +1 -0
  212. package/dist/components/search-popover/index.js +1 -1
  213. package/dist/components/sign/index.js +128 -0
  214. package/dist/components/sign/style.css +1 -0
  215. package/dist/components/sign-panel/index.js +14 -1
  216. package/dist/components/skeleton/index.js +82 -0
  217. package/dist/components/skeleton/style.css +1 -0
  218. package/dist/components/split-pane/index.js +7 -1
  219. package/dist/components/stateful/index.js +1 -1
  220. package/dist/components/static-pageable-table/index.js +1 -1
  221. package/dist/components/swiper/index.js +1 -1
  222. package/dist/components/tab/index.js +4 -2
  223. package/dist/components/tab-item/index.js +2 -2
  224. package/dist/components/table-column/index.js +1 -1
  225. package/dist/components/table-page/index.js +129 -0
  226. package/dist/components/table-view/index.js +2 -2
  227. package/dist/components/tabs/index.js +90 -0
  228. package/dist/components/tabs/style.css +0 -0
  229. package/dist/components/tag-render/index.js +1 -1
  230. package/dist/components/text-ellipsis/index.js +107 -0
  231. package/dist/components/text-ellipsis/style.css +1 -0
  232. package/dist/components/tinymce-editor/index.js +1 -1
  233. package/dist/components/tinymce-wrapper/index.js +1 -1
  234. package/dist/components/toolbar/index.js +1 -1
  235. package/dist/components/toolbar-button/index.js +1 -1
  236. package/dist/components/tree/index.js +427 -0
  237. package/dist/components/tree/style.css +1 -0
  238. package/dist/components/trigger/index.js +1 -1
  239. package/dist/components/verify/index.js +80 -0
  240. package/dist/components/verify/style.css +1 -0
  241. package/dist/components/vue-tags-input/index.js +115 -1
  242. package/dist/components/watermark/index.js +20 -2
  243. package/dist/index.css +4128 -745
  244. package/dist/index.es.js +21634 -7064
  245. package/package.json +20 -4
  246. package/web-types.json +12777 -2788
  247. package/dist/components/x-dialog/index.js +0 -173
  248. package/dist/components/x-dialog/style.css +0 -1
@@ -0,0 +1,846 @@
1
+ import { p as F } from "../../chunks/packages.5d7a86c4.js";
2
+ import { p as S } from "../../chunks/permission.ce5d2121.js";
3
+ import { i as _ } from "../../chunks/init.352281f5.js";
4
+ import { c as d } from "../../chunks/config.46422d7f.js";
5
+ import { b as v, f as O } from "../../chunks/dataformat.fb35ee10.js";
6
+ import { a as f, s as k, o as y, c as b, k as o } from "../../chunks/util.5053d54e.js";
7
+ import { n as L } from "../../chunks/vueComponentNormalizer.71e2aa87.js";
8
+ const E = {
9
+ common: {
10
+ condition: "条件",
11
+ display: "显示",
12
+ hide: "隐藏"
13
+ },
14
+ tip: {
15
+ select: "请选择",
16
+ input: "请输入"
17
+ },
18
+ check: {
19
+ checkAll: "全选"
20
+ },
21
+ upload: {
22
+ upload: "点击上传",
23
+ tip: "将文件拖到此处,或"
24
+ },
25
+ time: {
26
+ start: "开始",
27
+ end: "结束"
28
+ },
29
+ date: {
30
+ start: "开始",
31
+ end: "结束",
32
+ t: "今日",
33
+ y: "昨日",
34
+ n: "近7天",
35
+ a: "全部"
36
+ },
37
+ form: {
38
+ printBtn: "打 印",
39
+ mockBtn: "模 拟",
40
+ submitBtn: "提 交",
41
+ emptyBtn: "清 空"
42
+ },
43
+ crud: {
44
+ filter: {
45
+ addBtn: "新增条件",
46
+ clearBtn: "清空数据",
47
+ resetBtn: "清空条件",
48
+ cancelBtn: "取 消",
49
+ submitBtn: "确 定"
50
+ },
51
+ column: {
52
+ name: "列名",
53
+ hide: "隐藏",
54
+ fixed: "冻结",
55
+ filters: "过滤",
56
+ sortable: "排序",
57
+ index: "顺序",
58
+ width: "宽度"
59
+ },
60
+ tipStartTitle: "当前表格已选择",
61
+ tipEndTitle: "项",
62
+ editTitle: "编 辑",
63
+ copyTitle: "复 制",
64
+ addTitle: "新 增",
65
+ viewTitle: "查 看",
66
+ filterTitle: "过滤条件",
67
+ showTitle: "列显隐",
68
+ menu: "操作",
69
+ addBtn: "新 增",
70
+ show: "显 示",
71
+ hide: "隐 藏",
72
+ open: "展 开",
73
+ shrink: "收 缩",
74
+ printBtn: "打 印",
75
+ excelBtn: "导 出",
76
+ updateBtn: "修 改",
77
+ cancelBtn: "取 消",
78
+ searchBtn: "搜 索",
79
+ emptyBtn: "清 空",
80
+ menuBtn: "功 能",
81
+ saveBtn: "保 存",
82
+ viewBtn: "查 看",
83
+ editBtn: "编 辑",
84
+ copyBtn: "复 制",
85
+ delBtn: "删 除"
86
+ }
87
+ }, x = (e, t) => {
88
+ t = t || "";
89
+ const l = t.split(".");
90
+ let i = e, r = null;
91
+ for (let s = 0, a = l.length; s < a; s++) {
92
+ const c = l[s];
93
+ if (!i)
94
+ break;
95
+ if (s === a - 1) {
96
+ r = i[c];
97
+ break;
98
+ }
99
+ i = i[c];
100
+ }
101
+ return r;
102
+ }, D = (e) => x(E, e);
103
+ var B = function() {
104
+ var e = this, t = e.$createElement, l = e._self._c || t;
105
+ return l("div", {
106
+ staticClass: "avue-crud avue-crud--card"
107
+ }, [e.tableOption.title ? l(e.tableOption.titleSize || "h2", {
108
+ tag: "Component",
109
+ style: e.tableOption.titleStyle
110
+ }, [e._v(" " + e._s(e.tableOption.title) + " ")]) : e._e(), l("HeaderSearch", {
111
+ ref: "headerSearch",
112
+ scopedSlots: e._u([{
113
+ key: "search",
114
+ fn: function(i) {
115
+ return [e._t("search", null, null, i)];
116
+ }
117
+ }, {
118
+ key: "searchMenu",
119
+ fn: function(i) {
120
+ return [e._t("searchMenu", null, null, i)];
121
+ }
122
+ }, e._l(e.searchSlot, function(i) {
123
+ return {
124
+ key: i,
125
+ fn: function(r) {
126
+ return [e._t(i, null, null, r)];
127
+ }
128
+ };
129
+ })], null, !0)
130
+ }), e.optVal(e.tableOption.header, !0) ? l("HeaderMenu", {
131
+ ref: "headerMenu",
132
+ scopedSlots: e._u([{
133
+ key: "menuLeft",
134
+ fn: function(i) {
135
+ return [e._t("menuLeft", null, null, i)];
136
+ }
137
+ }, {
138
+ key: "menuRight",
139
+ fn: function(i) {
140
+ return [e._t("menuRight", null, null, i)];
141
+ }
142
+ }], null, !0)
143
+ }) : e._e(), e.optVal(e.tableOption.tip, e.config.tip) && e.tableOption.selection ? l("ElTag", {
144
+ staticClass: "avue-crud__tip"
145
+ }, [l("span", {
146
+ staticClass: "avue-crud__tip-name"
147
+ }, [e._v(" 当前表格已选择 "), l("span", {
148
+ staticClass: "avue-crud__tip-count"
149
+ }, [e._v(e._s(e.selectLen))]), e._v(" 项 ")]), e.optVal(e.tableOption.selectClearBtn, e.config.selectClearBtn) && e.tableOption.selection ? l("ElButton", {
150
+ directives: [{
151
+ name: "permission",
152
+ rawName: "v-permission",
153
+ value: e.getPermission("selectClearBtn"),
154
+ expression: "getPermission('selectClearBtn')"
155
+ }],
156
+ attrs: {
157
+ type: "text",
158
+ size: "small"
159
+ },
160
+ on: {
161
+ click: e.selectClear
162
+ }
163
+ }, [e._v(" 清 空 ")]) : e._e(), e._t("tip")], 2) : e._e(), e._t("header"), l("ElForm", {
164
+ ref: "cellForm",
165
+ attrs: {
166
+ model: e.cellForm,
167
+ "show-message": !1
168
+ },
169
+ on: {
170
+ validate: e.handleValidate
171
+ }
172
+ }, [l("ElTable", {
173
+ directives: [{
174
+ name: "loading",
175
+ rawName: "v-loading",
176
+ value: e.tableLoading,
177
+ expression: "tableLoading"
178
+ }],
179
+ key: e.reload,
180
+ ref: "table",
181
+ class: {
182
+ "avue-crud--indeterminate": e.optVal(e.tableOption.indeterminate, !1)
183
+ },
184
+ attrs: {
185
+ data: e.cellForm.list,
186
+ "row-key": e.rowKey,
187
+ size: e.$AVUE.tableSize || e.controlSize,
188
+ lazy: e.optVal(e.tableOption.lazy, !1),
189
+ load: e.treeLoad,
190
+ "tree-props": e.treeProps,
191
+ "expand-row-keys": e.tableOption.expandRowKeys,
192
+ "default-expand-all": e.tableOption.defaultExpandAll,
193
+ "highlight-current-row": e.tableOption.highlightCurrentRow,
194
+ "show-summary": e.tableOption.showSummary,
195
+ "summary-method": e.tableSummaryMethod,
196
+ "span-method": e.tableSpanMethod,
197
+ stripe: e.tableOption.stripe,
198
+ "show-header": e.tableOption.showHeader,
199
+ "default-sort": e.tableOption.defaultSort,
200
+ "row-class-name": e.rowClassName,
201
+ "cell-class-name": e.cellClassName,
202
+ "row-style": e.rowStyle,
203
+ "cell-style": e.cellStyle,
204
+ fit: e.tableOption.fit,
205
+ "header-cell-class-name": e.headerCellClassName,
206
+ "max-height": e.isAutoHeight ? e.tableHeight : e.tableOption.maxHeight,
207
+ height: e.tableHeight,
208
+ width: e.setPx(e.tableOption.width, e.config.width),
209
+ border: e.tableOption.border
210
+ },
211
+ on: {
212
+ "current-change": e.currentRowChange,
213
+ "expand-change": e.expandChange,
214
+ "header-dragend": e.headerDragend,
215
+ "row-click": e.rowClick,
216
+ "row-dblclick": e.rowDblclick,
217
+ "cell-mouse-enter": e.cellMouseEnter,
218
+ "cell-mouse-leave": e.cellMouseLeave,
219
+ "cell-click": e.cellClick,
220
+ "header-click": e.headerClick,
221
+ "row-contextmenu": e.rowContextmenu,
222
+ "header-contextmenu": e.headerContextmenu,
223
+ "cell-dblclick": e.cellDblclick,
224
+ "filter-change": e.filterChange,
225
+ "selection-change": e.selectionChange,
226
+ select: e.select,
227
+ "select-all": e.selectAll,
228
+ "sort-change": e.sortChange
229
+ },
230
+ scopedSlots: e._u([{
231
+ key: "empty",
232
+ fn: function() {
233
+ return [e.$slots.empty ? e._t("empty") : l("ElEmpty", {
234
+ staticClass: "avue-crud__empty",
235
+ attrs: {
236
+ "image-size": 100,
237
+ description: e.tableOption.emptyText
238
+ }
239
+ })];
240
+ },
241
+ proxy: !0
242
+ }], null, !0)
243
+ }, [l("Column", {
244
+ attrs: {
245
+ "column-option": e.columnOption
246
+ },
247
+ scopedSlots: e._u([{
248
+ key: "header",
249
+ fn: function() {
250
+ return [l("ColumnDefault", {
251
+ ref: "columnDefault",
252
+ scopedSlots: e._u([{
253
+ key: "expand",
254
+ fn: function(i) {
255
+ var r = i.row, s = i.index;
256
+ return [e._t("expand", null, {
257
+ row: r,
258
+ index: s
259
+ })];
260
+ }
261
+ }], null, !0)
262
+ })];
263
+ },
264
+ proxy: !0
265
+ }, e._l(e.mainSlot, function(i) {
266
+ return {
267
+ key: i,
268
+ fn: function(r) {
269
+ return [e._t(i, null, null, r)];
270
+ }
271
+ };
272
+ }), {
273
+ key: "footer",
274
+ fn: function() {
275
+ return [l("ColumnMenu", {
276
+ scopedSlots: e._u([{
277
+ key: "menu",
278
+ fn: function(i) {
279
+ return [e._t("menu", null, null, i)];
280
+ }
281
+ }, {
282
+ key: "menuBtn",
283
+ fn: function(i) {
284
+ return [e._t("menuBtn", null, null, i)];
285
+ }
286
+ }], null, !0)
287
+ })];
288
+ },
289
+ proxy: !0
290
+ }], null, !0)
291
+ })], 1)], 1), e._t("footer"), l("TablePage", {
292
+ ref: "tablePage"
293
+ }), l("FyDialogForm", {
294
+ ref: "dialogForm",
295
+ scopedSlots: e._u([e._l(e.formSlot, function(i) {
296
+ return {
297
+ key: i,
298
+ fn: function(r) {
299
+ return [e._t(i, null, null, r)];
300
+ }
301
+ };
302
+ }), {
303
+ key: "menuForm",
304
+ fn: function(i) {
305
+ return [e._t("menuForm", null, null, i)];
306
+ }
307
+ }], null, !0)
308
+ }), l("DialogColumn", {
309
+ ref: "dialogColumn"
310
+ }), l("DialogExcel", {
311
+ ref: "dialogExcel"
312
+ }), l("DialogFilter", {
313
+ ref: "dialogFilter"
314
+ })], 2);
315
+ }, P = [];
316
+ const H = {
317
+ name: "FyCurd",
318
+ directives: {
319
+ permission: S
320
+ },
321
+ mixins: [_],
322
+ provide() {
323
+ return {
324
+ crud: this
325
+ };
326
+ },
327
+ props: {
328
+ spanMethod: Function,
329
+ summaryMethod: Function,
330
+ rowStyle: Function,
331
+ cellStyle: Function,
332
+ beforeClose: Function,
333
+ beforeOpen: Function,
334
+ rowClassName: Function,
335
+ cellClassName: Function,
336
+ headerCellClassName: Function,
337
+ uploadBefore: Function,
338
+ uploadAfter: Function,
339
+ uploadDelete: Function,
340
+ uploadPreview: Function,
341
+ uploadError: Function,
342
+ uploadExceed: Function,
343
+ permission: {
344
+ type: [Function, Object],
345
+ default: () => ({})
346
+ },
347
+ value: {
348
+ type: Object,
349
+ default: () => ({})
350
+ },
351
+ search: {
352
+ type: Object,
353
+ default() {
354
+ return {};
355
+ }
356
+ },
357
+ page: {
358
+ type: Object,
359
+ default() {
360
+ return {};
361
+ }
362
+ },
363
+ tableLoading: {
364
+ type: Boolean,
365
+ default: !1
366
+ },
367
+ disabled: {
368
+ type: Boolean,
369
+ default: !1
370
+ },
371
+ data: {
372
+ type: Array,
373
+ required: !0,
374
+ default: () => []
375
+ }
376
+ },
377
+ data() {
378
+ return {
379
+ reload: Math.random(),
380
+ cellForm: {
381
+ list: []
382
+ },
383
+ config: d,
384
+ list: [],
385
+ listError: {},
386
+ tableForm: {},
387
+ tableHeight: void 0,
388
+ tableIndex: -1,
389
+ tableSelect: [],
390
+ sumsList: {},
391
+ cascaderIndexList: [],
392
+ cascaderDicList: {},
393
+ cascaderFormList: {},
394
+ btnDisabledList: {},
395
+ btnDisabled: !1,
396
+ default: {}
397
+ };
398
+ },
399
+ computed: {
400
+ isHeightAuto() {
401
+ return this.tableOption.height === "auto";
402
+ },
403
+ isSortable() {
404
+ return this.tableOption.sortable;
405
+ },
406
+ isRowSort() {
407
+ return this.tableOption.rowSort;
408
+ },
409
+ isColumnSort() {
410
+ return this.tableOption.columnSort;
411
+ },
412
+ rowParentKey() {
413
+ return this.option.rowParentKey || f.rowParentKey;
414
+ },
415
+ childrenKey() {
416
+ return this.treeProps.children || f.children;
417
+ },
418
+ hasChildrenKey() {
419
+ return this.treeProps.hasChildren || f.hasChildren;
420
+ },
421
+ treeProps() {
422
+ return this.tableOption.treeProps || {};
423
+ },
424
+ isAutoHeight() {
425
+ return this.tableOption.height === "auto";
426
+ },
427
+ formSlot() {
428
+ return this.getSlotList(["Error", "Label", "Type", "Form"], this.$scopedSlots, this.propOption);
429
+ },
430
+ searchSlot() {
431
+ return this.getSlotList(["Search"], this.$scopedSlots, this.propOption);
432
+ },
433
+ mainSlot() {
434
+ let e = [];
435
+ return this.propOption.forEach((t) => {
436
+ this.$scopedSlots[t.prop] && e.push(t.prop);
437
+ }), this.getSlotList(["Header", "Form"], this.$scopedSlots, this.propOption).concat(e);
438
+ },
439
+ calcHeight() {
440
+ return (this.tableOption.calcHeight || 0) + this.$AVUE.calcHeight;
441
+ },
442
+ propOption() {
443
+ let e = [];
444
+ function t(l = []) {
445
+ Array.isArray(l) && l.forEach((i) => {
446
+ Array.isArray(i.children) ? t(i.children) : e.push(i);
447
+ });
448
+ }
449
+ return t(this.columnOption), e = v(e), e;
450
+ },
451
+ isShowSummary() {
452
+ return this.option.showSummary;
453
+ },
454
+ isHeader() {
455
+ let e = !1;
456
+ return this.columnOption.forEach((t) => {
457
+ t.children && (e = !0);
458
+ }), e;
459
+ },
460
+ isTree() {
461
+ let e = !1;
462
+ return this.data.forEach((t) => {
463
+ t.children && (e = !0);
464
+ }), e;
465
+ },
466
+ isCard() {
467
+ return this.option.card ? "always" : "never";
468
+ },
469
+ expandLevel() {
470
+ return this.parentOption.expandLevel || 0;
471
+ },
472
+ expandAll() {
473
+ return this.parentOption.expandAll || !1;
474
+ },
475
+ parentOption() {
476
+ return this.tableOption || {};
477
+ },
478
+ columnOption() {
479
+ return this.tableOption.column || [];
480
+ },
481
+ sumColumnList() {
482
+ return this.tableOption.sumColumnList || [];
483
+ },
484
+ selectLen() {
485
+ return this.tableSelect ? this.tableSelect.length : 0;
486
+ }
487
+ },
488
+ watch: {
489
+ value: {
490
+ handler() {
491
+ this.tableForm = this.value;
492
+ },
493
+ immediate: !0,
494
+ deep: !0
495
+ },
496
+ list: {
497
+ handler() {
498
+ this.cellForm.list = this.list;
499
+ },
500
+ deep: !0
501
+ },
502
+ data: {
503
+ handler() {
504
+ this.dataInit();
505
+ },
506
+ deep: !0
507
+ }
508
+ },
509
+ mounted() {
510
+ this.dataInit(), this.getTableHeight(), this.refreshTable();
511
+ },
512
+ methods: {
513
+ setPx: k,
514
+ optVal: y,
515
+ handleValidate(e, t, l) {
516
+ this.listError[e] || this.$set(this.listError, e, { valid: !1, msg: "" }), this.listError[e].valid = !t, this.listError[e].msg = l;
517
+ },
518
+ getPermission(e, t, l) {
519
+ return typeof this.permission == "function" ? this.permission(e, t, l) : b(this.permission[e]) ? !0 : this.permission[e];
520
+ },
521
+ getTableHeight() {
522
+ this.isAutoHeight ? this.$nextTick(() => {
523
+ const e = this.$refs.table, t = this.$refs.tablePage;
524
+ if (!e)
525
+ return;
526
+ const l = e.$el, i = t.$el.offsetHeight || 20;
527
+ this.tableHeight = document.documentElement.clientHeight - l.offsetTop - i - this.calcHeight;
528
+ }) : this.tableHeight = this.tableOption.height;
529
+ },
530
+ doLayout() {
531
+ this.$refs.table.doLayout();
532
+ },
533
+ refreshTable(e) {
534
+ this.reload = Math.random(), this.$nextTick(() => {
535
+ e && e();
536
+ });
537
+ },
538
+ //树懒加载
539
+ treeLoad(e, t, l) {
540
+ this.$emit("tree-load", e, t, (i) => {
541
+ e.children = i, l(i);
542
+ });
543
+ },
544
+ menuIcon(e) {
545
+ return y(this.tableOption[e + "Text"], D(`crud.${e}`));
546
+ },
547
+ getBtnIcon(e) {
548
+ const t = e + "Icon";
549
+ return this.tableOption[t] || d[t];
550
+ },
551
+ //对部分表单字段进行校验的方法
552
+ validateField(e) {
553
+ return this.$refs.dialogForm.$refs.tableForm.validateField(e);
554
+ },
555
+ selectClear() {
556
+ this.$emit("selection-clear", o(this.tableSelect)), this.$refs.table.clearSelection();
557
+ },
558
+ toggleRowSelection(e, t) {
559
+ this.$refs.table.toggleRowSelection(e, t);
560
+ },
561
+ toggleRowExpansion(e, t) {
562
+ this.$refs.table.toggleRowExpansion(e, t);
563
+ },
564
+ setCurrentRow(e) {
565
+ this.$refs.table.setCurrentRow(e);
566
+ },
567
+ dataInit() {
568
+ this.list = this.data, this.list.forEach((e, t) => {
569
+ e.$cellEdit && !this.cascaderFormList[t] && (this.cascaderFormList[t] = o(e)), this.$set(e, "$cellEdit", e.$cellEdit || !1), this.$set(e, "$index", t);
570
+ });
571
+ },
572
+ //拖动表头事件
573
+ headerDragend(e, t, l, i) {
574
+ this.objectOption[l.property] && this.$set(this.objectOption[l.property], "width", e), this.$emit("header-dragend", e, t, l, i);
575
+ },
576
+ headerSort(e, t) {
577
+ let l = this.columnOption, i = l.splice(e, 1)[0];
578
+ l.splice(t, 0, i), this.refreshTable();
579
+ },
580
+ // 清除过滤器执行函数
581
+ clearFilter(e) {
582
+ this.$refs.table.clearFilter(e);
583
+ },
584
+ //展开或则关闭
585
+ expandChange(e, t) {
586
+ this.$emit("expand-change", e, t);
587
+ },
588
+ //设置单选
589
+ currentRowChange(e, t) {
590
+ this.$emit("current-row-change", e, t);
591
+ },
592
+ //刷新事件
593
+ refreshChange() {
594
+ this.$emit("refresh-change");
595
+ },
596
+ // 选中实例
597
+ toggleSelection(e) {
598
+ e ? e.forEach((t) => {
599
+ this.$refs.table.toggleRowSelection(t);
600
+ }) : this.$refs.table.clearSelection();
601
+ },
602
+ // 选择回调
603
+ selectionChange(e) {
604
+ this.tableSelect = e, this.$emit("selection-change", this.tableSelect);
605
+ },
606
+ // 单个选择回调
607
+ select(e, t) {
608
+ this.$emit("select", e, t);
609
+ },
610
+ // 点击勾选全选 Checkbox
611
+ selectAll(e) {
612
+ this.$emit("select-all", e);
613
+ },
614
+ //筛选回调用
615
+ filterChange(e) {
616
+ this.$emit("filter-change", e);
617
+ },
618
+ // 排序回调
619
+ sortChange(e) {
620
+ this.$emit("sort-change", e);
621
+ },
622
+ // 行双击
623
+ rowDblclick(e, t) {
624
+ this.$emit("row-dblclick", e, t);
625
+ },
626
+ // 行单机
627
+ rowClick(e, t, l) {
628
+ this.$emit("row-click", e, t, l);
629
+ },
630
+ //清空排序
631
+ clearSort() {
632
+ this.$refs.table.clearSort();
633
+ },
634
+ //当单元格 hover 进入时会触发该事件
635
+ cellMouseEnter(e, t, l, i) {
636
+ this.$emit("cell-mouse-enter", e, t, l, i);
637
+ },
638
+ //当单元格 hover 退出时会触发该事件
639
+ cellMouseLeave(e, t, l, i) {
640
+ this.$emit("cell-mouse-leave", e, t, l, i);
641
+ },
642
+ //当某个单元格被点击时会触发该事件
643
+ cellClick(e, t, l, i) {
644
+ this.$emit("cell-click", e, t, l, i);
645
+ },
646
+ // 当某一列的表头被点击时会触发该事件
647
+ headerClick(e, t) {
648
+ this.$emit("header-click", e, t);
649
+ },
650
+ //当某一行被鼠标右键点击时会触发该事件
651
+ rowContextmenu(e, t, l) {
652
+ this.$emit("row-contextmenu", e, t, l);
653
+ },
654
+ //当某一列的表头被鼠标右键点击时触发该事件
655
+ headerContextmenu(e, t) {
656
+ this.$emit("header-contextmenu", e, t);
657
+ },
658
+ //当某个单元格被双击击时会触发该事件
659
+ cellDblclick(e, t, l, i) {
660
+ this.$emit("cell-dblclick", e, t, l, i);
661
+ },
662
+ //单元格新增
663
+ rowCellAdd(e = {}) {
664
+ let t = this.list.length, l = O(this.propOption).tableForm;
665
+ e = o(
666
+ Object.assign(
667
+ {
668
+ $cellEdit: !0,
669
+ $index: t
670
+ },
671
+ l,
672
+ e
673
+ )
674
+ ), this.list.push(e);
675
+ },
676
+ //行取消
677
+ rowCancel(e, t) {
678
+ b(e[this.rowKey]) ? (this.list.splice(t, 1), delete this.cascaderDIC[t]) : (this.cascaderFormList[t].$cellEdit = !1, this.$set(this.cascaderDIC, t, this.cascaderDicList[t]), this.$set(this.list, t, this.cascaderFormList[t])), delete this.cascaderDicList[t], delete this.cascaderFormList[t], this.cascaderIndexList.splice(this.cascaderIndexList.indexOf(t), 1);
679
+ },
680
+ //行编辑点击
681
+ rowCell(e, t) {
682
+ e.$cellEdit ? this.rowCellUpdate(e, t) : this.rowCellEdit(e, t);
683
+ },
684
+ rowCellUpdate(e, t) {
685
+ e = o(e);
686
+ var l = this.validateCellField(t);
687
+ const i = () => {
688
+ this.btnDisabledList[t] = !1, this.btnDisabled = !1, this.list[t].$cellEdit = !1, this.cascaderIndexList.splice(this.cascaderIndexList.indexOf(t), 1), delete this.cascaderFormList[t];
689
+ }, r = () => {
690
+ this.btnDisabledList[t] = !1, this.btnDisabled = !1;
691
+ };
692
+ l && (this.btnDisabledList[t] = !0, this.btnDisabled = !0, b(e[this.rowKey]) ? this.$emit("row-save", e, i, r) : this.$emit("row-update", e, t, i, r));
693
+ },
694
+ // 单元格编辑
695
+ rowCellEdit(e, t) {
696
+ e.$cellEdit = !0, this.cascaderFormList[t] = o(e), this.cascaderDicList[t] = o(this.cascaderDIC[t]);
697
+ },
698
+ // 对部分表单字段进行校验
699
+ validateCellForm(e) {
700
+ return new Promise((t) => {
701
+ this.$refs.cellForm.validate((l, i) => {
702
+ t(i);
703
+ });
704
+ });
705
+ },
706
+ validateCellField(e) {
707
+ let t = !0;
708
+ for (const l of this.$refs.cellForm.fields)
709
+ if (l.prop.split(".")[1] == e && this.$refs.cellForm.validateField(l.prop, (i) => {
710
+ i && (t = !1);
711
+ }), !t)
712
+ break;
713
+ return t;
714
+ },
715
+ rowAdd() {
716
+ this.$refs.dialogForm.show("add");
717
+ },
718
+ rowSave() {
719
+ return this.$refs.dialogForm.$refs.tableForm.submit();
720
+ },
721
+ rowUpdate() {
722
+ return this.$refs.dialogForm.$refs.tableForm.submit();
723
+ },
724
+ closeDialog() {
725
+ return this.$refs.dialogForm.closeDialog();
726
+ },
727
+ getPropRef(e) {
728
+ return this.$refs.dialogForm.$refs.tableForm.getPropRef(e);
729
+ },
730
+ setVal() {
731
+ this.$emit("input", this.tableForm), this.$emit("change", this.tableForm);
732
+ },
733
+ // 编辑
734
+ rowEdit(e, t) {
735
+ this.tableForm = o(e), this.tableIndex = t, this.setVal(), this.$refs.dialogForm.show("edit");
736
+ },
737
+ //复制
738
+ rowCopy(e) {
739
+ this.tableForm = o(e), delete this.tableForm[this.rowKey], this.tableIndex = -1, this.setVal(), this.$refs.dialogForm.show("add");
740
+ },
741
+ //查看
742
+ rowView(e, t) {
743
+ this.tableForm = o(e), this.tableIndex = t, this.setVal(), this.$refs.dialogForm.show("view");
744
+ },
745
+ // 删除
746
+ rowDel(e, t) {
747
+ this.$emit("row-del", e, t, () => {
748
+ let { parentList: l, index: i } = this.findData(e[this.rowKey]);
749
+ l && l.splice(i, 1);
750
+ });
751
+ },
752
+ //合并行
753
+ tableSpanMethod(e) {
754
+ if (typeof this.spanMethod == "function")
755
+ return this.spanMethod(e);
756
+ },
757
+ //合集统计逻辑
758
+ tableSummaryMethod(e) {
759
+ let t = {};
760
+ if (typeof this.summaryMethod == "function")
761
+ return this.summaryMethod(e);
762
+ const { columns: l, data: i } = e;
763
+ let r = [];
764
+ return l.length > 0 && l.forEach((s, a) => {
765
+ let c = this.sumColumnList.find((u) => u.name === s.property);
766
+ if (c) {
767
+ let u = c.decimals || 2, m = c.label || "";
768
+ switch (c.type) {
769
+ case "count":
770
+ r[a] = m + i.length;
771
+ break;
772
+ case "avg":
773
+ let C = i.map((n) => Number(n[s.property])), g = 1;
774
+ r[a] = C.reduce((n, h) => {
775
+ let p = Number(h);
776
+ return isNaN(p) ? n : (n * (g - 1) + h) / g++;
777
+ }, 0), r[a] = m + r[a].toFixed(u);
778
+ break;
779
+ case "sum":
780
+ let $ = i.map((n) => Number(n[s.property]));
781
+ r[a] = $.reduce((n, h) => {
782
+ let p = Number(h);
783
+ return isNaN(p) ? n : n + h;
784
+ }, 0), r[a] = m + r[a].toFixed(u);
785
+ break;
786
+ }
787
+ t[s.property] = r[a];
788
+ } else
789
+ r[a] = "";
790
+ }), this.sumsList = t, r;
791
+ },
792
+ tableDrop(e, t, l) {
793
+ if (this.isSortable !== !0) {
794
+ if (e === "row" && !this.isRowSort)
795
+ return;
796
+ if (e === "column" && !this.isColumnSort)
797
+ return;
798
+ }
799
+ if (!window.Sortable) {
800
+ F.logs("Sortable");
801
+ return;
802
+ }
803
+ window.Sortable.create(t, {
804
+ ghostClass: d.ghostClass,
805
+ chosenClass: d.ghostClass,
806
+ animation: 500,
807
+ delay: 0,
808
+ onEnd: (i) => l(i)
809
+ });
810
+ },
811
+ findData(e) {
812
+ let t = {};
813
+ const l = (i, r) => {
814
+ i.forEach((s, a) => {
815
+ s[this.rowKey] === e && (t = {
816
+ item: s,
817
+ index: a,
818
+ parentList: i,
819
+ parent: r
820
+ }), s[this.childrenKey] && l(s[this.childrenKey], s);
821
+ });
822
+ };
823
+ return l(this.list), t;
824
+ }
825
+ }
826
+ }, w = {};
827
+ var T = /* @__PURE__ */ L(
828
+ H,
829
+ B,
830
+ P,
831
+ !1,
832
+ M,
833
+ null,
834
+ null,
835
+ null
836
+ );
837
+ function M(e) {
838
+ for (let t in w)
839
+ this[t] = w[t];
840
+ }
841
+ const z = /* @__PURE__ */ function() {
842
+ return T.exports;
843
+ }();
844
+ export {
845
+ z as default
846
+ };