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