Browse Source

zb修改初始化移动设备状态框显示

master
张博 5 months ago
parent
commit
c181854b2e
  1. 2
      src/app/layouts/admin/admin.component.ts
  2. 28
      src/app/routes/wcs/monitor/monitor.canvas.ts
  3. 2
      src/assets/i18n/zh-CN.json
  4. 2
      src/assets/settings/srv.json

2
src/app/layouts/admin/admin.component.ts

@ -240,7 +240,7 @@ export class AdminComponent implements OnDestroy {
// console.log('---------'); // console.log('---------');
// console.log(this.alertMessages.list[0].stockBarcode ); // console.log(this.alertMessages.list[0].stockBarcode );
},1000);//10秒刷新一回
},10000);//10秒刷新一回
} }

28
src/app/routes/wcs/monitor/monitor.canvas.ts

@ -44,6 +44,20 @@ export class MonitorCanvas {
public init(map: ElementRef): Promise<void> { public init(map: ElementRef): Promise<void> {
map.nativeElement.firstChild.width = screen.width; map.nativeElement.firstChild.width = screen.width;
map.nativeElement.firstChild.height = screen.height; map.nativeElement.firstChild.height = screen.height;
// 新修改20241205 zb 增加鼠标模拟滚动事件
setTimeout(()=>{
console.log(this._canvas);
const down = new fabric.Point(1098, 318);
const scaleDown = 0.9081818181818182;
const up = new fabric.Point(1098, 318);
const scaleUp=0.9990000000000001;
this. canvas.zoomToPoint(down,scaleDown);
setTimeout(()=>{
this. canvas.zoomToPoint(up,scaleDown);
},200);
},100);
return new Promise(resolve => { return new Promise(resolve => {
setTimeout(() => { setTimeout(() => {
this._canvas = new fabric.Canvas('map', { selection: false }); this._canvas = new fabric.Canvas('map', { selection: false });
@ -56,7 +70,12 @@ export class MonitorCanvas {
this._canvas.on('mouse:down', () => panning = true); this._canvas.on('mouse:down', () => panning = true);
this._canvas.on('mouse:up', () => panning = false); this._canvas.on('mouse:up', () => panning = false);
this._canvas.on('mouse:move', (e: any) => panning && e && e.e && this._canvas.relativePan(new fabric.Point(e.e.movementX, e.e.movementY))); this._canvas.on('mouse:move', (e: any) => panning && e && e.e && this._canvas.relativePan(new fabric.Point(e.e.movementX, e.e.movementY)));
this._canvas.on('mouse:wheel', (e: any) => e && e.e && this._canvas.zoomToPoint(new fabric.Point(e.e.pageX, e.e.pageY), Math.max(.1, Math.min(10, this._canvas.getZoom() * (e.e.deltaY > 0 ? .9 : 1.1)))));
//console.log(e.e.movementX);
//新修改
this. canvas.on('mouse:wheel',(e: any)=>{
this.wheelToggle(e);
});
// this._canvas.on('mouse:wheel', (e: any) => e && e.e && this._canvas.zoomToPoint(new fabric.Point(e.e.pageX, e.e.pageY), Math.max(.1, Math.min(10, this._canvas.getZoom() * (e.e.deltaY > 0 ? .9 : 1.1)))));
this._canvas.on('mouse:dblclick', (e: any) => e && e.target && e.target.data && this.fire(e.target.data)); this._canvas.on('mouse:dblclick', (e: any) => e && e.target && e.target.data && this.fire(e.target.data));
this._canvas.on('mouse:over', (e) => e && this.focus(e)); this._canvas.on('mouse:over', (e) => e && this.focus(e));
@ -65,6 +84,13 @@ export class MonitorCanvas {
}); });
} }
//新修改
public wheelToggle(e) {
console.log(new fabric.Point(e.e.pageX, e.e.pageY));
console.log(Math.max(.1, Math.min(10, this._canvas.getZoom() * (e.e.deltaY > 0 ? .9 : 1.1))));
e && e.e && this._canvas.zoomToPoint(new fabric.Point(e.e.pageX, e.e.pageY), Math.max(.1, Math.min(10, this._canvas.getZoom() * (e.e.deltaY > 0 ? .9 : 1.1))))
}
public render() { public render() {
this._canvas?.renderAll(); this._canvas?.renderAll();
} }

2
src/assets/i18n/zh-CN.json

@ -193,7 +193,7 @@
"autocommand":"下达自动任务", "autocommand":"下达自动任务",
"systemsetting":"系统参数设置", "systemsetting":"系统参数设置",
"stationstatus":"站台管理", "stationstatus":"站台管理",
"reuquestWms":"重新请求处理"
"reuquestWms":"入库重新请求"
}, },
"monitor": { "monitor": {
"name": "库", "name": "库",

2
src/assets/settings/srv.json

@ -1,3 +1,3 @@
{ {
"default": "http://127.0.0.1:22222"
"default": "http://192.168.16.3:22222"
} }
Loading…
Cancel
Save