Browse Source

🚀 完成地图接口

master
wangxiang 3 years ago
parent
commit
cb32597da2
  1. 2
      .env.development
  2. 4
      src/api/platform/common/entity/mapLogistic.ts
  3. 1
      src/api/platform/common/entity/mapTask.ts
  4. 1
      src/api/platform/common/entity/mapTaskPreset.ts
  5. 31
      src/components/AMap/src/AMapDesigner/index.vue
  6. 48
      src/components/AMap/src/amap.data.tsx
  7. 2
      src/components/AMap/src/components/MapTaskModal.vue
  8. 1
      src/components/AMap/src/components/MapTaskPresetModal.vue
  9. 13
      src/views/common/mapLogistic/mapLogistic.data.ts

2
.env.development

@ -4,7 +4,7 @@ VITE_PUBLIC_PATH = /
# 本地开发代理,可以解决跨域及多地址代理 # 本地开发代理,可以解决跨域及多地址代理
# 如果接口地址匹配到,则会转发到http://localhost:3000,防止本地出现跨域问题 # 如果接口地址匹配到,则会转发到http://localhost:3000,防止本地出现跨域问题
# 可以有多个,注意多个不能换行,否则代理将会失效 # 可以有多个,注意多个不能换行,否则代理将会失效
VITE_PROXY = [["/api","http://localhost:9999"],["/upload","http://localhost:9999/system_proxy/system/file/upload"]] VITE_PROXY = [["/api","http://192.168.3.10:9999"],["/upload","http://192.168.3.10:9999/system_proxy/system/file/upload"]]
# 是否删除console.log # 是否删除console.log
VITE_DROP_CONSOLE = false VITE_DROP_CONSOLE = false

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

