修改editMap 返回 emit
This commit is contained in:
parent
8b9dc456a0
commit
446b359632
@ -673,7 +673,7 @@ const mapBackgroundRef = ref()
|
||||
const inputBoxRef = ref() //文字输入框
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const emit = defineEmits(['backMapInfo'])
|
||||
// 缩放停止
|
||||
const interfaceRefreshed = ref(true)
|
||||
const resizeEnd = (locationX, locationY, w, h, item, index) => {
|
||||
@ -2327,12 +2327,13 @@ const removeEventListener = () => {
|
||||
const router = useRouter()
|
||||
onBeforeRouteLeave((to, from) => {
|
||||
if (to.path == '/mapPage/realTimeMap' && to.query.mapId != imgBgObj.positionMapId) {
|
||||
router.replace({
|
||||
name: 'MapPageRealTimeMap',
|
||||
query: {
|
||||
mapId: imgBgObj.positionMapId
|
||||
}
|
||||
})
|
||||
// router.replace({
|
||||
// name: 'MapPageRealTimeMap',
|
||||
// query: {
|
||||
// mapId: imgBgObj.positionMapId
|
||||
// }
|
||||
// })
|
||||
emit('backMapInfo', imgBgObj.positionMapId)
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 新建任务的弹窗 -->
|
||||
<createTaskDialog v-if="mapValue.length" ref="createTaskDialogRef" :positionMapId="mapValue[1]" />
|
||||
<createTaskDialog v-if="mapValue.length" ref="createTaskDialogRef" @backMapInfo="backMapInfo" :positionMapId="mapValue[1]" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@ -33,7 +33,7 @@ import { ref, defineComponent, reactive, nextTick, onMounted } from 'vue'
|
||||
import * as MapApi from '@/api/map/map'
|
||||
import download from '@/utils/download'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
|
||||
const mapId = ref(null)
|
||||
const message = useMessage() // 消息弹窗
|
||||
const route = useRoute()
|
||||
const { push } = useRouter()
|
||||
@ -87,7 +87,9 @@ const findChildrenByValues = (tree, values) => {
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
const backMapInfo = (id) => {
|
||||
mapId.value = id
|
||||
}
|
||||
//获取地图区域
|
||||
const getList = async () => {
|
||||
let data = await MapApi.getPositionMapGetMap()
|
||||
@ -113,11 +115,14 @@ const getList = async () => {
|
||||
|
||||
list.value = mapList
|
||||
|
||||
if (query.mapId) {
|
||||
let item = findDataById(data, Number(query.mapId))
|
||||
// if (query.mapId) {
|
||||
// let item = findDataById(data, Number(query.mapId))
|
||||
// mapValue.value = [String(item.floor), Number(item.id)]
|
||||
// }
|
||||
if (mapId.value) {
|
||||
let item = findDataById(data, Number(mapId.value))
|
||||
mapValue.value = [String(item.floor), Number(item.id)]
|
||||
}
|
||||
|
||||
if (mapValue.value.length) {
|
||||
handleChangeMap(mapValue.value)
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user