cyy
2025-09-28 fb026e6052b4d843d327312db398cf791ac57ab9
pages/map/scene.vue
@@ -1,7 +1,7 @@
<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?"构图程序准备就绪":"等待构图程序就绪..."}}
@@ -29,7 +29,7 @@
            <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>
@@ -51,13 +51,13 @@
            </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>
@@ -124,6 +124,7 @@
      },
      onLoad(option) {
         console.log("scene load")
         const _this = this
         this.ip = option.ip || ""
         uni.getSystemInfo({
@@ -139,7 +140,7 @@
      },
      onUnload() {
         console.log("scene unload")
      },
      onBackPress() {
@@ -360,7 +361,7 @@
               }
            } 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)
@@ -474,15 +475,16 @@
               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) => {
@@ -522,7 +524,7 @@
               const info = await getMapLaserData(this.ip, this.mapId)
               return info
            } catch (ex) {
               showError(ex)
               showToast(ex)
               return {}
            }
         },
@@ -531,15 +533,15 @@
               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: {