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
package/dist/tailwind.css CHANGED
@@ -537,8 +537,8 @@
537
537
  height: 42px !important;
538
538
  }
539
539
 
540
- .\!h-\[46px\] {
541
- height: 46px !important;
540
+ .\!h-\[56px\] {
541
+ height: 56px !important;
542
542
  }
543
543
 
544
544
  .\!h-\[66px\] {
@@ -753,8 +753,8 @@
753
753
  width: 42px !important;
754
754
  }
755
755
 
756
- .\!w-\[46px\] {
757
- width: 46px !important;
756
+ .\!w-\[56px\] {
757
+ width: 56px !important;
758
758
  }
759
759
 
760
760
  .\!w-\[58px\] {
@@ -936,10 +936,6 @@
936
936
  cursor: pointer;
937
937
  }
938
938
 
939
- .cursor-wait {
940
- cursor: wait;
941
- }
942
-
943
939
  .select-none {
944
940
  -webkit-user-select: none;
945
941
  -moz-user-select: none;
@@ -1150,6 +1146,10 @@
1150
1146
  border-color: transparent;
1151
1147
  }
1152
1148
 
1149
+ .\!bg-\[rgba\(var\(--hy-background\)\2c 0\.7\)\] {
1150
+ background-color: rgba(var(--hy-background),0.7) !important;
1151
+ }
1152
+
1153
1153
  .\!bg-background {
1154
1154
  --tw-bg-opacity: 1 !important;
1155
1155
  background-color: rgb(var(--hy-background), var(--tw-bg-opacity, 1)) !important;
@@ -1212,6 +1212,11 @@
1212
1212
  background-color: rgb(var(--hy-success), var(--tw-bg-opacity, 1));
1213
1213
  }
1214
1214
 
1215
+ .bg-success-3 {
1216
+ --tw-bg-opacity: 1;
1217
+ background-color: rgb(var(--hy-success-3), var(--tw-bg-opacity, 1));
1218
+ }
1219
+
1215
1220
  .bg-theme {
1216
1221
  --tw-bg-opacity: 1;
1217
1222
  background-color: rgb(var(--hy-theme), var(--tw-bg-opacity, 1));
@@ -1225,6 +1230,10 @@
1225
1230
  padding: 0.25rem;
1226
1231
  }
1227
1232
 
1233
+ .p-4 {
1234
+ padding: 1rem;
1235
+ }
1236
+
1228
1237
  .p-5 {
1229
1238
  padding: 1.25rem;
1230
1239
  }
@@ -1317,6 +1326,11 @@
1317
1326
  padding-bottom: 0.5rem;
1318
1327
  }
1319
1328
 
1329
+ .py-2\.5 {
1330
+ padding-top: 0.625rem;
1331
+ padding-bottom: 0.625rem;
1332
+ }
1333
+
1320
1334
  .py-4 {
1321
1335
  padding-top: 1rem;
1322
1336
  padding-bottom: 1rem;
@@ -1395,6 +1409,10 @@
1395
1409
  padding-right: 62px;
1396
1410
  }
1397
1411
 
1412
+ .pt-0 {
1413
+ padding-top: 0px;
1414
+ }
1415
+
1398
1416
  .pt-2 {
1399
1417
  padding-top: 0.5rem;
1400
1418
  }
@@ -1411,10 +1429,6 @@
1411
1429
  padding-top: 1.5rem;
1412
1430
  }
1413
1431
 
1414
- .pt-\[11px\] {
1415
- padding-top: 11px;
1416
- }
1417
-
1418
1432
  .pt-\[32px\] {
1419
1433
  padding-top: 32px;
1420
1434
  }
