|
|
@@ -1,9 +1,43 @@ |
|
|
|
import React from 'react' |
|
|
|
import React from 'react'; |
|
|
|
import { useState } from 'react'; |
|
|
|
import styles from './sync.less'; |
|
|
|
import syncingImg from './assets/syncing.png'; |
|
|
|
import syncSuccessImg from './assets/sync.success.png'; |
|
|
|
import syncErrorImg from './assets/sync.error.png'; |
|
|
|
import classNames from 'classnames'; |
|
|
|
|
|
|
|
enum SyncType { |
|
|
|
Syncing, |
|
|
|
SyncSuccess, |
|
|
|
SyncError, |
|
|
|
} |
|
|
|
|
|
|
|
const syncTypeList = [ |
|
|
|
{ type: SyncType.Syncing, label: '同步中', icon: syncingImg }, |
|
|
|
{ type: SyncType.SyncSuccess, label: '同步成功', icon: syncSuccessImg }, |
|
|
|
{ type: SyncType.SyncError, label: '同步异常', icon: syncErrorImg }, |
|
|
|
]; |
|
|
|
|
|
|
|
export default function SyncView() { |
|
|
|
const [type, setType] = useState<SyncType>(SyncType.Syncing); |
|
|
|
return ( |
|
|
|
<div> |
|
|
|
同步任务界面 |
|
|
|
<div className={styles.sync}> |
|
|
|
<div className={styles.left}> |
|
|
|
<h4><span>同步任务</span></h4> |
|
|
|
{ |
|
|
|
syncTypeList.map(({ type: iType, label, icon }) => ( |
|
|
|
<div className={classNames(styles.tab, iType === type ? styles.active : '')} onClick={() => setType(iType)}> |
|
|
|
<img className={styles.icon} src={icon} alt="" /> |
|
|
|
<span className={styles.label}>{label}</span> |
|
|
|
<span className={styles.count}>99+</span> |
|
|
|
</div> |
|
|
|
)) |
|
|
|
} |
|
|
|
</div> |
|
|
|
<div className={styles.right}> |
|
|
|
同步任务界面 |
|
|
|
<div style={{ height: 20000 }}></div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
) |
|
|
|
} |