hy-dispatch-ui-v3 0.1.6 → 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 (160) hide show
  1. package/README.md +47 -0
  2. package/dist/tailwind.css +349 -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 +22 -1
  9. package/es/components/appCutter/appCutter.vue.mjs +202 -129
  10. package/es/components/appDatePicker/appDatePicker.vue.mjs +1 -1
  11. package/es/components/appForm/appForm.vue.mjs +132 -209
  12. package/es/components/appForm/cpns/appFormItem.vue.mjs +312 -0
  13. package/es/components/appForm/cpns/arrayItem.vue.mjs +305 -0
  14. package/es/components/appForm/cpns/extraItem.vue.mjs +140 -0
  15. package/es/components/appForm/js/index.mjs +46 -24
  16. package/es/components/appForm/js/useAppForm.mjs +30 -6
  17. package/es/components/appForm/style/appForm.scss +53 -0
  18. package/es/components/appIcon/appIcon.vue.mjs +2 -1
  19. package/es/components/appIconBox/style/appIconBox.scss +0 -1
  20. package/es/components/appInput/appInput.vue.mjs +99 -0
  21. package/es/components/appInput/index.mjs +6 -0
  22. package/es/components/appMenu/appMenu.vue.mjs +129 -0
  23. package/es/components/appMenu/index.mjs +6 -0
  24. package/es/components/appMenu/style/appMenu.scss +145 -0
  25. package/es/components/appOrgCascader/appOrgCascader.vue.mjs +14 -10
  26. package/es/components/appSearch/appSearch.vue.mjs +55 -211
  27. package/es/components/appSearch/cpns/appSearchItem.vue.mjs +238 -0
  28. package/es/components/appSearch/js/index.mjs +20 -8
  29. package/es/components/appSearch/js/useAppSearch.mjs +10 -5
  30. package/es/components/appSearch/style/appSearch.scss +10 -0
  31. package/es/components/appTable/appTable.vue.mjs +312 -158
  32. package/es/components/appTable/cpns/columnSelect.vue.mjs +151 -156
  33. package/es/components/appTable/cpns/columnSelectItem.vue2.mjs +104 -110
  34. package/es/components/appTable/cpns/headerItem.vue.mjs +98 -0
  35. package/es/components/appTable/cpns/virtualTable.vue.mjs +560 -0
  36. package/es/components/appTable/js/index.mjs +46 -20
  37. package/es/components/appTable/js/search.mjs +1 -2
  38. package/es/components/appTable/js/useAppTable.mjs +58 -14
  39. package/es/components/appTable/style/appTable.scss +16 -0
  40. package/es/components/appTooltip/appTooltip.vue.mjs +24 -13
  41. package/es/components/appTree/appTree.vue.mjs +304 -0
  42. package/es/components/appTree/index.mjs +6 -0
  43. package/es/components/appTree/js/index.mjs +531 -0
  44. package/es/components/appUserAvatar/appUserAvatar.vue.mjs +9 -8
  45. package/es/components/appUserAvatar/style/appUserAvatar.scss +0 -1
  46. package/es/components/appVideoPlayer/appVideoPlayer.vue.mjs +647 -0
  47. package/es/components/appVideoPlayer/cpns/mediaLoading.vue.mjs +35 -0
  48. package/es/components/appVideoPlayer/index.mjs +6 -0
  49. package/es/components/appVideoPlayer/js/index.mjs +426 -0
  50. package/es/components/appVideoPlayer/style/appVideoPlayer.scss +275 -0
  51. package/es/components/appVideoPlayer/style/mediaLoading.scss +62 -0
  52. package/es/components/index.mjs +5 -0
  53. package/es/hooks/index.mjs +3 -0
  54. package/es/hooks/useApi.mjs +4 -4
  55. package/es/hooks/useAudioPlayerConfig.mjs +12 -0
  56. package/es/hooks/useGlobalConfig.mjs +18 -7
  57. package/es/hooks/useLocale.mjs +3 -11
  58. package/es/hooks/useMixins.mjs +1 -1
  59. package/es/hooks/usePermissionMap.mjs +12 -0
  60. package/es/hooks/useUserAvatarMap.mjs +2 -3
  61. package/es/hooks/useVideoPlayerConfig.mjs +12 -0
  62. package/es/index.mjs +14 -4
  63. package/es/locale/en.mjs +52 -3
  64. package/es/locale/zh_CN.mjs +48 -3
  65. package/es/make-installer.mjs +2 -0
  66. package/es/static/hy-svg-icons.js +462 -0
  67. package/es/static/protocolcheck.js +247 -0
  68. package/es/style/element/element.scss +9 -0
  69. package/es/style/element/index.scss +6 -3
  70. package/es/style/index.scss +11 -0
  71. package/es/style/theme.scss +73 -0
  72. package/es/utils/date.mjs +25 -1
  73. package/es/utils/file.mjs +5 -4
  74. package/es/utils/form.mjs +52 -0
  75. package/es/utils/handler.mjs +22 -2
  76. package/es/utils/index.mjs +6 -4
  77. package/es/utils/is.mjs +23 -2
  78. package/es/utils/loadScript.mjs +33 -0
  79. package/es/version.mjs +1 -1
  80. package/lib/components/appAudioPlayer/appAudioPlayer.vue.js +466 -0
  81. package/lib/components/appAudioPlayer/index.js +11 -0
  82. package/lib/components/appAudioPlayer/js/index.js +329 -0
  83. package/lib/components/appAudioPlayer/style/appAudioPlayer.scss +319 -0
  84. package/lib/components/appButton/style/appButton.scss +0 -1
  85. package/lib/components/appConfigProvider/appConfigProvider.vue.js +22 -1
  86. package/lib/components/appCutter/appCutter.vue.js +201 -128
  87. package/lib/components/appDatePicker/appDatePicker.vue.js +1 -1
  88. package/lib/components/appForm/appForm.vue.js +129 -206
  89. package/lib/components/appForm/cpns/appFormItem.vue.js +316 -0
  90. package/lib/components/appForm/cpns/arrayItem.vue.js +309 -0
  91. package/lib/components/appForm/cpns/extraItem.vue.js +144 -0
  92. package/lib/components/appForm/js/index.js +48 -23
  93. package/lib/components/appForm/js/useAppForm.js +30 -6
  94. package/lib/components/appForm/style/appForm.scss +53 -0
  95. package/lib/components/appIcon/appIcon.vue.js +2 -1
  96. package/lib/components/appIconBox/style/appIconBox.scss +0 -1
  97. package/lib/components/appInput/appInput.vue.js +103 -0
  98. package/lib/components/appInput/index.js +11 -0
  99. package/lib/components/appMenu/appMenu.vue.js +133 -0
  100. package/lib/components/appMenu/index.js +11 -0
  101. package/lib/components/appMenu/style/appMenu.scss +145 -0
  102. package/lib/components/appOrgCascader/appOrgCascader.vue.js +14 -10
  103. package/lib/components/appSearch/appSearch.vue.js +51 -207
  104. package/lib/components/appSearch/cpns/appSearchItem.vue.js +242 -0
  105. package/lib/components/appSearch/js/index.js +20 -7
  106. package/lib/components/appSearch/js/useAppSearch.js +10 -5
  107. package/lib/components/appSearch/style/appSearch.scss +10 -0
  108. package/lib/components/appTable/appTable.vue.js +319 -165
  109. package/lib/components/appTable/cpns/columnSelect.vue.js +151 -156
  110. package/lib/components/appTable/cpns/columnSelectItem.vue2.js +105 -111
  111. package/lib/components/appTable/cpns/headerItem.vue.js +102 -0
  112. package/lib/components/appTable/cpns/virtualTable.vue.js +564 -0
  113. package/lib/components/appTable/js/index.js +47 -19
  114. package/lib/components/appTable/js/search.js +1 -2
  115. package/lib/components/appTable/js/useAppTable.js +57 -13
  116. package/lib/components/appTable/style/appTable.scss +16 -0
  117. package/lib/components/appTooltip/appTooltip.vue.js +23 -12
  118. package/lib/components/appTree/appTree.vue.js +308 -0
  119. package/lib/components/appTree/index.js +11 -0
  120. package/lib/components/appTree/js/index.js +533 -0
  121. package/lib/components/appUserAvatar/appUserAvatar.vue.js +9 -8
  122. package/lib/components/appUserAvatar/style/appUserAvatar.scss +0 -1
  123. package/lib/components/appVideoPlayer/appVideoPlayer.vue.js +651 -0
  124. package/lib/components/appVideoPlayer/cpns/mediaLoading.vue.js +39 -0
  125. package/lib/components/appVideoPlayer/index.js +11 -0
  126. package/lib/components/appVideoPlayer/js/index.js +429 -0
  127. package/lib/components/appVideoPlayer/style/appVideoPlayer.scss +275 -0
  128. package/lib/components/appVideoPlayer/style/mediaLoading.scss +62 -0
  129. package/lib/components/index.js +42 -32
  130. package/lib/hooks/index.js +9 -0
  131. package/lib/hooks/useApi.js +4 -4
  132. package/lib/hooks/useAudioPlayerConfig.js +15 -0
  133. package/lib/hooks/useGlobalConfig.js +18 -7
  134. package/lib/hooks/useLocale.js +3 -11
  135. package/lib/hooks/useMixins.js +1 -1
  136. package/lib/hooks/usePermissionMap.js +15 -0
  137. package/lib/hooks/useUserAvatarMap.js +1 -2
  138. package/lib/hooks/useVideoPlayerConfig.js +15 -0
  139. package/lib/index.js +62 -33
  140. package/lib/locale/en.js +52 -3
  141. package/lib/locale/zh_CN.js +48 -3
  142. package/lib/make-installer.js +2 -0
  143. package/lib/static/hy-svg-icons.js +459 -8
  144. package/lib/static/protocolcheck.js +249 -0
  145. package/lib/style/element/element.scss +9 -0
  146. package/lib/style/element/index.scss +6 -3
  147. package/lib/style/index.scss +11 -0
  148. package/lib/style/theme.scss +73 -0
  149. package/lib/utils/date.js +25 -0
  150. package/lib/utils/file.js +4 -4
  151. package/lib/utils/form.js +57 -0
  152. package/lib/utils/handler.js +22 -1
  153. package/lib/utils/index.js +11 -1
  154. package/lib/utils/is.js +23 -1
  155. package/lib/utils/loadScript.js +37 -0
  156. package/lib/version.js +1 -1
  157. package/package.json +12 -10
  158. package/es/config/index.mjs +0 -1
  159. package/es/static/hy-svg-icons.mjs +0 -11
  160. package/lib/config/index.js +0 -2
