Fix group details can focus deleted behavior
This commit is contained in:
parent
c10dd6e882
commit
8607dcd3da
@ -112,5 +112,6 @@ const EN_US = {
|
|||||||
"Panel.Info.Label.Details.Error.Unspecified": "Label object not specified",
|
"Panel.Info.Label.Details.Error.Unspecified": "Label object not specified",
|
||||||
"Panel.Info.Label.List.Error.Nodata": "There are no labels in the model, click the button to create",
|
"Panel.Info.Label.List.Error.Nodata": "There are no labels in the model, click the button to create",
|
||||||
"Panel.Info.Behavior.Details.Error.Not.Behavior": "Please specify a behavior first to view the details",
|
"Panel.Info.Behavior.Details.Error.Not.Behavior": "Please specify a behavior first to view the details",
|
||||||
|
"Panel.Info.Behavior.Details.Behavior.Props": "{behavior} parameter",
|
||||||
}
|
}
|
||||||
export default EN_US;
|
export default EN_US;
|
@ -112,5 +112,6 @@ const ZH_CN = {
|
|||||||
"Panel.Info.Label.Details.Error.Unspecified": "未指定标签对象",
|
"Panel.Info.Label.Details.Error.Unspecified": "未指定标签对象",
|
||||||
"Panel.Info.Label.List.Error.Nodata": "模型中没有标签,点击按钮以创建",
|
"Panel.Info.Label.List.Error.Nodata": "模型中没有标签,点击按钮以创建",
|
||||||
"Panel.Info.Behavior.Details.Error.Not.Behavior": "请先指定一个行为以查看详情",
|
"Panel.Info.Behavior.Details.Error.Not.Behavior": "请先指定一个行为以查看详情",
|
||||||
|
"Panel.Info.Behavior.Details.Behavior.Props": "{behavior}参数",
|
||||||
}
|
}
|
||||||
export default ZH_CN;
|
export default ZH_CN;
|
@ -4,6 +4,8 @@ import { Behavior } from "@Model/Behavior";
|
|||||||
import { Message } from "@Component/Message/Message";
|
import { Message } from "@Component/Message/Message";
|
||||||
import { AttrInput } from "@Component/AttrInput/AttrInput";
|
import { AttrInput } from "@Component/AttrInput/AttrInput";
|
||||||
import { ColorInput } from "@Component/ColorInput/ColorInput";
|
import { ColorInput } from "@Component/ColorInput/ColorInput";
|
||||||
|
import { TogglesInput } from "@Component/TogglesInput/TogglesInput";
|
||||||
|
import { ConfirmPopup } from "@Component/ConfirmPopup/ConfirmPopup";
|
||||||
import "./BehaviorDetails.scss";
|
import "./BehaviorDetails.scss";
|
||||||
|
|
||||||
interface IBehaviorDetailsProps {}
|
interface IBehaviorDetailsProps {}
|
||||||
@ -31,6 +33,34 @@ class BehaviorDetails extends Component<IBehaviorDetailsProps & IMixinStatusProp
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<TogglesInput
|
||||||
|
keyI18n="Common.Attr.Key.Delete" red
|
||||||
|
onIconName="delete" offIconName="delete"
|
||||||
|
valueChange={() => {
|
||||||
|
if (this.props.status) {
|
||||||
|
const status = this.props.status;
|
||||||
|
status.popup.showPopup(ConfirmPopup, {
|
||||||
|
infoI18n: "Popup.Delete.Behavior.Confirm",
|
||||||
|
titleI18N: "Popup.Action.Objects.Confirm.Title",
|
||||||
|
yesI18n: "Popup.Action.Objects.Confirm.Delete",
|
||||||
|
red: "yes",
|
||||||
|
yes: () => {
|
||||||
|
status.model.deleteBehavior(behavior);
|
||||||
|
status.setBehaviorObject();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Message
|
||||||
|
isTitle
|
||||||
|
i18nKey="Panel.Info.Behavior.Details.Behavior.Props"
|
||||||
|
options={{
|
||||||
|
behavior: behavior.getTerms(behavior.behaviorName)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
</>;
|
</>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,6 +63,7 @@ class BehaviorList extends Component<IBehaviorListProps & IMixinStatusProps & IM
|
|||||||
red: "yes",
|
red: "yes",
|
||||||
yes: () => {
|
yes: () => {
|
||||||
status.model.deleteBehavior(behavior);
|
status.model.deleteBehavior(behavior);
|
||||||
|
status.setBehaviorObject();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -121,9 +121,11 @@ class GroupDetails extends Component<IGroupDetailsProps & IMixinStatusProps & IM
|
|||||||
behavior={group.behaviors}
|
behavior={group.behaviors}
|
||||||
focusBehavior={this.props.status?.focusBehavior}
|
focusBehavior={this.props.status?.focusBehavior}
|
||||||
click={(behavior) => {
|
click={(behavior) => {
|
||||||
|
if (behavior.isDeleted()) return;
|
||||||
this.props.status?.setBehaviorObject(behavior);
|
this.props.status?.setBehaviorObject(behavior);
|
||||||
}}
|
}}
|
||||||
action={(behavior) => {
|
action={(behavior) => {
|
||||||
|
if (behavior.isDeleted()) return;
|
||||||
this.props.status?.setBehaviorObject(behavior);
|
this.props.status?.setBehaviorObject(behavior);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.props.setting?.layout.focus("BehaviorDetails");
|
this.props.setting?.layout.focus("BehaviorDetails");
|
||||||
|
Loading…
Reference in New Issue
Block a user