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

View File

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

View File

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

View File

@ -31,6 +31,7 @@
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <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">新媒体ID</th> <th style="text-align: center">新媒体ID</th>
@ -43,7 +44,9 @@
<tbody> <tbody>
{% for w in res %} {% for w in res %}
<tr> <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> class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ w.code }}</td> <td style="vertical-align: middle;text-align: center">{{ w.code }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.douyinid }}</td> <td style="vertical-align: middle;text-align: center">{{ w.douyinid }}</td>

View File

@ -23,7 +23,7 @@
<section class="box "> <section class="box ">
<header class="panel_header"> <header class="panel_header">
<h2 class="title pull-left">其他新媒体列表</h2> <h2 class="title pull-left">其他新媒体列表</h2>
<h2 class="title pull-right" style="margin-right: 30px">其他新媒体总计:{{ qita_count}}</h2> <h2 class="title pull-right" style="margin-right: 30px">其他新媒体总计:{{ qita_count }}</h2>
</header> </header>
<div class="content-body"> <div class="content-body">
<div class="row"> <div class="row">
@ -31,6 +31,7 @@
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <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>
@ -44,7 +45,9 @@
<tbody> <tbody>
{% for w in res %} {% for w in res %}
<tr> <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> class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ w.type }}</td> <td style="vertical-align: middle;text-align: center">{{ w.type }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.name }}</td> <td style="vertical-align: middle;text-align: center">{{ w.name }}</td>

View File

@ -31,6 +31,7 @@
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <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">新媒体ID</th> <th style="text-align: center">新媒体ID</th>
@ -43,7 +44,9 @@
<tbody> <tbody>
{% for w in res %} {% for w in res %}
<tr> <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> class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ w.code }}</td> <td style="vertical-align: middle;text-align: center">{{ w.code }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.toutiaoid }}</td> <td style="vertical-align: middle;text-align: center">{{ w.toutiaoid }}</td>

View File

@ -31,6 +31,7 @@
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <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">新媒体ID</th> <th style="text-align: center">新媒体ID</th>
@ -43,7 +44,9 @@
<tbody> <tbody>
{% for w in res %} {% for w in res %}
<tr> <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> class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ w.code }}</td> <td style="vertical-align: middle;text-align: center">{{ w.code }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.weiboid }}</td> <td style="vertical-align: middle;text-align: center">{{ w.weiboid }}</td>

View File

@ -31,6 +31,7 @@
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <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">新媒体ID</th> <th style="text-align: center">新媒体ID</th>
@ -43,7 +44,9 @@
<tbody> <tbody>
{% for w in res %} {% for w in res %}
<tr> <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> class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ w.code }}</td> <td style="vertical-align: middle;text-align: center">{{ w.code }}</td>
<td style="vertical-align: middle;text-align: center">{{ w.weixinid }}</td> <td style="vertical-align: middle;text-align: center">{{ w.weixinid }}</td>

View File

@ -57,6 +57,7 @@
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <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>
@ -67,7 +68,8 @@
<tbody> <tbody>
{% for n in news %} {% for n in news %}
<tr> <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.author }}</td>
<td style="vertical-align: middle;text-align: center">{{ n.type }}</td> <td style="vertical-align: middle;text-align: center">{{ n.type }}</td>
<td style="vertical-align: middle;text-align: center">{{ n.date }}</td> <td style="vertical-align: middle;text-align: center">{{ n.date }}</td>

View File

@ -57,6 +57,7 @@
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <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>#}
@ -69,6 +70,7 @@
<tbody> <tbody>
{% for r in res %} {% for r in res %}
<tr> <tr>
<td style="vertical-align: middle;text-align: center">{{ forloop.counter }}</td>
<td style="vertical-align: middle;text-align: center"><img <td style="vertical-align: middle;text-align: center"><img
src="{{ r.image }}" style="width: 80px;height: 80px;" src="{{ r.image }}" style="width: 80px;height: 80px;"
class="img-circle"></td> class="img-circle"></td>

