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