yf_ymm 5 лет назад
Родитель
Сommit
cb1d6fd4a5
3 измененных файлов с 26 добавлено и 4 удалено
  1. 5 1
      apps/Equipment/urls.py
  2. 19 2
      apps/Equipment/views.py
  3. 2 1
      apps/Home/views.py

+ 5 - 1
apps/Equipment/urls.py

@@ -20,7 +20,7 @@ from apps.Equipment.views import (
     Video_Upload,JKview,Person_Area_Pub,CropCount_View,Sell_Del,Pick_Del,
     Video_Upload,JKview,Person_Area_Pub,CropCount_View,Sell_Del,Pick_Del,
     Pick_New,Repertory_New_View,Park_Land,Contrast_Detail,Contrast_List,Person_View,Person_List,
     Pick_New,Repertory_New_View,Park_Land,Contrast_Detail,Contrast_List,Person_View,Person_List,
     Area_Create,Area_Map,Person_Limit,Limit_View,Expert,learnDepot,Create_User,Change_Pwd,Delete_User,User_Change_Pwd,QXZ_Auto,QXZ_Value_Mqtt,QXZ_Status2, QXZ_Report_Detail2,
     Area_Create,Area_Map,Person_Limit,Limit_View,Expert,learnDepot,Create_User,Change_Pwd,Delete_User,User_Change_Pwd,QXZ_Auto,QXZ_Value_Mqtt,QXZ_Status2, QXZ_Report_Detail2,
-    Sightsee_Photo,Pic_locat,Home_Farm,Guide_Img)
+    Sightsee_Photo,Pic_locat,Home_Farm,Guide_Img,Alarm_Record)
 
 
 app_name = 'Equipment'
 app_name = 'Equipment'
 
 
@@ -249,6 +249,10 @@ urlpatterns = [
     
     
     url(r'^guide_img$', Guide_Img.as_view(), name='guide_img'),
     url(r'^guide_img$', Guide_Img.as_view(), name='guide_img'),
     
     
+    url(r'^alarm_record$', Alarm_Record.as_view(), name='alarm_record'),
+    
+    
+    
     
     
     
     
     
     

+ 19 - 2
apps/Equipment/views.py

@@ -23,7 +23,8 @@ from apps.AppInfo.models import (
     Article, CKArticle, Equip, Equip_type, FarmList, FarmUser, GardenManage,
     Article, CKArticle, Equip, Equip_type, FarmList, FarmUser, GardenManage,
     Hotel_Info, Hotel_Photo, JKdata, MyUser, Pick_Pub, Product, QXZdata,
     Hotel_Info, Hotel_Photo, JKdata, MyUser, Pick_Pub, Product, QXZdata,
     QXZdata_New, QXZstatus, QXZstatus_New, QXZswitchdata, QXZswitchstatus,
     QXZdata_New, QXZstatus, QXZstatus_New, QXZswitchdata, QXZswitchstatus,
-    Video_data,GardenArea,Store_Manage,Areacrop,Sell_Manage,Person_Pick,QXZAutoswitch,Sightsee_Info,Pic_Info)
+    Video_data,GardenArea,Store_Manage,Areacrop,Sell_Manage,Person_Pick,QXZAutoswitch,Sightsee_Info,Pic_Info,
+    QXZ_Alarm_Log)
 from apps.Equipment.all_dict import qxz_dict
 from apps.Equipment.all_dict import qxz_dict
 
 
 
 
@@ -3608,4 +3609,20 @@ class Home_Farm(ListView):
         return render(request, 'backstageNet/home.html', context={"farm_list":farm_list})
         return render(request, 'backstageNet/home.html', context={"farm_list":farm_list})
 
 
     def post(self, request):
     def post(self, request):
-        pass
+        pass
+    
+    
+
+class Alarm_Record(ListView):
+    def get(self,request):
+        pass
+
+    def post(self, request):
+        alarm_list = QXZ_Alarm_Log.objects.all()
+        page = int(request.POST.get("page"))
+        dat = []
+        for i in alarm_list:
+            data.append({"equip_id":i.equip_id,"logs":i.logs,"ekey":i.ekey,"upl_time":i.upl_time})
+        nums = len(dat)
+        dat = dat[(10*(page-1)):(page*10)]
+        data = {"dat":dat,"nums":nums}

+ 2 - 1
apps/Home/views.py

@@ -351,7 +351,8 @@ class User_Check(ListView):
 class Prove_Code(ListView):
 class Prove_Code(ListView):
     def post(self, request):
     def post(self, request):
         phone = json.loads(request.body.decode())
         phone = json.loads(request.body.decode())
-        num = verification_code()
+        # num = verification_code()
+        num = 123456
         mobile = phone["mobile"]
         mobile = phone["mobile"]
         pass_word1 = phone["password"]
         pass_word1 = phone["password"]
         pass_word2 = phone["password2"]
         pass_word2 = phone["password2"]