diff --git a/safesite.lnk b/safesite.lnk
deleted file mode 100644
index 129596d1..00000000
Binary files a/safesite.lnk and /dev/null differ
diff --git a/safesite/templates/behavior.html b/safesite/templates/behavior.html
index 1fe2d098..8e007297 100644
--- a/safesite/templates/behavior.html
+++ b/safesite/templates/behavior.html
@@ -76,8 +76,8 @@
},
legend: {
orient: 'vertical',
- x: 'left',
- y: 'bottom',
+ x: 'right',
+ y:'bottom',
data: []
},
toolbox: {
@@ -187,8 +187,12 @@
containLabel: true
},
toolbox: {
+ show: true,
feature: {
- saveAsImage: {}
+ mark: { show: true },
+ dataView: { show: true, readOnly: false },
+ restore: { show: true },
+ saveAsImage: { show: true }
}
},
xAxis: {
@@ -260,33 +264,34 @@
-
+
-
-
-
-
+
+
+
+
-
+
diff --git a/safesite/templates/trainfigure.html b/safesite/templates/trainfigure.html
index 68ec9739..4f601349 100644
--- a/safesite/templates/trainfigure.html
+++ b/safesite/templates/trainfigure.html
@@ -1,5 +1,25 @@
@@ -266,15 +299,24 @@
+
+
+
+
+
+
+
diff --git a/safesite/urls.py b/safesite/urls.py
index 37caa876..31735cea 100644
--- a/safesite/urls.py
+++ b/safesite/urls.py
@@ -157,6 +157,7 @@ urlpatterns = [
path('api/obscount',views.observepic),
path('api/riskas',views.apiriskas),
path('api/trainfg',views.trainfg),
+ path('api/examtj',views.examtj),
path('api/check_session',views.check_session),
#path('api/rights/group/',views.rightsgroup),
diff --git a/safesite/views.py b/safesite/views.py
index ef6f3b3e..54ea5b8b 100644
--- a/safesite/views.py
+++ b/safesite/views.py
@@ -6106,7 +6106,7 @@ def refresh_captcha(request):
def dump(obj):
print('\n'.join(['%s:%s' % item for item in obj.__dict__.items()]))
-
+#教育培训统计图
def trainfg(req):
a = req.GET.get('a')
userid = req.session['userid']
@@ -6128,20 +6128,27 @@ def trainfg(req):
teamlevel.append(a.filter(trainlevel__dicid=7).count())
departmentlevel.append(a.filter(trainlevel__dicid=42).count())
return JsonResponse({'code':1,'companylevel':companylevel,'workshoplevel':workshoplevel,'teamlevel':teamlevel,'departmentlevel':departmentlevel})
+ elif a=='trainuser':
+ a = Trainuser.objects.filter(participant__usecomp__partid=companyid)
+
+ if req.GET.get('fxbm'):
+ fxbm = req.GET.get('fxbm')
+ parts = Partment.objects.filter(partlink__contains=',' + fxbm + ',')|Partment.objects.filter(partid=fxbm)
+ a = a.filter(participant__ubelongpart__in=parts)
+ total = a.count()
+ objs = a.values('participant__name','participant__username').annotate(count=Count('participant__userid'))
+ return HttpResponse(transjson(total,objs),content_type="application/json")
elif a=='traintype':
year = int(req.GET.get('year'))
month = int(req.GET.get('month'))
- daily=[]#日常培训
- related=[]#相关方培训
- jobuser=[]#在岗人员培训
+ traintypelist=[]
+
first_day,first_day_of_next_month = gettime(datetime(year,month,1))
a = Train.objects.filter(usecomp__partid=companyid,deletemark=1,starttime__range=(first_day, first_day_of_next_month))
- daily.append(a.filter(traintype__dickeyid=1).count())
- related.append(a.filter(traintype__dickeyid=108).count())
- jobuser.append(a.filter(traintype__dickeyid=107).count())
- return JsonResponse({'code':1,'daily':daily,'related':related,'jobuser':jobuser})
- elif a=='trainuser':
- a = Trainuser.objects.filter(participant__userid=userid)
- total = a.count()
- objs = a.annotate(count=Count('participant')).values('participant__username','count')
- return HttpResponse(transjson(total,objs),content_type="application/json")
+ for i in Dickey.objects.filter(dicparent_id=8):
+ count=a.filter(traintype__dickeyid=i.dickeyid).count()
+ dickeyname=i.dickeyname
+ traintypelist.append({'value':count,'name':dickeyname})
+ return HttpResponse(json.dumps({'code':1,'data':{'traintypelist':list(traintypelist)}}), content_type='application/json')
+
+