diff --git a/NewMediaMonitoring/settings.py b/NewMediaMonitoring/settings.py index b2cc19f..c27bf9a 100644 --- a/NewMediaMonitoring/settings.py +++ b/NewMediaMonitoring/settings.py @@ -169,6 +169,7 @@ SMS_ACCESS_KEY_ID = 'LTAIBfgqfC2fpIDF' SMS_ACCESS_KEY_SECRET = 'ocBzC2UvguYbyR6coNGYdPiV5HdWbC' +LOGIN_URL = '/' try: from .local_settings import * except ImportError as e: diff --git a/dashboard/templates/dashboard/index.html b/dashboard/templates/dashboard/index.html index 4aaca3c..cb9e559 100644 --- a/dashboard/templates/dashboard/index.html +++ b/dashboard/templates/dashboard/index.html @@ -163,7 +163,7 @@
-
+
时间/更新篇数 @@ -191,182 +191,16 @@
-
-
- -  PAGE VIEWS    UNIQUE VISITORS - - -        - - -
- - -
+
+
- {#
#} - {#
#} - {# #} - {#  CPU USAGE#} - {# #} - {# #} - {#

#} - {#
#} - {#
#} - {#  LONDON    PARIS#} - {#
#} - {# #} - {#
#} - {#
#} - - {#
#} -
-
- {#
#} - {#

Visitor's Statistics

#} - {#
#} - {#
#} - {#
#} - {#
#} - {#
#} - {#
#} - {#
#} - {#

Unique Visitors

#} - {# Last Week Rise by 62%#} - {#
#} - {#
#} - {#
#} - {#
#} - {#

Registrations

#} - {# Up by 57% last 7 days#} - {#
#} - {#
#} - {#
#} - {#
#} - {#

Direct Sales

#} - {# Last Month Rise by 22%#} - {#
#} - {#
#} - {#
#} - {#
#} - {#
#} - {#
#} - {#
#} - {##} - {#
#} - {#
#} - {##} - {##} - {#
#} - {#
#} - {#
#} - {#
#} - {#
#} - {#
#} - {# #} - {#
#} - {#
#} - {#
#} - {#
#} - {# #} - {# #} - {# #} - {# #} - {#
#} - {#
#} - {# #} - {# #} - {# #} - {#
#} - {#
#} - {#
#} - {##} - {#
#} - {#
#} - {#
#} - {#
#} - {##} - {#
#} - {#
#} - {#
Smoothing
#} - {#
#} - {#
#} - {#
#} - {#
Preview Range
#} - {#
#} - {#
#} - {#
#} - {##} - {#
#} - {# #} - {##} +
@@ -409,6 +243,128 @@ {% endblock %} \ No newline at end of file diff --git a/dashboard/views.py b/dashboard/views.py index 9a53376..43e67ea 100644 --- a/dashboard/views.py +++ b/dashboard/views.py @@ -43,9 +43,6 @@ def index(request): qita_count = Qita.objects.all().count() douyin_count = Douyin.objects.all().count() organization_count = Organization.objects.filter(status='1').count() - # year = datetime.datetime.now().year - # month = datetime.datetime.now().month - # month = datetime.datetime.now().month return render(request, 'dashboard/index.html', {'weixin_count': weixin_count, 'weibo_count': weibo_count, 'toutiao_count': toutiao_count, 'qita_count': qita_count, 'douyin_count': douyin_count, 'organization_count': organization_count}) diff --git a/monitor/static/monitor/js/index-map.js b/monitor/static/monitor/js/index-map.js index 563b7ed..a2dda68 100644 --- a/monitor/static/monitor/js/index-map.js +++ b/monitor/static/monitor/js/index-map.js @@ -53,7 +53,7 @@ function marker_click(marker,name){ contentType: false, success: function (res){ console.log(res); - var content = '微信:'+res.timelinessmonitoring_weixin+'
'+'微博:'+res.timelinessmonitoring_weibo+'
'+'头条:'+res.timelinessmonitoring_toutiao+'
'+'抖音:'+res.timelinessmonitoring_douyin+'
'+'其他:'+res.timelinessmonitoring_qita+'
'; + var content =''+name+''+'
'+ '微信:'+res.timelinessmonitoring_weixin+'
'+'微博:'+res.timelinessmonitoring_weibo+'
'+'头条:'+res.timelinessmonitoring_toutiao+'
'+'抖音:'+res.timelinessmonitoring_douyin+'
'+'其他:'+res.timelinessmonitoring_qita+'
'; marker.bindPopup(content).openPopup(); } }); diff --git a/monitor/templates/monitor/timeliness-monitoring-douyin.html b/monitor/templates/monitor/timeliness-monitoring-douyin.html index 07e4d90..538e78e 100644 --- a/monitor/templates/monitor/timeliness-monitoring-douyin.html +++ b/monitor/templates/monitor/timeliness-monitoring-douyin.html @@ -71,22 +71,23 @@
- -
-
+ +
@@ -277,6 +278,755 @@ myChart.setOption(option); }) - + $("#main1").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main2").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/weixin/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '微信更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main3").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/weibo/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '微博更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main4").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/toutiao/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '头条更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main5").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/douyin/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '抖音更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main6").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/qita/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '其他更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) {% endblock %} \ No newline at end of file diff --git a/monitor/templates/monitor/timeliness-monitoring-qita.html b/monitor/templates/monitor/timeliness-monitoring-qita.html index 6a3745a..ed1f1ea 100644 --- a/monitor/templates/monitor/timeliness-monitoring-qita.html +++ b/monitor/templates/monitor/timeliness-monitoring-qita.html @@ -71,8 +71,22 @@
-
-
+
@@ -264,6 +278,755 @@ myChart.setOption(option); }) - + $("#main1").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main2").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/weixin/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '微信更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main3").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/weibo/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '微博更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main4").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/toutiao/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '头条更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main5").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/douyin/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '抖音更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main6").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/qita/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '其他更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) {% endblock %} \ No newline at end of file diff --git a/monitor/templates/monitor/timeliness-monitoring-toutiao.html b/monitor/templates/monitor/timeliness-monitoring-toutiao.html index 35a4a8b..1bd1cec 100644 --- a/monitor/templates/monitor/timeliness-monitoring-toutiao.html +++ b/monitor/templates/monitor/timeliness-monitoring-toutiao.html @@ -71,8 +71,22 @@
-
-
+
@@ -262,6 +276,755 @@ myChart.setOption(option); }) - + $("#main1").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main2").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/weixin/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '微信更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main3").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/weibo/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '微博更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main4").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/toutiao/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '头条更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main5").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/douyin/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '抖音更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main6").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/qita/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '其他更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/monitor/templates/monitor/timeliness-monitoring-weibo.html b/monitor/templates/monitor/timeliness-monitoring-weibo.html index c5e4070..8323b60 100644 --- a/monitor/templates/monitor/timeliness-monitoring-weibo.html +++ b/monitor/templates/monitor/timeliness-monitoring-weibo.html @@ -71,8 +71,22 @@
-
-
+
@@ -262,6 +276,755 @@ myChart.setOption(option); }) - + $("#main1").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main2").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/weixin/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '微信更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main3").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/weibo/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '微博更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main4").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/toutiao/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '头条更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main5").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/douyin/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '抖音更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main6").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/qita/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '其他更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) {% endblock %} diff --git a/monitor/templates/monitor/timeliness-monitoring-weixin.html b/monitor/templates/monitor/timeliness-monitoring-weixin.html index 60f74e0..067706e 100644 --- a/monitor/templates/monitor/timeliness-monitoring-weixin.html +++ b/monitor/templates/monitor/timeliness-monitoring-weixin.html @@ -71,8 +71,22 @@
-
-
+
@@ -262,6 +276,755 @@ myChart.setOption(option); }) - + $("#main1").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main2").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/weixin/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '微信更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main3").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/weibo/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '微博更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main4").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/toutiao/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '头条更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main5").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/douyin/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '抖音更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) + $("#main6").on('click', function () { + console.log("main1") + $.getJSON('/monitor/timeliness/monitoring/json/qita/', function (res) { + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + option = { + title: { + text: '其他更新次数/时间' + }, + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州'] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + toolbox: { + feature: { + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: res.date + }, + yAxis: { + type: 'value' + }, + series: [ + { + name: '兰州市', + type: 'line', + stack: '总量', + data: res.lanzhou + }, + { + name: '嘉峪关市', + type: 'line', + stack: '总量', + data: res.jiayuguan + }, + { + name: '金昌市', + type: 'line', + stack: '总量', + data: res.jinchang + }, + { + name: '酒泉市', + type: 'line', + stack: '总量', + data: res.jiuquan + }, + { + name: '张掖市', + type: 'line', + stack: '总量', + data: res.zhangye + }, + { + name: '武威市', + type: 'line', + stack: '总量', + data: res.wuwei + }, + { + name: '白银市', + type: 'line', + stack: '总量', + data: res.baiyin + }, + { + name: '天水市', + type: 'line', + stack: '总量', + data: res.tianshui + }, + { + name: '平凉市', + type: 'line', + stack: '总量', + data: res.pingliang + }, + { + name: '庆阳市', + type: 'line', + stack: '总量', + data: res.qingyang + }, + { + name: '定西市', + type: 'line', + stack: '总量', + data: res.dingxi + }, + { + name: '陇南市', + type: 'line', + stack: '总量', + data: res.longnan + }, + { + name: '甘南州', + type: 'line', + stack: '总量', + data: res.gannan + }, + { + name: '临夏州', + type: 'line', + stack: '总量', + data: res.linxia + } + ] + }; + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + }) + }) {% endblock %} diff --git a/monitor/urls.py b/monitor/urls.py index b7370b9..e3a5669 100644 --- a/monitor/urls.py +++ b/monitor/urls.py @@ -11,6 +11,11 @@ urlpatterns = [ path('new/media/public/opinion/qita/',views.new_media_public_opinion_qita,name='monitor-new-media-public-opinion-qita'), #时效性监测 path('timeliness/monitoring/json/',views.timeliness_monitoring_json,name='monitor-timeliness-monitoring-json'), + path('timeliness/monitoring/json/weixin/',views.timeliness_monitoring_json_weixin,name='monitor-timeliness-monitoring-json-weixin'), + path('timeliness/monitoring/json/weibo/',views.timeliness_monitoring_json_weibo,name='monitor-timeliness-monitoring-json-weibo'), + path('timeliness/monitoring/json/toutiao/',views.timeliness_monitoring_json_toutiao,name='monitor-timeliness-monitoring-json-toutiao'), + path('timeliness/monitoring/json/douyin/',views.timeliness_monitoring_json_douyin,name='monitor-timeliness-monitoring-json-douyin'), + path('timeliness/monitoring/json/qita/',views.timeliness_monitoring_json_qita,name='monitor-timeliness-monitoring-json-qita'), path('timeliness/monitoring/weixin/',views.timeliness_monitoring_weixin,name='monitor-timeliness-monitoring-weixin'), path('timeliness/monitoring/weibo/',views.timeliness_monitoring_weibo,name='monitor-timeliness-monitoring-weibo'), path('timeliness/monitoring/toutiao/',views.timeliness_monitoring_toutiao,name='monitor-timeliness-monitoring-toutiao'), diff --git a/monitor/views.py b/monitor/views.py index 62f186f..6eadb98 100644 --- a/monitor/views.py +++ b/monitor/views.py @@ -4,6 +4,7 @@ import json from collections import Counter import jieba +from django.contrib.auth.decorators import login_required from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage from django.db.models import Sum from django.http import HttpResponse, JsonResponse @@ -16,7 +17,7 @@ from dashboard.models import Weixin, Weixin_data, Toutiao_data, Weibo_data, Qita Douyin, Douyin_data, News, TimelinessMonitoring, Organization, Wrongly from monitor.models import Test - +@login_required def new_media_public_opinion_weixin(request): weixin = Weixin.objects.all() group = Group.objects.all() @@ -36,7 +37,7 @@ def new_media_public_opinion_weixin(request): return render(request, 'monitor/new-media-public-opinion-weixin.html', {'res': res, 'weixin': weixin, 'group': group}) - +@login_required def new_media_public_opinion_toutiao(request): toutiao = Toutiao.objects.all() group = Group.objects.all() @@ -58,7 +59,7 @@ def new_media_public_opinion_toutiao(request): return render(request, 'monitor/new-media-public-opinion-toutiao.html', {'res': res, 'toutiao': toutiao, 'group': group}) - +@login_required def new_media_public_opinion_douyin(request): douyin = Douyin.objects.all() group = Group.objects.all() @@ -78,7 +79,7 @@ def new_media_public_opinion_douyin(request): return render(request, 'monitor/new-media-public-opinion-douyin.html', {'res': res, 'douyin': douyin, 'group': group}) - +@login_required def new_media_public_opinion_weibo(request): weibo = Weibo.objects.all() group = Group.objects.all() @@ -99,7 +100,7 @@ def new_media_public_opinion_weibo(request): res.append(o) return render(request, 'monitor/new-media-public-opinion-weibo.html', {'res': res, 'weibo': weibo, 'group': group}) - +@login_required def new_media_public_opinion_qita(request): qita = Qita.objects.all() group = Group.objects.all() @@ -121,7 +122,7 @@ def new_media_public_opinion_qita(request): res.append(o) return render(request, 'monitor/new-media-public-opinion-qita.html', {'res': res, 'qita': qita, 'group': group}) - +@login_required def timeliness_monitoring_weixin(request): now = datetime.datetime.now() # 本周第一天和最后一天 @@ -196,7 +197,7 @@ def timeliness_monitoring_weixin(request): 'organization_count_week': organization_count_week, 'res': res, 'timelinessmonitoring': timelinessmonitoring}) - +@login_required def timeliness_monitoring_weibo(request): now = datetime.datetime.now() # 本周第一天和最后一天 @@ -271,7 +272,7 @@ def timeliness_monitoring_weibo(request): 'organization_count_week': organization_count_week, 'res': res, 'timelinessmonitoring': timelinessmonitoring}) - +@login_required def timeliness_monitoring_toutiao(request): now = datetime.datetime.now() # 本周第一天和最后一天 @@ -346,7 +347,7 @@ def timeliness_monitoring_toutiao(request): 'organization_count_week': organization_count_week, 'res': res, 'timelinessmonitoring': timelinessmonitoring}) - +@login_required def timeliness_monitoring_douyin(request): now = datetime.datetime.now() # 本周第一天和最后一天 @@ -421,7 +422,7 @@ def timeliness_monitoring_douyin(request): 'organization_count_week': organization_count_week, 'res': res, 'timelinessmonitoring': timelinessmonitoring}) - +@login_required def timeliness_monitoring_qita(request): now = datetime.datetime.now() # 本周第一天和最后一天 @@ -497,7 +498,7 @@ def timeliness_monitoring_qita(request): 'organization_count_week': organization_count_week, 'res': res, 'timelinessmonitoring': timelinessmonitoring}) - +@login_required def error_monitoring(request): wrongly = Wrongly.objects.all() paginator = Paginator(wrongly, 8) @@ -510,16 +511,16 @@ def error_monitoring(request): wrongly = paginator.page(paginator.num_pages) return render(request, 'monitor/error-monitoring.html',{'wrongly':wrongly}) - +@login_required def sensitive_word_monitoring(request): data = range(1,8) return render(request, 'monitor/sensitive-word-monitoring.html',{'data':data}) - +@login_required def comment_on_interactive_monitoring(request): return render(request, 'monitor/comment-on-interactive-monitoring.html') - +@login_required def comment_on_interactive_monitoring_json(request): data = Test.objects.all()[:100] r = [] @@ -545,13 +546,13 @@ def comment_on_interactive_monitoring_json(request): "res": res })) - +@login_required def monitoring_report(request): news = News.objects.filter(type='3').order_by('-date') count = News.objects.filter(type='3').count() return render(request, 'monitor/monitoring-report.html', {'news': news, 'count': count}) - +@login_required def monitoring_report_json(request): news = News.objects.filter(type='3').order_by('date') # year_now = datetime.datetime.now().year @@ -571,7 +572,7 @@ def monitoring_report_json(request): def test(request): return render(request, 'monitor/test.html') - +@login_required def test_json(request): res = [] with open('D:/2020/舆论监测平台/新媒体监测数据/平凉/Result_PL.csv', encoding='utf-8') as csvfile: @@ -598,7 +599,7 @@ def test_json(request): "res": res })) - +@login_required def timeliness_monitoring_json(request): # timelinessmonitoring_lanzhou_weixin = \ # TimelinessMonitoring.objects.filter(city='兰州市', n_type='微信').aggregate(nums=Sum('update'))['nums'] @@ -828,6 +829,278 @@ def timeliness_monitoring_json(request): "linxia":linxia, "date":date_list, })) + +@login_required +def timeliness_monitoring_json_weixin(request): + date = TimelinessMonitoring.objects.distinct('date') + date_list = [] + lanzhou = [] + jiayuguan = [] + jinchang = [] + jiuquan = [] + zhangye = [] + wuwei = [] + baiyin = [] + tianshui = [] + pingliang = [] + qingyang = [] + dingxi = [] + longnan = [] + gannan = [] + linxia = [] + for d in date: + date_list.append(d.date) + print(str(d.date)+"1111111111111111111111111") + lanzhou.append(TimelinessMonitoring.objects.filter(city__contains='兰州',date=d.date,n_type='微信').aggregate(nums=Sum('update'))['nums']) + jiayuguan.append(TimelinessMonitoring.objects.filter(city__contains='嘉峪关',date=d.date,n_type='微信').aggregate(nums=Sum('update'))['nums']) + jinchang.append(TimelinessMonitoring.objects.filter(city__contains='金昌',date=d.date,n_type='微信').aggregate(nums=Sum('update'))['nums']) + jiuquan.append(TimelinessMonitoring.objects.filter(city__contains='酒泉',date=d.date,n_type='微信').aggregate(nums=Sum('update'))['nums']) + zhangye.append(TimelinessMonitoring.objects.filter(city__contains='张掖',date=d.date,n_type='微信').aggregate(nums=Sum('update'))['nums']) + wuwei.append(TimelinessMonitoring.objects.filter(city__contains='武威',date=d.date,n_type='微信').aggregate(nums=Sum('update'))['nums']) + baiyin.append(TimelinessMonitoring.objects.filter(city__contains='白银',date=d.date,n_type='微信').aggregate(nums=Sum('update'))['nums']) + tianshui.append(TimelinessMonitoring.objects.filter(city__contains='天水',date=d.date,n_type='微信').aggregate(nums=Sum('update'))['nums']) + pingliang.append(TimelinessMonitoring.objects.filter(city__contains='平凉',date=d.date,n_type='微信').aggregate(nums=Sum('update'))['nums']) + qingyang.append(TimelinessMonitoring.objects.filter(city__contains='庆阳',date=d.date,n_type='微信').aggregate(nums=Sum('update'))['nums']) + dingxi.append(TimelinessMonitoring.objects.filter(city__contains='定西',date=d.date,n_type='微信').aggregate(nums=Sum('update'))['nums']) + longnan.append(TimelinessMonitoring.objects.filter(city__contains='陇南',date=d.date,n_type='微信').aggregate(nums=Sum('update'))['nums']) + gannan.append(TimelinessMonitoring.objects.filter(city__contains='甘南',date=d.date,n_type='微信').aggregate(nums=Sum('update'))['nums']) + linxia.append(TimelinessMonitoring.objects.filter(city__contains='临夏',date=d.date,n_type='微信').aggregate(nums=Sum('update'))['nums']) + return HttpResponse(json.dumps({ + "status":"1", + "lanzhou":lanzhou, + "jiayuguan":jiayuguan, + "jinchang":jinchang, + "jiuquan":jiuquan, + "zhangye":zhangye, + "wuwei":wuwei, + "baiyin":baiyin, + "tianshui":tianshui, + "pingliang":pingliang, + "qingyang":qingyang, + "dingxi":dingxi, + "longnan":longnan, + "gannan":gannan, + "linxia":linxia, + "date":date_list, + })) + +@login_required +def timeliness_monitoring_json_weibo(request): + date = TimelinessMonitoring.objects.distinct('date') + date_list = [] + lanzhou = [] + jiayuguan = [] + jinchang = [] + jiuquan = [] + zhangye = [] + wuwei = [] + baiyin = [] + tianshui = [] + pingliang = [] + qingyang = [] + dingxi = [] + longnan = [] + gannan = [] + linxia = [] + for d in date: + date_list.append(d.date) + print(str(d.date)+"1111111111111111111111111") + lanzhou.append(TimelinessMonitoring.objects.filter(city__contains='兰州',date=d.date,n_type='微博').aggregate(nums=Sum('update'))['nums']) + jiayuguan.append(TimelinessMonitoring.objects.filter(city__contains='嘉峪关',date=d.date,n_type='微博').aggregate(nums=Sum('update'))['nums']) + jinchang.append(TimelinessMonitoring.objects.filter(city__contains='金昌',date=d.date,n_type='微博').aggregate(nums=Sum('update'))['nums']) + jiuquan.append(TimelinessMonitoring.objects.filter(city__contains='酒泉',date=d.date,n_type='微博').aggregate(nums=Sum('update'))['nums']) + zhangye.append(TimelinessMonitoring.objects.filter(city__contains='张掖',date=d.date,n_type='微博').aggregate(nums=Sum('update'))['nums']) + wuwei.append(TimelinessMonitoring.objects.filter(city__contains='武威',date=d.date,n_type='微博').aggregate(nums=Sum('update'))['nums']) + baiyin.append(TimelinessMonitoring.objects.filter(city__contains='白银',date=d.date,n_type='微博').aggregate(nums=Sum('update'))['nums']) + tianshui.append(TimelinessMonitoring.objects.filter(city__contains='天水',date=d.date,n_type='微博').aggregate(nums=Sum('update'))['nums']) + pingliang.append(TimelinessMonitoring.objects.filter(city__contains='平凉',date=d.date,n_type='微博').aggregate(nums=Sum('update'))['nums']) + qingyang.append(TimelinessMonitoring.objects.filter(city__contains='庆阳',date=d.date,n_type='微博').aggregate(nums=Sum('update'))['nums']) + dingxi.append(TimelinessMonitoring.objects.filter(city__contains='定西',date=d.date,n_type='微博').aggregate(nums=Sum('update'))['nums']) + longnan.append(TimelinessMonitoring.objects.filter(city__contains='陇南',date=d.date,n_type='微博').aggregate(nums=Sum('update'))['nums']) + gannan.append(TimelinessMonitoring.objects.filter(city__contains='甘南',date=d.date,n_type='微博').aggregate(nums=Sum('update'))['nums']) + linxia.append(TimelinessMonitoring.objects.filter(city__contains='临夏',date=d.date,n_type='微博').aggregate(nums=Sum('update'))['nums']) + return HttpResponse(json.dumps({ + "status":"1", + "lanzhou":lanzhou, + "jiayuguan":jiayuguan, + "jinchang":jinchang, + "jiuquan":jiuquan, + "zhangye":zhangye, + "wuwei":wuwei, + "baiyin":baiyin, + "tianshui":tianshui, + "pingliang":pingliang, + "qingyang":qingyang, + "dingxi":dingxi, + "longnan":longnan, + "gannan":gannan, + "linxia":linxia, + "date":date_list, + })) + +@login_required +def timeliness_monitoring_json_toutiao(request): + date = TimelinessMonitoring.objects.distinct('date') + date_list = [] + lanzhou = [] + jiayuguan = [] + jinchang = [] + jiuquan = [] + zhangye = [] + wuwei = [] + baiyin = [] + tianshui = [] + pingliang = [] + qingyang = [] + dingxi = [] + longnan = [] + gannan = [] + linxia = [] + for d in date: + date_list.append(d.date) + print(str(d.date)+"1111111111111111111111111") + lanzhou.append(TimelinessMonitoring.objects.filter(city__contains='兰州',date=d.date,n_type__contains='头条').aggregate(nums=Sum('update'))['nums']) + jiayuguan.append(TimelinessMonitoring.objects.filter(city__contains='嘉峪关',date=d.date,n_type__contains='头条').aggregate(nums=Sum('update'))['nums']) + jinchang.append(TimelinessMonitoring.objects.filter(city__contains='金昌',date=d.date,n_type__contains='头条').aggregate(nums=Sum('update'))['nums']) + jiuquan.append(TimelinessMonitoring.objects.filter(city__contains='酒泉',date=d.date,n_type__contains='头条').aggregate(nums=Sum('update'))['nums']) + zhangye.append(TimelinessMonitoring.objects.filter(city__contains='张掖',date=d.date,n_type__contains='头条').aggregate(nums=Sum('update'))['nums']) + wuwei.append(TimelinessMonitoring.objects.filter(city__contains='武威',date=d.date,n_type__contains='头条').aggregate(nums=Sum('update'))['nums']) + baiyin.append(TimelinessMonitoring.objects.filter(city__contains='白银',date=d.date,n_type__contains='头条').aggregate(nums=Sum('update'))['nums']) + tianshui.append(TimelinessMonitoring.objects.filter(city__contains='天水',date=d.date,n_type__contains='头条').aggregate(nums=Sum('update'))['nums']) + pingliang.append(TimelinessMonitoring.objects.filter(city__contains='平凉',date=d.date,n_type__contains='头条').aggregate(nums=Sum('update'))['nums']) + qingyang.append(TimelinessMonitoring.objects.filter(city__contains='庆阳',date=d.date,n_type__contains='头条').aggregate(nums=Sum('update'))['nums']) + dingxi.append(TimelinessMonitoring.objects.filter(city__contains='定西',date=d.date,n_type__contains='头条').aggregate(nums=Sum('update'))['nums']) + longnan.append(TimelinessMonitoring.objects.filter(city__contains='陇南',date=d.date,n_type__contains='头条').aggregate(nums=Sum('update'))['nums']) + gannan.append(TimelinessMonitoring.objects.filter(city__contains='甘南',date=d.date,n_type__contains='头条').aggregate(nums=Sum('update'))['nums']) + linxia.append(TimelinessMonitoring.objects.filter(city__contains='临夏',date=d.date,n_type__contains='头条').aggregate(nums=Sum('update'))['nums']) + return HttpResponse(json.dumps({ + "status":"1", + "lanzhou":lanzhou, + "jiayuguan":jiayuguan, + "jinchang":jinchang, + "jiuquan":jiuquan, + "zhangye":zhangye, + "wuwei":wuwei, + "baiyin":baiyin, + "tianshui":tianshui, + "pingliang":pingliang, + "qingyang":qingyang, + "dingxi":dingxi, + "longnan":longnan, + "gannan":gannan, + "linxia":linxia, + "date":date_list, + })) + +@login_required +def timeliness_monitoring_json_douyin(request): + date = TimelinessMonitoring.objects.distinct('date') + date_list = [] + lanzhou = [] + jiayuguan = [] + jinchang = [] + jiuquan = [] + zhangye = [] + wuwei = [] + baiyin = [] + tianshui = [] + pingliang = [] + qingyang = [] + dingxi = [] + longnan = [] + gannan = [] + linxia = [] + for d in date: + date_list.append(d.date) + print(str(d.date)+"1111111111111111111111111") + lanzhou.append(TimelinessMonitoring.objects.filter(city__contains='兰州',date=d.date,n_type__contains='抖音').aggregate(nums=Sum('update'))['nums']) + jiayuguan.append(TimelinessMonitoring.objects.filter(city__contains='嘉峪关',date=d.date,n_type__contains='抖音').aggregate(nums=Sum('update'))['nums']) + jinchang.append(TimelinessMonitoring.objects.filter(city__contains='金昌',date=d.date,n_type__contains='抖音').aggregate(nums=Sum('update'))['nums']) + jiuquan.append(TimelinessMonitoring.objects.filter(city__contains='酒泉',date=d.date,n_type__contains='抖音').aggregate(nums=Sum('update'))['nums']) + zhangye.append(TimelinessMonitoring.objects.filter(city__contains='张掖',date=d.date,n_type__contains='抖音').aggregate(nums=Sum('update'))['nums']) + wuwei.append(TimelinessMonitoring.objects.filter(city__contains='武威',date=d.date,n_type__contains='抖音').aggregate(nums=Sum('update'))['nums']) + baiyin.append(TimelinessMonitoring.objects.filter(city__contains='白银',date=d.date,n_type__contains='抖音').aggregate(nums=Sum('update'))['nums']) + tianshui.append(TimelinessMonitoring.objects.filter(city__contains='天水',date=d.date,n_type__contains='抖音').aggregate(nums=Sum('update'))['nums']) + pingliang.append(TimelinessMonitoring.objects.filter(city__contains='平凉',date=d.date,n_type__contains='抖音').aggregate(nums=Sum('update'))['nums']) + qingyang.append(TimelinessMonitoring.objects.filter(city__contains='庆阳',date=d.date,n_type__contains='抖音').aggregate(nums=Sum('update'))['nums']) + dingxi.append(TimelinessMonitoring.objects.filter(city__contains='定西',date=d.date,n_type__contains='抖音').aggregate(nums=Sum('update'))['nums']) + longnan.append(TimelinessMonitoring.objects.filter(city__contains='陇南',date=d.date,n_type__contains='抖音').aggregate(nums=Sum('update'))['nums']) + gannan.append(TimelinessMonitoring.objects.filter(city__contains='甘南',date=d.date,n_type__contains='抖音').aggregate(nums=Sum('update'))['nums']) + linxia.append(TimelinessMonitoring.objects.filter(city__contains='临夏',date=d.date,n_type__contains='抖音').aggregate(nums=Sum('update'))['nums']) + return HttpResponse(json.dumps({ + "status":"1", + "lanzhou":lanzhou, + "jiayuguan":jiayuguan, + "jinchang":jinchang, + "jiuquan":jiuquan, + "zhangye":zhangye, + "wuwei":wuwei, + "baiyin":baiyin, + "tianshui":tianshui, + "pingliang":pingliang, + "qingyang":qingyang, + "dingxi":dingxi, + "longnan":longnan, + "gannan":gannan, + "linxia":linxia, + "date":date_list, + })) + +@login_required +def timeliness_monitoring_json_qita(request): + date = TimelinessMonitoring.objects.distinct('date') + date_list = [] + lanzhou = [] + jiayuguan = [] + jinchang = [] + jiuquan = [] + zhangye = [] + wuwei = [] + baiyin = [] + tianshui = [] + pingliang = [] + qingyang = [] + dingxi = [] + longnan = [] + gannan = [] + linxia = [] + for d in date: + date_list.append(d.date) + print(str(d.date)+"1111111111111111111111111") + lanzhou.append(TimelinessMonitoring.objects.filter(city__contains='兰州',date=d.date).exclude(n_type__in=['微信', '微博', '今日头条', '抖音']).aggregate(nums=Sum('update'))['nums']) + jiayuguan.append(TimelinessMonitoring.objects.filter(city__contains='嘉峪关',date=d.date).exclude(n_type__in=['微信', '微博', '今日头条', '抖音']).aggregate(nums=Sum('update'))['nums']) + jinchang.append(TimelinessMonitoring.objects.filter(city__contains='金昌',date=d.date).exclude(n_type__in=['微信', '微博', '今日头条', '抖音']).aggregate(nums=Sum('update'))['nums']) + jiuquan.append(TimelinessMonitoring.objects.filter(city__contains='酒泉',date=d.date).exclude(n_type__in=['微信', '微博', '今日头条', '抖音']).aggregate(nums=Sum('update'))['nums']) + zhangye.append(TimelinessMonitoring.objects.filter(city__contains='张掖',date=d.date).exclude(n_type__in=['微信', '微博', '今日头条', '抖音']).aggregate(nums=Sum('update'))['nums']) + wuwei.append(TimelinessMonitoring.objects.filter(city__contains='武威',date=d.date).exclude(n_type__in=['微信', '微博', '今日头条', '抖音']).aggregate(nums=Sum('update'))['nums']) + baiyin.append(TimelinessMonitoring.objects.filter(city__contains='白银',date=d.date).exclude(n_type__in=['微信', '微博', '今日头条', '抖音']).aggregate(nums=Sum('update'))['nums']) + tianshui.append(TimelinessMonitoring.objects.filter(city__contains='天水',date=d.date).exclude(n_type__in=['微信', '微博', '今日头条', '抖音']).aggregate(nums=Sum('update'))['nums']) + pingliang.append(TimelinessMonitoring.objects.filter(city__contains='平凉',date=d.date).exclude(n_type__in=['微信', '微博', '今日头条', '抖音']).aggregate(nums=Sum('update'))['nums']) + qingyang.append(TimelinessMonitoring.objects.filter(city__contains='庆阳',date=d.date).exclude(n_type__in=['微信', '微博', '今日头条', '抖音']).aggregate(nums=Sum('update'))['nums']) + dingxi.append(TimelinessMonitoring.objects.filter(city__contains='定西',date=d.date).exclude(n_type__in=['微信', '微博', '今日头条', '抖音']).aggregate(nums=Sum('update'))['nums']) + longnan.append(TimelinessMonitoring.objects.filter(city__contains='陇南',date=d.date).exclude(n_type__in=['微信', '微博', '今日头条', '抖音']).aggregate(nums=Sum('update'))['nums']) + gannan.append(TimelinessMonitoring.objects.filter(city__contains='甘南',date=d.date).exclude(n_type__in=['微信', '微博', '今日头条', '抖音']).aggregate(nums=Sum('update'))['nums']) + linxia.append(TimelinessMonitoring.objects.filter(city__contains='临夏',date=d.date).exclude(n_type__in=['微信', '微博', '今日头条', '抖音']).aggregate(nums=Sum('update'))['nums']) + return HttpResponse(json.dumps({ + "status":"1", + "lanzhou":lanzhou, + "jiayuguan":jiayuguan, + "jinchang":jinchang, + "jiuquan":jiuquan, + "zhangye":zhangye, + "wuwei":wuwei, + "baiyin":baiyin, + "tianshui":tianshui, + "pingliang":pingliang, + "qingyang":qingyang, + "dingxi":dingxi, + "longnan":longnan, + "gannan":gannan, + "linxia":linxia, + "date":date_list, + })) + +@login_required def index_map(request): name = request.GET.get('name') print(name)