Commit 5da13f0c authored by yzl's avatar yzl

修改添加bug

parent 4c5d07f8
...@@ -212,50 +212,12 @@ ...@@ -212,50 +212,12 @@
}) })
}, []) }, [])
const saveData = async (ipAddress, values, groups) => { const saveData = async (ipAddress, values, groups, successImages) => {
const data = form.getFieldsValue(); const data = form.getFieldsValue();
data['发生时间'] = data['发生时间'] ? time.format('YYYY-MM-DD HH:mm:ss') : moment().format('YYYY-MM-DD HH:mm:ss'); data['发生时间'] = data['发生时间'] ? time.format('YYYY-MM-DD HH:mm:ss') : moment().format('YYYY-MM-DD HH:mm:ss');
// 上传图片 // 上传图片
const images = [...fileList]; const names = [...successImages];
const names = [];
images.forEach((image, index) => {
const formData = new FormData();
const guid = _createGuid();
const obj = {
guid: guid,
folder: '项目管理_售后问题反馈台账表/问题附件截图/' + guid,
id: "WU_File_" + new Date().getTime().toString() + index,
name: image.name,
type: 'png',
lastModifiedDate: image.lastModifiedDate,
size: image.size,
}
names.push('/' + obj.folder + '/' + image.name);
Object.keys(obj).forEach(key => {
formData.append(key, obj[key]);
})
formData.append('file', image.originFileObj);
$.ajax({
type: 'POST',
contentType: false,
processData: false,
url: ipAddress + '/cityinterface/rest/services/filedownload.svc/WebUploaderFile/',
data: formData,
success: function (data) {
console.log(data);
}
})
})
// 上传所有 // 上传所有
data['问题附件截图'] = names.join(','); data['问题附件截图'] = names.join(',');
...@@ -337,10 +299,9 @@ ...@@ -337,10 +299,9 @@
autoSize={{minRows: 3, maxRows: 5}} autoSize={{minRows: 3, maxRows: 5}}
/> />
</Form.Item> </Form.Item>
<Form.Item label="问题附件截图" required> <Form.Item label="问题截图" required>
<div className='helpUploadBox' style={{marginLeft: 20}}> <div className='helpUploadBox' style={{marginLeft: 20}}>
<Upload <Upload
action={return false}
showCount showCount
maxLength={4} maxLength={4}
className='helpUploadImg' className='helpUploadImg'
...@@ -349,6 +310,49 @@ ...@@ -349,6 +310,49 @@
style={{width: '90%'}} style={{width: '90%'}}
beforeUpload={onbeforeUpload} beforeUpload={onbeforeUpload}
onChange={onChangeUpload} onChange={onChangeUpload}
customRequest={(options) => {
const images = [...fileList];
const names = [];
images.forEach((image, index) => {
const formData = new FormData();
const guid = _createGuid();
const obj = {
guid: guid,
folder: '项目管理_售后问题反馈台账表/问题附件截图/' + guid,
id: "WU_File_" + new Date().getTime().toString() + index,
name: image.name,
type: 'png',
lastModifiedDate: image.lastModifiedDate,
size: image.size,
}
names.push('/' + obj.folder + '/' + image.name);
Object.keys(obj).forEach(key => {
formData.append(key, obj[key]);
})
formData.append('file', image.originFileObj);
$.ajax({
type: 'POST',
contentType: false,
processData: false,
url: ip + '/cityinterface/rest/services/filedownload.svc/WebUploaderFile/',
data: formData,
success: function (data) {
if(data.success) {
setSuccessImages(names)
options.onSuccess()
}
}
})
})
}}
onPreview={onPreviewUpload} onPreview={onPreviewUpload}
> >
{fileList.length < 4 && '+ 上传截图'} {fileList.length < 4 && '+ 上传截图'}
...@@ -375,7 +379,7 @@ ...@@ -375,7 +379,7 @@
<img src='./images/help/addBg.png' style={{marginLeft: 90}} alt=""/> <img src='./images/help/addBg.png' style={{marginLeft: 90}} alt=""/>
</Col> </Col>
<Col span={14}> <Col span={12}>
<div style={{textAlign: 'right'}}> <div style={{textAlign: 'right'}}>
<Button htmlType="reset" style={{margin: '0 20px'}} onClick={() => { <Button htmlType="reset" style={{margin: '0 20px'}} onClick={() => {
window.location.href = './?site_code=' + code; window.location.href = './?site_code=' + code;
......
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
.callback{ .callback{
width: 200px; width: 200px;
height: 160px; padding-top: 52px;
margin-left: 30px; margin-left: 30px;
padding-left: 30px; padding-left: 30px;
border-left: 1px solid #E0E6EF; border-left: 1px solid #E0E6EF;
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
.connectWrap{ .connectWrap{
position: relative; position: relative;
width: 420px; width: 456px;
height: 150px; height: 150px;
padding: 30px; padding: 30px;
background-size: cover; background-size: cover;
...@@ -315,6 +315,7 @@ ...@@ -315,6 +315,7 @@
border-image: linear-gradient(0deg, #F5F9FF, #DCEAFF) 10 10; border-image: linear-gradient(0deg, #F5F9FF, #DCEAFF) 10 10;
border-radius: 8px; border-radius: 8px;
padding: 20px; padding: 20px;
margin-bottom: 20px;
h1{ h1{
font-size: 20px; font-size: 20px;
......
...@@ -301,7 +301,6 @@ ...@@ -301,7 +301,6 @@
setPreviewTitle(item['解决方案']); setPreviewTitle(item['解决方案']);
setPreviewImage(item['图片']); setPreviewImage(item['图片']);
}}>查看详情</p> }}>查看详情</p>
}
</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