@@ -0,0 +1,144 @@
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 appFormItem = require('./appFormItem.vue.js');
9
+ var useLocale = require('../../../hooks/useLocale.js');
10
+ var is = require('../../../utils/is.js');
11
+
12
+ const _sfc_main = {
13
+ __name: "extraItem",
14
+ props: {
15
+ model: {
16
+ type: Object,
17
+ default: () => ({})
18
+ },
19
+ column: {
20
+ type: Object,
21
+ default: () => ({})
22
+ },
23
+ columnNum: {
24
+ type: Number,
25
+ default: 1
26
+ },
27
+ loading: {
28
+ type: Boolean,
29
+ default: false
30
+ },
31
+ readonly: {
32
+ type: Boolean,
33
+ default: false
34
+ }
35
+ },
36
+ setup(__props) {
37
+ const props = __props;
38
+ const { t } = useLocale.useLocale();
39
+ const containerRef = vue.useTemplateRef("containerRef");
40
+ const containerHeight = vue.ref(0);
41
+ const isExpand = vue.ref(false);
42
+ const isExpandHover = vue.ref(null);
43
+ function onExpandHandler(column) {
44
+ containerHeight.value = containerRef.value.clientHeight;
45
+ isExpand.value = !isExpand.value;
46
+ }
47
+ function onExpandMouseenter(column) {
48
+ isExpandHover.value = true;
49
+ }
50
+ function onExpandMouseleave(column) {
51
+ isExpandHover.value = false;
52
+ }
53
+ const containerStyle = vue.computed(() => {
54
+ 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;
55
+ return {
56
+ gridTemplateColumns: `repeat(${columnNum}, minmax(0, 1fr))`
57
+ };
58
+ });
59
+ return (_ctx, _cache) => {
60
+ return vue.openBlock(), vue.createElementBlock("div", { class: "pt-6" }, [
61
+ vue.createElementVNode("div", { class: "flex items-center justify-center text-xs relative" }, [
62
+ vue.createElementVNode("div", {
63
+ class: vue.normalizeClass(["app-form-extra", { expand: isExpand.value }]),
64
+ onClick: ($event) => onExpandHandler(__props.column),
65
+ onMouseenter: ($event) => onExpandMouseenter(__props.column),
66
+ onMouseleave: ($event) => onExpandMouseleave(__props.column)
67
+ }, [
68
+ vue.createVNode(vue.unref(elementPlus.ElIcon), {
69
+ size: "8",
70
+ class: "app-form-extra-arrow"
71
+ }, {
72
+ default: vue.withCtx(() => [
73
+ vue.createVNode(vue.unref(iconsVue.DArrowRight))
74
+ ]),
75
+ _: 1
76
+ /* STABLE */
77
+ }),
78
+ vue.createElementVNode(
79
+ "span",
80
+ { class: "ml-1.5" },
81
+ vue.toDisplayString(isExpandHover.value ? vue.unref(t)("form.additionalInformationHoverTip") : vue.unref(t)("form.additionalInformationTip")),
82
+ 1
83
+ /* TEXT */
84
+ )
85
+ ], 42, ["onClick", "onMouseenter", "onMouseleave"]),
86
+ vue.createElementVNode("div", { class: "app-form-extra-line" })
87
+ ]),
88
+ vue.createElementVNode(
89
+ "div",
90
+ {
91
+ class: "mt-3 overflow-hidden transition-all",
92
+ style: vue.normalizeStyle({ height: isExpand.value ? `${containerHeight.value || 0}px` : "0px" })
93
+ },
94
+ [
95
+ vue.createElementVNode(
96
+ "div",
97
+ {
98
+ ref_key: "containerRef",
99
+ ref: containerRef,
100
+ class: "grid gap-x-6",
101
+ style: vue.normalizeStyle(containerStyle.value)
102
+ },
103
+ [
104
+ (vue.openBlock(true), vue.createElementBlock(
105
+ vue.Fragment,
106
+ null,
107
+ vue.renderList(__props.column.children, (item, index) => {
108
+ return vue.openBlock(), vue.createBlock(appFormItem.default, {
109
+ key: index,
110
+ model: __props.model,
111
+ column: item,
112
+ loading: __props.loading,
113
+ readonly: __props.readonly
114
+ }, vue.createSlots({
115
+ _: 2
116
+ /* DYNAMIC */
117
+ }, [
118
+ vue.renderList(_ctx.$slots, (_, slotName) => {
119
+ return {
120
+ name: slotName,
121
+ fn: vue.withCtx((scope) => [
122
+ vue.renderSlot(_ctx.$slots, slotName, vue.mergeProps({ ref_for: true }, scope))
123
+ ])
124
+ };
125
+ })
126
+ ]), 1032, ["model", "column", "loading", "readonly"]);
127
+ }),
128
+ 128
129
+ /* KEYED_FRAGMENT */
130
+ ))
131
+ ],
132
+ 4
133
+ /* STYLE */
134
+ )
135
+ ],
136
+ 4
137
+ /* STYLE */
138
+ )
139
+ ]);
140
+ };
141
+ }
142
+ };
143
+
144
+ exports.default = _sfc_main;
@@ -1,8 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  var vue = require('vue');
4
- var is = require('../../../utils/is.js');
5
4
  var handler = require('../../../utils/handler.js');
