|
@@ -1,7 +1,7 @@
|
|
/*
|
|
/*
|
|
* @Author: your name
|
|
* @Author: your name
|
|
* @Date: 2021-11-16 09:12:37
|
|
* @Date: 2021-11-16 09:12:37
|
|
- * @LastEditTime: 2024-12-03 14:54:16
|
|
|
|
|
|
+ * @LastEditTime: 2024-12-31 13:48:33
|
|
* @LastEditors: code4eat awesomedema@gmail.com
|
|
* @LastEditors: code4eat awesomedema@gmail.com
|
|
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
* @FilePath: /KC-MiddlePlatform/src/pages/index/components/topBar/index.tsx
|
|
* @FilePath: /KC-MiddlePlatform/src/pages/index/components/topBar/index.tsx
|
|
@@ -11,7 +11,7 @@ import React, { useEffect, useState } from 'react';
|
|
|
|
|
|
import './style.less';
|
|
import './style.less';
|
|
|
|
|
|
-import { Input, Modal, Tooltip } from 'antd';
|
|
|
|
|
|
+import { Input, Modal, Popover, Tooltip } from 'antd';
|
|
import { LogoutOutlined, SettingOutlined } from '@ant-design/icons';
|
|
import { LogoutOutlined, SettingOutlined } from '@ant-design/icons';
|
|
|
|
|
|
// import logo from '../../../public/images/kc-logo.png';
|
|
// import logo from '../../../public/images/kc-logo.png';
|
|
@@ -32,18 +32,18 @@ interface TopBarType {
|
|
onTabClick?: (data: TopBar.Tab) => void;
|
|
onTabClick?: (data: TopBar.Tab) => void;
|
|
userData?: { name: string;[key: string]: any };
|
|
userData?: { name: string;[key: string]: any };
|
|
navData: TopBar.PanelData[];
|
|
navData: TopBar.PanelData[];
|
|
- logo?:string;
|
|
|
|
- topBarTitle?:string;
|
|
|
|
|
|
+ logo?: string;
|
|
|
|
+ topBarTitle?: string;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
const TopBar: React.FC<TopBarType> = (props) => {
|
|
const TopBar: React.FC<TopBarType> = (props) => {
|
|
- const { onTabChange, userPannelTabClick, onCloseTab, onTabClick, userData, navData, currentTab,logo=undefined,topBarTitle='欢迎进入医管平台' } = props;
|
|
|
|
|
|
+ const { onTabChange, userPannelTabClick, onCloseTab, onTabClick, userData, navData, currentTab, logo = undefined, topBarTitle = '欢迎进入医管平台' } = props;
|
|
const [systemTabs, setSystemTabs] = useState<TopBar.Tab[]>([]); //已打开的tab
|
|
const [systemTabs, setSystemTabs] = useState<TopBar.Tab[]>([]); //已打开的tab
|
|
const [currentSelectedTab, setCurrentSelectedTab] = useState<TopBar.Tab>();
|
|
const [currentSelectedTab, setCurrentSelectedTab] = useState<TopBar.Tab>();
|
|
const [ifOpenPannel, setIfOpenPannel] = useState(false);
|
|
const [ifOpenPannel, setIfOpenPannel] = useState(false);
|
|
const [arrowRotate, setArrowRotate] = useState(false);
|
|
const [arrowRotate, setArrowRotate] = useState(false);
|
|
- const [pageTitle, set_pageTitle] = useState('');
|
|
|
|
|
|
+ // const [pageTitle, set_pageTitle] = useState('');
|
|
const [currentActivedBlockIndex, set_currentActivedBlockIndex] = useState(0);
|
|
const [currentActivedBlockIndex, set_currentActivedBlockIndex] = useState(0);
|
|
const [panelData, set_panelData] = useState<TopBar.PanelData[]>([]);
|
|
const [panelData, set_panelData] = useState<TopBar.PanelData[]>([]);
|
|
|
|
|
|
@@ -51,11 +51,13 @@ const TopBar: React.FC<TopBarType> = (props) => {
|
|
const [onTabSystemTabs_hide, set_onTabSystemTabs_hide] = useState<TopBar.Tab[]>([]); //下拉掩藏的导航
|
|
const [onTabSystemTabs_hide, set_onTabSystemTabs_hide] = useState<TopBar.Tab[]>([]); //下拉掩藏的导航
|
|
|
|
|
|
const { initialState, setInitialState } = useModel('@@initialState');
|
|
const { initialState, setInitialState } = useModel('@@initialState');
|
|
- const [tokenUpdateModalVisible,set_tokenUpdateModalVisible] = useState(false);
|
|
|
|
|
|
+ const [tokenUpdateModalVisible, set_tokenUpdateModalVisible] = useState(false);
|
|
const location = useLocation();
|
|
const location = useLocation();
|
|
|
|
|
|
const [showMoreTabPannel, set_showMoreTabPannel] = useState(false);
|
|
const [showMoreTabPannel, set_showMoreTabPannel] = useState(false);
|
|
- const [password,set_password] = useState<string|undefined>(undefined);
|
|
|
|
|
|
+ const [password, set_password] = useState<string | undefined>(undefined);
|
|
|
|
+ const [showGroupList, set_showGroupList] = useState(false);
|
|
|
|
+ const [groupList,set_groupList] = useState<any[]>([]);
|
|
|
|
|
|
|
|
|
|
const localSavedTab = localStorage.getItem('currentSelectedTab');
|
|
const localSavedTab = localStorage.getItem('currentSelectedTab');
|
|
@@ -69,7 +71,7 @@ const TopBar: React.FC<TopBarType> = (props) => {
|
|
//导航栏tab点击
|
|
//导航栏tab点击
|
|
// console.log('_systemTabClickHandle',item);
|
|
// console.log('_systemTabClickHandle',item);
|
|
onTabClick && onTabClick(item);
|
|
onTabClick && onTabClick(item);
|
|
- if(item.type != 1&&item.contentType != 7){
|
|
|
|
|
|
+ if (item.type != 1 && item.contentType != 7) {
|
|
localStorage.setItem('currentSelectedTab', JSON.stringify(item));
|
|
localStorage.setItem('currentSelectedTab', JSON.stringify(item));
|
|
setCurrentSelectedTab(item);
|
|
setCurrentSelectedTab(item);
|
|
}
|
|
}
|
|
@@ -79,9 +81,9 @@ const TopBar: React.FC<TopBarType> = (props) => {
|
|
|
|
|
|
const _systemListClickHandle = (data: TopBar.Tab, currentActivedBlockIndex: number, index: number, i: number) => {
|
|
const _systemListClickHandle = (data: TopBar.Tab, currentActivedBlockIndex: number, index: number, i: number) => {
|
|
//导航栏系统菜单列表点击回调
|
|
//导航栏系统菜单列表点击回调
|
|
-
|
|
|
|
|
|
+
|
|
if (currentSelectedTab?.menuId == data.menuId) return;
|
|
if (currentSelectedTab?.menuId == data.menuId) return;
|
|
-
|
|
|
|
|
|
+
|
|
//临时保存衣打开过的菜单
|
|
//临时保存衣打开过的菜单
|
|
const t = localStorage.getItem('visitedTabs');
|
|
const t = localStorage.getItem('visitedTabs');
|
|
|
|
|
|
@@ -98,7 +100,8 @@ const TopBar: React.FC<TopBarType> = (props) => {
|
|
|
|
|
|
_systemTabClickHandle(data); //触发一次tab点击
|
|
_systemTabClickHandle(data); //触发一次tab点击
|
|
|
|
|
|
- set_pageTitle(panelData[currentActivedBlockIndex].child[index].name)
|
|
|
|
|
|
+ // set_pageTitle(panelData[currentActivedBlockIndex].child[index].name);
|
|
|
|
+ setInitialState((s: any) => ({ ...s, pageTitle: panelData[currentActivedBlockIndex].child[index].name }))
|
|
|
|
|
|
if (panelData[currentActivedBlockIndex].child[index].child) {
|
|
if (panelData[currentActivedBlockIndex].child[index].child) {
|
|
//console.log([...panelData[currentActivedBlockIndex].child[index].child])
|
|
//console.log([...panelData[currentActivedBlockIndex].child[index].child])
|
|
@@ -129,7 +132,7 @@ const TopBar: React.FC<TopBarType> = (props) => {
|
|
if (delIndex != 0) {
|
|
if (delIndex != 0) {
|
|
_systemTabClickHandle(_systemTabs[delIndex - 1]); //自动切换为前一个tab
|
|
_systemTabClickHandle(_systemTabs[delIndex - 1]); //自动切换为前一个tab
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
onTabChange && onTabChange(filtered);
|
|
onTabChange && onTabChange(filtered);
|
|
onCloseTab && onCloseTab(item);
|
|
onCloseTab && onCloseTab(item);
|
|
};
|
|
};
|
|
@@ -161,7 +164,7 @@ const TopBar: React.FC<TopBarType> = (props) => {
|
|
setSystemTabs([]); //清空tab导航
|
|
setSystemTabs([]); //清空tab导航
|
|
onTabChange && onTabChange([]);
|
|
onTabChange && onTabChange([]);
|
|
setCurrentSelectedTab(undefined);
|
|
setCurrentSelectedTab(undefined);
|
|
- set_pageTitle(topBarTitle);
|
|
|
|
|
|
+ setInitialState((s: any) => ({ ...s, pageTitle: topBarTitle }))
|
|
setIfOpenPannel(false);
|
|
setIfOpenPannel(false);
|
|
console.log('goHome');
|
|
console.log('goHome');
|
|
localStorage.removeItem('currentSelectedTab');
|
|
localStorage.removeItem('currentSelectedTab');
|
|
@@ -204,10 +207,10 @@ const TopBar: React.FC<TopBarType> = (props) => {
|
|
_systemTabClickHandle(systemData);
|
|
_systemTabClickHandle(systemData);
|
|
const temp = onTabSystemTabs[onTabSystemTabs.length - 1];
|
|
const temp = onTabSystemTabs[onTabSystemTabs.length - 1];
|
|
const _onTabSystemTabs = [...onTabSystemTabs];
|
|
const _onTabSystemTabs = [...onTabSystemTabs];
|
|
- const b = _onTabSystemTabs.filter(a => (a.systemId?a.systemId:a.menuId) != (temp.systemId?temp.systemId:temp.menuId));
|
|
|
|
-
|
|
|
|
|
|
+ const b = _onTabSystemTabs.filter(a => (a.systemId ? a.systemId : a.menuId) != (temp.systemId ? temp.systemId : temp.menuId));
|
|
|
|
+
|
|
set_onTabSystemTabs([...b, systemData]);
|
|
set_onTabSystemTabs([...b, systemData]);
|
|
- set_onTabSystemTabs_hide([...onTabSystemTabs_hide.filter(a => (a.systemId?a.systemId:a.menuId) != (systemData.systemId?systemData.systemId:systemData.menuId)), temp])
|
|
|
|
|
|
+ set_onTabSystemTabs_hide([...onTabSystemTabs_hide.filter(a => (a.systemId ? a.systemId : a.menuId) != (systemData.systemId ? systemData.systemId : systemData.menuId)), temp])
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -235,7 +238,8 @@ const TopBar: React.FC<TopBarType> = (props) => {
|
|
for (let k = 0; k < _systems.length; k++) {
|
|
for (let k = 0; k < _systems.length; k++) {
|
|
if (_systems[k].menuId == _currentSelectedTabFromLocal.menuId) {
|
|
if (_systems[k].menuId == _currentSelectedTabFromLocal.menuId) {
|
|
set_currentActivedBlockIndex(blockIndex);
|
|
set_currentActivedBlockIndex(blockIndex);
|
|
- set_pageTitle(_panelData[blockIndex].child[channelIndex].name); //设置体系标题
|
|
|
|
|
|
+ // set_pageTitle(_panelData[blockIndex].child[channelIndex].name); //设置体系标题
|
|
|
|
+ setInitialState((s: any) => ({ ...s, pageTitle: _panelData[blockIndex].child[channelIndex].name }))
|
|
|
|
|
|
break one;
|
|
break one;
|
|
}
|
|
}
|
|
@@ -254,8 +258,8 @@ const TopBar: React.FC<TopBarType> = (props) => {
|
|
}
|
|
}
|
|
|
|
|
|
// console.log({_currentSelectedTabFromLocal,location});
|
|
// console.log({_currentSelectedTabFromLocal,location});
|
|
- const {pathname} = location;
|
|
|
|
- if(pathname.indexOf(_currentSelectedTabFromLocal.path) == -1){
|
|
|
|
|
|
+ const { pathname } = location;
|
|
|
|
+ if (pathname.indexOf(_currentSelectedTabFromLocal.path) == -1) {
|
|
history.push(_currentSelectedTabFromLocal.path);
|
|
history.push(_currentSelectedTabFromLocal.path);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -287,19 +291,19 @@ const TopBar: React.FC<TopBarType> = (props) => {
|
|
};
|
|
};
|
|
|
|
|
|
const updateToken = async () => {
|
|
const updateToken = async () => {
|
|
- const account = (localStorage.getItem('account')) as string;
|
|
|
|
- const hospSign = localStorage.getItem('hospSign');
|
|
|
|
- const data = {
|
|
|
|
- account,
|
|
|
|
- password:password,
|
|
|
|
- hospSign
|
|
|
|
- }
|
|
|
|
- const resp = await updateTokenReq(data);
|
|
|
|
- if(resp){
|
|
|
|
- set_password(undefined);
|
|
|
|
- set_tokenUpdateModalVisible(false);
|
|
|
|
- window.location.reload();
|
|
|
|
- }
|
|
|
|
|
|
+ const account = (localStorage.getItem('account')) as string;
|
|
|
|
+ const hospSign = localStorage.getItem('hospSign');
|
|
|
|
+ const data = {
|
|
|
|
+ account,
|
|
|
|
+ password: password,
|
|
|
|
+ hospSign
|
|
|
|
+ }
|
|
|
|
+ const resp = await updateTokenReq(data);
|
|
|
|
+ if (resp) {
|
|
|
|
+ set_password(undefined);
|
|
|
|
+ set_tokenUpdateModalVisible(false);
|
|
|
|
+ window.location.reload();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -319,9 +323,9 @@ const TopBar: React.FC<TopBarType> = (props) => {
|
|
}, [currentTab]);
|
|
}, [currentTab]);
|
|
|
|
|
|
|
|
|
|
- useEffect(()=>{
|
|
|
|
- set_pageTitle(topBarTitle);
|
|
|
|
- },[topBarTitle])
|
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
+ setInitialState((s: any) => ({ ...s, pageTitle: topBarTitle }))
|
|
|
|
+ }, [topBarTitle])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -356,22 +360,23 @@ const TopBar: React.FC<TopBarType> = (props) => {
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
|
|
|
- //_systemTabClickHandle(currentSelectedTabFromLocal); //恢复选中的tab
|
|
|
|
|
|
+ // _systemTabClickHandle(currentSelectedTabFromLocal); //恢复选中的tab
|
|
|
|
|
|
document.body.addEventListener('click', (e: any) => {
|
|
document.body.addEventListener('click', (e: any) => {
|
|
|
|
|
|
- const classes = ['panel', 'typeBlockName', 'left', 'typeBlockIcon', 'typeBlock', 'typeBlock active', 'active', 'right', 'row', 'rowDetai', 'channelName', 'channelList', 'systemTab', 'channelIcon', 'rowDetail','typeBlockIcon typeBlockIcon1','typeBlockIcon typeBlockIcon2','typeBlockIcon typeBlockIcon3','typeBlockIcon typeBlockIcon4','typeBlockIcon typeBlockIcon5','typeBlockIcon typeBlockIcon6','typeBlockIcon typeBlockIcon7','typeBlockIcon typeBlockIcon8','typeBlockIcon typeBlockIcon9'];
|
|
|
|
|
|
+ const classes = ['panel', 'typeBlockName', 'left', 'typeBlockIcon', 'typeBlock', 'typeBlock active', 'active', 'right', 'row', 'rowDetai', 'channelName', 'channelList', 'systemTab', 'channelIcon', 'rowDetail', 'typeBlockIcon typeBlockIcon1', 'typeBlockIcon typeBlockIcon2', 'typeBlockIcon typeBlockIcon3', 'typeBlockIcon typeBlockIcon4', 'typeBlockIcon typeBlockIcon5', 'typeBlockIcon typeBlockIcon6', 'typeBlockIcon typeBlockIcon7', 'typeBlockIcon typeBlockIcon8', 'typeBlockIcon typeBlockIcon9'];
|
|
if (e.target) {
|
|
if (e.target) {
|
|
- let key = e.target.className?e.target.className:'';
|
|
|
|
- if (classes.includes(key)||(typeof key == 'string'&&key.indexOf('typeBlockIcon') != -1)) {
|
|
|
|
|
|
+ let key = e.target.className ? e.target.className : '';
|
|
|
|
+ if (classes.includes(key) || (typeof key == 'string' && key.indexOf('typeBlockIcon') != -1)) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
setIfOpenPannel(false);
|
|
setIfOpenPannel(false);
|
|
|
|
+ set_showGroupList(false);
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
// 事件监听器的函数定义
|
|
// 事件监听器的函数定义
|
|
- const handleStorageChange = (e:any) => {
|
|
|
|
|
|
+ const handleStorageChange = (e: any) => {
|
|
if (e.key === 'tokenExpired') {
|
|
if (e.key === 'tokenExpired') {
|
|
set_tokenUpdateModalVisible(true);
|
|
set_tokenUpdateModalVisible(true);
|
|
}
|
|
}
|
|
@@ -389,31 +394,31 @@ const TopBar: React.FC<TopBarType> = (props) => {
|
|
|
|
|
|
return (
|
|
return (
|
|
<div className='topBar' onClick={e => e.stopPropagation()}>
|
|
<div className='topBar' onClick={e => e.stopPropagation()}>
|
|
- <Modal className='TokenUpdateModal' open={tokenUpdateModalVisible} width={400} title={false} footer={false} closable={false} >
|
|
|
|
- <div className='content'>
|
|
|
|
- <div className='title'>登录超时锁定</div>
|
|
|
|
- <div className='form'>
|
|
|
|
- <div className='avatar'>
|
|
|
|
- <img className='avatarImg' src={require('../../../public/images/initAvatar.png')} alt="" />
|
|
|
|
- <img className='suoding' src={require('../../../public/images/suoding.png')} alt="" />
|
|
|
|
- </div>
|
|
|
|
- <div className='name'>{userData?.name}</div>
|
|
|
|
- <Input onChange={(e)=>set_password(e.target.value)} value={password}
|
|
|
|
- className='input' autoComplete='off' onKeyDown={(e)=>e.key === 'Enter'&&updateToken()} />
|
|
|
|
- <div className='updateBtn' onClick={()=>updateToken()}>解锁</div>
|
|
|
|
- <a onClick={()=>logoutHandle()}>退出登录</a>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <Modal className='TokenUpdateModal' open={tokenUpdateModalVisible} width={400} title={false} footer={false} closable={false} >
|
|
|
|
+ <div className='content'>
|
|
|
|
+ <div className='title'>登录超时锁定</div>
|
|
|
|
+ <div className='form'>
|
|
|
|
+ <div className='avatar'>
|
|
|
|
+ <img className='avatarImg' src={require('../../../public/images/initAvatar.png')} alt="" />
|
|
|
|
+ <img className='suoding' src={require('../../../public/images/suoding.png')} alt="" />
|
|
|
|
+ </div>
|
|
|
|
+ <div className='name'>{userData?.name}</div>
|
|
|
|
+ <Input onChange={(e) => set_password(e.target.value)} value={password}
|
|
|
|
+ className='input' autoComplete='off' onKeyDown={(e) => e.key === 'Enter' && updateToken()} />
|
|
|
|
+ <div className='updateBtn' onClick={() => updateToken()}>解锁</div>
|
|
|
|
+ <a onClick={() => logoutHandle()}>退出登录</a>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</Modal>
|
|
</Modal>
|
|
<div className='logoWrap'>
|
|
<div className='logoWrap'>
|
|
- {logo&&<img className='logo' src={logo} onClick={() => goToHome()} />}
|
|
|
|
|
|
+ {logo && <img className='logo' src={logo} onClick={() => goToHome()} />}
|
|
<Divider type="vertical" style={{ background: 'white', height: 16, opacity: 0.29, position: 'relative', top: 1, marginLeft: 16, marginRight: 8 }} />
|
|
<Divider type="vertical" style={{ background: 'white', height: 16, opacity: 0.29, position: 'relative', top: 1, marginLeft: 16, marginRight: 8 }} />
|
|
<div className={ifOpenPannel ? 'menu active' : 'menu'} onClick={() => openNav()}>
|
|
<div className={ifOpenPannel ? 'menu active' : 'menu'} onClick={() => openNav()}>
|
|
<img src={require('../../../public/images/menu.png')} alt="" />
|
|
<img src={require('../../../public/images/menu.png')} alt="" />
|
|
</div>
|
|
</div>
|
|
<span className='systemTitle'
|
|
<span className='systemTitle'
|
|
// onClick={() => goSystemIndex(pageTitle)}
|
|
// onClick={() => goSystemIndex(pageTitle)}
|
|
- >{pageTitle}</span>
|
|
|
|
|
|
+ >{initialState?.pageTitle}</span>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div className='userRelaInfoWrap'>
|
|
<div className='userRelaInfoWrap'>
|
|
@@ -453,9 +458,20 @@ const TopBar: React.FC<TopBarType> = (props) => {
|
|
<div className='notification'>
|
|
<div className='notification'>
|
|
<img className='notificationIcon' src={require('../../../public/images/notificationIcon.png')} />
|
|
<img className='notificationIcon' src={require('../../../public/images/notificationIcon.png')} />
|
|
</div>
|
|
</div>
|
|
|
|
+ <div className='group'>
|
|
|
|
+ <Tooltip title="运营管理部" placement='right'><div className='group-switcher' onClick={()=>set_showGroupList(!showGroupList)}><img src={require('./images/groupIcon.png')} alt="" /></div></Tooltip>
|
|
|
|
+ {
|
|
|
|
+ showGroupList && (
|
|
|
|
+ <div className='group-list-wrapper'>
|
|
|
|
+ <div className='group-list active'>后勤管理部</div>
|
|
|
|
+ <div className='group-list'>后勤管理部</div>
|
|
|
|
+ </div>
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ </div>
|
|
<Tooltip className='topBarTooltip' placement='bottomRight' title={<UserPannel />} color="#fff" onOpenChange={(visible) => setArrowRotate(visible)}>
|
|
<Tooltip className='topBarTooltip' placement='bottomRight' title={<UserPannel />} color="#fff" onOpenChange={(visible) => setArrowRotate(visible)}>
|
|
<div className='user'>
|
|
<div className='user'>
|
|
- <div className='avator'><img src={userData?.avatarUrl?userData.avatarUrl:require('../../../public/images/avatar.png')} /></div>
|
|
|
|
|
|
+ <div className='avator'><img src={userData?.avatarUrl ? userData.avatarUrl : require('../../../public/images/avatar.png')} /></div>
|
|
<div className='info'>
|
|
<div className='info'>
|
|
<span className='hospName'>{localStorage.getItem('hospAbbreviation')}</span>
|
|
<span className='hospName'>{localStorage.getItem('hospAbbreviation')}</span>
|
|
<span className='name'>{userData?.name}</span>
|
|
<span className='name'>{userData?.name}</span>
|
|
@@ -487,7 +503,7 @@ const TopBar: React.FC<TopBarType> = (props) => {
|
|
panelData.length > 0 && panelData[currentActivedBlockIndex] && panelData[currentActivedBlockIndex].child && panelData[currentActivedBlockIndex].child.map((item, index: number) => {
|
|
panelData.length > 0 && panelData[currentActivedBlockIndex] && panelData[currentActivedBlockIndex].child && panelData[currentActivedBlockIndex].child.map((item, index: number) => {
|
|
return (
|
|
return (
|
|
<div className='row' key={index}>
|
|
<div className='row' key={index}>
|
|
- <img className='channelIcon' src={item.icon?item.icon:require(`../../../public/images/tongyong_tixi.png`)} alt="" />
|
|
|
|
|
|
+ <img className='channelIcon' src={item.icon ? item.icon : require(`../../../public/images/tongyong_tixi.png`)} alt="" />
|
|
<div className='rowDetail'>
|
|
<div className='rowDetail'>
|
|
<div className='channelName' onClick={() => goChannelIndex(item)}>{item.name}</div>
|
|
<div className='channelName' onClick={() => goChannelIndex(item)}>{item.name}</div>
|
|
<div className='channelList'>
|
|
<div className='channelList'>
|