|
@ -1,11 +1,11 @@ |
|
|
import React, { useState } from 'react'; |
|
|
import React, { useState } from 'react'; |
|
|
import { Button, Form, Input, Modal, Select, DatePicker, Icon } from 'antd'; |
|
|
import { Form, Input, Modal, Select, Row, Col } from 'antd'; |
|
|
import { EnvironmentTwoTone } from '@ant-design/icons'; |
|
|
// import { EnvironmentTwoTone } from '@ant-design/icons';
|
|
|
const { TextArea } = Input; |
|
|
const { TextArea } = Input; |
|
|
import { connect } from 'react-redux'; |
|
|
import { connect } from 'react-redux'; |
|
|
import Uploads from '$components/Uploads'; |
|
|
import Uploads from '$components/Uploads'; |
|
|
import { useEffect } from 'react'; |
|
|
import { useEffect } from 'react'; |
|
|
import moment from 'moment'; |
|
|
// import moment from 'moment';
|
|
|
|
|
|
|
|
|
const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, firmList }) => { |
|
|
const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, firmList }) => { |
|
|
|
|
|
|
|
@ -34,7 +34,7 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, f |
|
|
map: map |
|
|
map: map |
|
|
}); //构造地点查询类
|
|
|
}); //构造地点查询类
|
|
|
|
|
|
|
|
|
function select (e) { |
|
|
function select(e) { |
|
|
if (e) { |
|
|
if (e) { |
|
|
placeSearch.setCity(e.poi.adcode); |
|
|
placeSearch.setCity(e.poi.adcode); |
|
|
placeSearch.search(e.poi.name, function (status, result) { |
|
|
placeSearch.search(e.poi.name, function (status, result) { |
|
@ -56,8 +56,9 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, f |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<Modal |
|
|
<Modal |
|
|
|
|
|
className="global-modal" |
|
|
title={modelData?.id ? '编辑项目' : '新建项目'} |
|
|
title={modelData?.id ? '编辑项目' : '新建项目'} |
|
|
width={600} |
|
|
width={717} |
|
|
open={true} |
|
|
open={true} |
|
|
onOk={() => { |
|
|
onOk={() => { |
|
|
form.validateFields().then(v => { |
|
|
form.validateFields().then(v => { |
|
@ -78,7 +79,7 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, f |
|
|
style={{}} |
|
|
style={{}} |
|
|
form={form} |
|
|
form={form} |
|
|
labelAlign='right' |
|
|
labelAlign='right' |
|
|
labelCol={{ span: 6 }} wrapperCol={{ span: 18 }} |
|
|
labelCol={{ span: 4 }} wrapperCol={{ span: 18 }} |
|
|
onFinish={r => { |
|
|
onFinish={r => { |
|
|
}} |
|
|
}} |
|
|
initialValues={{ |
|
|
initialValues={{ |
|
@ -90,24 +91,29 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, f |
|
|
describe: modelData?.describe, |
|
|
describe: modelData?.describe, |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
<Form.Item label='结构物名称' name="name" style={{}} |
|
|
<div style={{ position: 'relative', display: 'flex' }}> |
|
|
initialValue={modelData?.name} |
|
|
<Form.Item label='结构物名称' labelCol={{ span: 9 }} name="name" style={{ width: 369 }} |
|
|
rules={[{ required: true, message: '请输入结构物名称' },]} |
|
|
initialValue={modelData?.name} |
|
|
> |
|
|
rules={[{ required: true, message: '请输入结构物名称' },]} |
|
|
<Input placeholder="请输入结构物名称" allowClear /> |
|
|
> |
|
|
</Form.Item> |
|
|
<Input placeholder="请输入结构物名称" allowClear bordered={false} /> |
|
|
<Form.Item label='结构物类型' name="type" style={{}} |
|
|
</Form.Item> |
|
|
initialValue={modelData?.type || '桥梁'} |
|
|
<Form.Item label='结构物类型' labelCol={{ span: 9 }} name="type" style={{ width: 254 }} |
|
|
// rules={[{ required: true, message: '请选择结构物类型' },]}
|
|
|
initialValue={modelData?.type || '桥梁'} |
|
|
> |
|
|
// rules={[{ required: true, message: '请选择结构物类型' },]}
|
|
|
<Select allowClear |
|
|
> |
|
|
options={[ |
|
|
<Select |
|
|
{ value: '桥梁', label: '桥梁' }, |
|
|
bordered={false} |
|
|
{ value: '隧道', label: '隧道' }, |
|
|
allowClear |
|
|
{ value: '管廊', label: '管廊' }]} /> |
|
|
options={[ |
|
|
</Form.Item> |
|
|
{ value: '桥梁', label: '桥梁' }, |
|
|
|
|
|
{ value: '隧道', label: '隧道' }, |
|
|
|
|
|
{ value: '管廊', label: '管廊' }]} |
|
|
|
|
|
/> |
|
|
|
|
|
</Form.Item> |
|
|
|
|
|
</div> |
|
|
<div style={{ position: 'relative' }}> |
|
|
<div style={{ position: 'relative' }}> |
|
|
<Form.Item label="所在地区:" labelCol={{ span: 11 }} labelAlign='right' name="longitude" style={{ display: 'inline-block', width: 'calc(60% - 30px)', }} |
|
|
<Form.Item label="所在地区:" labelCol={{ span: 9 }} labelAlign='right' name="longitude" style={{ display: 'inline-block', width: 'calc(60% - 50px)', }} |
|
|
rules={[{ required: true, message: '', }, { |
|
|
rules={[{ required: true, message: '', }, { |
|
|
validator: (rule, value, callback) => { |
|
|
validator: (rule, value, callback) => { |
|
|
const sjh = /^\d+$|^\d*\.\d+$/g; |
|
|
const sjh = /^\d+$|^\d*\.\d+$/g; |
|
@ -122,10 +128,10 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, f |
|
|
} |
|
|
} |
|
|
}]} |
|
|
}]} |
|
|
> |
|
|
> |
|
|
<Input placeholder="经度支持数字" /> |
|
|
<Input placeholder="经度支持数字" bordered={false} /> |
|
|
</Form.Item> |
|
|
</Form.Item> |
|
|
~ |
|
|
— |
|
|
<Form.Item name="latitude" style={{ display: 'inline-block', width: 'calc(40% + 15px)', }} |
|
|
<Form.Item name="latitude" style={{ display: 'inline-block', width: 'calc(40% + 15px)', }} |
|
|
rules={[{ required: true, message: '', }, { |
|
|
rules={[{ required: true, message: '', }, { |
|
|
validator: (rule, value, callback) => { |
|
|
validator: (rule, value, callback) => { |
|
|
const sjh = /^\d+$|^\d*\.\d+$/g; |
|
|
const sjh = /^\d+$|^\d*\.\d+$/g; |
|
@ -140,9 +146,9 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, f |
|
|
} |
|
|
} |
|
|
}]} |
|
|
}]} |
|
|
> |
|
|
> |
|
|
<Input placeholder="维度支持数字" /> |
|
|
<Input placeholder="维度支持数字" bordered={false} /> |
|
|
</Form.Item> |
|
|
</Form.Item> |
|
|
<EnvironmentTwoTone style={{ position: 'absolute', top: 5, right: 27, fontSize: 22 }} onClick={() => { |
|
|
<img src='/assets/images/show_map.svg' style={{ position: 'absolute', width: 28, top: 2, right: 47, cursor: 'pointer' }} onClick={() => { |
|
|
setShowBaiduMap(!showBaiduMap) |
|
|
setShowBaiduMap(!showBaiduMap) |
|
|
}} /> |
|
|
}} /> |
|
|
</div> |
|
|
</div> |
|
@ -161,7 +167,7 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, f |
|
|
<div id="container" style={{ width: '100%', height: '425px', marginBottom: '15px' }}></div> |
|
|
<div id="container" style={{ width: '100%', height: '425px', marginBottom: '15px' }}></div> |
|
|
</Form.Item> |
|
|
</Form.Item> |
|
|
<Form.Item name='describe' label="描述"> |
|
|
<Form.Item name='describe' label="描述"> |
|
|
<TextArea /> |
|
|
<TextArea bordered={false} /> |
|
|
</Form.Item> |
|
|
</Form.Item> |
|
|
<Form.Item |
|
|
<Form.Item |
|
|
label="结构物图片" |
|
|
label="结构物图片" |
|
@ -193,7 +199,7 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, f |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function mapStateToProps (state) { |
|
|
function mapStateToProps(state) { |
|
|
const { auth, global } = state; |
|
|
const { auth, global } = state; |
|
|
return { |
|
|
return { |
|
|
user: auth.user, |
|
|
user: auth.user, |
|
|