hy-dispatch-ui-v3 0.1.5 → 0.2.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 (174) hide show
  1. package/README.md +47 -0
  2. package/dist/tailwind.css +408 -4
  3. package/es/components/appAudioPlayer/appAudioPlayer.vue.mjs +462 -0
  4. package/es/components/appAudioPlayer/index.mjs +6 -0
  5. package/es/components/appAudioPlayer/js/index.mjs +327 -0
  6. package/es/components/appAudioPlayer/style/appAudioPlayer.scss +319 -0
  7. package/es/components/appButton/style/appButton.scss +0 -1
  8. package/es/components/appConfigProvider/appConfigProvider.vue.mjs +25 -4
  9. package/es/components/appConfirmDialog/appConfirmDialog.vue.mjs +3 -3
  10. package/es/components/appConfirmDialog/appConfirmMethod.mjs +13 -13
  11. package/es/components/appCutter/appCutter.vue.mjs +358 -0
  12. package/es/components/appCutter/index.mjs +6 -0
  13. package/es/components/appCutter/style/appCutter.scss +51 -0
  14. package/es/components/appDatePicker/appDatePicker.vue.mjs +1 -1
  15. package/es/components/appDialog/appDialog.vue.mjs +205 -0
  16. package/es/components/appDialog/index.mjs +6 -0
  17. package/es/components/appDialog/style/appDialog.scss +0 -0
  18. package/es/components/appForm/appForm.vue.mjs +132 -209
  19. package/es/components/appForm/cpns/appFormItem.vue.mjs +312 -0
  20. package/es/components/appForm/cpns/arrayItem.vue.mjs +305 -0
  21. package/es/components/appForm/cpns/extraItem.vue.mjs +140 -0
  22. package/es/components/appForm/js/index.mjs +46 -24
  23. package/es/components/appForm/js/useAppForm.mjs +30 -6
  24. package/es/components/appForm/style/appForm.scss +53 -0
  25. package/es/components/appIcon/appIcon.vue.mjs +2 -1
  26. package/es/components/appIconBox/style/appIconBox.scss +0 -1
  27. package/es/components/appInput/appInput.vue.mjs +99 -0
  28. package/es/components/appInput/index.mjs +6 -0
  29. package/es/components/appMenu/appMenu.vue.mjs +129 -0
  30. package/es/components/appMenu/index.mjs +6 -0
  31. package/es/components/appMenu/style/appMenu.scss +145 -0
  32. package/es/components/appOrgCascader/appOrgCascader.vue.mjs +14 -10
  33. package/es/components/appSearch/appSearch.vue.mjs +55 -211
  34. package/es/components/appSearch/cpns/appSearchItem.vue.mjs +238 -0
  35. package/es/components/appSearch/js/index.mjs +20 -8
  36. package/es/components/appSearch/js/useAppSearch.mjs +10 -5
  37. package/es/components/appSearch/style/appSearch.scss +10 -0
  38. package/es/components/appTable/appTable.vue.mjs +313 -159
  39. package/es/components/appTable/cpns/columnSelect.vue.mjs +151 -156
  40. package/es/components/appTable/cpns/columnSelectItem.vue2.mjs +104 -110
  41. package/es/components/appTable/cpns/headerItem.vue.mjs +98 -0
  42. package/es/components/appTable/cpns/virtualTable.vue.mjs +560 -0
  43. package/es/components/appTable/js/index.mjs +46 -20
  44. package/es/components/appTable/js/search.mjs +1 -2
  45. package/es/components/appTable/js/useAppTable.mjs +58 -14
  46. package/es/components/appTable/style/appTable.scss +16 -0
  47. package/es/components/appTooltip/appTooltip.vue.mjs +24 -13
  48. package/es/components/appTree/appTree.vue.mjs +304 -0
  49. package/es/components/appTree/index.mjs +6 -0
  50. package/es/components/appTree/js/index.mjs +531 -0
  51. package/es/components/appUserAvatar/appUserAvatar.vue.mjs +9 -8
  52. package/es/components/appUserAvatar/style/appUserAvatar.scss +0 -1
  53. package/es/components/appVideoPlayer/appVideoPlayer.vue.mjs +647 -0
  54. package/es/components/appVideoPlayer/cpns/mediaLoading.vue.mjs +35 -0
  55. package/es/components/appVideoPlayer/index.mjs +6 -0
  56. package/es/components/appVideoPlayer/js/index.mjs +426 -0
  57. package/es/components/appVideoPlayer/style/appVideoPlayer.scss +275 -0
  58. package/es/components/appVideoPlayer/style/mediaLoading.scss +62 -0
  59. package/es/components/index.mjs +7 -0
  60. package/es/hooks/index.mjs +3 -0
  61. package/es/hooks/useApi.mjs +7 -3
  62. package/es/hooks/useAudioPlayerConfig.mjs +12 -0
  63. package/es/hooks/useGlobalConfig.mjs +20 -9
  64. package/es/hooks/useLocale.mjs +10 -8
  65. package/es/hooks/useMixins.mjs +1 -1
  66. package/es/hooks/usePermissionMap.mjs +12 -0
  67. package/es/hooks/useUserAvatarMap.mjs +6 -3
  68. package/es/hooks/useVideoPlayerConfig.mjs +12 -0
  69. package/es/index.mjs +16 -3
  70. package/es/locale/en.mjs +58 -4
  71. package/es/locale/zh_CN.mjs +56 -6
  72. package/es/make-installer.mjs +2 -0
  73. package/es/static/hy-svg-icons.js +462 -0
  74. package/es/static/protocolcheck.js +247 -0
  75. package/es/style/element/element.scss +9 -0
  76. package/es/style/element/index.scss +6 -3
  77. package/es/style/index.scss +11 -0
  78. package/es/style/theme.scss +73 -0
  79. package/es/utils/date.mjs +25 -1
  80. package/es/utils/file.mjs +69 -0
  81. package/es/utils/form.mjs +52 -0
  82. package/es/utils/handler.mjs +22 -2
  83. package/es/utils/index.mjs +6 -3
  84. package/es/utils/is.mjs +26 -2
  85. package/es/utils/loadScript.mjs +33 -0
  86. package/es/version.mjs +1 -1
  87. package/lib/components/appAudioPlayer/appAudioPlayer.vue.js +466 -0
  88. package/lib/components/appAudioPlayer/index.js +11 -0
  89. package/lib/components/appAudioPlayer/js/index.js +329 -0
  90. package/lib/components/appAudioPlayer/style/appAudioPlayer.scss +319 -0
  91. package/lib/components/appButton/style/appButton.scss +0 -1
  92. package/lib/components/appConfigProvider/appConfigProvider.vue.js +23 -2
  93. package/lib/components/appConfirmDialog/appConfirmDialog.vue.js +3 -3
  94. package/lib/components/appConfirmDialog/appConfirmMethod.js +13 -13
  95. package/lib/components/appCutter/appCutter.vue.js +362 -0
  96. package/lib/components/appCutter/index.js +11 -0
  97. package/lib/components/appCutter/style/appCutter.scss +51 -0
  98. package/lib/components/appDatePicker/appDatePicker.vue.js +1 -1
  99. package/lib/components/appDialog/appDialog.vue.js +209 -0
  100. package/lib/components/appDialog/index.js +11 -0
  101. package/lib/components/appDialog/style/appDialog.scss +0 -0
  102. package/lib/components/appForm/appForm.vue.js +129 -206
  103. package/lib/components/appForm/cpns/appFormItem.vue.js +316 -0
  104. package/lib/components/appForm/cpns/arrayItem.vue.js +309 -0
  105. package/lib/components/appForm/cpns/extraItem.vue.js +144 -0
  106. package/lib/components/appForm/js/index.js +48 -23
  107. package/lib/components/appForm/js/useAppForm.js +30 -6
  108. package/lib/components/appForm/style/appForm.scss +53 -0
  109. package/lib/components/appIcon/appIcon.vue.js +2 -1
  110. package/lib/components/appIconBox/style/appIconBox.scss +0 -1
  111. package/lib/components/appInput/appInput.vue.js +103 -0
  112. package/lib/components/appInput/index.js +11 -0
  113. package/lib/components/appMenu/appMenu.vue.js +133 -0
  114. package/lib/components/appMenu/index.js +11 -0
  115. package/lib/components/appMenu/style/appMenu.scss +145 -0
  116. package/lib/components/appOrgCascader/appOrgCascader.vue.js +14 -10
  117. package/lib/components/appSearch/appSearch.vue.js +51 -207
  118. package/lib/components/appSearch/cpns/appSearchItem.vue.js +242 -0
  119. package/lib/components/appSearch/js/index.js +20 -7
  120. package/lib/components/appSearch/js/useAppSearch.js +10 -5
  121. package/lib/components/appSearch/style/appSearch.scss +10 -0
  122. package/lib/components/appTable/appTable.vue.js +320 -166
  123. package/lib/components/appTable/cpns/columnSelect.vue.js +151 -156
  124. package/lib/components/appTable/cpns/columnSelectItem.vue2.js +105 -111
  125. package/lib/components/appTable/cpns/headerItem.vue.js +102 -0
  126. package/lib/components/appTable/cpns/virtualTable.vue.js +564 -0
  127. package/lib/components/appTable/js/index.js +47 -19
  128. package/lib/components/appTable/js/search.js +1 -2
  129. package/lib/components/appTable/js/useAppTable.js +57 -13
  130. package/lib/components/appTable/style/appTable.scss +16 -0
  131. package/lib/components/appTooltip/appTooltip.vue.js +23 -12
  132. package/lib/components/appTree/appTree.vue.js +308 -0
  133. package/lib/components/appTree/index.js +11 -0
  134. package/lib/components/appTree/js/index.js +533 -0
  135. package/lib/components/appUserAvatar/appUserAvatar.vue.js +9 -8
  136. package/lib/components/appUserAvatar/style/appUserAvatar.scss +0 -1
  137. package/lib/components/appVideoPlayer/appVideoPlayer.vue.js +651 -0
  138. package/lib/components/appVideoPlayer/cpns/mediaLoading.vue.js +39 -0
  139. package/lib/components/appVideoPlayer/index.js +11 -0
  140. package/lib/components/appVideoPlayer/js/index.js +429 -0
  141. package/lib/components/appVideoPlayer/style/appVideoPlayer.scss +275 -0
  142. package/lib/components/appVideoPlayer/style/mediaLoading.scss +62 -0
  143. package/lib/components/index.js +42 -28
  144. package/lib/hooks/index.js +9 -0
  145. package/lib/hooks/useApi.js +7 -3
  146. package/lib/hooks/useAudioPlayerConfig.js +15 -0
  147. package/lib/hooks/useGlobalConfig.js +18 -7
  148. package/lib/hooks/useLocale.js +9 -7
  149. package/lib/hooks/useMixins.js +1 -1
  150. package/lib/hooks/usePermissionMap.js +15 -0
  151. package/lib/hooks/useUserAvatarMap.js +5 -2
  152. package/lib/hooks/useVideoPlayerConfig.js +15 -0
  153. package/lib/index.js +70 -28
  154. package/lib/locale/en.js +58 -4
  155. package/lib/locale/zh_CN.js +56 -6
  156. package/lib/make-installer.js +2 -0
  157. package/lib/static/hy-svg-icons.js +459 -8
  158. package/lib/static/protocolcheck.js +249 -0
  159. package/lib/style/element/element.scss +9 -0
  160. package/lib/style/element/index.scss +6 -3
  161. package/lib/style/index.scss +11 -0
  162. package/lib/style/theme.scss +73 -0
  163. package/lib/utils/date.js +25 -0
  164. package/lib/utils/file.js +76 -0
  165. package/lib/utils/form.js +57 -0
  166. package/lib/utils/handler.js +22 -1
  167. package/lib/utils/index.js +19 -0
  168. package/lib/utils/is.js +27 -1
  169. package/lib/utils/loadScript.js +37 -0
  170. package/lib/version.js +1 -1
  171. package/package.json +13 -12
  172. package/es/config/index.mjs +0 -1
  173. package/es/static/hy-svg-icons.mjs +0 -11
  174. package/lib/config/index.js +0 -2
