This commit is contained in:
Bob 2020-10-05 10:13:30 +08:00
parent 3ec3dd1d64
commit ba62fac65f
11 changed files with 18787 additions and 78 deletions

View File

@ -0,0 +1,265 @@
{% extends 'dashboard/base/base.html' %}
{% load static %}
{% block content %}
<body class=" ">
<div class="page-container row-fluid">
<div class="page-sidebar ">
{% include 'dashboard/base/left.html' %}
</div>
<section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
{% if messages %}
<div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
{% for message in messages %}
{{ message }}.<br/>
{% endfor %}
</div>
{% endif %}
</section>
<div class="panel">
<div class="panel panel-default">
<div class="panel-heading">新媒体详情</div>
<div class="panel panel-default">
<div class="panel-body">
<div class="col-md-1">
<img src="../a.png">
</div>
<div class="col-md-11">
<p>甘肃发布</p>
<p>甘肃发布甘肃发布甘肃发布甘肃发布甘肃发布甘肃发布甘肃发布甘肃发布甘肃发布甘肃发布甘肃发布甘肃发布甘肃发布</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
<div class="panel-heading">近一月内容发布情况</div>
<div class="col-md-6">
<p>最新发布时间:</p>
<div class="col-md-6">
<div id="fbqk-bggs" style="height: 300px"></div>
</div>
<div class="col-md-6">
<div id="fbqk-yjcs" style="height: 300px"></div>
</div>
</div>
<div class="col-md-6">
<div id="zzt-yjcs" style="height: 300px"></div>
</div>
</div>
</div>
<div>
<table class="table table-hover table-bordered" style="font-size: 14px">
<tbody>
<tr>
<td style="vertical-align: middle;text-align: center">
<span class="glyphicon glyphicon-calendar" aria-hidden="true"></span>
<p></p>
<p>发布次数/篇数:</p>
</td>
<td style="vertical-align: middle;text-align: center">
<span class="glyphicon glyphicon-folder-open" aria-hidden="true"></span>
<p></p>
<p>阅读次数/平均阅读次数:</p>
</td>
<td style="vertical-align: middle;text-align: center">
<span class="glyphicon glyphicon-globe" aria-hidden="true"></span>
<p></p>
<p>好看次数/平均好看次数:</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="panel panel-default">
<div class="panel-body" style="text-align: center">
<div class="list-group col-md-4 ">
<a href="#" class="list-group-item list-group-item-success" style="text-align: center;height: 100px;">
<h4 class="list-group-item-heading" style="display: inline-block">未修改错别字</h4>
<span style="font-size: 25px;margin-left: 20px;">7</span>
<p class="list-group-item-text">错别字7个</p>
<p class="list-group-item-text">严重错别字0个</p>
</a>
</div>
<div class="list-group col-md-4 ">
<a href="#" class="list-group-item list-group-item-info" style="text-align: center;height: 100px;">
<h4 class="list-group-item-heading" style="display: inline-block">未修改敏感词</h4>
<span style="font-size: 25px;margin-left: 20px;">0</span>
<p class="list-group-item-text">敏感词0个</p>
</a>
</div>
<div class="list-group col-md-4 ">
<a href="#" class="list-group-item list-group-item-warning" style="text-align: center;height: 100px;">
<h4 class="list-group-item-heading" style="display: inline-block">未处理非法外链</h4>
<span style="font-size: 25px;margin-left: 20px;">12</span>
<p class="list-group-item-text">外链数12个</p>
<p class="list-group-item-text">非法外链数0个</p>
</a>
</div>
</div>
</div>
<table class="table table-hover" style="font-size: 14px">
<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>
<th style="text-align: center">发布时间</th>
</tr>
</thead>
<tbody>
<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">{{ r.date }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.date }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.date }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
</div>
</body>
{% endblock %}
{% block add_js %}
<script src="{% static 'js/echarts.min.js' %}" type="text/javascript"></script>
<script src="{% static 'js/chart-sparkline.js' %}" type="text/javascript"></script>
<script type="text/javascript">
var fbqkBggs = echarts.init(document.getElementById('fbqk-bggs'));
fbqkBggsOption = {
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b}: {c} ({d}%)'
},
legend: {
orient: 'vertical',
left: 10,
data: ['更新未达标天数']
},
color: ['green'],
series: [
{
name: '更新未达标天数',
type: 'pie',
radius: ['60%', '70%'],
avoidLabelOverlap: false,
label: {
show: true,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: '16',
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: [
{value: 335, name: '更新未达标天数'},
]
}
]
};
var fbqkYyjcs = echarts.init(document.getElementById('fbqk-yjcs'));
fbqkYyjcsOption = {
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b}: {c} ({d}%)'
},
legend: {
orient: 'vertical',
left: 10,
data: ['最长更新时间']
},
color: ['orange'],
series: [
{
name: '最长更新时间',
type: 'pie',
radius: ['60%', '70%'],
avoidLabelOverlap: false,
label: {
show: true,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: '16',
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: [
{value: 335, name: '最长更新时间'},
]
}
]
};
var zztYjcs = echarts.init(document.getElementById('zzt-yjcs'));
zztYjcsOption = {
color: ['#3398DB'],
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
axisTick: {
alignWithLabel: true
}
}
],
yAxis: [
{
type: 'value'
}
],
series: [
{
name: '预警次数',
type: 'bar',
barWidth: '60%',
data: [10, 52, 200, 334, 390, 330, 220]
}
]
}
// 使用刚指定的配置项和数据显示图表。
fbqkBggs.setOption(fbqkBggsOption)
fbqkYyjcs.setOption(fbqkYyjcsOption)
zztYjcs.setOption(zztYjcsOption)
</script>
{% endblock %}

View File

