Commit c092a97f authored by 张博's avatar 张博

区域点,树详情ui 及接口调试

parent a5063aa1
...@@ -130,6 +130,8 @@ export const FasSerUrl = { ...@@ -130,6 +130,8 @@ export const FasSerUrl = {
export const ModuleEditUrl = { export const ModuleEditUrl = {
getAreaTreeUrl:completePrefix(convertorURI, 'api/view3d/region/tree'),// getAreaTreeUrl:completePrefix(convertorURI, 'api/view3d/region/tree'),//
getAreaTreeDetailUrl:completePrefix(convertorURI, 'api/view3d/region/detail'),//
getPointTreeDetailUrl:completePrefix(convertorURI, 'api/view3d/point/detail?type={type}&pointId={pointId}'),//
getPointTreeUrl:completePrefix(convertorURI, 'api/view3d/point/tree'), getPointTreeUrl:completePrefix(convertorURI, 'api/view3d/point/tree'),
saveAreaDataUrl:completePrefix(convertorURI, 'api/view3d/region/bind'),// saveAreaDataUrl:completePrefix(convertorURI, 'api/view3d/region/bind'),//
getPointTypeUrl:completePrefix(convertorURI, 'api/view3d/point/type'), getPointTypeUrl:completePrefix(convertorURI, 'api/view3d/point/type'),
......
...@@ -34,14 +34,19 @@ export const saveDesignAction = object => { ...@@ -34,14 +34,19 @@ export const saveDesignAction = object => {
export const getAreaTreeAction = () => { export const getAreaTreeAction = () => {
return commonGet(ModuleEditUrl.getAreaTreeUrl); return commonGet(ModuleEditUrl.getAreaTreeUrl);
} }
export const getAreaTreeDetailAction = (id) => {
return commonGet(`${ModuleEditUrl.getPointTreeDetailUrl}/${id}`);
}
export const getPointTreeDetailAction = (pointId, type ) => {
return commonGet(formatUrl(ModuleEditUrl.getPointTreeDetailUrl,{ pointId, type }));
}
export const getPointTreeAction = (type) => { export const getPointTreeAction = (type) => {
return commonGet(`${ModuleEditUrl.getPointTreeUrl}/${type}`); return commonGet(`${ModuleEditUrl.getPointTreeUrl}/${type}`);
} }
/** /**
* 保存区域 * 保存区域
* @param {*} routePathParams * @param {*} routePathParams
*/ */
export const saveAreaDataAction = (routePathParams) => { export const saveAreaDataAction = (routePathParams) => {
return commonPost(ModuleEditUrl.saveAreaDataUrl, routePathParams); return commonPost(ModuleEditUrl.saveAreaDataUrl, routePathParams);
...@@ -52,8 +57,8 @@ export const getPointTypeAction = () => { ...@@ -52,8 +57,8 @@ export const getPointTypeAction = () => {
} }
/** /**
* 获取风险点 * 获取风险点
* @param {点类型} type * @param {点类型} type
* @param {区域id} riskSourceId * @param {区域id} riskSourceId
*/ */
export const getPointListAction = (type,riskSourceId) => { export const getPointListAction = (type,riskSourceId) => {
if (type) { if (type) {
...@@ -61,13 +66,13 @@ export const getPointListAction = (type,riskSourceId) => { ...@@ -61,13 +66,13 @@ export const getPointListAction = (type,riskSourceId) => {
} else { } else {
return commonGet(`${ModuleEditUrl.getPointListUrl}`); return commonGet(`${ModuleEditUrl.getPointListUrl}`);
} }
} }
/** /**
* 保存风险点 * 保存风险点
* @param {*} bindParams * @param {*} bindParams
*/ */
export const savePointListAction = (bindParams) => { export const savePointListAction = (bindParams) => {
return commonPost(ModuleEditUrl.savePointListUrl, bindParams); return commonPost(ModuleEditUrl.savePointListUrl, bindParams);
} }
\ No newline at end of file
...@@ -164,17 +164,46 @@ ...@@ -164,17 +164,46 @@
border: 1px solid rgba(46, 217, 239, 0.59); border: 1px solid rgba(46, 217, 239, 0.59);
padding: 12px; padding: 12px;
color: #fff; color: #fff;
.basic-demo{
height: calc(100% - 48px);
}
.amos-form-item-label { .amos-form-item-label {
color: #fff; color: #fff;
} }
.topForm { .topForm {
.rightTitle{
margin-left: -15px;
.titleText{
margin-left: 5px;
}
}
.amos-input{
background-color: rgba(4, 30, 36,0.4);
border-radius: 1px;
border: solid 1px rgba(46, 217, 239, 0.59);
font-size: 14px;
color:#fff;
}
.moduleTitle{
height: 50px;
display: flex;
align-items: center;
.titleText{
margin-left: 5px;
}
}
height: calc(100% - 48px); height: calc(100% - 48px);
padding-left: 20px;
.amos-input { .amos-input {
width: 100%; width: 100%;
} }
.amos-select { .amos-select {
width: 100%; width: 100%;
} }
.radio-text{
color:#fff
}
} }
} }
.bottomBtns { .bottomBtns {
......
...@@ -109,8 +109,8 @@ class MaskContent extends Component { ...@@ -109,8 +109,8 @@ class MaskContent extends Component {
return ( return (
<div className="mask-content"> <div className="mask-content">
<AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData} reconnect debug /> <AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData} reconnect debug />
{/* { sideControlShow && <SideControl multiple={multiple} errorAreaId={errorAreaId} onItemClick={onItemClick} layerConfig={layerConfig} animationProps={controlAnimation} />} */} { sideControlShow && <SideControl multiple={multiple} errorAreaId={errorAreaId} onItemClick={onItemClick} layerConfig={layerConfig} animationProps={controlAnimation} />}
<SideControl multiple={multiple} errorAreaId={errorAreaId} onItemClick={onItemClick} layerConfig={layerConfig} animationProps={controlAnimation} /> {/* <SideControl multiple={multiple} errorAreaId={errorAreaId} onItemClick={onItemClick} layerConfig={layerConfig} animationProps={controlAnimation} /> */}
{ sideControlShow && <DataPane animationProps={datapaneAnim} />} { sideControlShow && <DataPane animationProps={datapaneAnim} />}
<TopMsg alarmStart={alarmStart} /> <TopMsg alarmStart={alarmStart} />
{!isShowActionBar && <ModelHeader headerName={headerName} handleExceptModel={this.handleExceptModel} />} {!isShowActionBar && <ModelHeader headerName={headerName} handleExceptModel={this.handleExceptModel} />}
......
...@@ -732,7 +732,6 @@ class View3D extends Component { ...@@ -732,7 +732,6 @@ class View3D extends Component {
} }
//选中区域变化 //选中区域变化
selectItemChange = (selectArea) => { selectItemChange = (selectArea) => {
console.log(selectArea);
this.state.selectArea = selectArea this.state.selectArea = selectArea
this.setState({ this.setState({
selectArea: selectArea, selectArea: selectArea,
......
...@@ -2,7 +2,7 @@ import React, { Component } from 'react'; ...@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types'; 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 * as endConf from 'amos-processor/lib/config/endconf';
import { getAreaTreeAction,saveAreaDataAction } from '../../services/moduleEditServices' import { getAreaTreeAction,saveAreaDataAction,getPointTreeDetailAction } from '../../services/moduleEditServices'
const eventConnect = Connect.eventConnect; const eventConnect = Connect.eventConnect;
const TreeNode = Tree.TreeNode; const TreeNode = Tree.TreeNode;
...@@ -20,30 +20,38 @@ class RightEditPointPanel extends Component { ...@@ -20,30 +20,38 @@ class RightEditPointPanel extends Component {
form: { form: {
}, },
rules:{} rules:{},
detailData:[]
}; };
} }
componentDidMount() { componentDidMount() {
// getAreaTreeAction().then(data => { let {detailData}=this.props
// console.log(data);
// this.setState({ getPointTreeDetailAction(detailData.id,detailData.type).then(data => {
// treeData:data || [] console.log(data);
// }) this.setState({
// this.props.getAreaData(data || []) detailData: data || [],
// }) },err => {
console.log(err)
});
});
} }
componentWillUnmount() { componentWillUnmount() {
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
console.log(nextProps) let {detailData}=this.props
let {treeData,pointTypeArr} = nextProps; getPointTreeDetailAction(detailData.id,detailData.type).then(data => {
// this.setState({ console.log(data);
this.setState({
// }) detailData: data || [],
},err => {
console.log(err)
});
});
} }
onChange = (key, e) => { onChange = (key, e) => {
const value = e.target.value; const value = e.target.value;
...@@ -67,10 +75,10 @@ class RightEditPointPanel extends Component { ...@@ -67,10 +75,10 @@ class RightEditPointPanel extends Component {
handleSubmit = (e) => { handleSubmit = (e) => {
// e.preventDefault(); // e.preventDefault();
this.form.validate((valid, dataValues, errors) => { this.form.validate((valid, dataValues, errors) => {
...@@ -85,8 +93,9 @@ class RightEditPointPanel extends Component { ...@@ -85,8 +93,9 @@ class RightEditPointPanel extends Component {
} }
render() { render() {
let { rules, form,pointTypeArr,pointType } = 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 },
...@@ -96,49 +105,51 @@ class RightEditPointPanel extends Component { ...@@ -96,49 +105,51 @@ class RightEditPointPanel extends Component {
} }
return ( return (
<div className="rightEditPanel"> <div className="rightEditPanel">
<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='rightContainer'>
<div className='topForm'> <div className='topForm'>
<div className='rightTitle'> <div className='rightTitle'>
<span className='titleIcon'></span> <img src='/mods/components/3dviewConvertor/assets/convertor/moduleEdit/rightModalTitleIcon.png'/>
<span className='titleText'>风险点信息</span> <span className='titleText'>风险点信息</span>
</div> </div>
<div className='baseMsg'> <div className='baseMsg'>
<div className='moduleTitle'> <div className='moduleTitle'>
<span className='titleIcon'></span> <img src='/mods/components/3dviewConvertor/assets/convertor/moduleEdit/rightBaseMsgIcon.png'/>
<span className='titleText'>基本信息</span> <span className='titleText'>基本信息</span>
</div> </div>
<div className='moduleContent'> <div className='moduleContent'>
<div className='msgItem'> <div className='msgItem'>
<div className='itemLabel'>风险名称</div> <div className='itemLabel'>风险名称</div>
<FormItem field="name" > <FormItem field="name" >
<Input /> <Input value={detailData.name} disabled/>
</FormItem> </FormItem>
</div> </div>
<div className='msgItem'> <div className='msgItem'>
<div className='itemLabel'>参考编号</div> <div className='itemLabel'>参考编号</div>
<FormItem field="code" > <FormItem field="code" >
<Input <Input
onChange={(e) => this.onChange('name', e)} onChange={(e) => this.onChange('name', e)}
value={detailData.code}
disabled
/> />
</FormItem> </FormItem>
</div> </div>
<div className='msgItem'> <div className='msgItem'>
<div className='itemLabel'>风险等级</div> <div className='itemLabel'>风险等级</div>
<FormItem field="level" > <FormItem field="level" >
<Select value={form.level} onChange={this.onHobbyChange}> {/* <Select value={form.level} onChange={this.onHobbyChange}>
<Option value="1">一级</Option> <Option value="1">一级</Option>
<Option value="2">二级</Option> <Option value="2">二级</Option>
<Option value="3">三级</Option> <Option value="3">三级</Option>
<Option value="4">四级</Option> <Option value="4">四级</Option>
<Option value="5">五级</Option> <Option value="5">五级</Option>
</Select> </Select> */}
<Input value={detailData.level} disabled/>
</FormItem> </FormItem>
</div> </div>
</div> </div>
</div> </div>
...@@ -153,17 +164,17 @@ class RightEditPointPanel extends Component { ...@@ -153,17 +164,17 @@ class RightEditPointPanel extends Component {
<div className='position'> <div className='position'>
<div className='positionItem'> <div className='positionItem'>
<FormItem label="X" field="positionX" {...formItemLayout}> <FormItem label="X" field="positionX" {...formItemLayout}>
<InputNumber /> <Input value={detailData.ue4Location && detailData.ue4Location[0]} />
</FormItem> </FormItem>
</div> </div>
<div className='positionItem'> <div className='positionItem'>
<FormItem label="Y" field="positionY" {...formItemLayout}> <FormItem label="Y" field="positionY" {...formItemLayout}>
<InputNumber /> <Input value={detailData.ue4Location && detailData.ue4Location[1]} />
</FormItem> </FormItem>
</div> </div>
<div className='positionItem'> <div className='positionItem'>
<FormItem label="Z" field="positionZ" {...formItemLayout}> <FormItem label="Z" field="positionZ" {...formItemLayout}>
<InputNumber /> <Input value={detailData.ue4Location && detailData.ue4Location[2]} />
</FormItem> </FormItem>
</div> </div>
</div> </div>
...@@ -171,16 +182,16 @@ class RightEditPointPanel extends Component { ...@@ -171,16 +182,16 @@ class RightEditPointPanel extends Component {
<div className='msgItem'> <div className='msgItem'>
<div className='itemLabel'>楼层位置</div> <div className='itemLabel'>楼层位置</div>
<FormItem field="floorNum" > <FormItem field="floorNum" >
<Input /> <Input value={detailData.floor3d} disabled/>
</FormItem> </FormItem>
</div> </div>
<div className='msgItem'> <div className='msgItem'>
<div className='itemLabel'>是否位于室内</div> <div className='itemLabel'>是否位于室内</div>
<FormItem field="isIndoor" > <FormItem field="isIndoor" >
<RadioGroup defaultValue="prop2" onChange={value => {this.onRadioChange(value)}}> <RadioGroup defaultValue="prop2" onChange={value => {this.onRadioChange(value)}}>
<Radio value="prop1"></Radio> <Radio className='radio-text' value="prop1"></Radio>
<Radio value="prop2"></Radio> <Radio className='radio-text' value="prop2"></Radio>
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
</div> </div>
...@@ -188,19 +199,20 @@ class RightEditPointPanel extends Component { ...@@ -188,19 +199,20 @@ class RightEditPointPanel extends Component {
</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>
</div>
</Form> </Form>
</div>
</div> </div>
); );
} }
......
...@@ -20,29 +20,31 @@ class RightEditRegionPanel extends Component { ...@@ -20,29 +20,31 @@ class RightEditRegionPanel extends Component {
form: { form: {
}, },
rules:{} rules:{},
treeDetailData:[]
}; };
} }
componentDidMount() { componentDidMount() {
// getAreaTreeAction().then(data => { console.log(JSON.stringify(this.props.detailData))
// getAreaTreeDetailAction().then(data => {
// console.log(data); // console.log(data);
// this.setState({ // this.setState({
// treeData:data || [] // treeDetailData:data || []
// }) // })
// this.props.getAreaData(data || []) // this.props.getAreaData(data || [])
// }) // })
} }
componentWillUnmount() { componentWillUnmount() {
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
console.log(nextProps) console.log(nextProps)
let {treeData,pointTypeArr} = nextProps; let {treeData,pointTypeArr} = nextProps;
// this.setState({ // this.setState({
// }) // })
} }
onChange = (key, e) => { onChange = (key, e) => {
...@@ -67,16 +69,17 @@ class RightEditRegionPanel extends Component { ...@@ -67,16 +69,17 @@ class RightEditRegionPanel extends Component {
handleSubmit = (e) => { handleSubmit = (e) => {
// e.preventDefault(); // e.preventDefault();
this.form.validate((valid, dataValues, errors) => { this.form.validate((valid, dataValues, errors) => {
console.log('返回内容:', dataValues, valid, errors); console.log('返回内容:', dataValues, valid, errors);
if (valid) { if (valid) {
// AmosAlert.success('结果', JSON.stringify(dataValues)); //AmosAlert.success('结果', JSON.stringify(dataValues));
} else { } else {
console.log('error submit!!'); console.log('error submit!!');
return false; return false;
...@@ -85,8 +88,8 @@ class RightEditRegionPanel extends Component { ...@@ -85,8 +88,8 @@ class RightEditRegionPanel extends Component {
} }
render() { render() {
let { rules, form,pointTypeArr,pointType } = this.state; let { rules, form,pointTypeArr,pointType, } = this.state;
let { pageType } = this.props; let { pageType,detailData } = this.props;
const formItemLayout = { const formItemLayout = {
labelCol: { labelCol: {
xs: { span: 28 }, xs: { span: 28 },
...@@ -96,55 +99,57 @@ class RightEditRegionPanel extends Component { ...@@ -96,55 +99,57 @@ class RightEditRegionPanel extends Component {
} }
return ( return (
<div className="rightEditPanel"> <div className="rightEditPanel">
<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='rightContainer'>
<div className='topForm'> <div className='topForm'>
<div className='rightTitle'> <div className='rightTitle'>
<span className='titleIcon'></span> <img src='/mods/components/3dviewConvertor/assets/convertor/moduleEdit/rightModalTitleIcon.png'/>
<span className='titleText'>风险区域信息</span> <span className='titleText'>风险区域信息</span>
</div> </div>
<div className='baseMsg'> <div className='baseMsg'>
<div className='moduleTitle'> <div className='moduleTitle'>
<span className='titleIcon'></span> <img src='/mods/components/3dviewConvertor/assets/convertor/moduleEdit/rightBaseMsgIcon.png'/>
<span className='titleText'>基本信息</span> <span className='titleText'>基本信息</span>
</div> </div>
<div className='moduleContent'> <div className='moduleContent'>
<div className='msgItem'> <div className='msgItem'>
<div className='itemLabel'>风险名称</div> <div className='itemLabel'>风险名称</div>
<FormItem field="name" > <FormItem field="name" >
<Input /> <Input value={detailData.name} disabled/>
</FormItem> </FormItem>
</div> </div>
<div className='msgItem'> <div className='msgItem'>
<div className='itemLabel'>参考编号</div> <div className='itemLabel'>参考编号</div>
<FormItem field="code" > <FormItem field="code" >
<Input <Input
onChange={(e) => this.onChange('name', e)} onChange={(e) => this.onChange('name', e)}
value={detailData.code}
disabled
/> />
</FormItem> </FormItem>
</div> </div>
<div className='msgItem'> <div className='msgItem'>
<div className='itemLabel'>风险等级</div> <div className='itemLabel'>风险等级</div>
<FormItem field="level" > <FormItem field="level" >
<Select value={form.level} onChange={this.onHobbyChange}> {/* <Select value={form.level} onChange={this.onHobbyChange}>
<Option value="1">一级</Option> <Option value="1">一级</Option>
<Option value="2">二级</Option> <Option value="2">二级</Option>
<Option value="3">三级</Option> <Option value="3">三级</Option>
<Option value="4">四级</Option> <Option value="4">四级</Option>
<Option value="5">五级</Option> <Option value="5">五级</Option>
</Select> </Select> */}
<Input value={detailData.level} disabled/>
</FormItem> </FormItem>
</div> </div>
</div> </div>
</div> </div>
<div className='3dMsg'> <div className='3dMsg'>
<div className='moduleTitle'> <div className='moduleTitle'>
<span className='titleIcon'></span> <img src='/mods/components/3dviewConvertor/assets/convertor/moduleEdit/right3dIcon.png'/>
<span className='titleText'>三维信息</span> <span className='titleText'>三维信息</span>
</div> </div>
<div className='moduleContent'> <div className='moduleContent'>
...@@ -153,17 +158,17 @@ class RightEditRegionPanel extends Component { ...@@ -153,17 +158,17 @@ class RightEditRegionPanel extends Component {
<div className='position'> <div className='position'>
<div className='positionItem'> <div className='positionItem'>
<FormItem label="长" field="positionX" {...formItemLayout}> <FormItem label="长" field="positionX" {...formItemLayout}>
<InputNumber /> <Input value={detailData.ue4Location && detailData.ue4Location[0]} />
</FormItem> </FormItem>
</div> </div>
<div className='positionItem'> <div className='positionItem'>
<FormItem label="宽" field="positionY" {...formItemLayout}> <FormItem label="宽" field="positionY" {...formItemLayout}>
<InputNumber /> <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}>
<InputNumber /> <Input value={detailData.ue4Location && detailData.ue4Location[2]} />
</FormItem> </FormItem>
</div> </div>
</div> </div>
...@@ -172,19 +177,20 @@ class RightEditRegionPanel extends Component { ...@@ -172,19 +177,20 @@ class RightEditRegionPanel extends Component {
</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>
</div>
</Form> </Form>
</div>
</div> </div>
); );
} }
......
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