@zjhc/ui 0.0.0-stage → 0.1.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 (207) hide show
  1. package/LICENSE +51 -0
  2. package/NOTICE +23 -0
  3. package/README.md +177 -2
  4. package/dist/component.d.ts +3 -0
  5. package/dist/components/autocomplete/index.d.ts +5 -0
  6. package/dist/components/autocomplete/src/autoComplete.vue.d.ts +511 -0
  7. package/dist/components/autocomplete/src/autocomplete.d.ts +50 -0
  8. package/dist/components/collapse-container/index.d.ts +6 -0
  9. package/dist/components/collapse-container/src/collapseContainer.vue.d.ts +47 -0
  10. package/dist/components/collapse-container/src/instance.d.ts +2 -0
  11. package/dist/components/collapse-panel/index.d.ts +6 -0
  12. package/dist/components/collapse-panel/src/collapsePanel.vue.d.ts +68 -0
  13. package/dist/components/collapse-panel/src/instance.d.ts +2 -0
  14. package/dist/components/complex-table/index.d.ts +7 -0
  15. package/dist/components/complex-table/src/ComplexTable.vue.d.ts +1428 -0
  16. package/dist/components/complex-table/src/TableOperator.vue.d.ts +41 -0
  17. package/dist/components/complex-table/src/instance.d.ts +4 -0
  18. package/dist/components/dialog/index.d.ts +5 -0
  19. package/dist/components/dialog/src/dialog-content.d.ts +20 -0
  20. package/dist/components/dialog/src/dialog.d.ts +76 -0
  21. package/dist/components/dialog/src/dialog.vue.d.ts +456 -0
  22. package/dist/components/dialog/src/dialogContent.vue.d.ts +74 -0
  23. package/dist/components/dialog/src/use-dialog.d.ts +23 -0
  24. package/dist/components/edit-table-column/EditTableColumn.vue.d.ts +79 -0
  25. package/dist/components/edit-table-column/index.d.ts +6 -0
  26. package/dist/components/edit-table-column/registerComp.d.ts +3 -0
  27. package/dist/components/edit-table-column/type.d.ts +14 -0
  28. package/dist/components/group-container/index.d.ts +6 -0
  29. package/dist/components/group-container/src/groupContainer.vue.d.ts +43 -0
  30. package/dist/components/group-container/src/instance.d.ts +2 -0
  31. package/dist/components/index.d.ts +13 -0
  32. package/dist/components/loading/index.d.ts +11 -0
  33. package/dist/components/loading/src/directive.d.ts +13 -0
  34. package/dist/components/loading/src/loading.d.ts +27 -0
  35. package/dist/components/loading/src/service.d.ts +3 -0
  36. package/dist/components/loading/src/types.d.ts +61 -0
  37. package/dist/components/search-layout/index.d.ts +6 -0
  38. package/dist/components/search-layout/src/instance.d.ts +2 -0
  39. package/dist/components/search-layout/src/searchLayout.vue.d.ts +22 -0
  40. package/dist/components/search-panel/index.d.ts +6 -0
  41. package/dist/components/search-panel/src/instance.d.ts +2 -0
  42. package/dist/components/search-panel/src/searchPanel.vue.d.ts +17 -0
  43. package/dist/components/search-panel-layout/index.d.ts +6 -0
  44. package/dist/components/search-panel-layout/src/layout.d.ts +95 -0
  45. package/dist/components/sticky-toolbar/index.d.ts +6 -0
  46. package/dist/components/sticky-toolbar/src/instance.d.ts +2 -0
  47. package/dist/components/sticky-toolbar/src/stickyToolbar.vue.d.ts +43 -0
  48. package/dist/components/switch-mode/index.d.ts +7 -0
  49. package/dist/components/switch-theme/index.d.ts +7 -0
  50. package/dist/components/table-toolbar/index.d.ts +7 -0
  51. package/dist/components/table-toolbar/src/buttonGroup.vue.d.ts +79 -0
  52. package/dist/components/table-toolbar/src/interface.d.ts +21 -0
  53. package/dist/components/table-toolbar/src/tableToolbar.vue.d.ts +71 -0
  54. package/dist/constants/aria.d.ts +17 -0
  55. package/dist/constants/date.d.ts +3 -0
  56. package/dist/constants/event.d.ts +3 -0
  57. package/dist/constants/index.d.ts +5 -0
  58. package/dist/constants/key.d.ts +1 -0
  59. package/dist/constants/size.d.ts +7 -0
  60. package/dist/defaults.d.ts +5 -0
  61. package/dist/hooks/complex-table/index.d.ts +33 -0
  62. package/dist/hooks/get-cookie/index.d.ts +4 -0
  63. package/dist/hooks/index.d.ts +6 -0
  64. package/dist/hooks/oper-modal/index.d.ts +8 -0
  65. package/dist/hooks/post-message/index.d.ts +19 -0
  66. package/dist/hooks/set-theme/index.d.ts +2 -0
  67. package/dist/hooks/use-draggable-resize/index.d.ts +10 -0
  68. package/dist/hooks/use-loading/index.d.ts +4 -0
  69. package/dist/hooks/use-namespace/index.d.ts +20 -0
  70. package/dist/icons/arrow-down.vue.d.ts +2 -0
  71. package/dist/icons/arrow-up.vue.d.ts +2 -0
  72. package/dist/icons/check.vue.d.ts +2 -0
  73. package/dist/icons/close.vue.d.ts +2 -0
  74. package/dist/icons/copy-document.vue.d.ts +2 -0
  75. package/dist/icons/filter.vue.d.ts +2 -0
  76. package/dist/icons/full-screen.vue.d.ts +2 -0
  77. package/dist/icons/index.d.ts +9 -0
  78. package/dist/icons/loading.vue.d.ts +2 -0
  79. package/dist/icons/minus.vue.d.ts +2 -0
  80. package/dist/index.cjs +3985 -0
  81. package/dist/index.css +2661 -0
  82. package/dist/index.d.ts +10 -0
  83. package/dist/index.mjs +3985 -0
  84. package/dist/make-installer.d.ts +5 -0
  85. package/dist/plugin.d.ts +3 -0
  86. package/dist/types/enhance/accessory.d.ts +45 -0
  87. package/dist/types/enhance/biztrace.d.ts +75 -0
  88. package/dist/types/enhance/form.d.ts +83 -0
  89. package/dist/types/enhance/heai.d.ts +47 -0
  90. package/dist/types/enhance/workflow.d.ts +385 -0
  91. package/dist/types/extension/extension.d.ts +58 -0
  92. package/dist/types/extension/frame.d.ts +48 -0
  93. package/dist/types/extension/job.d.ts +36 -0
  94. package/dist/types/framework/auth.d.ts +38 -0
  95. package/dist/types/framework/config.d.ts +13 -0
  96. package/dist/types/framework/core.d.ts +24 -0
  97. package/dist/types/index.d.ts +11 -0
  98. package/dist/utils/index.d.ts +6 -0
  99. package/dist/utils/style.d.ts +10 -0
  100. package/dist/utils/tools/istype.d.ts +11 -0
  101. package/dist/utils/tools/security.d.ts +2 -0
  102. package/dist/utils/tools/throw-error.d.ts +1 -0
  103. package/dist/utils/tools/tree.d.ts +2 -0
  104. package/dist/utils/vue/index.d.ts +2 -0
  105. package/dist/utils/vue/install.d.ts +6 -0
  106. package/dist/utils/vue/shared.d.ts +10 -0
  107. package/dist/utils/vue/typescript.d.ts +5 -0
  108. package/dist/version.d.ts +1 -0
  109. package/package.json +76 -4
  110. package/theme-chalk/autocomplete.css +144 -0
  111. package/theme-chalk/base-var.css +1037 -0
  112. package/theme-chalk/base.css +120 -0
  113. package/theme-chalk/collapse-container.css +71 -0
  114. package/theme-chalk/collapse-panel.css +49 -0
  115. package/theme-chalk/complextable.css +72 -0
  116. package/theme-chalk/dark.css +134 -0
  117. package/theme-chalk/dialog.css +0 -0
  118. package/theme-chalk/document-tables.css +175 -0
  119. package/theme-chalk/group-container.css +159 -0
  120. package/theme-chalk/index.css +2661 -0
  121. package/theme-chalk/loading.css +86 -0
  122. package/theme-chalk/page.css +34 -0
  123. package/theme-chalk/pub-class.css +417 -0
  124. package/theme-chalk/reset.css +152 -0
  125. package/theme-chalk/search-panel.css +31 -0
  126. package/theme-chalk/searchlayout.css +125 -0
  127. package/theme-chalk/src/autocomplete.scss +103 -0
  128. package/theme-chalk/src/base-var.scss +489 -0
  129. package/theme-chalk/src/base.scss +1 -0
  130. package/theme-chalk/src/black/index.scss +4 -0
  131. package/theme-chalk/src/collapse-container.scss +44 -0
  132. package/theme-chalk/src/collapse-panel.scss +26 -0
  133. package/theme-chalk/src/common/var.scss +154 -0
  134. package/theme-chalk/src/complextable.scss +47 -0
  135. package/theme-chalk/src/dark/css-vars.scss +35 -0
  136. package/theme-chalk/src/dark/var.scss +198 -0
  137. package/theme-chalk/src/dialog.scss +0 -0
  138. package/theme-chalk/src/document-tables.scss +133 -0
  139. package/theme-chalk/src/group-container.scss +139 -0
  140. package/theme-chalk/src/index.scss +17 -0
  141. package/theme-chalk/src/light/css-vars.scss +4 -0
  142. package/theme-chalk/src/light/var.scss +158 -0
  143. package/theme-chalk/src/loading.scss +68 -0
  144. package/theme-chalk/src/mixins/_var.scss +48 -0
  145. package/theme-chalk/src/mixins/config.scss +5 -0
  146. package/theme-chalk/src/mixins/function.scss +133 -0
  147. package/theme-chalk/src/mixins/mixins.scss +211 -0
  148. package/theme-chalk/src/page.scss +8 -0
  149. package/theme-chalk/src/pub-class.scss +127 -0
  150. package/theme-chalk/src/reset.scss +155 -0
  151. package/theme-chalk/src/search-panel.scss +10 -0
  152. package/theme-chalk/src/searchlayout.scss +114 -0
  153. package/theme-chalk/src/sticky-toolbar.scss +59 -0
  154. package/theme-chalk/src/table-toolbar.scss +36 -0
  155. package/theme-chalk/src/var.scss +32 -0
  156. package/theme-chalk/src/zjhc/alert.scss +16 -0
  157. package/theme-chalk/src/zjhc/anchor.scss +10 -0
  158. package/theme-chalk/src/zjhc/autocomplete.scss +11 -0
  159. package/theme-chalk/src/zjhc/backtop.scss +8 -0
  160. package/theme-chalk/src/zjhc/breadcrumb.scss +3 -0
  161. package/theme-chalk/src/zjhc/button.scss +82 -0
  162. package/theme-chalk/src/zjhc/calendar.scss +5 -0
  163. package/theme-chalk/src/zjhc/card.scss +5 -0
  164. package/theme-chalk/src/zjhc/cascader.scss +26 -0
  165. package/theme-chalk/src/zjhc/checkbox.scss +59 -0
  166. package/theme-chalk/src/zjhc/collapse.scss +8 -0
  167. package/theme-chalk/src/zjhc/dateEditor.scss +14 -0
  168. package/theme-chalk/src/zjhc/descriptions.scss +32 -0
  169. package/theme-chalk/src/zjhc/dialog.scss +148 -0
  170. package/theme-chalk/src/zjhc/drawer.scss +4 -0
  171. package/theme-chalk/src/zjhc/dropdown.scss +16 -0
  172. package/theme-chalk/src/zjhc/empty.scss +3 -0
  173. package/theme-chalk/src/zjhc/fontsize.scss +42 -0
  174. package/theme-chalk/src/zjhc/form.scss +33 -0
  175. package/theme-chalk/src/zjhc/index.scss +48 -0
  176. package/theme-chalk/src/zjhc/input.scss +47 -0
  177. package/theme-chalk/src/zjhc/link.scss +20 -0
  178. package/theme-chalk/src/zjhc/main.scss +3 -0
  179. package/theme-chalk/src/zjhc/mention.scss +9 -0
  180. package/theme-chalk/src/zjhc/menu.scss +0 -0
  181. package/theme-chalk/src/zjhc/message-box.scss +57 -0
  182. package/theme-chalk/src/zjhc/message.scss +13 -0
  183. package/theme-chalk/src/zjhc/notification.scss +4 -0
  184. package/theme-chalk/src/zjhc/number.scss +9 -0
  185. package/theme-chalk/src/zjhc/overlay.scss +3 -0
  186. package/theme-chalk/src/zjhc/page.scss +3 -0
  187. package/theme-chalk/src/zjhc/pagination.scss +64 -0
  188. package/theme-chalk/src/zjhc/picker.scss +85 -0
  189. package/theme-chalk/src/zjhc/popover.scss +13 -0
  190. package/theme-chalk/src/zjhc/popper.scss +13 -0
  191. package/theme-chalk/src/zjhc/radio.scss +49 -0
  192. package/theme-chalk/src/zjhc/scrollbar.scss +5 -0
  193. package/theme-chalk/src/zjhc/segmented.scss +18 -0
  194. package/theme-chalk/src/zjhc/select.scss +49 -0
  195. package/theme-chalk/src/zjhc/steps.scss +40 -0
  196. package/theme-chalk/src/zjhc/switch.scss +11 -0
  197. package/theme-chalk/src/zjhc/table-v2.scss +16 -0
  198. package/theme-chalk/src/zjhc/table.scss +44 -0
  199. package/theme-chalk/src/zjhc/tabs.scss +15 -0
  200. package/theme-chalk/src/zjhc/tags.scss +25 -0
  201. package/theme-chalk/src/zjhc/timeline.scss +16 -0
  202. package/theme-chalk/src/zjhc/tour.scss +9 -0
  203. package/theme-chalk/src/zjhc/tree.scss +6 -0
  204. package/theme-chalk/src/zjhc/upload.scss +6 -0
  205. package/theme-chalk/sticky-toolbar.css +71 -0
  206. package/theme-chalk/table-toolbar.css +53 -0
  207. package/theme-chalk/var.css +120 -0
