- {% endfor %} -
政务新媒体监测系统
{{ weixin_count }}
- 微信 -{{ weibo_count }}
- 微博 -{{ toutiao_count }}
- 今日头条 -{{ qita_count }}
- 其他新媒体 -Visitor's Statistics
-Unique Visitors
- Last Week Rise by 62% --
Registrations
- Up by 57% last 7 days --
diff --git a/NewMediaMonitoring/settings.py b/NewMediaMonitoring/settings.py index da4bf49..8d7b1d5 100644 --- a/NewMediaMonitoring/settings.py +++ b/NewMediaMonitoring/settings.py @@ -47,6 +47,7 @@ INSTALLED_APPS = [ 'monitor', 'polls', 'django_summernote', + 'graph', ] MIDDLEWARE = [ diff --git a/NewMediaMonitoring/urls.py b/NewMediaMonitoring/urls.py index ab05d0f..e71499b 100644 --- a/NewMediaMonitoring/urls.py +++ b/NewMediaMonitoring/urls.py @@ -17,14 +17,21 @@ from django.contrib import admin from django.urls import path, re_path, include from django.conf import settings from django.conf.urls.static import static +# from wagtail.admin import urls as wagtailadmin_urls +# from wagtail.documents import urls as wagtaildocs_urls +# from wagtail.core import urls as wagtail_urls urlpatterns = [ path('polls/', include('polls.urls')), + # re_path(r'^cms/', include(wagtailadmin_urls)), + # re_path(r'^documents/', include(wagtaildocs_urls)), + # re_path(r'^pages/', include(wagtail_urls)), path('admin/', admin.site.urls), path('', include('dashboard.urls')), path('captcha/', include('captcha.urls')), path('management/', include('management.urls')), path('monitor/', include('monitor.urls')), path('summernote/', include('django_summernote.urls')), + path('graph/', include('graph.urls')), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/dashboard/models.py b/dashboard/models.py index 5e15d9c..4b3fd56 100644 --- a/dashboard/models.py +++ b/dashboard/models.py @@ -1,5 +1,4 @@ import uuid -from django_summernote.fields import SummernoteTextField from django.contrib.auth.models import User from django.db import models @@ -15,19 +14,19 @@ class Level(models.Model): return self.name class Group_type(models.Model): id = models.UUIDField('id', primary_key=True, default=uuid.uuid4) - type = models.CharField('群组类型', max_length=256, null=True, blank=True) + type = models.CharField('矩阵类型', max_length=256, null=True, blank=True) def __str__(self): return self.type -# 群组 +# 矩阵 class Group(models.Model): GROUP_STATUS_CHOICES = ( ('0', '关闭'), ('1', '开启') ) id = models.UUIDField('id', primary_key=True, default=uuid.uuid4) - name = models.CharField('群组名称', max_length=256, null=True, blank=True) - presentation = models.TextField('群组描述', null=True, blank=True) + name = models.CharField('矩阵名称', max_length=256, null=True, blank=True) + presentation = models.TextField('矩阵描述', null=True, blank=True) image = models.FileField(upload_to='groupimage', null=True, blank=True) type = models.ForeignKey( Group_type, on_delete=models.CASCADE, null=True, blank=True) @@ -38,6 +37,7 @@ class Group(models.Model): district = models.CharField('县', max_length=256, null=True, blank=True) town = models.CharField('乡', max_length=256, null=True, blank=True) village = models.CharField('村', max_length=256, null=True, blank=True) + user = models.ForeignKey(User,on_delete=models.CASCADE,blank=True,null=True) created = models.DateTimeField('创建时间', auto_now_add=True) updated = models.DateTimeField('更新时间', auto_now=True) @@ -45,7 +45,7 @@ class Group(models.Model): def __str__(self): return self.name -# 群组管理员 +# 矩阵管理员 class Group_admin(models.Model): id = models.UUIDField('id', primary_key=True, default=uuid.uuid4) user = models.ForeignKey( @@ -57,7 +57,7 @@ class Group_admin(models.Model): def __str__(self): return self.group.name -# 群组成员 +# 矩阵成员 class Group_user(models.Model): id = models.UUIDField('id', primary_key=True, default=uuid.uuid4) user = models.ForeignKey( @@ -94,8 +94,8 @@ class Organization(models.Model): district = models.CharField('县', max_length=256, null=True, blank=True) town = models.CharField('乡', max_length=256, null=True, blank=True) village = models.CharField('村', max_length=256, null=True, blank=True) - # group = models.ForeignKey(Group, on_delete=models.CASCADE, null=True, blank=True) - # level = models.ForeignKey(Level,on_delete=models.CASCADE,null=True,blank=True) + level = models.ForeignKey(Level,on_delete=models.CASCADE,null=True,blank=True) + directly = models.CharField('直属',max_length=256,null=True,blank=True) created = models.DateTimeField('创建时间', auto_now_add=True) updated = models.DateTimeField('更新时间', auto_now=True) @@ -171,7 +171,7 @@ class Weixin_data(models.Model): id = models.UUIDField('id', primary_key=True, default=uuid.uuid4) title = models.CharField('文章标题', max_length=256, null=True, blank=True) site = models.CharField('位置', max_length=256, null=True, blank=True) - date = models.CharField('发文时间', max_length=256, null=True, blank=True) + date = models.DateField('发文时间', max_length=256, null=True, blank=True) original = models.BooleanField('是否原创', null=True, blank=True) url = models.CharField('文章链接', max_length=256, null=True, blank=True) author = models.CharField('作者', max_length=256, null=True, blank=True) @@ -235,7 +235,7 @@ class Weibo_data(models.Model): '转发图片url', max_length=256, null=True, blank=True) original = models.BooleanField('是否原创', null=True, blank=True) site = models.CharField('发布位置', max_length=256, null=True, blank=True) - date = models.CharField('发布时间', max_length=256, null=True, blank=True) + date = models.DateField('发布时间', max_length=256, null=True, blank=True) tool = models.CharField('发布工具', max_length=256, null=True, blank=True) like = models.CharField('点赞数', max_length=256, null=True, blank=True) transpond = models.CharField('转发数', max_length=256, null=True, blank=True) @@ -278,7 +278,7 @@ class Toutiao_data(models.Model): commentcount = models.CharField( '评论数', max_length=256, null=True, blank=True) reply = models.CharField('作者回复数', max_length=256, null=True, blank=True) - date = models.CharField('时间', max_length=256, null=True, blank=True) + date = models.DateField('时间', max_length=256, null=True, blank=True) content = models.TextField('正文', null=True, blank=True) comment = models.TextField('评论', null=True, blank=True) toutiao = models.ForeignKey( @@ -335,7 +335,7 @@ class Douyin_data(models.Model): '监测时间内发文量', max_length=256, null=True, blank=True) comment = models.CharField('评论数', max_length=256, null=True, blank=True) reply = models.CharField('作者回复数', max_length=256, null=True, blank=True) - date = models.CharField('最近发文日期', max_length=256, null=True, blank=True) + date = models.DateField('最近发文日期', max_length=256, null=True, blank=True) created = models.DateTimeField('创建时间', auto_now_add=True) updated = models.DateTimeField('更新时间', auto_now=True) @@ -361,7 +361,7 @@ class Qita_jc(models.Model): '监测时间内发文量', max_length=256, null=True, blank=True) comment = models.CharField('评论数', max_length=256, null=True, blank=True) reply = models.CharField('作者回复数', max_length=256, null=True, blank=True) - date = models.CharField('最近发文日期', max_length=256, null=True, blank=True) + date = models.DateField('最近发文日期', max_length=256, null=True, blank=True) created = models.DateTimeField('创建时间', auto_now_add=True) updated = models.DateTimeField('更新时间', auto_now=True) @@ -391,11 +391,12 @@ class News(models.Model): ) id = models.UUIDField('id',primary_key=True,default=uuid.uuid4) type = models.CharField('文章类型',max_length=256,null=True,blank=True,choices=NEWMEDIA_NEWS_CHOICES) + source = models.CharField('文章来源',max_length=256,null=True,blank=True) title = models.CharField('文章标题',max_length=256,null=True,blank=True) image = models.FileField( upload_to='news/%Y/%m/%d/', null=True, blank=True) author = models.CharField('作者',max_length=256,null=True,blank=True) - date = models.CharField('发表日期',null=True,blank=True,max_length=256) + date = models.DateField('发表日期',null=True,blank=True,max_length=256) content = models.TextField('内容',null=True,blank=True) def __str__(self): diff --git a/dashboard/static/dashboard/image/douyin.jpg b/dashboard/static/dashboard/image/douyin.jpg new file mode 100644 index 0000000..7ffa020 Binary files /dev/null and b/dashboard/static/dashboard/image/douyin.jpg differ diff --git a/dashboard/static/dashboard/image/shuliang.jpg b/dashboard/static/dashboard/image/shuliang.jpg new file mode 100644 index 0000000..54ff40d Binary files /dev/null and b/dashboard/static/dashboard/image/shuliang.jpg differ diff --git a/dashboard/templates/dashboard/base/left.html b/dashboard/templates/dashboard/base/left.html index d89d177..61f1df0 100644 --- a/dashboard/templates/dashboard/base/left.html +++ b/dashboard/templates/dashboard/base/left.html @@ -35,7 +35,7 @@ 新媒体舆情 -{#
e[0]||i[1]<0||i[1]>e[1])){var n=this._handleEnds,o=(n[0]+n[1])/2,a=this._updateInterval("all",i[0]-o);this._updateView(),a&&this._dispatchZoomAction()}},_dispatchZoomAction:function(){var t=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,start:t[0],end:t[1]})},_findCoordRect:function(){var i;if(JC(this.getTargetCoordInfo(),function(t){if(!i&&t.length){var e=t[0].model.coordinateSystem;i=e.getRect&&e.getRect()}}),!i){var t=this.api.getWidth(),e=this.api.getHeight();i={x:.2*t,y:.2*e,width:.6*t,height:.6*e}}return i}});function nL(t){return"vertical"===t?"ns-resize":"ew-resize"}JA.extend({type:"dataZoom.inside",defaultOption:{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}});var oL="\0_ec_dataZoom_roams";function aL(t,n){var e=sL(t),o=n.dataZoomId,a=n.coordId;E(e,function(t,e){var i=t.dataZoomInfos;i[o]&&_(n.allCoordIds,a)<0&&(delete i[o],t.count--)}),lL(e);var i=e[a];i||((i=e[a]={coordId:a,dataZoomInfos:{},count:0}).controller=function(t,r){var e=new zy(t.getZr());return E(["pan","zoom","scrollMove"],function(a){e.on(a,function(n){var o=[];E(r.dataZoomInfos,function(t){if(n.isAvailableBehavior(t.dataZoomModel.option)){var e=(t.getRange||{})[a],i=e&&e(r.controller,n);!t.dataZoomModel.get("disabled",!0)&&i&&o.push({dataZoomId:t.dataZoomId,start:i[0],end:i[1]})}}),o.length&&r.dispatchAction(o)})}),e}(t,i),i.dispatchAction=T(uL,t)),i.dataZoomInfos[o]||i.count++,i.dataZoomInfos[o]=n;var r=function(t){var n,o={type_true:2,type_move:1,type_false:0,type_undefined:-1},a=!0;return E(t,function(t){var e=t.dataZoomModel,i=!e.get("disabled",!0)&&(!e.get("zoomLock",!0)||"move");o["type_"+n]=100?!0:!1,s=function(i){if(!(i.length<2)){var e=0;i.each(function(){e=Math.max(e,t(this).outerHeight())}).each(function(){var i=t(this),n=e-(i.outerHeight()-i.height());i.css("min-height",n+"px")})}};o||(e.row?(n.width(),setTimeout(function(){var e=!1,n=[];i.each(function(){var i=t(this),o=i.offset().top;o!=e&&n.length&&(s(t(n)),n=[],o=i.offset().top),n.push(i),e=o}),n.length&&s(t(n))},0)):s(i))}}}(jQuery,UIkit),function(t,i){"use strict";function e(e,n){return n?("object"==typeof e?(e=e instanceof jQuery?e:i.$(e),e.parent().length&&(n.persist=e,n.persist.data("modalPersistParent",e.parent()))):e="string"==typeof e||"number"==typeof e?t("").html(e):t("").html("UIkit.modal Error: Unsupported data type: "+typeof e),e.appendTo(n.element.find(".@-modal-dialog")),n):void 0}var n,o=!1,s=i.$html;i.component("modal",{defaults:{keyboard:!0,bgclose:!0,minScrollHeight:150,center:!1},scrollable:!1,transition:!1,init:function(){n||(n=t("body"));var e=this;this.transition=i.support.transition,this.paddingdir="padding-"+("left"==i.langdirection?"right":"left"),this.dialog=this.find(".@-modal-dialog"),this.on("click",".@-modal-close",function(t){t.preventDefault(),e.hide()}).on("click",function(i){var n=t(i.target);n[0]==e.element[0]&&e.options.bgclose&&e.hide()})},toggle:function(){return this[this.isActive()?"hide":"show"]()},show:function(){if(!this.isActive())return o&&o.hide(!0),this.element.removeClass("@-open").show(),this.resize(),o=this,s.addClass("@-modal-page").height(),this.element.addClass("@-open").trigger("show.uk.modal"),i.Utils.checkDisplay(this.dialog,!0),this},hide:function(t){if(this.isActive()){if(!t&&i.support.transition){var e=this;this.one(i.support.transition.end,function(){e._hide()}).removeClass("@-open")}else this._hide();return this}},resize:function(){var t=n.width();if(this.scrollbarwidth=window.innerWidth-t,n.css(this.paddingdir,this.scrollbarwidth),this.element.css("overflow-y",this.scrollbarwidth?"scroll":"auto"),!this.updateScrollable()&&this.options.center){var i=this.dialog.outerHeight(),e=parseInt(this.dialog.css("margin-top"),10)+parseInt(this.dialog.css("margin-bottom"),10);i+e
+ {% endfor %}
+ 编辑矩阵
矩阵信息表单
+
- {% endfor %}
- 添加群组管理员
群组管理员表单
-
+ {% endfor %}
+ 添加矩阵管理员
矩阵管理员表单
+
- {% endfor %}
- 群组管理
+ {% endfor %}
+ 矩阵管理
- {% endfor %}
- 新建群组
群组信息表单
- {#
+ {% endfor %}
+ 新建矩阵
矩阵信息表单
+ {#
+ {% endfor %}
+ 矩阵管理
- {% endfor %}
- 编辑群组
群组信息表单
-
+ {% endfor %}
+ 编辑矩阵
矩阵信息表单
+
+ {% endfor %}
+ 矩阵管理
矩阵列表
#}
+
+
+
+
+
+
+
+
+
+ {% for r in res_g_u %}
+ 头像
+ 矩阵名称
+ 矩阵类型
+ 管理员个数
+ 成员个数
+ 状态
+
+
+ {% endfor %}
+
+
+ {{ r.name }}
+ {{ r.type }}
+ {{ r.admin_count }}
+ {{ r.admin_count }}
+ {{ r.status }}
+
- {% endfor %}
- 添加群组成员
群组成员表单
-
+ {% endfor %}
+ 添加矩阵成员
矩阵成员表单
+
+ {% endfor %}
+ 新建新媒体
新建抖音
+
- {% endfor %}
- 新建新媒体
+ {% endfor %}
+ 新建新媒体
新媒体编辑
- {% endfor %}
- 编辑新媒体
+ {% endfor %}
+ 编辑新媒体
+ {% endfor %}
+ 新媒体编辑
抖音编辑
+
+ {% endfor %}
+ {{ news.title }}
+
+ {% endfor %}
+ 新闻管理
- {% endfor %}
- 新建单位
单位信息表单
- {#
+ {% endfor %}
+ 新建单位
单位信息表单
+ {#
- {% endfor %}
- 编辑单位
单位信息表单
- {#
+ {% endfor %}
+ 编辑单位
单位信息表单
+ {#
- {% endfor %}
- 主体单位管理
单位列表
- {#
+ {% endfor %}
+ 主体单位管理
单位列表
+ {# =e.maxIterations){t+=e.ellipsis;break}var s=0===r?bn(t,o,e.ascCharWidth,e.cnCharWidth):0f)return{lines:[],width:0,height:0};C.textWidth=pn(C.text,w);var S=x.textWidth,M=null==S||"auto"===S;if("string"==typeof S&&"%"===S.charAt(S.length-1))C.percentWidth=S,u.push(C),S=0;else{if(M){S=C.textWidth;var I=x.textBackgroundColor,T=I&&I.image;T&&sn(T=on(T))&&(S=Math.max(S,T.width*b/T.height))}var A=_?_[1]+_[3]:0;S+=A;var D=null!=d?d-v:null;null!=D&&Dn[0]){for(r=0;rM[1]&&(M[1]=S)}if(!o.pure){var I=u[v];if(m&&null==I)if(null!=m.name)u[v]=I=m.name;else if(null!=i){var T=r[i],A=a[T][y];if(A){I=A[x];var D=l[T].ordinalMeta;D&&D.categories.length&&(I=D.categories[I])}}var C=null==m?null:m.id;null==C&&null!=I&&(d[I]=d[I]||0,0=t&&(0===e?0:n[e-1][0])