5
+ var is = require('../../../utils/is.js');
6
+ var useLocale = require('../../../hooks/useLocale.js');
6
7
 
7
8
  function columnItemStyle(props, column) {
8
9
  const style = {};
@@ -10,6 +11,14 @@ function columnItemStyle(props, column) {
10
11
  if (is.isNumber(span) && span > 1) {
11
12
  span = span >= props.columnNum ? props.columnNum : span;
12
13
  style["grid-column"] = `span ${span}`;
14
+ } else {
15
+ switch (column.type) {
16
+ case "title":
17
+ case "extra":
18
+ case "array":
19
+ style["grid-column"] = `span ${props.columnNum}`;
20
+ break;
21
+ }
13
22
  }
14
23
  return style;
15
24
  }
@@ -20,7 +29,6 @@ function columnShowHandler(props, column) {
20
29
  return true;
21
30
  }
22
31
  function isRequired(props, column) {
23
- var _a;
24
32
  let { readonly, field, rules } = column;
25
33
  if (props.readonly || readonly) {
26
34
  return false;
@@ -28,33 +36,35 @@ function isRequired(props, column) {
28
36
  if (Array.isArray(field)) {
29
37
  return field.find((key) => isRequired(props, { ...column, field: key }));
30
38
  }
31
- rules = is.isArray(rules) && (rules == null ? void 0 : rules.length) || is.isObject(rules) ? rules : (_a = props.rules) == null ? void 0 : _a[field];
39
+ rules = is.isArray(rules) && rules?.length || is.isObject(rules) ? rules : props.rules?.[field];
32
40
  if (is.isArray(rules)) {
33
41
  return rules.some((item) => item.required);
34
42
  }
35
43
  if (is.isObject(rules)) {
36
- return rules == null ? void 0 : rules.required;
44
+ return rules?.required;
37
45
  }
38
46
  return false;
39
47
  }
40
48
  function isDisabled(props, column) {
41
- var _a;
42
- return !!(props.loading || ((_a = column.attrs) == null ? void 0 : _a.disabled));
49
+ if (props.loading) return true;
50
+ const disabled = vue.unref(column.attrs?.disabled);
51
+ if (is.isBoolean(disabled)) return disabled;
52
+ if (is.isFunction(disabled)) return disabled(column, props.model);
53
+ return false;
43
54
  }
44
- function renderText(props, column = {}, index) {
45
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
55
+ function renderText(props, column = {}) {
46
56
  const { type, field, customRender } = column;
47
- const { fieldNames, options = [] } = column.attrs || {};
57
+ const { props: fieldNames, options = [] } = column.attrs || {};
48
58
  if (customRender && typeof customRender === "function") {
49
59
  return customRender({
50
- column: props.columns[index],
60
+ column,
51
61
  model: props.model,
52
62
  value: props.model[field]
53
63
  });
54
64
  }
55
65
  if (type === "range-picker") {
56
66
  const [start, end] = field;
57
- return ((_a = props.model) == null ? void 0 : _a[start]) ? `${(_b = props.model) == null ? void 0 : _b[start]} ~ ${(_c = props.model) == null ? void 0 : _c[end]}` : "";
67
+ return props.model?.[start] ? `${props.model?.[start]} ~ ${props.model?.[end]}` : "";
58
68
  }
59
69
  if (type === "location") {
60
70
  const [lon, lat] = field;
@@ -62,31 +72,46 @@ function renderText(props, column = {}, index) {
62
72
  }
63
73
  if (/^(select|radio|checkbox)$/.test(type)) {
64
74
  const target = options.find(
65
- (item) => {
66
- var _a2;
67
- return item[fieldNames.value] === ((_a2 = props.model) == null ? void 0 : _a2[field]);
68
- }
75
+ (item) => item[fieldNames.value] === props.model?.[field]
69
76
  );
70
- return (target == null ? void 0 : target[fieldNames.label]) || ((_d = props.model) == null ? void 0 : _d[field]) || "";
77
+ return target?.[fieldNames.label] || props.model?.[field] || "";
71
78
  }
72
79
  if (/^dept-select(-all)?$/.test(type)) {
73
80
  const dict = /^dept-select$/.test(type) ? deptTreeDict.value : deptTreeAllDict.value;
74
- return dict[(_e = props.model) == null ? void 0 : _e[field]] || ((_f = props.model) == null ? void 0 : _f[field]) || "";
81
+ return dict[props.model?.[field]] || props.model?.[field] || "";
75
82
  }
76
83
  if (type === "area-select") {
77
- return areaTreeDict.value[(_g = props.model) == null ? void 0 : _g[field]] || ((_h = props.model) == null ? void 0 : _h[field]) || "";
84
+ return areaTreeDict.value[props.model?.[field]] || props.model?.[field] || "";
78
85
  }
79
86
  if (Array.isArray(field)) {
80
- return field.map((key) => {
81
- var _a2;
82
- return ((_a2 = props.model) == null ? void 0 : _a2[key]) || "";
83
- }).filter(Boolean).join(" - ");
87
+ return field.map((key) => props.model?.[key] || "").filter(Boolean).join(" - ");
84
88
  }
85
- return ((_i = props.model) == null ? void 0 : _i[field]) || ((_j = props.model) == null ? void 0 : _j[field]) || "";
89
+ return props.model?.[field] || props.model?.[field] || "";
90
+ }
91
+ function renderArrayItemLabel(props, column, index) {
92
+ const { t } = useLocale.useLocale();
93
+ const itemLabel = vue.unref(column.itemLabel);
94
+ if (is.isFunction(itemLabel)) return itemLabel(column, index);
95
+ return (itemLabel || t("form.dynamicFormItem")) + ` ${index + 1}`;
96
+ }
97
+ function renderAddLabel(props, column) {
98
+ const { t } = useLocale.useLocale();
99
+ let addLabel = vue.unref(column.addLabel);
100
+ if (is.isFunction(addLabel)) return addLabel();
101
+ return addLabel || t("form.addFormItem");
102
+ }
103
+ function optionsHandler(props, column) {
104
+ const options = vue.unref(column.attrs.options);
105
+ if (is.isArray(options)) return options;
106
+ if (is.isFunction(options)) return options(column, props.model);
107
+ return [];
86
108
  }
87
109
 
88
110
  exports.columnItemStyle = columnItemStyle;
89
111
  exports.columnShowHandler = columnShowHandler;
90
112
  exports.isDisabled = isDisabled;
91
113
  exports.isRequired = isRequired;
114
+ exports.optionsHandler = optionsHandler;
115
+ exports.renderAddLabel = renderAddLabel;
116
+ exports.renderArrayItemLabel = renderArrayItemLabel;
92
117
  exports.renderText = renderText;
@@ -1,10 +1,11 @@
1
1
  'use strict';
2
2
 
3
3
  var vue = require('vue');
4
+ var form = require('../../../utils/form.js');
4
5
  var handler = require('../../../utils/handler.js');
5
6
  var date = require('../../../utils/date.js');
6
- var useLocale = require('../../../hooks/useLocale.js');
7
7
  var is = require('../../../utils/is.js');
8
+ var useLocale = require('../../../hooks/useLocale.js');
8
9
 
9
10
  const genDefaultLabel = (config) => {
10
11
  if (config.label) return config.label;
@@ -28,7 +29,7 @@ const genPlaceholderHandler = (config) => {
28
29
  break;
29
30
  case "date-picker":
30
31
  if (["datetimerange", "daterange", "monthrange", "yearrange"].includes(
31
- attrs == null ? void 0 : attrs.type
32
+ attrs?.type
32
33
  )) {
33
34
  switch (attrs.type) {
34
35
  case "yearrange":
@@ -60,7 +61,7 @@ const genPlaceholderHandler = (config) => {
60
61
  const genRuleRequiredMsgHandler = (config) => {
61
62
  const { t } = useLocale.useLocale();
62
63
  const { type, prop, label } = config || {};
63
- if (!prop || !(prop == null ? void 0 : prop.length)) return "";
64
+ if (!prop || !prop?.length) return "";
64
65
  switch (type) {
65
66
  case "input":
66
67
  return t("hy.pleaseEnterPlaceholder", [label]);
@@ -132,18 +133,41 @@ function appFormItemHandler(column = {}) {
132
133
  endPlaceholder
133
134
  }
134
135
  };
136
+ } else if (/^(extra)$/.test(column.type)) {
137
+ return {
138
+ ...column,
139
+ children: (column.children || []).map((item) => appFormItemHandler(item))
140
+ };
141
+ } else if (/^(array)$/.test(column.type)) {
142
+ return {
143
+ height: 500,
144
+ emptyChildren: false,
145
+ ...column,
146
+ children: (column.children || []).map((item) => appFormItemHandler(item))
147
+ };
135
148
  }
136
149
  return column;
137
150
  }
138
151
  const resetAppFormValue = (columns = [], obj = {}) => {
139
152
  for (const item of columns) {
140
153
  const value = handler.funRunHandler(item.defaultValue);
141
- if (Array.isArray(item.prop)) {
154
+ if (item.type === "array") {
155
+ if (is.isArray(value)) {
156
+ obj[item.prop] = value;
157
+ } else if (!item.emptyChildren) {
158
+ const childValue = resetAppFormValue(item.children);
159
+ obj[item.prop] = [childValue];
160
+ }
161
+ } else if (Array.isArray(item.prop)) {
142
162
  for (let i = 0; i < item.prop.length; i++) {
143
- obj[item.prop[i]] = value && Array.isArray(value) ? value[i] : void 0;
163
+ form.genValueByProp(
164
+ obj,
165
+ item.prop[i],
166
+ Array.isArray(value) ? value[i] : void 0
167
+ );
144
168
  }
145
169
  } else {
146
- obj[item.prop] = value;
170
+ form.genValueByProp(obj, item.prop, value);
147
171
  }
148
172
  }
149
173
  return obj;
@@ -14,3 +14,56 @@
14
14
  color: rgba(var(--hy-danger-2));
15
15
  }
16
16
  }
17
+
18
+ .app-form-extra {
19
+ height: 32px;
20
+ color: rgba(var(--hy-auxiliary));
21
+ position: relative;
22
+ padding: 0 40px;
23
+ display: flex;
24
+ align-items: center;
25
+ justify-content: center;
26
+ border-radius: 1000px;
27
+ border: 1px solid rgba(var(--hy-auxiliary));
28
+ background-color: rgba(var(--hy-background-2));
29
+ cursor: pointer;
30
+ transition: all 0.1s linear;
31
+ user-select: none;
32
+ z-index: 2;
33
+ .app-form-extra-arrow {
34
+ transform: rotateZ(90deg) rotateY(0deg);
35
+ transition: all 0.3s linear;
36
+ }
37
+ &:hover {
38
+ color: rgba(var(--hy-theme));
39
+ border-color: rgba(var(--hy-theme));
40
+ box-shadow: 0px 0px 12px 1px rgba(var(--hy-theme), 0.5);
41
+ & + .app-form-extra-line {
42
+ background: radial-gradient(
43
+ circle,
44
+ rgba(var(--hy-theme), 1),
45
+ rgba(var(--hy-theme), 0)
46
+ );
47
+ }
48
+ }
49
+ &.expand {
50
+ .app-form-extra-arrow {
51
+ transform: rotateZ(90deg) rotateY(-180deg);
52
+ }
53
+ }
54
+ }
55
+
56
+ .app-form-extra-line {
57
+ width: 100%;
58
+ height: 2px;
59
+ position: absolute;
60
+ left: 0;
61
+ top: 50%;
62
+ transform: translateY(-50%);
63
+ pointer-events: none;
64
+ background: radial-gradient(
65
+ circle,
66
+ rgba(var(--hy-auxiliary), 1),
67
+ rgba(var(--hy-auxiliary), 0)
68
+ );
69
+ }
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
+ var loadScript = require('../../utils/loadScript.js');
6
7
 
7
8
  import "./style/appIcon.scss";
8
9
 
@@ -35,10 +36,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
35
36
  return "app-icon";
36
37
  }
37
38
  });
39
+ loadScript.svgIconLoad();
38
40
  return (_ctx, _cache) => {
39
41
  return vue.openBlock(), vue.createElementBlock("svg", {
40
42
  class: vue.normalizeClass(svgClass.value),
41
- "aria-hidden": "true",
42
43
  svgName: __props.svgName
43
44
  }, [
44
45
  vue.createElementVNode("use", { "xlink:href": iconName.value }, null, 8, ["xlink:href"])
@@ -14,7 +14,6 @@
14
14
  user-select: none;
15
15
  color: rgb(var(--hy-main));
16
16
  border-radius: 100%;
17
- box-sizing: border-box;
18
17
  background:
19
18
  radial-gradient(
20
19
  142% 47% at 50% 119%,
@@ -0,0 +1,103 @@
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 form = require('../../utils/form.js');
8
+
9
+ const __default__ = vue.defineComponent({
10
+ name: "AppInput"
11
+ });
12
+ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
13
+ props: /* @__PURE__ */ vue.mergeModels({
14
+ type: {
15
+ type: String,
16
+ default: "text"
17
+ },
18
+ clearSpaceType: {
19
+ type: String,
20
+ // between-清除两端空格 all-清除所有空格 before-清除前面的空格 after-清除后面的空格 none-不清除空格
21
+ default: "between"
22
+ }
23
+ }, {
24
+ "modelValue": { type: String, default: "" },
25
+ "modelModifiers": {}
26
+ }),
27
+ emits: /* @__PURE__ */ vue.mergeModels([], ["update:modelValue"]),
28
+ setup(__props, { expose: __expose, emit: __emit }) {
29
+ const props = __props;
30
+ const modelValue = vue.useModel(__props, "modelValue");
31
+ const inputRef = vue.useTemplateRef("inputRef");
32
+ const bindValue = vue.computed({
33
+ get() {
34
+ return modelValue.value;
35
+ },
36
+ set(val) {
37
+ if (val && props.type !== "password") {
38
+ if (["between", "before"].includes(props.clearSpaceType)) {
39
+ modelValue.value = form.clearSpace(val, "before");
40
+ return;
41
+ }
42
+ if (["all"].includes(props.clearSpaceType)) {
43
+ modelValue.value = form.clearSpace(val, props.clearSpaceType);
44
+ return;
45
+ }
46
+ }
47
+ modelValue.value = val;
48
+ }
49
+ });
50
+ function onBlurHandler() {
51
+ if (modelValue.value && props.type !== "password") {
52
+ modelValue.value = form.clearSpace(modelValue.value, props.clearSpaceType);
53
+ }
54
+ }
55
+ __expose({
56
+ blur() {
57
+ inputRef.value.blur();
58
+ },
59
+ clear() {
60
+ inputRef.value.clear();
61
+ },
62
+ focus() {
63
+ inputRef.value.focus();
64
+ },
65
+ input: vue.computed(() => {
66
+ return inputRef.value.input;
67
+ }),
68
+ ref: vue.computed(() => {
69
+ return inputRef.value.ref;
70
+ }),
71
+ resizeTextarea() {
72
+ inputRef.value.resizeTextarea();
73
+ },
74
+ select() {
75
+ inputRef.value.select();
76
+ },
77
+ textarea: vue.computed(() => {
78
+ return inputRef.value.textarea;
79
+ }),
80
+ textareaStyle: vue.computed(() => {
81
+ return inputRef.value.textareaStyle;
82
+ }),
83
+ isComposing: vue.computed(() => {
84
+ return inputRef.value.isComposing;
85
+ }),
86
+ passwordVisible: vue.computed(() => {
87
+ return inputRef.value.passwordVisible;
88
+ })
89
+ });
90
+ return (_ctx, _cache) => {
91
+ return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElInput), vue.mergeProps({
92
+ ref_key: "inputRef",
93
+ ref: inputRef,
94
+ modelValue: bindValue.value,
95
+ "onUpdate:modelValue": ($event) => bindValue.value = $event
96
+ }, _ctx.$attrs, {
97
+ onBlur: ($event) => onBlurHandler(props, _ctx.column)
98
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "onBlur"]);
99
+ };
100
+ }
101
+ });
102
+
103
+ exports.default = _sfc_main;
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var appInput = require('./appInput.vue.js');
6
+ var handler = require('../../utils/handler.js');
7
+
8
+ const AppInput = handler.withInstall(appInput.default);
9
+
10
+ exports.AppInput = AppInput;
11
+ exports.default = AppInput;
@@ -0,0 +1,133 @@
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 usePermissionMap = require('../../hooks/usePermissionMap.js');
9
+ var index = require('../appTooltip/index.js');
10
+ var index$1 = require('../appIcon/index.js');
11
+
12
+ import "./style/appMenu.scss";
13
+
14
+ const __default__ = vue.defineComponent({
15
+ name: "AppMenu"
16
+ });
17
+ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
18
+ props: /* @__PURE__ */ vue.mergeModels({
19
+ menu: {
20
+ type: Array,
21
+ default: () => []
22
+ },
23
+ showShrink: {
24
+ type: Boolean,
25
+ default: false
26
+ }
27
+ }, {
28
+ "modelValue": { type: String, default: "" },
29
+ "modelModifiers": {},
30
+ "expand": { type: Boolean, default: true },
31
+ "expandModifiers": {}
32
+ }),
33
+ emits: /* @__PURE__ */ vue.mergeModels(["select", "open", "close"], ["update:modelValue", "update:expand"]),
34
+ setup(__props, { expose: __expose, emit: __emit }) {
35
+ const emits = __emit;
36
+ const { permissionMap } = usePermissionMap.usePermissionMap();
37
+ const modelValue = vue.useModel(__props, "modelValue");
38
+ const expand = vue.useModel(__props, "expand");
39
+ function onClickHandler(item) {
40
+ modelValue.value = item.path;
41
+ emits("select", item);
42
+ }
43
+ function onExpandHandler() {
44
+ expand.value = !expand.value;
45
+ emits(expand.value ? "open" : "close");
46
+ }
47
+ __expose({});
48
+ return (_ctx, _cache) => {
49
+ return vue.openBlock(), vue.createElementBlock(
50
+ "div",
51
+ {
52
+ class: vue.normalizeClass(["operator-menu-box user-select-none", { "operator-menu-box-expand": expand.value }])
53
+ },
54
+ [
55
+ vue.createElementVNode("div", { class: "operator-menu-list scroll-body" }, [
56
+ (vue.openBlock(true), vue.createElementBlock(
57
+ vue.Fragment,
58
+ null,
59
+ vue.renderList(__props.menu, (item, index$2) => {
60
+ return vue.openBlock(), vue.createElementBlock(
61
+ vue.Fragment,
62
+ { key: index$2 },
63
+ [
64
+ vue.unref(permissionMap).has(item.permission) ? (vue.openBlock(), vue.createBlock(vue.unref(index.AppTooltip), {
65
+ key: 0,
66
+ "is-always": "",
67
+ disabled: expand.value,
68
+ content: item.label,
69
+ placement: "right"
70
+ }, {
71
+ default: vue.withCtx(() => [
72
+ vue.createElementVNode("div", {
73
+ class: vue.normalizeClass(["operator-menu-item", { "operator-menu-item-active": modelValue.value === item.path }]),
74
+ onClick: vue.withModifiers(($event) => onClickHandler(item), ["stop"])
75
+ }, [
76
+ vue.createElementVNode("div", { class: "operator-label clickBox over_one_line" }, [
77
+ vue.createVNode(vue.unref(index$1.AppIcon), {
78
+ "svg-name": `${item.iconName}`,
79
+ "class-name": "!w-5 !h-5 flex-shrink-0"
80
+ }, null, 8, ["svg-name"]),
81
+ vue.createElementVNode(
82
+ "span",
83
+ {
84
+ class: vue.normalizeClass({ "ml-3": expand.value })
85
+ },
86
+ vue.toDisplayString(expand.value ? item.label : item.tip || item.label),
87
+ 3
88
+ /* TEXT, CLASS */
89
+ )
90
+ ])
91
+ ], 10, ["onClick"])
92
+ ]),
93
+ _: 2
94
+ /* DYNAMIC */
95
+ }, 1032, ["disabled", "content"])) : vue.createCommentVNode("v-if", true)
96
+ ],
97
+ 64
98
+ /* STABLE_FRAGMENT */
99
+ );
100
+ }),
101
+ 128
102
+ /* KEYED_FRAGMENT */
103
+ ))
104
+ ]),
105
+ __props.showShrink ? (vue.openBlock(), vue.createElementBlock("div", {
106
+ key: 0,
107
+ class: vue.normalizeClass(["w-full h-[44px] border-t border-border box-border cursor-pointer relative", { "justify-end pr-3": expand.value, "justify-center": !expand.value }]),
108
+ onClick: ($event) => onExpandHandler()
109
+ }, [
110
+ vue.createVNode(vue.unref(elementPlus.ElIcon), {
111
+ size: "20",
112
+ style: vue.normalizeStyle({
113
+ transform: expand.value ? "translate(0px, -50%) rotateY(0deg) rotateZ(90deg)" : "translate(50%, -50%) rotateY(-180deg) rotateZ(90deg)",
114
+ transition: "all 0.3s linear"
115
+ }),
116
+ class: vue.normalizeClass(["absolute top-1/2", { "right-3": expand.value, "right-1/2": !expand.value }])
117
+ }, {
118
+ default: vue.withCtx(() => [
119
+ vue.createVNode(vue.unref(iconsVue.Download))
120
+ ]),
121
+ _: 1
122
+ /* STABLE */
123
+ }, 8, ["style", "class"])
124
+ ], 10, ["onClick"])) : vue.createCommentVNode("v-if", true)
125
+ ],
126
+ 2
127
+ /* CLASS */
128
+ );
129
+ };
130
+ }
131
+ });
132
+
133
+ exports.default = _sfc_main;