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
|
@@ -48,9 +48,7 @@ const DEFAULT_MAP_OPTIONS = {
|
|
|
48
48
|
// 禁止鼠标滚动缩放
|
|
49
49
|
};
|
|
50
50
|
const remToPx = (rem) => {
|
|
51
|
-
const rootFontSize = parseFloat(
|
|
52
|
-
getComputedStyle(document.documentElement).fontSize
|
|
53
|
-
);
|
|
51
|
+
const rootFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
54
52
|
return rem * rootFontSize;
|
|
55
53
|
};
|
|
56
54
|
const createUniqueId = () => {
|
|
@@ -164,11 +162,7 @@ function wrapDrawLayer(layer) {
|
|
|
164
162
|
const bounds = layer.getBounds();
|
|
165
163
|
if (!layer.getLatLngs) {
|
|
166
164
|
layer.getLatLngs = () => {
|
|
167
|
-
const points = circleToPolygonPoints(
|
|
168
|
-
layer.getLatLng(),
|
|
169
|
-
layer.getRadius() / 1e3,
|
|
170
|
-
true
|
|
171
|
-
);
|
|
165
|
+
const points = circleToPolygonPoints(layer.getLatLng(), layer.getRadius() / 1e3, true);
|
|
172
166
|
return [latLngListCheckExport(points)];
|
|
173
167
|
};
|
|
174
168
|
} else {
|
|
@@ -229,11 +223,11 @@ function getCrs(crs) {
|
|
|
229
223
|
70.53121499999999,
|
|
230
224
|
35.26560700000001
|
|
231
225
|
].map((item) => 0.0254 * item / (96 * (Math.PI * 2 * 6378137 / 360)));
|
|
232
|
-
L.CRS.CRS4490 = new L.Proj.CRS(
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
);
|
|
226
|
+
L.CRS.CRS4490 = new L.Proj.CRS("EPSG:4490", "+proj=longlat +ellps=GRS80 +no_defs +type=crs", {
|
|
227
|
+
matrixIds,
|
|
228
|
+
resolutions,
|
|
229
|
+
origin: [-180, 90]
|
|
230
|
+
});
|
|
237
231
|
}
|
|
238
232
|
return crs ? L.CRS[`${crs}`] : DEFAULT_CRS;
|
|
239
233
|
}
|
|
@@ -306,6 +300,7 @@ class Leafletjs extends EventEmitter {
|
|
|
306
300
|
return createMapProxy(polygon, handlers);
|
|
307
301
|
});
|
|
308
302
|
this.initParams = request;
|
|
303
|
+
this.tileLayerList = [];
|
|
309
304
|
}
|
|
310
305
|
// 初始化地图
|
|
311
306
|
InitMap(domId, option) {
|
|
@@ -325,6 +320,7 @@ class Leafletjs extends EventEmitter {
|
|
|
325
320
|
const newMap = L.map(domId, option);
|
|
326
321
|
newMap.getInitMap = () => newMap;
|
|
327
322
|
const wrappedHandlers = createWrappedHandlerStore();
|
|
323
|
+
const _this = this;
|
|
328
324
|
const handlers = {
|
|
329
325
|
// 删除地图
|
|
330
326
|
removeMap: function(target, params) {
|
|
@@ -400,6 +396,10 @@ class Leafletjs extends EventEmitter {
|
|
|
400
396
|
off: function(target, types, fn, context) {
|
|
401
397
|
const wrappedFn = wrappedHandlers.take(types, fn);
|
|
402
398
|
return target.off(types, wrappedFn || fn, context);
|
|
399
|
+
},
|
|
400
|
+
/* 判断地图颜色 */
|
|
401
|
+
satelliteMapFn: function(target, satelliteMap) {
|
|
402
|
+
_this.setLayersUrl(target, satelliteMap !== 2);
|
|
403
403
|
}
|
|
404
404
|
};
|
|
405
405
|
const map = createMapProxy(newMap, handlers);
|
|
@@ -409,7 +409,7 @@ class Leafletjs extends EventEmitter {
|
|
|
409
409
|
option.completeCallbacks();
|
|
410
410
|
}
|
|
411
411
|
});
|
|
412
|
-
this.setLayersUrl(map);
|
|
412
|
+
this.setLayersUrl(map, option.satelliteMap !== 2);
|
|
413
413
|
return map;
|
|
414
414
|
}
|
|
415
415
|
// 设置地图瓦片地址
|
|
@@ -424,22 +424,23 @@ class Leafletjs extends EventEmitter {
|
|
|
424
424
|
if (mapServerType === "WMTS" || mapServerType === "Dynamic") {
|
|
425
425
|
return this.createLayers(map, layersUrls);
|
|
426
426
|
}
|
|
427
|
+
this.tileLayerList.forEach((tileLayer) => {
|
|
428
|
+
tileLayer?.remove();
|
|
429
|
+
});
|
|
430
|
+
this.tileLayerList = [];
|
|
427
431
|
layersUrls.split(",").forEach((layersUrl) => {
|
|
432
|
+
let tileLayer = null;
|
|
428
433
|
if (changeColorType) {
|
|
429
|
-
this.createCustomLayers(map, layersUrl);
|
|
434
|
+
tileLayer = this.createCustomLayers(map, layersUrl);
|
|
430
435
|
} else {
|
|
431
|
-
this.createLayers(map, layersUrl);
|
|
436
|
+
tileLayer = this.createLayers(map, layersUrl);
|
|
432
437
|
}
|
|
438
|
+
this.tileLayerList.push(tileLayer);
|
|
433
439
|
});
|
|
434
440
|
}
|
|
435
441
|
// 超图 WMTS 图层(不适用所有的WMTS图层,目前仅支持超图WMTS,因不同的WMTS服务规范不一样,主要体现在路由访问参数)
|
|
436
442
|
createWMTSLayer(map, option = {}) {
|
|
437
|
-
const {
|
|
438
|
-
url,
|
|
439
|
-
layer,
|
|
440
|
-
tilematrixSet,
|
|
441
|
-
format = "image/png"
|
|
442
|
-
} = typeof option === "string" ? { url: option } : option;
|
|
443
|
+
const { url, layer, tilematrixSet, format = "image/png" } = typeof option === "string" ? { url: option } : option;
|
|
443
444
|
const crs = getCrs(this.initParams.crs);
|
|
444
445
|
if (!L.WMTSLayer) {
|
|
445
446
|
L.WMTSLayer = L.TileLayer.extend({
|
|
@@ -515,8 +516,7 @@ class Leafletjs extends EventEmitter {
|
|
|
515
516
|
createLayers(map, url, option = {}) {
|
|
516
517
|
const { zoomOffset, mapServerType } = this.initParams;
|
|
517
518
|
if (mapServerType === "WMTS") return this.createWMTSLayer(map, url);
|
|
518
|
-
if (mapServerType === "Dynamic")
|
|
519
|
-
return this.createDynamicLayer(map, url.url || url);
|
|
519
|
+
if (mapServerType === "Dynamic") return this.createDynamicLayer(map, url.url || url);
|
|
520
520
|
const newLeayer = L.tileLayer(url, {
|
|
521
521
|
...option,
|
|
522
522
|
zoomOffset: zoomOffset || 0
|
|
@@ -528,8 +528,7 @@ class Leafletjs extends EventEmitter {
|
|
|
528
528
|
createCustomLayers(map, url, option = {}) {
|
|
529
529
|
const { zoomOffset, mapServerType } = this.initParams;
|
|
530
530
|
if (mapServerType === "WMTS") return this.createWMTSLayer(map, url);
|
|
531
|
-
if (mapServerType === "Dynamic")
|
|
532
|
-
return this.createDynamicLayer(map, url.url || url);
|
|
531
|
+
if (mapServerType === "Dynamic") return this.createDynamicLayer(map, url.url || url);
|
|
533
532
|
const filter = option.filter || DEFAULT_TILE_FILTER;
|
|
534
533
|
const CustomTileLayer = L.TileLayer.extend({
|
|
535
534
|
options: {
|
|
@@ -633,12 +632,7 @@ class Leafletjs extends EventEmitter {
|
|
|
633
632
|
},
|
|
634
633
|
on: function(target, types, fn, context) {
|
|
635
634
|
if (types === "click") {
|
|
636
|
-
const customClickHandler = createClickHandler(
|
|
637
|
-
fn,
|
|
638
|
-
context,
|
|
639
|
-
target,
|
|
640
|
-
true
|
|
641
|
-
);
|
|
635
|
+
const customClickHandler = createClickHandler(fn, context, target, true);
|
|
642
636
|
wrappedHandlers.remember(types, fn, customClickHandler);
|
|
643
637
|
return target.on(types, customClickHandler, context);
|
|
644
638
|
}
|
|
@@ -726,10 +720,7 @@ class Leafletjs extends EventEmitter {
|
|
|
726
720
|
},
|
|
727
721
|
// 圆形转多边形坐标
|
|
728
722
|
getLatLngs: function(target) {
|
|
729
|
-
const points = circleToPolygonPoints(
|
|
730
|
-
target.getLatLng(),
|
|
731
|
-
target.getRadius() / 1e3
|
|
732
|
-
);
|
|
723
|
+
const points = circleToPolygonPoints(target.getLatLng(), target.getRadius() / 1e3);
|
|
733
724
|
return [latLngListCheckExport(points)];
|
|
734
725
|
}
|
|
735
726
|
};
|
|
@@ -811,12 +802,7 @@ class Leafletjs extends EventEmitter {
|
|
|
811
802
|
if (latLngList && latLngList.length !== 0) {
|
|
812
803
|
latLngList = latLngListCheck(latLngList);
|
|
813
804
|
}
|
|
814
|
-
const polyline = L.motion.polyline(
|
|
815
|
-
latLngList,
|
|
816
|
-
option,
|
|
817
|
-
motionOption,
|
|
818
|
-
markerOption
|
|
819
|
-
);
|
|
805
|
+
const polyline = L.motion.polyline(latLngList, option, motionOption, markerOption);
|
|
820
806
|
return createMapProxy(polyline, {
|
|
821
807
|
addTo: function(target, map) {
|
|
822
808
|
return target.addTo(generalMapMethods.getMap(map));
|
|
@@ -1037,20 +1023,14 @@ class Leafletjs extends EventEmitter {
|
|
|
1037
1023
|
function calcTotalDistance(index, preIndex) {
|
|
1038
1024
|
const current = rangingMarker[index].options.extData.latlng;
|
|
1039
1025
|
const previous = rangingMarker[preIndex].options.extData.latlng;
|
|
1040
|
-
const distance = parseFloat(
|
|
1041
|
-
|
|
1042
|
-
);
|
|
1043
|
-
const total = parseFloat(
|
|
1044
|
-
rangingMarker[preIndex].options.extData.distance || 0
|
|
1045
|
-
);
|
|
1026
|
+
const distance = parseFloat((map.distance(current, previous) / 1e3).toFixed(2));
|
|
1027
|
+
const total = parseFloat(rangingMarker[preIndex].options.extData.distance || 0);
|
|
1046
1028
|
return (distance + total).toFixed(2);
|
|
1047
1029
|
}
|
|
1048
1030
|
function setStartIcon(index) {
|
|
1049
1031
|
const markerItem = rangingMarker[index];
|
|
1050
1032
|
markerItem.setIcon({
|
|
1051
|
-
divIcon: _this.DivIcon(
|
|
1052
|
-
rangingStartIconOption(options, markerItem.options.extData.dicId)
|
|
1053
|
-
)
|
|
1033
|
+
divIcon: _this.DivIcon(rangingStartIconOption(options, markerItem.options.extData.dicId))
|
|
1054
1034
|
});
|
|
1055
1035
|
markerItem.options.extData.distance = 0;
|
|
1056
1036
|
}
|
|
@@ -1068,14 +1048,7 @@ class Leafletjs extends EventEmitter {
|
|
|
1068
1048
|
const markerItem = rangingMarker[index];
|
|
1069
1049
|
const isLast = showDeleteAll ?? !rangingMarker[index + 1]?.options?.extData?.distance;
|
|
1070
1050
|
markerItem.setIcon({
|
|
1071
|
-
divIcon: _this.DivIcon(
|
|
1072
|
-
rangingPointIconOption(
|
|
1073
|
-
options,
|
|
1074
|
-
distance,
|
|
1075
|
-
markerItem.options.extData.dicId,
|
|
1076
|
-
isLast
|
|
1077
|
-
)
|
|
1078
|
-
)
|
|
1051
|
+
divIcon: _this.DivIcon(rangingPointIconOption(options, distance, markerItem.options.extData.dicId, isLast))
|
|
1079
1052
|
});
|
|
1080
1053
|
markerItem.options.extData.distance = distance;
|
|
1081
1054
|
}
|
|
@@ -1103,10 +1076,7 @@ class Leafletjs extends EventEmitter {
|
|
|
1103
1076
|
rangingPointsIng.push({ lat, lng });
|
|
1104
1077
|
} else {
|
|
1105
1078
|
const latlngs = [
|
|
1106
|
-
[
|
|
1107
|
-
rangingPointsIng[rangingPointsIng.length - 1].lat,
|
|
1108
|
-
rangingPointsIng[rangingPointsIng.length - 1].lng
|
|
1109
|
-
],
|
|
1079
|
+
[rangingPointsIng[rangingPointsIng.length - 1].lat, rangingPointsIng[rangingPointsIng.length - 1].lng],
|
|
1110
1080
|
[lat, lng]
|
|
1111
1081
|
];
|
|
1112
1082
|
const polyline = _this.Polyline(latlngs, {
|
|
@@ -1124,13 +1094,9 @@ class Leafletjs extends EventEmitter {
|
|
|
1124
1094
|
{ lat: latlngs[1][0], lng: latlngs[1][1] }
|
|
1125
1095
|
);
|
|
1126
1096
|
distance = parseFloat((distance / 1e3).toFixed(2));
|
|
1127
|
-
const total = parseFloat(
|
|
1128
|
-
rangingMarker[rangingMarker.length - 1].options.extData.distance || 0
|
|
1129
|
-
);
|
|
1097
|
+
const total = parseFloat(rangingMarker[rangingMarker.length - 1].options.extData.distance || 0);
|
|
1130
1098
|
distance = (distance + total).toFixed(2);
|
|
1131
|
-
const customIcon = _this.DivIcon(
|
|
1132
|
-
rangingPointIconOption(options, distance, dicId)
|
|
1133
|
-
);
|
|
1099
|
+
const customIcon = _this.DivIcon(rangingPointIconOption(options, distance, dicId));
|
|
1134
1100
|
const markerItem = _this.Marker({
|
|
1135
1101
|
icon: customIcon,
|
|
1136
1102
|
position: { lat, lng },
|
|
@@ -1196,10 +1162,7 @@ class Leafletjs extends EventEmitter {
|
|
|
1196
1162
|
if (changeIndex - 1 === index) {
|
|
1197
1163
|
setStartIcon(changeIndex);
|
|
1198
1164
|
} else {
|
|
1199
|
-
setPointIcon(
|
|
1200
|
-
changeIndex,
|
|
1201
|
-
calcTotalDistance(changeIndex, changeIndex - 1)
|
|
1202
|
-
);
|
|
1165
|
+
setPointIcon(changeIndex, calcTotalDistance(changeIndex, changeIndex - 1));
|
|
1203
1166
|
}
|
|
1204
1167
|
changeIndex++;
|
|
1205
1168
|
}
|
|
@@ -1232,10 +1195,7 @@ class Leafletjs extends EventEmitter {
|
|
|
1232
1195
|
let changeIndex = index + 1;
|
|
1233
1196
|
while (rangingMarker[changeIndex]?.options?.extData?.distance) {
|
|
1234
1197
|
const disIndex = changeIndex - 1 === index ? changeIndex - 2 : changeIndex - 1;
|
|
1235
|
-
setPointIcon(
|
|
1236
|
-
changeIndex,
|
|
1237
|
-
calcTotalDistance(changeIndex, disIndex)
|
|
1238
|
-
);
|
|
1198
|
+
setPointIcon(changeIndex, calcTotalDistance(changeIndex, disIndex));
|
|
1239
1199
|
changeIndex++;
|
|
1240
1200
|
}
|
|
1241
1201
|
setTimeout(() => {
|
|
@@ -1246,11 +1206,7 @@ class Leafletjs extends EventEmitter {
|
|
|
1246
1206
|
const beforeDistance = rangingMarker[index - 1]?.options?.extData?.distance;
|
|
1247
1207
|
if (beforeDistance) {
|
|
1248
1208
|
removeLineBetween(rangEndIndex, index - 1, index);
|
|
1249
|
-
setPointIcon(
|
|
1250
|
-
index - 1,
|
|
1251
|
-
rangingMarker[index - 1].options.extData.distance,
|
|
1252
|
-
true
|
|
1253
|
-
);
|
|
1209
|
+
setPointIcon(index - 1, rangingMarker[index - 1].options.extData.distance, true);
|
|
1254
1210
|
setTimeout(() => {
|
|
1255
1211
|
rangingMarker[index].remove();
|
|
1256
1212
|
rangingMarker.splice(index, 1);
|
package/es/utils/map/index.mjs
CHANGED
|
@@ -18,15 +18,9 @@ const AMAP_PLUGINS = [
|
|
|
18
18
|
];
|
|
19
19
|
const staticAssets = {
|
|
20
20
|
"bigemap.js": new URL("../../static/map/bigemap.js", import.meta.url).href,
|
|
21
|
-
"markercluster.js": new URL(
|
|
22
|
-
"../../static/map/markercluster.js",
|
|
23
|
-
import.meta.url
|
|
24
|
-
).href,
|
|
21
|
+
"markercluster.js": new URL("../../static/map/markercluster.js", import.meta.url).href,
|
|
25
22
|
"bmDraw.js": new URL("../../static/map/bmDraw.js", import.meta.url).href,
|
|
26
|
-
"bm.geometryutil.js": new URL(
|
|
27
|
-
"../../static/map/bm.geometryutil.js",
|
|
28
|
-
import.meta.url
|
|
29
|
-
).href,
|
|
23
|
+
"bm.geometryutil.js": new URL("../../static/map/bm.geometryutil.js", import.meta.url).href,
|
|
30
24
|
"moveMarker.js": new URL("../../static/map/moveMarker.js", import.meta.url).href
|
|
31
25
|
};
|
|
32
26
|
const normalizeStaticBaseUrl = (baseUrl) => {
|
|
@@ -230,7 +224,7 @@ class InitMap extends EventEmitter {
|
|
|
230
224
|
/* === leafletjs === */
|
|
231
225
|
...option
|
|
232
226
|
};
|
|
233
|
-
return this.map
|
|
227
|
+
return this.map?.InitMap(domId, option);
|
|
234
228
|
}
|
|
235
229
|
// 自定义 h5 图标
|
|
236
230
|
DivIcon(option) {
|
|
@@ -32,9 +32,9 @@ function ToLon(x, y) {
|
|
|
32
32
|
return ret;
|
|
33
33
|
}
|
|
34
34
|
const Coordinate = {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
WGS84: 0,
|
|
36
|
+
GCJ02: 1,
|
|
37
|
+
BD09: 2
|
|
38
38
|
};
|
|
39
39
|
const reverseCoordinate = {
|
|
40
40
|
0: "WGS84",
|
|
@@ -42,17 +42,17 @@ const reverseCoordinate = {
|
|
|
42
42
|
2: "BD09"
|
|
43
43
|
};
|
|
44
44
|
const conversionCoordinateMap = {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
WGS84: {
|
|
46
|
+
GCJ02: WGS84ToGCJ02,
|
|
47
|
+
BD09: WGS84ToBD09
|
|
48
48
|
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
GCJ02: {
|
|
50
|
+
WGS84: GCJ02ToWGS84,
|
|
51
|
+
BD09: GCJ02ToBD09
|
|
52
52
|
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
BD09: {
|
|
54
|
+
GCJ02: BD09ToGCJ02,
|
|
55
|
+
WGS84: BD09ToWGS84
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
function getMapConfig() {
|
package/es/version.mjs
CHANGED
package/lib/api/device.js
CHANGED
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
require('../hooks/index.js');
|
|
4
4
|
var vue = require('vue');
|
|
5
|
-
var useLocale = require('../hooks/useLocale.js');
|
|
6
5
|
var useApi = require('../hooks/useApi.js');
|
|
6
|
+
var useLocale = require('../hooks/useLocale.js');
|
|
7
7
|
|
|
8
8
|
function detailApi(deviceId) {
|
|
9
9
|
return new Promise((resolve, reject) => {
|
|
10
|
-
const { t } = useLocale.useLocale();
|
|
11
10
|
const { api } = useApi.useApi();
|
|
12
11
|
const http = vue.unref(api);
|
|
13
12
|
http.post("device/detail", { deviceId }).then((res) => {
|
|
14
13
|
resolve(res);
|
|
15
14
|
}).catch((res) => {
|
|
16
|
-
reject(new Error(t("
|
|
15
|
+
reject(new Error(useLocale.$t("hy")));
|
|
17
16
|
});
|
|
18
17
|
});
|
|
19
18
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
require('../hooks/index.js');
|
|
5
|
+
var useApi = require('../hooks/useApi.js');
|
|
6
|
+
|
|
7
|
+
function exportDailyCheckReportApi(url) {
|
|
8
|
+
return new Promise((resolve, reject) => {
|
|
9
|
+
const { api } = useApi.useApi();
|
|
10
|
+
const http = vue.unref(api);
|
|
11
|
+
http.get(url, {
|
|
12
|
+
responseType: "blob"
|
|
13
|
+
}).then((res) => {
|
|
14
|
+
resolve(res);
|
|
15
|
+
}).catch((err) => {
|
|
16
|
+
reject(err);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function exportDailyCheckReportPostApi(url, params) {
|
|
21
|
+
return new Promise((resolve, reject) => {
|
|
22
|
+
const { api } = useApi.useApi();
|
|
23
|
+
const http = vue.unref(api);
|
|
24
|
+
http.post(url, params, {
|
|
25
|
+
responseType: "blob",
|
|
26
|
+
isJSON: true
|
|
27
|
+
}).then((res) => {
|
|
28
|
+
resolve(res);
|
|
29
|
+
}).catch((err) => {
|
|
30
|
+
reject(err);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function exportDailyCheckReportPostToFormApi(url, params) {
|
|
35
|
+
return new Promise((resolve, reject) => {
|
|
36
|
+
const { api } = useApi.useApi();
|
|
37
|
+
const http = vue.unref(api);
|
|
38
|
+
http.post(url, params, {
|
|
39
|
+
responseType: "blob"
|
|
40
|
+
}).then((res) => {
|
|
41
|
+
resolve(res);
|
|
42
|
+
}).catch((err) => {
|
|
43
|
+
reject(err);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function exportExcelFnApi(url) {
|
|
48
|
+
return new Promise((resolve, reject) => {
|
|
49
|
+
const { api } = useApi.useApi();
|
|
50
|
+
const http = vue.unref(api);
|
|
51
|
+
http.get(url).then((res) => {
|
|
52
|
+
resolve(res);
|
|
53
|
+
}).catch((err) => {
|
|
54
|
+
reject(err);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
exports.exportDailyCheckReportApi = exportDailyCheckReportApi;
|
|
60
|
+
exports.exportDailyCheckReportPostApi = exportDailyCheckReportPostApi;
|
|
61
|
+
exports.exportDailyCheckReportPostToFormApi = exportDailyCheckReportPostToFormApi;
|
|
62
|
+
exports.exportExcelFnApi = exportExcelFnApi;
|
package/lib/api/index.js
CHANGED
|
@@ -2,37 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
require('../hooks/index.js');
|
|
4
4
|
var vue = require('vue');
|
|
5
|
-
var useLocale = require('../hooks/useLocale.js');
|
|
6
5
|
var useApi = require('../hooks/useApi.js');
|
|
6
|
+
var useLocale = require('../hooks/useLocale.js');
|
|
7
7
|
|
|
8
|
-
const { t } = useLocale.useLocale();
|
|
9
8
|
function selectApi(controller, params) {
|
|
10
|
-
return new Promise((resolve,
|
|
9
|
+
return new Promise((resolve, reject2) => {
|
|
11
10
|
const { api } = useApi.useApi();
|
|
12
11
|
const http = vue.unref(api);
|
|
13
12
|
if (!params) {
|
|
14
|
-
return
|
|
13
|
+
return reject2(new Error(useLocale.$t("iDNotPassed")));
|
|
15
14
|
}
|
|
16
15
|
http.post(controller + "/select", {
|
|
17
16
|
id: params !== -1 ? params : null
|
|
18
17
|
}).then((res) => {
|
|
19
18
|
resolve(res);
|
|
20
19
|
}).catch((res) => {
|
|
21
|
-
|
|
20
|
+
reject2(new Error(useLocale.$t("interfaceError")));
|
|
22
21
|
});
|
|
23
22
|
});
|
|
24
23
|
}
|
|
25
24
|
function detailApi(controller, params) {
|
|
26
|
-
return new Promise((resolve,
|
|
25
|
+
return new Promise((resolve, reject2) => {
|
|
27
26
|
const { api } = useApi.useApi();
|
|
28
27
|
const http = vue.unref(api);
|
|
29
28
|
if (!params) {
|
|
30
|
-
return
|
|
29
|
+
return reject2(new Error(useLocale.$t("iDNotPassed")));
|
|
31
30
|
}
|
|
32
31
|
http.post(controller + "/detail", { id: params }).then((res) => {
|
|
33
32
|
resolve(res);
|
|
34
33
|
}).catch((res) => {
|
|
35
|
-
|
|
34
|
+
reject2(new Error(useLocale.$t("interfaceError")));
|
|
36
35
|
});
|
|
37
36
|
});
|
|
38
37
|
}
|
|
@@ -45,11 +44,13 @@ function insertFnApi(controller, params) {
|
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
46
|
const url = controller + "/insert";
|
|
48
|
-
return new Promise((resolve,
|
|
47
|
+
return new Promise((resolve, reject2) => {
|
|
49
48
|
const { api } = useApi.useApi();
|
|
50
49
|
const http = vue.unref(api);
|
|
51
50
|
http.post(url, params, { isJSON: true }).then((res) => {
|
|
52
51
|
return resolve(res);
|
|
52
|
+
}).catch((err) => {
|
|
53
|
+
reject2(err);
|
|
53
54
|
});
|
|
54
55
|
});
|
|
55
56
|
}
|
|
@@ -62,13 +63,13 @@ function saveFnApi(controller, params, options) {
|
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
const url = controller + "/save";
|
|
65
|
-
return new Promise((resolve,
|
|
66
|
+
return new Promise((resolve, reject2) => {
|
|
66
67
|
const { api } = useApi.useApi();
|
|
67
68
|
const http = vue.unref(api);
|
|
68
69
|
http.post(url, params, { isJSON: true, ...options }).then((res) => {
|
|
69
70
|
return resolve(res);
|
|
70
71
|
}).catch((res) => {
|
|
71
|
-
|
|
72
|
+
reject2(res);
|
|
72
73
|
});
|
|
73
74
|
});
|
|
74
75
|
}
|
|
@@ -86,41 +87,49 @@ function saveApi(controller, params) {
|
|
|
86
87
|
} else {
|
|
87
88
|
url = controller + "/insert";
|
|
88
89
|
}
|
|
89
|
-
return new Promise((resolve,
|
|
90
|
+
return new Promise((resolve, reject2) => {
|
|
90
91
|
const { api } = useApi.useApi();
|
|
91
92
|
const http = vue.unref(api);
|
|
92
93
|
http.post(url, params, { isJSON: true }).then((res) => {
|
|
93
94
|
return resolve(res);
|
|
95
|
+
}).catch((err) => {
|
|
96
|
+
reject2(err);
|
|
94
97
|
});
|
|
95
98
|
});
|
|
96
99
|
}
|
|
97
100
|
function findAllApi(controller, params) {
|
|
98
|
-
return new Promise((resolve,
|
|
101
|
+
return new Promise((resolve, reject2) => {
|
|
99
102
|
const { api } = useApi.useApi();
|
|
100
103
|
const http = vue.unref(api);
|
|
101
104
|
http.post(controller + "/findAll", params).then((res) => {
|
|
102
105
|
resolve(res);
|
|
106
|
+
}).catch((err) => {
|
|
107
|
+
reject2(err);
|
|
103
108
|
});
|
|
104
109
|
});
|
|
105
110
|
}
|
|
106
111
|
function pageApi(controller, params, isJsonData) {
|
|
107
|
-
return new Promise((resolve,
|
|
112
|
+
return new Promise((resolve, reject2) => {
|
|
108
113
|
const { api } = useApi.useApi();
|
|
109
114
|
const http = vue.unref(api);
|
|
110
115
|
http.post(controller + "/page", params, { isJSON: isJsonData }).then((res) => {
|
|
111
116
|
resolve(res);
|
|
117
|
+
}).catch((err) => {
|
|
118
|
+
reject2(err);
|
|
112
119
|
});
|
|
113
120
|
});
|
|
114
121
|
}
|
|
115
122
|
function deleteBatchApi(controller, ids) {
|
|
116
|
-
return new Promise((resolve,
|
|
123
|
+
return new Promise((resolve, reject2) => {
|
|
117
124
|
const { api } = useApi.useApi();
|
|
118
125
|
const http = vue.unref(api);
|
|
119
126
|
if (!ids) {
|
|
120
|
-
return
|
|
127
|
+
return reject2(new Error(useLocale.$t("iDNotPassed")));
|
|
121
128
|
}
|
|
122
129
|
http.post(controller + "/deleteBatch", { ids }).then((res) => {
|
|
123
130
|
resolve(res);
|
|
131
|
+
}).catch((err) => {
|
|
132
|
+
reject2(err);
|
|
124
133
|
});
|
|
125
134
|
});
|
|
126
135
|
}
|
|
@@ -133,6 +142,8 @@ function displayChangeApi(controller, ids, display) {
|
|
|
133
142
|
display
|
|
134
143
|
}).then(() => {
|
|
135
144
|
resolve();
|
|
145
|
+
}).catch((err) => {
|
|
146
|
+
reject(err);
|
|
136
147
|
});
|
|
137
148
|
});
|
|
138
149
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
require('../hooks/index.js');
|
|
5
|
+
var useApi = require('../hooks/useApi.js');
|
|
6
|
+
var useLocale = require('../hooks/useLocale.js');
|
|
7
|
+
|
|
8
|
+
function findAllMapRailLocationApi(params) {
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
|
+
const { api } = useApi.useApi();
|
|
11
|
+
const http = vue.unref(api);
|
|
12
|
+
http.post("mapRail/location/findAll", params, { isJSON: true }).then((res) => {
|
|
13
|
+
resolve(res);
|
|
14
|
+
}).catch((res) => {
|
|
15
|
+
reject(new Error(useLocale.$t("interfaceError")));
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function batchMapRailUserSaveApi(params) {
|
|
20
|
+
return new Promise((resolve, reject) => {
|
|
21
|
+
const { api } = useApi.useApi();
|
|
22
|
+
const http = vue.unref(api);
|
|
23
|
+
http.post("mapRail/mapRailUser/saveBatch", params, {
|
|
24
|
+
isJSON: true
|
|
25
|
+
}).then((res) => {
|
|
26
|
+
resolve(res);
|
|
27
|
+
}).catch((res) => {
|
|
28
|
+
resolve(res);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
exports.batchMapRailUserSaveApi = batchMapRailUserSaveApi;
|
|
34
|
+
exports.findAllMapRailLocationApi = findAllMapRailLocationApi;
|
package/lib/api/organization.js
CHANGED
|
@@ -1,47 +1,56 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
require('../hooks/index.js');
|
|
4
3
|
var vue = require('vue');
|
|
5
|
-
|
|
4
|
+
require('../hooks/index.js');
|
|
6
5
|
var useApi = require('../hooks/useApi.js');
|
|
6
|
+
var useLocale = require('../hooks/useLocale.js');
|
|
7
7
|
|
|
8
8
|
function orgListWithDev3Api(params) {
|
|
9
9
|
return new Promise((resolve, reject) => {
|
|
10
|
-
const { t } = useLocale.useLocale();
|
|
11
10
|
const { api } = useApi.useApi();
|
|
12
11
|
const http = vue.unref(api);
|
|
13
12
|
http.post("organization/orgTree", params).then((res) => {
|
|
14
13
|
resolve(res.data);
|
|
15
14
|
}).catch((res) => {
|
|
16
|
-
reject(new Error(t("interfaceError")));
|
|
15
|
+
reject(new Error(useLocale.$t("interfaceError")));
|
|
17
16
|
});
|
|
18
17
|
});
|
|
19
18
|
}
|
|
20
19
|
function orgTreeWithGroupAndDeviceApi(params) {
|
|
21
20
|
return new Promise((resolve, reject) => {
|
|
22
|
-
const { t } = useLocale.useLocale();
|
|
23
21
|
const { api } = useApi.useApi();
|
|
24
22
|
const http = vue.unref(api);
|
|
25
23
|
http.post("organization/orgTreeWithGroupAndDevice", params).then((res) => {
|
|
26
24
|
return resolve(res.data);
|
|
27
25
|
}).catch((res) => {
|
|
28
|
-
reject(new Error(t("interfaceError")));
|
|
26
|
+
reject(new Error(useLocale.$t("interfaceError")));
|
|
29
27
|
});
|
|
30
28
|
});
|
|
31
29
|
}
|
|
32
30
|
function orgTreeWithPlanGroupAndDeviceApi(params) {
|
|
33
31
|
return new Promise((resolve, reject) => {
|
|
34
|
-
const { t } = useLocale.useLocale();
|
|
35
32
|
const { api } = useApi.useApi();
|
|
36
33
|
const http = vue.unref(api);
|
|
37
34
|
http.post("organization/orgTreeWithPlanGroupAndDevice", params).then((res) => {
|
|
38
35
|
return resolve(res.data);
|
|
39
36
|
}).catch((res) => {
|
|
40
|
-
reject(new Error(t("interfaceError")));
|
|
37
|
+
reject(new Error(useLocale.$t("interfaceError")));
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function orgTreeApi(params, options = {}) {
|
|
42
|
+
return new Promise((resolve, reject) => {
|
|
43
|
+
const { api } = useApi.useApi();
|
|
44
|
+
const http = vue.unref(api);
|
|
45
|
+
http.post("/organization/orgTree", params, { ...options }).then((res) => {
|
|
46
|
+
resolve(res);
|
|
47
|
+
}).catch((err) => {
|
|
48
|
+
reject(err);
|
|
41
49
|
});
|
|
42
50
|
});
|
|
43
51
|
}
|
|
44
52
|
|
|
45
53
|
exports.orgListWithDev3Api = orgListWithDev3Api;
|
|
54
|
+
exports.orgTreeApi = orgTreeApi;
|
|
46
55
|
exports.orgTreeWithGroupAndDeviceApi = orgTreeWithGroupAndDeviceApi;
|
|
47
56
|
exports.orgTreeWithPlanGroupAndDeviceApi = orgTreeWithPlanGroupAndDeviceApi;
|