Commit 59262a79 authored by 皮倩雯's avatar 皮倩雯

fix: '修复集成登录无法提交bug'

parent 28a5aebf
Pipeline #61088 passed with stages
......@@ -233,128 +233,128 @@ const AddModal = props => {
};
// 提交
const onSubmit = () => {
console.log(form.getFieldsValue().siteDescription);
console.log(form.getFieldsValue().siteDescription.textContent);
// form.validateFields().then(validate => {
// if (validate) {
// setLoading(true);
// let obj = form.getFieldsValue();
// console.log(obj.siteDescription);
// if (obj.internetAddress || obj.intranetAddress) {
// if (obj.accountParamValue == '熊猫ticket') {
// obj.accountParamValue = 1;
// } else if (obj.accountParamValue == '熊猫token') {
// obj.accountParamValue = 2;
// }
// let aa = { key: obj.accountParamKey, value: obj.accountParamValue };
// let bb = [];
// bb.push(aa);
// if (obj.iconUrl.file) {
// obj.iconUrl = obj.iconUrl.file.response.data;
// }
// let data = [];
// if (obj.coordinate) {
// data = obj.coordinate.split(',');
// }
// let dataList = [];
// if (fileList.length > 0) {
// fileList.map(i => {
// if (i.submitUrl) {
// dataList.push(i.submitUrl);
// } else {
// dataList.push(i.response.data);
// }
// });
// }
// if (type === 'add') {
// AddIntegratedLogin({
// systemName: obj.systemName,
// subtitle: obj.subtitle,
// internetAddress: obj.internetAddress,
// intranetAddress: obj.intranetAddress,
// accountParam: bb,
// iconUrl: obj.iconUrl,
// accountType: 'Panda',
// isHide: false,
// target: obj.target,
// isMaster: obj.isMaster,
// images: dataList,
// mapSetting: obj.mapSetting,
// coordinate: data,
// siteDescription: obj.siteDescription,
// })
// .then(res => {
// if (res.code === 0) {
// onCancel();
// setLoading(false);
// callBackSubmit();
// notification.success({
// message: '提示',
// duration: 3,
// description: res.msg || '新增成功',
// });
// } else {
// setLoading(false);
// notification.error({
// message: '提示',
// duration: 3,
// description: res.msg || '新增失败',
// });
// }
// })
// .catch(err => {
// setLoading(false);
// });
// } else {
// EditIntegratedLogin({
// systemName: obj.systemName,
// subtitle: obj.subtitle,
// internetAddress: obj.internetAddress,
// intranetAddress: obj.intranetAddress,
// accountParam: bb,
// iconUrl: obj.iconUrl,
// accountType: 'Panda',
// target: obj.target,
// isMaster: obj.isMaster,
// images: dataList,
// clients: pickItem.clients,
// isHide: pickItem.isHide,
// mapSetting: obj.mapSetting,
// coordinate: data,
// siteDescription: obj.siteDescription,
// })
// .then(res => {
// if (res.code === 0) {
// onCancel();
// setLoading(false);
// callBackSubmit();
// notification.success({
// message: '提示',
// duration: 3,
// description: res.msg || '编辑成功',
// });
// } else {
// setLoading(false);
// notification.error({
// message: '提示',
// duration: 3,
// description: res.msg || '编辑失败',
// });
// }
// })
// .catch(err => {
// setLoading(false);
// });
// }
// } else {
// notification.warning({
// message: '提示',
// duration: 3,
// description: '内网地址或外网地址必须填写一项',
// });
// }
// }
// });
// console.log(form.getFieldsValue().siteDescription);
// console.log(form.getFieldsValue().siteDescription.textContent);
form.validateFields().then(validate => {
if (validate) {
setLoading(true);
let obj = form.getFieldsValue();
console.log(obj.siteDescription);
if (obj.internetAddress || obj.intranetAddress) {
if (obj.accountParamValue == '熊猫ticket') {
obj.accountParamValue = 1;
} else if (obj.accountParamValue == '熊猫token') {
obj.accountParamValue = 2;
}
let aa = { key: obj.accountParamKey, value: obj.accountParamValue };
let bb = [];
bb.push(aa);
if (obj.iconUrl.file) {
obj.iconUrl = obj.iconUrl.file.response.data;
}
let data = [];
if (obj.coordinate) {
data = obj.coordinate.split(',');
}
let dataList = [];
if (fileList.length > 0) {
fileList.map(i => {
if (i.submitUrl) {
dataList.push(i.submitUrl);
} else {
dataList.push(i.response.data);
}
});
}
if (type === 'add') {
AddIntegratedLogin({
systemName: obj.systemName,
subtitle: obj.subtitle,
internetAddress: obj.internetAddress,
intranetAddress: obj.intranetAddress,
accountParam: bb,
iconUrl: obj.iconUrl,
accountType: 'Panda',
isHide: false,
target: obj.target,
isMaster: obj.isMaster,
images: dataList,
mapSetting: obj.mapSetting,
coordinate: data,
siteDescription: obj.siteDescription,
})
.then(res => {
if (res.code === 0) {
onCancel();
setLoading(false);
callBackSubmit();
notification.success({
message: '提示',
duration: 3,
description: res.msg || '新增成功',
});
} else {
setLoading(false);
notification.error({
message: '提示',
duration: 3,
description: res.msg || '新增失败',
});
}
})
.catch(err => {
setLoading(false);
});
} else {
EditIntegratedLogin({
systemName: obj.systemName,
subtitle: obj.subtitle,
internetAddress: obj.internetAddress,
intranetAddress: obj.intranetAddress,
accountParam: bb,
iconUrl: obj.iconUrl,
accountType: 'Panda',
target: obj.target,
isMaster: obj.isMaster,
images: dataList,
clients: pickItem.clients,
isHide: pickItem.isHide,
mapSetting: obj.mapSetting,
coordinate: data,
siteDescription: obj.siteDescription,
})
.then(res => {
if (res.code === 0) {
onCancel();
setLoading(false);
callBackSubmit();
notification.success({
message: '提示',
duration: 3,
description: res.msg || '编辑成功',
});
} else {
setLoading(false);
notification.error({
message: '提示',
duration: 3,
description: res.msg || '编辑失败',
});
}
})
.catch(err => {
setLoading(false);
});
}
} else {
notification.warning({
message: '提示',
duration: 3,
description: '内网地址或外网地址必须填写一项',
});
}
}
});
};
const layout = {
......
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