This commit is contained in:
xieshen 2020-10-19 16:52:51 +08:00
parent b652639aae
commit a80895d223
13 changed files with 123 additions and 53 deletions

View File

@ -43,10 +43,14 @@
<header class="panel_header">
{# <h2 class="title pull-left">矩阵列表</h2>#}
<ul class="nav nav-pills">
<li role="presentation" style="margin-top: 20px"><a href="{% url 'group-management-management-init' %}">我创建的矩阵</a></li>
<li role="presentation" class="active" style="margin-top: 20px"><a href="{% url 'group-management-management-admin' %}">我管理的矩阵</a></li>
<li role="presentation" style="margin-top: 20px"><a href="{% url 'group-management-management-user' %}">我加入的矩阵</a></li>
<h6 class="title pull-right">我共管理{% if admin_count %}{{ admin_count }}{% else %}0{% endif %}个矩阵</h6>
<li role="presentation" style="margin-top: 20px"><a
href="{% url 'group-management-management-init' %}">我创建的矩阵</a></li>
<li role="presentation" class="active" style="margin-top: 20px"><a
href="{% url 'group-management-management-admin' %}">我管理的矩阵</a></li>
<li role="presentation" style="margin-top: 20px"><a
href="{% url 'group-management-management-user' %}">我加入的矩阵</a></li>
<h6 class="title pull-right">我共管理{% if admin_count %}{{ admin_count }}{% else %}
0{% endif %}个矩阵</h6>
</ul>
</header>
<div class="content-body">
@ -55,6 +59,7 @@
<table class="table table-hover">
<thead>
<tr>
<th style="text-align: center">序号</th>
<th style="text-align: center">头像</th>
<th style="text-align: center">矩阵名称</th>
<th style="text-align: center">矩阵类型</th>
@ -67,7 +72,9 @@
<tbody>
{% for r in res_g_a %}
<tr>
<td><img src="{{ r.image }}" style="width: 80px;height: 80px;"
<td style="vertical-align: middle;text-align: center">{{ forloop.counter }}</td>
<td style="text-align:center "><img src="{{ r.image }}"
style="width: 80px;height: 80px;"
class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ r.name }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.type }}</td>

View File

@ -41,10 +41,14 @@
<header class="panel_header">
{# <h2 class="title pull-left">矩阵列表</h2>#}
<ul class="nav nav-pills">
<li role="presentation" class="active" style="margin-top: 20px"><a href="{% url 'group-management-management-init' %}">我创建的矩阵</a></li>
<li role="presentation" style="margin-top: 20px"><a href="{% url 'group-management-management-admin' %}">我管理的矩阵</a></li>
<li role="presentation" style="margin-top: 20px"><a href="{% url 'group-management-management-user' %}">我加入的矩阵</a></li>
<h6 class="title pull-right">我共创建{% if init_count %}{{ init_count }}{% else %}0{% endif %}个矩阵</h6>
<li role="presentation" class="active" style="margin-top: 20px"><a
href="{% url 'group-management-management-init' %}">我创建的矩阵</a></li>
<li role="presentation" style="margin-top: 20px"><a
href="{% url 'group-management-management-admin' %}">我管理的矩阵</a></li>
<li role="presentation" style="margin-top: 20px"><a
href="{% url 'group-management-management-user' %}">我加入的矩阵</a></li>
<h6 class="title pull-right">我共创建{% if init_count %}{{ init_count }}{% else %}
0{% endif %}个矩阵</h6>
</ul>
</header>
<div class="content-body">
@ -53,6 +57,7 @@
<table class="table table-hover">
<thead>
<tr>
<th style="text-align: center">序号</th>
<th style="text-align: center">头像</th>
<th style="text-align: center">矩阵名称</th>
<th style="text-align: center">矩阵类型</th>
@ -65,7 +70,9 @@
<tbody>
{% for r in res_g_i %}
<tr>
<td><img src="{{ r.image }}" style="width: 80px;height: 80px;"
<td style="vertical-align: middle;text-align: center">{{ forloop.counter }}</td>
<td style="text-align: center"><img src="{{ r.image }}"
style="width: 80px;height: 80px;"
class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ r.name }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.type }}</td>

