Commit bc8e17ba authored by 张博's avatar 张博

bug

parent ef93eb7e
......@@ -123,7 +123,7 @@ class MaskContent extends Component {
<div className="mask-content">
<AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData} reconnect debug />
{ !alarmStarted && sideControlShow && <SideControl multiple={multiple} errorAreaId={errorAreaId} onItemClick={onItemClick} layerConfig={layerConfig} animationProps={controlAnimation} />}
{ !alarmStarted && <SearchPane visible={searchPaneVisible} focusPosition={focusPosition} changeSearchPaneVisible={() => this.changeSearchPaneVisible} />}
{ !alarmStarted && <SearchPane visible={searchPaneVisible} focusPosition={focusPosition} changeSearchPaneVisible={this.changeSearchPaneVisible} />}
<TopMsg alarmStart={alarmStart} />
{ !alarmStarted && !isShowActionBar && <ModelHeader animationProps={controlAnimation} headerName={headerName} handleExceptModel={this.handleExceptModel} />}
{ !alarmStarted && isShowActionBar && <ActionBar activeAction={activeAction} onActionItemClick={(e) => this.actionBarClick(e)} animationProps={controlAnimation} /> }
......
......@@ -53,6 +53,7 @@ class PointsPool extends Component {
}
onMarkersCreated = (type, { markersCache }) => {
this.markerList[type] = markersCache;
(markersCache || []).forEach(mc => {
const extData = mc.getExtData();
......
......@@ -14,15 +14,20 @@ class PromptModal extends Component {
}
};
saveData = () => {
const { isback, type } = this.props.promptData;
if (isback) {
this.props.handleOutExceptModel();
}
const { isback, type,pointType,pointParams } = this.props.promptData;
this.props.closePromptModal();
if (type === 'region') {
this.props.saveAreaData();
} else {
this.props.savePointData();
if (isback){
this.props.savePointData();
} else {
this.props.savePointAndRefreshMarker(pointType,pointParams);
}
}
if (isback) {
this.props.handleOutExceptModel();
}
};
render() {
......@@ -34,7 +39,7 @@ class PromptModal extends Component {
content={
<div className="prompt-content">
<div>{promptData.promptContent}</div>
{promptData.btnType == 'isOk' ? (
{promptData.btnType === 'isOk' ? (
<div className="prompt-buttons">
<span className={'promptOk'} onClick={this.saveData} />
<span className={'promptNo'} onClick={this.cancel} />
......
......@@ -991,7 +991,17 @@ class View3D extends Component {
pointType: selectPoints.type,
position3d: ``
});
this.savePointAndRefreshMarker(pointType,pointParams);
this.setState({ promptData: {
promptvisible: true,
promptContent: '确定将选中删除?',
type: 'point',
btnType: 'isOk',
isback: false,
pointType,
pointParams
}
});
//this.savePointAndRefreshMarker(pointType,pointParams);
} else if (selectPoints && selectPoints.isRegion && selectPoints.children){
let pointParams = [];
pointParams = selectPoints.children.filter(e => e.position3d && e.position3d.length > 0).map(item=>{
......@@ -1001,13 +1011,15 @@ class View3D extends Component {
position3d: ''
};
});
this.savePointAndRefreshMarker(pointType,pointParams);
//this.savePointAndRefreshMarker(pointType,pointParams);
this.setState({ promptData: {
promptvisible: true,
promptContent: '是否删除该区域下所有点?',
type: 'point',
btnType: 'isOk',
isback: false
isback: false,
pointType,
pointParams
}
});
}
......@@ -1147,12 +1159,13 @@ class View3D extends Component {
this.setState({
pointType,
treeData: [],
treeDataList: [],
selectArea: '',
selectPoints: '',
dragItem: ''
});
getPointTreeAction(pointType).then(data => {
//alert(JSON.stringify(data))
this.generateList(data);
this.getPointList(pointType,data);
this.setState({
pointType,
......@@ -1207,6 +1220,7 @@ class View3D extends Component {
}
const isInside = this.polygonRegion[dragItem.parentId].pointInPolygon([position.x,position.y,position.z]);
console.log(isInside);
if (dragItem) {
if (isInside === false) {
message.danger('只能放置在当前区域');
......@@ -1271,28 +1285,6 @@ class View3D extends Component {
});
}
}
changeMarkerType = (item, isCancel) => {
const { markers } = this.state;
if (item.isLine) {
this.setState({
toggleRoad: !isCancel
});
} else {
if (isCancel) {
markers[item.type] = [];
this.setState({
markers
});
} else {
// if (totalDelta < mousewheelCount) {
this.asyncLoadMarkerData(item.type);
}
}
};
asyncLoadMarkerData = (markerType, riskSourceId) => {
const { markers } = this.state;
this.setState({ showMap: false });
......@@ -1702,6 +1694,7 @@ class View3D extends Component {
<PromptModal promptData={promptData}
saveAreaData={this.saveAreaData}
handleOutExceptModel={this.handleOutExceptModel}
savePointAndRefreshMarker={(pointType,pointParams)=>this.savePointAndRefreshMarker(pointType,pointParams)}
savePointData={this.savePointData}
closePromptModal={this.closePromptModal}
/>
......
......@@ -10,7 +10,7 @@ const getParentKey = (key, tree) => {
let parentKey;
for (let i = 0; i < tree.length; i++) {
const node = tree[i];
if (node.children && node.children.length >0) {
if (node.children && node.children.length > 0) {
if (node.children.some(item => item.id === key)) {
parentKey = node.id;
} else if (getParentKey(key, node.children)) {
......@@ -39,40 +39,9 @@ class AreaLeftTree extends Component {
}
componentDidMount() {
let {treeData,pointTypeArr,treeDataList} = this.props;
this.setState({
treeData,
treeDataList,
pointTypeArr,
pointType: pointTypeArr[0]?pointTypeArr[0].code:''
})
}
componentWillUnmount() {
}
componentWillReceiveProps(nextProps) {
console.log(nextProps)
let {treeData,pointTypeArr,pageType,treeDataList} = nextProps;
this.setState({
treeData,
pointTypeArr,
treeDataList,
pointType: pointTypeArr[0]?pointTypeArr[0].code:''
})
}
onSearchChange =(e,value) => {
// onSelectChange = (value, item) =>{
// console.log(value, item);
// this.state.pointType = value;
// this.props.pointTypeChange(value);
// }
onSearchChange = e => {
const {treeDataList,treeData} = this.state
const value = e.target.value;
const { treeDataList,treeData } = this.props;
const expandedKeys = treeDataList
.map(item => {
if (item.title.indexOf(value) > -1) {
......@@ -98,44 +67,16 @@ class AreaLeftTree extends Component {
autoExpandParent: false
});
}
// onCheck = (checkedKeys,e) => {
// console.log('onCheck', checkedKeys);
// // console.log('onCheck', e);
// let currentKey = checkedKeys.checked[0]?checkedKeys.checked[checkedKeys.checked.length-1]:'';
// if (checkedKeys.checked.length<2) {
// currentKey = checkedKeys.checked[0]
// } else {
// if (checkedKeys.checked[0] == this.state.checkedKeys[0]) {
// currentKey = checkedKeys.checked[1]
// } else {
// currentKey = checkedKeys.checked[0]
// }
// }
// // checkedKeys[0] = checkedKeys[checkedKeys.length - 1]
// this.setState({ checkedKeys: currentKey?[currentKey]:[] });
// this.props.selectItemChange(currentKey);
// if (currentKey) {
// this.props.startDrow(currentKey);
// }else {
// this.props.stopDrowing()
// }
// }
drowArea = (editItem) => {
}
onTreeSelect = (selectedKeys, info) => {
console.log('onSelect', info);
let selectItem = info.node.props.dataRef;
this.setState({ selectedKeys });
this.props.selectItemChange(selectItem);
}
// onClick={(e)=>{e.nativeEvent.stopImmediatePropagation();e.stopPropagation();console.log(123123);}}
renderTreeNodes = (data) => {
let {searchValue} =this.state
// console.log(data);
if (data.length>0) {
let { searchValue } = this.state;
if (data.length > 0) {
return data.map((item) => {
const index = item.name.indexOf(searchValue);
const beforeStr = item.name.substr(0, index);
......@@ -152,14 +93,14 @@ class AreaLeftTree extends Component {
);
if (item.children) {
return (
<TreeNode
title={
<div>
{
<span >
{title}
<span className='icon'>
{
<TreeNode
title={
<div>
{
<span >
{title}
<span className='icon'>
{
item.isBind ? '' :
<img
src={moduleEditIcon.editBtn}
......@@ -170,18 +111,18 @@ class AreaLeftTree extends Component {
}}
/>
}
{
{
item.isBind ? <img src={moduleEditIcon.bindedTip} alt='' /> :
item.routePath ? <img src={moduleEditIcon.noSaveTip} alt='' /> :
<img src={moduleEditIcon.noSaveTip} alt='' />
}
</span>
</span>
</span>
}
</div>
</div>
}
key={item.id}
dataRef={item}
key={item.id}
dataRef={item}
>
{this.renderTreeNodes(item.children)}
</TreeNode>
......@@ -192,44 +133,45 @@ class AreaLeftTree extends Component {
}
render() {
let { treeData, checkedKeys,pointTypeArr,pointType} = this.state;
let { pageType } = this.props;
return (
let { treeData } = this.props;
return (
<div className="leftTree">
<div className='leftContainer'>
<div className='topForm'>
<Search className='leftSearch' icon="search" onChange={this.onSearchChange} onIconClick={this.onSearchChange} />
</div>
<div className='treeBox'>
<Tree
<div className='leftContainer'>
<div className='topForm'>
<Search className='leftSearch' icon="search" onChange={this.onSearchChange} onIconClick={this.onSearchChange} />
</div>
<div className='treeBox'>
<Tree
// checkable
// checkStrictly
selectable={true}
onExpand={this.onExpand}
expandedKeys={this.state.expandedKeys}
autoExpandParent={true}
selectable
onExpand={this.onExpand}
expandedKeys={this.state.expandedKeys}
autoExpandParent
// onCheck={this.onCheck}
// checkedKeys={checkedKeys}
onSelect={this.onTreeSelect}
selectedKeys={this.state.selectedKeys}
blockNode
>
{this.renderTreeNodes(treeData)}
</Tree>
</div>
<div className='bottomBtns'>
<Button
className='sureBtn'
onClick={() => {
this.props.saveAreaData()
}} ></Button>
<Button
className='deleteBtn'
onClick={() => {
this.props.deleteAreaBind()
}} ></Button>
</div>
onSelect={this.onTreeSelect}
selectedKeys={this.state.selectedKeys}
blockNode
>
{this.renderTreeNodes(treeData)}
</Tree>
</div>
<div className='bottomBtns'>
<Button
className='sureBtn'
onClick={() => {
this.props.saveAreaData();
}}
/>
<Button
className='deleteBtn'
onClick={() => {
this.props.deleteAreaBind();
}}
/>
</div>
</div>
</div>
);
......
......@@ -43,34 +43,14 @@ class PointLeftTree extends Component {
}
componentDidMount() {
let { treeData, pointTypeArr, treeDataList } = this.props;
this.setState({
treeData,
treeDataList,
pointTypeArr,
pointType: pointTypeArr[0]?pointTypeArr[0].code:''
});
// console.log(this.props)
}
componentWillReceiveProps(nextProps) {
console.log(nextProps);
let { treeData,treeDataList } = nextProps;
this.setState({
treeData,
treeDataList
});
}
onSelectChange = (value, item) =>{
console.log(value, item);
this.setState({ pointType: value });
this.props.pointTypeChange(value);
}
onSearchChange = e => {
const { treeDataList,treeData } = this.state;
const value = e.target.value;
onSearchChange =(e,value) => {
const { treeDataList,treeData } = this.props;
const expandedKeys = treeDataList
.map(item => {
if (item.title.indexOf(value) > -1) {
......@@ -121,40 +101,40 @@ class PointLeftTree extends Component {
);
if (item.children) {
return (
<TreeNode
title={
<div>
{item.isRegion ?
<span>
{title}
<span className='icon'>
{
<TreeNode
title={
<div>
{item.isRegion ?
<span>
{title}
<span className='icon'>
{
item.isRegion ? item.isBind ? <img src={moduleEditIcon.bindedTip} alt='' /> :
<img src={moduleEditIcon.nobindTip} alt='' /> :
item.isBind ? <img src={moduleEditIcon.bindedTip} alt='' /> :
item.position3d ? <img src={moduleEditIcon.noSaveTip} alt='' /> :
<img src={moduleEditIcon.nobindTip} alt='' />
}
</span>
</span> :
<span
draggable
onDragStart={() => {
this.props.dragItemChange(item);
}}
>
{title}
<span className='icon'>
{
</span>
</span> :
<span
draggable
onDragStart={() => {
this.props.dragItemChange(item);
}}
>
{title}
<span className='icon'>
{
item.isRegion ? item.isBind ? <img src={moduleEditIcon.bindedTip} alt='' /> :
<img src={moduleEditIcon.nobindTip} alt='' /> :
item.isBind ? <img src={moduleEditIcon.bindedTip} alt='' /> :
item.position3d ? <img src={moduleEditIcon.noSaveTip} alt='' /> :
<img src={moduleEditIcon.nobindTip} alt='' />
}
</span>
</span>}
</div>
</span>
</span>}
</div>
}
key={item.id}
dataRef={item}
......@@ -179,7 +159,8 @@ class PointLeftTree extends Component {
this.props.selectPointChange(selectItem);
}
render() {
let { treeData,pointTypeArr,pointType } = this.state;
const { treeData,pointTypeArr } = this.props;
const pointType = pointTypeArr[0] ? pointTypeArr[0].code : '';
return (
<div className="leftTree">
<div className='leftContainer'>
......
......@@ -2,13 +2,13 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { utils } from 'amos-tool';
import { Markers } from 'amos-3d/lib/designer';
import { BaseObjHelper } from 'base-r3d/lib/factory';
import formatUrl from 'amos-processor/lib/utils/urlFormat';
import { CONSTS } from './../../consts/storageConsts';
import PointDialog from './PointDialog';
import { tirggerPlanTopic } from './../dataProcessor';
import { marker3DIoncMapper, markerTitleBgMapper } from './../../consts/imgStatic';
import MarkerIcon from './MarkerIcon';
import { eventTopics, isPointEvent , isLevelFilter } from './../consts';
import { parseMarkers, parseLevelFilter } from '../dataProcessor';
const getIcon = (markerType, level) => {
// return marker3DIoncMapper[`${markerType}_${level}`];
......@@ -18,17 +18,17 @@ const getIcon = (markerType, level) => {
return marker3DIoncMapper[`${markerType}`];
};
const createMarkerLabel = text => {
const div = document.createElement('div');
div.style.position = 'absolute';
div.style.marginTop = '-3rem';
div.className = 'three-ui-anchor';
div.innerText = text;
return div;
};
// const createMarkerLabel = text => {
// const div = document.createElement('div');
// div.style.position = 'absolute';
// div.style.marginTop = '-3rem';
// div.className = 'three-ui-anchor';
// div.innerText = text;
// return div;
// };
const urlMapper = {
fireCar: { file: 'fire-car', label: '消防车' },
fireEquipment: { file: 'pool', label: '消防' },
fireEquipment: { file: 'fireEquip', label: '消防设备' },
fireFoamRoom: { file: 'fireFoam', label: '泡沫间' },
fireChamber: { file: 'fireChamber', label: '消防室' },
hydrant: { file: 'hydrant', label: '消防栓' },
......@@ -47,6 +47,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
constructor(props) {
super(props);
this.markerList = {};
this.markerEvents = {
click: this.onMarkerClick,
// dblclick: this.onMarkerDblClick,
......@@ -83,12 +84,23 @@ 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);
});
}
componentWillReceiveProps = nextProps => {
if (nextProps.isEditMode) {
this.markersCache.eachValue(obj => {
// this.setTopCardConf(obj, obj.extData);
if (nextProps.selectPoints.type == obj.extData.type && nextProps.selectPoints.id == obj.extData.id) {
if (nextProps.selectPoints.type === obj.extData.type && nextProps.selectPoints.id === obj.extData.id) {
this.setTwinkleConf(obj);
}
});
......@@ -150,16 +162,15 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
this.outlineHelper = this.stagePilot ? this.stagePilot.outlineHelper : undefined;
markersCache.eachValue(obj => {
this.setTopCardConf(obj, obj.extData);
if (obj.extData.type === 'riskSource' && markerType != 'impEquipmentMode' && !isEditMode) {
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 color = twinkle && frequency != 0 ? '#FF0000' : 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);
}
......
......@@ -261,14 +261,18 @@ class SearchPane extends Component {
}
}
closeModal(){
this.props.changeSearchPaneVisible();
this.setState({ activeKey: 'search' },()=>this.paramsOnChange([]));
}
render() {
const { dataList,activeKey,retrieveType,totalCount,msgDataList,recordDataList,trajectoryDataList } = this.state;
return (
<div>
{ this.props.visible && <div className="search-pane-bg" /> }
{ this.props.visible && <SidePane className="search-pane">
<div className="search-pane-close" onClick={this.props.changeSearchPaneVisible()}>
<div className="search-pane-close" onClick={()=>this.closeModal()}>
<Icon icon="close" />
</div>
<Tabs
......
......@@ -3,8 +3,7 @@ import PropTypes from 'prop-types';
import { SidePane } from 'amos-framework';
import { Store } from 'amos-tool';
import BizControlPane from './BizControlPane';
import InnateControlPane from './InnateControlPane';
import { viewController, bizControls } from './../conf';
import { bizControls } from './../conf';
const loginUserName = Store.lsTool.read('userName');
const filterUser = ['tianbo', 'opera1', 'opera2'];
......@@ -54,7 +53,7 @@ class SideControl extends Component {
};
render() {
const { layerConfig, animationProps } = this.props;
const { animationProps } = this.props;
let _bizControls = bizControls;
if (filterUser.includes(loginUserName)) {
let target = _bizControls.find(item => item.key === 'fireResource-point');
......
This diff is collapsed.
This diff is collapsed.
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