diff --git a/polls/templates/polls/monitor_result.html b/polls/templates/polls/monitor_result.html new file mode 100644 index 0000000..2517a33 --- /dev/null +++ b/polls/templates/polls/monitor_result.html @@ -0,0 +1,56 @@ +{% extends 'polls/base.html' %} +{% load static %} +{% block content%} +
+
+
+
+
+
+
+{% endblock%} +{% block add_js %} + + +{% endblock %} \ No newline at end of file diff --git a/polls/templates/polls/monitor_statistics.html b/polls/templates/polls/monitor_statistics.html index c7a3e1e..3f40208 100644 --- a/polls/templates/polls/monitor_statistics.html +++ b/polls/templates/polls/monitor_statistics.html @@ -55,7 +55,7 @@ var option2 = { title: { text: '政务新媒体区域分布', - subtext: '省直部门:{{total1}},市直部门:{{total2}},县区政府:{{total3}}', + subtext: '省直部门{{total1}},市直部门{{total2}},县区政府{{total3}}', subtextStyle: { fontSize: 16, }, diff --git a/polls/urls.py b/polls/urls.py index a84a08c..954be7c 100644 --- a/polls/urls.py +++ b/polls/urls.py @@ -30,6 +30,8 @@ urlpatterns = [ views.news_detail, name='polls_news_detail'), path('monitor/statistics/', views.monitor_statistics, name='polls_monitor_statistics'), + path('monitor/result/', views.monitor_result, + name='polls_monitor_result'), path('tasks/list/', views.tasks, name='polls_tasks_list'), path('tasks/create/', views.create_task, name='polls_tasks_create'), path('tasks/create_test/', views.create_test_task, diff --git a/polls/views/__init__.py b/polls/views/__init__.py index e621b8f..d1468be 100644 --- a/polls/views/__init__.py +++ b/polls/views/__init__.py @@ -2,7 +2,7 @@ from .user import index, status_500, status_401, polls_login, send_code, registe from .notice import notices, notice_top, read_notice, reply_notice from .media import medias, my_medias, create_media, update_media, media_detail from .news import news_list, news_top, news_detail -from .monitor import monitor_statistics +from .monitor import monitor_statistics, monitor_result from .task import tasks, create_task, create_test_task from .group import groups, room from .compartment import compartments diff --git a/polls/views/__pycache__/__init__.cpython-38.pyc b/polls/views/__pycache__/__init__.cpython-38.pyc index 19a7d06..aa0d13a 100644 Binary files a/polls/views/__pycache__/__init__.cpython-38.pyc and b/polls/views/__pycache__/__init__.cpython-38.pyc differ diff --git a/polls/views/__pycache__/monitor.cpython-38.pyc b/polls/views/__pycache__/monitor.cpython-38.pyc index b6273dd..cd9aa1c 100644 Binary files a/polls/views/__pycache__/monitor.cpython-38.pyc and b/polls/views/__pycache__/monitor.cpython-38.pyc differ diff --git a/polls/views/__pycache__/task.cpython-38.pyc b/polls/views/__pycache__/task.cpython-38.pyc index 1293b6d..fbf8548 100644 Binary files a/polls/views/__pycache__/task.cpython-38.pyc and b/polls/views/__pycache__/task.cpython-38.pyc differ diff --git a/polls/views/monitor.py b/polls/views/monitor.py index 08d6f9e..54b05b6 100644 --- a/polls/views/monitor.py +++ b/polls/views/monitor.py @@ -104,3 +104,7 @@ def monitor_statistics(request): total3 = NewMedia.category_three_count() return render(request, 'polls/monitor_statistics.html', {'chart1_data': chart1_data, 'total': total, 'chart2_data': chart2_data, 'total1': total1, 'total2': total2, 'total3': total3}) + + +def monitor_result(request): + return render(request, 'polls/monitor_result.html') \ No newline at end of file diff --git a/polls/views/task.py b/polls/views/task.py index 87e8964..38da068 100644 --- a/polls/views/task.py +++ b/polls/views/task.py @@ -24,13 +24,14 @@ def tasks(request): result = dict() result['id'] = o.id m = [] - for g in o.groups: + for g in o.groups.all(): n = model_to_dict(g, ['id', 'name']) m.append(n) result['groups'] = m + result['content'] = o.content result['added'] = o.added.strftime("%Y-%m-%d %H:%M:%S") results.append(result) - return JsonResponse(results, safe=False) + return JsonResponse({'status': 'success', 'message':results}, safe=False) @csrf_exempt