Commit 9a6170aa authored by suhuiguang's avatar suhuiguang

1.修改进入故障模式字段

parent 6862f8b6
......@@ -18,7 +18,7 @@ export const FscSerUrl = {
//*******************************************************************************
// 3D视图
//*******************************************************************************
view3dInitUrl: completePrefix(view3dURI, 'api/view3d/init3dViewNode?type={type}'), // 初始化三维视图 get
view3dInitUrl: completePrefix(view3dURI, 'api/view3d/init3dViewNode?type={type}&riskSourceId={riskSourceId}'), // 初始化三维视图 get
view3dInitLinkUrl: completePrefix(view3dURI, 'view3d/initViewLink'), // 初始化三维视图 获取link get
searchRegionListUrl: completePrefix(patrolURI, 'api/group/queryDept'), //右侧菜单-检索-区域集合
searchViewUrl: completePrefix(view3dURI, 'api/view3d/retrieve/all?inputText={inputText}&dataLevel={dataLevel}&orgCode={orgCode}&nodeState={nodeState}&type={type}&current={page}&pageSize={pageSize}&routeName={routeName}&protectObjName={protectObjName}'), // 右侧菜单-检索
......
......@@ -25,8 +25,8 @@ export const getObjFromNet = (url, callback) => {
* 获取各个类型的marker
* @param {string} type
*/
export const initView3DAction = (type) => {
const url = formatUrl(FscSerUrl.view3dInitUrl, { type });
export const initView3DAction = (type,riskSourceId) => {
const url = formatUrl(FscSerUrl.view3dInitUrl, { type, riskSourceId });
return commonGet(url);
};
......@@ -166,8 +166,8 @@ export const queryContingencyWater = () => {
/**
* 颗粒/重点设备 模式点查询
* @param {模式} model
* @param {模式} model
*/
export const pointModelistAction = ( model ) => {
return commonGet(formatUrl(FasSerUrl.pointModelistUrl, { model }));
};
\ No newline at end of file
};
......@@ -107,7 +107,6 @@ class ConvertorView3DRoot extends Basic {
render() {
const { isEdit } = this.state;
debugger
const wsURL = completeToken(SysWsURL.convertorView3dws);
return (
<div>
......
......@@ -76,7 +76,8 @@ class MaskContent extends Component {
planQuit,
sideControlShow,
isShowActionBar,
headerName
headerName,
errorAreaId
} = this.props;
const wsURL = completeToken(SysWsURL.convertorRulews);
const controlAnimation = {
......@@ -108,7 +109,7 @@ class MaskContent extends Component {
return (
<div className="mask-content">
<AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData} reconnect debug />
{ sideControlShow && <SideControl multiple={multiple} onItemClick={onItemClick} layerConfig={layerConfig} animationProps={controlAnimation} />}
{ sideControlShow && <SideControl multiple={multiple} errorAreaId={errorAreaId} onItemClick={onItemClick} layerConfig={layerConfig} animationProps={controlAnimation} />}
{ sideControlShow && <DataPane animationProps={datapaneAnim} />}
<TopMsg alarmStart={alarmStart} />
{!isShowActionBar && <ModelHeader headerName={headerName} handleExceptModel={this.handleExceptModel} />}
......@@ -139,7 +140,8 @@ MaskContent.propTypes = {
isShowActionBar: PropTypes.bool,
headerName: PropTypes.string,
setHeaderName: PropTypes.string,
handleExceptModel: PropTypes.func
handleExceptModel: PropTypes.func,
errorAreaId: PropTypes.number
};
MaskContent.defaultProps = {
......
......@@ -73,7 +73,6 @@ class View3D extends Component {
super(props);
this.state = {
objs: null,
totalDelta: 0, // zoom值
asyncModels: null,
startAsyncLoad: false,
showExplain: false,
......@@ -114,7 +113,8 @@ class View3D extends Component {
exceptionAreas: [], //异常区域
startLoadExceptionArea: false, //是否开始加载区域marker
sideControlShow: false, //隐藏耳朵
isShowActionBar: true //显示工具栏
isShowActionBar: true, //显示工具栏
errorAreaId: '' //异常区域id
};
getObjFromNet(view3dFile, (objs, asyncModels) => {
......@@ -240,11 +240,6 @@ class View3D extends Component {
this.lensLevel = LENS_LEVEL.ROOT;
}
});
this.r3d.on('camera_zoom', evt => {
console.log('main camera_zoom', evt);
this.onCameraZoomChange(evt.delta);
});
};
_bindPubSubEvents = () => {
......@@ -432,22 +427,8 @@ class View3D extends Component {
this.setState({ showFireTruckRoute: false }); //1.关闭路线显示
this.executeOperate({ key: 'fitview' });
this.setState({ markers: {} });
};
onCameraZoomChange = delta => {
let { totalDelta, markerType, showMap } = this.state;
totalDelta = totalDelta + delta;
// if (totalDelta < mousewheelCount && showMap) {
if(showMap && markerType != "impEquipmentMode"){
this.asyncLoadMarkerData(markerType);
}
// } else if (totalDelta >= mousewheelCount && !showMap) {
// this.loadMarkTypeStatistics(markerType);
// }
this.setState({ totalDelta });
}
loadMarkTypeStatistics = markerType => {
const { markers } = this.state;
this.setState({ showMap: true });
......@@ -900,66 +881,62 @@ class View3D extends Component {
*/
changeAreaPoint = (type) => {
let { pointTypeArr } = this.state;
if (type == 'region') {
if (type === 'region') {
getAreaTreeAction().then(data => {
this.setState({
treeData:data || [],
pageType: 'region',
showRightPanel: false
})
})
treeData: data || [],
pageType: 'region',
showRightPanel: false
});
});
} else {
getPointTreeAction(pointTypeArr[0].code||'').then(data => {
getPointTreeAction(pointTypeArr[0].code || '').then(data => {
console.log(data);
this.setState({
pointType: pointTypeArr[0].code||'',
treeData: data||[],
pointType: pointTypeArr[0].code || '',
treeData: data || [],
pageType: 'point',
showRightPanel: false
})
})
});
});
}
}
pointTypeChange = (pointType) => {
this.state.pointType = pointType;
getPointTreeAction(pointType).then(data => {
console.log(data);
this.setState({
pointType: pointType,
treeData: data||[]
})
})
pointType,
treeData: data || []
});
});
}
dragItemChange = (dragItem) => {
this.state.dragItem = dragItem;
let { treeData } = this.state;
if (dragItem.isRegion) {
//是区域
} else {
if(dragItem.isBind) {
if (dragItem.isBind) {
//已绑定
} else {
let hasRegion = false;
}
}
this.setState({
dragItem
})
});
}
drop = (event) => {
event.preventDefault();
let { dragItem,markers }=this.state;
console.log(dragItem)
if(dragItem) {
let { dragItem,markers } = this.state;
console.log(dragItem);
if (dragItem) {
if (dragItem.isBind) {
this.tipMsg = '只能放置未绑定的标记点'
this.setState({
simpleTipVisible: true
})
});
return false;
}
......@@ -967,82 +944,75 @@ class View3D extends Component {
const objs = this.a3dRef.pickerCoordinate(event.clientX, event.clientY, null, true);
let position;
if (objs.length > 0){
// get point
position = objs[0].point;
}
// [0,0,0]
const isInside = this.polygonRegion[dragItem.parentId].pointInPolygon([position.x,position.y,position.z])
// console.log(this.polygonRegion)
// console.log(position)
console.log(isInside)
console.log(isInside);
if (dragItem) {
if (isInside == false) {
this.tipMsg = '只能放置在当前区域'
if (isInside === false) {
this.tipMsg = '只能放置在当前区域';
this.setState({
simpleTipVisible: true
})
});
return false;
}
let uid = UUID.uuidFast()
let uid = UUID.uuidFast();
let addPointParam = {
type: dragItem.type,
position: position,
uid: uid,
position,
uid,
id: dragItem.id,
key: `${dragItem.type}-${dragItem.id}`,
title: dragItem.name,
label: dragItem.name,
level:'1',
levelStr: 'level_2',
}
markers.riskSource.push(addPointParam)
console.log(markers)
level: '1',
levelStr: 'level_2'
};
markers.riskSource.push(addPointParam);
console.log(markers);
this.setState({
markers
})
});
}
}
quitEditMode = () => {
this.setState({
editFlag: false
})
this.props.editModelChange(false)
});
this.props.editModelChange(false);
}
editButtonClick = () => {
let { editFlag } = this.state;
if (editFlag == true) {
if (editFlag === true) {
return false;
}
editFlag = true;
this.setState({ editFlag })
if(editFlag == true) {
this.setState({ editFlag });
if (editFlag === true) {
getAreaTreeAction().then(data => {
console.log(data);
this.setState({
treeData:data || []
})
})
getPointTypeAction().then(data => {
console.log(data);
this.setState({
pointTypeArr: data||[],
pointType:data[0] ? data[0].code : ''
})
})
this.getPointList();
this.setState({
treeData: data || []
});
});
getPointTypeAction().then(data => {
console.log(data);
this.setState({
pointTypeArr: data || [],
pointType: data[0] ? data[0].code : ''
});
});
this.getPointList();
}
}
simpleTipOk = () => {
this.setState({
simpleTipVisible: false
})
});
}
changeMarkerType = (item, isCancel) => {
const { markers, totalDelta } = this.state;
const { markers } = this.state;
if (item.isLine) {
this.setState({
toggleRoad: !isCancel
......@@ -1050,25 +1020,22 @@ class View3D extends Component {
} else {
if (isCancel) {
markers[item.type] = [];
// delete this.markerList[item.type];
this.setState({
markers
});
} else {
// if (totalDelta < mousewheelCount) {
this.asyncLoadMarkerData(item.type);
// } else if (totalDelta >= mousewheelCount) {
// this.loadMarkTypeStatistics(item.type);
// }
this.asyncLoadMarkerData(item.type);
}
}
};
asyncLoadMarkerData = markerType => {
asyncLoadMarkerData = (markerType, riskSourceId) => {
const { markers } = this.state;
this.setState({ showMap: false });
this.clearMarkers();
initView3DAction(markerType).then(d => {
initView3DAction(markerType,riskSourceId).then(d => {
if (markerType === 'fireResource') {
markers['hydrant'] = d['hydrant'];
markers['pool'] = d['pool'];
......@@ -1138,7 +1105,6 @@ class View3D extends Component {
};
changeMarkerType = (item, isCancel) => {
const { markers, totalDelta } = this.state;
if (item.isLine) {
this.setState({
toggleRoad: !isCancel
......@@ -1146,11 +1112,7 @@ class View3D extends Component {
} else {
this.clearMarkers();
if (!isCancel) {
// if (totalDelta < mousewheelCount) {
this.asyncLoadMarkerData(item.type);
// } else if (totalDelta >= mousewheelCount) {
// this.loadMarkTypeStatistics(item.type);
// }
this.asyncLoadMarkerData(item.type,item.riskSourceId);
} else {
this.setState({ markerType: null });
}
......@@ -1160,7 +1122,6 @@ class View3D extends Component {
clearMarkers = () => {
const { markers } = this.state;
markers['patrol'] = [];
markers['risk'] = [];
markers['data'] = [];
markers['room'] = [];
......@@ -1296,24 +1257,26 @@ class View3D extends Component {
});
}
handleExceptModel =(type)=>{
handleExceptModel =(type,areaId)=>{
this.clearMarkers();
if(type === 'into_except_model'){//进入耳朵模式
if (type === 'into_except_model'){//进入耳朵模式
this.props.editModelChange(true);//隐藏全景统计
this.setState({
sideControlShow: true, //显示耳朵
isShowActionBar: false, //隐藏工具栏
startLoadExceptionArea: false,//隐藏marker
headerName: '故障点模式' //设置头名称
headerName: '故障点模式', //设置头名称
errorAreaId: areaId
});
} else if(type === 'out_except_model'){
} else if (type === 'out_except_model'){
this.props.editModelChange(false);//显示全景统计
this.setState({
sideControlShow: false, //隐藏耳朵
isShowActionBar: true, //显示工具栏
startLoadExceptionArea: true, //显示marker,
headerName: '', //设置头名称
editFlag: false //推出编辑模式
editFlag: false, //推出编辑模式
errorAreaId: ''
});
}
}
......@@ -1338,7 +1301,8 @@ class View3D extends Component {
exceptionAreas, exceptionMarkers,startLoadExceptionArea,
sideControlShow,
isShowActionBar,
headerName
headerName,
errorAreaId
} = this.state;
const { dimension, hiddenScreenSaver } = this.props;
const graphicProps = {
......@@ -1406,6 +1370,7 @@ class View3D extends Component {
headerName={headerName}
setHeaderName={this.setHeaderName}
onActionItemClick={this.onActionItemClick}
errorAreaId={errorAreaId}
handleExceptModel={this.handleExceptModel}
/>
}
......@@ -1492,7 +1457,8 @@ View3D.propTypes = {
hiddenScreenSaver: PropTypes.func,
onLoadCompleted: PropTypes.func,
alarmStart: PropTypes.func,
planStart: PropTypes.func
planStart: PropTypes.func,
editModelChange: PropTypes.func
};
export default View3D;
......@@ -46,8 +46,7 @@ class ExceptionArea extends Component {
onMarkerClick = (marker) => {
const { extData } = marker;
lsTool.write('errorAreaId',extData.id);
this.props.handleExceptModel && this.props.handleExceptModel('into_except_model');
this.props.handleExceptModel && this.props.handleExceptModel('into_except_model',extData.id);
}
setTopCardConf = (obj,{ safetyIndex })=>{
......
......@@ -27,12 +27,13 @@ class SideControl extends Component {
* control 点击,第二次点击则取消
*/
onBizItemClick = (item, e) => {
const { errorAreaId: riskSourceId } = this.props;
const alreadyActive = this.isActive(item.key);
const newKeys = this.getActiveControl(item.key, alreadyActive);
this.setState({
activeControl: newKeys
});
this.props.onItemClick && this.props.onItemClick(item, alreadyActive);
this.props.onItemClick && this.props.onItemClick({ ...item, riskSourceId }, alreadyActive);
};
getActiveControl = (key, alreadyActive) => {
......@@ -53,7 +54,7 @@ class SideControl extends Component {
};
render() {
const { layerConfig, animationProps } = this.props;
const { layerConfig, animationProps } = this.props;
let _bizControls = bizControls;
if (filterUser.includes(loginUserName)) {
let target = _bizControls.find(item => item.key === 'fireResource-point');
......@@ -80,7 +81,8 @@ SideControl.propTypes = {
onItemClick: PropTypes.func,
write: PropTypes.func,
toStr: PropTypes.func,
animationProps: PropTypes.object
animationProps: PropTypes.object,
errorAreaId: PropTypes.number
};
export default SideControl;
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