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

风险点,风险区域

parent af248adc
.ModuleEditPage { .ModuleEditPage {
position: relative; position: relative;
height: 100%; height: 100%;
::-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);
}
.topBox { .topBox {
position: absolute; position: absolute;
top: 34px; top: 34px;
...@@ -158,6 +171,7 @@ ...@@ -158,6 +171,7 @@
height: 100%; height: 100%;
padding: 32px 0; padding: 32px 0;
.rightContainer { .rightContainer {
position: relative;
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: rgba(10, 53, 62, 0.68); background-color: rgba(10, 53, 62, 0.68);
...@@ -165,7 +179,8 @@ ...@@ -165,7 +179,8 @@
padding: 12px; padding: 12px;
color: #fff; color: #fff;
.basic-demo{ .basic-demo{
height: calc(100% - 48px); height: calc(100% - 53px);
overflow-y: auto;
} }
.amos-form-item-label { .amos-form-item-label {
color: #fff; color: #fff;
...@@ -207,8 +222,11 @@ ...@@ -207,8 +222,11 @@
} }
} }
.bottomBtns { .bottomBtns {
position: absolute;
bottom:15px;
padding-top: 15px; padding-top: 15px;
text-align: center; left:50%;
margin-left: -100px;
.sureBtn { .sureBtn {
width: 100px; width: 100px;
height: 33px; height: 33px;
......
...@@ -209,6 +209,7 @@ class View3D extends Component { ...@@ -209,6 +209,7 @@ class View3D extends Component {
}; };
componentWillUnmount() { componentWillUnmount() {
if (this.timer) { if (this.timer) {
clearTimeout(this.timer); clearTimeout(this.timer);
} }
...@@ -530,12 +531,11 @@ class View3D extends Component { ...@@ -530,12 +531,11 @@ class View3D extends Component {
let { markers } = this.state let { markers } = this.state
getPointListAction().then(data => { getPointListAction().then(data => {
// console.log(data); // console.log(data);
for (let i = 0; i < data.length;i++) console.log(JSON.stringify(data))
for (let i = 0; i < data.length;i++){
markers[data[i].type].push(data[i]) markers[data[i].type].push(data[i])
this.setState({ }
markers this.setState({markers})
})
}) })
} }
startDrow = (areaItem) => { startDrow = (areaItem) => {
...@@ -798,11 +798,17 @@ class View3D extends Component { ...@@ -798,11 +798,17 @@ class View3D extends Component {
saveAreaData = () => { saveAreaData = () => {
let { treeData, routePathData, pageType } = this.state; let { treeData, routePathData, pageType } = this.state;
let routePathParams = []; let routePathParams = [];
console.log(routePathData) //console.log(routePathData)
saveAreaDataAction(routePathData).then(d => { saveAreaDataAction(routePathData).then(d => {
message.success('保存成功!'); message.success('保存成功!');
this.a3dRef.changeDrawState(PEN_STATE.CLEARED);//清除当前路径
// 结束绘制
this.setState({
drawing: false
});
getAreaTreeAction().then(data => { getAreaTreeAction().then(data => {
console.log(data); //console.log(data);
console.log(JSON.stringify(data))
this.setState({ this.setState({
treeData:data || [] treeData:data || []
}) })
...@@ -813,7 +819,7 @@ class View3D extends Component { ...@@ -813,7 +819,7 @@ class View3D extends Component {
} }
//保存点绑定 //保存点绑定
savePointData = () => { savePointData = () => {
let { markers } = this.state; let { markers ,pointTypeArr} = this.state;
let paramsArr = []; let paramsArr = [];
for ( let key in markers ){ for ( let key in markers ){
let item = markers[key]; let item = markers[key];
...@@ -826,23 +832,39 @@ class View3D extends Component { ...@@ -826,23 +832,39 @@ class View3D extends Component {
} }
} }
savePointListAction(paramsArr).then(data => { savePointListAction(paramsArr).then(data => {
console.log(data); getPointTreeAction(pointTypeArr[0].code || '').then(data => {
this.setState({
pointType: pointTypeArr[0].code || '',
treeData: data || [],
pageType: 'point',
showRightPanel: false
});
});
}) })
} }
// 删除点绑定 // 删除点绑定
deletePointBind = () => { deletePointBind = () => {
let { selectPoints } = this.state; let { selectPoints ,pointTypeArr,markers} = this.state;
if (selectPoints) { if (selectPoints) {
let pointParams = []; let pointParams = [];
pointParams.push({ pointParams.push({
pointId: selectPoints.id, pointId: selectPoints.id,
pointType: selectPoints.type, pointType: selectPoints.type,
position3d: `${selectPoints.position.x},${selectPoints.position.y},${selectPoints.position.z}` position3d: ``
}) })
savePointListAction(pointParams).then(data => { savePointListAction(pointParams).then(data => {
console.log(data); getPointTreeAction(pointTypeArr[0].code || '').then(data => {
this.getPointList()
this.setState({
pointType: pointTypeArr[0].code || '',
treeData: data || [],
pageType: 'point',
showRightPanel: false
});
});
}) })
} }
} }
...@@ -856,9 +878,9 @@ class View3D extends Component { ...@@ -856,9 +878,9 @@ class View3D extends Component {
routePath: '' routePath: ''
}) })
saveAreaDataAction(areaParams).then(d => { saveAreaDataAction(areaParams).then(d => {
message.success('删除成功!'); message.success('删除成功!');
getAreaTreeAction().then(data => { getAreaTreeAction().then(data => {
console.log(data);
this.setState({ this.setState({
treeData:data || [] treeData:data || []
}) })
...@@ -885,7 +907,6 @@ class View3D extends Component { ...@@ -885,7 +907,6 @@ class View3D extends Component {
}); });
} else { } else {
getPointTreeAction(pointTypeArr[0].code || '').then(data => { getPointTreeAction(pointTypeArr[0].code || '').then(data => {
console.log(data);
this.setState({ this.setState({
pointType: pointTypeArr[0].code || '', pointType: pointTypeArr[0].code || '',
treeData: data || [], treeData: data || [],
...@@ -896,8 +917,11 @@ class View3D extends Component { ...@@ -896,8 +917,11 @@ class View3D extends Component {
} }
} }
pointTypeChange = (pointType) => { pointTypeChange = (pointType) => {
this.setState({
pointType,
treeData:[]
});
getPointTreeAction(pointType).then(data => { getPointTreeAction(pointType).then(data => {
console.log(data);
this.setState({ this.setState({
pointType, pointType,
treeData: data || [] treeData: data || []
...@@ -963,7 +987,7 @@ class View3D extends Component { ...@@ -963,7 +987,7 @@ class View3D extends Component {
levelStr: 'level_2' levelStr: 'level_2'
}; };
markers.riskSource.push(addPointParam); markers.riskSource.push(addPointParam);
console.log(markers);
this.setState({ this.setState({
markers markers
}); });
...@@ -1234,9 +1258,9 @@ class View3D extends Component { ...@@ -1234,9 +1258,9 @@ class View3D extends Component {
} }
getExceptionAreasList = () => { getExceptionAreasList = () => {
exceptionRegionListAction().then(data=>{ // exceptionRegionListAction().then(data=>{
this.setState({ exceptionAreas: data }); // this.setState({ exceptionAreas: data });
}); // });
} }
initExceptionAreasData = ()=>{ initExceptionAreasData = ()=>{
...@@ -1271,6 +1295,7 @@ class View3D extends Component { ...@@ -1271,6 +1295,7 @@ class View3D extends Component {
} else if (type === 'out_except_model'){ } else if (type === 'out_except_model'){
this.props.editModelChange(false);//显示全景统计 this.props.editModelChange(false);//显示全景统计
this.setState({ this.setState({
treeData:[],
sideControlShow: false, //隐藏耳朵 sideControlShow: false, //隐藏耳朵
isShowActionBar: true, //显示工具栏 isShowActionBar: true, //显示工具栏
startLoadExceptionArea: true, //显示marker, startLoadExceptionArea: true, //显示marker,
......
...@@ -43,7 +43,7 @@ class RightEditPointPanel extends Component { ...@@ -43,7 +43,7 @@ class RightEditPointPanel extends Component {
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
let {detailData}=this.props let {detailData}=nextProps
getPointTreeDetailAction(detailData.id,detailData.type).then(data => { getPointTreeDetailAction(detailData.id,detailData.type).then(data => {
console.log(data); console.log(data);
this.setState({ this.setState({
...@@ -95,7 +95,6 @@ class RightEditPointPanel extends Component { ...@@ -95,7 +95,6 @@ class RightEditPointPanel extends Component {
render() { render() {
let { rules, form,pointTypeArr,pointType ,detailData} = this.state; let { rules, form,pointTypeArr,pointType ,detailData} = this.state;
let { pageType } = this.props; let { pageType } = this.props;
const formItemLayout = { const formItemLayout = {
labelCol: { labelCol: {
xs: { span: 28 }, xs: { span: 28 },
...@@ -106,10 +105,9 @@ class RightEditPointPanel extends Component { ...@@ -106,10 +105,9 @@ class RightEditPointPanel extends Component {
return ( return (
<div className="rightEditPanel"> <div className="rightEditPanel">
<div className='rightContainer'> <div className='rightContainer'>
<Form className="basic-demo" ref={component => this.form = component} model={form} rules={rules}> <Form className="basic-demo" ref={component => this.form = component} model={form} rules={rules}>
<div className='topForm'> <div className='topForm'>
<div className='rightTitle'> <div className='rightTitle'>
<img src='/mods/components/3dviewConvertor/assets/convertor/moduleEdit/rightModalTitleIcon.png'/> <img src='/mods/components/3dviewConvertor/assets/convertor/moduleEdit/rightModalTitleIcon.png'/>
<span className='titleText'>风险点信息</span> <span className='titleText'>风险点信息</span>
</div> </div>
...@@ -198,7 +196,10 @@ class RightEditPointPanel extends Component { ...@@ -198,7 +196,10 @@ class RightEditPointPanel extends Component {
</div> </div>
</div> </div>
</div> </div>
<div className='bottomBtns'>
</Form>
<div className='bottomBtns'>
<Button <Button
className='sureBtn' className='sureBtn'
onClick={() => { onClick={() => {
...@@ -210,9 +211,8 @@ class RightEditPointPanel extends Component { ...@@ -210,9 +211,8 @@ class RightEditPointPanel extends Component {
// this.props.save() // this.props.save()
}} ></Button> }} ></Button>
</div> </div>
</Form>
</div> </div>
</div> </div>
); );
} }
......
...@@ -27,7 +27,7 @@ class RightEditRegionPanel extends Component { ...@@ -27,7 +27,7 @@ class RightEditRegionPanel extends Component {
} }
componentDidMount() { componentDidMount() {
console.log(JSON.stringify(this.props.detailData)) console.log(JSON.stringify(this.props.detailData))
// getAreaTreeDetailAction().then(data => { // getAreaTreeDetailAction().then(data => {
// console.log(data); // console.log(data);
// this.setState({ // this.setState({
...@@ -76,7 +76,7 @@ console.log(JSON.stringify(this.props.detailData)) ...@@ -76,7 +76,7 @@ console.log(JSON.stringify(this.props.detailData))
handleSubmit = (e) => { handleSubmit = (e) => {
// e.preventDefault(); // e.preventDefault();
this.form.validate((valid, dataValues, errors) => { this.form.validate((valid, dataValues, errors) => {
alert(JSON.stringify(dataValues))
console.log('返回内容:', dataValues, valid, errors); console.log('返回内容:', dataValues, valid, errors);
if (valid) { if (valid) {
//AmosAlert.success('结果', JSON.stringify(dataValues)); //AmosAlert.success('结果', JSON.stringify(dataValues));
...@@ -156,7 +156,7 @@ console.log(JSON.stringify(this.props.detailData)) ...@@ -156,7 +156,7 @@ console.log(JSON.stringify(this.props.detailData))
<div className='msgItem'> <div className='msgItem'>
<div className='itemLabel'>三维坐标</div> <div className='itemLabel'>三维坐标</div>
<div className='position'> <div className='position'>
<div className='positionItem'> {/* <div className='positionItem'>
<FormItem label="长" field="positionX" {...formItemLayout}> <FormItem label="长" field="positionX" {...formItemLayout}>
<Input value={detailData.ue4Location && detailData.ue4Location[0]} /> <Input value={detailData.ue4Location && detailData.ue4Location[0]} />
</FormItem> </FormItem>
...@@ -165,10 +165,11 @@ console.log(JSON.stringify(this.props.detailData)) ...@@ -165,10 +165,11 @@ console.log(JSON.stringify(this.props.detailData))
<FormItem label="宽" field="positionY" {...formItemLayout}> <FormItem label="宽" field="positionY" {...formItemLayout}>
<Input value={detailData.ue4Location && detailData.ue4Location[1]} /> <Input value={detailData.ue4Location && detailData.ue4Location[1]} />
</FormItem> </FormItem>
</div> </div> */}
<div className='positionItem'> <div className='positionItem'>
<FormItem label="高" field="positionZ" {...formItemLayout}> <FormItem label="高" field="positionZ" {...formItemLayout}>
<Input value={detailData.ue4Location && detailData.ue4Location[2]} /> <Input defaultValue={0} onChange={(e) => this.onChange('positionZ', e)}/>
{/* <Input value={detailData.ue4Location && detailData.ue4Location[2]} /> */}
</FormItem> </FormItem>
</div> </div>
</div> </div>
...@@ -177,16 +178,20 @@ console.log(JSON.stringify(this.props.detailData)) ...@@ -177,16 +178,20 @@ console.log(JSON.stringify(this.props.detailData))
</div> </div>
</div> </div>
<div className='bottomBtns'> <div className='bottomBtns'>
<Button <Button
className='sureBtn' className='sureBtn'
onClick={() => { onClick={() => {
this.handleSubmit() this.handleSubmit()
}} ></Button> }} ></Button>
<Button <Button
className='cancelBtn' className='cancelBtn'
onClick={() => { onClick={() => {
// this.props.save() // this.props.save()
}} ></Button> }} ></Button>
</div> </div>
</Form> </Form>
......
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