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