This commit is contained in:
weipengfei 2023-08-18 12:10:37 +08:00
parent b21d4266d1
commit 6f4cbcc24a
4 changed files with 27 additions and 22 deletions

View File

@ -48,7 +48,7 @@ const initMap = async () => {
map.value.on("click", (e: any) => {
// console.log("", e.lnglat);
if (m_index >= 3) return;
if (m_index >= 1) return;
//
getDistrictName(e.lnglat.lng, e.lnglat.lat, e);
@ -76,18 +76,18 @@ const initMap = async () => {
m_index++;
//
// marker.on("click", (event: any) => {
// console.log("", event);
// markerList = markerList.filter((item: any) => {
// item[0] == marker._position.pos[0] &&
// item[0] == marker._position.pos[0];
// });
// emits("changeMaps", markerList);
// //
// map.value.remove(marker);
// m_index--;
// marker = null;
// });
marker.on("click", (event: any) => {
console.log("删除", event);
markerList = markerList.filter((item: any) => {
item[0] == marker._position.pos[0] &&
item[0] == marker._position.pos[0];
});
emits("changeMaps", markerList);
//
map.value.remove(marker);
m_index--;
marker = null;
});
});
};

View File

@ -54,10 +54,10 @@
placeholder="没有任务描述"
/>
</el-form-item>
<el-form-item v-if="mode == 'show'" label="">
<!-- <el-form-item v-if="mode == 'show'" label="">
<el-button type="primary" @click="clickUpdate"> 修改 </el-button>
<el-button type="danger" @click="clickDelete"> 删除 </el-button>
</el-form-item>
</el-form-item> -->
</el-form>
</popup>
<el-dialog v-model="isShow" title="选择任务模板" width="60%">

View File

@ -1,7 +1,7 @@
<template>
<div>
<el-card class="!border-none" v-loading="loading" shadow="never">
<div style="display: flex; justify-content: space-between">
<!-- <div style="display: flex; justify-content: space-between">
<el-button
v-perms="['task.taskCalendar/add']"
type="primary"
@ -12,11 +12,7 @@
</template>
新增
</el-button>
<!-- <div class="btn">
<div :class="{ active: nowType == 0 }" @click="nowType = 0">日历</div>
<div :class="{ active: nowType == 1 }" @click="nowType = 1">列表</div>
</div> -->
</div>
</div> -->
<calendar
:list="taskList"
@clickItem="clickTask"

View File

@ -22,6 +22,14 @@
<el-form-item label-width="80px" label="地图">
<MapContainer ref="mapRef" @changeMaps="changeMaps"></MapContainer>
</el-form-item>
<el-form-item label-width="80px" label="已选地点">
<el-input
style="width: 350px; margin-right: 16px"
placeholder="请点击上方地图选择地点"
readonly
:value="address[0]?.address"
/>
</el-form-item>
<!-- <el-form-item label-width="80px" label="起点">
<el-input
style="width: 350px; margin-right: 16px"
@ -115,7 +123,7 @@ const changeMaps = (e: any) => {
//
const handleSubmit = async () => {
if (address.value.length < 3) return ElMessage.error("请先选择三个地点");
// if (address.value.length < 3) return ElMessage.error("");
popupRef.value?.close();
emit("success", address.value);
};
@ -124,6 +132,7 @@ const handleSubmit = async () => {
const open = (type = "地点") => {
title.value = "选择" + type;
popupRef.value?.open();
resetMap();
};
//