Commit 8aa27333 authored by 张博's avatar 张博

bug

parent 0ac02935
...@@ -154,6 +154,22 @@ ...@@ -154,6 +154,22 @@
} }
} }
.point-dialog-modal{ .point-dialog-modal{
::-webkit-scrollbar {
/* 血槽宽度 */
width: 5px;
height: 5px;
background-color: rgba(10, 53, 62, 1);
border-radius: 5px;
}
::-webkit-scrollbar-thumb {
/* 拖动条 */
border-radius: 5px;
background-color: rgba(255, 255, 255, 0.4);
}
::-webkit-scrollbar-track {
/* 背景槽 */
background-color: rgba(17, 44, 88, 0.2);
}
width: 100%; width: 100%;
height: 100%; height: 100%;
.amos-modal-container{ .amos-modal-container{
......
...@@ -4,7 +4,7 @@ import { Connect } from 'amos-framework'; ...@@ -4,7 +4,7 @@ import { Connect } from 'amos-framework';
import { Store } from 'amos-tool'; import { Store } from 'amos-tool';
import { connect3D } from 'amos-3d/lib/designer'; import { connect3D } from 'amos-3d/lib/designer';
import { RiskPoint, PatrolPoint, PersonPoint3D, MonitorPoint, ProbePoint, import { RiskPoint, PatrolPoint, PersonPoint3D, MonitorPoint, ProbePoint,
FireResourcePoint, EquipmentPoint, FireCar3D, FirePoint, WorkerMen3D, PointStatistics, ImpEquipmentMode } from './points'; FireResourcePoint, EquipmentPoint, FireCar3D, FirePoint, PointStatistics, ImpEquipmentMode } from './points';
import { eventTopics, isPointEvent , isLevelFilter } from './consts'; import { eventTopics, isPointEvent , isLevelFilter } from './consts';
import { parseMarkers, parseLevelFilter } from './dataProcessor'; import { parseMarkers, parseLevelFilter } from './dataProcessor';
...@@ -31,26 +31,26 @@ class PointsPool extends Component { ...@@ -31,26 +31,26 @@ class PointsPool extends Component {
this.markerList = {}; this.markerList = {};
} }
// componentDidMount() { componentDidMount() {
// this.props.subscribe(eventTopics.base3d_view, (topic, data) => { this.props.subscribe(eventTopics.base3d_view, (topic, data) => {
// if (isPointEvent(topic)){ if (isPointEvent(topic)){
// parseMarkers(this, topic, data); parseMarkers(this, topic, data);
// } else if (isLevelFilter(topic)) { } else if (isLevelFilter(topic)) {
// parseLevelFilter(this, topic, data); parseLevelFilter(this, topic, data);
}
});
this.props.subscribe('base3d.fromws1.showFireTruckRoute', (topic, data) => {
parseMarkers(this, topic, data);
});
// this.props.subscribe(eventTopics.view3d_init, (topic, data) => {
// const fireTruckMarkerCache = this.markerList['fireCar'];
// if (fireTruckMarkerCache) {
// for (let fireTruck of fireTruckMarkerCache.getValues()) {
// fireTruck.stopMove();
// } // }
// });
// this.props.subscribe('base3d.fromws1.showFireTruckRoute', (topic, data) => {
// parseMarkers(this, topic, data);
// });
// // this.props.subscribe(eventTopics.view3d_init, (topic, data) => {
// // const fireTruckMarkerCache = this.markerList['fireCar'];
// // if (fireTruckMarkerCache) {
// // for (let fireTruck of fireTruckMarkerCache.getValues()) {
// // fireTruck.stopMove();
// // }
// // }
// // });
// } // }
// });
}
onMarkersCreated = (type, { markersCache }) => { onMarkersCreated = (type, { markersCache }) => {
...@@ -84,7 +84,7 @@ class PointsPool extends Component { ...@@ -84,7 +84,7 @@ class PointsPool extends Component {
this.props.updateMarker(data); this.props.updateMarker(data);
} }
addMarker=(data)=>{ addMarker=(data)=>{
this.props.addMarker(data) this.props.addMarker(data);
} }
render() { render() {
const { markers, ...rest } = this.props; const { markers, ...rest } = this.props;
...@@ -241,7 +241,12 @@ class PointsPool extends Component { ...@@ -241,7 +241,12 @@ class PointsPool extends Component {
PointsPool.propTypes = { PointsPool.propTypes = {
subscribe: PropTypes.func, subscribe: PropTypes.func,
updateMarker: PropTypes.func, updateMarker: PropTypes.func,
markers: PropTypes.object markers: PropTypes.object,
isEditMode: PropTypes.bool,
selectPoints: PropTypes.object,
stagePilot: PropTypes.object,
addMarker: PropTypes.func
}; };
export default PointsPool; export default PointsPool;
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Modal } from 'amos-framework'; import { Modal } from 'amos-framework';
import PropTypes from 'prop-types';
class PromptModal extends Component { class PromptModal extends Component {
constructor(props) { constructor(props) {
...@@ -14,7 +15,7 @@ class PromptModal extends Component { ...@@ -14,7 +15,7 @@ class PromptModal extends Component {
} }
}; };
saveData = () => { saveData = () => {
const { isback, type,pointType,pointParams } = this.props.promptData; const { isback, type,pointType,pointParams,isSwitch } = this.props.promptData;
this.props.closePromptModal(); this.props.closePromptModal();
if (type === 'region') { if (type === 'region') {
...@@ -22,6 +23,8 @@ class PromptModal extends Component { ...@@ -22,6 +23,8 @@ class PromptModal extends Component {
} else { } else {
if (isback){ if (isback){
this.props.savePointData(); this.props.savePointData();
} else if (isSwitch) {
this.props.savePointData();
} else { } else {
this.props.savePointAndRefreshMarker(pointType,pointParams); this.props.savePointAndRefreshMarker(pointType,pointParams);
} }
...@@ -61,5 +64,13 @@ class PromptModal extends Component { ...@@ -61,5 +64,13 @@ class PromptModal extends Component {
); );
} }
} }
PromptModal.propTypes = {
promptData: PropTypes.object,
closePromptModal: PropTypes.func,
saveAreaData: PropTypes.func,
savePointAndRefreshMarker: PropTypes.func,
handleOutExceptModel: PropTypes.func,
savePointData: PropTypes.func
};
export default PromptModal; export default PromptModal;
...@@ -1179,7 +1179,9 @@ class View3D extends Component { ...@@ -1179,7 +1179,9 @@ class View3D extends Component {
promptContent: `有未保存数据,是否保存?`, promptContent: `有未保存数据,是否保存?`,
type: 'point', type: 'point',
btnType: 'isOk', btnType: 'isOk',
isback: false isback: false,
isSwitch: true
} }
}); });
...@@ -1557,10 +1559,11 @@ class View3D extends Component { ...@@ -1557,10 +1559,11 @@ class View3D extends Component {
selectPoints: '', selectPoints: '',
showRightPanel: false showRightPanel: false
}); });
this.clearMarkers();
} }
handleExceptModel =(type,areaId)=>{ handleExceptModel =(type,areaId)=>{
let { isPointSave,isAreaSave } = this.state; let { isPointSave,isAreaSave } = this.state;
this.clearMarkers();
if (type === 'into_except_model'){//进入耳朵模式 if (type === 'into_except_model'){//进入耳朵模式
this.props.editModelChange(true);//隐藏全景统计 this.props.editModelChange(true);//隐藏全景统计
this.setState({ this.setState({
......
...@@ -250,9 +250,9 @@ export const parseLevelFilter = (instance, topic, data) => { ...@@ -250,9 +250,9 @@ export const parseLevelFilter = (instance, topic, data) => {
const extData = mc.getExtData(); const extData = mc.getExtData();
if (extData.levelStr === pointLevel){ if (extData.levelStr === pointLevel){
if (visible) { if (visible) {
mc.show(); mc.visible = true;
} else { } else {
mc.hide(); mc.visible = false;
} }
} }
}); });
......
...@@ -63,7 +63,7 @@ class PointLeftTree extends Component { ...@@ -63,7 +63,7 @@ class PointLeftTree extends Component {
onSelectChange = (value, item) =>{ onSelectChange = (value, item) =>{
console.log(value, item); console.log(value, item);
this.setState({ pointType: value }); this.setState({ pointType: value, searchValue: '' });
this.props.pointTypeChange(value); this.props.pointTypeChange(value);
} }
onSearchChange = (e,v) => { onSearchChange = (e,v) => {
...@@ -180,7 +180,7 @@ class PointLeftTree extends Component { ...@@ -180,7 +180,7 @@ class PointLeftTree extends Component {
} }
render() { render() {
let { treeData,pointTypeArr,pointType } = this.state; let { treeData,pointTypeArr,pointType , searchValue } = this.state;
return ( return (
<div className="leftTree"> <div className="leftTree">
<div className='leftContainer'> <div className='leftContainer'>
...@@ -196,7 +196,7 @@ class PointLeftTree extends Component { ...@@ -196,7 +196,7 @@ class PointLeftTree extends Component {
</Select> </Select>
} }
<Search className='leftSearch' icon="search" onChange={this.onSearchChange} onIconClick={this.onSearchChange} /> <Search className='leftSearch' icon="search" value={searchValue} onChange={this.onSearchChange} onIconClick={this.onSearchChange} />
</div> </div>
<div className='treeBox'> <div className='treeBox'>
<Tree <Tree
......
...@@ -81,18 +81,18 @@ export default function marker3DFactory(WrappedComponent = 'div', options) { ...@@ -81,18 +81,18 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
componentWillMount = () => { componentWillMount = () => {
this.setState({ planStarted: this.props.planStarted }); this.setState({ planStarted: this.props.planStarted });
}; };
componentDidMount() { // componentDidMount() {
this.props.subscribe(eventTopics.base3d_view, (topic, data) => { // this.props.subscribe(eventTopics.base3d_view, (topic, data) => {
if (isPointEvent(topic)){ // if (isPointEvent(topic)){
parseMarkers(this, topic, data); // parseMarkers(this, topic, data);
} else if (isLevelFilter(topic)) { // } else if (isLevelFilter(topic)) {
parseLevelFilter(this, topic, data); // parseLevelFilter(this, topic, data);
} // }
}); // });
this.props.subscribe('base3d.fromws1.showFireTruckRoute', (topic, data) => { // this.props.subscribe('base3d.fromws1.showFireTruckRoute', (topic, data) => {
parseMarkers(this, topic, data); // parseMarkers(this, topic, data);
}); // });
} // }
componentWillReceiveProps = nextProps => { componentWillReceiveProps = nextProps => {
if (nextProps.isEditMode) { if (nextProps.isEditMode) {
this.markersCache.eachValue(obj => { this.markersCache.eachValue(obj => {
...@@ -145,31 +145,9 @@ export default function marker3DFactory(WrappedComponent = 'div', options) { ...@@ -145,31 +145,9 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
that.setState({ isClick: true }); // 将isClick设置为true that.setState({ isClick: true }); // 将isClick设置为true
}, 1000); }, 1000);
}; };
markerDragend = (marker, evt) => {
if (marker) {
console.log(marker.position);
console.log(marker.extData);
this.props.addMarker(marker);
}
};
markerCreated = ({ markersCache }) => {
let { isEditMode, selectKey } = this.props;
this.markersCache = markersCache;
this.stagePilot = this.props.stagePilot;
this.outlineHelper = this.stagePilot ? this.stagePilot.outlineHelper : undefined;
markersCache.eachValue(obj=>{
if (isEditMode){
this.setTopCardConf(obj, obj.extData);
}
if (obj.extData.type === 'riskSource' && markerType !== 'impEquipmentMode' && !isEditMode){
this.setTwinkleConf(obj);
}
});
}
setTwinkleConf = ( obj ) => { setTwinkleConf = ( obj ) => {
const { twinkle,frequency } = obj.extData; const { twinkle,frequency } = obj.extData;
let pulsePeriod = (twinkle && frequency !== 0 ? 1 / frequency : null); let pulsePeriod = twinkle && frequency !== 0 ? 1 / frequency : null;
let color = twinkle && frequency !== 0 ? '#FF0000' : null; let color = twinkle && frequency !== 0 ? '#FF0000' : null;
if (!obj.baseObjHelper.outlineHelper){ if (!obj.baseObjHelper.outlineHelper){
obj.baseObjHelper.setOutlineHelper(this.outlineHelper); obj.baseObjHelper.setOutlineHelper(this.outlineHelper);
...@@ -211,7 +189,31 @@ export default function marker3DFactory(WrappedComponent = 'div', options) { ...@@ -211,7 +189,31 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
// } // }
obj.baseObjHelper.title = cardTitle; obj.baseObjHelper.title = cardTitle;
}; };
markerDragend = (marker, evt) => {
if (marker) {
console.log(marker.position);
console.log(marker.extData);
this.props.addMarker(marker);
}
};
markerCreated = (data) => {
let { isEditMode } = this.props;
let { markersCache } = data;
if (markersCache.cacheMap.size > 0) {
this.props.onCreated(data);
}
this.markersCache = markersCache;
this.stagePilot = this.props.stagePilot;
this.outlineHelper = this.stagePilot ? this.stagePilot.outlineHelper : undefined;
markersCache.eachValue(obj=>{
if (isEditMode){
this.setTopCardConf(obj, obj.extData);
}
if (obj.extData.type === 'riskSource' && markerType !== 'impEquipmentMode' && !isEditMode){
this.setTwinkleConf(obj);
}
});
}
buildMarkerOptions = (markers, markerType, defaultParams = {}) => { buildMarkerOptions = (markers, markerType, defaultParams = {}) => {
console.log(markers); console.log(markers);
const { isEditMode } = this.props; const { isEditMode } = this.props;
...@@ -263,6 +265,14 @@ export default function marker3DFactory(WrappedComponent = 'div', options) { ...@@ -263,6 +265,14 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
); );
} }
} }
MarkerPoints.propTypes = {
subscribe: PropTypes.func,
updateMarker: PropTypes.func,
markers: PropTypes.object,
isEditMode: PropTypes.bool,
selectPoints: PropTypes.object,
stagePilot: PropTypes.object,
addMarker: PropTypes.func
};
return MarkerPoints; return MarkerPoints;
} }
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