Commit 3361ed6d authored by 张博's avatar 张博

选择点闪烁

parent 1a4d9ff1
......@@ -47,7 +47,7 @@
delayTime: 10 // 屏保出现时间(单位:秒) 10s
},
//三维模型配置 yinan 沂南站 shm 上海庙站 sn 苏南 hainan 海南站
view3dFile:'/mods/components/3dviewConvertor/threeres/models/shm/index_dev.json',
view3dFile:'/mods/components/3dviewConvertor/threeres/models/yinan/index.json',
}
}
};
......
{
"sceneName": "station-shanghai-temple",
"basePath": "/threeres/models/shm/",
"basePath": "/mods/components/3dviewConvertor/threeres/models/shm/",
"models": [
{ "objName": "ground.obj", "mtlName": "ground.mtl", "modelLevel": "Park" },
{ "objName": "ji1diduanfatingshi.obj", "mtlName": "ji1diduanfatingshi.mtl", "modelLevel": "Building", "foreignKey": "valve-hall_01" },
......
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Connect, Modal, Tree, Select, Search, Button, Input,InputNumber, Form, Radio } from 'amos-framework';
import { Connect, Modal, Tree, Select, Search, Button, Input, InputNumber, Form, Radio } from 'amos-framework';
import * as endConf from 'amos-processor/lib/config/endconf';
import { getAreaTreeAction,saveAreaDataAction } from '../../services/moduleEditServices';
import { getAreaTreeAction, saveAreaDataAction } from '../../services/moduleEditServices';
import imgStatic from '../../consts/imgStatic';
const moduleEditIcon = imgStatic.moduleEditIcon;
......@@ -12,7 +12,6 @@ const Option = Select.Option;
const FormItem = Form.Item;
const RadioGroup = Radio.Group;
@eventConnect
class RightEditRegionPanel extends Component {
constructor(props) {
......@@ -20,40 +19,39 @@ class RightEditRegionPanel extends Component {
this.state = {
form: {},
rules: {},
treeDetailData:[],
treeDetailData: [],
detailData: {},
heightInput: 0
};
}
componentDidMount() {
console.log(JSON.stringify(this.props.detailData))
const { detailData,routePathData } = this.props;
this.mergeDetailData(detailData,routePathData);
console.log(JSON.stringify(this.props.detailData));
const { detailData, routePathData } = this.props;
this.mergeDetailData(detailData, routePathData);
}
componentWillUnmount() {
}
componentWillUnmount() {}
componentWillReceiveProps(nextProps) {
console.log(nextProps)
console.log(nextProps);
// if(this.props.detailData != nextProps.detailData || this.props.routePathData != nextProps.routePathData){
let { detailData,routePathData } = nextProps;
this.mergeDetailData(detailData,routePathData);
let { detailData, routePathData } = nextProps;
this.mergeDetailData(detailData, routePathData);
// }
}
mergeDetailData = (detailData,routePathData) => {
mergeDetailData = (detailData, routePathData) => {
let { heightInput } = this.state;
const { rightHeight } = this.props;
routePathData && routePathData.forEach(r => {
if(r.riskSourceId === detailData.id){
routePathData &&
routePathData.forEach(r => {
if (r.riskSourceId === detailData.id) {
detailData.routePath = r.routePath;
}
});
heightInput = detailData && detailData.routePath && detailData.routePath != '' && JSON.parse(detailData.routePath).regionHeigth || rightHeight;
heightInput = (detailData && detailData.routePath && detailData.routePath != '' && JSON.parse(detailData.routePath).regionHeigth) || rightHeight;
this.setState({ detailData, heightInput });
}
};
onChange = (key, e) => {
const value = e.target.value;
......@@ -62,104 +60,101 @@ class RightEditRegionPanel extends Component {
form: newForm,
heightInput: value
});
}
onNumberChange = (value) => {
const newForm = Object.assign({}, this.state.form, { 'positionZ': value });
};
onNumberChange = value => {
const newForm = Object.assign({}, this.state.form, { positionZ: value });
this.setState({
form: newForm,
heightInput: value
});
}
onRadioChange = (value) => {
const newForm = Object.assign({}, this.state.form, { 'isIndoor': value });
};
onRadioChange = value => {
const newForm = Object.assign({}, this.state.form, { isIndoor: value });
this.setState({
form: newForm
});
}
};
onHobbyChange = (value, item) => {
const newForm = Object.assign({}, this.state.form, { 'level': value });
const newForm = Object.assign({}, this.state.form, { level: value });
this.setState({
form: newForm
});
}
};
handleSubmit = (e) => {
handleSubmit = e => {
// e.preventDefault();
const {detailData} = this.state;
const { detailData } = this.state;
this.form.validate((valid, dataValues, errors) => {
console.log('返回内容:', dataValues, valid, errors);
if (valid) {
let routePathData=[ {
let routePathData = [
{
riskSourceId: detailData.id,
routePath: JSON.stringify({
routePath:JSON.parse(detailData.routePath).routePath,
regionHeigth:parseFloat(dataValues.positionZ)
})}]
routePath: JSON.parse(detailData.routePath).routePath,
regionHeigth: parseFloat(dataValues.positionZ)
})
}
];
// this.props.saveRoutePath(routePathData)
let routePathDataNode={
let routePathDataNode = {
riskSourceId: detailData.id,
routePath: JSON.stringify({
routePath:JSON.parse(detailData.routePath).routePath,
regionHeigth:parseFloat(dataValues.positionZ)
routePath: JSON.parse(detailData.routePath).routePath,
regionHeigth: parseFloat(dataValues.positionZ)
})
}
};
this.props.changeRoutePath(routePathDataNode);
this.props.closeRightPanel()
this.props.closeRightPanel();
} else {
console.log('error submit!!');
this.props.closeRightPanel()
this.props.closeRightPanel();
return false;
}
});
}
};
render() {
let { rules, form,pointTypeArr,pointType,detailData,heightInput } = this.state;
let { pageType,rightHeight } = this.props;
let { rules, form, pointTypeArr, pointType, detailData, heightInput } = this.state;
let { pageType, rightHeight } = this.props;
const formItemLayout = {
labelCol: {
xs: { span: 28 },
sm: { span: 3 },
className: 'colspanlab'
}
}
};
return (
<div className="rightEditPanel">
<div className='rightContainer'>
<div className="rightContainer">
<Form className="basic-demo" ref={component => this.form = component} model={form} rules={rules}>
<div className='topForm'>
<div className='rightTitle'>
<img src={moduleEditIcon.rightModalTitleIcon} alt='' />
<span className='titleText'>风险区域信息</span>
</div>
<div className='baseMsg'>
<div className='moduleTitle'>
<img src={moduleEditIcon.rightBaseMsgIcon} alt='' />
<span className='titleText'>基本信息</span>
</div>
<div className='moduleContent'>
<div className='msgItem'>
<div className='itemLabel'>风险名称</div>
<FormItem field="name" >
<Input value={detailData.name} disabled/>
<div className="topForm">
<div className="rightTitle">
<img src={moduleEditIcon.rightModalTitleIcon} alt="" />
<span className="titleText">风险区域信息</span>
</div>
<div className="baseMsg">
<div className="moduleTitle">
<img src={moduleEditIcon.rightBaseMsgIcon} alt="" />
<span className="titleText">基本信息</span>
</div>
<div className="moduleContent">
<div className="msgItem">
<div className="itemLabel">风险名称</div>
<FormItem field="name">
<Input value={detailData.name} disabled />
</FormItem>
</div>
<div className='msgItem'>
<div className='itemLabel'>参考编号</div>
<FormItem field="code" >
<Input
onChange={(e) => this.onChange('name', e)}
value={detailData.code}
disabled
/>
<div className="msgItem">
<div className="itemLabel">参考编号</div>
<FormItem field="code">
<Input onChange={e => this.onChange('name', e)} value={detailData.code} disabled />
</FormItem>
</div>
<div className='msgItem'>
<div className='itemLabel'>风险等级</div>
<FormItem field="level" >
<div className="msgItem">
<div className="itemLabel">风险等级</div>
<FormItem field="level">
{/* <Select value={form.level} onChange={this.onHobbyChange}>
<Option value="1">一级</Option>
<Option value="2">二级</Option>
......@@ -169,19 +164,18 @@ class RightEditRegionPanel extends Component {
</Select> */}
<Input value={detailData.level} disabled />
</FormItem>
</div>
</div>
</div>
<div className='3dMsg'>
<div className='moduleTitle'>
<img src={moduleEditIcon.right3dIcon} alt='' />
<span className='titleText'>三维信息</span>
<div className="3dMsg">
<div className="moduleTitle">
<img src={moduleEditIcon.right3dIcon} alt="" />
<span className="titleText">三维信息</span>
</div>
<div className='moduleContent'>
<div className='msgItem'>
<div className='itemLabel'>三维坐标</div>
<div className='position'>
<div className="moduleContent">
<div className="msgItem">
<div className="itemLabel">三维坐标</div>
<div className="position">
{/* <div className='positionItem'>
<FormItem label="长" field="positionX" {...formItemLayout}>
<Input value={detailData.ue4Location && detailData.ue4Location[0]} />
......@@ -192,13 +186,15 @@ class RightEditRegionPanel extends Component {
<Input value={detailData.ue4Location && detailData.ue4Location[1]} />
</FormItem>
</div> */}
<div className='positionItem'>
<FormItem label="高" field="positionZ" {...formItemLayout}>
<div className="itemLabel"></div>
<div className="positionItem">
<FormItem field="positionZ" {...formItemLayout}>
<InputNumber
placeholder={detailData.routePath && JSON.parse(detailData.routePath).regionHeigth || rightHeight}
placeholder={(detailData.routePath && JSON.parse(detailData.routePath).regionHeigth) || rightHeight}
value={heightInput}
min={0}
onChange={(e) => this.onNumberChange(e)}/>
onChange={e => this.onNumberChange(e)}
/>
{/* <Input value={detailData.ue4Location && detailData.ue4Location[2]} /> */}
</FormItem>
</div>
......@@ -207,23 +203,21 @@ class RightEditRegionPanel extends Component {
</div>
</div>
</div>
<div className='bottomBtns'>
<div className="bottomBtns">
<Button
className='sureBtn'
className="sureBtn"
onClick={() => {
this.handleSubmit()
}} ></Button>
this.handleSubmit();
}}
/>
<Button
className='cancelBtn'
className="cancelBtn"
onClick={() => {
this.props.closeRightPanel()
}} ></Button>
this.props.closeRightPanel();
}}
/>
</div>
</Form>
</div>
</div>
......@@ -233,7 +227,8 @@ class RightEditRegionPanel extends Component {
RightEditRegionPanel.propTypes = {
subscribe: PropTypes.func,
trigger: PropTypes.func
trigger: PropTypes.func,
rightHeight: PropTypes.number
};
export default RightEditRegionPanel;
......@@ -61,9 +61,11 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
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) {
this.setTwinkleConf(obj);
this.selectTwinkleConf(obj,1,'#FF0000');
} else {
this.selectTwinkleConf(obj,null,null);
}
});
}
......@@ -126,6 +128,18 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
pulsePeriod: pulsePeriod.toFixed(2)
});
};
selectTwinkleConf = (obj, mark,selectColor)=> {
let pulsePeriod = mark;
let color = selectColor;
if (!obj.baseObjHelper.outlineHelper) {
obj.baseObjHelper.setOutlineHelper(this.outlineHelper);
}
obj.baseObjHelper.style.outlineColor = color;
pulsePeriod &&
obj.baseObjHelper.outlineHelper.setConfig({
pulsePeriod: pulsePeriod.toFixed(2)
});
};
setTopCardConf = (obj, extData) => {
const { title, name } = extData;
......
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