hy-dispatch-ui-v3 0.2.59 → 0.2.61

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 (102) hide show
  1. package/dist/tailwind.css +131 -6
  2. package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
  3. package/es/api/index.mjs +137 -0
  4. package/es/bussiness/hyAddDepartmentType/addDepartmentType.vue.mjs +365 -0
  5. package/es/bussiness/hyAddDepartmentType/index.mjs +6 -0
  6. package/es/bussiness/hyAddDepartmentType/style/addDepartmentType.scss +31 -0
  7. package/es/bussiness/index.mjs +1 -1
  8. package/es/components/hyAudioPlayer/audioPlayer.vue.mjs +1 -1
  9. package/es/components/hyBatchUploadDialog/batchUploadDialog.vue.mjs +45 -36
  10. package/es/components/hyDatePicker/datePicker.vue.mjs +2 -0
  11. package/es/components/hyForm/cpns/formItem.vue.mjs +106 -43
  12. package/es/components/hyForm/cpns/locationSelect.vue.mjs +358 -0
  13. package/es/components/hyForm/form.vue.mjs +83 -31
  14. package/es/components/hyForm/js/index.mjs +9 -2
  15. package/es/components/hyForm/js/useAppForm.mjs +6 -36
  16. package/es/components/hyMap/map.vue.mjs +3 -3
  17. package/es/components/hyMenu/menu.vue.mjs +38 -23
  18. package/es/components/hyMenu/style/menu.scss +3 -1
  19. package/es/components/hyOrgCascader/js/index.mjs +2 -2
  20. package/es/components/hyRadioGroup/index.mjs +6 -0
  21. package/es/components/hyRadioGroup/radioGroup.vue.mjs +123 -0
  22. package/es/components/hyRadioGroup/style/radioGroup.scss +0 -0
  23. package/es/components/hySearch/cpns/searchItem.vue.mjs +20 -13
  24. package/es/components/hySearch/js/useAppSearch.mjs +3 -33
  25. package/es/components/hyTable/cpns/virtualTable.vue.mjs +9 -1
  26. package/es/components/hyTable/js/index.mjs +6 -3
  27. package/es/components/hyTable/js/search.mjs +1 -0
  28. package/es/components/hyTable/table.vue.mjs +11 -4
  29. package/es/components/hyTableForm/batchTableForm.vue.mjs +5 -2
  30. package/es/components/hyTableForm/tableForm.vue.mjs +6 -0
  31. package/es/components/hyTree/js/index.mjs +69 -53
  32. package/es/components/hyTree/tree.vue.mjs +36 -1
  33. package/es/components/hyVideoPlayer/js/index.mjs +0 -1
  34. package/es/components/index.mjs +1 -0
  35. package/es/hooks/useApi.mjs +2 -2
  36. package/es/hooks/useGlobalConfig.mjs +1 -1
  37. package/es/index.mjs +4 -1
  38. package/es/locale/en.mjs +17 -1
  39. package/es/locale/zh_CN.mjs +17 -1
  40. package/es/static/hy-svg-icons/hy-icon-ops-linear-shouqi.js +8 -0
  41. package/es/static/hy-svg-icons/hy-icon-ops-linear-zhankai.js +8 -0
  42. package/es/style/index.scss +53 -0
  43. package/es/style/theme.scss +0 -53
  44. package/es/utils/form.mjs +56 -7
  45. package/es/utils/handler.mjs +5 -0
  46. package/es/utils/index.mjs +2 -1
  47. package/es/utils/map/hook/bigMap.mjs +4 -0
  48. package/es/utils/map/hook/gaode.mjs +3 -0
  49. package/es/utils/map/hook/leafletjs.mjs +10 -10
  50. package/es/utils/map/index.mjs +27 -7
  51. package/es/utils/tree.mjs +1 -0
  52. package/es/version.mjs +1 -1
  53. package/lib/_virtual/_plugin-vue_export-helper.js +13 -0
  54. package/lib/api/index.js +147 -0
  55. package/lib/bussiness/hyAddDepartmentType/addDepartmentType.vue.js +369 -0
  56. package/lib/bussiness/hyAddDepartmentType/index.js +11 -0
  57. package/lib/bussiness/hyAddDepartmentType/style/addDepartmentType.scss +31 -0
  58. package/lib/bussiness/index.js +5 -0
  59. package/lib/components/hyBatchUploadDialog/batchUploadDialog.vue.js +44 -35
  60. package/lib/components/hyDatePicker/datePicker.vue.js +2 -0
  61. package/lib/components/hyForm/cpns/formItem.vue.js +111 -48
  62. package/lib/components/hyForm/cpns/locationSelect.vue.js +362 -0
  63. package/lib/components/hyForm/form.vue.js +79 -27
  64. package/lib/components/hyForm/js/index.js +9 -1
  65. package/lib/components/hyForm/js/useAppForm.js +5 -35
  66. package/lib/components/hyMap/map.vue.js +3 -3
  67. package/lib/components/hyMenu/menu.vue.js +37 -22
  68. package/lib/components/hyMenu/style/menu.scss +3 -1
  69. package/lib/components/hyOrgCascader/js/index.js +2 -2
  70. package/lib/components/hyRadioGroup/index.js +11 -0
  71. package/lib/components/hyRadioGroup/radioGroup.vue.js +127 -0
  72. package/lib/components/hyRadioGroup/style/radioGroup.scss +0 -0
  73. package/lib/components/hySearch/cpns/searchItem.vue.js +19 -12
  74. package/lib/components/hySearch/js/useAppSearch.js +2 -32
  75. package/lib/components/hyTable/cpns/virtualTable.vue.js +9 -1
  76. package/lib/components/hyTable/js/index.js +6 -3
  77. package/lib/components/hyTable/js/search.js +1 -0
  78. package/lib/components/hyTable/table.vue.js +43 -36
  79. package/lib/components/hyTableForm/batchTableForm.vue.js +5 -2
  80. package/lib/components/hyTableForm/tableForm.vue.js +6 -0
  81. package/lib/components/hyTree/js/index.js +69 -53
  82. package/lib/components/hyTree/tree.vue.js +36 -1
  83. package/lib/components/hyVideoPlayer/js/index.js +0 -1
  84. package/lib/components/index.js +14 -12
  85. package/lib/hooks/useApi.js +2 -2
  86. package/lib/index.js +61 -49
  87. package/lib/locale/en.js +17 -1
  88. package/lib/locale/zh_CN.js +17 -1
  89. package/lib/static/hy-svg-icons/hy-icon-ops-linear-shouqi.js +8 -0
  90. package/lib/static/hy-svg-icons/hy-icon-ops-linear-zhankai.js +8 -0
  91. package/lib/style/index.scss +53 -0
  92. package/lib/style/theme.scss +0 -53
  93. package/lib/utils/form.js +57 -5
  94. package/lib/utils/handler.js +5 -0
  95. package/lib/utils/index.js +8 -0
  96. package/lib/utils/map/hook/bigMap.js +4 -0
  97. package/lib/utils/map/hook/gaode.js +3 -0
  98. package/lib/utils/map/hook/leafletjs.js +10 -10
  99. package/lib/utils/map/index.js +26 -6
  100. package/lib/utils/tree.js +10 -0
  101. package/lib/version.js +1 -1
  102. package/package.json +2 -2
