import React, { useEffect, useState, useRef } from 'react';
import Icon from '../../Icon/index';
import LargeScreenLayerInput from '../LargeScreenLayerInput/index';
import Sortable from 'sortablejs';
import { IGISChildren } from '../../../type/largeScreenLayer';
import { Dropdown, Menu, Input } from 'antd';
function LargeScreenGISList(props: IProps) {
const gisChildLayerMenuList = [
{
key: 'shangyi',
label: '上移一层',
icon:
},
{
key: 'xiayi',
label: '下移一层',
icon:
},
{ key: 'del', label: '删除', icon: },
{
key: 'rename',
label: '重命名',
icon:
}
];
const { GISChildren, layerListEvent } = props;
const [isCurrentInput, setIsCurrentInput] = useState(-1);
const listRef = useRef(null); // 图层列表容器ref
const sortableRef = useRef(null); // sortable
const dragRef = useRef(null); // 拖动开始
useEffect(() => {
if (GISChildren.length > 0) {
sortableRef?.current?.destroy();
initSort();
}
}, [GISChildren]);
const zoomMenu = (item, index) => {
let menu = [...gisChildLayerMenuList];
if (item.isHide) {
menu.push({
key: 'show',
label: '显示',
icon:
});
} else {
menu.push({
key: 'hid',
label: '隐藏',
icon:
});
}
return (