|
@@ -149,6 +149,8 @@ export default {
|
|
|
'steam':'GJ',
|
|
|
'water':'m³',
|
|
|
};
|
|
|
+ var line1_tipdata = {};
|
|
|
+ var line2_tipdata = {};
|
|
|
let getDataTimer=null;
|
|
|
let getDataTimer1 = null;
|
|
|
let getDataTimer2 = null;
|
|
@@ -163,9 +165,14 @@ export default {
|
|
|
if(newVal){
|
|
|
//模型加载完成
|
|
|
console.log('全厂模型加载完成')
|
|
|
- clearTimeout(getDataTimer);
|
|
|
try{
|
|
|
- if(MarkerMapFac["FAC"]==null) loadmarkers();
|
|
|
+ if(MarkerMapFac["FAC"]!=null && player!=null && player.Native!=null){
|
|
|
+ for(let key in MarkerMapFac["FAC"]){
|
|
|
+ player.Native.GisMarker.destroy(key)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ MarkerMapFac["FAC"] = {};
|
|
|
+ loadmarkers();
|
|
|
backMasterViewByFac();
|
|
|
}catch(e){
|
|
|
window.location.reload();
|
|
@@ -175,55 +182,26 @@ export default {
|
|
|
|
|
|
let DataFull={
|
|
|
GetFacData:function(){
|
|
|
+ getDataTimer = setTimeout(function () {
|
|
|
+ //每1分钟主动查询一次数据
|
|
|
+ DataFull.GetFacData()
|
|
|
+ }, 60*1000);
|
|
|
api.GetFacData().then((res)=>{
|
|
|
- if(window.CurrentTargetType!='FAC') return;
|
|
|
- getDataTimer = setTimeout(function () {
|
|
|
- //每1分钟主动查询一次数据
|
|
|
- DataFull.GetFacData()
|
|
|
- }, 60*1000);
|
|
|
+ if(window.CurrentTargetType!='FAC') return;
|
|
|
FacStockData = res||{};
|
|
|
if (res == null || player.Native==null || window.CurrentTargetType!='FAC') {
|
|
|
return
|
|
|
}
|
|
|
- for (var key in MarkerMapFac) {
|
|
|
- if(key=="FAC"){
|
|
|
- for (var marker in MarkerMapFac[key]) {
|
|
|
- var opt = MarkerMapFac[key][marker];
|
|
|
- var dataType = opt["userData"];
|
|
|
- if(dataType==null) continue;
|
|
|
- dataType = dataType.split("|");
|
|
|
- var dataMap = res[dataType[0]];//从返回结果中获取到当前数据类型对应的统计结果
|
|
|
- if(dataMap==null) continue;
|
|
|
- var dataTpl = dataType[1]; //从拆分结果中获取数据模板
|
|
|
- var dataText = dataTpl;
|
|
|
- //将模板中的属性替换成数据值
|
|
|
- for (var attr in dataMap) {
|
|
|
- /*
|
|
|
- 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;
|
|
|
- player.Native.GisMarker.update(marker, opt);
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
+ updateMarkerData();
|
|
|
});
|
|
|
},
|
|
|
GetDeviceStat:function(){
|
|
|
+ getDataTimer1 = setTimeout(function () {
|
|
|
+ //每1分钟主动查询一次数据
|
|
|
+ DataFull.GetDeviceStat()
|
|
|
+ }, 60*1000);
|
|
|
api.GetFacDeviceStat().then(res=>{
|
|
|
if(window.CurrentTargetType!='FAC') return;
|
|
|
- getDataTimer1 = setTimeout(function () {
|
|
|
- //每1分钟主动查询一次数据
|
|
|
- DataFull.GetDeviceStat()
|
|
|
- }, 60*1000);
|
|
|
if (res == null || player.Native==null || window.CurrentTargetType!='FAC') {
|
|
|
return
|
|
|
}
|
|
@@ -237,6 +215,7 @@ export default {
|
|
|
*/
|
|
|
return;
|
|
|
}
|
|
|
+ FacStockData = res.data.stock||{};
|
|
|
deviceStatData.value = res.data;
|
|
|
LoadSCLine('Length');
|
|
|
LoadUsedLine('price');
|
|
@@ -258,10 +237,44 @@ export default {
|
|
|
}, 3000);
|
|
|
})();
|
|
|
}
|
|
|
+
|
|
|
+ async function updateMarkerData(){
|
|
|
+ if(MarkerMapFac==null) return;
|
|
|
+ for (var key in MarkerMapFac) {
|
|
|
+ if(key=="FAC"){
|
|
|
+ for (var marker in MarkerMapFac[key]) {
|
|
|
+ var opt = MarkerMapFac[key][marker];
|
|
|
+ var dataType = opt["userData"];
|
|
|
+ if(dataType==null) continue;
|
|
|
+ dataType = dataType.split("|");
|
|
|
+ var dataMap = FacStockData[dataType[0]];//从返回结果中获取到当前数据类型对应的统计结果
|
|
|
+ if(dataMap==null) continue;
|
|
|
+ var dataTpl = dataType[1]; //从拆分结果中获取数据模板
|
|
|
+ var dataText = dataTpl;
|
|
|
+ //将模板中的属性替换成数据值
|
|
|
+ for (var attr in dataMap) {
|
|
|
+ /*
|
|
|
+ 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;
|
|
|
+ player.Native.GisMarker.update(marker, opt);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
async function loadmarkers(){
|
|
|
//获取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 imgid = await player.Native.GisMarker.loadImage("data://icon/qietu/tip3.png");
|
|
|
var options = {
|
|
|
"text": "白坯布("+StockTypeUnit['bpb']+")\r\r当前库存:-\r统计时间:7点至次日7点\r当日入库:- 出库:-\r当月入库:- 出库:-\r",
|
|
|
"visible": true,
|
|
@@ -357,15 +370,7 @@ export default {
|
|
|
},100,markerLClickObj["userData"]);
|
|
|
emit('markerLClick',markerLClickObj);
|
|
|
});
|
|
|
- DataFull.GetFacData();
|
|
|
- DataFull.GetDeviceStat();
|
|
|
- /*
|
|
|
- DataFull.GetFacProduction();
|
|
|
- DataFull.GetScLine();
|
|
|
- DataFull.GetUsedLine();
|
|
|
- LoadJBPie();
|
|
|
- LoadRZPie();
|
|
|
- */
|
|
|
+ updateMarkerData();
|
|
|
}
|
|
|
function LoadSCLine(dataType) {
|
|
|
buttonCode1.value = dataType;
|
|
@@ -373,15 +378,14 @@ export default {
|
|
|
let data = deviceStatData.value.prodTrade;
|
|
|
//生产趋势
|
|
|
//获取数据中weight、aweight、bweight
|
|
|
- var t = echarts_sc_qushi.value;
|
|
|
- var week_efficiency = [];
|
|
|
+ var t = echarts_sc_qushi.value;
|
|
|
var week_aefficiency = [];
|
|
|
var week_befficiency = [];
|
|
|
var times = [];
|
|
|
var v_series = [];
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
var tv = data[i]['date'];
|
|
|
- times.push(tv);
|
|
|
+ times.push([tv,data[i].tips]);
|
|
|
if(dataType=='Length'){
|
|
|
week_aefficiency.push(data[i]['jbLength'])
|
|
|
week_befficiency.push(data[i]['rzLength'])
|
|
@@ -481,8 +485,10 @@ export default {
|
|
|
formatter: function (params) {
|
|
|
let xv='';
|
|
|
let result = '';
|
|
|
+ console.log(params)
|
|
|
params.forEach(function (item) {
|
|
|
- xv=`${item.name}<br/>`;
|
|
|
+ xv=`${item.name}`;
|
|
|
+ xv = xv.split(',')[1]+'<br>';
|
|
|
result += ` ${item.marker} ${item.seriesName}: ${item.value}(`+typeUnitName+`)<br/>`;
|
|
|
});
|
|
|
return xv+result;
|
|
@@ -500,7 +506,10 @@ export default {
|
|
|
boundaryGap: true,
|
|
|
axisLabel: {
|
|
|
rotate: 45,
|
|
|
- color: "#26e2fb"
|
|
|
+ color: "#26e2fb",
|
|
|
+ formatter:function(v){
|
|
|
+ return v.split(',')[0]
|
|
|
+ }
|
|
|
},
|
|
|
axisTick:{
|
|
|
show:false
|
|
@@ -546,7 +555,7 @@ export default {
|
|
|
var week_aefficiency = [];
|
|
|
var week_befficiency = [];
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
- times.push(data[i]['date']);
|
|
|
+ times.push([data[i]['date'],data[i].tips]);
|
|
|
if(data[i]['jb'][dataType]!=null) week_aefficiency.push(data[i]['jb'][dataType]);
|
|
|
if(data[i]['rz'][dataType]!=null) week_befficiency.push(data[i]['rz'][dataType]);
|
|
|
}
|
|
@@ -599,7 +608,8 @@ export default {
|
|
|
let xv='';
|
|
|
let result = '';
|
|
|
params.forEach(function (item) {
|
|
|
- xv=`${item.name}<br/>`;
|
|
|
+ xv=`${item.name}`;
|
|
|
+ xv = xv.split(',')[1]+'<br>';
|
|
|
result += ` ${item.marker} ${item.seriesName}: ${item.value}(`+typeUnitName+`)<br/>`;
|
|
|
});
|
|
|
return xv+result;
|
|
@@ -626,7 +636,10 @@ export default {
|
|
|
boundaryGap: false,
|
|
|
axisLabel: {
|
|
|
rotate: 45,
|
|
|
- color: "#26e2fb"
|
|
|
+ color: "#26e2fb",
|
|
|
+ formatter:function(v){
|
|
|
+ return v.split(',')[0]
|
|
|
+ }
|
|
|
},
|
|
|
axisLine:{
|
|
|
show:true
|
|
@@ -1077,6 +1090,8 @@ export default {
|
|
|
clearTimeout(getDataTimer2);
|
|
|
clearTimeout(getDataTimer3);
|
|
|
clearTimeout(getDataTimer4);
|
|
|
+ DataFull.GetFacData();
|
|
|
+ DataFull.GetDeviceStat();
|
|
|
backMasterViewByFac();
|
|
|
});
|
|
|
onUnmounted(()=>{
|