Commit 637ce8a7 authored by 单奇雲's avatar 单奇雲

Merge branch 'developer' of http://172.16.10.76/station/amos-station-module-view into developer

parents 912cf982 e42dd624
......@@ -11,9 +11,9 @@
objModelURI: '/a3dres',
// 根url
// baseURI: 'http://172.16.11.30:9008/',
baseURI: 'http://172.16.3.122:8083/',
baseURI: 'http://172.16.3.77:8083/',
// convertorURI: 'http://172.16.3.122:8083/',
convertorURI: 'http://172.16.3.122:8083/',
convertorURI: 'http://172.16.3.77:8083/',
patrolURI: 'http://172.16.3.77:9000/',
rulesConfigURI: 'http://172.16.10.91:8080/',
// plugin URI
......
......@@ -57,7 +57,6 @@ class PointsPool extends Component {
}
onMarkersCreated = (type, { markersCache }) => {
this.markerList[type] = markersCache;
(markersCache || []).forEach(mc => {
const extData = mc.getExtData();
......@@ -106,6 +105,7 @@ class PointsPool extends Component {
addMarker={this.addMarker}
stagePilot={this.props.stagePilot}
selectPoints={this.props.selectPoints}
showRightPanelOnclick={(d)=>this.props.showRightPanelOnclick(d)}
/>
{/* <PatrolPoint
{...rest}
......
......@@ -22,9 +22,9 @@ class PromptModal extends Component {
this.props.saveAreaData();
} else {
if (isback){
this.props.savePointData();
this.props.savePointDataBack();
} else if (isSwitch) {
this.props.savePointData();
this.props.savePointDataSwitch(pointType);
} else {
this.props.savePointAndRefreshMarker(pointType,pointParams);
}
......
......@@ -283,7 +283,7 @@ class View3D extends Component {
_bindPubSubEvents = () => {
this.props.subscribe(eventTopics.base3d_view, (topic, data) => {
console.log('subscribe base3d_view' + data);
console.log(`subscribe base3d_view${data}`);
if (isControllerEvent(topic)) {
executeView3dCMD(this, topic, data);
} else if (isManualOperate(topic)) {
......@@ -924,7 +924,14 @@ class View3D extends Component {
message.error('保存失败!');
});
}
savePointDataBack = async()=>{
await this.savePointData();
this.handleOutExceptModel();
}
savePointDataSwitch= async (pointType)=>{
await this.savePointData();
this.pointTypeChangeIsok(pointType);
}
//保存点绑定
savePointData = () => {
let { markers, pointType } = this.state;
......@@ -1050,10 +1057,10 @@ class View3D extends Component {
riskSourceId: selectArea.id,
routePath: ''
});
var tree = new Object();
tree.children = treeData;
this.removeTreeDataRoutePathByChildId(selectArea.id,tree);
this.getAreas(tree.children);
//var tree = new Object();
//tree.children = treeData;
//this.removeTreeDataRoutePathByChildId(selectArea.id,tree);
//this.getAreas(tree.children);
this.setState({
routePathData: this.state.routePathData,
//treeData: tree.children,
......@@ -1152,11 +1159,7 @@ class View3D extends Component {
this.enableCamera();
}
}
pointTypeChange = (pointType) => {
let { isPointSave } = this.state;
if (isPointSave){
this.showConfirm();
}
pointTypeChangeIsok =(pointType)=>{
this.stagePilot.positionCtl.clearDrag();
this.setState({
pointType,
......@@ -1175,7 +1178,16 @@ class View3D extends Component {
});
});
}
showConfirm = () => {
pointTypeChange = (pointType) => {
let { isPointSave } = this.state;
if (isPointSave){
this.showConfirm(pointType);
} else {
this.pointTypeChangeIsok(pointType);
}
}
showConfirm = (pointType) => {
this.setState({ promptData:
{
promptvisible: true,
......@@ -1183,8 +1195,8 @@ class View3D extends Component {
type: 'point',
btnType: 'isOk',
isback: false,
isSwitch: true
isSwitch: true,
pointType
}
});
......@@ -1528,7 +1540,7 @@ class View3D extends Component {
}
initExceptionAreasData = ()=>{
this.setState({ startLoadExceptionArea: false, exceptionAreas: [] },()=>{
this.setState({ startLoadExceptionArea: true },()=>{
this.getExceptionAreasList();
});
}
......@@ -1545,6 +1557,7 @@ class View3D extends Component {
});
}
handleOutExceptModel=()=>{
this.clearMarkers();
this.executeOperate({ key: 'fitview' });//恢复正常视角
this.props.editModelChange(false);//显示全景统计
this.enableCamera();//恢复相机
......@@ -1562,7 +1575,7 @@ class View3D extends Component {
selectPoints: '',
showRightPanel: false
});
this.clearMarkers();
}
handleExceptModel =(type,areaId)=>{
let { isPointSave,isAreaSave } = this.state;
......@@ -1642,16 +1655,22 @@ class View3D extends Component {
multLoadWorkerObjContent =(asyncModels)=>{
const sliceArry = chunk(asyncModels, 5);//每5个一组
return sliceArry.map(objs=>{
return <WorkerObjContent
return (<WorkerObjContent
onComplete={this.onComplete}
objs={objs}
onWorkerMessage={this.onWorkerLoading}
enableLoading
afterInit={this.onAfterWorkerInit}
/>;
/>);
});
}
showRightPanelOnclick=({ extData, position })=>{
this.setState({
positionxyz: position,
showRightPanel: true,
selectPoints: extData
});
}
addMarker=({ extData, position })=>{
const me = this;
const { markers } = me.state;
......@@ -1702,6 +1721,7 @@ class View3D extends Component {
rightHeight,
treeDataList,
promptData,
pointType,
isOutterView
} = this.state;
const { dimension, hiddenScreenSaver, editModelChange } = this.props;
......@@ -1746,7 +1766,8 @@ class View3D extends Component {
saveAreaData={this.saveAreaData}
handleOutExceptModel={this.handleOutExceptModel}
savePointAndRefreshMarker={(pointType,pointParams)=>this.savePointAndRefreshMarker(pointType,pointParams)}
savePointData={this.savePointData}
savePointDataBack={this.savePointDataBack}
savePointDataSwitch={this.savePointDataSwitch}
closePromptModal={this.closePromptModal}
/>
......@@ -1796,7 +1817,7 @@ class View3D extends Component {
>
{startAsyncLoad && this.multLoadWorkerObjContent(asyncModels)}
{isEditMode && pageType === 'region' ? '' :
isOutterView && <PointsPool markers={markers} isEditMode={isEditMode} selectPoints={selectPoints} updateMarker={this.updateMarker} planStarted={alarmStarted} stagePilot={this.stagePilot} positionCtl={this.positionCtl} addMarker={this.addMarker} ref={node => this.pointsPool = node} />}
isOutterView && <PointsPool showRightPanelOnclick={this.showRightPanelOnclick} markers={markers} isEditMode={isEditMode} selectPoints={selectPoints} updateMarker={this.updateMarker} planStarted={alarmStarted} stagePilot={this.stagePilot} positionCtl={this.positionCtl} addMarker={this.addMarker} ref={node => this.pointsPool = node} />}
{fireTruckRoute && <FatLine {...lineData.fatLineConf} linePath={JSON.parse(fireTruckRoute)} visible={showFireTruckRoute} />}
<FlameFire position={firePosition} width={10} height={20} depth={8} sliceSpacing={1} visible={planStarted} />
{isEditMode && this.renderAreas()}
......@@ -1828,7 +1849,7 @@ class View3D extends Component {
// stopDrowing={this.stopDrowing}
pageType={pageType}
treeDataList={treeDataList}
// pointType={pointType}
pointType={pointType}
markers={markers}
pointTypeArr={pointTypeArr}
pointTypeChange={this.pointTypeChange}
......
......@@ -42,32 +42,13 @@ class PointLeftTree extends Component {
}
componentWillMount() {
const { treeData, pointTypeArr, treeDataList } = this.props;
this.setState({
treeData,
treeDataList,
pointTypeArr,
pointType: pointTypeArr[0] ? pointTypeArr[0].code : ''
});
}
componentWillReceiveProps(nextProps) {
console.log(nextProps);
let { treeData,treeDataList } = nextProps;
this.setState({
treeData,
treeDataList
});
}
onSelectChange = (value, item) =>{
console.log(value, item);
this.setState({ pointType: value, searchValue: '' });
this.setState({ searchValue: '' });
this.props.pointTypeChange(value);
}
onSearchChange = (e,v) => {
const { treeDataList,treeData } = this.state;
const { treeDataList,treeData } = this.props;
let value = v ? v : '';
const expandedKeys = treeDataList
.map(item => {
......@@ -100,7 +81,8 @@ class PointLeftTree extends Component {
}
// eslint-disable-next-line react/sort-comp
renderTreeNodes = (data) => {
const { searchValue, pointType } = this.state;
const { searchValue } = this.state;
const { pointType = '' } = this.props;
if (data.length > 0) {
return data.map((item) => {
const index = item.name.indexOf(searchValue);
......@@ -180,7 +162,8 @@ class PointLeftTree extends Component {
}
render() {
let { treeData,pointTypeArr,pointType , searchValue } = this.state;
const { searchValue } = this.state;
const { treeData, pointTypeArr, pointType = '' } = this.props;
return (
<div className="leftTree">
<div className='leftContainer'>
......
......@@ -139,15 +139,15 @@ class SafetyIndexWeek extends Component {
type: 'line',
symbol: 'circle', //折线点设置为实心点
smooth: 0.6,
// itemStyle: {
// normal: {
// color: '#FF7400', //折线点的颜色
// lineStyle: {
// width: 3, //折线宽度
// color: '#DDBF28' //折线颜色
// }
// }
// },
itemStyle: {
normal: {
color: 'rgba(255, 0, 0, 0.3)', //折线点的颜色
// lineStyle: {
// width: 3, //折线宽度
// color: '#DDBF28' //折线颜色
// }
}
},
lineStyle: {
normal: { color: {
type: 'linear',
......
......@@ -92,8 +92,10 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
};
onMarkerClick = (marker, e) => {
const { isClick } = this.state;
if (this.props.isEditMode) {
this.props.showRightPanelOnclick(marker);
return false;
}
tirggerPlanTopic(CONSTS.plan_detail, { type: marker.extData.type, data: marker.extData });
......
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