@ -50,6 +50,7 @@ urlpatterns = [
path('newmedia/management/delete/toutiao/<str:pk>/',views.newmedia_management_delete_toutiao,name='newmedia-management-delete-toutiao'), path('newmedia/management/delete/toutiao/<str:pk>/',views.newmedia_management_delete_toutiao,name='newmedia-management-delete-toutiao'),
path('newmedia/management/delete/douyin/<str:pk>/',views.newmedia_management_delete_douyin,name='newmedia-management-delete-douyin'), path('newmedia/management/delete/douyin/<str:pk>/',views.newmedia_management_delete_douyin,name='newmedia-management-delete-douyin'),
path('newmedia/management/delete/qita/<str:pk>/',views.newmedia_management_delete_qita,name='newmedia-management-delete-qita'), path('newmedia/management/delete/qita/<str:pk>/',views.newmedia_management_delete_qita,name='newmedia-management-delete-qita'),
path('newmedia/detail/<str:pk>/weixin/',views.newmedia_detail_weixin,name='newmedia-detail-weixin'),
#新闻管理 #新闻管理
path('news/management/',views.new_management,name='new-management'), path('news/management/',views.new_management,name='new-management'),

View File

@ -1,6 +1,7 @@
import json import json
from django.contrib import messages from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.hashers import make_password from django.contrib.auth.hashers import make_password
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
@ -11,6 +12,7 @@ from dashboard.models import Userprofile, Group, Organization, Level, Organizati
Toutiao, Qita, Group_type, Group_admin, Group_user, News, Douyin Toutiao, Qita, Group_type, Group_admin, Group_user, News, Douyin
@login_required
def user_management(request): def user_management(request):
user = request.user user = request.user
o = Organization.objects.get(userprofile__user_id=user.id) o = Organization.objects.get(userprofile__user_id=user.id)
@ -22,10 +24,12 @@ def user_management(request):
if level == 1: if level == 1:
userpaginator = User.objects.filter(userprofile__organization__province=province).order_by('-date_joined') userpaginator = User.objects.filter(userprofile__organization__province=province).order_by('-date_joined')
elif level == 2: elif level == 2:
userpaginator = User.objects.filter(userprofile__organization__province=province,userprofile__organization__cities=cities).order_by('-date_joined') userpaginator = User.objects.filter(userprofile__organization__province=province,
userprofile__organization__cities=cities).order_by('-date_joined')
elif level == 3: elif level == 3:
userpaginator = User.objects.filter(userprofile__organization__province=province, userpaginator = User.objects.filter(userprofile__organization__province=province,
userprofile__organization__cities=cities,userprofile__organization__district=district).order_by('-date_joined') userprofile__organization__cities=cities,
userprofile__organization__district=district).order_by('-date_joined')
paginator = Paginator(userpaginator, 6) paginator = Paginator(userpaginator, 6)
page = int(request.GET.get('page', 1)) page = int(request.GET.get('page', 1))
try: try:
@ -56,12 +60,14 @@ def user_management(request):
{'userallinfo': userallinfo, 'userpaginator': userpaginator}) {'userallinfo': userallinfo, 'userpaginator': userpaginator})
@login_required
def user_delete(request, pk): def user_delete(request, pk):
user = User.objects.get(id=pk) user = User.objects.get(id=pk)
user.delete() user.delete()
return HttpResponseRedirect('/management/user/management/') return HttpResponseRedirect('/management/user/management/')
@login_required
def user_update(request, pk): def user_update(request, pk):
user = User.objects.get(id=pk) user = User.objects.get(id=pk)
userprofile = Userprofile.objects.get(user_id=user.id) userprofile = Userprofile.objects.get(user_id=user.id)
@ -107,6 +113,7 @@ def user_update(request, pk):
{'usee': user, 'userprofile': userprofile, 'organization': organization}) {'usee': user, 'userprofile': userprofile, 'organization': organization})
@login_required
def group_management_init(request): def group_management_init(request):
user = request.user user = request.user
# 创建的矩阵 # 创建的矩阵
@ -134,6 +141,7 @@ def group_management_init(request):
return render(request, 'management/group-management-init.html', {'group': group, 'res_g_i': res_g_i}) return render(request, 'management/group-management-init.html', {'group': group, 'res_g_i': res_g_i})
@login_required
def group_management_admin(request): def group_management_admin(request):
# 管理的矩阵 # 管理的矩阵
user = request.user user = request.user
@ -163,6 +171,7 @@ def group_management_admin(request):
return render(request, 'management/group-management-admin.html', {'group': group, 'res_g_a': res_g_a}) return render(request, 'management/group-management-admin.html', {'group': group, 'res_g_a': res_g_a})
@login_required
def group_management_user(request): def group_management_user(request):
# 加入的矩阵 # 加入的矩阵
user = request.user user = request.user
@ -192,6 +201,7 @@ def group_management_user(request):
return render(request, 'management/group-management-user.html', {'group': group, 'res_g_u': res_g_u}) return render(request, 'management/group-management-user.html', {'group': group, 'res_g_u': res_g_u})
@login_required
def group_update(request, pk): def group_update(request, pk):
group = Group.objects.get(id=pk) group = Group.objects.get(id=pk)
group_status_choices_list = [] group_status_choices_list = []
@ -263,7 +273,7 @@ def group_update(request, pk):
if image is not None: if image is not None:
Group.objects.filter(id=pk).update(name=name, presentation=presentation, type_id=type, status=status, Group.objects.filter(id=pk).update(name=name, presentation=presentation, type_id=type, status=status,
province=province_r, cities=city_r, district=district_r, town=town_r, province=province_r, cities=city_r, district=district_r, town=town_r,
village=village_r,classify=classify) village=village_r, classify=classify)
g = Group.objects.get(id=pk) g = Group.objects.get(id=pk)
g.image = image g.image = image
g.save() g.save()
@ -272,14 +282,15 @@ def group_update(request, pk):
else: else:
Group.objects.filter(id=pk).update(name=name, presentation=presentation, type_id=type, status=status, Group.objects.filter(id=pk).update(name=name, presentation=presentation, type_id=type, status=status,
province=province_r, cities=city_r, district=district_r, town=town_r, province=province_r, cities=city_r, district=district_r, town=town_r,
village=village_r,classify=classify) village=village_r, classify=classify)
messages.success(request, '修改成功') messages.success(request, '修改成功')
return HttpResponseRedirect('/management/group/management/init/') return HttpResponseRedirect('/management/group/management/init/')
return render(request, 'management/group-management-update.html', return render(request, 'management/group-management-update.html',
{'group': group, 'group_status_choices_list': group_status_choices_list, 'group_type': group_type, {'group': group, 'group_status_choices_list': group_status_choices_list, 'group_type': group_type,
'g_a_list': g_a_list, 'g_u_list': g_u_list,'g_c_c_res':g_c_c_res}) 'g_a_list': g_a_list, 'g_u_list': g_u_list, 'g_c_c_res': g_c_c_res})
@login_required
def group_create(request): def group_create(request):
user = request.user user = request.user
group_status_choices_list = [] group_status_choices_list = []
@ -326,17 +337,20 @@ def group_create(request):
print(name, presentation, image, type, status, province, city, district, town, village) print(name, presentation, image, type, status, province, city, district, town, village)
if name is not None: if name is not None:
group = Group(name=name, presentation=presentation, image=image, type_id=type, status=status, group = Group(name=name, presentation=presentation, image=image, type_id=type, status=status,
province=province_r, cities=city_r, district=district_r, town=town_r, village=village_r,user_id=user.id,classify=classify) province=province_r, cities=city_r, district=district_r, town=town_r, village=village_r,
user_id=user.id, classify=classify)
group.save() group.save()
messages.success(request, '添加成功') messages.success(request, '添加成功')
return render(request,'management/add-group-admin-and-user.html',{'group':group}) return render(request, 'management/add-group-admin-and-user.html', {'group': group})
else: else:
messages.error(request, '矩阵名不能为空') messages.error(request, '矩阵名不能为空')
# return HttpResponseRedirect('/management/group/management/') # return HttpResponseRedirect('/management/group/management/')
return render(request, 'management/group-management-create.html', return render(request, 'management/group-management-create.html',
{'group_status_choices_list': group_status_choices_list, 'group_type': group_type,'g_c_c_res':g_c_c_res}) {'group_status_choices_list': group_status_choices_list, 'group_type': group_type,
'g_c_c_res': g_c_c_res})
@login_required
def group_admin_create(request, pk): def group_admin_create(request, pk):
if request.method == 'POST': if request.method == 'POST':
user = request.POST.get("user") user = request.POST.get("user")
@ -354,6 +368,7 @@ def group_admin_create(request, pk):
return render(request, 'management/group-admin-create.html', {'usee': user, 'group': group, 'pk': pk}) return render(request, 'management/group-admin-create.html', {'usee': user, 'group': group, 'pk': pk})
@login_required
def group_admin_delete(request, pk, group_pk): def group_admin_delete(request, pk, group_pk):
group_admin = Group_admin.objects.get(id=pk) group_admin = Group_admin.objects.get(id=pk)
group_admin.delete() group_admin.delete()
@ -361,6 +376,7 @@ def group_admin_delete(request, pk, group_pk):
return HttpResponseRedirect('/management/group/update/%s/' % (group_pk)) return HttpResponseRedirect('/management/group/update/%s/' % (group_pk))
@login_required
def group_user_create(request, pk): def group_user_create(request, pk):
if request.method == 'POST': if request.method == 'POST':
user = request.POST.get('user') user = request.POST.get('user')
@ -377,6 +393,7 @@ def group_user_create(request, pk):
return render(request, 'management/group-user-create.html', {'usee': user, 'group': group, 'pk': pk}) return render(request, 'management/group-user-create.html', {'usee': user, 'group': group, 'pk': pk})
@login_required
def group_user_delete(request, pk, group_pk): def group_user_delete(request, pk, group_pk):
group_user = Group_user.objects.get(id=pk) group_user = Group_user.objects.get(id=pk)
group_user.delete() group_user.delete()
@ -384,6 +401,7 @@ def group_user_delete(request, pk, group_pk):
return HttpResponseRedirect('/management/group/update/%s/' % (group_pk)) return HttpResponseRedirect('/management/group/update/%s/' % (group_pk))
@login_required
def group_delete(request, pk): def group_delete(request, pk):
group = Group.objects.get(id=pk) group = Group.objects.get(id=pk)
group.delete() group.delete()
@ -391,6 +409,7 @@ def group_delete(request, pk):
return HttpResponseRedirect('/management/group/management/') return HttpResponseRedirect('/management/group/management/')
@login_required
def organization_management(request): def organization_management(request):
user = request.user user = request.user
o = Organization.objects.get(userprofile__user_id=user.id) o = Organization.objects.get(userprofile__user_id=user.id)
@ -439,7 +458,7 @@ def organization_management(request):
o['administrativedivision'] = str(Area_code_2020.objects.get(code=i.province).name) + '-' + str( o['administrativedivision'] = str(Area_code_2020.objects.get(code=i.province).name) + '-' + str(
Area_code_2020.objects.get(code=i.cities).name) + '-' + str( Area_code_2020.objects.get(code=i.cities).name) + '-' + str(
Area_code_2020.objects.get(code=i.district).name) Area_code_2020.objects.get(code=i.district).name)
elif len(i.province) > 0 and len(i.cities) > 0 : elif len(i.province) > 0 and len(i.cities) > 0:
o['administrativedivision'] = str(Area_code_2020.objects.get(code=i.province).name) + '-' + str( o['administrativedivision'] = str(Area_code_2020.objects.get(code=i.province).name) + '-' + str(
Area_code_2020.objects.get(code=i.cities).name) Area_code_2020.objects.get(code=i.cities).name)
elif len(i.province) > 0: elif len(i.province) > 0:
@ -453,6 +472,7 @@ def organization_management(request):
return render(request, 'management/organization-management.html', {"organization": organization, 'res': res}) return render(request, 'management/organization-management.html', {"organization": organization, 'res': res})
@login_required
def organization_delete(request, pk): def organization_delete(request, pk):
organization = Organization.objects.get(id=pk) organization = Organization.objects.get(id=pk)
organization.delete() organization.delete()
@ -460,6 +480,7 @@ def organization_delete(request, pk):
return HttpResponseRedirect('/management/organization/management/') return HttpResponseRedirect('/management/organization/management/')
@login_required
def organization_update(request, pk): def organization_update(request, pk):
organization = Organization.objects.get(id=pk) organization = Organization.objects.get(id=pk)
organizationtype = Organizationtype.objects.all() organizationtype = Organizationtype.objects.all()
@ -498,7 +519,7 @@ def organization_update(request, pk):
if image is not None: if image is not None:
Organization.objects.filter(id=pk).update(name=name, organizationtype_id=organizationtype, Organization.objects.filter(id=pk).update(name=name, organizationtype_id=organizationtype,
province=province_r, cities=city_r, district=district_r, province=province_r, cities=city_r, district=district_r,
town=town_r, village=village_r,level_id=level_id) town=town_r, village=village_r, level_id=level_id)
o = Organization.objects.get(id=pk) o = Organization.objects.get(id=pk)
o.image = image o.image = image
o.save() o.save()
@ -507,11 +528,11 @@ def organization_update(request, pk):
else: else:
Organization.objects.filter(id=pk).update(name=name, organizationtype_id=organizationtype, Organization.objects.filter(id=pk).update(name=name, organizationtype_id=organizationtype,
province=province_r, cities=city_r, district=district_r, province=province_r, cities=city_r, district=district_r,
town=town_r, village=village_r,level_id=level_id) town=town_r, village=village_r, level_id=level_id)
messages.success(request, '修改成功') messages.success(request, '修改成功')
return HttpResponseRedirect('/management/organization/management/') return HttpResponseRedirect('/management/organization/management/')
return render(request, 'management/organization-management-update.html', return render(request, 'management/organization-management-update.html',
{'organization': organization, 'organizationtype': organizationtype,'level':level}) {'organization': organization, 'organizationtype': organizationtype, 'level': level})
def organization_create(request): def organization_create(request):
@ -535,19 +556,22 @@ def organization_create(request):
if name is not None: if name is not None:
organization = Organization(name=name, image=image, organizationtype_id=organizationtype, organization = Organization(name=name, image=image, organizationtype_id=organizationtype,
province=province, cities=city, district=district, town=town, province=province, cities=city, district=district, town=town,
village=village,level_id=level_id,status='0') village=village, level_id=level_id, status='0')
organization.save() organization.save()
messages.success(request, '添加成功') messages.success(request, '添加成功')
else: else:
messages.error(request, '单位名不能为空') messages.error(request, '单位名不能为空')
return HttpResponseRedirect('/management/organization/management/') # return HttpResponseRedirect('/management/organization/management/')
return render(request, 'management/organization-management-create.html', {'organizationtype': organizationtype,'level':level}) return render(request, 'management/organization-management-create.html',
{'organizationtype': organizationtype, 'level': level})
@login_required
def newmedia_management_create_menu(request): def newmedia_management_create_menu(request):
return render(request, 'management/newmedia-management-create-menu.html') return render(request, 'management/newmedia-management-create-menu.html')
@login_required
def newmedia_management_create_weixin(request): def newmedia_management_create_weixin(request):
weixin_status_choices_list = [] weixin_status_choices_list = []
for w in range(2): for w in range(2):
@ -586,6 +610,7 @@ def newmedia_management_create_weixin(request):
{'weixin_status_choices_list': weixin_status_choices_list, "organization": organization}) {'weixin_status_choices_list': weixin_status_choices_list, "organization": organization})
@login_required
def newmedia_management_create_weibo(request): def newmedia_management_create_weibo(request):
weibo_status_choices_list = [] weibo_status_choices_list = []
for w in range(2): for w in range(2):
@ -625,6 +650,7 @@ def newmedia_management_create_weibo(request):
{'weibo_status_choices_list': weibo_status_choices_list, "organization": organization}) {'weibo_status_choices_list': weibo_status_choices_list, "organization": organization})
@login_required
def newmedia_management_create_toutiao(request): def newmedia_management_create_toutiao(request):
toutiao_status_choices_list = [] toutiao_status_choices_list = []
for w in range(2): for w in range(2):
@ -663,6 +689,8 @@ def newmedia_management_create_toutiao(request):
return render(request, 'management/newmedia-management-create-toutiao.html', return render(request, 'management/newmedia-management-create-toutiao.html',
{'toutiao_status_choices_list': toutiao_status_choices_list, "organization": organization}) {'toutiao_status_choices_list': toutiao_status_choices_list, "organization": organization})
@login_required
def newmedia_management_create_douyin(request): def newmedia_management_create_douyin(request):
douyin_status_choices_list = [] douyin_status_choices_list = []
for w in range(2): for w in range(2):
@ -680,13 +708,13 @@ def newmedia_management_create_douyin(request):
if organization is not None: if organization is not None:
if image is not None: if image is not None:
douyin = Douyin(code=code, douyinid=douyinid, alias=alias, image=image, douyin = Douyin(code=code, douyinid=douyinid, alias=alias, image=image,
organization_id=organization, status=status) organization_id=organization, status=status)
douyin.save() douyin.save()
messages.success(request, '创建成功') messages.success(request, '创建成功')
return HttpResponseRedirect('/management/newmedia/management/create/douyin/') return HttpResponseRedirect('/management/newmedia/management/create/douyin/')
else: else:
douyin = Douyin(code=code, douyinid=douyinid, alias=alias, image='douyin.png', douyin = Douyin(code=code, douyinid=douyinid, alias=alias, image='douyin.png',
organization_id=organization, status=status) organization_id=organization, status=status)
douyin.save() douyin.save()
messages.success(request, '创建成功') messages.success(request, '创建成功')
return HttpResponseRedirect('/management/newmedia/management/create/douyin/') return HttpResponseRedirect('/management/newmedia/management/create/douyin/')
@ -702,6 +730,8 @@ def newmedia_management_create_douyin(request):
return render(request, 'management/newmedia-management-create-douyin.html', return render(request, 'management/newmedia-management-create-douyin.html',
{'douyin_status_choices_list': douyin_status_choices_list, "organization": organization}) {'douyin_status_choices_list': douyin_status_choices_list, "organization": organization})
@login_required
def newmedia_management_create_qita(request): def newmedia_management_create_qita(request):
qita_status_choices_list = [] qita_status_choices_list = []
for w in range(2): for w in range(2):
@ -741,10 +771,12 @@ def newmedia_management_create_qita(request):
{'qita_status_choices_list': qita_status_choices_list, "organization": organization}) {'qita_status_choices_list': qita_status_choices_list, "organization": organization})
@login_required
def newmedia_management_edit_menu(request): def newmedia_management_edit_menu(request):
return render(request, 'management/newmedia-management-edit-menu.html') return render(request, 'management/newmedia-management-edit-menu.html')
@login_required
def newmedia_management_edit_weixin(request): def newmedia_management_edit_weixin(request):
user = request.user user = request.user
o = Organization.objects.get(userprofile__user_id=user.id) o = Organization.objects.get(userprofile__user_id=user.id)
@ -756,9 +788,11 @@ def newmedia_management_edit_weixin(request):
if level == 1: if level == 1:
weixin = Weixin.objects.filter(organization__province=province).order_by('-created') weixin = Weixin.objects.filter(organization__province=province).order_by('-created')
elif level == 2: elif level == 2:
weixin = Weixin.objects.filter(organization__province=province,organization__cities=cities).order_by('-created') weixin = Weixin.objects.filter(organization__province=province, organization__cities=cities).order_by(
'-created')
elif level == 3: elif level == 3:
weixin = Weixin.objects.filter(organization__province=province, organization__cities=cities,organization__district=district).order_by( weixin = Weixin.objects.filter(organization__province=province, organization__cities=cities,
organization__district=district).order_by(
'-created') '-created')
paginator = Paginator(weixin, 6) paginator = Paginator(weixin, 6)
page = int(request.GET.get('page', 1)) page = int(request.GET.get('page', 1))
@ -808,6 +842,7 @@ def newmedia_management_edit_weixin(request):
return render(request, 'management/newmedia-management-edit-weixin.html', {'weixin': weixin, 'res': res}) return render(request, 'management/newmedia-management-edit-weixin.html', {'weixin': weixin, 'res': res})
@login_required
def newmedia_management_edit_weibo(request): def newmedia_management_edit_weibo(request):
user = request.user user = request.user
o = Organization.objects.get(userprofile__user_id=user.id) o = Organization.objects.get(userprofile__user_id=user.id)
@ -819,9 +854,10 @@ def newmedia_management_edit_weibo(request):
if level == 1: if level == 1:
weibo = Weibo.objects.filter(organization__province=province).order_by('-created') weibo = Weibo.objects.filter(organization__province=province).order_by('-created')
elif level == 2: elif level == 2:
weibo = Weibo.objects.filter(organization__province=province,organization__cities=cities).order_by('-created') weibo = Weibo.objects.filter(organization__province=province, organization__cities=cities).order_by('-created')
elif level == 3: elif level == 3:
weibo = Weibo.objects.filter(organization__province=province, organization__cities=cities,organization__district=district).order_by('-created') weibo = Weibo.objects.filter(organization__province=province, organization__cities=cities,
organization__district=district).order_by('-created')
paginator = Paginator(weibo, 6) paginator = Paginator(weibo, 6)
page = int(request.GET.get('page', 1)) page = int(request.GET.get('page', 1))
try: try:
@ -870,6 +906,7 @@ def newmedia_management_edit_weibo(request):
return render(request, 'management/newmedia-management-edit-weibo.html', {'weibo': weibo, 'res': res}) return render(request, 'management/newmedia-management-edit-weibo.html', {'weibo': weibo, 'res': res})
@login_required
def newmedia_management_edit_toutiao(request): def newmedia_management_edit_toutiao(request):
user = request.user user = request.user
o = Organization.objects.get(userprofile__user_id=user.id) o = Organization.objects.get(userprofile__user_id=user.id)
@ -881,9 +918,11 @@ def newmedia_management_edit_toutiao(request):
if level == 1: if level == 1:
toutiao = Toutiao.objects.filter(organization__province=province).order_by('-created') toutiao = Toutiao.objects.filter(organization__province=province).order_by('-created')
elif level == 2: elif level == 2:
toutiao = Toutiao.objects.filter(organization__province=province,organization__cities=cities).order_by('-created') toutiao = Toutiao.objects.filter(organization__province=province, organization__cities=cities).order_by(
'-created')
elif level == 3: elif level == 3:
toutiao = Toutiao.objects.filter(organization__province=province, organization__cities=cities,organization__district=district).order_by( toutiao = Toutiao.objects.filter(organization__province=province, organization__cities=cities,
organization__district=district).order_by(
'-created') '-created')
paginator = Paginator(toutiao, 6) paginator = Paginator(toutiao, 6)
page = int(request.GET.get('page', 1)) page = int(request.GET.get('page', 1))
@ -932,6 +971,8 @@ def newmedia_management_edit_toutiao(request):
res.append(o) res.append(o)
return render(request, 'management/newmedia-management-edit-toutiao.html', {'toutiao': toutiao, 'res': res}) return render(request, 'management/newmedia-management-edit-toutiao.html', {'toutiao': toutiao, 'res': res})
@login_required
def newmedia_management_edit_douyin(request): def newmedia_management_edit_douyin(request):
user = request.user user = request.user
o = Organization.objects.get(userprofile__user_id=user.id) o = Organization.objects.get(userprofile__user_id=user.id)
@ -943,9 +984,11 @@ def newmedia_management_edit_douyin(request):
if level == 1: if level == 1:
douyin = Douyin.objects.filter(organization__province=province).order_by('-created') douyin = Douyin.objects.filter(organization__province=province).order_by('-created')
elif level == 2: elif level == 2:
douyin = Douyin.objects.filter(organization__province=province,organization__cities=cities).order_by('-created') douyin = Douyin.objects.filter(organization__province=province, organization__cities=cities).order_by(
'-created')
elif level == 3: elif level == 3:
douyin = Douyin.objects.filter(organization__province=province, organization__cities=cities,organization__district=district).order_by( douyin = Douyin.objects.filter(organization__province=province, organization__cities=cities,
organization__district=district).order_by(
'-created') '-created')
paginator = Paginator(douyin, 6) paginator = Paginator(douyin, 6)
page = int(request.GET.get('page', 1)) page = int(request.GET.get('page', 1))
@ -964,29 +1007,38 @@ def newmedia_management_edit_douyin(request):
o['douyinid'] = w.douyinid o['douyinid'] = w.douyinid
o['organization'] = w.organization.name o['organization'] = w.organization.name
o['organization_type'] = w.organization.organizationtype.organizationtype o['organization_type'] = w.organization.organizationtype.organizationtype
if len(w.organization.province) > 0 and len(w.organization.cities) > 0 and len(w.organization.district) > 0 and len(w.organization.town) > 0 and len(w.organization.village) > 0: if len(w.organization.province) > 0 and len(w.organization.cities) > 0 and len(
o['administrativedivision'] = str(Area_code_2020.objects.get(code=w.organization.province).name) + '-' + str( w.organization.district) > 0 and len(w.organization.town) > 0 and len(w.organization.village) > 0:
o['administrativedivision'] = str(
Area_code_2020.objects.get(code=w.organization.province).name) + '-' + str(
Area_code_2020.objects.get(code=w.organization.cities).name) + '-' + str( Area_code_2020.objects.get(code=w.organization.cities).name) + '-' + str(
Area_code_2020.objects.get(code=w.organization.district).name) + '-' + str( Area_code_2020.objects.get(code=w.organization.district).name) + '-' + str(
Area_code_2020.objects.get(code=w.organization.town).name) + '-' + str( Area_code_2020.objects.get(code=w.organization.town).name) + '-' + str(
Area_code_2020.objects.get(code=w.organization.village).name) Area_code_2020.objects.get(code=w.organization.village).name)
elif len(w.organization.province) > 0 and len(w.organization.cities) > 0 and len(w.organization.district) > 0 and len(w.organization.town) > 0: elif len(w.organization.province) > 0 and len(w.organization.cities) > 0 and len(
o['administrativedivision'] = str(Area_code_2020.objects.get(code=w.organization.province).name) + '-' + str( w.organization.district) > 0 and len(w.organization.town) > 0:
o['administrativedivision'] = str(
Area_code_2020.objects.get(code=w.organization.province).name) + '-' + str(
Area_code_2020.objects.get(code=w.organization.cities).name) + '-' + str( Area_code_2020.objects.get(code=w.organization.cities).name) + '-' + str(
Area_code_2020.objects.get(code=w.organization.district).name) + '-' + str( Area_code_2020.objects.get(code=w.organization.district).name) + '-' + str(
Area_code_2020.objects.get(code=w.organization.town).name) Area_code_2020.objects.get(code=w.organization.town).name)
elif len(w.organization.province) > 0 and len(w.organization.cities) > 0 and len(w.organization.district) > 0: elif len(w.organization.province) > 0 and len(w.organization.cities) > 0 and len(w.organization.district) > 0:
o['administrativedivision'] = str(Area_code_2020.objects.get(code=w.organization.province).name) + '-' + str( o['administrativedivision'] = str(
Area_code_2020.objects.get(code=w.organization.province).name) + '-' + str(
Area_code_2020.objects.get(code=w.organization.cities).name) + '-' + str( Area_code_2020.objects.get(code=w.organization.cities).name) + '-' + str(
Area_code_2020.objects.get(code=w.organization.district).name) Area_code_2020.objects.get(code=w.organization.district).name)
elif len(w.organization.province) > 0 and len(w.organization.cities) > 0 : elif len(w.organization.province) > 0 and len(w.organization.cities) > 0:
o['administrativedivision'] = str(Area_code_2020.objects.get(code=w.organization.province).name) + '-' + str( o['administrativedivision'] = str(
Area_code_2020.objects.get(code=w.organization.province).name) + '-' + str(
Area_code_2020.objects.get(code=w.organization.cities).name) Area_code_2020.objects.get(code=w.organization.cities).name)
elif len(w.organization.province) > 0: elif len(w.organization.province) > 0:
o['administrativedivision'] = str(Area_code_2020.objects.get(code=w.organization.province).name) o['administrativedivision'] = str(Area_code_2020.objects.get(code=w.organization.province).name)
o['status'] = w.status o['status'] = w.status
res.append(o) res.append(o)
return render(request, 'management/newmedia-management-edit-douyin.html', {'douyin': douyin, 'res': res}) return render(request, 'management/newmedia-management-edit-douyin.html', {'douyin': douyin, 'res': res})
@login_required
def newmedia_management_edit_qita(request): def newmedia_management_edit_qita(request):
user = request.user user = request.user
o = Organization.objects.get(userprofile__user_id=user.id) o = Organization.objects.get(userprofile__user_id=user.id)
@ -998,9 +1050,10 @@ def newmedia_management_edit_qita(request):
if level == 1: if level == 1:
qita = Qita.objects.filter(organization__province=province).order_by('-created') qita = Qita.objects.filter(organization__province=province).order_by('-created')
elif level == 2: elif level == 2:
qita = Qita.objects.filter(organization__province=province,organization__cities=cities).order_by('-created') qita = Qita.objects.filter(organization__province=province, organization__cities=cities).order_by('-created')
elif level == 3: elif level == 3:
qita = Qita.objects.filter(organization__province=province, organization__cities=cities,organization__district=district).order_by('-created') qita = Qita.objects.filter(organization__province=province, organization__cities=cities,
organization__district=district).order_by('-created')
paginator = Paginator(qita, 6) paginator = Paginator(qita, 6)
page = int(request.GET.get('page', 1)) page = int(request.GET.get('page', 1))
try: try:
@ -1050,6 +1103,7 @@ def newmedia_management_edit_qita(request):
return render(request, 'management/newmedia-management-edit-qita.html', {'qita': qita, 'res': res}) return render(request, 'management/newmedia-management-edit-qita.html', {'qita': qita, 'res': res})
@login_required
def newmedia_management_update_weixin(request, pk): def newmedia_management_update_weixin(request, pk):
weixin_status_choices_list = [] weixin_status_choices_list = []
for w in range(2): for w in range(2):
@ -1092,6 +1146,7 @@ def newmedia_management_update_weixin(request, pk):
'weixin_status_choices_list': weixin_status_choices_list}) 'weixin_status_choices_list': weixin_status_choices_list})
@login_required
def newmedia_management_update_weibo(request, pk): def newmedia_management_update_weibo(request, pk):
weibo_status_choices_list = [] weibo_status_choices_list = []
for w in range(2): for w in range(2):
@ -1134,6 +1189,7 @@ def newmedia_management_update_weibo(request, pk):
'weibo_status_choices_list': weibo_status_choices_list}) 'weibo_status_choices_list': weibo_status_choices_list})
@login_required
def newmedia_management_update_toutiao(request, pk): def newmedia_management_update_toutiao(request, pk):
toutiao_status_choices_list = [] toutiao_status_choices_list = []
for w in range(2): for w in range(2):
@ -1175,6 +1231,8 @@ def newmedia_management_update_toutiao(request, pk):
{'toutiao': toutiao, 'organization': organization, {'toutiao': toutiao, 'organization': organization,
'toutiao_status_choices_list': toutiao_status_choices_list}) 'toutiao_status_choices_list': toutiao_status_choices_list})
@login_required
def newmedia_management_update_douyin(request, pk): def newmedia_management_update_douyin(request, pk):
douyin_status_choices_list = [] douyin_status_choices_list = []
for w in range(2): for w in range(2):
@ -1192,14 +1250,14 @@ def newmedia_management_update_douyin(request, pk):
if organization is not None: if organization is not None:
if image is not None: if image is not None:
Douyin.objects.filter(id=pk).update(code=code, douyinid=douyinid, alias=alias, Douyin.objects.filter(id=pk).update(code=code, douyinid=douyinid, alias=alias,
organization_id=organization, status=status) organization_id=organization, status=status)
douyin.image = image douyin.image = image
douyin.save() douyin.save()
messages.success(request, '修改成功') messages.success(request, '修改成功')
return HttpResponseRedirect('/management/newmedia/management/edit/douyin/') return HttpResponseRedirect('/management/newmedia/management/edit/douyin/')
else: else:
Douyin.objects.filter(id=pk).update(code=code, douyinid=douyinid, alias=alias, Douyin.objects.filter(id=pk).update(code=code, douyinid=douyinid, alias=alias,
organization_id=organization, status=status) organization_id=organization, status=status)
messages.success(request, '修改成功') messages.success(request, '修改成功')
return HttpResponseRedirect('/management/newmedia/management/edit/douyin/') return HttpResponseRedirect('/management/newmedia/management/edit/douyin/')
else: else:
@ -1215,6 +1273,9 @@ def newmedia_management_update_douyin(request, pk):
return render(request, 'management/newmedia-management-update-douyin.html', return render(request, 'management/newmedia-management-update-douyin.html',
{'douyin': douyin, 'organization': organization, {'douyin': douyin, 'organization': organization,
'douyin_status_choices_list': douyin_status_choices_list}) 'douyin_status_choices_list': douyin_status_choices_list})
@login_required
def newmedia_management_update_qita(request, pk): def newmedia_management_update_qita(request, pk):
qita_status_choices_list = [] qita_status_choices_list = []
for w in range(2): for w in range(2):
@ -1258,6 +1319,7 @@ def newmedia_management_update_qita(request, pk):
'qita_status_choices_list': qita_status_choices_list}) 'qita_status_choices_list': qita_status_choices_list})
@login_required
def newmedia_management_delete_weixin(request, pk): def newmedia_management_delete_weixin(request, pk):
weixin = Weixin.objects.get(id=pk) weixin = Weixin.objects.get(id=pk)
weixin.delete() weixin.delete()
@ -1265,6 +1327,7 @@ def newmedia_management_delete_weixin(request, pk):
return HttpResponseRedirect('/management/newmedia/management/edit/weixin/') return HttpResponseRedirect('/management/newmedia/management/edit/weixin/')
@login_required
def newmedia_management_delete_weibo(request, pk): def newmedia_management_delete_weibo(request, pk):
weibo = Weibo.objects.get(id=pk) weibo = Weibo.objects.get(id=pk)
weibo.delete() weibo.delete()
@ -1272,24 +1335,31 @@ def newmedia_management_delete_weibo(request, pk):
return HttpResponseRedirect('/management/newmedia/management/edit/weibo/') return HttpResponseRedirect('/management/newmedia/management/edit/weibo/')
@login_required
def newmedia_management_delete_toutiao(request, pk): def newmedia_management_delete_toutiao(request, pk):
toutiao = Toutiao.objects.get(id=pk) toutiao = Toutiao.objects.get(id=pk)
toutiao.delete() toutiao.delete()
messages.success(request, "删除成功") messages.success(request, "删除成功")
return HttpResponseRedirect('/management/newmedia/management/edit/toutiao/') return HttpResponseRedirect('/management/newmedia/management/edit/toutiao/')
@login_required
def newmedia_management_delete_douyin(request, pk): def newmedia_management_delete_douyin(request, pk):
douyin = Douyin.objects.get(id=pk) douyin = Douyin.objects.get(id=pk)
douyin.delete() douyin.delete()
messages.success(request, "删除成功") messages.success(request, "删除成功")
return HttpResponseRedirect('/management/newmedia/management/edit/douyin/') return HttpResponseRedirect('/management/newmedia/management/edit/douyin/')
@login_required
def newmedia_management_delete_qita(request, pk): def newmedia_management_delete_qita(request, pk):
qita = Qita.objects.get(id=pk) qita = Qita.objects.get(id=pk)
qita.delete() qita.delete()
messages.success(request, "删除成功") messages.success(request, "删除成功")
return HttpResponseRedirect('/management/newmedia/management/edit/qita/') return HttpResponseRedirect('/management/newmedia/management/edit/qita/')
@login_required
def new_management(request): def new_management(request):
news = News.objects.all() news = News.objects.all()
paginator = Paginator(news, 6) paginator = Paginator(news, 6)
@ -1322,7 +1392,10 @@ def new_management(request):
elif n.type == '6': elif n.type == '6':
o['type'] = '重点新闻' o['type'] = '重点新闻'
news_list.append(o) news_list.append(o)
return render(request,'management/news-management.html',{'news':news_list,'new':news}) return render(request, 'management/news-management.html', {'news': news_list, 'new': news})
@login_required
def news_management_create(request): def news_management_create(request):
if request.method == 'POST': if request.method == 'POST':
type = request.POST.get('type') type = request.POST.get('type')
@ -1350,7 +1423,7 @@ def news_management_create(request):
t = '6' t = '6'
print(str(title), str(content)) print(str(title), str(content))
news = News(type=t, title=title, author=author, date=date, content=content,source=source,image=image) news = News(type=t, title=title, author=author, date=date, content=content, source=source, image=image)
news.save() news.save()
messages.success(request, '添加成功!!!') messages.success(request, '添加成功!!!')
return HttpResponseRedirect('/management/news/management/create/') return HttpResponseRedirect('/management/news/management/create/')
@ -1361,11 +1434,24 @@ def news_management_create(request):
o['choices'] = list(i)[1] o['choices'] = list(i)[1]
results.append(o) results.append(o)
return render(request, 'management/news-management-create.html', {'type': results}) return render(request, 'management/news-management-create.html', {'type': results})
def news_management_detail(request,pk):
@login_required
def news_management_detail(request, pk):
news = News.objects.get(id=pk) news = News.objects.get(id=pk)
return render(request,'management/news-management-detail.html',{'news':news}) return render(request, 'management/news-management-detail.html', {'news': news})
def news_management_delete(request,pk):
@login_required
def news_management_delete(request, pk):
news = News.objects.get(id=pk) news = News.objects.get(id=pk)
news.delete() news.delete()
messages.success(request,'删除成功') messages.success(request, '删除成功')
return HttpResponseRedirect('/management/news/management/') return HttpResponseRedirect('/management/news/management/')
@login_required
def newmedia_detail_weixin(request, pk):
weixin = Weixin.objects.all().order_by('-created')
return render(request, 'management/newmedia-detail-weixin.html', {'weixin': weixin})

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,10 +1,107 @@
<!DOCTYPE html> {% extends 'dashboard/base/base.html' %}
<html lang="en"> {% load static %}
<head> {% block content %}
<meta charset="UTF-8"> <body class=" ">
<title>Title</title> <!-- START TOPBAR -->
</head>
<body>
</body> <!-- START CONTAINER -->
</html> <div class="page-container row-fluid">
<div class="page-sidebar ">
{% include 'dashboard/base/left.html' %}
</div>
<section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
{% if messages %}
<div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
{% for message in messages %}
{{ message }}.<br/>
{% endfor %}
</div>
{% endif %}
</section>
<div class="chatapi-windows "></div>
<div class="panel panel-default">
<div class="panel-body">
<div class="panel panel-default">
<div class="panel-heading">评论热点文章列表</div>
<div class="panel panel-default">
<!-- Default panel contents -->
<table class="table table-hover" style="font-size: 14px">
<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>
</tr>
</thead>
<tbody>
<tr>
<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">{{ r.date }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.date }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.date }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="panel-body">
<div class="panel panel-default">
<div class="panel-heading">评论高频词</div>
<div class="panel panel-default">
<div id="main" style="width: 800px; height: 600px"></div>
</div>
</div>
</div>
<div class="panel-body">
<div class="panel panel-default">
<div class="panel-heading">热点评论</div>
<div class="panel panel-default">
<!-- Default panel contents -->
<table class="table table-hover" style="font-size: 14px">
<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>
</tr>
</thead>
<tbody>
<tr>
<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">{{ r.date }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.date }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.date }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
</div>
</body>
{% endblock %}
{% block add_js %}
<script type="text/javascript" src="{% static 'js/echarts.min.js' %}"></script>
<script type="text/javascript" src="{% static 'monitor/js/echarts-wordcloud.min.js' %}"></script>
<script type="text/javascript" src="{% static 'monitor/js/ciyuntu.js' %}"></script>
{% endblock %}

