This commit is contained in:
xieshen 2021-02-02 08:47:02 +08:00
commit 1896d002df
3 changed files with 86 additions and 3 deletions

View File

@ -4,7 +4,7 @@ import datetime
from django.contrib.auth.models import User
from django.db import models
from dashboard.models import Group, Group_user
from dashboard.models import Group, Group_user, NewMedia
VERIFY_CODE_TYPE_CHOICES = (
(0, 'register'),
@ -239,4 +239,26 @@ class VoiceNotifyRecord(models.Model):
phone = models.CharField('phone', max_length=32)
added = models.DateField(auto_now_add=True)
notice_id = models.CharField('notice_id', max_length=64)
updated = models.DateTimeField(auto_now=True)
updated = models.DateTimeField(auto_now=True)
UNQUALIFIED_MEDIA_TYPE_CHOICES = (
(0, 'weixin'),
(1, 'weibo'),
(2, 'toutiao'),
(3, 'douyin'),
(4, 'qita')
)
class UnqualifiedMedia(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
media = models.ForeignKey(NewMedia, on_delete=models.CASCADE)
result = models.TextField('result', null=True, blank=True)
cou = models.IntegerField('count of update', default=0)
dos = models.IntegerField('days of silent', default=0)
sdos = models.DateField('start date of silent', null=True, blank=True)
edos = models.DateField('end date of silent', null=True, blank=True)
version = models.IntegerField('version', default=0)
added = models.DateField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)

View File

@ -0,0 +1,56 @@
{% extends 'polls/base.html' %}
{% load static %}
{% block content%}
<div class="flex-container">
<div class="row">
<div class="col-xs-12">
<div id="chart1" style="width: 100%%;height:400px;margin:20px 10px;"></div>
</div>
</div>
</div>
{% endblock%}
{% block add_js %}
<script src="{% static 'polls/js/echarts.min.js' %}"></script>
<script type="text/javascript">
var myChart = echarts.init(document.getElementById('chart1'));
var option = {
title: {
text: '政务新媒体存在问题占比',
left: 'center',
subtextStyle: {
fontSize: 16,
}
},
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)'
},
legend: {
top: '15%',
data: ['账号不存在', '账号已关闭', '监测期间无更新', '两周无更新', '名称变更']
},
series: [
{
name: '总量',
type: 'pie',
radius: '55%',
center: ['50%', '60%'],
data: [
{name: '账号不存在', value:27},
{name: '账号已关闭', vlaue:1},
{name: '监测期间无更新', value:6},
{name: '两周无更新', value:46},
{name: '名称变更', value:25},
],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]};
myChart.setOption(option);
</script>
{% endblock %}

View File

@ -34,7 +34,6 @@ def monitor_statistics(request):
chart4_data.append({'name': '激活', 'value': profile_status_1_count})
chart4_data.append({'name': '未激活', 'value': profile_status_0_count})
wbc = Weibo.objects.exclude(status=0).count()
wxc = Weixin.objects.exclude(status=0).count()
ttc = Toutiao.objects.exclude(status=0).count()
@ -141,3 +140,9 @@ def city_ranking(request):
def monitor_result(request):
return render(request, 'polls/monitor_result.html')
def monitor_unqualified_result(request):
user_id = request.user.id
return render(request, 'polls/monitor_unqualified_result.html')