case_data_statistics.html 19 KB

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