View File

@ -43,10 +43,14 @@
<header class="panel_header">
{# <h2 class="title pull-left">矩阵列表</h2>#}
<ul class="nav nav-pills">
<li role="presentation" style="margin-top: 20px"><a href="{% url 'group-management-management-init' %}">我创建的矩阵</a></li>
<li role="presentation" style="margin-top: 20px"><a href="{% url 'group-management-management-admin' %}">我管理的矩阵</a></li>
<li role="presentation" class="active" style="margin-top: 20px"><a href="{% url 'group-management-management-user' %}">我加入的矩阵</a></li>
<h6 class="title pull-right">我共加入{% if user_count %}{{ user_count }}{% else %}0{% endif %}个矩阵</h6>
<li role="presentation" style="margin-top: 20px"><a
href="{% url 'group-management-management-init' %}">我创建的矩阵</a></li>
<li role="presentation" style="margin-top: 20px"><a
href="{% url 'group-management-management-admin' %}">我管理的矩阵</a></li>
<li role="presentation" class="active" style="margin-top: 20px"><a
href="{% url 'group-management-management-user' %}">我加入的矩阵</a></li>
<h6 class="title pull-right">我共加入{% if user_count %}{{ user_count }}{% else %}
0{% endif %}个矩阵</h6>
</ul>
</header>
<div class="content-body">
@ -55,6 +59,7 @@
<table class="table table-hover">
<thead>
<tr>
<th style="text-align: center">序号</th>
<th style="text-align: center">头像</th>
<th style="text-align: center">矩阵名称</th>
<th style="text-align: center">矩阵类型</th>
@ -66,7 +71,9 @@
<tbody>
{% for r in res_g_u %}
<tr>
<td><img src="{{ r.image }}" style="width: 80px;height: 80px;"
<td style="vertical-align: middle;text-align: center">{{ forloop.counter }}</td>
<td style="text-align: center"><img src="{{ r.image }}"
style="width: 80px;height: 80px;"
class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ r.name }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.type }}</td>

View File

@ -31,6 +31,7 @@
<table class="table table-hover">
<thead>
<tr>
<th style="text-align: center">序号</th>
<th style="text-align: center">图标</th>
<th style="text-align: center">新媒体名称</th>
<th style="text-align: center">新媒体ID</th>
@ -43,7 +44,9 @@
<tbody>
{% for w in res %}
<tr>
<td><img src="{{ w.image.url }}" style="width: 60px;height: 60px;margin: auto"
<td style="vertical-align: middle;text-align: center">{{ forloop.counter }}</td>
<td style="text-align: center"><img src="{{ w.image.url }}"
style="width: 60px;height: 60px;margin: auto"
class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ w.code }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.douyinid }}</td>

View File

@ -31,6 +31,7 @@
<table class="table table-hover">
<thead>
<tr>
<th style="text-align: center">序号</th>
<th style="text-align: center">图标</th>
<th style="text-align: center">新媒体类型</th>
<th style="text-align: center">新媒体名称</th>
@ -44,7 +45,9 @@
<tbody>
{% for w in res %}
<tr>
<td><img src="{{ w.image.url }}" style="width: 60px;height: 60px;margin: auto"
<td style="vertical-align: middle;text-align: center">{{ forloop.counter }}</td>
<td style="text-align: center"><img src="{{ w.image.url }}"
style="width: 60px;height: 60px;margin: auto"
class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ w.type }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.name }}</td>

View File

@ -31,6 +31,7 @@
<table class="table table-hover">
<thead>
<tr>
<th style="text-align: center">头条</th>
<th style="text-align: center">图标</th>
<th style="text-align: center">新媒体名称</th>
<th style="text-align: center">新媒体ID</th>
@ -43,7 +44,9 @@
<tbody>
{% for w in res %}
<tr>
<td><img src="{{ w.image.url }}" style="width: 60px;height: 60px;margin: auto"
<td style="vertical-align: middle;text-align: center">{{ forloop.counter }}</td>
<td style="text-align: center"><img src="{{ w.image.url }}"
style="width: 60px;height: 60px;margin: auto"
class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ w.code }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.toutiaoid }}</td>

