Junjie
2026-04-16 413b42a497ed1b695ceb0acada0122e553021ddb
src/main/webapp/components/MapCanvas.js
@@ -33,6 +33,7 @@
          </div>
          <div :style="mapToolRowStyle()">
            <button type="button" @click="openStationColorConfigPage" :style="mapToolButtonStyle(false)">站点颜色</button>
            <button v-if="fakeOperationVisible" type="button" @click="openFakeOperationConfigPage" :style="mapToolButtonStyle(false)">仿真操作</button>
          </div>
          <div v-if="levList && levList.length > 1" :style="mapToolFloorSectionStyle()">
            <div :style="mapToolSectionLabelStyle()">楼层</div>
@@ -153,7 +154,8 @@
        'machine-pakout': 0x97b400,
        'site-run-block': 0xe69138,
        'site-error': 0xDB2828
      }
      },
      fakeOperationVisible: false
    }
  },
    mounted() {
@@ -162,6 +164,7 @@
    this.startContainerResizeObserve();
    this.loadMapTransformConfig();
    this.loadStationColorConfig();
    this.loadFakeProcessStatus();
    this.loadLocList();
    this.connectWs();
@@ -2616,6 +2619,40 @@
      }
      window.open(url, '_blank');
    },
    loadFakeProcessStatus() {
      if (typeof window === 'undefined' || typeof $ === 'undefined' || typeof baseUrl === 'undefined') {
        this.fakeOperationVisible = false;
        return;
      }
      $.ajax({
        url: baseUrl + '/openapi/getFakeSystemRunStatus',
        method: 'get',
        success: function (res) {
          const data = res && res.data ? res.data : null;
          this.fakeOperationVisible = !!(data && data.isFake);
        }.bind(this),
        error: function () {
          this.fakeOperationVisible = false;
        }.bind(this)
      });
    },
    openFakeOperationConfigPage() {
      if (typeof window === 'undefined' || !this.fakeOperationVisible) { return; }
      const url = (typeof baseUrl !== 'undefined' ? baseUrl : '') + '/views/watch/fakeOperationConfig.html';
      const layerInstance = (window.top && window.top.layer) || window.layer;
      if (layerInstance && typeof layerInstance.open === 'function') {
        layerInstance.open({
          type: 2,
          title: '仿真操作',
          maxmin: true,
          area: ['1180px', '820px'],
          shadeClose: false,
          content: url
        });
        return;
      }
      window.open(url, '_blank');
    },
    parseRotation(value) {
      const num = parseInt(value, 10);
      if (!isFinite(num)) { return 0; }