@@ -2,7 +2,7 @@ import { computed, unref, openBlock, createBlock, withCtx, createElementVNode, n
2
2
  import { ElFormItem, ElSelect } from 'element-plus';
3
3
  import { columnShowHandler, columnItemStyle, columnItemInputStyle, isDisabled, optionsHandler, isSelectedTimeRange, timeRangeHandler } from '../js/index.mjs';
4
4
  import { isArray } from '../../../utils/is.mjs';
5
- import { setValueByProp, getValueByProp } from '../../../utils/form.mjs';
5
+ import { setValueByProp, getValueByProp, columnPlaceholderHandler, columnLabelHandler } from '../../../utils/form.mjs';
6
6
  import { HyInput } from '../../hyInput/index.mjs';
7
7
  import { HyDatePicker } from '../../hyDatePicker/index.mjs';
8
8
  import { HyTimePicker } from '../../hyTimePicker/index.mjs';
@@ -56,6 +56,13 @@ const _sfc_main = {
56
56
  setValueByProp(props.model, prop, val);
57
57
  }
58
58
  });
59
+ const columnAttrs = computed(() => {
60
+ return {
61
+ ...props.column.attrs,
62
+ label: columnLabelHandler(props.column, props.model),
63
+ placeholder: columnPlaceholderHandler(props.column, props.model)
64
+ };
65
+ });
59
66
  function onChangeHandler(value, column) {
60
67
  emits("search");
61
68
  }
