Commit f3029f99 authored by 张博's avatar 张博

bug

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