#add message

This commit is contained in:
xieshen 2020-11-03 18:07:53 +08:00
parent a7c90cadb4
commit 94d15bbbb5
11 changed files with 4257 additions and 223 deletions

View File

@ -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:

View File

@ -163,7 +163,7 @@
<div class="content-body">
<div class="row">
<div class="col-md-6 col-sm-7 col-xs-12">
<div class="col-lg-6 col-md-6 col-sm-7 col-xs-12">
<div class="r1_graph1 db_box">
<span class='bold'>时间/更新篇数</span>
@ -191,182 +191,16 @@
</div>
<div class="col-md-6 col-sm-7 col-xs-12">
<div class="r1_maingraph db_box">
<span class='pull-left'>
<i class='icon-purple fa fa-square icon-xs'></i>&nbsp;<small>PAGE VIEWS</small>&nbsp; &nbsp;<i
class='fa fa-square icon-xs icon-primary'></i>&nbsp;<small>UNIQUE VISITORS</small>
</span>
<span class='pull-right switch'>
<i class='icon-default fa fa-line-chart icon-xs'></i>&nbsp; &nbsp;<i
class='icon-secondary fa fa-bar-chart icon-xs'></i>&nbsp; &nbsp;<i
class='icon-secondary fa fa-area-chart icon-xs'></i>
</span>
<div id="db_morris_line_graph"
style="height:272px;width:95%;"></div>
<div id="db_morris_area_graph"
style="height:272px;width:90%;display:none;"></div>
<div id="db_morris_bar_graph"
style="height:272px;width:90%;display:none;"></div>
</div>
<div class="col-lg-6 col-md-6 col-sm-7 col-xs-12">
<div id="main" style="width: 100%;height:350px;background-color: white"></div>
</div>
{# <div class="col-md-3 col-sm-12 col-xs-12">#}
{# <div class="r1_graph4 db_box">#}
{# <span class=''>#}
{# <i class='icon-purple fa fa-square icon-xs icon-1'></i>&nbsp;<small>CPU USAGE</small>#}
{# </span>#}
{# <canvas width='180' height='90' id="gauge-meter"></canvas>#}
{# <h4 id='gauge-meter-text'></h4>#}
{# </div>#}
{# <div class="r1_graph5 db_box col-xs-6">#}
{# <span class=''><i#}
{# class='icon-purple fa fa-square icon-xs icon-1'></i>&nbsp;<small>LONDON</small>&nbsp; &nbsp;<i#}
{# class='fa fa-square icon-xs icon-2'></i>&nbsp;<small>PARIS</small></span>#}
{# <div style="width:120px;height:120px;margin: 0 auto;">#}
{# <span class="db_easypiechart1 easypiechart"#}
{# data-percent="66"><span class="percent"#}
{# style='line-height:120px;'></span></span>#}
{# </div>#}
{# </div>#}
{# </div>#}
</div> <!-- End .row -->
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div id="map" style="width: 100%;height: 600px"></div>
{# <div class="wid-vectormap">#}
{# <h4>Visitor's Statistics</h4>#}
{# <div class="row">#}
{# <div class="col-md-9 col-sm-9 col-xs-12">#}
{# <figure>#}
{# <div id="db-world-map-markers"#}
{# style="width: 100%; height: 300px"></div>#}
{# </figure>#}
{# </div>#}
{# <div class="col-md-3 col-sm-3 col-xs-12 map_progress">#}
{# <h4>Unique Visitors</h4>#}
{# <span class='text-muted'><small>Last Week Rise by 62%</small></span>#}
{# <div class="progress">#}
{# <div class="progress-bar progress-bar-primary"#}
{# role="progressbar" aria-valuenow="62"#}
{# aria-valuemin="0" aria-valuemax="100"#}
{# style="width: 62%"></div>#}
{# </div>#}
{# <br>#}
{# <h4>Registrations</h4>#}
{# <span class='text-muted'><small>Up by 57% last 7 days</small></span>#}
{# <div class="progress">#}
{# <div class="progress-bar progress-bar-primary"#}
{# role="progressbar" aria-valuenow="57"#}
{# aria-valuemin="0" aria-valuemax="100"#}
{# style="width: 57%"></div>#}
{# </div>#}
{# <br>#}
{# <h4>Direct Sales</h4>#}
{# <span class='text-muted'><small>Last Month Rise by 22%</small></span>#}
{# <div class="progress">#}
{# <div class="progress-bar progress-bar-primary"#}
{# role="progressbar" aria-valuenow="22"#}
{# aria-valuemin="0" aria-valuemax="100"#}
{# style="width: 22%"></div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{##}
{# <div class="col-md-4 col-sm-12 col-xs-12">#}
{# <div class="r2_graph1 db_box">#}
{##}
{##}
{# <form id="rickshaw_side_panel">#}
{# <section>#}
{# <div id="legend"></div>#}
{# </section>#}
{# <section>#}
{# <div id="renderer_form" class="toggler">#}
{# <select name="renderer">#}
{# <option value="area" selected>Area</option>#}
{# <option value="bar">Bar</option>#}
{# <option value="line">Line</option>#}
{# <option value="scatterplot">Scatter</option>#}
{# </select>#}
{# </div>#}
{# </section>#}
{# <section>#}
{# <div id="offset_form">#}
{# <label for="stack">#}
{# <input type="radio" name="offset" id="stack"#}
{# value="zero" checked>#}
{# <span>stack</span>#}
{# </label>#}
{# <label for="stream">#}
{# <input type="radio" name="offset" id="stream"#}
{# value="wiggle">#}
{# <span>stream</span>#}
{# </label>#}
{# <label for="pct">#}
{# <input type="radio" name="offset" id="pct"#}
{# value="expand">#}
{# <span>pct</span>#}
{# </label>#}
{# <label for="value">#}
{# <input type="radio" name="offset" id="value"#}
{# value="value">#}
{# <span>value</span>#}
{# </label>#}
{# </div>#}
{# <div id="interpolation_form">#}
{# <label for="cardinal">#}
{# <input type="radio" name="interpolation"#}
{# id="cardinal" value="cardinal" checked>#}
{# <span>cardinal</span>#}
{# </label>#}
{# <label for="linear">#}
{# <input type="radio" name="interpolation" id="linear"#}
{# value="linear">#}
{# <span>linear</span>#}
{# </label>#}
{# <label for="step">#}
{# <input type="radio" name="interpolation" id="step"#}
{# value="step-after">#}
{# <span>step</span>#}
{# </label>#}
{# </div>#}
{# </section>#}
{# </form>#}
{##}
{# <div id="chart_container" class="rickshaw_ext">#}
{# <div id="chart"></div>#}
{# <div id="timeline"></div>#}
{# </div>#}
{##}
{# <div id='rickshaw_side_panel' class="rickshaw_sliders">#}
{# <section>#}
{# <h5>Smoothing</h5>#}
{# <div id="smoother"></div>#}
{# </section>#}
{# <section>#}
{# <h5>Preview Range</h5>#}
{# <div id="preview" class="rickshaw_ext_preview"></div>#}
{# </section>#}
{# </div>#}
{##}
{# </div>#}
{# <!--#}
{# <div class="r2_counter1 db_box">#}
{# counter 1#}
{# </div>#}
{##}
{# <div class="r2_counter2 db_box">#}
{# counter 2#}
{# </div> -->#}
{##}
<div id="map" style="width: 100%;height: 600px;margin-top: 30px"></div>
</div>
</div> <!-- End .row -->
@ -409,6 +243,128 @@
<script src="{% static 'leaflet/leaflet.NonTiledLayer.js' %}" type="text/javascript"></script>
<script src="{% static 'monitor/js/index-map.js' %}" type="text/javascript"></script>
<script>
$.getJSON('/monitor/timeliness/monitoring/json/', function (res) {
// 基于准备好的dom初始化echarts实例
var myChart = echarts.init(document.getElementById('main'));
option = {
{#title: {#}
{# text: '更新次数/时间',#}
{# top: '-2%'#}
{# },#}
tooltip: {
trigger: 'axis'
},
legend: {
data: ['兰州市', '嘉峪关市', '金昌市', '酒泉市', '张掖市', '武威市', '白银市', '天水市', '平凉市', '庆阳市', '定西市', '陇南市', '甘南州', '临夏州']
},
grid: {
left: '3%',
right: '4%',
bottom: '1%',
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);
})
</script>
{% endblock %}

View File

@ -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})

View File

@ -53,7 +53,7 @@ function marker_click(marker,name){
contentType: false,
success: function (res){
console.log(res);
var content = '微信:'+res.timelinessmonitoring_weixin+'<br>'+'微博:'+res.timelinessmonitoring_weibo+'<br>'+'头条:'+res.timelinessmonitoring_toutiao+'<br>'+'抖音:'+res.timelinessmonitoring_douyin+'<br>'+'其他:'+res.timelinessmonitoring_qita+'<br>';
var content ='<span style="font-size: 15px;font-weight: 900">'+name+'</span>'+'</br>'+ '微信:'+res.timelinessmonitoring_weixin+'<br>'+'微博:'+res.timelinessmonitoring_weibo+'<br>'+'头条:'+res.timelinessmonitoring_toutiao+'<br>'+'抖音:'+res.timelinessmonitoring_douyin+'<br>'+'其他:'+res.timelinessmonitoring_qita+'<br>';
marker.bindPopup(content).openPopup();
}
});

View File

@ -71,22 +71,23 @@
</a>
</div>
</div>
<div class="btn-group col-md-12">
<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
分类 <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="#">总更新</a></li>
<li><a href="#">微信更新</a></li>
<li><a href="#">微博更新</a></li>
<li><a href="#">头条更新</a></li>
<li><a href="#">抖音更新</a></li>
<li><a href="#">其他更新</a></li>
</ul>
</div>
<div class="panel-body col-md-12" style="margin-top: 20px">
<div id="main" style="width: 100%;height:400px;"></div>
<div class="panel-body col-md-12">
<div class="btn-group col-md-1" style="float: right">
<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
分类 <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="#" id="main1">总更新</a></li>
<li><a href="#" id="main2">微信更新</a></li>
<li><a href="#" id="main3">微博更新</a></li>
<li><a href="#" id="main4">头条更新</a></li>
<li><a href="#" id="main5">抖音更新</a></li>
<li><a href="#" id="main6">其他更新</a></li>
</ul>
</div>
<div id="main" style="width: 100%;height:400px;margin-top: 30px"></div>
</div>
<div class="panel panel-default">
@ -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);
})
})
</script>
{% endblock %}

View File

@ -71,8 +71,22 @@
</a>
</div>
</div>
<div class="panel-body">
<div id="main" style="width: 100%;height:400px;"></div>
<div class="panel-body col-md-12">
<div class="btn-group col-md-1" style="float: right">
<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
分类 <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="#" id="main1">总更新</a></li>
<li><a href="#" id="main2">微信更新</a></li>
<li><a href="#" id="main3">微博更新</a></li>
<li><a href="#" id="main4">头条更新</a></li>
<li><a href="#" id="main5">抖音更新</a></li>
<li><a href="#" id="main6">其他更新</a></li>
</ul>
</div>
<div id="main" style="width: 100%;height:400px;margin-top: 30px"></div>
</div>
<div class="panel panel-default">
@ -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);
})
})
</script>
{% endblock %}

View File

@ -71,8 +71,22 @@
</a>
</div>
</div>
<div class="panel-body">
<div id="main" style="width: 100%;height:400px;"></div>
<div class="panel-body col-md-12">
<div class="btn-group col-md-1" style="float: right">
<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
分类 <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="#" id="main1">总更新</a></li>
<li><a href="#" id="main2">微信更新</a></li>
<li><a href="#" id="main3">微博更新</a></li>
<li><a href="#" id="main4">头条更新</a></li>
<li><a href="#" id="main5">抖音更新</a></li>
<li><a href="#" id="main6">其他更新</a></li>
</ul>
</div>
<div id="main" style="width: 100%;height:400px;margin-top: 30px"></div>
</div>
<div class="panel panel-default">
@ -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);
})
})
</script>
{% endblock %}
{% endblock %}

View File

@ -71,8 +71,22 @@
</a>
</div>
</div>
<div class="panel-body">
<div id="main" style="width: 100%;height:400px;"></div>
<div class="panel-body col-md-12">
<div class="btn-group col-md-1" style="float: right">
<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
分类 <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="#" id="main1">总更新</a></li>
<li><a href="#" id="main2">微信更新</a></li>
<li><a href="#" id="main3">微博更新</a></li>
<li><a href="#" id="main4">头条更新</a></li>
<li><a href="#" id="main5">抖音更新</a></li>
<li><a href="#" id="main6">其他更新</a></li>
</ul>
</div>
<div id="main" style="width: 100%;height:400px;margin-top: 30px"></div>
</div>
<div class="panel panel-default">
@ -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);
})
})
</script>
{% endblock %}

View File

@ -71,8 +71,22 @@
</a>
</div>
</div>
<div class="panel-body">
<div id="main" style="width: 100%;height:400px;"></div>
<div class="panel-body col-md-12">
<div class="btn-group col-md-1" style="float: right">
<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
分类 <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="#" id="main1">总更新</a></li>
<li><a href="#" id="main2">微信更新</a></li>
<li><a href="#" id="main3">微博更新</a></li>
<li><a href="#" id="main4">头条更新</a></li>
<li><a href="#" id="main5">抖音更新</a></li>
<li><a href="#" id="main6">其他更新</a></li>
</ul>
</div>
<div id="main" style="width: 100%;height:400px;margin-top: 30px"></div>
</div>
<div class="panel panel-default">
@ -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);
})
})
</script>
{% endblock %}

View File

@ -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'),

View File

@ -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)