1006410406_edit.jsp 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. <html>
  2. <head>
  3. <style>
  4. .chatWarp {
  5. padding: 10px;
  6. }
  7. .chatWarp h2 {
  8. font-size: 16px;
  9. font-weight: bold;
  10. margin: 9px 0px;
  11. color: #666;
  12. }
  13. .sevenDayWarp {
  14. border-radius: 6px;
  15. background-color: #fff;
  16. height: 230px;
  17. border: 1px solid #f2f2f2;
  18. }
  19. .website-control {
  20. padding: 12px;
  21. }
  22. .website-control-title {
  23. margin-bottom: 10px;
  24. font-size: 16px;
  25. }
  26. .website-control-list ul {
  27. display: flex;
  28. justify-content: space-between;
  29. flex-wrap: wrap;
  30. }
  31. .website-control-list li {
  32. box-sizing: border-box;
  33. width: 49%;
  34. margin-bottom: 8px;
  35. padding: 6px 10px;
  36. border-radius: 6px;
  37. background: #fff url(/apps/space/images/mobile/monitoring/count.png) no-repeat 119% center;
  38. background-size: 40% !important;
  39. box-shadow: 0px 4px 5px 1px rgba(175, 175, 175, 0.1) !important;
  40. /* background-color: rgb(229, 250, 255);
  41. border: 1px solid rgb(0, 208, 255); */
  42. background-color: #fff;
  43. }
  44. .website-control-list li h2{
  45. color: rgb(0, 208, 255);
  46. }
  47. .website-control-list li:nth-child(2) {
  48. background-image: url(/apps/space/images/mobile/monitoring/today.png);
  49. /* background-color: rgb(250, 233, 221);
  50. border: 1px solid rgb(255, 177, 119); */
  51. }
  52. .website-control-list li:nth-child(2) h2{
  53. color: #14b56b;
  54. }
  55. .website-control-list li:nth-child(3) {
  56. background-image: url(/apps/space/images/mobile/monitoring/read.png);
  57. /* background-color: rgb(246, 235, 255);
  58. border: 1px solid rgb(190, 114, 255); */
  59. }
  60. .website-control-list li:nth-child(3) h2{
  61. color: rgb(190, 114, 255);
  62. }
  63. .website-control-list li:nth-child(4) {
  64. background-image: url(/apps/space/images/mobile/monitoring/bug.png);
  65. /* background-color: rgb(252, 236, 236);
  66. border: 1px solid rgb(230, 65, 65); */
  67. }
  68. .website-control-list li:nth-child(4) h2{
  69. color: rgb(230, 65, 65);
  70. }
  71. .website-control-list h2 {
  72. font-family: Georgia;
  73. font-size: 20px;
  74. line-height: 40px;
  75. }
  76. .website-control-list p {
  77. color: #373d4d;
  78. }
  79. /* 文章排行 */
  80. .article-ranking,
  81. .article-ranking ul,
  82. .article-ranking li {
  83. width: 100%;
  84. background-color: #fff;
  85. border-radius: 6px;
  86. }
  87. .article-ranking li {
  88. height: 38px;
  89. line-height: 38px;
  90. box-sizing: border-box;
  91. padding: 0px 3px 0px 10px;
  92. overflow: hidden;
  93. }
  94. .article-ranking li a{
  95. display: block;
  96. width: 100%;
  97. }
  98. .article-ranking li:hover {
  99. background-color: #F2F8FE;
  100. }
  101. .article-ranking a:hover {
  102. color: #333;
  103. }
  104. .article-ranking-title {
  105. float: left;
  106. width: calc(100% - 82px);
  107. /* overflow: hidden;
  108. text-overflow: ellipsis; */
  109. /* white-space: nowrap; */
  110. display: -webkit-box;
  111. -webkit-box-orient: vertical;
  112. -webkit-line-clamp: 1;
  113. overflow: hidden;
  114. }
  115. .article-ranking .el-tag {
  116. float: right;
  117. margin-top: 3px;
  118. }
  119. .article-ranking li:nth-child(1) .article-ranking-title span {
  120. color: #e64141;
  121. }
  122. .article-ranking li:nth-child(2) .article-ranking-title span {
  123. color: #E6A23C;
  124. }
  125. .article-ranking li:nth-child(3) .article-ranking-title span {
  126. color: #67C23A;
  127. }
  128. </style>
  129. </head>
  130. <body class="body-bg-gray">
  131. <div id="space-content">
  132. <div class="content-wrap">
  133. <div class="chatWarp" style="padding-top: 6px;padding-bottom: 0px;">
  134. <div class="website-control-list">
  135. <ul>
  136. <li>
  137. <a href="javascript:;">
  138. <h2>{{statistics.normalTotal}}</h2>
  139. <p>网站总访问量</p>
  140. </a>
  141. </li>
  142. <li>
  143. <a href="javascript:;">
  144. <h2>{{statistics.todayWebsiteVisitCount}}</h2>
  145. <p>今日访问量</p>
  146. </a>
  147. </li>
  148. <li>
  149. <a href="javascript:;">
  150. <h2>{{statistics.articleReadCount}}</h2>
  151. <p>文章总阅读量</p>
  152. </a>
  153. </li>
  154. <li>
  155. <a href="javascript:;">
  156. <h2>{{statistics.errorTotal}}</h2>
  157. <p>疑似爬虫攻击</p>
  158. </a>
  159. </li>
  160. </ul>
  161. </div>
  162. </div>
  163. <div class="chatWarp" style="padding-top: 0px;">
  164. <!-- <h2>近七日网站流量</h2> -->
  165. <div class="sevenDayWarp">
  166. <div id="sevenDayChatDom" style="width: 100%; height: 200px;margin-top: 12px;">
  167. </div>
  168. </div>
  169. </div>
  170. <div style="background-color: #fff;border-radius: 6px;margin: 0px 10px 10px 10px;padding: 0px;">
  171. <h2 style="color: #333333;font-size: 18px;fill: #333333;text-align: center;padding: 16px 0px 8px 0px;font-weight: normal;">文章阅读排行</h2>
  172. <ul class="article-ranking">
  173. <li v-for="(item,index) in articleRanking" :key="index" @click="articleInfo(item.articleid)">
  174. <a href="javascript:;" rel="noreferrer">
  175. <p class="article-ranking-title">
  176. <span>{{index+1}}、</span>
  177. {{item.title}}
  178. </p>
  179. <van-tag plain type="warning">
  180. {{item.read_count}}次阅读
  181. </van-tag>
  182. </a>
  183. </li>
  184. </ul>
  185. </div>
  186. </div>
  187. </div>
  188. </body>
  189. <!-- <script src="/apps/space/plug-in/echarts/echarts.min.js" type="text/javascript" charset="utf-8"></script> -->
  190. <script src="/apps/space/plug-in/Highcharts-8.2.2/highcharts.js"></script>
  191. <script type="text/javascript">
  192. space.vue = new Vue({
  193. el: space.appContent,
  194. data: function () {
  195. return {
  196. articleRanking: [],
  197. statistics: {
  198. articleReadCount: '-',
  199. todayWebsiteVisitCount: '-',
  200. normalTotal: '-',
  201. errorTotal: '-',
  202. }
  203. }
  204. },
  205. methods: {
  206. articleInfo: function(aid) {
  207. space.plugin.appWindow.show({
  208. "title": "加载中",
  209. "url": '@service{ name:`article_info`, page:`article_mobile.article_info` }@',
  210. "position": "right",
  211. "param": {
  212. "articleid": aid
  213. }
  214. });
  215. }
  216. },
  217. mounted: function () {
  218. var _this = this;
  219. // 顶部的四个统计
  220. space.utils.ajax({
  221. url: "@service{ name: 'website.website_visit_getIndexStatistics' }@",
  222. dataType: 'json',
  223. loadLayer: false,
  224. callback: function (resp) {
  225. _this.statistics = resp.data;
  226. }
  227. });
  228. // 文章排行
  229. space.utils.ajax({
  230. url: "@service{ name: 'website_visit_articleHot' }@",
  231. dataType: 'json',
  232. callback: function (resp) {
  233. _this.articleRanking = resp.data;
  234. }
  235. });
  236. // 近七天的访问总量
  237. space.utils.ajax({
  238. url: "@service{ name: 'website_visit_getSevenDaysVisit' }@",
  239. dataType: 'json',
  240. callback: function (resp) {
  241. initVisit(resp.data);
  242. }
  243. });
  244. }
  245. })
  246. </script>
  247. <script type="text/javascript">
  248. var sevenDayChart = undefined;
  249. function initVisit(data) {
  250. for (let index = 0; index < data.date.length; index++) {
  251. const element = data.date[index];
  252. data.date[index] = element.substring(element.indexOf("-") + 1);
  253. }
  254. for (let index = 0; index < data.normal.length; index++) {
  255. const element = data.normal[index];
  256. data.normal[index] = parseInt(element);
  257. }
  258. for (let index = 0; index < data.error.length; index++) {
  259. const element = data.error[index];
  260. data.error[index] = parseInt(element);
  261. }
  262. var dom = document.getElementById("sevenDayChatDom");
  263. // sevenDayChart = echarts.init(dom);
  264. var app = {};
  265. option = null;
  266. option = {
  267. credits: {
  268. // 去掉官网地址
  269. enabled: false
  270. },
  271. chart: {
  272. type: 'spline'
  273. },
  274. title: {
  275. text: '网站访问趋势'
  276. },
  277. tooltip: {
  278. split: true,
  279. backgroundColor: '#FCFFC5', // 背景颜色
  280. borderColor: 'black', // 边框颜色
  281. borderRadius: 10, // 边框圆角
  282. borderWidth: 3, // 边框宽度
  283. shadow: true, // 是否显示阴影
  284. animation: true // 是否启用动画效果
  285. },
  286. legend: {
  287. data: ['正常', '异常']
  288. },
  289. toolbox: {
  290. feature: {
  291. saveAsImage: {}
  292. }
  293. },
  294. grid: {
  295. left: '3%',
  296. right: '4%',
  297. bottom: '3%',
  298. containLabel: true
  299. },
  300. xAxis: [{
  301. categories: data.date,
  302. tickmarkPlacement: 'on',
  303. title: {
  304. enabled: false
  305. }
  306. }],
  307. yAxis: [{
  308. title:{
  309. text:'访问量'
  310. },
  311. labels: {
  312. formatter: function () {
  313. return this.value ;
  314. }
  315. }
  316. }],
  317. series: [{
  318. name: '正常',
  319. type: 'line',
  320. stack: '总量',
  321. smooth: true,
  322. color: '#3f85ed',
  323. data: data.normal
  324. },
  325. {
  326. name: '异常',
  327. type: 'line',
  328. stack: '总量',
  329. smooth: true,
  330. color: '#F56C6C',
  331. data: data.error
  332. },
  333. ]
  334. };
  335. if (option && typeof option === "object") {
  336. // sevenDayChart.setOption(option, true);
  337. var chart = Highcharts.chart('sevenDayChatDom', option)
  338. }
  339. }
  340. </script>
  341. </html>