diff --git a/source/Component/BehaviorList/BehaviorList.tsx b/source/Component/BehaviorList/BehaviorList.tsx index 1e11a30..af0c8a9 100644 --- a/source/Component/BehaviorList/BehaviorList.tsx +++ b/source/Component/BehaviorList/BehaviorList.tsx @@ -112,7 +112,7 @@ class BehaviorList extends Component
-
+
{ } } + /** + * 修改群属性 + */ + public changeBehaviorAttrib> + (id: ObjectID, key: P, val: IParamValue) { + const behavior = this.model.getBehaviorById(id); + if (behavior) { + if (key === "color") { + behavior.color = val as number[]; + } else if (key === "name") { + behavior.name = val as string; + } else { + behavior.parameter[key] = val; + } + this.emit("behaviorAttrChange"); + } + } + public addGroupBehavior(id: ObjectID, val: Behavior) { const group = this.model.getObjectById(id); if (group && group instanceof Group) { diff --git a/source/Localization/EN-US.ts b/source/Localization/EN-US.ts index 79d6f1b..d28b7f9 100644 --- a/source/Localization/EN-US.ts +++ b/source/Localization/EN-US.ts @@ -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,7 @@ 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", + "Panel.Info.Behavior.Details.Behavior.Props": "{behavior} parameter", } export default EN_US; \ No newline at end of file diff --git a/source/Localization/ZH-CN.ts b/source/Localization/ZH-CN.ts index 7f582fc..c28978a 100644 --- a/source/Localization/ZH-CN.ts +++ b/source/Localization/ZH-CN.ts @@ -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,7 @@ 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": "请先指定一个行为以查看详情", + "Panel.Info.Behavior.Details.Behavior.Props": "{behavior}参数", } export default ZH_CN; \ No newline at end of file diff --git a/source/Model/Behavior.ts b/source/Model/Behavior.ts index fb91290..f25a612 100644 --- a/source/Model/Behavior.ts +++ b/source/Model/Behavior.ts @@ -6,6 +6,11 @@ import type { Model } from "./Model"; import type { Range } from "./Range"; import type { Label } from "./Label"; +type IObjectParamCacheType = { + picker: P; + objects: Q; +} + /** * 参数类型 */ @@ -16,12 +21,10 @@ type IMapBasicParamTypeKeyToType = { } type IMapObjectParamTypeKeyToType = { - "R"?: Range; - "G"?: Group; - "GR"?: Group | Range; - "LR"?: Label | Range; - "LG"?: Label | Group; - "LGR"?: Label | Group | Range; + "R": IObjectParamCacheType; + "G": IObjectParamCacheType; + "LR": IObjectParamCacheType