hyx 3 years ago
parent
commit
7ebaca73ed
1 changed files with 35 additions and 18 deletions
  1. 35 18
      nngkxxdp/src/main/resources/static/wzkp/wzkp.html

+ 35 - 18
nngkxxdp/src/main/resources/static/wzkp/wzkp.html

@@ -23,9 +23,9 @@
                     <ul class="layui-tab-title" style="border: none">
                         <!-- 月度:month;季度:quarter;半年:halfYear;年度:year; -->
                         <li class="layui-this">月度</li>
-                        <li>季度</li>
-                        <li>半年</li>
-                        <li>年度</li>
+                        <li data-childrenType="1">季度</li>
+                        <li data-childrenType="0">半年</li>
+                        <li data-childrenType="year">年度</li>
                     </ul>
                     <div class="choice_year">
                         <label class="layui-form-label">当前月份</label>
@@ -1180,7 +1180,8 @@
         loadTimeChoose(type);
         let yearMonth = getYearMonth();
         type = 0;
-        let childrenType = (new Date).getMonth() == 0 ? 12 : (new Date).getMonth();
+        let childrenType = '';
+        // let childrenType = (new Date).getMonth() == 0 ? 12 : (new Date).getMonth();
         let deptId = $("[name='department']").val();
         let hasDept = 1;
         let newMon = yearMonth;