@ -25,10 +25,6 @@ export interface MapLogistic extends Partial<CommonEntity> {
sendOrderTaskType: string; sendOrderTaskType: string;
sendOrderLng: Nullable<number>; sendOrderLng: Nullable<number>;
sendOrderLat: Nullable<number>; sendOrderLat: Nullable<number>;
fileId: string | string[];
estimateTime: string;
requireTime: string;
batchCode?: string;
version?: number; version?: number;
mapTask: MapTask[]; mapTask: MapTask[];
mapLogisticPoint: MapLogisticPoint[]; mapLogisticPoint: MapLogisticPoint[];

1
src/api/platform/common/entity/mapTask.ts

@ -27,6 +27,7 @@ export interface MapTask extends Partial<CommonEntity> {
orgLat?: number; orgLat?: number;
courierUserId?: string; courierUserId?: string;
fileId: string | string[]; fileId: string | string[];
receiptFileId: string | string[];
estimateTime?: string; estimateTime?: string;
requireTime?: string; requireTime?: string;
batchCode?: string; batchCode?: string;

1
src/api/platform/common/entity/mapTaskPreset.ts

@ -26,6 +26,7 @@ export interface MapTaskPreset extends Partial<CommonEntity> {
courierUserId: string; courierUserId: string;
key?: string; key?: string;
fileId: string | string[]; fileId: string | string[];
receiptFileId: string | string[];
estimateTime?: string; estimateTime?: string;
requireTime?: string; requireTime?: string;
batchCode?: string; batchCode?: string;

31
src/components/AMap/src/AMapDesigner/index.vue

@ -54,18 +54,6 @@
@select="handleCourierUserData" @select="handleCourierUserData"
/> />
</AFormItem> </AFormItem>
<AFormItem label="文件" name="fileId">
<BasicUpload v-model:value="mapState.mapData.fileId"
:maxSize="20"
:maxNumber="10"
:showPreviewNumber="false"
:emptyHidePreview="true"
:showUploadSaveBtn="true"
:api="commonUpload"
:accept="['image/*']"
multiple
/>
</AFormItem>
</AForm> </AForm>
</div> </div>
<div class="operatePanel-list"> <div class="operatePanel-list">
@ -475,6 +463,13 @@
}; };
eventSource.onmessage = function (ev) { eventSource.onmessage = function (ev) {
try {
let { data } = ev;
let mapLogistic = JSON.parse(data);
let courierUser = mapState.courierUserList.find(item => item.value == mapLogistic?.courierUserId);
courierUser && (courierUser.mapLat = mapLogistic.courierLat);
courierUser && (courierUser.mapLng = mapLogistic.courierLng);
} catch (e) {}
console.info(ev); console.info(ev);
}; };
@ -538,6 +533,7 @@
orgId: '', orgId: '',
orgName: t('component.aMapDesigner.taskPositionTip'), orgName: t('component.aMapDesigner.taskPositionTip'),
sort: 1, sort: 1,
receiptFileId: [],
fileId: [], fileId: [],
key: buildUUID() key: buildUUID()
}); });
@ -555,6 +551,7 @@
Object.assign(mapTask, { Object.assign(mapTask, {
orgId: '', orgId: '',
orgName: t('component.aMapDesigner.taskPositionTip'), orgName: t('component.aMapDesigner.taskPositionTip'),
receiptFileId: [],
fileId: [] fileId: []
}); });
// //
@ -717,12 +714,13 @@
nextTick(() => { nextTick(() => {
mapState.mapData = cloneDeep(merge(defaultMapData(), options)); mapState.mapData = cloneDeep(merge(defaultMapData(), options));
// //
isString(mapState.mapData.fileId) && (mapState.mapData.fileId ? (mapState.mapData.fileId = mapState.mapData.fileId.split(',')) : []);
mapState.mapData.mapTask.forEach(item => { mapState.mapData.mapTask.forEach(item => {
isString(item.fileId) && (item.fileId ? (item.fileId = item.fileId.split(',')) : []); isString(item.fileId) && (item.fileId ? (item.fileId = item.fileId.split(',')) : []);
isString(item.receiptFileId) && (item.receiptFileId ? (item.receiptFileId = item.receiptFileId.split(',')) : []);
if (~~item.taskType == 1) { if (~~item.taskType == 1) {
item?.mapTaskPreset?.forEach(childItem => { item?.mapTaskPreset?.forEach(childItem => {
isString(childItem.fileId) && (childItem.fileId ? (childItem.fileId = childItem.fileId.split(',')) : []); isString(childItem.fileId) && (childItem.fileId ? (childItem.fileId = childItem.fileId.split(',')) : []);
isString(item.receiptFileId) && (item.receiptFileId ? (item.receiptFileId = item.receiptFileId.split(',')) : []);
}); });
} }
}); });
@ -735,7 +733,6 @@
async function getMapDataJson() { async function getMapDataJson() {
await formElRef.value.validate(); await formElRef.value.validate();
const mapData = toRaw(mapState.mapData); const mapData = toRaw(mapState.mapData);
isArray(mapData.fileId) && (mapData.fileId = mapData.fileId.join(','));
mapData.mapTask.forEach(item => { mapData.mapTask.forEach(item => {
const hospital = item.hospitalId && mapState.hospitalList.find(e => e.value == item.hospitalId), const hospital = item.hospitalId && mapState.hospitalList.find(e => e.value == item.hospitalId),
org = item.orgId && mapState.orgList.find(e => e.value == item.orgId); org = item.orgId && mapState.orgList.find(e => e.value == item.orgId);
@ -751,8 +748,12 @@
orgLat: org.mapLat orgLat: org.mapLat
}); });
isArray(item.fileId) && (item.fileId = item.fileId.join(',')); isArray(item.fileId) && (item.fileId = item.fileId.join(','));
isArray(item.receiptFileId) && (item.receiptFileId = item.receiptFileId.join(','));
if (~~item.taskType == 1) { if (~~item.taskType == 1) {
item?.mapTaskPreset?.forEach(childItem => isArray(childItem.fileId) && (childItem.fileId = childItem.fileId.join(','))); item?.mapTaskPreset?.forEach(childItem => {
isArray(childItem.fileId) && (childItem.fileId = childItem.fileId.join(','));
isArray(item.receiptFileId) && (item.receiptFileId = item.receiptFileId.join(','));
});
} }
}); });
return Promise.resolve(cloneDeep(mapState.mapData)); return Promise.resolve(cloneDeep(mapState.mapData));

48
src/components/AMap/src/amap.data.tsx

@ -69,6 +69,22 @@ export const taskOrdinaryColumns: BasicColumn[] = [
editRow: true, editRow: true,
editComponent: 'Select', editComponent: 'Select',
}, },
{
title: '上传单据文件',
dataIndex: 'receiptFileId',
editRow: true,
editComponent: 'Upload',
editComponentProps: {
multiple: true,
maxSize: 20,
maxNumber: 10,
showUploadSaveBtn: true,
showPreviewNumber: false,
emptyHidePreview: true,
api: commonUpload,
accept: ['image/*']
}
},
{ {
title: '上传文件', title: '上传文件',
dataIndex: 'fileId', dataIndex: 'fileId',
@ -117,6 +133,22 @@ export const taskPresetColumns: BasicColumn[] = [
title: '目的地预设点', title: '目的地预设点',
dataIndex: 'orgName', dataIndex: 'orgName',
}, },
{
title: '上传单据文件',
dataIndex: 'receiptFileId',
editRow: true,
editComponent: 'Upload',
editComponentProps: {
multiple: true,
maxSize: 20,
maxNumber: 10,
showUploadSaveBtn: true,
showPreviewNumber: false,
emptyHidePreview: true,
api: commonUpload,
accept: ['image/*']
}
},
{ {
title: '上传文件', title: '上传文件',
dataIndex: 'fileId', dataIndex: 'fileId',
@ -169,6 +201,22 @@ export const taskPresetChildColumns: BasicColumn[] = [
title: '目的地预设点', title: '目的地预设点',
dataIndex: 'destinationPresetName' dataIndex: 'destinationPresetName'
}, },
{
title: '上传单据文件',
dataIndex: 'receiptFileId',
editRow: true,
editComponent: 'Upload',
editComponentProps: {
multiple: true,
maxSize: 20,
maxNumber: 10,
showUploadSaveBtn: true,
showPreviewNumber: false,
emptyHidePreview: true,
api: commonUpload,
accept: ['image/*']
}
},
{ {
title: '上传文件', title: '上传文件',
dataIndex: 'fileId', dataIndex: 'fileId',

2
src/components/AMap/src/components/MapTaskModal.vue

@ -232,6 +232,7 @@
orgId: '', orgId: '',
orgName: t('component.aMapDesigner.taskPositionTip'), orgName: t('component.aMapDesigner.taskPositionTip'),
fileId: [], fileId: [],
receiptFileId: [],
key: buildUUID() key: buildUUID()
} as MapTask); } as MapTask);
} }
@ -256,6 +257,7 @@
orgId: '', orgId: '',
orgName: t('component.aMapDesigner.taskPositionTip'), orgName: t('component.aMapDesigner.taskPositionTip'),
fileId: [], fileId: [],
receiptFileId: [],
key: buildUUID() key: buildUUID()
} as MapTask); } as MapTask);
} }

