previewGroupUser.tsx 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { Tabs, Typography } from 'antd';
  2. import React, { useState } from 'react';
  3. import { ShowGroupUserTable } from './addGroupObject';
  4. const { Text } = Typography;
  5. interface PreviewGroupUserProps {
  6. strategyList: { [x: string]: any }[];
  7. bookPlatForm: TASK_CREATE.BookPlatFormProps[]
  8. bookList: TASK_CREATE.BookListProps[]
  9. }
  10. /**
  11. * 群配置预览
  12. * @param param0
  13. * @returns
  14. */
  15. const PreviewGroupUser: React.FC<PreviewGroupUserProps> = ({ strategyList, bookList, bookPlatForm }) => {
  16. /****************************************/
  17. const [activeKey, setActiveKey] = useState<string>('1')
  18. /****************************************/
  19. return <Tabs
  20. activeKey={activeKey}
  21. tabPosition='left'
  22. style={{
  23. height: '100%',
  24. width: '100%'
  25. }}
  26. onChange={(key) => { setActiveKey(key) }}
  27. items={strategyList.map((item, index) => {
  28. return {
  29. label: <div style={{ maxWidth: 100 }}><Text>{item.strategyName}</Text></div>,
  30. key: `${index + 1}`,
  31. children: <div style={{ width: '100%', height: 282, overflow: 'hidden', overflowY: 'auto' }}>
  32. <ShowGroupUserTable
  33. value={item.groupObjectList}
  34. bookList={bookList}
  35. bookPlatForm={bookPlatForm}
  36. isPreview={true}
  37. />
  38. </div>
  39. }
  40. })}
  41. />;
  42. };
  43. export default PreviewGroupUser;