Commit 5da13f0c authored by yzl's avatar yzl

修改添加bug

parent 4c5d07f8
......@@ -212,50 +212,12 @@
})
}, [])
const saveData = async (ipAddress, values, groups) => {
const saveData = async (ipAddress, values, groups, successImages) => {
const data = form.getFieldsValue();
data['发生时间'] = data['发生时间'] ? time.format('YYYY-MM-DD HH:mm:ss') : moment().format('YYYY-MM-DD HH:mm:ss');
// 上传图片
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: ipAddress + '/cityinterface/rest/services/filedownload.svc/WebUploaderFile/',
data: formData,
success: function (data) {
console.log(data);
}
})
})
const names = [...successImages];
// 上传所有
data['问题附件截图'] = names.join(',');
......@@ -337,10 +299,9 @@
autoSize={{minRows: 3, maxRows: 5}}
/>
</Form.Item>
<Form.Item label="问题附件截图" required>
<Form.Item label="问题截图" required>
<div className='helpUploadBox' style={{marginLeft: 20}}>
<Upload
action={return false}
showCount
maxLength={4}
className='helpUploadImg'
......@@ -349,6 +310,49 @@
style={{width: '90%'}}
beforeUpload={onbeforeUpload}
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}
>
{fileList.length < 4 && '+ 上传截图'}
......@@ -375,7 +379,7 @@
<img src='./images/help/addBg.png' style={{marginLeft: 90}} alt=""/>
</Col>
<Col span={14}>
<Col span={12}>
<div style={{textAlign: 'right'}}>
<Button htmlType="reset" style={{margin: '0 20px'}} onClick={() => {
window.location.href = './?site_code=' + code;
......
......@@ -153,7 +153,7 @@
.callback{
width: 200px;
height: 160px;
padding-top: 52px;
margin-left: 30px;
padding-left: 30px;
border-left: 1px solid #E0E6EF;
......@@ -169,7 +169,7 @@
.connectWrap{
position: relative;
width: 420px;
width: 456px;
height: 150px;
padding: 30px;
background-size: cover;
......@@ -315,6 +315,7 @@
border-image: linear-gradient(0deg, #F5F9FF, #DCEAFF) 10 10;
border-radius: 8px;
padding: 20px;
margin-bottom: 20px;
h1{
font-size: 20px;
......
......@@ -301,7 +301,6 @@
setPreviewTitle(item['解决方案']);
setPreviewImage(item['图片']);
}}>查看详情</p>
}
</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