@@ -96,14 +103,14 @@ const _sfc_main = {
96
103
  "div",
97
104
  {
98
105
  class: normalizeClass(["flex items-center text-auxiliary text-xs whitespace-nowrap", {
99
- "border-r border-border px-3": __props.column.labelSlot && _ctx.$slots[__props.column.labelSlot] || __props.column.label
106
+ "border-r border-border px-3": __props.column.labelSlot && _ctx.$slots[__props.column.labelSlot] || unref(columnLabelHandler)(__props.column, props.model)
100
107
  }])
101
108
  },
102
109
  [
103
110
  __props.column.labelSlot && _ctx.$slots[__props.column.labelSlot] ? renderSlot(_ctx.$slots, __props.column.labelSlot, { column: __props.column }, void 0, void 0, 0) : (openBlock(), createElementBlock(
104
111
  "span",
105
112
  { key: 1 },
106
- toDisplayString(__props.column.label),
113
+ toDisplayString(unref(columnLabelHandler)(__props.column, props.model)),
107
114
  1
108
115
  /* TEXT */
109
116
  ))
@@ -128,7 +135,7 @@ const _sfc_main = {
128
135
  createVNode(unref(HyInput), mergeProps({
129
136
  modelValue: bindValue.value,
130
137
  "onUpdate:modelValue": ($event) => bindValue.value = $event
131
- }, __props.column.attrs, {
138
+ }, columnAttrs.value, {
132
139
  disabled: unref(isDisabled)(props, __props.column),
133
140
  onKeydown: withKeys(($event) => onKeydownEnterHander($event, __props.column), ["enter"]),
134
141
  onChange: ($event) => onChangeHandler($event, __props.column)
@@ -144,7 +151,7 @@ const _sfc_main = {
144
151
  createVNode(unref(ElSelect), mergeProps({
145
152
  modelValue: bindValue.value,
146
153
  "onUpdate:modelValue": ($event) => bindValue.value = $event
147
- }, __props.column.attrs, {
154
+ }, columnAttrs.value, {
148
155
  disabled: unref(isDisabled)(props, __props.column),
149
156
  options: unref(optionsHandler)(props, __props.column),
150
157
  onChange: ($event) => onChangeHandler($event, __props.column)
@@ -162,7 +169,7 @@ const _sfc_main = {
162
169
  "daterange",
163
170
  "monthrange",
164
171
  "yearrange"
165
- ].includes(__props.column.attrs?.type) && unref(isArray)(__props.column.field) ? (openBlock(), createBlock(unref(HyDatePicker), mergeProps({
172
+ ].includes(columnAttrs.value?.type) && unref(isArray)(__props.column.field) ? (openBlock(), createBlock(unref(HyDatePicker), mergeProps({
166
173
  key: 0,
167
174
  start: bindValue.value,
168
175
  "onUpdate:start": ($event) => bindValue.value = $event,
@@ -171,7 +178,7 @@ const _sfc_main = {
171
178
  "is-range": true,
172
179
  style: { "width": "100%" },
173
180
  timeRangeFill: __props.column.timeRangeFill
174
- }, __props.column.attrs, {
181
+ }, columnAttrs.value, {
175
182
  disabled: unref(isDisabled)(props, __props.column),
176
183
  onChange: ($event) => onChangeHandler($event, __props.column)
177
184
  }), null, 16, ["start", "onUpdate:start", "end", "onUpdate:end", "timeRangeFill", "disabled", "onChange"])) : (openBlock(), createBlock(unref(HyDatePicker), mergeProps({
@@ -181,7 +188,7 @@ const _sfc_main = {
181
188
  "is-range": false,
182
189
  style: { "width": "100%" },
183
190
  timeRangeFill: __props.column.timeRangeFill
184
- }, __props.column.attrs, {
191
+ }, columnAttrs.value, {
185
192
  disabled: unref(isDisabled)(props, __props.column),
186
193
  onChange: ($event) => onChangeHandler($event, __props.column)
187
194
  }), null, 16, ["modelValue", "onUpdate:modelValue", "timeRangeFill", "disabled", "onChange"]))
@@ -193,7 +200,7 @@ const _sfc_main = {
193
200
  { key: 4 },
194
201
  [
195
202
  createCommentVNode(" \u65F6\u95F4\u9009\u62E9\u6846 "),
196
- __props.column.attrs.isRange ? (openBlock(), createBlock(unref(HyTimePicker), mergeProps({
203
+ columnAttrs.value.isRange ? (openBlock(), createBlock(unref(HyTimePicker), mergeProps({
197
204
  key: 0,
198
205
  start: bindValue.value,
199
206
  "onUpdate:start": ($event) => bindValue.value = $event,
@@ -201,7 +208,7 @@ const _sfc_main = {
201
208
  "onUpdate:end": ($event) => bindValue2.value = $event,
202
209
  "is-range": true,
203
210
  style: { "width": "100%" }
204
- }, __props.column.attrs, {
211
+ }, columnAttrs.value, {
205
212
  disabled: unref(isDisabled)(props, __props.column),
206
213
  onChange: onChangeHandler
207
214
  }), null, 16, ["start", "onUpdate:start", "end", "onUpdate:end", "disabled"])) : (openBlock(), createBlock(unref(HyTimePicker), mergeProps({
@@ -210,7 +217,7 @@ const _sfc_main = {
210
217
  "onUpdate:modelValue": ($event) => bindValue.value = $event,
211
218
  "is-range": false,
212
219
  style: { "width": "100%" }
213
- }, __props.column.attrs, {
220
+ }, columnAttrs.value, {
214
221
  disabled: unref(isDisabled)(props, __props.column),
215
222
  onChange: onChangeHandler
216
223
  }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"]))
@@ -225,7 +232,7 @@ const _sfc_main = {
225
232
  createVNode(unref(HyOrgCascader), mergeProps({
226
233
  modelValue: bindValue.value,
227
234
  "onUpdate:modelValue": ($event) => bindValue.value = $event
228
- }, __props.column.attrs, {
235
+ }, columnAttrs.value, {
229
236
  disabled: unref(isDisabled)(props, __props.column),
230
237
  onChange: onChangeHandler
231
238
  }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])
@@ -241,7 +248,7 @@ const _sfc_main = {
241
248
  4
242
249
  /* STYLE */
243
250
  ),
244
- __props.column.type === "date-picker" && ["daterange", "datetimerange"].includes(__props.column.attrs?.type) && __props.column.timeRangeOptions?.length ? (openBlock(), createElementBlock("div", {
251
+ __props.column.type === "date-picker" && ["daterange", "datetimerange"].includes(columnAttrs.value?.type) && __props.column.timeRangeOptions?.length ? (openBlock(), createElementBlock("div", {
245
252
  key: 0,
246
253
  class: "flex text-main select-none"
247
254
  }, [
@@ -1,37 +1,9 @@
1
1
  import { unref, toRef } from 'vue';
2
2
  import { funRunHandler, mergeDeep } from '../../../utils/handler.mjs';
3
- import { genValueByProp } from '../../../utils/form.mjs';
3
+ import { genValueByProp, genColumnDefaultLabel } from '../../../utils/form.mjs';
4
4
  import { useLocale } from '../../../hooks/useLocale.mjs';
5
5
  import { isNumber } from '../../../utils/is.mjs';
6
6
 
7
- const genDefaultLabel = (config) => {
8
- if (config.label) return config.label;
9
- const { t } = useLocale();
10
- switch (config.type) {
11
- // 部门级联选择框
12
- case "org-cascader":
13
- return t("form.department");
14
- }
15
- };
16
- const genPlaceholderHandler = (config) => {
17
- const { t } = useLocale();
18
- const { type, label, attrs = {} } = config || {};
19
- let placeholder = attrs.placeholder, startPlaceholder = attrs.startPlaceholder, endPlaceholder = attrs.endPlaceholder;
20
- switch (type) {
21
- case "input":
22
- placeholder = placeholder || t("hy.pleaseEnterPlaceholder", [label]);
23
- break;
24
- case "select":
25
- case "date-picker":
26
- case "time-picker":
27
- case "org-cascader":
28
- placeholder = placeholder || t("hy.pleaseSelectPlaceholder", [label]);
29
- break;
30
- default:
31
- placeholder = placeholder || label;
32
- }
33
- return { placeholder, startPlaceholder, endPlaceholder };
34
- };
35
7
  const genColumnWidth = (config) => {
36
8
  let { width, inputWidth, type, attrs } = config || {};
37
9
  if (!width && !inputWidth) {
@@ -84,12 +56,10 @@ const timeRangeOptionsHandler = (config) => {
84
56
  }, []);
85
57
  };
86
58
  function appSearchItemHandler(column = {}) {
87
- const label = genDefaultLabel(column);
88
- const { placeholder} = genPlaceholderHandler({ ...column, label });
59
+ const label = genColumnDefaultLabel(column);
89
60
  const attrs = {
90
61
  clearable: true,
91
- ...column.attrs || {},
92
- placeholder
62
+ ...column.attrs || {}
93
63
  };
94
64
  const { width, inputWidth } = genColumnWidth(column);
95
65
  column = mergeDeep(
@@ -457,7 +457,15 @@ const _sfc_main = {
457
457
  }, {
458
458
  default: withCtx(() => [
459
459
  createElementVNode("div", {
460
- class: normalizeClass(["w-[40px] h-[48px] inline-flex flex-col items-center justify-center text-xs hover:font-bold border border-transparent hover:border-theme hover:shadow-[0px_0px_5px_0px_rgba(var(--hy-theme),0.5)] rounded box-border cursor-pointer", citem.className]),
460
+ class: normalizeClass(["w-[40px] h-[48px] inline-flex flex-col items-center justify-center text-xs hover:font-bold border border-transparent rounded box-border", [
461
+ citem.className,
462
+ unref(operatorDisabledHandler)(citem, {
463
+ column,
464
+ row,
465
+ $index,
466
+ cellIndex
467
+ }) ? "cursor-not-allowed text-[var(--hy-el-text-color-disabled)] hover:border-[rgba(var(--hy-auxiliary),1)] hover:shadow-[0px_0px_5px_0px_rgba(var(--hy-auxiliary),0.5)]" : "cursor-pointer hover:border-theme hover:shadow-[0px_0px_5px_0px_rgba(var(--hy-theme),0.5)]"
468
+ ]]),
461
469
  onClick: ($event) => unref(operatorClickHandler)(
462
470
  cindex,
463
471
  column,
@@ -1,8 +1,8 @@
1
1
  import { ref, computed, watch, watchEffect, unref, nextTick } from 'vue';
2
2
  import { ElLoading } from 'element-plus';
3
- import { isString, isBoolean, isFunction, isPermission, isNumber, isArray } from '../../../utils/is.mjs';
4
- import { useLocale } from '../../../hooks/useLocale.mjs';
5
3
  import { usePermissionMap } from '../../../hooks/usePermissionMap.mjs';
4
+ import { useLocale } from '../../../hooks/useLocale.mjs';
5
+ import { isString, isBoolean, isFunction, isPermission, isNumber, isArray } from '../../../utils/is.mjs';
6
6
 
7
7
  function tableColumnShowHandler(column) {
8
8
  if (column.permission && !isPermission(column.permission)) {
@@ -123,6 +123,7 @@ function operatorFilterHandler(column, scope, type = "all") {
123
123
  function operatorClickHandler(command, column, scope, type = "all") {
124
124
  const operator = operatorFilterHandler(column, scope, type);
125
125
  const target = operator[command];
126
+ if (operatorDisabledHandler(target, scope)) return;
126
127
  target?.handler && target.handler(scope);
127
128
  }
128
129
  function renderHeaderHandler(column, scope) {
@@ -394,7 +395,9 @@ const useAppTableWrapper = (hy) => {
394
395
  // 搜索选中
395
396
  isSearchFocus,
396
397
  onSearchInputHandler,
397
- onSearchBlurHandler
398
+ onSearchBlurHandler,
399
+ showAppTableLoading,
400
+ closeAppTableLoading
398
401
  };
399
402
  };
400
403
 
@@ -54,6 +54,7 @@ function useAppTableSearch(hy) {
54
54
  }
55
55
  async function resetFields() {
56
56
  await nextTick();
57
+ props.filterModel.query = null;
57
58
  if (appSearchRef.value) {
58
59
  appSearchRef.value.resetFields();
59
60
  }
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, useModel, useTemplateRef, openBlock, createElementBlock, createCommentVNode, createElementVNode, createBlock, unref, createVNode, toDisplayString, withCtx, renderSlot, normalizeClass, createSlots, renderList, normalizeProps, guardReactiveProps, mergeProps, Fragment, withModifiers, mergeModels } from 'vue';
2
2
  import { ElTable, ElTableColumn, ElDropdown, ElIcon, ElDropdownMenu, ElDropdownItem, ElAutoResizer, ElPagination } from 'element-plus';
3
3
  import { MoreFilled } from '@element-plus/icons-vue';
4
- import { operatorFilterHandler, operatorClickHandler, operatorDisabledHandler, operatorDisableTextdHandler, renderContentHandler, renderHeaderHandler, useAppTableWrapper } from './js/index.mjs';
4
+ import { useAppTableWrapper, operatorFilterHandler, operatorClickHandler, operatorDisabledHandler, operatorDisableTextdHandler, renderContentHandler, renderHeaderHandler } from './js/index.mjs';
5
5
  import { useAppTableSearch } from './js/search.mjs';
6
6
  import _sfc_main$2 from './cpns/headerItem.vue.mjs';
7
7
  import _sfc_main$1 from './cpns/columnSelect.vue.mjs';
@@ -248,7 +248,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
248
248
  getTableDataSource,
249
249
  onSizeChangeHandler,
250
250
  onCurrentChangeHandler,
251
- onSearchQueryHandler
251
+ onSearchQueryHandler,
252
+ showAppTableLoading,
253
+ closeAppTableLoading
252
254
  } = useMixins(
253
255
  {
254
256
  props,
@@ -275,7 +277,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
275
277
  getTableDataSource,
276
278
  clearSelection,
277
279
  clearSelectedList,
278
- toggleRowExpansion
280
+ toggleRowExpansion,
281
+ showAppTableLoading,
282
+ closeAppTableLoading
279
283
  });
280
284
  return (_ctx, _cache) => {
281
285
  return openBlock(), createElementBlock(
@@ -478,7 +482,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
478
482
  }, {
479
483
  default: withCtx(() => [
480
484
  createElementVNode("div", {
481
- class: normalizeClass(["w-[40px] h-[48px] inline-flex flex-col items-center justify-center text-xs hover:font-bold border border-transparent hover:border-theme hover:shadow-[0px_0px_5px_0px_rgba(var(--hy-theme),0.5)] rounded box-border cursor-pointer", citem.className]),
485
+ class: normalizeClass(["w-[40px] h-[48px] inline-flex flex-col items-center justify-center text-xs hover:font-bold border border-transparent hover:border-theme hover:shadow-[0px_0px_5px_0px_rgba(var(--hy-theme),0.5)] rounded box-border", [
486
+ citem.className,
487
+ unref(operatorDisabledHandler)(citem, scope) ? "cursor-not-allowed text-[var(--hy-el-text-color-disabled)] hover:border-[rgba(var(--hy-auxiliary),1)] hover:shadow-[0px_0px_5px_0px_rgba(var(--hy-auxiliary),0.5)]" : "cursor-pointer hover:border-theme hover:shadow-[0px_0px_5px_0px_rgba(var(--hy-theme),0.5)]"
488
+ ]]),
482
489
  onClick: withModifiers(($event) => unref(operatorClickHandler)(cindex, column, scope, "default"), ["stop"]),
483
490
  onContextmenu: withModifiers(() => {
484
491
  }, ["stop"])
@@ -61,6 +61,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
61
61
  beforeDataHandle: {
62
62
  type: Function
63
63
  },
64
+ onExpandRowChange: {
65
+ type: Function
66
+ },
64
67
  templateConfig: {
65
68
  type: Object,
66
69
  default: () => ({
@@ -149,7 +152,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
149
152
  try {
150
153
  isUploading.value = true;
151
154
  emits("uploading");
152
- formColumns;
153
155
  const data = await doReadExcel(files, props);
154
156
  if (!data) {
155
157
  ElMessage.warning("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25");
@@ -523,6 +525,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
523
525
  }, _ctx.$attrs, {
524
526
  tableColumns: __props.tableColumns,
525
527
  formColumns: __props.formColumns,
528
+ onExpandRowChange: __props.onExpandRowChange,
526
529
  rules: __props.rules,
527
530
  rowClickExpand: __props.rowClickExpand,
528
531
  columnNum: __props.columnNum,
@@ -540,7 +543,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
540
543
  ])
541
544
  };
542
545
  })
543
- ]), 1040, ["tableColumns", "formColumns", "rules", "rowClickExpand", "columnNum", "size"])
546
+ ]), 1040, ["tableColumns", "formColumns", "onExpandRowChange", "rules", "rowClickExpand", "columnNum", "size"])
544
547
  ])) : createCommentVNode("v-if", true),
545
548
  submitting.value ? (openBlock(), createElementBlock("div", {
546
549
  key: 1,
@@ -17,6 +17,9 @@ const __default__ = defineComponent({
17
17
  });
18
18
  const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
19
19
  props: {
20
+ onExpandRowChange: {
21
+ type: Function
22
+ },
20
23
  // 表格配置项
21
24
  tableColumns: {
22
25
  // 表格的列
@@ -131,6 +134,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
131
134
  }
132
135
  }
133
136
  async function onExpandRowChange(row) {
137
+ if (props.onExpandRowChange) {
138
+ props.onExpandRowChange(row);
139
+ }
134
140
  await nextTick();
135
141
  if (!formRef.value) return;
136
142
  const valid = await initValidateHandler([row]);
@@ -14,7 +14,7 @@ const deviceStatus = {
14
14
  1: "\u5728\u7EBF"
15
15
  };
16
16
  const useAppTreeWrapper = (hy) => {
17
- const { props, emits, slots, treeRef, VirtualTree } = hy;
17
+ const { props: props2, emits, slots, treeRef, VirtualTree } = hy;
18
18
  const instance = getCurrentInstance();
19
19
  const slotAppContext = instance ? {
20
20
  ...instance.appContext,
@@ -33,17 +33,17 @@ const useAppTreeWrapper = (hy) => {
33
33
  const selectFilterList = ref([]);
34
34
  const loading = ref(true);
35
35
  watch(
36
- () => props.showCheckbox,
36
+ () => props2.showCheckbox,
37
37
  (newVal) => {
38
38
  virtualTree?.setRowSelection({
39
- type: props.showCheckbox ? "checkbox" : "radio"
39
+ type: props2.showCheckbox ? "checkbox" : "radio"
40
40
  });
41
41
  }
42
42
  );
43
43
  function getData(dataList) {
44
44
  return new Promise((resolve) => {
45
45
  hy.loading.value = true;
46
- if (props.disableSelection?.length) {
46
+ if (props2.disableSelection?.length) {
47
47
  setDisAbleSelectionMap();
48
48
  }
49
49
  if (!virtualTree) {
@@ -59,9 +59,9 @@ const useAppTreeWrapper = (hy) => {
59
59
  // 可视区域外的缓冲项数量
60
60
  indent: 16,
61
61
  emptyText: "\u6682\u65E0\u6570\u636E",
62
- business: props.treeType,
62
+ business: props2.treeType,
63
63
  // 自定义整体的插槽
64
- renderItem: props.treeType === treeTypeConfig.user ? (data, node) => setUserSlot(data) : setSlot("treeParentSlot"),
64
+ renderItem: props2.treeType === treeTypeConfig.user ? (data, node) => setUserSlot(data) : setSlot("treeParentSlot"),
65
65
  // // 自定义状态右侧插槽
66
66
  renderRight: (data) => {
67
67
  let renderRight = setSlot("renderRight");
@@ -87,9 +87,9 @@ const useAppTreeWrapper = (hy) => {
87
87
  return true;
88
88
  },
89
89
  // // 自定义状态模块
90
- renderStatus: props.treeType === treeTypeConfig.device || props.treeType === treeTypeConfig.channel ? (data) => setRenderStatus(data) : null,
90
+ renderStatus: props2.treeType === treeTypeConfig.device || props2.treeType === treeTypeConfig.channel ? (data) => setRenderStatus(data) : null,
91
91
  renderEmpty: () => {
92
- if (!props.showCustomEmpty || hy.filterValue.value) return true;
92
+ if (!props2.showCustomEmpty || hy.filterValue.value) return true;
93
93
  let renderEmpty = setSlot("renderEmpty");
94
94
  if (renderEmpty) {
95
95
  const target = renderEmpty();
@@ -100,29 +100,31 @@ const useAppTreeWrapper = (hy) => {
100
100
  props: {
101
101
  showStatus: true,
102
102
  disabled: (data) => {
103
- if (data.dataType === 3 || data.dataType === 5) {
103
+ if (data.dataType === 5 || data.dataType === 3) {
104
104
  if (hy.disableSelectionMap.value) {
105
- return hy.disableSelectionMap.value.get(data.id);
105
+ return data.dataType === 3 ? hy.disableSelectionMap.value.get(data.deviceId) : hy.disableSelectionMap.value.get(data.id);
106
106
  }
107
107
  return false;
108
108
  }
109
109
  return false;
110
110
  },
111
- ...props.treeProps
111
+ ...props2.treeProps
112
112
  },
113
113
  rowSelection: {
114
- type: props.showCheckbox ? "checkbox" : "radio",
115
- highlight: props.highlight,
116
- checkStrictly: props.checkStrictly,
114
+ type: props2.showCheckbox ? "checkbox" : "radio",
115
+ highlight: props2.highlight,
116
+ checkStrictly: props2.checkStrictly,
117
117
  // 是否显示选项 showSinglebox 单选为true时部门不显示其他节点显示选择框
118
118
  showSelect: (data) => {
119
119
  if (data.dataType === 1) {
120
- return props.showCheckbox;
120
+ return props2.showCheckbox;
121
121
  }
122
- return props.showCheckbox || props.showSinglebox;
122
+ return props2.showCheckbox || props2.showSinglebox;
123
123
  },
124
124
  // 单选时是否可以取消选择
125
- cancelable: true,
125
+ cancelable: props2.cancelable,
126
+ // 是否显示多选框或单选框
127
+ showSelectBox: props2.showSelectBox,
126
128
  // 选中回调
127
129
  onCheckChange: (data, info, checked) => {
128
130
  console.log("onCheckChange", info);
@@ -139,25 +141,35 @@ const useAppTreeWrapper = (hy) => {
139
141
  );
140
142
  }
141
143
  },
144
+ // 是否在点击节点的时候展开或者收缩节点
145
+ expandOnClickNode: props2.expandOnClickNode,
146
+ // 是否在点击节点的时候选中节点
147
+ checkOnClickNode: props2.checkOnClickNode,
148
+ // 点击叶节点(最后一个子节点)时是否检查或取消节点
149
+ checkOnClickLeaf: props2.checkOnClickLeaf,
150
+ // 双击父节点会触发选中功能
151
+ checkOnDblclickParentNode: props2.checkOnDblclickParentNode,
142
152
  // 筛选方法
143
153
  filterMethod: ({ filterValue: filterValue2 }, data) => {
144
154
  let isFilter = true;
145
155
  if (filterValue2) {
146
156
  isFilter = isFilter && !!filterNodeMethod(data, filterValue2, {
147
- treeFilterParam: props.treeFilterParam
157
+ treeFilterParam: props2.treeFilterParam
148
158
  });
149
159
  }
150
160
  return isFilter;
151
161
  },
152
162
  businessConfig: {
153
163
  // 是否开启按在线离线状态排序
154
- sortByStatus: props.deviceOrderSort,
164
+ sortByStatus: props2.deviceOrderSort,
155
165
  // 是否只显示在线设备
156
- showOnlineState: props.showOnlineOnly,
166
+ showOnlineState: props2.showOnlineOnly,
157
167
  // 是否清空没有业务项(设备、用户、采集器)的部门和群组
158
- clearEmptyBusiness: props.clearEmptyBusiness,
168
+ clearEmptyBusiness: props2.clearEmptyBusiness,
159
169
  // 是否显示通道节点的选择框
160
- isShowChannelSelect: props.isShowChannelSelect
170
+ isShowChannelSelect: props2.isShowChannelSelect,
171
+ // 初始化过滤数据
172
+ filterConfig: props2.filterConfig
161
173
  },
162
174
  // 初始化时处理数据,想回显必须return值,若想要过滤,可不return
163
175
  handleMethod: (data) => {
@@ -178,7 +190,7 @@ const useAppTreeWrapper = (hy) => {
178
190
  },
179
191
  // 双击事件
180
192
  onNodeDblClick: (data, node, event) => {
181
- if (props.treeType !== "channel") {
193
+ if (props2.treeType !== "channel") {
182
194
  emits("on-dblclick", [{ ...data }]);
183
195
  } else {
184
196
  if (data.channelId) {
@@ -218,13 +230,13 @@ const useAppTreeWrapper = (hy) => {
218
230
  document.body.click();
219
231
  },
220
232
  onLoad: () => {
221
- if (props.showOnlineOnly && !virtualTree._flattenTree?.length && !hy.filterValue.value) {
233
+ if (props2.showOnlineOnly && !virtualTree._flattenTree?.length && !hy.filterValue.value) {
222
234
  ElMessage.warning("\u6682\u65E0\u8BBE\u5907\u5904\u4E8E\u5728\u7EBF\u72B6\u6001");
223
235
  }
224
- if (props.defaultSelectedOrgID && props.showCheckbox && props.treeType === "device") {
236
+ if (props2.defaultSelectedOrgID && props2.showCheckbox && props2.treeType === "device") {
225
237
  setSelectedOrg(dataList);
226
- } else if (props.selectedByDefault?.length) {
227
- setCheckedKeys(props.selectedByDefault);
238
+ } else if (props2.selectedByDefault?.length) {
239
+ setCheckedKeys(props2.selectedByDefault);
228
240
  }
229
241
  if (hy.filterValue.value) {
230
242
  getFilterValue();
@@ -240,13 +252,13 @@ const useAppTreeWrapper = (hy) => {
240
252
  {
241
253
  data: dataList,
242
254
  businessConfig: {
243
- sortByStatus: props.deviceOrderSort,
244
- showOnlineState: props.showOnlineOnly,
245
- clearEmptyBusiness: props.clearEmptyBusiness
255
+ sortByStatus: props2.deviceOrderSort,
256
+ showOnlineState: props2.showOnlineOnly,
257
+ clearEmptyBusiness: props2.clearEmptyBusiness
246
258
  }
247
259
  },
248
260
  () => {
249
- if (props.showOnlineOnly && !virtualTree._flattenTree?.length && !hy.filterValue.value) {
261
+ if (props2.showOnlineOnly && !virtualTree._flattenTree?.length && !hy.filterValue.value) {
250
262
  ElMessage.success("\u6682\u65E0\u8BBE\u5907\u5904\u4E8E\u5728\u7EBF\u72B6\u6001");
251
263
  }
252
264
  if (hy.filterValue.value) {
@@ -263,7 +275,7 @@ const useAppTreeWrapper = (hy) => {
263
275
  }
264
276
  function setEmpty() {
265
277
  let content = ``;
266
- if (!props.showOnlineOnly) {
278
+ if (!props2.showOnlineOnly) {
267
279
  setTimeout(() => {
268
280
  if (hy.addDeviceDom.value) {
269
281
  hy.addDeviceDom.value.removeEventListener("click", addDevice);
@@ -292,7 +304,7 @@ const useAppTreeWrapper = (hy) => {
292
304
  }
293
305
  function setDisAbleSelectionMap() {
294
306
  const map = /* @__PURE__ */ new Map();
295
- props.disableSelection.forEach((v) => {
307
+ props2.disableSelection.forEach((v) => {
296
308
  map.set(v.id, true);
297
309
  });
298
310
  hy.disableSelectionMap.value = map;
@@ -316,7 +328,7 @@ const useAppTreeWrapper = (hy) => {
316
328
  container.style.display = "flex";
317
329
  container.style.width = "100%";
318
330
  const dutyHtml = `<div class="flex treeDeviceBox">
319
- ${props.getDutyRoster === 1 && data.rosterContent ? `<span class="w-[22px] h-[22px] text-xs rounded border box-border text-main flex justify-center items-center mr-1"
331
+ ${props2.getDutyRoster === 1 && data.rosterContent ? `<span class="w-[22px] h-[22px] text-xs rounded border box-border text-main flex justify-center items-center mr-1"
320
332
  style="border-color: ${data.rosterContentColor};background-color: ${data.rosterContentColor}70;">
321
333
  ${data.rosterContentSimple}
322
334
  </span>` : ""}
@@ -385,31 +397,35 @@ const useAppTreeWrapper = (hy) => {
385
397
  emits("on-addDevice");
386
398
  }
387
399
  function singleRemovalFn(row) {
388
- if (props.treeType === "device") {
400
+ if (props2.treeType === "device") {
389
401
  virtualTree.setChecked(row.channelId || row.deviceId, false, true);
390
- } else if (props.treeType) {
402
+ } else if (props2.treeType) {
391
403
  virtualTree.setChecked(row.id, false, true);
392
- } else if (!props.treeType && props.treeProps) {
393
- virtualTree.setChecked(row[`${props.treeProps.value}`], false, true);
404
+ } else if (!props2.treeType && props2.treeProps) {
405
+ virtualTree.setChecked(row[`${props2.treeProps.value}`], false, true);
394
406
  }
395
407
  }
396
408
  function setCheckedKeys(dataList) {
397
- if (props.treeType === "device" || props.treeType === "channel") {
409
+ if (props2.treeType === "device" || props2.treeType === "channel") {
398
410
  virtualTree?.setCheckedKeys(
399
411
  dataList.map((v) => v.channelId || v.deviceId),
400
412
  true
401
413
  );
402
- } else if (props.treeType) {
414
+ } else if (props2.treeType) {
403
415
  virtualTree?.setCheckedKeys(
404
416
  dataList.map((v) => v.id),
405
417
  true
406
418
  );
407
- } else if (!props.treeType && props.treeProps) {
419
+ } else if (!props2.treeType && props2.treeProps) {
420
+ console.log(
421
+ "\u9009\u4E2D\u56DE\u8C03",
422
+ dataList.map((v) => v[`${props2.treeProps.value}`])
423
+ );
408
424
  virtualTree?.setCheckedKeys(
409
- dataList.map((v) => v[`${props.treeProps.value}`])
425
+ dataList.map((v) => v[`${props2.treeProps.value}`])
410
426
  );
411
427
  }
412
- if (props.isBackDefaultSelected) {
428
+ if (props2.isBackDefaultSelected) {
413
429
  setTimeout(() => {
414
430
  const deviceList = virtualTree?.getCheckedBusinessNodes(true) || [];
415
431
  emits("on-selectedDataList", deviceList);
@@ -417,17 +433,17 @@ const useAppTreeWrapper = (hy) => {
417
433
  }
418
434
  }
419
435
  function setChecked(data, type) {
420
- if (props.treeType === "device") {
436
+ if (props2.treeType === "device") {
421
437
  virtualTree?.setChecked(data.channelId || data.deviceId, type, true);
422
- } else if (props.treeType) {
438
+ } else if (props2.treeType) {
423
439
  virtualTree?.setChecked(data.id, type, true);
424
- } else if (!props.treeType && props.treeProps) {
425
- virtualTree?.setChecked(data[`${props.treeProps.value}`], type, true);
440
+ } else if (!props2.treeType && props2.treeProps) {
441
+ virtualTree?.setChecked(data[`${props2.treeProps.value}`], type, true);
426
442
  }
427
443
  }
428
444
  function setSelectedOrg(deviceList) {
429
445
  for (let i = 0; i < deviceList.length; i++) {
430
- if (props.defaultSelectedOrgID === deviceList[i].id) {
446
+ if (props2.defaultSelectedOrgID === deviceList[i].id) {
431
447
  if (deviceList[i].deviceList?.length) {
432
448
  setCheckedKeys(deviceList[i].deviceList);
433
449
  }
@@ -443,13 +459,13 @@ const useAppTreeWrapper = (hy) => {
443
459
  return virtualTree?.getCheckedBusinessNodes(true) || [];
444
460
  }
445
461
  function setFilterListType(type) {
446
- if (props.selectFilterList?.length) {
462
+ if (props2.selectFilterList?.length) {
447
463
  hy.selectFilterList.value = JSON.parse(
448
- JSON.stringify(props.selectFilterList)
464
+ JSON.stringify(props2.selectFilterList)
449
465
  );
450
466
  return;
451
467
  }
452
- if (props.treeType === "device") {
468
+ if (props2.treeType === "device") {
453
469
  hy.selectFilterList.value = [
454
470
  {
455
471
  label: "\u5168\u90E8",
@@ -467,7 +483,7 @@ const useAppTreeWrapper = (hy) => {
467
483
  placeholder: "\u8BBE\u5907\u53F7\u3001\u8BBE\u5907\u540D\u79F0\u8FDB\u884C\u7B5B\u9009"
468
484
  }
469
485
  ];
470
- } else if (props.treeType === "user") {
486
+ } else if (props2.treeType === "user") {
471
487
  hy.selectFilterList.value = [
472
488
  {
473
489
  label: "\u5168\u90E8",
@@ -529,7 +545,7 @@ function filterNodeMethod(data, value, { selectFilterType, treeFilterParam = []
529
545
  const includesValue = (field) => {
530
546
  return field && field.toString().includes(value.toString());
531
547
  };
532
- if (!type) {
548
+ if (!props.treeType) {
533
549
  let filterType = false;
534
550
  for (let i = 0; i < treeFilterParam.length; i++) {
535
551
  const item = treeFilterParam[i];