hy-dispatch-ui-v3 0.2.65 → 0.2.66

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 (128) hide show
  1. package/dist/tailwind.css +26 -12
  2. package/es/api/organization.mjs +43 -0
  3. package/es/bussiness/hyAcquisitionStationTree/acquisitionStationTree.vue.mjs +245 -0
  4. package/es/bussiness/hyAcquisitionStationTree/index.mjs +7 -0
  5. package/es/bussiness/hyAcquisitionStationTree/js/index.mjs +124 -0
  6. package/es/bussiness/hyAcquisitionStationTree/style/acquisitionStationTree.scss +0 -0
  7. package/es/bussiness/hyDeviceTree/deviceTree.vue.mjs +249 -0
  8. package/es/bussiness/hyDeviceTree/index.mjs +7 -0
  9. package/es/bussiness/hyDeviceTree/js/index.mjs +126 -0
  10. package/es/bussiness/hyDeviceTree/style/deviceTree.scss +0 -0
  11. package/es/bussiness/hyOrgGroupTree/index.mjs +7 -0
  12. package/es/bussiness/hyOrgGroupTree/js/index.mjs +124 -0
  13. package/es/bussiness/hyOrgGroupTree/orgGroupTree.vue.mjs +245 -0
  14. package/es/bussiness/hyOrgGroupTree/style/orgGroupTree.scss +0 -0
  15. package/es/bussiness/hyPlanGroupDeviceTree/index.mjs +7 -0
  16. package/es/bussiness/hyPlanGroupDeviceTree/js/index.mjs +124 -0
  17. package/es/bussiness/hyPlanGroupDeviceTree/planGroupDeviceTree.vue.mjs +245 -0
  18. package/es/bussiness/hyPlanGroupDeviceTree/style/planGroupDeviceTree.scss +0 -0
  19. package/es/bussiness/hyUserTree/index.mjs +7 -0
  20. package/es/bussiness/hyUserTree/js/index.mjs +126 -0
  21. package/es/bussiness/hyUserTree/style/userTree.scss +0 -0
  22. package/es/bussiness/hyUserTree/userTree.vue.mjs +239 -0
  23. package/es/bussiness/index.mjs +5 -0
  24. package/es/components/hyBatchUploadDialog/batchUploadDialog.vue.mjs +18 -16
  25. package/es/components/hyButton/button.vue.mjs +3 -2
  26. package/es/components/hyButton/style/button.scss +70 -0
  27. package/es/components/hyConfirmDialog/confirmDialog.vue.mjs +1 -2
  28. package/es/components/hyForm/cpns/formItem.vue.mjs +198 -26
  29. package/es/components/hyForm/cpns/locationSelect.vue.mjs +8 -1
  30. package/es/components/hyForm/form.vue.mjs +74 -19
  31. package/es/components/hyForm/js/index.mjs +2 -1
  32. package/es/components/hyForm/js/useAppForm.mjs +2 -2
  33. package/es/components/hyIcon/style/icon.scss +1 -0
  34. package/es/components/hyNoPermissions/noPermissions.vue.mjs +1 -1
  35. package/es/components/hyNoPermissionsMap/noPermissionsMap.vue.mjs +1 -1
  36. package/es/components/hyOrgCascader/orgCascader.vue.mjs +69 -14
  37. package/es/components/hyRadioGroup/radioGroup.vue.mjs +5 -4
  38. package/es/components/hySearch/cpns/searchItem.vue.mjs +167 -11
  39. package/es/components/hySearch/js/index.mjs +2 -1
  40. package/es/components/hySearch/search.vue.mjs +60 -9
  41. package/es/components/hyTable/cpns/columnSelect.vue.mjs +21 -22
  42. package/es/components/hyTable/cpns/virtualTable.vue.mjs +10 -15
  43. package/es/components/hyTable/js/index.mjs +5 -12
  44. package/es/components/hyTable/js/search.mjs +3 -1
  45. package/es/components/hyTable/style/table.scss +13 -0
  46. package/es/components/hyTable/table.vue.mjs +21 -9
  47. package/es/components/hyTableActionButton/tableActionButton.vue.mjs +8 -10
  48. package/es/components/hyTableForm/batchTableForm.vue.mjs +13 -3
  49. package/es/components/hyTableForm/tableForm.vue.mjs +17 -11
  50. package/es/components/hyTour/index.mjs +7 -0
  51. package/es/components/hyTour/style/tour.scss +0 -0
  52. package/es/components/hyTour/tour.vue.mjs +23 -0
  53. package/es/components/hyTree/config/tree-config.mjs +5 -2
  54. package/es/components/hyTree/js/index.mjs +11 -7
  55. package/es/components/hyTree/tree.vue.mjs +18 -35
  56. package/es/components/index.mjs +1 -0
  57. package/es/index.mjs +6 -0
  58. package/es/static/hy-svg-icons/hy-icon-ops-linear-arrow.js +10 -0
  59. package/es/style/element/hy-element.scss +24 -3
  60. package/es/style/theme.scss +1 -0
  61. package/es/utils/map/hook/bigMap.mjs +9 -1
  62. package/es/utils/map/hook/gaode.mjs +9 -1
  63. package/es/utils/map/hook/leafletjs.mjs +10 -1
  64. package/es/version.mjs +1 -1
  65. package/lib/api/organization.js +47 -0
  66. package/lib/bussiness/hyAcquisitionStationTree/acquisitionStationTree.vue.js +249 -0
  67. package/lib/bussiness/hyAcquisitionStationTree/index.js +12 -0
  68. package/lib/bussiness/hyAcquisitionStationTree/js/index.js +126 -0
  69. package/lib/bussiness/hyAcquisitionStationTree/style/acquisitionStationTree.scss +0 -0
  70. package/lib/bussiness/hyDeviceTree/deviceTree.vue.js +253 -0
  71. package/lib/bussiness/hyDeviceTree/index.js +12 -0
  72. package/lib/bussiness/hyDeviceTree/js/index.js +128 -0
  73. package/lib/bussiness/hyDeviceTree/style/deviceTree.scss +0 -0
  74. package/lib/bussiness/hyOrgGroupTree/index.js +12 -0
  75. package/lib/bussiness/hyOrgGroupTree/js/index.js +126 -0
  76. package/lib/bussiness/hyOrgGroupTree/orgGroupTree.vue.js +249 -0
  77. package/lib/bussiness/hyOrgGroupTree/style/orgGroupTree.scss +0 -0
  78. package/lib/bussiness/hyPlanGroupDeviceTree/index.js +12 -0
  79. package/lib/bussiness/hyPlanGroupDeviceTree/js/index.js +126 -0
  80. package/lib/bussiness/hyPlanGroupDeviceTree/planGroupDeviceTree.vue.js +249 -0
  81. package/lib/bussiness/hyPlanGroupDeviceTree/style/planGroupDeviceTree.scss +0 -0
  82. package/lib/bussiness/hyUserTree/index.js +12 -0
  83. package/lib/bussiness/hyUserTree/js/index.js +128 -0
  84. package/lib/bussiness/hyUserTree/style/userTree.scss +0 -0
  85. package/lib/bussiness/hyUserTree/userTree.vue.js +243 -0
  86. package/lib/bussiness/index.js +14 -4
  87. package/lib/components/hyBatchUploadDialog/batchUploadDialog.vue.js +18 -16
  88. package/lib/components/hyButton/button.vue.js +3 -2
  89. package/lib/components/hyButton/style/button.scss +70 -0
  90. package/lib/components/hyConfirmDialog/confirmDialog.vue.js +0 -1
  91. package/lib/components/hyForm/cpns/formItem.vue.js +195 -23
  92. package/lib/components/hyForm/cpns/locationSelect.vue.js +8 -1
  93. package/lib/components/hyForm/form.vue.js +72 -17
  94. package/lib/components/hyForm/js/index.js +2 -0
  95. package/lib/components/hyForm/js/useAppForm.js +2 -2
  96. package/lib/components/hyIcon/style/icon.scss +1 -0
  97. package/lib/components/hyNoPermissions/noPermissions.vue.js +1 -1
  98. package/lib/components/hyNoPermissionsMap/noPermissionsMap.vue.js +1 -1
  99. package/lib/components/hyOrgCascader/orgCascader.vue.js +67 -12
  100. package/lib/components/hyRadioGroup/radioGroup.vue.js +5 -4
  101. package/lib/components/hySearch/cpns/searchItem.vue.js +164 -8
  102. package/lib/components/hySearch/js/index.js +2 -0
  103. package/lib/components/hySearch/search.vue.js +58 -7
  104. package/lib/components/hyTable/cpns/columnSelect.vue.js +20 -21
  105. package/lib/components/hyTable/cpns/virtualTable.vue.js +27 -32
  106. package/lib/components/hyTable/js/index.js +5 -12
  107. package/lib/components/hyTable/js/search.js +3 -1
  108. package/lib/components/hyTable/style/table.scss +13 -0
  109. package/lib/components/hyTable/table.vue.js +20 -8
  110. package/lib/components/hyTableActionButton/tableActionButton.vue.js +7 -9
  111. package/lib/components/hyTableForm/batchTableForm.vue.js +13 -3
  112. package/lib/components/hyTableForm/tableForm.vue.js +18 -12
  113. package/lib/components/hyTour/index.js +12 -0
  114. package/lib/components/hyTour/style/tour.scss +0 -0
  115. package/lib/components/hyTour/tour.vue.js +27 -0
  116. package/lib/components/hyTree/config/tree-config.js +5 -2
  117. package/lib/components/hyTree/js/index.js +11 -7
  118. package/lib/components/hyTree/tree.vue.js +18 -35
  119. package/lib/components/index.js +8 -6
  120. package/lib/index.js +67 -55
  121. package/lib/static/hy-svg-icons/hy-icon-ops-linear-arrow.js +10 -0
  122. package/lib/style/element/hy-element.scss +24 -3
  123. package/lib/style/theme.scss +1 -0
  124. package/lib/utils/map/hook/bigMap.js +9 -1
  125. package/lib/utils/map/hook/gaode.js +9 -1
  126. package/lib/utils/map/hook/leafletjs.js +10 -1
  127. package/lib/version.js +1 -1
  128. package/package.json +1 -1
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
6
  var elementPlus = require('element-plus');
