Skip to content

Commit

Permalink
feat(设备模拟器): 设备模拟器
Browse files Browse the repository at this point in the history
操作交互优化

re #203
  • Loading branch information
Lind-pro committed Sep 24, 2020
1 parent 9e30101 commit 4d89d9a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/pages/simulator/device/detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const Detail: React.FC<Props> = props => {
useEffect(() => {
service.state(props.data.id).pipe(
).subscribe(data => {
console.log(data, 'dddd');
setData(data);
});
}, []);
Expand Down
11 changes: 9 additions & 2 deletions src/pages/simulator/device/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ const Simulator: React.FC<Props> = props => {
const start = (id: string) => {
service.start(id).subscribe(() => {
message.success('启动成功');
setDetailVisible(true);
// setCurrent(item)
search();
})
}
Expand Down Expand Up @@ -71,8 +73,12 @@ const Simulator: React.FC<Props> = props => {
<Icon
type="eye"
onClick={() => {
setDetailVisible(true);
setCurrent(item)
if (item.status.value === 'stop') {
message.success('模拟器未启动!')
} else {
setDetailVisible(true);
setCurrent(item)
}
}}
/>
</Tooltip>,
Expand All @@ -90,6 +96,7 @@ const Simulator: React.FC<Props> = props => {
<Icon
type="play-circle"
onClick={() => {
setCurrent(item);
item.status.value === 'stop' ? start(item.id) : stop(item.id)
}}
/>
Expand Down

0 comments on commit 4d89d9a

Please sign in to comment.