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

fix: '

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