| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>耀荣康健</title>
- <link rel="stylesheet" type="text/css" href="/analysis/css/styles.css">
- <link rel="stylesheet" type="text/css" href="/analysis/js/layui/css/layui.css">
- <script src="/analysis/js/jquery-3.2.1.min.js"></script>
- <script src="/analysis/js/layer.js"></script>
- <script src="/analysis/js/timeUtils.js"></script>
- <script src="/analysis/js/chart.js"></script>
- <script src="/analysis/js/laydate.js"></script>
- <script src="/analysis/js/layui/layui.js"></script>
- <style>
- /*body{ font-size: 24px}*/
- </style>
- </head>
- <body>
- <div style="margin: 0 auto; height: 100%; width: 100%; text-align: center">
- <div style="display: flex; width: 100%; height: 112px; align-items: center; justify-content: center;background-color: #0044CB; color:#ffffff">
- <div style="width: 60%; display: flex; height: 100%; align-items: center">
- <a href="/analysis/index.html">
- <div style="width:50%; float: left; text-align: left"><img src="/analysis/img/LOGO.png"></div>
- </a>
- <div style="width:50%;float: right; text-align: right">
- <!-- <a href="/index.html" style="text-decoration: none; color: #ffffff; font-size: 24px"><span>主页</span></a>-->
- <!-- <span> </span>-->
- <!-- <a href="/analysis.html" style="text-decoration: none; color: #ffffff; font-size: 24px"> <span>认知测试</span></a>-->
- </div>
- </div>
- </div>
- <div style="width: 100%; height: 680px; display: flex; justify-content: center; flex-direction: column">
- <div style="width: 100%;display: flex; justify-content: center; align-items: center">
- <div id="dateRange">
- <input type="text" id="sdate" style="width: 200px; height: 20px; color: #666666">
-
- <input type="text" id="edate" style="width: 200px; height: 20px; color: #666666">
-
- </div>
- <!-- <button style="color:white;width:70px;height:30px;background-color: #3155C5; border: 0"-->
- <!-- onclick="javascript:search()">查询-->
- <!-- </button>-->
- <a href="javascript:search(null)" style="color:white;width:70px;height:30px;line-height: 30px;
- background-image: url('/analysis/img/btnBg.png'); background-repeat: no-repeat;background-size: cover;background-position: center;background-size: 100% 100%;
- ">查询</a>
- </div>
- <div> </div>
- <div style="width: 100%;display: flex; justify-content: center; align-items: center">
- <div style="display:flex;flex-direction: column; justify-content: center; align-items: center; width: 50%;
- background-image: url('/analysis/img/tableBg.png'); background-repeat: no-repeat;background-size: cover;background-position: center;background-size: 100% 100%;
- ">
- <div> </div>
- <div> </div>
- <table id="dg" style="width: 80%; " border="0" cellpadding="20"
- cellspacing="0">
- <thead style="background-color: #3155C5; height: 50px; color: white; font-weight: bold;">
- <td width="300px">测试日期</td>
- <td width="300px" align="center">百分比正确率</td>
- <td width="300px">正确数量</td>
- <td width="300px">错误数量</td>
- <td width="300px">超时数量</td>
- <td width="300px">结果</td>
- </thead>
- <tbody>
- <!-- <td>aaa</td>-->
- <!-- <td>aaa</td>-->
- <!-- <td style="width: 100px; height: 100px; background-image: url('/img/greenCircle.png');background-repeat: no-repeat;background-size: cover;background-position: center;background-size: 100% 100%;"><span>ddd</span></td>-->
- <!-- <td>aaa</td>-->
- </tbody>
- </table>
- </div>
- </div>
- <div></div>
- </div>
- <div style="width:100%; height:50px; ">
- <div id="test1"></div>
- </div>
- <div style="font-size:14px; height: 98px; color: #999999; display: flex;
- align-items: center; justify-content: center; background: url(/analysis/img/d97f28a59f20114dad3adbeb0dab456f.png) 100% no-repeat;">
- 地址: 北京市朝阳区东四环中路41号嘉泰国际A座16层1619室 联系电话:400-086-1638<br/>
- 湘ICP备2024059687号-3
- </div>
- </div>
- <script>
- function search() {
- currPage = 1
- // getReport(null)
- // alert("aa")
- checkLogin()
- }
- function setPage(count) {
- // alert(count+" ")
- layui.use('laypage', function () {
- var laypage = layui.laypage;
- //执行一个laypage实例
- laypage.render({
- elem: 'test1', //注意,这里的 test1 是 ID,不用加 # 号
- count: count, //数据总数,从服务端得到
- curr: currPage,
- limit: pageLimit,
- jump: function (obj, first) {
- //obj包含了当前分页的所有参数,比如:
- // console.log(obj.curr); //得到当前页,以便向服务端请求对应页的数据。
- // console.log(obj.limit); //得到每页显示的条数
- //首次不执行
- if (!first) {
- // alert(obj.curr+" "+obj.limit)
- currPage = obj.curr
- getReport(null)
- }
- }
- });
- });
- }
- function checkLogin() {
- // alert("aa")
- $.ajax({
- url: '/analysis/login/checkLogin',
- type: 'POST',
- dataType: 'json',
- success: function (res) {
- // console.log('成功:', res.code);
- if (res.code == 0) {
- // showReport(res.data)
- // phone = res.data.phone
- getReport(res.data.phone)
- } else {
- isLogin = false
- LAYER_ID = layer.open({
- // icon: 2,
- type: 2,
- title: ["请先登录", "font-size:18px"],
- // title: false,
- content: '/analysis/login.html',
- scrollbar: false,
- area: ['800px', '500px'],
- // offset:'100px',
- anim: 0,
- closeBtn: 0
- });
- }
- },
- error: function (xhr, status, error) {
- console.error('错误:', error);
- layer.alert("服务器繁忙,请稍后重试!", {icon: 2});
- }
- });
- }
- function afterLogin(data) {
- getReport(data.phone)
- }
- var currPage = 1
- var pageLimit = 5
- function getReport(phone) {
- // alert(pageLimit)
- const param = {
- "phone": phone,
- "sdate": $("#sdate").val(),
- "edate": $("#edate").val(),
- "currPage": currPage,
- "pageLimit": pageLimit
- }
- $.ajax({
- url: '/analysis/detect/report',
- type: 'POST',
- dataType: 'json',
- contentType: "application/json",
- data: JSON.stringify(param),
- success: function (res) {
- if (res.code == 0) {
- // alert(res.count)
- var htmlStr = ""
- for (let i = 0; i < res.data.length; i++) {
- // alert(res.data[i].create_time)
- const tt = new Date(res.data[i].create_time)
- htmlStr += "<tr style='height: 100px'>"
- htmlStr += "<td>" + tt.format("MM月dd日 hh时mm分") + "</td>"
- if (res.data[i].score > 70) {
- htmlStr += "<td style=\"width: 70px; height: 70px; background-image: url('/analysis/img/circleGreen100.png');background-repeat: no-repeat;background-position: center;background-size: 30%;\">"
- + res.data[i].score + "</td>"
- } else if (res.data[i].score < 30) {
- htmlStr += "<td style=\"width: 70px; height: 70px; background-image: url('/analysis/img/circleRed100.png');background-repeat: no-repeat;background-position: center;background-size: 30%;\">"
- + res.data[i].score + "</td>"
- } else {
- htmlStr += "<td style=\"width: 70px; height: 70px; background-image: url('/analysis/img/circleYellow100.png');background-repeat: no-repeat;background-position: center;background-size: 30%;\">"
- + res.data[i].score + "</td>"
- }
- htmlStr += "<td>" + res.data[i].total_right + "</td>"
- htmlStr += "<td>" + res.data[i].total_wrong + "</td>"
- htmlStr += "<td>" + res.data[i].total_timeout + "</td>"
- if (res.data[i].score <= 30) {
- htmlStr += "<td><img src='/analysis/img/iconWrong.png' style='width: 30px'></td>"
- } else {
- htmlStr += "<td><img src='/analysis/img/iconRight.png' style='width: 30px'></td>"
- }
- htmlStr += "<td></td>"
- htmlStr += "</tr>"
- }
- $("#dg tbody").html(htmlStr)
- setPage(res.count)
- } else {
- layer.alert(res.message, {icon: 2})
- }
- },
- error: function (xhr, status, error) {
- console.error('错误:', error);
- layer.alert("服务器繁忙,请稍后重试!", {icon: 2});
- }
- });
- }
- $(function () {
- laydate.render({
- elem: '#dateRange',
- type: 'date',
- range: ['#sdate', '#edate']
- })
- const sdate = new Date()
- sdate.setDate(sdate.getDate() - 30)
- // alert(sdate.format("yyyy-MM-dd"))
- $("#sdate").val(sdate.format("yyyy-MM-dd"))
- $("#edate").val(new Date().format("yyyy-MM-dd"))
- checkLogin()
- })
- </script>
- </body>
- </html>
|