Jelajahi Sumber

Merge branch 'master' of http://39.104.94.153:3000/yf_zd/second into master

yf_csx 5 tahun lalu
induk
melakukan
92480e8d24
53 mengubah file dengan 2032 tambahan dan 562 penghapusan
  1. 1 0
      .gitignore
  2. 1 1
      apps/AppInfo/admin.py
  3. 19 2
      apps/AppInfo/models.py
  4. 7 4
      apps/Equipment/urls.py
  5. 117 30
      apps/Equipment/views.py
  6. 6 3
      apps/Home/views.py
  7. 27 21
      templates/backstageNet/info/dormPub.html
  8. 30 22
      templates/backstageNet/info/gardenPub.html
  9. 32 23
      templates/backstageNet/info/newsPub.html
  10. 27 21
      templates/backstageNet/info/productPub.html
  11. 27 21
      templates/backstageNet/info/sightseePub.html
  12. 28 21
      templates/backstageNet/info/videoPub.html
  13. 1 1
      templates/backstageNet/infoManage/sightseeManage.html
  14. 6 6
      templates/backstageNet/jk/equipmanage_jk.html
  15. 1 1
      templates/backstageNet/limit/expertList.html
  16. 169 13
      templates/backstageNet/production/cropcount.html
  17. 1 1
      templates/backstageNet/production/gardenNew.html
  18. 9 4
      templates/backstageNet/production/person_farm_edit.html
  19. 140 25
      templates/backstageNet/qxzctrl/qxzData.html
  20. 14 3
      templates/backstageNet/qxzctrl/qxzchart.html
  21. 4 4
      templates/backstageNet/qxzctrl/qxzctrl.html
  22. 787 0
      templates/backstageNet/systemSet/imageUpload.html
  23. 6 6
      templates/backstageNet/systemSet/onlineSplit.html
  24. 3 3
      templates/backstageNet/systemSet/onlineSplitMap.html
  25. 1 1
      templates/backstageNet/systemSet/user_list.html
  26. 3 3
      templates/backstageNet/warn/productionset.html
  27. 25 26
      templates/backstageNet/warn/warnSet.html
  28. 12 2
      templates/outerNet/exhibitionList.html
  29. 120 71
      templates/outerNet/farmList.html
  30. 4 62
      templates/outerNet/forgetPaw.html
  31. 8 8
      templates/outerNet/index2.html
  32. 4 62
      templates/outerNet/login2.html
  33. 20 3
      templates/outerNet/newsList.html
  34. 4 62
      templates/outerNet/register.html
  35. 1 1
      templates/outerNet/tourist.html
  36. 1 1
      templates/outerNet/touristList.html
  37. 12 2
      templates/outerNet/videoList.html
  38. 286 0
      templates/static/css/ImgCropping.css
  39. 10 0
      templates/static/css/cropper.min.css
  40. 1 1
      templates/static/css/header.css
  41. 1 0
      templates/static/css/home.css
  42. TEMPAT SAMPAH
      templates/static/imgs/dev/icon_100.png
  43. TEMPAT SAMPAH
      templates/static/imgs/dev/icon_201.png
  44. TEMPAT SAMPAH
      templates/static/imgs/dev/icon_202.png
  45. TEMPAT SAMPAH
      templates/static/imgs/dev/icon_203.png
  46. TEMPAT SAMPAH
      templates/static/imgs/dev/icon_211.png
  47. 7 2
      templates/static/js/backstageNet/common.js
  48. 10 0
      templates/static/js/cropper.min.js
  49. 8 5
      templates/static/js/limit/limit.js
  50. 9 0
      templates/static/js/newsList.js
  51. 2 2
      templates/static/js/systemSet/userManage.js
  52. 10 6
      templates/static/js/warn/qxz_dict.js
  53. 10 6
      templates/static/lib/js/qxz_dict.js

+ 1 - 0
.gitignore

@@ -59,6 +59,7 @@ docs/_build/
 /hotel_photo/
 /hotel_photos/
 /hvideos/
+/cropcount_photo
 /media/
 /guser_photo/
 /product_photo/

+ 1 - 1
apps/AppInfo/admin.py

@@ -562,7 +562,7 @@ class GardenManageAdmin(admin.ModelAdmin):
 @admin.register(GardenArea)
 class GardenAreaAdmin(admin.ModelAdmin):
     # 列表页面显示字段
-    list_display = ['name','user','garden','manage','location','addr','area','mobile','img','desc','upl_time','hidden']
+    list_display = ['name','user','garden','manage','location','location_2','addr','area','mobile','img','img_1','desc','upl_time','hidden']
     # 搜索项:
     search_fields = ['name']
 

+ 19 - 2
apps/AppInfo/models.py

@@ -522,7 +522,7 @@ class Blog(models.Model):
 
 class CKArticle(models.Model):
     author = models.ForeignKey(MyUser,verbose_name=u'作者',blank=True, null=True)
-    art_type = models.CharField(u'文章类型',max_length=10, blank=True, null=True)  # 5 新闻资讯  6 视频资讯  7 产品展厅  8 四季采摘  9  民宿导览  10  旅游景点
+    art_type = models.CharField(u'文章类型',max_length=10, blank=True, null=True)  # 5 新闻资讯  6 视频资讯  7 产品展厅  8 四季采摘  9  民宿导览  10  旅游景点 11 个人农场
     writer = models.CharField(u'发布人', max_length=10, blank=True, null=True)
     title = models.CharField(u'标题',max_length=254, null=True, blank=True)
     video_url = models.FileField(upload_to="media/uploads/", null=True, blank=True, verbose_name="视频内容")
@@ -576,9 +576,11 @@ class GardenArea(models.Model):
     manage = models.CharField(u'负责人', max_length=20, blank=True, null=True)
     garden = models.ForeignKey(GardenManage,blank=True, null=True,verbose_name=u'所属园区')
     location = models.CharField(u'地块坐标', max_length=100, blank=True, null=True)
+    location_2 = models.CharField(u'地块坐标2', max_length=100, blank=True, null=True)
     area = models.CharField('地块面积', max_length=50, blank=True, null=True)
     mobile = models.CharField(u'电话', max_length=20, blank=True, null=True)
     img = models.CharField(u'地块图片', max_length=200, blank=True, null=True)
+    img_1 = models.CharField(u'地块图片', max_length=200, blank=True, null=True)
     addr = models.CharField(u'地块地址',max_length=255, null=True, blank=True)
     desc = models.CharField(u'地块介绍', max_length=350, blank=True,null=True)
     guide_img = models.CharField(u'导览图片', max_length=200, blank=True, null=True)
@@ -878,4 +880,19 @@ class Relations(models.Model):
         verbose_name = u'合作伙伴表'
         verbose_name_plural = verbose_name
         ordering = ['-upl_time']
-        get_latest_by = 'upl_time'
+        get_latest_by = 'upl_time'
+        
+        
+
+# 轮播图和广告图
+class SystemPhoto(models.Model):
+    code = models.CharField(u'图片区分', max_length=5, blank=True, null=True)
+    pic_img = models.CharField(u'图片链接', max_length=100, blank=True, null=True)
+    upl_time = models.DateTimeField(u'创建时间', default=timezone.now)
+
+    class Meta:
+        verbose_name = '轮播图和广告图'
+        verbose_name_plural = verbose_name
+
+    def __str__(self):
+        return self.name

+ 7 - 4
apps/Equipment/urls.py

