From 1d888836aa0889d378702cfd5acd476693dfc13a Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Thu, 17 Aug 2023 11:23:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/map/MapContainer.vue | 19 ++++-- src/views/task_template/edit.vue | 24 ++++++- src/views/task_template/map.vue | 102 ++++++++++++++++++++++++++++ 3 files changed, 136 insertions(+), 9 deletions(-) create mode 100644 src/views/task_template/map.vue 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