4 changed files with 49 additions and 0 deletions
@ -0,0 +1,7 @@ |
|||
import { defineItem } from '@/runtime/DefineItem.ts' |
|||
|
|||
export default defineItem({ |
|||
name: 'line', |
|||
label: '辅助线', |
|||
category: 'line' |
|||
}) |
|||
@ -0,0 +1,7 @@ |
|||
import { defineItem } from '@/runtime/DefineItem.ts' |
|||
|
|||
export default defineItem({ |
|||
name: 'point', |
|||
label: '辅助点', |
|||
category: 'point' |
|||
}) |
|||
@ -0,0 +1,7 @@ |
|||
import { defineItem } from '@/runtime/DefineItem.ts' |
|||
|
|||
export default defineItem({ |
|||
name: 'queue', |
|||
label: '暂存区', |
|||
category: 'store' |
|||
}) |
|||
@ -0,0 +1,28 @@ |
|||
/** |
|||
* 定义一个 物流单元 |
|||
*/ |
|||
export class ItemDefine { |
|||
option!: ItemOption |
|||
|
|||
constructor(option: ItemOption) { |
|||
this.option = option |
|||
} |
|||
} |
|||
|
|||
export type ItemCategory = 'point' | 'line' | 'store' | 'executer' | 'flow_item' | 'other' |
|||
|
|||
export interface ItemOption { |
|||
name: string |
|||
label: string |
|||
category: ItemCategory |
|||
} |
|||
|
|||
/** |
|||
* 定义一个 物流单元 |
|||
*/ |
|||
export function defineItem(option: ItemOption): Promise<ItemDefine> { |
|||
return new Promise((resolve, reject) => { |
|||
const item = new ItemDefine(option) |
|||
resolve(item) |
|||
}) |
|||
} |
|||
Loading…
Reference in new issue