فهرست منبع

调整line的x轴label数据
修复染整线模型加载时容易卡断线重连的问题

liling 2 ماه پیش
والد
کامیت
29570f3b25

+ 1 - 1
src/pages/components/Bottom.vue

@@ -1,5 +1,5 @@
 <template>
-    <div class="bottom">
+    <div class="bottom" style="z-index: 1000;">
         <div style="display: flex; justify-content: left; flex-flow: row;height: 100%;">
             <div :class="item.active?'btn active':'btn'" v-for="item in navlist" :style="{backgroundImage: item.active?`url(${btnFrontBg})`:''}" @click="loadNavModel(item);">
                 <img :src="item.active?item.img1:item.img" :key="item.code" :t='item.code' :class="item.active?'active':''">

+ 1 - 1
src/pages/components/Fac.vue

@@ -500,7 +500,7 @@ export default {
                     type: 'category',
                     boundaryGap: true,
                     axisLabel: {
-                        rotate: 45,
+                        rotate: 0,
                         color: "#26e2fb",
                         formatter:function(v){
                             return v.split(',')[0]

+ 57 - 31
src/pages/components/In02.vue

@@ -930,7 +930,7 @@ export default {
             for (var i = 0; i < data.length; i++) {
                 var v = data[i]['alarm'];
                 var tv = data[i]['time'].split("-")
-                times.push(tv[1] + "-" + tv[2])
+                times.push([tv[2],data[i]['time']]);
                 if (v != null) tmpWeek.push(v);
             }
             alarmWeek.value = tmpWeek;
@@ -967,7 +967,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.value}(次)<br/>`;
                             });
                             return xv+result;
@@ -991,8 +992,11 @@ export default {
                         type: 'category',
                         boundaryGap: false,
                         axisLabel: {
-                            rotate: 45,
-                            color: "#fff"
+                            rotate: 0,
+                            color: "#26e2fb",
+                            formatter:function(v){
+                                return v.split(',')[0];
+                            }
                         },
                         data: times
                     },
@@ -1002,7 +1006,7 @@ export default {
                             color: "#fff"
                         },
                         axisLabel: {
-                            color: "rgb(203,215,235)"
+                            color: "#26e2fb"
                         },
                         splitLine: {
                             lineStyle: {
@@ -1025,7 +1029,7 @@ export default {
             var v_series = [];
             for (var i = 0; i < data.length; i++) {
                 var tv = data[i]['time'].split("-")
-                times.push(tv[1] + "-" + tv[2])
+                times.push([tv[2],data[i]['time']]);
                 for (var k1 in week) {
                     week[k1].push(data[i][k1])
                 }
@@ -1051,7 +1055,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}(次)<br/>`;
                         });
                         return xv+result;
@@ -1077,8 +1082,11 @@ export default {
                     boundaryGap: true,
                     data: times,
                     axisLabel: {
-                        rotate: 45,
-                        color: "#fff"
+                        rotate: 0,
+                        color: "#26e2fb",
+                        formatter:function(v){
+                            return v.split(',')[0];
+                        }
                     },
                     axisPointer: {snap: false}
                 }],