View File

@ -31,11 +31,12 @@
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <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>
<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> <th style="text-align: center">操作</th>
</tr> </tr>
@ -43,12 +44,13 @@
<tbody> <tbody>
{% for u in userallinfo %} {% for u in userallinfo %}
<tr> <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> class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ u.name }}</td> <td style="vertical-align: middle;text-align: center">{{ u.name }}</td>
<td style="vertical-align: middle;text-align: center">{{ u.phone }}</td> <td style="vertical-align: middle;text-align: center">{{ u.phone }}</td>
<td style="vertical-align: middle;text-align: center">{{ u.organization }}</td> <td style="vertical-align: middle;text-align: center">{{ u.organization }}</td>
{# <td style="vertical-align: middle;text-align: center">{{ u.type }}</td>#} {# <td style="vertical-align: middle;text-align: center">{{ u.type }}</td>#}
<td style="vertical-align: middle;text-align: center">{{ u.administrativedivision }}</td> <td style="vertical-align: middle;text-align: center">{{ u.administrativedivision }}</td>
<td style="vertical-align: middle;text-align: center"> <td style="vertical-align: middle;text-align: center">
<a href="{% url 'user-management-delete' u.id %}" <a href="{% url 'user-management-delete' u.id %}"

View File

@ -46,20 +46,24 @@
<thead> <thead>
<tr> <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>
<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> </tr>
</thead> </thead>
<tbody> <tbody>
{% for n in news %}
<tr> <tr>
<td style="vertical-align: middle;text-align: center">{{ r.code }}</td> <td style="vertical-align: middle;text-align: center">{{ forloop.counter }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.comment }}</td> <td style="vertical-align: middle;text-align: center">{{ n.date }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.reply }}</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">{{ r.date }}</td> <td style="vertical-align: middle;text-align: center">{{ n.author }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.date }}</td> <td style="vertical-align: middle;text-align: center">{{ n.source }}</td>
<td style="vertical-align: middle;text-align: center">1</td>
</tr> </tr>
{% endfor %}
</tbody> </tbody>
</table> </table>
</div> </div>

View File

