Commit bdf9bd9d authored by 皮倩雯's avatar 皮倩雯

fix: '集成登录地区选择优化'

parent 5be3b9d8
Pipeline #57221 waiting for manual action with stages
...@@ -106,6 +106,7 @@ const AddModal = props => { ...@@ -106,6 +106,7 @@ const AddModal = props => {
let list = []; let list = [];
let listSecord = []; let listSecord = [];
let fff = 0;
res.data.mapSettings.map(i => { res.data.mapSettings.map(i => {
list.push(i[0]); list.push(i[0]);
if (i[1]) { if (i[1]) {
...@@ -114,7 +115,9 @@ const AddModal = props => { ...@@ -114,7 +115,9 @@ const AddModal = props => {
}); });
console.log(list); console.log(list);
console.log(listSecord); console.log(listSecord);
if (list.indexOf('100000') != -1) {
fff = 1;
}
setShow(1); setShow(1);
// 获取城市选择器列表 // 获取城市选择器列表
window.AMap.plugin('AMap.DistrictSearch', () => { window.AMap.plugin('AMap.DistrictSearch', () => {
...@@ -158,17 +161,24 @@ const AddModal = props => { ...@@ -158,17 +161,24 @@ const AddModal = props => {
}); });
} }
}); });
data.map(i => { console.log(fff);
let aa = []; if (fff == 0) {
i.districtList.map(j => { data.map(i => {
if (listSecord.indexOf(j.adcode) != -1) { let aa = [];
aa.push(j); i.districtList.map(j => {
i.districtList = aa; if (listSecord.indexOf(j.adcode) != -1) {
} aa.push(j);
i.districtList = aa;
}
});
}); });
}); console.log(result.districtList[0].districtList);
console.log(result.districtList[0].districtList); setOptionsList(data);
setOptionsList(data); } else {
console.log(result.districtList[0].districtList);
setOptionsList(result.districtList[0].districtList);
}
if (type == 'edit') { if (type == 'edit') {
form.setFieldsValue({ form.setFieldsValue({
mapSetting: pickItem.MapSetting, mapSetting: pickItem.MapSetting,
...@@ -384,12 +394,8 @@ const AddModal = props => { ...@@ -384,12 +394,8 @@ const AddModal = props => {
]; ];
const onChangeField = (value, selectedOptions) => { const onChangeField = (value, selectedOptions) => {
console.log(value);
console.log(value[value.length - 1]);
let aa = value[value.length - 1].split(','); let aa = value[value.length - 1].split(',');
form.setFieldsValue({ coordinate1: aa[0], coordinate2: aa[1] }); form.setFieldsValue({ coordinate1: aa[0], coordinate2: aa[1] });
console.log(aa);
console.log(selectedOptions);
}; };
return ( return (
<Modal <Modal
......
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