liling 6 сар өмнө
parent
commit
7a3a52bdf8

BIN
bg.jpg


+ 124 - 0
bpb_fx.html

@@ -0,0 +1,124 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title></title>
+    <link rel="stylesheet" type="text/css" href="css/main.css">
+    <link rel="stylesheet" type="text/css" href="css/jquery-ui.css">
+    <link rel="stylesheet" type="text/css" href="css/bpb.css">
+</head>
+<body onclick="clearEle();" class="bpb_bg">
+<div class="bpb_title"></div>
+<div class="bpb_content"><div style="text-align: center;">正在开发中...</div></div>
+</body>
+</html>
+<!-- 引入qwebchannel.js、Player.js、PlayerUtils.js -->
+<script type="text/javascript" src="jquery-3.4.1.js"></script>
+<script type="text/javascript" src="jquery-ui.min.js"></script>
+<script type="text/javascript" src="echarts.min.js"></script>
+<script src="global.js"></script>
+<script type="text/javascript" src="template.js"></script>
+
+<script>
+     //汉化日期控件
+    $.datepicker.regional['zh-CN'] = {
+        clearText: '清除',
+        clearStatus: '清除已选日期',
+        closeText: '关闭',
+        closeStatus: '不改变当前选择',
+        prevText: '<上月',
+        prevStatus: '显示上月',
+        prevBigText: '<<',
+        prevBigStatus: '显示上一年',
+        nextText: '下月>',
+        nextStatus: '显示下月',
+        nextBigText: '>>',
+        nextBigStatus: '显示下一年',
+        currentText: '今天',
+        currentStatus: '显示本月',
+        monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
+        monthNamesShort: ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二'],
+        monthStatus: '选择月份',
+        yearStatus: '选择年份',
+        weekHeader: '周',
+        weekStatus: '年内周次',
+        dayNames: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
+        dayNamesShort: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
+        dayNamesMin: ['日', '一', '二', '三', '四', '五', '六'],
+        dayStatus: '设置 DD 为一周起始',
+        dateStatus: '选择 m月 d日, DD',
+        dateFormat: 'yy-mm-dd',
+        firstDay: 1,
+        initStatus: '请选择日期',
+        isRTL: false
+    };
+    $(document).ready(function () {
+        $.datepicker.setDefaults($.datepicker.regional['zh-CN']);  //设置日期控制语言
+        $("#datepicker1").datepicker({
+            dateFormat: "yy-mm-dd",
+            showOn: "button",
+            buttonText: "选择日期",
+            changeMonth: true,
+            changeYear: true,
+            numberOfMonths: 1,
+            rangeSelect: true,
+            onClose: function (selectedDate) {
+                $("#datepicker2").datepicker("option", "minDate", selectedDate);
+                $("#datepicker2").val('');
+                var isNowDay = selectedDate==new Date().Format("yyyy-MM-dd");
+                var hour1Opts = [];
+                var nowHour = new Date().Format("h");
+                for (var i = 0; i < 24; i++) {
+                    if( !isNowDay || (isNowDay && i<=nowHour)) hour1Opts.push('<option value="' + i + '">' + i + ' 时</option>');
+                }
+                $("#hour1,#hourP1").html(hour1Opts.join(''))
+            }
+        });
+
+        $("#datepicker2").datepicker({
+            dateFormat: "yy-mm-dd",
+            showOn: "button",
+            buttonText: "选择日期",
+            changeMonth: true,
+            changeYear: true,
+            numberOfMonths: 1,
+            rangeSelect: true,
+            defaultDate: new Date().Format("yyyy-MM-dd"),
+            onClose:function(selectedDate){
+                var isNowDay = selectedDate==new Date().Format("yyyy-MM-dd");
+                var hour2Opts = [];
+                var nowHour = new Date().Format("h");
+                for (var i = 0; i < 24; i++) {
+                    if( !isNowDay || (isNowDay && i<=nowHour)) hour2Opts.push('<option value="' + i + '">' + i + ' 时</option>');
+                }
+                $("#hour2,#hourP2").html(hour2Opts.join(''))
+            }
+        });
+        //日期不能超过当前日期
+        //$("#datepicker1,#datepicker2").datepicker("option", "maxDate", new Date().Format("yyyy-MM-dd"));
+        $("#date_select,#ui-datepicker-div,#day_select").on("click", function (e) {
+            e.stopPropagation();
+        });
+        $("#bpb_content").height($(window).height()-$(".bpb_title").height());
+    });
+    function clearEle(){
+        
+    }
+    function GetData() {
+            $.getJSON(SERVER_URL + "/index", {}, function (res) {
+                setTimeout(function () {
+                    //每60秒主动查询一次数据
+                    GetData()
+                }, INDEX_TIMEOUT);
+                if (res == null || res.code != 0) {
+                    return
+                }
+                var jsondata = res.data;
+            })
+    }
+
+    //关闭窗口
+    function CloseWin() {
+    }
+
+</script>

