10 changed files with 1374 additions and 10 deletions
Binary file not shown.
|
After Width: | Height: | Size: 5.3 KiB |
@ -0,0 +1,5 @@ |
|||||
|
import BaseEntity from '@/core/base/BaseItemEntity.ts' |
||||
|
|
||||
|
export default class ShuttleRackEntity extends BaseEntity { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,22 @@ |
|||||
|
import BaseInteraction from '@/core/base/BaseInteraction.ts' |
||||
|
import * as THREE from 'three' |
||||
|
|
||||
|
export default class ShuttleRackInteraction extends BaseInteraction { |
||||
|
|
||||
|
get isSinglePointMode(): boolean { |
||||
|
return true |
||||
|
} |
||||
|
|
||||
|
constructor(itemTypeName: string) { |
||||
|
super(itemTypeName) |
||||
|
} |
||||
|
|
||||
|
createPointOfItem(item: ItemJson, point: THREE.Vector3): ItemJson { |
||||
|
item = super.createPointOfItem(item, point) |
||||
|
|
||||
|
// 创建一个地堆货架
|
||||
|
item.dt.rackWidth = 3 // 宽度
|
||||
|
item.dt.rackDepth = 1 // 深度
|
||||
|
return item |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,65 @@ |
|||||
|
import type { PropertySetter } from "@/core/base/PropertyTypes.ts"; |
||||
|
import { basicFieldsSetter } from "@/editor/widgets/property/PropertyPanelConstant.ts"; |
||||
|
|
||||
|
const propertySetter: PropertySetter = { |
||||
|
flatten: { |
||||
|
fields: [ |
||||
|
...basicFieldsSetter, |
||||
|
{ |
||||
|
dataPath: 'dt.rackDepth', label: '货架深度', input: 'InputNumber', |
||||
|
inputProps: {}, |
||||
|
}, |
||||
|
{ |
||||
|
dataPath: 'dt.levelCount', label: '总层数', input: 'InputNumber', |
||||
|
inputProps: {}, |
||||
|
}, |
||||
|
{ |
||||
|
dataPath: 'dt.bayCount', label: '总列数', input: 'InputNumber', |
||||
|
inputProps: {}, |
||||
|
}, |
||||
|
{ |
||||
|
dataPath: 'dt.hideFloor', label: '隐藏底板', input: 'InputNumber', |
||||
|
inputProps: {}, |
||||
|
}, |
||||
|
{ |
||||
|
dataPath: 'dt.extendColumns', label: '扩展挡板', input: 'InputNumber', |
||||
|
inputProps: {}, |
||||
|
}, |
||||
|
{ |
||||
|
dataPath: 'dt.columnSpacing', label: '支脚跨越', input: 'InputNumber', |
||||
|
inputProps: {}, |
||||
|
}, |
||||
|
{ |
||||
|
dataPath: 'dt.bays', input: 'BayEditor', |
||||
|
inputProps: { |
||||
|
}, |
||||
|
}, |
||||
|
/** |
||||
|
* dt.bays 5列3层货架示例 |
||||
|
* { |
||||
|
* dt: { |
||||
|
* rackDepth: 1.1, // 货架深度
|
||||
|
* levelCount: 3, // 总层数
|
||||
|
* bayCount: 5, // 总列数
|
||||
|
* hideFloor: false, // 隐藏底板
|
||||
|
* extendColumns: true, // 扩展挡板
|
||||
|
* columnSpacing: 1, // 支脚跨越
|
||||
|
* bays: [ // 每列的配置
|
||||
|
* { |
||||
|
* bayWidth: 1.6, // 列的宽度
|
||||
|
* offset: // 列偏移
|
||||
|
* levelHeight: [ 1.4, 1.4, 1.4 ] // 每层的高度
|
||||
|
* }, |
||||
|
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]}, |
||||
|
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]}, |
||||
|
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]}, |
||||
|
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]}, |
||||
|
* ] |
||||
|
* } |
||||
|
* } |
||||
|
*/ |
||||
|
], |
||||
|
}, |
||||
|
}; |
||||
|
|
||||
|
export default propertySetter; |
||||
File diff suppressed because it is too large
@ -0,0 +1,15 @@ |
|||||
|
import { defineModule } from '@/core/manager/ModuleManager.ts' |
||||
|
import ShuttleRackRenderer from './ShuttleRackRenderer.ts' |
||||
|
import ShuttleRackEntity from './ShuttleRackEntity.ts' |
||||
|
import ShuttleRackInteraction from './ShuttleRackInteraction.ts' |
||||
|
import propertySetter from "./ShuttleRackPropertySetter.ts"; |
||||
|
|
||||
|
export const ITEM_TYPE_NAME = 'shuttle_rack' |
||||
|
|
||||
|
export default defineModule({ |
||||
|
name: ITEM_TYPE_NAME, |
||||
|
renderer: new ShuttleRackRenderer(ITEM_TYPE_NAME), |
||||
|
interaction: new ShuttleRackInteraction(ITEM_TYPE_NAME), |
||||
|
setter: propertySetter, |
||||
|
entity: ShuttleRackEntity, |
||||
|
}) |
||||
Loading…
Reference in new issue