diff --git a/src/components/map/MapContainer.vue b/src/components/map/MapContainer.vue index e4bb920..6bc2796 100644 --- a/src/components/map/MapContainer.vue +++ b/src/components/map/MapContainer.vue @@ -1,5 +1,5 @@ @@ -33,7 +38,7 @@ const initMap = () => { #container { padding: 0px; margin: 0px; - width: 100%; - height: 800px; + width: 400px; + height: 400px; } \ No newline at end of file diff --git a/src/views/task_template/edit.vue b/src/views/task_template/edit.vue index 8baa249..a2bc945 100644 --- a/src/views/task_template/edit.vue +++ b/src/views/task_template/edit.vue @@ -119,6 +119,12 @@ /> + @@ -134,6 +140,7 @@ import { import { timeFormat } from "@/utils/util"; import type { PropType } from "vue"; import { dictDataLists } from "@/api/setting/dict"; +import taskMap from "./map.vue"; defineProps({ dictData: { type: Object as PropType>, @@ -222,9 +229,22 @@ const getDetail = async (row: Record) => { setFormData(data); }; +// 地图控件 +const mapShow = ref(false); +const mapRef = shallowRef>(); + // 选择任务类型 -const changeTaskType = (e: any) => { - console.log(e); +const changeTaskType = async (e: any) => { + if (e == 32) { + mapShow.value = true; //为三轮车时 + await nextTick(); + console.log(mapRef.value); + mapRef.value?.open(); + } +}; + +const setMap = (e: any) => { + console.log("选择了地图", e); }; // 提交按钮 diff --git a/src/views/task_template/map.vue b/src/views/task_template/map.vue new file mode 100644 index 0000000..0868197 --- /dev/null +++ b/src/views/task_template/map.vue @@ -0,0 +1,102 @@ + + + + \ No newline at end of file