| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782 |
- <html>
- <head>
- <style type="text/css">
- .el-row {
- margin-top: 12px;
- }
- /* 卡片 */
- .box-card {
- box-sizing: border-box;
- box-shadow: none !important;
- }
- .clearfix:before,
- .clearfix:after {
- display: table;
- content: "";
- }
- .clearfix:after {
- clear: both
- }
- .box-card .el-card__body {
- height: 420px;
- box-sizing: border-box;
- overflow-y: auto;
- }
- .box-card-right {
- float: right;
- }
- .tab-right.box-card-right {
- top: 20px;
- right: 20px;
- }
- .box-card-right i {
- margin-left: 8px;
- cursor: pointer;
- color: #409EFF;
- font-size: 16px;
- }
- .box-card-right i:hover {
- color: #66b1ff;
- }
- .urge-tbs .el-tabs__item {
- font-size: 16px;
- font-weight: normal;
- }
- .no-header {
- border: none !important;
- webkit-box-shadow: 0px 4px 5px 1px rgba(175, 175, 175, 0.1) !important;
- box-shadow: 0px 4px 5px 1px rgba(175, 175, 175, 0.1) !important;
- }
- .no-header .el-card__body {
- height: 115px;
- }
- .no-header .box-card-body {
- padding: 0 12px;
- }
- .card-main {
- text-align: center;
- }
- .card-main-left {
- float: left;
- border-radius: 3px;
- width: 60px;
- height: 60px;
- background-color: #409EFF;
- text-align: center;
- line-height: 80px;
- margin-top: 7px;
- }
- .card-main-left i {
- color: #fff;
- font-size: 40px;
- text-shadow: 3px 4px 3px #333;
- }
- .card-main h3 {
- font-size: 30px;
- font-family: Georgia;
- }
- .card-main-right {
- float: right;
- }
- .card-main-name {
- font-size: 14px;
- margin-top: 12px;
- }
- .card-main-desc {
- font-size: 12px;
- color: #666;
- }
- /* 文章排行 */
- .article-ranking,
- .article-ranking ul,
- .article-ranking li {
- width: 100%;
- }
- .article-ranking li {
- height: 38px;
- line-height: 38px;
- box-sizing: border-box;
- padding: 0 10px;
- }
- .article-ranking li:hover {
- background-color: #F2F8FE;
- }
- .article-ranking a:hover {
- color: #333;
- }
- .article-ranking-title {
- float: left;
- width: calc(100% - 100px);
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .article-ranking .el-tag {
- float: right;
- margin-top: 3px;
- }
- .article-ranking li:nth-child(1) .article-ranking-title span {
- color: #e64141;
- }
- .article-ranking li:nth-child(2) .article-ranking-title span {
- color: #E6A23C;
- }
- .article-ranking li:nth-child(3) .article-ranking-title span {
- color: #67C23A;
- }
- /* 时间线 */
- .timeline-main {
- -webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
- padding: 20px;
- border-radius: 4px;
- }
- .timeline-main:hover {
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .3);
- }
- .el-timeline .timeline-mesg {
- height: 56px;
- }
- .el-timeline .timeline-mesg img {
- width: 46px;
- height: 46px;
- float: left;
- }
- .timeline-mesg-name {
- margin-left: 58px;
- }
- .timeline-mesg-name p {
- margin-bottom: 3px;
- }
- .timeline-mesg-name span {
- color: #666;
- font-size: 13px;
- }
- .el-timeline .timeline-title {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- margin-top: 5px;
- margin-left: 60px;
- }
- .urge-tbs .el-tabs__item {
- font-size: 16px;
- font-weight: normal;
- }
- .space-tabs-nav li {
- position: relative;
- }
- .space-tabs-nav li .space-tabs-dot {
- position: absolute;
- right: 17px;
- top: 18px;
- width: 6px;
- height: 6px;
- border-radius: 50%;
- background-color: #f56c6c;
- }
- /* 待办框 */
- .box-card.box-card-tbs .el-card__body {
- height: 477px;
- padding-top: 0;
- overflow-y: hidden;
- }
- </style>
- </head>
- <body>
- <div id="space-content" style="background-color: transparent;">
- <el-row :gutter="12" style="margin-top: 0;">
- <el-col :span="6">
- <el-card class="box-card no-header" style="background-color: #e5faff;" title="数据将于每10分钟更新一次">
- <div class="box-card-body">
- <div class="card-main">
- <div class="card-main-left" style="background-color: #00d0ff;">
- <i class="el-icon-s-promotion layui-anim layui-anim-scale"></i>
- </div>
- <div class="card-main-right">
- <h3>{{statistics.normalTotal}}</h3>
- <p class="card-main-name">
- 网站总访问量
- </p>
- </div>
- </div>
- </div>
- </el-card>
- </el-col>
- <el-col :span="6">
- <el-card class="box-card no-header" style="background-color: #fae9dd;" title="数据将于每10分钟更新一次">
- <div class="box-card-body">
- <div class="card-main">
- <div class="card-main-left" style="background-color: #ffb177;">
- <i class="el-icon-s-order layui-anim layui-anim-scale"></i>
- </div>
- <div class="card-main-right">
- <h3>{{statistics.articleReadCount}}</h3>
- <p class="card-main-name">
- 文章总阅读量
- </p>
- </div>
- </div>
- </div>
- </el-card>
- </el-col>
- <el-col :span="6">
- <el-card class="box-card no-header" style="background-color: rgb(246 235 255);" title="数据将于每10分钟更新一次">
- <div class="box-card-body">
- <div class="card-main">
- <div class="card-main-left" style="background-color: #BE72FF;">
- <i class="el-icon-view layui-anim layui-anim-scale"></i>
- </div>
- <div class="card-main-right">
- <h3>{{statistics.todayWebsiteVisitCount}}</h3>
- <p class="card-main-name">
- 今日访问量
- </p>
- </div>
- </div>
- </div>
- </el-card>
- </el-col>
- <el-col :span="6">
- <el-card class="box-card no-header" style="background-color: #fcecec;" title="数据将于每10分钟更新一次">
- <div class="box-card-body">
- <div class="card-main">
- <div class="card-main-left" style="background-color: #e64141;">
- <i class="el-icon-aim layui-anim layui-anim-scale"></i>
- </div>
- <div class="card-main-right">
- <h3>{{statistics.errorTotal}}</h3>
- <p class="card-main-name">
- 疑似爬虫攻击
- </p>
- </div>
- </div>
- </div>
- </el-card>
- </el-col>
- </el-row>
- <el-row :gutter="12">
- <el-col :span="12">
- <el-card class="box-card box-card-tbs">
- <iframe src="@service{ name: `sys.sys_flow_number`, page:`sys.common_audit.flow_backlog_list` }@" style="width: 100%;height: 100%;"></iframe>
- </el-card>
- </el-col>
- <el-col :span="12">
- <el-card class="box-card">
- <div slot="header" class="clearfix">
- <span><i class="el-icon-data-line"></i> 网站访问折线图</span>
- <div class="box-card-right">
- <span class="layui-badge-rim">近七日</span>
- </div>
- </div>
- <div class="box-card-body">
- <div id="container" style="width: 100%; height: 380px;">
- </div>
- </div>
- </el-card>
- </el-col>
- </el-row>
- <el-row :gutter="12">
- <el-card class="box-card">
- <div slot="header" class="clearfix" style="line-height: 27px">
- <span><i class="el-icon-s-data"></i> 各网站本月发文数</span>
- <div class="box-card-right">
- <el-button size="mini"type="text" onclick='@service{ show:`true`, page:`issue_article_history` }@' >查看历史统计</el-button>
- </div>
- </div>
- <div class="box-card-body">
- <div id="container5" style="width: 100%; height: 380px;">
- </div>
- </div>
- </el-card>
- </el-row>
- <el-row :gutter="12">
- <el-col :span="6">
- <el-card class="box-card">
- <div slot="header" class="clearfix">
- <span><i class="el-icon-cpu"></i> CPU监控</span>
- <div class="box-card-right">
- <span class="layui-badge-rim">每5秒更新一次</span>
- </div>
- </div>
- <div class="box-card-body">
- <div id="container2" style="width: 100%; height: 380px;">
- </div>
- </div>
- </el-card>
- </el-col>
- <el-col :span="6">
- <el-card class="box-card">
- <div slot="header" class="clearfix">
- <span><i class="el-icon-odometer"></i> 内存监控</span>
- <div class="box-card-right">
- <span class="layui-badge-rim">每5秒更新一次</span>
- </div>
- </div>
- <div class="box-card-body">
- <div id="container3" style="width: 100%; height: 380px;">
- </div>
- </div>
- </el-card>
- </el-col>
- <!--<el-col :span="12">
- <el-card class="box-card">
- <div slot="header" class="clearfix">
- <span><i class="el-icon-news"></i> 近期动态</span>
- <div class="box-card-right">
- <span class="layui-badge-rim">数据每小时更新一次</span>
- </div>
- </div>
- <div class="box-card-body">
- <el-timeline>
- <el-timeline-item :timestamp="item.time" placement="top" v-for="(item,index) in timelineList" :key="index">
- <a :href="item.url" target="_blank" rel="noreferrer" >
- <div class="timeline-main">
- <div class="timeline-mesg">
- <img :src="item.icon_path" alt="">
- <div class="timeline-mesg-name">
- <p>{{item.uname}}</p>
- <span>{{item.dname}}</span>
- /
- <span>{{item.pname}}</span>
- </div>
- </div>
- <p class="timeline-title">
- 我发布了文章“ {{item.title}} ”
- </p>
- </div>
- </a>
- </el-timeline-item>
- </el-timeline>
- </div>
- </el-card>
- </el-col>-->
- <el-col :span="12">
- <el-card class="box-card">
- <div slot="header" class="clearfix">
- <span><i class="el-icon-s-data"></i> 文章点击排行</span>
- <div class="box-card-right">
- <span class="layui-badge-rim">数据每小时更新一次</span>
- </div>
- </div>
- <div class="box-card-body">
- <ul class="article-ranking">
- <li v-for="(item,index) in articleRanking" :key="index">
- <a :href="item.url" target="_blank" rel="noreferrer">
- <p class="article-ranking-title">
- <span>{{index+1}}、</span>
- {{item.title}}
- </p>
- <el-tag type="warning" effect="plain">
- {{item.read_count}}次阅读
- </el-tag>
- </a>
- </li>
- </ul>
- </div>
- </el-card>
- </el-col>
- </el-row>
- </div>
- </body>
- <script src="/apps/space/plug-in/echarts/echarts.min.js" type="text/javascript" charset="utf-8"></script>
- <script type="text/javascript">
- space.vue = new Vue({
- el: space.appContent,
- data: function () {
- return {
- v_loading: false,
- articleRanking: [],
- // timelineList: [],
- statistics: {
- articleReadCount: '-',
- todayWebsiteVisitCount: '-',
- normalTotal: '-',
- errorTotal: '-',
- }
- }
- },
- mounted: function () {
- var _this = this;
- // 近七天的访问总量
- space.utils.ajax({
- url: "@service{ name: 'website_visit_getSevenDaysVisit' }@",
- dataType: 'json',
- callback: function (resp) {
- initVisit(resp.data);
- }
- });
- // 文章排行
- space.utils.ajax({
- url: "@service{ name: 'website_visit_articleHot' }@",
- dataType: 'json',
- callback: function (resp) {
- _this.articleRanking = resp.data;
- }
- });
- // 文章发布动态
- // space.utils.ajax({
- // url: "@service{ name: 'website_visit_getIssueDynamic' }@",
- // dataType: 'json',
- // callback: function (resp) {
- // _this.timelineList = resp.data;
- // }
- // });
- // 顶部的四个统计
- space.utils.ajax({
- url: "@service{ name: 'website.website_visit_getIndexStatistics' }@",
- dataType: 'json',
- loadLayer: false,
- callback: function (resp) {
- _this.statistics = resp.data;
- }
- });
- },
- methods: {
- }
- })
- </script>
- <script type="text/javascript">
- var myChart2 = undefined;
- $(document).ready(function () {
- var dom2 = document.getElementById("container2");
- myChart2 = echarts.init(dom2);
- var app2 = {};
- var option2 = null;
- option2 = {
- tooltip: {
- formatter: '{a} <br/>{b} : {c}%'
- },
- toolbox: {
- feature: {
- restore: {},
- saveAsImage: {}
- }
- },
- series: [{
- name: 'CPU实时监控',
- type: 'gauge',
- detail: {
- formatter: '{value}%'
- },
- data: [{
- value: ((Math.random() * 10).toFixed(2) - 0 + 30).toFixed(1),
- name: 'CPU占用'
- }]
- }]
- };
- if (option2 && typeof option2 === "object") {
- myChart2.setOption(option2, true);
- }
- setInterval(function () {
- option2.series[0].data[0].value = ((Math.random() * 10).toFixed(2) - 0 + 30).toFixed(1);
- myChart2.setOption(option2, true);
- }, 5000);
- });
- </script>
- <script type="text/javascript">
- var myChart3 = undefined;
- $(document).ready(function () {
- var dom3 = document.getElementById("container3");
- myChart3 = echarts.init(dom3);
- var app3 = {};
- var option3 = null;
- option3 = {
- tooltip: {
- formatter: '{a} <br/>{b} : {c}%'
- },
- toolbox: {
- feature: {
- restore: {},
- saveAsImage: {}
- }
- },
- series: [{
- name: '内存实时监控',
- type: 'gauge',
- detail: {
- formatter: '{value}%'
- },
- data: [{
- value: ((Math.random() * 8).toFixed(2) - 0 + 50).toFixed(1),
- name: '内存占用'
- }]
- }]
- };
- if (option3 && typeof option3 === "object") {
- myChart3.setOption(option3, true);
- }
- setInterval(function () {
- option3.series[0].data[0].value = ((Math.random() * 8).toFixed(2) - 0 + 50).toFixed(1);
- myChart3.setOption(option3, true);
- }, 5000);
- });
- </script>
- <script type="text/javascript">
- var myChart = undefined;
- function initVisit(data) {
- var dom = document.getElementById("container");
- myChart = echarts.init(dom);
- var app = {};
- option = null;
- option = {
- title: {
- // text: '网站访问趋势'
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'cross',
- label: {
- backgroundColor: '#6a7985'
- }
- }
- },
- legend: {
- data: ['正常', '异常']
- },
- toolbox: {
- feature: {
- saveAsImage: {}
- }
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true
- },
- xAxis: [{
- type: 'category',
- boundaryGap: false,
- data: data.date
- }],
- yAxis: [{
- type: 'value'
- }],
- series: [{
- name: '异常',
- type: 'line',
- stack: '总量',
- smooth: true,
- itemStyle: {
- normal: {
- color: '#F56C6C',
- lineStyle: {
- color: '#F56C6C'
- }
- }
- },
- areaStyle: {
- color: '#F56C6C',
- },
- data: data.error
- },
- {
- name: '正常',
- type: 'line',
- stack: '总量',
- smooth: true,
- itemStyle: {
- normal: {
- color: '#3f85ed',
- lineStyle: {
- color: '#3f85ed'
- }
- }
- },
- areaStyle: {
- color: '#3f85ed'
- },
- data: data.normal
- },
- ]
- };
- if (option && typeof option === "object") {
- myChart.setOption(option, true);
- }
- }
- </script>
- <script type="text/javascript">
- var myChart5 = undefined;
- $(document).ready(function () {
- // 文章排行
- space.utils.ajax({
- url: '@service{ name: "website_visit_getWebsiteIssueArticleReport", params:`{dateType: "month", startDate: "current" }` }@',
- dataType: 'json',
- callback: function (resp) {
- if (resp.code != "success") {
- return;
- }
- var chartsDatas = {
- date: new Array(),
- label: new Array()
- }
- var index = 0;
- for (const key in resp.data) {
- const element = resp.data[key];
- chartsDatas.date[index] = element.count;
- chartsDatas.label[index] = element.name;
- index++;
- }
- initIssueArticleCount(chartsDatas);
- }
- });
- });
- function initIssueArticleCount(chartsDatas) {
- var dom5 = document.getElementById("container5");
- myChart5 = echarts.init(dom5);
- var app5 = {};
- var option5 = {
- color: ['#3398DB'],
- tooltip: {
- trigger: 'axis',
- axisPointer: { // 坐标轴指示器,坐标轴触发有效
- type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
- }
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true
- },
- xAxis: [
- {
- type: 'category',
- data: chartsDatas.label,
- axisLabel: {
- interval: 0,
- rotate: 40
- },
- axisTick: {
- alignWithLabel: true
- }
- }
- ],
- yAxis: [
- {
- type: 'value',
- },
- ],
- series: [
- {
- name: '发文数量',
- type: 'bar',
- barWidth: '60%',
- data: chartsDatas.date
- }
- ]
- };
- if (option5 && typeof option5 === "object") {
- myChart5.setOption(option5, true);
- }
- }
- </script>
- <script>
- window.onresize = function () {
- if (myChart) {
- myChart.resize();
- }
- if (myChart2) {
- myChart2.resize();
- }
- if (myChart3) {
- myChart3.resize();
- }
- if (myChart5) {
- myChart5.resize();
- }
- }
- </script>
- </html>
|