| | |
| | | </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> |
| | |
| | | 'machine-pakout': 0x97b400, |
| | | 'site-run-block': 0xe69138, |
| | | 'site-error': 0xDB2828 |
| | | } |
| | | }, |
| | | fakeOperationVisible: false |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | this.startContainerResizeObserve(); |
| | | this.loadMapTransformConfig(); |
| | | this.loadStationColorConfig(); |
| | | this.loadFakeProcessStatus(); |
| | | this.loadLocList(); |
| | | this.connectWs(); |
| | | |
| | |
| | | } |
| | | 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; } |