hy-dispatch-ui-v3 0.2.67 → 0.2.69

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 (282) hide show
  1. package/dist/tailwind.css +232 -20
  2. package/es/api/device.mjs +2 -3
  3. package/es/api/exportExcel.mjs +57 -0
  4. package/es/api/index.mjs +27 -16
  5. package/es/api/mapRail.mjs +31 -0
  6. package/es/api/organization.mjs +17 -9
  7. package/es/api/rule.mjs +30 -0
  8. package/es/api/sypct.mjs +2 -3
  9. package/es/api/task.mjs +2 -3
  10. package/es/bussiness/hyAddDepartmentType/addDepartmentType.vue.mjs +18 -19
  11. package/es/bussiness/hyAddDepartmentType/style/addDepartmentType.scss +28 -28
  12. package/es/bussiness/hyElectronicFence/cpns/addElectronicFenceDialog/addElectronicFenceDialog.vue.mjs +511 -0
  13. package/es/bussiness/hyElectronicFence/cpns/batchSetElectronicFenceUserDialog/batchSetElectronicFenceUserDialog.vue.mjs +178 -0
  14. package/es/bussiness/hyElectronicFence/cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersDialog.vue.mjs +316 -0
  15. package/es/bussiness/hyElectronicFence/cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersItem.vue.mjs +119 -0
  16. package/es/bussiness/hyElectronicFence/electronicFence.vue.mjs +358 -0
  17. package/es/bussiness/hyElectronicFence/index.mjs +13 -0
  18. package/es/bussiness/hyElectronicFence/style/electronicFence.scss +0 -0
  19. package/es/bussiness/hyElectronicFence/style/electronicFenceAssociatedUsersDialog.scss +25 -0
  20. package/es/bussiness/hyMapAearchPlace/js/index.mjs +1 -1
  21. package/es/bussiness/hyMapAearchPlace/mapAearchPlace.vue.mjs +4 -6
  22. package/es/bussiness/hyMapAearchPlace/style/mapAearchPlace.scss +4 -3
  23. package/es/bussiness/hyRuleSetting/cpns/gatheringPeople/gatheringPeople.vue.mjs +270 -0
  24. package/es/bussiness/hyRuleSetting/cpns/missionInRule/missionInRule.vue.mjs +251 -0
  25. package/es/bussiness/hyRuleSetting/cpns/missionOutRule/missionOutRule.vue.mjs +251 -0
  26. package/es/bussiness/hyRuleSetting/cpns/ruleAssignDialog/ruleAssignDialog.vue.mjs +395 -0
  27. package/es/bussiness/hyRuleSetting/cpns/ruleFenceDialog/ruleFenceDialog.vue.mjs +651 -0
  28. package/es/bussiness/hyRuleSetting/cpns/ruleSettingDialog/ruleSettingDialog.vue.mjs +357 -0
  29. package/es/bussiness/hyRuleSetting/cpns/sedentary/sedentary.vue.mjs +261 -0
  30. package/es/bussiness/hyRuleSetting/cpns/setRuleAggregationAlarmDialog/setRuleAggregationAlarmDialog.vue.mjs +360 -0
  31. package/es/bussiness/hyRuleSetting/cpns/timedVideo/timedVideo.vue.mjs +240 -0
  32. package/es/bussiness/hyRuleSetting/cpns/timerCamera/timerCamera.vue.mjs +258 -0
  33. package/es/bussiness/hyRuleSetting/cpns/timingReturn/timingReturn.vue.mjs +240 -0
  34. package/es/bussiness/hyRuleSetting/index.mjs +15 -0
  35. package/es/bussiness/hyRuleSetting/js/ruleSetting.mjs +65 -0
  36. package/es/bussiness/hyRuleSetting/ruleSetting.vue.mjs +129 -0
  37. package/es/bussiness/hyRuleSetting/style/ruleSetting.scss +0 -0
  38. package/es/bussiness/index.mjs +2 -0
  39. package/es/components/hyAudioPlayer/audioPlayer.vue.mjs +5 -13
  40. package/es/components/hyAudioPlayer/js/index.mjs +9 -14
  41. package/es/components/hyAudioPlayer/style/audioPlayer.scss +7 -2
  42. package/es/components/hyButton/button.vue.mjs +2 -2
  43. package/es/components/hyButton/style/button.scss +48 -74
  44. package/es/components/hyCheckboxGroup/checkboxGroup.vue.mjs +119 -0
  45. package/es/components/hyCheckboxGroup/index.mjs +7 -0
  46. package/es/components/hyCheckboxGroup/style/checkboxGroup.scss +58 -0
  47. package/es/components/hyConfigProvider/configProvider.vue.mjs +51 -38
  48. package/es/components/hyConfirmDialog/confirmDialog.vue.mjs +57 -62
  49. package/es/components/hyConfirmDialog/confirmMethod.mjs +24 -22
  50. package/es/components/hyCutter/cutter.vue.mjs +9 -23
  51. package/es/components/hyDatePicker/datePicker.vue.mjs +12 -17
  52. package/es/components/hyDialog/dialog.vue.mjs +5 -9
  53. package/es/components/hyDialog/style/dialog.scss +12 -13
  54. package/es/components/hyDrawer/drawer.vue.mjs +100 -0
  55. package/es/components/hyDrawer/index.mjs +7 -0
  56. package/es/components/hyDrawer/style/drawer.scss +0 -0
  57. package/es/components/hyForm/cpns/arrayItem.vue.mjs +10 -28
  58. package/es/components/hyForm/cpns/arrayItem2.vue.mjs +198 -0
  59. package/es/components/hyForm/cpns/extraItem.vue.mjs +2 -3
  60. package/es/components/hyForm/cpns/formItem.vue.mjs +75 -37
  61. package/es/components/hyForm/cpns/locationSelect.vue.mjs +26 -26
  62. package/es/components/hyForm/form.vue.mjs +58 -24
  63. package/es/components/hyForm/js/index.mjs +4 -8
  64. package/es/components/hyForm/js/useAppForm.mjs +5 -9
  65. package/es/components/hyForm/style/form.scss +4 -13
  66. package/es/components/hyIcon/icon.vue.mjs +3 -3
  67. package/es/components/hyIconBox/style/iconBox.scss +2 -6
  68. package/es/components/hyInput/inputSearch.vue.mjs +8 -11
  69. package/es/components/hyInput/style/inputSearch.scss +3 -0
  70. package/es/components/hyLoading/index.mjs +3 -5
  71. package/es/components/hyMap/js/index.mjs +29 -4
  72. package/es/components/hyMap/map.vue.mjs +17 -3
  73. package/es/components/hyMenu/style/menu.scss +5 -15
  74. package/es/components/hyNoPermissions/noPermissions.vue.mjs +3 -4
  75. package/es/components/hyNoPermissionsMap/noPermissionsMap.vue.mjs +3 -6
  76. package/es/components/hyOrgCascader/js/index.mjs +1 -5
  77. package/es/components/hyOrgCascader/orgCascader.vue.mjs +25 -11
  78. package/es/components/hyOrgCascader/style/orgCascader.scss +7 -0
  79. package/es/components/hyRadioGroup/radioGroup.vue.mjs +48 -41
  80. package/es/components/hyRadioGroup/style/radioGroup.scss +9 -0
  81. package/es/components/hySearch/cpns/searchItem.vue.mjs +33 -20
  82. package/es/components/hySearch/js/index.mjs +1 -4
  83. package/es/components/hySearch/js/useAppSearch.mjs +6 -10
  84. package/es/components/hySearch/search.vue.mjs +9 -16
  85. package/es/components/hySearch/style/search.scss +2 -0
  86. package/es/components/hyStatus/index.mjs +7 -0
  87. package/es/components/hyStatus/status.vue.mjs +110 -0
  88. package/es/components/hyStatus/style/status.scss +0 -0
  89. package/es/components/hyTable/cpns/columnSelect.vue.mjs +24 -28
  90. package/es/components/hyTable/cpns/columnSelectItem.vue.mjs +8 -9
  91. package/es/components/hyTable/cpns/headerItem.vue.mjs +2 -2
  92. package/es/components/hyTable/cpns/virtualTable.vue.mjs +18 -28
  93. package/es/components/hyTable/js/index.mjs +56 -59
  94. package/es/components/hyTable/js/useAppTable.mjs +3 -4
  95. package/es/components/hyTable/style/table.scss +8 -0
  96. package/es/components/hyTable/table.vue.mjs +35 -41
  97. package/es/components/hyTableActionButton/tableActionButton.vue.mjs +4 -4
  98. package/es/components/hyTableForm/batchTableForm.vue.mjs +3 -7
  99. package/es/components/hyTableForm/js/index.mjs +3 -11
  100. package/es/components/hyTableForm/js/useAppTableForm.mjs +2 -7
  101. package/es/components/hyTableForm/style/batchTableForm.scss +26 -54
  102. package/es/components/hyTableForm/style/tableForm.scss +3 -2
  103. package/es/components/hyTableForm/tableForm.vue.mjs +90 -46
  104. package/es/components/hyTimePicker/timePicker.vue.mjs +4 -5
  105. package/es/components/hyTree/js/index.mjs +13 -40
  106. package/es/components/hyTree/style/index.css +1 -1
  107. package/es/components/hyTree/tree.vue.mjs +17 -16
  108. package/es/components/hyUserAvatar/userAvatar.vue.mjs +3 -6
  109. package/es/components/hyVideoPlayer/js/index.mjs +14 -23
  110. package/es/components/hyVideoPlayer/style/videoPlayer.scss +5 -7
  111. package/es/components/hyVideoPlayer/videoPlayer.vue.mjs +16 -26
  112. package/es/components/index.mjs +3 -0
  113. package/es/hooks/index.mjs +6 -2
  114. package/es/hooks/useAudioPlayerConfig.mjs +1 -3
  115. package/es/hooks/useBaseMainStore.mjs +29 -0
  116. package/es/hooks/useCurrentBus.mjs +20 -0
  117. package/es/hooks/useDialog.mjs +327 -0
  118. package/es/hooks/useExportFile.mjs +133 -0
  119. package/es/hooks/useGlobalConfig.mjs +10 -6
  120. package/es/hooks/useLocale.mjs +22 -12
  121. package/es/hooks/usePermissionMap.mjs +1 -3
  122. package/es/hooks/useResizeHandler.mjs +1 -4
  123. package/es/hooks/useResizeObserver.mjs +3 -1
  124. package/es/hooks/useSubscribe.mjs +2 -2
  125. package/es/hooks/useUserAvatarMap.mjs +1 -3
  126. package/es/hooks/useVideoPlayerConfig.mjs +1 -3
  127. package/es/index.mjs +11 -2
  128. package/es/locale/{en.mjs → en_US.mjs} +81 -5
  129. package/es/locale/index.mjs +2 -2
  130. package/es/locale/zh_CN.mjs +81 -3
  131. package/es/style/tailwind.scss +7 -3
  132. package/es/utils/adaptive.mjs +1 -3
  133. package/es/utils/form.mjs +19 -12
  134. package/es/utils/handler.mjs +4 -8
  135. package/es/utils/input.mjs +8 -9
  136. package/es/utils/map/hook/bigMap.mjs +14 -53
  137. package/es/utils/map/hook/gaode.mjs +5 -20
  138. package/es/utils/map/hook/leafletjs.mjs +23 -79
  139. package/es/utils/map/index.mjs +2 -8
  140. package/es/utils/map/js/webgis.mjs +12 -12
  141. package/es/version.mjs +1 -1
  142. package/lib/api/device.js +2 -3
  143. package/lib/api/exportExcel.js +62 -0
  144. package/lib/api/index.js +27 -16
  145. package/lib/api/mapRail.js +34 -0
  146. package/lib/api/organization.js +17 -8
  147. package/lib/api/rule.js +33 -0
  148. package/lib/api/sypct.js +2 -3
  149. package/lib/api/task.js +2 -3
  150. package/lib/bussiness/hyAddDepartmentType/addDepartmentType.vue.js +17 -18
  151. package/lib/bussiness/hyAddDepartmentType/style/addDepartmentType.scss +28 -28
  152. package/lib/bussiness/hyElectronicFence/cpns/addElectronicFenceDialog/addElectronicFenceDialog.vue.js +515 -0
  153. package/lib/bussiness/hyElectronicFence/cpns/batchSetElectronicFenceUserDialog/batchSetElectronicFenceUserDialog.vue.js +182 -0
  154. package/lib/bussiness/hyElectronicFence/cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersDialog.vue.js +320 -0
  155. package/lib/bussiness/hyElectronicFence/cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersItem.vue.js +123 -0
  156. package/lib/bussiness/hyElectronicFence/electronicFence.vue.js +362 -0
  157. package/lib/bussiness/hyElectronicFence/index.js +21 -0
  158. package/lib/bussiness/hyElectronicFence/style/electronicFence.scss +0 -0
  159. package/lib/bussiness/hyElectronicFence/style/electronicFenceAssociatedUsersDialog.scss +25 -0
  160. package/lib/bussiness/hyMapAearchPlace/js/index.js +1 -1
  161. package/lib/bussiness/hyMapAearchPlace/mapAearchPlace.vue.js +4 -6
  162. package/lib/bussiness/hyMapAearchPlace/style/mapAearchPlace.scss +4 -3
  163. package/lib/bussiness/hyRuleSetting/cpns/gatheringPeople/gatheringPeople.vue.js +274 -0
  164. package/lib/bussiness/hyRuleSetting/cpns/missionInRule/missionInRule.vue.js +255 -0
  165. package/lib/bussiness/hyRuleSetting/cpns/missionOutRule/missionOutRule.vue.js +255 -0
  166. package/lib/bussiness/hyRuleSetting/cpns/ruleAssignDialog/ruleAssignDialog.vue.js +399 -0
  167. package/lib/bussiness/hyRuleSetting/cpns/ruleFenceDialog/ruleFenceDialog.vue.js +655 -0
  168. package/lib/bussiness/hyRuleSetting/cpns/ruleSettingDialog/ruleSettingDialog.vue.js +361 -0
  169. package/lib/bussiness/hyRuleSetting/cpns/sedentary/sedentary.vue.js +265 -0
  170. package/lib/bussiness/hyRuleSetting/cpns/setRuleAggregationAlarmDialog/setRuleAggregationAlarmDialog.vue.js +364 -0
  171. package/lib/bussiness/hyRuleSetting/cpns/timedVideo/timedVideo.vue.js +244 -0
  172. package/lib/bussiness/hyRuleSetting/cpns/timerCamera/timerCamera.vue.js +262 -0
  173. package/lib/bussiness/hyRuleSetting/cpns/timingReturn/timingReturn.vue.js +244 -0
  174. package/lib/bussiness/hyRuleSetting/index.js +24 -0
  175. package/lib/bussiness/hyRuleSetting/js/ruleSetting.js +68 -0
  176. package/lib/bussiness/hyRuleSetting/ruleSetting.vue.js +133 -0
  177. package/lib/bussiness/hyRuleSetting/style/ruleSetting.scss +0 -0
  178. package/lib/bussiness/index.js +21 -10
  179. package/lib/components/hyAudioPlayer/audioPlayer.vue.js +5 -13
  180. package/lib/components/hyAudioPlayer/js/index.js +9 -14
  181. package/lib/components/hyAudioPlayer/style/audioPlayer.scss +7 -2
  182. package/lib/components/hyButton/button.vue.js +2 -2
  183. package/lib/components/hyButton/style/button.scss +48 -74
  184. package/lib/components/hyCheckboxGroup/checkboxGroup.vue.js +123 -0
  185. package/lib/components/hyCheckboxGroup/index.js +12 -0
  186. package/lib/components/hyCheckboxGroup/style/checkboxGroup.scss +58 -0
  187. package/lib/components/hyConfigProvider/configProvider.vue.js +50 -56
  188. package/lib/components/hyConfirmDialog/confirmDialog.vue.js +56 -61
  189. package/lib/components/hyConfirmDialog/confirmMethod.js +23 -21
  190. package/lib/components/hyCutter/cutter.vue.js +8 -22
  191. package/lib/components/hyDatePicker/datePicker.vue.js +11 -16
  192. package/lib/components/hyDialog/dialog.vue.js +5 -9
  193. package/lib/components/hyDialog/style/dialog.scss +12 -13
  194. package/lib/components/hyDrawer/drawer.vue.js +104 -0
  195. package/lib/components/hyDrawer/index.js +12 -0
  196. package/lib/components/hyDrawer/style/drawer.scss +0 -0
  197. package/lib/components/hyForm/cpns/arrayItem.vue.js +9 -27
  198. package/lib/components/hyForm/cpns/arrayItem2.vue.js +202 -0
  199. package/lib/components/hyForm/cpns/extraItem.vue.js +2 -3
  200. package/lib/components/hyForm/cpns/formItem.vue.js +76 -38
  201. package/lib/components/hyForm/cpns/locationSelect.vue.js +26 -26
  202. package/lib/components/hyForm/form.vue.js +53 -19
  203. package/lib/components/hyForm/js/index.js +3 -7
  204. package/lib/components/hyForm/js/useAppForm.js +5 -9
  205. package/lib/components/hyForm/style/form.scss +4 -13
  206. package/lib/components/hyIcon/icon.vue.js +3 -3
  207. package/lib/components/hyIconBox/style/iconBox.scss +2 -6
  208. package/lib/components/hyInput/inputSearch.vue.js +7 -10
  209. package/lib/components/hyInput/style/inputSearch.scss +3 -0
  210. package/lib/components/hyLoading/index.js +2 -4
  211. package/lib/components/hyMap/js/index.js +29 -4
  212. package/lib/components/hyMap/map.vue.js +17 -3
  213. package/lib/components/hyMenu/style/menu.scss +5 -15
  214. package/lib/components/hyNoPermissions/noPermissions.vue.js +3 -4
  215. package/lib/components/hyNoPermissionsMap/noPermissionsMap.vue.js +3 -6
  216. package/lib/components/hyOrgCascader/js/index.js +1 -5
  217. package/lib/components/hyOrgCascader/orgCascader.vue.js +23 -9
  218. package/lib/components/hyOrgCascader/style/orgCascader.scss +7 -0
  219. package/lib/components/hyRadioGroup/radioGroup.vue.js +47 -40
  220. package/lib/components/hyRadioGroup/style/radioGroup.scss +9 -0
  221. package/lib/components/hySearch/cpns/searchItem.vue.js +33 -20
  222. package/lib/components/hySearch/js/index.js +1 -4
  223. package/lib/components/hySearch/js/useAppSearch.js +6 -10
  224. package/lib/components/hySearch/search.vue.js +9 -16
  225. package/lib/components/hySearch/style/search.scss +2 -0
  226. package/lib/components/hyStatus/index.js +12 -0
  227. package/lib/components/hyStatus/status.vue.js +114 -0
  228. package/lib/components/hyStatus/style/status.scss +0 -0
  229. package/lib/components/hyTable/cpns/columnSelect.vue.js +22 -26
  230. package/lib/components/hyTable/cpns/columnSelectItem.vue.js +7 -8
  231. package/lib/components/hyTable/cpns/headerItem.vue.js +2 -2
  232. package/lib/components/hyTable/cpns/virtualTable.vue.js +17 -27
  233. package/lib/components/hyTable/js/index.js +54 -57
  234. package/lib/components/hyTable/js/useAppTable.js +2 -3
  235. package/lib/components/hyTable/style/table.scss +8 -0
  236. package/lib/components/hyTable/table.vue.js +35 -41
  237. package/lib/components/hyTableActionButton/tableActionButton.vue.js +4 -4
  238. package/lib/components/hyTableForm/batchTableForm.vue.js +3 -7
  239. package/lib/components/hyTableForm/js/index.js +3 -11
  240. package/lib/components/hyTableForm/js/useAppTableForm.js +2 -7
  241. package/lib/components/hyTableForm/style/batchTableForm.scss +26 -54
  242. package/lib/components/hyTableForm/style/tableForm.scss +3 -2
  243. package/lib/components/hyTableForm/tableForm.vue.js +89 -45
  244. package/lib/components/hyTimePicker/timePicker.vue.js +3 -4
  245. package/lib/components/hyTree/js/index.js +13 -40
  246. package/lib/components/hyTree/style/index.css +1 -1
  247. package/lib/components/hyTree/tree.vue.js +17 -16
  248. package/lib/components/hyUserAvatar/userAvatar.vue.js +3 -6
  249. package/lib/components/hyVideoPlayer/js/index.js +14 -23
  250. package/lib/components/hyVideoPlayer/style/videoPlayer.scss +5 -7
  251. package/lib/components/hyVideoPlayer/videoPlayer.vue.js +16 -26
  252. package/lib/components/index.js +46 -40
  253. package/lib/hooks/index.js +17 -0
  254. package/lib/hooks/useAudioPlayerConfig.js +1 -3
  255. package/lib/hooks/useBaseMainStore.js +32 -0
  256. package/lib/hooks/useCurrentBus.js +23 -0
  257. package/lib/hooks/useDialog.js +331 -0
  258. package/lib/hooks/useExportFile.js +135 -0
  259. package/lib/hooks/useGlobalConfig.js +10 -6
  260. package/lib/hooks/useLocale.js +25 -11
  261. package/lib/hooks/usePermissionMap.js +1 -3
  262. package/lib/hooks/useResizeHandler.js +1 -4
  263. package/lib/hooks/useResizeObserver.js +3 -1
  264. package/lib/hooks/useSubscribe.js +2 -1
  265. package/lib/hooks/useUserAvatarMap.js +1 -3
  266. package/lib/hooks/useVideoPlayerConfig.js +1 -3
  267. package/lib/index.js +107 -73
  268. package/lib/locale/{en.js → en_US.js} +81 -5
  269. package/lib/locale/index.js +3 -3
  270. package/lib/locale/zh_CN.js +81 -3
  271. package/lib/style/tailwind.scss +7 -3
  272. package/lib/utils/adaptive.js +1 -3
  273. package/lib/utils/form.js +17 -10
  274. package/lib/utils/handler.js +3 -7
  275. package/lib/utils/input.js +7 -8
  276. package/lib/utils/map/hook/bigMap.js +14 -53
  277. package/lib/utils/map/hook/gaode.js +5 -20
  278. package/lib/utils/map/hook/leafletjs.js +23 -79
  279. package/lib/utils/map/index.js +2 -8
  280. package/lib/utils/map/js/webgis.js +12 -12
  281. package/lib/version.js +1 -1
  282. package/package.json +3 -2
