hy-dispatch-ui-v3 0.2.64 → 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 +75 -68
  55. package/es/components/hyTree/tree.vue.mjs +19 -36
  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 +75 -68
  118. package/lib/components/hyTree/tree.vue.js +19 -36
  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
@@ -1,5 +1,6 @@
1
- import { defineComponent, useModel, useTemplateRef, ref, computed, watch, onUnmounted, openBlock, createElementBlock, createElementVNode, normalizeStyle, createVNode, unref, renderSlot, toDisplayString, createCommentVNode, createBlock, normalizeClass, mergeModels } from 'vue';
2
- import { ElCascader } from 'element-plus';
1
+ import { defineComponent, useModel, useTemplateRef, ref, computed, watch, onUnmounted, openBlock, createElementBlock, createElementVNode, normalizeStyle, createVNode, unref, createSlots, withCtx, renderSlot, toDisplayString, createCommentVNode, createBlock, normalizeClass, mergeModels } from 'vue';
2
+ import { ElCascader, ElIcon } from 'element-plus';
3
+ import { Loading } from '@element-plus/icons-vue';
3
4
  import '../../hooks/index.mjs';
4
5
  import { getOrgTreeSimple, orgTreeDatahandler } from './js/index.mjs';
5
6
  import { useSubscribe } from '../../hooks/useSubscribe.mjs';
@@ -80,7 +81,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
80
81
  "modelModifiers": {}
81
82
  }),
82
83
  emits: /* @__PURE__ */ mergeModels(["change"], ["update:modelValue"]),
83
- setup(__props, { emit: __emit }) {
84
+ setup(__props, { expose: __expose, emit: __emit }) {
84
85
  const props = __props;
85
86
  const emits = __emit;
86
87
  const { subOrgCascader, unsubOrgCascader } = useSubscribe();
@@ -95,11 +96,20 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
95
96
  const target = cascaderValueMap.value.get(modelValue.value);
96
97
  return target?.companyName;
97
98
  });
98
- async function getCascaderData() {
99
- loading.value = true;
100
- const data = await getOrgTreeSimple();
101
- handlerData(data || []);
102
- loading.value = false;
99
+ function getCascaderData() {
100
+ return new Promise(async (resolve, reject) => {
101
+ loading.value = true;
102
+ try {
103
+ cascaderOptions.value = [];
104
+ const data = await getOrgTreeSimple();
105
+ handlerData(data || []);
106
+ resolve();
107
+ } catch (err) {
108
+ console.error(err);
109
+ reject();
110
+ }
111
+ loading.value = false;
112
+ });
103
113
  }
104
114
  function handlerData(data) {
105
115
  const { cascaderData, cascaderDataMap } = orgTreeDatahandler(data);
@@ -153,6 +163,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
153
163
  onUnmounted(() => {
154
164
  unsubOrgCascader(getCascaderData);
155
165
  });
166
+ __expose({
167
+ getData: getCascaderData
168
+ });
156
169
  return (_ctx, _cache) => {
157
170
  return openBlock(), createElementBlock("div", { class: "relative" }, [
158
171
  __props.contentType ? (openBlock(), createElementBlock("div", {
@@ -186,7 +199,30 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
186
199
  "virtual-scroll": "",
187
200
  onChange: onChangeHanlder,
188
201
  onVisibleChange: ($event) => onVisibleChangeHandler($event)
189
- }, null, 8, ["modelValue", "onUpdate:modelValue", "size", "options", "disabled", "clearable", "placeholder", "onVisibleChange"])
202
+ }, createSlots({
203
+ _: 2
204
+ /* DYNAMIC */
205
+ }, [
206
+ loading.value ? {
207
+ name: "empty",
208
+ fn: withCtx(() => [
209
+ createElementVNode("div", { class: "w-full flex items-center justify-center py-2 gap-1.5 text-main text-xs whitespace-nowrap" }, [
210
+ createVNode(unref(ElIcon), {
211
+ size: "16",
212
+ class: "is-loading text-theme"
213
+ }, {
214
+ default: withCtx(() => [
215
+ createVNode(unref(Loading))
216
+ ]),
217
+ _: 1
218
+ /* STABLE */
219
+ }),
220
+ createElementVNode("span", null, "\u6570\u636E\u6B63\u5728\u52A0\u8F7D\u4E2D")
221
+ ])
222
+ ]),
223
+ key: "0"
224
+ } : void 0
225
+ ]), 1032, ["modelValue", "onUpdate:modelValue", "size", "options", "disabled", "clearable", "placeholder", "onVisibleChange"])
190
226
  ],
191
227
  4
192
228
  /* STYLE */
@@ -225,11 +261,30 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
225
261
  "show-all-levels": false,
226
262
  "virtual-scroll": "",
227
263
  onChange: onChangeHanlder
228
- }, null, 8, ["modelValue", "onUpdate:modelValue", "class", "size", "options", "clearable", "disabled", "placeholder"])),
229
- loading.value ? (openBlock(), createElementBlock("div", {
230
- key: 2,
231
- class: "absolute left-0 right-0 top-0 bottom-0 cursor-wait"
232
- })) : createCommentVNode("v-if", true)
264
+ }, createSlots({
265
+ _: 2
266
+ /* DYNAMIC */
267
+ }, [
268
+ loading.value ? {
269
+ name: "empty",
270
+ fn: withCtx(() => [
271
+ createElementVNode("div", { class: "w-full flex items-center justify-center py-2 gap-1.5 text-main text-xs whitespace-nowrap" }, [
272
+ createVNode(unref(ElIcon), {
273
+ size: "16",
274
+ class: "is-loading text-theme"
275
+ }, {
276
+ default: withCtx(() => [
277
+ createVNode(unref(Loading))
278
+ ]),
279
+ _: 1
280
+ /* STABLE */
281
+ }),
282
+ createElementVNode("span", null, "\u6570\u636E\u6B63\u5728\u52A0\u8F7D\u4E2D")
283
+ ])
284
+ ]),
285
+ key: "0"
286
+ } : void 0
287
+ ]), 1032, ["modelValue", "onUpdate:modelValue", "class", "size", "options", "clearable", "disabled", "placeholder"]))
233
288
  ]);