+ 20 - 0
css/bpb.css

@@ -0,0 +1,20 @@
+body{
+    width: 1366px;
+    height: 764px;
+}
+.bpb_bg{
+    background-image: url('../image/bpb/bg.png');
+    background-size: contain;
+}
+.bpb_title{
+    background-image: url('../image/bpb/title.png');
+    background-repeat: no-repeat;
+    background-size: contain;
+    height: 9%;
+}
+.bpb_content{
+    position: relative;
+    width: 100%;
+    height: calc(91%-40px);
+    color: #fff;
+}

+ 32 - 3
css/main.css

@@ -58,6 +58,22 @@
             scrollbar-base-color: #f8f8f8; /*滚动条的基本颜色*/
             Cursor: url(mouse.cur); /*自定义个性鼠标*/
         }
+    #iframeWin{
+        display: none;
+    }
+    #iframeWin .content,#iframeWin iframe{
+        height: 100%;
+        width: 100%;
+        border: 0;       
+    }
+    .bpbWin{
+        width: 1366px !important;
+        height: 764px !important;
+        left: 50%;
+        top:50%;
+        margin-top: -382px !important;
+        margin-left:-683px !important;
+    }
     #loading{
         position: absolute;
         top: 50%;
@@ -107,6 +123,19 @@
     #search_result .item:hover{
         background: #3B6096;
     }
+    #func_menulist{
+        position: absolute;
+        width: 160px;
+        height: 100px;
+        background: rgba(19, 47, 95, 0.8);
+        box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.2);
+        border-radius: 2px 2px 2px 2px;
+        z-index: 4;
+        top: 60px;
+        right: 71px;
+        padding: 5px;
+        display: none;
+    }
     #imp_item{
         position: absolute;
         width: 160px;
@@ -120,7 +149,7 @@
         padding: 5px;
         display: none;
     }
-    #imp_item>div{
+    #imp_item>div,#func_menulist>div{
         width: 144px;
         height: 30px;
         border-radius: 2px 2px 2px 2px;
@@ -129,10 +158,10 @@
         line-height: 30px;
         padding:0 5px;
     }
-    #imp_item>div:hover{
+    #imp_item>div:hover,#func_menulist>div:hover{
         background: #3B6096;
     }
-    #imp_item .active{
+    #imp_item .active,#func_menulist .active{
         background: #3B6096;
     }
     #top{

BIN
image/CalendarBlank.png


BIN
image/bpb/Exclude.png


BIN
image/bpb/Exclude1.png


BIN
image/bpb/Exclude2.png


BIN
image/bpb/bg.png


BIN
image/bpb/bg2.png


BIN
image/bpb/device.png


BIN
image/bpb/h.png


BIN
image/bpb/o.png


BIN
image/bpb/plc.png


BIN
image/bpb/refresh.png


BIN
image/bpb/title.png


BIN
image/bpb/v317.png


BIN
image/bpb/v318.png


BIN
image/bpb/v319.png


BIN
image/bpb/v320.png


BIN
image/bpb/wl0.png


BIN
image/bpb/wl1.png


BIN
image/bpb/wlbg.png


+ 37 - 11
main.html

@@ -6,7 +6,7 @@
     <link rel="stylesheet" type="text/css" href="css/main.css">
     <link rel="stylesheet" type="text/css" href="css/jquery-ui.css">
 </head>
-<body onclick="$('#imp_item,#date_select,#day_select').hide();$('#search_result').html('').hide();$('#search input').val('')">
+<body onclick="clearEle()">
 <div id="loading_a1"></div>
 <div id="loading">正在加载模型中...</div>
 <div for="FAC" id="top" class="top topfac">
@@ -29,7 +29,7 @@
          onclick="backMasterView()"><img src="image/view.png"></div>
 </div>
 <div for="IN02" id="top" class="top top02 hideDiv">
-    <div  id="maogao_btn" title=""
+    <div  id="func_menu_btn" title=""
          style="cursor: pointer;position: absolute;right: 176px;top: 25px;height: 38px;width: 38px;"><IMG
             src="image/menu1.png"></div>
     <div  id="autoplayer_btn" title="切换自动漫游"
@@ -42,6 +42,10 @@
          style="cursor: pointer;position: absolute;right: 10px;top: 25px;height: 38px;width: 38px;text-align: center;"
          onclick="backMasterView()"><img src="image/view.png"></div>
 </div>
+<div for="IN02" id="func_menulist">
+    <div  id="maogao_btn" title="" style="cursor: pointer;">毛高比重</div>
+    <div  id="bpb_fx" title="" style="cursor: pointer;">白柸布预测分析</div>
+</div>
 <div for="IN02" id="imp_item">
     <div itemcode="1"><span>生产数据</span><img src="image/imp2.png" style="float: right;margin-top: 7px;"></div>
     <div itemcode="2"><span>停机原因</span><img src="image/imp2.png" style="float: right;margin-top: 7px;"></div>
