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/views.py b/safesite/views.py index c96422cb..6e593125 100644 --- a/safesite/views.py +++ b/safesite/views.py @@ -6079,20 +6079,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') + +