|
@@ -255,6 +255,7 @@
|
|
|
var vue = new Vue({
|
|
var vue = new Vue({
|
|
|
el:"#container",
|
|
el:"#container",
|
|
|
data:{
|
|
data:{
|
|
|
|
|
+ increment:true,
|
|
|
group:[],//库区列表
|
|
group:[],//库区列表
|
|
|
ws:[],//仓库列表
|
|
ws:[],//仓库列表
|
|
|
locationMapping:{},//库位的信息映射
|
|
locationMapping:{},//库位的信息映射
|
|
@@ -283,11 +284,13 @@
|
|
|
equipments:[ //备选设备池
|
|
equipments:[ //备选设备池
|
|
|
{id:1,w:1.2,h:2.4,grid:2,layer:4,color:"RGB(252,228,214)",describe:"4层高位货架,可设八个标准托盘位"},
|
|
{id:1,w:1.2,h:2.4,grid:2,layer:4,color:"RGB(252,228,214)",describe:"4层高位货架,可设八个标准托盘位"},
|
|
|
{id:2,w:1.2,h:2.4,grid:2,layer:5,color:"RGB(255,255,255)",describe:"5层高位货架,可设十个标准托盘位"},
|
|
{id:2,w:1.2,h:2.4,grid:2,layer:5,color:"RGB(255,255,255)",describe:"5层高位货架,可设十个标准托盘位"},
|
|
|
- {id:3,w:1.2,h:2.4,grid:1,layer:3,color:"RGB(169,208,142)",describe:"叉车通道,可设三个标准托盘位"},
|
|
|
|
|
- {id:4,w:1.2,h:2.4,grid:2,layer:3,color:"RGB(221,235,247)",describe:"叉车通道,可设六个标准托盘位"},
|
|
|
|
|
|
|
+ {id:3,w:1.2,h:3.3,grid:3,layer:1,color:"RGB(169,208,142)",describe:"叉车通道,可设三个标准托盘位"},
|
|
|
|
|
+ {id:4,w:1.2,h:3.3,grid:3,layer:2,color:"RGB(221,235,247)",describe:"叉车通道,可设六个标准托盘位"},
|
|
|
{id:5,w:1.2,h:1.2,grid:1,layer:4,color:"RGB(255,255,0)",describe:"半组货架,可设四层高四个标准托盘位"},
|
|
{id:5,w:1.2,h:1.2,grid:1,layer:4,color:"RGB(255,255,0)",describe:"半组货架,可设四层高四个标准托盘位"},
|
|
|
- {id:6,w:1.2,h:1.2,grid:2,layer:1,color:"RGB(189,215,238)",describe:"叉车通道,顶上两个托盘位"},
|
|
|
|
|
|
|
+ {id:6,w:1.2,h:2.4,grid:2,layer:1,color:"RGB(189,215,238)",describe:"叉车通道,顶上两个托盘位"},
|
|
|
{id:7,w:1.2,h:1.2,grid:1,layer:5,color:"RGB(255,255,5)",describe:"半组货架,可设五层高五个标准托盘位"},
|
|
{id:7,w:1.2,h:1.2,grid:1,layer:5,color:"RGB(255,255,5)",describe:"半组货架,可设五层高五个标准托盘位"},
|
|
|
|
|
+ {id:8,w:1.2,h:3.3,grid:3,layer:4,color:"RGB(146,208,80)",describe:"4层高位货架,可设十二个标准托盘位"},
|
|
|
|
|
+ {id:9,w:1.2,h:2.4,grid:2,layer:2,color:"RGB(228,243,211)",describe:"叉车通道,可设四个标准托盘位"},
|
|
|
],
|
|
],
|
|
|
currentEq:{ //选中的设备
|
|
currentEq:{ //选中的设备
|
|
|
el:null,
|
|
el:null,
|
|
@@ -340,15 +343,17 @@
|
|
|
}
|
|
}
|
|
|
if(key===86 && e.ctrlKey){
|
|
if(key===86 && e.ctrlKey){
|
|
|
let val = $('#clipboardDiv').val();
|
|
let val = $('#clipboardDiv').val();
|
|
|
- if (!val)return;
|
|
|
|
|
|
|
+ if (!val || JSON.stringify(val)==="{}")return;
|
|
|
let toolWid = document.getElementById("tool").offsetWidth;
|
|
let toolWid = document.getElementById("tool").offsetWidth;
|
|
|
- let obj = JSON.parse(val);
|
|
|
|
|
|
|
+ let obj = Object.assign({},JSON.parse(val));
|
|
|
obj.x = this.client.x-toolWid+content.scrollLeft;
|
|
obj.x = this.client.x-toolWid+content.scrollLeft;
|
|
|
obj.y = this.client.y+content.scrollTop;
|
|
obj.y = this.client.y+content.scrollTop;
|
|
|
obj.children = [];
|
|
obj.children = [];
|
|
|
for (let i=0;i<obj.layer;i++)obj.children.push({});
|
|
for (let i=0;i<obj.layer;i++)obj.children.push({});
|
|
|
if (this.currentEl.eqId){
|
|
if (this.currentEl.eqId){
|
|
|
obj.eqId = undefined;
|
|
obj.eqId = undefined;
|
|
|
|
|
+ this.current = obj;
|
|
|
|
|
+ this.currentEl = obj;
|
|
|
this.showAddModal(obj);
|
|
this.showAddModal(obj);
|
|
|
}else{
|
|
}else{
|
|
|
this.elements.push(obj);
|
|
this.elements.push(obj);
|
|
@@ -425,9 +430,17 @@
|
|
|
let size = result.val.toString().length;
|
|
let size = result.val.toString().length;
|
|
|
let val;
|
|
let val;
|
|
|
if(result.type==="CHAR"){
|
|
if(result.type==="CHAR"){
|
|
|
- val=this.charArr[result.val+index];
|
|
|
|
|
|
|
+ if (this.increment){
|
|
|
|
|
+ val=this.charArr[result.val+index];
|
|
|
|
|
+ }else{
|
|
|
|
|
+ val=this.charArr[result.val-index];
|
|
|
|
|
+ }
|
|
|
}else{
|
|
}else{
|
|
|
- val=Number(result.val)+index;
|
|
|
|
|
|
|
+ if (this.increment){
|
|
|
|
|
+ val=Number(result.val)+index;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ val=Number(result.val)-index;
|
|
|
|
|
+ }
|
|
|
if (val.toString().length<size){
|
|
if (val.toString().length<size){
|
|
|
val = (Array(size).join('0') + val).slice(-size);
|
|
val = (Array(size).join('0') + val).slice(-size);
|
|
|
}
|
|
}
|
|
@@ -482,7 +495,9 @@
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
copyEle(){
|
|
copyEle(){
|
|
|
- $('#clipboardDiv').text(JSON.stringify(this.currentEl));
|
|
|
|
|
|
|
+ if (this.currentEl!=null && JSON.stringify(this.currentEl)!=="{}"){
|
|
|
|
|
+ $('#clipboardDiv').text(JSON.stringify(this.currentEl));
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
delEquipment(){
|
|
delEquipment(){
|
|
|
this.equipmentElements.some((el,index)=>{
|
|
this.equipmentElements.some((el,index)=>{
|
|
@@ -511,7 +526,7 @@
|
|
|
}else if (equipment.updateCoords){
|
|
}else if (equipment.updateCoords){
|
|
|
equipments.push({
|
|
equipments.push({
|
|
|
id:equipment.eqId,
|
|
id:equipment.eqId,
|
|
|
- info:JSON.stringify({x:equipment.x,y:equipment.y,id:equipment.id})
|
|
|
|
|
|
|
+ info:JSON.stringify({x:equipment.x,y:equipment.y,id:equipment.id,turn:equipment.turn})
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -616,15 +631,10 @@
|
|
|
let children = [];
|
|
let children = [];
|
|
|
for (let i=0;i<this.currentEq.obj.layer;i++)children.push({});
|
|
for (let i=0;i<this.currentEq.obj.layer;i++)children.push({});
|
|
|
let newEquipment = Object.assign({children:children,x:x,y:y}, this.currentEq.obj);
|
|
let newEquipment = Object.assign({children:children,x:x,y:y}, this.currentEq.obj);
|
|
|
- if (this.turn){
|
|
|
|
|
- let wid = newEquipment.w;
|
|
|
|
|
- newEquipment.w = newEquipment.h;
|
|
|
|
|
- newEquipment.h = wid;
|
|
|
|
|
- newEquipment.turn = this.turn;
|
|
|
|
|
- this.showAddModal(newEquipment);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ newEquipment.turn = this.turn;
|
|
|
newEquipment.width = newEquipment.w;
|
|
newEquipment.width = newEquipment.w;
|
|
|
newEquipment.depth = newEquipment.h;
|
|
newEquipment.depth = newEquipment.h;
|
|
|
|
|
+ this.showAddModal(newEquipment);
|
|
|
}
|
|
}
|
|
|
this.currentEq.obj = null;
|
|
this.currentEq.obj = null;
|
|
|
},
|
|
},
|