Commit 1e9a0b7c authored by 单奇雲's avatar 单奇雲

修改bug

parent 831e5a42
......@@ -16,7 +16,7 @@ export const FscSerUrl = {
//*******************************************************************************
// 3D视图
//*******************************************************************************
view3dInitUrl: completePrefix(view3dURI, 'api/view3d/init3dViewNode?type={type}&riskSourceId={riskSourceId}'), // 初始化三维视图 get
view3dInitUrl: completePrefix(view3dURI, 'api/view3d/init3dViewNode?type={type}&riskSourceId={riskSourceId}&abnormalStatus={abnormalStatus}'), // 初始化三维视图 get
view3dInitLinkUrl: completePrefix(view3dURI, 'view3d/initViewLink'), // 初始化三维视图 获取link get
searchRegionListUrl: completePrefix(patrolURI, 'api/group/queryDept'), //右侧菜单-检索-区域集合
searchViewUrl: completePrefix(view3dURI, 'api/view3d/retrieve/all'), // 右侧菜单-检索
......
......@@ -25,12 +25,11 @@ export const getObjFromNet = (url, callback) => {
* 获取各个类型的marker
* @param {string} type
*/
export const initView3DAction = (type,riskSourceId) => {
export const initView3DAction = (type,riskSourceId,abnormalStatus) => {
if (!riskSourceId) {
riskSourceId="";
riskSourceId = '';
}
const url = formatUrl(FscSerUrl.view3dInitUrl, {type,riskSourceId});
const url = formatUrl(FscSerUrl.view3dInitUrl, { type,riskSourceId,abnormalStatus });
return commonGet(url);
};
......
......@@ -31,6 +31,7 @@ class ConvertorView3DRoot extends Basic {
isEdit: false
};
this.pushTimeOutId = null;
}
componentDidMount() {}
......@@ -89,15 +90,11 @@ class ConvertorView3DRoot extends Basic {
}
}
refshExceptAreaData = ()=>{
this.view3d.initExceptionAreasData && this.view3d.initExceptionAreasData();
}
render() {
const { isEdit } = this.state;
return (
<div style={{ height: '100%' }}>
{ isEdit ? '' : <Statistical refshExceptAreaData={this.refshExceptAreaData} /> }
{ isEdit ? '' : <Statistical /> }
<div className="sys-view-3d">
<View3D
ref={node => this.view3d = node}
......
......@@ -56,7 +56,7 @@ class MaskContent extends Component {
this.setState({ activeAction: type });
}
this.props.onActionItemClick && this.props.onActionItemClick(type, label, showLabel);
if(type === "search"){
if (type === 'search'){
this.changeSearchPaneVisible();
}
}
......@@ -122,7 +122,7 @@ 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 && <SearchPane visible={searchPaneVisible} focusPosition={focusPosition} changeSearchPaneVisible={() => this.changeSearchPaneVisible} />}
<TopMsg alarmStart={alarmStart} />
{ !alarmStarted && !isShowActionBar && <ModelHeader animationProps={controlAnimation} headerName={headerName} handleExceptModel={this.handleExceptModel} />}
......
......@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { utils,UUID, deepCopy } from 'amos-tool';
import { PubSub } from 'ray-eventpool';
import { Connect as UIConnect, message, AmosAlert,Modal } from 'amos-framework';
import { Connect as UIConnect, message, AmosAlert } from 'amos-framework';
import { FatLine } from 'amos-3d/lib/advanced';
import A3DDesigner, { Connect, FireObject,DESIGNER_CONSTS,PolygonRegion } from 'amos-3d/lib/designer';
import WorkerObjContent from 'amos-3d/lib/worker/WorkerObjContent';
......@@ -13,7 +13,6 @@ import MaskContent from './MaskContent';
import { getObjFromNet, initView3DAction, query3DStatistics, pointModelistAction } from '../services/3dService';
import { desigerConf, desigerHelperConfig } from './conf';
import PointsPool from './PointsPool';
import PromptModal from './PromptModal'
import { eventTopics, isControllerEvent, isManualOperate } from './consts';
import { executeView3dCMD, parseManual, parseBubbleMarkers, tirggerPlanTopic, tirggerTransTopic } from './dataProcessor';
import {
......@@ -120,18 +119,11 @@ class View3D extends Component {
sideControlShow: false, //隐藏耳朵
isShowActionBar: true, //显示工具栏
errorAreaId: '' ,//异常区域id
positionxyz:'',
rightHeight:10,
isPointSave:false,
isAreaSave:false,
treeDataList:[],
promptData:{
promptvisible:false,
promptContent:'',
type:'region',
btnType:'isOk',
isback:false
}
positionxyz: '',
rightHeight: 1,
isPointSave: true,
treeDataList: [],
abnormalStatus: true //点告警状态
};
getObjFromNet(view3dFile, (objs, asyncModels) => {
......@@ -277,6 +269,8 @@ class View3D extends Component {
this.asyncLoadMarkerData('fireResource');
} else if (topic === eventTopics.view_fresh) {
this.viewFreshInit();
} else if (topic === eventTopics.exceptionAreas_fresh) {
this.initExceptionAreasData();
}
});
};
......@@ -583,7 +577,6 @@ class View3D extends Component {
}
startDrow = (areaItem) => {
// this.a3dRef.addPen(m);
this.setState({ isAreaSave: true });
console.log('drow--------')
this.setState({
selectArea:areaItem,
......@@ -884,7 +877,6 @@ class View3D extends Component {
//保存区域绑定
saveAreaData = () => {
let { routePathData } = this.state;
this.setState({isAreaSave: false});
saveAreaDataAction(routePathData).then(d => {
message.success('保存成功!');
this.a3dRef.changeDrawState(PEN_STATE.CLEARED);//清除当前路径
......@@ -907,9 +899,8 @@ class View3D extends Component {
//保存点绑定
savePointData = () => {
let { markers, pointType, isPointSave} = this.state;
this.setState({isPointSave: false});
this.setState({isPointSave: true});
let paramsArr = [];
paramsArr = markers[pointType].filter(e=> e.isEdit).map(item=>{
return {
......@@ -951,40 +942,23 @@ class View3D extends Component {
});
this.savePointAndRefreshMarker(pointType,pointParams);
}else if(selectPoints && selectPoints.isRegion && selectPoints.children){
// AmosAlert.confirm('提示', '是否删除该区域下所有点?', {
// callback: (flag) => {
// if (flag){
// let pointParams = [];
// pointParams = selectPoints.children.filter(e => e.position3d && e.position3d.length > 0).map(item=>{
// return {
// pointId: item.id,
// pointType: item.type,
// position3d: ''
// };
// });
// this.savePointAndRefreshMarker(pointType,pointParams);
// } else {
// }
// }
// });
let pointParams = [];
pointParams = selectPoints.children.filter(e => e.position3d && e.position3d.length > 0).map(item=>{
return {
pointId: item.id,
pointType: item.type,
position3d: ''
};
});
this.savePointAndRefreshMarker(pointType,pointParams);
this.setState({promptData:{
promptvisible:true,
promptContent:'是否删除该区域下所有点?',
type:'point',
btnType:'isOk',
isback:false,
AmosAlert.confirm('提示', '是否删除该区域下所有点?', {
callback: (flag) => {
if (flag){
let pointParams = [];
pointParams = selectPoints.children.filter(e => e.position3d && e.position3d.length > 0).map(item=>{
return {
pointId: item.id,
pointType: item.type,
position3d: ''
};
});
this.savePointAndRefreshMarker(pointType,pointParams);
} else {
}
}
})
});
}
}
......@@ -1011,29 +985,18 @@ 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,
selectArea: '',
treeData: tree.children
});
this.setState({promptData:{
promptvisible:true,
promptContent:'确定将选中删除?',
type:'region',
btnType:'isOk',
isback:false
}
})
} else {
message.danger('请先清除点的绑定再进行删除!');
}
});
}else{
message.danger('请先选择已绑定的区域再进行删除!');
}
}
/**
......@@ -1109,7 +1072,7 @@ class View3D extends Component {
}
pointTypeChange = (pointType) => {
let { isPointSave } = this.state;
if (isPointSave){
if (!isPointSave){
this.showConfirm();
}
this.setState({
......@@ -1125,24 +1088,15 @@ class View3D extends Component {
});
}
showConfirm = () => {
// AmosAlert.confirm('提示', '有未保存数据,是否保存?', {
// callback: (flag) => {
// if (flag){
// this.savePointData();
// } else {
// this.setState({ isPointSave: true });
// }
// }
// });
this.setState({promptData:
{
promptvisible:true,
promptContent:`有未保存数据,是否保存??`,
type:'point',
btnType:'isOk',
isback:false
AmosAlert.confirm('提示', '有未保存数据,是否保存?', {
callback: (flag) => {
if (flag){
this.savePointData();
} else {
this.setState({ isPointSave: true });
}
}
})
});
};
dragItemChange = (dragItem) => {
......@@ -1164,7 +1118,7 @@ class View3D extends Component {
drop = (event) => {
this.stagePilot.positionCtl.clearDrag();
event.preventDefault();
this.setState({ isPointSave: true });
this.setState({ isPointSave: false });
let { dragItem,markers } = this.state;
if (dragItem) {
if (dragItem.isBind) {
......@@ -1267,18 +1221,18 @@ class View3D extends Component {
};
asyncLoadMarkerData = (markerType, riskSourceId) => {
const { markers } = this.state;
const { markers,abnormalStatus } = this.state;
this.setState({ showMap: false });
this.clearMarkers();
initView3DAction(markerType,riskSourceId).then(d => {
initView3DAction(markerType,riskSourceId,abnormalStatus).then(d => {
if (markerType === 'fireResource') {
markers['hydrant'] = d['hydrant'];
markers['pool'] = d['pool'];
markers['fireCar'] = d['fireCar'];
markers['fireEquipment'] = d['fireEquipment'];
markers['fireChamber'] = d['fireChamber'];
markers['fireFoamRoom'] = d['fireFoamRoom'];
markers['fireDetection'] = d['fireDetection'];
markers['hydrant'] = d.filter(e => e.type === 'hydrant');
markers['pool'] = d.filter(e => e.type === 'pool');
markers['fireCar'] = d.filter(e => e.type === 'fireCar');
markers['fireEquipment'] = d.filter(e => e.type === 'fireEquipment');
markers['fireChamber'] = d.filter(e => e.type === 'fireChamber');
markers['fireFoamRoom'] = d.filter(e => e.type === 'fireFoamRoom');
markers['fireDetection'] = d.filter(e => e.type === 'fireDetection');
markers[markerType] = d;
this.setState({
markers
......@@ -1429,10 +1383,21 @@ class View3D extends Component {
startLoadExceptionArea: false,//隐藏marker
sideControlShow: false //隐藏耳朵
});
} else if (actionType === 'panoramicMonitor'){
this.props.editModelChange(true);
this.setState({
sideControlShow: true,//耳朵
startLoadExceptionArea: false, //隐藏marker
isShowActionBar: false, //隐藏工具栏
abnormalStatus: false //点告警状态
});
} else {
this.props.editModelChange(false);
this.setState({
isEditMode: false
isEditMode: false,
sideControlShow: false,
abnormalStatus: true
});
}
}
......@@ -1491,7 +1456,7 @@ class View3D extends Component {
}
initExceptionAreasData = ()=>{
this.setState({ startLoadExceptionArea: false },()=>{
this.setState({ startLoadExceptionArea: true },()=>{
this.getExceptionAreasList();
});
}
......@@ -1507,23 +1472,9 @@ class View3D extends Component {
return points.length > 0 && <PolygonRegion key={area.id} {...regionConf} points={points} onCreated={e=>this.onRectCreated(e,area,index)} />;
});
}
handleOutExceptModel=()=>{
this.executeOperate({ key: 'fitview' });//恢复正常视角
this.props.editModelChange(false);//显示全景统计
this.enableCamera();//恢复相机
this.setState({
treeData: [],
pageType: 'region',//区域
sideControlShow: false, //隐藏耳朵
isShowActionBar: true, //显示工具栏
startLoadExceptionArea: true, //显示marker,
headerName: '', //设置头名称
isEditMode: false, //推出编辑模式
errorAreaId: ''
});
}
handleExceptModel =(type,areaId)=>{
let { isPointSave,isAreaSave } = this.state;
let { isPointSave } = this.state;
this.clearMarkers();
if (type === 'into_except_model'){//进入耳朵模式
this.props.editModelChange(true);//隐藏全景统计
......@@ -1536,32 +1487,54 @@ class View3D extends Component {
});
} else if (type === 'out_except_model'){
this.stagePilot.positionCtl.clearDrag();
if(isAreaSave){
this.setState({promptData:
{
promptvisible:true,
promptContent:`要在退出之前保存对风险区域的更改吗?`,
type:'region',
btnType:'isSave',
isback:true
}
})
return
}else{
if (isPointSave){
this.setState({promptData:
{
promptvisible:true,
promptContent:`要在退出之前保存对风险点的更改吗?`,
type:'point',
btnType:'isSave',
isback:true
if (!isPointSave){
AmosAlert.confirm('提示', '有未保存数据,是否保存?', {
callback: (flag) => {
if (flag){
this.savePointData();
this.executeOperate({ key: 'fitview' });//恢复正常视角
this.props.editModelChange(false);//显示全景统计
this.setState({
treeData: [],
pageType: 'region',//区域
sideControlShow: false, //隐藏耳朵
isShowActionBar: true, //显示工具栏
startLoadExceptionArea: true, //显示marker,
headerName: '', //设置头名称
isEditMode: false, //推出编辑模式
errorAreaId: ''
});
} else {
this.props.editModelChange(false);//显示全景统计
this.setState({
isPointSave: true,
treeData: [],
pageType: 'region',//区域
sideControlShow: false, //隐藏耳朵
isShowActionBar: true, //显示工具栏
startLoadExceptionArea: true, //显示marker,
headerName: '', //设置头名称
isEditMode: false, //推出编辑模式
errorAreaId: ''
});
}
})
} else {
this.handleOutExceptModel()
}
}
});
} else {
this.props.editModelChange(false);//显示全景统计
this.enableCamera();//恢复相机
this.setState({
treeData: [],
pageType: 'region',//区域
sideControlShow: false, //隐藏耳朵
isShowActionBar: true, //显示工具栏
startLoadExceptionArea: true, //显示marker,
headerName: '', //设置头名称
isEditMode: false, //推出编辑模式
errorAreaId: ''
});
}
}
}
......@@ -1601,13 +1574,7 @@ class View3D extends Component {
// message.error('不能放置非所在区域');
// }
}
closePromptModal=()=>{
this.setState({
promptData:{promptvisible:false},
isPointSave:false,
isAreaSave:false,}
)
}
render() {
const {
objs,
......@@ -1628,8 +1595,7 @@ class View3D extends Component {
errorAreaId,
positionxyz,
rightHeight,
treeDataList,
promptData
treeDataList
} = this.state;
const { dimension, hiddenScreenSaver, editModelChange } = this.props;
const graphicProps = {
......@@ -1669,12 +1635,6 @@ class View3D extends Component {
return (
<div className='ModuleEditPage'>
<PromptModal promptData={promptData}
saveAreaData={this.saveAreaData}
handleOutExceptModel={this.handleOutExceptModel}
savePointData={this.savePointData}
closePromptModal={this.closePromptModal}/>
<div
className='designerBox'
onDragOver={(e) => {e.preventDefault();}}
......@@ -1774,7 +1734,6 @@ class View3D extends Component {
</div>
</div>
}
</div>
);
}
......
......@@ -81,14 +81,14 @@ export const viewController = [
export const actionBars = [
{ key: 'impEquipment-action', icon: 'impEquipment', type: 'impEquipment', singleClick: false, label: '重点设备',showLabel: true },
{ key: 'panoramic-action', icon: 'panoramic', type: 'panoramic', singleClick: false, label: '全景', showLabel: true },
{ key: 'burst-action', icon: 'burst', type: 'burst', singleClick: true, label: '分解' , showLabel: false },
{ key: 'panoramicMonitor-action', icon: 'burst', type: 'panoramicMonitor', singleClick: false, label: '全景监控' , showLabel: true },
{ key: 'fitview-action', icon: 'fitview', type: 'fitview', singleClick: true, label: '初始视图' , showLabel: false },
{ 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 bizControls = [
{ key: 'riskSource-point', icon: 'fengxiandian', type: 'riskSource', label: '风险点', subs: [
......@@ -114,10 +114,41 @@ export const bizControls = [
// { key: 'fireFoamRoom', label: '泡沫间' },
// { key: 'fireDetection', label: '火探' }
// ] },
// { key: 'monitorEquipment-point', icon: 'shujudian', type: 'monitorEquipment', label: '探测设备' },
{ key: 'monitorEquipment-point', icon: 'shujudian', type: 'monitorEquipment', label: '探测设备' }
// { key: 'monitor-point', icon: 'xunjiandian', type: 'video', label: '视频点' }
];
/**
* 全景监控模式模式
*/
export const pMonitorControls = [
{ key: 'riskSource-point', icon: 'fengxiandian', type: 'riskSource', label: '风险点', subs: [
{ key: 'level_1', label: '1级' },
{ key: 'level_2', label: '2级' },
{ key: 'level_3', label: '3级' },
{ key: 'level_4', label: '4级' },
{ key: 'level_5', label: '5级' }
] },
{ key: 'risk-point', icon: 'dianwei-zhongdianshebei', type: 'patrol', label: '巡检点',subs: [
{ key: 'level_3', label: '漏检' },
{ key: 'level_2', label: '不合格' },
{ key: 'level_1', label: '合格' },
{ key: 'level_0', label: '未计划' }
] },
{ key: 'impEquipment-point', icon: 'zhongdianshebeixiangqing', type: 'impEquipment', label: '重点设备' },
{ key: 'fireResource-point', icon: 'xiaofang', type: 'fireResource', label: '消防设备', subs: [
{ key: 'hydrant', label: '消防栓' },
{ key: 'pool', label: '消防水池' },
{ key: 'fireCar', label: '消防车' },
{ key: 'fireEquipment', label: '灭火器' },
{ key: 'fireChamber', label: '消防室' },
{ key: 'fireFoamRoom', label: '泡沫间' },
{ key: 'fireDetection', label: '火探' }
] },
{ key: 'monitorEquipment-point', icon: 'shujudian', type: 'monitorEquipment', label: '探测设备' },
{ key: 'monitor-point', icon: 'xunjiandian', type: 'video', label: '视频点' }
];
export const bizControlsTypes = [
{ key: 'riskSource', label: '风险点' },
......
......@@ -47,6 +47,7 @@ export const eventTopics = {
point_change: 'base3d.view.point_change', // marker 点变化
batch_point_change: 'base3d.view.batch_point_change', // 批量 marker 点变化
linkdata_change: 'base3d.view.linkdata_change', // marker 点变化
point_position_change: 'base3d.view.point_change', // marker 点变化
point_patrol: 'base3d.view.point_patrol', // 巡检点
point_risk: 'base3d.view.point_risk', // 风险点
......@@ -65,6 +66,7 @@ export const eventTopics = {
broadcast_fresh: 'base3d.view.broadcast_fresh',//执行步骤数据刷新
view_fresh: 'base3d.view.view_fresh',//视图刷新
fromws: 'base3d.fromws',
exceptionAreas_fresh: 'base3d.view.exceptionAreas_fresh',//异常区域刷新
datapane_msg: 'base3d.fromws.datapane_msg', // datapane 消息
......
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Connect, Button, Input, Form, Radio } from 'amos-framework';
import { PubSub } from 'ray-eventpool';
import { getPointTreeDetailAction } from '../../services/moduleEditServices';
import { eventTopics } from './../consts';
const eventConnect = Connect.eventConnect;
const FormItem = Form.Item;
......@@ -88,6 +90,7 @@ class RightEditPointPanel extends Component {
mreageMarkerPosition = ( position ) => {
const { detailData } = this.state;
PubSub.publish(eventTopics.point_position_change, { id: detailData.id, position });
this.props.changeMarkersData(position,detailData.type,detailData.id);
}
......
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { PubSub } from 'ray-eventpool';
import EquipStatusList from './EquipStatusList';
import SafetyExecuteList from './SafetyExecuteList';
import SafetyIndex from './SafetyIndex';
......@@ -8,6 +9,7 @@ import StatisticsCheck from './StatisticsCheck';
import StatisticsDuty from './StatisticsDuty';
import AmosWebSocket from 'amos-websocket';
import SysWsURL, { completeToken } from './../../../consts/wsUrlConsts';
import { eventTopics } from './../../consts';
/**
* 全景监控统计
......@@ -40,7 +42,7 @@ export default class Statistical extends Component {
break;
case 'error_status':
console.log('异常区域刷新~~~~~~~~~~~~~~~~~~~~');
this.props.refshExceptAreaData && this.props.refshExceptAreaData();
PubSub.publish(eventTopics.exceptionAreas_fresh, {});
break;
case 'week_safety_index':
console.log('一周安全指数趋势刷新~~~~~~~~~~~~~~~~~~~~');
......
......@@ -23,8 +23,6 @@ export const RiskPoint = marker3DFactory(BasicPoint,
useModel: true,
objPath: '/mods/components/3dviewConvertor/threeres/marker-models/riskSource/{url}.obj',
mtlPath: '/mods/components/3dviewConvertor/threeres/marker-models/riskSource/{url}.mtl'
// objPath: '/mods/components/3dviewConvertor/threeres/marker-models/riskSource/riskSource-1.obj',
// mtlPath: '/mods/components/3dviewConvertor/threeres/marker-models/riskSource/riskSource-1.mtl'
}
}
);
......@@ -83,9 +81,14 @@ export const ProbePoint = marker3DFactory(BasicPoint,
/**
* 消防资源
*/
export const FireResourcePoint = markerFactory(BasicPoint,
export const FireResourcePoint = marker3DFactory(BasicPoint,
{
markerType: 'fireResource'
markerType: 'fireResource',
markerParams: {
useModel: true,
objPath: '/mods/components/3dviewConvertor/threeres/marker-models/fireResource/{type}.obj',
mtlPath: '/mods/components/3dviewConvertor/threeres/marker-models/fireResource/{type}.mtl'
}
}
);
......
......@@ -18,15 +18,6 @@ const getIcon = (markerType, level) => {
return marker3DIoncMapper[`${markerType}`]
};
const createMarkerLabel = (text) => {
const div = document.createElement('div');
div.style.position = 'absolute';
div.style.marginTop = '-3rem';
div.className = 'three-ui-anchor';
div.innerText = text;
return div;
};
export default function marker3DFactory(WrappedComponent = 'div', options){
const { markerType, markerParams } = options;
class MarkerPoints extends Component {
......@@ -45,26 +36,23 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
// dblclick: this.onMarkerDblClick,
dragend: this.markerDragend,
mouseover: (marker) => {
console.log('111')
if(marker.object2DPipe){
if (marker.object2DPipe){
marker.object2DPipe.pipeNode.visible = true;
marker.object2DPipe.pipeNode.elementVisible = true;
marker.object2DPipe.toggleDisplay(true);
}
if(marker.extData.type === 'riskSource'){
marker.baseObjHelper.title = marker.extData.name;
marker.object2DPipe && marker.object2DPipe.toggleDisplay(true);
if (!this.props.isEditMode) {
this.setTopCardConf(marker, marker.extData);
}
},
mouseout: (marker) => {
if(marker.object2DPipe){
if (marker.object2DPipe){
marker.object2DPipe.pipeNode.visible = false;
marker.object2DPipe.pipeNode.elementVisible = false;
marker.object2DPipe.toggleDisplay(false);
}
if(marker.extData.type === 'riskSource'){
marker.baseObjHelper.title = marker.extData.title;
marker.object2DPipe.toggleDisplay(false);
if (!this.props.isEditMode) {
marker.baseObjHelper.title = null;
}
}
};
......@@ -78,7 +66,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
}
componentWillReceiveProps = nextProps => {
if(nextProps.isEditMode){
if ( nextProps.isEditMode ){
this.markersCache.eachValue(obj=>{
// this.setTopCardConf(obj, obj.extData);
if(nextProps.selectPoints.type == obj.extData.type && nextProps.selectPoints.id ==obj.extData.id ){
......@@ -95,7 +83,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
onMarkerDblClick = (marker, e) => {
console.log('marker3DFactory','onMarkerDblClick')
if (this.props.isEditMode) {
return false
return false;
}
clearTimeout(this.time);
// tirggerPlanTopic(CONSTS.plan_detail, { type: marker.extData.type, data: marker.extData });
......@@ -109,7 +97,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
onMarkerClick = (marker, e) => {
const { isClick } = this.state;
if (this.props.isEditMode) {
return false
return false;
}
tirggerPlanTopic(CONSTS.plan_detail, { type: marker.extData.type, data: marker.extData });
......@@ -117,7 +105,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
this.setState({ isClick: false }); //将isClick 变成false,将不会执行处理事件
// this.pdRef && this.pdRef.onOpenClick(marker);
this.time = setTimeout(() => this.pdRef && this.pdRef.onOpenClick(marker), 1000);
}else{
} else {
this.onMarkerDblClick(marker, e);
}
const that = this; // 为定时器中的setState绑定this
......@@ -139,8 +127,10 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
this.stagePilot = this.props.stagePilot;
this.outlineHelper = this.stagePilot ? this.stagePilot.outlineHelper : undefined;
markersCache.eachValue(obj=>{
this.setTopCardConf(obj, obj.extData);
if(obj.extData.type === "riskSource" && markerType != 'impEquipmentMode' && !isEditMode){
if (isEditMode){
this.setTopCardConf(obj, obj.extData);
}
if (obj.extData.type === 'riskSource' && markerType !== 'impEquipmentMode' && !isEditMode){
this.setTwinkleConf(obj);
}
});
......@@ -148,8 +138,8 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
setTwinkleConf = ( obj ) => {
const { twinkle,frequency } = obj.extData;
let pulsePeriod = (twinkle && frequency != 0 ? 1 / frequency : null)
let color = twinkle && frequency != 0 ? '#FF0000': null;
let pulsePeriod = (twinkle && frequency !== 0 ? 1 / frequency : null);
let color = twinkle && frequency !== 0 ? '#FF0000' : null;
if (!obj.baseObjHelper.outlineHelper){
obj.baseObjHelper.setOutlineHelper(this.outlineHelper);
}
......@@ -160,7 +150,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
}
setTopCardConf = (obj, extData )=>{
const { title, label , type, showInfo , name } = extData;
const { title , name } = extData;
let cardTitle = null;
console.log(extData)
obj.baseObjHelper.titleConfig = {
......@@ -182,11 +172,11 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
imgHeight: 128,
image: markerTitleBgMapper['base']
};
if(type === 'riskSource' && !this.props.isEditMode){
cardTitle = '风险值' + title
}else{
cardTitle = name ? name : title;
}
// if (type === 'riskSource' && !this.props.isEditMode){
// cardTitle = '风险值' + title
// }else{
cardTitle = name ? name : title;
// }
obj.baseObjHelper.title = cardTitle;
}
......@@ -200,15 +190,17 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
position = Object.values(m.position);
}
for (let k of Object.keys(defaultParams)) {
if((markerType === 'riskSource' || markerType === 'patrol' ) && k != 'useModel' && !isEditMode){
if ((markerType === 'riskSource' || markerType === 'patrol' ) && k !== 'useModel' && !isEditMode){
m[k] = formatUrl(defaultParams[k], { url: `${markerType}-${m.level}` });
}else if((markerType === 'riskSource' || markerType === 'patrol' ) && k != 'useModel' && isEditMode){
if(markerType === 'riskSource'){
} else if ((markerType === 'riskSource' || markerType === 'patrol' ) && k !== 'useModel' && isEditMode){
if (markerType === 'riskSource'){
m[k] = formatUrl(defaultParams[k], { url: `${markerType}-4` });
}else{
} else {
m[k] = formatUrl(defaultParams[k], { url: `${markerType}-1` });
}
}else{
} else if (markerType === 'fireResource' && k !== 'useModel') {
m[k] = formatUrl(defaultParams[k], { type: `${m.type}` });
} else {
m[k] = defaultParams[k];
}
}
......
......@@ -4,7 +4,7 @@ import { SidePane } from 'amos-framework';
import { Store } from 'amos-tool';
import BizControlPane from './BizControlPane';
import InnateControlPane from './InnateControlPane';
import { viewController, bizControls } from './../conf';
import { viewController, bizControls, pMonitorControls } from './../conf';
const loginUserName = Store.lsTool.read('userName');
const filterUser = ['tianbo', 'opera1', 'opera2'];
......@@ -54,8 +54,8 @@ class SideControl extends Component {
};
render() {
const { layerConfig, animationProps } = this.props;
let _bizControls = bizControls;
const { layerConfig, animationProps, activeAction } = this.props;
let _bizControls = activeAction === 'panoramic' ? bizControls : pMonitorControls;
if (filterUser.includes(loginUserName)) {
let target = _bizControls.find(item => item.key === 'fireResource-point');
let subControls = target.subs;
......
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