View File

@ -1,10 +1,76 @@
<!DOCTYPE html> {% extends 'dashboard/base/base.html' %}
<html lang="en"> {% load static %}
<head> {% block content %}
<meta charset="UTF-8"> <body class=" ">
<title>Title</title> <!-- START TOPBAR -->
</head>
<body>
</body> <!-- START CONTAINER -->
</html> <div class="page-container row-fluid">
<div class="page-sidebar ">
{% include 'dashboard/base/left.html' %}
</div>
<section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
{% if messages %}
<div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
{% for message in messages %}
{{ message }}.<br/>
{% endfor %}
</div>
{% endif %}
</section>
<div class="chatapi-windows "></div>
<div class="panel panel-default">
<div class="panel-body">
<div class="panel panel-default">
<div class="panel-heading">错别字列表</div>
<div class="panel panel-default">
<!-- Default panel contents -->
<table class="table table-hover" style="font-size: 14px">
<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>
<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>
<tr>
<td style="vertical-align: middle;text-align: center">{{ r.code }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.title }}</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">{{ r.date }}</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">{{ r.date }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.date }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
</div>
</body>
{% endblock %}

View File

@ -1,10 +1,198 @@
<!DOCTYPE html> {% extends 'dashboard/base/base.html' %}
<html lang="en"> {% load static %}
<head> {% block content %}
<meta charset="UTF-8"> <body class=" ">
<title>Title</title> <div class="page-container row-fluid">
</head> <div class="page-sidebar ">
<body> {% include 'dashboard/base/left.html' %}
</div>
<section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
{% if messages %}
<div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
{% for message in messages %}
{{ message }}.<br/>
{% endfor %}
</div>
{% endif %}
</section>
<div class="panel">
<div class="panel panel-default">
</body> <div class="panel-heading">监测报告发布情况</div>
</html>
<div class="panel panel-default">
<div class="panel-body">
<div class="panel-heading">最新报告时间</div>
<div class="col-md-6">
<div class="col-md-6">
<div id="fbqk-bggs" style="height: 300px"></div>
</div>
<div class="col-md-6">
<div id="fbqk-yjcs" style="height: 300px"></div>
</div>
</div>
<div class="col-md-6">
<div id="zzt-yjcs" style="height: 300px"></div>
</div>
</div>
</div>
<div class="panel-heading">已有报告列表</div>
<table class="table table-hover" style="font-size: 14px">
<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>
</tr>
</thead>
<tbody>
<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>
</tr>
</tbody>
</table>
</div>
</div>
</section>
</div>
</body>
{% endblock %}
{% block add_js %}
<script src="{% static 'js/echarts.min.js' %}" type="text/javascript"></script>
<script src="{% static 'js/chart-sparkline.js' %}" type="text/javascript"></script>
<script type="text/javascript">
var fbqkBggs = echarts.init(document.getElementById('fbqk-bggs'));
fbqkBggsOption = {
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b}: {c} ({d}%)'
},
legend: {
orient: 'vertical',
left: 10,
data: ['报告个数']
},
color: ['green'],
series: [
{
name: '报告个数',
type: 'pie',
radius: ['60%', '70%'],
avoidLabelOverlap: false,
label: {
show: true,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: '16',
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: [
{value: 335, name: '报告个数'},
]
}
]
};
var fbqkYyjcs = echarts.init(document.getElementById('fbqk-yjcs'));
fbqkYyjcsOption = {
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b}: {c} ({d}%)'
},
legend: {
orient: 'vertical',
left: 10,
data: ['预警次数']
},
color: ['orange'],
series: [
{
name: '预警次数',
type: 'pie',
radius: ['60%', '70%'],
avoidLabelOverlap: false,
label: {
show: true,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: '16',
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: [
{value: 335, name: '预警次数'},
]
}
]
};
var zztYjcs = echarts.init(document.getElementById('zzt-yjcs'));
zztYjcsOption = {
color: ['#3398DB'],
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
axisTick: {
alignWithLabel: true
}
}
],
yAxis: [
{
type: 'value'
}
],
series: [
{
name: '预警次数',
type: 'bar',
barWidth: '60%',
data: [10, 52, 200, 334, 390, 330, 220]
}
]
}
// 使用刚指定的配置项和数据显示图表。
fbqkBggs.setOption(fbqkBggsOption)
fbqkYyjcs.setOption(fbqkYyjcsOption)
zztYjcs.setOption(zztYjcsOption)
</script>
{% endblock %}