1
src/components/AMap/src/components/MapTaskPresetModal.vue

@ -167,6 +167,7 @@
orginPresetName: t('component.aMapDesigner.taskPositionTip'), orginPresetName: t('component.aMapDesigner.taskPositionTip'),
destinationPresetName: t('component.aMapDesigner.taskPositionTip'), destinationPresetName: t('component.aMapDesigner.taskPositionTip'),
fileId: [], fileId: [],
receiptFileId: [],
key: buildUUID() key: buildUUID()
} as MapTaskPreset); } as MapTaskPreset);
} }

13
src/views/common/mapLogistic/mapLogistic.data.ts

@ -31,10 +31,6 @@ export const columns: BasicColumn[] = [
title: '发单起点纬度值', title: '发单起点纬度值',
dataIndex: 'sendOrderLat', dataIndex: 'sendOrderLat',
}, },
{
title: '报告单批次码',
dataIndex: 'batchCode',
},
]; ];
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
@ -46,14 +42,5 @@ export const searchFormSchema: FormSchema[] = [
placeholder: '请输入地图名称', placeholder: '请输入地图名称',
}, },
colProps: { span: 8 }, colProps: { span: 8 },
},
{
field: 'batchCode',
label: '报告单批次码',
component: 'Input',
componentProps: {
placeholder: '请输入报告单批次码',
},
colProps: { span: 8 }
} }
]; ];

Loading…
Cancel
Save