Commit 6f00cc3e authored by 皮倩雯's avatar 皮倩雯

fix: '

parent 64c3555b
Pipeline #79525 passed with stages
...@@ -42,7 +42,16 @@ const { Item } = Form; ...@@ -42,7 +42,16 @@ const { Item } = Form;
const { Option } = Select; const { Option } = Select;
const { TreeNode } = TreeSelect; const { TreeNode } = TreeSelect;
const NewEditModal = props => { const NewEditModal = props => {
const { callBackSubmit = () => {}, type, formObj, visible, baseMap, name, onCancel } = props; const {
callBackSubmit = () => {},
type,
formObj,
visible,
baseMap,
name,
onCancel,
json,
} = props;
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [radio, setRadio] = useState(); const [radio, setRadio] = useState();
const [alpha, setAlpha] = useState(1); const [alpha, setAlpha] = useState(1);
...@@ -64,6 +73,7 @@ const NewEditModal = props => { ...@@ -64,6 +73,7 @@ const NewEditModal = props => {
'assets/images/thumbnail/thumbnail_3.jpg', 'assets/images/thumbnail/thumbnail_3.jpg',
'assets/images/thumbnail/thumbnail_4.jpg', 'assets/images/thumbnail/thumbnail_4.jpg',
]; ];
const [maplayer, setMaplayer] = useState([]);
// 提交 // 提交
const onSubmit = () => { const onSubmit = () => {
...@@ -178,11 +188,28 @@ const NewEditModal = props => { ...@@ -178,11 +188,28 @@ const NewEditModal = props => {
const onFinish = value => {}; const onFinish = value => {};
useEffect(() => { useEffect(() => {
let data = []; // let data = [];
jsonData.forEach(item => { // jsonData.forEach(item => {
data = [...data, ...item.items]; // data = [...data, ...item.items];
}); // });
setKeepJsonData(data); // setKeepJsonData(data);
if (json.length > 0) {
setMaplayer(json);
let data = [];
json.forEach(item => {
data = [...data, ...item.items];
});
setKeepJsonData(data);
} else {
setMaplayer(jsonData);
let data = [];
jsonData.forEach(item => {
data = [...data, ...item.items];
});
setKeepJsonData(data);
}
setLoading(false); setLoading(false);
setSpaceData([]); setSpaceData([]);
setKeyData([]); setKeyData([]);
...@@ -561,8 +588,8 @@ const NewEditModal = props => { ...@@ -561,8 +588,8 @@ const NewEditModal = props => {
showCheckedStrategy showCheckedStrategy
onChange={handleChange} onChange={handleChange}
> >
{jsonData ? ( {maplayer ? (
jsonData.map(i => mapTree(i)) maplayer.map(i => mapTree(i))
) : ( ) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} /> <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
)} )}
......
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