Commit 3758a306 authored by suhuiguang's avatar suhuiguang

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

parent 336faae8
......@@ -35,7 +35,7 @@ export const EVENTS_CONSTS = {
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 = {
export const ModuleEditUrl = {
getAreaTreeUrl: completePrefix(convertorURI, 'api/view3d/region/tree'),//
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'),
saveAreaDataUrl: completePrefix(convertorURI, 'api/view3d/region/bind'),//
getPointTypeUrl: completePrefix(convertorURI, 'api/view3d/point/type'),
......
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 { commonGet, commonPost, singleFetch } from './../utils/request';
export const downloadBasicScene = (modelURI) => {
if (!modelURI.endsWith('.json')){
modelURI += '/index.json';
}
return singleFetch(modelURI);
};
export const downloadBasicScene = modelURI => {
if (!modelURI.endsWith('.json')) {
modelURI += '/index.json';
}
return singleFetch(modelURI);
};
/**
/**
* 通过 subjectId 获取场景配置信息
* @param {String} subjectId
*/
export const getDesignerParamAction = (subjectId) => {
export const getDesignerParamAction = subjectId => {
// return singleFetch('/_mock/empty.json');
// return singleFetch('/_mock/plant.json');
// return commonGet('/_mock/plant.json');
......@@ -32,47 +30,43 @@ export const saveDesignAction = object => {
};
export const getAreaTreeAction = () => {
return commonGet(ModuleEditUrl.getAreaTreeUrl);
}
export const getAreaTreeDetailAction = (id) => {
return commonGet(`${ModuleEditUrl.getPointTreeDetailUrl}/${id}`);
}
export const getPointTreeDetailAction = (pointId, type ) => {
return commonGet(formatUrl(ModuleEditUrl.getPointTreeDetailUrl,{ pointId, type }));
}
export const getPointTreeAction = (type) => {
return commonGet(ModuleEditUrl.getAreaTreeUrl);
};
export const getPointDetailAction = (pointId, type) => {
return commonGet(formatUrl(ModuleEditUrl.getPointDetailUrl, { pointId, type }));
};
export const getPointTreeAction = type => {
return commonGet(`${ModuleEditUrl.getPointTreeUrl}/${type}`);
}
};
/**
* 保存区域
* @param {*} routePathParams
*/
export const saveAreaDataAction = (routePathParams) => {
export const saveAreaDataAction = routePathParams => {
return commonPost(ModuleEditUrl.saveAreaDataUrl, routePathParams);
}
};
export const getPointTypeAction = () => {
return commonGet(ModuleEditUrl.getPointTypeUrl);
}
};
/**
* 获取风险点
* @param {点类型} type
* @param {区域id} riskSourceId
*/
export const getPointListAction = (type,riskSourceId) => {
export const getPointListAction = (type, riskSourceId) => {
if (type) {
return commonGet(`${ModuleEditUrl.getPointListUrl}?type=${type}&riskSourceId=${riskSourceId}`);
} else {
return commonGet(`${ModuleEditUrl.getPointListUrl}`);
}
}
};
/**
* 保存风险点
* @param {*} bindParams
*/
export const savePointListAction = (bindParams) => {
export const savePointListAction = bindParams => {
return commonPost(ModuleEditUrl.savePointListUrl, bindParams);
}
};
......@@ -156,8 +156,9 @@
}
.title-child {
border-bottom: 1px solid rgba(196, 86, 86, 0.3);
padding-top: 7px;
cursor: pointer;
border-bottom: 1px solid rgba(196, 86, 86, 0.3);
}
}
}
......
......@@ -49,7 +49,6 @@ class MaskContent extends Component {
};
actionBarClick = ({ singleClick, type, label, showLabel }) => {
if (!singleClick){//设置选中状态
this.setState({ activeAction: type });
}
......
......@@ -50,7 +50,6 @@ class PointsPool extends Component {
// }
// }
// });
this.props.subscribe(eventTopics.point_position_change, (topic, data) => {
changeMarkerPosition(this, topic, data);
});
......@@ -60,6 +59,9 @@ class PointsPool extends Component {
this.markerList[type] = markersCache;
(markersCache || []).forEach(mc => {
const extData = mc.getExtData();
if (extData.isNeedFocus) {//控制安全执行类表双击最佳视角
this.props.focusObject && this.props.focusObject(mc.node);
}
if (extData.hasOwnProperty('visible')){
let visible = extData.visible;
if (visible) {
......@@ -107,11 +109,6 @@ class PointsPool extends Component {
selectPoints={this.props.selectPoints}
showRightPanelOnclick={(d)=>this.props.showRightPanelOnclick(d)}
/>
{/* <PatrolPoint
{...rest}
markers={markers.risk}
onCreated={(val) => this.onMarkersCreated('risk', val)}
/> */}
<PatrolPoint
{...rest}
markers={markers.patrol}
......@@ -259,7 +256,8 @@ PointsPool.propTypes = {
selectPoints: PropTypes.object,
stagePilot: PropTypes.object,
addMarker: PropTypes.func,
showRightPanelOnclick: PropTypes.func
showRightPanelOnclick: PropTypes.func,
focusObject: PropTypes.func
};
......
......@@ -23,7 +23,8 @@ import {
tirggerTransTopic,
cacheObjsSave,
flyToSubView,
convertMarkerType
convertMarkerType,
showSelectMarkerPoint
} from './dataProcessor';
import {
dealTroubleMarkers,
......@@ -258,14 +259,12 @@ class View3D extends Component {
}
_registerEvents = () => {
this.r3d.on('dbclick', evt => {
if (evt.button !== 0) {
return;
}
const object = evt.object;
if (object) {
alert(1)
this.cameraFactory.flyTo({
position: object.position.toArray(),
duration: 6000
......@@ -290,7 +289,6 @@ class View3D extends Component {
if (isControllerEvent(topic)) {
executeView3dCMD(this, topic, data);
} else if (isManualOperate(topic)) {
parseManual(this, topic, data);
} else if (topic === eventTopics.show_fire_equip) {
this.asyncLoadMarkerData('fireResource');
......@@ -298,6 +296,8 @@ class View3D extends Component {
this.viewFreshInit();
} else if (topic === eventTopics.exceptionAreas_fresh) {
this.initExceptionAreasData();
} else if (topic === eventTopics.safety_db_select) {
showSelectMarkerPoint(this,data.target);
}
});
};
......@@ -1845,7 +1845,7 @@ class View3D extends Component {
>
{startAsyncLoad && this.multLoadWorkerObjContent(asyncModels)}
{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} />}
<FlameFire position={firePosition} width={10} height={20} depth={8} sliceSpacing={1} visible={planStarted} />
{isEditMode && this.renderAreas()}
......
......@@ -81,7 +81,7 @@ 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: '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: 'edit-action', icon: 'editMode', type: 'editMode', singleClick: false, label: '编辑' , showLabel: true },
{ key: 'search-action', icon: 'chaxun', type: 'search', singleClick: true, label: '检索' , showLabel: true }
......
......@@ -67,9 +67,8 @@ export const eventTopics = {
view_fresh: 'base3d.view.view_fresh',//视图刷新
fromws: 'base3d.fromws',
exceptionAreas_fresh: 'base3d.view.exceptionAreas_fresh',//异常区域刷新
safety_db_select: 'base3d.view.safety_db_select', // 安全执行列表双击选中
datapane_msg: 'base3d.fromws.datapane_msg', // datapane 消息
broad_msg: 'base3d.fromws.broad_msg', // 播报消息
global_msg: 'base3d.fromws.global_msg', // 全局消息
......@@ -88,9 +87,10 @@ export const eventTopics = {
top_afe_msg: 'base3d.fromws.top_alarm_fire_equip_msg', //顶部传感器报警消息
top_ae_msg: 'base3d.fromws.top_alarm_equip_msg', //顶部重点装备报警提醒消息
plan_task_list:'biz.planDrill.task_tabs_show',//预案演练任务列表展开事件
plan_tree_view:'biz.planDrill.plan_tree_view',//预案树展开事件
plan_drill_appId:'biz.planDrill.plan_drill_app_id',//预案选择节点
plan_task_list: 'biz.planDrill.task_tabs_show',//预案演练任务列表展开事件
plan_tree_view: 'biz.planDrill.plan_tree_view',//预案树展开事件
plan_drill_appId: 'biz.planDrill.plan_drill_app_id' //预案选择节点
};
export const isPointEvent = (topic) => topic.indexOf('.point_') > -1;
......
......@@ -5,6 +5,7 @@ import { PubSub } from 'ray-eventpool';
import { transitionHelper } from 'amos-3d/lib/helpers';
import { eventTopics, pointTopicMapping, operateTypes } from './consts';
import { searchLinkAction } from './../services/3dService';
import { getPointDetailAction } from './../services/moduleEditServices';
import conf from './conf';
// import { lineData } from './datas';
......@@ -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
*/
......@@ -72,12 +82,6 @@ export const parseSearchMenuMarkers = (instance, content) => {
instance.setState({
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));
content.map( (item) => {
const { type } = item;
......@@ -421,3 +425,39 @@ export const convertMarkerType = (type) => {
const fireEquipmentStr = 'fireCar,fireEquipment,fireChamber,fireFoamRoom,hydrant,pool';
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 });
}
});
};
......@@ -3,6 +3,8 @@ import imgStatic from './../../../consts/imgStatic';
import { onlineDayAction, safetyExecuteListAction } from './../../../services/panoramicService';
import { getIcon } from './../../../utils/request';
import { warnTypes } from './conf';
import { eventTopics } from './../../consts';
import { tirggerPlanTopic } from './../../dataProcessor';
const panoramicIcon = imgStatic.panoramicIcon;
......@@ -77,12 +79,17 @@ export default class SafetyExecuteList extends Component {
});
}
showSelectMarker =(item)=>{
//显示marker并飞入最佳视角
tirggerPlanTopic(eventTopics.safety_db_select,item);
}
renderContent = (datas) => {
return (
datas.map((item, index) => {
datas.map(item => {
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.changeDate}</span>
</div>
......
......@@ -3,7 +3,6 @@ import { initView3DAction, markerDetailsAction } from './../services/3dService';
import { getMatchEquipmentListAction } from './../services/ledgerService';
import { eventTopics } from './consts';
import { desigerHelperConfig } from './conf';
import { connect3D } from 'amos-3d/lib/designer';
const typeEum = { picture1: '电源负荷图',picture2: '电缆沟封堵图',picture3: '消防车进站行车路线图',picture4: '消防取水图' };
const parseTroubleMarkers = (instance,content,markers)=> {//处理设备报警:切换图层到探测器、显示报警的探测器(闪烁-报警,不闪烁-报警解除)
......@@ -182,8 +181,8 @@ export const fireCarDisPlay = (instance, content) => {//3D界面消防车上弹
let markers = {};
const type = 'fireCar';
content.contingencyRo.type = type;
initView3DAction(type).then(d => {
markers[type] = d;
initView3DAction(type,'',false).then(d => {
markers['fireCar'] = d.filter(e => e.type === 'fireCar');
parseFireTruckMarkers(instance, content, markers);
});
};
......@@ -281,10 +280,10 @@ export const initView3d = (instance, content) => {//监控屏恢初始状态
export const dealTroubleMarkers = (instance, content) => {
let markers = {};
let type = 'monitorEquipment';
const type = 'monitorEquipment';
hiddenFireTruckRoute(instance);
content.contingencyRo.type = type;
initView3DAction(type).then(d => {
initView3DAction(type,'',false).then(d => {
markers[type] = d;
parseTroubleMarkers(instance,content,markers);
});
......@@ -351,7 +350,7 @@ export const equipReleteCameraOpen = (instance, content) => {
let markers = {};
let type = 'video';
content.contingencyRo.type = type;
initView3DAction(type).then(d => {
initView3DAction(type,'',false).then(d => {
markers[type] = d;
dealEquipReleteCameraOpen(instance,content,markers);
});
......@@ -375,7 +374,7 @@ export const matchingFireEquipDisPlay = (instance, content)=>{
let markers = {};
const type = 'fireResource';
// content.contingencyRo.type = type ;
initView3DAction(type).then(d => {
initView3DAction(type,'',false).then(d => {
markers[type] = d;
markers['hydrant'] = (d['hydrant'] || []).map(item => {return { ...item, visible: true }; });
markers['pool'] = (d['pool'] || []).map(item => {return { ...item, visible: true }; });
......
......@@ -303,7 +303,7 @@ class SearchPane extends Component {
}
}
closeModal(){
let args = {
const args = {
target: [],
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