@@ -0,0 +1,327 @@
1
+ import { getCurrentInstance, ref, onMounted, watch } from 'vue';
2
+ import '../components/index.mjs';
3
+ import { useLocale } from './useLocale.mjs';
4
+ import './index.mjs';
5
+ import { useBaseMainStore } from './useBaseMainStore.mjs';
6
+ import { useCurrentBus } from './useCurrentBus.mjs';
7
+ import { HyConfirmDialog } from '../components/hyConfirmDialog/index.mjs';
8
+
9
+ function useDialog(hy) {
10
+ const instance = getCurrentInstance();
11
+ const loading = ref(false);
12
+ const isEdit = ref(false);
13
+ const minimized = ref(false);
14
+ const minimizedTitle = ref("");
15
+ function setDragLevelIndex(dialogComponents) {
16
+ const { baseMainStore } = useBaseMainStore();
17
+ const dragLevel = baseMainStore.getters.dragLevel;
18
+ hy[`${dialogComponents}`].value.setDragLevelIndex(dragLevel);
19
+ baseMainStore.commit("setDragLevel");
20
+ }
21
+ function onMinimized(params) {
22
+ hy.minimized.value = params.type;
23
+ hy.minimizedTitle.value = params.title;
24
+ if (hy.minimized.value) {
25
+ hy.minimizedClose();
26
+ } else {
27
+ hy.minimizedRemove();
28
+ }
29
+ }
30
+ function minimizedRemove() {
31
+ const { currentBus } = useCurrentBus();
32
+ const unique = instance?.attrs?.unique || null;
33
+ currentBus.value.emit("workbenchOperation", {
34
+ type: "delete",
35
+ row: unique
36
+ });
37
+ }
38
+ function minimizedClose() {
39
+ const { currentBus } = useCurrentBus();
40
+ const unique = instance?.attrs?.unique || null;
41
+ if (unique) {
42
+ currentBus.value.emit("workbenchOperation", {
43
+ type: "add",
44
+ row: {
45
+ component: unique,
46
+ labelName: hy.minimizedTitle.value,
47
+ valueJson: {
48
+ isEdit: hy.getIsEdit(),
49
+ ...hy.getCacheData()
50
+ }
51
+ }
52
+ });
53
+ }
54
+ }
55
+ async function minimizedShow(params) {
56
+ if (params.id) {
57
+ const value = params.valueJson;
58
+ hy.setIsEdit(false);
59
+ await hy.restoreCache(value);
60
+ hy.setIsEdit(value.isEdit);
61
+ } else {
62
+ hy.setDragLevelIndex("HyDialogRef");
63
+ }
64
+ }
65
+ function setIsEdit(newIsEdit) {
66
+ hy.isEdit.value = newIsEdit;
67
+ }
68
+ function getIsEdit() {
69
+ return hy.isEdit.value;
70
+ }
71
+ function getCacheData() {
72
+ return {
73
+ // formModel: hy.formModel.value,
74
+ };
75
+ }
76
+ function restoreCache(params = {}) {
77
+ return Promise.resolve();
78
+ }
79
+ function confirmReplace(type) {
80
+ const { t } = useLocale();
81
+ return new Promise((resolve, reject) => {
82
+ if (type === "close") {
83
+ HyConfirmDialog.confirm({
84
+ content: `<div>
85
+ <p>\u786E\u8BA4\u79BB\u5F00\u7F16\u8F91</p>
86
+ <p>\u79BB\u5F00\u540E\u5DF2\u586B\u5199\u7684\u5185\u5BB9\u5C06\u4E0D\u505A\u4FDD\u5B58</p>
87
+ </div>`,
88
+ onCancel: () => {
89
+ hy.loading.value = false;
90
+ reject(false);
91
+ },
92
+ submitText: "\u786E\u8BA4\u79BB\u5F00",
93
+ onSubmit: () => {
94
+ resolve(true);
95
+ }
96
+ });
97
+ } else {
98
+ HyConfirmDialog.confirm({
99
+ content: `<div>
100
+ <p>\u68C0\u6D4B\u5230\u60A8\u4E0A\u6B21\u6709\u672A\u5B8C\u6210\u7684\u7F16\u8F91\u5185\u5BB9\u3002</p>
101
+ <p>\u662F\u5426\u7EE7\u7EED\u8FDB\u884C\u7F16\u8F91\uFF1F</p>
102
+ </div>`,
103
+ cancelText: "\u7EE7\u7EED\u7F16\u8F91\u5185\u5BB9",
104
+ onCancel: () => {
105
+ hy.setDragLevelIndex("HyDialogRef");
106
+ hy.loading.value = false;
107
+ reject(false);
108
+ },
109
+ submitText: "\u6E05\u7A7A\u91CD\u65B0\u7F16\u8F91",
110
+ onSubmit: () => {
111
+ resolve(true);
112
+ }
113
+ });
114
+ }
115
+ });
116
+ }
117
+ onMounted(() => {
118
+ watch(
119
+ () => hy.dialogVisible?.value,
120
+ (newVal) => {
121
+ if (!newVal) {
122
+ if (hy.minimized) {
123
+ hy.minimized.value = false;
124
+ }
125
+ if (hy.loading) {
126
+ hy.loading.value = false;
127
+ }
128
+ hy.setIsEdit(false);
129
+ } else {
130
+ hy.minimizedRemove();
131
+ }
132
+ },
133
+ { deep: true }
134
+ );
135
+ });
136
+ return {
137
+ loading,
138
+ isEdit,
139
+ instance,
140
+ minimized,
141
+ minimizedTitle,
142
+ setDragLevelIndex,
143
+ onMinimized,
144
+ minimizedRemove,
145
+ minimizedClose,
146
+ minimizedShow,
147
+ setIsEdit,
148
+ getIsEdit,
149
+ getCacheData,
150
+ restoreCache,
151
+ confirmReplace
152
+ };
153
+ }
154
+ function useDialogIsEdit(hy) {
155
+ const isWatchForm = ref(false);
156
+ function watchPause(type = "show") {
157
+ return new Promise(async (resolve, reject) => {
158
+ if (hy.getIsEdit()) {
159
+ if (type === "close") {
160
+ const eplaceType = await hy.confirmReplace(type).catch((err) => {
161
+ return reject(err);
162
+ });
163
+ if (!eplaceType) {
164
+ return reject();
165
+ }
166
+ } else {
167
+ await hy.confirmReplace(type);
168
+ }
169
+ }
170
+ hy?.setIsEdit(false);
171
+ hy.isWatchForm.value = false;
172
+ resolve({});
173
+ });
174
+ }
175
+ function watchResume() {
176
+ hy.isWatchForm.value = true;
177
+ }
178
+ onMounted(() => {
179
+ if (hy.formModel && hy.formModel.value) {
180
+ watch(
181
+ () => hy.formModel?.value,
182
+ () => {
183
+ if (hy.isWatchForm?.value && !hy.getIsEdit()) {
184
+ hy.setIsEdit(true);
185
+ }
186
+ },
187
+ { deep: true }
188
+ );
189
+ }
190
+ hy.setIsEdit(false);
191
+ });
192
+ return {
193
+ isWatchForm,
194
+ watchPause,
195
+ watchResume
196
+ };
197
+ }
198
+ function useBatchDialog(hy) {
199
+ const instance = getCurrentInstance();
200
+ const tableDataChange = ref([]);
201
+ const progress = ref(0);
202
+ function onTableDataChange(data) {
203
+ hy.tableDataChange.value = data;
204
+ }
205
+ function confirmReplace(type) {
206
+ const { t } = useLocale();
207
+ return new Promise((resolve, reject) => {
208
+ if (type === "close") {
209
+ HyConfirmDialog.confirm({
210
+ content: `<div>
211
+ <p>\u786E\u8BA4\u79BB\u5F00\u7F16\u8F91</p>
212
+ <p>\u79BB\u5F00\u540E\u5DF2\u586B\u5199\u7684\u5185\u5BB9\u5C06\u4E0D\u505A\u4FDD\u5B58</p>
213
+ </div>`,
214
+ onCancel: () => {
215
+ hy.loading.value = false;
216
+ reject(false);
217
+ },
218
+ submitText: "\u786E\u8BA4\u79BB\u5F00",
219
+ onSubmit: () => {
220
+ resolve(true);
221
+ }
222
+ });
223
+ } else {
224
+ HyConfirmDialog.confirm({
225
+ content: `<div>
226
+ <p>\u68C0\u6D4B\u5230\u60A8\u4E0A\u6B21\u6709\u672A\u5B8C\u6210\u7684\u7F16\u8F91\u5185\u5BB9\u3002</p>
227
+ <p>\u662F\u5426\u7EE7\u7EED\u8FDB\u884C\u7F16\u8F91\uFF1F</p>
228
+ </div>`,
229
+ cancelText: "\u7EE7\u7EED\u7F16\u8F91\u5185\u5BB9",
230
+ onCancel: () => {
231
+ hy.setDragLevelIndex("HyBatchUploadDialogRef");
232
+ hy.loading.value = false;
233
+ reject(false);
234
+ },
235
+ submitText: "\u6E05\u7A7A\u91CD\u65B0\u7F16\u8F91",
236
+ onSubmit: () => {
237
+ resolve(true);
238
+ }
239
+ });
240
+ }
241
+ });
242
+ }
243
+ function minimizedClose() {
244
+ const unique = instance?.attrs?.unique || null;
245
+ if (unique) {
246
+ const { currentBus } = useCurrentBus();
247
+ currentBus.value.emit("workbenchOperation", {
248
+ type: "add",
249
+ row: {
250
+ component: unique,
251
+ labelName: hy.minimizedTitle.value,
252
+ valueJson: {
253
+ isBatch: true,
254
+ isEdit: hy.getIsEdit(),
255
+ uploadStatus: true,
256
+ loading: hy.HyBatchUploadDialogRef.value.getIsSubmitting(),
257
+ updateProgress: hy.progress.value,
258
+ ...hy.getCacheData()
259
+ }
260
+ }
261
+ });
262
+ }
263
+ }
264
+ async function minimizedShow(params) {
265
+ hy.setDragLevelIndex("HyBatchUploadDialogRef");
266
+ }
267
+ async function onClose() {
268
+ await hy.watchPause("close");
269
+ }
270
+ function onSubmitProgress(newProgress) {
271
+ const unique = instance?.attrs?.unique || null;
272
+ hy.progress.value = newProgress;
273
+ const { currentBus } = useCurrentBus();
274
+ currentBus.value.emit("workbenchOperation", {
275
+ type: "update",
276
+ row: {
277
+ component: unique,
278
+ valueJson: {
279
+ loading: true,
280
+ uploadStatus: true,
281
+ updateProgress: hy.progress.value
282
+ }
283
+ }
284
+ });
285
+ }
286
+ function uploadProgress(params = {}) {
287
+ const unique = instance?.attrs?.unique || null;
288
+ const { total, success, failed, result } = params;
289
+ if (result) {
290
+ hy.minimizedRemove();
291
+ }
292
+ const { currentBus } = useCurrentBus();
293
+ currentBus.value.emit("workbenchOperation", {
294
+ type: "update",
295
+ row: {
296
+ component: unique,
297
+ valueJson: {
298
+ uploadStatus: result
299
+ }
300
+ }
301
+ });
302
+ }
303
+ onMounted(() => {
304
+ watch(
305
+ () => hy.tableDataChange.value,
306
+ () => {
307
+ hy.setIsEdit(hy.tableDataChange.value.length !== 0);
308
+ },
309
+ { deep: true, immediate: true }
310
+ );
311
+ hy.setIsEdit(false);
312
+ });
313
+ return {
314
+ instance,
315
+ tableDataChange,
316
+ progress,
317
+ onTableDataChange,
318
+ confirmReplace,
319
+ minimizedClose,
320
+ minimizedShow,
321
+ onClose,
322
+ onSubmitProgress,
323
+ uploadProgress
324
+ };
325
+ }
326
+
327
+ export { useBatchDialog, useDialog, useDialogIsEdit };
@@ -0,0 +1,133 @@
1
+ import { ElMessage } from 'element-plus';
2
+ import './index.mjs';
3
+ import '../utils/index.mjs';
4
+ import { exportDailyCheckReportApi, exportDailyCheckReportPostApi, exportDailyCheckReportPostToFormApi, exportExcelFnApi } from '../api/exportExcel.mjs';
5
+ import { $t } from './useLocale.mjs';
6
+ import { formatTimeFn } from '../utils/input.mjs';
7
+
8
+ function useExportFile(hy) {
9
+ function blobDownloadFn(res, name) {
10
+ return new Promise((resolve, reject) => {
11
+ ElMessage.warning($t("startDownloading"));
12
+ const today = formatTimeFn(/* @__PURE__ */ new Date(), "Y-M-h D:m:s");
13
+ const blob = res;
14
+ const reader = new FileReader();
15
+ reader.readAsDataURL(blob);
16
+ reader.onload = function() {
17
+ let url = null;
18
+ try {
19
+ if (window.navigator.msSaveOrOpenBlob) {
20
+ const blobObject = new Blob([blob]);
21
+ window.navigator.msSaveOrOpenBlob(blobObject, `${name}_${today}.xls`);
22
+ } else {
23
+ url = URL.createObjectURL(new Blob([blob]));
24
+ const a = document.createElement("a");
25
+ document.body.appendChild(a);
26
+ a.href = url;
27
+ a.download = `${name}_${today}.xls`;
28
+ a.target = "_blank";
29
+ a.click();
30
+ a.remove();
31
+ }
32
+ resolve();
33
+ } catch (error) {
34
+ reject(error);
35
+ } finally {
36
+ if (url) URL.revokeObjectURL(url);
37
+ }
38
+ };
39
+ });
40
+ }
41
+ function customExportFileFn(name, route, getParameters = {}) {
42
+ return new Promise((resolve, reject) => {
43
+ let url = "";
44
+ for (const k in getParameters) {
45
+ const content = getParameters[`${k}`];
46
+ if (content || content === 0) {
47
+ url += `${k}=${content}&`;
48
+ }
49
+ }
50
+ url = url.substring(url.length - 1, 0);
51
+ exportDailyCheckReportApi(`/exportExcel/${route}?${url}`).then((res) => {
52
+ if (!res) return ElMessage.error($t("noDataCanBeExported"));
53
+ hy.blobDownloadFn(res, name).then(() => {
54
+ resolve();
55
+ });
56
+ });
57
+ });
58
+ }
59
+ function customExportFilePostFn(name, route, getParameters = {}) {
60
+ return new Promise((resolve, reject) => {
61
+ exportDailyCheckReportPostApi(`/exportExcel/${route}`, getParameters).then((res) => {
62
+ hy.blobDownloadFn(res, name).then(() => {
63
+ resolve();
64
+ });
65
+ });
66
+ });
67
+ }
68
+ function customExportFilePostToFormFn(name, route, getParameters = {}) {
69
+ return new Promise((resolve, reject) => {
70
+ exportDailyCheckReportPostToFormApi(`/exportExcel/${route}`, getParameters).then((res) => {
71
+ this.blobDownloadFn(res, name).then(() => {
72
+ resolve();
73
+ });
74
+ });
75
+ });
76
+ }
77
+ function directDownloadFn(url, fileName) {
78
+ return new Promise((resolve, reject) => {
79
+ exportDailyCheckReportApi(url).then((res) => {
80
+ if (!res) return ElMessage.error($t("noDataCanBeExported"));
81
+ hy.blobDownloadFn(res, fileName).then(() => {
82
+ resolve();
83
+ });
84
+ });
85
+ });
86
+ }
87
+ function obtainUrlDownloadingFn(url, fileName) {
88
+ ElMessage.warning($t("startDownloading"));
89
+ const today = formatTimeFn(/* @__PURE__ */ new Date(), "Y-M-h D:m:s");
90
+ exportExcelFnApi(url).then((res) => {
91
+ if (res.code === 200) {
92
+ const url2 = res.data;
93
+ const xhr = new XMLHttpRequest();
94
+ xhr.open("GET", url2);
95
+ xhr.responseType = "blob";
96
+ xhr.onload = function() {
97
+ const blob = xhr.response;
98
+ const reader = new FileReader();
99
+ reader.readAsDataURL(blob);
100
+ reader.onload = () => {
101
+ if (window.navigator.msSaveOrOpenBlob) {
102
+ const blobObject = new Blob([blob]);
103
+ window.navigator.msSaveOrOpenBlob(blobObject, `${fileName}_${today}.xls`);
104
+ } else {
105
+ const url3 = URL.createObjectURL(new Blob([blob]));
106
+ const a = document.createElement("a");
107
+ document.body.appendChild(a);
108
+ a.href = url3;
109
+ a.download = `${fileName}_${today}.xls`;
110
+ a.target = "_blank";
111
+ a.click();
112
+ a.remove();
113
+ }
114
+ };
115
+ };
116
+ xhr.onerror = function() {
117
+ console.error("could not download file");
118
+ };
119
+ xhr.send();
120
+ }
121
+ });
122
+ }
123
+ return {
124
+ blobDownloadFn,
125
+ customExportFileFn,
126
+ customExportFilePostFn,
127
+ customExportFilePostToFormFn,
128
+ directDownloadFn,
129
+ obtainUrlDownloadingFn
130
+ };
131
+ }
132
+
133
+ export { useExportFile };
@@ -9,6 +9,8 @@ import { localVideoPlayerConfigKey } from './useVideoPlayerConfig.mjs';
9
9
  import { localEnsureHyIconMapKey } from './useEnsureHyIcon.mjs';
