statistics_data_list.html 18 KB

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