View File

@ -31,6 +31,7 @@
<table class="table table-hover">
<thead>
<tr>
<th style="text-align: center">序号</th>
<th style="text-align: center">图标</th>
<th style="text-align: center">新媒体名称</th>
<th style="text-align: center">新媒体ID</th>
@ -43,7 +44,9 @@
<tbody>
{% for w in res %}
<tr>
<td><img src="{{ w.image.url }}" style="width: 60px;height: 60px;margin: auto"
<td style="vertical-align: middle;text-align: center">{{ forloop.counter }}</td>
<td style="text-align: center"><img src="{{ w.image.url }}"
style="width: 60px;height: 60px;margin: auto"
class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ w.code }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.weiboid }}</td>

View File

@ -31,6 +31,7 @@
<table class="table table-hover">
<thead>
<tr>
<th style="text-align: center">序号</th>
<th style="text-align: center">图标</th>
<th style="text-align: center">新媒体名称</th>
<th style="text-align: center">新媒体ID</th>
@ -43,7 +44,9 @@
<tbody>
{% for w in res %}
<tr>
<td><img src="{{ w.image.url }}" style="width: 60px;height: 60px;margin: auto"
<td style="vertical-align: middle;text-align: center">{{ forloop.counter }}</td>
<td style="text-align: center"><img src="{{ w.image.url }}"
style="width: 60px;height: 60px;margin: auto"
class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ w.code }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.weixinid }}</td>

View File

@ -57,6 +57,7 @@
<table class="table table-hover">
<thead>
<tr>
<th style="text-align: center">序号</th>
<th style="text-align: center">标题</th>
<th style="text-align: center">作者</th>
<th style="text-align: center">类型</th>
@ -67,7 +68,8 @@
<tbody>
{% for n in news %}
<tr>
<td style="vertical-align: middle;text-align: left">{{ n.title }}</td>
<td style="vertical-align: middle;text-align: left">{{ forloop.counter }}</td>
<td style="vertical-align: middle;text-align: center">{{ n.title }}</td>
<td style="vertical-align: middle;text-align: center">{{ n.author }}</td>
<td style="vertical-align: middle;text-align: center">{{ n.type }}</td>
<td style="vertical-align: middle;text-align: center">{{ n.date }}</td>

View File

@ -57,6 +57,7 @@
<table class="table table-hover">
<thead>
<tr>
<th style="text-align: center">序号</th>
<th style="text-align: center">图标</th>
<th style="text-align: center">单位名称</th>
{# <th style="text-align: center">类型</th>#}
@ -69,6 +70,7 @@
<tbody>
{% for r in res %}
<tr>
<td style="vertical-align: middle;text-align: center">{{ forloop.counter }}</td>
<td style="vertical-align: middle;text-align: center"><img
src="{{ r.image }}" style="width: 80px;height: 80px;"
class="img-circle"></td>

View File

@ -31,6 +31,7 @@
<table class="table table-hover">
<thead>
<tr>
<th style="text-align: center">序号</th>
<th style="text-align: center">头像</th>
<th style="text-align: center">姓名</th>
<th style="text-align: center">电话</th>
@ -43,7 +44,8 @@
<tbody>
{% for u in userallinfo %}
<tr>
<td><img src="{{ u.image.url }}" style="width: 80px;height: 80px;"
<td style="vertical-align: middle;text-align: center">{{ forloop.counter }}</td>
<td style="text-align: center"><img src="{{ u.image.url }}" style="width: 80px;height: 80px;"
class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ u.name }}</td>
<td style="vertical-align: middle;text-align: center">{{ u.phone }}</td>

View File

