|
|
@ -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} |
|
|
@ -94,7 +104,7 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, q |
|
|
|
<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: '', },{ |
|
|
|
rules={[{ required: false, message: '', }, { |
|
|
|
validator: (rule, value, callback) => { |
|
|
|
const sjh = /^\d+$|^\d*\.\d+$/g; |
|
|
|
if (value) { |
|
|
@ -104,7 +114,8 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, q |
|
|
|
} |
|
|
|
callback(); |
|
|
|
} |
|
|
|
return callback([new Error("请输入横坐标")]); |
|
|
|
// return callback([new Error("请输入横坐标")]);
|
|
|
|
return Promise.resolve(); |
|
|
|
} |
|
|
|
}]} |
|
|
|
> |
|
|
@ -112,7 +123,7 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, q |
|
|
|
</Form.Item> |
|
|
|
~ |
|
|
|
<Form.Item name="latitude" style={{ display: 'inline-block', width: 'calc(40% + 15px)', }} |
|
|
|
rules={[{ required: true, message: '', },{ |
|
|
|
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> |
|
|
|
|
|
|
|