浏览代码

日期代入

luolei 5 年之前
父节点
当前提交
a2da0c88ec
共有 3 个文件被更改,包括 29 次插入24 次删除
  1. 17 15
      src/js/console.js
  2. 10 9
      src/js/deptConsole.js
  3. 2 0
      src/js/index.js

+ 17 - 15
src/js/console.js

@@ -113,10 +113,9 @@ $(function(){
     $(".part02").on("mouseleave",".bingli li.sec",function(){
       $(this).find(".explainNum").css("color","#A5ADBF")
     })
-    getDetails()
     getEveryDeptLevel()
 })
-function getDetails(){
+function getDetails(dateType){
     $(".pubEchartB.paymoney .title").click(function(){
       focusMenuItem("YH-ZKK-GKSQXZB_XQ");
       $(parent.document).find("#contentIframe").attr("src","./deptScoreDetailControl.html?from=1&dateType="+dateType+"&deptType="+deptType+"&startDateParam="+behosDateStart+"&endDateParam="+behosDateEnd)
@@ -166,6 +165,17 @@ function getDetails(){
         focusMenuItem("YH-ZKK-TMQXZB_XQ");
         $(parent.document).find("#contentIframe").attr("src","./singleVeto.html?from=1&special=1&shijian="+dateType+"&startDateParam="+behosDateStart+"&endDateParam="+behosDateEnd)
     })
+    $("body").on("click",".homegodetail",function(){
+        let name = $(this).attr("data-name")
+        focusMenuItem("YH-ZKK-TMQXZB_XQ");
+        $(parent.document).find("#contentIframe").attr("src","./singleVeto.html?from=1&special=1&shijian="+dateType+"&model="+name+"&startDateParam="+behosDateStart+"&endDateParam="+behosDateEnd)
+    })
+    $("body").on("click",".explainPanT .explainLi",function(){
+        let deptName = $(this).attr("data-dept")
+        let deptId = $(this).attr("dept-id")
+        focusMenuItem("YH-ZKK-TMQXZB_XQ");
+        $(parent.document).find("#contentIframe").attr("src","singleVeto.html?from=1&shijian="+dateType+"&qxName="+deptName+"&startDateParam="+behosDateStart+"&endDateParam="+behosDateEnd)
+    })
 }
 
 //判断有无某一权限
@@ -1638,11 +1648,6 @@ function queList(data){
         `
     }
     $(".qtable").html(tmp+strAll)
-    $(".homegodetail").click(function(){
-        let name = $(this).attr("data-name")
-        focusMenuItem("YH-ZKK-TMQXZB_XQ");
-        $(parent.document).find("#contentIframe").attr("src","./singleVeto.html?from=1&special=1&shijian="+dateType+"&model="+name+"&startDateParam="+behosDateStart+"&endDateParam="+behosDateEnd)
-    })
 }
 //饼图列表注释渲染
 function panDetail(data){
@@ -1660,12 +1665,6 @@ function panDetail(data){
         `
     }
     $(".explainPanT table").html(strAll);
-    $(".explainPanT .explainLi").click(function(){
-        let deptName = $(this).attr("data-dept")
-        let deptId = $(this).attr("dept-id")
-        focusMenuItem("YH-ZKK-TMQXZB_XQ");
-        $(parent.document).find("#contentIframe").attr("src","singleVeto.html?from=1&shijian="+dateType+"&qxName="+deptName+"&startDateParam="+behosDateStart+"&endDateParam="+behosDateEnd)
-    })
 }
 function panDetailB(data){
     let color = ['#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336','#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336'];
@@ -1730,9 +1729,11 @@ function dateConsole(dateType,flg){
     } else {
         startDate = "-6d"
     }
+    getBarData(dateType)
     if(getCookie("behosDateStart")&&!flg){
         startDate = new Date(getCookie("behosDateStart"))
         endDate = new Date(getCookie("behosDateEnd"))
+        dateType = 3
         $(".monthYear .year").css({
             "border-color":'#A5ADBF',
             color:'#A5ADBF',
@@ -1744,6 +1745,8 @@ function dateConsole(dateType,flg){
             backgroundColor:'#203463'
         })
     }
+    
+    getDetails(dateType)
     $( "#datepicker" ).datepicker({
         yearRange: "2015:"+year,
         changeMonth: true,
@@ -1758,7 +1761,6 @@ function dateConsole(dateType,flg){
     }).datepicker( "setDate",endDate);
     getStaticDate(flg)
     getAverageScoreLis()
-    getBarData(dateType)
     getHomeData('firstLevelPercent')
     getEveryDeptLevel()
 }
@@ -1779,7 +1781,7 @@ function getStaticDate(flg){
         setCookieAction(behosDateStart,behosDateEnd)
     }
     if(behosDateStart){
-        behosDateStart = behosDateStart.replace(/\//g,'-') + ' 00:00:00'
+        behosDateStart = behosDateStart.replace(/\//g,'-') + ' 00:00:000'
     }
     if(behosDateEnd){
         behosDateEnd = behosDateEnd.replace(/\//g,'-') + ' 23:59:59'

+ 10 - 9
src/js/deptConsole.js

@@ -47,9 +47,8 @@ $(function(){
       $(".part02").on("mouseleave",".bingli li.sec",function(){
         $(this).find(".explainNum").css("color","#A5ADBF")
       })
-    tiaomu()
 })
-function tiaomu(){
+function tiaomu(dateType){
     $(".defect .partTitlePub").click(function(){
         focusMenuItem("YH-KSZR-GMKQXZB_XQ");
         $(parent.document).find("#contentIframe").attr("src","mukuai.html?from=2&deptName="+curDept+"&dateType="+dateType+"&startDateParam="+behosDateStart+"&endDateParam="+behosDateEnd)
@@ -72,6 +71,11 @@ function tiaomu(){
         let chengdu = dataC == 1?'甲':dataC==2?'乙':'丙'
         $(parent.document).find("#contentIframe").attr("src","./qcListDept.html?from=1&dateType="+dateType+"&chengdu="+chengdu+"&deptName="+curDept+"&deptId="+curDeptId+"&startDateParam="+behosDateStart+"&endDateParam="+behosDateEnd)
     });
+    $("body").on("click",".homegodetail",function(){
+        let name = $(this).attr("data-name")
+        focusMenuItem("YH-KSZR-TMQXZB_XQ");
+        $(parent.document).find("#contentIframe").attr("src","./singleVeto.html?from=2&special=1&shijian="+dateType+"&model="+name+"&startDateParam="+behosDateStart+"&endDateParam="+behosDateEnd)
+    })
 }
 //判断有无某一权限
 function hasData(data){
@@ -757,11 +761,6 @@ function queList(data){
         `
     }
     $(".qtable").html(tmp+strAll)
-    $(".homegodetail").click(function(){
-        let name = $(this).attr("data-name")
-        focusMenuItem("YH-KSZR-TMQXZB_XQ");
-        $(parent.document).find("#contentIframe").attr("src","./singleVeto.html?from=2&special=1&shijian="+dateType+"&model="+name+"&startDateParam="+behosDateStart+"&endDateParam="+behosDateEnd)
-    })
 }
 //饼图列表注释渲染
 function panDetailB(data){
@@ -823,7 +822,6 @@ $(".sureDate").click(function(){
     if(!getStaticDate()){
         return
     }
-    
     setCookieAction(behosDateStart.split(" ")[0],behosDateEnd.split(" ")[0])
     getBarData(dateType)
     dateType = 3
@@ -851,6 +849,7 @@ function dateConsole(dateType,flg){
         startDate = "-1m"
     }
     if(getCookie("behosDateStart")&&!flg){
+        dateType = 3
         startDate = new Date(getCookie("behosDateStart"))
         endDate = new Date(getCookie("behosDateEnd"))
         $(".monthYear .year").css({
@@ -863,6 +862,8 @@ function dateConsole(dateType,flg){
             color:'#A5ADBF',
             backgroundColor:'#203463'
         })
+    }else{
+        getBarData(dateType)
     }
     $( "#datepicker" ).datepicker({
         yearRange: "2015:"+year,
@@ -877,7 +878,7 @@ function dateConsole(dateType,flg){
         dateFormat:"yy/mm/dd"
     }).datepicker( "setDate",endDate);
     getStaticDate(flg)
-    getBarData(dateType)
+    tiaomu(dateType)
 }
 function setCookieAction(startDate,endDate){
     setCookie('behosDateStart',startDate)

+ 2 - 0
src/js/index.js

@@ -249,6 +249,8 @@ $("#changeWord").click(function(e){
 //推出登录
 $(".login-out").click(function(){
   delCookie('accessToken')
+  setCookie('behosDateStart','')
+  setCookie('behosDateEnd','')
 })
 
 //时间获取