1002810153_edit.jsp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782
  1. <html>
  2. <head>
  3. <style type="text/css">
  4. .el-row {
  5. margin-top: 12px;
  6. }
  7. /* 卡片 */
  8. .box-card {
  9. box-sizing: border-box;
  10. box-shadow: none !important;
  11. }
  12. .clearfix:before,
  13. .clearfix:after {
  14. display: table;
  15. content: "";
  16. }
  17. .clearfix:after {
  18. clear: both
  19. }
  20. .box-card .el-card__body {
  21. height: 420px;
  22. box-sizing: border-box;
  23. overflow-y: auto;
  24. }
  25. .box-card-right {
  26. float: right;
  27. }
  28. .tab-right.box-card-right {
  29. top: 20px;
  30. right: 20px;
  31. }
  32. .box-card-right i {
  33. margin-left: 8px;
  34. cursor: pointer;
  35. color: #409EFF;
  36. font-size: 16px;
  37. }
  38. .box-card-right i:hover {
  39. color: #66b1ff;
  40. }
  41. .urge-tbs .el-tabs__item {
  42. font-size: 16px;
  43. font-weight: normal;
  44. }
  45. .no-header {
  46. border: none !important;
  47. webkit-box-shadow: 0px 4px 5px 1px rgba(175, 175, 175, 0.1) !important;
  48. box-shadow: 0px 4px 5px 1px rgba(175, 175, 175, 0.1) !important;
  49. }
  50. .no-header .el-card__body {
  51. height: 115px;
  52. }
  53. .no-header .box-card-body {
  54. padding: 0 12px;
  55. }
  56. .card-main {
  57. text-align: center;
  58. }
  59. .card-main-left {
  60. float: left;
  61. border-radius: 3px;
  62. width: 60px;
  63. height: 60px;
  64. background-color: #409EFF;
  65. text-align: center;
  66. line-height: 80px;
  67. margin-top: 7px;
  68. }
  69. .card-main-left i {
  70. color: #fff;
  71. font-size: 40px;
  72. text-shadow: 3px 4px 3px #333;
  73. }
  74. .card-main h3 {
  75. font-size: 30px;
  76. font-family: Georgia;
  77. }
  78. .card-main-right {
  79. float: right;
  80. }
  81. .card-main-name {
  82. font-size: 14px;
  83. margin-top: 12px;
  84. }
  85. .card-main-desc {
  86. font-size: 12px;
  87. color: #666;
  88. }
  89. /* 文章排行 */
  90. .article-ranking,
  91. .article-ranking ul,
  92. .article-ranking li {
  93. width: 100%;
  94. }
  95. .article-ranking li {
  96. height: 38px;
  97. line-height: 38px;
  98. box-sizing: border-box;
  99. padding: 0 10px;
  100. }
  101. .article-ranking li:hover {
  102. background-color: #F2F8FE;
  103. }
  104. .article-ranking a:hover {
  105. color: #333;
  106. }
  107. .article-ranking-title {
  108. float: left;
  109. width: calc(100% - 100px);
  110. overflow: hidden;
  111. text-overflow: ellipsis;
  112. white-space: nowrap;
  113. }
  114. .article-ranking .el-tag {
  115. float: right;
  116. margin-top: 3px;
  117. }
  118. .article-ranking li:nth-child(1) .article-ranking-title span {
  119. color: #e64141;
  120. }
  121. .article-ranking li:nth-child(2) .article-ranking-title span {
  122. color: #E6A23C;
  123. }
  124. .article-ranking li:nth-child(3) .article-ranking-title span {
  125. color: #67C23A;
  126. }
  127. /* 时间线 */
  128. .timeline-main {
  129. -webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
  130. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
  131. padding: 20px;
  132. border-radius: 4px;
  133. }
  134. .timeline-main:hover {
  135. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .3);
  136. }
  137. .el-timeline .timeline-mesg {
  138. height: 56px;
  139. }
  140. .el-timeline .timeline-mesg img {
  141. width: 46px;
  142. height: 46px;
  143. float: left;
  144. }
  145. .timeline-mesg-name {
  146. margin-left: 58px;
  147. }
  148. .timeline-mesg-name p {
  149. margin-bottom: 3px;
  150. }
  151. .timeline-mesg-name span {
  152. color: #666;
  153. font-size: 13px;
  154. }
  155. .el-timeline .timeline-title {
  156. overflow: hidden;
  157. text-overflow: ellipsis;
  158. white-space: nowrap;
  159. margin-top: 5px;
  160. margin-left: 60px;
  161. }
  162. .urge-tbs .el-tabs__item {
  163. font-size: 16px;
  164. font-weight: normal;
  165. }
  166. .space-tabs-nav li {
  167. position: relative;
  168. }
  169. .space-tabs-nav li .space-tabs-dot {
  170. position: absolute;
  171. right: 17px;
  172. top: 18px;
  173. width: 6px;
  174. height: 6px;
  175. border-radius: 50%;
  176. background-color: #f56c6c;
  177. }
  178. /* 待办框 */
  179. .box-card.box-card-tbs .el-card__body {
  180. height: 477px;
  181. padding-top: 0;
  182. overflow-y: hidden;
  183. }
  184. </style>
  185. </head>
  186. <body>
  187. <div id="space-content" style="background-color: transparent;">
  188. <el-row :gutter="12" style="margin-top: 0;">
  189. <el-col :span="6">
  190. <el-card class="box-card no-header" style="background-color: #e5faff;" title="数据将于每10分钟更新一次">
  191. <div class="box-card-body">
  192. <div class="card-main">
  193. <div class="card-main-left" style="background-color: #00d0ff;">
  194. <i class="el-icon-s-promotion layui-anim layui-anim-scale"></i>
  195. </div>
  196. <div class="card-main-right">
  197. <h3>{{statistics.normalTotal}}</h3>
  198. <p class="card-main-name">
  199. 网站总访问量
  200. </p>
  201. </div>
  202. </div>
  203. </div>
  204. </el-card>
  205. </el-col>
  206. <el-col :span="6">
  207. <el-card class="box-card no-header" style="background-color: #fae9dd;" title="数据将于每10分钟更新一次">
  208. <div class="box-card-body">
  209. <div class="card-main">
  210. <div class="card-main-left" style="background-color: #ffb177;">
  211. <i class="el-icon-s-order layui-anim layui-anim-scale"></i>
  212. </div>
  213. <div class="card-main-right">
  214. <h3>{{statistics.articleReadCount}}</h3>
  215. <p class="card-main-name">
  216. 文章总阅读量
  217. </p>
  218. </div>
  219. </div>
  220. </div>
  221. </el-card>
  222. </el-col>
  223. <el-col :span="6">
  224. <el-card class="box-card no-header" style="background-color: rgb(246 235 255);" title="数据将于每10分钟更新一次">
  225. <div class="box-card-body">
  226. <div class="card-main">
  227. <div class="card-main-left" style="background-color: #BE72FF;">
  228. <i class="el-icon-view layui-anim layui-anim-scale"></i>
  229. </div>
  230. <div class="card-main-right">
  231. <h3>{{statistics.todayWebsiteVisitCount}}</h3>
  232. <p class="card-main-name">
  233. 今日访问量
  234. </p>
  235. </div>
  236. </div>
  237. </div>
  238. </el-card>
  239. </el-col>
  240. <el-col :span="6">
  241. <el-card class="box-card no-header" style="background-color: #fcecec;" title="数据将于每10分钟更新一次">
  242. <div class="box-card-body">
  243. <div class="card-main">
  244. <div class="card-main-left" style="background-color: #e64141;">
  245. <i class="el-icon-aim layui-anim layui-anim-scale"></i>
  246. </div>
  247. <div class="card-main-right">
  248. <h3>{{statistics.errorTotal}}</h3>
  249. <p class="card-main-name">
  250. 疑似爬虫攻击
  251. </p>
  252. </div>
  253. </div>
  254. </div>
  255. </el-card>
  256. </el-col>
  257. </el-row>
  258. <el-row :gutter="12">
  259. <el-col :span="12">
  260. <el-card class="box-card box-card-tbs">
  261. <iframe src="@service{ name: `sys.sys_flow_number`, page:`sys.common_audit.flow_backlog_list` }@" style="width: 100%;height: 100%;"></iframe>
  262. </el-card>
  263. </el-col>
  264. <el-col :span="12">
  265. <el-card class="box-card">
  266. <div slot="header" class="clearfix">
  267. <span><i class="el-icon-data-line"></i> 网站访问折线图</span>
  268. <div class="box-card-right">
  269. <span class="layui-badge-rim">近七日</span>
  270. </div>
  271. </div>
  272. <div class="box-card-body">
  273. <div id="container" style="width: 100%; height: 380px;">
  274. </div>
  275. </div>
  276. </el-card>
  277. </el-col>
  278. </el-row>
  279. <el-row :gutter="12">
  280. <el-card class="box-card">
  281. <div slot="header" class="clearfix" style="line-height: 27px">
  282. <span><i class="el-icon-s-data"></i> 各网站本月发文数</span>
  283. <div class="box-card-right">
  284. <el-button size="mini"type="text" onclick='@service{ show:`true`, page:`issue_article_history` }@' >查看历史统计</el-button>
  285. </div>
  286. </div>
  287. <div class="box-card-body">
  288. <div id="container5" style="width: 100%; height: 380px;">
  289. </div>
  290. </div>
  291. </el-card>
  292. </el-row>
  293. <el-row :gutter="12">
  294. <el-col :span="6">
  295. <el-card class="box-card">
  296. <div slot="header" class="clearfix">
  297. <span><i class="el-icon-cpu"></i> CPU监控</span>
  298. <div class="box-card-right">
  299. <span class="layui-badge-rim">每5秒更新一次</span>
  300. </div>
  301. </div>
  302. <div class="box-card-body">
  303. <div id="container2" style="width: 100%; height: 380px;">
  304. </div>
  305. </div>
  306. </el-card>
  307. </el-col>
  308. <el-col :span="6">
  309. <el-card class="box-card">
  310. <div slot="header" class="clearfix">
  311. <span><i class="el-icon-odometer"></i> 内存监控</span>
  312. <div class="box-card-right">
  313. <span class="layui-badge-rim">每5秒更新一次</span>
  314. </div>
  315. </div>
  316. <div class="box-card-body">
  317. <div id="container3" style="width: 100%; height: 380px;">
  318. </div>
  319. </div>
  320. </el-card>
  321. </el-col>
  322. <!--<el-col :span="12">
  323. <el-card class="box-card">
  324. <div slot="header" class="clearfix">
  325. <span><i class="el-icon-news"></i> 近期动态</span>
  326. <div class="box-card-right">
  327. <span class="layui-badge-rim">数据每小时更新一次</span>
  328. </div>
  329. </div>
  330. <div class="box-card-body">
  331. <el-timeline>
  332. <el-timeline-item :timestamp="item.time" placement="top" v-for="(item,index) in timelineList" :key="index">
  333. <a :href="item.url" target="_blank" rel="noreferrer" >
  334. <div class="timeline-main">
  335. <div class="timeline-mesg">
  336. <img :src="item.icon_path" alt="">
  337. <div class="timeline-mesg-name">
  338. <p>{{item.uname}}</p>
  339. <span>{{item.dname}}</span>
  340. /
  341. <span>{{item.pname}}</span>
  342. </div>
  343. </div>
  344. <p class="timeline-title">
  345. 我发布了文章“ {{item.title}} ”
  346. </p>
  347. </div>
  348. </a>
  349. </el-timeline-item>
  350. </el-timeline>
  351. </div>
  352. </el-card>
  353. </el-col>-->
  354. <el-col :span="12">
  355. <el-card class="box-card">
  356. <div slot="header" class="clearfix">
  357. <span><i class="el-icon-s-data"></i> 文章点击排行</span>
  358. <div class="box-card-right">
  359. <span class="layui-badge-rim">数据每小时更新一次</span>
  360. </div>
  361. </div>
  362. <div class="box-card-body">
  363. <ul class="article-ranking">
  364. <li v-for="(item,index) in articleRanking" :key="index">
  365. <a :href="item.url" target="_blank" rel="noreferrer">
  366. <p class="article-ranking-title">
  367. <span>{{index+1}}、</span>
  368. {{item.title}}
  369. </p>
  370. <el-tag type="warning" effect="plain">
  371. {{item.read_count}}次阅读
  372. </el-tag>
  373. </a>
  374. </li>
  375. </ul>
  376. </div>
  377. </el-card>
  378. </el-col>
  379. </el-row>
  380. </div>
  381. </body>
  382. <script src="/apps/space/plug-in/echarts/echarts.min.js" type="text/javascript" charset="utf-8"></script>
  383. <script type="text/javascript">
  384. space.vue = new Vue({
  385. el: space.appContent,
  386. data: function () {
  387. return {
  388. v_loading: false,
  389. articleRanking: [],
  390. // timelineList: [],
  391. statistics: {
  392. articleReadCount: '-',
  393. todayWebsiteVisitCount: '-',
  394. normalTotal: '-',
  395. errorTotal: '-',
  396. }
  397. }
  398. },
  399. mounted: function () {
  400. var _this = this;
  401. // 近七天的访问总量
  402. space.utils.ajax({
  403. url: "@service{ name: 'website_visit_getSevenDaysVisit' }@",
  404. dataType: 'json',
  405. callback: function (resp) {
  406. initVisit(resp.data);
  407. }
  408. });
  409. // 文章排行
  410. space.utils.ajax({
  411. url: "@service{ name: 'website_visit_articleHot' }@",
  412. dataType: 'json',
  413. callback: function (resp) {
  414. _this.articleRanking = resp.data;
  415. }
  416. });
  417. // 文章发布动态
  418. // space.utils.ajax({
  419. // url: "@service{ name: 'website_visit_getIssueDynamic' }@",
  420. // dataType: 'json',
  421. // callback: function (resp) {
  422. // _this.timelineList = resp.data;
  423. // }
  424. // });
  425. // 顶部的四个统计
  426. space.utils.ajax({
  427. url: "@service{ name: 'website.website_visit_getIndexStatistics' }@",
  428. dataType: 'json',
  429. loadLayer: false,
  430. callback: function (resp) {
  431. _this.statistics = resp.data;
  432. }
  433. });
  434. },
  435. methods: {
  436. }
  437. })
  438. </script>
  439. <script type="text/javascript">
  440. var myChart2 = undefined;
  441. $(document).ready(function () {
  442. var dom2 = document.getElementById("container2");
  443. myChart2 = echarts.init(dom2);
  444. var app2 = {};
  445. var option2 = null;
  446. option2 = {
  447. tooltip: {
  448. formatter: '{a} <br/>{b} : {c}%'
  449. },
  450. toolbox: {
  451. feature: {
  452. restore: {},
  453. saveAsImage: {}
  454. }
  455. },
  456. series: [{
  457. name: 'CPU实时监控',
  458. type: 'gauge',
  459. detail: {
  460. formatter: '{value}%'
  461. },
  462. data: [{
  463. value: ((Math.random() * 10).toFixed(2) - 0 + 30).toFixed(1),
  464. name: 'CPU占用'
  465. }]
  466. }]
  467. };
  468. if (option2 && typeof option2 === "object") {
  469. myChart2.setOption(option2, true);
  470. }
  471. setInterval(function () {
  472. option2.series[0].data[0].value = ((Math.random() * 10).toFixed(2) - 0 + 30).toFixed(1);
  473. myChart2.setOption(option2, true);
  474. }, 5000);
  475. });
  476. </script>
  477. <script type="text/javascript">
  478. var myChart3 = undefined;
  479. $(document).ready(function () {
  480. var dom3 = document.getElementById("container3");
  481. myChart3 = echarts.init(dom3);
  482. var app3 = {};
  483. var option3 = null;
  484. option3 = {
  485. tooltip: {
  486. formatter: '{a} <br/>{b} : {c}%'
  487. },
  488. toolbox: {
  489. feature: {
  490. restore: {},
  491. saveAsImage: {}
  492. }
  493. },
  494. series: [{
  495. name: '内存实时监控',
  496. type: 'gauge',
  497. detail: {
  498. formatter: '{value}%'
  499. },
  500. data: [{
  501. value: ((Math.random() * 8).toFixed(2) - 0 + 50).toFixed(1),
  502. name: '内存占用'
  503. }]
  504. }]
  505. };
  506. if (option3 && typeof option3 === "object") {
  507. myChart3.setOption(option3, true);
  508. }
  509. setInterval(function () {
  510. option3.series[0].data[0].value = ((Math.random() * 8).toFixed(2) - 0 + 50).toFixed(1);
  511. myChart3.setOption(option3, true);
  512. }, 5000);
  513. });
  514. </script>
  515. <script type="text/javascript">
  516. var myChart = undefined;
  517. function initVisit(data) {
  518. var dom = document.getElementById("container");
  519. myChart = echarts.init(dom);
  520. var app = {};
  521. option = null;
  522. option = {
  523. title: {
  524. // text: '网站访问趋势'
  525. },
  526. tooltip: {
  527. trigger: 'axis',
  528. axisPointer: {
  529. type: 'cross',
  530. label: {
  531. backgroundColor: '#6a7985'
  532. }
  533. }
  534. },
  535. legend: {
  536. data: ['正常', '异常']
  537. },
  538. toolbox: {
  539. feature: {
  540. saveAsImage: {}
  541. }
  542. },
  543. grid: {
  544. left: '3%',
  545. right: '4%',
  546. bottom: '3%',
  547. containLabel: true
  548. },
  549. xAxis: [{
  550. type: 'category',
  551. boundaryGap: false,
  552. data: data.date
  553. }],
  554. yAxis: [{
  555. type: 'value'
  556. }],
  557. series: [{
  558. name: '异常',
  559. type: 'line',
  560. stack: '总量',
  561. smooth: true,
  562. itemStyle: {
  563. normal: {
  564. color: '#F56C6C',
  565. lineStyle: {
  566. color: '#F56C6C'
  567. }
  568. }
  569. },
  570. areaStyle: {
  571. color: '#F56C6C',
  572. },
  573. data: data.error
  574. },
  575. {
  576. name: '正常',
  577. type: 'line',
  578. stack: '总量',
  579. smooth: true,
  580. itemStyle: {
  581. normal: {
  582. color: '#3f85ed',
  583. lineStyle: {
  584. color: '#3f85ed'
  585. }
  586. }
  587. },
  588. areaStyle: {
  589. color: '#3f85ed'
  590. },
  591. data: data.normal
  592. },
  593. ]
  594. };
  595. if (option && typeof option === "object") {
  596. myChart.setOption(option, true);
  597. }
  598. }
  599. </script>
  600. <script type="text/javascript">
  601. var myChart5 = undefined;
  602. $(document).ready(function () {
  603. // 文章排行
  604. space.utils.ajax({
  605. url: '@service{ name: "website_visit_getWebsiteIssueArticleReport", params:`{dateType: "month", startDate: "current" }` }@',
  606. dataType: 'json',
  607. callback: function (resp) {
  608. if (resp.code != "success") {
  609. return;
  610. }
  611. var chartsDatas = {
  612. date: new Array(),
  613. label: new Array()
  614. }
  615. var index = 0;
  616. for (const key in resp.data) {
  617. const element = resp.data[key];
  618. chartsDatas.date[index] = element.count;
  619. chartsDatas.label[index] = element.name;
  620. index++;
  621. }
  622. initIssueArticleCount(chartsDatas);
  623. }
  624. });
  625. });
  626. function initIssueArticleCount(chartsDatas) {
  627. var dom5 = document.getElementById("container5");
  628. myChart5 = echarts.init(dom5);
  629. var app5 = {};
  630. var option5 = {
  631. color: ['#3398DB'],
  632. tooltip: {
  633. trigger: 'axis',
  634. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  635. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  636. }
  637. },
  638. grid: {
  639. left: '3%',
  640. right: '4%',
  641. bottom: '3%',
  642. containLabel: true
  643. },
  644. xAxis: [
  645. {
  646. type: 'category',
  647. data: chartsDatas.label,
  648. axisLabel: {
  649. interval: 0,
  650. rotate: 40
  651. },
  652. axisTick: {
  653. alignWithLabel: true
  654. }
  655. }
  656. ],
  657. yAxis: [
  658. {
  659. type: 'value',
  660. },
  661. ],
  662. series: [
  663. {
  664. name: '发文数量',
  665. type: 'bar',
  666. barWidth: '60%',
  667. data: chartsDatas.date
  668. }
  669. ]
  670. };
  671. if (option5 && typeof option5 === "object") {
  672. myChart5.setOption(option5, true);
  673. }
  674. }
  675. </script>
  676. <script>
  677. window.onresize = function () {
  678. if (myChart) {
  679. myChart.resize();
  680. }
  681. if (myChart2) {
  682. myChart2.resize();
  683. }
  684. if (myChart3) {
  685. myChart3.resize();
  686. }
  687. if (myChart5) {
  688. myChart5.resize();
  689. }
  690. }
  691. </script>
  692. </html>