@@ -427,10 +431,7 @@
     </div>
 </div>
 <div id="newwin" class="newwin">
-    <div class="title"><img src="image/title_icon.png" style="margin: 7px;float: left;"><span class="text"></span><span
-            class="text">#经编机-详细数据</span><img src="image/Close.png"
-                                                     style="margin: 7px;float: right;cursor: pointer;"
-                                                     onclick="CloseWin()"></div>
+    <div class="title"><img src="image/title_icon.png" style="margin: 7px;float: left;"><span class="text"></span><span  class="text">#经编机-详细数据</span><img src="image/Close.png" style="margin: 7px;float: right;cursor: pointer;" onclick="CloseWin()"></div>
     <div class="content">
         <div style="text-align: center;"><span class="btn btn_active" style="margin-left: -220px;">告警</span><span
                 class="btn">产能</span><span class="btn">产线及设备</span><span class="btn">配方</span><span
@@ -1391,6 +1392,10 @@
         </div>
     </div>
 </div>
+<div id="iframeWin">
+    <div class="title"><img src="image/title_icon.png" style="margin: 7px;float: left;"><span class="text">--</span><img src="image/Close.png" style="margin: 7px;float: right;cursor: pointer;" onclick="CloseWin()"></div>
+    <div class="content"><iframe src="" class=""></iframe></div>    
+</div>
 </body>
 <script type="text/html" id="maogodetail_tpl">
     {{each data}}
@@ -2503,12 +2508,18 @@
         $("#imp_btn").on('click', function (e) {
             e.stopPropagation();
             $('#imp_item').show();
-            $('#search_result').hide()
+            $('#search_result,#func_menulist').hide()
         })
         $("#search .search_btn").on('click', function (e) {
             e.stopPropagation();
             search();
         })
+        //分析功能
+        $("#func_menu_btn").on('click',function(e){
+            e.stopPropagation();
+            $("#func_menulist").show();
+            $('#search_result,#imp_item').hide()
+        });
         //导出数据项选择
         $("#imp_item>div").on('click', function (e) {
             $(this).parent().find(".active").removeClass("active");
@@ -2761,6 +2772,13 @@
                 })
             })
         })
+        //白柸布预测分析
+        $("#bpb_fx").on('click',function(e){
+            e.stopPropagation();
+            var ifm = $("#iframeWin").attr("class","newwin bpbWin").show();
+            ifm.find(".title .text").html('');
+            ifm.find("iframe").attr({"src":"bpb_fx.html"});
+        });
         //初始化小时选择项
         var hour1Opts = [];
         var hour2Opts = [];
@@ -2772,6 +2790,12 @@
         $("#hour1,#hourP1").html(hour1Opts.join(''))
         $("#hour2,#hourP2").html(hour2Opts.join(''))
     });
+    function clearEle(){
+        $('#imp_item,#func_menulist,#date_select,#day_select').hide();
+        $('#search_result').html('').hide();
+        $('#search input').val('');
+        $("#iframeWin").hide().find("iframe").attr("src","");
+    }
     function GetData() {
             $.getJSON(SERVER_URL + "/index", {}, function (res) {
                 setTimeout(function () {
@@ -3049,6 +3073,7 @@
     //3.[可选]监听连接失败消息
     player.on("Disconnected", (e) => {
         console.log("Disconnected from engine", e);
+        clearEle();
         playerConnState = false
         //4.[推荐]尝试重新连接
         reconntimer = setTimeout(function () {
@@ -3144,14 +3169,14 @@
              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当月入库:- 出库:-",
+                         "text": "原材料(KG)\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}"
+                         "userData":"ycl|原材料(KG)\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];
@@ -3163,14 +3188,14 @@
              //await player.Native.GisMarker.update(markPtr, options);
              //var imgid = await player.Native.GisMarker.loadImage("rgba:255,0,255,255");
              var options = {
-                         "text": "成品(KG)\r\r当日入库:- 出库:-\r当月入库:- 出库:-",
+                         "text": "成品()\r\r当日入库:- 出库:-\r当月入库:- 出库:-",
                          "visible": true,
                          //"maxLod": 130,
                          "minLod": 0,
                          "textFontSize":16,
                          "textColor": parseInt("0xffffffff"),
                          "contentPadding":[5,5,5,5],
-                         "userData":"cp|成品(KG)\r\r当日入库:{d-in} 出库:{d-out}\r当月入库:{m-in} 出库:{m-out}\r"
+                         "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;
@@ -3733,6 +3758,7 @@
         openState = false
         window.Device_Data = null;
         $("#newwin,#nodevice").hide();
+        $("iframe").attr("src","");
     }
 
     //显示设备基本信息