@@ -0,0 +1,316 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+ var elementPlus = require('element-plus');
7
+ var iconsVue = require('@element-plus/icons-vue');
8
+ var index$3 = require('../../appDatePicker/index.js');
9
+ var index$4 = require('../../appOrgCascader/index.js');
10
+ var index = require('../js/index.js');
11
+ var form = require('../../../utils/form.js');
12
+ var index$1 = require('../../appTooltip/index.js');
13
+ var index$2 = require('../../appInput/index.js');
14
+ var is = require('../../../utils/is.js');
15
+ var handler = require('../../../utils/handler.js');
16
+
17
+ const _sfc_main = {
18
+ __name: "appFormItem",
19
+ props: {
20
+ model: {
21
+ type: Object,
22
+ default: () => ({})
23
+ },
24
+ column: {
25
+ type: Object,
26
+ default: () => ({})
27
+ },
28
+ parentProp: {
29
+ type: String
30
+ },
31
+ index: {
32
+ type: Number
33
+ },
34
+ loading: {
35
+ type: Boolean,
36
+ default: false
37
+ },
38
+ readonly: {
39
+ type: Boolean,
40
+ default: false
41
+ }
42
+ },
43
+ setup(__props) {
44
+ const props = __props;
45
+ const columnProp = vue.computed(() => {
46
+ let field = is.isArray(props.column.field) ? props.column.field[0] : props.column.field;
47
+ if (props.parentProp) {
48
+ field = [props.parentProp, props.index, field];
49
+ }
50
+ return field;
51
+ });
52
+ const bindValue = vue.computed({
53
+ get() {
54
+ const prop = is.isArray(props.column.field) ? props.column.field[0] : props.column.field;
55
+ return form.getValueByProp(props.model, prop);
56
+ },
57
+ set(val) {
58
+ const prop = is.isArray(props.column.field) ? props.column.field[0] : props.column.field;
59
+ form.setValueByProp(props.model, prop, val);
60
+ }
61
+ });
62
+ const bindValue2 = vue.computed({
63
+ get() {
64
+ const prop = is.isArray(props.column.field) ? props.column.field[1] : props.column.field;
65
+ return form.getValueByProp(props.model, prop);
66
+ },
67
+ set(val) {
68
+ const prop = is.isArray(props.column.field) ? props.column.field[1] : props.column.field;
69
+ form.setValueByProp(props.model, prop, val);
70
+ }
71
+ });
72
+ function onChangeHandler(...args) {
73
+ const { onChange } = props.column;
74
+ if (!onChange) return;
75
+ onChange(props.column, props.model);
76
+ }
77
+ return (_ctx, _cache) => {
78
+ return vue.unref(index.columnShowHandler)(props, __props.column) ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElFormItem), {
79
+ key: 0,
80
+ rules: __props.column.rules,
81
+ prop: columnProp.value,
82
+ style: vue.normalizeStyle(vue.unref(index.columnItemStyle)(props, __props.column))
83
+ }, {
84
+ default: vue.withCtx(() => [
85
+ vue.createCommentVNode(" \u8868\u5355\u9879label "),
86
+ vue.createElementVNode("div", { class: "w-full flex justify-between text-main" }, [
87
+ vue.createElementVNode("div", { class: "flex items-center" }, [
88
+ vue.renderSlot(_ctx.$slots, __props.column.labelSlot, {
89
+ column: __props.column,
90
+ model: __props.model,
91
+ required: vue.unref(index.isRequired)(props, __props.column)
92
+ }, () => [
93
+ vue.createElementVNode(
94
+ "span",
95
+ { class: "text-main" },
96
+ vue.toDisplayString(__props.column.label),
97
+ 1
98
+ /* TEXT */
99
+ )
100
+ ]),
101
+ vue.unref(index.isRequired)(props, __props.column) ? (vue.openBlock(), vue.createElementBlock("span", {
102
+ key: 0,
103
+ class: "label-required"
104
+ })) : vue.createCommentVNode("v-if", true),
105
+ vue.unref(handler.funRunHandler)(__props.column.help) ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.AppTooltip), {
106
+ key: 1,
107
+ "is-always": "",
108
+ content: vue.unref(handler.funRunHandler)(__props.column.help)
109
+ }, {
110
+ default: vue.withCtx(() => [
111
+ vue.createVNode(vue.unref(elementPlus.ElIcon), {
112
+ size: "14",
113
+ color: "rgba(var(--hy-theme))",
114
+ class: "ml-1.5"
115
+ }, {
116
+ default: vue.withCtx(() => [
117
+ vue.createVNode(vue.unref(iconsVue.QuestionFilled))
118
+ ]),
119
+ _: 1
120
+ /* STABLE */
121
+ })
122
+ ]),
123
+ _: 1
124
+ /* STABLE */
125
+ }, 8, ["content"])) : vue.createCommentVNode("v-if", true)
126
+ ]),
127
+ __props.column.rightSlot && _ctx.$slots[__props.column.rightSlot] ? (vue.openBlock(), vue.createElementBlock("div", {
128
+ key: 0,
129
+ class: "ml-2"
130
+ }, [
131
+ vue.renderSlot(_ctx.$slots, __props.column.rightSlot, {
132
+ column: __props.column,
133
+ model: __props.model,
134
+ required: vue.unref(index.isRequired)(props, __props.column)
135
+ })
136
+ ])) : vue.createCommentVNode("v-if", true)
137
+ ]),
138
+ vue.createCommentVNode(" \u5185\u5BB9\u4EC5\u67E5\u770B "),
139
+ __props.column.readonly || __props.readonly || !__props.column.type && !__props.column.slot ? (vue.openBlock(), vue.createElementBlock("div", {
140
+ key: 0,
141
+ class: "w-full text-main h-[32px]"
142
+ }, [
143
+ vue.unref(index.renderText)(props, __props.column) ? (vue.openBlock(), vue.createElementBlock(
144
+ "span",
145
+ { key: 0 },
146
+ vue.toDisplayString(vue.unref(index.renderText)(props, __props.column)),
147
+ 1
148
+ /* TEXT */
149
+ )) : (vue.openBlock(), vue.createElementBlock("span", {
150
+ key: 1,
151
+ class: "text-auxiliary"
152
+ }, "- -"))
153
+ ])) : (vue.openBlock(), vue.createElementBlock(
154
+ vue.Fragment,
155
+ { key: 1 },
156
+ [
157
+ vue.createCommentVNode(" \u81EA\u5B9A\u4E49\u5177\u540D\u63D2\u69FD "),
158
+ __props.column.slot && _ctx.$slots[__props.column.slot] ? vue.renderSlot(_ctx.$slots, __props.column.slot, {
159
+ key: 0,
160
+ column: __props.column,
161
+ model: __props.model,
162
+ required: vue.unref(index.isRequired)(props, __props.column)
163
+ }) : __props.column.type === "input" ? (vue.openBlock(), vue.createElementBlock(
164
+ vue.Fragment,
165
+ { key: 1 },
166
+ [
167
+ vue.createCommentVNode(" \u8F93\u5165\u6846 "),
168
+ vue.createVNode(vue.unref(index$2.AppInput), vue.mergeProps({
169
+ modelValue: bindValue.value,
170
+ "onUpdate:modelValue": ($event) => bindValue.value = $event
171
+ }, __props.column.attrs, {
172
+ disabled: vue.unref(index.isDisabled)(props, __props.column),
173
+ onChange: onChangeHandler
174
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])
175
+ ],
176
+ 2112
177
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
178
+ )) : __props.column.type === "select" ? (vue.openBlock(), vue.createElementBlock(
179
+ vue.Fragment,
180
+ { key: 2 },
181
+ [
182
+ vue.createCommentVNode(" \u9009\u62E9\u6846 "),
183
+ vue.createVNode(vue.unref(elementPlus.ElSelect), vue.mergeProps({
184
+ modelValue: bindValue.value,
185
+ "onUpdate:modelValue": ($event) => bindValue.value = $event
186
+ }, __props.column.attrs, {
187
+ disabled: vue.unref(index.isDisabled)(props, __props.column),
188
+ options: vue.unref(index.optionsHandler)(props, __props.column),
189
+ onChange: onChangeHandler
190
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "options"])
191
+ ],
192
+ 2112
193
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
194
+ )) : __props.column.type === "date-picker" ? (vue.openBlock(), vue.createElementBlock(
195
+ vue.Fragment,
196
+ { key: 3 },
197
+ [
198
+ vue.createCommentVNode(" \u65E5\u671F\u9009\u62E9\u6846 "),
199
+ ["datetimerange", "daterange", "monthrange", "yearrange"].includes(
200
+ __props.column.attrs?.type
201
+ ) && vue.unref(is.isArray)(__props.column.field) ? (vue.openBlock(), vue.createBlock(vue.unref(index$3.AppDatePicker), vue.mergeProps({
202
+ key: 0,
203
+ start: bindValue.value,
204
+ "onUpdate:start": ($event) => bindValue.value = $event,
205
+ end: bindValue2.value,
206
+ "onUpdate:end": ($event) => bindValue2.value = $event,
207
+ "is-range": true,
208
+ style: { "width": "100%" }
209
+ }, __props.column.attrs, {
210
+ disabled: vue.unref(index.isDisabled)(props, __props.column),
211
+ onChange: onChangeHandler
212
+ }), null, 16, ["start", "onUpdate:start", "end", "onUpdate:end", "disabled"])) : (vue.openBlock(), vue.createBlock(vue.unref(index$3.AppDatePicker), vue.mergeProps({
213
+ key: 1,
214
+ modelValue: bindValue.value,
215
+ "onUpdate:modelValue": ($event) => bindValue.value = $event,
216
+ "is-range": false,
217
+ style: { "width": "100%" }
218
+ }, __props.column.attrs, {
219
+ disabled: vue.unref(index.isDisabled)(props, __props.column),
220
+ onChange: onChangeHandler
221
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"]))
222
+ ],
223
+ 64
224
+ /* STABLE_FRAGMENT */
225
+ )) : __props.column.type === "radio" ? (vue.openBlock(), vue.createElementBlock(
226
+ vue.Fragment,
227
+ { key: 4 },
228
+ [
229
+ vue.createCommentVNode(" \u5355\u9009 "),
230
+ vue.createVNode(vue.unref(elementPlus.ElRadioGroup), vue.mergeProps({
231
+ modelValue: bindValue.value,
232
+ "onUpdate:modelValue": ($event) => bindValue.value = $event
233
+ }, __props.column.attrs, {
234
+ disabled: vue.unref(index.isDisabled)(props, __props.column),
235
+ options: vue.unref(index.optionsHandler)(props, __props.column),
236
+ onChange: onChangeHandler
237
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "options"])
238
+ ],
239
+ 2112
240
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
241
+ )) : __props.column.type === "checkbox" ? (vue.openBlock(), vue.createElementBlock(
242
+ vue.Fragment,
243
+ { key: 5 },
244
+ [
245
+ vue.createCommentVNode(" \u591A\u9009 "),
246
+ vue.createVNode(vue.unref(elementPlus.ElCheckboxGroup), vue.mergeProps({
247
+ modelValue: bindValue.value,
248
+ "onUpdate:modelValue": ($event) => bindValue.value = $event
249
+ }, __props.column.attrs, {
250
+ disabled: vue.unref(index.isDisabled)(props, __props.column),
251
+ options: vue.unref(index.optionsHandler)(props, __props.column),
252
+ onChange: onChangeHandler
253
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "options"])
254
+ ],
255
+ 2112
256
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
257
+ )) : __props.column.type === "switch" ? (vue.openBlock(), vue.createElementBlock(
258
+ vue.Fragment,
259
+ { key: 6 },
260
+ [
261
+ vue.createCommentVNode(" \u5F00\u5173 "),
262
+ vue.createVNode(vue.unref(elementPlus.ElSwitch), vue.mergeProps({
263
+ modelValue: bindValue.value,
264
+ "onUpdate:modelValue": ($event) => bindValue.value = $event
265
+ }, __props.column.attrs, {
266
+ disabled: vue.unref(index.isDisabled)(props, __props.column),
267
+ onChange: onChangeHandler
268
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])
269
+ ],
270
+ 2112
271
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
272
+ )) : __props.column.type === "input-number" ? (vue.openBlock(), vue.createElementBlock(
273
+ vue.Fragment,
274
+ { key: 7 },
275
+ [
276
+ vue.createCommentVNode(" \u6570\u5B57\u8F93\u5165\u6846 "),
277
+ vue.createVNode(vue.unref(elementPlus.ElInputNumber), vue.mergeProps({
278
+ modelValue: bindValue.value,
279
+ "onUpdate:modelValue": ($event) => bindValue.value = $event
280
+ }, __props.column.attrs, {
281
+ disabled: vue.unref(index.isDisabled)(props, __props.column),
282
+ onChange: onChangeHandler
283
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])
284
+ ],
285
+ 2112
286
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
287
+ )) : __props.column.type === "org-cascader" ? (vue.openBlock(), vue.createElementBlock(
288
+ vue.Fragment,
289
+ { key: 8 },
290
+ [
291
+ vue.createCommentVNode(" \u90E8\u95E8\u7EA7\u8054\u9009\u62E9\u6846 "),
292
+ vue.createVNode(vue.unref(index$4.AppOrgCascader), vue.mergeProps({
293
+ modelValue: bindValue.value,
294
+ "onUpdate:modelValue": ($event) => bindValue.value = $event,
295
+ class: "w-full"
296
+ }, __props.column.attrs, {
297
+ disabled: vue.unref(index.isDisabled)(props, __props.column),
298
+ onChange: onChangeHandler
299
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])
300
+ ],
301
+ 2112
302
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
303
+ )) : vue.createCommentVNode("v-if", true)
304
+ ],
305
+ 64
306
+ /* STABLE_FRAGMENT */
307
+ ))
308
+ ]),
309
+ _: 3
310
+ /* FORWARDED */
311
+ }, 8, ["rules", "prop", "style"])) : vue.createCommentVNode("v-if", true);
312
+ };
313
+ }
314
+ };
315
+
316
+ exports.default = _sfc_main;
@@ -0,0 +1,309 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+ var elementPlus = require('element-plus');
7
+ var iconsVue = require('@element-plus/icons-vue');
8
+ var index = require('../js/index.js');
9
+ var appFormItem = require('./appFormItem.vue.js');
10
+ var useAppForm = require('../js/useAppForm.js');
11
+ var useLocale = require('../../../hooks/useLocale.js');
12
+ var form = require('../../../utils/form.js');
13
+ var is = require('../../../utils/is.js');
14
+ var handler = require('../../../utils/handler.js');
15
+ var index$1 = require('../../appTooltip/index.js');
16
+
17
+ const _sfc_main = {
18
+ __name: "arrayItem",
19
+ props: {
20
+ model: {
21
+ type: Object,
22
+ default: () => ({})
23
+ },
24
+ column: {
25
+ type: Object,
26
+ default: () => ({})
27
+ },
28
+ columnNum: {
29
+ type: Number,
30
+ default: 1
31
+ },
32
+ loading: {
33
+ type: Boolean,
34
+ default: false
35
+ },
36
+ readonly: {
37
+ type: Boolean,
38
+ default: false
39
+ },
40
+ size: {
41
+ type: String,
42
+ default: "default"
43
+ }
44
+ },
45
+ setup(__props) {
46
+ const props = __props;
47
+ const { t } = useLocale.useLocale();
48
+ const bindValue = vue.computed({
49
+ get() {
50
+ const prop = props.column.field;
51
+ return form.getValueByProp(props.model, prop);
52
+ },
53
+ set(val) {
54
+ const prop = props.column.field;
55
+ form.setValueByProp(props.model, prop, val);
56
+ }
57
+ });
58
+ const containerRef = vue.useTemplateRef("containerRef");
59
+ vue.ref(0);
60
+ vue.ref(false);
61
+ vue.ref(null);
62
+ const containerStyle = vue.computed(() => {
63
+ const columnNum = is.isNumber(props.column.columnNum) && props.column.columnNum > 0 ? props.column.columnNum : is.isNumber(props.columnNum) && props.columnNum > 0 ? props.columnNum || 1 : 1;
64
+ return {
65
+ gridTemplateColumns: `repeat(${columnNum}, minmax(0, 1fr))`
66
+ };
67
+ });
68
+ function onAddItemHandler() {
69
+ if (!is.isArray(bindValue.value)) {
70
+ bindValue.value = [];
71
+ }
72
+ bindValue.value.push(useAppForm.resetAppFormValue(props.column.children));
73
+ }
74
+ function onDeleteItemHandler(index) {
75
+ bindValue.value.splice(index, 1);
76
+ }
77
+ function onSwapItemHandler(index, index2) {
78
+ const list = bindValue.value;
79
+ list[index] = list.splice(index2, 1, list[index])[0];
80
+ }
81
+ return (_ctx, _cache) => {
82
+ const _component_QuestionFilled = vue.resolveComponent("QuestionFilled");
83
+ return vue.openBlock(), vue.createElementBlock("div", null, [
84
+ vue.createElementVNode(
85
+ "div",
86
+ {
87
+ class: vue.normalizeClass(["w-full flex justify-between text-main", [__props.size === "small" ? "text-xs" : "text-sm"]])
88
+ },
89
+ [
90
+ vue.createElementVNode("div", { class: "flex items-center" }, [
91
+ vue.renderSlot(_ctx.$slots, __props.column.labelSlot, {
92
+ column: __props.column,
93
+ model: __props.model,
94
+ required: vue.unref(index.isRequired)(props, __props.column)
95
+ }, () => [
96
+ vue.createElementVNode(
97
+ "span",
98
+ { class: "text-main" },
99
+ vue.toDisplayString(__props.column.label),
100
+ 1
101
+ /* TEXT */
102
+ )
103
+ ]),
104
+ vue.unref(handler.funRunHandler)(__props.column.help) ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.AppTooltip), {
105
+ key: 0,
106
+ "is-always": "",
107
+ content: vue.unref(handler.funRunHandler)(__props.column.help)
108
+ }, {
109
+ default: vue.withCtx(() => [
110
+ vue.createVNode(vue.unref(elementPlus.ElIcon), {
111
+ size: "14",
112
+ color: "rgba(var(--hy-theme))",
113
+ class: "ml-1.5"
114
+ }, {
115
+ default: vue.withCtx(() => [
116
+ vue.createVNode(_component_QuestionFilled)
117
+ ]),
118
+ _: 1
119
+ /* STABLE */
120
+ })
121
+ ]),
122
+ _: 1
123
+ /* STABLE */
124
+ }, 8, ["content"])) : vue.createCommentVNode("v-if", true)
125
+ ]),
126
+ __props.column.rightSlot && _ctx.$slots[__props.column.rightSlot] ? (vue.openBlock(), vue.createElementBlock("div", {
127
+ key: 0,
128
+ class: "ml-2"
129
+ }, [
130
+ vue.renderSlot(_ctx.$slots, __props.column.rightSlot, {
131
+ column: __props.column,
132
+ model: __props.model,
133
+ required: vue.unref(index.isRequired)(props, __props.column)
134
+ })
135
+ ])) : vue.createCommentVNode("v-if", true)
136
+ ],
137
+ 2
138
+ /* CLASS */
139
+ ),
140
+ vue.createElementVNode(
141
+ "div",
142
+ {
143
+ class: "overflow-y-auto scroll-body",
144
+ style: vue.normalizeStyle({ maxHeight: `${__props.column.height || 500}px` })
145
+ },
146
+ [
147
+ (vue.openBlock(true), vue.createElementBlock(
148
+ vue.Fragment,
149
+ null,
150
+ vue.renderList(bindValue.value, (item, index$1) => {
151
+ return vue.openBlock(), vue.createElementBlock(
152
+ "div",
153
+ {
154
+ key: index$1,
155
+ class: vue.normalizeClass(["bg-background-2 rounded-[6px] border border-border my-1.5", [__props.size === "small" ? "px-4 pt-2" : " pt-3 px-5"]])
156
+ },
157
+ [
158
+ vue.createElementVNode("div", { class: "flex items-center min-h-[36px]" }, [
159
+ vue.createElementVNode("div", { class: "flex items-center gap-2 text-xs" }, [
160
+ vue.createElementVNode(
161
+ "div",
162
+ { class: "w-4 h-4 rounded-full border-[2px] border-theme text-theme font-bold flex items-center justify-center" },
163
+ vue.toDisplayString(index$1 + 1),
164
+ 1
165
+ /* TEXT */
166
+ ),
167
+ vue.renderSlot(_ctx.$slots, __props.column.itemLabelSlot, {
168
+ column: __props.column,
169
+ index: index$1
170
+ }, () => [
171
+ vue.createElementVNode(
172
+ "span",
173
+ { class: "text-auxiliary" },
174
+ vue.toDisplayString(vue.unref(index.renderArrayItemLabel)(props, __props.column, index$1)),
175
+ 1
176
+ /* TEXT */
177
+ )
178
+ ])
179
+ ]),
180
+ vue.createElementVNode("div", { class: "flex items-center gap-3 ml-auto" }, [
181
+ bindValue.value.length > 1 || props.column.emptyChildren ? (vue.openBlock(), vue.createElementBlock("div", {
182
+ key: 0,
183
+ class: "clickBox bg-background py-0.5 px-1.5 rounded",
184
+ onClick: ($event) => onDeleteItemHandler(index$1)
185
+ }, [
186
+ vue.createVNode(vue.unref(elementPlus.ElIcon), {
187
+ size: "14",
188
+ color: "rgb(var(--hy-danger-2))"
189
+ }, {
190
+ default: vue.withCtx(() => [
191
+ vue.createVNode(vue.unref(iconsVue.Delete))
192
+ ]),
193
+ _: 1
194
+ /* STABLE */
195
+ })
196
+ ], 8, ["onClick"])) : vue.createCommentVNode("v-if", true),
197
+ bindValue.value.length > 1 ? (vue.openBlock(), vue.createElementBlock("div", {
198
+ key: 1,
199
+ class: "flex flex-col justify-center"
200
+ }, [
201
+ index$1 !== 0 ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElIcon), {
202
+ key: 0,
203
+ size: "16",
204
+ class: "text-auxiliary hover:text-main clickBox",
205
+ onClick: ($event) => onSwapItemHandler(index$1, index$1 - 1)
206
+ }, {
207
+ default: vue.withCtx(() => [
208
+ vue.createVNode(vue.unref(iconsVue.Top))
209
+ ]),
210
+ _: 1
211
+ /* STABLE */
212
+ }, 8, ["onClick"])) : vue.createCommentVNode("v-if", true),
213
+ index$1 !== bindValue.value.length - 1 ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElIcon), {
214
+ key: 1,
215
+ size: "16",
216
+ class: "text-auxiliary hover:text-main clickBox",
217
+ onClick: ($event) => onSwapItemHandler(index$1, index$1 + 1)
218
+ }, {
219
+ default: vue.withCtx(() => [
220
+ vue.createVNode(vue.unref(iconsVue.Bottom))
221
+ ]),
222
+ _: 1
223
+ /* STABLE */
224
+ }, 8, ["onClick"])) : vue.createCommentVNode("v-if", true)
225
+ ])) : vue.createCommentVNode("v-if", true)
226
+ ])
227
+ ]),
228
+ vue.createElementVNode(
229
+ "div",
230
+ {
231
+ ref_for: true,
232
+ ref_key: "containerRef",
233
+ ref: containerRef,
234
+ class: "grid gap-x-6",
235
+ style: vue.normalizeStyle(containerStyle.value)
236
+ },
237
+ [
238
+ (vue.openBlock(true), vue.createElementBlock(
239
+ vue.Fragment,
240
+ null,
241
+ vue.renderList(__props.column.children, (citem, cindex) => {
242
+ return vue.openBlock(), vue.createBlock(appFormItem.default, {
243
+ key: cindex,
244
+ model: item,
245
+ column: citem,
246
+ "parent-prop": __props.column.field,
247
+ index: index$1,
248
+ loading: __props.loading,
249
+ readonly: __props.readonly
250
+ }, vue.createSlots({
251
+ _: 2
252
+ /* DYNAMIC */
253
+ }, [
254
+ vue.renderList(_ctx.$slots, (_, slotName) => {
255
+ return {
256
+ name: slotName,
257
+ fn: vue.withCtx((scope) => [
258
+ vue.renderSlot(_ctx.$slots, slotName, vue.mergeProps({ ref_for: true }, scope))
259
+ ])
260
+ };
261
+ })
262
+ ]), 1032, ["model", "column", "parent-prop", "index", "loading", "readonly"]);
263
+ }),
264
+ 128
265
+ /* KEYED_FRAGMENT */
266
+ ))
267
+ ],
268
+ 4
269
+ /* STYLE */
270
+ )
271
+ ],
272
+ 2
273
+ /* CLASS */
274
+ );
275
+ }),
276
+ 128
277
+ /* KEYED_FRAGMENT */
278
+ ))
279
+ ],
280
+ 4
281
+ /* STYLE */
282
+ ),
283
+ vue.createElementVNode("div", { class: "flex justify-center mt-2.5" }, [
284
+ vue.createElementVNode("span", {
285
+ onClick: ($event) => onAddItemHandler(),
286
+ class: "flex items-center justify-center clickBox text-success"
287
+ }, [
288
+ vue.createVNode(vue.unref(elementPlus.ElIcon), null, {
289
+ default: vue.withCtx(() => [
290
+ vue.createVNode(vue.unref(iconsVue.CirclePlus))
291
+ ]),
292
+ _: 1
293
+ /* STABLE */
294
+ }),
295
+ vue.createElementVNode(
296
+ "span",
297
+ { style: { "margin-left": "6px" } },
298
+ vue.toDisplayString(vue.unref(index.renderAddLabel)(props, __props.column)),
299
+ 1
300
+ /* TEXT */
301
+ )
302
+ ], 8, ["onClick"])
303
+ ])
304
+ ]);
305
+ };
306
+ }
307
+ };
308
+
309
+ exports.default = _sfc_main;