Skip to content

Commit

Permalink
refactor(components): 优化聊天组件和实时告警页面
Browse files Browse the repository at this point in the history
- 聊天组件:将发送按钮添加点击事件,简化 onPressEnter 事件处理
- 实时告警页面:更新刷新按钮逻辑,优化表格行样式
  • Loading branch information
aide-cloud committed Dec 30, 2024
1 parent d01c28a commit 3adfc1a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/components/chat/moon-chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,12 @@ export default function MoonChat() {
loading ? (
<Button type='primary' icon={<CloseCircleOutlined />} onClick={handleClose} />
) : (
<SendOutlined />
<SendOutlined className='cursor-pointer' onClick={sendMessage} />
)
}
value={msg}
onChange={(e) => setMsg(e.target.value)}
onPressEnter={() => {
sendMessage()
}}
onPressEnter={sendMessage}
/>
</div>
</Drawer>
Expand Down
13 changes: 9 additions & 4 deletions src/pages/realtime/alarm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,14 @@ const Group: React.FC = () => {
checked={showLevelColor}
onChange={setShowLevelColor}
/>
<Button color='default' variant='filled' onClick={onRefresh}>
<Button
color='default'
variant='filled'
onClick={() => {
onRefresh()
onRefreshPages()
}}
>
刷新
</Button>
</Space>
Expand Down Expand Up @@ -275,9 +282,7 @@ const Group: React.FC = () => {
onRow={(record) => {
const { metricLevel: level } = record as RealtimeAlarmItem
return {
style: {
background: showLevelColor ? level.level.extend?.color : ''
}
style: { background: showLevelColor ? level.level.extend?.color : '' }
}
}}
/>
Expand Down

0 comments on commit 3adfc1a

Please sign in to comment.