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

bug

parent 0ac02935
......@@ -154,6 +154,22 @@
}
}
.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%;
height: 100%;
.amos-modal-container{
......
......@@ -4,7 +4,7 @@ import { Connect } from 'amos-framework';
import { Store } from 'amos-tool';
import { connect3D } from 'amos-3d/lib/designer';
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 { parseMarkers, parseLevelFilter } from './dataProcessor';
......@@ -31,26 +31,26 @@ class PointsPool extends Component {
this.markerList = {};
}
// componentDidMount() {
// this.props.subscribe(eventTopics.base3d_view, (topic, data) => {
// if (isPointEvent(topic)){
// parseMarkers(this, topic, data);
// } else if (isLevelFilter(topic)) {
// 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();
// // }
// // }
// // });
// }
componentDidMount() {
this.props.subscribe(eventTopics.base3d_view, (topic, data) => {
if (isPointEvent(topic)){
parseMarkers(this, topic, data);
} else if (isLevelFilter(topic)) {
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();
// }
// }
// });
}
onMarkersCreated = (type, { markersCache }) => {
......@@ -84,7 +84,7 @@ class PointsPool extends Component {
this.props.updateMarker(data);
}
addMarker=(data)=>{
this.props.addMarker(data)
this.props.addMarker(data);
}
render() {
const { markers, ...rest } = this.props;
......@@ -241,7 +241,12 @@ class PointsPool extends Component {
PointsPool.propTypes = {
subscribe: 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;
import React, { Component } from 'react';
import { Modal } from 'amos-framework';
import PropTypes from 'prop-types';
class PromptModal extends Component {
constructor(props) {
......@@ -14,7 +15,7 @@ class PromptModal extends Component {
}
};
saveData = () => {
const { isback, type,pointType,pointParams } = this.props.promptData;
const { isback, type,pointType,pointParams,isSwitch } = this.props.promptData;
this.props.closePromptModal();
if (type === 'region') {
......@@ -22,6 +23,8 @@ class PromptModal extends Component {
} else {
if (isback){
this.props.savePointData();
} else if (isSwitch) {
this.props.savePointData();
} else {
this.props.savePointAndRefreshMarker(pointType,pointParams);
}
......@@ -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;
......@@ -1179,7 +1179,9 @@ class View3D extends Component {
promptContent: `有未保存数据,是否保存?`,
type: 'point',
btnType: 'isOk',
isback: false
isback: false,
isSwitch: true
}
});
......@@ -1557,10 +1559,11 @@ class View3D extends Component {
selectPoints: '',
showRightPanel: false
});
this.clearMarkers();
}
handleExceptModel =(type,areaId)=>{
let { isPointSave,isAreaSave } = this.state;
this.clearMarkers();
if (type === 'into_except_model'){//进入耳朵模式
this.props.editModelChange(true);//隐藏全景统计
this.setState({
......
......@@ -250,9 +250,9 @@ export const parseLevelFilter = (instance, topic, data) => {
const extData = mc.getExtData();
if (extData.levelStr === pointLevel){
if (visible) {
mc.show();
mc.visible = true;
} else {
mc.hide();
mc.visible = false;
}
}
});
......
......@@ -63,7 +63,7 @@ class PointLeftTree extends Component {
onSelectChange = (value, item) =>{
console.log(value, item);
this.setState({ pointType: value });
this.setState({ pointType: value, searchValue: '' });
this.props.pointTypeChange(value);
}
onSearchChange = (e,v) => {
......@@ -180,7 +180,7 @@ class PointLeftTree extends Component {
}
render() {
let { treeData,pointTypeArr,pointType } = this.state;
let { treeData,pointTypeArr,pointType , searchValue } = this.state;
return (
<div className="leftTree">
<div className='leftContainer'>
......@@ -196,7 +196,7 @@ class PointLeftTree extends Component {
</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 className='treeBox'>
<Tree
......
......@@ -81,18 +81,18 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
componentWillMount = () => {
this.setState({ planStarted: this.props.planStarted });
};
componentDidMount() {
this.props.subscribe(eventTopics.base3d_view, (topic, data) => {
if (isPointEvent(topic)){
parseMarkers(this, topic, data);
} else if (isLevelFilter(topic)) {
parseLevelFilter(this, topic, data);
}
});
this.props.subscribe('base3d.fromws1.showFireTruckRoute', (topic, data) => {
parseMarkers(this, topic, data);
});
}
// componentDidMount() {
// this.props.subscribe(eventTopics.base3d_view, (topic, data) => {
// if (isPointEvent(topic)){
// parseMarkers(this, topic, data);
// } else if (isLevelFilter(topic)) {
// parseLevelFilter(this, topic, data);
// }
// });
// this.props.subscribe('base3d.fromws1.showFireTruckRoute', (topic, data) => {
// parseMarkers(this, topic, data);
// });
// }
componentWillReceiveProps = nextProps => {
if (nextProps.isEditMode) {
this.markersCache.eachValue(obj => {
......@@ -145,31 +145,9 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
that.setState({ isClick: true }); // 将isClick设置为true
}, 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 ) => {
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;
if (!obj.baseObjHelper.outlineHelper){
obj.baseObjHelper.setOutlineHelper(this.outlineHelper);
......@@ -211,7 +189,31 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
// }
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 = {}) => {
console.log(markers);
const { isEditMode } = this.props;
......@@ -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;
}
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