|
|
|
@ -69,8 +69,20 @@
@@ -69,8 +69,20 @@
|
|
|
|
|
</template> |
|
|
|
|
<script lang="ts" setup> |
|
|
|
|
import AMapLoader from '@amap/amap-jsapi-loader'; |
|
|
|
|
import { reactive, watchEffect, getCurrentInstance, onBeforeMount, onUnmounted, ref, PropType, watch, toRefs, nextTick } from 'vue'; |
|
|
|
|
import { operatePanelColumns, MapData, MapPointType } from '../amap.data'; |
|
|
|
|
import { |
|
|
|
|
reactive, |
|
|
|
|
watchEffect, |
|
|
|
|
getCurrentInstance, |
|
|
|
|
onBeforeMount, |
|
|
|
|
onUnmounted, |
|
|
|
|
ref, |
|
|
|
|
PropType, |
|
|
|
|
watch, |
|
|
|
|
toRefs, |
|
|
|
|
nextTick, |
|
|
|
|
toRaw |
|
|
|
|
} from 'vue'; |
|
|
|
|
import { operatePanelColumns, MapPointType } from '../amap.data'; |
|
|
|
|
import hospital from '/@/assets/images/hospital.svg'; |
|
|
|
|
import medicalKit from '/@/assets/images/medical-kit.svg'; |
|
|
|
|
import hospitalTwinkle from '/@/assets/images/hospital-twinkle.gif'; |
|
|
|
@ -93,6 +105,8 @@
@@ -93,6 +105,8 @@
|
|
|
|
|
import { listMapTaskPreset } from '/@/api/platform/common/controller/mapTaskPreset'; |
|
|
|
|
import { defaultMapData } from '/@/enums/amapEnum'; |
|
|
|
|
import Toolbar from '../components/Toolbar.vue'; |
|
|
|
|
import { saveOrUpdateMapLogistic } from '/@/api/platform/common/controller/mapLogistic'; |
|
|
|
|
import { MapLogistic } from '/@/api/platform/common/entity/mapLogistic'; |
|
|
|
|
|
|
|
|
|
/** 类型规范统一声明定义区域 */ |
|
|
|
|
interface MapState { |
|
|
|
@ -107,13 +121,13 @@
@@ -107,13 +121,13 @@
|
|
|
|
|
amapKey: string; |
|
|
|
|
options: Recordable; |
|
|
|
|
}; |
|
|
|
|
mapData: MapData; |
|
|
|
|
mapData: MapLogistic; |
|
|
|
|
rulesRef: Recordable; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const mapProps = defineProps({ |
|
|
|
|
options: { |
|
|
|
|
type: [Object, String] as PropType<MapData | string>, |
|
|
|
|
type: [Object, String] as PropType<MapLogistic | string>, |
|
|
|
|
default: () => ({}) |
|
|
|
|
}, |
|
|
|
|
sidebarControl: propTypes.bool.def(true), |
|
|
|
@ -138,6 +152,7 @@
@@ -138,6 +152,7 @@
|
|
|
|
|
let scanCourierUserCircleRange; |
|
|
|
|
let driving; |
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['success']); |
|
|
|
|
const userStore = useUserStore(); |
|
|
|
|
const instance = getCurrentInstance(); |
|
|
|
|
const { createMessage } = useMessage(); |
|
|
|
@ -614,6 +629,7 @@
@@ -614,6 +629,7 @@
|
|
|
|
|
lat: hospital.mapLat, |
|
|
|
|
sort: undefined, |
|
|
|
|
type: '0', |
|
|
|
|
key: item.key, |
|
|
|
|
hospitalId: hospital.value, |
|
|
|
|
hospitalName: hospital.label |
|
|
|
|
}); |
|
|
|
@ -622,6 +638,7 @@
@@ -622,6 +638,7 @@
|
|
|
|
|
lat: org.mapLat, |
|
|
|
|
sort: undefined, |
|
|
|
|
type: '1', |
|
|
|
|
key: item.key, |
|
|
|
|
hospitalId: org.value, |
|
|
|
|
hospitalName: org.label |
|
|
|
|
}); |
|
|
|
@ -634,6 +651,7 @@
@@ -634,6 +651,7 @@
|
|
|
|
|
lat: item.orginPresetLat, |
|
|
|
|
sort: undefined, |
|
|
|
|
type: '0', |
|
|
|
|
key: item.key, |
|
|
|
|
hospitalId: item.orginPresetId, |
|
|
|
|
hospitalName: item.orginPresetName |
|
|
|
|
}); |
|
|
|
@ -642,6 +660,7 @@
@@ -642,6 +660,7 @@
|
|
|
|
|
lat: item.destinationPresetLat, |
|
|
|
|
sort: undefined, |
|
|
|
|
type: '0', |
|
|
|
|
key: item.key, |
|
|
|
|
hospitalId: item.destinationPresetId, |
|
|
|
|
hospitalName: item.destinationPresetName |
|
|
|
|
}); |
|
|
|
@ -661,8 +680,20 @@
@@ -661,8 +680,20 @@
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** 处理地图保存并发布 */ |
|
|
|
|
function handleMapSave() { |
|
|
|
|
|
|
|
|
|
async function handleMapSave() { |
|
|
|
|
await formElRef.value.validate(); |
|
|
|
|
const mapData = toRaw(mapState.mapData); |
|
|
|
|
mapData.fileId = (mapData.fileId as [] || []).join(','); |
|
|
|
|
mapData.mapTask.forEach(item => { |
|
|
|
|
item.fileId = (item.fileId as [] || []).join(','); |
|
|
|
|
if (~~item.taskType == 1) { |
|
|
|
|
item?.mapTaskPreset?.forEach(childItem => { |
|
|
|
|
childItem.fileId = (childItem.fileId as [] || [])?.join(','); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
await saveOrUpdateMapLogistic(toRaw(mapState.mapData)); |
|
|
|
|
emit('success'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** 处理地图重置 */ |
|
|
|
@ -676,11 +707,11 @@
@@ -676,11 +707,11 @@
|
|
|
|
|
formElRef.value?.clearValidate(); |
|
|
|
|
// 清除地图数据 |
|
|
|
|
mapState.mapData.courierUserName = ''; |
|
|
|
|
mapState.mapData.courierLng = undefined; |
|
|
|
|
mapState.mapData.courierLat = undefined; |
|
|
|
|
mapState.mapData.courierLng = null; |
|
|
|
|
mapState.mapData.courierLat = null; |
|
|
|
|
mapState.mapData.sendOrderName = ''; |
|
|
|
|
mapState.mapData.sendOrderLng = undefined; |
|
|
|
|
mapState.mapData.sendOrderLat = undefined; |
|
|
|
|
mapState.mapData.sendOrderLng = null; |
|
|
|
|
mapState.mapData.sendOrderLat = null; |
|
|
|
|
mapState.mapData.mapTask = []; |
|
|
|
|
mapState.mapData.mapLogisticPoint = []; |
|
|
|
|
setTableData([]); |
|
|
|
|