index.js 1.39 KB
Newer Older
秦文海's avatar
秦文海 committed
1 2 3
import './index.less';
import { FileTextOutlined, PlaySquareOutlined } from '@ant-design/icons';
import { TableContent } from '../tableContent';
4 5 6
import { Tabs, ConfigProvider } from 'antd';
import classNames from 'classnames';
import React, { useContext } from 'react';
秦文海's avatar
秦文海 committed
7 8
const { TabPane } = Tabs;
const LeftList = (props) => {
9 10
  const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
  const prefixCls = getPrefixCls('panda-gis-tipLeft');
秦文海's avatar
秦文海 committed
11 12
  const { leftSetting } = props;
  return (
13
    <div className={classNames(`${prefixCls}-ullist`)}>
秦文海's avatar
秦文海 committed
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
      <Tabs tabPosition="left">
        {leftSetting.map((item, index) => {
          if (!item.active) return;
          if (item.name == 'dataList') {
            return (
              <TabPane
                tab={
                  <div>
                    <FileTextOutlined />
                  </div>
                }
                key={index}
              >
                <TableContent data={item.data} />
              </TabPane>
            );
          } else if (item.name == 'media') {
            return (
              <TabPane
                tab={
                  <div>
                    <PlaySquareOutlined />
                  </div>
                }
秦文海's avatar
秦文海 committed
38
                key={index}
秦文海's avatar
秦文海 committed
39 40 41 42 43 44 45 46 47 48 49
              >
                多媒体
              </TabPane>
            );
          }
        })}
      </Tabs>
    </div>
  );
};
export { LeftList };