Commit f3029f99 authored by 张博's avatar 张博

bug

parent 44554099
...@@ -21,6 +21,7 @@ class MaskContent extends Component { ...@@ -21,6 +21,7 @@ class MaskContent extends Component {
this.state = { this.state = {
planStarted: false, planStarted: false,
activeAction: 'panoramic', activeAction: 'panoramic',
multiple: true,
searchPaneVisible: false searchPaneVisible: false
}; };
} }
...@@ -49,14 +50,18 @@ class MaskContent extends Component { ...@@ -49,14 +50,18 @@ class MaskContent extends Component {
}; };
actionBarClick = ({ singleClick, type, label, showLabel }) => { actionBarClick = ({ singleClick, type, label, showLabel }) => {
if (type === 'back'){
this.props.initModalback();
return;
}
if (!singleClick){//设置选中状态 if (!singleClick){//设置选中状态
this.setState({ activeAction: type }); this.setState({ activeAction: type ,multiple: false });
} }
this.props.onActionItemClick && this.props.onActionItemClick(type, label, showLabel); this.props.onActionItemClick && this.props.onActionItemClick(type, label, showLabel);
if (type === 'search'){ if (type === 'search'){
this.changeSearchPaneVisible(); this.changeSearchPaneVisible();
} }
} }
changeSearchPaneVisible = () => { changeSearchPaneVisible = () => {
...@@ -71,13 +76,12 @@ class MaskContent extends Component { ...@@ -71,13 +76,12 @@ class MaskContent extends Component {
initViewModel = ()=>{ initViewModel = ()=>{
//选中全景监控、隐藏检索查询框 //选中全景监控、隐藏检索查询框
this.setState({ activeAction: 'panoramic', searchPaneVisible: false }); this.setState({ activeAction: 'panoramic',multiple: true, searchPaneVisible: false });
} }
render() { render() {
const { planStarted, activeAction, searchPaneVisible } = this.state; const { planStarted, activeAction, searchPaneVisible,multiple } = this.state;
const { const {
multiple,
onItemClick, onItemClick,
layerConfig, layerConfig,
alarmStarted, alarmStarted,
...@@ -90,7 +94,9 @@ class MaskContent extends Component { ...@@ -90,7 +94,9 @@ class MaskContent extends Component {
errorAreaId, errorAreaId,
focusPosition, focusPosition,
isPermissionControl, isPermissionControl,
bizPerActionBars bizPerActionBars,
isInitModel,
isPanoramic
} = this.props; } = this.props;
alarmStarted && this.props.editModelChange(true); alarmStarted && this.props.editModelChange(true);
const wsURL = completeToken(SysWsURL.rulews); const wsURL = completeToken(SysWsURL.rulews);
...@@ -115,12 +121,15 @@ class MaskContent extends Component { ...@@ -115,12 +121,15 @@ class MaskContent extends Component {
return ( return (
<div className="mask-content"> <div className="mask-content">
<AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData} reconnect debug /> <AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData} reconnect debug />
{ !alarmStarted && sideControlShow && <SideControl multiple={multiple} errorAreaId={errorAreaId} onItemClick={onItemClick} layerConfig={layerConfig} animationProps={controlAnimation} />} { !alarmStarted && sideControlShow && <SideControl multiple={multiple} errorAreaId={errorAreaId} onItemClick={onItemClick} layerConfig={layerConfig} animationProps={controlAnimation} activeAction={activeAction} />}
{ !alarmStarted && isShowActionBar && <SearchPane visible={searchPaneVisible} focusPosition={focusPosition} changeSearchPaneVisible={this.changeSearchPaneVisible} />} { !alarmStarted && isShowActionBar && <SearchPane visible={searchPaneVisible} focusPosition={focusPosition} changeSearchPaneVisible={this.changeSearchPaneVisible} />}
<TopMsg alarmStart={alarmStart} /> <TopMsg alarmStart={alarmStart} />
{ !alarmStarted && !isShowActionBar && <ModelHeader animationProps={controlAnimation} headerName={headerName} handleExceptModel={this.handleExceptModel} />} { !alarmStarted && (!isShowActionBar || isInitModel ) && !isPanoramic &&
<ModelHeader animationProps={controlAnimation} headerName={headerName} handleExceptModel={this.handleExceptModel} />
}
{ !alarmStarted && isShowActionBar && { !alarmStarted && isShowActionBar &&
<ActionBar <ActionBar
isInitModel={isInitModel}
isPermissionControl={isPermissionControl} isPermissionControl={isPermissionControl}
bizPerActionBars={bizPerActionBars} bizPerActionBars={bizPerActionBars}
PeractiveAction={activeAction} PeractiveAction={activeAction}
...@@ -138,7 +147,7 @@ MaskContent.propTypes = { ...@@ -138,7 +147,7 @@ MaskContent.propTypes = {
layerConfig: PropTypes.object, layerConfig: PropTypes.object,
onItemClick: PropTypes.func, onItemClick: PropTypes.func,
// 是否支持多选 // 是否支持多选
multiple: PropTypes.bool, //multiple: PropTypes.bool,
subscribe: PropTypes.func, subscribe: PropTypes.func,
trigger: PropTypes.func, trigger: PropTypes.func,
showExplain: PropTypes.bool, showExplain: PropTypes.bool,
...@@ -159,11 +168,13 @@ MaskContent.propTypes = { ...@@ -159,11 +168,13 @@ MaskContent.propTypes = {
editModelChange: PropTypes.func, editModelChange: PropTypes.func,
focusPosition: PropTypes.func, focusPosition: PropTypes.func,
isPermissionControl: PropTypes.bool, isPermissionControl: PropTypes.bool,
isInitModel: PropTypes.bool,
isPanoramic: PropTypes.bool,
bizPerActionBars: PropTypes.arrays bizPerActionBars: PropTypes.arrays
}; };
MaskContent.defaultProps = { // MaskContent.defaultProps = {
multiple: false // multiple: true
}; // };
export default MaskContent; export default MaskContent;
...@@ -131,6 +131,7 @@ class View3D extends Component { ...@@ -131,6 +131,7 @@ class View3D extends Component {
startLoadExceptionArea: false, //是否开始加载区域marker startLoadExceptionArea: false, //是否开始加载区域marker
sideControlShow: false, //隐藏耳朵 sideControlShow: false, //隐藏耳朵
isShowActionBar: true, //显示工具栏 isShowActionBar: true, //显示工具栏
isPanoramic: true, //是否全景
errorAreaId: '' ,//异常区域id errorAreaId: '' ,//异常区域id
positionxyz: '', positionxyz: '',
rightHeight: 10, rightHeight: 10,
...@@ -145,7 +146,8 @@ class View3D extends Component { ...@@ -145,7 +146,8 @@ class View3D extends Component {
btnType: 'isOk', btnType: 'isOk',
isback: false isback: false
}, },
isOutterView: true //控制进入层级后是否显示marker isOutterView: true ,//控制进入层级后是否显示marker
isInitModel: false //是否进入模型内部
}; };
getObjFromNet(view3dFile, (objs, asyncModels) => { getObjFromNet(view3dFile, (objs, asyncModels) => {
...@@ -265,7 +267,6 @@ class View3D extends Component { ...@@ -265,7 +267,6 @@ class View3D extends Component {
} }
const object = evt.object; const object = evt.object;
if (object) { if (object) {
alert(1)
this.cameraFactory.flyTo({ this.cameraFactory.flyTo({
position: object.position.toArray(), position: object.position.toArray(),
duration: 6000 duration: 6000
...@@ -279,11 +280,25 @@ class View3D extends Component { ...@@ -279,11 +280,25 @@ class View3D extends Component {
this.initModelDisplay(); this.initModelDisplay();
this.outlineFactory.toggleOutline([]);//清除选中 this.outlineFactory.toggleOutline([]);//清除选中
this.lensLevel = LENS_LEVEL.ROOT; this.lensLevel = LENS_LEVEL.ROOT;
this.setState({ isOutterView: true });//恢复marker显示 if (this.state.isPanoramic){
this.setState({ isOutterView: true,isInitModel: false,isShowActionBar: true });//恢复marker显示
} else {
this.setState({ isOutterView: true,isInitModel: false,isShowActionBar: false });//恢复marker显示
}
} }
}); });
}; };
initModalback = ()=>{
this.initModelDisplay();
this.outlineFactory.toggleOutline([]);//清除选中
this.lensLevel = LENS_LEVEL.ROOT;
if (this.state.isPanoramic){
this.setState({ isOutterView: true,isInitModel: false,isShowActionBar: true });//恢复marker显示
} else {
this.setState({ isOutterView: true,isInitModel: false,isShowActionBar: false });//恢复marker显示
}
}
_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}`);
...@@ -543,6 +558,7 @@ class View3D extends Component { ...@@ -543,6 +558,7 @@ class View3D extends Component {
//双击进入模型内部 //双击进入模型内部
obj.on(EVENT_TYPE_CORE.DBLClick, evt => { obj.on(EVENT_TYPE_CORE.DBLClick, evt => {
if (this.state.isEditMode === false) { if (this.state.isEditMode === false) {
me.setState({ isInitModel: true,isShowActionBar: true });
flyToSubView(me,obj,LENS_LEVEL); flyToSubView(me,obj,LENS_LEVEL);
} }
}); });
...@@ -1305,7 +1321,6 @@ class View3D extends Component { ...@@ -1305,7 +1321,6 @@ class View3D extends Component {
asyncLoadMarkerData = (markerType, riskSourceId) => { asyncLoadMarkerData = (markerType, riskSourceId) => {
const { markers,abnormalStatus } = this.state; const { markers,abnormalStatus } = this.state;
this.setState({ showMap: false }); this.setState({ showMap: false });
this.clearMarkers();
initView3DAction(markerType,riskSourceId,abnormalStatus).then(d => { initView3DAction(markerType,riskSourceId,abnormalStatus).then(d => {
if (markerType === 'fireResource') { if (markerType === 'fireResource') {
markers['hydrant'] = d.filter(e => e.type === 'hydrant'); markers['hydrant'] = d.filter(e => e.type === 'hydrant');
...@@ -1374,7 +1389,7 @@ class View3D extends Component { ...@@ -1374,7 +1389,7 @@ class View3D extends Component {
toggleRoad: !isCancel toggleRoad: !isCancel
}); });
} else { } else {
this.clearMarkers(); //this.clearMarkers();
if (!isCancel) { if (!isCancel) {
this.asyncLoadMarkerData(item.type,item.riskSourceId); this.asyncLoadMarkerData(item.type,item.riskSourceId);
} else { } else {
...@@ -1450,6 +1465,7 @@ class View3D extends Component { ...@@ -1450,6 +1465,7 @@ class View3D extends Component {
this.setState({ this.setState({
isEditMode: false, isEditMode: false,
isShowActionBar: false, //隐藏工具栏 isShowActionBar: false, //隐藏工具栏
isPanoramic: false,
startLoadExceptionArea: false,//隐藏marker startLoadExceptionArea: false,//隐藏marker
sideControlShow: false //隐藏耳朵 sideControlShow: false //隐藏耳朵
}); });
...@@ -1462,6 +1478,7 @@ class View3D extends Component { ...@@ -1462,6 +1478,7 @@ class View3D extends Component {
this.setState({ this.setState({
isShowActionBar: false, //隐藏工具栏 isShowActionBar: false, //隐藏工具栏
isPanoramic: false,
startLoadExceptionArea: false,//隐藏marker startLoadExceptionArea: false,//隐藏marker
sideControlShow: false //隐藏耳朵 sideControlShow: false //隐藏耳朵
}); });
...@@ -1471,6 +1488,7 @@ class View3D extends Component { ...@@ -1471,6 +1488,7 @@ class View3D extends Component {
sideControlShow: true,//耳朵 sideControlShow: true,//耳朵
startLoadExceptionArea: false, //隐藏marker startLoadExceptionArea: false, //隐藏marker
isShowActionBar: false, //隐藏工具栏 isShowActionBar: false, //隐藏工具栏
isPanoramic: false,
abnormalStatus: false //点告警状态 abnormalStatus: false //点告警状态
}); });
...@@ -1533,7 +1551,7 @@ class View3D extends Component { ...@@ -1533,7 +1551,7 @@ class View3D extends Component {
getExceptionAreasList = () => { getExceptionAreasList = () => {
exceptionRegionListAction().then(data=>{ exceptionRegionListAction().then(data=>{
const exceptionAreas = data.filter(e=>{ const exceptionAreas = data && data.filter(e=>{
return e.routePath && e.routePath.routePath && e.routePath.routePath.length > 0; return e.routePath && e.routePath.routePath && e.routePath.routePath.length > 0;
}); });
this.setState({ exceptionAreas }); this.setState({ exceptionAreas });
...@@ -1550,9 +1568,12 @@ class View3D extends Component { ...@@ -1550,9 +1568,12 @@ class View3D extends Component {
} }
selectPolygonRegion =(exceptionAreas,id)=> { selectPolygonRegion =(exceptionAreas,id)=> {
const regionConf = { const regionConf = {
regionColor: '#76d015', // 区域颜色 // regionColor: '#76d015', // 区域颜色
lineColor: '#ffffff', // 边框颜色 // lineColor: '#ffffff', // 边框颜色
regionOpacity: 1 // 不透明度 (默认是 0.5 半透明) // regionOpacity: 1 // 不透明度 (默认是 0.5 半透明)
regionColor: '#02B00F', // 区域颜色
lineColor: '#00FF70', // 边框颜色
regionOpacity: 0.3
}; };
if (id && exceptionAreas){ if (id && exceptionAreas){
return exceptionAreas.map((area,index) =>{ return exceptionAreas.map((area,index) =>{
...@@ -1568,9 +1589,9 @@ class View3D extends Component { ...@@ -1568,9 +1589,9 @@ class View3D extends Component {
renderPolygonRegion = (exceptionAreas)=> { renderPolygonRegion = (exceptionAreas)=> {
const regionConf = { const regionConf = {
regionColor: '#76d015', // 区域颜色 regionColor: '#02B00F', // 区域颜色
lineColor: '#ffffff', // 边框颜色 lineColor: '#00FF70', // 边框颜色
regionOpacity: 1 // 不透明度 (默认是 0.5 半透明) regionOpacity: 0.3
}; };
return exceptionAreas.map((area,index) =>{ return exceptionAreas.map((area,index) =>{
const { routePath: points = [] } = area.routePath; const { routePath: points = [] } = area.routePath;
...@@ -1589,6 +1610,8 @@ class View3D extends Component { ...@@ -1589,6 +1610,8 @@ class View3D extends Component {
pageType: 'region',//区域 pageType: 'region',//区域
sideControlShow: false, //隐藏耳朵 sideControlShow: false, //隐藏耳朵
isShowActionBar: true, //显示工具栏 isShowActionBar: true, //显示工具栏
isInitModel: false,
isPanoramic: true,
startLoadExceptionArea: true, //显示marker, startLoadExceptionArea: true, //显示marker,
headerName: '', //设置头名称 headerName: '', //设置头名称
isEditMode: false, //推出编辑模式 isEditMode: false, //推出编辑模式
...@@ -1610,6 +1633,8 @@ class View3D extends Component { ...@@ -1610,6 +1633,8 @@ class View3D extends Component {
this.setState({ this.setState({
sideControlShow: true, //显示耳朵 sideControlShow: true, //显示耳朵
isShowActionBar: false, //隐藏工具栏 isShowActionBar: false, //隐藏工具栏
isInitModel: false,
isPanoramic: false,
startLoadExceptionArea: false,//隐藏marker startLoadExceptionArea: false,//隐藏marker
headerName: '故障点模式', //设置头名称 headerName: '故障点模式', //设置头名称
errorAreaId: areaId errorAreaId: areaId
...@@ -1748,7 +1773,9 @@ class View3D extends Component { ...@@ -1748,7 +1773,9 @@ class View3D extends Component {
promptData, promptData,
pointType, pointType,
isOutterView, isOutterView,
routePathData routePathData,
isInitModel,
isPanoramic
} = this.state; } = this.state;
const { dimension, hiddenScreenSaver, editModelChange, isPermissionControl, bizPerActionBars } = this.props; const { dimension, hiddenScreenSaver, editModelChange, isPermissionControl, bizPerActionBars } = this.props;
const graphicProps = { const graphicProps = {
...@@ -1812,6 +1839,9 @@ class View3D extends Component { ...@@ -1812,6 +1839,9 @@ class View3D extends Component {
maskContent={ maskContent={
<MaskContent <MaskContent
planStarted={planStarted} planStarted={planStarted}
isInitModel={isInitModel}
isPanoramic={isPanoramic}
initModalback={this.initModalback}
alarmStarted={alarmStarted} alarmStarted={alarmStarted}
onItemClick={this.changeMarkerType} onItemClick={this.changeMarkerType}
layerConfig={layerConfig} layerConfig={layerConfig}
......
...@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; ...@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import classNames from 'classnames'; import classNames from 'classnames';
import { Connect } from 'amos-framework'; import { Connect } from 'amos-framework';
import { SidePane } from 'amos-framework'; import { SidePane } from 'amos-framework';
import { actionBars } from './../conf'; import { actionBars,actionBackBars } from './../conf';
import { eventTopics } from './../consts'; import { eventTopics } from './../consts';
const eventConnect = Connect.eventConnect; const eventConnect = Connect.eventConnect;
...@@ -18,12 +18,17 @@ class ActionBar extends Component { ...@@ -18,12 +18,17 @@ class ActionBar extends Component {
getActionBars =()=>{ getActionBars =()=>{
const { isPermissionControl = false, bizPerActionBars = {} } = this.props; const { isPermissionControl = false, bizPerActionBars = {} ,isInitModel = false } = this.props;
if (isPermissionControl){ if (isInitModel){
return actionBars.filter(bar => bizPerActionBars[bar.key] && bizPerActionBars[bar.key].hasPermission); return actionBackBars;
} else { } else {
return actionBars; if (isPermissionControl){
return actionBars.filter(bar => bizPerActionBars[bar.key] && bizPerActionBars[bar.key].hasPermission);
} else {
return actionBars;
}
} }
} }
itemClick = (item) => { itemClick = (item) => {
......
...@@ -86,7 +86,12 @@ export const actionBars = [ ...@@ -86,7 +86,12 @@ export const actionBars = [
{ key: 'edit-action', icon: 'editMode', type: 'editMode', singleClick: false, label: '编辑' , showLabel: true }, { key: 'edit-action', icon: 'editMode', type: 'editMode', singleClick: false, label: '编辑' , showLabel: true },
{ key: 'search-action', icon: 'chaxun', type: 'search', singleClick: true, label: '检索' , showLabel: true } { key: 'search-action', icon: 'chaxun', type: 'search', singleClick: true, label: '检索' , showLabel: true }
]; ];
/**
* 视图控制返回
*/
export const actionBackBars = [
{ key: 'back-action', icon: 'impEquipment', type: 'back', singleClick: true, label: '返回',showLabel: true }
];
/** /**
* 告警模式 * 告警模式
*/ */
......
...@@ -60,7 +60,7 @@ export default class SafetyExecuteList extends Component { ...@@ -60,7 +60,7 @@ export default class SafetyExecuteList extends Component {
} }
}); });
this.setState({ this.setState({
alarmData: data, alarmData: data || [],
selectValue: value selectValue: value
}); });
}); });
......
...@@ -21,7 +21,26 @@ class SideControl extends Component { ...@@ -21,7 +21,26 @@ class SideControl extends Component {
activeControl: [] activeControl: []
}; };
} }
componentWillMount(){
const { activeAction } = this.props;
let activeControl = [];
if (activeAction === 'panoramic'){
let _bizControls = bizControls;
_bizControls.map((item,index)=>{
return activeControl.push(item.key);
});
}
this.setState({ activeControl },()=>this.getAreaPoint());
}
getAreaPoint(){
const { activeControl } = this.state;
const { errorAreaId: riskSourceId } = this.props;
for (let i = 0;i < activeControl.length;i++){
this.props.onItemClick && this.props.onItemClick({ ...bizControls[i] , riskSourceId }, false);
}
}
/** /**
* control 点击,第二次点击则取消 * control 点击,第二次点击则取消
*/ */
......
This diff is collapsed.
This diff is collapsed.
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