|
@@ -324,8 +324,16 @@ const ContentAreaLarge = () => {
|
|
|
/>
|
|
|
}
|
|
|
onClick={async () => {
|
|
|
- const selectedBodyPosition =
|
|
|
- store.getState().bodyPositionList.selectedBodyPosition;
|
|
|
+ const state = store.getState().bodyPositionList;
|
|
|
+ const selectedBodyPosition = state.selectedBodyPosition;
|
|
|
+ const bodyPositions = state.bodyPositions;
|
|
|
+
|
|
|
+ // 检查体位数量,至少保留一个
|
|
|
+ if (bodyPositions.length <= 1) {
|
|
|
+ message.warning('至少需要保留一个体位,无法删除');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
console.log(
|
|
|
`选中的体位:${JSON.stringify(selectedBodyPosition)}`
|
|
|
);
|