234
289
  };
235
290
  }
@@ -41,8 +41,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
41
41
  };
42
42
  });
43
43
  function switchSelect(target) {
44
- modelValue.value = target[radioProps.value.value];
45
- emits("change", modelValue.value);
44
+ const value = target[radioProps.value.value];
45
+ if (modelValue.value === value) return;
46
+ modelValue.value = value;
47
+ emits("change", value);
46
48
  }
47
49
  async function sliderHandler() {
48
50
  selectIndex.value = props.options.findIndex((item) => {
@@ -53,7 +55,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
53
55
  if (slider) {
54
56
  const proportion = 100 / props.options.length;
55
57
  const left = selectIndex.value > 0 ? selectIndex.value * proportion : 0;
56
- console.log("proportion", proportion, left, selectIndex.value);
57
58
  slider.style.left = `${left}%`;
58
59
  }
59
60
  }
@@ -81,7 +82,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
81
82
  renderList(__props.options, (item, index) => {
82
83
  return openBlock(), createElementBlock("li", {
83
84
  key: index,
84
- class: "w-0 flex-1 flex items-center justify-center text-main clickBox",
85
+ class: "w-0 flex-1 flex items-center justify-center text-main user-select-none clickBox",
85
86
  onClick: ($event) => switchSelect(item, index, $event)
86
87
  }, [
87
88
  renderSlot(_ctx.$slots, "default", {
@@ -1,8 +1,9 @@
1
- import { computed, unref, openBlock, createBlock, withCtx, createElementVNode, normalizeStyle, createCommentVNode, normalizeClass, renderSlot, createElementBlock, toDisplayString, Fragment, createVNode, mergeProps, withKeys, renderList } from 'vue';
2
- import { ElFormItem, ElSelect, ElCascader } from 'element-plus';
1
+ import { inject, useTemplateRef, computed, ref, reactive, toRefs, onMounted, onBeforeUnmount, unref, openBlock, createBlock, withCtx, createElementVNode, normalizeStyle, createCommentVNode, normalizeClass, renderSlot, createElementBlock, toDisplayString, Fragment, createVNode, mergeProps, withKeys, createSlots, renderList } from 'vue';
2
+ import { ElFormItem, ElSelect, ElIcon, ElSelectV2, ElCascader } from 'element-plus';
3
+ import { Loading } from '@element-plus/icons-vue';
3
4
  import '../../../utils/index.mjs';
4
5
  import '../../index.mjs';
5
- import { timeRangeHandler, columnShowHandler, columnItemStyle, columnItemInputStyle, isDisabled, optionsHandler, isSelectedTimeRange } from '../js/index.mjs';
6
+ import { formContextKey, timeRangeHandler, optionsHandler, columnShowHandler, columnItemStyle, columnItemInputStyle, isDisabled, isSelectedTimeRange } from '../js/index.mjs';
6
7
  import { isArray } from '../../../utils/is.mjs';
7
8
  import { setValueByProp, getValueByProp, columnPlaceholderHandler, columnLabelHandler } from '../../../utils/form.mjs';
8
9
  import { HyInput } from '../../hyInput/index.mjs';
@@ -34,10 +35,16 @@ const _sfc_main = {
34
35
  setup(__props, { emit: __emit }) {
35
36
  const props = __props;
36
37
  const emits = __emit;
38
+ const formContext = inject(formContextKey);
39
+ const orgCascaderRef = useTemplateRef("orgCascaderRef");
37
40
  const columnProp = computed(() => {
38
41
  let field = isArray(props.column.field) ? props.column.field[0] : props.column.field;
39
42
  return field;
40
43
  });
44
+ const propString = computed(() => {
45
+ if (!columnProp.value) return "";
46
+ return isArray(columnProp.value) ? columnProp.value.join(".") : columnProp.value;
47
+ });
41
48
  const bindValue = computed({
42
49
  get() {
43
50
  const prop = isArray(props.column.field) ? props.column.field[0] : props.column.field;
@@ -58,6 +65,12 @@ const _sfc_main = {
58
65
  setValueByProp(props.model, prop, val);
59
66
  }
60
67
  });
68
+ const columnConfig = computed(() => {
69
+ return {
70
+ ...props.column,
71
+ attrs: columnAttrs.value
72
+ };
73
+ });
61
74
  const columnAttrs = computed(() => {
62
75
  return {
63
76
  ...props.column.attrs,
@@ -65,8 +78,42 @@ const _sfc_main = {
65
78
  placeholder: columnPlaceholderHandler(props.column, props.model)
66
79
  };
67
80
  });
81
+ const optionsLoading = ref(false);
82
+ const optionsError = ref("");
83
+ async function obtainOptions() {
84
+ if (props.column.optionsFn) {
85
+ if (!props.column.optionsFn || optionsLoading.value) return;
86
+ optionsLoading.value = true;
87
+ optionsError.value = "";
88
+ props.column.attrs.options = [];
89
+ try {
90
+ props.column.attrs.options = await props.column.optionsFn(
91
+ props.column,
92
+ props.model
93
+ );
94
+ optionsError.value = "";
95
+ } catch (err) {
96
+ optionsError.value = "error";
97
+ console.error(err);
98
+ }
99
+ } else if (props.column.type === "org-cascader") {
100
+ if (orgCascaderRef.value) {
101
+ optionsLoading.value = true;
102
+ optionsError.value = "";
103
+ try {
104
+ await orgCascaderRef.value.getData();
105
+ } catch {
106
+ optionsError.value = "error";
107
+ }
108
+ }
109
+ }
110
+ optionsLoading.value = false;
111
+ }
68
112
  function onChangeHandler(value, column) {
113
+ const { onChange } = props.column;
69
114
  emits("search");
115
+ if (!onChange) return;
116
+ onChange(props.column, props.model, props.index);
70
117
  }
71
118
  function onKeydownEnterHander(e) {
72
119
  emits("search");
@@ -86,6 +133,27 @@ const _sfc_main = {
86
133
  }
87
134
  emits("search");
88
135
  }
136
+ const context = reactive({
137
+ ...toRefs(props),
138
+ columnProp,
139
+ propString,
140
+ columnConfig,
141
+ columnAttrs,
142
+ obtainOptions,
143
+ optionsLoading,
144
+ optionsError,
145
+ options: computed(() => {
146
+ return optionsHandler(props, props.column);
147
+ })
148
+ });
149
+ onMounted(() => {
150
+ if (propString.value) {
151
+ formContext?.addField(context);
152
+ }
153
+ });
154
+ onBeforeUnmount(() => {
155
+ formContext?.removeField(context);
156
+ });
89
157
  return (_ctx, _cache) => {
90
158
  return unref(columnShowHandler)(props, __props.column) ? (openBlock(), createBlock(unref(ElFormItem), {
91
159
  key: 0,
@@ -109,7 +177,7 @@ const _sfc_main = {
109
177
  }])
110
178
  },
111
179
  [
112
- __props.column.labelSlot && _ctx.$slots[__props.column.labelSlot] ? renderSlot(_ctx.$slots, __props.column.labelSlot, { column: __props.column }, void 0, void 0, 0) : (openBlock(), createElementBlock(
180
+ __props.column.labelSlot && _ctx.$slots[__props.column.labelSlot] ? renderSlot(_ctx.$slots, __props.column.labelSlot, { column: columnConfig.value }, void 0, void 0, 0) : (openBlock(), createElementBlock(
113
181
  "span",
114
182
  { key: 1 },
115
183
  toDisplayString(unref(columnLabelHandler)(__props.column, props.model)),
@@ -129,7 +197,7 @@ const _sfc_main = {
129
197
  },
130
198
  [
131
199
  createCommentVNode(" \u81EA\u5B9A\u4E49\u5177\u540D\u63D2\u69FD "),
132
- __props.column.slot ? renderSlot(_ctx.$slots, __props.column.slot, { column: __props.column }, void 0, void 0, 0) : __props.column.type === "input" ? (openBlock(), createElementBlock(
200
+ __props.column.slot ? renderSlot(_ctx.$slots, __props.column.slot, { column: columnConfig.value }, void 0, void 0, 0) : __props.column.type === "input" ? (openBlock(), createElementBlock(
133
201
  Fragment,
134
202
  { key: 1 },
135
203
  [
@@ -157,13 +225,75 @@ const _sfc_main = {
157
225
  disabled: unref(isDisabled)(props, __props.column),
158
226
  options: unref(optionsHandler)(props, __props.column),
159
227
  onChange: ($event) => onChangeHandler($event, __props.column)
160
- }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "options", "onChange"])
228
+ }), createSlots({
229
+ _: 2
230
+ /* DYNAMIC */
231
+ }, [
232
+ optionsLoading.value ? {
233
+ name: "empty",
234
+ fn: withCtx(() => [
235
+ createElementVNode("div", { class: "w-full flex items-center justify-center py-2 gap-1.5 text-main text-xs whitespace-nowrap" }, [
236
+ createVNode(unref(ElIcon), {
237
+ size: "16",
238
+ class: "is-loading text-theme"
239
+ }, {
240
+ default: withCtx(() => [
241
+ createVNode(unref(Loading))
242
+ ]),
243
+ _: 1
244
+ /* STABLE */
245
+ }),
246
+ createElementVNode("span", null, "\u6570\u636E\u6B63\u5728\u52A0\u8F7D\u4E2D")
247
+ ])
248
+ ]),
249
+ key: "0"
250
+ } : void 0
251
+ ]), 1040, ["modelValue", "onUpdate:modelValue", "disabled", "options", "onChange"])
161
252
  ],
162
253
  2112
163
254
  /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
164
- )) : __props.column.type === "date-picker" ? (openBlock(), createElementBlock(
255
+ )) : __props.column.type === "select-v2" ? (openBlock(), createElementBlock(
165
256
  Fragment,
166
257
  { key: 3 },
258
+ [
259
+ createCommentVNode(" \u865A\u62DF\u5316\u9009\u62E9\u6846 "),
260
+ createVNode(unref(ElSelectV2), mergeProps({
261
+ modelValue: bindValue.value,
262
+ "onUpdate:modelValue": ($event) => bindValue.value = $event
263
+ }, columnAttrs.value, {
264
+ disabled: unref(isDisabled)(props, __props.column),
265
+ options: unref(optionsHandler)(props, __props.column),
266
+ onChange: onChangeHandler
267
+ }), createSlots({
268
+ _: 2
269
+ /* DYNAMIC */
270
+ }, [
271
+ optionsLoading.value ? {
272
+ name: "empty",
273
+ fn: withCtx(() => [
274
+ createElementVNode("div", { class: "w-full flex items-center justify-center py-2 gap-1.5 text-main text-xs whitespace-nowrap" }, [
275
+ createVNode(unref(ElIcon), {
276
+ size: "16",
277
+ class: "is-loading text-theme"
278
+ }, {
279
+ default: withCtx(() => [
280
+ createVNode(unref(Loading))
281
+ ]),
282
+ _: 1
283
+ /* STABLE */
284
+ }),
285
+ createElementVNode("span", null, "\u6570\u636E\u6B63\u5728\u52A0\u8F7D\u4E2D")
286
+ ])
287
+ ]),
288
+ key: "0"
289
+ } : void 0
290
+ ]), 1040, ["modelValue", "onUpdate:modelValue", "disabled", "options"])
291
+ ],
292
+ 2112
293
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
294
+ )) : __props.column.type === "date-picker" ? (openBlock(), createElementBlock(
295
+ Fragment,
296
+ { key: 4 },
167
297
  [
168
298
  createCommentVNode(" \u65E5\u671F\u9009\u62E9\u6846 "),
169
299
  [
@@ -199,7 +329,7 @@ const _sfc_main = {
199
329
  /* STABLE_FRAGMENT */
200
330
  )) : __props.column.type === "time-picker" ? (openBlock(), createElementBlock(
201
331
  Fragment,
202
- { key: 4 },
332
+ { key: 5 },
203
333
  [
204
334
  createCommentVNode(" \u65F6\u95F4\u9009\u62E9\u6846 "),
205
335
  columnAttrs.value.isRange ? (openBlock(), createBlock(unref(HyTimePicker), mergeProps({
@@ -228,10 +358,12 @@ const _sfc_main = {
228
358
  /* STABLE_FRAGMENT */
229
359
  )) : __props.column.type === "org-cascader" ? (openBlock(), createElementBlock(
230
360
  Fragment,
231
- { key: 5 },
361
+ { key: 6 },
232
362
  [
233
363
  createCommentVNode(" \u90E8\u95E8\u7EA7\u8054\u9009\u62E9\u6846 "),
234
364
  createVNode(unref(HyOrgCascader), mergeProps({
365
+ ref_key: "orgCascaderRef",
366
+ ref: orgCascaderRef,
235
367
  modelValue: bindValue.value,
236
368
  "onUpdate:modelValue": ($event) => bindValue.value = $event
237
369
  }, columnAttrs.value, {
@@ -243,17 +375,41 @@ const _sfc_main = {
243
375
  /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
244
376
  )) : __props.column.type === "cascader" ? (openBlock(), createElementBlock(
245
377
  Fragment,
246
- { key: 6 },
378
+ { key: 7 },
247
379
  [
248
380
  createCommentVNode(" \u7EA7\u8054\u9009\u62E9\u6846 "),
249
381
  createVNode(unref(ElCascader), mergeProps({
250
382
  modelValue: bindValue.value,
251
383
  "onUpdate:modelValue": ($event) => bindValue.value = $event
252
384
  }, columnAttrs.value, {
385
+ style: { "width": "100%" },
253
386
  disabled: unref(isDisabled)(props, __props.column),
254
387
  options: unref(optionsHandler)(props, __props.column),
255
388
  onChange: onChangeHandler
256
- }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "options"])
389
+ }), createSlots({
390
+ _: 2
391
+ /* DYNAMIC */
392
+ }, [
393
+ optionsLoading.value ? {
394
+ name: "empty",
395
+ fn: withCtx(() => [
396
+ createElementVNode("div", { class: "w-full flex items-center justify-center py-2 gap-1.5 text-main text-xs whitespace-nowrap" }, [
397
+ createVNode(unref(ElIcon), {
398
+ size: "16",
399
+ class: "is-loading text-theme"
400
+ }, {
401
+ default: withCtx(() => [
402
+ createVNode(unref(Loading))
403
+ ]),
404
+ _: 1
405
+ /* STABLE */
406
+ }),
407
+ createElementVNode("span", null, "\u6570\u636E\u6B63\u5728\u52A0\u8F7D\u4E2D")
408
+ ])
409
+ ]),
410
+ key: "0"
411
+ } : void 0
412
+ ]), 1040, ["modelValue", "onUpdate:modelValue", "disabled", "options"])
257
413
  ],
258
414
  2112
259
415
  /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
@@ -5,6 +5,7 @@ import '../../../hooks/index.mjs';
5
5
  import { isNumber, isString, isBoolean, isFunction, isEmpty, isArray } from '../../../utils/is.mjs';
6
6
  import { useResizeObserver } from '../../../hooks/useResizeObserver.mjs';
7
7
 
8
+ const formContextKey = /* @__PURE__ */ Symbol("formContextKey");
8
9
  function columnItemStyle(props, column) {
9
10
  const { width } = column;
10
11
  const style = {};
@@ -138,4 +139,4 @@ function optionsHandler(props, column) {
138
139
  return [];
139
140
  }
140
141
 
141
- export { columnItemInputStyle, columnItemStyle, columnShowHandler, isDisabled, isEmptyValue, isSelectedTimeRange, optionsHandler, timeRangeHandler, useShrink };
142
+ export { columnItemInputStyle, columnItemStyle, columnShowHandler, formContextKey, isDisabled, isEmptyValue, isSelectedTimeRange, optionsHandler, timeRangeHandler, useShrink };
@@ -1,11 +1,11 @@
1
- import { defineComponent, useTemplateRef, computed, unref, onUnmounted, openBlock, createElementBlock, normalizeClass, createElementVNode, createVNode, toDisplayString, Fragment, createCommentVNode, withDirectives, normalizeStyle, withCtx, vShow, mergeProps, renderList, createBlock, createSlots, renderSlot } from 'vue';
1
+ import { defineComponent, useTemplateRef, computed, unref, reactive, provide, toRefs, onMounted, onUnmounted, openBlock, createElementBlock, normalizeClass, createElementVNode, createVNode, toDisplayString, Fragment, createCommentVNode, withDirectives, normalizeStyle, withCtx, vShow, mergeProps, renderList, createBlock, createSlots, renderSlot } from 'vue';
2
2
  import { ElIcon, ElForm } from 'element-plus';
3
3
  import { ArrowDown } from '@element-plus/icons-vue';
4
4
  import '../../hooks/index.mjs';
5
5
  import '../../utils/index.mjs';
6
6
  import '../index.mjs';
7
7
  import _sfc_main$1 from './cpns/searchItem.vue.mjs';
8
- import { useShrink, isEmptyValue } from './js/index.mjs';
8
+ import { useShrink, isEmptyValue, formContextKey } from './js/index.mjs';
9
9
  import { resetAppSearchValue } from './js/useAppSearch.mjs';
10
10
  import { useLocale } from '../../hooks/useLocale.mjs';
11
11
  import { isArray, isObject } from '../../utils/is.mjs';
@@ -80,9 +80,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
80
80
  }
81
81
  return style;
82
82
  });
83
- onUnmounted(() => {
84
- shrinkDestroy();
85
- });
86
83
  function getFilterCount(model, defaultValue, prop) {
87
84
  let count = 0;
88
85
  const keys = Object.keys(defaultValue);
@@ -110,10 +107,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
110
107
  function onSearchHandler() {
111
108
  emits("search");
112
109
  }
113
- function resetFields(fields) {
110
+ function resetFields(fields2) {
114
111
  let columns = props.columns || [];
115
- if (fields && fields?.length) {
116
- columns = fields.map((key) => formColumnMap.value.get(key)).filter(Boolean);
112
+ if (fields2 && fields2?.length) {
113
+ columns = fields2.map((key) => formColumnMap.value.get(key)).filter(Boolean);
117
114
  }
118
115
  resetAppSearchValue(columns, props.model);
119
116
  }
@@ -121,8 +118,62 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
121
118
  resetFields();
122
119
  emits("search");
123
120
  }
121
+ const fields = reactive([]);
122
+ function addField(field) {
123
+ fields.push(field);
124
+ }
125
+ const removeField = (field) => {
126
+ if (unref(field.columnAttrs)) {
127
+ fields.splice(fields.indexOf(field), 1);
128
+ }
129
+ };
130
+ function filterFields(fields2 = [], keys = []) {
131
+ const filterKeys = keys.map((prop) => isArray(prop) ? prop.join(".") : prop);
132
+ return filterKeys.length ? fields2.filter(
133
+ (field) => field.propString && filterKeys.includes(field.propString)
134
+ ) : fields2;
135
+ }
136
+ async function obtainOptionsFields(keys) {
137
+ const filteredFields = filterFields(fields, keys);
138
+ await Promise.allSettled(filteredFields.map((field) => field.obtainOptions()));
139
+ }
140
+ async function getOptions() {
141
+ await obtainOptionsFields();
142
+ }
143
+ async function getOptionsFields(keys) {
144
+ await obtainOptionsFields(keys);
145
+ }
146
+ async function getOptionsError() {
147
+ const filteredFields = fields.filter(
148
+ (field) => field.propString && field.optionsError
149
+ );
150
+ await Promise.allSettled(filteredFields.map((field) => field.obtainOptions()));
151
+ }
152
+ provide(
153
+ formContextKey,
154
+ reactive({
155
+ ...toRefs(props),
156
+ emits,
157
+ addField,
158
+ removeField
159
+ })
160
+ );
161
+ onMounted(() => {
162
+ getOptions();
163
+ });
164
+ onUnmounted(() => {
165
+ shrinkDestroy();
166
+ });
124
167
  __expose({
125
- resetFields
168
+ resetFields,
169
+ getOptions,
170
+ getOptionsFields,
171
+ getOptionsError,
172
+ getOptionsByField: (field) => {
173
+ const [target] = filterFields(fields, [field]);
174
+ if (!target) return null;
175
+ return target.options;
176
+ }
126
177
  });
127
178
  return (_ctx, _cache) => {
128
179
  return openBlock(), createElementBlock(
@@ -1,7 +1,6 @@
1
1
  import { useTemplateRef, ref, computed, unref, nextTick, watch, openBlock, createBlock, withCtx, createElementVNode, toDisplayString, createVNode, normalizeClass, createCommentVNode, createElementBlock, Fragment, renderList, createTextVNode } from 'vue';
2
2
  import Sortable from 'sortablejs';
3
- import { ElMessage, ElPopover, ElCheckboxGroup, ElIcon } from 'element-plus';
4
- import { Warning } from '@element-plus/icons-vue';
3
+ import { ElMessage, ElPopover, ElCheckboxGroup } from 'element-plus';
5
4
  import '../../../hooks/index.mjs';
6
5
  import '../../../utils/index.mjs';
7
6
  import '../../index.mjs';
@@ -49,7 +48,7 @@ const _sfc_main = {
49
48
  function showPopover() {
50
49
  initColumnsInfo(props.columns, props.columnsEditable);
51
50
  rowDrag();
52
- showClear.value = true;
51
+ showReset.value = true;
53
52
  }
54
53
  function closePopover() {
55
54
  sortableInstance?.destroy?.();
@@ -73,7 +72,7 @@ const _sfc_main = {
73
72
  tableEditableColumns.value = columnArr;
74
73
  checkedList.value = checkedArr;
75
74
  }
76
- const showClear = ref(true);
75
+ const showReset = ref(true);
77
76
  const checkedList = ref([]);
78
77
  const checkMap = computed(() => {
79
78
  return (unref(checkedList) || []).reduce((map, item) => {
@@ -90,7 +89,7 @@ const _sfc_main = {
90
89
  } else {
91
90
  checkedList.value.push(target.prop);
92
91
  }
93
- showClear.value = true;
92
+ showReset.value = true;
94
93
  }
95
94
  function onConfirmHandler() {
96
95
  if (!checkedList.value.length && showColumnsLength.value === tableEditableColumns.value?.length) {
@@ -117,7 +116,7 @@ const _sfc_main = {
117
116
  props.originColumns
118
117
  );
119
118
  initColumnsInfo(columnsList, columnsEditablele);
120
- showClear.value = false;
119
+ showReset.value = false;
121
120
  }
122
121
  let sortableInstance;
123
122
  async function rowDrag() {
@@ -145,7 +144,7 @@ const _sfc_main = {
145
144
  for (let i = minIndex; i <= maxIndex; i++) {
146
145
  tableEditableColumns.value[i].sortIndex = sortList[i];
147
146
  }
148
- showClear.value = true;
147
+ showReset.value = true;
149
148
  }
150
149
  });
151
150
  }
@@ -168,7 +167,7 @@ const _sfc_main = {
168
167
  ref: popoverRef,
169
168
  trigger: "click",
170
169
  placement: "left-start",
171
- "popper-class": "!bg-background !p-0 border !border-theme",
170
+ "popper-class": "!bg-[rgba(var(--hy-background),0.7)] !p-0 border !border-theme",
172
171
  effect: "dark",
173
172
  width: "400",
174
173
  "show-arrow": false,
@@ -177,8 +176,7 @@ const _sfc_main = {
177
176
  },
178
177
  {
179
178
  reference: withCtx(() => [
180
- createElementVNode("div", { class: "flex items-center gap-[10px] clickBox px-3 rounded hover:bg-background-2" }, [
181
- createCommentVNode(" <el-icon><Edit /></el-icon> "),
179
+ createElementVNode("div", { class: "h-[32px] flex items-center gap-[10px] clickBox px-3 rounded hover:bg-background-2" }, [
182
180
  createVNode(unref(HyIcon), {
183
181
  "svg-name": "ops-button-edit-column",
184
182
  "class-name": "!w-3 !h-3"
@@ -208,7 +206,14 @@ const _sfc_main = {
208
206
  onClick: closePopover
209
207
  })
210
208
  ]),
211
- createElementVNode("div", { class: "h-[364px] px-4 pt-[11px] pb-1 scroll-body overflow-y-auto" }, [
209
+ createElementVNode("div", { class: "flex items-center gap-1.5 px-4 py-2.5 text-xs text-theme" }, [
210
+ createVNode(unref(HyIcon), {
211
+ "svg-name": "dispatch-share1-prompt",
212
+ "class-name": "!w-3 !h-3"
213
+ }),
214
+ createElementVNode("span", null, "\u5728\u53F3\u4FA7\u62D6\u52A8\u5217\u53EF\u8FDB\u884C\u8FDB\u884C\u6392\u5E8F")
215
+ ]),
216
+ createElementVNode("div", { class: "h-[364px] p-4 pt-0 pb-1 scroll-body overflow-y-auto" }, [
212
217
  createVNode(unref(ElCheckboxGroup), {
213
218
  modelValue: checkedList.value,
214
219
  "onUpdate:modelValue": ($event) => checkedList.value = $event
@@ -288,14 +293,14 @@ const _sfc_main = {
288
293
  1
289
294
  /* TEXT */
290
295
  ),
291
- showClear.value ? (openBlock(), createElementBlock(
296
+ showReset.value ? (openBlock(), createElementBlock(
292
297
  "span",
293
298
  {
294
299
  key: 0,
295
300
  class: "clickBox text-danger-2 ml-3",
296
301
  onClick: onClearHandler
297
302
  },
298
- toDisplayString(unref(t)("table.clear")),
303
+ toDisplayString(unref(t)("hy.reset")),
299
304
  1
300
305
  /* TEXT */
301
306
  )) : createCommentVNode("v-if", true)
@@ -305,15 +310,9 @@ const _sfc_main = {
305
310
  Fragment,
306
311
  { key: 0 },
307
312
  [
308
- createVNode(unref(ElIcon), {
309
- class: "mr-1.5",
310
- color: "rgb(var(--hy-auxiliary))"
311
- }, {
312
- default: withCtx(() => [
313
- createVNode(unref(Warning))
314
- ]),
315
- _: 1
316
- /* STABLE */
313
+ createVNode(unref(HyIcon), {
314
+ "svg-name": "dispatch-share1-prompt",
315
+ class: "!w-3 !h-3 text-auxiliary mr-1.5"
317
316
  }),
318
317
  createVNode(unref(HyTooltip), {
319
318
  "is-always": false,