@@ -252,9 +252,9 @@ urlpatterns = [
     
     url(r'^qxz_data_export$', QXZ_Data_Export.as_view(), name='qxz_data_export'),
     
+    url(r'^system_photo$', System_Photo.as_view(), name='system_photo'),
     
-    
-    
+    url(r'^system_photo_save$', System_Photo_Save.as_view(), name='system_photo_save'),
     
     
     
@@ -269,8 +269,11 @@ urlpatterns = [
     url(r'^garden_photo/(?P<path>.*)', serve, {'document_root': 'F:\YFWLW\second\garden_photo'}), #本地
     url(r'^guser_photo/(?P<path>.*)', serve, {'document_root': 'F:\YFWLW\second\guser_photo'}), #本地
     url(r'^map_photo/(?P<path>.*)', serve, {'document_root': 'F:\YFWLW\second\map_photo'}), #本地
-    url(r'^media/uploads/(?P<path>.*)', serve, {'document_root': 'F:\YFWLW\second\media\\uploads'}), #本地
-    
+    url(r'^sightsee_photos/(?P<path>.*)', serve, {'document_root': 'F:\YFWLW\second\sightsee_photos'}), #本地
+    url(r'^media/(?P<path>.*)', serve, {'document_root': 'F:\YFWLW\second\media'}), #本地
+    url(r'^sell_photo/(?P<path>.*)', serve, {'document_root': 'F:\YFWLW\second\sell_photo'}), #本地
+    url(r'^cropcount_photo/(?P<path>.*)', serve, {'document_root': 'F:\YFWLW\second\cropcount_photo'}), #本地
+    url(r'^garden_photo/(?P<path>.*)', serve, {'document_root': 'F:\YFWLW\second\garden_photo'}), #本地
     
 
     # url(r'^hotel_photo/(?P<path>.*)', serve, {'document_root': '/home/web/second/second/hotel_photo'}), #本地

+ 117 - 30
apps/Equipment/views.py

@@ -24,7 +24,7 @@ from apps.AppInfo.models import (
     Hotel_Info, Hotel_Photo, JKdata, MyUser, Pick_Pub, Product, QXZdata,
     QXZdata_New, QXZstatus, QXZstatus_New, QXZswitchdata, QXZswitchstatus,
     Video_data,GardenArea,Store_Manage,Areacrop,Sell_Manage,Person_Pick,QXZAutoswitch,Sightsee_Info,Pic_Info,
-    QXZ_Alarm_Log,Experts,Relations,QXZ_Alarm,QXZ_Conf,QXZ_Base_Info,QXZ_Default_Conf,QXZ_Info_Record)
+    QXZ_Alarm_Log,Experts,Relations,QXZ_Alarm,QXZ_Conf,QXZ_Base_Info,QXZ_Default_Conf,QXZ_Info_Record,SystemPhoto)
 from apps.Equipment.all_dict import qxz_dict
 import xlwt
 from io import BytesIO
@@ -269,8 +269,9 @@ class Equip_Show_List(ListView):
 class Equip_Show_Detail(ListView):
     def get(self,request):
         e_id = request.GET.get("id")
-        product = Product.objects.get(id=e_id)
         e_name = request.GET.get("name")
+        if e_id:
+            product = Product.objects.get(id=e_id)
         if e_name:
             product = Product.objects.get(title=e_name)
         return render(request, 'outerNet/exhibitionDetail.html', context={"product":product})
@@ -306,8 +307,9 @@ class Garden_View(ListView):
 class Garden_Intro(ListView):
     def get(self,request):
         pid = request.GET.get("id")
-        pick = Pick_Pub.objects.get(id=pid)
         pname = request.GET.get("name")
+        if pid:
+            pick = Pick_Pub.objects.get(id=pid)
         if pname:
             pick = Pick_Pub.objects.get(name=pname)
         return render(request, 'outerNet/pickIntro.html', context={"pick":pick})
@@ -337,8 +339,9 @@ class Garden_Detail(ListView):
 class Tourist(ListView):
     def get(self,request):
         sid = request.GET.get("id")
-        sightsee = Sightsee_Info.objects.get(id=sid)
         sname = request.GET.get("name")
+        if sid:
+            sightsee = Sightsee_Info.objects.get(id=sid)
         if sname:
             sightsee = Sightsee_Info.objects.get(name=sname)
         return render(request, 'outerNet/tourist.html', context={"sightsee":sightsee})
@@ -380,11 +383,12 @@ class Dorm_List(ListView):
 class Dorm_Detail(ListView):
     def get(self,request):
         hotel_id = request.GET.get("id")
-        hotel = Hotel_Info.objects.get(id=hotel_id)
-        photos = Hotel_Photo.objects.filter(hotel=hotel)
         hotel_name = request.GET.get("name")
+        if hotel_id:
+            hotel = Hotel_Info.objects.get(id=hotel_id)
         if hotel_name:
             hotel = Hotel_Info.objects.get(name=hotel_name)
+        photos = Hotel_Photo.objects.filter(hotel=hotel)
         return render(request, 'outerNet/hotelDetail.html', context={"hotel":hotel,"photos":photos})
     def post(self,request):
         pass
@@ -395,12 +399,12 @@ class Farm_list(ListView):
     def get(self,request):
         page = int(request.GET.get("page"))
         con = request.GET.get("condition")
-        hotel_list = Hotel_Info.objects.all()
+        garden_list = GardenArea.objects.filter(hidden=True)
         if con:
-            hotel_list = Hotel_Info.objects.filter(name__contains=con)
-        nums = hotel_list.count()
-        hotel = hotel_list[(10*(page-1)):(page*10)]
-        return render(request, 'outerNet/farmList.html', context={"nums":nums,"hotel":hotel,"page":page,"con":con})
+            garden_list = GardenArea.objects.filter(hidden=True,name__contains=con)
+        nums = garden_list.count()
+        garden_list = garden_list[(9*(page-1)):(page*9)]
+        return render(request, 'outerNet/farmList.html', context={"nums":nums,"garden_list":garden_list,"page":page,"con":con})
     def post(self,request):
         pass
 
@@ -424,9 +428,11 @@ class Video_List(ListView):
 class Video_Detail(ListView):
     def get(self,request):
         v_id = request.GET.get("id")
-        video = Video_data.objects.get(id=v_id)
         v_name = request.GET.get("name")
+        if v_id:
+            video = Video_data.objects.get(id=v_id)
         if v_name:
+            print("name",v_name)
             video = Video_data.objects.get(title=v_name)
         return render(request, 'outerNet/videoDetail.html', context={"video":video})
     def post(self,request):
@@ -1904,16 +1910,16 @@ class Farm_Check_List(ListView):
         #删除
         if req == "del":
             i = GardenArea.objects.get(id=art_id)
-            ckobj = CKArticle.objects.get(title=i.name)
-            ckobj.delete()
+            # ckobj = CKArticle.objects.get(title=i.name)
+            # ckobj.delete()
             art_obj.delete()
             data = "1"
         #审核通过
         elif req == "check1":
             art_obj = GardenArea.objects.get(id=art_id)
-            ckobj = CKArticle.objects.get(title=art_obj.name)
-            ckobj.hidden = True
-            ckobj.save()
+            # ckobj = CKArticle.objects.get(title=art_obj.name)
+            # ckobj.hidden = True
+            # ckobj.save()
             art_obj.hidden = True
             art_obj.save()
             data = "1"
@@ -2073,6 +2079,19 @@ class CKArticle_View(ListView):
         title = request.POST.get('title')
         art_type = request.POST.get('art_type')
         content = request.POST.get('content')
+        edit = request.POST.get('edit')
+        if edit == "1":
+            CKArticle.objects.filter(title=title).update(
+                    art_type=art_type,
+                    writer=writer,
+                    intro=intro,
+                    title=title,
+                    content=content,
+                    head_img=news_photo
+                )
+            return HttpResponse("1")
+        if CKArticle.objects.filter(title=title).exists():
+            return HttpResponse("2")
         try:
             # CKArticle.objects.create(auther=current_user.username,art_type=art_type,writer=writer,intro=intro,title=title,content=content,head_img=news_photo)
             if art_type == "5":
@@ -2219,7 +2238,7 @@ class Garden_Manage_View(ListView):
         else:
             try:
                 gardens=GardenArea.objects.get(id=gardenid)
-                if  FarmList.objects.filter(name=name,user=current_user) :
+                if FarmList.objects.filter(name=name,user=current_user):
                     data = "0"
                 else:
                     FarmList.objects.create(
@@ -2757,7 +2776,7 @@ class CropCount_View(ListView):
                     time_now = int(timezone.now().strftime("%Y%m%d"))
                     data = time_now-time
                     print(data)
-                    curro = "" 
+                    curro = ""
                     h2 = {"cropname":x.cropname,
                         "area":x.area.name,
                         "crop_count":x.crop_count,
@@ -2766,7 +2785,7 @@ class CropCount_View(ListView):
                         "id":x.id,
                         "upl_time":x.upl_time.strftime('%Y-%m-%d'),
                         "crop_img":x.crop_img,
-                        } 
+                        }
                     dat.append({"data":h2,"curro":curro})
         nums = len(dat)
         dat = dat[(9*(page-1)):(page*9)]
@@ -3311,14 +3330,14 @@ class Person_Farm_Edit(ListView):
         current_user = MyUser.objects.get(username=username)
         try:
             gar_area = GardenArea.objects.get(user=current_user)
-            data = {"name":gar_area.name,"manage":gar_area.manage,"mobile":gar_area.mobile,
-                "area":gar_area.area,"location":gar_area.location,"addr":gar_area.addr,
+            data = {"id":current_user.id,"name":gar_area.name,"manage":gar_area.manage,"mobile":gar_area.mobile,
+                "area":gar_area.area,"location":gar_area.location,"location_2":gar_area.location_2,"addr":gar_area.addr,
                 "desc":gar_area.desc,"img":gar_area.img,"guide_img":gar_area.guide_img
                 }
             
         except Exception as e:
             print(e)
-            data = {"name":"","manage":"","mobile":"",
+            data = {"id":"","name":"","manage":"","mobile":"",
                 "area":"","location":"","addr":"",
                 "desc":"","img":"","guide_img":""
                 }
@@ -3348,7 +3367,9 @@ class Person_Area_Pub(ListView):
         desc = request.POST.get('desc')
         # 图片
         img = request.POST.get('img')
+        img_1 = request.POST.get('img_1')
         location = request.POST.get('location')
+        location_2 = request.POST.get('location_2')
         addr = request.POST.get('addr')
         guide_img = request.POST.get('guide_img')
         if GardenArea.objects.filter(user=user).exists():
@@ -3361,8 +3382,10 @@ class Person_Area_Pub(ListView):
                 gar_obj.desc = desc
                 gar_obj.img = img
                 gar_obj.location = location
+                gar_obj.location_2 = location_2
                 gar_obj.addr = addr
                 gar_obj.guide_img = guide_img
+                gar_obj.img_1 = img_1
                 gar_obj.save()
                 data = "1"
             except Exception as e:
@@ -3371,7 +3394,7 @@ class Person_Area_Pub(ListView):
         else:
             try:
                 GardenArea.objects.create(user=user,name=name,manage=manage,mobile=mobile,
-                    area=area,desc=desc,img=img,guide_img=guide_img,
+                    area=area,desc=desc,img=img,guide_img=guide_img,img_1=img_1,location_2=location_2,
                     location=location,addr=addr)
                 data = "1"
             except Exception as e:
@@ -3484,6 +3507,7 @@ class Area_Create(ListView):
         currpage = request.GET.get('currpage')
         uname = request.GET.get("uname")
         f_name = request.GET.get("f_name")
+        c_id = request.GET.get("id")
         user_obj = MyUser.objects.get(username=uname)
         try:
             curr_area = GardenArea.objects.get(user=user_obj)
@@ -3492,12 +3516,13 @@ class Area_Create(ListView):
             print(e)
             curr_area = ""
             # user_area = {"name":"","location":""}
-        return render(request, 'backstageNet/systemSet/onlineSplit.html', context={"currpage":currpage,"uname":uname,"f_name":f_name,"curr_area":curr_area})
+        return render(request, 'backstageNet/systemSet/onlineSplit.html', context={"currpage":currpage,"uname":uname,"f_name":f_name,"curr_area":curr_area,"id":c_id})
     def post(self,request):
         uname = request.POST.get("uname")
         name = request.POST.get("name")
         area = request.POST.get("area")
         location = request.POST.get("location")
+        location_2 = request.POST.get("location_2")
         user_obj = MyUser.objects.get(username=uname)
         if GardenArea.objects.filter(user=user_obj).exists():
             try:
@@ -3505,6 +3530,7 @@ class Area_Create(ListView):
                 area_obj.name = name
                 area_obj.area = area
                 area_obj.location = location
+                area_obj.location_2 = location_2
                 area_obj.upl_time = datetime.datetime.now()
                 area_obj.save()
                 data = "1"
@@ -3513,7 +3539,7 @@ class Area_Create(ListView):
                 data = "0"
         else:
             try:
-                GardenArea.objects.create(user=user_obj,name=name,area=area,location=location,upl_time=datetime.datetime.now())
+                GardenArea.objects.create(user=user_obj,name=name,area=area,location=location,location_2=location_2,upl_time=datetime.datetime.now())
                 data = "1"
             except Exception as e:
                 print(e)
@@ -3531,13 +3557,13 @@ class Area_Map(ListView):
         all_area = []
         area_list = GardenArea.objects.all().exclude(user=user_obj)
         for i in area_list:
-            all_area.append({"name":i.name,"location":i.location})
+            all_area.append({"name":i.name,"location_2":i.location_2})
         try:
             curr_area = GardenArea.objects.get(user=user_obj)
-            user_area = {"name":curr_area.name,"location":curr_area.location}
+            user_area = {"name":curr_area.name,"location_2":curr_area.location_2}
         except Exception as e:
             print(e)
-            user_area = {"name":"","location":""}
+            user_area = {"name":"","location_2":""}
         data = json.dumps({"all_area":all_area,"user_area":user_area})
         return HttpResponse(data)
 
@@ -4573,4 +4599,65 @@ class QXZ_Data_Export(ListView):
         
     
     def post(self,request):
-        pass
+        pass
+    
+    
+
+# 系统管理上传图片
+class System_Photo(ListView):
+    def get(self,request):
+        return render(request, 'backstageNet/systemSet/imageUpload.html', context={})
+    def post(self,request):
+        upl_time = timezone.now() 
+        basestr = request.FILES.get("upload")
+        basestr1 = request.FILES.get("upload1")
+        now_time = time.strftime('%Y%m%d%H%M%S', time.localtime(time.time()))
+        if basestr:
+            base_dir = 'media/uploads/'
+            img = Image.open(basestr)
+            code = 1
+        else:
+            base_dir = 'media/uploads1/'
+            code = 2
+            img = Image.open(basestr1)
+        if os.path.exists(base_dir) == False:
+            os.makedirs(base_dir)
+        img.save(base_dir + now_time +".png")
+        pic_list = SystemPhoto.objects.filter(code=code).order_by("upl_time")
+        if code == 1:
+            if len(pic_list) <= 2:
+                SystemPhoto.objects.create(code=code,pic_img=base_dir +now_time +".png")
+            else:
+                for i in pic_list[:1]:
+                    i.pic_img=base_dir +now_time +".png"
+                    i.upl_time=upl_time
+                    i.save()
+        else:
+            if len(pic_list) <=3:
+                SystemPhoto.objects.create(code=code,pic_img=base_dir +now_time +".png")
+            else:
+                for i in pic_list[:1]:
+                    i.pic_img=base_dir +now_time +".png"
+                    i.upl_time=upl_time
+                    i.save()
+        return HttpResponse("1")
+    
+
+    
+
+# 系统管理上传图片
+class System_Photo_Save(ListView):
+    def post(self,request):
+        code = request.POST.get("code")
+        data = []
+        if code != "1" and code != "2":
+            return HttpResponse("0")
+        else:
+           pic_list = SystemPhoto.objects.filter(code=code)
+        for i in pic_list:
+            data.append({
+                "pic_img":i.pic_img
+            })
+        data = json.dumps(data)
+        return HttpResponse(data)
+    

+ 6 - 3
apps/Home/views.py

@@ -261,7 +261,8 @@ class Login_View(View):
 # 用户登录2
 class Login2_View(View):
     def get(self, request):
-        return render(request, 'outerNet/login2.html', context={})
+        relation = Relations.objects.all()
+        return render(request, 'outerNet/login2.html', context={"relation":relation})
 
     def post(self, request):
         pass
@@ -272,14 +273,16 @@ class Login2_View(View):
 # 注册
 class ForgetPaw_View(View):
     def get(self, request):
-        return render(request, 'outerNet/forgetPaw.html', context={})
+        relation = Relations.objects.all()
+        return render(request, 'outerNet/forgetPaw.html', context={"relation":relation})
 
     def post(self, request):
         pass
 # 注册
 class register_View(View):
     def get(self, request):
-        return render(request, 'outerNet/register.html', context={})
+        relation = Relations.objects.all()
+        return render(request, 'outerNet/register.html', context={"relation":relation})
 
     def post(self, request):
         pass

+ 27 - 21
templates/backstageNet/info/dormPub.html

@@ -495,30 +495,36 @@
                 CKupdate()
 
                 var fields = data.field;
-                $.ajax({
-                    url: 'dorm_pub',
-                    data: $("#formDiv").serialize(),
-                    type: 'post',
-                    success: function (data) {
-                        if (data) {
-                            if (window.id !== '') {
-                                parent.layer.msg("发布成功,等待审核", { icon: 1 });
-                            } else {
-                                layer.msg("发布成功,等待审核", { icon: 1 });
-                            }
-                            msgTitleSaveFun(fields.title,9)
-                            clearForm()
-                        } else {
-                            if (window.id !== '') {
-                                parent.layer.msg("发布失败", { icon: 2 });
+                if(window.id !== ''){
+                    var edit = 1;
+                }else{
+                    var edit = '';
+                }
+                msgTitleSaveFun(fields.name,9,edit,function(){
+                    $.ajax({
+                        url: 'dorm_pub',
+                        data: $("#formDiv").serialize(),
+                        type: 'post',
+                        success: function (data) {
+                            if (data == 1) {
+                                if (window.id !== '') {
+                                    parent.layer.msg("发布成功,等待审核", { icon: 1 });
+                                } else {
+                                    layer.msg("发布成功,等待审核", { icon: 1 });
+                                }
+                                clearForm()
                             } else {
-                                layer.msg("发布失败", { icon: 2 });
+                                if (window.id !== '') {
+                                    parent.layer.msg("发布失败", { icon: 2 });
+                                } else {
+                                    layer.msg("发布失败", { icon: 2 });
+                                }
                             }
-                        }
-                    },
-                    error: function (type) {
+                        },
+                        error: function (type) {
 
-                    }
+                        }
+                    })
                 })
                 return false;
 

+ 30 - 22
templates/backstageNet/info/gardenPub.html

@@ -364,33 +364,41 @@
                 field = Object.assign(data.field, { content: content });
                 data.field.scale = data.field.scale+data.field.unit;
                 var fields = data.field;
-                $.ajax({
-                    url: 'garden_pub',
-                    type: 'post',
-                    data: data.field,
-                    success: function (data) {
-                        if (data) {
-                            if (window.id !== '') {
-                                parent.layer.msg("发布成功,等待审核", { icon: 1 });
-                            } else {
-                                layer.msg("发布成功,等待审核", { icon: 1 });
-                            }
-                            msgTitleSaveFun(fields.title,8)
-                            clearForm()
+                data.field.art_type = 8;
+
+                if(window.id !== ''){
+                    var edit = 1;
+                }else{
+                    var edit = '';
+                }
+                msgTitleSaveFun(fields.name,8,edit,function(){
+                    $.ajax({
+                        url: 'garden_pub',
+                        type: 'post',
+                        data: data.field,
+                        success: function (data) {
+                            if (data == 1) {
+                                if (window.id !== '') {
+                                    parent.layer.msg("发布成功,等待审核", { icon: 1 });
+                                } else {
+                                    layer.msg("发布成功,等待审核", { icon: 1 });
+                                }
+                                clearForm()
 
-                        } else {
-                            if (window.id !== '') {
-                                parent.layer.msg("发布失败", { icon: 2 });
                             } else {
-                                layer.msg("发布失败", { icon: 2 });
+                                if (window.id !== '') {
+                                    parent.layer.msg("发布失败", { icon: 2 });
+                                } else {
+                                    layer.msg("发布失败", { icon: 2 });
+                                }
                             }
+                        },
+                        error: function (type) {
+                            console.log(type)
                         }
-                    },
-                    error: function (type) {
-                        console.log(type)
-                    }
-                })
+                    })
 
+                })
                 return false
                 // }
             });

+ 32 - 23
templates/backstageNet/info/newsPub.html

@@ -183,7 +183,7 @@
                         <div class="layui-form-item">
                             <label class="layui-form-label">发布人:</label>
                             <div class="layui-input-inline">
-                                <input type="text" name="writer" required lay-verify="required" placeholder="请填写发布人"
+                                <input type="text" name="writer" maxlength="6" required lay-verify="required" placeholder="请填写发布人"
                                     autocomplete="off" class="layui-input">
                             </div>
                         </div>
@@ -298,33 +298,42 @@
                     return false;
                 }
                 var fields = data.field;
+                data.field.art_type = 6;
+                if(window.id !== ''){
+                    var edit = 1;
+                }else{
+                    var edit = '';
+                }
                 CKupdate()
-
-                $.ajax({
-                    url: 'news_pub',
-                    data: $("#formDiv").serialize(),
-                    type: 'post',
-                    success: function (data) {
-                        if (data) {
-                            if (window.id !== '') {
-                                parent.layer.msg("发布成功,等待审核", { icon: 1 });
+                msgTitleSaveFun(fields.title,5,edit,function(){
+                    $.ajax({
+                        url: 'news_pub',
+                        data: $("#formDiv").serialize(),
+                        type: 'post',
+                        success: function (data) {
+                            if (data == 1) {
+                                if (window.id !== '') {
+                                    parent.layer.msg("发布成功,等待审核", { icon: 1 });
+                                } else {
+                                    layer.msg("发布成功,等待审核", { icon: 1 });
+                                }
+                                clearForm()
                             } else {
-                                layer.msg("发布成功,等待审核", { icon: 1 });
+                                if (window.id !== '') {
+                                    parent.layer.msg("发布失败", { icon: 2 });
+                                } else {
+                                    layer.msg("发布失败", { icon: 2 });
+                                }
                             }
-                            msgTitleSaveFun(fields.title,5)
-                            clearForm()
-                        } else {
-                            if (window.id !== '') {
-                                parent.layer.msg("发布失败", { icon: 2 });
-                            } else {
-                                layer.msg("发布失败", { icon: 2 });
-                            }
-                        }
-                    },
-                    error: function (type) {
+                        },
+                        error: function (type) {
 
-                    }
+                        }
+                    })
                 })
+
+
+                
                 return false;
 
             });

+ 27 - 21
templates/backstageNet/info/productPub.html

@@ -287,31 +287,37 @@
                     var field = data.field;
                     field = Object.assign(data.field, { content: content });
                     var fields = data.field;
-                    $.ajax({
-                        url: 'equip_pub',
-                        type: 'post',
-                        data: data.field,
-                        success: function (data) {
-                            if (data) {
-                                if (window.id !== '') {
-                                    parent.layer.msg("发布成功,等待审核", { icon: 1 });
-                                } else {
-                                    layer.msg("发布成功,等待审核", { icon: 1 });
-                                }
-                                msgTitleSaveFun(fields.title,7)
-                                clearForm()
+                    if(window.id !== ''){
+                        var edit = 1;
+                    }else{
+                        var edit = '';
+                    }
+                    msgTitleSaveFun(fields.title,7,edit,function(){
+                        $.ajax({
+                            url: 'equip_pub',
+                            type: 'post',
+                            data: data.field,
+                            success: function (data) {
+                                if (data == 1) {
+                                    if (window.id !== '') {
+                                        parent.layer.msg("发布成功,等待审核", { icon: 1 });
+                                    } else {
+                                        layer.msg("发布成功,等待审核", { icon: 1 });
+                                    }
+                                    clearForm()
 
-                            } else {
-                                if (window.id !== '') {
-                                    parent.layer.msg("发布失败", { icon: 2 });
                                 } else {
-                                    layer.msg("发布失败", { icon: 2 });
+                                    if (window.id !== '') {
+                                        parent.layer.msg("发布失败", { icon: 2 });
+                                    } else {
+                                        layer.msg("发布失败", { icon: 2 });
+                                    }
                                 }
+                            },
+                            error: function (type) {
+                                console.log(type)
                             }
-                        },
-                        error: function (type) {
-                            console.log(type)
-                        }
+                        })
                     })
                     return false;
                 }

+ 27 - 21
templates/backstageNet/info/sightseePub.html

@@ -516,30 +516,36 @@
                 CKupdate()
 
                 var fields = data.field;
-                $.ajax({
-                    url: 'sightsee_pub',
-                    data: $("#formDiv").serialize(),
-                    type: 'post',
-                    success: function (data) {
-                        if (data) {
-                            if (window.id !== '') {
-                                parent.layer.msg("发布成功,等待审核", { icon: 1 });
-                            } else {
-                                layer.msg("发布成功,等待审核", { icon: 1 });
-                            }
-                            msgTitleSaveFun(fields.title,5)
-                            clearForm()
-                        } else {
-                            if (window.id !== '') {
-                                parent.layer.msg("发布失败", { icon: 2 });
+                if(window.id !== ''){
+                    var edit = 1;
+                }else{
+                    var edit = '';
+                }
+                msgTitleSaveFun(fields.name,10,edit,function(){
+                    $.ajax({
+                        url: 'sightsee_pub',
+                        data: $("#formDiv").serialize(),
+                        type: 'post',
+                        success: function (data) {
+                            if (data == 1) {
+                                if (window.id !== '') {
+                                    parent.layer.msg("发布成功,等待审核", { icon: 1 });
+                                } else {
+                                    layer.msg("发布成功,等待审核", { icon: 1 });
+                                }
+                                clearForm()
                             } else {
-                                layer.msg("发布失败", { icon: 2 });
+                                if (window.id !== '') {
+                                    parent.layer.msg("发布失败", { icon: 2 });
+                                } else {
+                                    layer.msg("发布失败", { icon: 2 });
+                                }
                             }
-                        }
-                    },
-                    error: function (type) {
+                        },
+                        error: function (type) {
 
-                    }
+                        }
+                    })
                 })
                 return false;
 

+ 28 - 21
templates/backstageNet/info/videoPub.html

@@ -328,31 +328,38 @@
                     return false;
                 } else {
                     var fields = data.field;
-                    $.ajax({
-                        url: 'video_pub',
-                        type: 'post',
-                        data: data.field,
-                        success: function (data) {
-                            if (data) {
-                                if (window.id !== '') {
-                                    parent.layer.msg("发布成功,等待审核", { icon: 1 });
-                                } else {
-                                    layer.msg("发布成功,等待审核", { icon: 1 });
-                                }
-                                msgTitleSaveFun(fields.title,6)
-                                clearForm()
+                    data.field.art_type = 6;
+                    if(window.id !== ''){
+                        var edit = 1;
+                    }else{
+                        var edit = '';
+                    }
+                    msgTitleSaveFun(fields.title,6,edit,function(){
+                        $.ajax({
+                            url: 'video_pub',
+                            type: 'post',
+                            data: data.field,
+                            success: function (data) {
+                                if (data == 1) {
+                                    if (window.id !== '') {
+                                        parent.layer.msg("发布成功,等待审核", { icon: 1 });
+                                    } else {
+                                        layer.msg("发布成功,等待审核", { icon: 1 });
+                                    }
+                                    clearForm()
 
-                            } else {
-                                if (window.id !== '') {
-                                    parent.layer.msg("发布失败", { icon: 2 });
                                 } else {
-                                    layer.msg("发布失败", { icon: 2 });
+                                    if (window.id !== '') {
+                                        parent.layer.msg("发布失败", { icon: 2 });
+                                    } else {
+                                        layer.msg("发布失败", { icon: 2 });
+                                    }
                                 }
+                            },
+                            error: function (type) {
+                                console.log(type)
                             }
-                        },
-                        error: function (type) {
-                            console.log(type)
-                        }
+                        })
                     })
                     return false;
                 }

+ 1 - 1
templates/backstageNet/infoManage/sightseeManage.html

@@ -260,7 +260,7 @@
                 }
             })
             var index = layer.open({
-                title: '四季编辑',
+                title: '景点编辑',
                 type: 2,
                 area: ['850px', '560px'],
                 content: 'sightsee_pub',

+ 6 - 6
templates/backstageNet/jk/equipmanage_jk.html

@@ -530,7 +530,7 @@
             <div id="allmap"></div>
         </div>
     </div>
-
+    <input type="hidden" id="token" value="{{token}}">
     <script src="{% static '/lib/js/jquery-2.1.4.min.js'%}"></script>
     <script src="{% static '/lib/layui/layui.js'%}"></script>
     <script src="{% static '/js/backstageNet/common.js'%}"></script>
@@ -641,7 +641,7 @@
                                 },
                                 success:function(data){
                                     console.log(data)
-                                    if(data == 0){
+                                    if(data == 1){
                                         layer.closeAll();
                                     }else{
                                         layer.msg('添加失败', {icon: 2}); 
@@ -689,7 +689,7 @@
                 data: data,
                 dataType: "json",
                 success: function (data) {
-                    if (data == 1) {
+                    if (data == 0) {
                         // layer.tips("设备名已存在!", '#ename');
                         layui.use('layer', function () {
                             var layer = layui.layer;
@@ -697,7 +697,7 @@
                         })
                         return false;
                     }
-                    else if (data == 2) {
+                    else if (data == 1) {
                         layui.use('layer', function () {
                             var layer = layui.layer;
                             layer.msg('设备位置添加成功!');
@@ -705,7 +705,7 @@
                         })
                     }
 
-                    else if (data == 0) {
+                    else if (data == 1) {
                         layui.use('layer', function () {
                             var layer = layui.layer;
                             layer.msg('设备名称修改成功!');
@@ -815,7 +815,7 @@
 
             var playHtml;
             var script;
-            var token = 'at.0izp4b188fna8vvk8j28o2l4a980qqex-1otrmuqf8l-1k26cbi-cletdiwkp'
+            var token = $('#token').val()
              
 
             if (isIE) {

+ 1 - 1
templates/backstageNet/limit/expertList.html

@@ -5,7 +5,7 @@
         <img src="{% static '/imgs/cornerIcon.png' %}" alt="">
         <div class="expertInner">
             <div class="expertImg">
-                <img src="http://127.0.0.1:8000{{msg.pic}}" alt="">
+                <img src="http://127.0.0.1:8000/{{msg.pic}}" alt="">
             </div>
             <div class="expertTxt">
                 <h1>{{msg.name}}</h1>

+ 169 - 13
templates/backstageNet/production/cropcount.html

@@ -518,7 +518,6 @@
                             //         },
                             //         error: function (type) {
                             //             console.log(type)
-                            //             alert('失败')
                             //         }
                             //     })
                             // }
@@ -536,6 +535,7 @@
                 //页面数据渲染
                 gedata('cropcount_view', 1)
                 function gedata(url, page) {
+                    var ids = data.value
                     $.ajax({
                         url: 'cropcount_view',
                         type: 'get',
@@ -578,8 +578,7 @@
                                         '<div class="userItem">' +
                                         '<div class="userMsg">' +
                                         '<div class="fl imgDiv">' +
-                                        '<img src="" alt="">' +
-                                        '<p>' + group[i].data.cropname + '</p>' +
+                                        '<img src="' + group[i].data.crop_img + '" alt="">' +
                                         '</div>' +
                                         '<div class="userInfo">' +
                                         // '<p>当前阶段:' + group[i].curro + '</p>' +
@@ -612,7 +611,8 @@
                                                 url: 'cropcount_view',
                                                 type: 'get',
                                                 // data: { page: obj.curr, ids: sessionStorage.getItem('seelectID') },
-                                                data: { page: obj.curr, ids: $('#farmSelect').val() },
+                                                // data: { page: obj.curr, ids: $('#farmSelect').val() },
+                                                data: { page: obj.curr, ids: ids },
                                                 dataType: 'html',
                                                 success: function (data) {
                                                     //转换格式
@@ -649,7 +649,7 @@
                                                             '<div class="userItem">' +
                                                             '<div class="userMsg">' +
                                                             '<div class="fl imgDiv">' +
-                                                            '<img src="" alt="">' +
+                                                            '<img src="' + group[i].data.crop_img +'" alt="">' +
                                                             '<p>' + group[i].data.cropname + '</p>' +
                                                             '</div>' +
                                                             '<div class="userInfo">' +
@@ -686,7 +686,6 @@
                         },
                         error: function (type) {
                             console.log(type)
-                            alert('失败')
                         }
                     })
                 }
@@ -719,8 +718,8 @@
                 return false;
             });
 
-             //图片上传
-             var uploadInst = upload.render({
+            //图片上传
+            var uploadInst = upload.render({
                 elem: '#pickImg'
                 , url: 'cropcount_photo'
                 , field: 'gar_img'
@@ -754,6 +753,164 @@
                 }
             });
 
+
+            // 选中农场进行渲染列表
+            gedata('cropcount_view', 1, $('#farmSelct').val())
+            function gedata(url, page, id) {
+                $.ajax({
+                    url: 'cropcount_view',
+                    type: 'get',
+                    data: {
+                        page: page,
+                        ids: id,
+                    },
+                    dataType: 'json',
+                    success: function (data) {
+                        if (data.nums !== 0) {
+                            //获取需要的数据
+                            var group = data.dat;
+                            //拼接字符串
+                            var str = '';
+                            //对数据做遍历,拼接到页面显示
+                            for (var i = 0; i < group.length; i++) {
+                                var strSeparator = "-"; //日期分隔符
+                                var oDate1
+                                var oDate2
+                                var strDateStart = new Date()
+                                var Str = strDateStart.getFullYear() + '-' +
+                                    (strDateStart.getMonth() + 1) + '-' +
+                                    strDateStart.getDate() + ' '
+                                var strDateEnd = group[i].data.upl_time
+                                var iDays;
+                                oDate1 = Str.split(strSeparator);
+                                oDate2 = strDateEnd.split(strSeparator);
+                                var strDateS = new Date(oDate1[0], oDate1[1] - 1, oDate1[2]);
+                                var strDateE = new Date(oDate2[0], oDate2[1] - 1, oDate2[2]);
+                                iDays = parseInt(Math.ceil(strDateS - strDateE) / 1000 / 60 / 60 / 24)//把相差的毫秒数转换为天数
+                                if (iDays > 0) {
+                                    //正数
+                                    var dateNum = iDays
+                                } else if (iDays <= 0) {
+                                    //负数
+                                    var dateNum = 0
+                                }
+                                str += '<div class="layui-col-xs6 layui-col-sm6 layui-col-md4">' +
+                                    '<div class="userItem">' +
+                                    '<div class="userMsg">' +
+                                    '<div class="fl imgDiv">' +
+                                    '<img src="' + group[i].data.crop_img + '" alt="">' +
+                                    '<p>' + group[i].data.cropname + '</p>' +
+                                    '</div>' +
+                                    '<div class="userInfo">' +
+                                    // '<p>当前阶段:' + group[i].curro + '</p>' +
+                                    '<p>所属农场:' + group[i].data.area + '</p>' +
+                                    '<p>规  模:' + group[i].data.crop_count + '</p>' +
+                                    '<p>种植日期:' + group[i].data.upl_time + '</p>' +
+                                    '<p>已生长/天:' + dateNum + '</p>' +
+                                    '</div>' +
+                                    '</div>' +
+                                    '<div class="operateDiv">' +
+                                    '<button type="button" class="layui-btn layui-btn-sm layui-btn-normal" onclick="amend( ' + group[i].data.id + ' )">修改</button>' +
+                                    '<button type="button" class="layui-btn layui-btn-sm layui-btn-danger" onclick="del(' + group[i].data.id + ')">删除</button>' +
+                                    // '<button type="button" class="layui-btn layui-btn-sm layui-btn-danger" onclick="over(\'' + group[i].data.id + '\',\'' + group[i].curro + '\')">结束</button>' +
+                                    '</div>' +
+                                    '</div>' +
+                                    '</div>';
+                            }
+                            //放入页面的容器显示
+                            $('#box').html(str)
+
+                            laypage.render({
+                                elem: 'page' //注意,这里的 test1 是 ID,不用加 # 号
+                                , count: data.nums
+                                , limit: '9'
+                                , theme: '#2ca9f9'
+                                , layout: ['prev', 'page', 'next', 'skip']
+                                , jump: function (obj, first) {
+                                    if (!first) {
+                                        $.ajax({
+                                            url: 'cropcount_view',
+                                            type: 'get',
+                                            // data: { page: obj.curr, ids: sessionStorage.getItem('seelectID') },
+                                            // data: { page: obj.curr, ids: $('#farmSelect').val() },
+                                            data: { page: obj.curr, ids: $('#farmSelct').val() },
+                                            dataType: 'html',
+                                            success: function (data) {
+                                                //转换格式
+                                                var res = JSON.parse(data)
+                                                //获取需要的数据
+                                                var group = res.dat;
+                                                //拼接字符串
+                                                var str = '';
+                                                //对数据做遍历,拼接到页面显示
+                                                for (var i = 0; i < group.length; i++) {
+                                                    var strSeparator = "-"; //日期分隔符
+                                                    var oDate1
+                                                    var oDate2
+                                                    var strDateStart = new Date()
+                                                    var Str = strDateStart.getFullYear() + '-' +
+                                                        (strDateStart.getMonth() + 1) + '-' +
+                                                        strDateStart.getDate() + ' '
+                                                    var strDateEnd = group[i].data.upl_time
+                                                    var iDays;
+                                                    oDate1 = Str.split(strSeparator);
+                                                    oDate2 = strDateEnd.split(strSeparator);
+                                                    var strDateS = new Date(oDate1[0], oDate1[1] - 1, oDate1[2]);
+                                                    var strDateE = new Date(oDate2[0], oDate2[1] - 1, oDate2[2]);
+                                                    iDays = parseInt(Math.ceil(strDateS - strDateE) / 1000 / 60 / 60 / 24)//把相差的毫秒数转换为天数
+
+                                                    if (iDays > 0) {
+                                                        //正数
+                                                        var dateNum = iDays
+                                                    } else if (iDays <= 0) {
+                                                        //负数
+                                                        var dateNum = 0
+                                                    }
+                                                    str += '<div class="layui-col-xs6 layui-col-sm6 layui-col-md4">' +
+                                                        '<div class="userItem">' +
+                                                        '<div class="userMsg">' +
+                                                        '<div class="fl imgDiv">' +
+                                                        '<img src="' + group[i].data.crop_img + '" alt="">' +
+
+                                                        '<p>' + group[i].data.cropname + '</p>' +
+                                                        '</div>' +
+                                                        '<div class="userInfo">' +
+                                                        // '<p>当前阶段:' + group[i].curro + '</p>' +
+                                                        '<p>所属农场:' + group[i].data.area + '</p>' +
+                                                        '<p>规  模:' + group[i].data.crop_count + '</p>' +
+                                                        '<p>种植日期:' + group[i].data.upl_time + '</p>' +
+                                                        '<p>已生长/天:' + dateNum + '</p>' +
+                                                        '</div>' +
+                                                        '</div>' +
+                                                        '<div class="operateDiv">' +
+                                                        '<button type="button" class="layui-btn layui-btn-sm layui-btn-normal" onclick="amend( ' + group[i].data.id + ' )">修改</button>' +
+                                                        '<button type="button" class="layui-btn layui-btn-sm layui-btn-danger" onclick="del(' + group[i].data.id + ')">删除</button>' +
+                                                        // '<button type="button" class="layui-btn layui-btn-sm layui-btn-danger" onclick="over(' + group[i].id + ')">结束</button>' +
+                                                        // '<button type="button" class="layui-btn layui-btn-sm layui-btn-danger" onclick="over(\'' + group[i].data.id + '\',\'' + group[i].curro + '\')">结束</button>' +
+                                                        '</div>' +
+                                                        '</div>' +
+                                                        '</div>';
+                                                }
+                                                //放入页面的容器显示
+                                                $('#box').html(str)
+                                            },
+                                            error: function (type) {
+                                                console.log(type)
+                                            }
+                                        })
+                                    }
+                                }
+                            });
+                        } else {
+                            var html = '<div class="layui-col-xs12 " style="line-height:100px;text-align:center">暂无数据</div>'
+                            $('#box').html(html);
+                        }
+                    },
+                    error: function (type) {
+                        console.log(type)
+                    }
+                })
+            }
         })
 
         // 渲染农场下拉框数据
@@ -773,7 +930,7 @@
         }
 
 
-        // 选中农场进行渲染列表
+        // // 选中农场进行渲染列表
         gedata('cropcount_view', 1, $('#farmSelct').val())
         function gedata(url, page, id) {
             $.ajax({
@@ -817,7 +974,6 @@
                                 '<div class="userItem">' +
                                 '<div class="userMsg">' +
                                 '<div class="fl imgDiv">' +
-                                // '<img src="" alt="">' +
                                 '<img src="' + group[i].data.crop_img +'" alt="">' +
                                 '<p>' + group[i].data.cropname + '</p>' +
                                 '</div>' +
@@ -852,7 +1008,8 @@
                                         url: 'cropcount_view',
                                         type: 'get',
                                         // data: { page: obj.curr, ids: sessionStorage.getItem('seelectID') },
-                                        data: { page: obj.curr, ids: $('#farmSelect').val() },
+                                        // data: { page: obj.curr, ids: $('#farmSelect').val() },
+                                        data: { page: obj.curr, ids: $('#farmSelct').val() },
                                         dataType: 'html',
                                         success: function (data) {
                                             //转换格式
@@ -889,7 +1046,7 @@
                                                     '<div class="userItem">' +
                                                     '<div class="userMsg">' +
                                                     '<div class="fl imgDiv">' +
-                                                    '<img src="" alt="">' +
+                                                    '<img src="' + group[i].data.crop_img + '" alt="">' +
                                                     '<p>' + group[i].data.cropname + '</p>' +
                                                     '</div>' +
                                                     '<div class="userInfo">' +
@@ -926,7 +1083,6 @@
                 },
                 error: function (type) {
                     console.log(type)
-                    alert('失败')
                 }
             })
         }

+ 1 - 1
templates/backstageNet/production/gardenNew.html

@@ -4,7 +4,7 @@
         <!-- <p class="username">{{ msg.art }}</p> -->
         <p class="username">{{ msg.name }}</p>
         <div class="userMsg">
-            <img src='http://127.0.0.1:8000/{{ msg.farm_img }}' class="fl" alt="">
+            <img src='{{ msg.farm_img }}' class="fl" alt="">
             <div class="userInfo">
                 <p>基地面积(亩): {{ msg.area }}</p>
                 <p>管理者: {{ msg.manage_user.name }}</p>

+ 9 - 4
templates/backstageNet/production/person_farm_edit.html

@@ -314,6 +314,8 @@
                             </div>
                         </div>
                         <div class="layui-form-item">
+                            <input type="hidden" value="" name="img_1" id="img_1">
+                            <input type="hidden" value="" name="location_2" id="location_2">
                             <div class="layui-input-block">
                                 <button class="layui-btn" type="button" lay-submit lay-filter="formDemo">立即提交</button>
                                 <a type="button" class="layui-btn layui-btn-primary" href="person_farm?name={{current_user.username}}" target="blank">查看个人农场</a>
@@ -390,13 +392,16 @@
                             , "area": data.area
                             , "addr": data.addr
                             , "location": data.location
+                            , "location_2": data.location_2
                             , "desc": data.desc
                             , "img": data.img
-                            , "guide_img": 'http://127.0.0.1:8000/'+data.guide_img
+                            , "guide_img": data.guide_img
                         })
                     });
-                    var latlan = data.location.split(',');
-                    getMapSite(latlan[0], latlan[1]);
+                    if(data.location){
+                        var latlan = data.location.split(',');
+                        getMapSite(latlan[0], latlan[1]);
+                    }
                     if (data.img) {
                         var currImg = data.img.split(',');
                         $('#uploader-list').html('');
@@ -537,7 +542,7 @@
 
                 // CKupdate()
                 // console.log($("#adtaForm").serializeArray());
-
+                $('#img_1').val(data.field.img.split(',')[0])
                 $.ajax({
                     url: 'person_area_pub',
                     data: $("#formDiv").serialize(),

+ 140 - 25
templates/backstageNet/qxzctrl/qxzData.html

@@ -7,9 +7,9 @@
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <meta http-equiv="X-UA-Compatible" content="ie=edge">
     <title>Document</title>
-    <link rel="stylesheet" href="{% static '/lib/layui/css/layui.css' %}">
     <link rel="stylesheet" href="{% static '/lib/font/fontIcon/iconfont.css' %}">
     <link rel="stylesheet" href="{% static '/lib/css/reset.css' %}">
+    <link rel="stylesheet" href="{% static '/lib/layui/css/layui.css' %}">
     <style>
         /* 面包屑导航 */
 
@@ -208,7 +208,10 @@
             width: 30%;
             text-align: right;
         }
-
+        .dev .devLeft img{
+            width: 60px;
+            height: 60px;
+        }
 
         .dev .devRight {
             padding-left: 15px;
@@ -244,6 +247,9 @@
             padding: 5px 15px;
         }
 
+        #myModal>div{
+            padding-top: 20px;
+        }
         .layui-input {
             font-size: 14px;
             color: #333;
@@ -254,6 +260,19 @@
             height: 30px;
             vertical-align: middle;
         }
+        .layui-form-select .layui-input,.layui-form-item .layui-input-inline{
+            width: 210px;
+        }
+        .layui-form input{
+            color: #858585;
+            background-color: #FFF;
+            border: 1px solid #D5D5D5;
+            padding: 5px 4px 6px;
+            width: 200px;
+        }
+        .timeStage{
+            display: none;
+        }
     </style>
 </head>
 
@@ -319,7 +338,43 @@
         </div>
     </div>
     <input type="hidden" id="qxzPhotoId">
-
+    <!-- 导出提示框 -->
+    <div id="myModal" >
+        <div>
+            <form class="layui-form" action="">
+                <div class="layui-form-item">
+                    <label class="layui-form-label">文件名称:</label>
+                    <div class="layui-input-block">
+                        <input type="text" id="filename" name="name" required  lay-verify="required" placeholder="请输入文件的名称" maxlength="15" class="col-xs-12">
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label">下载类型:</label>
+                    <div class="layui-input-inline">
+                        <select name="downtype" lay-verify="required" lay-filter="downtype" id="downtype">
+                            <option value="1">全部</option>
+                            <option value="2">时间段</option>
+                        </select>
+                    </div>
+                </div>
+                <div class="layui-form-item timeStage">
+                    <label class="layui-form-label">时间段:</label>
+                    <div class="layui-input-inline">
+                        <input type="text" id="timSelectBox3" autocomplete="off" placeholder="请选择时间段 " class="col-xs-12">
+                        <input type="hidden" id="downbegin" name="begin">
+                        <input type="hidden" id="downend" name="end">
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <div class="layui-input-block">
+                    <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
+                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
+                    </div>
+                </div>
+            </form> 
+        </div>
+        
+    </div>
 
     <script src="{% static '/lib/js/jquery-2.1.4.min.js'%}"></script>
     <script src="{% static '/lib/layui/layui.js'%}"></script>
@@ -328,12 +383,13 @@
     <script src="{% static '/lib/js/qxz_dict.js'%}"></script>
     <script>
         var currPage = 1, totelpage;
-        var layer, element, laydate, laypage;
-        layui.use(['element', 'layer', 'laydate', 'laypage'], function () {
+        var layer, element, laydate, laypage,form;
+        layui.use(['element', 'layer', 'laydate', 'laypage','form'], function () {
             element = layui.element;
             layer = layui.layer;
             laydate = layui.laydate;
             laypage = layui.laypage;
+            form = layui.form;
             getEquipList(1, '');
             // 搜索
             $('#searchBtn').on('click', function () {
@@ -354,7 +410,63 @@
                     $('#tableEnd').val(dateArray[1])
                 }
             });
+            //执行一个laydate实例
+            laydate.render({
+                elem: '#timSelectBox3' //指定元素
+                , range: true
+                , done: function (value, date) {
+                    var dateArray = value.split(' - ')
+                    $('#downbegin').val(dateArray[0])
+                    $('#downend').val(dateArray[1])
+                }
+            });
+            form.on('select(downtype)', function(data){
+                if (data.value == 2) {
+                    $('.timeStage').show();
+                } else {
+                    $('.timeStage').hide();
+                    $('#downbegin').val('');
+                    $('#downend').val('');
+                    $('#downtimSelectBox').val('');
+                }
+            }); 
+            form.on('submit(formDemo)', function(data){
+                if(data.field.downtype == 2){
+                    if(!data.field.begin || !data.field.end){
+                        layer.msg('请将时间填写完整!')
+                        return false;
+                    }
+                }
+                window.location.href = 'qxz_data_export?id='+$('.equipListUl li.active').attr('id')+'&begin='+$('#downbegin').val()+'&end='+$('#downend').val()+'&filename='+$('#filename').val()
+                layer.msg(JSON.stringify(data.field));
+                return false;
+            });
         })
+        // 判断主流浏览器
+        function decideExport(){
+            // $('#myModal').modal('toggle')
+            layer.open({
+                type:1,
+                title: '下载'
+                ,area:['550px','350px']
+                ,content: $('#myModal')
+            }); 
+        }
+        //导出
+        function operation() {
+            if (!$('#filename').val()) {
+                layer.msg("请填写文件名!", { time: 2000 });
+                return false;
+            }
+            if ($('#downtype').val() == 2) {
+                if (!($('#downbegin').val() && $('#downbegin').val())) {
+                    layer.msg("请选择时间段!", { time: 2000 });
+                    return false;
+                }
+            }
+            window.location.href = 'cbd_data_export?id='+$('#equip_id').val()+'&begin='+$('#downbegin').val()+'&end='+$('#downend').val()+'&filename='+$('#filename').val()
+
+        }
         // 首页
         function gotofirstpage() {
             currpage = 1;
@@ -500,26 +612,29 @@
                 , layout: ['prev', 'page', 'next', 'skip']
                 , jump: function (obj, first) {
                     var currId = $(".equipListUl .active").attr("id");
-                    $.ajax({
-                        url: 'qxz_report_detail2',
-                        type: 'post',
-                        data: {
-                            page: obj.curr,
-                            e_id: currId,
-                            begin: $('#tableBegin').val(),
-                            end: $('#tableEnd').val(),
-                        },
-                        dataType: 'json',
-                        beforeSend: function () {
-                            loadFlage = layer.load();
-                        },
-                        complete: function () {
-                            layer.close(loadFlage);
-                        },
-                        success: function (data) {
-                            randerTable(data)
-                        }
-                    })
+                    if(!first){
+                        $.ajax({
+                            url: 'qxz_report_detail2',
+                            type: 'post',
+                            data: {
+                                page: obj.curr,
+                                e_id: currId,
+                                begin: $('#tableBegin').val(),
+                                end: $('#tableEnd').val(),
+                            },
+                            dataType: 'json',
+                            beforeSend: function () {
+                                loadFlage = layer.load();
+                            },
+                            complete: function () {
+                                layer.close(loadFlage);
+                            },
+                            success: function (data) {
+                                randerTable(data)
+                            }
+                        })
+                    }
+                   
                 }
             });
         }

+ 14 - 3
templates/backstageNet/qxzctrl/qxzchart.html

@@ -200,7 +200,10 @@
             width: 30%;
             text-align: right;
         }
-
+        .dev .devLeft img{
+            width: 60px;
+            height: 60px;
+        }
 
         .dev .devRight {
             padding-left: 15px;
@@ -761,10 +764,18 @@
                             legend.push(dat[0].unit[j][3] + elementName);
                         }
                         if (seriesDat[j]) {
-                            seriesDat[j].unshift(parseFloat(dat[i].unit[j][0]));
+                            if(dat[i].unit[j][0] == '-99.99'){
+                                seriesDat[j].unshift('-');
+                            }else{
+                                seriesDat[j].unshift(parseFloat(dat[i].unit[j][0]));
+                            }
                         } else {
                             var arr = [];
-                            arr.unshift(parseFloat(dat[i].unit[j][0]));
+                            if(dat[i].unit[j][0] == '-99.99'){
+                                arr.unshift('-');
+                            }else{
+                                arr.unshift(parseFloat(dat[i].unit[j][0]));
+                            }
                             seriesDat[j] = arr;
                         }
                     }

+ 4 - 4
templates/backstageNet/qxzctrl/qxzctrl.html

@@ -457,7 +457,7 @@
                                 },
                                 success:function(data){
                                     console.log(data)
-                                    if(data == 0){
+                                    if(data == 1){
                                         layer.closeAll();
                                     }else{
                                         layer.msg('添加失败', {icon: 2}); 
@@ -505,7 +505,7 @@
                 data: data,
                 dataType: "json",
                 success: function (data) {
-                    if (data == 1) {
+                    if (data == 0) {
                         // layer.tips("设备名已存在!", '#ename');
                         layui.use('layer', function () {
                             var layer = layui.layer;
@@ -513,7 +513,7 @@
                         })
                         return false;
                     }
-                    else if (data == 2) {
+                    else if (data == 1) {
                         layui.use('layer', function () {
                             var layer = layui.layer;
                             layer.msg('设备位置添加成功!');
@@ -521,7 +521,7 @@
                         })
                     }
 
-                    else if (data == 0) {
+                    else if (data == 1) {
                         layui.use('layer', function () {
                             var layer = layui.layer;
                             layer.msg('设备名称修改成功!');

+ 787 - 0
templates/backstageNet/systemSet/imageUpload.html

@@ -0,0 +1,787 @@
+{% load staticfiles %}
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta http-equiv="X-UA-Compatible" content="ie=edge">
+    <title>新闻发布</title>
+    <link rel="stylesheet" href="{% static '/lib/layui/css/layui.css' %}">
+    <link rel="stylesheet" href="{% static '/lib/css/reset.css' %}">
+    <link rel="stylesheet" href="{% static '/css/cropper.min.css' %}">
+    <link rel="stylesheet" href="{% static '/css/ImgCropping.css' %}">
+    <style>
+        .breadcrumbs {
+            padding: 12px 0 12px 30px;
+            border-bottom: 1px solid #dbdbdb;
+        }
+
+        .layui-breadcrumb>* {
+            font-size: 16px;
+        }
+
+        .fixedDiv {
+            position: fixed;
+            width: 100%;
+            z-index: 999;
+            box-shadow: 0px 3px 5px 0px #ececec;
+            background: #fff;
+        }
+
+        /* 发布类型 */
+
+        .widget-title {
+            position: relative;
+            padding-left: 10px;
+            font-size: 16px;
+            padding: 5px 0 5px 10px;
+        }
+
+        .widget-title::after {
+            position: absolute;
+            content: '';
+            left: 0;
+            top: 9px;
+            height: 15px;
+            border-left: 5px solid #23a3ee;
+            padding-left: 10px;
+            font-size: 16px;
+            padding: 5px 0 5px 10px;
+        }
+
+        .widget-title h2 {
+            font-weight: 700;
+            line-height: 33px;
+        }
+
+        .widget-title h2 span {
+            font-size: 13px;
+            font-weight: 100;
+            margin-left: 20px;
+            color: #333;
+        }
+
+
+
+        /* 上传详情 */
+
+        .layui-form-item .layui-input-inline {
+            width: 50%;
+        }
+
+        .uploadContent,
+        .advertisingUp {
+            /* border-top: 7px solid #f0f0f0; */
+            padding: 25px;
+        }
+
+        .uploadUl>li {
+            display: none;
+        }
+
+        .uploadUl>li:first-child {
+            display: block;
+        }
+
+        .innerDiv {
+            max-width: 500px;
+        }
+
+        /* 图片预览 */
+
+        .layui-upload-img {
+            width: 92px;
+            height: 92px;
+            margin: 0 10px 10px 0;
+        }
+
+        #progressBar {
+            display: none;
+        }
+
+        /* 产品展厅上传多图 */
+
+        .uploadParent {
+            position: absolute;
+            margin: 10px 0;
+        }
+
+        .uploadParent>div {
+            display: inline-block;
+            width: 92px;
+            height: 92px;
+            /* border: 1px solid #b8b8b8; */
+            background: url(../../static/imgs/addicon.png) no-repeat center;
+            background-size: 80% 80%;
+            cursor: pointer;
+            margin-right: 8px;
+        }
+
+        .uploadShowParent .layui-upload-list {
+            display: inline-block;
+        }
+
+        /* 表单样式 */
+
+        .layui-form-item .layui-input-inline {
+            width: 50%;
+        }
+
+        .layui-form-item .layui-input-textarea {
+            width: 50%;
+        }
+
+        .uploadImg {
+            position: absolute;
+            margin: 10px 0;
+            width: 92px;
+            height: 92px;
+            background: none;
+            border: 1px solid #b8b8b8;
+            cursor: pointer;
+        }
+
+        .uploadImgIcon {
+            background: url(../../static/imgs/uploadImgIcon.png) no-repeat center;
+            background-size: 80% 80%;
+        }
+
+        /* 地图 */
+        .layui-form-label {
+            width: 102px;
+        }
+
+        .mapBox {
+            display: flex;
+        }
+
+        .map {
+            width: 55%;
+            height: 400px;
+            border: 1px solid #878787;
+        }
+
+        .locatPoint button {
+            padding: 5px 10px;
+            border-radius: 4px;
+            margin: 10px 20px 5px;
+            color: #fff;
+        }
+
+        .locatPoint button.sw {
+            background-color: #ed9c22;
+        }
+
+        .locatPoint button.ne {
+            background-color: #22a3ed;
+
+        }
+
+        .locatPoint button.center {
+            background-color: #ed2289;
+
+        }
+
+        /* 广告位-开始上传、取消上传按钮 */
+        .imgListAction,
+        .delImgData {
+            display: none;
+        }
+
+        /* 轮播图-开始上传、取消上传按钮 */
+        .testListAction,
+        .delTestData {
+            display: none;
+        }
+
+        .imgHidden {
+            display: none;
+        }
+    </style>
+</head>
+
+<body>
+    <div class="content">
+        <div class="floatNav">
+            <!-- 导航 -->
+            <div class="breadcrumbs">
+                <span class="layui-breadcrumb">
+                    <a target="BoardRight">首页</a>
+                    <a>
+                        <cite>图片上传</cite>
+                    </a>
+                </span>
+            </div>
+        </div>
+        <!-- 内容 -->
+        <div>
+            <!-- 发布详情 -->
+            <div class="uploadContent" id="uploadContent">
+                <div class="widget-title">
+                    <h2>首页轮播图上传
+                        <span id="Uptime"></span>
+                    </h2>
+                </div>
+
+                <!-- 上传 -->
+                <div class="layui-upload">
+                    <span class="">轮播图片:</span>
+                    <button type="button" class="layui-btn layui-btn-normal" id="testList">选择图片</button>
+                    <div id="demo1" style="margin-top: 10px">
+                        <img src="" alt="" class="layui-upload-img imgHidden" id="carouselImg">
+                    </div>
+                    <ul id="listData"></ul>
+                    <button type="button" class="layui-btn testListAction" id="testListAction">开始上传</button>
+                    <button type="button" class="layui-btn layui-btn-danger delTestData" id="delTestData">取消上传</button>
+                </div>
+            </div>
+
+            <!-- 广告位 -->
+            <div class="advertisingUp">
+                <div class="widget-title">
+                    <h2>首页广告位图上传
+                        <span id="Uptime"></span>
+                    </h2>
+                </div>
+
+                <!-- 上传 -->
+                <div class="layui-upload">
+                    <span class="">广告位图片:</span>
+                    <button type="button" class="layui-btn layui-btn-normal" id="replaceImg">选择图片</button>
+                    <div id="demo2" style="margin-top: 10px">
+                        <img src="" alt="" class="layui-upload-img imgHidden" id="finalImg">
+                    </div>
+                    <ul id="listDataA"></ul>
+                    <button type="button" class="layui-btn imgListAction" id="imgListAction">开始上传</button>
+                    <button type="button" class="layui-btn layui-btn-danger delImgData" id="delImgData">取消上传</button>
+                </div>
+            </div>
+        </div>
+
+        <!--图片裁剪框 start广告位-->
+        <div style="display: none" class="tailoring-container1">
+            <div class="black-cloth" onclick="closeTailor(this)"></div>
+            <div class="tailoring-content">
+                <div class="tailoring-content-one">
+                    <label title="上传图片" for="chooseImg" class="l-btn choose-btn">
+                        <input type="file" accept="image/jpg,image/jpeg,image/png" name="file" id="chooseImg"
+                            class="hidden" onchange="selectImg(this)">
+                        选择图片
+                    </label>
+                    <div class="close-tailoring" onclick="closeTailor(this)">×</div>
+                </div>
+                <div class="tailoring-content-two">
+                    <div class="tailoring-box-parcel">
+                        <img id="tailoringImg">
+                    </div>
+                    <div class="preview-box-parcel">
+                        <p>图片预览:</p>
+                        <div class="square previewImg"></div>
+                    </div>
+                </div>
+                <div class="tailoring-content-three">
+                    <!-- <button class="l-btn cropper-reset-btn">复位</button>
+                    <button class="l-btn cropper-rotate-btn">旋转</button>
+                    <button class="l-btn cropper-scaleX-btn">换向</button> -->
+                    <button class="l-btn sureCut" id="sureCut">确定</button>
+                </div>
+            </div>
+        </div>
+        <!--图片裁剪框 end广告位-->
+
+
+        <!--图片裁剪框 start首页轮播-->
+        <div style="display: none" class="tailoring-container2">
+            <div class="black-cloth" onclick="closeTailorA(this)"></div>
+            <div class="tailoring-content">
+                <div class="tailoring-content-one">
+                    <label title="上传图片" for="chooseImgA" class="l-btn choose-btn">
+                        <input type="file" accept="image/jpg,image/jpeg,image/png" name="fileA" id="chooseImgA"
+                            class="hidden" onchange="selectImgA(this)">
+                        选择图片
+                    </label>
+                    <div class="close-tailoring" onclick="closeTailorA(this)">×</div>
+                </div>
+                <div class="tailoring-content-two">
+                    <div class="tailoring-box-parcel">
+                        <img id="carouselingImg">
+                    </div>
+                    <div class="preview-box-parcel">
+                        <p>图片预览:</p>
+                        <div class="square previewImgA"></div>
+                    </div>
+                </div>
+                <div class="tailoring-content-three">
+                    <!-- <button class="l-btn cropper-reset-btn">复位</button>
+                    <button class="l-btn cropper-rotate-btn">旋转</button>
+                    <button class="l-btn cropper-scaleX-btn">换向</button> -->
+                    <button class="l-btn sureCut" id="carousesureCut">确定</button>
+                </div>
+            </div>
+        </div>
+        <!--图片裁剪框 end首页轮播-->
+    </div>
+
+
+
+
+    <script src="{% static '/lib/js/jquery-2.1.4.min.js'%}"></script>
+    <script src="{% static '/lib/layui/layui.js'%}"></script>
+    <script src="{% static 'lib/ckeditor/ckeditor.js'%}"></script>
+    <script src="{% static 'lib/ckeditor/lang/zh-cn.js'%}"></script>
+    <script src="{% static '/js/backstageNet/common.js'%}"></script>
+    <script src="{% static '/js/cropper.min.js'%}"></script>
+    <script>
+        var element, form, upload;
+        var advertisingName //广告位上传图片名称
+        var carouselName //轮播图上传图片名称
+        layui.use(['element', 'form', 'upload', 'layer'], function () {
+            element = layui.element;
+            form = layui.form;
+            upload = layui.upload;
+            layer = layui.layer;
+            // $ = layui.jquery
+
+
+            imgListData() //请求已上传的图片列表-广告
+            imgListDataA() //请求已上传的图片列表-轮播
+        });
+
+        //广告列表请求
+        function imgListData() {
+            $.ajax({
+                url: 'system_photo_save',
+                type: 'post',
+                data: {
+                    code: '2'
+                },
+                success: function (data) {
+                    var dat = JSON.parse(data)
+                    $('#listDataA li').remove()
+                    var html = ''
+                    for (var i = 0; i < dat.length; i++) {
+                        html = '<li class="" style="margin: 10px 0 10px 0"><img style="width: 800px !important; height: 60px" src="' + dat[i].pic_img + '" alt="" class=""></li>'
+                        $('#listDataA').append(html)
+                    }
+                },
+                error: function (err) {
+                    console.log(err)
+                }
+            })
+        }
+
+        //轮播列表请求
+        function imgListDataA() {
+            $.ajax({
+                url: 'system_photo_save',
+                type: 'post',
+                data: {
+                    code: '1'
+                },
+                success: function (data) {
+                    var dat = JSON.parse(data)
+                    $('#listData li').remove()
+                    var html = ''
+                    for (var i = 0; i < dat.length; i++) {
+                        html = '<li class="" style="margin: 10px 0 10px 0"><img style="width: 512px !important; height: 128px" src="' + dat[i].pic_img + '" alt="" class=""></li>'
+                        $('#listData').append(html)
+                    }
+                },
+                error: function (err) {
+                    console.log(err)
+                }
+            })
+        }
+
+        windowAddMouseWheel();
+        function windowAddMouseWheel() {
+            var scrollFunc = function (e) {
+                e = e || window.event;
+                var top = $(window).scrollTop();
+                if (e.wheelDelta) {  //判断浏览器IE,谷歌滑轮事件
+                    if (e.wheelDelta > 0) { //当滑轮向上滚动时
+                        if (top < 60) {
+                            if ($(".floatNav").hasClass("fixedDiv")) {
+                                $(".floatNav").removeClass("fixedDiv");
+                                $(window).scrollTop(0)
+                            }
+                        }
+                    }
+                    if (e.wheelDelta < 0) { //当滑轮向下滚动时
+                        if (top >= 60) {
+                            $(".floatNav").addClass("fixedDiv");
+                        }
+                    }
+                } else if (e.detail) {  //Firefox滑轮事件
+                    if (e.detail > 0) { //当滑轮向上滚动时
+                        if (top < 60) {
+                            if ($(".floatNav").hasClass("fixedDiv")) {
+                                $(".floatNav").removeClass("fixedDiv");
+                                $(window).scrollTop(0)
+                            }
+                        }
+                    }
+                    if (e.detail < 0) { //当滑轮向下滚动时
+                        if (top >= 60) {
+                            $(".floatNav").addClass("fixedDiv");
+                        }
+                    }
+                }
+            };
+            //给页面绑定滑轮滚动事件
+            if (document.addEventListener) {
+                document.addEventListener('DOMMouseScroll', scrollFunc, false);
+            }
+            //滚动滑轮触发scrollFunc方法
+            window.onmousewheel = document.onmousewheel = scrollFunc;
+        }
+
+        // 广告位开始上传按钮监听事件
+        $('#imgListAction').on('click', function () {
+            var fileObj = dataURLtoFile(imgArr, $('#chooseImg').val())
+            var form = new FormData();
+            form.append("upload1", fileObj);
+
+            $.ajax({
+                url: 'system_photo',
+                type: 'post',
+                data: form,
+                processData: false, // 告诉jQuery不要去处理发送的数据
+                contentType: false, // 告诉jQuery不要去设置Content-Type请求头
+                success: function (data) {
+                    console.log(data)
+                    $.ajax({
+                        url: 'system_photo_save',
+                        type: 'post',
+                        data: {
+                            code: '2'
+                        },
+                        success: function (data) {
+                            var dat = JSON.parse(data)
+                            if (dat.length != 0) {
+                                layer.msg('上传成功', { icon: 1 });
+                                imgArr = [] //清空数组数据
+                                $('#delImgData').addClass('delImgData')
+                                $('#finalImg').addClass('imgHidden')
+                                // $('#demo2 img').remove();  //删除所有img
+                                $('#imgListAction').addClass('imgListAction') //隐藏上传按钮
+                                $('#delImgData').addClass('delImgData') //隐藏取消按钮
+                                imgListData() //请求已上传的图片列表-广告
+                            } else if (data == 0) {
+                                layer.msg('上传失败', { icon: 2 });
+                            }
+                        },
+                        error: function (err) {
+                            console.log(err)
+                        }
+                    })
+                },
+                error: function (err) {
+                    console.log(err)
+                }
+            })
+
+
+        });
+
+        // 广告位取消上传按钮监听事件
+        $('#delImgData').on('click', function () {
+            layer.confirm('是否删除已上传的图片', {
+                btn: ['确定', '取消'] //按钮
+            }, function () {
+                imgArr = [] //清空数组数据
+                $('#delImgData').addClass('delImgData')
+                $('#finalImg').addClass('imgHidden')
+                // $('#demo2 img').remove();  //删除所有img
+                $('#imgListAction').addClass('imgListAction') //隐藏上传按钮
+                $('#delImgData').addClass('delImgData') //隐藏取消按钮
+                layer.msg('删除成功', { icon: 1 });
+            }, function () {
+                layer.msg('取消删除', { icon: 1 });
+            });
+        });
+
+        //广告位上传图片按钮监听事件
+        $('#replaceImg').on('click', function () {
+            // $("#replaceImg").addClass("layui-btn-disabled")
+            //弹出图片裁剪框
+            boxSize1 = 40
+            boxSize2 = 3
+            $("#replaceImg").on("click", function () {
+                $(".tailoring-container1").toggle();
+            });
+        });
+
+        //弹出框水平垂直居中
+        (window.onresize = function () {
+            var win_height = $(window).height();
+            var win_width = $(window).width();
+            if (win_width <= 768) {
+                $(".tailoring-content").css({
+                    "top": (win_height - $(".tailoring-content").outerHeight()) / 2,
+                    "left": 0
+                });
+            } else {
+                $(".tailoring-content").css({
+                    "top": (win_height - $(".tailoring-content").outerHeight()) / 2,
+                    "left": (win_width - $(".tailoring-content").outerWidth()) / 2
+                });
+            }
+        })();
+
+        //广告位图像上传
+        function selectImg(file) {
+            if (!file.files || !file.files[0]) {
+                return;
+            }
+            var reader = new FileReader();
+            reader.onload = function (evt) {
+                var replaceSrc = evt.target.result;
+                //更换cropper的图片
+                $('#tailoringImg').cropper('replace', replaceSrc, false);//默认false,适应高度,不失真
+            }
+            advertisingName = file.files[0].name
+            reader.readAsDataURL(file.files[0]);
+        }
+        //cropper图片裁剪
+        $('#tailoringImg').cropper({
+            aspectRatio: 40 / 3,//默认比例
+            preview: '.previewImg',//预览视图
+            guides: false,  //裁剪框的虚线(九宫格)
+            autoCropArea: 0.5,  //0-1之间的数值,定义自动剪裁区域的大小,默认0.8
+            movable: false, //是否允许移动图片
+            dragCrop: true,  //是否允许移除当前的剪裁框,并通过拖动来新建一个剪裁框区域
+            movable: true,  //是否允许移动剪裁框
+            resizable: true,  //是否允许改变裁剪框的大小
+            zoomable: false,  //是否允许缩放图片大小
+            mouseWheelZoom: false,  //是否允许通过鼠标滚轮来缩放图片
+            touchDragZoom: true,  //是否允许通过触摸移动来缩放图片
+            rotatable: true,  //是否允许旋转图片
+            crop: function (e) {
+                // 输出结果数据裁剪图像。
+            }
+        });
+        //广告位旋转
+        $(".cropper-rotate-btn").on("click", function () {
+            $('#tailoringImg').cropper("rotate", 45);
+        });
+        //广告位复位
+        $(".cropper-reset-btn").on("click", function () {
+            $('#tailoringImg').cropper("reset");
+        });
+        //广告位换向
+        var flagX = true;
+        $(".cropper-scaleX-btn").on("click", function () {
+            if (flagX) {
+                $('#tailoringImg').cropper("scaleX", -1);
+                flagX = false;
+            } else {
+                $('#tailoringImg').cropper("scaleX", 1);
+                flagX = true;
+            }
+            flagX != flagX;
+        });
+
+        //广告位裁剪后的处理
+        $("#sureCut").on("click", function () {
+            if ($("#tailoringImg").attr("src") == null) {
+                return false;
+            } else {
+                var cas = $('#tailoringImg').cropper('getCroppedCanvas');//获取被裁剪后的canvas
+                var base64url = cas.toDataURL('image/png'); //转换为base64地址形式
+                imgArr = base64url
+                $("#finalImg").prop("src", base64url);//显示为图片的形式
+                $('#finalImg').removeClass('imgHidden')
+                //关闭裁剪框
+                closeTailor();
+                $('#imgListAction').removeClass('imgListAction')
+                $('#delImgData').removeClass('delImgData')
+                // var fileObj = dataURLtoFile(imgArr, $('#chooseImg').val())
+                // var form = new FormData();
+                // form.append("upload1", fileObj);
+
+                // $.ajax({
+                //     url: 'system_photo',
+                //     type: 'post',
+                //     data: form,
+                //     processData: false, // 告诉jQuery不要去处理发送的数据
+                //     contentType: false, // 告诉jQuery不要去设置Content-Type请求头
+                //     success: function (data) {
+                //         console.log(data)
+                //     },
+                //     error: function (err) {
+                //         console.log(err)
+                //     }
+                // })
+            }
+        });
+        //广告位关闭裁剪框
+        function closeTailor() {
+            $(".tailoring-container1").toggle();
+        }
+
+
+
+        // 首页轮播开始上传按钮监听事件
+        $('#testListAction').on('click', function () {
+            var fileObj = dataURLtoFile(imgArrA, $('#chooseImgA').val())
+            var form = new FormData();
+            form.append("upload", fileObj);
+            $.ajax({
+                url: 'system_photo',
+                type: 'post',
+                data: form,
+                processData: false, // 告诉jQuery不要去处理发送的数据
+                contentType: false, // 告诉jQuery不要去设置Content-Type请求头
+                success: function (data) {
+                    $.ajax({
+                        url: 'system_photo_save',
+                        type: 'post',
+                        data: {
+                            code: '1'
+                        },
+                        success: function (data) {
+                            console.log(JSON.parse(data))
+                            var dat = JSON.parse(data)
+                            if (dat.length != 0) {
+                                layer.msg('上传成功', { icon: 1 });
+                                imgArr = [] //清空数组数据
+                                $('#carouselImg').addClass('imgHidden')
+                                // $('#demo1 img').remove();  //删除所有img
+                                $('#testListAction').addClass('testListAction') //隐藏上传按钮
+                                $('#delTestData').addClass('delTestData') //隐藏取消按钮
+                                imgListDataA() //请求已上传的图片列表-轮播
+                            } else if (data == 0) {
+                                layer.msg('上传失败', { icon: 2 });
+                            }
+                        },
+                        error: function (err) {
+                            console.log(err)
+                        }
+                    })
+                },
+                error: function (err) {
+                    console.log(err)
+                }
+            })
+        });
+
+        // 首页轮播取消上传按钮监听事件
+        $('#delTestData').on('click', function () {
+            layer.confirm('是否删除已上传的图片', {
+                btn: ['确定', '取消'] //按钮
+            }, function () {
+                imgArr = [] //清空数组数据
+                $('#carouselImg').addClass('imgHidden')
+                // $('#demo1 img').remove();  //删除所有img
+                $('#testListAction').addClass('testListAction') //隐藏上传按钮
+                $('#delTestData').addClass('delTestData') //隐藏取消按钮
+                layer.msg('删除成功', { icon: 1 });
+            }, function () {
+                layer.msg('取消删除', { icon: 1 });
+            });
+        });
+
+        //首页轮播上传图片按钮监听事件
+        $('#testList').on('click', function () {
+            // $("#replaceImg").addClass("layui-btn-disabled")
+            //弹出图片裁剪框
+            $("#testList").on("click", function () {
+                $(".tailoring-container2").toggle();
+            });
+        });
+
+        //首页轮播图像上传
+        function selectImgA(fileA) {
+            if (!fileA.files || !fileA.files[0]) {
+                return;
+            }
+            var reader = new FileReader();
+            reader.onload = function (evt) {
+                var replaceSrc = evt.target.result;
+                //更换cropper的图片
+                $('#carouselingImg').cropper('replace', replaceSrc, false);//默认false,适应高度,不失真
+            }
+            carouselName = fileA.files[0].name
+            reader.readAsDataURL(fileA.files[0]);
+        }
+        //cropper图片裁剪
+        $('#carouselingImg').cropper({
+            aspectRatio: 4 / 1,//默认比例
+            preview: '.previewImgA',//预览视图
+            guides: false,  //裁剪框的虚线(九宫格)
+            autoCropArea: 0.5,  //0-1之间的数值,定义自动剪裁区域的大小,默认0.8
+            movable: false, //是否允许移动图片
+            dragCrop: true,  //是否允许移除当前的剪裁框,并通过拖动来新建一个剪裁框区域
+            movable: true,  //是否允许移动剪裁框
+            resizable: true,  //是否允许改变裁剪框的大小
+            zoomable: false,  //是否允许缩放图片大小
+            mouseWheelZoom: false,  //是否允许通过鼠标滚轮来缩放图片
+            touchDragZoom: true,  //是否允许通过触摸移动来缩放图片
+            rotatable: true,  //是否允许旋转图片
+            crop: function (e) {
+                // 输出结果数据裁剪图像。
+            }
+        });
+        //首页轮播旋转
+        $(".cropper-rotate-btn").on("click", function () {
+            $('#carouselingImg').cropper("rotate", 45);
+        });
+        //首页轮播复位
+        $(".cropper-reset-btn").on("click", function () {
+            $('#carouselingImg').cropper("reset");
+        });
+        //首页轮播换向
+        var flagX = true;
+        $(".cropper-scaleX-btn").on("click", function () {
+            if (flagX) {
+                $('#carouselingImg').cropper("scaleX", -1);
+                flagX = false;
+            } else {
+                $('#carouselingImg').cropper("scaleX", 1);
+                flagX = true;
+            }
+            flagX != flagX;
+        });
+
+        //首页轮播裁剪后的处理
+        $("#carousesureCut").on("click", function () {
+            if ($("#carouselingImg").attr("src") == null) {
+                return false;
+            } else {
+                var cas = $('#carouselingImg').cropper('getCroppedCanvas');//获取被裁剪后的canvas
+                var base64url = cas.toDataURL('image/png'); //转换为base64地址形式
+                imgArrA = base64url
+                $("#carouselImg").prop("src", base64url);//显示为图片的形式
+                $('#carouselImg').removeClass('imgHidden')
+
+                //关闭裁剪框
+                closeTailorA();
+                $('#testListAction').removeClass('testListAction')
+                $('#delTestData').removeClass('delTestData')
+
+            }
+        });
+        function dataURLtoFile(dataurl, filename) {
+            var arr = dataurl.split(',');
+            var mime = arr[0].match(/:(.*?);/)[1];
+            var bstr = atob(arr[1]);
+            var n = bstr.length;
+            var u8arr = new Uint8Array(n);
+            while (n--) {
+                u8arr[n] = bstr.charCodeAt(n);
+            }
+            //转换成file对象
+            return new File([u8arr], filename, { type: mime });
+            //转换成成blob对象
+            //return new Blob([u8arr],{type:mime});
+        }
+        //首页轮播关闭裁剪框
+        function closeTailorA() {
+            $(".tailoring-container2").toggle();
+        }
+    </script>
+</body>
+
+</html>

+ 6 - 6
templates/backstageNet/systemSet/onlineSplit.html

@@ -233,7 +233,7 @@
                         <div class="layui-form-item layui-form-text">
                             <label class="layui-form-label">基地范围:</label>
                             <div class="layui-input-inline">
-                                <input type="text" name="location" value="{{curr_area.location|default:''}}" id="scopeArea" required lay-verify="required" readonly
+                                <input type="text" name="location_2" value="{{curr_area.location_2|default:''}}" id="scopeArea" required lay-verify="required" readonly
                                     placeholder="基地范围" autocomplete="off" class="layui-input">
                             </div>
                             <div class="layui-form-mid layui-word-aux scopeSetBtn" onclick="setAreaFun()">设置</div>
@@ -335,7 +335,7 @@
                             var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
                             if ($('#scopeArea').val()) {
                                 var dat = {
-                                    location:$('#scopeArea').val()
+                                    location_2:$('#scopeArea').val()
                                 }
                                 iframeWin.currDraw(dat);
                             } else {
@@ -353,16 +353,16 @@
             var data = {
                 all_area: [
                     {
-                        location: "119.58544,26.11644;119.601394,26.11631;119.58774,26.108264",
+                        location_2: "119.58544,26.11644;119.601394,26.11631;119.58774,26.108264",
                         name: "苹果园区"
                     },
                     {
-                        location: "119.616558,26.111152;119.611527,26.102847;119.631218,26.102587;119.630499,26.102847|119.604772,26.096228;119.604772,26.08247;119.622019,26.087272",
+                        location_2: "119.616558,26.111152;119.611527,26.102847;119.631218,26.102587;119.630499,26.102847|119.604772,26.096228;119.604772,26.08247;119.622019,26.087272",
                         name: 'ssdf'
                     }
                 ],
                 user_area: {
-                    location: "119.618282,26.106221;119.630212,26.104793;119.617995,26.10077",
+                    location_2: "119.618282,26.106221;119.630212,26.104793;119.617995,26.10077",
                     name: "苹果园区"
                 }
             }
@@ -373,7 +373,7 @@
             layer.closeAll(); //疯狂模式,关闭所有层
         }
         function SetBasePolygon(Polygon) {
-            $("input[name=location]").val(Polygon);
+            $("input[name=location_2]").val(Polygon);
             layer.closeAll(); //疯狂模式,关闭所有层
         }
         function clearAll() {

+ 3 - 3
templates/backstageNet/systemSet/onlineSplitMap.html

@@ -139,10 +139,10 @@
         if (PolygonStrDat.length) {
             for (var i = 0; i < PolygonStrDat.length; i++) {
                 var baseName = PolygonStrDat[i].name;
-                if(!PolygonStrDat[i].location){
+                if(!PolygonStrDat[i].location_2){
                     continue;
                 }
-                var drawingNums = PolygonStrDat[i].location.split('|');
+                var drawingNums = PolygonStrDat[i].location_2.split('|');
                 for (var z = 0; z < drawingNums.length; z++) {
                     if (drawingNums[z] == null || drawingNums[z] == undefined) {
                         continue;
@@ -192,7 +192,7 @@
     }
     // 当前绘制
     function currDraw(data) {
-        var PolygonStr = data.location;
+        var PolygonStr = data.location_2;
         if (PolygonStr != "") {
             var polygonArray = PolygonStr.split('|');
 

+ 1 - 1
templates/backstageNet/systemSet/user_list.html

@@ -14,7 +14,7 @@
 	</td>
 	<td>{{ user.date_joined }}</td>
 	<td>
-		<button class="layui-btn layui-btn-sm  btn-shaixuan" onclick="allotEquipPage('{{ user.username }}')">在线分地</button>
+		<button class="layui-btn layui-btn-sm  btn-shaixuan" onclick="allotEquipPage('{{ user.username }}','{{user.id}}')">在线分地</button>
 		{% if user.username == 'admin' %}  {% else %}
 		<button class="layui-btn layui-btn-sm  layui-btn-warm" onclick="addUser('{{ user.id }}')">编辑</button>
 		{% endif %}

+ 3 - 3
templates/backstageNet/warn/productionset.html

@@ -233,7 +233,7 @@
                 <div class="ctrlDiv">
                     <div class="title">
                         <div class="widget-title">
-                            <h2>控制开关
+                            <h2>阈值设置
                                 <span id="Uptime"></span>
                             </h2>
                         </div>
@@ -381,9 +381,9 @@
                                         var eNum = qxz_list[j].eNum;
                                         var txt = qxz_dict[qxz_list[j].eNum][1];
 
-                                        html += '<div class="layui-col-xs6 layui-col-md3"><div class="grid-demo ctrlItem">' +
+                                        html += '<div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3"><div class="grid-demo ctrlItem">' +
                                             '<div class="ctrlUp"><input type="hidden" value=' + JSON.stringify(switchData[i]) + ' class="currStutas">' +
-                                            '<div class="ctrlName"><p class="switchName">开关' + switchData[i].JK + '(通道' + switchData[i].eKey + ')</p><div class="clearfix">' +
+                                            '<div class="ctrlName"><p class="switchName">开关' + (parseInt(switchData[i].JK)+1) + '(通道' + (parseInt(switchData[i].eKey)+1) + ')</p><div class="clearfix">' +
                                             '<div class="fl warnEleName"><div class="bySwitchName"><span title="' + txt + '">' + txt + '</span>' +
                                             '<img src="http://www.yfzhwlw.com/static/img/dev/icon_' + eNum + '.png" alt=""></div></div>' +
                                             '<div class="warnEleVal"><p>最大值:' + switchData[i].upper + '</p><p>最小值:' + switchData[i].lower + '</p></div></div></div>' +

+ 25 - 26
templates/backstageNet/warn/warnSet.html

@@ -131,7 +131,7 @@
         <!-- 内容 -->
         <div class="mainContent">
             <div class="widget-title">
-                <h2>阈值设置</h2>
+                <h2>预警设置</h2>
             </div>
             <div class="currEquip">
                 当前设备: 
@@ -198,23 +198,13 @@
             $('.currEquipSelect').select2({
                 width: 217
             });
+            getthreVal($('.currEquipSelect').val())
              //select2事件
              $(".currEquipSelect").on("change", function () {
                 var data = $(this).val();
                 getthreVal(data)
                 console.log(data)
             });
-            console.log($('.currEquipSelect').val())
-            //执行一个laydate实例
-            laydate.render({
-                elem: '#timSelectBox' //指定元素
-                , range: true
-                , done: function (value, date) {
-                    var dateArray = value.split(' - ')
-                    $('#tableBegin').val(dateArray[0])
-                    $('#tableEnd').val(dateArray[1])
-                }
-            });
             form.verify({
                 userphone: function(value, item){ //value:表单的值、item:表单的DOM对象
                     if(value !='' ){
@@ -274,38 +264,47 @@
         function getthreVal(data){
             var imei = $('#equipSelect').val()
             $.ajax({
-                url: 'qxz_alarm',
+                url: 'qxz_warning_view',
                 data: {
-                    imei:imei
+                    equip_id:imei
                 },
                 type: 'post',
+                dataType:'json',
                 success: function (data) {
                     renderHtml(data);
                 },
                 error: function (type) {
-                    // var data = {
-                    //     alarm:'{"dat":{"e8":"1#5","e2":"0#7","e3":"0#3","e4":"0#2","e5":"1#56"},"tel":"","equip_id":"16057231"}',
-                    //     conf: {e8: "盐分", e2: "温度#°", e3: "雨量",e4: "气压#hpa",e5: ""}
-                    // }
-                    // renderHtml(data);
+                    renderHtml(data);
                 }
             })
         }
-        var data = {
-            alarm:'{"dat":{"e6":"0#","e2":"0#","e3":"0#3","e4":"0#2","e5":"1#56"},"tel":"","equip_id":"16057231"}',
-            conf: {e6: "ces", e2: "", e3: "",e4: "风向#°",e5: "数字气压#hpa"}
-        }
+        // var data = {
+        //     alarm:'{"dat":{"e6":"0#","e2":"0#","e3":"0#3","e4":"0#2","e5":"1#56"},"tel":"","equip_id":"16057231"}',
+        //     conf: {e6: "ces", e2: "", e3: "",e4: "风向#°",e5: "数字气压#hpa"}
+        // }
         // renderHtml(data);
         function renderHtml(data){
-            var dat = eval('('+data.alarm+')').dat;
+            if (data.alarm) {
+                var dat = eval('(' + data.alarm + ')');
+            } else {
+                var dat = {}
+            }
             var conf = data.conf;
             var html = '';
             for(var i = 1;i<=30;i++){
                 var keyEl = 'e'+i;
                 if(conf[keyEl]){
                     var unit = conf[keyEl].split('#')[0];
-                    var typenum = dat[keyEl].split('#')[0];
-                    var val = dat[keyEl].split('#')[1] || '';
+                    if (dat.dat) {
+                        if (dat.dat[key]) {
+                            var typenum = dat[keyEl].split('#')[0];
+                            var val = dat[keyEl].split('#')[1] || '';
+                        } else {
+                            var typenum = 0;
+                            var val = '';
+                        }
+                    }
+                    
                     html += '<div class="layui-form-item">'+
                                 '<div class="layui-input-block"><span class="eleTitle">'+unit+'</span></div>'+
                                 '<div class="layui-input-block">'+

+ 12 - 2
templates/outerNet/exhibitionList.html

@@ -13,6 +13,11 @@
     <link rel="stylesheet" href="{% static '/css/common.css' %}">
     <link rel="stylesheet" href="{% static '/css/module.css' %}">
     <link rel="stylesheet" href="{% static '/css/exhibitionList.css' %}">
+    <style>
+        .layui-breadcrumb .curr cite{
+            color: #3ab851;
+        }
+    </style>
 </head>
 
 <body>
@@ -34,8 +39,13 @@
                 <!-- 面包屑导航 -->
                 <div class="breadcrumb">
                     <span class="layui-breadcrumb">
-                        <a href="home">首页</a>
-                        <a>
+                        <a href="newslist_view?page=1&type=5">
+                            <cite>新闻资讯</cite>
+                        </a>
+                        <a href="video_list?page=1">
+                            <cite>视频资讯</cite>
+                        </a>
+                        <a href="equip_show_list?page=1" class="curr">
                             <cite>产品展厅</cite>
                         </a>
                     </span>

+ 120 - 71
templates/outerNet/farmList.html

@@ -15,41 +15,49 @@
     <link rel="stylesheet" href="{% static '/css/module.css' %}">
     <!-- <link rel="stylesheet" href="{% static '/css/hotelList.css' %}"> -->
     <style>
-        .advImg{
+        .advImg {
             background: url(../static/imgs/farmAdv.jpg) no-repeat center;
             background-size: cover;
         }
+
         /* 内容模块 */
-        .hacienda .haciendaList{
+        .hacienda .haciendaList {
             display: flex;
             flex-flow: wrap;
         }
-        .hacienda .haciendaList{
+
+        .hacienda .haciendaList {
             padding: 20px 20px 0 20px;
         }
-        .hacienda .haciendaItem{
+
+        .hacienda .haciendaItem {
             display: flex;
             margin-bottom: 20px;
         }
-        .hacienda .haciendaImg{
+
+        .hacienda .haciendaImg {
             width: 195px;
             height: 165px;
             position: relative;
         }
-        .hacienda .haciendaImg .haciendaImg1{
+
+        .hacienda .haciendaImg .haciendaImg1 {
             width: 100%;
             height: 100%;
         }
-        .hacienda .haciendaImg .haciendaImg2{
+
+        .hacienda .haciendaImg .haciendaImg2 {
             position: absolute;
             top: 0;
             left: 10px;
         }
-        .hacienda .haciendaItem .haciendaTxt{
+
+        .hacienda .haciendaItem .haciendaTxt {
             width: 147px;
             padding: 10px 10px;
         }
-        .hacienda .haciendaItem .haciendaTxt h2{
+
+        .hacienda .haciendaItem .haciendaTxt h2 {
             font-size: 14px;
             font-weight: bold;
             line-height: 33px;
@@ -57,24 +65,29 @@
             overflow: hidden;
             text-overflow: ellipsis;
         }
-        .hacienda .haciendaItem .haciendaTxt .desc{
+
+        .hacienda .haciendaItem .haciendaTxt .desc {
             letter-spacing: 2px;
             height: 100px;
             overflow: hidden;
         }
-        .hacienda .haciendaItem .haciendaTxt button{
+
+        .hacienda .haciendaItem .haciendaTxt button {
             color: #fff;
             padding: 5px 6px;
             border-radius: 5px;
         }
-        .hacienda .haciendaItem .haciendaTxt button.btn1{
+
+        .hacienda .haciendaItem .haciendaTxt button.btn1 {
             background-color: #00aeed;
         }
-        .hacienda .haciendaItem .haciendaTxt button.btn2{
+
+        .hacienda .haciendaItem .haciendaTxt button.btn2 {
             background-color: #3bb852;
         }
+
         /* 弹出观光样式 */
-        .tourismShow{
+        .tourismShow {
             position: relative;
             z-index: 999;
             opacity: 0;
@@ -87,10 +100,10 @@
             min-height: 400px;
             background-color: #fff;
             border: 1px solid #f1f1f1;
-            -webkit-box-shadow: 2px 4px 10px rgba(0,0,0,.15);
-            -moz-box-shadow: 2px 4px 10px rgba(0,0,0,.15);
-            -o-box-shadow: 2px 4px 10px rgba(0,0,0,.15);
-            box-shadow: 2px 4px 10px rgba(0,0,0,.15);
+            -webkit-box-shadow: 2px 4px 10px rgba(0, 0, 0, .15);
+            -moz-box-shadow: 2px 4px 10px rgba(0, 0, 0, .15);
+            -o-box-shadow: 2px 4px 10px rgba(0, 0, 0, .15);
+            box-shadow: 2px 4px 10px rgba(0, 0, 0, .15);
             padding: 20px;
             border-radius: 12px;
             z-index: 9;
@@ -99,20 +112,24 @@
             border-top-right-radius: 0;
             transition: all .5s;
         }
-        .tourismShow .title{
+
+        .tourismShow .title {
             border-left: 3px solid #ff6a28;
             padding-left: 8px;
             font-size: 16px;
         }
-        .tourismShow .line{
+
+        .tourismShow .line {
             border-bottom: 1px solid #ddd;
             margin-top: 10px;
         }
-        .tourismShow .content{
+
+        .tourismShow .content {
             height: 430px;
             padding-top: 20px;
         }
-        .tourismShow .tourismShowCloseBtn{
+
+        .tourismShow .tourismShowCloseBtn {
             position: absolute;
             right: 15px;
             top: 11px;
@@ -124,10 +141,12 @@
             text-align: center;
             cursor: pointer;
         }
-        .tourismShow .content .guideForm>input{
+
+        .tourismShow .content .guideForm>input {
             width: 40%;
         }
-        .tourismShow .content .guideForm>button{
+
+        .tourismShow .content .guideForm>button {
             color: #fff;
             padding: 5px 6px;
             border-radius: 5px;
@@ -135,7 +154,8 @@
             margin-left: 10px;
             background: #1eaeed;
         }
-        .tourismShow .content .guideForm>button{
+
+        .tourismShow .content .guideForm>button {
             color: #fff;
             padding: 5px 6px;
             border-radius: 5px;
@@ -143,11 +163,13 @@
             margin-left: 10px;
             background: #1eaeed;
         }
-        .tourismShow .content #map{
+
+        .tourismShow .content #map {
             height: 373px;
             margin-top: 10px;
         }
-        .tourismShow .loadDiv{
+
+        .tourismShow .loadDiv {
             position: absolute;
             left: 45%;
             top: 45%;
@@ -180,37 +202,45 @@
                         </a>
                     </span>
                     <div class="searchDiv">
-                        <input type="text" id="searchTitlt" value="{{con|default:''}}" placeholder="请输入标题" autocomplete="off" class="layui-input" >
-                        <button type="button" onclick="searchCon()" class="layui-btn layui-btn-ms"><i class="layui-icon">&#xe615;</i></button>
+                        <input type="text" id="searchTitlt" value="{{con|default:''}}" placeholder="请输入标题"
+                            autocomplete="off" class="layui-input">
+                        <button type="button" onclick="searchCon()" class="layui-btn layui-btn-ms"><i
+                                class="layui-icon">&#xe615;</i></button>
                     </div>
                 </div>
                 <!-- 新闻列表 -->
                 <div class="innerDiv">
                     <div class="hacienda">
                         <ul class="haciendaList">
-                            {% if hotel|length %} {% for hotelItem in hotel %}
+                            {% if garden_list|length %} {% for gardenItem in garden_list %}
                             <li class="haciendaItem">
                                 <div class="haciendaImg">
-                                    <img class="haciendaImg1" src="{% static 'imgs/1.jpg'%}" alt="">
+                                    <img class="haciendaImg1" src="http://127.0.0.1:8000/{{gardenItem.img_1}}" alt="">
                                 </div>
                                 <div class="haciendaTxt">
-                                    <h2>云飞农场</h2>
-                                    <div class="desc">位于和南沙鞥周三水电费,杀敌欧福布斯后撒粉红色的。阿时候发货萨芬,是大法师。</div>
+                                    <h2>{{gardenItem.name}}</h2>
+                                    <div class="desc">{{gardenItem.desc|default:''}}</div>
                                     <div>
-                                        <button class="btn1">观光路线</button>
-                                        <button class="btn2">导游导览</button>
+                                        <button class="btn1">
+                                            <input type="hidden" name="" value="{{gardenItem.guide_img}}" id="">
+                                            观光路线
+                                        </button>
+                                        <button class="btn2">
+                                            <input type="hidden" name="" value="{{gardenItem.location}}" id="">
+                                            导游导览
+                                        </button>
                                     </div>
                                 </div>
                             </li>
                             {% endfor %} {% else %}
-                                <li class="videoItem" style=" width: 100%;">
-                                    <div style="text-align:center;line-height:200px;font-size:18px">暂无数据</div>
-                                </li>
+                            <li class="videoItem" style=" width: 100%;">
+                                <div style="text-align:center;line-height:200px;font-size:18px">暂无数据</div>
+                            </li>
                             {% endif %}
                         </ul>
                     </div>
-                    
-                    {% if hotel|length %}
+
+                    {% if garden_list|length %}
                     <div id="page"></div>
                     <input type="hidden" value="{{nums}}" id="nums">
                     <input type="hidden" value="{{page}}" id="currPage">
@@ -250,7 +280,7 @@
     </div>
 
     <script src="{% static '/lib/js/jquery-2.1.4.min.js'%}"></script>
-    <script src="https://webapi.amap.com/maps?v=1.4.15&key=3939967b919a8003377dd113fc445a3d&plugin=AMap.Driving"></script>
+    <script src="https://webapi.amap.com/maps?v=1.4.15&key=3939967b919a8003377dd113fc445a3d&plugin=AMap.Driving&plugin=AMap.Geocoder"></script>
     <script src="{% static '/lib/layui/layui.js'%}"></script>
     <script>
         //注意:导航 依赖 element 模块,否则无法进行功能性操作
@@ -291,31 +321,38 @@
             window.location.href = 'farm_list?page=1' + '&condition=' + searchTitlt;
         }
 
-        $('.haciendaTxt .btn1').on('click',function(){
+        $('.haciendaTxt .btn1').on('click', function () {
             $('.tourismShow .title span').html('观光路线')
-            $('.tourismShow .content').html('<div style="text-align:center;width:100%;height:100%"><img  style="width:100%;height:100%" src="http://127.0.0.1:8000/static/imgs/banner2.jpg">')
+            var img = $(this).find('input').val();
+            $('.tourismShow .content').html('<div style="text-align:center;width:100%;height:100%"><img  style="width:100%;height:100%" src="' + img + '">')
             $('.tourismShow').show();
-            $('.tourismShow').css('opacity',1)
+            $('.tourismShow').css('opacity', 1)
         })
-        $('.tourismShowCloseBtn').on('click',function(){
+        $('.tourismShowCloseBtn').on('click', function () {
             $('.tourismShow .content').html('')
-            $('.tourismShow').css('opacity',0)
-            setTimeout(function(){
+            $('.tourismShow').css('opacity', 0)
+            setTimeout(function () {
                 $('.tourismShow').hide();
-            },500)
+            }, 500)
         })
         var map;
-        $('.haciendaTxt .btn2').on('click',function(){
+        $('.haciendaTxt .btn2').on('click', function () {
             $('.tourismShow .title span').html('导游导览');
-            var html = '<div class="">'+
-                        '<div class="guideForm">起始地点:<input type="text" id="startPath"><button onclick="searchWay()">确定</button></div>'+
-                        '<div id="map">地图</div>'+
-                        '</div>'
+            var lng = $(this).find('input').val().split(',')[0];
+            var lat = $(this).find('input').val().split(',')[1];
+            var html = '<div class="">' +
+                '<div class="guideForm">起始地点:<input type="text" id="startPath"><button onclick="searchWay(\'' + lng + '\',\'' + lat + '\')">确定</button></div>' +
+                '<div id="map">地图</div>' +
+                '</div>'
             $('.tourismShow .content').html(html);
             map = new AMap.Map('map', {
                 resizeEnable: true, //是否监控地图容器尺寸变化
                 zoom: 11, //初始化地图层级
-                center: [113.397428, 39.90923] //初始化地图中心点
+                center: [lng, lat] //初始化地图中心点
+            });
+            geocoder = new AMap.Geocoder({
+                city: "010", //城市设为北京,默认:“全国”
+                radius: 1000 //范围,默认:500
             });
             var startIcon = new AMap.Icon({
                 // 图标尺寸
@@ -334,18 +371,22 @@
                 imageOffset: new AMap.Pixel(-95, -3)
             });
             var marker = new AMap.Marker({
-                icon:endIcon,
-                position: new AMap.LngLat(113.397428, 39.90923),   // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
-                title: '北京'
+                icon: endIcon,
+                position: new AMap.LngLat(lng, lat),   // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
             });
-            map.add(marker); 
+            map.add(marker);
             $('.tourismShow').show();
-            $('.tourismShow').css('opacity',1)
+            $('.tourismShow').css('opacity', 1);
+            geocoder = new AMap.Geocoder({
+                city: "010", //城市设为北京,默认:“全国”
+                radius: 1000 //范围,默认:500
+            });
         })
-        function searchWay() {
+        function searchWay(lng,lat) {
             map.clearMap();
             var startPath = $("#startPath").val();
             var endPath = '北京';
+            
 
             if (!startPath) {
                 $("#startPath").focus();
@@ -357,19 +398,27 @@
                 map: map,
                 // panel: "panel"
             });
-            // 根据起终点名称规划驾车导航路线
-            driving.search([
-                { keyword: startPath, city: '' },
-                { keyword: endPath, city: '' }
-            ], function (status, result) {
-                if (status === 'complete') {
-                    // log.success('绘制驾车路线完成');
-                    $('.loadDiv').remove();
-                } else {
-                    alert('获取驾车数据失败:' + result)
-                    $('.loadDiv').remove();
+            geocoder.getAddress([lng,lat], function(status, result) {
+                if (status === 'complete'&&result.regeocode) {
+                    var address = result.regeocode.formattedAddress;
+                    // 根据起终点名称规划驾车导航路线
+                    driving.search([
+                        { keyword: startPath, city: '' },
+                        { keyword: address, city: '' }
+                    ], function (status, result) {
+                        if (status === 'complete') {
+                            // log.success('绘制驾车路线完成');
+                            $('.loadDiv').remove();
+                        } else {
+                            alert('获取驾车数据失败:' + result)
+                            $('.loadDiv').remove();
+                        }
+                    });
+                }else{
+                    log.error('根据经纬度查询地址失败')
                 }
             });
+            
         }
     </script>
 </body>

+ 4 - 62
templates/outerNet/forgetPaw.html

@@ -261,71 +261,13 @@
                 </div>
                 <div class="partnerInner">
                     <ul class="partnerInnerList">
+                        {% for relationItem in relation %}
                         <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
+                            <a target="_blank" href="{{relationItem.relation}}">
+                                <img src="http://127.0.0.1:8000/{{relationItem.pic}}" alt="">        
                             </a>
                         </li>
+                        {% endfor %}
                         <li style="clear: both;"></li>
                     </ul>
                 </div>

+ 8 - 8
templates/outerNet/index2.html

@@ -220,7 +220,7 @@
                                             {% for farmItem in garden %}
                                             <li class="farm-item">
                                                 <a target="_blank" href="person_farm?name={{farmItem.user}}">
-                                                  <img src="http://127.0.0.1:8000/{{farmItem.farm_img}}" alt="">
+                                                  <img src="http://127.0.0.1:8000/{{farmItem.img_1}}" alt="">
                                                     <div class="news-item-txt">
                                                         <div class="title">
                                                             <h1>
@@ -228,7 +228,7 @@
                                                             </h1>
                                                         </div>
                                                         <div class="desc">
-                                                            {{farmItem.desc}}
+                                                            {{farmItem.desc|default:''}}
                                                         </div>
                                                     </div>  
                                                 </a>
@@ -245,7 +245,7 @@
                     <div class="news">
                         <div class="newsTitle">
                             <span>焦点新闻</span>
-                            <a href="newslist_view?page=1&type=''" target="_blank" class="more">更多</a>
+                            <a href="newslist_view?page=1&type=5" target="_blank" class="more">更多</a>
                         </div>
                         <div class="newsContent">
                             <ul class="news-txt-list">
@@ -299,7 +299,7 @@
                                         <li class="productItem">
                                             <div>
                                                 <a href="garden_intro?id={{pickItem.id}}" target="_blank">
-                                                    <img src="http://192.168.1.9:8000/{{pickItem.pick_img}}" alt="">
+                                                    <img src="http://127.0.0.1:8000/{{pickItem.pick_img}}" alt="">
                                                 </a>
                                             </div>
                                             <p><a href="garden_intro?id={{pickItem.id}}" target="_blank">{{pickItem.name}}</a></p>
@@ -355,12 +355,12 @@
                                 {% for gardenItem in garden %}
                                 <li class="haciendaItem">
                                     <div class="haciendaImg">
-                                        <img class="haciendaImg1" src="{% static 'imgs/1.jpg'%}" alt="">
+                                        <img class="haciendaImg1" src="http://127.0.0.1:8000/{{gardenItem.img_1}}" alt="">
                                         <img class="haciendaImg2" src="{% static 'imgs/22.png'%}" alt="">
                                     </div>
                                     <div class="haciendaTxt">
                                         <h2>{{gardenItem.name}}</h2>
-                                        <div class="desc">{{gardenItem.desc}}</div>
+                                        <div class="desc">{{gardenItem.desc|default:''}}</div>
                                         <div>
                                             <button class="btn1">
                                                 <input type="hidden" name="" value="{{gardenItem.guide_img}}" id="">
@@ -405,7 +405,7 @@
                                     <li class="travelItem">
                                         <a href="tourist?id={{sightseeItem.id}}" target="_blank">
                                             <div class="travelImg">
-                                                <img class="haciendaImg1" src="http://127.0.0.1:8000/{{sightseeItem.sightisee_img}}" alt="">
+                                                <img class="haciendaImg1" src="http://127.0.0.1:8000/{{sightseeItem.sightsee_img}}" alt="">
                                                 <img class="haciendaImg2" src="{% static 'imgs/22.png'%}" alt="">
                                             </div>
                                             <div class="travelTitle">
@@ -538,7 +538,7 @@
                         {% for relationItem in relation %}
                         <li class="partnerInnerItem">
                             <a target="_blank" href="{{relationItem.relation}}">
-                                <img src="http://127.0.0.1:8000{{relationItem.pic}}" alt="">        
+                                <img src="http://127.0.0.1:8000/{{relationItem.pic}}" alt="">        
                             </a>
                         </li>
                         {% endfor %}

+ 4 - 62
templates/outerNet/login2.html

@@ -208,71 +208,13 @@
                 </div>
                 <div class="partnerInner">
                     <ul class="partnerInnerList">
+                        {% for relationItem in relation %}
                         <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
+                            <a target="_blank" href="{{relationItem.relation}}">
+                                <img src="http://127.0.0.1:8000/{{relationItem.pic}}" alt="">        
                             </a>
                         </li>
+                        {% endfor %}
                         <li style="clear: both;"></li>
                     </ul>
                 </div>

+ 20 - 3
templates/outerNet/newsList.html

@@ -13,6 +13,11 @@
     <link rel="stylesheet" href="{% static '/css/common.css' %}">
     <link rel="stylesheet" href="{% static '/css/module.css' %}">
     <link rel="stylesheet" href="{% static '/css/newsList.css' %}">
+    <style>
+        .layui-breadcrumb .curr cite{
+            color: #3ab851;
+        }
+    </style>
 </head>
 
 <body>
@@ -34,9 +39,21 @@
                 <!-- 面包屑导航 -->
                 <div class="breadcrumb">
                     <span class="layui-breadcrumb">
-                        <a href="home">首页</a>
-                        <a>
-                            <cite>新闻资讯</cite>
+                        <a class="curr">
+                            <cite>
+                                <select name="" id="newsChange" onchange="newsChange(this)">
+                                    <option value="5">新闻资讯</option>
+                                    <option value="0">农业新闻</option>
+                                    <option value="1">农业政策</option>
+                                    <option value="2">农业技术</option>
+                                </select>
+                            </cite>
+                        </a>
+                        <a href="video_list?page=1">
+                            <cite>视频资讯</cite>
+                        </a>
+                        <a href="equip_show_list?page=1">
+                            <cite>产品展厅</cite>
                         </a>
                     </span>
                     <div class="searchDiv">

+ 4 - 62
templates/outerNet/register.html

@@ -241,71 +241,13 @@
                 </div>
                 <div class="partnerInner">
                     <ul class="partnerInnerList">
+                        {% for relationItem in relation %}
                         <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
-                            </a>
-                        </li>
-                        <li class="partnerInnerItem">
-                            <a href="">
-                                <img src="http://www.xbxxnyggw.cn/file/upload/201901/22/230441831.jpg" alt="">
+                            <a target="_blank" href="{{relationItem.relation}}">
+                                <img src="http://127.0.0.1:8000/{{relationItem.pic}}" alt="">        
                             </a>
                         </li>
+                        {% endfor %}
                         <li style="clear: both;"></li>
                     </ul>
                 </div>

+ 1 - 1
templates/outerNet/tourist.html

@@ -68,7 +68,7 @@
                         <div class="sendTime title">{{sightsee.upl_time}}</div>
                         <div class="prodectIntro">
                             <div class="prodectImg">
-                                <img src="http://127.0.0.1:8000/{{sightsee.sightisee_img }}" alt="">
+                                <img src="http://127.0.0.1:8000/{{sightsee.sightsee_img}}" alt="">
                             </div>
                             <div class="descTxt">
                                 <div><span>景点名称:</span>{{sightsee.name}}</div>

+ 1 - 1
templates/outerNet/touristList.html

@@ -56,7 +56,7 @@
                          {% if sightsee|length %} {% for hotelItem in sightsee %}
                         <li class="hotelItem">
                             <a href="tourist?id={{hotelItem.id}}">
-                                <img src="{{hotelItem.hotel_img}}" alt="">
+                                <img src="http://127.0.0.1:8000/{{hotelItem.sightsee_img}}" alt="">
                                 <div class="hotelDetial">
                                     <h2>{{hotelItem.name}}</h2>
                                     <div class="abstract-wrap">

+ 12 - 2
templates/outerNet/videoList.html

@@ -13,6 +13,11 @@
     <link rel="stylesheet" href="{% static '/css/common.css' %}">
     <link rel="stylesheet" href="{% static '/css/module.css' %}">
     <link rel="stylesheet" href="{% static '/css/videoList.css' %}">
+    <style>
+        .layui-breadcrumb .curr cite{
+            color: #3ab851;
+        }
+    </style>
 </head>
 
 <body>
@@ -34,10 +39,15 @@
                 <!-- 面包屑导航 -->
                 <div class="breadcrumb">
                     <span class="layui-breadcrumb">
-                        <a href="home">首页</a>
-                        <a>
+                        <a href="newslist_view?page=1&type=5">
+                            <cite>新闻资讯</cite>
+                        </a>
+                        <a href="video_list?page=1" class="curr">
                             <cite>视频资讯</cite>
                         </a>
+                        <a href="equip_show_list?page=1">
+                            <cite>产品展厅</cite>
+                        </a>
                     </span>
                     <div class="searchDiv">
                         <input type="text" id="searchTitlt" value="{{con|default:''}}" placeholder="请输入标题" autocomplete="off" class="layui-input">

+ 286 - 0
templates/static/css/ImgCropping.css

@@ -0,0 +1,286 @@
+* {
+    margin: 0;
+    padding: 0;
+}
+
+.l-btn {
+    display: inline-block;
+    outline: none;
+    resize: none;
+    border: none;
+    padding: 5px 10px;
+    background: #8C85E6;
+    color: #fff;
+    border: solid 1px #8C85E6;
+    border-radius: 3px;
+    font-size: 14px;
+}
+
+.l-btn:hover {
+    background: #8078e3;
+    animation: anniu 1s infinite;
+}
+
+.l-btn:active {
+    box-shadow: 0 2px 3px rgba(0, 0, 0, .2) inset;
+}
+
+.hidden {
+    display: none;
+}
+
+/* .tailoring-container,
+.tailoring-container div,
+.tailoring-container p { */
+.tailoring-container1,
+.tailoring-container1 div,
+.tailoring-container1 p {
+    margin: 0;
+    padding: 0;
+    box-sizing: border-box;
+    -webkit-box-sizing: border-box;
+    -moz-box-sizing: border-box;
+}
+
+.tailoring-container2,
+.tailoring-container2 div,
+.tailoring-container2 p {
+    margin: 0;
+    padding: 0;
+    box-sizing: border-box;
+    -webkit-box-sizing: border-box;
+    -moz-box-sizing: border-box;
+}
+
+/* .tailoring-container { */
+.tailoring-container1 {
+    position: fixed;
+    width: 100%;
+    height: 100%;
+    z-index: 1000;
+    top: 0;
+    left: 0;
+}
+
+.tailoring-container2 {
+    position: fixed;
+    width: 100%;
+    height: 100%;
+    z-index: 1000;
+    top: 0;
+    left: 0;
+}
+
+/* .tailoring-container .black-cloth { */
+.tailoring-container1 .black-cloth {
+    position: fixed;
+    width: 100%;
+    height: 100%;
+    background: #111;
+    opacity: .9;
+    z-index: 1001;
+}
+
+.tailoring-container2 .black-cloth {
+    position: fixed;
+    width: 100%;
+    height: 100%;
+    background: #111;
+    opacity: .9;
+    z-index: 1001;
+}
+
+/* .tailoring-container .tailoring-content{ */
+.tailoring-container1 .tailoring-content {
+    position: absolute;
+    width: 768px;
+    height: 560px;
+    background: #fff;
+    z-index: 1002;
+    left: 0;
+    top: 0;
+
+    /* 水平垂直居中 浏览器版本号低的不支持transform */
+    /*left: 50%;
+    top: 50%;
+    transform: translate(-50%,-50%);
+    -weblit-transform: translate(-50%,-50%);
+    -moz-transform: translate(-50%,-50%);
+    -ms-transform: translate(-50%,-50%);
+    -o-transform: translate(-50%,-50%);*/
+
+    border-radius: 10px;
+    box-shadow: 0 0 10px #000;
+    padding: 10px;
+}
+
+.tailoring-container2 .tailoring-content {
+    position: absolute;
+    width: 768px;
+    height: 560px;
+    background: #fff;
+    z-index: 1002;
+    left: 0;
+    top: 0;
+
+    /* 水平垂直居中 浏览器版本号低的不支持transform */
+    /*left: 50%;
+    top: 50%;
+    transform: translate(-50%,-50%);
+    -weblit-transform: translate(-50%,-50%);
+    -moz-transform: translate(-50%,-50%);
+    -ms-transform: translate(-50%,-50%);
+    -o-transform: translate(-50%,-50%);*/
+
+    border-radius: 10px;
+    box-shadow: 0 0 10px #000;
+    padding: 10px;
+}
+
+.tailoring-content-one {
+    height: 40px;
+    width: 100%;
+    border-bottom: 1px solid #DDD;
+}
+
+.tailoring-content .choose-btn {
+    float: left;
+}
+
+.tailoring-content .close-tailoring {
+    display: inline-block;
+    height: 30px;
+    width: 30px;
+    border-radius: 100%;
+    background: #eee;
+    color: #fff;
+    font-size: 22px;
+    text-align: center;
+    line-height: 30px;
+    float: right;
+    cursor: pointer;
+}
+
+.tailoring-content .close-tailoring:hover {
+    background: #ccc;
+}
+
+.tailoring-content .tailoring-content-two {
+    width: 100%;
+    height: 460px;
+    position: relative;
+    padding: 5px 0;
+}
+
+.tailoring-content .tailoring-box-parcel {
+    width: 520px;
+    height: 450px;
+    position: absolute;
+    left: 0;
+    border: solid 1px #ddd;
+}
+
+.tailoring-content .preview-box-parcel {
+    display: inline-block;
+    width: 228px;
+    height: 450px;
+    position: absolute;
+    right: 0;
+    padding: 4px 14px;
+}
+
+.preview-box-parcel p {
+    color: #555;
+}
+
+.previewImg {
+    width: 200px;
+    height: 200px;
+    overflow: hidden;
+}
+
+.previewImgA {
+    width: 200px;
+    height: 200px;
+    overflow: hidden;
+}
+
+.preview-box-parcel .square {
+    margin-top: 10px;
+    border: solid 1px #ddd;
+}
+
+.preview-box-parcel .circular {
+    border-radius: 100%;
+    margin-top: 10px;
+    border: solid 1px #ddd;
+}
+
+.tailoring-content .tailoring-content-three {
+    width: 100%;
+    height: 40px;
+    border-top: 1px solid #DDD;
+    padding-top: 10px;
+}
+
+.sureCut {
+    float: right;
+}
+
+@media all and (max-width: 768px) {
+
+    /* .tailoring-container .tailoring-content { */
+    .tailoring-container1 .tailoring-content {
+        width: 100%;
+        min-width: 320px;
+        height: 460px;
+    }
+
+    .tailoring-content .tailoring-content-two {
+        height: 360px;
+    }
+
+    .tailoring-content .tailoring-box-parcel {
+        height: 350px;
+    }
+
+    /* .tailoring-container .tailoring-box-parcel { */
+    .tailoring-container1 .tailoring-box-parcel {
+        width: 100%;
+    }
+
+    /* .tailoring-container .preview-box-parcel { */
+    .tailoring-container1 .preview-box-parcel {
+        display: none;
+    }
+
+
+
+
+
+
+
+    .tailoring-container2 .tailoring-content {
+        width: 100%;
+        min-width: 320px;
+        height: 460px;
+    }
+
+    .tailoring-content .tailoring-content-two {
+        height: 360px;
+    }
+
+    .tailoring-content .tailoring-box-parcel {
+        height: 350px;
+    }
+
+    /* .tailoring-container .tailoring-box-parcel { */
+    .tailoring-container2 .tailoring-box-parcel {
+        width: 100%;
+    }
+
+    /* .tailoring-container .preview-box-parcel { */
+    .tailoring-container2 .preview-box-parcel {
+        display: none;
+    }
+}

File diff ditekan karena terlalu besar
+ 10 - 0
templates/static/css/cropper.min.css


+ 1 - 1
templates/static/css/header.css

@@ -195,7 +195,7 @@
     height: 40px;
     overflow: hidden;
     border-radius: 50%;
-    background: red;
+    /* background: red; */
     margin-right: 10px;
 }
 .yet_loginCover .person .userHeadImg img{

+ 1 - 0
templates/static/css/home.css

@@ -17,6 +17,7 @@
 }
 .header .logo img{
     cursor: pointer;
+    margin-top: -10px;
 }
 .header .navigation{
     float: right;

TEMPAT SAMPAH
templates/static/imgs/dev/icon_100.png


TEMPAT SAMPAH
templates/static/imgs/dev/icon_201.png


TEMPAT SAMPAH
templates/static/imgs/dev/icon_202.png


TEMPAT SAMPAH
templates/static/imgs/dev/icon_203.png


TEMPAT SAMPAH
templates/static/imgs/dev/icon_211.png


+ 7 - 2
templates/static/js/backstageNet/common.js

@@ -16,16 +16,21 @@ function scrollBar() {
 }
 
 // 信息发布另存标题
-function msgTitleSaveFun(title,type){
+function msgTitleSaveFun(title,type,edit,callbackFun){
     $.ajax({
         url: 'ckarticle_view',
         data: {
             title:title,
             art_type:type,
+            edit:edit
         },
         type: 'post',
         success: function (data) {
-            
+            if(data == 1){
+                callbackFun();
+            }else if(data == 2){
+                layer.msg('标题存在,请重新输入',{icon:2})
+            }
         },
         error: function (type) {
 

File diff ditekan karena terlalu besar
+ 10 - 0
templates/static/js/cropper.min.js


+ 8 - 5
templates/static/js/limit/limit.js

@@ -97,12 +97,12 @@ var navList = [
         "children": [
             {
                 "id": 7.1,
-                "title": "阈值设置",
+                "title": "预警设置",
                 "url": "qxz_warning_view",
             },
             {
                 "id": 7.2,
-                "title": "生产方式设置",
+                "title": "阈值设置",
                 "url": "productionset",
             },
             {
@@ -264,7 +264,6 @@ var navList = [
         "title": "系统设置",
         "icon": "&#xe619;",
         "url": "",
-        "disabled": "true",
         "children": [
             {
                 "id": 13.1,
@@ -276,13 +275,18 @@ var navList = [
                 "id": 13.2,
                 "title": "地图设置",
                 "url": "setMap",
-                "disabled": "true",
             },
             {
                 "id": 13.3,
                 "title": "合作伙伴",
                 "url": "add_relation",
                 "disabled": "true",
+            },
+            {
+                "id": 13.4,
+                "title": "首页图片",
+                "url": "system_photo",
+                "disabled": "true",
             }
         ]
     },
@@ -291,7 +295,6 @@ var navList = [
         "title": "专家诊断",
         "icon": "&#xe721;",
         "url": "",
-        "disabled": "true",
         "children": [
             {
                 "id": 14.1,

+ 9 - 0
templates/static/js/newsList.js

@@ -24,6 +24,15 @@ layui.use(['element', 'laypage'], function () {
         }
     });
 });
+// var valdat = localStorage.newsChange || 5;
+$('#newsChange').val(location.search.split('=')[2])
+console.log(location.search.split('=')[2])
+
+function newsChange(obj){
+    var val = $(obj).val();
+    // localStorage.setItem("newsChange", val);
+    window.location.href = 'newslist_view?page=1&type=' + val;
+}   
 
 
 $('#searchTitlt').on('keypress', function (e) {

+ 2 - 2
templates/static/js/systemSet/userManage.js

@@ -127,10 +127,10 @@ function initSearchPage(page, url, datas) {
     });
 }
 
-function allotEquipPage(uname) {
+function allotEquipPage(uname,id) {
     var currPage = $('#page .layui-laypage-curr em').eq(1).html();
     var f_name = $('#uname').val();
-    window.location.href = 'area_create?uname=' + uname + '&currpage=' + currPage + '&f_name=' + f_name;
+    window.location.href = 'area_create?uname=' + uname + '&currpage=' + currPage + '&f_name=' + f_name+ '&id=' + id;
 }
 
 // 创建新用户

+ 10 - 6
templates/static/js/warn/qxz_dict.js

@@ -55,10 +55,14 @@ var qxz_dict = {'100':['未定义',],
 '155':['155','氮','mg/kg'],
 '156':['156','磷','mg/kg'],
 '157':['157','钾','mg/kg'],
-'158':['158','NO2','ug/m3'],
-'159':['159','O3','ug/m3'],
-'160':['160','管道流量','m3/s'],
-'161':['161','流速','L/min'],
-'162':['162','管道压力','KPa'],
-'208':['208','照度','Lux']
+'158':['158','热通量','W/m2'],
+'159':['159','叶面温度','℃'],
+'160':['160','叶面湿度','%RH'],
+'161':['161','茎秆','mm'],
+'162':['162','负氧离子','个/cm3'],
+'201':['201','土壤水势','KPA'],
+'202':['202','露点温度','℃'],
+'203':['203','PM100','ug/m3'],
+'208':['208','照度','Lux'],
+'211':['211','电导率','uS/cm']
 }

+ 10 - 6
templates/static/lib/js/qxz_dict.js

@@ -55,10 +55,14 @@ var qxz_dict = {'100':['未定义',],
 '155':['155','氮','mg/kg'],
 '156':['156','磷','mg/kg'],
 '157':['157','钾','mg/kg'],
-'158':['158','NO2','ug/m3'],
-'159':['159','O3','ug/m3'],
-'160':['160','管道流量','m3/s'],
-'161':['161','流速','L/min'],
-'162':['162','管道压力','KPa'],
-'208':['208','照度','Lux']
+'158':['158','热通量','W/m2'],
+'159':['159','叶面温度','℃'],
+'160':['160','叶面湿度','%RH'],
+'161':['161','茎秆','mm'],
+'162':['162','负氧离子','个/cm3'],
+'201':['201','土壤水势','KPA'],
+'202':['202','露点温度','℃'],
+'203':['203','PM100','ug/m3'],
+'208':['208','照度','Lux'],
+'211':['211','电导率','uS/cm']
 }