7
+ var iconsVue = require('@element-plus/icons-vue');
7
8
  require('../../../utils/index.js');
8
9
  require('../../index.js');
9
10
  var index = require('../js/index.js');
@@ -64,7 +65,9 @@ const _sfc_main = {
64
65
  setup(__props) {
65
66
  const { t } = useLocale.useLocale();
66
67
  const props = __props;
68
+ const formContext = vue.inject(index.formContextKey);
67
69
  const formItemRef = vue.useTemplateRef("formItemRef");
70
+ const orgCascaderRef = vue.useTemplateRef("orgCascaderRef");
68
71
  const columnProp = vue.computed(() => {
69
72
  let field = is.isArray(props.column.field) ? props.column.field[0] : props.column.field;
70
73
  if (props.parentProp) {
@@ -72,6 +75,10 @@ const _sfc_main = {
72
75
  }
73
76
  return field;
74
77
  });
78
+ const propString = vue.computed(() => {
79
+ if (!columnProp.value) return "";
80
+ return is.isArray(columnProp.value) ? columnProp.value.join(".") : columnProp.value;
81
+ });
75
82
  const bindValue = vue.computed({
76
83
  get() {
77
84
  const prop = is.isArray(props.column.field) ? props.column.field[0] : props.column.field;
@@ -92,6 +99,12 @@ const _sfc_main = {
92
99
  form.setValueByProp(props.model, prop, val);
93
100
  }
94
101
  });
102
+ const columnConfig = vue.computed(() => {
103
+ return {
104
+ ...props.column,
105
+ attrs: columnAttrs.value
106
+ };
107
+ });
95
108
  const columnAttrs = vue.computed(() => {
96
109
  return {
97
110
  ...props.column.attrs,
@@ -99,6 +112,37 @@ const _sfc_main = {
99
112
  placeholder: form.columnPlaceholderHandler(props.column, props.model)
100
113
  };
101
114
  });
115
+ const optionsLoading = vue.ref(false);
116
+ const optionsError = vue.ref("");
117
+ async function obtainOptions() {
118
+ if (props.column.optionsFn) {
119
+ if (!props.column.optionsFn || optionsLoading.value) return;
120
+ optionsLoading.value = true;
121
+ optionsError.value = "";
122
+ props.column.attrs.options = [];
123
+ try {
124
+ props.column.attrs.options = await props.column.optionsFn(
125
+ props.column,
126
+ props.model
127
+ );
128
+ optionsError.value = "";
129
+ } catch (err) {
130
+ optionsError.value = "error";
131
+ console.error(err);
132
+ }
133
+ } else if (props.column.type === "org-cascader") {
134
+ if (orgCascaderRef.value) {
135
+ optionsLoading.value = true;
136
+ optionsError.value = "";
137
+ try {
138
+ await orgCascaderRef.value.getData();
139
+ } catch {
140
+ optionsError.value = "error";
141
+ }
142
+ }
143
+ }
144
+ optionsLoading.value = false;
145
+ }
102
146
  function getColumnRuleHandler(column, model) {
103
147
  if (!index.isRequired(props, column) && formItemRef.value) {
104
148
  formItemRef.value.clearValidate();
@@ -108,8 +152,29 @@ const _sfc_main = {
108
152
  function onChangeHandler() {
109
153
  const { onChange } = props.column;
110
154
  if (!onChange) return;
111
- onChange(props.column, props.model);
155
+ onChange(props.column, props.model, props.index);
112
156
  }
157
+ const context = vue.reactive({
158
+ ...vue.toRefs(props),
159
+ columnProp,
160
+ propString,
161
+ columnConfig,
162
+ columnAttrs,
163
+ obtainOptions,
164
+ optionsLoading,
165
+ optionsError,
166
+ options: vue.computed(() => {
167
+ return index.optionsHandler(props, props.column);
168
+ })
169
+ });
170
+ vue.onMounted(() => {
171
+ if (propString.value) {
172
+ formContext?.addField(context);
173
+ }
174
+ });
175
+ vue.onBeforeUnmount(() => {
176
+ formContext?.removeField(context);
177
+ });
113
178
  return (_ctx, _cache) => {
114
179
  return !vue.unref(index.columnVisibleHandler)(props, __props.column) ? (vue.openBlock(), vue.createElementBlock("div", {
115
180
  key: 0,
@@ -126,14 +191,14 @@ const _sfc_main = {
126
191
  id: __props.column.id,
127
192
  prop: columnProp.value,
128
193
  rules: getColumnRuleHandler(__props.column, props.model),
129
- style: vue.normalizeStyle(vue.unref(index.columnItemStyle)(props, __props.column))
130
- }, {
194
+ style: vue.normalizeStyle(vue.unref(index.columnItemStyle)(props, __props.column)),
195
+ error: optionsError.value
196
+ }, vue.createSlots({
131
197
  default: vue.withCtx(() => [
132
- vue.createCommentVNode(" \u8868\u5355\u9879label "),
133
198
  vue.createElementVNode("div", { class: "w-full flex justify-between text-main" }, [
134
199
  vue.createElementVNode("div", { class: "flex items-center" }, [
135
200
  vue.renderSlot(_ctx.$slots, __props.column.labelSlot, {
136
- column: __props.column,
201
+ column: columnConfig.value,
137
202
  model: __props.model,
138
203
  required: vue.unref(index.isRequired)(props, __props.column)
139
204
  }, () => [
@@ -162,7 +227,11 @@ const _sfc_main = {
162
227
  1
163
228
  /* TEXT */
164
229
  )) : vue.createCommentVNode("v-if", true),
165
- vue.renderSlot(_ctx.$slots, __props.column.tooltipContentSlot)
230
+ vue.renderSlot(_ctx.$slots, __props.column.tooltipContentSlot, {
231
+ column: columnConfig.value,
232
+ model: __props.model,
233
+ required: vue.unref(index.isRequired)(props, __props.column)
234
+ })
166
235
  ]),
167
236
  default: vue.withCtx(() => [
168
237
  vue.createElementVNode("span", { class: "text-xs text-theme ml-2" }, [
@@ -188,13 +257,12 @@ const _sfc_main = {
188
257
  class: "ml-2 flex items-center"
189
258
  }, [
190
259
  vue.renderSlot(_ctx.$slots, __props.column.rightSlot, {
191
- column: __props.column,
260
+ column: columnConfig.value,
192
261
  model: __props.model,
193
262
  required: vue.unref(index.isRequired)(props, __props.column)
194
263
  })
195
264
  ])) : vue.createCommentVNode("v-if", true)
196
265
  ]),
197
- vue.createCommentVNode(" \u5185\u5BB9\u4EC5\u67E5\u770B "),
198
266
  vue.unref(index.isReadonly)(props, __props.column) || !__props.column.type && !__props.column.slot ? (vue.openBlock(), vue.createElementBlock(
199
267
  "div",
200
268
  {
@@ -230,9 +298,10 @@ const _sfc_main = {
230
298
  vue.Fragment,
231
299
  { key: 1 },
232
300
  [
301
+ vue.createCommentVNode(" \u8868\u5355\u9879 "),
233
302
  vue.createCommentVNode(" \u81EA\u5B9A\u4E49\u5177\u540D\u63D2\u69FD "),
234
303
  __props.column.slot && _ctx.$slots[__props.column.slot] ? vue.renderSlot(_ctx.$slots, __props.column.slot, {
235
- column: __props.column,
304
+ column: columnConfig.value,
236
305
  model: __props.model,
237
306
  required: vue.unref(index.isRequired)(props, __props.column)
238
307
  }, void 0, void 0, 0) : __props.column.type === "input" ? (vue.openBlock(), vue.createElementBlock(
@@ -262,13 +331,75 @@ const _sfc_main = {
262
331
  disabled: vue.unref(index.isDisabled)(props, __props.column),
263
332
  options: vue.unref(index.optionsHandler)(props, __props.column),
264
333
  onChange: onChangeHandler
265
- }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "options"])
334
+ }), vue.createSlots({
335
+ _: 2
336
+ /* DYNAMIC */
337
+ }, [
338
+ optionsLoading.value ? {
339
+ name: "empty",
340
+ fn: vue.withCtx(() => [
341
+ vue.createElementVNode("div", { class: "w-full flex items-center justify-center py-2 gap-1.5 text-main text-xs whitespace-nowrap" }, [
342
+ vue.createVNode(vue.unref(elementPlus.ElIcon), {
343
+ size: "16",
344
+ class: "is-loading text-theme"
345
+ }, {
346
+ default: vue.withCtx(() => [
347
+ vue.createVNode(vue.unref(iconsVue.Loading))
348
+ ]),
349
+ _: 1
350
+ /* STABLE */
351
+ }),
352
+ vue.createElementVNode("span", null, "\u6570\u636E\u6B63\u5728\u52A0\u8F7D\u4E2D")
353
+ ])
354
+ ]),
355
+ key: "0"
356
+ } : void 0
357
+ ]), 1040, ["modelValue", "onUpdate:modelValue", "disabled", "options"])
266
358
  ],
267
359
  2112
268
360
  /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
269
- )) : __props.column.type === "date-picker" ? (vue.openBlock(), vue.createElementBlock(
361
+ )) : __props.column.type === "select-v2" ? (vue.openBlock(), vue.createElementBlock(
270
362
  vue.Fragment,
271
363
  { key: 3 },
364
+ [
365
+ vue.createCommentVNode(" \u865A\u62DF\u5316\u9009\u62E9\u6846 "),
366
+ vue.createVNode(vue.unref(elementPlus.ElSelectV2), vue.mergeProps({
367
+ modelValue: bindValue.value,
368
+ "onUpdate:modelValue": ($event) => bindValue.value = $event
369
+ }, columnAttrs.value, {
370
+ disabled: vue.unref(index.isDisabled)(props, __props.column),
371
+ options: vue.unref(index.optionsHandler)(props, __props.column),
372
+ onChange: onChangeHandler
373
+ }), vue.createSlots({
374
+ _: 2
375
+ /* DYNAMIC */
376
+ }, [
377
+ optionsLoading.value ? {
378
+ name: "empty",
379
+ fn: vue.withCtx(() => [
380
+ vue.createElementVNode("div", { class: "w-full flex items-center justify-center py-2 gap-1.5 text-main text-xs whitespace-nowrap" }, [
381
+ vue.createVNode(vue.unref(elementPlus.ElIcon), {
382
+ size: "16",
383
+ class: "is-loading text-theme"
384
+ }, {
385
+ default: vue.withCtx(() => [
386
+ vue.createVNode(vue.unref(iconsVue.Loading))
387
+ ]),
388
+ _: 1
389
+ /* STABLE */
390
+ }),
391
+ vue.createElementVNode("span", null, "\u6570\u636E\u6B63\u5728\u52A0\u8F7D\u4E2D")
392
+ ])
393
+ ]),
394
+ key: "0"
395
+ } : void 0
396
+ ]), 1040, ["modelValue", "onUpdate:modelValue", "disabled", "options"])
397
+ ],
398
+ 2112
399
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
400
+ )) : __props.column.type === "date-picker" ? (vue.openBlock(), vue.createElementBlock(
401
+ vue.Fragment,
402
+ { key: 4 },
272
403
  [
273
404
  vue.createCommentVNode(" \u65E5\u671F\u9009\u62E9\u6846 "),
274
405
  ["datetimerange", "daterange", "monthrange", "yearrange"].includes(
@@ -301,7 +432,7 @@ const _sfc_main = {
301
432
  /* STABLE_FRAGMENT */
302
433
  )) : __props.column.type === "time-picker" ? (vue.openBlock(), vue.createElementBlock(
303
434
  vue.Fragment,
304
- { key: 4 },
435
+ { key: 5 },
305
436
  [
306
437
  vue.createCommentVNode(" \u65F6\u95F4\u9009\u62E9\u6846 "),
307
438
  columnAttrs.value.isRange ? (vue.openBlock(), vue.createBlock(vue.unref(index$5.HyTimePicker), vue.mergeProps({
@@ -332,7 +463,7 @@ const _sfc_main = {
332
463
  /* STABLE_FRAGMENT */
333
464
  )) : __props.column.type === "radio" ? (vue.openBlock(), vue.createElementBlock(
334
465
  vue.Fragment,
335
- { key: 5 },
466
+ { key: 6 },
336
467
  [
337
468
  vue.createCommentVNode(" \u5355\u9009 "),
338
469
  vue.createVNode(vue.unref(elementPlus.ElRadioGroup), vue.mergeProps({
@@ -348,7 +479,7 @@ const _sfc_main = {
348
479
  /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
349
480
  )) : __props.column.type === "radio-group" ? (vue.openBlock(), vue.createElementBlock(
350
481
  vue.Fragment,
351
- { key: 6 },
482
+ { key: 7 },
352
483
  [
353
484
  vue.createCommentVNode(" \u5355\u9009\u6309\u94AE "),
354
485
  vue.createVNode(vue.unref(index$6.HyRadioGroup), vue.mergeProps({
@@ -365,7 +496,7 @@ const _sfc_main = {
365
496
  /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
366
497
  )) : __props.column.type === "checkbox" ? (vue.openBlock(), vue.createElementBlock(
367
498
  vue.Fragment,
368
- { key: 7 },
499
+ { key: 8 },
369
500
  [
370
501
  vue.createCommentVNode(" \u591A\u9009 "),
371
502
  vue.createVNode(vue.unref(elementPlus.ElCheckboxGroup), vue.mergeProps({
@@ -381,7 +512,7 @@ const _sfc_main = {
381
512
  /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
382
513
  )) : __props.column.type === "switch" ? (vue.openBlock(), vue.createElementBlock(
383
514
  vue.Fragment,
384
- { key: 8 },
515
+ { key: 9 },
385
516
  [
386
517
  vue.createCommentVNode(" \u5F00\u5173 "),
387
518
  vue.createVNode(vue.unref(elementPlus.ElSwitch), vue.mergeProps({
@@ -399,7 +530,7 @@ const _sfc_main = {
399
530
  /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
400
531
  )) : __props.column.type === "input-number" ? (vue.openBlock(), vue.createElementBlock(
401
532
  vue.Fragment,
402
- { key: 9 },
533
+ { key: 10 },
403
534
  [
404
535
  vue.createCommentVNode(" \u6570\u5B57\u8F93\u5165\u6846 "),
405
536
  vue.createVNode(vue.unref(elementPlus.ElInputNumber), vue.mergeProps({
@@ -414,10 +545,12 @@ const _sfc_main = {
414
545
  /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
415
546
  )) : __props.column.type === "org-cascader" ? (vue.openBlock(), vue.createElementBlock(
416
547
  vue.Fragment,
417
- { key: 10 },
548
+ { key: 11 },
418
549
  [
419
550
  vue.createCommentVNode(" \u90E8\u95E8\u7EA7\u8054\u9009\u62E9\u6846 "),
420
551
  vue.createVNode(vue.unref(index$7.HyOrgCascader), vue.mergeProps({
552
+ ref_key: "orgCascaderRef",
553
+ ref: orgCascaderRef,
421
554
  modelValue: bindValue.value,
422
555
  "onUpdate:modelValue": ($event) => bindValue.value = $event,
423
556
  class: "w-full"
@@ -430,17 +563,41 @@ const _sfc_main = {
430
563
  /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
431
564
  )) : __props.column.type === "cascader" ? (vue.openBlock(), vue.createElementBlock(
432
565
  vue.Fragment,
433
- { key: 11 },
566
+ { key: 12 },
434
567
  [
435
568
  vue.createCommentVNode(" \u7EA7\u8054\u9009\u62E9\u6846 "),
436
569
  vue.createVNode(vue.unref(elementPlus.ElCascader), vue.mergeProps({
437
570
  modelValue: bindValue.value,
438
571
  "onUpdate:modelValue": ($event) => bindValue.value = $event
439
572
  }, columnAttrs.value, {
573
+ class: "w-full",
440
574
  disabled: vue.unref(index.isDisabled)(props, __props.column),
441
575
  options: vue.unref(index.optionsHandler)(props, __props.column),
442
576
  onChange: onChangeHandler
443
- }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "options"])
577
+ }), vue.createSlots({
578
+ _: 2
579
+ /* DYNAMIC */
580
+ }, [
581
+ optionsLoading.value ? {
582
+ name: "empty",
583
+ fn: vue.withCtx(() => [
584
+ vue.createElementVNode("div", { class: "w-full flex items-center justify-center py-2 gap-1.5 text-main text-xs whitespace-nowrap" }, [
585
+ vue.createVNode(vue.unref(elementPlus.ElIcon), {
586
+ size: "16",
587
+ class: "is-loading text-theme"
588
+ }, {
589
+ default: vue.withCtx(() => [
590
+ vue.createVNode(vue.unref(iconsVue.Loading))
591
+ ]),
592
+ _: 1
593
+ /* STABLE */
594
+ }),
595
+ vue.createElementVNode("span", null, "\u6570\u636E\u6B63\u5728\u52A0\u8F7D\u4E2D")
596
+ ])
597
+ ]),
598
+ key: "0"
599
+ } : void 0
600
+ ]), 1040, ["modelValue", "onUpdate:modelValue", "disabled", "options"])
444
601
  ],
445
602
  2112
446
603
  /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
@@ -450,9 +607,24 @@ const _sfc_main = {
450
607
  /* STABLE_FRAGMENT */
451
608
  ))
452
609
  ]),
453
- _: 3
454
- /* FORWARDED */
455
- }, 8, ["id", "prop", "rules", "style"])) : vue.createCommentVNode("v-if", true);
610
+ _: 2
611
+ /* DYNAMIC */
612
+ }, [
613
+ optionsError.value ? {
614
+ name: "error",
615
+ fn: vue.withCtx(() => [
616
+ vue.createElementVNode("div", { class: "hy-el-form-item__error" }, [
617
+ vue.createElementVNode("span", null, "\u6570\u636E\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7"),
618
+ vue.createElementVNode("span", {
619
+ class: "text-theme cursor-pointer",
620
+ onClick: obtainOptions
621
+ }, "[\u91CD\u65B0\u52A0\u8F7D]"),
622
+ vue.createElementVNode("span", null, "\u6216\u8054\u7CFB\u7BA1\u7406\u5458")
623
+ ])
624
+ ]),
625
+ key: "0"
626
+ } : void 0
627
+ ]), 1032, ["id", "prop", "rules", "style", "error"])) : vue.createCommentVNode("v-if", true);
456
628
  };
457
629
  }
458
630
  };
@@ -236,6 +236,12 @@ const _sfc_main = {
236
236
  map.setView({ lat, lng }, mapConfig.maxZoom || 18);
237
237
  }
238
238
  }
239
+ function clearMarker() {
240
+ if (marker) {
241
+ marker.remove();
242
+ marker = null;
243
+ }
244
+ }
239
245
  function setMapSize() {
240
246
  emits("setMapSize");
241
247
  setTimeout(() => {
@@ -253,7 +259,8 @@ const _sfc_main = {
253
259
  hyMap = null;
254
260
  });
255
261
  __expose({
256
- setMarker
262
+ setMarker,
263
+ clearMarker
257
264
  });
258
265
  return (_ctx, _cache) => {
259
266
  return vue.openBlock(), vue.createElementBlock("div", { class: "w-full h-full flex flex-col" }, [
@@ -4,7 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
6
  var elementPlus = require('element-plus');
7
- require('@element-plus/icons-vue');
8
7
  require('../../hooks/index.js');
9
8
  require('../../utils/index.js');
10
9
  var formItem = require('./cpns/formItem.vue.js');
@@ -59,8 +58,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
59
58
  },
60
59
  emits: ["on-allMapSelect", "complete"],
61
60
  setup(__props, { expose: __expose, emit: __emit }) {
62
- const emit = __emit;
63
61
  const props = __props;
62
+ const emits = __emit;
64
63
  const { t } = useLocale.useLocale();
65
64
  const formTemplateRef = vue.useTemplateRef("formTemplateRef");
66
65
  const formColumnMap = vue.computed(() => {
@@ -83,52 +82,108 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
83
82
  const allMapSelect = vue.ref(false);
84
83
  function setMapSize() {
85
84
  allMapSelect.value = !allMapSelect.value;
86
- emit("on-allMapSelect", allMapSelect.value);
85
+ emits("on-allMapSelect", allMapSelect.value);
87
86
  }
88
87
  function complete() {
89
- emit("complete");
88
+ emits("complete");
90
89
  }
90
+ const fields = vue.reactive([]);
91
+ function addField(field) {
92
+ fields.push(field);
93
+ }
94
+ const removeField = (field) => {
95
+ if (vue.unref(field.columnAttrs)) {
96
+ fields.splice(fields.indexOf(field), 1);
97
+ }
98
+ };
99
+ function filterFields(fields2 = [], keys = []) {
100
+ const filterKeys = keys.map((prop) => is.isArray(prop) ? prop.join(".") : prop);
101
+ return filterKeys.length ? fields2.filter(
102
+ (field) => field.propString && filterKeys.includes(field.propString)
103
+ ) : fields2;
104
+ }
105
+ async function obtainOptionsFields(keys) {
106
+ const filteredFields = filterFields(fields, keys);
107
+ await Promise.allSettled(filteredFields.map((field) => field.obtainOptions()));
108
+ }
109
+ async function getOptions() {
110
+ await obtainOptionsFields();
111
+ }
112
+ async function getOptionsFields(keys) {
113
+ await obtainOptionsFields(keys);
114
+ }
115
+ async function getOptionsError() {
116
+ const filteredFields = fields.filter(
117
+ (field) => field.propString && field.optionsError
118
+ );
119
+ await Promise.allSettled(filteredFields.map((field) => field.obtainOptions()));
120
+ }
121
+ vue.provide(
122
+ index.formContextKey,
123
+ vue.reactive({
124
+ ...vue.toRefs(props),
125
+ emits,
126
+ addField,
127
+ removeField
128
+ })
129
+ );
130
+ vue.onMounted(() => {
131
+ getOptions();
132
+ });
91
133
  __expose({
92
134
  validate: async (callback) => {
93
135
  await vue.nextTick();
94
136
  return vue.unref(formTemplateRef).validate(callback);
95
137
  },
96
- validateField: async (fields) => {
138
+ validateField: async (fields2) => {
97
139
  await vue.nextTick();
98
- return vue.unref(formTemplateRef).validateField(fields);
140
+ return vue.unref(formTemplateRef).validateField(fields2);
99
141
  },
100
- resetFields: async (fields) => {
142
+ resetFields: async (fields2) => {
101
143
  let columns = props.columns || [];
102
- if (fields && fields?.length) {
103
- columns = fields.map((key) => formColumnMap.value.get(key)).filter(Boolean);
144
+ if (fields2 && fields2?.length) {
145
+ columns = fields2.map((key) => formColumnMap.value.get(key)).filter(Boolean);
104
146
  }
105
147
  useAppForm.resetAppFormValue(columns, props.model);
106
- vue.unref(formTemplateRef).clearValidate(fields);
148
+ vue.unref(formTemplateRef).clearValidate(fields2);
107
149
  },
108
- scrollToField: async (fields) => {
150
+ scrollToField: async (fields2) => {
109
151
  await vue.nextTick();
110
- vue.unref(formTemplateRef).scrollToField(fields);
152
+ vue.unref(formTemplateRef).scrollToField(fields2);
111
153
  },
112
- clearValidate: async (fields) => {
154
+ clearValidate: async (fields2) => {
113
155
  await vue.nextTick();
114
- vue.unref(formTemplateRef).clearValidate(fields);
156
+ vue.unref(formTemplateRef).clearValidate(fields2);
115
157
  },
116
158
  fields: vue.computed(() => {
117
159
  return vue.unref(formTemplateRef)?.fields || [];
118
160
  }),
119
- getField: async (fields) => {
161
+ getField: async (fields2) => {
120
162
  await vue.nextTick();
121
- return vue.unref(formTemplateRef).getField(fields);
163
+ return vue.unref(formTemplateRef).getField(fields2);
122
164
  },
123
165
  setMarker: (latlng) => {
124
166
  if (locationSelectRef.value) {
125
167
  is.isArray(locationSelectRef.value) ? locationSelectRef.value.map((item) => item.setMarker(latlng)) : locationSelectRef.value.setMarker(latlng);
126
168
  }
127
- }
169
+ },
170
+ clearMarker: () => {
171
+ if (locationSelectRef.value) {
172
+ is.isArray(locationSelectRef.value) ? locationSelectRef.value.map((item) => item.clearMarker()) : locationSelectRef.value.clearMarker();
173
+ }
174
+ },
128
175
  // setInitialValue: async (value) => {
129
176
  // await nextTick()
130
177
  // unref(formTemplateRef).setInitialValue(value)
131
178
  // }
179
+ getOptions,
180
+ getOptionsFields,
181
+ getOptionsError,
182
+ getOptionsByField: (field) => {
183
+ const [target] = filterFields(fields, [field]);
184
+ if (!target) return null;
185
+ return target.options;
186
+ }
132
187
  });
133
188
  return (_ctx, _cache) => {
134
189
  return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElForm), vue.mergeProps({
@@ -8,6 +8,7 @@ var is = require('../../../utils/is.js');
8
8
  var form = require('../../../utils/form.js');
9
9
  var useLocale = require('../../../hooks/useLocale.js');
10
10
 
11
+ const formContextKey = /* @__PURE__ */ Symbol("formContextKey");
11
12
  function columnItemStyle(props, column) {
12
13
  const style = {};
13
14
  let span = handler.funRunHandler(column.span, column, props.model);
@@ -125,6 +126,7 @@ exports.columnHelpHandler = columnHelpHandler;
125
126
  exports.columnItemStyle = columnItemStyle;
126
127
  exports.columnShowHandler = columnShowHandler;
127
128
  exports.columnVisibleHandler = columnVisibleHandler;
129
+ exports.formContextKey = formContextKey;
128
130
  exports.isDisabled = isDisabled;
129
131
  exports.isReadonly = isReadonly;
130
132
  exports.isRequired = isRequired;
@@ -29,7 +29,7 @@ function appFormItemHandler(column = {}) {
29
29
  ...attrs
30
30
  }
31
31
  };
32
- } else if (/^(radio|radio-group|checkbox|select)$/.test(column.type)) {
32
+ } else if (/^(radio|radio-group|checkbox|select|select-v2)$/.test(column.type)) {
33
33
  return {
34
34
  ...column,
35
35
  attrs: {
@@ -43,7 +43,7 @@ function appFormItemHandler(column = {}) {
43
43
  }
44
44
  }
45
45
  };
46
- } else if (/^(extra)$/.test(column.type) || /^(location-select)$/.test(column.type)) {
46
+ } else if (/^(extra|location-select)$/.test(column.type)) {
47
47
  return {
48
48
  ...column,
49
49
  children: (column.children || []).map((item) => appFormItemHandler(item))
@@ -6,6 +6,7 @@
6
6
  overflow: hidden;
7
7
  fill: currentColor;
8
8
  outline: none;
9
+ flex-shrink: 0;
9
10
  }
10
11
  .hy-button {
11
12
  .hy-icon {
@@ -30,7 +30,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
30
30
  return vue.openBlock(), vue.createElementBlock("div", { class: "w-full h-full bg-background-2 text-auxiliary text-base flex flex-col items-center justify-center" }, [
31
31
  vue.createVNode(vue.unref(index.HyIcon), {
32
32
  "svg-name": __props.svgName,
33
- "class-name": "!w-[46px] !h-[46px]"
33
+ "class-name": "!w-[56px] !h-[56px]"
34
34
  }, null, 8, ["svg-name"]),
35
35
  vue.createElementVNode("div", { class: "text-center mt-[12px]" }, [
36
36
  vue.createElementVNode(
@@ -30,7 +30,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
30
30
  return vue.openBlock(), vue.createElementBlock("div", { class: "w-full h-full bg-background-2 text-auxiliary text-base flex flex-col items-center justify-center" }, [
31
31
  vue.createVNode(vue.unref(index.HyIcon), {
32
32
  "svg-name": __props.svgName,
33
- "class-name": "!w-[46px] !h-[46px]"
33
+ "class-name": "!w-[56px] !h-[56px]"
34
34
  }, null, 8, ["svg-name"]),
35
35
  vue.createElementVNode("div", { class: "text-center mt-[12px]" }, [
36
36
  vue.createElementVNode(