@ -46,20 +46,24 @@
<thead>
<tr>
<th style="text-align: center">序号</th>
<th style="text-align: center">时间</th>
<th style="text-align: center">发布时间</th>
<th style="text-align: center">报告名称</th>
<th style="text-align: center">发布者</th>
<th style="text-align: center">来源</th>
<th style="text-align: center">预警次数</th>
</tr>
</thead>
<tbody>
{% for n in news %}
<tr>
<td style="vertical-align: middle;text-align: center">{{ r.code }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.comment }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.reply }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.date }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.date }}</td>
<td style="vertical-align: middle;text-align: center">{{ forloop.counter }}</td>
<td style="vertical-align: middle;text-align: center">{{ n.date }}</td>
<td style="vertical-align: middle;text-align: center"><a href="{% url 'news-management-detail' n.id %}">{{ n.title }}</a></td>
<td style="vertical-align: middle;text-align: center">{{ n.author }}</td>
<td style="vertical-align: middle;text-align: center">{{ n.source }}</td>
<td style="vertical-align: middle;text-align: center">1</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>

View File

@ -8,7 +8,7 @@ from django.shortcuts import render
# Create your views here.
from dashboard.models import Weixin, Weixin_data, Toutiao_data, Weibo_data, Qita_jc, Group, Toutiao, Weibo, Qita, \
Douyin, Douyin_data
Douyin, Douyin_data, News
from monitor.models import Test
@ -29,7 +29,9 @@ def new_media_public_opinion_weixin(request):
o['month'] = w.month
o['day'] = w.day
res.append(o)
return render(request, 'monitor/new-media-public-opinion-weixin.html', {'res':res,'weixin':weixin,'group':group})
return render(request, 'monitor/new-media-public-opinion-weixin.html',
{'res': res, 'weixin': weixin, 'group': group})
def new_media_public_opinion_toutiao(request):
toutiao = Toutiao.objects.all()
@ -49,7 +51,10 @@ def new_media_public_opinion_toutiao(request):
o['month'] = t.month
o['day'] = t.day
res.append(o)
return render(request, 'monitor/new-media-public-opinion-toutiao.html', {'res':res,'toutiao':toutiao,'group':group})
return render(request, 'monitor/new-media-public-opinion-toutiao.html',
{'res': res, 'toutiao': toutiao, 'group': group})
def new_media_public_opinion_douyin(request):
douyin = Douyin.objects.all()
group = Group.objects.all()
@ -66,7 +71,10 @@ def new_media_public_opinion_douyin(request):
o['reply'] = d.reply
o['date'] = d.date
res.append(o)
return render(request, 'monitor/new-media-public-opinion-douyin.html', {'res':res,'douyin':douyin,'group':group})
return render(request, 'monitor/new-media-public-opinion-douyin.html',
{'res': res, 'douyin': douyin, 'group': group})
def new_media_public_opinion_weibo(request):
weibo = Weibo.objects.all()
group = Group.objects.all()
@ -87,6 +95,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})
def new_media_public_opinion_qita(request):
qita = Qita.objects.all()
group = Group.objects.all()
@ -107,14 +116,24 @@ def new_media_public_opinion_qita(request):
o['day'] = q.day
res.append(o)
return render(request, 'monitor/new-media-public-opinion-qita.html', {'res': res, 'qita': qita, 'group': group})
def timeliness_monitoring(request):
return render(request, 'monitor/timeliness-monitoring.html')
def error_monitoring(request):
return render(request, 'monitor/error-monitoring.html')
def sensitive_word_monitoring(request):
return render(request, 'monitor/sensitive-word-monitoring.html')
def comment_on_interactive_monitoring(request):
return render(request, 'monitor/comment-on-interactive-monitoring.html')
def comment_on_interactive_monitoring_json(request):
data = Test.objects.all()[:500]
r = []
@ -139,13 +158,19 @@ def comment_on_interactive_monitoring_json(request):
return HttpResponse(json.dumps({
"res": res
}))
def monitoring_report(request):
return render(request,'monitor/monitoring-report.html')
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})
def test(request):
return render(request, 'monitor/test.html')
def test_json(request):
res = []
with open('D:/2020/舆论监测平台/新媒体监测数据/平凉/Result_PL.csv', encoding='utf-8') as csvfile:
@ -171,4 +196,3 @@ def test_json(request):
return HttpResponse(json.dumps({
"res": res
}))