statistics_data_list.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  1. {extend name="public/layout" /} {block name="title"}数据统计{/block} {block name="body"}
  2. <link rel="stylesheet" href="__LAYUI__/common.css" media="all">
  3. <link rel="stylesheet" href="__STATIC__/css/csspc.css">
  4. <link rel="stylesheet" href="__STATIC__/css/font.css">
  5. <style type="text/css">
  6. html,
  7. body {
  8. display: block;
  9. min-width: 1100px;
  10. font: 14px Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif;
  11. height: 99%;
  12. overflow: hidden;
  13. }
  14. .layui-table thead tr,
  15. .layui-table-header {
  16. background-color: #D8E6F1 !important;
  17. }
  18. .layui-tab {
  19. padding:15px;
  20. height: 100%;
  21. box-sizing: border-box;
  22. margin:15px;
  23. background: #fff;
  24. height: 98%;
  25. box-shadow: 0 0 4px 0 #B6CADE;
  26. border-radius: 5px;
  27. }
  28. .layui-fluid {
  29. display: block;
  30. box-shadow: 0 0 4px 0 #B6CADE;
  31. border-radius: 5px;
  32. background-color: #ffffff;
  33. height:94%;
  34. }
  35. .layui-card{box-shadow: none;}
  36. .layui-form-label {
  37. width: auto;
  38. }
  39. .layui-laydate-range {
  40. width: 581px;
  41. }
  42. .layui-table-page>div {
  43. display: flex;
  44. justify-content: flex-start;
  45. }
  46. .layui-btn-primary,
  47. .layui-btn-primary:hover {
  48. border: 1px solid #249EFB;
  49. background-color: #fff;
  50. color: #249EFB;
  51. }
  52. .layui-form-item .layui-inline {
  53. margin-right: 0px;
  54. }
  55. .layui-btn-normal,
  56. .layui-btn-normal:hover {
  57. border: 1px solid #249EFB;
  58. background-color: #fff;
  59. color: #249EFB;
  60. }
  61. .layui-btn-danger,
  62. .layui-btn-danger:hover {
  63. color: #FF5722;
  64. border: 1px solid #FF5722;
  65. background-color: #fff;
  66. }
  67. .li_active {
  68. font-weight: 700;
  69. background-color: #249EFB;
  70. color: #fff;
  71. }
  72. .relative {
  73. position: relative;
  74. }
  75. .noneClass {
  76. display: none !important;
  77. }
  78. .c_wordlist {
  79. width: 20px;
  80. position: absolute;
  81. top: 43px;
  82. right: 1px;
  83. display: flex;
  84. flex-direction: column;
  85. z-index: 99999;
  86. height: auto;
  87. justify-content: flex-start;
  88. align-items: center;
  89. box-sizing: border-box;
  90. padding: 4px 0px;
  91. overflow: hidden;
  92. max-height: 297px;
  93. -ms-overflow-style: none;
  94. /* IE 10+ */
  95. scrollbar-width: none;
  96. /* Firefox */
  97. overflow-y: scroll;
  98. background-color: #f5f5f5;
  99. }
  100. .c_wordlist::-webkit-scrollbar {
  101. display: none;
  102. /* Chrome Safari */
  103. }
  104. .c_wordlist>li {
  105. width: 20px;
  106. height: 37px;
  107. cursor: pointer;
  108. display: flex;
  109. justify-content: center;
  110. align-items: center;
  111. margin-bottom: 0px;
  112. line-height: 37px;
  113. }
  114. .s_wordlist {
  115. width: 20px;
  116. position: absolute;
  117. top: 43px;
  118. right: 1px;
  119. display: flex;
  120. flex-direction: column;
  121. z-index: 99999;
  122. height: auto;
  123. justify-content: flex-start;
  124. align-items: center;
  125. box-sizing: border-box;
  126. padding: 4px 0px;
  127. overflow: hidden;
  128. max-height: 297px;
  129. -ms-overflow-style: none;
  130. /* IE 10+ */
  131. scrollbar-width: none;
  132. /* Firefox */
  133. overflow-y: scroll;
  134. background-color: #f5f5f5;
  135. }
  136. .s_wordlist::-webkit-scrollbar {
  137. display: none;
  138. /* Chrome Safari */
  139. }
  140. .s_wordlist>li {
  141. width: 20px;
  142. height: 37px;
  143. cursor: pointer;
  144. display: flex;
  145. justify-content: center;
  146. align-items: center;
  147. margin-bottom: 0px;
  148. line-height: 37px;
  149. }
  150. /*dd {
  151. border-bottom: 1px solid #EFEFEF;
  152. }*/
  153. .layui-anim-upbit {
  154. -ms-overflow-style: none;
  155. /* IE 10+ */
  156. scrollbar-width: none;
  157. /* Firefox */
  158. overflow-y: scroll;
  159. background-color: #fff;
  160. }
  161. .layui-anim-upbit::-webkit-scrollbar {
  162. display: none;
  163. /* Chrome Safari */
  164. }
  165. .layui-form-select dl {
  166. width: 100% !important;
  167. }
  168. .layui-tab-title .layui-this {
  169. color: #249EFB;
  170. }
  171. .layui-tab-title .layui-this:after {
  172. width: 50px;
  173. height: 4px;
  174. background-color: #249EFB;
  175. top: 36px !important;
  176. left: 50%;
  177. transform: translateX(-50%);
  178. border: none;
  179. }
  180. .layui-tab-title li {
  181. margin: 0px 5px;
  182. }
  183. .layui-tab-title {
  184. box-sizing: border-box;
  185. border-bottom: 1px solid #f5f5f5;
  186. padding: 0px 5px;
  187. }
  188. .li_active {
  189. font-weight: 700;
  190. background-color: #249EFB;
  191. color: #fff;
  192. }
  193. .ablock {
  194. display: inline-block;
  195. width: 100%;
  196. height: 100%;
  197. }
  198. .ml5 {
  199. margin-left: 14px !important;
  200. }
  201. .flex-row {
  202. display: flex;
  203. justify-content: space-around;
  204. align-items: center;
  205. background-color: #fff;
  206. margin: 15px;
  207. height: 130px;
  208. box-shadow: 0 0 4px 0 #b6cade;
  209. border-radius: 5px;
  210. }
  211. .flex-item {
  212. display: flex;
  213. flex-direction: column;
  214. justify-content: center;
  215. align-items: center;
  216. }
  217. .font-weight {
  218. font-weight: 600;
  219. }
  220. .layui-form-select{float:left;width: 60%;}
  221. .sjtj_dl .sjtj_dl_dd{float: right;min-width:270px;margin-top:1px;margin-right: 10px;}
  222. .sjtj_dl .sjtj_dl_dd p{font-size: 14px;}
  223. .set_times{height: 36px;border:1px solid #c7d8e6;}
  224. .table_box thead tr th {
  225. text-align: center;
  226. white-space: nowrap;
  227. /* outline: 1px solid #d4d4d4;
  228. border:none !important; */
  229. }
  230. .table_box tbody tr td {
  231. text-align: center;
  232. word-break: keep-all;
  233. white-space: nowrap;
  234. /* outline: 1px solid #000000;
  235. border:none !important; */
  236. }
  237. /* ////////////////// */
  238. html{background: none;min-width:1100px;}
  239. .table_box tbody tr td,.table_box thead tr th{border:1px solid #c7d8e6;}
  240. .head_t_th_p1{font-size: 16px;font-weight: bold;}
  241. .head_t_th_p2{font-size: 14px;}
  242. .borhuise{border:1px solid #d1e5f5;}
  243. .borhuiserleft{border-left:1px solid #d1e5f5;}
  244. .borhuisertop,.bodylist_dd_p{border-top:1px solid #d1e5f5;}
  245. /* .body_top{background: #D8D8D8;} */
  246. .body_top .body_top_dd{width:16.66%;float:left;color:#475562;}
  247. .list_dd01{width:190px;}
  248. .list_dd02{width:96px;}
  249. .list_dd03{width:126px;}
  250. .list_dd04{width:160px;}
  251. .body_c .body_c_dd{float:left;text-align: center;font-size: 14px;border-left:1px solid #d1e5f5;line-height: 38px;}
  252. .lanse{color:#249efb !important;}
  253. .bodylist li{line-height: 38px;}
  254. .bodylist li .bodylist_dd{border-left:1px solid #d1e5f5;border-top:1px solid #d1e5f5;float:left;text-align: center;font-size: 14px;}
  255. .bodylist_dd_p{line-height: 38px !important;}
  256. .layui-table{margin-top:0;}
  257. .iwidth {width: 220px !important;display: inline-block;}
  258. .table_tbodys tr td div{line-height: 30px;padding: 6px 15px;border-bottom: 1px solid #e6e6e6;}
  259. .table_tbodys br{display: contents;}
  260. .ispddiv{padding:0 !important;}
  261. .tableHeadertr{background: #D8E6F1 !important;}
  262. /*.bodybgsbox{margin-right: 16px;}*/
  263. .bodybgs{background: #f1f9ff;overflow: hidden;}
  264. .layui-fluid{height: 100%;}
  265. #page{position: absolute;bottom: 0;left:0;padding:0 20px;background: #fff;}
  266. .lablebodys{height:calc(62vh - 60px);overflow-y: scroll;}
  267. #rangeDepart {
  268. width: 200px;
  269. height: 38px;
  270. }
  271. xm-select > .xm-body {
  272. z-index: 99999 !important;
  273. }
  274. </style>
  275. <body>
  276. <div class="layui-tab">
  277. <ul class="layui-tab-title rst_box_top">
  278. <li data-index="1" class="font16 layui_video_list"><a href="{:url('article/index')}">图文列表</a></li>
  279. <li data-index="2" class="font16 layui_video_tjss layui-this"><a href="{:url('article/statistics_data_list')}">数据统计</a></li>
  280. </ul>
  281. <form class="layui-form layui-form-box ds" id="bodybox" style="margin-top:20px;padding:0 15px;height: 94%;position: relative">
  282. <dl class="sjtj_dl">
  283. <dd style="float: left;">
  284. <button type="button" class="layui-btn layuiadmin-btn-list" id="export">
  285. 导出
  286. </button>
  287. </dd>
  288. <dd class="sjtj_dl_dd mdr20" style="width: 144px;min-width: 144px;margin-top:0;">
  289. <button class="layui-btn layuiadmin-btn-list submitbtn" id="searchbox" type="button">
  290. 搜索
  291. </button>
  292. <button class="layui-btn layuiadmin-btn-list" type="button" id="resetbtn">
  293. 重置
  294. </button>
  295. </dd>
  296. <dd class="sjtj_dl_dd" style="min-width:312px;">
  297. <p class="ids lh38">时间范围:</p>
  298. <input type="text" style="border:1px solid #e6e6e6;height:36px;" class=" iwidth layui-input" name="time" id="time_date" required lay-verify="required" placeholder="开始时间 - 结束时间" autocomplete="off">
  299. </dd>
  300. <dd class="sjtj_dl_dd width15_">
  301. <p class="wleft lh38">部门筛选:</p>
  302. <!-- <select name="orgname" id="org" lay-filter="org_type" lay-search>
  303. <option value="">请选择部门</option>
  304. {volist name="orglist" id="vo"}
  305. <option value="{$vo.id}">{$vo.name}</option>
  306. {/volist}
  307. </select> -->
  308. <div id="rangeDepart" class="wleft"></div>
  309. </dd>
  310. </dl>
  311. <div class="clear"></div>
  312. <div class="bodybgsbox">
  313. <div class="mdt30 borhuise borl0 bodybgs">
  314. <dl class="woverflow body_top pdtb20 borhuiserleft" id="hzcont">
  315. </dl>
  316. </div>
  317. </div>
  318. <div class="lablebodys">
  319. <table lay-filter="tabletotalbox" class="layui-table table_box">
  320. <thead class="tableHeader">
  321. <tr class="tableHeadertr">
  322. <th lay-data="" colspan="1">部门名称</th>
  323. <th lay-data="" colspan="1">转发次数</th>
  324. <th lay-data="" colspan="1">浏览人数</th>
  325. <th lay-data="" colspan="1">获得线索</th>
  326. <th lay-data="" colspan="1">浏览时长</th>
  327. <th lay-data="" colspan="1">转发人数</th>
  328. <th lay-data="" colspan="1">未转发人数</th>
  329. </tr>
  330. </thead>
  331. <tbody class="table_tbodys">
  332. </tbody>
  333. </table>
  334. <div id="page"></div>
  335. </div>
  336. </form>
  337. </div>
  338. </body>
  339. {/block} {block name="js"}
  340. <script type="text/javascript" src="__STATIC__/js/jquery.min.js"></script>
  341. <script type="text/javascript" src="__STATIC__/js/FileSaver.min.js"></script>
  342. <script type="text/javascript" src="__STATIC__/js/tableExport.min.js"></script>
  343. <script src="__STATIC__/layui/layui/layui.js"></script>
  344. <script src="__STATIC__/layui/layui/lay/modules/xm-select.js" type="text/javascript" charset="utf-8"></script>
  345. <script>
  346. layui.config({
  347. base: '__LAYUI__/',
  348. urlbase: '/sys'
  349. }).extend({
  350. index: 'lib/index' //主入口模块
  351. }).use(['index', 'form', 'table', 'laydate', 'laypage'], function () {
  352. var $ = layui.$,
  353. form = layui.form,
  354. laydate = layui.laydate,
  355. table = layui.table,
  356. laypage = layui.laypage,
  357. scrollTopNum = 0;
  358. //分页
  359. var pagePre = 1;//当前页
  360. var limit = 10;//每页默认条数
  361. var where = {};
  362. where.page = pagePre;
  363. where.limit = limit;
  364. document.onkeydown=function(event){
  365. var e = event || window.event || arguments.callee.caller.arguments[0];
  366. if(e && e.keyCode==13){
  367. $(".submitbtn").trigger("click");
  368. }
  369. };
  370. var departTree = xmSelect.render({
  371. el: "#rangeDepart",
  372. name: 'org',
  373. autoRow: true,
  374. filterable: true,
  375. tips: '请选择',
  376. radio: true,
  377. tree: {
  378. show: true,
  379. showFolderIcon: true,
  380. showLine: true,
  381. indent: 20,
  382. expandedKeys: [ -3 ],
  383. //是否严格遵守父子模式
  384. strict: false,
  385. },
  386. height: "200px",
  387. data: [],
  388. //文本显示模式
  389. //处理方式
  390. });
  391. $.ajax({
  392. url: '{:url("statistics/get_person")}',
  393. type: "post",
  394. data: {},
  395. success: function(res) {
  396. departTree.update({data:res})
  397. }
  398. })
  399. //日期范围
  400. laydate.render({
  401. elem: '#time_date'
  402. , type: 'date'
  403. , range: true
  404. , trigger: 'click'//呼出事件改成click
  405. });
  406. $('#searchbox').click(function () {
  407. where.org_id= departTree.getValue('value')[0];
  408. where.time= $('#time_date').val();
  409. action.list(where);
  410. })
  411. $('#resetbtn').click(function(){
  412. $("#bodybox")[0].reset();
  413. departTree.setValue([ ]);
  414. layui.form.render();
  415. where.org_id= null;
  416. where.time= null;
  417. action.list(where);
  418. })
  419. //监听部门变化
  420. form.on('select(org_type)', function (data) {
  421. where.org_id = parseInt(data.value);
  422. action.list(where);
  423. })
  424. var action = {
  425. list: function (where) {
  426. $.ajax({
  427. url: '{:url("statistics_data_list")}',
  428. type: 'post',
  429. dataType: 'json',
  430. data: where,
  431. success: function(res) {
  432. var htmlstr = '';
  433. var hzhtml = '';
  434. $('.table_tbodys').html(htmlstr);
  435. if (res.code == 0) {
  436. for(let j = 0; j < res.data.list.length; j++){
  437. htmlstr+=`<tr>
  438. <td lay-data="" rowspan="1"><a class="lanse" href="{:url('statistics_emplist')}?org_id=${res.data.list[j].id}">${res.data.list[j].name}</a></td>
  439. <td lay-data="" rowspan="1">${res.data.list[j].share_count}</td>
  440. <td lay-data="" rowspan="1">${res.data.list[j].footprints_user_count}</td>
  441. <td lay-data="" rowspan="1">${res.data.list[j].clue_count}</td>
  442. <td lay-data="" rowspan="1">${res.data.list[j].visit_long}</td>
  443. <td lay-data="" rowspan="1">${res.data.list[j].share_employee_count}</td>
  444. <td lay-data="" rowspan="1">${res.data.list[j].un_share_employee_count}</td>
  445. </tr>`;
  446. }
  447. $('.table_tbodys').html(htmlstr);
  448. action.page(where,res.count);
  449. hzhtml+=`<dd class="textc body_top_dd">
  450. <p class="font16 textb bodyTops01">${res.data.all.article_cont}</p>
  451. <p class="font14">图文总数</p>
  452. </dd>
  453. <dd class="textc body_top_dd">
  454. <p class="font16 textb bodyTops02">${res.data.all.share_employee_count}</p>
  455. <p class="font14">转发人数</p>
  456. </dd>
  457. <dd class="textc body_top_dd">
  458. <p class="font16 textb bodyTops03">${res.data.all.share_count}</p>
  459. <p class="font14">转发次数</p>
  460. </dd>
  461. <dd class="textc body_top_dd">
  462. <p class="font16 textb bodyTops04">${res.data.all.footprints_user_count}</p>
  463. <p class="font14">浏览人数</p>
  464. </dd>
  465. <dd class="textc body_top_dd">
  466. <p class="font16 textb bodyTops05">${res.data.all.visit_long}</p>
  467. <p class="font14">浏览时长(s)</p>
  468. </dd>
  469. <dd class="textc body_top_dd">
  470. <p class="font16 textb bodyTops06">${res.data.all.clue_count}</p>
  471. <p class="font14">获得线索</p>
  472. </dd>`;
  473. $('#hzcont').html(hzhtml);
  474. }
  475. }
  476. });
  477. },
  478. page: function pages(where,count) {
  479. laypage.render({
  480. elem: 'page'
  481. , count: count
  482. , curr: where.page
  483. , limit: where.limit
  484. , prev:'<i class="layui-icon layui-icon-left"></i>'
  485. , next:'<i class="layui-icon layui-icon-right"></i>'
  486. , layout: ['prev', 'page', 'next' , 'skip','count','limit']
  487. , jump: function (obj, first) {
  488. limit = obj.limit
  489. where.page = obj.curr
  490. where.limit = obj.limit
  491. if (!first) {
  492. console.log(where)
  493. action.list(where);
  494. }
  495. }
  496. });
  497. }
  498. };
  499. action.list(where);
  500. $('#export').on('click',function () {
  501. $('table').tableExport({
  502. type: 'excel',
  503. mso: {
  504. styles: ['background-color', 'border-top-color', 'border-left-color', 'border-right-color', 'border-bottom-color', 'border-top-width', 'border-left-width', 'border-right-width', 'border-bottom-width', 'border-top-style', 'border-left-style', 'border-right-style', 'border-bottom-style', 'color']
  505. }
  506. });
  507. })
  508. });
  509. </script>
  510. {/block}