@@ -0,0 +1,43 @@
1
+ import '../hooks/index.mjs';
2
+ import { unref } from 'vue';
3
+ import { useLocale } from '../hooks/useLocale.mjs';
4
+ import { useApi } from '../hooks/useApi.mjs';
5
+
6
+ function orgListWithDev3Api(params) {
7
+ return new Promise((resolve, reject) => {
8
+ const { t } = useLocale();
9
+ const { api } = useApi();
10
+ const http = unref(api);
11
+ http.post("organization/orgTree", params).then((res) => {
12
+ resolve(res.data);
13
+ }).catch((res) => {
14
+ reject(new Error(t("interfaceError")));
15
+ });
16
+ });
17
+ }
18
+ function orgTreeWithGroupAndDeviceApi(params) {
19
+ return new Promise((resolve, reject) => {
20
+ const { t } = useLocale();
21
+ const { api } = useApi();
22
+ const http = unref(api);
23
+ http.post("organization/orgTreeWithGroupAndDevice", params).then((res) => {
24
+ return resolve(res.data);
25
+ }).catch((res) => {
26
+ reject(new Error(t("interfaceError")));
27
+ });
28
+ });
29
+ }
30
+ function orgTreeWithPlanGroupAndDeviceApi(params) {
31
+ return new Promise((resolve, reject) => {
32
+ const { t } = useLocale();
33
+ const { api } = useApi();
34
+ const http = unref(api);
35
+ http.post("organization/orgTreeWithPlanGroupAndDevice", params).then((res) => {
36
+ return resolve(res.data);
37
+ }).catch((res) => {
38
+ reject(new Error(t("interfaceError")));
39
+ });
40
+ });
41
+ }
42
+
43
+ export { orgListWithDev3Api, orgTreeWithGroupAndDeviceApi, orgTreeWithPlanGroupAndDeviceApi };
@@ -0,0 +1,245 @@
1
+ import { defineComponent, useSlots, openBlock, createElementBlock, createCommentVNode, createVNode, unref, mergeProps, createSlots, renderList, withCtx, renderSlot, normalizeProps, guardReactiveProps } from 'vue';
2
+ import '../../components/index.mjs';
3
+ import '../../hooks/index.mjs';
4
+ import { useAcquisitionStationTree } from './js/index.mjs';
5
+ import { useMixins } from '../../hooks/useMixins.mjs';
6
+ import { HyTree } from '../../components/hyTree/index.mjs';
7
+
8
+ import "./style/acquisitionStationTree.scss";
9
+
10
+ const __default__ = defineComponent({
11
+ name: "HyAcquisitionStationTree"
12
+ });
13
+ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
14
+ props: {
15
+ // 数据获取类型 custom 自定义数据
16
+ type: {
17
+ type: String,
18
+ default: "default"
19
+ },
20
+ // 请求的额外参数
21
+ requestParams: {
22
+ type: Object,
23
+ default: () => ({})
24
+ },
25
+ /* 禁止选择 */
26
+ disableSelection: {
27
+ type: Array,
28
+ default: () => {
29
+ return [];
30
+ }
31
+ },
32
+ // 是否开启按照设备在线和离线状态排序,仅支持 device 和 groupDevice 业务类型
33
+ deviceOrderSort: {
34
+ type: Boolean,
35
+ default: true
36
+ },
37
+ // 设置勤务状态
38
+ getDutyRoster: {
39
+ type: Boolean,
40
+ default: false
41
+ },
42
+ // 仅展示在线数据
43
+ showOnlineOnly: {
44
+ type: Boolean,
45
+ default: false
46
+ },
47
+ /* 是否开启多选框 */
48
+ showCheckbox: {
49
+ type: Boolean,
50
+ default: true
51
+ },
52
+ /* 是否开启单选框 */
53
+ showSinglebox: {
54
+ type: Boolean,
55
+ default: false
56
+ },
57
+ // 是否清除无数据的部门
58
+ clearEmptyBusiness: {
59
+ type: Boolean,
60
+ default: false
61
+ },
62
+ // 是否显示通道节点的选择框
63
+ isShowChannelSelect: {
64
+ type: Boolean,
65
+ default: false
66
+ },
67
+ // 是否显示自定义空数据显示
68
+ showCustomEmpty: {
69
+ type: Boolean,
70
+ default: false
71
+ },
72
+ placeholder: {
73
+ type: String,
74
+ default: "\u8BF7\u8F93\u5165"
75
+ },
76
+ // 是否返回默认选择的数据
77
+ isBackDefaultSelected: {
78
+ type: Boolean,
79
+ default: false
80
+ },
81
+ /* 默认选中列表 */
82
+ selectedByDefault: {
83
+ type: Array,
84
+ default: () => {
85
+ return [];
86
+ }
87
+ },
88
+ // 默认需要选中的部门ID
89
+ defaultSelectedOrgID: {
90
+ default: null
91
+ },
92
+ // 搜索类型
93
+ searchType: {
94
+ type: Number,
95
+ default: 1
96
+ },
97
+ // 筛选列表
98
+ selectFilterList: {
99
+ type: Array,
100
+ default: () => []
101
+ },
102
+ // 是否高亮选中节点
103
+ highlight: {
104
+ type: Boolean,
105
+ default: false
106
+ },
107
+ // 是否严格的遵循父子不互相关联
108
+ checkStrictly: {
109
+ type: Boolean,
110
+ default: false
111
+ },
112
+ // 单选时可以取消选中
113
+ cancelable: {
114
+ type: Boolean,
115
+ default: true
116
+ },
117
+ // 是否显示多选框或单选框
118
+ showSelectBox: {
119
+ type: Boolean,
120
+ default: true
121
+ },
122
+ // 是否在点击节点的时候展开或者收缩节点
123
+ expandOnClickNode: {
124
+ type: Boolean,
125
+ default: true
126
+ },
127
+ // 是否在点击节点的时候选中节点
128
+ checkOnClickNode: {
129
+ type: Boolean,
130
+ default: false
131
+ },
132
+ // 点击叶节点(最后一个子节点)时是否检查或取消节点
133
+ checkOnClickLeaf: {
134
+ type: Boolean,
135
+ default: true
136
+ },
137
+ // 双击父节点会触发选中功能
138
+ checkOnDblclickParentNode: {
139
+ type: Boolean,
140
+ default: true
141
+ },
142
+ // 初始化过滤数据
143
+ filterConfig: {
144
+ type: Array,
145
+ default: () => []
146
+ },
147
+ // 外部自定义过滤函数
148
+ filterMethod: {
149
+ type: Function,
150
+ default: null
151
+ }
152
+ },
153
+ emits: [
154
+ "on-load",
155
+ "onRefreshData",
156
+ "on-click-delete",
157
+ "on-click",
158
+ "on-check-tree",
159
+ "on-department-click",
160
+ "on-click-device",
161
+ "on-contextmenu",
162
+ "on-dblclick",
163
+ "on-selectedDataList"
164
+ ],
165
+ setup(__props, { expose: __expose, emit: __emit }) {
166
+ const props = __props;
167
+ const emits = __emit;
168
+ const slots = useSlots();
169
+ const {
170
+ containerRef,
171
+ hyTreeRef,
172
+ treeHeight,
173
+ setData,
174
+ getData,
175
+ onClickDelete,
176
+ onClick,
177
+ onCheckTree,
178
+ onDepartmentClick,
179
+ onClickDevice,
180
+ onContextmenu,
181
+ onDblclick,
182
+ onSelectedDataList,
183
+ singleRemovalFn,
184
+ setCheckedKeys,
185
+ setChecked,
186
+ getSelectedDataList,
187
+ refreshData,
188
+ getNode
189
+ } = useMixins({ props, emits }, [useAcquisitionStationTree]);
190
+ __expose({
191
+ getData,
192
+ singleRemovalFn,
193
+ setCheckedKeys,
194
+ setChecked,
195
+ getSelectedDataList,
196
+ refreshData,
197
+ getNode
198
+ });
199
+ return (_ctx, _cache) => {
200
+ return openBlock(), createElementBlock(
201
+ "div",
202
+ {
203
+ ref_key: "containerRef",
204
+ ref: containerRef,
205
+ class: "w-full h-full"
206
+ },
207
+ [
208
+ createCommentVNode(" HyAcquisitionStationTree \u91C7\u96C6\u7AD9\u6811\u5F62 "),
209
+ createVNode(unref(HyTree), mergeProps({
210
+ ref_key: "hyTreeRef",
211
+ ref: hyTreeRef
212
+ }, { ...props }, {
213
+ treeType: "cs",
214
+ treeHeight: unref(treeHeight),
215
+ onOnRefreshData: unref(setData),
216
+ onOnClickDelete: unref(onClickDelete),
217
+ onOnClick: unref(onClick),
218
+ onOnCheckTree: unref(onCheckTree),
219
+ onOnDepartmentClick: unref(onDepartmentClick),
220
+ onOnClickDevice: unref(onClickDevice),
221
+ onOnContextmenu: unref(onContextmenu),
222
+ onOnDblclick: unref(onDblclick),
223
+ onOnSelectedDataList: unref(onSelectedDataList)
224
+ }), createSlots({
225
+ _: 2
226
+ /* DYNAMIC */
227
+ }, [
228
+ renderList(unref(slots), (_, slotName) => {
229
+ return {
230
+ name: slotName,
231
+ fn: withCtx((scope) => [
232
+ renderSlot(_ctx.$slots, slotName, normalizeProps(guardReactiveProps(scope)))
233
+ ])
234
+ };
235
+ })
236
+ ]), 1040, ["treeHeight", "onOnRefreshData", "onOnClickDelete", "onOnClick", "onOnCheckTree", "onOnDepartmentClick", "onOnClickDevice", "onOnContextmenu", "onOnDblclick", "onOnSelectedDataList"])
237
+ ],
238
+ 512
239
+ /* NEED_PATCH */
240
+ );
241
+ };
242
+ }
243
+ });
244
+
245
+ export { _sfc_main as default };
@@ -0,0 +1,7 @@
1
+ import _sfc_main from './acquisitionStationTree.vue.mjs';
2
+ import '../../utils/index.mjs';
3
+ import { withInstall } from '../../utils/handler.mjs';
4
+
5
+ const HyAcquisitionStationTree = withInstall(_sfc_main);
6
+
7
+ export { HyAcquisitionStationTree, HyAcquisitionStationTree as default };
@@ -0,0 +1,124 @@
1
+ import { useTemplateRef, ref, onMounted, nextTick, onUnmounted } from 'vue';
2
+ import { orgListWithDev3Api } from '../../../api/organization.mjs';
3
+
4
+ function useAcquisitionStationTree(hy) {
5
+ const emits = hy.emits;
6
+ const props = hy.props;
7
+ const hyTreeRef = useTemplateRef("hyTreeRef");
8
+ const containerRef = useTemplateRef("containerRef");
9
+ const treeHeight = ref(400);
10
+ let resizeObserver;
11
+ function updateTreeHeight() {
12
+ const height = hy.containerRef.value?.getBoundingClientRect().height;
13
+ if (height > 0 && height - 12 !== hy.treeHeight.value) {
14
+ hy.treeHeight.value = Math.round(height) - 12;
15
+ }
16
+ }
17
+ async function setData() {
18
+ if (props.type === "custom") {
19
+ emits("onRefreshData");
20
+ return;
21
+ }
22
+ const data = await orgListWithDev3Api({
23
+ ...props.requestParams
24
+ });
25
+ hy.hyTreeRef.value.getData(data).then(() => {
26
+ emits("on-load");
27
+ });
28
+ }
29
+ function getData(data) {
30
+ return new Promise((resolve) => {
31
+ hy.hyTreeRef.value.getData(data).then(() => {
32
+ emits("on-load");
33
+ resolve(200);
34
+ });
35
+ });
36
+ }
37
+ onMounted(() => {
38
+ if (props.type !== "custom") {
39
+ hy.setData();
40
+ }
41
+ nextTick(() => {
42
+ hy.updateTreeHeight();
43
+ if (typeof ResizeObserver === "function" && hy.containerRef.value) {
44
+ hy.resizeObserver = new ResizeObserver(hy.updateTreeHeight);
45
+ hy.resizeObserver.observe(hy.containerRef.value);
46
+ } else if (typeof window !== "undefined") {
47
+ window.addEventListener("resize", hy.updateTreeHeight);
48
+ }
49
+ });
50
+ });
51
+ onUnmounted(() => {
52
+ hy.resizeObserver?.disconnect();
53
+ if (typeof window !== "undefined") {
54
+ window.removeEventListener("resize", hy.updateTreeHeight);
55
+ }
56
+ });
57
+ function onClickDelete(data) {
58
+ emits("on-click-delete", data);
59
+ }
60
+ function onClick(data) {
61
+ emits("on-click", data);
62
+ }
63
+ function onCheckTree(list, checkObj) {
64
+ emits("on-check-tree", list, checkObj);
65
+ }
66
+ function onDepartmentClick(data) {
67
+ emits("on-department-click", data);
68
+ }
69
+ function onClickDevice(data) {
70
+ emits("on-click-device", data);
71
+ }
72
+ function onContextmenu(data) {
73
+ emits("on-contextmenu", data);
74
+ }
75
+ function onDblclick(list) {
76
+ emits("on-dblclick", list);
77
+ }
78
+ function onSelectedDataList(list) {
79
+ emits("on-selectedDataList", list);
80
+ }
81
+ function singleRemovalFn(row, isForce = false) {
82
+ hy.hyTreeRef.value.singleRemovalFn(row, isForce);
83
+ }
84
+ function setCheckedKeys(dataList, isForce = false) {
85
+ hy.hyTreeRef.value.setCheckedKeys(dataList, isForce);
86
+ }
87
+ function setChecked(data, type = true) {
88
+ hy.hyTreeRef.value.setChecked(data, type);
89
+ }
90
+ function getSelectedDataList(leafOnly = false) {
91
+ return hy.hyTreeRef.value.getSelectedDataList(leafOnly);
92
+ }
93
+ function refreshData() {
94
+ hy.hyTreeRef.value.refreshData();
95
+ }
96
+ function getNode(id) {
97
+ return hy.hyTreeRef.value.getNode(id);
98
+ }
99
+ return {
100
+ hyTreeRef,
101
+ containerRef,
102
+ treeHeight,
103
+ resizeObserver,
104
+ updateTreeHeight,
105
+ setData,
106
+ getData,
107
+ onClickDelete,
108
+ onClick,
109
+ onCheckTree,
110
+ onDepartmentClick,
111
+ onClickDevice,
112
+ onContextmenu,
113
+ onDblclick,
114
+ onSelectedDataList,
115
+ singleRemovalFn,
116
+ setCheckedKeys,
117
+ setChecked,
118
+ getSelectedDataList,
119
+ refreshData,
120
+ getNode
121
+ };
122
+ }
123
+
124
+ export { useAcquisitionStationTree };