Commit f8640455 authored by maoying's avatar maoying

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

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