给首页增加统计折线图的功能

This commit is contained in:
季圣华
2019-10-24 22:16:22 +08:00
parent 028b87a701
commit 7ea85d4f6e
10 changed files with 729 additions and 377 deletions

View File

@@ -3,61 +3,61 @@
* @author jishenghua
*/
$(function () {
unreadMsg()
// unreadMsg()
});
function unreadMsg() {
$.get(ctx + "/msg/unreadMsg?__notUpdateSession=true&__t=" + new Date().getTime(), function (d) {
var b = $("#msgList").empty();
var a = d.count || 0, c = d.list || [];
for (i = 0; i < c.length; i++) {
b.append(js.template("msgListTpl", c[i]))
}
$("#msgNum, #msgNum2").text(a);
$(".timeago").timeago();
pullPoolMsg();
if (window.ppmInt) {
clearInterval(window.ppmInt)
}
window.ppmInt = setInterval(pullPoolMsg, 60 * 1000)
})
}
function pullPoolMsg() {
var a = $("#msgList");
var b = a.attr("data-mergeMsgLimit");
$.get(ctx + "/msg/pullPoolMsg?__notUpdateSession=true&__t=" + new Date().getTime(), function (e) {
for (i = 0; i < e.length; i++) {
if (!(e.length > b)) {
var g = js.template("msgTipTpl", e[i]);
js.showMessage(g, e[i].msgContentEntity.title, "info", 1000 * 60);
doFlashTitle()
}
if (e[i].id && e[i].id != "") {
a.prepend(js.template("msgListTpl", e[i]))
}
}
if (e.length > b) {
var f = {
msgContentEntity: {
title: a.attr("data-mergeMsgTitle"),
content: js.text(a.attr("data-mergeMsgContent"), e.length)
}, sendDate: "", sendUserName: "", id: ""
};
var g = js.template("msgTipTpl", f);
js.showMessage(g, null, "info", 1000 * 60);
doFlashTitle()
}
var c = parseInt($("#msgNum").text());
if (!isNaN(c)) {
c += e.length || 0
} else {
c = a.find("li").length
}
$("#msgNum, #msgNum2").text(c);
$(".timeago").timeago()
})
}
// function unreadMsg() {
// $.get(ctx + "/msg/unreadMsg?__notUpdateSession=true&__t=" + new Date().getTime(), function (d) {
// var b = $("#msgList").empty();
// var a = d.count || 0, c = d.list || [];
// for (i = 0; i < c.length; i++) {
// b.append(js.template("msgListTpl", c[i]))
// }
// $("#msgNum, #msgNum2").text(a);
// $(".timeago").timeago();
// pullPoolMsg();
// if (window.ppmInt) {
// clearInterval(window.ppmInt)
// }
// window.ppmInt = setInterval(pullPoolMsg, 60 * 1000)
// })
// }
//
// function pullPoolMsg() {
// var a = $("#msgList");
// var b = a.attr("data-mergeMsgLimit");
// $.get(ctx + "/msg/pullPoolMsg?__notUpdateSession=true&__t=" + new Date().getTime(), function (e) {
// for (i = 0; i < e.length; i++) {
// if (!(e.length > b)) {
// var g = js.template("msgTipTpl", e[i]);
// js.showMessage(g, e[i].msgContentEntity.title, "info", 1000 * 60);
// doFlashTitle()
// }
// if (e[i].id && e[i].id != "") {
// a.prepend(js.template("msgListTpl", e[i]))
// }
// }
// if (e.length > b) {
// var f = {
// msgContentEntity: {
// title: a.attr("data-mergeMsgTitle"),
// content: js.text(a.attr("data-mergeMsgContent"), e.length)
// }, sendDate: "", sendUserName: "", id: ""
// };
// var g = js.template("msgTipTpl", f);
// js.showMessage(g, null, "info", 1000 * 60);
// doFlashTitle()
// }
// var c = parseInt($("#msgNum").text());
// if (!isNaN(c)) {
// c += e.length || 0
// } else {
// c = a.find("li").length
// }
// $("#msgNum, #msgNum2").text(c);
// $(".timeago").timeago()
// })
// }
function readMsg(c, d, e) {
var a = $(c).data("href");