From 9340e27419e4132f0bd84c57a9881f09c84da45d Mon Sep 17 00:00:00 2001 From: wangxiang <1827945911@qq.com> Date: Wed, 1 Jun 2022 12:15:28 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=81=20=E4=BF=AE=E5=A4=8D=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E5=8A=A0=E8=BD=BD=E9=A1=B5=E9=9D=A2=E5=8D=A1=E6=AD=BB?= =?UTF-8?q?=E6=83=85=E5=86=B5,=E8=BF=9B=E4=B8=8D=E5=8E=BB=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kicc-ui/src/components/AMap/src/Amap.vue | 42 ++++++++++++++---------- kicc-ui/src/router/guard/index.ts | 34 ++++++++++--------- kicc-ui/tsconfig.json | 4 +-- 3 files changed, 46 insertions(+), 34 deletions(-) diff --git a/kicc-ui/src/components/AMap/src/Amap.vue b/kicc-ui/src/components/AMap/src/Amap.vue index 020eaa6e..f796bca5 100644 --- a/kicc-ui/src/components/AMap/src/Amap.vue +++ b/kicc-ui/src/components/AMap/src/Amap.vue @@ -295,20 +295,6 @@ panel: instance.refs.mapPanel }); - // 扫描收样员园形范围 - scanTakeSpecimenCircleRange = new AMap.Circle({ - radius: 2000, - borderWeight: 3, - strokeColor: '#3600ff', - strokeOpacity: 0.2, - strokeWeight: 6, - fillOpacity: 0.4, - strokeStyle: 'dashed', - strokeDasharray: [8, 8], - fillColor: '#1791fc', - zIndex: 50 - }); - // 根据起终点经纬度规划驾车导航路线 driving.search(new AMap.LngLat(112.913864, 28.295114), new AMap.LngLat(112.918119, 28.282891), { waypoints:[new AMap.LngLat(112.919165, 28.289924)] @@ -366,15 +352,37 @@ if (smallHospitalMap) { // 绘制20公里,园形矢量图,并且检测这个范围内是否有收样员 map.remove(scanTakeSpecimenCircleRange); + // 扫描收样员园形范围 + scanTakeSpecimenCircleRange = new AMap.Circle({ + radius: 8000, + borderWeight: 3, + strokeColor: '#3600ff', + strokeOpacity: 0.2, + strokeWeight: 6, + fillOpacity: 0.4, + strokeStyle: 'dashed', + strokeDasharray: [8, 8], + fillColor: '#1791fc', + zIndex: 50 + }); + scanTakeSpecimenCircleRange.setCenter([smallHospitalMap.lng, smallHospitalMap.lat]); map.add(scanTakeSpecimenCircleRange); map.setFitView([ scanTakeSpecimenCircleRange ]); // 查找园圈内的收样员 - const specimenLngLat = new AMap.LngLat(116.403984,39.907535); + const gatherCircleRangeSpecimen = []; + for (let i = 0; i < smallHospitalMapList.length; ++i) { + const smallHospitalMap = smallHospitalMapList[i]; + const specimenLngLat = new AMap.LngLat(smallHospitalMap.lng, smallHospitalMap.lat); + if (scanTakeSpecimenCircleRange.contains(specimenLngLat)) { + console.log('查找到'); + } else { + console.log('没有查找到'); + } + } + - if (scanTakeSpecimenCircleRange.contains()) { - } } else { throw '查找不到发单点数据,请检查发单点!'; diff --git a/kicc-ui/src/router/guard/index.ts b/kicc-ui/src/router/guard/index.ts index 38445763..93f660d6 100644 --- a/kicc-ui/src/router/guard/index.ts +++ b/kicc-ui/src/router/guard/index.ts @@ -18,7 +18,7 @@ import { createPermissionGuard } from './permissionGuard'; import { createStateGuard } from './stateGuard'; import nProgress from 'nprogress'; import projectSetting from '/@/settings/projectSetting'; -import { User } from '/@/api/platform/core/entity/user'; +import type { User } from '/@/api/platform/core/entity/user'; import { synchronousAuthenticationUser } from '/@/api/platform/system/controller/user'; import { isEmpty } from '/@/utils/is'; @@ -123,20 +123,24 @@ export function createSynchronousAuthenticationUserGuard(router: Router) { const token = userStore.getAccessToken; const userInfo = userStore.getUserInfo; if (token && !isEmpty(userInfo)) { - const kiccUser = await synchronousAuthenticationUser(); - // 同步当前身份验证用户到用户信息中 - Object.assign(userInfo, { - id: kiccUser.id, - phone: kiccUser.phone, - userName: kiccUser.username, - tenantId: kiccUser.tenantId, - tenantIds: String(kiccUser.tenantId).split(','), - enabled: kiccUser.enabled, - accountNonLocked: kiccUser.accountNonLocked, - accountNonExpired: kiccUser.accountNonExpired, - credentialsNonExpired: kiccUser.credentialsNonExpired - } as User); - userStore.setUserInfo(userInfo); + try { + const kiccUser = await synchronousAuthenticationUser(); + // 同步当前身份验证用户到用户信息中 + Object.assign(userInfo, { + id: kiccUser.id, + phone: kiccUser.phone, + userName: kiccUser.username, + tenantId: kiccUser.tenantId, + tenantIds: String(kiccUser.tenantId).split(','), + enabled: kiccUser.enabled, + accountNonLocked: kiccUser.accountNonLocked, + accountNonExpired: kiccUser.accountNonExpired, + credentialsNonExpired: kiccUser.credentialsNonExpired + } as Partial); + userStore.setUserInfo(userInfo); + } catch { + console.log('同步授权用户信息失败,请检查token是否过期!'); + } } return true; }); diff --git a/kicc-ui/tsconfig.json b/kicc-ui/tsconfig.json index 041136f3..a15deb13 100644 --- a/kicc-ui/tsconfig.json +++ b/kicc-ui/tsconfig.json @@ -27,8 +27,8 @@ "noImplicitThis" : false, "noImplicitAny": false, "skipLibCheck": true, - "types": ["vite/client"], - "typeRoots": ["./node_modules/@types/", "./types", "./node_modules/@amap/amap-jsapi-loader/src"], + "types": ["vite/client", "@amap/amap-jsapi-loader/src/global"], + "typeRoots": ["./node_modules/@types/", "./types"], "removeComments": true, "paths": { "/@/*": ["src/*"],