@ -8,7 +8,7 @@ from django.shortcuts import render
# Create your views here. # Create your views here.
from dashboard.models import Weixin, Weixin_data, Toutiao_data, Weibo_data, Qita_jc, Group, Toutiao, Weibo, Qita, \ 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 from monitor.models import Test
@ -29,7 +29,9 @@ def new_media_public_opinion_weixin(request):
o['month'] = w.month o['month'] = w.month
o['day'] = w.day o['day'] = w.day
res.append(o) 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): def new_media_public_opinion_toutiao(request):
toutiao = Toutiao.objects.all() toutiao = Toutiao.objects.all()
@ -49,7 +51,10 @@ def new_media_public_opinion_toutiao(request):
o['month'] = t.month o['month'] = t.month
o['day'] = t.day o['day'] = t.day
res.append(o) 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): def new_media_public_opinion_douyin(request):
douyin = Douyin.objects.all() douyin = Douyin.objects.all()
group = Group.objects.all() group = Group.objects.all()
@ -66,7 +71,10 @@ def new_media_public_opinion_douyin(request):
o['reply'] = d.reply o['reply'] = d.reply
o['date'] = d.date o['date'] = d.date
res.append(o) 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): def new_media_public_opinion_weibo(request):
weibo = Weibo.objects.all() weibo = Weibo.objects.all()
group = Group.objects.all() group = Group.objects.all()
@ -85,7 +93,8 @@ def new_media_public_opinion_weibo(request):
o['month'] = w.month o['month'] = w.month
o['day'] = w.day o['day'] = w.day
res.append(o) res.append(o)
return render(request, 'monitor/new-media-public-opinion-weibo.html', {'res':res,'weibo':weibo,'group':group}) return render(request, 'monitor/new-media-public-opinion-weibo.html', {'res': res, 'weibo': weibo, 'group': group})
def new_media_public_opinion_qita(request): def new_media_public_opinion_qita(request):
qita = Qita.objects.all() qita = Qita.objects.all()
@ -106,15 +115,25 @@ def new_media_public_opinion_qita(request):
o['month'] = q.month o['month'] = q.month
o['day'] = q.day o['day'] = q.day
res.append(o) res.append(o)
return render(request, 'monitor/new-media-public-opinion-qita.html', {'res':res,'qita':qita,'group':group}) return render(request, 'monitor/new-media-public-opinion-qita.html', {'res': res, 'qita': qita, 'group': group})
def timeliness_monitoring(request): def timeliness_monitoring(request):
return render(request,'monitor/timeliness-monitoring.html') return render(request, 'monitor/timeliness-monitoring.html')
def error_monitoring(request): def error_monitoring(request):
return render(request, 'monitor/error-monitoring.html') return render(request, 'monitor/error-monitoring.html')
def sensitive_word_monitoring(request): def sensitive_word_monitoring(request):
return render(request,'monitor/sensitive-word-monitoring.html') return render(request, 'monitor/sensitive-word-monitoring.html')
def comment_on_interactive_monitoring(request): def comment_on_interactive_monitoring(request):
return render(request,'monitor/comment-on-interactive-monitoring.html') return render(request, 'monitor/comment-on-interactive-monitoring.html')
def comment_on_interactive_monitoring_json(request): def comment_on_interactive_monitoring_json(request):
data = Test.objects.all()[:500] data = Test.objects.all()[:500]
r = [] r = []
@ -130,25 +149,31 @@ def comment_on_interactive_monitoring_json(request):
res = [] res = []
for (k, v) in c.most_common(200): # 遍历输出高频词 for (k, v) in c.most_common(200): # 遍历输出高频词
# print('%s%s %s %d' % (' ' * (5 - len(k)), k, '*', v)) # print('%s%s %s %d' % (' ' * (5 - len(k)), k, '*', v))
#剔除不是汉字的值 # 剔除不是汉字的值
if all(map(lambda c:'\u4e00' <= c <= '\u9fa5',k)): if all(map(lambda c: '\u4e00' <= c <= '\u9fa5', k)):
o = dict() o = dict()
o['name'] = k o['name'] = k
o['value'] = v o['value'] = v
res.append(o) res.append(o)
return HttpResponse(json.dumps({ return HttpResponse(json.dumps({
"res":res "res": res
})) }))
def monitoring_report(request): 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): def test(request):
return render(request,'monitor/test.html') return render(request, 'monitor/test.html')
def test_json(request): def test_json(request):
res = [] res = []
with open('D:/2020/舆论监测平台/新媒体监测数据/平凉/Result_PL.csv',encoding='utf-8') as csvfile: with open('D:/2020/舆论监测平台/新媒体监测数据/平凉/Result_PL.csv', encoding='utf-8') as csvfile:
reader = csv.reader(csvfile) reader = csv.reader(csvfile)
results = [] results = []
try: try:
@ -163,7 +188,7 @@ def test_json(request):
if len(x) > 1 and x != '\r\n': if len(x) > 1 and x != '\r\n':
c[x] += 1 c[x] += 1
for (k, v) in c.most_common(200): # 遍历输出高频词 for (k, v) in c.most_common(200): # 遍历输出高频词
if all(map(lambda c:'\u4e00' <= c <= '\u9fa5',k)): if all(map(lambda c: '\u4e00' <= c <= '\u9fa5', k)):
o = dict() o = dict()
o['name'] = k o['name'] = k
o['value'] = v o['value'] = v
@ -171,4 +196,3 @@ def test_json(request):
return HttpResponse(json.dumps({ return HttpResponse(json.dumps({
"res": res "res": res
})) }))