Commit 3758a306 authored by suhuiguang's avatar suhuiguang

1.消防安全执行 列表双击事件

parent 336faae8
...@@ -35,7 +35,7 @@ export const EVENTS_CONSTS = { ...@@ -35,7 +35,7 @@ export const EVENTS_CONSTS = {
ROUTE_LINE_CHANGE: 'route_line_change', // 线路切换 ROUTE_LINE_CHANGE: 'route_line_change', // 线路切换
// -- 场景处理 -- // -- 场景处理 --
STAGE_CAMERA_INFO: 'stage_camera_info' // 场景摄像机信息同步 STAGE_CAMERA_INFO: 'stage_camera_info', // 场景摄像机信息同步
}; };
/** /**
......
...@@ -130,7 +130,7 @@ export const FasSerUrl = { ...@@ -130,7 +130,7 @@ export const FasSerUrl = {
export const ModuleEditUrl = { export const ModuleEditUrl = {
getAreaTreeUrl: completePrefix(convertorURI, 'api/view3d/region/tree'),// getAreaTreeUrl: completePrefix(convertorURI, 'api/view3d/region/tree'),//
getAreaTreeDetailUrl: completePrefix(convertorURI, 'api/view3d/region/detail'),// getAreaTreeDetailUrl: completePrefix(convertorURI, 'api/view3d/region/detail'),//
getPointTreeDetailUrl: completePrefix(convertorURI, 'api/view3d/point/detail?type={type}&pointId={pointId}'),// getPointDetailUrl: completePrefix(convertorURI, 'api/view3d/point/detail?type={type}&pointId={pointId}'),//
getPointTreeUrl: completePrefix(convertorURI, 'api/view3d/point/tree'), getPointTreeUrl: completePrefix(convertorURI, 'api/view3d/point/tree'),
saveAreaDataUrl: completePrefix(convertorURI, 'api/view3d/region/bind'),// saveAreaDataUrl: completePrefix(convertorURI, 'api/view3d/region/bind'),//
getPointTypeUrl: completePrefix(convertorURI, 'api/view3d/point/type'), getPointTypeUrl: completePrefix(convertorURI, 'api/view3d/point/type'),
......
import formatUrl from 'amos-processor/lib/utils/urlFormat'; import formatUrl from 'amos-processor/lib/utils/urlFormat';
import * as helper from 'base-r3d/lib/utils/helper';
// import { helper } from 'amos-3d/lib/threeTools';
import { ModuleEditUrl } from './../consts/urlConsts'; import { ModuleEditUrl } from './../consts/urlConsts';
import { commonGet, commonPost, singleFetch } from './../utils/request'; import { commonGet, commonPost, singleFetch } from './../utils/request';
export const downloadBasicScene = (modelURI) => { export const downloadBasicScene = modelURI => {
if (!modelURI.endsWith('.json')){ if (!modelURI.endsWith('.json')) {
modelURI += '/index.json'; modelURI += '/index.json';
} }
return singleFetch(modelURI); return singleFetch(modelURI);
}; };
/** /**
* 通过 subjectId 获取场景配置信息 * 通过 subjectId 获取场景配置信息
* @param {String} subjectId * @param {String} subjectId
*/ */
export const getDesignerParamAction = (subjectId) => { export const getDesignerParamAction = subjectId => {
// return singleFetch('/_mock/empty.json'); // return singleFetch('/_mock/empty.json');
// return singleFetch('/_mock/plant.json'); // return singleFetch('/_mock/plant.json');
// return commonGet('/_mock/plant.json'); // return commonGet('/_mock/plant.json');
...@@ -32,47 +30,43 @@ export const saveDesignAction = object => { ...@@ -32,47 +30,43 @@ export const saveDesignAction = object => {
}; };
export const getAreaTreeAction = () => { export const getAreaTreeAction = () => {
return commonGet(ModuleEditUrl.getAreaTreeUrl); return commonGet(ModuleEditUrl.getAreaTreeUrl);
} };
export const getAreaTreeDetailAction = (id) => { export const getPointDetailAction = (pointId, type) => {
return commonGet(`${ModuleEditUrl.getPointTreeDetailUrl}/${id}`); return commonGet(formatUrl(ModuleEditUrl.getPointDetailUrl, { pointId, type }));
} };
export const getPointTreeDetailAction = (pointId, type ) => { export const getPointTreeAction = type => {
return commonGet(formatUrl(ModuleEditUrl.getPointTreeDetailUrl,{ pointId, type }));
}
export const getPointTreeAction = (type) => {
return commonGet(`${ModuleEditUrl.getPointTreeUrl}/${type}`); return commonGet(`${ModuleEditUrl.getPointTreeUrl}/${type}`);
} };
/** /**
* 保存区域 * 保存区域
* @param {*} routePathParams * @param {*} routePathParams
*/ */
export const saveAreaDataAction = (routePathParams) => { export const saveAreaDataAction = routePathParams => {
return commonPost(ModuleEditUrl.saveAreaDataUrl, routePathParams); return commonPost(ModuleEditUrl.saveAreaDataUrl, routePathParams);
} };
export const getPointTypeAction = () => { export const getPointTypeAction = () => {
return commonGet(ModuleEditUrl.getPointTypeUrl); return commonGet(ModuleEditUrl.getPointTypeUrl);
} };
/** /**
* 获取风险点 * 获取风险点
* @param {点类型} type * @param {点类型} type
* @param {区域id} riskSourceId * @param {区域id} riskSourceId
*/ */
export const getPointListAction = (type,riskSourceId) => { export const getPointListAction = (type, riskSourceId) => {
if (type) { if (type) {
return commonGet(`${ModuleEditUrl.getPointListUrl}?type=${type}&riskSourceId=${riskSourceId}`); return commonGet(`${ModuleEditUrl.getPointListUrl}?type=${type}&riskSourceId=${riskSourceId}`);
} else { } else {
return commonGet(`${ModuleEditUrl.getPointListUrl}`); return commonGet(`${ModuleEditUrl.getPointListUrl}`);
} }
};
}
/** /**
* 保存风险点 * 保存风险点
* @param {*} bindParams * @param {*} bindParams
*/ */
export const savePointListAction = (bindParams) => { export const savePointListAction = bindParams => {
return commonPost(ModuleEditUrl.savePointListUrl, bindParams); return commonPost(ModuleEditUrl.savePointListUrl, bindParams);
} };
...@@ -156,8 +156,9 @@ ...@@ -156,8 +156,9 @@
} }
.title-child { .title-child {
border-bottom: 1px solid rgba(196, 86, 86, 0.3);
padding-top: 7px; padding-top: 7px;
cursor: pointer;
border-bottom: 1px solid rgba(196, 86, 86, 0.3);
} }
} }
} }
......
...@@ -49,7 +49,6 @@ class MaskContent extends Component { ...@@ -49,7 +49,6 @@ class MaskContent extends Component {
}; };
actionBarClick = ({ singleClick, type, label, showLabel }) => { actionBarClick = ({ singleClick, type, label, showLabel }) => {
if (!singleClick){//设置选中状态 if (!singleClick){//设置选中状态
this.setState({ activeAction: type }); this.setState({ activeAction: type });
} }
......
...@@ -50,7 +50,6 @@ class PointsPool extends Component { ...@@ -50,7 +50,6 @@ class PointsPool extends Component {
// } // }
// } // }
// }); // });
this.props.subscribe(eventTopics.point_position_change, (topic, data) => { this.props.subscribe(eventTopics.point_position_change, (topic, data) => {
changeMarkerPosition(this, topic, data); changeMarkerPosition(this, topic, data);
}); });
...@@ -60,6 +59,9 @@ class PointsPool extends Component { ...@@ -60,6 +59,9 @@ class PointsPool extends Component {
this.markerList[type] = markersCache; this.markerList[type] = markersCache;
(markersCache || []).forEach(mc => { (markersCache || []).forEach(mc => {
const extData = mc.getExtData(); const extData = mc.getExtData();
if (extData.isNeedFocus) {//控制安全执行类表双击最佳视角
this.props.focusObject && this.props.focusObject(mc.node);
}
if (extData.hasOwnProperty('visible')){ if (extData.hasOwnProperty('visible')){
let visible = extData.visible; let visible = extData.visible;
if (visible) { if (visible) {
...@@ -107,11 +109,6 @@ class PointsPool extends Component { ...@@ -107,11 +109,6 @@ class PointsPool extends Component {
selectPoints={this.props.selectPoints} selectPoints={this.props.selectPoints}
showRightPanelOnclick={(d)=>this.props.showRightPanelOnclick(d)} showRightPanelOnclick={(d)=>this.props.showRightPanelOnclick(d)}
/> />
{/* <PatrolPoint
{...rest}
markers={markers.risk}
onCreated={(val) => this.onMarkersCreated('risk', val)}
/> */}
<PatrolPoint <PatrolPoint
{...rest} {...rest}
markers={markers.patrol} markers={markers.patrol}
...@@ -259,7 +256,8 @@ PointsPool.propTypes = { ...@@ -259,7 +256,8 @@ PointsPool.propTypes = {
selectPoints: PropTypes.object, selectPoints: PropTypes.object,
stagePilot: PropTypes.object, stagePilot: PropTypes.object,
addMarker: PropTypes.func, addMarker: PropTypes.func,
showRightPanelOnclick: PropTypes.func showRightPanelOnclick: PropTypes.func,
focusObject: PropTypes.func
}; };
......
...@@ -23,7 +23,8 @@ import { ...@@ -23,7 +23,8 @@ import {
tirggerTransTopic, tirggerTransTopic,
cacheObjsSave, cacheObjsSave,
flyToSubView, flyToSubView,
convertMarkerType convertMarkerType,
showSelectMarkerPoint
} from './dataProcessor'; } from './dataProcessor';
import { import {
dealTroubleMarkers, dealTroubleMarkers,
...@@ -258,14 +259,12 @@ class View3D extends Component { ...@@ -258,14 +259,12 @@ class View3D extends Component {
} }
_registerEvents = () => { _registerEvents = () => {
this.r3d.on('dbclick', evt => { this.r3d.on('dbclick', evt => {
if (evt.button !== 0) { if (evt.button !== 0) {
return; return;
} }
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
...@@ -290,7 +289,6 @@ class View3D extends Component { ...@@ -290,7 +289,6 @@ class View3D extends Component {
if (isControllerEvent(topic)) { if (isControllerEvent(topic)) {
executeView3dCMD(this, topic, data); executeView3dCMD(this, topic, data);
} else if (isManualOperate(topic)) { } else if (isManualOperate(topic)) {
parseManual(this, topic, data); parseManual(this, topic, data);
} else if (topic === eventTopics.show_fire_equip) { } else if (topic === eventTopics.show_fire_equip) {
this.asyncLoadMarkerData('fireResource'); this.asyncLoadMarkerData('fireResource');
...@@ -298,6 +296,8 @@ class View3D extends Component { ...@@ -298,6 +296,8 @@ class View3D extends Component {
this.viewFreshInit(); this.viewFreshInit();
} else if (topic === eventTopics.exceptionAreas_fresh) { } else if (topic === eventTopics.exceptionAreas_fresh) {
this.initExceptionAreasData(); this.initExceptionAreasData();
} else if (topic === eventTopics.safety_db_select) {
showSelectMarkerPoint(this,data.target);
} }
}); });
}; };
...@@ -1845,7 +1845,7 @@ class View3D extends Component { ...@@ -1845,7 +1845,7 @@ class View3D extends Component {
> >
{startAsyncLoad && this.multLoadWorkerObjContent(asyncModels)} {startAsyncLoad && this.multLoadWorkerObjContent(asyncModels)}
{isEditMode && pageType === 'region' ? '' : {isEditMode && pageType === 'region' ? '' :
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} />} 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} focusObject={this.focusObject} />}
{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()}
......
...@@ -81,7 +81,7 @@ export const viewController = [ ...@@ -81,7 +81,7 @@ export const viewController = [
export const actionBars = [ export const actionBars = [
{ key: 'impEquipment-action', icon: 'impEquipment', type: 'impEquipment', singleClick: false, label: '重点设备',showLabel: true }, { 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: 'panoramic-action', icon: 'panoramic', type: 'panoramic', singleClick: false, label: '全景', showLabel: true },
{ key: 'panoramicMonitor-action', icon: 'burst', type: 'panoramicMonitor', singleClick: false, label: '全景监控' , showLabel: true }, { 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: 'fitview-action', icon: 'fitview', type: 'fitview', singleClick: true, label: '初始视图' , showLabel: false },
{ 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 }
......
...@@ -67,9 +67,8 @@ export const eventTopics = { ...@@ -67,9 +67,8 @@ export const eventTopics = {
view_fresh: 'base3d.view.view_fresh',//视图刷新 view_fresh: 'base3d.view.view_fresh',//视图刷新
fromws: 'base3d.fromws', fromws: 'base3d.fromws',
exceptionAreas_fresh: 'base3d.view.exceptionAreas_fresh',//异常区域刷新 exceptionAreas_fresh: 'base3d.view.exceptionAreas_fresh',//异常区域刷新
safety_db_select: 'base3d.view.safety_db_select', // 安全执行列表双击选中
datapane_msg: 'base3d.fromws.datapane_msg', // datapane 消息 datapane_msg: 'base3d.fromws.datapane_msg', // datapane 消息
broad_msg: 'base3d.fromws.broad_msg', // 播报消息 broad_msg: 'base3d.fromws.broad_msg', // 播报消息
global_msg: 'base3d.fromws.global_msg', // 全局消息 global_msg: 'base3d.fromws.global_msg', // 全局消息
...@@ -88,9 +87,10 @@ export const eventTopics = { ...@@ -88,9 +87,10 @@ export const eventTopics = {
top_afe_msg: 'base3d.fromws.top_alarm_fire_equip_msg', //顶部传感器报警消息 top_afe_msg: 'base3d.fromws.top_alarm_fire_equip_msg', //顶部传感器报警消息
top_ae_msg: 'base3d.fromws.top_alarm_equip_msg', //顶部重点装备报警提醒消息 top_ae_msg: 'base3d.fromws.top_alarm_equip_msg', //顶部重点装备报警提醒消息
plan_task_list:'biz.planDrill.task_tabs_show',//预案演练任务列表展开事件 plan_task_list: 'biz.planDrill.task_tabs_show',//预案演练任务列表展开事件
plan_tree_view:'biz.planDrill.plan_tree_view',//预案树展开事件 plan_tree_view: 'biz.planDrill.plan_tree_view',//预案树展开事件
plan_drill_appId:'biz.planDrill.plan_drill_app_id',//预案选择节点 plan_drill_appId: 'biz.planDrill.plan_drill_app_id' //预案选择节点
}; };
export const isPointEvent = (topic) => topic.indexOf('.point_') > -1; export const isPointEvent = (topic) => topic.indexOf('.point_') > -1;
......
...@@ -5,6 +5,7 @@ import { PubSub } from 'ray-eventpool'; ...@@ -5,6 +5,7 @@ import { PubSub } from 'ray-eventpool';
import { transitionHelper } from 'amos-3d/lib/helpers'; import { transitionHelper } from 'amos-3d/lib/helpers';
import { eventTopics, pointTopicMapping, operateTypes } from './consts'; import { eventTopics, pointTopicMapping, operateTypes } from './consts';
import { searchLinkAction } from './../services/3dService'; import { searchLinkAction } from './../services/3dService';
import { getPointDetailAction } from './../services/moduleEditServices';
import conf from './conf'; import conf from './conf';
// import { lineData } from './datas'; // import { lineData } from './datas';
...@@ -33,6 +34,15 @@ export const tirggerPlanTopic = (type, data) => { ...@@ -33,6 +34,15 @@ export const tirggerPlanTopic = (type, data) => {
}; };
/** /**
* 通用消息发送
* @param {String} type
* @param {object} data
*/
export const commonPublishTopic = (type,data)=>{
PubSub.publish(type,data);
};
/**
* 触发线路数据变化 * 触发线路数据变化
* @param {Array} links * @param {Array} links
*/ */
...@@ -72,12 +82,6 @@ export const parseSearchMenuMarkers = (instance, content) => { ...@@ -72,12 +82,6 @@ export const parseSearchMenuMarkers = (instance, content) => {
instance.setState({ instance.setState({
markers: { 'riskSource': [],'patrol': [],'impEquipment': [],'monitorEquipment': [],'video': [],'fireEquipment': [],'person': [],'pool': [],'hydrant': [],'fireChamber': [],'fireCar': [],'fire': [],'fireDetection': [],'fireFoamRoom': [],'risk': [],'data': [],'room': [],'statistics': [],'impEquipmentMode': [] } markers: { 'riskSource': [],'patrol': [],'impEquipment': [],'monitorEquipment': [],'video': [],'fireEquipment': [],'person': [],'pool': [],'hydrant': [],'fireChamber': [],'fireCar': [],'fire': [],'fireDetection': [],'fireFoamRoom': [],'risk': [],'data': [],'room': [],'statistics': [],'impEquipmentMode': [] }
}); });
// if (content.length === 0){
// instance.setState({
// markers: { 'riskSource': [],'patrol': [],'impEquipment': [],'monitorEquipment': [],'video': [],'fireEquipment': [],'person': [],'pool': [],'hydrant': [],'fireChamber': [],'fireCar': [],'fire': [],'fireDetection': [],'fireFoamRoom': [],'risk': [],'data': [],'room': [],'statistics': [],'impEquipmentMode': [] }
// });
// return ;
// }
console.log(JSON.stringify(markers)); console.log(JSON.stringify(markers));
content.map( (item) => { content.map( (item) => {
const { type } = item; const { type } = item;
...@@ -421,3 +425,39 @@ export const convertMarkerType = (type) => { ...@@ -421,3 +425,39 @@ export const convertMarkerType = (type) => {
const fireEquipmentStr = 'fireCar,fireEquipment,fireChamber,fireFoamRoom,hydrant,pool'; const fireEquipmentStr = 'fireCar,fireEquipment,fireChamber,fireFoamRoom,hydrant,pool';
return fireEquipmentStr.indexOf(type) > -1 ? 'fireEquipment' : type ; return fireEquipmentStr.indexOf(type) > -1 ? 'fireEquipment' : type ;
}; };
/**
* 显示选中的点
* @param {object} instance
* @param {object} param
*/
export const showSelectMarkerPoint = (instance, { pointId, type })=>{
getPointDetailAction(pointId, type).then(data=>{
const { markers } = instance.state;
const newMarkers = markers[type];
if (!newMarkers.some(item => item.pointId === pointId && item.type === type)) {
data.position3d.length > 0 && newMarkers.push({
id: pointId,
key: `${type}_${pointId}`,
position: data.position3d,
name: data.name,
level: data.level,
type
});
const arry = newMarkers.map(ma => {
if (ma.id === pointId) {
return {
...ma,
isNeedFocus: true
};
}
return {
...ma,
isNeedFocus: false
};
});
markers[type] = arry;
instance.setState({ markers });
}
});
};
import React, { Component } from 'react'; import React, { Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Connect, Button, Input, Form, Radio } from 'amos-framework'; import { Button, Input, Form, Radio } from 'amos-framework';
import { PubSub } from 'ray-eventpool'; import { getPointDetailAction } from '../../services/moduleEditServices';
import { getPointTreeDetailAction } from '../../services/moduleEditServices';
import { eventTopics } from './../consts'; import { eventTopics } from './../consts';
import imgStatic from '../../consts/imgStatic'; import imgStatic from '../../consts/imgStatic';
import { commonPublishTopic } from './../dataProcessor';
const moduleEditIcon = imgStatic.moduleEditIcon; const moduleEditIcon = imgStatic.moduleEditIcon;
const eventConnect = Connect.eventConnect;
const FormItem = Form.Item; const FormItem = Form.Item;
const RadioGroup = Radio.Group; const RadioGroup = Radio.Group;
@eventConnect
class RightEditPointPanel extends Component { class RightEditPointPanel extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -25,12 +22,11 @@ class RightEditPointPanel extends Component { ...@@ -25,12 +22,11 @@ class RightEditPointPanel extends Component {
positionY: '', positionY: '',
positionZ: '' positionZ: ''
}; };
} }
componentDidMount() { componentDidMount() {
const { detailData } = this.props; const { detailData } = this.props;
getPointTreeDetailAction(detailData.id, detailData.type).then(data => { getPointDetailAction(detailData.id, detailData.type).then(data => {
this.setState({ this.setState({
detailData: data || [], detailData: data || [],
positionX: detailData.position.length > 0 ? detailData.position[0] : '', positionX: detailData.position.length > 0 ? detailData.position[0] : '',
...@@ -42,8 +38,8 @@ class RightEditPointPanel extends Component { ...@@ -42,8 +38,8 @@ class RightEditPointPanel extends Component {
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
const { detailData } = nextProps; const { detailData } = nextProps;
getPointTreeDetailAction(detailData.id, detailData.type).then(data => { getPointDetailAction(detailData.id, detailData.type).then(data => {
if (detailData.position){ if (detailData.position) {
data.position = detailData.position; data.position = detailData.position;
} }
this.setState({ this.setState({
...@@ -61,43 +57,43 @@ class RightEditPointPanel extends Component { ...@@ -61,43 +57,43 @@ class RightEditPointPanel extends Component {
this.setState({ this.setState({
form: newForm form: newForm
}); });
} };
onRadioChange = (value) => { onRadioChange = value => {
const newForm = Object.assign({}, this.state.form, { 'isIndoor': value }); const newForm = Object.assign({}, this.state.form, { isIndoor: value });
this.setState({ this.setState({
form: newForm form: newForm
}); });
} };
onHobbyChange = (value, item) => { onHobbyChange = (value, item) => {
const newForm = Object.assign({}, this.state.form, { 'level': value }); const newForm = Object.assign({}, this.state.form, { level: value });
this.setState({ this.setState({
form: newForm form: newForm
}); });
} };
onChangePosition = ( inputType , value ) => { onChangePosition = (inputType, value) => {
let { positionX, positionY, positionZ } = this.state; let { positionX, positionY, positionZ } = this.state;
if (inputType === 'positionX'){ if (inputType === 'positionX') {
positionX = Number(value); positionX = Number(value);
} else if (inputType === 'positionY'){ } else if (inputType === 'positionY') {
positionY = Number(value); positionY = Number(value);
} else { } else {
positionZ = Number(value); positionZ = Number(value);
} }
const position = [positionX,positionY,positionZ]; const position = [positionX, positionY, positionZ];
this.mreageMarkerPosition(position); this.mreageMarkerPosition(position);
} };
mreageMarkerPosition = ( position ) => { mreageMarkerPosition = position => {
const { detailData } = this.state; const { detailData } = this.state;
PubSub.publish(eventTopics.point_position_change, { id: detailData.id, type: detailData.type , position }); commonPublishTopic(eventTopics.point_position_change, { id: detailData.id, type: detailData.type, position });
this.props.changeMarkersData(position,detailData.type,detailData.id); this.props.changeMarkersData(position, detailData.type, detailData.id);
} };
render() { render() {
let { rules,form,detailData } = this.state; let { rules, form, detailData } = this.state;
let radio = detailData.isIndoor ? 'prop1' : 'prop2'; let radio = detailData.isIndoor ? 'prop1' : 'prop2';
const formItemLayout = { const formItemLayout = {
labelCol: { labelCol: {
...@@ -105,118 +101,111 @@ class RightEditPointPanel extends Component { ...@@ -105,118 +101,111 @@ class RightEditPointPanel extends Component {
sm: { span: 3 }, sm: { span: 3 },
className: 'colspanlab' className: 'colspanlab'
} }
} };
return ( return (
<div className="rightEditPanel"> <div className="rightEditPanel">
<div className='rightContainer'> <div className="rightContainer">
<Form className="basic-demo" ref={component => this.form = component} model={form} rules={rules}> <Form className="basic-demo" ref={component => (this.form = component)} model={form} rules={rules}>
<div className='topForm'> <div className="topForm">
<div className='rightTitle'> <div className="rightTitle">
<img src={moduleEditIcon.rightModalTitleIcon} alt='' /> <img src={moduleEditIcon.rightModalTitleIcon} alt="" />
<span className='titleText'>风险点信息</span> <span className="titleText">风险点信息</span>
</div> </div>
<div className='baseMsg'> <div className="baseMsg">
<div className='moduleTitle'> <div className="moduleTitle">
<img src={moduleEditIcon.rightBaseMsgIcon} alt='' /> <img src={moduleEditIcon.rightBaseMsgIcon} alt="" />
<span className='titleText'>基本信息</span> <span className="titleText">基本信息</span>
</div> </div>
<div className='moduleContent'> <div className="moduleContent">
<div className='msgItem'> <div className="msgItem">
<div className='itemLabel'>风险名称</div> <div className="itemLabel">风险名称</div>
<FormItem field="name" > <FormItem field="name">
<Input value={detailData.name} disabled /> <Input value={detailData.name} disabled />
</FormItem> </FormItem>
</div> </div>
<div className='msgItem'> <div className="msgItem">
<div className='itemLabel'>参考编号</div> <div className="itemLabel">参考编号</div>
<FormItem field="code" > <FormItem field="code">
<Input <Input onChange={e => this.onChange('name', e)} value={detailData.code} disabled />
onChange={(e) => this.onChange('name', e)}
value={detailData.code}
disabled
/>
</FormItem> </FormItem>
</div> </div>
<div className='msgItem'> <div className="msgItem">
<div className='itemLabel'>风险等级</div> <div className="itemLabel">风险等级</div>
<FormItem field="level" > <FormItem field="level">
<Input value={detailData.level} disabled /> <Input value={detailData.level} disabled />
</FormItem> </FormItem>
</div>
</div>
</div> </div>
</div> </div>
<div className='3dMsg'> <div className="3dMsg">
<div className='moduleTitle'> <div className="moduleTitle">
<span className='titleIcon'></span> <span className="titleIcon"/>
<span className='titleText'>三维信息</span> <span className="titleText">三维信息</span>
</div> </div>
<div className='moduleContent'> <div className="moduleContent">
<div className='msgItem'> <div className="msgItem">
<div className='itemLabel'>三维坐标</div> <div className="itemLabel">三维坐标</div>
<div className='position'> <div className="position">
<div className='positionItem'> <div className="positionItem">
<FormItem label="X" field="positionX" {...formItemLayout}> <FormItem label="X" field="positionX" {...formItemLayout}>
<Input <Input value={this.state.positionX} onChange={e => this.onChangePosition('positionX', e.target.value)} />
value={ this.state.positionX } </FormItem>
onChange={ (e) => this.onChangePosition('positionX',e.target.value) }
/>
</FormItem>
</div> </div>
<div className='positionItem'> <div className="positionItem">
<FormItem label="Y" field="positionY" {...formItemLayout}> <FormItem label="Y" field="positionY" {...formItemLayout}>
<Input <Input value={this.state.positionY} onChange={e => this.onChangePosition('positionY', e.target.value)} />
value={ this.state.positionY }
onChange={ (e) => this.onChangePosition('positionY',e.target.value) }
/>
</FormItem> </FormItem>
</div> </div>
<div className='positionItem'> <div className="positionItem">
<FormItem label="Z" field="positionZ" {...formItemLayout}> <FormItem label="Z" field="positionZ" {...formItemLayout}>
<Input <Input value={this.state.positionZ} onChange={e => this.onChangePosition('positionZ', e.target.value)} />
value={ this.state.positionZ }
onChange={ (e) => this.onChangePosition('positionZ',e.target.value) }
/>
</FormItem> </FormItem>
</div> </div>
</div> </div>
</div> </div>
<div className='msgItem'> <div className="msgItem">
<div className='itemLabel'>楼层位置</div> <div className="itemLabel">楼层位置</div>
<FormItem field="floorNum" > <FormItem field="floorNum">
<Input value={detailData.floor3d} disabled /> <Input value={detailData.floor3d} disabled />
</FormItem> </FormItem>
</div> </div>
<div className='msgItem'> <div className="msgItem">
<div className='itemLabel'>是否位于室内</div> <div className="itemLabel">是否位于室内</div>
<FormItem field="isIndoor" > <FormItem field="isIndoor">
<RadioGroup value={radio} onChange={value => {this.onRadioChange(value)}}> <RadioGroup
<Radio className='radio-text' value="prop1"></Radio> value={radio}
<Radio className='radio-text' value="prop2"></Radio> onChange={value => {
this.onRadioChange(value);
}}
>
<Radio className="radio-text" value="prop1">
</Radio>
<Radio className="radio-text" value="prop2">
</Radio>
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</Form>
<div className="bottomBtns">
</Form> <Button
<div className='bottomBtns'> className="sureBtn"
<Button onClick={() => {
className='sureBtn' this.props.closeRightPanel();
onClick={() => { }}
this.props.closeRightPanel() />
}} ></Button> <Button
<Button className="cancelBtn"
className='cancelBtn' onClick={() => {
onClick={() => { this.props.closeRightPanel();
this.props.closeRightPanel() }}
}} ></Button> />
</div> </div>
</div> </div>
</div> </div>
); );
} }
......
...@@ -3,6 +3,8 @@ import imgStatic from './../../../consts/imgStatic'; ...@@ -3,6 +3,8 @@ import imgStatic from './../../../consts/imgStatic';
import { onlineDayAction, safetyExecuteListAction } from './../../../services/panoramicService'; import { onlineDayAction, safetyExecuteListAction } from './../../../services/panoramicService';
import { getIcon } from './../../../utils/request'; import { getIcon } from './../../../utils/request';
import { warnTypes } from './conf'; import { warnTypes } from './conf';
import { eventTopics } from './../../consts';
import { tirggerPlanTopic } from './../../dataProcessor';
const panoramicIcon = imgStatic.panoramicIcon; const panoramicIcon = imgStatic.panoramicIcon;
...@@ -77,12 +79,17 @@ export default class SafetyExecuteList extends Component { ...@@ -77,12 +79,17 @@ export default class SafetyExecuteList extends Component {
}); });
} }
showSelectMarker =(item)=>{
//显示marker并飞入最佳视角
tirggerPlanTopic(eventTopics.safety_db_select,item);
}
renderContent = (datas) => { renderContent = (datas) => {
return ( return (
datas.map((item, index) => { datas.map(item => {
return ( return (
<div key={item.id} className="title-child"> <div key={item.id} className="title-child" onDoubleClick={()=>this.showSelectMarker(item)} >
<span className="title-text" >{item.label}</span>&nbsp;&nbsp; <span className="title-text" >{item.label}</span>&nbsp;&nbsp;
<span className="title-text" >{item.changeDate}</span> <span className="title-text" >{item.changeDate}</span>
</div> </div>
......
...@@ -3,7 +3,6 @@ import { initView3DAction, markerDetailsAction } from './../services/3dService'; ...@@ -3,7 +3,6 @@ import { initView3DAction, markerDetailsAction } from './../services/3dService';
import { getMatchEquipmentListAction } from './../services/ledgerService'; import { getMatchEquipmentListAction } from './../services/ledgerService';
import { eventTopics } from './consts'; import { eventTopics } from './consts';
import { desigerHelperConfig } from './conf'; import { desigerHelperConfig } from './conf';
import { connect3D } from 'amos-3d/lib/designer';
const typeEum = { picture1: '电源负荷图',picture2: '电缆沟封堵图',picture3: '消防车进站行车路线图',picture4: '消防取水图' }; const typeEum = { picture1: '电源负荷图',picture2: '电缆沟封堵图',picture3: '消防车进站行车路线图',picture4: '消防取水图' };
const parseTroubleMarkers = (instance,content,markers)=> {//处理设备报警:切换图层到探测器、显示报警的探测器(闪烁-报警,不闪烁-报警解除) const parseTroubleMarkers = (instance,content,markers)=> {//处理设备报警:切换图层到探测器、显示报警的探测器(闪烁-报警,不闪烁-报警解除)
...@@ -182,8 +181,8 @@ export const fireCarDisPlay = (instance, content) => {//3D界面消防车上弹 ...@@ -182,8 +181,8 @@ export const fireCarDisPlay = (instance, content) => {//3D界面消防车上弹
let markers = {}; let markers = {};
const type = 'fireCar'; const type = 'fireCar';
content.contingencyRo.type = type; content.contingencyRo.type = type;
initView3DAction(type).then(d => { initView3DAction(type,'',false).then(d => {
markers[type] = d; markers['fireCar'] = d.filter(e => e.type === 'fireCar');
parseFireTruckMarkers(instance, content, markers); parseFireTruckMarkers(instance, content, markers);
}); });
}; };
...@@ -281,10 +280,10 @@ export const initView3d = (instance, content) => {//监控屏恢初始状态 ...@@ -281,10 +280,10 @@ export const initView3d = (instance, content) => {//监控屏恢初始状态
export const dealTroubleMarkers = (instance, content) => { export const dealTroubleMarkers = (instance, content) => {
let markers = {}; let markers = {};
let type = 'monitorEquipment'; const type = 'monitorEquipment';
hiddenFireTruckRoute(instance); hiddenFireTruckRoute(instance);
content.contingencyRo.type = type; content.contingencyRo.type = type;
initView3DAction(type).then(d => { initView3DAction(type,'',false).then(d => {
markers[type] = d; markers[type] = d;
parseTroubleMarkers(instance,content,markers); parseTroubleMarkers(instance,content,markers);
}); });
...@@ -351,7 +350,7 @@ export const equipReleteCameraOpen = (instance, content) => { ...@@ -351,7 +350,7 @@ export const equipReleteCameraOpen = (instance, content) => {
let markers = {}; let markers = {};
let type = 'video'; let type = 'video';
content.contingencyRo.type = type; content.contingencyRo.type = type;
initView3DAction(type).then(d => { initView3DAction(type,'',false).then(d => {
markers[type] = d; markers[type] = d;
dealEquipReleteCameraOpen(instance,content,markers); dealEquipReleteCameraOpen(instance,content,markers);
}); });
...@@ -375,7 +374,7 @@ export const matchingFireEquipDisPlay = (instance, content)=>{ ...@@ -375,7 +374,7 @@ export const matchingFireEquipDisPlay = (instance, content)=>{
let markers = {}; let markers = {};
const type = 'fireResource'; const type = 'fireResource';
// content.contingencyRo.type = type ; // content.contingencyRo.type = type ;
initView3DAction(type).then(d => { initView3DAction(type,'',false).then(d => {
markers[type] = d; markers[type] = d;
markers['hydrant'] = (d['hydrant'] || []).map(item => {return { ...item, visible: true }; }); markers['hydrant'] = (d['hydrant'] || []).map(item => {return { ...item, visible: true }; });
markers['pool'] = (d['pool'] || []).map(item => {return { ...item, visible: true }; }); markers['pool'] = (d['pool'] || []).map(item => {return { ...item, visible: true }; });
......
...@@ -303,7 +303,7 @@ class SearchPane extends Component { ...@@ -303,7 +303,7 @@ class SearchPane extends Component {
} }
} }
closeModal(){ closeModal(){
let args = { const args = {
target: [], target: [],
operateType: operateTypes.POINT_SEARCH operateType: operateTypes.POINT_SEARCH
}; };
......
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