View File

@ -1,10 +1,62 @@
<!DOCTYPE html> {% extends 'dashboard/base/base.html' %}
<html lang="en"> {% load static %}
<head> {% block content %}
<meta charset="UTF-8"> <body class=" ">
<title>Title</title> <!-- START TOPBAR -->
</head>
<body>
</body> <!-- START CONTAINER -->
</html> <div class="page-container row-fluid">
<div class="page-sidebar ">
{% include 'dashboard/base/left.html' %}
</div>
<section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
{% if messages %}
<div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
{% for message in messages %}
{{ message }}.<br/>
{% endfor %}
</div>
{% endif %}
</section>
<div class="chatapi-windows "></div>
<div class="panel panel-default">
<div class="panel-body">
<div class="panel panel-default">
<div class="panel-heading">敏感词列表</div>
<div class="panel panel-default">
<!-- Default panel contents -->
<table class="table table-hover" style="font-size: 14px">
<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>
</tr>
</thead>
<tbody>
<tr>
<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">{{ r.date }}</td>
<td style="vertical-align: middle;text-align: center">{{ r.date }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
</div>
</body>
{% endblock %}

View File

@ -0,0 +1,365 @@
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>3D动画标签云</title>
<link rel="stylesheet" type="text/css" href="css/zzsc-demo.css">
<style type="text/css">
#tag-cloud {
width: 120px;
height: 150px;
overflow: hidden;
/* margin: 50px auto; */
}
#tag-cloud svg {
position: absolute;
top: -3px;
left: 50%;
transform: translateX(-50%);
overflow: hidden;
}
[class^="icon-"], [class*=" icon-"] {
font-family: 'icomoon';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
body, html {
font-size: 100%;
padding: 0;
margin: 0;
}
/* Reset */
*,
*:after,
*:before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/* Clearfix hack by Nicolas Gallagher: http://nicolasgallagher.com/micro-clearfix-hack/ */
.clearfix:before,
.clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
body {
/* background: #494A5F; */
color: #D5D6E2;
font-weight: 500;
font-size: 1.05em;
font-family: "Microsoft YaHei", "瀹嬩綋", "Segoe UI", "Lucida Grande", Helvetica, Arial, sans-serif, FreeSans, Arimo;
}
a {
color: #2fa0ec;
text-decoration: none;
outline: none;
}
a:hover, a:focus {
color: #74777b;
}
.zzsc-container {
width: 120px;
height: 150px;
margin: 0 auto;
overflow: hidden;
background: url(../dun.png) no-repeat;
background-size: cover
}
/* Header */
.zzsc-header {
padding: 1em 190px 1em;
letter-spacing: -1px;
text-align: center;
background: #66677c;
}
.zzsc-header h1 {
color: #D5D6E2;
font-weight: 600;
font-size: 2em;
line-height: 1;
margin-bottom: 0;
font-family: "Microsoft YaHei", "瀹嬩綋", "Segoe UI", "Lucida Grande", Helvetica, Arial, sans-serif, FreeSans, Arimo;
}
.zzsc-header h1 span {
font-family: "Microsoft YaHei", "瀹嬩綋", "Segoe UI", "Lucida Grande", Helvetica, Arial, sans-serif, FreeSans, Arimo;
display: block;
font-size: 60%;
font-weight: 400;
padding: 0.8em 0 0.5em 0;
color: #c3c8cd;
}
/*nav*/
.zzsc-demo a {
color: #fff;
text-decoration: none;
}
.zzsc-demo {
width: 100%;
padding-bottom: 1.2em;
}
.zzsc-demo a {
display: inline-block;
margin: 0.5em;
padding: 0.6em 1em;
border: 3px solid #fff;
font-weight: 700;
}
.zzsc-demo a:hover {
opacity: 0.6;
}
.zzsc-demo a.current {
background: #1d7db1;
color: #fff;
}
/* Top Navigation Style */
.zzsc-links {
position: relative;
display: inline-block;
white-space: nowrap;
font-size: 1.5em;
text-align: center;
}
.zzsc-links::after {
position: absolute;
top: 0;
left: 50%;
margin-left: -1px;
width: 2px;
height: 100%;
background: #dbdbdb;
content: '';
-webkit-transform: rotate3d(0, 0, 1, 22.5deg);
transform: rotate3d(0, 0, 1, 22.5deg);
}
.zzsc-icon {
display: inline-block;
margin: 0.5em;
padding: 0em 0;
width: 1.5em;
text-decoration: none;
}
.zzsc-icon span {
display: none;
}
.zzsc-icon:before {
margin: 0 5px;
text-transform: none;
font-weight: normal;
font-style: normal;
font-variant: normal;
font-family: 'icomoon';
line-height: 1;
speak: none;
-webkit-font-smoothing: antialiased;
}
/* footer */
.zzsc-footer {
width: 100%;
padding-top: 10px;
}
.zzsc-small {
font-size: 0.8em;
}
.center {
text-align: center;
}
/****/
.related {
color: #fff;
/* background: #494A5F; */
text-align: center;
font-size: 1.25em;
padding: 0.5em 0;
overflow: hidden;
position: relative;
}
.related > a {
vertical-align: top;
width: calc(100% - 20px);
max-width: 340px;
display: inline-block;
text-align: center;
margin: 20px 10px;
padding: 25px;
font-family: "Microsoft YaHei", "瀹嬩綋", "Segoe UI", "Lucida Grande", Helvetica, Arial, sans-serif, FreeSans, Arimo;
}
.related a {
display: inline-block;
text-align: left;
margin: 20px auto;
padding: 10px 20px;
opacity: 0.8;
-webkit-transition: opacity 0.3s;
transition: opacity 0.3s;
-webkit-backface-visibility: hidden;
}
.related a:hover,
.related a:active {
opacity: 1;
}
.related a img {
max-width: 100%;
opacity: 0.8;
border-radius: 4px;
}
.related a:hover img,
.related a:active img {
opacity: 1;
}
.related h3 {
font-family: "Microsoft YaHei", sans-serif;
}
.related a h3 {
font-weight: 300;
margin-top: 0.15em;
color: #fff;
}
/* icomoon */
.icon-zzsc-home-outline:before {
content: "\e5000";
}
.icon-zzsc-arrow-forward-outline:before {
content: "\e5001";
}
@media screen and (max-width: 50em) {
.zzsc-header {
padding: 3em 10% 4em;
}
.zzsc-header h1 {
font-size: 2em;
}
}
@media screen and (max-width: 40em) {
.zzsc-header h1 {
font-size: 1.5em;
}
}
@media screen and (max-width: 30em) {
.zzsc-header h1 {
font-size: 1.2em;
}
}
</style>
</head>
<body>
<div class="zzsc-container">
<div id='tag-cloud'></div>
</div>
<script src="../../../static/js/jquery-1.11.2.min.js" type="text/javascript"></script>
<script src="../../static/monitor/js/jquery.svg3dtagcloud.min.js"></script>
<script>
$(document).ready(function () {
var entries = [
{label: '1', url: '#', target: '_top'},
{label: '2', url: '#', target: '_top'},
{label: '3', url: '#', target: '_top'},
{label: '4', url: '#', target: '_top'},
{label: '5', url: '#', target: '_top'},
{label: '6', url: 'http://www.lanrenzhijia.com/', target: '_top'},
{label: '7', url: 'http://www.lanrenzhijia.com/', target: '_top'},
{label: '8', url: '#', target: '_top'},
{label: '9', url: 'http://www.lanrenzhijia.com/', target: '_top'},
{label: '10', url: 'http://www.lanrenzhijia.com/', target: '_top'},
{label: 'Can I Use', url: 'http://www.lanrenzhijia.com/', target: '_top'},
{label: 'URL shortener', url: 'http://www.lanrenzhijia.com/', target: '_top'},
{label: 'Grid Layout', url: '#', target: '_top'},
{label: 'Twitter', url: 'http://www.lanrenzhijia.com/', target: '_top'},
{label: 'deviantART', url: 'http://www.lanrenzhijia.com/', target: '_top'},
{label: 'Gulp', url: 'http://www.lanrenzhijia.com/', target: '_top'},
{label: 'Browsersync', url: 'http://www.lanrenzhijia.com/', target: '_top'},
{label: 'GitHub', url: 'https://www.lanrenzhijia.com/', target: '_top'},
{label: 'Shadertoy', url: 'http://www.lanrenzhijia.com/', target: '_top'},
{label: 'Tree View', url: '#', target: '_top'},
{label: 'jsPerf', url: 'http://www.lanrenzhijia.com/', target: '_top'},
{label: 'Foundation', url: 'http://www.lanrenzhijia.com/', target: '_top'},
{label: 'CreateJS', url: 'http://www.lanrenzhijia.com/', target: '_top'},
{label: 'Velocity.js', url: 'http://www.lanrenzhijia.com/', target: '_top'},
{label: 'TweenLite', url: 'http://www.lanrenzhijia.com/', target: '_top'},
{label: 'jQuery', url: 'http://www.lanrenzhijia.com/', target: '_top'},
{label: 'Notification', url: '#', target: '_top'},
{label: 'Parallax', url: '#', target: '_top'}
];
var settings = {
entries: entries,
width: 500,
height: 500,
radius: '100%',
radiusMin: 75,
bgDraw: true,
bgColor: 'rgba(0,0,0,0)',
opacityOver: 1.00,
opacityOut: 0.05,
opacitySpeed: 6,
fov: 800,
speed: 0.2,
fontFamily: 'Oswald, Arial, sans-serif',
fontSize: '20',
fontColor: 'red',
fontWeight: 'normal',//bold
fontStyle: 'normal',//italic
fontStretch: 'normal',//wider, narrower, ultra-condensed, extra-condensed, condensed, semi-condensed, semi-expanded, expanded, extra-expanded, ultra-expanded
fontToUpperCase: true
};
$('#tag-cloud').svg3DTagCloud(settings);
});
</script>
</body>
</html>