wjx 2 semanas atrás
pai
commit
382d5439b1
1 arquivos alterados com 21 adições e 5 exclusões
  1. 21 5
      src/components/RightContent/index.tsx

+ 21 - 5
src/components/RightContent/index.tsx

@@ -1,4 +1,4 @@
-import { Tag, Space, Badge, Modal, Select, Avatar as AntdAvatar, message } from 'antd';
+import { Tag, Space, Badge, Modal, Select, Avatar as AntdAvatar, message, Divider, Checkbox } from 'antd';
 import React, { useCallback, useEffect, useState } from 'react';
 import { useModel } from 'umi';
 import Avatar from './AvatarDropdown';
@@ -248,7 +248,7 @@ const GlobalHeaderRight: React.FC<{}> = () => {
         })
     }, [])
 
-
+    const appListOptions = appList.filter(item => item.productType === initialState?.productType).filter(item => item.mediaPlatform === initialState?.mediaPlatform)
     return (
         <div style={{ display: 'flex', justifyContent: 'space-between' }}>
             {location.hash.includes('/iaaData') && <div style={{ left: left + 10, position: 'absolute' }}>
@@ -293,8 +293,7 @@ const GlobalHeaderRight: React.FC<{}> = () => {
                     filterOption={(input, option) => (option?.name as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                     value={initialState?.iaaApp}
                     onChange={(e) => {
-                        // if (e?.length > 0)
-                            setInitialState({ ...initialState, iaaApp: e })
+                        setInitialState({ ...initialState, iaaApp: e })
                     }}
                     allowClear
                     loading={getAppList.loading}
@@ -302,8 +301,25 @@ const GlobalHeaderRight: React.FC<{}> = () => {
                     maxTagCount={1}
                     removeIcon={<CloseOutlined style={{ color: '#000' }} />}
                     clearIcon={<CloseOutlined style={{ color: '#000' }} />}
+                    dropdownRender={menu => (
+                        <>
+                            {menu}
+                            <Divider style={{ margin: '8px 0' }} />
+                            <Space style={{ padding: '0 8px 4px' }}>
+                                <Checkbox
+                                    onChange={(e) => {
+                                        if (e.target.checked) {
+                                            setInitialState({ ...initialState, iaaApp: appListOptions.map(item => item.value) })
+                                        } else {
+                                            setInitialState({ ...initialState, iaaApp: [] })
+                                        }
+                                    }}
+                                >全选</Checkbox>
+                            </Space>
+                        </>
+                    )}
                 >
-                    {appList.filter(item => item.productType === initialState?.productType).filter(item => item.mediaPlatform === initialState?.mediaPlatform).map(item => {
+                    {appListOptions.map(item => {
                         return <Select.Option key={item.value} value={item.value} name={item.label}>
                             <Space align='center'>
                                 <AntdAvatar shape="square" style={{ marginBottom: 4 }} size={16} icon={<UserOutlined />} src={item?.icon} />