diff --git a/src/api/platform/common/controller/mapLogistic.ts b/src/api/platform/common/controller/mapLogistic.ts new file mode 100644 index 0000000..50960d1 --- /dev/null +++ b/src/api/platform/common/controller/mapLogistic.ts @@ -0,0 +1,25 @@ +/** + * 提供api模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致 + * Copyright © 2020-2022 entfrm All rights reserved. + * author entfrm开发团队-王翔 + */ +import type { MapLogisticParams, MapLogistic, MapLogisticResult } from '../entity/mapLogistic'; +import { defHttp } from '/@/utils/http/axios'; + +enum Api { + list = '/common_proxy/common/mapLogistic/list', + get = '/common_proxy/common/mapLogistic', + add = '/common_proxy/common/mapLogistic/save', + edit = '/common_proxy/common/mapLogistic/update', + del = '/common_proxy/common/mapLogistic/remove' +} + +export const listMapLogistic = (params?: Partial) => defHttp.get({ url: Api.list, params }); + +export const addMapLogistic = (params: Partial) => defHttp.post({ url: Api.add, data: params }); + +export const editMapLogistic = (params: Partial) => defHttp.put({ url: Api.edit, data: params }); + +export const getMapLogistic = (id: string) => defHttp.get({ url: `${Api.get}/${id}` }); + +export const delMapLogistic = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` }); diff --git a/src/api/platform/common/entity/mapLogistic.ts b/src/api/platform/common/entity/mapLogistic.ts new file mode 100644 index 0000000..3862464 --- /dev/null +++ b/src/api/platform/common/entity/mapLogistic.ts @@ -0,0 +1,31 @@ + +/** + * @program: kicc-ui + * @description: 地图任务主表实体类 + * @author: entfrm开发团队-王翔 + * @since: 2022/8/24 + */ + +import type { R } from '/#/axios'; +import type { CommonEntity, Page } from '/@/api/common/data/entity'; + +export type MapLogisticParams = Page & MapLogistic; + +export interface MapLogistic extends CommonEntity { + id: string; + name: string; + courierUserId: string; + courierUserName: string; + courierLng: number; + courierLat: number; + sendOrderId: string; + sendOrderName: string; + sendOrderLng: number; + sendOrderLat: number; + fileId: string; + estimateTime: string; + requireTime: string; + batchCode: string; +} + +export type MapLogisticResult = R; diff --git a/src/api/platform/core/entity/user.ts b/src/api/platform/core/entity/user.ts index 144d892..cea885a 100644 --- a/src/api/platform/core/entity/user.ts +++ b/src/api/platform/core/entity/user.ts @@ -59,6 +59,8 @@ export interface User extends CommonEntity { loginIp: string; // 最后登陆时间 loginTime: string; + // 地图标记点位置图片旋转值 + mapOrientation: number; // 用户状态 status: string; // 备注信息 diff --git a/src/components/AMap/src/Amap.vue b/src/components/AMap/src/Amap.vue index c0bc6ff..6645a47 100644 --- a/src/components/AMap/src/Amap.vue +++ b/src/components/AMap/src/Amap.vue @@ -20,11 +20,7 @@ > @@ -57,6 +53,7 @@ import { useModal } from '/@/components/Modal'; import TaskModal from './TaskModal.vue'; import { propTypes } from '/@/utils/propTypes'; + import { listHospital } from '/@/api/platform/common/controller/hospital'; const mapProps = defineProps({ sidebarControl: propTypes.bool.def(true) @@ -81,7 +78,8 @@ smallHospitalId: '', takeSpecimenId: '' }, - takeSpecimenList: [] + takeSpecimenList: [], + hospitalList: [] }); const AForm = Form; const AFormItem = Form.Item; @@ -122,6 +120,18 @@ } }; mapState.loading = true; + // 初始化地图数据 + listHospital({ size: 40 }).then(res => { + mapState.hospitalList = (res.data || []).map(item => ({ + value: item.id, + label: item.name, + mapLat: item.mapLat, + mapLng: item.mapLng, + mapNotify: item.mapNotify, + mapOrientation: item.mapOrientation + })); + }) + AMapLoader.load({ key: mapConfig.amapKey, version: '2.0', diff --git a/src/views/common/hospital/hospital.data.ts b/src/views/common/hospital/hospital.data.ts index 6e20b33..2b070d4 100644 --- a/src/views/common/hospital/hospital.data.ts +++ b/src/views/common/hospital/hospital.data.ts @@ -148,6 +148,35 @@ export const formSchema: FormSchema[] = [ }, required: true, }, + { + field: 'mapOrientation', + label: '图片旋转值', + component: 'InputNumber', + componentProps: { + style: { width:'100%' }, + min: 0 + } + }, + { + field: 'mapLng', + label: '位置经度值', + component: 'InputNumber', + componentProps: { + style: { width:'100%' }, + min: 0 + }, + required: true + }, + { + field: 'mapLat', + label: '位置纬度值', + component: 'InputNumber', + componentProps: { + style: { width:'100%' }, + min: 0 + }, + required: true + }, { field: 'contactName', label: '联系人名称', diff --git a/src/views/common/amapTask/AmapTaskModal.vue b/src/views/common/mapLogistic/MapLogisticModal.vue similarity index 98% rename from src/views/common/amapTask/AmapTaskModal.vue rename to src/views/common/mapLogistic/MapLogisticModal.vue index a4eadbc..c2fc1ff 100644 --- a/src/views/common/amapTask/AmapTaskModal.vue +++ b/src/views/common/mapLogistic/MapLogisticModal.vue @@ -1,6 +1,6 @@