|
|
@ -34,7 +34,7 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, q |
|
|
|
map: map |
|
|
|
}); //构造地点查询类
|
|
|
|
|
|
|
|
function select (e) { |
|
|
|
function select(e) { |
|
|
|
if (e) { |
|
|
|
placeSearch.setCity(e.poi.adcode); |
|
|
|
placeSearch.search(e.poi.name, function (status, result) { |
|
|
@ -64,7 +64,10 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, q |
|
|
|
dispatch(projectRegime.addPosition({ |
|
|
|
...r, |
|
|
|
id: modelData?.id, |
|
|
|
projectId: qrCodeId |
|
|
|
projectId: qrCodeId, |
|
|
|
latitude: r?.latitude ? r?.latitude : null, |
|
|
|
longitude: r?.longitude ? r?.longitude : null, |
|
|
|
img: r.img ? r.img.map(u => u.storageUrl) : [], |
|
|
|
})).then(res => { |
|
|
|
if (res.success) { |
|
|
|
success() |
|
|
@ -84,6 +87,13 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, q |
|
|
|
onFinish={r => { |
|
|
|
|
|
|
|
}} |
|
|
|
initialValues={{ |
|
|
|
img: (modelData.img || []).map(s => { |
|
|
|
return { |
|
|
|
storageUrl: s |
|
|
|
} |
|
|
|
}), |
|
|
|
}} |
|
|
|
> |
|
|
|
<Form.Item label='点位名称' name="name" style={{}} |
|
|
|
initialValue={modelData?.name} |
|
|
@ -91,10 +101,10 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, q |
|
|
|
> |
|
|
|
<Input placeholder="请输入点位名称" allowClear /> |
|
|
|
</Form.Item> |
|
|
|
<div style={{position: 'relative'}}> |
|
|
|
<div style={{ position: 'relative' }}> |
|
|
|
{/* /^\d+$|^\d*\.\d+$/g */} |
|
|
|
<Form.Item label="所在地区:" labelCol={{ span: 11 }} labelAlign='right' name="longitude" style={{ display: 'inline-block', width: 'calc(60% - 30px)', }} |
|
|
|
rules={[{ required: true, message: '', },{ |
|
|
|
<Form.Item label="所在地区:" labelCol={{ span: 11 }} labelAlign='right' name="longitude" style={{ display: 'inline-block', width: 'calc(60% - 30px)', }} |
|
|
|
rules={[{ required: false, message: '', }, { |
|
|
|
validator: (rule, value, callback) => { |
|
|
|
const sjh = /^\d+$|^\d*\.\d+$/g; |
|
|
|
if (value) { |
|
|
@ -104,15 +114,16 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, q |
|
|
|
} |
|
|
|
callback(); |
|
|
|
} |
|
|
|
return callback([new Error("请输入横坐标")]); |
|
|
|
// return callback([new Error("请输入横坐标")]);
|
|
|
|
return Promise.resolve(); |
|
|
|
} |
|
|
|
}]} |
|
|
|
> |
|
|
|
<Input placeholder="经度支持数字" /> |
|
|
|
</Form.Item> |
|
|
|
~ |
|
|
|
<Form.Item name="latitude" style={{ display: 'inline-block', width: 'calc(40% + 15px)', }} |
|
|
|
rules={[{ required: true, message: '', },{ |
|
|
|
<Form.Item name="latitude" style={{ display: 'inline-block', width: 'calc(40% + 15px)', }} |
|
|
|
rules={[{ required: false, message: '', }, { |
|
|
|
validator: (rule, value, callback) => { |
|
|
|
const sjh = /^\d+$|^\d*\.\d+$/g; |
|
|
|
if (value) { |
|
|
@ -122,7 +133,8 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, q |
|
|
|
} |
|
|
|
callback(); |
|
|
|
} |
|
|
|
return callback([new Error("请输入纵坐标")]); |
|
|
|
// return callback([new Error("请输入纵坐标")]);
|
|
|
|
return Promise.resolve(); |
|
|
|
} |
|
|
|
}]} |
|
|
|
> |
|
|
@ -152,6 +164,25 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, q |
|
|
|
rules={[{ required: true, message: '请输入描述内容', },]}> |
|
|
|
<TextArea /> |
|
|
|
</Form.Item> |
|
|
|
<Form.Item |
|
|
|
label="结构物图片" |
|
|
|
name='img' |
|
|
|
help={<div style={{ fontSize: 12 }}>说明:请上传png,jpg格式图片,图片大小不超过5M</div>} |
|
|
|
> |
|
|
|
<Uploads |
|
|
|
listType='picture-card' |
|
|
|
uploadType='project' |
|
|
|
maxFilesNum={1} |
|
|
|
maxFileSize={5} |
|
|
|
isQiniu={true} |
|
|
|
fileTypes={["png", "jpg"]} |
|
|
|
defaultValue={(modelData.img || []).map(s => { |
|
|
|
return { |
|
|
|
storageUrl: s |
|
|
|
} |
|
|
|
})} |
|
|
|
/> |
|
|
|
</Form.Item> |
|
|
|
</Form> |
|
|
|
</Modal> |
|
|
|
|
|
|
@ -159,7 +190,7 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, q |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
function mapStateToProps (state) { |
|
|
|
function mapStateToProps(state) { |
|
|
|
const { auth, global } = state; |
|
|
|
return { |
|
|
|
user: auth.user, |
|
|
|