| | |
| | | <template> |
| | | <view class="pages-scene"> |
| | | <view class="map-content" v-if="opSceneType =='' "> |
| | | <image v-if="opType != 'extend'" class="img" src="/images/image 25.png" alt=" 图片" mode="aspectFit" /> |
| | | <image v-if="opType != 'extend'" class="img" src="/images/image_25.png" alt=" 图片" mode="aspectFit" /> |
| | | <image v-else class="img" :src="extendBase64Img" alt=" 图片" mode="aspectFit" /> |
| | | <view v-if="opType != 'extend'" class="space">没有找到符合条件的地图</view> |
| | | <!-- <view class="loading-view">{{mapserverIsOk?"构图程序准备就绪":"等待构图程序就绪..."}} |
| | |
| | | <view class="tip">请输入场景名称</view> |
| | | <view class="name-input"> |
| | | <input ref="refInputName" :focus="true" placeholder="请输入场景名称" :value="sceneName" |
| | | @input="onInputName"></input> |
| | | @input="onInputName" /> |
| | | <uni-icons class="clear" color="#ccc" type="clear" size="20" v-if="showClearName" |
| | | @click="clickClearName"></uni-icons> |
| | | </view> |
| | |
| | | </view> |
| | | </view> |
| | | <view class="bottom-content" v-else-if="opSceneType =='finish'"> |
| | | <view class="tip">场景构建完成</view> |
| | | <view>已成功构建“{{sceneName}}”</view> |
| | | <!-- <view class="loading-view">{{saveMapIsOk?"构图保存完成":"等待构图保存完成..."}} |
| | | <view class="tip"> “{{sceneName}}”{{opType == "extend"?"场景扩展完成"+"":"场景构建完成"}}</view> |
| | | <!-- <view> 已成功构建“{{sceneName}}”</view> --> |
| | | <view class="loading-view">{{saveMapIsOk?"构图保存完成":"等待构图保存完成..."}} |
| | | <view v-if="!saveMapIsOk" class="auto-circle"></view> |
| | | </view> !saveMapIsOk ||--> |
| | | </view> |
| | | <view class="text-button-group"> |
| | | <a-button type="primary" class="button" :disabled=" loading" @click="clickFinish">构建完成</a-button> |
| | | <a-button type="primary" class="button" :disabled=" !saveMapIsOk || loading" @click="clickFinish">{{opType == "extend"?"扩展完成":"构建完成"}}</a-button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | |
| | | }, |
| | | onLoad(option) { |
| | | console.log("scene load") |
| | | const _this = this |
| | | this.ip = option.ip || "" |
| | | uni.getSystemInfo({ |
| | |
| | | |
| | | }, |
| | | onUnload() { |
| | | |
| | | console.log("scene unload") |
| | | }, |
| | | onBackPress() { |
| | | |
| | |
| | | } |
| | | |
| | | } else if (param.method == "cancel_positioning_agv") { |
| | | this.positioningAgv = false |
| | | //this.positioningAgv = false |
| | | } else if (param.method == "show_log") { |
| | | const listLog = session.getValue("request_log") || [] |
| | | listLog.unshift(param.data) |
| | |
| | | await stopMap(this.ip, this.sceneName) |
| | | // await startOrStopMapServer(this.ip, 2) |
| | | // this.checkSaveMapState(); |
| | | if (this.opType == "extend") { |
| | | this.opSceneType = "" |
| | | const eventChannel = this.getOpenerEventChannel(); |
| | | eventChannel.emit('create_finish', this.sceneName); |
| | | uni.navigateBack({ |
| | | delta: 1, //返回层数,2则上上页 |
| | | }) |
| | | } |
| | | |
| | | // if (this.opType == "extend") { |
| | | // this.opSceneType = "" |
| | | // const eventChannel = this.getOpenerEventChannel(); |
| | | // eventChannel.emit('create_finish', this.sceneName); |
| | | // uni.navigateBack({ |
| | | // delta: 1, //返回层数,2则上上页 |
| | | // }) |
| | | // } |
| | | setTimeout(() => {this.saveMapIsOk = true}, 5000); |
| | | |
| | | } catch (ex) { |
| | | console.log(ex) |
| | | showModal("请检查车辆连接,并重新开始构建场景", "场景构建失败", false, "确定").then((res) => { |
| | |
| | | const info = await getMapLaserData(this.ip, this.mapId) |
| | | return info |
| | | } catch (ex) { |
| | | showError(ex) |
| | | showToast(ex) |
| | | return {} |
| | | } |
| | | }, |
| | |
| | | if (this.opSceneType === "scan") { |
| | | |
| | | const data = await this.loadMapLaserData() |
| | | |
| | | |
| | | const listCtrData = [] |
| | | let newMap = false |
| | | if (data.base_map?.image_base64) { |
| | | this.robotPos = {} |
| | | newMap = true |
| | | const mapData = data.base_map.image_base64 //this.mapId ?"terdy": |
| | | const mapData = data.base_map.image_base64 //this.mapId ?"terdy": |
| | | this.mapId = data.base_map.map_id |
| | | |
| | | |
| | | listCtrData.push({ |
| | | method: "background", |
| | | param: { |