Add behavior details panel
This commit is contained in:
parent
7fd22bb5fd
commit
2cf9a22907
@ -48,6 +48,8 @@ const EN_US = {
|
||||
"Panel.Info.Group.Details.View": "Edit view group attributes",
|
||||
"Panel.Title.Behavior.List.View": "Behavior list",
|
||||
"Panel.Info.Behavior.List.View": "Edit view behavior list",
|
||||
"Panel.Title.Behavior.Details.View": "Behavior",
|
||||
"Panel.Info.Behavior.Details.View": "Edit view Behavior attributes",
|
||||
"Popup.Title.Unnamed": "Popup message",
|
||||
"Popup.Title.Confirm": "Confirm message",
|
||||
"Popup.Action.Yes": "Confirm",
|
||||
@ -109,5 +111,6 @@ const EN_US = {
|
||||
"Panel.Info.Group.Details.Attr.Error.Unspecified": "Unspecified group object",
|
||||
"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.Behavior.Details.Error.Not.Behavior": "Please specify a behavior first to view the details",
|
||||
}
|
||||
export default EN_US;
|
@ -48,6 +48,8 @@ const ZH_CN = {
|
||||
"Panel.Info.Group.Details.View": "编辑查看群属性",
|
||||
"Panel.Title.Behavior.List.View": "行为列表",
|
||||
"Panel.Info.Behavior.List.View": "编辑查看行为列表",
|
||||
"Panel.Title.Behavior.Details.View": "行为",
|
||||
"Panel.Info.Behavior.Details.View": "编辑查看行为属性",
|
||||
"Popup.Title.Unnamed": "弹窗消息",
|
||||
"Popup.Title.Confirm": "确认消息",
|
||||
"Popup.Action.Yes": "确定",
|
||||
@ -109,5 +111,6 @@ const ZH_CN = {
|
||||
"Panel.Info.Group.Details.Attr.Error.Unspecified": "未指定群对象",
|
||||
"Panel.Info.Label.Details.Error.Unspecified": "未指定标签对象",
|
||||
"Panel.Info.Label.List.Error.Nodata": "模型中没有标签,点击按钮以创建",
|
||||
"Panel.Info.Behavior.Details.Error.Not.Behavior": "请先指定一个行为以查看详情",
|
||||
}
|
||||
export default ZH_CN;
|
@ -75,9 +75,9 @@ class SimulatorWeb extends Component {
|
||||
items: [
|
||||
{
|
||||
items: [
|
||||
{panels: ["RenderView", "Label Aa Bb", "Label aaa"]},
|
||||
{panels: ["RenderView"]},
|
||||
{
|
||||
items: [{panels: ["BehaviorList", "Label bbb"]}, {panels: ["LabelList"]}],
|
||||
items: [{panels: ["BehaviorList"]}, {panels: ["LabelList"]}],
|
||||
scale: 80,
|
||||
layout: LayoutDirection.X
|
||||
}
|
||||
@ -87,9 +87,9 @@ class SimulatorWeb extends Component {
|
||||
},
|
||||
{
|
||||
items: [{
|
||||
panels: ["ObjectList", "Test tab"]
|
||||
panels: ["ObjectList"]
|
||||
}, {
|
||||
panels: ["GroupDetails", "RangeDetails", "LabelDetails"]
|
||||
panels: ["GroupDetails", "RangeDetails", "LabelDetails", "BehaviorDetails"]
|
||||
}],
|
||||
scale: 30,
|
||||
layout: LayoutDirection.Y
|
||||
|
0
source/Panel/BehaviorDetails/BehaviorDetails.scss
Normal file
0
source/Panel/BehaviorDetails/BehaviorDetails.scss
Normal file
26
source/Panel/BehaviorDetails/BehaviorDetails.tsx
Normal file
26
source/Panel/BehaviorDetails/BehaviorDetails.tsx
Normal file
@ -0,0 +1,26 @@
|
||||
import { Component, ReactNode} from "react";
|
||||
import { useStatusWithEvent, IMixinStatusProps } from "@Context/Status";
|
||||
import { Behavior } from "@Model/Behavior";
|
||||
import { Message } from "@Component/Message/Message";
|
||||
import "./BehaviorDetails.scss";
|
||||
|
||||
interface IBehaviorDetailsProps {}
|
||||
|
||||
@useStatusWithEvent("focusBehaviorChange")
|
||||
class BehaviorDetails extends Component<IBehaviorDetailsProps & IMixinStatusProps> {
|
||||
|
||||
private renderFrom(behavior: Behavior): ReactNode {
|
||||
return <></>;
|
||||
}
|
||||
|
||||
public render(): ReactNode {
|
||||
if (this.props.status) {
|
||||
if (this.props.status.focusBehavior) {
|
||||
return this.renderFrom(this.props.status.focusBehavior);
|
||||
}
|
||||
}
|
||||
return <Message i18nKey="Panel.Info.Behavior.Details.Error.Not.Behavior"/>;
|
||||
}
|
||||
}
|
||||
|
||||
export { BehaviorDetails };
|
@ -9,6 +9,7 @@ import { LabelList } from "./LabelList/LabelList";
|
||||
import { LabelDetails } from "./LabelDetails/LabelDetails";
|
||||
import { GroupDetails } from "./GroupDetails/GroupDetails";
|
||||
import { BehaviorList } from "./BehaviorList/BehaviorList";
|
||||
import { BehaviorDetails } from "./BehaviorDetails/BehaviorDetails";
|
||||
|
||||
interface IPanelInfo {
|
||||
nameKey: string;
|
||||
@ -29,6 +30,7 @@ type PanelId = ""
|
||||
| "LabelDetails" // 标签属性
|
||||
| "GroupDetails" // 群属性
|
||||
| "BehaviorList" // 行为列表
|
||||
| "BehaviorDetails" // 行为属性
|
||||
;
|
||||
|
||||
const PanelInfoMap = new Map<PanelId, IPanelInfo>();
|
||||
@ -60,6 +62,10 @@ PanelInfoMap.set("BehaviorList", {
|
||||
nameKey: "Panel.Title.Behavior.List.View", introKay: "Panel.Info.Behavior.List.View",
|
||||
class: BehaviorList, hidePadding: true
|
||||
});
|
||||
PanelInfoMap.set("BehaviorDetails", {
|
||||
nameKey: "Panel.Title.Behavior.Details.View", introKay: "Panel.Info.Behavior.Details.View",
|
||||
class: BehaviorDetails
|
||||
});
|
||||
|
||||
function getPanelById(panelId: PanelId): ReactNode {
|
||||
switch (panelId) {
|
||||
|
Loading…
Reference in New Issue
Block a user