Skip to content

Commit d2b35f4

Browse files
committed
[frontend] 增加最新版本tag,预览模式取消自动保存
1 parent 0ecbaff commit d2b35f4

2 files changed

Lines changed: 25 additions & 6 deletions

File tree

app-engine/frontend/src/components/timeLine/index.tsx

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*--------------------------------------------------------------------------------------------*/
66

77
import React, { useContext, useEffect, useRef, useState } from 'react';
8-
import { Button, Drawer, Timeline } from 'antd';
8+
import { Button, Drawer, Tag, Timeline } from 'antd';
99
import { useParams } from 'react-router-dom';
1010
import { CloseOutlined } from '@ant-design/icons';
1111
import { Message } from '@/shared/utils/message';
@@ -62,7 +62,6 @@ const TimeLineFc = (props) => {
6262
};
6363

6464
useEffect(() => {
65-
console.log(open)
6665
if (open) {
6766
dispatch(setIsReadOnly(true));
6867
setTimeList([]);
@@ -178,25 +177,42 @@ const TimeLineFc = (props) => {
178177
<div style={{ fontWeight: '700' }}>{t('currentDraft')}</div>
179178
</div>
180179
</Timeline.Item>
181-
{timeList.map(timeItem => {
180+
{timeList.map((timeItem, index) => {
182181
const isSelected = timeItem.id === selectedAppId;
182+
const isLatest = index === 0;
183183
return (
184184
<Timeline.Item
185-
color={isSelected ? 'blue' : '#000000'}
185+
color={isSelected ? '#2673e5' : 'rgb(77, 77, 77)'}
186186
key={timeItem.id}
187187
>
188188
<div
189189
className="time-line-inner"
190190
style={{
191-
color: isSelected ? '#1677ff' : 'rgb(77, 77, 77)',
191+
color: isSelected ? '#2673e5' : 'rgb(77, 77, 77)',
192192
backgroundColor: isSelected ? '#e6f7ff' : 'transparent',
193193
borderRadius: '4px',
194194
padding: '8px',
195195
cursor: 'pointer',
196196
}}
197197
onClick={() => handleItemClick(timeItem)}
198198
>
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>
200216
<div style={{ margin: '8px 0' }}>{descProcess(timeItem.publishedDescription)}</div>
201217
<div>{timeItem.updateBy}</div>
202218
<div>{timeItem.updateAt}</div>

app-engine/frontend/src/pages/addFlow/components/elsa-stage.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,9 @@ const Stage = (props) => {
305305
// 数据实时保存
306306
const handleChange = useCallback(debounce((id) => elsaChange(id), 2000), []);
307307
function elsaChange(id: any) {
308+
if (elsaReadOnlyRef.current) {
309+
return;
310+
}
308311
let graphChangeData = window.agent.serialize();
309312
currentApp.current.flowGraph.appearance = graphChangeData;
310313
updateAppRunningFlow(id);

0 commit comments

Comments
 (0)