10
10
  import { localTooltipConfigKey } from './useTooltipConfig.mjs';
11
11
  import { localMapConfigKey } from './useMapConfig.mjs';
12
+ import { localBaseMainStoreKey } from './useBaseMainStore.mjs';
13
+ import { localCurrentBusKey } from './useCurrentBus.mjs';
12
14
  import zh_CN from '../locale/zh_CN.mjs';
13
15
 
14
16
  const globalConfig = ref();
@@ -29,19 +31,16 @@ function useGlobalConfig(key, defaultValue = void 0) {
29
31
  return config;
30
32
  }
31
33
  }
32
- const provideGlobalConfig = (config, app, global = false) => {
34
+ const provideGlobalConfig = (props, app, global = false) => {
33
35
  const inSetup = !!getCurrentInstance();
34
36
  const oldConfig = inSetup ? useGlobalConfig() : void 0;
35
37
  const provideFn = app?.provide ?? (inSetup ? provide : void 0);
36
38
  if (!provideFn) {
37
- console.warn(
38
- "provideGlobalConfig",
39
- "provideGlobalConfig() can only be used inside setup()."
40
- );
39
+ console.warn("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup().");
41
40
  return;
42
41
  }
43
42
  const context = computed(() => {
44
- const cfg = unref(config);
43
+ const cfg = unref(props.hyConfig || {});
45
44
  if (!oldConfig?.value) return cfg;
46
45
  return mergeConfig(oldConfig.value, cfg);
47
46
  });
@@ -82,6 +81,11 @@ const provideGlobalConfig = (config, app, global = false) => {
82
81
  localMapConfigKey,
83
82
  computed(() => context.value.mapConfig)
84
83
  );
84
+ provideFn(localBaseMainStoreKey, context.value.baseMainStore);
85
+ provideFn(
86
+ localCurrentBusKey,
87
+ computed(() => context.value.currentBus)
88
+ );
85
89
  if (global || !globalConfig.value) {
86
90
  globalConfig.value = context.value;
87
91
  }
@@ -7,21 +7,20 @@ import { isEmpty } from '../utils/is.mjs';
7
7
  import zh_CN from '../locale/zh_CN.mjs';
8
8
  import { useGlobalConfig } from './useGlobalConfig.mjs';
9
9
 
10
+ const localeContextKey = /* @__PURE__ */ Symbol("localeContextKey");
11
+ const translate = (path, option, locale) => get(locale, path, path).replace(/\{(\w+)\}/g, (_, key) => `${!isEmpty(option?.[key]) ? option[key] : ""}`);
10
12
  const buildTranslator = (locale) => (path, option) => translate(path, option, unref(locale));
11
- const translate = (path, option, locale) => get(locale, path, path).replace(
12
- /\{(\w+)\}/g,
13
- (_, key) => `${!isEmpty(option?.[key]) ? option[key] : ""}`
14
- );
15
13
  const buildLocaleContext = (locale, conifg) => {
16
- const lang = computed(() => unref(locale).name);
14
+ const lang2 = computed(() => unref(locale).name);
17
15
  const localeRef = isRef(locale) ? locale : ref(locale);
16
+ const $t2 = buildTranslator(locale);
18
17
  return {
19
- lang,
18
+ lang: lang2,
20
19
  locale: localeRef,
21
- t: buildTranslator(locale)
20
+ t: $t2,
21
+ $t: $t2
22
22
  };
23
23
  };
24
- const localeContextKey = /* @__PURE__ */ Symbol("localeContextKey");
25
24
  const getLanguage = (localeOverrides) => {
26
25
  const locale = localeOverrides || (getCurrentInstance() ? inject(localeContextKey, ref()) : void 0);
27
26
  return unref(locale)?.name || Chinese?.name;
@@ -29,10 +28,21 @@ const getLanguage = (localeOverrides) => {
29
28
  const useLocale = (localeOverrides) => {
30
29
  const locale = localeOverrides || (getCurrentInstance() ? inject(localeContextKey, ref()) : void 0);
31
30
  return buildLocaleContext(
32
- computed(
33
- () => unref(locale) || index[unref(useGlobalConfig())?.locale] || zh_CN
34
- )
31
+ computed(() => unref(locale) || index[unref(useGlobalConfig())?.locale] || zh_CN)
35
32
  );
36
33
  };
34
+ const lang = ref("zh_CN");
35
+ const getLang = () => {
36
+ return lang.value;
37
+ };
38
+ const setLang = (value) => {
39
+ if (value && ["zh_CN", "en_US"]) {
40
+ lang.value = value;
41
+ }
42
+ };
43
+ const $t = (path, option) => {
44
+ const locale = index[lang.value] || zh_CN;
45
+ return translate(path, option, locale);
46
+ };
37
47
 
38
- export { buildLocaleContext, buildTranslator, getLanguage, localeContextKey, translate, useLocale };
48
+ export { $t, buildLocaleContext, buildTranslator, getLang, getLanguage, lang, localeContextKey, setLang, translate, useLocale };
@@ -10,9 +10,7 @@ const usePermissionMap = () => {
10
10
  };
11
11
  } else {
12
12
  return {
13
- permissionMap: computed(
14
- () => unref(useGlobalConfig()).permissionMap || /* @__PURE__ */ new Map()
15
- )
13
+ permissionMap: computed(() => unref(useGlobalConfig()).permissionMap || /* @__PURE__ */ new Map())
16
14
  };
17
15
  }
18
16
  };
@@ -20,10 +20,7 @@ function onResizeHandler() {
20
20
  resizeConfig.animationId = window.requestAnimationFrame(() => {
21
21
  try {
22
22
  let symbolKeys = Object.getOwnPropertySymbols(resizeMap);
23
- symbolKeys = [
24
- ...symbolKeys.slice(resizeConfig.resizeIndex),
25
- ...symbolKeys
26
- ];
23
+ symbolKeys = [...symbolKeys.slice(resizeConfig.resizeIndex), ...symbolKeys];
27
24
  symbolKeys.forEach((key, index, list) => {
28
25
  const timeout = setTimeout(() => {
29
26
  resizeConfig.resizeIndex = list.length - 1 == index ? 0 : index;
@@ -11,7 +11,9 @@ function useResizeObserver(container, callback) {
11
11
  resizeMap[key] = resizeObserver;
12
12
  }
13
13
  function removeResize() {
14
- resizeObserver.disconnect();
14
+ if (resizeObserver) {
15
+ resizeObserver.disconnect();
16
+ }
15
17
  resizeObserver = null;
16
18
  delete resizeMap[key];
17
19
  }
@@ -7,7 +7,7 @@ function useSubscribe() {
7
7
  bus.on(UPDATE_ORG_CASCADER, callback);
8
8
  };
9
9
  const unsubOrgCascader = (callback) => {
10
- bus.on(UPDATE_ORG_CASCADER, callback);
10
+ bus.off(UPDATE_ORG_CASCADER, callback);
11
11
  };
12
12
  return {
13
13
  // 部门级联组件
@@ -25,4 +25,4 @@ function usePublish() {
25
25
  };
26
26
  }
27
27
 
28
- export { usePublish, useSubscribe };
28
+ export { bus, usePublish, useSubscribe };
@@ -10,9 +10,7 @@ const useUserAvatarMap = () => {
10
10
  };
11
11
  } else {
12
12
  return {
13
- userAvatarMap: computed(
14
- () => unref(useGlobalConfig()).userAvatarMap || /* @__PURE__ */ new Map()
15
- )
13
+ userAvatarMap: computed(() => unref(useGlobalConfig()).userAvatarMap || /* @__PURE__ */ new Map())
16
14
  };
17
15
  }
18
16
  };
@@ -10,9 +10,7 @@ const useVideoPlayerConfig = () => {
10
10
  };
11
11
  } else {
12
12
  return {
13
- videoPlayerConfig: computed(
14
- () => unref(useGlobalConfig()).videoPlayer || {}
15
- )
13
+ videoPlayerConfig: computed(() => unref(useGlobalConfig()).videoPlayer || {})
16
14
  };
17
15
  }
18
16
  };