@@ -1086,7 +1094,7 @@ export default {
                     type: 'value',
                     axisPointer: {snap: false},
                     axisLabel: {
-                        color: "rgb(203,215,235)"
+                        color: "#26e2fb"
                     },
                     splitLine: {
                         lineStyle: {
@@ -1143,14 +1151,18 @@ export default {
             var week_befficiency = [];
             var times = [];
             var v_series = [];
+            var minValue = 100;
             for (var i = 0; i < data.length; i++) {
                 var v = data[i]['efficiency'];
                 var tv = data[i]['time'].split("-")
-                times.push(tv[1] + "-" + tv[2])
+                times.push([tv[2],data[i]['time']]);
                 if (v != null) week_efficiency.push(v);
-                week_aefficiency.push(data[i]['aefficiency'])
-                week_befficiency.push(data[i]['befficiency'])
+                week_aefficiency.push(data[i]['aefficiency']);
+                week_befficiency.push(data[i]['befficiency']);
+                if(data[i]['aefficiency']<minValue) minValue = data[i]['aefficiency'];
+                if(data[i]['befficiency']<minValue) minValue = data[i]['befficiency'];
             }
+            minValue = minValue-10;
             if (week_efficiency.length == 0) {
                 return
             }
@@ -1204,7 +1216,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} %<br/>`;
                         });
                         return xv+result;
@@ -1229,18 +1242,22 @@ export default {
                     type: 'category',
                     boundaryGap: false,
                     axisLabel: {
-                        rotate: 45,
-                        color: "#fff"
+                        rotate: 0,
+                        color: "#26e2fb",
+                        formatter:function(v){
+                            return v.split(',')[0];
+                        }
                     },
                     data: times
                 },
                 yAxis: {
                     type: 'value',
+                    min:minValue,
                     nameTextStyle: {
-                        color: "#fff"
+                        color: "#26e2fb"
                     },
                     axisLabel: {
-                        color: "rgb(203,215,235)"
+                        color: "#26e2fb"
                     },
                     splitLine: {
                         lineStyle: {
@@ -1266,7 +1283,7 @@ export default {
             var v_series = [];
             for (var i = 0; i < data.length; i++) {
                 var tv = data[i]['time'].split("-")
-                times.push(tv[1] + "-" + tv[2])
+                times.push([tv[2],data[i]['time']]);
                 week_efficiency.push(data[i]['length'])
                 week_aefficiency.push(data[i]['lengthA'])
                 week_befficiency.push(data[i]['lengthB'])
@@ -1338,7 +1355,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}(米/日)<br/>`;
                         });
                         return xv+result;
@@ -1355,18 +1373,21 @@ export default {
                     type: 'category',
                     boundaryGap: false,
                     axisLabel: {
-                        rotate: 45,
-                        color: "#fff"
+                        rotate: 0,
+                        color: "#26e2fb",
+                        formatter:function(v){
+                            return v.split(',')[0]
+                        }
                     },
                     data: times
                 },
                 yAxis: {
                     type: 'value',
                     nameTextStyle: {
-                        color: "#fff"
+                        color: "#26e2fb"
                     },
                     axisLabel: {
-                        color: "rgb(203,215,235)"
+                        color: "#26e2fb"
                     },
                     splitLine: {
                         lineStyle: {
@@ -1393,7 +1414,7 @@ export default {
             for (var i = 0; i < data.length; i++) {
                 var v = data[i]['kwh'];
                 var tv = data[i]['time'].split("-")
-                times.push(tv[1] + "-" + tv[2])
+                times.push([tv[2],data[i]['time']]);
                 if (v != null) week_efficiency.push(v);
                 week_aefficiency.push(data[i]['akwh'])
                 week_befficiency.push(data[i]['bkwh'])
@@ -1451,7 +1472,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}(kWh)<br/>`;
                         });
                         return xv+result;
@@ -1476,18 +1498,21 @@ export default {
                     type: 'category',
                     boundaryGap: false,
                     axisLabel: {
-                        rotate: 45,
-                        color: "#fff"
+                        rotate: 0,
+                        color: "#26e2fb",
+                        formatter:function(v){
+                            return v.split(',')[0]
+                        }
                     },
                     data: times
                 },
                 yAxis: {
                     type: 'value',
                     nameTextStyle: {
-                        color: "#fff"
+                        color: "#26e2fb"
                     },
                     axisLabel: {
-                        color: "rgb(203,215,235)"
+                        color: "#26e2fb"
                     },
                     splitLine: {
                         lineStyle: {
@@ -1598,7 +1623,8 @@ export default {
         function clickalarmtr(item){
             var devno = item.devcode;
             if (devno == '') return;
-            ShowInfo("C_" + devno)
+            let name="C_" + devno;
+            emit('OpenIframeWin',{class:'newwin deviceInfoWin',src:'/in02-device-info#'+name,title:name+'基本信息'})
         }
         function LoadPan(data) {
             //盘头数据处理

+ 9 - 5
src/pages/components/In02_device_peifang.vue

@@ -907,7 +907,7 @@
                     for (var i = 0; i < data.alarms.length; i++) {
                         var v = data.alarms[i]['value'];
                         var tv = data.alarms[i]['time'].split("-")
-                        times.push(tv[1] + "-" + tv[2])
+                        times.push([ tv[2],data.alarms[i]['time']]);
                         if (v != null) alarmWeekTmp.push(v)
                     }
                     if (alarmWeekTmp.length == 0) {
@@ -945,7 +945,8 @@
                                     let xv='';
                                     let result = '';
                                     params.forEach(function (item) {
-                                        xv=`${item.name}<br/>`;
+                                        xv=`${item.name}`;
+                                        xv = xv.split(',')[1]+'<br/>';
                                         result += ` ${item.marker}  ${item.value}(次)<br/>`;
                                     });
                                     return xv+result;
@@ -969,8 +970,11 @@
                                 type: 'category',
                                 boundaryGap: false,
                                 axisLabel: {
-                                    rotate: 45,
-                                    color: "#fff"
+                                    rotate: 0,
+                                    color: "#26e2fb",
+                                    formatter:function(v){
+                                        return v.split(',')[0];
+                                    }
                                 },
                                 data: times
                             },
@@ -980,7 +984,7 @@
                                     color: "#fff"
                                 },
                                 axisLabel: {
-                                    color: "rgb(203,215,235)"
+                                    color: "#26e2fb"
                                 },
                                 splitLine: {
                                     lineStyle: {

+ 7 - 6
src/pages/components/In03.vue

@@ -218,14 +218,14 @@ export default {
             if(newVal==null){
                 return;
             }
-            console.log('印花模型点击:',newVal)
+            //console.log('印花模型点击:',newVal)
         },{deep:true,immediate:true})
         watch(() => props.in03ModelLoadState, newVal=> {
             if(newVal){
                 console.log('印花模型加载状态:',newVal)
                 clearTimeout(getDataTimer);
-                setTimeout(() => {
-                    DataFull.GetData();
+                setTimeout(() => {  
+                    DataFull.GetData();                  
                     init();
                 }, 1000);                
             }
@@ -344,14 +344,14 @@ export default {
             updateLineStateTimer = setTimeout(() => {
                 updateLineState();
             }, 1000*60);
-            if(window.LINELIST==null) return;
+            if(window.LINELIST==null || player==null || player.Native==null) return;
             for(let name in window.LINELIST){
                 if(oldLineState[name]==window.IN345LINE[name]) continue;
                 if(!window.IN345LINE[name]){
                     //产线未开
                     await player.Native.ModelTree.setItemColor(window.LINELIST[name], parseInt("0x666666ff"), true)
                 }else{
-                    await player.Native.ModelTree.restoreItemColor(window.LINELIST[name]);
+                    //await player.Native.ModelTree.restoreItemColor(window.LINELIST[name]);//这句有BUG,会导致API调用失败,重而导致ws断开国家利益.暂时不用
                 }
             }
             oldLineState = JSON.parse(JSON.stringify(window.IN345LINE));
@@ -635,13 +635,14 @@ export default {
             // 使用异步函数
             (async () => {
                 setTimeout(function() {
-                    player.Native.Camera.setAnchorPos([ -80.69618225097656,21.59876251220703,11.815500259399414]);
+                    player.Native.Camera.setAnchorPos([-80.69618225097656,21.59876251220703,11.815500259399414]);
                 }, 3000);
             })();
         }
         onMounted(()=>{
             if(BODY_H_RATE>0.9) isFullScreen.value=true;
             else isFullScreen.value=false;
+            oldLineState = window.IN345LINE;//初始化产线初始状态
         })
         onUnmounted(()=>{
             clearTimeout(getDataTimer);

+ 9 - 1
src/pages/main/index.vue

@@ -188,7 +188,15 @@ export default {
                         return;
                     }
                     player.reconnect();
-                }, 4000)
+                }, 4000);
+                //启动自动连接状态检测
+                setTimeout(() => {
+                    //5秒还未连接成功时直接刷新页面
+                    if(!playerConnState){
+                        console.log('自动连接超时,自动页面刷新')
+                        //window.location.reload();
+                    }
+                }, 9000);
             });
 
             //5. [推荐] 响应UserTimeOut消息,引擎接收用户鼠标触屏事件超时发出通知