data_statistics.html 19 KB

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