

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>教育局主页</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
  <script type="text/javascript" src="/lib/layui/layui.all.js"></script>
  <script type="text/javascript" src="/js/common.js"></script>
  <link href="/css/main.css" rel="stylesheet">
</head>
<body>

  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md8">
        <div class="layui-row layui-col-space15">
          <div class="layui-col-md6">
            <div class="layui-card">
              <div class="layui-card-header">快捷方式</div>
              <div class="layui-card-body">

                <div class="layui-carousel layadmin-carousel layadmin-shortcut">
                  <div carousel-item>
                    <ul class="layui-row layui-col-space10">
                      <li class="layui-col-xs3">
                        <a lay-href="/page/libQuery">
                          <i class="layui-icon layui-icon-console"></i>
                          <cite>馆藏查询</cite>
                        </a>
                      </li>
                      <li class="layui-col-xs3">
                        <a lay-href="/page/readerQueryState">
                          <i class="layui-icon layui-icon-chart"></i>
                          <cite>读者查询</cite>
                        </a>
                      </li>
                      <li class="layui-col-xs3">
                        <a lay-href="/page/libNumberStats">
                          <i class="layui-icon layui-icon-template-1"></i>
                          <cite>藏书分布</cite>
                        </a>
                      </li>
                      <li class="layui-col-xs3">
                        <a lay-href="/page/libSortSortState" layadmin-event="im">
                          <i class="layui-icon layui-icon-chat"></i>
                          <cite>藏书分类</cite>
                        </a>
                      </li>
                      <li class="layui-col-xs3">
                        <a lay-href="/page/addStatsState">
                          <i class="layui-icon layui-icon-find-fill"></i>
                          <cite>生均及增量</cite>
                        </a>
                      </li>
                      <li class="layui-col-xs3">
                        <a lay-href="/page/standardreport">
                          <i class="layui-icon layui-icon-survey"></i>
                          <cite>达标测算</cite>
                        </a>
                      </li>
                      <li class="layui-col-xs3">
                        <a lay-href="/page/schoolRegister">
                          <i class="layui-icon layui-icon-user"></i>
                          <cite>单位注册</cite>
                        </a>
                      </li>
                      <li class="layui-col-xs3">
                        <a lay-href="/page/thisUnit">
                          <i class="layui-icon layui-icon-set"></i>
                          <cite>基本信息</cite>
                        </a>
                      </li>
                    </ul>
                  </div>
                </div>

              </div>
            </div>
          </div>
          <div class="layui-col-md6">
            <div class="layui-card">
              <div class="layui-card-header">汇总统计</div>
              <div class="layui-card-body">

                <div class="layui-carousel layadmin-carousel layadmin-backlog">
                  <div carousel-item>
                    <ul class="layui-row layui-col-space10">
                      <li class="layui-col-xs6">
                        <a lay-href="/page/schoolRegister" class="layadmin-backlog-body">
                          <h3>学校数</h3>
                          <p><cite id="xxs">0</cite></p>
                        </a>
                      </li>
                      <li class="layui-col-xs6">
                        <a lay-href="/page/schoolRegister" class="layadmin-backlog-body">
                          <h3>学生数</h3>
                          <p><cite id="xss">0</cite></p>
                        </a>
                      </li>
                      <li class="layui-col-xs6">
                        <a lay-href="/page/readerQueryState" class="layadmin-backlog-body">
                          <h3>读者数</h3>
                          <p><cite id="dzs">0</cite></p>
                        </a>
                      </li>
                      <li class="layui-col-xs6">
                        <a class="layadmin-backlog-body" style="text-decoration:none;">
                          <h3>图书管理员数</h3>
                          <p><cite id="tsglys">0</cite></p>
                        </a>
                      </li>
                    </ul>

                    <ul class="layui-row layui-col-space10">
                      <li class="layui-col-xs6">
                        <a class="layadmin-backlog-body" style="text-decoration:none;">
                          <h3>图书种数</h3>
                          <p><cite id="tszs">0</cite></p>
                        </a>
                      </li>
                      <li class="layui-col-xs6">
                        <a lay-href="/page/libNumberStats" class="layadmin-backlog-body">
                          <h3>图书总册数</h3>
                          <p><cite id="tszcs">0</cite></p>
                        </a>
                      </li>
                      <li class="layui-col-xs6">
                        <a class="layadmin-backlog-body" style="text-decoration:none;">
                          <h3>图书生均册数</h3>
                          <p><cite id="tssjcs">0</cite></p>
                        </a>
                      </li>
                      <li class="layui-col-xs6">
                        <a lay-href="/page/standardreport" class="layadmin-backlog-body">
                          <h3>缺书册数</h3>
                          <p><cite id="qscs">0</cite></p>
                        </a>
                      </li>
                    </ul>
                    <ul class="layui-row layui-col-space10">
                      <li class="layui-col-xs6">
                        <a class="layadmin-backlog-body" style="text-decoration:none;">
                          <h3>平均复本</h3>
                          <p><cite id="pjfb">0</cite></p>
                        </a>
                      </li>
                      <li class="layui-col-xs6">
                        <a class="layadmin-backlog-body" style="text-decoration:none;">
                          <h3>期刊种数</h3>
                          <p><cite id="qkzs">0</cite></p>
                        </a>
                      </li>
                    </ul>
                  </div>
                </div>
              </div>
            </div>
          </div>


          <div class="layui-col-md12">
            <div class="layui-card">
              <div class="layui-card-header">数据概览</div>
              <div class="layui-card-body">
                <div class="layui-carousel layadmin-carousel layadmin-dataview" data-anim="fade" lay-filter="LAY-index-dataview">
                  <div carousel-item id="LAY-index-dataview">
                    <div id="chart1"><i class="layui-icon layui-icon-loading1 layadmin-loading"></i></div>
                    <div>
                      <form class="layui-form" id="jieyuefrom"  lay-filter="jieyuefrom" >
                        机构&nbsp;&nbsp;<div  style="display: inline-block;" id="linkDiv"></div>
                        <div class="layui-input-inline">
                          <label class="layui-input-inline" >时间</label>
                          <div class="layui-input-inline">
                            <input type="text" name="begindate"  id="begindate" lay-verify="required|date"  placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
                          </div>
                          <label class="layui-input-inline" >至</label>
                          <div class="layui-input-inline">
                            <input type="text" name="enddate"  id="enddate" lay-verify="required|date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
                          </div>
                          <button class="layui-btn layui-btn-sm" lay-submit lay-filter="searchBtn">查询</button>
                        </div>
                      </form>
                      <div id="chart2" style="width: 100%;height: 95%"></div>
                    </div>
                  </div>
                </div>

              </div>
            </div>
            <div class="layui-card">
              <div class="layui-tab layui-tab-brief layadmin-latestData">
                <ul class="layui-tab-title">
                  <li class="layui-this">通知公告</li>
                </ul>
                <div class="layui-tab-content">
                  <div class="layui-tab-item layui-show">
                    <table id="dataTable"></table>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>

      <div class="layui-col-md4">
        <div class="layui-card">
          <div class="layui-card-header">今日简报</div>
          <div class="layui-card-body">

            <div class="layui-carousel layadmin-carousel layadmin-backlog">
              <div carousel-item>
                <ul class="layui-row layui-col-space10">
                  <li class="layui-col-xs6">
                    <a lay-href="/page/libFlowStats" class="layadmin-backlog-body">
                      <h3>借书数量</h3>
                      <p><cite id="jssl">0</cite></p>
                    </a>
                  </li>
                  <li class="layui-col-xs6">
                    <a lay-href="/page/libFlowStats" class="layadmin-backlog-body">
                      <h3>还书数量</h3>
                      <p><cite id="hssl">0</cite></p>
                    </a>
                  </li>
                  <li class="layui-col-xs6">
                    <a lay-href="/page/libChange" class="layadmin-backlog-body">
                      <h3>新增图书</h3>
                      <p><cite id="xzsl">0</cite></p>
                    </a>
                  </li>
                  <li class="layui-col-xs6">
                    <a lay-href="/page/libChange" class="layadmin-backlog-body">
                      <h3>注销图书</h3>
                      <p><cite id="zxsl">0</cite></p>
                    </a>
                  </li>
                </ul>
                <ul class="layui-row layui-col-space10">
                  <li class="layui-col-xs6">
                    <a class="layadmin-backlog-body" style="text-decoration:none;">
                      <h3>读者到馆率</h3>
                      <p><cite id="dgl">0</cite></p>
                    </a>
                  </li>
                  <li class="layui-col-xs6">
                    <a class="layadmin-backlog-body" style="text-decoration:none;">
                      <h3>图书借阅率</h3>
                      <p><cite id="jyl">0</cite></p>
                    </a>
                  </li>
                </ul>
              </div>
            </div>
          </div>
        </div>

        <div class="layui-card" style="height: 394px;">
          <div class="layui-card-header">馆藏分类占比情况(前10)</div>
          <div id="container" style="height: 100%"></div>
        </div>


        <div class="layui-card">
          <div class="layui-tab layui-tab-brief layadmin-latestData">
            <ul class="layui-tab-title">
              <li class="layui-this">图书荐购</li>
            </ul>
            <div class="layui-tab-content">
              <div class="layui-tab-item layui-show">
                <table class="layui-table layui-form">
                  <thead>
                  <tr>
                    <td>书名</td>
                    <td>著者</td>
                    <td>荐购次数</td>
                    <td>推荐学校</td>
                  </tr>
                  </thead>
                  <tr>
                    <td>平凡的世界</td>
                    <td>路遥</td>
                    <td>8</td>
                    <td>席关小学</td>
                  </tr>
                  <tr>
                    <td>打开心灵之门</td>
                    <td>冯志远主编</td>
                    <td>6</td>
                    <td>麦巷小学</td>
                  </tr>
                  <tr>
                    <td>春暖花开时</td>
                    <td>刘吾福</td>
                    <td>5</td>
                    <td>青龙小学</td>
                  </tr>
                  <tr>
                    <td>谁叫你不见义勇为</td>
                    <td>吴志强</td>
                    <td>3</td>
                    <td>十字小学</td>
                  </tr>
                </table>
              </div>
            </div>
          </div>
        </div>

        <!--<div class="layui-card">-->
          <!--<div class="layui-card-header">产品动态</div>-->
          <!--<div class="layui-card-body">-->
            <!--<div class="layui-carousel layadmin-carousel layadmin-news" data-autoplay="true" data-anim="fade" lay-filter="news">-->
              <!--<div carousel-item>-->
                <!--<div><a href="http://fly.layui.com/docs/2/" target="_blank" class="layui-bg-red">layuiAdmin 快速上手文档</a></div>-->
                <!--<div><a href="http://fly.layui.com/vipclub/list/layuiadmin/" target="_blank" class="layui-bg-green">layuiAdmin 会员讨论专区</a></div> -->
                <!--<div><a href="http://www.layui.com/admin/#get" target="_blank" class="layui-bg-blue">获得 layui 官方后台模板系统</a></div>-->
              <!--</div>-->
            <!--</div>-->
          <!--</div>-->
        <!--</div>-->

        <!--<div class="layui-card">-->
          <!--<div class="layui-card-header">-->
            <!--作者心语-->
            <!--<i class="layui-icon layui-icon-tips" lay-tips="要支持的噢" lay-offset="5"></i>-->
          <!--</div>-->
          <!--<div class="layui-card-body layui-text layadmin-text">-->
            <!--<p>一直以来，layui 秉承无偿开源的初心，虔诚致力于服务各层次前后端 Web 开发者，在商业横飞的当今时代，这一信念从未动摇。即便身单力薄，仍然重拾决心，埋头造轮，以尽可能地填补产品本身的缺口。</p>-->
            <!--<p>在过去的一段的时间，我一直在寻求持久之道，已维持你眼前所见的一切。而 layuiAdmin 是我们尝试解决的手段之一。我相信真正有爱于 layui 生态的你，定然不会错过这一拥抱吧。</p>-->
            <!--<p>子曰：君子不用防，小人防不住。请务必通过官网正规渠道，获得 <a href="http://www.layui.com/admin/" target="_blank">layuiAdmin</a>！</p>-->
            <!--<p>—— 贤心（<a href="http://www.layui.com/" target="_blank">layui.com</a>）</p>-->
          <!--</div>-->
        <!--</div>-->
      <!--</div>-->

    </div>
  </div>

  <script src="../../layuiadmin/layui/layui.js?t=1"></script>
    <script type="text/javascript" src="/lib/extend/echarts.js"></script>
  <script>
      var $;
      layui.config({
          base: '../../layuiadmin/' //静态资源所在路径
      }).extend({
          index: 'lib/index' //主入口模块
      }).use(['index', 'console']);
      layui.use(['jquery', 'layer'], function(){
          $ = layui.$;
          $.ajax({
              url: "/region/summaryList",
              type: "POST",
              data:{orgid:JSON.parse(sessionStorage.loginData).orgid,token:JSON.parse(sessionStorage.loginData).token},
              success: function(result) {
                  if(result.code==200){
                      if(result.data){
                          if(result.data.xxs){$("#xxs").text(result.data.xxs);}
                          if(result.data.xss){$("#xss").text(result.data.xss);}
                          if(result.data.pjfb){
                              $("#pjfb").text(result.data.pjfb?parseFloat(result.data.pjfb).toFixed(2):0);
                          }
                          if(result.data.qkzs){$("#qkzs").text(result.data.qkzs);}

                          if(result.data.tssjcs){$("#tssjcs").text(result.data.tssjcs?parseFloat(result.data.tssjcs).toFixed(2):0)};

                          if(result.data.tsglys){$("#tsglys").text(result.data.tsglys);}
                          if(result.data.tszcs){$("#tszcs").text(result.data.tszcs);}
                          if(result.data.dzs){$("#dzs").text(result.data.dzs);}
                          if(result.data.tszs){$("#tszs").text(result.data.tszs);}
                          //if(result.data.qscs){$("#qscs").text(result.data.qscs);}
                      }
                  }
              }
          });

          $.ajax({
              url: "/selectcount/standardBoookNumTotal",
              type: "POST",
              data:{orgid:JSON.parse(sessionStorage.loginData).orgid,toporgid:JSON.parse(sessionStorage.loginData).orgid,token:JSON.parse(sessionStorage.loginData).token},
              success: function(result) {
                  if(result.code==200){
                      if(result.data){
                          if(result.data.quekouBooknum){$("#qscs").text(result.data.quekouBooknum);}
                      }
                  }
              }
          });
          $.ajax({
              url: "/region/dayBriefingList",
              type: "POST",
              data:{orgid:JSON.parse(sessionStorage.loginData).orgid,token:JSON.parse(sessionStorage.loginData).token},
              success: function(result) {

                  if(result.code==200) {
                      if(result.data.jssl){$("#jssl").html(result.data.jssl);}
                      if(result.data.hssl){$("#hssl").html(result.data.hssl);}
                      if(result.data.xzsl){$("#xzsl").html(result.data.xzsl);}
                      if(result.data.zxsl){$("#zxsl").html(result.data.zxsl);}
                      if(result.data.dgl){$("#dgl").html(parseFloat(result.data.dgl*100).toFixed(2)+"%");}
                      if(result.data.jyl){$("#jyl").html(parseFloat(result.data.jyl*100).toFixed(2)+"%");}
                  }
              }
          });

          var dom = document.getElementById("container");
          var myChart = echarts.init(dom);
          var app = {};
          option = null;
          app.title = '嵌套环形图';

          var fiveNum = [];
          var topTen = [];

          $.ajax("/schoolhome/typeNumberTeach",{
              data:{orgid:JSON.parse(sessionStorage.loginData).orgid,token:JSON.parse(sessionStorage.loginData).token},
              success:function(result){
                  if(result.code==200){
                      fiveNum = result.data.fiveNum;
                      topTen = result.data.topTen;
                      option = {
                          tooltip: {
                              trigger: 'item',
                              formatter: "{a} <br/>{b}: {c} ({d}%)"
                          },
                          series: [
                              {
                                  name:'分类占比',
                                  type:'pie',
                                  selectedMode: 'single',
                                  radius: [0, '30%'],

                                  label: {
                                      normal: {
                                          position: 'inner'
                                      }
                                  },
                                  labelLine: {
                                      normal: {
                                          show: false
                                      }
                                  },
                                  data:fiveNum
                              },
                              {
                                  name:'分类占比',
                                  type:'pie',
                                  radius: ['40%', '55%'],
                                  data:topTen
                              }
                          ]
                      };
                      if (option && typeof option === "object") {
                          myChart.setOption(option, true);
                      }
                  }
              }
          });

      });

      var laytpl;
      layui.use(['jquery', 'layer','table'], function() {
          var table = layui.table;
          laytpl = layui.laytpl;
          table.render({
              elem: '#dataTable'
              ,url: '/notice/receiveListToHomePage?orgid='+JSON.parse(sessionStorage.loginData).orgid
              ,page: true
              ,cellMinWidth: 120
              ,cols: [[
                  {type: 'numbers', title: '序号'}
                  ,{field: 'flag', title: '类型',align:'center',templet:function (d) {
                          if(d.flag == 0){
                              return "公告";
                          }else {
                              return "通知";
                          }
                      }}
                  ,{field: 'title', title: '发布主题',align:'center',style:'text-decoration-line: underline;color: #199ED8; cursor: pointer;',templet:function (d) {
                          return '<div><a onclick="shownotice('+d.noticeId+','+d.id+')" target="_blank" class="layui-table-link">'+d.title+'</div>'
                      }}
                  ,{field: 'createtime', title: '发布时间', align:'center',templet:function(d){
                          if(d.createtime){
                              return d.createtime.split(" ")[0];
                          }else {
                              return d.createtime;
                          }
                      }}
                  ,{field: 'orgname', title: '发布单位', align:'center'}
                  ,{field: 'readstatus', title: '是否已读',align:'center',templet:function (d) {
                          if(d.readstatus == 0){
                              return "未读";
                          }else {
                              return "已读";
                          }
                      }}
              ]]
              ,skin: 'line'
          });
      });

      var downloadUrl = "";
      function shownotice(noticeId,id) {
          $.ajax({
              url: "/notice/noticeLists",
              type: "POST",
              data:{id:noticeId},
              success: function(result) {
                  if(result.data.filsurl == null){
                      result.data.filsurl = "";
                  }
                  downloadUrl = result.data.filsurl;
                  var filsurl = result.data.filsurl;
                  var index = filsurl .lastIndexOf("\/");
                  filsurl  = filsurl .substring(index + 1, filsurl.length);
                  result.data.filsurl = filsurl.slice(13);
                  var noticeStr = '<div id="noticeContent">\n' +
                      '    <h5>'+result.data.title+'</h5>\n' +
                      '    <div class="noticeContentText">'+result.data.content+'</div>\n' +
                      '    <footer style="margin-bottom: 0;">附件：<a onclick="downloadFile()">'+result.data.filsurl+'</a>' +
                      '<div>'+result.data.orgname+'</div>' +
                      '<div>'+result.data.createtime.split(" ")[0]+'</div></footer>\n' +
                      '</div>';
                  laytpl(noticeStr).render(result.data, function(string){
                      noticeStr = string;
                  });

                  layer.open({
                      title: "查看",
                      type: 1,
                      area: ['1000px', '500px'],
                      skin: 'noticeStr',
                      content: noticeStr,

                  });
                  $.ajax("/notice/setRead",{
                      data:{id:id},
                      success:function(result){
                          if(result.code==200){

                          }
                      }
                  });
              }
          });
      }

      function downloadFile(){
          window.open('/file/downloadFile?filename='+downloadUrl);
      }

      searchForm.linkage(JSON.parse(sessionStorage.loginData).orgid);
  </script>
</body>
</html>

