Browse Source

开发集成地图前后端接口

master
wangxiang 3 years ago
parent
commit
16b8acf239
  1. 25
      src/api/platform/common/controller/mapLogistic.ts
  2. 31
      src/api/platform/common/entity/mapLogistic.ts
  3. 2
      src/api/platform/core/entity/user.ts
  4. 22
      src/components/AMap/src/Amap.vue
  5. 29
      src/views/common/hospital/hospital.data.ts
  6. 2
      src/views/common/mapLogistic/MapLogisticModal.vue
  7. 20
      src/views/common/mapLogistic/index.vue
  8. 2
      src/views/common/mapLogistic/mapLogistic.data.ts
  9. 32
      src/views/common/org/org.data.ts
  10. 15
      src/views/system/user/user.data.ts

25
src/api/platform/common/controller/mapLogistic.ts

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
/**
* api模板规范代码参考,
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> 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<MapLogisticParams>) => defHttp.get({ url: Api.list, params });
export const addMapLogistic = (params: Partial<MapLogistic>) => defHttp.post({ url: Api.add, data: params });
export const editMapLogistic = (params: Partial<MapLogistic>) => defHttp.put({ url: Api.edit, data: params });
export const getMapLogistic = (id: string) => defHttp.get<MapLogistic>({ url: `${Api.get}/${id}` });
export const delMapLogistic = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` });

31
src/api/platform/common/entity/mapLogistic.ts

@ -0,0 +1,31 @@ @@ -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<MapLogistic[]>;

2
src/api/platform/core/entity/user.ts

@ -59,6 +59,8 @@ export interface User extends CommonEntity { @@ -59,6 +59,8 @@ export interface User extends CommonEntity {
loginIp: string;
// 最后登陆时间
loginTime: string;
// 地图标记点位置图片旋转值
mapOrientation: number;
// 用户状态
status: string;
// 备注信息

22
src/components/AMap/src/Amap.vue

@ -20,11 +20,7 @@ @@ -20,11 +20,7 @@
>
<AFormItem label="发单点">
<ASelect v-model:value="mapState.modelRef.smallHospitalId"
:options="[
{ value: '001', label: '下级医院:湘雅医院'},
{ value: '002', label: '下级医院:神经病医院'},
{ value: '003', label: '下级医院:第三医院'}
]"
:options="mapState.hospitalList"
@select="handleTakeSpecimenSearch"
/>
</AFormItem>
@ -57,6 +53,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 @@ @@ -81,7 +78,8 @@
smallHospitalId: '',
takeSpecimenId: ''
},
takeSpecimenList: []
takeSpecimenList: [],
hospitalList: []
});
const AForm = Form;
const AFormItem = Form.Item;
@ -122,6 +120,18 @@ @@ -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',

29
src/views/common/hospital/hospital.data.ts

@ -148,6 +148,35 @@ export const formSchema: FormSchema[] = [ @@ -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: '联系人名称',

2
src/views/common/amapTask/AmapTaskModal.vue → src/views/common/mapLogistic/MapLogisticModal.vue

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
<template>
<BasicModal v-bind="$attrs"
width="720px"
defaultFullscreen
@ok="handleSubmit"
@register="registerModal"
>

20
src/views/common/amapTask/index.vue → src/views/common/mapLogistic/index.vue

@ -2,21 +2,21 @@ @@ -2,21 +2,21 @@
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary"
@click=""
>预览</a-button>
<a-button type="primary"
@click="handleAdd()"
>新增地图线路</a-button>
>新增</a-button>
</template>
<template #action="{ record }">
<TableAction :actions="[
{
label: '设计',
icon: 'fa6-regular:pen-to-square',
onClick: handleEdit.bind(null, record)
},
{
label: '删除',
icon: 'ant-design:delete-outlined',
color: 'error',
onClick: handleDel.bind(null, record)
}]"
/>
@ -36,22 +36,22 @@ @@ -36,22 +36,22 @@
*/
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useModal } from '/@/components/Modal';
import { columns, searchFormSchema } from './amapTask.data';
import { columns, searchFormSchema } from './mapLogistic.data';
import { useMessage } from '/@/hooks/web/useMessage';
import AmapTaskModal from './AmapTaskModal.vue';
import AmapTaskModal from './MapLogisticModal.vue';
import { listMapLogistic, delMapLogistic } from '/@/api/platform/common/controller/mapLogistic'
const { createConfirm, createMessage } = useMessage();
const [registerModal, { openModal }] = useModal();
const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({
title: '地图任务列表',
//api: ,
api: listMapLogistic,
rowKey: 'id',
columns,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter: true,
fieldMapToTime: [['dateRange', ['beginTime', 'endTime'], 'YYYY-MM-DD']]
autoSubmitOnEnter: true
},
useSearchForm: true,
showTableSetting: true,
@ -85,7 +85,7 @@ @@ -85,7 +85,7 @@
title: '警告',
content: `是否确认删除机构编号为${id}机构吗?`,
onOk: async () => {
await delMapLogistic(id);
createMessage.success('删除成功!');
handleRefreshTable();
}

2
src/views/common/amapTask/amapTask.data.ts → src/views/common/mapLogistic/mapLogistic.data.ts

@ -10,7 +10,6 @@ export const columns: BasicColumn[] = [ @@ -10,7 +10,6 @@ export const columns: BasicColumn[] = [
{
title: '收样员名称',
dataIndex: 'courierUserName',
width: 120,
},
{
title: '收样员起点经度值',
@ -23,7 +22,6 @@ export const columns: BasicColumn[] = [ @@ -23,7 +22,6 @@ export const columns: BasicColumn[] = [
{
title: '发单下级医院名称',
dataIndex: 'sendOrderName',
width: 120
},
{
title: '发单起点经度值',

32
src/views/common/org/org.data.ts

@ -147,6 +147,35 @@ export const formSchema: FormSchema[] = [ @@ -147,6 +147,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: '联系人名称',
@ -184,7 +213,8 @@ export const formSchema: FormSchema[] = [ @@ -184,7 +213,8 @@ export const formSchema: FormSchema[] = [
initFetchParams: {
parentId: '0'
}
}
},
required: true
},
{
field: 'detailAddress',

15
src/views/system/user/user.data.ts

@ -267,6 +267,21 @@ export const userFormSchema: FormSchema[] = [ @@ -267,6 +267,21 @@ export const userFormSchema: FormSchema[] = [
span: 12
}
},
{
field: 'mapOrientation',
label: '图片旋转值',
component: 'InputNumber',
defaultValue: 0,
componentProps: {
style: { width:'100%' },
min: 0
},
colProps: {
span: 12
},
ifShow: ({ values }) => values.userType === '1',
required: true,
},
{
label: '备注',
field: 'remarks',

Loading…
Cancel
Save