Commit f8640455 authored by maoying's avatar maoying

修改站端信息页面离线地图相关代码

parent 3f07de29
......@@ -7,11 +7,8 @@
Amos.config = {
// 普通http
httpURI: {
baseURI: 'http://172.16.10.66:10005/',
pluginURI: 'http://172.16.10.66:10005/',
fileServerURI: 'http://39.98.246.31:8888/' //图片服务器地址
//设计器数据绑定
// dataBindUrl: 'http://172.16.10.91:8083/api/visual/common/dataBind'
baseURI: '/baseURI/',//接口服务地址
fileServerURI: '/fileServerURI/' //图片服务器地址
},
// websocket 地址
wsURI: {
......@@ -38,8 +35,6 @@
isAutoOpenBussiness: true,
//是否全景监控显示ue4
is3dUe4: false,
//内外部地图加载,outMap是true 使用离线地图, false使用在线地图
outMap: true,
convertor: {
// 设置3d页面统计配置
mapLevelconfig: {
......@@ -111,12 +106,16 @@
}
},
//地图中心点
mapCenter: [108.90771484, 35.93184115],
//内外部地图加载,outMap是true 使用离线地图, false使用在线地图
outMap: true,
//地图中心点 112.794877,27.645578 韶山
mapCenter: [102.140137,36.357685],
//地图zoom显示级别
// showZoom: [7, 13, 18],
//离线地图地址
picURI: 'http://172.16.3.121:8001/shanxi/amap',
showZoom: 4,
//地图zoom显示范围
showZooms: [4, 12],
//离线地图地址可填写IP(如:http://172.16.3.120:8001/shaoshan/)地址或前缀,若配置前缀需要在nginx进行ip代理转发http://172.16.3.120:8001/shaoshan/
picURI: '/mapURI/',//
//获取Echarts字体然后,不配置默认为黑色
theme: {
......@@ -140,12 +139,12 @@
window.LogConfig = LogConfig;
window.innerConfig = innerConfig;
window.demo = true;
window.CheckDefaultTheme = 'transparent'; // 'blue'
window.CheckDefaultTheme = 'transparent'; // 'transparent' 蓝色
// 采用本地模式启动插件
window.useNative = true;
window.appKey = 'CONVERTER_STATION';
window.product = 'CONVERTER_STATION_WEB';
window.appKey = 'studio_normalapp_3056965';
window.product = 'STUDIO_APP_WEB';
window.dutyType = 'normal'; //normal/bank
// 是否采用hash路由
window.useHashHistory = false;
window.useHashHistory = true;
})();
......@@ -4,7 +4,7 @@ const completePrefix = endConf.completePrefix;
// const baseURI = endConf.baseURI;
const AmosConfig = endConf.AmosConfig;
const securityBaseWsURI = AmosConfig.httpURI.pluginURI;
const securityBaseWsURI = AmosConfig.httpURI.baseURI;
// 三维视图
//const view3dURI = AmosConfig.httpURI.view3dURI;
const view3dURI = AmosConfig.httpURI.view3dURI;
......
......@@ -21,7 +21,7 @@
background: #f9f9f9;
.amos-layout-sider-children {
height: 96.3%;
height: 96%;
.risk-degree-rpn-histogram {
height: 100%;
......
......@@ -11,6 +11,7 @@ import {
queryAllUserAction,
addStationMaintenAction,
loadStationMaintenAction } from '../../../services/stationMaintenService';
import BasicMap from './indexMap';
const eventConnect = Connect.eventConnect;
......@@ -21,7 +22,7 @@ const RadioGroup = Radio.Group;
const timeout2000 = 2000;
const timeOut3000 = 3000;
const AmosConfig = endConf.AmosConfig;
const outMap = AmosConfig.sysConf.outMap;
const outMap = AmosConfig.outMap;
@eventConnect
class StationMainten extends Component {
......@@ -42,7 +43,6 @@ class StationMainten extends Component {
this.state = {
status: 1,
loadAmap: false,
BasicMap: null,
isClick: true,
isCanEidt: false,
canEdit: true,
......@@ -184,30 +184,24 @@ class StationMainten extends Component {
script = {
key: 'amapscripts',
url: `/extra/amap/js/outamap.1.4.6.js`
url: `./extra/amap/js/outamap.1.4.6.js`
};
mainUI = {
key: 'mainUI',
//url: '//10.56.28.228/webapi.amap.com/ui/1.0/main.js'
url: '/extra/amap/js/outmain.1.4.6.js'
url: './extra/amap/js/outmain.1.4.6.js'
};
loadScripts.asyncLoadScript(script, () => {
loadScripts.asyncLoadScript(mainUI, () => {
setTimeout(() => {
this.setState({
loadAmap: true,
BasicMap: require('./indexMap')
loadAmap: true
});
}, timeout2000);
});
});
} else {
_this.setState({
loadAmap: true,
BasicMap: require('./indexMap')
});
}
}
}
// 预留经纬度
......@@ -375,7 +369,8 @@ class StationMainten extends Component {
}
render() {
const { form, rules, useTypeData, provinceData, cityData, countyData, allUserList, BasicMap,isCanEidt,canEdit,canlSHow } = this.state;
const { form, rules, useTypeData, provinceData, cityData, countyData, allUserList, isCanEidt,canEdit,canlSHow } = this.state;
// 112.794877,27.645578
const lalng = {
longitude: form.longitude,
latitude: form.latitude
......@@ -584,7 +579,6 @@ class StationMainten extends Component {
</Col>
<Col className="stationMainten-body-right" span={12}>
<div style={{ height: '614px' }}>
{ /**this.state.loadAmap && <BasicMap indexViewChange={this.indexViewChange} pushMarkerPoint={this.handleMarkerMap} /> */}
{ this.state.loadAmap && <BasicMap indexViewChange={this.indexViewChange} pushMarkerPoint={this.handleMarkerMap} lalng={lalng} isCanEidt={isCanEidt} /> }
</div>
</Col>
......@@ -593,7 +587,6 @@ class StationMainten extends Component {
);
}
}
StationMainten.propTypes = {
};
......
......@@ -5,34 +5,24 @@ import * as endConf from 'amos-processor/lib/config/endconf';
// import TwoDimensionalMap from './../monitor/2d/index';
const AmosConfig = endConf.AmosConfig;
const outMap = AmosConfig.sysConf.outMap;
const outMap = AmosConfig.outMap;
const _showZooms = AmosConfig.showZooms;
const _showZoom = AmosConfig.showZoom;
const _mapCenter = AmosConfig.mapCenter;
const _picURI = AmosConfig.picURI;
const mapConfig = {
zoom: 4,
zoom: _showZoom,
resizeEnable: true,
zoomEnable: true,
// plugins: ['Scale', 'MapType', 'OverView', 'ControlBar'],
plugins: ['Scale'],
zooms: [4, 12],
plugins: ['Scale'],//['Scale', 'MapType', 'OverView', 'ControlBar'],
zooms: _showZooms,
expandZoomRange: true,
doubleClickZoom: false,
showIndoorMap: false, //隐藏地图自带的室内地图图层
features: ['bg', 'road', 'point'] //隐藏默认楼块
};
const layers = [
new window.AMap.TileLayer({
getTileUrl(x, y, z) {
return `${_picURI}/${z}/${x}/${y}.png`;
},
zIndex: 0
})
];
/**
* @class IndexMap
* @extends {Component}
......@@ -48,9 +38,7 @@ class IndexMap extends Component {
super(props);
this.state = {
mapCenter: _mapCenter,
center: { longitude: 101.90771484, latitude: 35.92184115 },
marker: this.props.lalng || { longitude: 0, latitude: 0 },
// marker: { longitude: null, latitude: null },
visible: true,
style: { strokeColor: '#10A100', fillColor: '#10A100' },
city: 'xian',
......@@ -58,6 +46,22 @@ class IndexMap extends Component {
};
}
componentWillMount() {
// 刷新数据
if (outMap) {
mapConfig.layers = this.mapLayers(_picURI);
}
}
mapLayers = mapServerUrl => {
return [
new window.AMap.TileLayer({
getTileUrl(x, y, z) {
return `${mapServerUrl}/${z}/${x}/${y}.png`;
},
zIndex: 3
})
];
};
/**
* 加载全局地图
*/
......@@ -87,11 +91,6 @@ class IndexMap extends Component {
click: this.handleClickMap
};
const { mapCenter, marker } = this.state;
if (outMap) {
mapConfig.layers = layers;
}
console.log(marker)
return (
<div className="content indexPage" style={{ height: '612px' }}>
......
......@@ -1491,9 +1491,9 @@ li.ant-calendar-time-picker-select-option-selected {
background: rgba(27, 52, 87);
color: white;
}
.risk-assessment-view .amos-layout-has-sider .amos-layout .amos-layout-content .risk-assessment-view-content .risk-incidence-severity-matrix {
/* .risk-assessment-view .amos-layout-has-sider .amos-layout .amos-layout-content .risk-assessment-view-content .risk-incidence-severity-matrix {
width: 494px !important;
}
} */
.risk-assessment-view-situation-matrix amos-layout-content .risk-assessment-view-situation {
width: 494px !important;
}
......
......@@ -67,4 +67,21 @@ defaultConfig.output.publicPath = '';
defaultConfig.name = 'amos-tpl';
if (__ENV__ === 'development') {
defaultConfig.devServer.proxy = {
'/baseURI': {
target: 'http://172.16.11.20:10005/',
pathRewrite: { '^/baseURI': '' }
},
'/fileServerURI': {
target: 'http://172.16.10.85:9000/',
pathRewrite: { '^/fileServerURI': '' }
},
'/mapURI': {
target: 'http://172.16.3.120:8001/shaoshan/',
pathRewrite: { '^/mapURI': '' }
}
}
}
module.exports = defaultConfig;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment