|
5 | 5 | *--------------------------------------------------------------------------------------------*/ |
6 | 6 |
|
7 | 7 | import React, { useContext, useEffect, useRef, useState } from 'react'; |
8 | | -import { Button, Drawer, Timeline } from 'antd'; |
| 8 | +import { Button, Drawer, Tag, Timeline } from 'antd'; |
9 | 9 | import { useParams } from 'react-router-dom'; |
10 | 10 | import { CloseOutlined } from '@ant-design/icons'; |
11 | 11 | import { Message } from '@/shared/utils/message'; |
@@ -62,7 +62,6 @@ const TimeLineFc = (props) => { |
62 | 62 | }; |
63 | 63 |
|
64 | 64 | useEffect(() => { |
65 | | - console.log(open) |
66 | 65 | if (open) { |
67 | 66 | dispatch(setIsReadOnly(true)); |
68 | 67 | setTimeList([]); |
@@ -178,25 +177,42 @@ const TimeLineFc = (props) => { |
178 | 177 | <div style={{ fontWeight: '700' }}>{t('currentDraft')}</div> |
179 | 178 | </div> |
180 | 179 | </Timeline.Item> |
181 | | - {timeList.map(timeItem => { |
| 180 | + {timeList.map((timeItem, index) => { |
182 | 181 | const isSelected = timeItem.id === selectedAppId; |
| 182 | + const isLatest = index === 0; |
183 | 183 | return ( |
184 | 184 | <Timeline.Item |
185 | | - color={isSelected ? 'blue' : '#000000'} |
| 185 | + color={isSelected ? '#2673e5' : 'rgb(77, 77, 77)'} |
186 | 186 | key={timeItem.id} |
187 | 187 | > |
188 | 188 | <div |
189 | 189 | className="time-line-inner" |
190 | 190 | style={{ |
191 | | - color: isSelected ? '#1677ff' : 'rgb(77, 77, 77)', |
| 191 | + color: isSelected ? '#2673e5' : 'rgb(77, 77, 77)', |
192 | 192 | backgroundColor: isSelected ? '#e6f7ff' : 'transparent', |
193 | 193 | borderRadius: '4px', |
194 | 194 | padding: '8px', |
195 | 195 | cursor: 'pointer', |
196 | 196 | }} |
197 | 197 | onClick={() => handleItemClick(timeItem)} |
198 | 198 | > |
199 | | - <div style={{ fontWeight: '700' }}>{timeItem.version}</div> |
| 199 | + <div style={{ display: 'flex', alignItems: 'center', fontWeight: 700, gap: '12px' }}> |
| 200 | + <span>{timeItem.version}</span> |
| 201 | + {isLatest && |
| 202 | + <Tag |
| 203 | + style={{ |
| 204 | + borderColor: '#2673e5', |
| 205 | + color: '#2673e5', |
| 206 | + backgroundColor: 'transparent', |
| 207 | + fontWeight: 'normal', |
| 208 | + padding: '0 8px', |
| 209 | + height: '22px', |
| 210 | + }} |
| 211 | + > |
| 212 | + {t('latest')} |
| 213 | + </Tag> |
| 214 | + } |
| 215 | + </div> |
200 | 216 | <div style={{ margin: '8px 0' }}>{descProcess(timeItem.publishedDescription)}</div> |
201 | 217 | <div>{timeItem.updateBy}</div> |
202 | 218 | <div>{timeItem.updateAt}</div> |
|
0 commit comments