|
@@ -2360,6 +2360,7 @@
|
|
|
$(document).ready(function () {
|
|
|
$(window).on('wheel', function(event) {
|
|
|
// 检查 event.originalEvent.deltaY 来判断滚动方向
|
|
|
+ /*
|
|
|
if (event.originalEvent.deltaY > 0) {
|
|
|
console.log('向下滚动:缩小'+zoomCount);
|
|
|
zoomCount = zoomCount-1
|
|
@@ -2367,12 +2368,13 @@
|
|
|
zoomCount=0;
|
|
|
//切换在全厂视图
|
|
|
loadFacModel(playerNative);
|
|
|
+
|
|
|
backMasterViewByFac();
|
|
|
}
|
|
|
} else {
|
|
|
console.log('向上滚动:放大');
|
|
|
zoomCount = zoomCount+1
|
|
|
- }
|
|
|
+ }*/
|
|
|
});
|
|
|
$.datepicker.setDefaults($.datepicker.regional['zh-CN']); //设置日期控制语言
|
|
|
$("#datepicker1").datepicker({
|
|
@@ -2821,7 +2823,7 @@
|
|
|
//每1分钟主动查询一次数据
|
|
|
GetFacData()
|
|
|
}, 60*1000);
|
|
|
- if (res == null || res.code != 0) {
|
|
|
+ if (res == null) {
|
|
|
return
|
|
|
}
|
|
|
if(currentTargetType!="FAC"){
|
|
@@ -2834,13 +2836,19 @@
|
|
|
var dataType = opt["userData"];
|
|
|
if(dataType==null) continue;
|
|
|
dataType = dataType.split("|");
|
|
|
- var dataMap = res.data[dataType[0]];//从返回结果中获取到当前数据类型对应的统计结果
|
|
|
+ var dataMap = res[dataType[0]];//从返回结果中获取到当前数据类型对应的统计结果
|
|
|
if(dataMap==null) continue;
|
|
|
var dataTpl = dataType[1]; //从拆分结果中获取数据模板
|
|
|
var dataText = dataTpl;
|
|
|
//将模板中的属性替换成数据值
|
|
|
for (var attr in dataMap) {
|
|
|
- dataText = dataText.replace("{"+attr+"}",dataMap[attr]);
|
|
|
+ if(attr=="fdy" || attr=="poy"){
|
|
|
+ for (var yclattr in dataMap[attr]) {
|
|
|
+ dataText = dataText.replace("{"+attr+"."+yclattr+"}",dataMap[attr][yclattr].toString().padEnd(6," "));
|
|
|
+ }
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ dataText = dataText.replace("{"+attr+"}",dataMap[attr].toString().padEnd(6," "));
|
|
|
}
|
|
|
//更新GIS标记内容
|
|
|
opt["text"]=dataText;
|
|
@@ -3009,90 +3017,90 @@
|
|
|
var cf = "data://models/T_ALL.pr";
|
|
|
var errStr = await PlayerUtils.call(Native.Model.loadModel, currentTargetType, cf);
|
|
|
modelLoadState[currentTargetType] = true;
|
|
|
- GetFacData();
|
|
|
//获取4号楼顶对象
|
|
|
- // var obj02 = await player.Native.ModelTree.findItemByName("Box013",0,true,1);
|
|
|
- // var imgid = await player.Native.GisMarker.loadImage("data://icon/qietu/tip2.png");
|
|
|
- // var options = {
|
|
|
- // "text": "白胚布\r\r当日入库:- 出库:-\r当月入库:- 出库:-\r",
|
|
|
- // "visible": true,
|
|
|
- // //"maxLod": 130,
|
|
|
- // "minLod": 0,
|
|
|
- // "textFontSize":18,
|
|
|
- // "textColor": parseInt("0xffffffff"),
|
|
|
- // "contentPadding":[5,5,5,5],
|
|
|
- // "userData":"bpb|白胚布\r\r当日入库:{d-in} 出库:{d-out}\r当月入库:{m-in} 出库:{m-out}\r"
|
|
|
- // };
|
|
|
- //
|
|
|
- // var obj02Aabb = await player.Native.ModelTree.getItemShapeInfo(obj02.item);
|
|
|
- // options.pos = [obj02Aabb.aabb[0][0], obj02Aabb.aabb[0][1], obj02Aabb.aabb[0][2]+70];
|
|
|
- // //options.parentNode=tmp.item;
|
|
|
- // options.imgId = imgid
|
|
|
- // options.imgSize = [0, 110];
|
|
|
- // var markPtr = await player.Native.GisMarker.create(options);
|
|
|
- // //await player.Native.GisMarker.update(markPtr, options);
|
|
|
- // MarkerMapFac["FAC"]={};
|
|
|
- // MarkerMapFac["FAC"][markPtr]=options;
|
|
|
- // //获取盘头仓对象
|
|
|
- // var pantou = await player.Native.ModelTree.findItemByName("Object023",0,true,1);
|
|
|
- // //var imgid = await player.Native.GisMarker.loadImage("rgba:255,0,255,255");
|
|
|
- // var options = {
|
|
|
- // "text": "盘头\r\r当日入库:- 出库:-\r当月入库:- 出库:-",
|
|
|
- // "visible": true,
|
|
|
- // //"maxLod": 130,
|
|
|
- // "minLod": 0,
|
|
|
- // "textFontSize":16,
|
|
|
- // "textColor": parseInt("0xffffffff"),
|
|
|
- // "contentPadding":[5,5,5,5],
|
|
|
- // "userData":"pt|盘头\r\r当日入库:{d-in} 出库:{d-out}\r当月入库:{m-in} 出库:{m-out}\r"
|
|
|
- // };
|
|
|
- // var obj02Aabb = await player.Native.ModelTree.getItemShapeInfo(pantou.item);
|
|
|
- // options.pos = [obj02Aabb.aabb[0][0], obj02Aabb.aabb[0][1]-20, obj02Aabb.aabb[0][2]+10];
|
|
|
- // //options.parentNode=tmp.item;
|
|
|
- // options.imgId = imgid
|
|
|
- // options.imgSize = [0, 110];
|
|
|
- // var markPtr = await player.Native.GisMarker.create(options);
|
|
|
- // MarkerMapFac["FAC"][markPtr]=options;
|
|
|
- // //await player.Native.GisMarker.update(markPtr, options);
|
|
|
- // //获取原材料仓对象
|
|
|
- // var pantou = await player.Native.ModelTree.findItemByName("B412",0,true,1);
|
|
|
- // //var imgid = await player.Native.GisMarker.loadImage("rgba:255,0,255,255");
|
|
|
- // var options = {
|
|
|
- // "text": "原材料\r\r当日入库:- 出库:-\r当月入库:- 出库:-",
|
|
|
- // "visible": true,
|
|
|
- // //"maxLod": 130,
|
|
|
- // "minLod": 0,
|
|
|
- // "textFontSize":16,
|
|
|
- // "textColor": parseInt("0xffffffff"),
|
|
|
- // "contentPadding":[5,5,5,5],
|
|
|
- // "userData":"ycl|原材料\r\r当日入库:{d-in} 出库:{d-out}\r当月入库:{m-in} 出库:{m-out}\r"
|
|
|
- // };
|
|
|
- // var obj02Aabb = await player.Native.ModelTree.getItemShapeInfo(pantou.item);
|
|
|
- // options.pos = [obj02Aabb.aabb[0][0], obj02Aabb.aabb[0][1], obj02Aabb.aabb[0][2]+20];
|
|
|
- // //options.parentNode=tmp.item;
|
|
|
- // options.imgId = imgid
|
|
|
- // options.imgSize = [0, 110];
|
|
|
- // var markPtr = await player.Native.GisMarker.create(options);
|
|
|
- // MarkerMapFac["FAC"][markPtr]=options;
|
|
|
- // //await player.Native.GisMarker.update(markPtr, options);
|
|
|
- // //var imgid = await player.Native.GisMarker.loadImage("rgba:255,0,255,255");
|
|
|
- // var options = {
|
|
|
- // "text": "成品\r\r当日入库:- 出库:-\r当月入库:- 出库:-",
|
|
|
- // "visible": true,
|
|
|
- // //"maxLod": 130,
|
|
|
- // "minLod": 0,
|
|
|
- // "textFontSize":16,
|
|
|
- // "textColor": parseInt("0xffffffff"),
|
|
|
- // "contentPadding":[5,5,5,5],
|
|
|
- // "userData":"cp|成品\r\r当日入库:{d-in} 出库:{d-out}\r当月入库:{m-in} 出库:{m-out}\r"
|
|
|
- // };
|
|
|
- // options.pos = [obj02Aabb.aabb[0][0]+120, obj02Aabb.aabb[0][1], obj02Aabb.aabb[0][2]+20];
|
|
|
- // //options.parentNode=tmp.item;
|
|
|
- // options.imgId = imgid
|
|
|
- // options.imgSize = [0, 110];
|
|
|
- // var markPtr = await player.Native.GisMarker.create(options);
|
|
|
- // MarkerMapFac["FAC"][markPtr]=options;
|
|
|
+ var obj02 = await player.Native.ModelTree.findItemByName("Box013",0,true,1);
|
|
|
+ var imgid = await player.Native.GisMarker.loadImage("data://icon/qietu/tip2.png");
|
|
|
+ var options = {
|
|
|
+ "text": "白胚布\r\r当日入库:- 出库:-\r当月入库:- 出库:-\r",
|
|
|
+ "visible": true,
|
|
|
+ //"maxLod": 130,
|
|
|
+ "minLod": 0,
|
|
|
+ "textFontSize":16,
|
|
|
+ "textColor": parseInt("0xffffffff"),
|
|
|
+ "contentPadding":[5,5,5,5],
|
|
|
+ "userData":"bpb|白胚布\r\r当日入库:{d-in} 出库:{d-out}\r当月入库:{m-in} 出库:{m-out}\r"
|
|
|
+ };
|
|
|
+
|
|
|
+ var obj02Aabb = await player.Native.ModelTree.getItemShapeInfo(obj02.item);
|
|
|
+ options.pos = [obj02Aabb.aabb[0][0], obj02Aabb.aabb[0][1]-25, obj02Aabb.aabb[0][2]+100];
|
|
|
+ //options.parentNode=tmp.item;
|
|
|
+ options.imgId = imgid
|
|
|
+ options.imgSize = [0, 110];
|
|
|
+ var markPtr = await player.Native.GisMarker.create(options);
|
|
|
+ //await player.Native.GisMarker.update(markPtr, options);
|
|
|
+ MarkerMapFac["FAC"]={};
|
|
|
+ MarkerMapFac["FAC"][markPtr]=options;
|
|
|
+ //获取盘头仓对象
|
|
|
+ var pantou = await player.Native.ModelTree.findItemByName("Object023",0,true,1);
|
|
|
+ //var imgid = await player.Native.GisMarker.loadImage("rgba:255,0,255,255");
|
|
|
+ var options = {
|
|
|
+ "text": "盘头\r\r当日入库:- 出库:-\r当月入库:- 出库:-",
|
|
|
+ "visible": true,
|
|
|
+ //"maxLod": 130,
|
|
|
+ "minLod": 0,
|
|
|
+ "textFontSize":16,
|
|
|
+ "textColor": parseInt("0xffffffff"),
|
|
|
+ "contentPadding":[5,5,5,5],
|
|
|
+ "userData":"pt|盘头\r\r当日入库:{d-in} 出库:{d-out}\r当月入库:{m-in} 出库:{m-out}\r"
|
|
|
+ };
|
|
|
+ var obj02Aabb = await player.Native.ModelTree.getItemShapeInfo(pantou.item);
|
|
|
+ options.pos = [obj02Aabb.aabb[0][0], obj02Aabb.aabb[0][1]-30, obj02Aabb.aabb[0][2]+45];
|
|
|
+ //options.parentNode=tmp.item;
|
|
|
+ options.imgId = imgid
|
|
|
+ options.imgSize = [240, 110];
|
|
|
+ var markPtr = await player.Native.GisMarker.create(options);
|
|
|
+ MarkerMapFac["FAC"][markPtr]=options;
|
|
|
+ //await player.Native.GisMarker.update(markPtr, options);
|
|
|
+ //获取原材料仓对象
|
|
|
+ var pantou = await player.Native.ModelTree.findItemByName("B412",0,true,1);
|
|
|
+ //var imgid = await player.Native.GisMarker.loadImage("rgba:255,0,255,255");
|
|
|
+ var options = {
|
|
|
+ "text": "原材料\r\rfdy当日入库:- 出库:-\rfdy当月入库:- 出库:-\rpoy当日入库:- 出库:-\rpoy当月入库:- 出库:-",
|
|
|
+ "visible": true,
|
|
|
+ //"maxLod": 130,
|
|
|
+ "minLod": 0,
|
|
|
+ "textFontSize":16,
|
|
|
+ "textColor": parseInt("0xffffffff"),
|
|
|
+ "contentPadding":[5,5,5,5],
|
|
|
+ "userData":"ycl|原材料\r\rfdy当日入库:{fdy.d-in} 出库:{fdy.d-out}\rfdy当月入库:{fdy.m-in} 出库:{fdy.m-out}\rpoy当日入库:{poy.d-in} 出库:{poy.d-out}\rpoy当月入库:{poy.m-in} 出库:{poy.m-out}"
|
|
|
+ };
|
|
|
+ var obj02Aabb = await player.Native.ModelTree.getItemShapeInfo(pantou.item);
|
|
|
+ options.pos = [obj02Aabb.aabb[0][0], obj02Aabb.aabb[0][1]-30, obj02Aabb.aabb[0][2]+60];
|
|
|
+ //options.parentNode=tmp.item;
|
|
|
+ options.imgId = imgid
|
|
|
+ options.imgSize = [0, 140];
|
|
|
+ var markPtr = await player.Native.GisMarker.create(options);
|
|
|
+ MarkerMapFac["FAC"][markPtr]=options;
|
|
|
+ //await player.Native.GisMarker.update(markPtr, options);
|
|
|
+ //var imgid = await player.Native.GisMarker.loadImage("rgba:255,0,255,255");
|
|
|
+ var options = {
|
|
|
+ "text": "成品\r\r当日入库:- 出库:-\r当月入库:- 出库:-",
|
|
|
+ "visible": true,
|
|
|
+ //"maxLod": 130,
|
|
|
+ "minLod": 0,
|
|
|
+ "textFontSize":16,
|
|
|
+ "textColor": parseInt("0xffffffff"),
|
|
|
+ "contentPadding":[5,5,5,5],
|
|
|
+ "userData":"cp|成品\r\r当日入库:{d-in} 出库:{d-out}\r当月入库:{m-in} 出库:{m-out}\r"
|
|
|
+ };
|
|
|
+ options.pos = [obj02Aabb.aabb[0][0]+120, obj02Aabb.aabb[0][1]-20, obj02Aabb.aabb[0][2]+50];
|
|
|
+ //options.parentNode=tmp.item;
|
|
|
+ options.imgId = imgid
|
|
|
+ options.imgSize = [250, 110];
|
|
|
+ var markPtr = await player.Native.GisMarker.create(options);
|
|
|
+ MarkerMapFac["FAC"][markPtr]=options;
|
|
|
//await player.Native.GisMarker.update(markPtr, options);
|
|
|
+ GetFacData();
|
|
|
}else{
|
|
|
showMarker(currentTargetType);
|
|
|
}
|