From f215a22829d7301535af73e02f91a9ad718e1b22 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期二, 17 十一月 2020 14:28:03 +0800 Subject: [PATCH] # --- src/main/webapp/views/monitor/js/monitor.js | 18 ++++++++++++++++++ src/main/java/com/zy/asrs/controller/MonitorController.java | 6 ++++-- src/main/webapp/views/monitor/monitor.html | 10 ++-------- src/main/webapp/static/js/common.js | 12 ++++++++++++ 4 files changed, 36 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/zy/asrs/controller/MonitorController.java b/src/main/java/com/zy/asrs/controller/MonitorController.java index 60dfb34..ac67824 100644 --- a/src/main/java/com/zy/asrs/controller/MonitorController.java +++ b/src/main/java/com/zy/asrs/controller/MonitorController.java @@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.*; @@ -48,12 +49,13 @@ * 鑾峰彇鍏朵粬淇℃伅 */ @GetMapping("/other") - public R monitorOther() { + public R monitorOther(@RequestParam("crnId") Integer crnId) { + return R.ok( // Cools.add("year", calendar.get(Calendar.YEAR)) - ); + ).add(crnId); } /** diff --git a/src/main/webapp/static/js/common.js b/src/main/webapp/static/js/common.js index 53a1d93..a2f6af8 100644 --- a/src/main/webapp/static/js/common.js +++ b/src/main/webapp/static/js/common.js @@ -157,3 +157,15 @@ return http }) : "object" == typeof module && module.exports ? module.exports = http : n.http = http }(this); + +/** + * 鑾峰彇url閿�煎 + */ +function getUrlVal(key) { + var reg = new RegExp('(^|&)' + key + '=([^&]*)(&|$)', 'i'); + var r = window.location.search.substr(1).match(reg); + if (r != null) { + return unescape(r[2]); + } + return null; +} \ No newline at end of file diff --git a/src/main/webapp/views/monitor/js/monitor.js b/src/main/webapp/views/monitor/js/monitor.js index 8889133..d1f7de9 100644 --- a/src/main/webapp/views/monitor/js/monitor.js +++ b/src/main/webapp/views/monitor/js/monitor.js @@ -7,6 +7,7 @@ var week = '鏄熸湡涓�'; setInterval(function () { + getOther(); setDate(); initlinChart(); initPieChart(); @@ -45,3 +46,20 @@ } +/** + * 鑾峰彇鍏朵粬鏁版嵁 + */ +function getOther() { + http.get(baseUrl+"/monitor/other", {crnId: getUrlVal("crnId")}, function (res) { + if (res.code === 200){ + + console.log(res); + } else if (res.code === 403){ + parent.location.href = baseUrl+"/login"; + } else { + layer.msg("杩炴帴鏈嶅姟鍣ㄥけ璐�", {icon: 2}); + } + }) + +} + diff --git a/src/main/webapp/views/monitor/monitor.html b/src/main/webapp/views/monitor/monitor.html index a496341..987c282 100644 --- a/src/main/webapp/views/monitor/monitor.html +++ b/src/main/webapp/views/monitor/monitor.html @@ -358,15 +358,9 @@ //,anim: 'updown' //鍒囨崲鍔ㄧ敾鏂瑰紡 }); }); - $('.counter').countUp(); - // 閬僵 - let closeBtn = document.getElementById('closeBtn'); - let detailModal = document.getElementById('detail-modal'); - closeBtn.onclick = function () { - detailModal.style.display = 'none'; - }; - var data = []; + // 璁℃暟鍔ㄧ敾 + $('.counter').countUp(); /***********************************************************************************/ /************************************* 鎶樼嚎鍥� ***************************************/ -- Gitblit v1.9.1