diff --git a/safesite/static/safesite/mystatic/js/util2.js b/safesite/static/safesite/mystatic/js/util2.js index aaab891d..886c4956 100644 --- a/safesite/static/safesite/mystatic/js/util2.js +++ b/safesite/static/safesite/mystatic/js/util2.js @@ -2,12 +2,12 @@ function update() { if ($('#mapshowinput').length) { source.clear() - $.get('../api/mapshow?a=risk', function (res) { + $.get('/api/mapshow?a=risk', function (res) { for (let i = 0, len = res.length; i < len; i++) { setPolygon(res[i]) } }) - $.get('../api/mapshow?a=trouble', function (res) { + $.get('/api/mapshow?a=trouble', function (res) { for (let i = 0, len = res.length; i < len; i++) { var data = res[i] data.id = data.yhqy__id @@ -18,7 +18,7 @@ function update() { setPoint(data) } }) - $.get('../api/mapshow?a=miss', function (res) { + $.get('/api/mapshow?a=miss', function (res) { for (let i = 0, len = res.length; i < len; i++) { var data = res[i] data.id = data.missqy__id @@ -29,7 +29,7 @@ function update() { setPoint(data) } }) - $.get('../api/mapshow?a=operation', function (res) { + $.get('/api/mapshow?a=operation', function (res) { console.log(res) for (let i = 0, len = res.length; i < len; i++) { var data = res[i] @@ -44,4 +44,4 @@ function update() { }) } } -var t1 = window.setInterval(update, 1000 * 60) \ No newline at end of file +var t1 = window.setInterval(update, 1000 * 60 * 5) \ No newline at end of file diff --git a/safesite/templates/datashow2.html b/safesite/templates/datashow2.html new file mode 100644 index 00000000..4da6bbdc --- /dev/null +++ b/safesite/templates/datashow2.html @@ -0,0 +1,395 @@ + + + + + + + 数据大屏 + + + + + + + + + + + +
+ 企业安全数据显示大屏 + +
+
+
+
+
+
+ + +
+
+
+ +
+ + + + + + + + + + + + + + + + +
危险作业列表
作业编号作业类型作业区域作业部门作业负责人作业人数开始时间
+
+ +
+ + + + + + + + + + + + + +
排名地市销售收入(万元)同比(%)环比(%)销售计划(万元)计划完成率(%)
+
+
+
+
+ +
+ + + + + + \ No newline at end of file diff --git a/safesite/templates/index.html b/safesite/templates/index.html index a955e065..7ac73928 100644 --- a/safesite/templates/index.html +++ b/safesite/templates/index.html @@ -99,6 +99,8 @@ style="display:none;color: #eee5e7;cursor: pointer;" onclick="setup()">预警设置 数据大屏 + 数据大屏2 diff --git a/safesite/urls.py b/safesite/urls.py index 5f678d62..273aeab4 100644 --- a/safesite/urls.py +++ b/safesite/urls.py @@ -99,6 +99,7 @@ urlpatterns = [ path('html/operproce',views.operproce),#操作规程 path('html/addoperproce',views.addoperproce), path('html/operproce/detail//',views.operprocedetail),#责任制度观看详情 + path('html/datashow2/',views.datashow2), #html页面 diff --git a/safesite/views.py b/safesite/views.py index 2f9ec615..9e53fe8d 100644 --- a/safesite/views.py +++ b/safesite/views.py @@ -490,6 +490,12 @@ def addoperproce(req):#责任制 def operprocedetail(req, id): return render(req, 'operprocedetail.html', {'id': id}) +def datashow2(req): + return render(req,'datashow2.html') + + + + def mainhtml(req): # 计算一些数据 userid = req.session['userid'] @@ -5079,6 +5085,14 @@ def apioperation(req): a = a[startnum:endnum].values('zyid', 'zylx__dickeyname', 'zynum', 'zyfzr__name', 'zynr', 'zyzt', 'submittime', 'todouser__name','zyqy__name') return HttpResponse(transjson(total, a), content_type="application/json") + elif a == 'liston': + userid = req.session['userid'] + usecomp = User.objects.get(userid=userid).usecomp + objs = Operation.objects.filter( + usecomp=usecomp, deletemark=1).exclude(zyzt__zyzt='已关闭') + total = objs.count() + objs = objs.values('zyid', 'zylx__dickeyname', 'zynum','zyfzr__name', 'zynr','zyqy__name','zyqy__id','zybm__partname','kssj').annotate(num=Count('zyry')) + return HttpResponse(transjson(total, objs), content_type="application/json") elif a == 'exportexcel': userid = req.session['userid'] usecomp = User.objects.get(userid=userid).usecomp