Cargo-Planner Docs
示例
基于此处提供的初始配置,我们提供了一些数据结构,您可以从中获得创建集成的灵感。
集装箱类型和托盘类型都可以引用一个id和/或内联数据。使用id时,集装箱和托盘类型规格将从我们的集装箱库中获取。您可以通过id获取集装箱规格,也可以通过更改各自数据结构中的字段来覆盖属性。
请参阅API文档以了解所有可用属性。
装载到自定义集装箱
let calculationData = {
length_dim: 'M',
weight_dim: 'KG',
items: [
{
label: 'My cargo 1',
l: 0.5,
w: 0.4,
h: 0.3,
wt: 25,
qty: 100,
},
],
container_types: [
{
name: 'My container',
L: 12,
W: 2,
H: 2,
payload: 20000,
},
],
};
装载到库中的集装箱
这将把货物装入库中的一种集装箱类型,并覆盖有效载荷(最大重量)。您可以在以下位置找到可用类型:API文档
let calculationData = {
length_dim: 'M',
weight_dim: 'KG',
items: [
{
label: 'My cargo 1',
l: 0.5,
w: 0.4,
h: 0.3,
wt: 25,
qty: 100,
},
],
container_types: [
{
id: 1, //一个20ft DV - 从API中找到的id
payload: 20000,
},
],
};
检查多少货物可以装入拖车
此示例将检查多少货物可以装入53ft半挂车
let calculationData = {
length_dim: 'M',
weight_dim: 'KG',
items: [
{
label: 'My cargo 1',
l: 0.5,
w: 0.4,
h: 0.3,
wt: 25,
tiltable: true,
qty: undefined, // 无限制装载
},
],
container_types: [
{
id: 1080, //一个53ft半挂车 - 从API中找到的id
payload: 1080,
},
],
};
托盘化货物
下面的示例将首先将托盘化字段设置为true的货物装入提供的托盘类型中,然后将托盘和其他货物装入我们的自定义集装箱类型中
let calculationData = {
length_dim: 'M',
weight_dim: 'KG',
items: [
{
label: 'My cargo 1',
l: 0.5,
w: 0.4,
h: 0.3,
wt: 25,
qty: 100,
palletize: true,
},
{
label: 'My cargo 2',
l: 2,
w: 1,
h: 0.5,
wt: 250,
qty: 2,
palletize: false, //默认
},
],
container_types: [
{
name: 'My container',
L: 12,
W: 2,
H: 2,
payload: 20000,
},
],
pallet_types: [
{
name: 'EU',
L: 1.2,
W: 0.8,
H: 0,
max_height: 2,
payload: 1000,
},
],
};