|
|
@ -1,11 +1,11 @@ |
|
|
|
import React, { useState } from 'react'; |
|
|
|
import { Button, Form, Input, Modal, Select, DatePicker, Icon } from 'antd'; |
|
|
|
import { EnvironmentTwoTone } from '@ant-design/icons'; |
|
|
|
import { Form, Input, Modal, Select, Row, Col } from 'antd'; |
|
|
|
// import { EnvironmentTwoTone } from '@ant-design/icons';
|
|
|
|
const { TextArea } = Input; |
|
|
|
import { connect } from 'react-redux'; |
|
|
|
import Uploads from '$components/Uploads'; |
|
|
|
import { useEffect } from 'react'; |
|
|
|
import moment from 'moment'; |
|
|
|
// import moment from 'moment';
|
|
|
|
|
|
|
|
const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, firmList }) => { |
|
|
|
|
|
|
@ -34,7 +34,7 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, f |
|
|
|
map: map |
|
|
|
}); //构造地点查询类
|
|
|
|
|
|
|
|
function select (e) { |
|
|
|
function select(e) { |
|
|
|
if (e) { |
|
|
|
placeSearch.setCity(e.poi.adcode); |
|
|
|
placeSearch.search(e.poi.name, function (status, result) { |
|
|
@ -56,8 +56,9 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, f |
|
|
|
|
|
|
|
return ( |
|
|
|
<Modal |
|
|
|
className="global-modal" |
|
|
|
title={modelData?.id ? '编辑项目' : '新建项目'} |
|
|
|
width={600} |
|
|
|
width={717} |
|
|
|
open={true} |
|
|
|
onOk={() => { |
|
|
|
form.validateFields().then(v => { |
|
|
@ -78,7 +79,7 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, f |
|
|
|
style={{}} |
|
|
|
form={form} |
|
|
|
labelAlign='right' |
|
|
|
labelCol={{ span: 6 }} wrapperCol={{ span: 18 }} |
|
|
|
labelCol={{ span: 4 }} wrapperCol={{ span: 18 }} |
|
|
|
onFinish={r => { |
|
|
|
}} |
|
|
|
initialValues={{ |
|
|
@ -90,24 +91,29 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, f |
|
|
|
describe: modelData?.describe, |
|
|
|
}} |
|
|
|
> |
|
|
|
<Form.Item label='结构物名称' name="name" style={{}} |
|
|
|
initialValue={modelData?.name} |
|
|
|
rules={[{ required: true, message: '请输入结构物名称' },]} |
|
|
|
> |
|
|
|
<Input placeholder="请输入结构物名称" allowClear /> |
|
|
|
</Form.Item> |
|
|
|
<Form.Item label='结构物类型' name="type" style={{}} |
|
|
|
initialValue={modelData?.type || '桥梁'} |
|
|
|
// rules={[{ required: true, message: '请选择结构物类型' },]}
|
|
|
|
> |
|
|
|
<Select allowClear |
|
|
|
options={[ |
|
|
|
{ value: '桥梁', label: '桥梁' }, |
|
|
|
{ value: '隧道', label: '隧道' }, |
|
|
|
{ value: '管廊', label: '管廊' }]} /> |
|
|
|
</Form.Item> |
|
|
|
<div style={{ position: 'relative', display: 'flex' }}> |
|
|
|
<Form.Item label='结构物名称' labelCol={{ span: 9 }} name="name" style={{ width: 369 }} |
|
|
|
initialValue={modelData?.name} |
|
|
|
rules={[{ required: true, message: '请输入结构物名称' },]} |
|
|
|
> |
|
|
|
<Input placeholder="请输入结构物名称" allowClear bordered={false} /> |
|
|
|
</Form.Item> |
|
|
|
<Form.Item label='结构物类型' labelCol={{ span: 9 }} name="type" style={{ width: 254 }} |
|
|
|
initialValue={modelData?.type || '桥梁'} |
|
|
|
// rules={[{ required: true, message: '请选择结构物类型' },]}
|
|
|
|
> |
|
|
|
<Select |
|
|
|
bordered={false} |
|
|
|
allowClear |
|
|
|
options={[ |
|
|
|
{ value: '桥梁', label: '桥梁' }, |
|
|
|
{ value: '隧道', label: '隧道' }, |
|
|
|
{ value: '管廊', label: '管廊' }]} |
|
|
|
/> |
|
|
|
</Form.Item> |
|
|
|
</div> |
|
|
|
<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: '', }, { |
|
|
|
validator: (rule, value, callback) => { |
|
|
|
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 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: '', }, { |
|
|
|
validator: (rule, value, callback) => { |
|
|
|
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> |
|
|
|
<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) |
|
|
|
}} /> |
|
|
|
</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> |
|
|
|
</Form.Item> |
|
|
|
<Form.Item name='describe' label="描述"> |
|
|
|
<TextArea /> |
|
|
|
<TextArea bordered={false} /> |
|
|
|
</Form.Item> |
|
|
|
<Form.Item |
|
|
|
label="结构物图片" |
|
|
@ -193,7 +199,7 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, f |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
function mapStateToProps (state) { |
|
|
|
function mapStateToProps(state) { |
|
|
|
const { auth, global } = state; |
|
|
|
return { |
|
|
|
user: auth.user, |
|
|
|