package/dist/index.mjs ADDED
@@ -0,0 +1,3985 @@
1
+ import { computed, unref, ref, onMounted, watchEffect, onBeforeUnmount, nextTick, reactive, defineComponent, openBlock, createElementBlock, normalizeClass, renderSlot, createElementVNode, onUnmounted, onUpdated, resolveComponent, Fragment, withModifiers, createVNode, withCtx, createTextVNode, createCommentVNode, provide, isVNode, h, toDisplayString, createBlock, resolveDynamicComponent, withDirectives, vShow, normalizeStyle, renderList, getCurrentInstance, watch, inject, Teleport, Transition, mergeProps, createSlots, resolveDirective, useAttrs as useAttrs$1, withKeys, createApp, toRefs, isRef, normalizeProps, guardReactiveProps } from "vue";
2
+ import { ElCol, ElForm, ElRow, ElDropdown, ElButton, ElIcon, ElDropdownMenu, ElDropdownItem, ElMessageBox, dialogInjectionKey, useNamespace as useNamespace$1, useSameTarget, ElOverlay, ElTableColumn, ElLink, ElTable, ElPagination, useAttrs, useId as useId$1, ElTooltip, ElInput, ElScrollbar, useGlobalConfig as useGlobalConfig$1, useZIndex as useZIndex$1, defaultInitialZIndex, ElSelect } from "element-plus";
3
+ import { debounce, isUndefined } from "lodash-es";
4
+ import ElFocusTrap, { FOCUS_TRAP_INJECTION_KEY } from "element-plus/es/components/focus-trap/index";
5
+ import { addUnit as addUnit$1, buildProps, iconPropType, isBoolean, definePropType, isClient as isClient$1, composeRefs, isObject as isObject$2, isString as isString$2, isArray as isArray$1 } from "element-plus/es/utils/index";
6
+ import { isClient, useTimeoutFn, onClickOutside } from "@vueuse/core";
7
+ import { useZIndex, useId, defaultNamespace as defaultNamespace$1, useLockscreen, useAriaProps } from "element-plus/es/hooks/index";
8
+ import { useGlobalConfig } from "element-plus/es/components/config-provider/index";
9
+ import { useFormDisabled } from "element-plus/es/components/form/index";
10
+ import { useTooltipContentProps } from "element-plus/es/components/tooltip/index";
11
+ import { defaultRenderCell } from "element-plus/es/components/table/src/config";
12
+ import CryptoJS from "crypto-js";
13
+ const EVENT_CODE = {
14
+ tab: "Tab",
15
+ enter: "Enter",
16
+ space: "Space",
17
+ left: "ArrowLeft",
18
+ // 37
19
+ up: "ArrowUp",
20
+ // 38
21
+ right: "ArrowRight",
22
+ // 39
23
+ down: "ArrowDown",
24
+ // 40
25
+ esc: "Escape",
26
+ delete: "Delete",
27
+ backspace: "Backspace",
28
+ numpadEnter: "NumpadEnter",
29
+ pageUp: "PageUp",
30
+ pageDown: "PageDown",
31
+ home: "Home",
32
+ end: "End"
33
+ };
34
+ const datePickTypes = [
35
+ "year",
36
+ "years",
37
+ "month",
38
+ "months",
39
+ "date",
40
+ "dates",
41
+ "week",
42
+ "datetime",
43
+ "datetimerange",
44
+ "daterange",
45
+ "monthrange",
46
+ "yearrange"
47
+ ];
48
+ const WEEK_DAYS = [
49
+ "sun",
50
+ "mon",
51
+ "tue",
52
+ "wed",
53
+ "thu",
54
+ "fri",
55
+ "sat"
56
+ ];
57
+ const UPDATE_MODEL_EVENT = "update:modelValue";
58
+ const CHANGE_EVENT = "change";
59
+ const INPUT_EVENT = "input";
60
+ const INSTALLED_KEY = Symbol("INSTALLED_KEY");
61
+ const componentSizes = ["", "default", "small", "large"];
62
+ const componentSizeMap = {
63
+ large: 40,
64
+ default: 32,
65
+ small: 24
66
+ };
67
+ const version$1 = "0.1.0";
68
+ const makeInstaller = (components = []) => {
69
+ const install2 = (app) => {
70
+ if (app[INSTALLED_KEY]) return;
71
+ app[INSTALLED_KEY] = true;
72
+ components.forEach((c) => app.use(c));
73
+ };
74
+ return {
75
+ version: version$1,
76
+ install: install2
77
+ };
78
+ };
79
+ const NOOP = () => {
80
+ };
81
+ const isString$1 = (val) => typeof val === "string";
82
+ const isObject$1 = (val) => val !== null && typeof val === "object";
83
+ const camelize = (str) => str.replace(/-(\w)/g, (_, c) => c ? c.toUpperCase() : "");
84
+ const hyphenate = (str) => str.replace(/\B([A-Z])/g, "-$1").toLowerCase();
85
+ const withInstall = (main, extra) => {
86
+ main.install = (app) => {
87
+ for (const comp of [main, ...Object.values(extra ?? {})]) {
88
+ app.component(comp.name, comp);
89
+ }
90
+ };
91
+ if (extra) {
92
+ for (const [key, comp] of Object.entries(extra)) {
93
+ main[key] = comp;
94
+ }
95
+ }
96
+ return main;
97
+ };
98
+ const withInstallFunction = (fn, name) => {
99
+ fn.install = (app) => {
100
+ fn._context = app._context;
101
+ app.config.globalProperties[name] = fn;
102
+ };
103
+ return fn;
104
+ };
105
+ const withInstallDirective = (directive, name) => {
106
+ directive.install = (app) => {
107
+ app.directive(name, directive);
108
+ };
109
+ return directive;
110
+ };
111
+ const withNoopInstall = (component) => {
112
+ component.install = NOOP;
113
+ return component;
114
+ };
115
+ const opt = Object.prototype.toString;
116
+ function isFunction(obj) {
117
+ return typeof obj === "function";
118
+ }
119
+ function isString(obj) {
120
+ return opt.call(obj) === "[object String]";
121
+ }
122
+ function isObject(obj) {
123
+ return opt.call(obj) === "[object Object]";
124
+ }
125
+ function isArray(obj) {
126
+ return opt.call(obj) === "[object Array]";
127
+ }
128
+ function isNumber$1(obj) {
129
+ return opt.call(obj) === "[object Number]" && obj === obj;
130
+ }
131
+ function isFile(obj) {
132
+ return opt.call(obj) === "[object File]";
133
+ }
134
+ function isRegExp(obj) {
135
+ return opt.call(obj) === "[object RegExp]";
136
+ }
137
+ function isBlob(obj) {
138
+ return opt.call(obj) === "[object Blob]";
139
+ }
140
+ function isWindow(obj) {
141
+ return obj === window;
142
+ }
143
+ function toTreeRecursion(list, item, codeProp, parentProp, leafProp, mergeFunc) {
144
+ if (leafProp && item[leafProp]) {
145
+ return;
146
+ }
147
+ const children = list.filter((t) => t[parentProp] === item[codeProp]).map((t) => {
148
+ if (mergeFunc) {
149
+ return Object.assign({}, t, mergeFunc(t));
150
+ } else {
151
+ return Object.assign({}, t);
152
+ }
153
+ });
154
+ if (!leafProp && children.length === 0) {
155
+ return;
156
+ }
157
+ children.forEach(
158
+ (t) => toTreeRecursion(list, t, codeProp, parentProp, leafProp, mergeFunc)
159
+ );
160
+ item.children = children;
161
+ }
162
+ function toTree(list, rootCode, codeProp, parentProp, leafProp, mergeFunc) {
163
+ return list.filter((t) => t[parentProp] === rootCode).map((t) => {
164
+ const item = mergeFunc ? Object.assign({}, t, mergeFunc(t)) : Object.assign({}, t);
165
+ toTreeRecursion(list, item, codeProp, parentProp, leafProp, mergeFunc);
166
+ return item;
167
+ });
168
+ }
169
+ const securityKey = "aubVseoLz3BkkeXKCXNzMg==";
170
+ function serialize(obj) {
171
+ const json = JSON.stringify(obj);
172
+ return CryptoJS.AES.encrypt(json, securityKey).toString();
173
+ }
174
+ function deserialize(input) {
175
+ const json = CryptoJS.AES.decrypt(input, securityKey).toString(
176
+ CryptoJS.enc.Utf8
177
+ );
178
+ return JSON.parse(json);
179
+ }
180
+ class ZjhcUIError extends Error {
181
+ constructor(m) {
182
+ super(m);
183
+ this.name = "ZjhcUIError";
184
+ }
185
+ }
186
+ function throwError(scope, m) {
187
+ throw new ZjhcUIError(`[${scope}]${m}`);
188
+ }
189
+ const isNumber = (val) => typeof val === "number";
190
+ const isStringNumber = (val) => {
191
+ if (!isString$1(val)) {
192
+ return false;
193
+ }
194
+ return !Number.isNaN(Number(val));
195
+ };
196
+ const classNameToArray = (cls = "") => cls.split(" ").filter((item) => !!item.trim());
197
+ const hasClass = (el, cls) => {
198
+ if (!el || !cls) return false;
199
+ if (cls.includes(" ")) throw new Error("classname should not contain space.");
200
+ return el.classList.contains(cls);
201
+ };
202
+ const addClass = (el, cls) => {
203
+ if (!el || !cls.trim()) return;
204
+ el.classList.add(...classNameToArray(cls));
205
+ };
206
+ const removeClass = (el, cls) => {
207
+ if (!el || !cls.trim()) return;
208
+ el.classList.remove(...classNameToArray(cls));
209
+ };
210
+ const getStyle = (element, styleName) => {
211
+ var _a;
212
+ if (!isClient || !element || !styleName) return "";
213
+ let key = camelize(styleName);
214
+ if (key === "float") key = "cssFloat";
215
+ try {
216
+ const style = element.style[key];
217
+ if (style) return style;
218
+ const computed2 = (_a = document.defaultView) == null ? void 0 : _a.getComputedStyle(element, "");
219
+ return computed2 ? computed2[key] : "";
220
+ } catch {
221
+ return element.style[key];
222
+ }
223
+ };
224
+ const setStyle = (element, styleName, value) => {
225
+ if (!element || !styleName) return;
226
+ if (isObject$1(styleName)) {
227
+ Object.entries(styleName).forEach(
228
+ ([prop, value2]) => setStyle(element, prop, value2)
229
+ );
230
+ } else {
231
+ const key = camelize(styleName);
232
+ element.style[key] = value;
233
+ }
234
+ };
235
+ const removeStyle = (element, style) => {
236
+ if (!element || !style) return;
237
+ if (isObject$1(style)) {
238
+ Object.keys(style).forEach(
239
+ (prop) => removeStyle(element, prop)
240
+ );
241
+ } else {
242
+ setStyle(element, style, "");
243
+ }
244
+ };
245
+ function addUnit(value, defaultUnit = "px") {
246
+ if (!value) return;
247
+ if (isNumber(value) || isStringNumber(value)) {
248
+ return `${value}${defaultUnit}`;
249
+ } else if (isString$1(value)) {
250
+ return value;
251
+ }
252
+ console.warn(
253
+ "@zjhc/ui/utils/dom/style",
254
+ "binding value must be a string or number"
255
+ );
256
+ }
257
+ const defaultNamespace = "zjhc";
258
+ const statePrefix = "is-";
259
+ const _bem = (namespace, block, blockSuffix, element, modifier) => {
260
+ let cls = `${namespace}-${block}`;
261
+ if (blockSuffix && blockSuffix !== "") {
262
+ cls += `-${blockSuffix}`;
263
+ }
264
+ if (element) {
265
+ cls += `__${element}`;
266
+ }
267
+ if (modifier) {
268
+ cls += `--${modifier}`;
269
+ }
270
+ return cls;
271
+ };
272
+ const useNamespace = (block) => {
273
+ const namespace = computed(() => defaultNamespace);
274
+ const b = (blockSuffix = "") => {
275
+ return _bem(unref(namespace), block, blockSuffix, "", "");
276
+ };
277
+ const e = (element) => {
278
+ return element ? _bem(unref(namespace), block, "", element, "") : "";
279
+ };
280
+ const m = (modifier) => {
281
+ return modifier ? _bem(unref(namespace), block, "", "", modifier) : "";
282
+ };
283
+ const be = (blockSuffix, element) => {
284
+ return blockSuffix && element ? _bem(unref(namespace), block, blockSuffix, element, "") : "";
285
+ };
286
+ const em = (element, modifier) => {
287
+ return element && modifier ? _bem(unref(namespace), block, "", element, modifier) : "";
288
+ };
289
+ const bm = (blockSuffix, modifier) => {
290
+ return blockSuffix && modifier ? _bem(unref(namespace), block, blockSuffix, "", modifier) : "";
291
+ };
292
+ const bem = (blockSuffix, element, modifier) => {
293
+ return blockSuffix && element && modifier ? _bem(unref(namespace), block, blockSuffix, element, modifier) : "";
294
+ };
295
+ const is = (name, ...args) => {
296
+ const state = args.length >= 1 ? args[0] : true;
297
+ return name && state ? `${statePrefix}${name}` : "";
298
+ };
299
+ return {
300
+ namespace,
301
+ b,
302
+ e,
303
+ m,
304
+ be,
305
+ em,
306
+ bm,
307
+ bem,
308
+ is
309
+ };
310
+ };
311
+ const useDraggableAndResizable = (targetRef, dragRef, draggable, resizable, isFullscreen, alignCenter, overflow) => {
312
+ const fullscreen = ref(false);
313
+ const varWidth = "width";
314
+ const varHeight = "height";
315
+ const minus = ref(false);
316
+ const dividerWidth = 5;
317
+ let dialogBody;
318
+ let transform = {
319
+ offsetX: 0,
320
+ offsetY: 0
321
+ };
322
+ let dialogWidth = "";
323
+ let dialogHeight = "";
324
+ let lastDialogStatus = 2;
325
+ const minSize = {
326
+ width: 200,
327
+ height: 72
328
+ };
329
+ const setTransform = () => {
330
+ if (targetRef.value) {
331
+ targetRef.value.style.left = transform.offsetX + "px";
332
+ targetRef.value.style.top = transform.offsetY + "px";
333
+ }
334
+ };
335
+ const onMousedown = (e) => {
336
+ var _a;
337
+ e.stopPropagation();
338
+ const downX = e.clientX;
339
+ const downY = e.clientY;
340
+ const marginTop = parseFloat(getComputedStyle(targetRef.value).marginTop);
341
+ const targetRect = targetRef.value.getBoundingClientRect();
342
+ const targetLeft = targetRect.left;
343
+ const targeTop = targetRect.top;
344
+ const targeWidth = targetRect.width;
345
+ const targeHeight = targetRect.height;
346
+ const clientWidth = document.documentElement.clientWidth;
347
+ const clientHeight = document.documentElement.clientHeight;
348
+ const minLeft = 0;
349
+ const minTop = 0 - marginTop;
350
+ const maxLeft = clientWidth - targeWidth;
351
+ const maxTop = clientHeight - targeHeight - marginTop;
352
+ const activeIframe = getFirstVisibleIframe();
353
+ dialogBody = (_a = targetRef.value) == null ? void 0 : _a.querySelector(".el-dialog__body");
354
+ const onMousemove = (e2) => {
355
+ if (activeIframe) {
356
+ activeIframe.style.pointerEvents = "none";
357
+ }
358
+ if (dialogBody) {
359
+ dialogBody.style.pointerEvents = "none";
360
+ }
361
+ document.body.style.userSelect = "none";
362
+ let moveX = targetLeft + e2.clientX - downX;
363
+ let moveY = targeTop + e2.clientY - downY - marginTop;
364
+ if (!(overflow == null ? void 0 : overflow.value)) {
365
+ moveX = Math.min(Math.max(moveX, minLeft), maxLeft);
366
+ moveY = Math.min(Math.max(moveY, minTop), maxTop);
367
+ }
368
+ transform = {
369
+ offsetX: moveX,
370
+ offsetY: moveY
371
+ };
372
+ if (targetRef.value) {
373
+ targetRef.value.style.left = `${addUnit$1(moveX)}`;
374
+ targetRef.value.style.top = `${addUnit$1(moveY)}`;
375
+ }
376
+ };
377
+ const onMouseup = () => {
378
+ if (activeIframe) {
379
+ activeIframe.style.pointerEvents = "";
380
+ }
381
+ if (dialogBody) {
382
+ dialogBody.style.pointerEvents = "";
383
+ }
384
+ document.body.style.userSelect = "";
385
+ document.removeEventListener("mousemove", onMousemove);
386
+ document.removeEventListener("mouseup", onMouseup);
387
+ };
388
+ document.addEventListener("mousemove", onMousemove);
389
+ document.addEventListener("mouseup", onMouseup);
390
+ };
391
+ const onResizeMousemove = (e) => {
392
+ if (!resizable.value) return;
393
+ if (minus.value) return;
394
+ const { offsetWidth, offsetHeight, offsetLeft, offsetTop } = targetRef.value;
395
+ if (e.clientX - offsetLeft < offsetWidth && e.clientX - offsetLeft > offsetWidth - dividerWidth && e.clientY - offsetTop < offsetHeight && e.clientY - offsetTop > offsetHeight - dividerWidth) {
396
+ targetRef.value.style.cursor = "se-resize";
397
+ } else if (e.clientX - offsetLeft <= dividerWidth && e.clientX - offsetLeft > 0 && e.clientY - offsetTop < offsetHeight && e.clientY - offsetTop > offsetHeight - dividerWidth) {
398
+ targetRef.value.style.cursor = "sw-resize";
399
+ } else if (e.clientX - offsetLeft <= dividerWidth) {
400
+ targetRef.value.style.cursor = "w-resize";
401
+ } else if (e.clientX - offsetLeft > offsetWidth - dividerWidth) {
402
+ targetRef.value.style.cursor = "e-resize";
403
+ } else if (e.clientY - offsetTop > offsetHeight - dividerWidth) {
404
+ targetRef.value.style.cursor = "s-resize";
405
+ } else {
406
+ targetRef.value.style.cursor = "";
407
+ }
408
+ };
409
+ const onResizeMousedown = (e) => {
410
+ var _a;
411
+ if (!resizable.value) return;
412
+ if (minus.value) return;
413
+ const activeIframe = getFirstVisibleIframe();
414
+ const { clientX, clientY } = e;
415
+ const marginTop = parseFloat(getComputedStyle(targetRef.value).marginTop);
416
+ const targetRect = targetRef.value.getBoundingClientRect();
417
+ const transX = targetRect.left;
418
+ const transY = targetRect.top;
419
+ const offsetWidth = targetRect.width;
420
+ const offsetHeight = targetRect.height;
421
+ const offsetX = clientX - transX;
422
+ const offsetY = clientY - transY;
423
+ transform = {
424
+ offsetX: transX,
425
+ offsetY: transY - marginTop
426
+ };
427
+ const maxWidth = document.documentElement.clientWidth;
428
+ const maxHeight = document.documentElement.clientHeight;
429
+ dialogBody = (_a = targetRef.value) == null ? void 0 : _a.querySelector(".el-dialog__body");
430
+ const onDocumentMouseup = () => {
431
+ document.removeEventListener("mousemove", onDocumentMousemove);
432
+ document.removeEventListener("mouseup", onDocumentMouseup);
433
+ targetRef.value.style.userSelect = "auto";
434
+ if (dialogBody) {
435
+ dialogBody.style.pointerEvents = "";
436
+ }
437
+ if (activeIframe) {
438
+ activeIframe.style.pointerEvents = "";
439
+ }
440
+ document.body.style.userSelect = "";
441
+ };
442
+ const onDocumentMousemove = (e2) => {
443
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
444
+ if (!targetRef.value) return;
445
+ if (e2.clientX > maxWidth - 2 || e2.clientX < 1 || e2.clientY > maxHeight || e2.clientY < 1) {
446
+ document.removeEventListener("mousemove", onDocumentMousemove);
447
+ document.removeEventListener("mouseup", onDocumentMouseup);
448
+ targetRef.value.style.userSelect = "auto";
449
+ if (dialogBody) {
450
+ dialogBody.style.pointerEvents = "";
451
+ }
452
+ if (activeIframe) {
453
+ activeIframe.style.pointerEvents = "";
454
+ }
455
+ document.body.style.userSelect = "";
456
+ } else {
457
+ if (dialogBody) {
458
+ dialogBody.style.pointerEvents = "none";
459
+ }
460
+ if (activeIframe) {
461
+ activeIframe.style.pointerEvents = "none";
462
+ }
463
+ document.body.style.userSelect = "none";
464
+ let moveX = transX;
465
+ if (offsetX >= 0 && offsetX <= dividerWidth) {
466
+ if (clientX > e2.clientX) {
467
+ (_a2 = targetRef.value) == null ? void 0 : _a2.style.setProperty(
468
+ varWidth,
469
+ offsetWidth + (clientX - e2.clientX) + "px"
470
+ );
471
+ moveX = transX + (e2.clientX - clientX);
472
+ } else if (clientX < e2.clientX) {
473
+ if (offsetWidth - (e2.clientX - clientX) <= minSize.width) {
474
+ (_b = targetRef.value) == null ? void 0 : _b.style.setProperty(varWidth, minSize.width + "px");
475
+ moveX = transform.offsetX;
476
+ } else {
477
+ (_c = targetRef.value) == null ? void 0 : _c.style.setProperty(
478
+ varWidth,
479
+ offsetWidth - (e2.clientX - clientX) + "px"
480
+ );
481
+ moveX = Math.round(transX + (e2.clientX - clientX));
482
+ }
483
+ }
484
+ transform = {
485
+ offsetX: moveX,
486
+ offsetY: transform.offsetY
487
+ };
488
+ setTransform();
489
+ fullscreen.value = false;
490
+ } else if (offsetX >= offsetWidth - 5 && offsetX <= offsetWidth) {
491
+ if (clientX > e2.clientX) {
492
+ if (offsetWidth - (clientX - e2.clientX) <= minSize.width) {
493
+ (_d = targetRef.value) == null ? void 0 : _d.style.setProperty(varWidth, minSize.width + "px");
494
+ } else {
495
+ (_e = targetRef.value) == null ? void 0 : _e.style.setProperty(
496
+ varWidth,
497
+ offsetWidth - (clientX - e2.clientX) + "px"
498
+ );
499
+ }
500
+ } else if (clientX < e2.clientX) {
501
+ if (clientX < e2.clientX && e2.clientX < maxWidth) {
502
+ if (offsetWidth + (e2.clientX - clientX) >= maxWidth) {
503
+ (_f = targetRef.value) == null ? void 0 : _f.style.setProperty(varWidth, maxWidth + "px");
504
+ } else {
505
+ (_g = targetRef.value) == null ? void 0 : _g.style.setProperty(
506
+ varWidth,
507
+ offsetWidth + (e2.clientX - clientX) + "px"
508
+ );
509
+ }
510
+ }
511
+ }
512
+ fullscreen.value = false;
513
+ }
514
+ if (offsetY > offsetHeight - dividerWidth && offsetY < offsetHeight) {
515
+ if (clientY > e2.clientY) {
516
+ if (offsetHeight - (clientY - e2.clientY) > minSize.height) {
517
+ (_h = targetRef.value) == null ? void 0 : _h.style.setProperty(
518
+ varHeight,
519
+ offsetHeight - (clientY - e2.clientY) + "px"
520
+ );
521
+ } else {
522
+ (_i = targetRef.value) == null ? void 0 : _i.style.setProperty(
523
+ varHeight,
524
+ minSize.height + "px"
525
+ );
526
+ }
527
+ } else if (clientY < e2.clientY && e2.clientY < maxHeight) {
528
+ if (offsetHeight + (e2.clientY - clientY) >= maxHeight) {
529
+ (_j = targetRef.value) == null ? void 0 : _j.style.setProperty(varHeight, maxHeight + "px");
530
+ } else {
531
+ (_k = targetRef.value) == null ? void 0 : _k.style.setProperty(
532
+ varHeight,
533
+ offsetHeight + (e2.clientY - clientY) + "px"
534
+ );
535
+ }
536
+ }
537
+ fullscreen.value = false;
538
+ }
539
+ }
540
+ };
541
+ if (offsetX > dividerWidth && offsetX < offsetWidth - dividerWidth && offsetY > dividerWidth && offsetY < offsetHeight - dividerWidth) {
542
+ return;
543
+ } else {
544
+ targetRef.value.style.userSelect = "none";
545
+ document.addEventListener("mousemove", onDocumentMousemove);
546
+ document.addEventListener("mouseup", onDocumentMouseup);
547
+ }
548
+ };
549
+ const onDraggable = () => {
550
+ if (dragRef.value && targetRef.value) {
551
+ dragRef.value.addEventListener("mousedown", onMousedown);
552
+ }
553
+ };
554
+ const offDraggable = () => {
555
+ if (dragRef.value && targetRef.value) {
556
+ dragRef.value.removeEventListener("mousedown", onMousedown);
557
+ }
558
+ };
559
+ const onResizable = () => {
560
+ if (targetRef.value) {
561
+ targetRef.value.addEventListener("mousemove", onResizeMousemove);
562
+ targetRef.value.addEventListener("mousedown", onResizeMousedown);
563
+ }
564
+ };
565
+ const offResizable = () => {
566
+ if (targetRef.value) {
567
+ targetRef.value.removeEventListener("mousemove", onResizeMousemove);
568
+ targetRef.value.removeEventListener("mousedown", onResizeMousedown);
569
+ }
570
+ };
571
+ const resetPosition = () => {
572
+ if (targetRef.value) {
573
+ transform = {
574
+ offsetX: 0,
575
+ offsetY: 0
576
+ };
577
+ const targetRect = targetRef.value.getBoundingClientRect();
578
+ const width = targetRect.width;
579
+ const height = targetRect.height;
580
+ const winWidth = window.innerWidth;
581
+ const winHeight = window.innerHeight;
582
+ targetRef.value.style.left = (winWidth - width) / 2 + "px";
583
+ if (alignCenter.value) {
584
+ targetRef.value.style.top = (winHeight - height) / 2 + "px";
585
+ }
586
+ }
587
+ };
588
+ const resetSize = () => {
589
+ fullscreen.value = false;
590
+ minus.value = false;
591
+ };
592
+ const fullscreenFn = () => {
593
+ if (targetRef.value) {
594
+ targetRef.value.style.left = "";
595
+ targetRef.value.style.top = "";
596
+ targetRef.value.style.setProperty(varWidth, "100%");
597
+ targetRef.value.style.setProperty(varHeight, "100%");
598
+ }
599
+ };
600
+ const minusFn = () => {
601
+ if (targetRef.value) {
602
+ targetRef.value.style.left = "";
603
+ targetRef.value.style.top = "";
604
+ targetRef.value.style.setProperty(varWidth, null);
605
+ targetRef.value.style.setProperty(varHeight, null);
606
+ }
607
+ };
608
+ const onExpand = () => {
609
+ if (targetRef.value) {
610
+ const style = window.getComputedStyle(targetRef.value);
611
+ dialogWidth = style.getPropertyValue(varWidth);
612
+ dialogHeight = style.getPropertyValue(varHeight);
613
+ }
614
+ minus.value = false;
615
+ fullscreen.value = true;
616
+ nextTick(() => {
617
+ fullscreenFn();
618
+ });
619
+ };
620
+ const onCompress = () => {
621
+ minus.value = false;
622
+ if (lastDialogStatus == 1) {
623
+ fullscreen.value = true;
624
+ lastDialogStatus = 2;
625
+ nextTick(() => {
626
+ fullscreenFn();
627
+ });
628
+ } else {
629
+ fullscreen.value = false;
630
+ nextTick(() => {
631
+ if (targetRef.value) {
632
+ targetRef.value.style.setProperty(varWidth, dialogWidth);
633
+ targetRef.value.style.setProperty(varHeight, dialogHeight);
634
+ resetPosition();
635
+ }
636
+ });
637
+ }
638
+ };
639
+ const onMinus = () => {
640
+ if (fullscreen.value) {
641
+ lastDialogStatus = 1;
642
+ } else {
643
+ lastDialogStatus = 2;
644
+ if (targetRef.value) {
645
+ const style = window.getComputedStyle(targetRef.value);
646
+ dialogWidth = style.getPropertyValue(varWidth);
647
+ dialogHeight = style.getPropertyValue(varHeight);
648
+ }
649
+ }
650
+ fullscreen.value = false;
651
+ minus.value = true;
652
+ nextTick(() => {
653
+ minusFn();
654
+ });
655
+ };
656
+ onMounted(() => {
657
+ watchEffect(() => {
658
+ fullscreen.value = isFullscreen.value;
659
+ });
660
+ watchEffect(() => {
661
+ if (draggable.value) {
662
+ onDraggable();
663
+ } else {
664
+ offDraggable();
665
+ }
666
+ });
667
+ watchEffect(() => {
668
+ if (resizable.value) {
669
+ onResizable();
670
+ } else {
671
+ offResizable();
672
+ }
673
+ });
674
+ });
675
+ onBeforeUnmount(() => {
676
+ offDraggable();
677
+ });
678
+ return {
679
+ resetPosition,
680
+ resetSize,
681
+ onExpand,
682
+ onCompress,
683
+ onMinus,
684
+ fullscreen,
685
+ minus
686
+ };
687
+ };
688
+ function getFirstVisibleIframe() {
689
+ const iframes = document.getElementsByTagName("iframe");
690
+ if (iframes.length > 0) {
691
+ for (let i = 0; i < iframes.length; i++) {
692
+ if (iframes[i].offsetWidth > 0 && iframes[i].offsetHeight > 0) {
693
+ return iframes[i];
694
+ }
695
+ }
696
+ return null;
697
+ } else {
698
+ return null;
699
+ }
700
+ }
701
+ function useLoading(initValue = false) {
702
+ const loading = ref(initValue);
703
+ const setLoading = (value) => {
704
+ loading.value = value;
705
+ };
706
+ return {
707
+ loading,
708
+ setLoading
709
+ };
710
+ }
711
+ function useOperModal(initValue) {
712
+ const mode = ref("");
713
+ const visible = ref(false);
714
+ const info = ref(initValue);
715
+ const setOperModal = (m, v, i) => {
716
+ mode.value = m;
717
+ visible.value = v;
718
+ info.value = i;
719
+ };
720
+ const clearOperModal = () => {
721
+ mode.value = "";
722
+ visible.value = false;
723
+ info.value = initValue;
724
+ };
725
+ return {
726
+ mode,
727
+ visible,
728
+ info,
729
+ setOperModal,
730
+ clearOperModal
731
+ };
732
+ }
733
+ function useComplexTable(config) {
734
+ const tableData = ref([]);
735
+ const tablePagination = reactive({
736
+ visible: false,
737
+ currentPage: 1,
738
+ pageSize: config.SERVICE_PAGESIZE,
739
+ hideOnSinglePage: false
740
+ });
741
+ const setData = (data) => {
742
+ tableData.value = data ?? [];
743
+ };
744
+ const setPagination = (pageData) => {
745
+ if (pageData) {
746
+ tableData.value = pageData.list;
747
+ Object.assign(tablePagination, {
748
+ visible: true,
749
+ total: pageData.total,
750
+ currentPage: pageData.pageNum,
751
+ pageSize: pageData.pageSize,
752
+ hideOnSinglePage: false
753
+ });
754
+ } else {
755
+ tableData.value = [];
756
+ Object.assign(tablePagination, {
757
+ visible: true,
758
+ total: 0,
759
+ currentPage: 1,
760
+ hideOnSinglePage: true
761
+ });
762
+ }
763
+ };
764
+ const setPageIndex = (pageIndex) => {
765
+ Object.assign(tablePagination, {
766
+ currentPage: pageIndex
767
+ });
768
+ };
769
+ const setPageSizes = (pageSize) => {
770
+ Object.assign(tablePagination, {
771
+ currentPage: 1,
772
+ pageSize
773
+ });
774
+ };
775
+ return {
776
+ tableData,
777
+ tablePagination,
778
+ setData,
779
+ setPagination,
780
+ setPageIndex,
781
+ setPageSizes
782
+ };
783
+ }
784
+ function setTheme(theme) {
785
+ if (theme) {
786
+ if (theme.elderMode) {
787
+ document.documentElement.classList.add(`${defaultNamespace}-caremode`);
788
+ } else {
789
+ document.documentElement.classList.remove(`${defaultNamespace}-caremode`);
790
+ }
791
+ if (theme.themeCode !== "default" && theme.themeCode !== "") {
792
+ const themePerfix = defaultNamespace + "-theme-";
793
+ const classList = Array.from(document.documentElement.classList);
794
+ classList.forEach((cls) => {
795
+ if (cls.startsWith(themePerfix)) {
796
+ document.documentElement.classList.remove(cls);
797
+ }
798
+ });
799
+ document.documentElement.classList.add(themePerfix + theme.themeCode);
800
+ loadCss(`/static-resource/theme/skin/${theme.themeCode}/theme-index.css`);
801
+ } else {
802
+ const themePerfix = defaultNamespace + "-theme-";
803
+ const classList = Array.from(document.documentElement.classList);
804
+ classList.forEach((cls) => {
805
+ if (cls.startsWith(themePerfix)) {
806
+ document.documentElement.classList.remove(cls);
807
+ }
808
+ });
809
+ }
810
+ }
811
+ }
812
+ function loadCss(url) {
813
+ const linkId = "themeCss";
814
+ if (!document.getElementById(linkId)) {
815
+ const linkEl = document.createElement("link");
816
+ linkEl.rel = "stylesheet";
817
+ linkEl.href = url;
818
+ linkEl.id = linkId;
819
+ document.head.appendChild(linkEl);
820
+ }
821
+ }
822
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
823
+ ...{
824
+ name: "ZjhcSearchPanel"
825
+ },
826
+ __name: "searchPanel",
827
+ setup(__props) {
828
+ const bem = useNamespace("search");
829
+ return (_ctx, _cache) => {
830
+ return openBlock(), createElementBlock("div", {
831
+ class: normalizeClass(unref(bem).e("panel"))
832
+ }, [
833
+ renderSlot(_ctx.$slots, "default")
834
+ ], 2);
835
+ };
836
+ }
837
+ });
838
+ const ZjhcSearchPanel = withInstall(_sfc_main$m);
839
+ const _sfc_main$l = defineComponent({
840
+ name: "Loading"
841
+ });
842
+ const _export_sfc = (sfc, props) => {
843
+ const target = sfc.__vccOpts || sfc;
844
+ for (const [key, val] of props) {
845
+ target[key] = val;
846
+ }
847
+ return target;
848
+ };
849
+ const _hoisted_1$b = {
850
+ xmlns: "http://www.w3.org/2000/svg",
851
+ viewBox: "0 0 1024 1024"
852
+ };
853
+ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
854
+ return openBlock(), createElementBlock("svg", _hoisted_1$b, [..._cache[0] || (_cache[0] = [
855
+ createElementVNode("path", {
856
+ fill: "currentColor",
857
+ d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248M828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0"
858
+ }, null, -1)
859
+ ])]);
860
+ }
861
+ const Loading$1 = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$8]]);
862
+ const _sfc_main$k = defineComponent({
863
+ name: "Check"
864
+ });
865
+ const _hoisted_1$a = {
866
+ xmlns: "http://www.w3.org/2000/svg",
867
+ viewBox: "0 0 1024 1024"
868
+ };
869
+ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
870
+ return openBlock(), createElementBlock("svg", _hoisted_1$a, [..._cache[0] || (_cache[0] = [
871
+ createElementVNode("path", {
872
+ fill: "currentColor",
873
+ d: "M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"
874
+ }, null, -1)
875
+ ])]);
876
+ }
877
+ const Check = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$7]]);
878
+ const _sfc_main$j = defineComponent({
879
+ name: "ArrowDown"
880
+ });
881
+ const _hoisted_1$9 = {
882
+ xmlns: "http://www.w3.org/2000/svg",
883
+ viewBox: "0 0 1024 1024"
884
+ };
885
+ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
886
+ return openBlock(), createElementBlock("svg", _hoisted_1$9, [..._cache[0] || (_cache[0] = [
887
+ createElementVNode("path", {
888
+ fill: "currentColor",
889
+ d: "M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"
890
+ }, null, -1)
891
+ ])]);
892
+ }
893
+ const ArrowDown = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$6]]);
894
+ const _sfc_main$i = defineComponent({
895
+ name: "ArrowUp"
896
+ });
897
+ const _hoisted_1$8 = {
898
+ xmlns: "http://www.w3.org/2000/svg",
899
+ viewBox: "0 0 1024 1024"
900
+ };
901
+ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
902
+ return openBlock(), createElementBlock("svg", _hoisted_1$8, [..._cache[0] || (_cache[0] = [
903
+ createElementVNode("path", {
904
+ fill: "currentColor",
905
+ d: "m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"
906
+ }, null, -1)
907
+ ])]);
908
+ }
909
+ const ArrowUp = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$5]]);
910
+ const _sfc_main$h = defineComponent({
911
+ name: "Filter"
912
+ });
913
+ const _hoisted_1$7 = {
914
+ xmlns: "http://www.w3.org/2000/svg",
915
+ viewBox: "0 0 1024 1024"
916
+ };
917
+ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
918
+ return openBlock(), createElementBlock("svg", _hoisted_1$7, [..._cache[0] || (_cache[0] = [
919
+ createElementVNode("path", {
920
+ fill: "currentColor",
921
+ d: "M384 523.392V928a32 32 0 0 0 46.336 28.608l192-96A32 32 0 0 0 640 832V523.392l280.768-343.104a32 32 0 1 0-49.536-40.576l-288 352A32 32 0 0 0 576 512v300.224l-128 64V512a32 32 0 0 0-7.232-20.288L195.52 192H704a32 32 0 1 0 0-64H128a32 32 0 0 0-24.768 52.288z"
922
+ }, null, -1)
923
+ ])]);
924
+ }
925
+ const Filter = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$4]]);
926
+ const _sfc_main$g = defineComponent({
927
+ name: "Close"
928
+ });
929
+ const _hoisted_1$6 = {
930
+ xmlns: "http://www.w3.org/2000/svg",
931
+ viewBox: "0 0 1024 1024"
932
+ };
933
+ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
934
+ return openBlock(), createElementBlock("svg", _hoisted_1$6, [..._cache[0] || (_cache[0] = [
935
+ createElementVNode("path", {
936
+ fill: "currentColor",
937
+ d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
938
+ }, null, -1)
939
+ ])]);
940
+ }
941
+ const Close = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$3]]);
942
+ const _sfc_main$f = defineComponent({
943
+ name: "Minus"
944
+ });
945
+ const _hoisted_1$5 = {
946
+ xmlns: "http://www.w3.org/2000/svg",
947
+ viewBox: "0 0 1024 1024"
948
+ };
949
+ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
950
+ return openBlock(), createElementBlock("svg", _hoisted_1$5, [..._cache[0] || (_cache[0] = [
951
+ createElementVNode("path", {
952
+ fill: "currentColor",
953
+ d: "M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64"
954
+ }, null, -1)
955
+ ])]);
956
+ }
957
+ const Minus = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$2]]);
958
+ const _sfc_main$e = defineComponent({
959
+ name: "CopyDocument"
960
+ });
961
+ const _hoisted_1$4 = {
962
+ xmlns: "http://www.w3.org/2000/svg",
963
+ viewBox: "0 0 1024 1024"
964
+ };
965
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
966
+ return openBlock(), createElementBlock("svg", _hoisted_1$4, [..._cache[0] || (_cache[0] = [
967
+ createElementVNode("path", {
968
+ fill: "currentColor",
969
+ d: "M768 832a128 128 0 0 1-128 128H192A128 128 0 0 1 64 832V384a128 128 0 0 1 128-128v64a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64z"
970
+ }, null, -1),
971
+ createElementVNode("path", {
972
+ fill: "currentColor",
973
+ d: "M384 128a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64zm0-64h448a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H384a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64"
974
+ }, null, -1)
975
+ ])]);
976
+ }
977
+ const CopyDocument = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$1]]);
978
+ const _sfc_main$d = defineComponent({
979
+ name: "FullScreen"
980
+ });
981
+ const _hoisted_1$3 = {
982
+ xmlns: "http://www.w3.org/2000/svg",
983
+ viewBox: "0 0 1024 1024"
984
+ };
985
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
986
+ return openBlock(), createElementBlock("svg", _hoisted_1$3, [..._cache[0] || (_cache[0] = [
987
+ createElementVNode("path", {
988
+ fill: "currentColor",
989
+ d: "m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z"
990
+ }, null, -1)
991
+ ])]);
992
+ }
993
+ const FullScreen = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render]]);
994
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
995
+ ...{
996
+ name: "ZjhcCollapsePanel"
997
+ },
998
+ __name: "collapsePanel",
999
+ props: {
1000
+ collapse: { type: Boolean, required: false, default: true },
1001
+ selector: { type: String, required: false, default: ".el-col" },
1002
+ disableCollapse: { type: Boolean, required: false, default: false }
1003
+ },
1004
+ emits: ["toggleEnd"],
1005
+ setup(__props, { expose: __expose, emit: __emit }) {
1006
+ const bem = useNamespace("collapse");
1007
+ const props = __props;
1008
+ const collapse = ref(props.collapse);
1009
+ const minHeight = ref(0);
1010
+ const maxHeight = ref(0);
1011
+ const collapseSelector = ref(props.selector);
1012
+ const collapseDom = ref(null);
1013
+ const wrapperDom = ref(null);
1014
+ const showToggle = ref(false);
1015
+ let enableEmit = false;
1016
+ let needUpdate = true;
1017
+ let resizeObsever;
1018
+ const init = async () => {
1019
+ var _a;
1020
+ collapseDom.value = (_a = wrapperDom.value) == null ? void 0 : _a.querySelector(collapseSelector.value);
1021
+ if (collapseDom.value) {
1022
+ if (getComputedStyle(collapseDom.value).display === "none") {
1023
+ collapseDom.value.style.display = "";
1024
+ }
1025
+ if (props.disableCollapse) {
1026
+ collapse.value = false;
1027
+ showToggle.value = false;
1028
+ wrapperDom.value.style.maxHeight = "none";
1029
+ return;
1030
+ }
1031
+ minHeight.value = collapseDom.value.offsetHeight;
1032
+ maxHeight.value = wrapperDom.value.scrollHeight;
1033
+ wrapperDom.value.style.maxHeight = collapse.value ? `${minHeight.value}px` : `${maxHeight.value}px`;
1034
+ await nextTick();
1035
+ if (minHeight.value == maxHeight.value) {
1036
+ showToggle.value = false;
1037
+ } else {
1038
+ showToggle.value = true;
1039
+ }
1040
+ wrapperDom.value.style.transition = "max-height linear 0.3s";
1041
+ }
1042
+ };
1043
+ const resize = () => {
1044
+ enableEmit = false;
1045
+ if (props.disableCollapse) {
1046
+ collapse.value = false;
1047
+ showToggle.value = false;
1048
+ return;
1049
+ }
1050
+ if (collapseDom.value && collapseDom.value.offsetHeight > 0) {
1051
+ minHeight.value = collapseDom.value.offsetHeight;
1052
+ maxHeight.value = wrapperDom.value.scrollHeight;
1053
+ if (minHeight.value == maxHeight.value) {
1054
+ showToggle.value = false;
1055
+ } else {
1056
+ showToggle.value = true;
1057
+ }
1058
+ wrapperDom.value.style.maxHeight = collapse.value ? `${minHeight.value}px` : `${maxHeight.value}px`;
1059
+ }
1060
+ };
1061
+ const modeChangeResize = () => {
1062
+ var _a;
1063
+ (_a = wrapperDom.value) == null ? void 0 : _a.addEventListener("transitionend", resize, { once: true });
1064
+ };
1065
+ const onToggle = () => {
1066
+ enableEmit = true;
1067
+ needUpdate = false;
1068
+ collapse.value = !collapse.value;
1069
+ if (wrapperDom.value) {
1070
+ wrapperDom.value.style.maxHeight = collapse.value ? `${minHeight.value}px` : `${maxHeight.value}px`;
1071
+ }
1072
+ };
1073
+ const emit = __emit;
1074
+ const onToggleEnd = () => {
1075
+ if (enableEmit) {
1076
+ emit("toggleEnd", collapse.value);
1077
+ }
1078
+ };
1079
+ __expose({ onToggle });
1080
+ let debounceResize = debounce(resize, 100);
1081
+ onMounted(() => {
1082
+ init();
1083
+ window.addEventListener("resize", debounceResize);
1084
+ window.addEventListener("modeChange", modeChangeResize);
1085
+ if ((wrapperDom == null ? void 0 : wrapperDom.value) && ResizeObserver) {
1086
+ resizeObsever = new ResizeObserver(debounceResize);
1087
+ resizeObsever.observe(wrapperDom == null ? void 0 : wrapperDom.value);
1088
+ }
1089
+ });
1090
+ onUnmounted(() => {
1091
+ window.removeEventListener("resize", debounceResize);
1092
+ window.removeEventListener("modeChange", modeChangeResize);
1093
+ resizeObsever == null ? void 0 : resizeObsever.disconnect();
1094
+ });
1095
+ onUpdated(() => {
1096
+ if (needUpdate) {
1097
+ resize();
1098
+ needUpdate = false;
1099
+ }
1100
+ nextTick(() => {
1101
+ needUpdate = true;
1102
+ });
1103
+ });
1104
+ return (_ctx, _cache) => {
1105
+ const _component_el_link = resolveComponent("el-link");
1106
+ return openBlock(), createElementBlock(Fragment, null, [
1107
+ createElementVNode("div", {
1108
+ class: normalizeClass(unref(bem).m("panel")),
1109
+ ref_key: "wrapperDom",
1110
+ ref: wrapperDom,
1111
+ onTransitionend: withModifiers(onToggleEnd, ["self"])
1112
+ }, [
1113
+ renderSlot(_ctx.$slots, "content")
1114
+ ], 34),
1115
+ createElementVNode("div", {
1116
+ class: normalizeClass(unref(bem).m("footer"))
1117
+ }, [
1118
+ renderSlot(_ctx.$slots, "footer"),
1119
+ showToggle.value ? renderSlot(_ctx.$slots, "toggle", {
1120
+ collapsed: collapse.value,
1121
+ onToggle
1122
+ }, () => [
1123
+ createVNode(_component_el_link, {
1124
+ onClick: onToggle,
1125
+ type: "primary",
1126
+ underline: false,
1127
+ icon: unref(Filter),
1128
+ class: normalizeClass(unref(bem).e("toggle"))
1129
+ }, {
1130
+ default: withCtx(() => [..._cache[0] || (_cache[0] = [
1131
+ createTextVNode("高级查询", -1)
1132
+ ])]),
1133
+ _: 1
1134
+ }, 8, ["icon", "class"])
1135
+ ], void 0, 0) : createCommentVNode("", true)
1136
+ ], 2)
1137
+ ], 64);
1138
+ };
1139
+ }
1140
+ });
1141
+ const ZjhcCollapsePanel = withInstall(_sfc_main$c);
1142
+ const SearchPanelLayout = defineComponent({
1143
+ name: "ZjhcSearchPanelLayout",
1144
+ props: {
1145
+ // ElCol组件的间距
1146
+ gutter: {
1147
+ type: Number,
1148
+ default: 30
1149
+ },
1150
+ // 当查询条件行数超过一行之后是否启用自动折叠。不包括初始一行,屏幕改变变为多行的情况,这种情况不会折叠查询面板
1151
+ enableExpand: {
1152
+ type: Boolean,
1153
+ default: true
1154
+ },
1155
+ // 每个组件占据的列数,一行默认分为24列,当值为数字的时候,默认为所有组件占据相同的列数
1156
+ // 如果传入值是数组时,只有数组下标对应的组件会被指定为传入的值,其他的组件默认占据6列
1157
+ colSpan: {
1158
+ type: [Array, Number],
1159
+ default: 6
1160
+ },
1161
+ // 当enableExpand为true的时候,初始折叠状态
1162
+ collapse: {
1163
+ type: Boolean,
1164
+ default: true
1165
+ },
1166
+ // 用于选择一个元素,组件基于这个元素的高度来设置折叠时候的高度
1167
+ collapseSelector: {
1168
+ type: String,
1169
+ default: ".el-col"
1170
+ }
1171
+ },
1172
+ inheritAttrs: false,
1173
+ setup(props, { slots, attrs, emit, expose }) {
1174
+ const ns = useNamespace("search");
1175
+ provide("ns", ns);
1176
+ const formRef = ref();
1177
+ const resetFields = () => {
1178
+ var _a;
1179
+ (_a = formRef.value) == null ? void 0 : _a.resetFields();
1180
+ };
1181
+ const validate = (callback) => {
1182
+ var _a;
1183
+ return (_a = formRef.value) == null ? void 0 : _a.validate(callback);
1184
+ };
1185
+ const validateField = (props2, callback) => {
1186
+ var _a;
1187
+ return (_a = formRef.value) == null ? void 0 : _a.validateField(props2, callback);
1188
+ };
1189
+ const scrollToField = (prop) => {
1190
+ var _a;
1191
+ (_a = formRef.value) == null ? void 0 : _a.scrollToField(prop);
1192
+ };
1193
+ const clearValidate = (props2) => {
1194
+ var _a;
1195
+ (_a = formRef.value) == null ? void 0 : _a.clearValidate(props2);
1196
+ };
1197
+ const onToggleEnd = (status) => {
1198
+ emit("toggleEnd", status);
1199
+ };
1200
+ expose({
1201
+ formRef,
1202
+ resetFields,
1203
+ validate,
1204
+ validateField,
1205
+ scrollToField,
1206
+ clearValidate
1207
+ });
1208
+ const renderItem = (item, index) => {
1209
+ const span = typeof props.colSpan == "number" ? props.colSpan : props.colSpan[index] || 6;
1210
+ if (item.type.toString() === "Symbol(v-fgt)") {
1211
+ if (Array.isArray(item.children)) {
1212
+ if (isVNode(item.children[0])) {
1213
+ if (item.children[0].children === "v-if" || item.children[0].children === "") {
1214
+ return false;
1215
+ }
1216
+ }
1217
+ }
1218
+ }
1219
+ if (item.children === "v-if" || item.children === "") {
1220
+ return false;
1221
+ }
1222
+ let visible = true;
1223
+ if (item.dirs) {
1224
+ const show = item.dirs.find((item2) => {
1225
+ return item2.dir.name === "show";
1226
+ });
1227
+ if (show && !show.value) {
1228
+ visible = false;
1229
+ }
1230
+ }
1231
+ return {
1232
+ node: h(
1233
+ ElCol,
1234
+ {
1235
+ xl: span,
1236
+ lg: span,
1237
+ md: 8,
1238
+ sm: 12,
1239
+ style: { display: visible ? null : "none" }
1240
+ },
1241
+ { default: () => item }
1242
+ ),
1243
+ span
1244
+ };
1245
+ };
1246
+ return () => {
1247
+ var _a;
1248
+ const defaultsList = (_a = slots.default) == null ? void 0 : _a.call(slots);
1249
+ const defaultSlots = [];
1250
+ const buttonGroupSlots = [];
1251
+ let wrapper;
1252
+ let colCount = 0;
1253
+ let indexNumber = 0;
1254
+ if (defaultsList !== void 0) {
1255
+ defaultsList.forEach((item) => {
1256
+ var _a2;
1257
+ if (item.type.toString() === "Symbol(v-fgt)" || item.type.toString() === "template") {
1258
+ if (Array.isArray(item.children)) {
1259
+ (_a2 = item.children) == null ? void 0 : _a2.forEach((subItem) => {
1260
+ if (isVNode(subItem)) {
1261
+ const res = renderItem(subItem, indexNumber);
1262
+ if (res !== false) {
1263
+ defaultSlots.push(res.node);
1264
+ colCount += res.span;
1265
+ }
1266
+ indexNumber++;
1267
+ }
1268
+ });
1269
+ }
1270
+ } else {
1271
+ const res = renderItem(item, indexNumber);
1272
+ if (res !== false) {
1273
+ defaultSlots.push(res.node);
1274
+ colCount += res.span;
1275
+ }
1276
+ indexNumber++;
1277
+ }
1278
+ });
1279
+ }
1280
+ if (slots.buttonGroup != void 0) {
1281
+ const buttonGroup = slots.buttonGroup();
1282
+ if (colCount > 20 || buttonGroup.length > 2) {
1283
+ buttonGroupSlots.push(
1284
+ h(
1285
+ ElCol,
1286
+ { span: 24, style: { textAlign: "center" } },
1287
+ { default: () => buttonGroup }
1288
+ )
1289
+ );
1290
+ } else {
1291
+ const span = 24 - colCount;
1292
+ defaultSlots.push(
1293
+ h(
1294
+ ElCol,
1295
+ { xl: span, lg: span, md: 8, sm: 12 },
1296
+ { default: () => buttonGroup }
1297
+ )
1298
+ );
1299
+ }
1300
+ }
1301
+ if (props.enableExpand && buttonGroupSlots.length > 0) {
1302
+ const form = h(
1303
+ ElForm,
1304
+ { ...attrs, ref: formRef },
1305
+ {
1306
+ default: () => h(
1307
+ ElRow,
1308
+ { gutter: props.gutter },
1309
+ { default: () => defaultSlots }
1310
+ )
1311
+ }
1312
+ );
1313
+ wrapper = h(
1314
+ ZjhcCollapsePanel,
1315
+ {
1316
+ selector: props.collapseSelector,
1317
+ collapse: props.collapse,
1318
+ onToggleEnd
1319
+ },
1320
+ {
1321
+ content: () => form,
1322
+ footer: () => buttonGroupSlots,
1323
+ toggle: (props2) => {
1324
+ var _a2;
1325
+ return (_a2 = slots.toggle) == null ? void 0 : _a2.call(slots, props2);
1326
+ }
1327
+ }
1328
+ );
1329
+ } else {
1330
+ wrapper = h(
1331
+ ElForm,
1332
+ { ...attrs, ref: formRef },
1333
+ {
1334
+ default: () => h(
1335
+ ElRow,
1336
+ { gutter: props.gutter },
1337
+ { default: () => [...defaultSlots, ...buttonGroupSlots] }
1338
+ )
1339
+ }
1340
+ );
1341
+ }
1342
+ return h(
1343
+ "div",
1344
+ {
1345
+ class: ns.e("panel")
1346
+ },
1347
+ [wrapper]
1348
+ );
1349
+ };
1350
+ }
1351
+ });
1352
+ const ZjhcSearchPanelLayout = withInstall(SearchPanelLayout);
1353
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
1354
+ ...{
1355
+ name: "ZjhcSearchLayout"
1356
+ },
1357
+ __name: "searchLayout",
1358
+ setup(__props) {
1359
+ const bem = useNamespace("search");
1360
+ return (_ctx, _cache) => {
1361
+ const _component_el_scrollbar = resolveComponent("el-scrollbar");
1362
+ return openBlock(), createElementBlock("div", {
1363
+ class: normalizeClass(unref(bem).e("layout"))
1364
+ }, [
1365
+ renderSlot(_ctx.$slots, "search"),
1366
+ createElementVNode("div", {
1367
+ class: normalizeClass(unref(bem).e("content"))
1368
+ }, [
1369
+ _ctx.$slots.sidebar ? (openBlock(), createElementBlock("div", {
1370
+ key: 0,
1371
+ class: normalizeClass(unref(bem).e("sidebar"))
1372
+ }, [
1373
+ createVNode(_component_el_scrollbar, null, {
1374
+ default: withCtx(() => [
1375
+ renderSlot(_ctx.$slots, "sidebar")
1376
+ ]),
1377
+ _: 3
1378
+ })
1379
+ ], 2)) : createCommentVNode("", true),
1380
+ createElementVNode("div", {
1381
+ class: normalizeClass(unref(bem).e("main"))
1382
+ }, [
1383
+ _ctx.$slots.toolbar ? (openBlock(), createElementBlock("div", {
1384
+ key: 0,
1385
+ class: normalizeClass(unref(bem).e("toolbar"))
1386
+ }, [
1387
+ renderSlot(_ctx.$slots, "toolbar")
1388
+ ], 2)) : createCommentVNode("", true),
1389
+ _ctx.$slots.list ? (openBlock(), createElementBlock("div", {
1390
+ key: 1,
1391
+ class: normalizeClass(unref(bem).e("grid"))
1392
+ }, [
1393
+ renderSlot(_ctx.$slots, "list")
1394
+ ], 2)) : createCommentVNode("", true),
1395
+ _ctx.$slots.pagination ? (openBlock(), createElementBlock("div", {
1396
+ key: 2,
1397
+ class: normalizeClass(unref(bem).e("pagination"))
1398
+ }, [
1399
+ renderSlot(_ctx.$slots, "pagination")
1400
+ ], 2)) : createCommentVNode("", true),
1401
+ renderSlot(_ctx.$slots, "default")
1402
+ ], 2)
1403
+ ], 2)
1404
+ ], 2);
1405
+ };
1406
+ }
1407
+ });
1408
+ const ZjhcSearchLayout = withInstall(_sfc_main$b);
1409
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
1410
+ ...{
1411
+ name: "ZjhcCollapseContainer"
1412
+ },
1413
+ __name: "collapseContainer",
1414
+ props: {
1415
+ collapse: { type: Boolean, required: false, default: false },
1416
+ title: { type: String, required: false, default: "" }
1417
+ },
1418
+ emits: ["toggleEnd"],
1419
+ setup(__props, { emit: __emit }) {
1420
+ const bem = useNamespace("collapse");
1421
+ const emit = __emit;
1422
+ const props = __props;
1423
+ const state = reactive({
1424
+ isCollapse: props.collapse
1425
+ });
1426
+ function toggle() {
1427
+ state.isCollapse = !state.isCollapse;
1428
+ }
1429
+ const onToggleEnd = () => {
1430
+ emit("toggleEnd", state.isCollapse);
1431
+ };
1432
+ return (_ctx, _cache) => {
1433
+ const _component_el_icon = resolveComponent("el-icon");
1434
+ const _component_el_collapse_transition = resolveComponent("el-collapse-transition");
1435
+ return openBlock(), createElementBlock("div", {
1436
+ class: normalizeClass(unref(bem).e("container"))
1437
+ }, [
1438
+ createElementVNode("div", {
1439
+ class: normalizeClass(unref(bem).e("header"))
1440
+ }, [
1441
+ renderSlot(_ctx.$slots, "title", {}, () => [
1442
+ createElementVNode("div", {
1443
+ class: normalizeClass(unref(bem).e("title"))
1444
+ }, toDisplayString(__props.title), 3)
1445
+ ]),
1446
+ createVNode(_component_el_icon, {
1447
+ class: normalizeClass(unref(bem).em("header", "arrow")),
1448
+ onClick: toggle
1449
+ }, {
1450
+ default: withCtx(() => [
1451
+ (openBlock(), createBlock(resolveDynamicComponent(state.isCollapse ? unref(ArrowDown) : unref(ArrowUp))))
1452
+ ]),
1453
+ _: 1
1454
+ }, 8, ["class"])
1455
+ ], 2),
1456
+ createVNode(_component_el_collapse_transition, null, {
1457
+ default: withCtx(() => [
1458
+ withDirectives(createElementVNode("div", {
1459
+ class: normalizeClass(unref(bem).e("content")),
1460
+ onTransitionend: withModifiers(onToggleEnd, ["self"])
1461
+ }, [
1462
+ renderSlot(_ctx.$slots, "content")
1463
+ ], 34), [
1464
+ [vShow, !state.isCollapse]
1465
+ ])
1466
+ ]),
1467
+ _: 3
1468
+ })
1469
+ ], 2);
1470
+ };
1471
+ }
1472
+ });
1473
+ const ZjhcCollapseContainer = withInstall(_sfc_main$a);
1474
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1475
+ ...{
1476
+ name: "ZjhcStickyToolbar"
1477
+ },
1478
+ __name: "stickyToolbar",
1479
+ props: {
1480
+ selector: { type: String, required: false, default: ".el-button" }
1481
+ },
1482
+ emits: ["toggleEnd"],
1483
+ setup(__props, { expose: __expose, emit: __emit }) {
1484
+ const bem = useNamespace("sticky");
1485
+ const props = __props;
1486
+ const wrapperDom = ref(null);
1487
+ const elDom = ref(null);
1488
+ const minHeight = ref(0);
1489
+ const maxHeight = ref(0);
1490
+ const showToggle = ref(false);
1491
+ const collapse = ref(true);
1492
+ let marginBottom = 10;
1493
+ let enableEmit = false;
1494
+ const init = async () => {
1495
+ enableEmit = false;
1496
+ if (wrapperDom.value) {
1497
+ elDom.value = wrapperDom.value.querySelector(props.selector);
1498
+ if (elDom.value != null) {
1499
+ if (getComputedStyle(elDom.value).display === "none") {
1500
+ elDom.value.style.display = "";
1501
+ }
1502
+ minHeight.value = elDom.value.offsetHeight;
1503
+ marginBottom = parseInt(getComputedStyle(elDom.value).marginBottom);
1504
+ }
1505
+ maxHeight.value = wrapperDom.value.scrollHeight - marginBottom;
1506
+ if (minHeight.value == maxHeight.value) {
1507
+ showToggle.value = false;
1508
+ } else {
1509
+ showToggle.value = true;
1510
+ }
1511
+ wrapperDom.value.style.maxHeight = collapse.value ? `${minHeight.value}px` : `${maxHeight.value}px`;
1512
+ setTimeout(() => {
1513
+ wrapperDom.value.style.transition = "max-height linear 0.3s";
1514
+ }, 0);
1515
+ }
1516
+ };
1517
+ const resize = () => {
1518
+ enableEmit = false;
1519
+ if (elDom.value && elDom.value.offsetHeight > 0) {
1520
+ minHeight.value = elDom.value.offsetHeight;
1521
+ marginBottom = parseInt(getComputedStyle(elDom.value).marginBottom);
1522
+ maxHeight.value = wrapperDom.value.scrollHeight - marginBottom;
1523
+ if (minHeight.value == maxHeight.value) {
1524
+ showToggle.value = false;
1525
+ } else {
1526
+ showToggle.value = true;
1527
+ }
1528
+ wrapperDom.value.style.maxHeight = collapse.value ? `${minHeight.value}px` : `${maxHeight.value}px`;
1529
+ }
1530
+ };
1531
+ const modeChangeResize = () => {
1532
+ var _a;
1533
+ (_a = wrapperDom.value) == null ? void 0 : _a.addEventListener("transitionend", resize, { once: true });
1534
+ };
1535
+ const onToggle = () => {
1536
+ enableEmit = true;
1537
+ collapse.value = !collapse.value;
1538
+ if (wrapperDom.value) {
1539
+ wrapperDom.value.style.maxHeight = collapse.value ? `${minHeight.value}px` : `${maxHeight.value}px`;
1540
+ }
1541
+ };
1542
+ const emit = __emit;
1543
+ const onToggleEnd = () => {
1544
+ if (enableEmit) {
1545
+ emit("toggleEnd", collapse.value);
1546
+ }
1547
+ };
1548
+ __expose({ onToggle });
1549
+ let debounceResize = debounce(resize, 100);
1550
+ onMounted(() => {
1551
+ init();
1552
+ window.addEventListener("resize", debounceResize);
1553
+ window.addEventListener("modeChange", modeChangeResize);
1554
+ });
1555
+ onUnmounted(() => {
1556
+ window.removeEventListener("resize", debounceResize);
1557
+ window.removeEventListener("modeChange", modeChangeResize);
1558
+ });
1559
+ return (_ctx, _cache) => {
1560
+ const _component_el_button = resolveComponent("el-button");
1561
+ return openBlock(), createElementBlock("div", {
1562
+ class: normalizeClass(unref(bem).e("toolbar"))
1563
+ }, [
1564
+ createElementVNode("div", {
1565
+ class: normalizeClass(unref(bem).e("main"))
1566
+ }, [
1567
+ createElementVNode("div", {
1568
+ class: normalizeClass(unref(bem).e("wrap")),
1569
+ ref_key: "wrapperDom",
1570
+ ref: wrapperDom,
1571
+ onTransitionend: withModifiers(onToggleEnd, ["self"])
1572
+ }, [
1573
+ renderSlot(_ctx.$slots, "content")
1574
+ ], 34),
1575
+ showToggle.value ? renderSlot(_ctx.$slots, "toggle", {}, () => [
1576
+ createVNode(_component_el_button, {
1577
+ type: "primary",
1578
+ icon: collapse.value ? unref(ArrowDown) : unref(ArrowUp),
1579
+ onClick: onToggle,
1580
+ class: normalizeClass(unref(bem).e("toggle"))
1581
+ }, null, 8, ["icon", "class"])
1582
+ ], void 0, 0) : createCommentVNode("", true)
1583
+ ], 2),
1584
+ renderSlot(_ctx.$slots, "side")
1585
+ ], 2);
1586
+ };
1587
+ }
1588
+ });
1589
+ const ZjhcStickyToolbar = withInstall(_sfc_main$9);
1590
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
1591
+ ...{
1592
+ name: "ZjhcGroupContainer"
1593
+ },
1594
+ __name: "groupContainer",
1595
+ props: {
1596
+ title: { type: String, required: false, default: "" },
1597
+ isBorder: { type: Boolean, required: false, default: false }
1598
+ },
1599
+ setup(__props) {
1600
+ const bem = useNamespace("group");
1601
+ return (_ctx, _cache) => {
1602
+ return openBlock(), createElementBlock("div", {
1603
+ class: normalizeClass([unref(bem).e("container"), { "is-border": __props.isBorder }])
1604
+ }, [
1605
+ __props.title || _ctx.$slots.toolbar ? (openBlock(), createElementBlock("div", {
1606
+ key: 0,
1607
+ class: normalizeClass(unref(bem).e("header"))
1608
+ }, [
1609
+ __props.title ? (openBlock(), createElementBlock("div", {
1610
+ key: 0,
1611
+ class: normalizeClass(unref(bem).e("title"))
1612
+ }, toDisplayString(__props.title), 3)) : createCommentVNode("", true),
1613
+ _ctx.$slots.toolbar ? (openBlock(), createElementBlock("div", {
1614
+ key: 1,
1615
+ class: normalizeClass(unref(bem).e("toolbar"))
1616
+ }, [
1617
+ renderSlot(_ctx.$slots, "toolbar")
1618
+ ], 2)) : createCommentVNode("", true)
1619
+ ], 2)) : createCommentVNode("", true),
1620
+ createElementVNode("div", {
1621
+ class: normalizeClass(unref(bem).e("content"))
1622
+ }, [
1623
+ renderSlot(_ctx.$slots, "content")
1624
+ ], 2)
1625
+ ], 2);
1626
+ };
1627
+ }
1628
+ });
1629
+ const ZjhcGroupContainer = withInstall(_sfc_main$8);
1630
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1631
+ ...{
1632
+ name: "ZjhcButtonGroup"
1633
+ },
1634
+ __name: "buttonGroup",
1635
+ props: {
1636
+ actions: { type: Array, required: true, default: () => [] },
1637
+ moreButtonText: { type: String, required: false, default: "更多" },
1638
+ buttonType: { type: String, required: false, default: "primary" },
1639
+ plain: { type: Boolean, required: false, default: false },
1640
+ space: { type: Number, required: false, default: 12 },
1641
+ rows: { type: Array, required: false, default: () => [] }
1642
+ },
1643
+ emits: ["command"],
1644
+ setup(__props, { emit: __emit }) {
1645
+ const bem = useNamespace("button");
1646
+ const props = __props;
1647
+ const emit = __emit;
1648
+ const pCur = ref(-1);
1649
+ const visibleButtons = computed(() => {
1650
+ if (pCur.value > 0) {
1651
+ return props.actions.slice(0, pCur.value);
1652
+ } else {
1653
+ return props.actions;
1654
+ }
1655
+ });
1656
+ const moreButtons = computed(() => {
1657
+ if (pCur.value > 0) {
1658
+ let temp = [];
1659
+ let res = props.actions.slice(pCur.value);
1660
+ for (let i = 0; i < res.length; i++) {
1661
+ if (res[i].children != void 0 && res[i].children.length > 0) {
1662
+ temp.push(...res[i].children);
1663
+ } else {
1664
+ temp.push(res[i]);
1665
+ }
1666
+ }
1667
+ return temp;
1668
+ } else {
1669
+ return [];
1670
+ }
1671
+ });
1672
+ const popperOptions = {
1673
+ modifiers: [
1674
+ {
1675
+ name: "offset",
1676
+ options: {
1677
+ offset: [0, 7]
1678
+ // 水平偏移0,垂直偏移10像素
1679
+ }
1680
+ }
1681
+ ]
1682
+ };
1683
+ let resizeObsever;
1684
+ const groupHeight = ref(28);
1685
+ const groupRef = ref(null);
1686
+ let btnSizes = [];
1687
+ function getButtonSize() {
1688
+ let group = groupRef == null ? void 0 : groupRef.value;
1689
+ let space = props.space;
1690
+ if (!group) return;
1691
+ if (btnSizes.length > 0) {
1692
+ btnSizes = [];
1693
+ }
1694
+ let buttons = group.querySelectorAll(".el-button");
1695
+ if (buttons && buttons.length > 0) {
1696
+ groupHeight.value = buttons[0].offsetHeight;
1697
+ let left = 0;
1698
+ for (let i = 0; i < buttons.length; i++) {
1699
+ left += buttons[i].offsetWidth + space;
1700
+ btnSizes.push(left);
1701
+ }
1702
+ }
1703
+ }
1704
+ function getContainerWidth() {
1705
+ let group = groupRef == null ? void 0 : groupRef.value;
1706
+ if (!group) return null;
1707
+ return group.offsetWidth;
1708
+ }
1709
+ function reBuild() {
1710
+ let width = getContainerWidth();
1711
+ if (width) {
1712
+ let cur = -1;
1713
+ for (let i = 0; i < btnSizes.length; i++) {
1714
+ if (btnSizes[i] - width > props.space) {
1715
+ cur = i - 1;
1716
+ break;
1717
+ }
1718
+ cur = -1;
1719
+ }
1720
+ pCur.value = cur;
1721
+ }
1722
+ }
1723
+ function modeChangeResize() {
1724
+ var _a;
1725
+ (_a = groupRef.value) == null ? void 0 : _a.addEventListener(
1726
+ "transitionend",
1727
+ () => {
1728
+ pCur.value = -1;
1729
+ nextTick(() => {
1730
+ getButtonSize();
1731
+ reBuild();
1732
+ });
1733
+ },
1734
+ { once: true }
1735
+ );
1736
+ }
1737
+ function getConfirmText(confirm) {
1738
+ if (isString(confirm)) {
1739
+ return confirm;
1740
+ }
1741
+ return "您确定该操作?";
1742
+ }
1743
+ function getActionEnabled(action) {
1744
+ if (typeof action.disabled === "boolean" && action.disabled) {
1745
+ return false;
1746
+ }
1747
+ if (typeof action.disabled === "function") {
1748
+ return !action.disabled(props.rows);
1749
+ }
1750
+ if (!action.limit || action.limit === "none") {
1751
+ return true;
1752
+ }
1753
+ if (action.limit === "one" && props.rows.length === 1) {
1754
+ return true;
1755
+ }
1756
+ if (action.limit === "more" && props.rows.length > 0) {
1757
+ return true;
1758
+ }
1759
+ return false;
1760
+ }
1761
+ function onConfirmAction(action, e) {
1762
+ if (action.confirm) {
1763
+ ElMessageBox.confirm(getConfirmText(action.confirm), "提示", {
1764
+ type: "warning",
1765
+ cancelButtonText: "取消",
1766
+ cancelButtonClass: "el-button--info",
1767
+ confirmButtonText: "确定"
1768
+ }).then(() => {
1769
+ onAction(action, e);
1770
+ }).catch(() => {
1771
+ });
1772
+ } else {
1773
+ onAction(action, e);
1774
+ }
1775
+ }
1776
+ function onAction(action, e) {
1777
+ const rows = action.limit === "one" ? props.rows[0] : props.rows;
1778
+ if (action.onclick) {
1779
+ if (isFunction(action.onclick)) {
1780
+ action.onclick(rows, void 0, e);
1781
+ } else {
1782
+ emit("command", action.onclick, rows);
1783
+ }
1784
+ }
1785
+ }
1786
+ const reCalcBtnSize = debounce(function() {
1787
+ if (groupHeight.value > 0) {
1788
+ return;
1789
+ }
1790
+ getButtonSize();
1791
+ }, 100);
1792
+ onMounted(() => {
1793
+ nextTick(() => {
1794
+ requestAnimationFrame(() => {
1795
+ getButtonSize();
1796
+ reBuild();
1797
+ });
1798
+ });
1799
+ if ((groupRef == null ? void 0 : groupRef.value) && ResizeObserver) {
1800
+ resizeObsever = new ResizeObserver(reCalcBtnSize);
1801
+ resizeObsever.observe(groupRef == null ? void 0 : groupRef.value);
1802
+ }
1803
+ window.addEventListener("resize", reBuild);
1804
+ window.addEventListener("modeChange", modeChangeResize);
1805
+ });
1806
+ onBeforeUnmount(() => {
1807
+ window.removeEventListener("resize", reBuild);
1808
+ window.removeEventListener("modeChange", modeChangeResize);
1809
+ resizeObsever == null ? void 0 : resizeObsever.disconnect();
1810
+ });
1811
+ return (_ctx, _cache) => {
1812
+ return openBlock(), createElementBlock("div", {
1813
+ class: normalizeClass(unref(bem).e("group")),
1814
+ ref_key: "groupRef",
1815
+ ref: groupRef,
1816
+ style: normalizeStyle({ height: groupHeight.value + "px" })
1817
+ }, [
1818
+ (openBlock(true), createElementBlock(Fragment, null, renderList(visibleButtons.value, (item) => {
1819
+ return openBlock(), createElementBlock(Fragment, {
1820
+ key: item.key
1821
+ }, [
1822
+ item.children != null && item.children.length > 0 ? (openBlock(), createBlock(unref(ElDropdown), {
1823
+ key: 0,
1824
+ "popper-options": popperOptions,
1825
+ "popper-class": unref(bem).em("group", "popper"),
1826
+ "max-heighgt": "280px",
1827
+ placement: "bottom-start"
1828
+ }, {
1829
+ dropdown: withCtx(() => [
1830
+ createVNode(unref(ElDropdownMenu), null, {
1831
+ default: withCtx(() => [
1832
+ (openBlock(true), createElementBlock(Fragment, null, renderList(item.children, (child, index) => {
1833
+ return openBlock(), createBlock(unref(ElDropdownItem), {
1834
+ key: index,
1835
+ disabled: !getActionEnabled(child),
1836
+ icon: child.icon,
1837
+ onClick: ($event) => onConfirmAction(child, $event)
1838
+ }, {
1839
+ default: withCtx(() => [
1840
+ createTextVNode(toDisplayString(child.text), 1)
1841
+ ]),
1842
+ _: 2
1843
+ }, 1032, ["disabled", "icon", "onClick"]);
1844
+ }), 128))
1845
+ ]),
1846
+ _: 2
1847
+ }, 1024)
1848
+ ]),
1849
+ default: withCtx(() => [
1850
+ createVNode(unref(ElButton), {
1851
+ icon: item.icon,
1852
+ disabled: !getActionEnabled(item),
1853
+ type: item.type,
1854
+ plain: item.plain,
1855
+ title: item.tooltip
1856
+ }, {
1857
+ default: withCtx(() => [
1858
+ item.text ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1859
+ createTextVNode(toDisplayString(item.text), 1)
1860
+ ], 64)) : createCommentVNode("", true),
1861
+ createVNode(unref(ElIcon), { class: "el-icon--right" }, {
1862
+ default: withCtx(() => [
1863
+ createVNode(unref(ArrowDown))
1864
+ ]),
1865
+ _: 1
1866
+ })
1867
+ ]),
1868
+ _: 2
1869
+ }, 1032, ["icon", "disabled", "type", "plain", "title"])
1870
+ ]),
1871
+ _: 2
1872
+ }, 1032, ["popper-class"])) : (openBlock(), createBlock(unref(ElButton), {
1873
+ key: 1,
1874
+ icon: item.icon,
1875
+ disabled: !getActionEnabled(item),
1876
+ type: item.type,
1877
+ plain: item.plain,
1878
+ title: item.tooltip,
1879
+ onClick: ($event) => onConfirmAction(item, $event)
1880
+ }, {
1881
+ default: withCtx(() => [
1882
+ item.text ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1883
+ createTextVNode(toDisplayString(item.text), 1)
1884
+ ], 64)) : createCommentVNode("", true)
1885
+ ]),
1886
+ _: 2
1887
+ }, 1032, ["icon", "disabled", "type", "plain", "title", "onClick"]))
1888
+ ], 64);
1889
+ }), 128)),
1890
+ moreButtons.value.length > 0 ? (openBlock(), createBlock(unref(ElDropdown), {
1891
+ key: 0,
1892
+ "popper-options": popperOptions,
1893
+ "popper-class": unref(bem).em("group", "popper"),
1894
+ "max-heighgt": "280px",
1895
+ placement: "bottom-start"
1896
+ }, {
1897
+ dropdown: withCtx(() => [
1898
+ createVNode(unref(ElDropdownMenu), null, {
1899
+ default: withCtx(() => [
1900
+ (openBlock(true), createElementBlock(Fragment, null, renderList(moreButtons.value, (child, index) => {
1901
+ return openBlock(), createBlock(unref(ElDropdownItem), {
1902
+ key: index,
1903
+ disabled: !getActionEnabled(child),
1904
+ icon: child.icon,
1905
+ onClick: ($event) => onConfirmAction(child, $event)
1906
+ }, {
1907
+ default: withCtx(() => [
1908
+ createTextVNode(toDisplayString(child.text), 1)
1909
+ ]),
1910
+ _: 2
1911
+ }, 1032, ["disabled", "icon", "onClick"]);
1912
+ }), 128))
1913
+ ]),
1914
+ _: 1
1915
+ })
1916
+ ]),
1917
+ default: withCtx(() => [
1918
+ createVNode(unref(ElButton), {
1919
+ type: __props.buttonType,
1920
+ plain: __props.plain
1921
+ }, {
1922
+ default: withCtx(() => [
1923
+ createTextVNode(toDisplayString(__props.moreButtonText), 1),
1924
+ createVNode(unref(ElIcon), { class: "el-icon--right" }, {
1925
+ default: withCtx(() => [
1926
+ createVNode(unref(ArrowDown))
1927
+ ]),
1928
+ _: 1
1929
+ })
1930
+ ]),
1931
+ _: 1
1932
+ }, 8, ["type", "plain"])
1933
+ ]),
1934
+ _: 1
1935
+ }, 8, ["popper-class"])) : createCommentVNode("", true)
1936
+ ], 6);
1937
+ };
1938
+ }
1939
+ });
1940
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
1941
+ ...{
1942
+ name: "ZjhcTableToolbar"
1943
+ },
1944
+ __name: "tableToolbar",
1945
+ props: {
1946
+ actions: { type: Array, required: false, default: () => [] },
1947
+ moreButtonText: { type: String, required: false, default: "更多" },
1948
+ primaryColSpan: { type: Number, required: false },
1949
+ secondaryColSpan: { type: Number, required: false },
1950
+ rows: { type: Array, required: false, default: () => [] },
1951
+ space: { type: Number, required: false, default: 12 }
1952
+ },
1953
+ emits: ["on-command"],
1954
+ setup(__props, { emit: __emit }) {
1955
+ const bem = useNamespace("table");
1956
+ const props = __props;
1957
+ const emit = __emit;
1958
+ const onCommand = (command, rows) => {
1959
+ emit("on-command", command, rows);
1960
+ };
1961
+ const primaryActions = computed(() => {
1962
+ return props.actions.filter(
1963
+ (item) => item.position == "left" || !item.position
1964
+ );
1965
+ });
1966
+ const secondaryActions = computed(() => {
1967
+ return props.actions.filter((item) => item.position == "right");
1968
+ });
1969
+ const primaryColSpan = computed(() => {
1970
+ if (props.primaryColSpan != void 0) {
1971
+ return props.primaryColSpan;
1972
+ } else {
1973
+ if (primaryActions.value.length > 0) {
1974
+ return 16;
1975
+ } else {
1976
+ return 0;
1977
+ }
1978
+ }
1979
+ });
1980
+ const secondaryColSpan = computed(() => {
1981
+ if (props.secondaryColSpan != void 0) {
1982
+ return props.secondaryColSpan;
1983
+ } else {
1984
+ if (secondaryActions.value.length > 0) {
1985
+ return 8;
1986
+ } else {
1987
+ return 0;
1988
+ }
1989
+ }
1990
+ });
1991
+ return (_ctx, _cache) => {
1992
+ return openBlock(), createElementBlock("div", {
1993
+ class: normalizeClass(unref(bem).e("toolbar"))
1994
+ }, [
1995
+ createVNode(unref(ElRow), null, {
1996
+ default: withCtx(() => [
1997
+ primaryActions.value.length > 0 ? (openBlock(), createBlock(unref(ElCol), {
1998
+ key: 0,
1999
+ span: primaryColSpan.value
2000
+ }, {
2001
+ default: withCtx(() => [
2002
+ createVNode(_sfc_main$7, {
2003
+ actions: primaryActions.value,
2004
+ moreButtonText: __props.moreButtonText,
2005
+ rows: __props.rows,
2006
+ buttonType: "primary",
2007
+ space: __props.space,
2008
+ plain: false,
2009
+ onCommand
2010
+ }, null, 8, ["actions", "moreButtonText", "rows", "space"])
2011
+ ]),
2012
+ _: 1
2013
+ }, 8, ["span"])) : createCommentVNode("", true),
2014
+ secondaryActions.value.length > 0 ? (openBlock(), createBlock(unref(ElCol), {
2015
+ key: 1,
2016
+ span: secondaryColSpan.value
2017
+ }, {
2018
+ default: withCtx(() => [
2019
+ createVNode(_sfc_main$7, {
2020
+ style: { "text-align": "right" },
2021
+ actions: secondaryActions.value,
2022
+ moreButtonText: __props.moreButtonText,
2023
+ buttonType: "primary",
2024
+ space: __props.space,
2025
+ plain: true,
2026
+ onCommand,
2027
+ rows: __props.rows
2028
+ }, null, 8, ["actions", "moreButtonText", "space", "rows"])
2029
+ ]),
2030
+ _: 1
2031
+ }, 8, ["span"])) : createCommentVNode("", true)
2032
+ ]),
2033
+ _: 1
2034
+ })
2035
+ ], 2);
2036
+ };
2037
+ }
2038
+ });
2039
+ const ZjhcTableToolbar = withInstall(_sfc_main$6);
2040
+ const dialogContentProps = buildProps({
2041
+ center: Boolean,
2042
+ alignCenter: Boolean,
2043
+ closeIcon: {
2044
+ type: iconPropType
2045
+ },
2046
+ // 是否可拖动
2047
+ draggable: {
2048
+ type: Boolean,
2049
+ default: true
2050
+ },
2051
+ // 是否可以改变大小
2052
+ resizable: {
2053
+ type: Boolean,
2054
+ default: true
2055
+ },
2056
+ overflow: {
2057
+ type: Boolean,
2058
+ default: false
2059
+ },
2060
+ fullscreen: Boolean,
2061
+ showClose: {
2062
+ type: Boolean,
2063
+ default: true
2064
+ },
2065
+ title: {
2066
+ type: String,
2067
+ default: ""
2068
+ },
2069
+ ariaLevel: {
2070
+ type: String,
2071
+ default: "2"
2072
+ }
2073
+ });
2074
+ const dialogProps = buildProps({
2075
+ ...dialogContentProps,
2076
+ appendToBody: {
2077
+ type: Boolean,
2078
+ default: true
2079
+ },
2080
+ appendTo: {
2081
+ type: definePropType([String, Object]),
2082
+ default: "body"
2083
+ },
2084
+ beforeClose: {
2085
+ type: definePropType(Function)
2086
+ },
2087
+ destroyOnClose: {
2088
+ type: Boolean,
2089
+ default: true
2090
+ },
2091
+ closeOnClickModal: {
2092
+ type: Boolean,
2093
+ default: false
2094
+ },
2095
+ closeOnPressEscape: {
2096
+ type: Boolean,
2097
+ default: true
2098
+ },
2099
+ lockScroll: {
2100
+ type: Boolean,
2101
+ default: true
2102
+ },
2103
+ modal: {
2104
+ type: Boolean,
2105
+ default: true
2106
+ },
2107
+ openDelay: {
2108
+ type: Number,
2109
+ default: 0
2110
+ },
2111
+ closeDelay: {
2112
+ type: Number,
2113
+ default: 0
2114
+ },
2115
+ top: {
2116
+ type: String
2117
+ },
2118
+ modelValue: Boolean,
2119
+ modalClass: String,
2120
+ width: {
2121
+ type: [String, Number]
2122
+ },
2123
+ height: {
2124
+ type: [String, Number]
2125
+ },
2126
+ zIndex: {
2127
+ type: Number
2128
+ },
2129
+ trapFocus: Boolean,
2130
+ headerAriaLevel: {
2131
+ type: String,
2132
+ default: "2"
2133
+ }
2134
+ });
2135
+ const dialogEmits = {
2136
+ open: () => true,
2137
+ opened: () => true,
2138
+ close: () => true,
2139
+ closed: () => true,
2140
+ [UPDATE_MODEL_EVENT]: (value) => isBoolean(value),
2141
+ openAutoFocus: () => true,
2142
+ closeAutoFocus: () => true
2143
+ };
2144
+ const useDialog = (props, targetRef) => {
2145
+ const instance = getCurrentInstance();
2146
+ const emit = instance.emit;
2147
+ const { nextZIndex } = useZIndex();
2148
+ let lastPosition = "", lastLeft = "", lastTop = "";
2149
+ const titleId = useId();
2150
+ const bodyId = useId();
2151
+ const visible = ref(false);
2152
+ const closed = ref(false);
2153
+ const rendered = ref(false);
2154
+ const zIndex = ref(props.zIndex ?? nextZIndex());
2155
+ let openTimer = void 0;
2156
+ let closeTimer = void 0;
2157
+ const namespace = useGlobalConfig("namespace", defaultNamespace$1);
2158
+ const style = computed(() => {
2159
+ const style2 = {};
2160
+ const varPrefix = `--${namespace.value}-dialog`;
2161
+ if (!props.fullscreen) {
2162
+ if (props.top) {
2163
+ style2[`${varPrefix}-margin-top`] = props.top;
2164
+ }
2165
+ }
2166
+ if (props.width) {
2167
+ style2[`${varPrefix}-width`] = addUnit$1(props.width);
2168
+ }
2169
+ if (props.height) {
2170
+ style2[`${varPrefix}-height`] = addUnit$1(props.height);
2171
+ }
2172
+ return style2;
2173
+ });
2174
+ const overlayDialogStyle = computed(() => {
2175
+ if (props.alignCenter) {
2176
+ return { display: "flex" };
2177
+ }
2178
+ return {};
2179
+ });
2180
+ function afterEnter() {
2181
+ emit("opened");
2182
+ }
2183
+ function afterLeave() {
2184
+ emit("closed");
2185
+ emit(UPDATE_MODEL_EVENT, false);
2186
+ if (props.destroyOnClose) {
2187
+ rendered.value = false;
2188
+ }
2189
+ }
2190
+ function beforeLeave() {
2191
+ emit("close");
2192
+ }
2193
+ function open() {
2194
+ closeTimer == null ? void 0 : closeTimer();
2195
+ openTimer == null ? void 0 : openTimer();
2196
+ if (props.openDelay && props.openDelay > 0) {
2197
+ ({ stop: openTimer } = useTimeoutFn(() => doOpen(), props.openDelay));
2198
+ } else {
2199
+ doOpen();
2200
+ }
2201
+ }
2202
+ function close() {
2203
+ closeTimer == null ? void 0 : closeTimer();
2204
+ openTimer == null ? void 0 : openTimer();
2205
+ if (props.closeDelay && props.closeDelay > 0) {
2206
+ ({ stop: closeTimer } = useTimeoutFn(() => doClose(), props.closeDelay));
2207
+ } else {
2208
+ doClose();
2209
+ }
2210
+ }
2211
+ function handleClose() {
2212
+ function hide(shouldCancel) {
2213
+ if (shouldCancel) return;
2214
+ closed.value = true;
2215
+ visible.value = false;
2216
+ }
2217
+ if (props.beforeClose) {
2218
+ props.beforeClose(hide);
2219
+ } else {
2220
+ close();
2221
+ }
2222
+ }
2223
+ function onModalClick() {
2224
+ if (props.closeOnClickModal) {
2225
+ handleClose();
2226
+ }
2227
+ }
2228
+ function doOpen() {
2229
+ if (!isClient$1) return;
2230
+ visible.value = true;
2231
+ if (props.draggable) {
2232
+ nextTick(() => {
2233
+ if (targetRef.value) {
2234
+ const width = targetRef.value.offsetWidth;
2235
+ const height = targetRef.value.offsetHeight;
2236
+ const winWidth = document.documentElement.clientWidth;
2237
+ const winHeight = document.documentElement.clientHeight;
2238
+ targetRef.value.style.left = (winWidth - width) / 2 + "px";
2239
+ if (props.alignCenter) {
2240
+ targetRef.value.style.top = Math.max(0, (winHeight - height) / 2) + "px";
2241
+ }
2242
+ }
2243
+ });
2244
+ }
2245
+ }
2246
+ function doClose() {
2247
+ visible.value = false;
2248
+ }
2249
+ function onOpenAutoFocus() {
2250
+ emit("openAutoFocus");
2251
+ }
2252
+ function onCloseAutoFocus() {
2253
+ emit("closeAutoFocus");
2254
+ }
2255
+ function onFocusoutPrevented(event) {
2256
+ var _a;
2257
+ if (((_a = event.detail) == null ? void 0 : _a.focusReason) === "pointer") {
2258
+ event.preventDefault();
2259
+ }
2260
+ }
2261
+ if (props.lockScroll) {
2262
+ useLockscreen(visible);
2263
+ }
2264
+ function onCloseRequested() {
2265
+ if (props.closeOnPressEscape) {
2266
+ handleClose();
2267
+ }
2268
+ }
2269
+ watch(
2270
+ () => props.modelValue,
2271
+ (val) => {
2272
+ if (val) {
2273
+ closed.value = false;
2274
+ open();
2275
+ rendered.value = true;
2276
+ zIndex.value = isUndefined(props.zIndex) ? nextZIndex() : zIndex.value++;
2277
+ nextTick(() => {
2278
+ emit("open");
2279
+ if (targetRef.value) {
2280
+ targetRef.value.scrollTop = 0;
2281
+ }
2282
+ });
2283
+ } else {
2284
+ if (visible.value) {
2285
+ close();
2286
+ }
2287
+ }
2288
+ }
2289
+ );
2290
+ watch(
2291
+ () => props.fullscreen,
2292
+ (val) => {
2293
+ if (!targetRef.value) return;
2294
+ if (val) {
2295
+ if (props.draggable) {
2296
+ lastPosition = targetRef.value.style.transform;
2297
+ targetRef.value.style.transform = "";
2298
+ lastLeft = targetRef.value.style.left;
2299
+ lastTop = targetRef.value.style.top;
2300
+ targetRef.value.style.left = "";
2301
+ targetRef.value.style.top = "";
2302
+ }
2303
+ } else {
2304
+ if (props.draggable) {
2305
+ targetRef.value.style.transform = lastPosition;
2306
+ targetRef.value.style.left = lastLeft;
2307
+ targetRef.value.style.top = lastTop;
2308
+ }
2309
+ }
2310
+ }
2311
+ );
2312
+ onMounted(() => {
2313
+ if (props.modelValue) {
2314
+ visible.value = true;
2315
+ rendered.value = true;
2316
+ open();
2317
+ }
2318
+ });
2319
+ return {
2320
+ afterEnter,
2321
+ afterLeave,
2322
+ beforeLeave,
2323
+ handleClose,
2324
+ onModalClick,
2325
+ close,
2326
+ doClose,
2327
+ onOpenAutoFocus,
2328
+ onCloseAutoFocus,
2329
+ onCloseRequested,
2330
+ onFocusoutPrevented,
2331
+ titleId,
2332
+ bodyId,
2333
+ closed,
2334
+ style,
2335
+ overlayDialogStyle,
2336
+ rendered,
2337
+ visible,
2338
+ zIndex
2339
+ };
2340
+ };
2341
+ const _hoisted_1$2 = ["aria-level"];
2342
+ const _hoisted_2$1 = ["id"];
2343
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2344
+ ...{
2345
+ name: "ZjhcDialogContent"
2346
+ },
2347
+ __name: "dialogContent",
2348
+ props: dialogContentProps,
2349
+ emits: ["close", "minusChange"],
2350
+ setup(__props, { expose: __expose, emit: __emit }) {
2351
+ const props = __props;
2352
+ const emit = __emit;
2353
+ const { dialogRef, headerRef, bodyId, ns, style } = inject(dialogInjectionKey);
2354
+ const { focusTrapRef } = inject(FOCUS_TRAP_INJECTION_KEY);
2355
+ const composeDialogRef = composeRefs(focusTrapRef, dialogRef);
2356
+ const draggable = computed(() => props.draggable);
2357
+ const overflow = computed(() => props.overflow);
2358
+ const isFullscreen = computed(() => props.fullscreen);
2359
+ const resizable = computed(() => props.resizable);
2360
+ const alignCenter = computed(() => props.alignCenter);
2361
+ const { resetPosition, resetSize, onExpand, onCompress, onMinus, fullscreen, minus } = useDraggableAndResizable(
2362
+ dialogRef,
2363
+ headerRef,
2364
+ draggable,
2365
+ resizable,
2366
+ isFullscreen,
2367
+ alignCenter,
2368
+ overflow
2369
+ );
2370
+ const dialogKls = computed(() => [
2371
+ ns.b(),
2372
+ ns.is("fullscreen", fullscreen.value),
2373
+ ns.is("minus", minus.value),
2374
+ ns.is("draggable", props.draggable),
2375
+ ns.is("resizable", props.resizable),
2376
+ ns.is("align-center", props.alignCenter),
2377
+ { [ns.m("center")]: props.center }
2378
+ ]);
2379
+ const onClose = () => {
2380
+ emit("close");
2381
+ };
2382
+ const _onMinus = () => {
2383
+ onMinus();
2384
+ emit("minusChange", minus.value);
2385
+ };
2386
+ const _onCompress = () => {
2387
+ onCompress();
2388
+ emit("minusChange", minus.value);
2389
+ };
2390
+ __expose({
2391
+ resetPosition,
2392
+ resetSize
2393
+ });
2394
+ return (_ctx, _cache) => {
2395
+ return openBlock(), createElementBlock("div", {
2396
+ ref: unref(composeDialogRef),
2397
+ class: normalizeClass(dialogKls.value),
2398
+ style: normalizeStyle(unref(style)),
2399
+ tabindex: "-1"
2400
+ }, [
2401
+ createElementVNode("header", {
2402
+ ref_key: "headerRef",
2403
+ ref: headerRef,
2404
+ class: normalizeClass([unref(ns).e("header"), { "show-close": _ctx.showClose }])
2405
+ }, [
2406
+ renderSlot(_ctx.$slots, "header", {}, () => [
2407
+ createElementVNode("span", {
2408
+ role: "heading",
2409
+ "aria-level": _ctx.ariaLevel,
2410
+ class: normalizeClass(unref(ns).e("title"))
2411
+ }, toDisplayString(_ctx.title), 11, _hoisted_1$2)
2412
+ ]),
2413
+ createElementVNode("div", {
2414
+ class: normalizeClass(unref(ns).e("headerbtns"))
2415
+ }, [
2416
+ resizable.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2417
+ !unref(minus) ? (openBlock(), createElementBlock("button", {
2418
+ key: 0,
2419
+ "aria-label": "最小化",
2420
+ class: normalizeClass(unref(ns).e("headerbtn")),
2421
+ type: "button",
2422
+ onClick: _onMinus
2423
+ }, [
2424
+ createVNode(unref(ElIcon), {
2425
+ class: normalizeClass(unref(ns).e("close")),
2426
+ size: 18
2427
+ }, {
2428
+ default: withCtx(() => [
2429
+ createVNode(unref(Minus))
2430
+ ]),
2431
+ _: 1
2432
+ }, 8, ["class"])
2433
+ ], 2)) : createCommentVNode("", true),
2434
+ !unref(fullscreen) && !unref(minus) ? (openBlock(), createElementBlock("button", {
2435
+ key: 1,
2436
+ "aria-label": "最大化",
2437
+ class: normalizeClass(unref(ns).e("headerbtn")),
2438
+ type: "button",
2439
+ onClick: _cache[0] || (_cache[0] = //@ts-ignore
2440
+ (...args) => unref(onExpand) && unref(onExpand)(...args))
2441
+ }, [
2442
+ createVNode(unref(ElIcon), {
2443
+ class: normalizeClass(unref(ns).e("close")),
2444
+ size: 18
2445
+ }, {
2446
+ default: withCtx(() => [
2447
+ createVNode(unref(FullScreen))
2448
+ ]),
2449
+ _: 1
2450
+ }, 8, ["class"])
2451
+ ], 2)) : (openBlock(), createElementBlock("button", {
2452
+ key: 2,
2453
+ "aria-label": "还原",
2454
+ class: normalizeClass(unref(ns).e("headerbtn")),
2455
+ type: "button",
2456
+ onClick: _onCompress
2457
+ }, [
2458
+ createVNode(unref(ElIcon), {
2459
+ class: normalizeClass(unref(ns).e("close")),
2460
+ size: 18
2461
+ }, {
2462
+ default: withCtx(() => [
2463
+ createVNode(unref(CopyDocument))
2464
+ ]),
2465
+ _: 1
2466
+ }, 8, ["class"])
2467
+ ], 2))
2468
+ ], 64)) : createCommentVNode("", true),
2469
+ _ctx.showClose ? (openBlock(), createElementBlock("button", {
2470
+ key: 1,
2471
+ "aria-label": "关闭",
2472
+ class: normalizeClass(unref(ns).e("headerbtn")),
2473
+ type: "button",
2474
+ onClick: onClose
2475
+ }, [
2476
+ createVNode(unref(ElIcon), {
2477
+ class: normalizeClass(unref(ns).e("close"))
2478
+ }, {
2479
+ default: withCtx(() => [
2480
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.closeIcon || unref(Close))))
2481
+ ]),
2482
+ _: 1
2483
+ }, 8, ["class"])
2484
+ ], 2)) : createCommentVNode("", true)
2485
+ ], 2)
2486
+ ], 2),
2487
+ createElementVNode("div", {
2488
+ id: unref(bodyId),
2489
+ class: normalizeClass(unref(ns).e("body"))
2490
+ }, [
2491
+ renderSlot(_ctx.$slots, "default")
2492
+ ], 10, _hoisted_2$1),
2493
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("footer", {
2494
+ key: 0,
2495
+ class: normalizeClass(unref(ns).e("footer"))
2496
+ }, [
2497
+ renderSlot(_ctx.$slots, "footer")
2498
+ ], 2)) : createCommentVNode("", true)
2499
+ ], 6);
2500
+ };
2501
+ }
2502
+ });
2503
+ const _hoisted_1$1 = ["aria-label", "aria-labelledby", "aria-describedby"];
2504
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
2505
+ ...{
2506
+ name: "ZjhcDialog",
2507
+ inheritAttrs: false
2508
+ },
2509
+ __name: "dialog",
2510
+ props: dialogProps,
2511
+ emits: dialogEmits,
2512
+ setup(__props, { expose: __expose }) {
2513
+ const props = __props;
2514
+ const ns = useNamespace$1("dialog");
2515
+ const dialogRef = ref();
2516
+ const headerRef = ref();
2517
+ const dialogContentRef = ref();
2518
+ const isMinus = ref(false);
2519
+ const {
2520
+ visible,
2521
+ titleId,
2522
+ bodyId,
2523
+ style,
2524
+ overlayDialogStyle,
2525
+ rendered,
2526
+ zIndex,
2527
+ afterEnter,
2528
+ afterLeave,
2529
+ beforeLeave,
2530
+ handleClose,
2531
+ onModalClick,
2532
+ onOpenAutoFocus,
2533
+ onCloseAutoFocus,
2534
+ onCloseRequested,
2535
+ onFocusoutPrevented
2536
+ } = useDialog(props, dialogRef);
2537
+ provide(dialogInjectionKey, {
2538
+ dialogRef,
2539
+ headerRef,
2540
+ bodyId,
2541
+ ns,
2542
+ rendered,
2543
+ style
2544
+ });
2545
+ const overlayEvent = useSameTarget(onModalClick);
2546
+ const resetPosition = () => {
2547
+ var _a;
2548
+ (_a = dialogContentRef.value) == null ? void 0 : _a.resetPosition();
2549
+ };
2550
+ const handleMinusChange = (value) => {
2551
+ isMinus.value = value;
2552
+ };
2553
+ __expose({
2554
+ visible,
2555
+ dialogContentRef,
2556
+ resetPosition
2557
+ });
2558
+ return (_ctx, _cache) => {
2559
+ return openBlock(), createBlock(Teleport, {
2560
+ to: _ctx.appendTo,
2561
+ disabled: _ctx.appendTo !== "body" ? false : !_ctx.appendToBody
2562
+ }, [
2563
+ createVNode(Transition, {
2564
+ name: "dialog-fade",
2565
+ onAfterEnter: unref(afterEnter),
2566
+ onAfterLeave: unref(afterLeave),
2567
+ onBeforeLeave: unref(beforeLeave),
2568
+ persisted: ""
2569
+ }, {
2570
+ default: withCtx(() => [
2571
+ withDirectives(createVNode(unref(ElOverlay), {
2572
+ "custom-mask-event": "",
2573
+ mask: _ctx.modal && !isMinus.value,
2574
+ "overlay-class": _ctx.modalClass,
2575
+ "z-index": unref(zIndex),
2576
+ style: normalizeStyle({ "pointer-events": !_ctx.modal || isMinus.value ? "none" : "auto" })
2577
+ }, {
2578
+ default: withCtx(() => [
2579
+ createElementVNode("div", {
2580
+ role: "dialog",
2581
+ "aria-modal": "true",
2582
+ "aria-label": _ctx.title || void 0,
2583
+ "aria-labelledby": !_ctx.title ? unref(titleId) : void 0,
2584
+ "aria-describedby": unref(bodyId),
2585
+ class: normalizeClass(`${unref(ns).namespace.value}-overlay-dialog`),
2586
+ style: normalizeStyle([
2587
+ unref(overlayDialogStyle),
2588
+ { "pointer-events": !_ctx.modal || isMinus.value ? "none" : "auto" }
2589
+ ]),
2590
+ onClick: _cache[0] || (_cache[0] = //@ts-ignore
2591
+ (...args) => unref(overlayEvent).onClick && unref(overlayEvent).onClick(...args)),
2592
+ onMousedown: _cache[1] || (_cache[1] = //@ts-ignore
2593
+ (...args) => unref(overlayEvent).onMousedown && unref(overlayEvent).onMousedown(...args)),
2594
+ onMouseup: _cache[2] || (_cache[2] = //@ts-ignore
2595
+ (...args) => unref(overlayEvent).onMouseup && unref(overlayEvent).onMouseup(...args))
2596
+ }, [
2597
+ createVNode(unref(ElFocusTrap), {
2598
+ loop: "",
2599
+ trapped: unref(visible),
2600
+ "focus-start-el": "container",
2601
+ onFocusAfterTrapped: unref(onOpenAutoFocus),
2602
+ onFocusAfterReleased: unref(onCloseAutoFocus),
2603
+ onFocusoutPrevented: unref(onFocusoutPrevented),
2604
+ onReleaseRequested: unref(onCloseRequested)
2605
+ }, {
2606
+ default: withCtx(() => [
2607
+ unref(rendered) ? (openBlock(), createBlock(_sfc_main$5, mergeProps({
2608
+ key: 0,
2609
+ ref_key: "dialogContentRef",
2610
+ ref: dialogContentRef
2611
+ }, _ctx.$attrs, {
2612
+ "align-center": _ctx.alignCenter,
2613
+ "close-icon": _ctx.closeIcon,
2614
+ draggable: _ctx.draggable,
2615
+ resizable: _ctx.resizable,
2616
+ overflow: _ctx.overflow,
2617
+ fullscreen: _ctx.fullscreen,
2618
+ center: _ctx.center,
2619
+ "show-close": _ctx.showClose,
2620
+ title: _ctx.title,
2621
+ "aria-level": _ctx.headerAriaLevel,
2622
+ onClose: unref(handleClose),
2623
+ onMinusChange: handleMinusChange
2624
+ }), createSlots({
2625
+ header: withCtx(() => [
2626
+ !_ctx.$slots.title ? renderSlot(_ctx.$slots, "header", {
2627
+ close: unref(handleClose),
2628
+ titleId: unref(titleId),
2629
+ titleClass: unref(ns).e("title")
2630
+ }, void 0, void 0, 0) : renderSlot(_ctx.$slots, "title", {}, void 0, void 0, 1)
2631
+ ]),
2632
+ default: withCtx(() => [
2633
+ renderSlot(_ctx.$slots, "default")
2634
+ ]),
2635
+ _: 2
2636
+ }, [
2637
+ _ctx.$slots.footer ? {
2638
+ name: "footer",
2639
+ fn: withCtx(() => [
2640
+ renderSlot(_ctx.$slots, "footer")
2641
+ ]),
2642
+ key: "0"
2643
+ } : void 0
2644
+ ]), 1040, ["align-center", "close-icon", "draggable", "resizable", "overflow", "fullscreen", "center", "show-close", "title", "aria-level", "onClose"])) : createCommentVNode("", true)
2645
+ ]),
2646
+ _: 3
2647
+ }, 8, ["trapped", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusoutPrevented", "onReleaseRequested"])
2648
+ ], 46, _hoisted_1$1)
2649
+ ]),
2650
+ _: 3
2651
+ }, 8, ["mask", "overlay-class", "z-index", "style"]), [
2652
+ [vShow, unref(visible)]
2653
+ ])
2654
+ ]),
2655
+ _: 3
2656
+ }, 8, ["onAfterEnter", "onAfterLeave", "onBeforeLeave"])
2657
+ ], 8, ["to", "disabled"]);
2658
+ };
2659
+ }
2660
+ });
2661
+ const ZjhcDialog = withInstall(_sfc_main$4);
2662
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2663
+ ...{
2664
+ name: "ZjhcTableOperator"
2665
+ },
2666
+ __name: "TableOperator",
2667
+ props: {
2668
+ actions: { type: Array, required: false, default: () => [] },
2669
+ width: { type: Number, required: false },
2670
+ title: { type: String, required: false, default: "操作" }
2671
+ },
2672
+ emits: ["inline-action"],
2673
+ setup(__props, { emit: __emit }) {
2674
+ const props = __props;
2675
+ const emit = __emit;
2676
+ const actionsWidth = computed(() => {
2677
+ if (props.width) {
2678
+ return props.width;
2679
+ }
2680
+ if (props.actions.length >= 4) {
2681
+ return 312;
2682
+ }
2683
+ if (props.actions.length === 3) {
2684
+ return 238;
2685
+ }
2686
+ if (props.actions.length === 2) {
2687
+ return 168;
2688
+ }
2689
+ return 98;
2690
+ });
2691
+ function getAvailbleActions(row) {
2692
+ return props.actions.filter((action) => {
2693
+ return isEnabled(action, row);
2694
+ });
2695
+ }
2696
+ function isEnabled(action, row) {
2697
+ if (isFunction(action.disabled)) {
2698
+ return !action.disabled(row);
2699
+ } else if (action.disabled) {
2700
+ return false;
2701
+ }
2702
+ return true;
2703
+ }
2704
+ function getConfirmText(confirm) {
2705
+ if (isString(confirm)) {
2706
+ return confirm;
2707
+ }
2708
+ return "您确定该操作?";
2709
+ }
2710
+ function onConfirmAction(action, row, rowIndex) {
2711
+ if (!isEnabled(action, row)) {
2712
+ return;
2713
+ }
2714
+ if (action.confirm) {
2715
+ ElMessageBox.confirm(getConfirmText(action.confirm), "提示", {
2716
+ type: "warning",
2717
+ cancelButtonText: "取消",
2718
+ confirmButtonText: "确定"
2719
+ }).then(() => {
2720
+ onAction(action, row, rowIndex);
2721
+ }).catch(() => {
2722
+ });
2723
+ } else {
2724
+ onAction(action, row, rowIndex);
2725
+ }
2726
+ }
2727
+ function onAction(action, row, rowIndex) {
2728
+ if (action.onclick) {
2729
+ if (isFunction(action.onclick)) {
2730
+ action.onclick(row, rowIndex);
2731
+ } else {
2732
+ emit("inline-action", action.onclick, row, rowIndex);
2733
+ }
2734
+ }
2735
+ }
2736
+ return (_ctx, _cache) => {
2737
+ return openBlock(), createBlock(unref(ElTableColumn), {
2738
+ fixed: "right",
2739
+ label: __props.title,
2740
+ width: actionsWidth.value
2741
+ }, {
2742
+ default: withCtx((scope) => [
2743
+ (openBlock(true), createElementBlock(Fragment, null, renderList(getAvailbleActions(scope.row), (action) => {
2744
+ return openBlock(), createBlock(unref(ElLink), {
2745
+ key: action.key,
2746
+ type: "primary",
2747
+ title: action.tooltip,
2748
+ icon: action.icon,
2749
+ onClick: ($event) => onConfirmAction(action, scope.row, scope.$index)
2750
+ }, {
2751
+ default: withCtx(() => [
2752
+ createTextVNode(toDisplayString(action.text), 1)
2753
+ ]),
2754
+ _: 2
2755
+ }, 1032, ["title", "icon", "onClick"]);
2756
+ }), 128))
2757
+ ]),
2758
+ _: 1
2759
+ }, 8, ["label", "width"]);
2760
+ };
2761
+ }
2762
+ });
2763
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2764
+ ...{
2765
+ name: "ZjhcComplexTable",
2766
+ inheritAttrs: false
2767
+ },
2768
+ __name: "ComplexTable",
2769
+ props: {
2770
+ class: { required: false },
2771
+ style: { required: false },
2772
+ actions: { type: Array, required: true, default: () => [] },
2773
+ actionSpace: { type: Number, required: false, default: 12 },
2774
+ moreButtonText: { type: String, required: false },
2775
+ primaryColSpan: { type: Number, required: false },
2776
+ secondaryColSpan: { type: Number, required: false },
2777
+ actionsWidth: { type: Number, required: false },
2778
+ actionsTitle: { type: String, required: false, default: "操作" },
2779
+ data: { type: Array, required: true },
2780
+ pagination: { type: Object, required: false },
2781
+ titleIsinline: { type: Boolean, required: false },
2782
+ loading: { type: Boolean, required: false, default: false },
2783
+ layout: { type: String, required: false },
2784
+ pageSizes: { type: Array, required: false }
2785
+ },
2786
+ emits: ["on-page-change", "on-size-change", "on-command"],
2787
+ setup(__props, { expose: __expose, emit: __emit }) {
2788
+ const bem = useNamespace("advance");
2789
+ const innerTableRef = ref();
2790
+ const emits = __emit;
2791
+ const props = __props;
2792
+ __expose({
2793
+ innerTableRef
2794
+ });
2795
+ const enableSelection = computed(() => {
2796
+ return props.actions.some((item) => item.limit === "more");
2797
+ });
2798
+ const theadActions = computed(() => {
2799
+ return props.actions.filter((item) => item.position !== void 0 || item.limit === "more" || item.limit === "none");
2800
+ });
2801
+ const inlineActions = computed(() => {
2802
+ return props.actions.filter((item) => item.position === void 0 && item.limit === "one");
2803
+ });
2804
+ const hasToolBar = computed(() => {
2805
+ return theadActions.value.length > 0;
2806
+ });
2807
+ const hasOne = computed(() => {
2808
+ return inlineActions.value.length > 0;
2809
+ });
2810
+ const selectedRows = ref([]);
2811
+ function isSelectedRow({ row }) {
2812
+ const isSelected = selectedRows.value.includes(row);
2813
+ if (isSelected) {
2814
+ return "is-selected";
2815
+ }
2816
+ return void 0;
2817
+ }
2818
+ function onSelectionChange(rows) {
2819
+ selectedRows.value = rows;
2820
+ }
2821
+ function onPageChange(currentPage) {
2822
+ if (props.pagination && props.pagination.visible) {
2823
+ emits("on-page-change", currentPage);
2824
+ }
2825
+ }
2826
+ function onSizeChange(pageSize) {
2827
+ if (props.pagination && props.pagination.visible) {
2828
+ emits("on-size-change", pageSize);
2829
+ }
2830
+ }
2831
+ function onInlineAction(command, rows, rowIndex) {
2832
+ emits("on-command", command, rows, rowIndex);
2833
+ }
2834
+ function onCommand(command, rows) {
2835
+ emits("on-command", command, rows);
2836
+ }
2837
+ return (_ctx, _cache) => {
2838
+ const _directive_zjhcloading = resolveDirective("zjhcloading");
2839
+ return openBlock(), createElementBlock("div", {
2840
+ class: normalizeClass([unref(bem).e("layout"), _ctx.$props.class])
2841
+ }, [
2842
+ hasToolBar.value || _ctx.$slots.title ? (openBlock(), createElementBlock("div", {
2843
+ key: 0,
2844
+ class: normalizeClass([unref(bem).e("toolbar"), __props.titleIsinline ? "is-line" : ""])
2845
+ }, [
2846
+ _ctx.$slots.title ? renderSlot(_ctx.$slots, "title", {}, void 0, void 0, 0) : createCommentVNode("", true),
2847
+ createVNode(unref(ZjhcTableToolbar), {
2848
+ rows: selectedRows.value,
2849
+ actions: theadActions.value,
2850
+ onOnCommand: onCommand,
2851
+ primaryColSpan: __props.primaryColSpan,
2852
+ secondaryColSpan: __props.secondaryColSpan,
2853
+ moreButtonText: __props.moreButtonText,
2854
+ space: __props.actionSpace
2855
+ }, null, 8, ["rows", "actions", "primaryColSpan", "secondaryColSpan", "moreButtonText", "space"])
2856
+ ], 2)) : createCommentVNode("", true),
2857
+ createElementVNode("div", {
2858
+ class: normalizeClass(unref(bem).e("grid"))
2859
+ }, [
2860
+ withDirectives((openBlock(), createBlock(unref(ElTable), mergeProps({
2861
+ ref_key: "innerTableRef",
2862
+ ref: innerTableRef,
2863
+ data: __props.data,
2864
+ onSelectionChange
2865
+ }, _ctx.$attrs, {
2866
+ class: "table-inner",
2867
+ "row-class-name": isSelectedRow
2868
+ }), createSlots({
2869
+ default: withCtx(() => [
2870
+ enableSelection.value ? (openBlock(), createBlock(unref(ElTableColumn), {
2871
+ key: 0,
2872
+ fixed: "",
2873
+ type: "selection",
2874
+ width: "50"
2875
+ })) : createCommentVNode("", true),
2876
+ renderSlot(_ctx.$slots, "default"),
2877
+ hasOne.value ? (openBlock(), createBlock(_sfc_main$3, {
2878
+ key: 1,
2879
+ actions: inlineActions.value,
2880
+ title: __props.actionsTitle,
2881
+ onInlineAction,
2882
+ width: __props.actionsWidth
2883
+ }, null, 8, ["actions", "title", "width"])) : createCommentVNode("", true)
2884
+ ]),
2885
+ _: 2
2886
+ }, [
2887
+ _ctx.$slots.append ? {
2888
+ name: "append",
2889
+ fn: withCtx(() => [
2890
+ renderSlot(_ctx.$slots, "append")
2891
+ ]),
2892
+ key: "0"
2893
+ } : void 0
2894
+ ]), 1040, ["data"])), [
2895
+ [_directive_zjhcloading, __props.loading]
2896
+ ])
2897
+ ], 2),
2898
+ __props.pagination && __props.pagination.visible ? (openBlock(), createElementBlock("div", {
2899
+ key: 1,
2900
+ class: normalizeClass(unref(bem).e("pagination"))
2901
+ }, [
2902
+ createVNode(unref(ElPagination), mergeProps({
2903
+ background: "",
2904
+ "current-page": __props.pagination.currentPage,
2905
+ "page-size": __props.pagination.pageSize,
2906
+ "onUpdate:currentPage": onPageChange,
2907
+ "onUpdate:pageSize": onSizeChange
2908
+ }, __props.pagination, {
2909
+ total: __props.pagination.total,
2910
+ layout: __props.layout || "total,sizes,->, prev, pager, next, jumper",
2911
+ pageSizes: __props.pageSizes
2912
+ }), null, 16, ["current-page", "page-size", "total", "layout", "pageSizes"])
2913
+ ], 2)) : createCommentVNode("", true)
2914
+ ], 2);
2915
+ };
2916
+ }
2917
+ });
2918
+ const ZjhcComplexTable = withInstall(_sfc_main$2);
2919
+ const autocompleteProps = buildProps({
2920
+ // 用来展示的字段名
2921
+ valueKey: {
2922
+ type: String,
2923
+ default: "value"
2924
+ },
2925
+ // 选中项绑定值
2926
+ modelValue: {
2927
+ type: Array,
2928
+ default: []
2929
+ },
2930
+ // 获取输入建议的防抖延时,单位为毫秒
2931
+ debounce: {
2932
+ type: Number,
2933
+ default: 300
2934
+ },
2935
+ // 下拉框出现的位置
2936
+ placement: {
2937
+ type: definePropType(String),
2938
+ values: [
2939
+ "top",
2940
+ "top-start",
2941
+ "top-end",
2942
+ "bottom",
2943
+ "bottom-start",
2944
+ "bottom-end"
2945
+ ],
2946
+ default: "bottom-start"
2947
+ },
2948
+ // 获取输入建议的方法,仅当输入的建议数据resolve的时候,通过调用callback(data:[])来返回它
2949
+ fetchSuggestions: {
2950
+ type: definePropType([Function, Array]),
2951
+ default: NOOP
2952
+ },
2953
+ // 远程搜索中的返回值允许点击几个
2954
+ multiple: {
2955
+ type: Boolean,
2956
+ default: false
2957
+ },
2958
+ popperClass: {
2959
+ type: String,
2960
+ default: ""
2961
+ },
2962
+ triggerOnFocus: {
2963
+ type: Boolean,
2964
+ default: true
2965
+ },
2966
+ selectWhenUnmatched: {
2967
+ type: Boolean,
2968
+ default: false
2969
+ },
2970
+ hideLoading: {
2971
+ type: Boolean,
2972
+ default: false
2973
+ },
2974
+ teleported: useTooltipContentProps.teleported,
2975
+ highlightFirstItem: {
2976
+ type: Boolean,
2977
+ default: false
2978
+ },
2979
+ fitInputWidth: {
2980
+ type: Boolean,
2981
+ default: false
2982
+ },
2983
+ clearable: {
2984
+ type: Boolean,
2985
+ default: false
2986
+ },
2987
+ name: String,
2988
+ ...useAriaProps(["ariaLabel"])
2989
+ });
2990
+ const autocompleteEmits = {
2991
+ [UPDATE_MODEL_EVENT]: (value) => isArray$1(value),
2992
+ [INPUT_EVENT]: (value) => isString$2(value),
2993
+ [CHANGE_EVENT]: (value) => isString$2(value),
2994
+ focus: (evt) => evt instanceof FocusEvent,
2995
+ blur: (evt) => evt instanceof FocusEvent,
2996
+ clear: () => true,
2997
+ select: (item, selected) => isObject$2(item) && isBoolean(selected)
2998
+ };
2999
+ const _hoisted_1 = ["aria-expanded", "aria-owns"];
3000
+ const _hoisted_2 = { key: 0 };
3001
+ const _hoisted_3 = ["id", "aria-selected", "onClick"];
3002
+ const COMPONENT_NAME = "ZjhcAutocomplete";
3003
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
3004
+ ...{
3005
+ name: COMPONENT_NAME,
3006
+ inheritAttrs: false
3007
+ },
3008
+ __name: "autoComplete",
3009
+ props: autocompleteProps,
3010
+ emits: autocompleteEmits,
3011
+ setup(__props, { expose: __expose, emit: __emit }) {
3012
+ const props = __props;
3013
+ const emit = __emit;
3014
+ const attrs = useAttrs();
3015
+ const rawAttrs = useAttrs$1();
3016
+ const disabled = useFormDisabled();
3017
+ const ns = useNamespace("autocomplete");
3018
+ const inputRef = ref();
3019
+ const regionRef = ref();
3020
+ const popperRef = ref();
3021
+ const listboxRef = ref();
3022
+ let readonly = false;
3023
+ let ignoreFocusEvent = false;
3024
+ const queryValue = ref("");
3025
+ const selectedItems = ref(/* @__PURE__ */ new Set());
3026
+ const suggestions = ref([]);
3027
+ const highlightedIndex = ref(-1);
3028
+ const dropdownWidth = ref("");
3029
+ const activated = ref(false);
3030
+ const suggestionDisabled = ref(false);
3031
+ const loading = ref(false);
3032
+ const listboxId = useId$1();
3033
+ const styles = computed(() => rawAttrs.style);
3034
+ const suggestionVisible = computed(() => {
3035
+ const isValidData = suggestions.value.length > 0;
3036
+ return (isValidData || loading.value) && activated.value;
3037
+ });
3038
+ const suggestionLoading = computed(() => {
3039
+ return !props.hideLoading && loading.value;
3040
+ });
3041
+ const refInput = computed(() => {
3042
+ if (inputRef.value) {
3043
+ return Array.from(
3044
+ inputRef.value.$el.querySelectorAll("input")
3045
+ );
3046
+ }
3047
+ return [];
3048
+ });
3049
+ const onSuggestionShow = () => {
3050
+ if (suggestionVisible.value) {
3051
+ if (Array.isArray(props.modelValue)) {
3052
+ selectedItems.value = new Set(props.modelValue);
3053
+ } else {
3054
+ selectedItems.value = /* @__PURE__ */ new Set([props.modelValue]);
3055
+ }
3056
+ dropdownWidth.value = `${inputRef.value.$el.offsetWidth}px`;
3057
+ }
3058
+ };
3059
+ const onHide = () => {
3060
+ highlightedIndex.value = -1;
3061
+ selectedItems.value.clear();
3062
+ };
3063
+ const getData = async (queryString) => {
3064
+ if (suggestionDisabled.value) return;
3065
+ const cb = (suggestionList) => {
3066
+ loading.value = false;
3067
+ if (suggestionDisabled.value) return;
3068
+ if (Array.isArray(suggestionList)) {
3069
+ suggestions.value = suggestionList;
3070
+ highlightedIndex.value = props.highlightFirstItem ? 0 : -1;
3071
+ } else {
3072
+ throwError(COMPONENT_NAME, "autocomplete的suggestions必须是一个数组");
3073
+ }
3074
+ };
3075
+ loading.value = true;
3076
+ if (Array.isArray(props.fetchSuggestions)) {
3077
+ cb(props.fetchSuggestions);
3078
+ } else {
3079
+ const result = await props.fetchSuggestions(queryString, cb);
3080
+ if (Array.isArray(result)) cb(result);
3081
+ }
3082
+ };
3083
+ const debounceGetData = debounce(getData, props.debounce);
3084
+ const handleInput = (value) => {
3085
+ const valuePresented = !!value;
3086
+ emit(INPUT_EVENT, value);
3087
+ suggestionDisabled.value = false;
3088
+ if (!activated.value) {
3089
+ activated.value = valuePresented;
3090
+ }
3091
+ if (!props.triggerOnFocus && !value) {
3092
+ suggestionDisabled.value = true;
3093
+ suggestions.value = [];
3094
+ return;
3095
+ }
3096
+ debounceGetData(value);
3097
+ };
3098
+ const handleMouseDown = (event) => {
3099
+ var _a;
3100
+ if (disabled.value) return;
3101
+ if (((_a = event.target) == null ? void 0 : _a.tagName) !== "INPUT" || refInput.value.includes(document.activeElement)) {
3102
+ activated.value = true;
3103
+ }
3104
+ };
3105
+ const handleChange = (value) => {
3106
+ emit(CHANGE_EVENT, value);
3107
+ };
3108
+ const handleFocus = (event) => {
3109
+ if (!ignoreFocusEvent) {
3110
+ activated.value = true;
3111
+ emit("focus", event);
3112
+ if (props.triggerOnFocus && !readonly) {
3113
+ if (queryValue.value.trim() !== "") {
3114
+ debounceGetData(String(queryValue.value));
3115
+ }
3116
+ }
3117
+ } else {
3118
+ ignoreFocusEvent = false;
3119
+ }
3120
+ };
3121
+ const handleBlur = (event) => {
3122
+ setTimeout(() => {
3123
+ var _a;
3124
+ if ((_a = popperRef.value) == null ? void 0 : _a.isFocusInsideContent()) {
3125
+ ignoreFocusEvent = true;
3126
+ return;
3127
+ }
3128
+ if (activated.value) {
3129
+ close();
3130
+ }
3131
+ emit("blur", event);
3132
+ });
3133
+ };
3134
+ const handleClear = () => {
3135
+ activated.value = false;
3136
+ emit("clear");
3137
+ };
3138
+ const handleKeyEnter = async () => {
3139
+ if (suggestionVisible.value && highlightedIndex.value >= 0 && highlightedIndex.value < suggestions.value.length) {
3140
+ handleSelect(suggestions.value[highlightedIndex.value]);
3141
+ } else if (props.selectWhenUnmatched) {
3142
+ suggestions.value = [];
3143
+ highlightedIndex.value = -1;
3144
+ }
3145
+ };
3146
+ const handleKeyEscape = (event) => {
3147
+ if (suggestionVisible.value) {
3148
+ event.preventDefault();
3149
+ event.stopPropagation();
3150
+ close();
3151
+ }
3152
+ };
3153
+ const close = () => {
3154
+ suggestions.value = [];
3155
+ activated.value = false;
3156
+ };
3157
+ const focus = () => {
3158
+ var _a;
3159
+ (_a = inputRef.value) == null ? void 0 : _a.focus();
3160
+ };
3161
+ const blur = () => {
3162
+ var _a;
3163
+ (_a = inputRef.value) == null ? void 0 : _a.blur();
3164
+ };
3165
+ const handleSelect = async (item) => {
3166
+ var _a;
3167
+ let isSelected = false;
3168
+ if (props.multiple) {
3169
+ if (selectedItems.value.has(item[props.valueKey])) {
3170
+ selectedItems.value.delete(item[props.valueKey]);
3171
+ } else {
3172
+ selectedItems.value.add(item[props.valueKey]);
3173
+ isSelected = true;
3174
+ }
3175
+ const selectedList = Array.from(selectedItems.value);
3176
+ emit(UPDATE_MODEL_EVENT, selectedList);
3177
+ } else {
3178
+ selectedItems.value.clear();
3179
+ selectedItems.value.add(item[props.valueKey]);
3180
+ emit(UPDATE_MODEL_EVENT, [item[props.valueKey]]);
3181
+ highlightedIndex.value = -1;
3182
+ (_a = inputRef.value) == null ? void 0 : _a.blur();
3183
+ isSelected = true;
3184
+ activated.value = false;
3185
+ }
3186
+ emit("select", item, isSelected);
3187
+ };
3188
+ const highlight = (index) => {
3189
+ var _a;
3190
+ if (!suggestionVisible.value || loading.value) return;
3191
+ if (index < 0) {
3192
+ highlightedIndex.value = -1;
3193
+ return;
3194
+ }
3195
+ if (index >= suggestions.value.length) {
3196
+ index = suggestions.value.length - 1;
3197
+ }
3198
+ const suggestion = regionRef.value.querySelector(
3199
+ `.${ns.be("suggestion", "wrap")}`
3200
+ );
3201
+ const suggestionList = suggestion.querySelectorAll(
3202
+ `.${ns.be("suggestion", "list")} li`
3203
+ );
3204
+ const highlightItem = suggestionList[index];
3205
+ const scrollTop = suggestion.scrollTop;
3206
+ const { offsetTop, scrollHeight } = highlightItem;
3207
+ if (offsetTop + scrollHeight > scrollTop + suggestion.clientHeight) {
3208
+ suggestion.scrollTop += scrollHeight;
3209
+ }
3210
+ if (offsetTop < scrollTop) {
3211
+ suggestion.scrollTop -= scrollHeight;
3212
+ }
3213
+ highlightedIndex.value = index;
3214
+ (_a = inputRef.value) == null ? void 0 : _a.ref.setAttribute(
3215
+ "aria-activedescendant",
3216
+ `${listboxId.value}-item-${highlightedIndex.value}`
3217
+ );
3218
+ };
3219
+ const stopHandle = onClickOutside(
3220
+ listboxRef,
3221
+ () => {
3222
+ if (suggestionVisible.value) {
3223
+ close();
3224
+ ignoreFocusEvent = false;
3225
+ }
3226
+ },
3227
+ // @vueuse/core v12 的 onClickOutside 有重载歧义:
3228
+ // 传 controls: true 返回 { stop, cancel, trigger },否则返回停止函数。
3229
+ // 这里显式写 false,让类型和运行时行为对齐(不传时默认就是 false)。
3230
+ { ignore: [regionRef], controls: false }
3231
+ //如果点击事件发生在下拉内部,不触发close
3232
+ );
3233
+ const isSelect = (item) => {
3234
+ return selectedItems.value.has(item[props.valueKey]);
3235
+ };
3236
+ onBeforeUnmount(() => {
3237
+ stopHandle == null ? void 0 : stopHandle();
3238
+ });
3239
+ onMounted(() => {
3240
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
3241
+ (_b = (_a = inputRef.value) == null ? void 0 : _a.ref) == null ? void 0 : _b.setAttribute("role", "textbox");
3242
+ (_d = (_c = inputRef.value) == null ? void 0 : _c.ref) == null ? void 0 : _d.setAttribute("aria-autocomplete", "list");
3243
+ (_f = (_e = inputRef.value) == null ? void 0 : _e.ref) == null ? void 0 : _f.setAttribute("aria-contrils", "id");
3244
+ (_h = (_g = inputRef.value) == null ? void 0 : _g.ref) == null ? void 0 : _h.setAttribute(
3245
+ "aria-activedescendant",
3246
+ `${listboxId.value}-item-${highlightedIndex.value}`
3247
+ );
3248
+ readonly = ((_j = (_i = inputRef.value) == null ? void 0 : _i.ref) == null ? void 0 : _j.hasAttribute("readonly")) || false;
3249
+ });
3250
+ __expose({
3251
+ highlightedIndex,
3252
+ activated,
3253
+ loading,
3254
+ inputRef,
3255
+ popperRef,
3256
+ suggestions,
3257
+ handleSelect,
3258
+ focus,
3259
+ blur,
3260
+ close,
3261
+ highlight,
3262
+ getData
3263
+ });
3264
+ return (_ctx, _cache) => {
3265
+ return openBlock(), createBlock(unref(ElTooltip), {
3266
+ ref_key: "popperRef",
3267
+ ref: popperRef,
3268
+ visible: suggestionVisible.value,
3269
+ placement: _ctx.placement,
3270
+ "fallback-placements": ["bottom-start", "top-start"],
3271
+ "popper-class": [unref(ns).e("popper"), _ctx.popperClass],
3272
+ teleported: _ctx.teleported,
3273
+ "gpu-acceleration": false,
3274
+ offset: 8,
3275
+ pure: "",
3276
+ "manual-mode": "",
3277
+ effect: "light",
3278
+ trigger: "click",
3279
+ transition: `${unref(ns).namespace.value}-zoom-in-top`,
3280
+ persostent: "",
3281
+ role: "listbox",
3282
+ onBeforeShow: onSuggestionShow,
3283
+ onHide
3284
+ }, {
3285
+ content: withCtx(() => [
3286
+ createElementVNode("div", {
3287
+ ref_key: "regionRef",
3288
+ ref: regionRef,
3289
+ class: normalizeClass([unref(ns).b("suggestion"), unref(ns).is("loading", suggestionLoading.value)]),
3290
+ style: normalizeStyle({
3291
+ [_ctx.fitInputWidth ? "width" : "minWidth"]: dropdownWidth.value,
3292
+ outline: "none"
3293
+ }),
3294
+ role: "region"
3295
+ }, [
3296
+ createVNode(unref(ElScrollbar), {
3297
+ id: unref(listboxId),
3298
+ tag: "ul",
3299
+ "wrap-class": unref(ns).be("suggestion", "wrap"),
3300
+ "view-class": unref(ns).be("suggestion", "list"),
3301
+ role: "listbox"
3302
+ }, {
3303
+ default: withCtx(() => [
3304
+ suggestionLoading.value ? (openBlock(), createElementBlock("li", _hoisted_2, [
3305
+ renderSlot(_ctx.$slots, "loading", {}, () => [
3306
+ createVNode(unref(ElIcon), {
3307
+ class: normalizeClass(unref(ns).is("loading"))
3308
+ }, {
3309
+ default: withCtx(() => [
3310
+ createVNode(unref(Loading$1))
3311
+ ]),
3312
+ _: 1
3313
+ }, 8, ["class"])
3314
+ ])
3315
+ ])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(suggestions.value, (item, index) => {
3316
+ return openBlock(), createElementBlock("li", {
3317
+ id: `${unref(listboxId)}-item-${index}`,
3318
+ key: index,
3319
+ class: normalizeClass({
3320
+ highlighted: highlightedIndex.value == index,
3321
+ "is-selected": isSelect(item)
3322
+ }),
3323
+ role: "option",
3324
+ "aria-selected": highlightedIndex.value == index,
3325
+ onClick: ($event) => handleSelect(item)
3326
+ }, [
3327
+ renderSlot(_ctx.$slots, "default", { item }, () => [
3328
+ createTextVNode(toDisplayString(item[_ctx.valueKey]), 1)
3329
+ ]),
3330
+ createVNode(unref(ElIcon), { class: "selected-icon" }, {
3331
+ default: withCtx(() => [
3332
+ createVNode(unref(Check))
3333
+ ]),
3334
+ _: 1
3335
+ })
3336
+ ], 10, _hoisted_3);
3337
+ }), 128))
3338
+ ]),
3339
+ _: 3
3340
+ }, 8, ["id", "wrap-class", "view-class"])
3341
+ ], 6)
3342
+ ]),
3343
+ default: withCtx(() => [
3344
+ createElementVNode("div", {
3345
+ ref_key: "listboxRef",
3346
+ ref: listboxRef,
3347
+ class: normalizeClass([unref(ns).b(), _ctx.$attrs.class]),
3348
+ style: normalizeStyle(styles.value),
3349
+ role: "combobox",
3350
+ "aria-haspopup": "listbox",
3351
+ "aria-expanded": suggestionVisible.value,
3352
+ "aria-owns": unref(listboxId)
3353
+ }, [
3354
+ createVNode(unref(ElInput), mergeProps({
3355
+ ref_key: "inputRef",
3356
+ ref: inputRef
3357
+ }, unref(attrs), {
3358
+ clearable: _ctx.clearable,
3359
+ disabled: unref(disabled),
3360
+ name: _ctx.name,
3361
+ modelValue: queryValue.value,
3362
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => queryValue.value = $event),
3363
+ "aria-label": _ctx.ariaLabel,
3364
+ onInput: handleInput,
3365
+ onChange: handleChange,
3366
+ onFocus: handleFocus,
3367
+ onBlur: handleBlur,
3368
+ onClear: handleClear,
3369
+ onKeydown: [
3370
+ _cache[1] || (_cache[1] = withKeys(withModifiers(($event) => highlight(highlightedIndex.value - 1), ["prevent"]), ["up"])),
3371
+ _cache[2] || (_cache[2] = withKeys(withModifiers(($event) => highlight(highlightedIndex.value + 1), ["prevent"]), ["down"])),
3372
+ withKeys(handleKeyEnter, ["enter"]),
3373
+ withKeys(close, ["tab"]),
3374
+ withKeys(handleKeyEscape, ["esc"])
3375
+ ],
3376
+ onMousedown: handleMouseDown
3377
+ }), createSlots({ _: 2 }, [
3378
+ _ctx.$slots.prepend ? {
3379
+ name: "prepend",
3380
+ fn: withCtx(() => [
3381
+ renderSlot(_ctx.$slots, "prepend")
3382
+ ]),
3383
+ key: "0"
3384
+ } : void 0,
3385
+ _ctx.$slots.append ? {
3386
+ name: "append",
3387
+ fn: withCtx(() => [
3388
+ renderSlot(_ctx.$slots, "append")
3389
+ ]),
3390
+ key: "1"
3391
+ } : void 0,
3392
+ _ctx.$slots.prefix ? {
3393
+ name: "prefix",
3394
+ fn: withCtx(() => [
3395
+ renderSlot(_ctx.$slots, "prefix")
3396
+ ]),
3397
+ key: "2"
3398
+ } : void 0,
3399
+ _ctx.$slots.suffix ? {
3400
+ name: "suffix",
3401
+ fn: withCtx(() => [
3402
+ renderSlot(_ctx.$slots, "suffix")
3403
+ ]),
3404
+ key: "3"
3405
+ } : void 0
3406
+ ]), 1040, ["clearable", "disabled", "name", "modelValue", "aria-label"])
3407
+ ], 14, _hoisted_1)
3408
+ ]),
3409
+ _: 3
3410
+ }, 8, ["visible", "placement", "popper-class", "teleported", "transition"]);
3411
+ };
3412
+ }
3413
+ });
3414
+ const ZjhcAutocomplete = withInstall(_sfc_main$1);
3415
+ let globalTotal = 1;
3416
+ function createLoadingComponent(options) {
3417
+ let afterLeaveTimer;
3418
+ const afterLeaveFlag = ref(false);
3419
+ const data = reactive({
3420
+ ...options,
3421
+ originalPosition: "",
3422
+ originalOverflow: "",
3423
+ visible: false
3424
+ });
3425
+ function setText(text) {
3426
+ data.text = text;
3427
+ }
3428
+ function destroySelf() {
3429
+ const target = data.parent;
3430
+ const ns = vm.ns;
3431
+ if (!target.vLoadingAddClassList) {
3432
+ let loadingNumber = target.getAttribute("loading-number");
3433
+ loadingNumber = Number.parseInt(loadingNumber) - 1;
3434
+ if (!loadingNumber) {
3435
+ removeClass(target, ns.bm("parent", "relative"));
3436
+ target.removeAttribute("loading-number");
3437
+ } else {
3438
+ target.setAttribute("loading-number", loadingNumber.toString());
3439
+ }
3440
+ removeClass(target, ns.bm("parent", "hidden"));
3441
+ }
3442
+ removeElLoadingChild();
3443
+ loadingInstance.unmount();
3444
+ }
3445
+ function removeElLoadingChild() {
3446
+ var _a, _b;
3447
+ (_b = (_a = vm.$el) == null ? void 0 : _a.parentNode) == null ? void 0 : _b.removeChild(vm.$el);
3448
+ }
3449
+ function close() {
3450
+ var _a;
3451
+ if (options.beforeClose && !options.beforeClose()) return;
3452
+ afterLeaveFlag.value = true;
3453
+ clearTimeout(afterLeaveTimer);
3454
+ afterLeaveTimer = setTimeout(handleAfterLeave, 400);
3455
+ data.visible = false;
3456
+ (_a = options.closed) == null ? void 0 : _a.call(options);
3457
+ }
3458
+ function handleAfterLeave() {
3459
+ if (!afterLeaveFlag.value) return;
3460
+ const target = data.parent;
3461
+ afterLeaveFlag.value = false;
3462
+ target.vLoadingAddClassList = void 0;
3463
+ destroySelf();
3464
+ }
3465
+ function getAnimateColor(color) {
3466
+ if (!color)
3467
+ return ["var(--el-color-primary)", "var(--el-color-primary-light-5)"];
3468
+ return color.split(";");
3469
+ }
3470
+ function createStop(offset, color, values) {
3471
+ return h(
3472
+ "stop",
3473
+ {
3474
+ offset,
3475
+ "stop-color": color
3476
+ },
3477
+ [
3478
+ values ? h("animate", {
3479
+ attributeName: "offset",
3480
+ values,
3481
+ dur: "3s",
3482
+ repeatCount: "indefinite"
3483
+ }) : null
3484
+ ]
3485
+ );
3486
+ }
3487
+ const elLoadingComponent = defineComponent({
3488
+ name: "ZjhcLoading",
3489
+ setup(_, { expose }) {
3490
+ const ns = useNamespace("loading");
3491
+ const config = useGlobalConfig$1();
3492
+ globalTotal += 1;
3493
+ const zIndex = useZIndex$1(
3494
+ computed(() => {
3495
+ var _a;
3496
+ return ((_a = config.value) == null ? void 0 : _a.zIndex) || defaultInitialZIndex;
3497
+ })
3498
+ );
3499
+ expose({
3500
+ ns,
3501
+ zIndex
3502
+ });
3503
+ return () => {
3504
+ const svg = data.spinner || data.svg;
3505
+ const animateColor = getAnimateColor(data.animateColor);
3506
+ const fillColor = data.fillColor || "var(--el-fill-color)";
3507
+ const offset = 0.2 / animateColor.length;
3508
+ const step = 1 / (animateColor.length - 1);
3509
+ const animate = [];
3510
+ animateColor.forEach((color, index) => {
3511
+ animate.push(
3512
+ createStop(
3513
+ `${index * offset}%`,
3514
+ color,
3515
+ `${-1 + step * index};${1 + step * index}`
3516
+ )
3517
+ );
3518
+ });
3519
+ animate.push(createStop("0.2%", animateColor[animateColor.length - 1]));
3520
+ const spinner = h(
3521
+ "svg",
3522
+ {
3523
+ class: "circular",
3524
+ viewBox: data.svgViewBox ? data.svgViewBox : "0 0 1024 1024",
3525
+ ...svg ? { innerHTML: svg } : {}
3526
+ },
3527
+ [
3528
+ h("path", {
3529
+ class: "path",
3530
+ d: "M481.4 577.7l-11.8 10.1-4.1 3.7c14 33.5-34 62.3-53.9 43.5 0 0-5.3 4-10.6 8.2l-7.5 6.1c0.6 5.7 1.5 14.1 5.5 17.1 38.5 28.4 116.3-10.8 102.5-68.4l-20.1-20.3zM1005 323c-42.9-59.8-87.7-12.8-117.2-35.6-10.1-7.8-11.3-27.9-11.3-34.7v-2.3l19.2-22.8s45 11.4 63.6-22.8c21.9-40.4-22.2-91.2-66.5-83.4-36.7 6.5-41.4 47.9-42 58.9l-0.1 2.6-22.9 18c-21.9 7.4-41.4-10.2-44.3-26.6-3.6-20.1 39.2-100.2-55.4-120.6-81.1-17.5-193.8-12.9-241.7-9.8l-23.1 1.7s14 16.9 31 23.3c15.6 5.9 89.1 10.2 113.4 10.8l5.3 0.1c12.4 0 16.9 5.6 18.2 8l0.5 1.1-83.3-1.7s15.3 19.7 41.9 25.4c26.6 5.7 50.7 1.4 64.5 2.4 10.6 0.7 14.5 5.8 15.8 8.1l0.5 1.1-72.4-0.7 2.7 2.2c6.6 5.2 24.2 17.8 42.3 20.6 22.9 3.6 44.3 0.7 51.7 1.4 13.1 1.3 12.9 6.8 12.6 8.2l-0.1 0.4h-67s14.5 17.1 36 22.1c21.4 5 44.4 0.2 54.7 1.4 9.1 1.1 12.5 7.2 13.6 10l0.4 1.4h-66.5s14 18.3 36.2 20.7c14.9 1.6 33.7 0 43.6 1.4 11.8 1.7 14.2 7.5 14.7 9.8l0.1 0.9-48.5-0.3c-9.5 0-16.4 0.2-15.8 0.5l3.5 1.6 7.3 3c13 5.6 26.5 14.1 27.6 47.9l-105.5 96.5c-15.3-46.2-29.5-84.1-7.5-91.5 2.9-1 6.8-1.1 11-0.9l9.1 0.4c13.2 0.3 24.4-2.4 12.4-30.1-17.7-33.5-54.7-35.6-69.5-30.6-49.4 16.7-38 70.7-19.9 128.8l13.7 43c2.3 7.2 4.4 14.4 6.4 21.4l-87.2 79.5-89.5-88.4-98.2-97.3c-32.3-32.1-63-62.6-90.2-89.8L176 160.6c-16.1-16.3-29.1-29.5-37.8-38.6l-6.2-6.5c-38.4-39.9-91.6 15.2-59.1 48.4l6.1 6.4-79 72.4 53.2 53.2 50.2-44.6 43.4 43.7-49.3 46.5 47.3 48.4 46.3-43.7 45.3 45.6-47.3 45.6 46.3 46.5L315 408l137.7 138-71.7 65.2c-4.1-52.4 31.9-63.8 59.5-65.4l5.2-0.2h4l-27.3-27.1c-43.2-1.1-99.2 43.5-74 115.5l1.7 5.2C224.5 753 111.6 854.5 86.1 874.7l-5.7 4.3c-21.9 16.7-5.8 24.9 12.3 11.5l263.8-214.1c-0.4 42.9-34.5 55-59.7 51.6l-22.5 17.8c64.1 37.4 137-22.4 115.1-96.1l80.2-65.2 12-9.5 66.7 66.9 30.6 30.8c21 21.2 35 35.4 39.1 39.8l9.6 10.8c10.7 12.5 21.8 30.6 10.9 65-9.7 30.5-29.7 60.9-10.3 110.4 28.1 72 123.4 91 167.7 82.6 151.5-28.5 176.4-183.6 140.9-249.1s-117.2-102.1-170-61.3l-3.8 2.8c-42.6 29.2-79.1-9.4-83.1-13.8l-137-135.2 64.4-52.3c-1.3 29.5-16.5 50.2-60.4 53.3 4.7 4.2 12.3 11.5 19.5 18.6l20 20.1c76-18.6 84.2-71.1 74-126l-1.6-7.9c75.2-60.9 128.9-104.1 135-108.1l0.6-0.3c42.6-0.4 51.7 29.1 53.5 38.6l0.4 2.8 2-52.1s6.9 2.8 9.9 10c3 7.1-4.9 27.1-2 44.6 2.4 14.1 12.6 22.9 16.6 25.9l1.6 1.1 2-61.3s5.4 0.5 8.4 7.1-4.9 47-2.5 58.9c1.8 8.7 10.8 20.5 15.4 26.1l2.8 3.3 2.5-69.3s7.4 1.4 8.9 11.4c1.9 12.5-6.4 52.7-4.9 68.9 1.1 11.7 13.7 27.8 20.6 35.8l4.5 5L938 399s3.9-1 8.4 7.1c4.8 8.8-5.4 67.5-2 84.5 2.5 12.3 14.5 27.4 21 34.8l4.2 4.6 1-98.3s4.9 0.9 8.9 9.5c3.9 8.5-4.9 114.9-1 133 3.1 14 18.3 31.3 24.9 38.3l3.1 3.2c0 0.1 40.4-234.2-1.5-292.7zM721.2 822.4l5-1.4c50.1-14.2 45.2-34.2 56.3-72 15.5-52.7 107.2-37.5 111.6 39.9 3.7 65.5-39.2 139.6-137.4 134.6l-4-0.2c-69.5-4.2-96.2-84.3-31.5-100.9zM273 705.9c-1.1-43.1 36.2-57.7 51.7-46.3l21.4-19.2c-2.9-5.3-1.6-16.1-8.3-18.6-33.7-12.9-110 18.8-87.4 104.1 7.3-6 13.3-11.4 17.3-15l5.3-5z m300.7-275.1l2.2 1s10.4-10 16.1-15l2.6-2.1C584.3 350.6 478.5 378.6 477 457l31 31c18.5-70.3 56.1-60.9 65.7-57.2z m267.2 14c-0.6-15.4-10.5-25.3-26-37l-7.5-5.5c-24.6-18-35.2 1.2-32.5 13.3l0.6 3.4c6.3 44.2-73 24.1-102.3 15.2l-10.7-3.4s6.9 38.7 3.9 49.6c45 11.4 177.9 44.9 174.5-35.6z",
3531
+ fill: `url(#gradient-${globalTotal})`
3532
+ }),
3533
+ h(
3534
+ "defs",
3535
+ h("linearGradient", { id: `gradient-${globalTotal}` }, [
3536
+ h("animateTransform", {
3537
+ attributeName: "gradientTransform",
3538
+ type: "rotate",
3539
+ from: "135 1 0",
3540
+ to: "135 0 1",
3541
+ dur: "3s",
3542
+ repeatCount: "indefinite"
3543
+ }),
3544
+ ...animate,
3545
+ createStop("0.2%", fillColor),
3546
+ createStop("100%", fillColor)
3547
+ ])
3548
+ )
3549
+ ]
3550
+ );
3551
+ const spinnerText = data.text ? h("p", { class: ns.b("text") }, [data.text]) : void 0;
3552
+ return h(
3553
+ Transition,
3554
+ {
3555
+ name: ns.b("fade"),
3556
+ onAfterLeave: handleAfterLeave
3557
+ },
3558
+ {
3559
+ default: withCtx(() => [
3560
+ withDirectives(
3561
+ createVNode(
3562
+ "div",
3563
+ {
3564
+ style: {
3565
+ backgroundColor: data.background || ""
3566
+ },
3567
+ class: [
3568
+ ns.b("mask"),
3569
+ data.customClass,
3570
+ data.fullscreen ? "is-fullscreen" : ""
3571
+ ]
3572
+ },
3573
+ [
3574
+ h(
3575
+ "div",
3576
+ {
3577
+ class: ns.b("spinner")
3578
+ },
3579
+ [spinner, spinnerText]
3580
+ )
3581
+ ]
3582
+ ),
3583
+ [[vShow, data.visible]]
3584
+ )
3585
+ ])
3586
+ }
3587
+ );
3588
+ };
3589
+ }
3590
+ });
3591
+ const loadingInstance = createApp(elLoadingComponent);
3592
+ const vm = loadingInstance.mount(document.createElement("div"));
3593
+ return {
3594
+ ...toRefs(data),
3595
+ setText,
3596
+ removeElLoadingChild,
3597
+ close,
3598
+ handleAfterLeave,
3599
+ vm,
3600
+ get $el() {
3601
+ return vm.$el;
3602
+ }
3603
+ };
3604
+ }
3605
+ let fullscreenInstance = void 0;
3606
+ const Loading = function(options = {}) {
3607
+ if (!isClient) return void 0;
3608
+ const resolved = resolveOptions(options);
3609
+ if (resolved.fullscreen && fullscreenInstance) {
3610
+ return fullscreenInstance;
3611
+ }
3612
+ const instance = createLoadingComponent({
3613
+ ...resolved,
3614
+ closed: () => {
3615
+ var _a;
3616
+ (_a = resolved.closed) == null ? void 0 : _a.call(resolved);
3617
+ if (resolved.fullscreen) fullscreenInstance = void 0;
3618
+ }
3619
+ });
3620
+ addStyle(resolved, resolved.parent, instance);
3621
+ addClassList(resolved, resolved.parent, instance);
3622
+ resolved.parent.vLoadingAddClassList = () => addClassList(resolved, resolved.parent, instance);
3623
+ let loadingNumber = resolved.parent.getAttribute("loading-number");
3624
+ if (!loadingNumber) {
3625
+ loadingNumber = "1";
3626
+ } else {
3627
+ loadingNumber = `${Number.parseInt(loadingNumber) + 1}`;
3628
+ }
3629
+ resolved.parent.setAttribute("loading-number", loadingNumber);
3630
+ resolved.parent.appendChild(instance.$el);
3631
+ nextTick(() => instance.visible.value = resolved.visible);
3632
+ if (resolved.fullscreen) {
3633
+ fullscreenInstance = instance;
3634
+ }
3635
+ return instance;
3636
+ };
3637
+ const resolveOptions = (options) => {
3638
+ let target;
3639
+ if (isString$1(options.target)) {
3640
+ target = document.querySelector(options.target) ?? document.body;
3641
+ } else {
3642
+ target = options.target || document.body;
3643
+ }
3644
+ return {
3645
+ parent: target === document.body || options.body ? document.body : target,
3646
+ background: options.background || "",
3647
+ fillColor: options.fillColor || "",
3648
+ animateColor: options.animateColor || "",
3649
+ svg: options.svg || "",
3650
+ svgViewBox: options.svgViewBox || "",
3651
+ spinner: options.spinner || false,
3652
+ text: options.text || "",
3653
+ fullscreen: target === document.body && (options.fullscreen ?? true),
3654
+ lock: options.lock ?? false,
3655
+ customClass: options.customClass || "",
3656
+ visible: options.visible ?? true,
3657
+ beforeClose: options.beforeClose,
3658
+ closed: options.closed,
3659
+ target
3660
+ };
3661
+ };
3662
+ const addStyle = async (options, parent, instance) => {
3663
+ const { nextZIndex } = instance.vm.zIndex || instance.vm._.exposed.zIndex;
3664
+ const maskStyle = {};
3665
+ if (options.fullscreen) {
3666
+ instance.originalPosition.value = getStyle(document.body, "position");
3667
+ instance.originalOverflow.value = getStyle(document.body, "overflow");
3668
+ maskStyle.zIndex = nextZIndex();
3669
+ } else if (options.parent === document.body) {
3670
+ instance.originalPosition.value = getStyle(document.body, "position");
3671
+ await nextTick();
3672
+ for (const property of ["top", "left"]) {
3673
+ const scroll = property === "top" ? "scrollTop" : "scrollLeft";
3674
+ maskStyle[property] = `${options.target.getBoundingClientRect()[property] + document.body[scroll] + document.documentElement[scroll] - Number.parseInt(getStyle(document.body, `margin-${property}`), 10)}px`;
3675
+ }
3676
+ for (const property of ["height", "width"]) {
3677
+ maskStyle[property] = `${options.target.getBoundingClientRect()[property]}px`;
3678
+ }
3679
+ } else {
3680
+ instance.originalPosition.value = getStyle(parent, "position");
3681
+ }
3682
+ for (const [key, value] of Object.entries(maskStyle)) {
3683
+ instance.$el.style[key] = value;
3684
+ }
3685
+ };
3686
+ const addClassList = (options, parent, instance) => {
3687
+ const ns = instance.vm.ns || instance.vm._.exposed.ns;
3688
+ if (!["absolute", "fixed", "sticky"].includes(instance.originalPosition.value)) {
3689
+ addClass(parent, ns.bm("parent", "relative"));
3690
+ } else {
3691
+ removeClass(parent, ns.bm("parent", "relative"));
3692
+ }
3693
+ if (options.fullscreen && options.lock) {
3694
+ addClass(parent, ns.bm("parent", "hidden"));
3695
+ } else {
3696
+ removeClass(parent, ns.bm("parent", "hidden"));
3697
+ }
3698
+ };
3699
+ const INSTANCE_KEY = Symbol("ZjhcLoading");
3700
+ const createInstance = (el, binding) => {
3701
+ const vm = binding.instance;
3702
+ const getBindingProp = (key) => isObject$1(binding.value) ? binding.value[key] : void 0;
3703
+ const resolveExpression = (key) => {
3704
+ const data = isString$1(key) && (vm == null ? void 0 : vm[key]) || key;
3705
+ if (data) return ref(data);
3706
+ else return data;
3707
+ };
3708
+ const getProp = (name) => resolveExpression(
3709
+ getBindingProp(name) || el.getAttribute(`element-loading-${hyphenate(name)}`)
3710
+ );
3711
+ const fullscreen = getBindingProp("fullscreen") ?? binding.modifiers.fullscreen;
3712
+ const options = {
3713
+ text: getProp("text"),
3714
+ svg: getProp("svg"),
3715
+ fillColor: getProp("fillColor"),
3716
+ animateColor: getProp("animateColor"),
3717
+ svgViewBox: getProp("svgViewBox"),
3718
+ spinner: getProp("spinner"),
3719
+ background: getProp("background"),
3720
+ customClass: getProp("customClass"),
3721
+ fullscreen,
3722
+ target: getBindingProp("target") ?? (fullscreen ? void 0 : el),
3723
+ body: getBindingProp("body") ?? binding.modifiers.body,
3724
+ lock: getBindingProp("lock") ?? binding.modifiers.lock
3725
+ };
3726
+ el[INSTANCE_KEY] = {
3727
+ options,
3728
+ instance: Loading(options)
3729
+ };
3730
+ };
3731
+ const updateOptions = (newOptions, originalOptions) => {
3732
+ for (const key of Object.keys(originalOptions)) {
3733
+ if (isRef(originalOptions[key]))
3734
+ originalOptions[key].value = newOptions[key];
3735
+ }
3736
+ };
3737
+ const vLoading = {
3738
+ mounted(el, binding) {
3739
+ if (binding.value) {
3740
+ createInstance(el, binding);
3741
+ }
3742
+ },
3743
+ updated(el, binding) {
3744
+ const instance = el[INSTANCE_KEY];
3745
+ if (binding.oldValue !== binding.value) {
3746
+ if (binding.value && !binding.oldValue) {
3747
+ createInstance(el, binding);
3748
+ } else if (binding.value && binding.oldValue) {
3749
+ if (isObject$1(binding.value))
3750
+ updateOptions(binding.value, instance.options);
3751
+ } else {
3752
+ instance == null ? void 0 : instance.instance.close();
3753
+ }
3754
+ }
3755
+ },
3756
+ unmounted(el) {
3757
+ var _a;
3758
+ (_a = el[INSTANCE_KEY]) == null ? void 0 : _a.instance.close();
3759
+ el[INSTANCE_KEY] = null;
3760
+ }
3761
+ };
3762
+ const ZjhcLoading = {
3763
+ install(app) {
3764
+ app.directive("zjhc-loading", vLoading);
3765
+ app.config.globalProperties.$zjhcLoading = vLoading;
3766
+ },
3767
+ directive: vLoading,
3768
+ service: Loading
3769
+ };
3770
+ const compMap = /* @__PURE__ */ new Map();
3771
+ function getComp(name) {
3772
+ const comp = compMap.get(name);
3773
+ if (comp) {
3774
+ return comp;
3775
+ }
3776
+ throw Error(`editTableColumn:没有注册${name}组件`);
3777
+ }
3778
+ function registerComp(name, comp) {
3779
+ if (compMap.has(name)) {
3780
+ throw Error(`editTableColumn:${name}已注册`);
3781
+ }
3782
+ compMap.set(name, comp);
3783
+ }
3784
+ (() => {
3785
+ registerComp("input", ElInput);
3786
+ registerComp("select", ElSelect);
3787
+ })();
3788
+ const _sfc_main = /* @__PURE__ */ defineComponent({
3789
+ ...{
3790
+ name: "ZjhcEditTableColumn"
3791
+ },
3792
+ __name: "EditTableColumn",
3793
+ props: {
3794
+ inputName: { type: String, required: false, default: "input" },
3795
+ inputProps: { type: Object, required: false, default: () => ({}) },
3796
+ inputChild: { type: Array, required: false },
3797
+ isEdit: { type: Boolean, required: false, default: true },
3798
+ selectOptions: { type: Array, required: false }
3799
+ },
3800
+ emits: ["on-change"],
3801
+ setup(__props, { emit: __emit }) {
3802
+ const props = __props;
3803
+ const emits = __emit;
3804
+ const comp = computed(() => getComp(props.inputName));
3805
+ function onChange(val, row) {
3806
+ emits("on-change", val, row);
3807
+ }
3808
+ return (_ctx, _cache) => {
3809
+ const _component_el_option = resolveComponent("el-option");
3810
+ const _component_el_table_column = resolveComponent("el-table-column");
3811
+ return openBlock(), createBlock(_component_el_table_column, normalizeProps(guardReactiveProps(props)), {
3812
+ append: withCtx((scoped) => [
3813
+ renderSlot(_ctx.$slots, "append", normalizeProps(guardReactiveProps(scoped)))
3814
+ ]),
3815
+ default: withCtx((scoped) => [
3816
+ renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(scoped)), () => {
3817
+ var _a;
3818
+ return [
3819
+ !__props.isEdit || !((_a = scoped.row) == null ? void 0 : _a.isEdit) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3820
+ createTextVNode(toDisplayString(unref(defaultRenderCell)(scoped)), 1)
3821
+ ], 64)) : (openBlock(), createBlock(resolveDynamicComponent(comp.value), mergeProps({ key: 1 }, __props.inputProps, {
3822
+ scoped,
3823
+ onChange: (val) => onChange(val, scoped.row),
3824
+ modelValue: scoped.row[scoped.column.property || scoped.column.prop],
3825
+ "onUpdate:modelValue": ($event) => scoped.row[scoped.column.property || scoped.column.prop] = $event
3826
+ }), createSlots({
3827
+ default: withCtx(() => {
3828
+ var _a2;
3829
+ return [
3830
+ __props.inputName == "select" ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(__props.selectOptions, (child, index) => {
3831
+ return openBlock(), createBlock(_component_el_option, {
3832
+ key: index,
3833
+ value: child.value,
3834
+ label: child.label,
3835
+ disabled: child.disabled
3836
+ }, null, 8, ["value", "label", "disabled"]);
3837
+ }), 128)) : createCommentVNode("", true),
3838
+ ((_a2 = __props.inputChild) == null ? void 0 : _a2.length) ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(__props.inputChild, (child, index) => {
3839
+ return openBlock(), createBlock(resolveDynamicComponent(child), { key: index });
3840
+ }), 128)) : createCommentVNode("", true)
3841
+ ];
3842
+ }),
3843
+ _: 2
3844
+ }, [
3845
+ _ctx.$slots.prepend ? {
3846
+ name: "prepend",
3847
+ fn: withCtx(() => [
3848
+ renderSlot(_ctx.$slots, "prepend")
3849
+ ]),
3850
+ key: "0"
3851
+ } : void 0,
3852
+ _ctx.$slots.append ? {
3853
+ name: "append",
3854
+ fn: withCtx(() => [
3855
+ renderSlot(_ctx.$slots, "append")
3856
+ ]),
3857
+ key: "1"
3858
+ } : void 0
3859
+ ]), 1040, ["scoped", "onChange", "modelValue", "onUpdate:modelValue"]))
3860
+ ];
3861
+ })
3862
+ ]),
3863
+ filterIcon: withCtx((scoped) => [
3864
+ renderSlot(_ctx.$slots, "filterIcon", normalizeProps(guardReactiveProps(scoped)))
3865
+ ]),
3866
+ _: 3
3867
+ }, 16);
3868
+ };
3869
+ }
3870
+ });
3871
+ const ZjhcEditTableColumn = withInstall(_sfc_main);
3872
+ const Components = [
3873
+ ZjhcSearchPanel,
3874
+ ZjhcSearchPanelLayout,
3875
+ ZjhcSearchLayout,
3876
+ ZjhcCollapsePanel,
3877
+ ZjhcCollapseContainer,
3878
+ ZjhcStickyToolbar,
3879
+ ZjhcGroupContainer,
3880
+ ZjhcTableToolbar,
3881
+ ZjhcDialog,
3882
+ ZjhcComplexTable,
3883
+ ZjhcAutocomplete,
3884
+ ZjhcEditTableColumn,
3885
+ ZjhcLoading
3886
+ ];
3887
+ const Plugins = [];
3888
+ const installer = makeInstaller([...Components, ...Plugins]);
3889
+ const SuccessResultCode = "0";
3890
+ const WarningResultCode = "9";
3891
+ const SystemFailResultCode = "-1";
3892
+ function getOperationType(type) {
3893
+ if (type === "save") {
3894
+ return "保存";
3895
+ } else if (type === "delete") {
3896
+ return "删除";
3897
+ } else if (type === "suspend") {
3898
+ return "挂起";
3899
+ } else if (type === "back") {
3900
+ return "退回";
3901
+ } else if (type === "reject") {
3902
+ return "驳回";
3903
+ } else if (type === "agree") {
3904
+ return "审批";
3905
+ } else if (type === "revoke") {
3906
+ return "撤回";
3907
+ } else {
3908
+ return "未知";
3909
+ }
3910
+ }
3911
+ const install = installer.install;
3912
+ const version = installer.version;
3913
+ export {
3914
+ CHANGE_EVENT,
3915
+ EVENT_CODE,
3916
+ INPUT_EVENT,
3917
+ INSTALLED_KEY,
3918
+ SuccessResultCode,
3919
+ SystemFailResultCode,
3920
+ UPDATE_MODEL_EVENT,
3921
+ WEEK_DAYS,
3922
+ WarningResultCode,
3923
+ ZjhcAutocomplete,
3924
+ ZjhcCollapseContainer,
3925
+ ZjhcCollapsePanel,
3926
+ ZjhcComplexTable,
3927
+ ZjhcDialog,
3928
+ ZjhcEditTableColumn,
3929
+ ZjhcGroupContainer,
3930
+ ZjhcLoading,
3931
+ vLoading as ZjhcLoadingDirective,
3932
+ Loading as ZjhcLoadingService,
3933
+ ZjhcSearchLayout,
3934
+ ZjhcSearchPanel,
3935
+ ZjhcSearchPanelLayout,
3936
+ ZjhcStickyToolbar,
3937
+ ZjhcTableToolbar,
3938
+ addClass,
3939
+ addUnit,
3940
+ autocompleteEmits,
3941
+ autocompleteProps,
3942
+ classNameToArray,
3943
+ componentSizeMap,
3944
+ componentSizes,
3945
+ datePickTypes,
3946
+ installer as default,
3947
+ defaultNamespace,
3948
+ deserialize,
3949
+ dialogEmits,
3950
+ dialogProps,
3951
+ getOperationType,
3952
+ getStyle,
3953
+ hasClass,
3954
+ install,
3955
+ isArray,
3956
+ isBlob,
3957
+ isFile,
3958
+ isFunction,
3959
+ isNumber$1 as isNumber,
3960
+ isObject,
3961
+ isRegExp,
3962
+ isString,
3963
+ isStringNumber,
3964
+ isWindow,
3965
+ makeInstaller,
3966
+ registerComp,
3967
+ removeClass,
3968
+ removeStyle,
3969
+ serialize,
3970
+ setStyle,
3971
+ setTheme,
3972
+ throwError,
3973
+ toTree,
3974
+ useComplexTable,
3975
+ useDraggableAndResizable,
3976
+ useLoading,
3977
+ useNamespace,
3978
+ useOperModal,
3979
+ vLoading as vZjhcLoading,
3980
+ version,
3981
+ withInstall,
3982
+ withInstallDirective,
3983
+ withInstallFunction,
3984
+ withNoopInstall
3985
+ };