Compare commits
	
		
			2 Commits
		
	
	
		
			c10dd6e882
			...
			dec18361ef
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| dec18361ef | |||
| 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; | ||||||
| @ -6,6 +6,11 @@ import type { Model } from "./Model"; | |||||||
| import type { Range } from "./Range"; | import type { Range } from "./Range"; | ||||||
| import type { Label } from "./Label"; | import type { Label } from "./Label"; | ||||||
| 
 | 
 | ||||||
|  | type IObjectParamCacheType<P, Q = P> = { | ||||||
|  |     picker: P; | ||||||
|  |     objects: Q; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| /** | /** | ||||||
|  * 参数类型 |  * 参数类型 | ||||||
|  */ |  */ | ||||||
| @ -16,12 +21,10 @@ type IMapBasicParamTypeKeyToType = { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| type IMapObjectParamTypeKeyToType = { | type IMapObjectParamTypeKeyToType = { | ||||||
|     "R"?: Range; |     "R": IObjectParamCacheType<Range | undefined>; | ||||||
|     "G"?: Group; |     "G": IObjectParamCacheType<Group | undefined>; | ||||||
|     "GR"?: Group | Range; |     "LR": IObjectParamCacheType<Label | Range | undefined, Range[]>; | ||||||
|     "LR"?: Label | Range; |     "LG": IObjectParamCacheType<Label | Group | undefined, Range[]>; | ||||||
|     "LG"?: Label | Group; |  | ||||||
|     "LGR"?: Label | Group | Range; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| type IMapVectorParamTypeKeyToType = { | type IMapVectorParamTypeKeyToType = { | ||||||
| @ -40,7 +43,7 @@ type IParamValue<K extends IParamType> = AllMapType[K]; | |||||||
| /** | /** | ||||||
|  * 特殊对象类型判定 |  * 特殊对象类型判定 | ||||||
|  */ |  */ | ||||||
| const objectTypeListEnumSet = new Set<IParamType>(["R", "G", "GR", "LR", "LG", "LGR"]); | const objectTypeListEnumSet = new Set<IParamType>(["R", "G", "LR", "LG"]); | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * 对象断言表达式 |  * 对象断言表达式 | ||||||
| @ -247,6 +250,22 @@ class BehaviorRecorder< | |||||||
|                     case "vec": |                     case "vec": | ||||||
|                         defaultObj[key] = [0, 0, 0] as any; |                         defaultObj[key] = [0, 0, 0] as any; | ||||||
|                         break; |                         break; | ||||||
|  |                      | ||||||
|  |                     case "G": | ||||||
|  |                     case "R": | ||||||
|  |                         defaultObj[key] = { | ||||||
|  |                             picker: undefined, | ||||||
|  |                             objects: undefined | ||||||
|  |                         } as any; | ||||||
|  |                         break; | ||||||
|  | 
 | ||||||
|  |                     case "LR": | ||||||
|  |                     case "LG": | ||||||
|  |                         defaultObj[key] = { | ||||||
|  |                             picker: undefined, | ||||||
|  |                             objects: [] | ||||||
|  |                         } as any; | ||||||
|  |                         break; | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -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