@@ -1222,7 +1223,6 @@
             },
             type: "post",
             success: function (data) {
-                console.log(data.data)
                 let dataList = [];
                 let lastDataList = [];
                 for (let i = 0; i < data.data.deptids.length; i++) {
@@ -1303,9 +1303,13 @@
         element.on('tab(docDemoTabBrief)', function (data) {
             type = data.index;
             let childrenType = (new Date).getFullYear();
+            if ($(this).attr('data-childrenType') != 'year') {
+                childrenType = $(this).attr('data-childrenType');
+            }
             let deptId = $("[name='department']").val();
             let hasDept = 1;
-            let newMon = getYearMonth();
+            // let newMon = getYearMonth();
+            let newMon = '';
             if (type == 0) {
                 newMon = getYearMonth();
             } else if (type == 3) {
@@ -1386,19 +1390,19 @@
     function bestRanking(obj, type) {
         $("#bestRanking1" + type).parent().children("div").eq(0).children("p").text(obj[0].department.substring(1, 3));
         $("#bestRanking1" + type).children("h1").text(obj[0].department);
-        $("#bestRanking1" + type).children("p").children("span").text(obj[0].basicScore + obj[0].addScore);
+        $("#bestRanking1" + type).children("p").children("span").text((obj[0].basicScore + obj[0].addScore).toFixed(2));
         $("#bestRanking1" + type).children("div").children("p").eq(0).text(obj[0].basicScore);
         $("#bestRanking1" + type).children("div").children("p").eq(1).text(obj[0].addScore);
 
         $("#bestRanking2" + type).parent().children("div").eq(0).children("p").text(obj[1].department.substring(1, 3));
         $("#bestRanking2" + type).children("h1").text(obj[1].department);
-        $("#bestRanking2" + type).children("p").children("span").text(obj[1].basicScore + obj[1].addScore);
+        $("#bestRanking2" + type).children("p").children("span").text((obj[1].basicScore + obj[1].addScore).toFixed(2));
         $("#bestRanking2" + type).children("div").children("p").eq(0).text(obj[1].basicScore);
         $("#bestRanking2" + type).children("div").children("p").eq(1).text(obj[1].addScore);
 
         $("#bestRanking3" + type).parent().children("div").eq(0).children("p").text(obj[2].department.substring(1, 3));
         $("#bestRanking3" + type).children("h1").text(obj[2].department);
-        $("#bestRanking3" + type).children("p").children("span").text(obj[2].basicScore + obj[2].addScore);
+        $("#bestRanking3" + type).children("p").children("span").text((obj[2].basicScore + obj[2].addScore).toFixed(2));
         $("#bestRanking3" + type).children("div").children("p").eq(0).text(obj[2].basicScore);
         $("#bestRanking3" + type).children("div").children("p").eq(1).text(obj[2].addScore);
     }
@@ -1407,19 +1411,19 @@
     function lowestRanking(obj, type) {
         $("#lowestRanking1" + type).parent().children("div").eq(0).children("p").text(obj[0].department.substring(1, 3));
         $("#lowestRanking1" + type).children("h1").text(obj[0].department);
-        $("#lowestRanking1" + type).children("p").children("span").text(obj[0].basicScore + obj[0].addScore);
+        $("#lowestRanking1" + type).children("p").children("span").text((obj[0].basicScore + obj[0].addScore).toFixed(2));
         $("#lowestRanking1" + type).children("div").children("p").eq(0).text(obj[0].basicScore);
         $("#lowestRanking1" + type).children("div").children("p").eq(1).text(obj[0].addScore);
 
         $("#lowestRanking2" + type).parent().children("div").eq(0).children("p").text(obj[1].department.substring(1, 3));
         $("#lowestRanking2" + type).children("h1").text(obj[1].department);
-        $("#lowestRanking2" + type).children("p").children("span").text(obj[1].basicScore + obj[1].addScore);
+        $("#lowestRanking2" + type).children("p").children("span").text((obj[1].basicScore + obj[1].addScore).toFixed(2));
         $("#lowestRanking2" + type).children("div").children("p").eq(0).text(obj[1].basicScore);
         $("#lowestRanking2" + type).children("div").children("p").eq(1).text(obj[1].addScore);
 
         $("#lowestRanking3" + type).parent().children("div").eq(0).children("p").text(obj[2].department.substring(1, 3));
         $("#lowestRanking3" + type).children("h1").text(obj[2].department);
-        $("#lowestRanking3" + type).children("p").children("span").text(obj[2].basicScore + obj[2].addScore);
+        $("#lowestRanking3" + type).children("p").children("span").text((obj[2].basicScore + obj[2].addScore).toFixed(2));
         $("#lowestRanking3" + type).children("div").children("p").eq(0).text(obj[2].basicScore);
         $("#lowestRanking3" + type).children("div").children("p").eq(1).text(obj[2].addScore);
     }
@@ -1428,19 +1432,19 @@
     function greatestProgress(obj, type) {
         $("#greatestProgress1" + type).parent().children("div").eq(0).children("p").text(obj[0].department.substring(1, 3));
         $("#greatestProgress1" + type).children("h1").text(obj[0].department);
-        $("#greatestProgress1" + type).children("p").children("span").text(obj[0].basicScore + obj[0].addScore);
+        $("#greatestProgress1" + type).children("p").children("span").text((obj[0].basicScore + obj[0].addScore).toFixed(2));
         $("#greatestProgress1" + type).children("div").children("p").eq(0).text(obj[0].basicScore);
         $("#greatestProgress1" + type).children("div").children("p").eq(1).text(obj[0].addScore);
 
         $("#greatestProgress2" + type).parent().children("div").eq(0).children("p").text(obj[1].department.substring(1, 3));
         $("#greatestProgress2" + type).children("h1").text(obj[1].department);
-        $("#greatestProgress2" + type).children("p").children("span").text(obj[1].basicScore + obj[1].addScore);
+        $("#greatestProgress2" + type).children("p").children("span").text((obj[1].basicScore + obj[1].addScore).toFixed(2));
         $("#greatestProgress2" + type).children("div").children("p").eq(0).text(obj[1].basicScore);
         $("#greatestProgress2" + type).children("div").children("p").eq(1).text(obj[1].addScore);
 
         $("#greatestProgress3" + type).parent().children("div").eq(0).children("p").text(obj[2].department.substring(1, 3));
         $("#greatestProgress3" + type).children("h1").text(obj[2].department);
-        $("#greatestProgress3" + type).children("p").children("span").text(obj[2].basicScore + obj[2].addScore);
+        $("#greatestProgress3" + type).children("p").children("span").text((obj[2].basicScore + obj[2].addScore).toFixed(2));
         $("#greatestProgress3" + type).children("div").children("p").eq(0).text(obj[2].basicScore);
         $("#greatestProgress3" + type).children("div").children("p").eq(1).text(obj[2].addScore);
     }
@@ -1449,19 +1453,19 @@
     function regressiveMaximum(obj, type) {
         $("#regressiveMaximum1" + type).parent().children("div").eq(0).children("p").text(obj[0].department.substring(1, 3));
         $("#regressiveMaximum1" + type).children("h1").text(obj[0].department);
-        $("#regressiveMaximum1" + type).children("p").children("span").text(obj[0].basicScore + obj[0].addScore);
+        $("#regressiveMaximum1" + type).children("p").children("span").text((obj[0].basicScore + obj[0].addScore).toFixed(2));
         $("#regressiveMaximum1" + type).children("div").children("p").eq(0).text(obj[0].basicScore);
         $("#regressiveMaximum1" + type).children("div").children("p").eq(1).text(obj[0].addScore);
 
         $("#regressiveMaximum2" + type).parent().children("div").eq(0).children("p").text(obj[1].department.substring(1, 3));
         $("#regressiveMaximum2" + type).children("h1").text(obj[1].department);
-        $("#regressiveMaximum2" + type).children("p").children("span").text(obj[1].basicScore + obj[1].addScore);
+        $("#regressiveMaximum2" + type).children("p").children("span").text((obj[1].basicScore + obj[1].addScore).toFixed(2));
         $("#regressiveMaximum2" + type).children("div").children("p").eq(0).text(obj[1].basicScore);
         $("#regressiveMaximum2" + type).children("div").children("p").eq(1).text(obj[1].addScore);
 
         $("#regressiveMaximum3" + type).parent().children("div").eq(0).children("p").text(obj[2].department.substring(1, 3));
         $("#regressiveMaximum3" + type).children("h1").text(obj[2].department);
-        $("#regressiveMaximum3" + type).children("p").children("span").text(obj[2].basicScore + obj[2].addScore);
+        $("#regressiveMaximum3" + type).children("p").children("span").text((obj[2].basicScore + obj[2].addScore).toFixed(2));
         $("#regressiveMaximum3" + type).children("div").children("p").eq(0).text(obj[2].basicScore);
         $("#regressiveMaximum3" + type).children("div").children("p").eq(1).text(obj[2].addScore);
     }
@@ -1609,6 +1613,19 @@
         rankingScore(obj, type)
     }
 
+    /**
+     * 渲染规则事件列表
+     * @param eventList
+     */
+    function renderEventList(eventList) {
+        if (eventList || eventList.length == 0) {
+
+        }
+        for (var i = 0; i < eventList.length; i++) {
+
+        }
+    }
+
     function rankingScore(pid, type) {
         for (let i = 0; i < newDataList.length; i++) {
             if (newDataList[i].deptid == pid) {