Нет описания

keywordsStatistics.html 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>关键词统计</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <script src="../Script/Common/huayi.load.js"></script>
  8. <script src="../Script/Common/huayi.config.js"></script>
  9. <link rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
  10. <link href="../css/WorkOrder/Search.css" rel="stylesheet">
  11. <link href="../css/init.css" rel="stylesheet" />
  12. <script src="../My97DatePicker/WdatePicker.js"></script>
  13. <script src="../js/laydate/laydate.js"></script>
  14. <style>
  15. table td {
  16. word-break: break-all;
  17. word-wrap: break-word;
  18. }
  19. .ld-service li {
  20. float: left;
  21. font-size: 14px;
  22. color: #000;
  23. padding: 5px 15px;
  24. cursor: pointer;
  25. border-bottom: 1px solid #ccc;
  26. }
  27. .cr-click {
  28. border: 1px solid #ccc;
  29. background-color: #fff;
  30. border-bottom: none !important;
  31. border-bottom-left-radius: 5px;
  32. border-bottom-right-radius: 5px;
  33. }
  34. .Shows {
  35. display: block !important;
  36. }
  37. .complain {
  38. display: none;
  39. }
  40. .toolLeft input {
  41. width: 200px;
  42. }
  43. th {
  44. padding: 5px;
  45. text-align: center;
  46. }
  47. td {
  48. padding: 5px;
  49. }
  50. .Borders {
  51. border: 1px solid #d7d7d7;
  52. }
  53. .cx {
  54. display: block;
  55. }
  56. .daoHang {
  57. margin-bottom: 15px;
  58. }
  59. .keyMargin {
  60. margin-bottom: 0;
  61. }
  62. </style>
  63. </head>
  64. <body class="gray-bg">
  65. <div class="wrapper wrapper-content animated fadeInRight">
  66. <div class="daoHang clearfix">
  67. <div class="dhLeft">
  68. <sapn>
  69. <i class="syIcon"></i>位置:
  70. <a href="javaScript:;" id="ReIndex">首页</a>&gt;
  71. <a href="javaScript:;">业务统计</a>&gt;
  72. <a href="" class="nowPosition">关键词统计</a>
  73. </sapn>
  74. </div>
  75. <div class="dhRight">
  76. <a href="" title="刷新"><i class="fa fa-refresh"></i></a>
  77. </div>
  78. </div>
  79. <div class="Content_box">
  80. <div class="complain Shows">
  81. <div class="toolBar clearfix">
  82. <div class="toolLeft">
  83. 开始日期:
  84. <input class="photo x-color inputs" type="text" id="squeryTime" autocomplete="off" />
  85. 结束时间:
  86. <input class="photo x-color inputs" type="text" id="equeryTime" autocomplete="off" />
  87. 来源:
  88. <select class="select_" id="source"></select>
  89. <button class="btns search_1">查询</button>
  90. </div>
  91. </div>
  92. <div class="tab-content">
  93. <div class="tab-pane fade active in" id="import_from_file">
  94. <!-- <div class="toolBar keyMargin clearfix">
  95. <button class="fr btns" id="print_1">打印预览</button>
  96. </div> -->
  97. <div style="width: 100%;padding: 10px;">
  98. <table id="table1" class="tables" data-row-style="rowStyle" data-query-params="queryParams"
  99. data-pagination="true">
  100. <thead>
  101. <tr>
  102. <th data-field="" data-formatter="serialNumber" data-align="center">序号</th>
  103. <th data-field="keyname" data-formatter="keywordList" data-align="center">关键词</th>
  104. <th data-field="keycount" data-formatter="totalNumberList" data-align="center">
  105. 统计数量</th>
  106. </tr>
  107. </thead>
  108. </table>
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. <script>
  116. $(document).ready(function () {
  117. laydate.render({
  118. elem: '#squeryTime',
  119. theme: '#00a1cb',
  120. type: 'datetime'
  121. });
  122. laydate.render({
  123. elem: '#equeryTime',
  124. theme: '#00a1cb',
  125. type: 'datetime'
  126. });
  127. //来源
  128. LY($("#source"));
  129. initTable();
  130. });
  131. //表格
  132. function initTable(pid=38) {
  133. $.ajax({
  134. url: huayi.config.callcenter_url + 'DataAnalysis/GetKeyReport_1',
  135. type: 'get',
  136. data: {
  137. sdate: $("#squeryTime").val(),
  138. edate: $("#equeryTime").val(),
  139. source: $("#source").val(),
  140. pid: pid,
  141. token: $.cookie("token")
  142. },
  143. dataType: "json",
  144. async: true,
  145. success: function (returnValue) {
  146. if (returnValue.state.toLowerCase() == "success") {
  147. var resultData1 = returnValue.data;
  148. $('#table1').bootstrapTable('load', resultData1);
  149. }
  150. //异步获取数据
  151. }
  152. });
  153. $('#table1').bootstrapTable('destroy').bootstrapTable({
  154. striped: true
  155. });
  156. }
  157. //序号
  158. function serialNumber(val, row, index) {
  159. return index + 1;
  160. }
  161. //来源
  162. function LY(obj) {
  163. obj.empty();
  164. obj.append(
  165. '<option selected="selected" value="">请选择</option>'
  166. );
  167. $.getJSON(
  168. huayi.config.callcenter_url +
  169. "Dictionary/GetDicValueListById", {
  170. token: $.cookie("token"),
  171. id: 1,
  172. },
  173. function (data) {
  174. if (data.state.toLowerCase() == "success") {
  175. var content = data.data;
  176. $(content).each(function (i, n) {
  177. $(
  178. "<option value='" +
  179. n.F_ValueId +
  180. "'>" +
  181. n.F_Value +
  182. "</option>"
  183. ).appendTo(obj);
  184. });
  185. }
  186. }
  187. );
  188. }
  189. //代办搜索
  190. $(".search_1").click(function () {
  191. initTable();
  192. });
  193. function totalNumberList(val, row) {
  194. return '<div class="imgs" ><a class="" onclick="viewList(\'' + row.F_Key + '\')" >' + val +
  195. '</a></div>';
  196. }
  197. function keywordList(val, row) {
  198. return '<div class="imgs" ><a class="" onclick="viewKeywordList(\'' + row.F_Key + '\')" >' + val +
  199. '</a></div>';
  200. }
  201. function viewList(key) {
  202. starttime = $("#squeryTime").val();
  203. endtime = $("#equeryTime").val();
  204. var date = new Date();
  205. var year = date.getFullYear();
  206. var month = date.getMonth() + 1;
  207. var day = date.getDate();
  208. var defaultDate = year + "-" + month + "-" + day;
  209. if (starttime == "") {
  210. starttime = encodeURIComponent(defaultDate + " 00:00:00");
  211. }
  212. if (endtime == "") {
  213. endtime = encodeURIComponent(defaultDate + " 23:59:59");
  214. } else if (endtime.length > 0 && endtime.length <= 10) {
  215. endtime = encodeURIComponent(endtime + " 23:59:59");
  216. } else {
  217. endtime = encodeURIComponent(endtime);
  218. }
  219. var source = $("#source").val();
  220. layer.open({
  221. type: 2,
  222. content: "./keywordsStatisticsList.html?starttime=" + starttime + "&endtime=" + endtime +
  223. "&key=" + key + "&source=" + source, //iframe的url,no代表不显示滚动条
  224. title: '关键词统计表',
  225. area: ['90%', '90%'], //宽高
  226. });
  227. }
  228. function viewKeywordList(key) {
  229. starttime = $("#squeryTime").val();
  230. endtime = $("#equeryTime").val();
  231. var date = new Date();
  232. var year = date.getFullYear();
  233. var month = date.getMonth() + 1;
  234. var day = date.getDate();
  235. var defaultDate = year + "-" + month + "-" + day;
  236. if (starttime == "") {
  237. starttime = encodeURIComponent(defaultDate + " 00:00:00");
  238. }
  239. if (endtime == "") {
  240. endtime = encodeURIComponent(defaultDate + " 23:59:59");
  241. } else if (endtime.length > 0 && endtime.length <= 10) {
  242. endtime = encodeURIComponent(endtime + " 23:59:59");
  243. } else {
  244. endtime = encodeURIComponent(endtime);
  245. }
  246. var source = $("#source").val();
  247. layer.open({
  248. type: 2,
  249. content: "./keywordsStatisticsChild.html?starttime=" + starttime + "&endtime=" + endtime +
  250. "&key=" + key + "&source=" + source, //iframe的url,no代表不显示滚动条
  251. title: '关键词统计表',
  252. area: ['90%', '90%'], //宽高
  253. });
  254. }
  255. //打印预览
  256. // $(document).on('click','#print_'+'',previewKeyWords);
  257. // function previewKeyWords(){
  258. // layer.open({
  259. // type: 2,
  260. // content: "../CommonHtml/PrintPreviewKeyWords.html?&sdate=" + $('#queryTime').val() + "&edate=" + $("#equeryTime").val(), //iframe的url,no代表不显示滚动条
  261. // title: '打印预览',
  262. // area: ['80%', '90%'], //宽高
  263. // });
  264. // }
  265. </script>
  266. </body>
  267. </html>