Commit 2a6317f3 authored by suhuiguang's avatar suhuiguang

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

# Conflicts: # mods/components/3dviewConvertor/view/MaskContent.js
parents 3758a306 ec57623b
.amos-side-pane-wrapper {
.amos-sidepane {
z-index: 1;
z-index: 99;
.record-view-parent {
width: 260px;
......
......@@ -49,6 +49,10 @@ class MaskContent extends Component {
};
actionBarClick = ({ singleClick, type, label, showLabel }) => {
if (type === 'back'){
this.props.initModalback && this.props.initModalback();
return;
}
if (!singleClick){//设置选中状态
this.setState({ activeAction: type });
}
......@@ -56,6 +60,7 @@ class MaskContent extends Component {
if (type === 'search'){
this.changeSearchPaneVisible();
}
}
changeSearchPaneVisible = () => {
......@@ -89,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);
......@@ -114,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}
......@@ -158,7 +168,10 @@ MaskContent.propTypes = {
editModelChange: PropTypes.func,
focusPosition: PropTypes.func,
isPermissionControl: PropTypes.bool,
bizPerActionBars: PropTypes.arrays
isInitModel: PropTypes.bool,
isPanoramic: PropTypes.bool,
bizPerActionBars: PropTypes.arrays,
initModalback: PropTypes.func
};
MaskContent.defaultProps = {
......
......@@ -132,6 +132,7 @@ class View3D extends Component {
startLoadExceptionArea: false, //是否开始加载区域marker
sideControlShow: false, //隐藏耳朵
isShowActionBar: true, //显示工具栏
isPanoramic: true, //是否全景
errorAreaId: '' ,//异常区域id
positionxyz: '',
rightHeight: 10,
......@@ -146,7 +147,8 @@ class View3D extends Component {
btnType: 'isOk',
isback: false
},
isOutterView: true //控制进入层级后是否显示marker
isOutterView: true ,//控制进入层级后是否显示marker
isInitModel: false //是否进入模型内部
};
getObjFromNet(view3dFile, (objs, asyncModels) => {
......@@ -278,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 +559,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);
}
});
......@@ -559,9 +576,24 @@ class View3D extends Component {
});
}
};
focusObject = object => {
getErrorAreaPoint(riskSourceId){
const { markers } = this.state;
let arrays = ['riskSource','patrol','impEquipment','monitorEquipment'];
initView3DAction('',riskSourceId,true).then(d => {
d.map((item)=>{
if (arrays.includes(item.type)){
markers[`${item.type}`].push(item);
}
}
);
this.setState({
markers: deepCopy(markers)
});
});
}
focusObject = (object,errorAreaId)=> {
const me = this;
me.getErrorAreaPoint(errorAreaId);
if (!me.state.alarmStarted && object) {
this.cameraFactory.flyTo({
target: object,
......@@ -1305,7 +1337,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');
......@@ -1317,13 +1348,13 @@ class View3D extends Component {
markers['fireDetection'] = d.filter(e => e.type === 'fireDetection');
markers[markerType] = d;
this.setState({
markers
markers: deepCopy(markers)
});
return;
}
markers[markerType] = d;
this.setState({
markers,
markers: deepCopy(markers),
markerType
});
});
......@@ -1450,6 +1481,7 @@ class View3D extends Component {
this.setState({
isEditMode: false,
isShowActionBar: false, //隐藏工具栏
isPanoramic: false,
startLoadExceptionArea: false,//隐藏marker
sideControlShow: false //隐藏耳朵
});
......@@ -1462,6 +1494,7 @@ class View3D extends Component {
this.setState({
isShowActionBar: false, //隐藏工具栏
isPanoramic: false,
startLoadExceptionArea: false,//隐藏marker
sideControlShow: false //隐藏耳朵
});
......@@ -1471,6 +1504,7 @@ class View3D extends Component {
sideControlShow: true,//耳朵
startLoadExceptionArea: false, //隐藏marker
isShowActionBar: false, //隐藏工具栏
isPanoramic: false,
abnormalStatus: false //点告警状态
});
......@@ -1533,7 +1567,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 +1584,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 +1605,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 +1626,8 @@ class View3D extends Component {
pageType: 'region',//区域
sideControlShow: false, //隐藏耳朵
isShowActionBar: true, //显示工具栏
isInitModel: false,
isPanoramic: true,
startLoadExceptionArea: true, //显示marker,
headerName: '', //设置头名称
isEditMode: false, //推出编辑模式
......@@ -1610,6 +1649,8 @@ class View3D extends Component {
this.setState({
sideControlShow: true, //显示耳朵
isShowActionBar: false, //隐藏工具栏
isInitModel: false,
isPanoramic: false,
startLoadExceptionArea: false,//隐藏marker
headerName: '故障点模式', //设置头名称
errorAreaId: areaId
......@@ -1748,7 +1789,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 +1855,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 }
];
/**
* 告警模式
*/
......
......@@ -46,7 +46,7 @@ class ExceptionArea extends Component {
onMarkerClick = (marker) => {
const { extData, node } = marker;
this.props.handleExceptModel && this.props.handleExceptModel('into_except_model',extData.id);
this.props.focusObject && this.props.focusObject(node);
this.props.focusObject && this.props.focusObject(node,extData.id);
}
......
......@@ -62,7 +62,7 @@ export default class SafetyExecuteList extends Component {
}
});
this.setState({
alarmData: data,
alarmData: data || [],
selectValue: value
});
});
......
......@@ -26,6 +26,7 @@ class SideControl extends Component {
* control 点击,第二次点击则取消
*/
onBizItemClick = (item, e) => {
console.log(item.type);
const { errorAreaId: riskSourceId } = this.props;
const alreadyActive = this.isActive(item.key);
const newKeys = this.getActiveControl(item.key, alreadyActive);
......
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