zhangyun 3 lat temu
rodzic
commit
c27f391ce9

+ 2 - 2
pingpu_vue/config/index.js

@@ -11,9 +11,9 @@ module.exports = {
     assetsPublicPath: '/',
     proxyTable: {
       '/api': {
-        // target: 'http://192.168.1.77:8003', //曹世祥本地服务
+        target: 'http://192.168.1.77:8003', //曹世祥本地服务
         // target: ' http://106.119.196.18:10004', //线上
-        target: 'http://192.168.1.52:8005',
+        // target: 'http://192.168.1.52:8005',
         changeOrigin: true,
         pathRewrite: {
           '^/api': '/api' //重写接口

+ 1 - 1
pingpu_vue/index.html

@@ -4,7 +4,7 @@
 <head>
   <meta charset="utf-8">
   <meta name="viewport" content="width=device-width,initial-scale=1.0">
-  <title>pingpu_vue</title>
+  <title>病虫害监测系统</title>
   <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
 </head>
 <style>

+ 2 - 1
pingpu_vue/package.json

@@ -74,7 +74,8 @@
     "webpack": "^3.6.0",
     "webpack-bundle-analyzer": "^2.9.0",
     "webpack-dev-server": "^2.9.1",
-    "webpack-merge": "^4.1.0"
+    "webpack-merge": "^4.1.0",
+    "highcharts": "^8.0.4"
   },
   "engines": {
     "node": ">= 6.0.0",

+ 3 - 3
pingpu_vue/src/page/base/maofacility.vue

@@ -23,13 +23,13 @@
           <span>{{ alreadyhave.area_addr[2] }}</span>
         </p>
         <p>
-          <i class="iconfont icon-zongmianji"></i> 基地面积:{{
+          <i class="iconfont icon-zongmianji" style="color:#999;font-size:14px;"></i> 基地面积:{{
             alreadyhave.base_area
           }}
         </p>
         <p>
-          <i class="iconfont icon-dikuaishuliang"></i> 设备数量:{{
+          <i class="iconfont icon-dikuaishuliang" style="color:#999;font-size:14px;"></i> 设备数量:{{
             faclist.length
           }}
@@ -597,7 +597,7 @@ export default {
       color: #262626;
     }
     p:first-child {
-      font-size: 30px;
+      font-size: 28px;
       margin-bottom: 10px;
       color: #262626;
     }

+ 30 - 18
pingpu_vue/src/page/base/mapplot.vue

@@ -23,15 +23,19 @@
           <span>{{ alreadyhave.area_addr[2] }}</span>
         </p>
         <p>
-          <i class="iconfont icon-zongmianji"></i> 基地面积:{{
-            alreadyhave.base_area
-          }}
+          <i
+            class="iconfont icon-zongmianji"
+            style="color: #999; font-size: 14px"
+          ></i>
+          基地面积:{{ alreadyhave.base_area }}
         </p>
         <p>
-          <i class="iconfont icon-dikuaishuliang"></i> 地块数量:{{
-            faclist.length
-          }}
+          <i
+            class="iconfont icon-dikuaishuliang"
+            style="color: #999; font-size: 14px"
+          ></i>
+          地块数量:{{ faclist.length }}
         </p>
       </div>
@@ -52,7 +56,14 @@
             <div class="caozuo">
               <div>地块面积:{{ item.massif_area }} 亩</div>
               <div>
-                <p @click="getpoltlistinfo(item.massif_name),getcroplist(item.massif_id)">修改</p>
+                <p
+                  @click="
+                    getpoltlistinfo(item.massif_name),
+                      getcroplist(item.massif_id)
+                  "
+                >
+                  修改
+                </p>
                 <p @click="delfac(item.massif_id)">删除</p>
               </div>
             </div>
@@ -270,11 +281,11 @@ export default {
   computed: {},
   //监控data中的数据变化
   watch: {
-    dialogVisible(val){
-      if(val){
-        this.getcroplist()
+    dialogVisible(val) {
+      if (val) {
+        this.getcroplist();
       }
-    }
+    },
   },
   //方法集合
   methods: {
@@ -395,18 +406,18 @@ export default {
       });
     },
     createPolygon() {
-      if (document.getElementsByClassName("el-message").length == 0) {
-        this.$message.success("开始绘制");
-      }
       if (this.underway) {
         if (document.getElementsByClassName("el-message").length == 0) {
           this.$message.warning("正在绘制中,请勿重复点击");
-          return;
         }
         return;
+      } else {
+        if (document.getElementsByClassName("el-message").length == 0) {
+          this.$message.success("开始绘制");
+        }
       }
       this.underway = true;
-      var polyEditor = new AMap.PolygonEditor(this.map);
+      var polyEditor = new AMap.PolygonEditor(this.map);0
       polyEditor.addAdsorbPolygons(this.polyEdarr);
       this.polyEditor = polyEditor;
       polyEditor.on("add", this.plotend);
@@ -439,6 +450,7 @@ export default {
             this.$message.warning("地块与其他地块重叠,绘制无效");
           }
           this.polyEditor.close();
+          this.underway = false;
           return true;
         } else {
           return false;
@@ -568,7 +580,7 @@ export default {
         method: "post",
         url: "api/api_gateway?method=basemanager.baseinfo.massif_by_crop_list",
         data: this.qs.stringify({
-          massif_id:id
+          massif_id: id,
         }),
       }).then((res) => {
         if (res.data.data) {
@@ -760,7 +772,7 @@ export default {
         color: #262626;
       }
       p:first-child {
-        font-size: 30px;
+        font-size: 28px;
         margin-bottom: 10px;
         color: #262626;
       }

+ 1 - 1
pingpu_vue/src/page/cbd/Cbd.vue

@@ -224,7 +224,7 @@
               style="width: 200px"
             ></el-input>
           </el-form-item>
-          <el-form-item label="设备开关" prop="ds">
+          <el-form-item label="设备开关:" prop="ds">
             <el-select v-model="equipContrlForm.ds" size="mini">
               <el-option label="开机" :value="1"></el-option>
               <el-option label="关机" :value="0"></el-option>

+ 6 - 1
pingpu_vue/src/page/cbd/analyse.vue

@@ -198,7 +198,7 @@
         @current-change="currentchange"
       >
       </el-pagination> -->
-      <div class="pagination">
+      <div class="pagination" v-if="pageloading">
         <el-pagination
           background
           layout="prev, pager, next,sizes,jumper"
@@ -282,6 +282,7 @@ export default {
       timeloading: false,
       d_idtf: true,
       length: 6,
+      pageloading:false
     };
   },
   //监听属性 类似于data概念
@@ -871,6 +872,7 @@ export default {
     },
     //图像溯源
     getImagesource() {
+      this.pageloading = false
       this.$axios({
         method: "post",
         url: "/api/api_gateway?method=forecast.worm_lamp.pest_image_source",
@@ -885,6 +887,7 @@ export default {
           page_size: this.page_size,
         }),
       }).then((res) => {
+        this.pageloading = true
         if (res.data.message == "") {
           if (res.data.data) {
             console.log(res.data.data.pest_image_data);
@@ -908,6 +911,7 @@ export default {
     },
     //图像溯源
     getworminfotable() {
+      this.pageloading = false
       this.$axios({
         method: "post",
         url: "/api/api_gateway?method=forecast.worm_lamp.pest_base_data",
@@ -922,6 +926,7 @@ export default {
           page_size: this.page_size,
         }),
       }).then((res) => {
+        this.pageloading = true
         if (res.data.message == "") {
           if (res.data.data) {
             console.log(res.data.data.pest_image_data);

+ 1 - 3
pingpu_vue/src/page/cbd/cbdDataPhotos.vue

@@ -3,7 +3,7 @@
   <div class="photosbox">
     <div class="baselistbox_top">
       <div class="baselistbox_top_title">
-        <p @click="backtrack">
+        <p @click="backtrack" style="cursor: pointer">
           <i class="el-icon-back"></i>
           <span>返回</span>
         </p>
@@ -3403,8 +3403,6 @@ export default {
           font-size: 11.5px;
           text-align: left;
           margin: 1px 0 0 3px;
-          .result_listBox_circle {
-          }
           .result_listBox_sum {
             line-height: 22px;
           }

+ 2 - 1
pingpu_vue/src/page/fault/faultinfo.vue

@@ -119,7 +119,7 @@
     </viewer>
     <el-dialog title="故障视频" :visible.sync="videodialogVisible" width="35%">
       <div>
-        <video width="100%" :src="$http + videosrc" controls autoplay></video>
+        <video width="100%" :src="videosrc" controls autoplay></video>
       </div>
     </el-dialog>
   </div>
@@ -236,6 +236,7 @@ export default {
       if (videosrc != "") {
         this.videosrc = videosrc;
         this.videodialogVisible = true;
+        console.log(this.videosrc)
       }
     },
     inited(viewer) {

+ 24 - 6
pingpu_vue/src/page/gis/gisshow.vue

@@ -25,13 +25,13 @@
           <span>{{ alreadyhave.area_addr[2] }}</span>
         </p>
         <p>
-          <i class="iconfont icon-zongmianji"></i> 基地面积:{{
+          <i class="iconfont icon-zongmianji" style="color:#999;font-size:14px;"></i> 基地面积:{{
             alreadyhave.base_area
           }}
         </p>
         <p>
-          <i class="iconfont icon-dikuaishuliang"></i> 地块数量:{{
+          <i class="iconfont icon-dikuaishuliang" style="color:#999;font-size:14px;"></i> 地块数量:{{
             faclist.length
           }}
@@ -367,8 +367,9 @@
             <p v-else>无</p>
           </div>
           <div style="display: flex" v-if="factypa == 7">
+            <p>预警信息:</p>
             <p v-if="detailsdata.warning_info.title">
-              预警信息:{{ detailsdata.warning_info.title }}
+              {{ detailsdata.warning_info.title }}
               {{ detailsdata.warning_info.describe }}
             </p>
             <p v-else>无</p>
@@ -423,6 +424,7 @@ export default {
       },
       listloading: false,
       infoloading: false,
+      player:null
     };
   },
   //监听属性 类似于data概念
@@ -435,6 +437,11 @@ export default {
     basetype2(val) {
       this.getdevlist();
     },
+    dialogVisible(val){
+      if(!val && this.player){
+        this.player.stop()
+      }
+    }
   },
   //方法集合
   methods: {
@@ -787,6 +794,7 @@ export default {
           setTimeout(() => {
             let player = new EZUIKit.EZUIPlayer(myPlayer);
             player.play();
+            this.player = player
           }, 1000);
         }
       });
@@ -816,6 +824,12 @@ export default {
   #mapbox {
     width: 100%;
     height: 100%;
+    /deep/.amap-logo {
+      display: none !important;
+    }
+    /deep/.amap-copyright {
+      display: none !important;
+    }
   }
   .baseslistbox {
     position: absolute;
@@ -836,14 +850,17 @@ export default {
           width: 100%;
           .el-input__inner {
             border: 0;
-            font-size: 30px;
+            font-size: 28px;
             padding: 0;
           }
+          .el-select__caret{
+            color: #000;
+          }
         }
       }
       p {
         font-size: 14px;
-        margin-bottom: 8px;
+        margin-bottom: 12px;
         overflow: hidden; //溢出隐藏
         white-space: nowrap; //禁止换行
         text-overflow: ellipsis; //...
@@ -873,7 +890,8 @@ export default {
           background-color: #ecf5ff;
           padding: 10px;
           box-sizing: border-box;
-          margin-top: 10px;
+          margin-top: 14px;
+          border-radius: 4px;
           p {
             font-size: 14px;
             color: #262626;

+ 8 - 1
pingpu_vue/src/page/home/Home.vue

@@ -66,9 +66,16 @@
 
         <div class="weather04">
           <div class="message">
+            <div class="notice">
+              <img
+                src="../../assets/images/home/home03/ICON/jinggao.png"
+                alt=""
+              />
+              <section>天气预警</section>
+            </div>
             <p>
               {{
-                air_tips == null || air_tips == "" ? "暂无天气信息" : air_tips
+                message == null || message == "" ? "暂无预警信息" : message
               }}
             </p>
           </div>

+ 1 - 1
pingpu_vue/src/page/index/index.vue

@@ -4,7 +4,7 @@
     <div class="projectbox_top">
       <div class="projectbox_top_left">
         <img src="../../../static/images/index/logo.png" alt="" />
-        <p>智慧社区管理平台</p>
+        <p>病虫害监测系统</p>
       </div>
       <div class="projectbox_top_right">
         <div class="lingdangbox">

+ 11 - 0
pingpu_vue/src/page/join/feng.json

@@ -0,0 +1,11 @@
+{
+    "N": "北",
+    "NE": "东北",
+    "E": "东",
+    "SE": "东南",
+    "S": "南",
+    "SW": "西南",
+    "W": "西",
+    "NW": "西北",
+    "C": "静风"
+}

+ 371 - 0
pingpu_vue/src/page/join/joincbd.vue

@@ -0,0 +1,371 @@
+<!--  -->
+<template>
+  <div class="cbdbox">
+    <div class="baselistbox_top">
+      <div class="baselistbox_top_title">
+        <p>查看图片</p>
+      </div>
+      <p class="baselistbox_top_line"></p>
+      <div class="baselistbox_top_search">
+        <div class="left_search">
+          <div class="secsearch">
+            <el-select
+              v-model="device_id"
+              size="mini"
+              filterable
+              placeholder="请选择"
+              @change="idchange"
+            >
+              <el-option
+                v-for="item in options"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+          </div>
+        </div>
+        <div class="right_search">
+          <div
+            :class="timeindex == 1 ? 'timebtn timebtn1' : 'timebtn timebtn2'"
+            @click="empty(1)"
+          >
+            近一天
+          </div>
+          <div
+            :class="timeindex == 2 ? 'timebtn timebtn1' : 'timebtn timebtn2'"
+            @click="empty(2)"
+          >
+            近七天
+          </div>
+          <div
+            :class="timeindex == 3 ? 'timebtn timebtn1' : 'timebtn timebtn2'"
+            @click="empty(3)"
+          >
+            近一月
+          </div>
+          <div
+            :class="timeindex == 4 ? 'timebtn timebtn1' : 'timebtn timebtn2'"
+            @click="empty(4)"
+          >
+            近三月
+          </div>
+          <el-date-picker
+            v-model="time"
+            type="daterange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            size="mini"
+            @change="timechange"
+          >
+          </el-date-picker>
+        </div>
+      </div>
+    </div>
+    <div class="baselistbox_table">
+      <el-row :gutter="10">
+        <el-col
+          :xs="24"
+          :sm="24"
+          :md="12"
+          :lg="4"
+          :xl="4"
+          v-for="(item, index) in baseimglist"
+          :key="index"
+        >
+          <el-card class="box-card" style="margin-bottom: 15px">
+            <img
+              v-lazy="item.thumb_url"
+              alt=""
+              class="img"
+              @click="seeimg(index)"
+            />
+            <p class="imgtime">
+              {{ +new Date(item.create_time) | formatTime }}
+            </p>
+          </el-card>
+        </el-col>
+      </el-row>
+      <div class="none" v-if="!baseimglist.length">
+        <img src="../../../static/images/quexingye.png" alt="" />
+      </div>
+      <div class="pagination">
+        <el-pagination
+          background
+          layout="prev, pager, next,sizes,jumper"
+          :total="totalNum"
+          :page-sizes="[12, 24, 36, 48]"
+          :page-size="12"
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+        >
+        </el-pagination>
+      </div>
+    </div>
+    <viewer v-show="imageListtstatus" :images="imageListtData" @inited="inited">
+      <img v-for="(src, index) in imageListtData" :src="src" :key="index" />
+    </viewer>
+  </div>
+</template>
+
+<script>
+//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+
+export default {
+  //import引入的组件需要注入到对象中才能使用
+  components: {},
+  data() {
+    //这里存放数据
+    return {
+      options: [],
+      device_id: "",
+      time: "",
+      timeindex: 1,
+      baseimglist: [],
+      totalNum: 12,
+      imageListtData: [],
+      imageListtstatus: false,
+      imgIndexNumber: 0,
+      end_time: "",
+      start_time: "",
+      page: "1",
+      page_size: "12",
+    };
+  },
+  //监听属性 类似于data概念
+  computed: {},
+  //监控data中的数据变化
+  watch: {},
+  //方法集合
+  methods: {
+    getbaselist() {
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=device.device_picture.pp_device_list",
+        data: this.qs.stringify({
+          device_type: 3,
+          page: "1",
+          page_size: "9999999",
+        }),
+      }).then((res) => {
+        console.log(res);
+        if (res.data.message == "") {
+          var data = res.data.data.data;
+          for (let i = 0; i < data.length; i++) {
+            var obj = {
+              value: data[i].device_id,
+              label: data[i].device_name + "/" + data[i].device_id,
+            };
+            this.options.push(obj);
+          }
+          this.device_id = data[0].device_id;
+          this.getbaseimglist();
+        }
+      });
+    },
+    empty(index) {
+      this.timeindex = index;
+      this.end_time = Math.floor(+new Date() / 1000);
+      var time = new Date();
+      if (index == 1) {
+        this.start_time = this.end_time - 24 * 60 * 60;
+      } else if (index == 2) {
+        this.start_time = this.end_time - 7 * 24 * 60 * 60;
+      } else if (index == 3) {
+        var mouth = time.getMonth();
+        this.start_time = Math.floor(time.setMonth(mouth - 1) / 1000);
+        // console.log(time2)
+      } else if (index == 4) {
+        var mouth = time.getMonth();
+        this.start_time = Math.floor(time.setMonth(mouth - 3) / 1000);
+      }
+      this.getbaseimglist();
+    },
+    timechange(e) {
+      if (e) {
+        this.start_time = Math.floor(+new Date(e[0]) / 1000);
+        this.end_time = Math.floor(+new Date(e[1]) / 1000);
+        this.page = 1;
+        this.getbaseimglist();
+      } else {
+        this.empty(1);
+      }
+    },
+    idchange(e) {
+      this.device_id = e;
+      this.page = 1;
+      this.getbaseimglist();
+    },
+    getbaseimglist() {
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=device.device_picture.pp_cbd_img_list",
+        data: this.qs.stringify({
+          device_id: this.device_id,
+          start_time: this.formatTime(this.start_time * 1000),
+          end_time: this.formatTime(this.end_time * 1000),
+          page: this.page,
+          page_size: this.page_size,
+        }),
+      }).then((res) => {
+        if (res.data.message == "") {
+          this.baseimglist = res.data.data.data;
+          this.totalNum = res.data.data.num;
+        } else {
+          this.baseimglist = [];
+          this.totalNum = 12;
+        }
+      });
+    },
+    handleSizeChange(e) {
+      this.page_size = e;
+      this.page = 1;
+      this.getbaseimglist();
+    },
+    handleCurrentChange(e) {
+      this.page = e;
+      this.getbaseimglist();
+    },
+    seeimg(index) {
+      this.$viewer.show();
+      this.imageListtData = [];
+      for (var i = 0; i < this.baseimglist.length; i++) {
+        this.imageListtData.push(this.baseimglist[i].img_url);
+      }
+      this.imgIndexNumber = index;
+    },
+    inited(viewer) {
+      this.$viewer = viewer;
+      this.$viewer.view(this.imgIndexNumber);
+    },
+  },
+  beforeCreate() {}, //生命周期 - 创建之前
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+    this.end_time = Math.floor(+new Date() / 1000);
+    this.start_time = this.end_time - 24 * 60 * 60;
+    this.getbaselist();
+  },
+  beforeMount() {}, //生命周期 - 挂载之前
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {},
+  beforeUpdate() {}, //生命周期 - 更新之前
+  updated() {}, //生命周期 - 更新之后
+  beforeDestroy() {}, //生命周期 - 销毁之前
+  destroyed() {}, //生命周期 - 销毁完成
+  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+<style lang="less" scoped>
+.cbdbox {
+  width: 100%;
+  height: 100%;
+  .baselistbox_top {
+    width: 100%;
+    height: 130px;
+    background-color: #fff;
+    border-radius: 10px;
+    .baselistbox_top_title {
+      width: 100%;
+      height: 65px;
+      display: flex;
+      padding: 20px;
+      box-sizing: border-box;
+      line-height: 25px;
+      justify-content: space-between;
+      p:first-child {
+        font-size: 18px;
+        font-weight: 700;
+      }
+    }
+    .baselistbox_top_line {
+      width: 100%;
+      height: 1px;
+      background-color: #f2f2f2;
+    }
+    .baselistbox_top_search {
+      width: 100%;
+      height: 68px;
+      display: flex;
+      padding: 20px;
+      box-sizing: border-box;
+      line-height: 28px;
+      justify-content: space-between;
+      .left_search {
+        display: flex;
+        .firstsearch,
+        .secsearch {
+          display: flex;
+          margin-right: 40px;
+          /deep/.el-input {
+            width: 240px;
+          }
+          .biaoti {
+            font-size: 14px;
+            margin-right: 20px;
+          }
+        }
+      }
+      .right_search {
+        display: flex;
+        .timebtn {
+          width: 68px;
+          height: 26px;
+          border: 1px solid #4f71ff;
+          text-align: center;
+          border-radius: 3px;
+          font-size: 14px;
+          margin-right: 20px;
+          line-height: 26px;
+          cursor: pointer;
+        }
+        .timebtn1 {
+          background-color: #4f71ff;
+          color: #fff;
+        }
+        .timebtn2 {
+          color: #4f71ff;
+        }
+      }
+    }
+  }
+  .baselistbox_table {
+    width: 100%;
+    // height: calc(100% - 140px);
+    background-color: #fff;
+    margin-top: 10px;
+    padding: 20px;
+    box-sizing: border-box;
+    position: relative;
+    border-radius: 10px;
+    .img {
+      width: 100%;
+    }
+    .imgtime {
+      text-align: center;
+      font-size: 14px;
+      margin-top: 10px;
+    }
+    .none {
+      width: 100%;
+      display: flex;
+      justify-content: space-around;
+    }
+    .pagination {
+      display: flex;
+      justify-content: flex-end;
+      margin-top: 20px;
+      /deep/.el-pager {
+        .active {
+          background-color: #4f71ff !important;
+        }
+      }
+      /deep/.el-input__inner:hover {
+        border-color: #4f71ff;
+      }
+    }
+  }
+}
+</style>

+ 354 - 0
pingpu_vue/src/page/join/joinqxz.vue

@@ -0,0 +1,354 @@
+<!--  -->
+<template>
+  <div class="cbdbox">
+    <div class="baselistbox_top">
+      <div class="baselistbox_top_title">
+        <p>查看图片</p>
+      </div>
+      <p class="baselistbox_top_line"></p>
+      <div class="baselistbox_top_search">
+        <div class="left_search">
+          <div class="secsearch">
+            <el-select
+              v-model="device_id"
+              size="mini"
+              filterable
+              placeholder="请选择"
+              @change="idchange"
+            >
+              <el-option
+                v-for="item in options"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+          </div>
+        </div>
+        <div class="right_search">
+          <div
+            :class="timeindex == 1 ? 'timebtn timebtn1' : 'timebtn timebtn2'"
+            @click="empty(1)"
+          >
+            近一天
+          </div>
+          <div
+            :class="timeindex == 2 ? 'timebtn timebtn1' : 'timebtn timebtn2'"
+            @click="empty(2)"
+          >
+            近七天
+          </div>
+          <div
+            :class="timeindex == 3 ? 'timebtn timebtn1' : 'timebtn timebtn2'"
+            @click="empty(3)"
+          >
+            近一月
+          </div>
+          <div
+            :class="timeindex == 4 ? 'timebtn timebtn1' : 'timebtn timebtn2'"
+            @click="empty(4)"
+          >
+            近三月
+          </div>
+          <el-date-picker
+            v-model="time"
+            type="daterange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            size="mini"
+            @change="timechange"
+          >
+          </el-date-picker>
+        </div>
+      </div>
+    </div>
+    <div class="baselistbox_table">
+      <el-table :data="baseimglist" style="width: 100%">
+        <el-table-column prop="updateTime" label="更新时间" width="180">
+        </el-table-column>
+        <el-table-column prop="devid" label="设备ID" width="180">
+        </el-table-column>
+        <el-table-column prop="air_t" label="空气温度"> </el-table-column>
+        <el-table-column prop="air_rh" label="空气湿度"> </el-table-column>
+        <el-table-column prop="earth_t" label="土壤温度"> </el-table-column>
+        <el-table-column prop="earth_rh" label="土壤湿度"> </el-table-column>
+        <el-table-column prop="wind_o" label="风向">
+          <template slot-scope="scope">
+            <p>{{ fengobj[scope.row.wind_o] }}</p>
+          </template>
+        </el-table-column>
+        <el-table-column prop="wind_speed" label="风速"> </el-table-column>
+        <el-table-column prop="rainfull" label="降雨量"> </el-table-column>
+        <el-table-column prop="vasp" label="蒸发量"> </el-table-column>
+        <el-table-column prop="sunlight" label="光照强度"> </el-table-column>
+        <el-table-column prop="pressure" label="大气压强"> </el-table-column>
+        <el-table-column prop="ec" label="土壤EC值"> </el-table-column>
+        <el-table-column prop="ludian" label="露点温度"> </el-table-column>
+      </el-table>
+      <div class="pagination">
+        <el-pagination
+          background
+          layout="prev, pager, next,sizes,jumper"
+          :total="totalNum"
+          :page-sizes="[10, 20, 30, 40]"
+          :page-size="10"
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+        >
+        </el-pagination>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+import feng from "./feng.json";
+export default {
+  //import引入的组件需要注入到对象中才能使用
+  components: {},
+  data() {
+    //这里存放数据
+    return {
+      options: [],
+      device_id: "",
+      time: "",
+      timeindex: 1,
+      baseimglist: [],
+      totalNum: 12,
+      imgIndexNumber: 0,
+      end_time: "",
+      start_time: "",
+      page: "1",
+      page_size: "10",
+      fengobj:{}
+    };
+  },
+  //监听属性 类似于data概念
+  computed: {},
+  //监控data中的数据变化
+  watch: {},
+  //方法集合
+  methods: {
+    getbaselist() {
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=device.device_picture.pp_device_list",
+        data: this.qs.stringify({
+          device_type: 5,
+          page: "1",
+          page_size: "9999999",
+        }),
+      }).then((res) => {
+        console.log(res);
+        if (res.data.message == "") {
+          var data = res.data.data.data;
+          for (let i = 0; i < data.length; i++) {
+            var obj = {
+              value: data[i].device_id,
+              label: data[i].device_name + "/" + data[i].device_id,
+            };
+            this.options.push(obj);
+          }
+          this.device_id = data[0].device_id;
+          this.getbaseimglist();
+        }
+      });
+    },
+    empty(index) {
+      this.timeindex = index;
+      this.end_time = Math.floor(+new Date() / 1000);
+      var time = new Date();
+      if (index == 1) {
+        this.start_time = this.end_time - 24 * 60 * 60;
+      } else if (index == 2) {
+        this.start_time = this.end_time - 7 * 24 * 60 * 60;
+      } else if (index == 3) {
+        var mouth = time.getMonth();
+        this.start_time = Math.floor(time.setMonth(mouth - 1) / 1000);
+        // console.log(time2)
+      } else if (index == 4) {
+        var mouth = time.getMonth();
+        this.start_time = Math.floor(time.setMonth(mouth - 3) / 1000);
+      }
+      this.getbaseimglist();
+    },
+    timechange(e) {
+      if (e) {
+        this.start_time = Math.floor(+new Date(e[0]) / 1000);
+        this.end_time = Math.floor(+new Date(e[1]) / 1000);
+        this.page = 1;
+        this.getbaseimglist();
+      } else {
+        this.empty(1);
+      }
+    },
+    idchange(e) {
+      this.device_id = e;
+      this.page = 1;
+      this.getbaseimglist();
+    },
+    getbaseimglist() {
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=device.device_picture.pp_qxz_data_list",
+        data: this.qs.stringify({
+          device_id: this.device_id,
+          start_time: this.formatTime(this.start_time * 1000),
+          end_time: this.formatTime(this.end_time * 1000),
+          page: this.page,
+          page_size: this.page_size,
+        }),
+      }).then((res) => {
+        if (res.data.message == "") {
+          this.baseimglist = res.data.data.data;
+          this.totalNum = res.data.data.num;
+        } else {
+          this.baseimglist = [];
+          this.totalNum = 12;
+        }
+      });
+    },
+    handleSizeChange(e) {
+      this.page_size = e;
+      this.page = 1;
+      this.getbaseimglist();
+    },
+    handleCurrentChange(e) {
+      this.page = e;
+      this.getbaseimglist();
+    },
+  },
+  beforeCreate() {}, //生命周期 - 创建之前
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+    this.end_time = Math.floor(+new Date() / 1000);
+    this.start_time = this.end_time - 24 * 60 * 60;
+    this.getbaselist();
+  },
+  beforeMount() {}, //生命周期 - 挂载之前
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {
+    //   console.log(feng["E"])
+      this.fengobj = feng
+  },
+  beforeUpdate() {}, //生命周期 - 更新之前
+  updated() {}, //生命周期 - 更新之后
+  beforeDestroy() {}, //生命周期 - 销毁之前
+  destroyed() {}, //生命周期 - 销毁完成
+  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+<style lang="less" scoped>
+.cbdbox {
+  width: 100%;
+  height: 100%;
+  .baselistbox_top {
+    width: 100%;
+    height: 130px;
+    background-color: #fff;
+    border-radius: 10px;
+    .baselistbox_top_title {
+      width: 100%;
+      height: 65px;
+      display: flex;
+      padding: 20px;
+      box-sizing: border-box;
+      line-height: 25px;
+      justify-content: space-between;
+      p:first-child {
+        font-size: 18px;
+        font-weight: 700;
+      }
+    }
+    .baselistbox_top_line {
+      width: 100%;
+      height: 1px;
+      background-color: #f2f2f2;
+    }
+    .baselistbox_top_search {
+      width: 100%;
+      height: 68px;
+      display: flex;
+      padding: 20px;
+      box-sizing: border-box;
+      line-height: 28px;
+      justify-content: space-between;
+      .left_search {
+        display: flex;
+        .firstsearch,
+        .secsearch {
+          display: flex;
+          margin-right: 40px;
+          /deep/.el-input {
+            width: 240px;
+          }
+          .biaoti {
+            font-size: 14px;
+            margin-right: 20px;
+          }
+        }
+      }
+      .right_search {
+        display: flex;
+        .timebtn {
+          width: 68px;
+          height: 26px;
+          border: 1px solid #4f71ff;
+          text-align: center;
+          border-radius: 3px;
+          font-size: 14px;
+          margin-right: 20px;
+          line-height: 26px;
+          cursor: pointer;
+        }
+        .timebtn1 {
+          background-color: #4f71ff;
+          color: #fff;
+        }
+        .timebtn2 {
+          color: #4f71ff;
+        }
+      }
+    }
+  }
+  .baselistbox_table {
+    width: 100%;
+    // height: calc(100% - 140px);
+    background-color: #fff;
+    margin-top: 10px;
+    padding: 20px;
+    box-sizing: border-box;
+    position: relative;
+    border-radius: 10px;
+    .img {
+      width: 100%;
+    }
+    .imgtime {
+      text-align: center;
+      font-size: 14px;
+      margin-top: 10px;
+    }
+    .none {
+      width: 100%;
+      display: flex;
+      justify-content: space-around;
+    }
+    .pagination {
+      display: flex;
+      justify-content: flex-end;
+      margin-top: 20px;
+      /deep/.el-pager {
+        .active {
+          background-color: #4f71ff !important;
+        }
+      }
+      /deep/.el-input__inner:hover {
+        border-color: #4f71ff;
+      }
+    }
+  }
+}
+</style>

+ 2 - 1
pingpu_vue/src/page/login/login.vue

@@ -5,7 +5,7 @@
       <div class="logininfo">
         <div class="title">
           <p>数字迁安</p>
-          <p>三情监测管理系统</p>
+          <p>病虫害监测系统</p>
         </div>
         <div class="info">
           <el-form
@@ -155,6 +155,7 @@ export default {
         color: #fff;
         border-radius: 8px;
         margin-top: 40px;
+        cursor: pointer;
       }
     }
   }

+ 169 - 43
pingpu_vue/src/page/monitor/Monitor.vue

@@ -47,7 +47,7 @@
         </div>
       </div>
       <div class="nav-box">
-        <div style="width: 240px; height: 30px; margin: 5px 0 5px 0">
+        <div class="inputbox">
           <!-- <div> -->
           <el-autocomplete
             size="mini"
@@ -75,13 +75,7 @@
               :class="['dot', item.status == 1 ? 'onLine' : 'outLine']"
             ></span>
             <!-- <span :title="item.device_id + (item.device_name !== '' ? item.device_name : '暂无设备名称')">{{ item | formatName }}</span> -->
-            <span
-              :title="
-                (item.device_name !== '' ? item.device_name + '/' : '') +
-                item.device_id
-              "
-              >{{ item | formatName }}</span
-            >
+            <span :title="item.device_id">{{ item | formatName }}</span>
             <!--查看图片 v-if="item.photo_num !== '0'" -->
             <div class="viewPhoto">
               <i class="el-icon-picture" @click.stop="viewPhoto(item.d_id)"></i>
@@ -90,6 +84,7 @@
                 @click.stop="toplay(item.device_id)"
                 v-if="item.camera_playback == 1"
               ></i>
+              <i class="el-icon-s-tools" @click.stop="setjk(item)"></i>
             </div>
             <!--  -->
             <!-- <span @click.stop="viewPhoto(item.device_id)" class="viewPhoto"
@@ -164,7 +159,7 @@
             @click="checkPlayType(0)"
             class="playtype0"
           ></div>
-          <!-- <div @click="addEquip()" class="addequip"></div> -->
+          <div @click="addEquip()" class="addequip"></div>
           <!-- <div @click="bindingSIM()" class="addequipA"></div> -->
           <!-- 绑定SIM卡及SIM卡查询 -->
           <!--  <div style="width: 140px; display: flex; margin: 0 auto">
@@ -630,6 +625,73 @@
         </div>
       </div>
     </el-dialog>
+    <el-dialog
+      title="设备控制"
+      :visible.sync="jkcondialogVisible"
+      width="600px"
+      :close-on-click-modal="false"
+    >
+      <div class="jkconbox">
+        <el-form
+          :model="jkconinfo"
+          :rules="rules"
+          ref="ruleForm"
+          label-width="120px"
+          class="demo-ruleForm"
+        >
+          <el-form-item label="设备名称" prop="name">
+            <el-input v-model="jkconinfo.name" size="mini" :maxlength="10"></el-input>
+          </el-form-item>
+          <el-form-item label="设备状态" prop="onoff">
+            <el-radio-group v-model="jkconinfo.onoff">
+              <el-radio label="on">开</el-radio>
+              <el-radio label="off">关</el-radio>
+            </el-radio-group>
+          </el-form-item>
+          <el-form-item label="开始结束时间" v-show="jkconinfo.onoff == 'on'">
+            <el-col :span="11">
+              <el-form-item prop="statetime">
+                <el-time-select
+                  v-model="jkconinfo.statetime"
+                  size="mini"
+                  :picker-options="{
+                    start: '00:00',
+                    step: '01:00',
+                    end: '23:00',
+                  }"
+                  placeholder="选择时间"
+                >
+                </el-time-select>
+              </el-form-item>
+            </el-col>
+            <el-col class="line" :span="2">-</el-col>
+            <el-col :span="11">
+              <el-form-item prop="endtime">
+                <el-time-select
+                  size="mini"
+                  v-model="jkconinfo.endtime"
+                  :picker-options="{
+                    start: '00:00',
+                    step: '01:00',
+                    end: '23:00',
+                  }"
+                  placeholder="选择时间"
+                >
+                </el-time-select>
+              </el-form-item>
+            </el-col>
+          </el-form-item>
+        </el-form>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="jkcondialogVisible = false" size="mini"
+          >取 消</el-button
+        >
+        <el-button size="mini" type="primary" @click="jkprimary"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
   </div>
 </template>
 <script>
@@ -862,45 +924,44 @@ export default {
       monthitortime: null,
       radio: "0",
       loading: false,
+      jkcondialogVisible: false,
+      jkconinfo: {
+        name: "",
+        onoff: "on",
+        statetime: "",
+        endtime: "",
+        device_id: "",
+      },
+      rules: {
+        name: [{ required: true, message: "请输入设备名称", trigger: "blur" }],
+        onoff: [{ required: true, message: "请选择设备状态", trigger: "blur" }],
+      },
     };
   },
   filters: {
     formatName: function (value) {
-      //设备名字
-      // if (!value) return "";
-      // if (value.equip_name) {
-      //   if (value.equip_name.length > 5) {
-      //     return value.equip_name.slice(0, 5) + "...";
-      //   }
-      //   return value.equip_name;
-      // } else {
-      //   if (value.device_id.length > 5) {
-      //     return value.device_id.slice(0, 5) + "...";
-      //   }
-      //   return value.device_id;
-      // }
-
-      // -----------------------------------------------------------
       if (!value) return "";
       if (value.device_name) {
-        if (value.device_name.length > 10) {
-          value.device_name.slice(0, 10) + "...";
+        if (value.device_name.length > 20) {
+          value.device_name.slice(0, 20) + "...";
         }
       }
-      if (value.device_id.length > 10) {
-        value.device_id.slice(0, 10) + "...";
+      if (value.device_id.length > 30) {
+        value.device_id.slice(0, 30) + "...";
       }
       // var item =
       //   (value.device_name !== ""
       //     ? value.device_name
       //     : "暂无设备名称") + "/" + value.device_id;
-      var item =
-        (value.device_name !== "" ? value.device_name + "/" : "") +
-        value.device_id;
-      // console.log(item)
+      var item = "";
+      if (value.device_name != "") {
+        item = value.device_name;
+      } else {
+        item = value.device_id;
+      }
       console.log(value.device_name + "/" + value.device_id);
-      if (item.length > 10) {
-        var name = item.slice(0, 10) + "...";
+      if (item.length > 20) {
+        var name = item.slice(0, 20) + "...";
       } else {
         var name = item;
       }
@@ -1775,6 +1836,47 @@ export default {
     toplay(id) {
       this.$router.push("/index/playback?id=" + id);
     },
+    setjk(data) {
+      console.log(data);
+      this.jkcondialogVisible = true;
+      this.jkconinfo.name = data.device_name;
+      this.jkconinfo.device_id = data.device_id;
+      this.jkconinfo.onoff = data.off_on;
+      this.jkconinfo.statetime = data.status_time;
+      this.jkconinfo.endtime = data.end_time;
+    },
+    jkprimary() {
+      this.$refs["ruleForm"].validate((valid) => {
+        if (valid) {
+          this.$axios({
+            method: "POST",
+            url: "/api/api_gateway?method=camera.camera_manage.camera_config",
+            data: this.qs.stringify({
+              device_id: this.jkconinfo.device_id,
+              start_time: this.jkconinfo.statetime,
+              end_time: this.jkconinfo.endtime,
+              off_on: this.jkconinfo.onoff,
+              device_name: this.jkconinfo.name,
+            }),
+          }).then((res) => {
+            console.log(res);
+            if (res.data.data) {
+              if (document.getElementsByClassName("el-message").length == 0) {
+                this.$message.success("指令下发成功");
+              }
+              this.jkcondialogVisible = false;
+            } else {
+              if (document.getElementsByClassName("el-message").length == 0) {
+                this.$message.error(res.data.message);
+              }
+            }
+          });
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
   },
   watch: {
     // 添加设备弹框
@@ -1845,8 +1947,9 @@ li {
     background: #323a47;
     flex: 1;
     .video-box {
-      flex: 1;
+      // flex: 1;
       padding: 10px 10px 0 10px;
+      width: 75%;
       .video-container {
         width: 100%;
         height: calc(100% - 47px);
@@ -1910,10 +2013,20 @@ li {
       }
     }
     .nav-box {
-      width: 240px;
+      width: 24%;
       background: #474e60;
       color: #fff;
       font-size: 14px;
+      .inputbox {
+        width: 100%;
+        height: 30px;
+        margin: 5px 0px;
+        padding: 10px;
+        box-sizing: border-box;
+        /deep/.el-autocomplete{
+          width: 100%;
+        }
+      }
       .viewLists {
         height: 50%;
         overflow: auto;
@@ -1928,11 +2041,7 @@ li {
             float: right;
             font-size: 18px;
             cursor: pointer;
-            // margin: 12px 0 0 0;
           }
-          // .viewPhoto:hover {
-          //   text-decoration: underline;
-          // }
           .dot {
             display: inline-block;
             width: 7px;
@@ -1971,7 +2080,7 @@ li {
       .direc {
         text-align: center;
         width: 100%;
-        height: 20%;
+        height: 180px;
         margin: 5% 0 5% 0;
         position: relative;
         background: url(../../assets/images/forecasting/monitor/direction-btn.png)
@@ -1995,12 +2104,12 @@ li {
         }
         .leftCtr {
           top: 50%;
-          left: 28px;
+          left: 112px;
           margin-top: -25px;
         }
         .rightCtr {
           top: 50%;
-          right: 28px;
+          right: 118px;
           margin-top: -25px;
         }
         .cameraCtr {
@@ -2126,4 +2235,21 @@ li {
     color: #4f71ff;
   }
 }
+.jkconbox {
+  /deep/.el-input {
+    width: 423px !important;
+  }
+  /deep/.el-date-editor {
+    width: 180px !important;
+  }
+  /deep/.is-checked {
+    .el-radio__inner {
+      border-color: #4f71ff !important;
+      background: #4f71ff !important;
+    }
+    .el-radio__label {
+      color: #4f71ff !important;
+    }
+  }
+}
 </style>

+ 1 - 1
pingpu_vue/src/page/qxz/Data24.vue

@@ -3,7 +3,7 @@
   <div class="data24box">
     <div class="baselistbox_top">
       <div class="baselistbox_top_title">
-        <p @click="backtrack">
+        <p @click="backtrack" style="cursor: pointer">
           <i class="el-icon-back"></i>
           <span>返回</span>
         </p>

+ 231 - 36
pingpu_vue/src/page/qxz/HistoryData.vue

@@ -3,7 +3,7 @@
   <div class="hisbox">
     <div class="baselistbox_top">
       <div class="baselistbox_top_title">
-        <p @click="backtrack">
+        <p @click="backtrack" style="cursor: pointer">
           <i class="el-icon-back"></i>
           <span>返回</span>
         </p>
@@ -12,31 +12,43 @@
       <p class="baselistbox_top_line"></p>
       <div class="baselistbox_top_search">
         <div class="search_left">
-          <div class="timebtn" @click="deriveData">导出</div>
-          <div class="timebtn" @click="refresh">刷新</div>
+          <div
+            :class="tabtable == 1 ? 'timebtn timebtn1' : 'timebtn timebtn2'"
+            @click="tabtable = 1"
+          >
+            表格
+          </div>
+          <div
+            :class="tabtable == 2 ? 'timebtn timebtn1' : 'timebtn timebtn2'"
+            @click="tabtable = 2"
+          >
+            图表
+          </div>
+          <div class="timebtn timebtn1" @click="deriveData">导出</div>
+          <div class="timebtn timebtn1" @click="refresh">刷新</div>
         </div>
         <div class="search_right">
           <div
             :class="timeindex == 1 ? 'timebtn timebtn1' : 'timebtn timebtn2'"
-            @click="empty(1),flag = true;"
+            @click="empty(1), (flag = true)"
           >
             近一天
           </div>
           <div
             :class="timeindex == 2 ? 'timebtn timebtn1' : 'timebtn timebtn2'"
-            @click="empty(2),flag = true;"
+            @click="empty(2), (flag = true)"
           >
             近七天
           </div>
           <div
             :class="timeindex == 3 ? 'timebtn timebtn1' : 'timebtn timebtn2'"
-            @click="empty(3),flag = true;"
+            @click="empty(3), (flag = true)"
           >
             近一月
           </div>
           <div
             :class="timeindex == 4 ? 'timebtn timebtn1' : 'timebtn timebtn2'"
-            @click="empty(4),flag = true;"
+            @click="empty(4), (flag = true)"
           >
             近三月
           </div>
@@ -54,31 +66,50 @@
       </div>
     </div>
     <div class="baselistbox_table">
-      <el-table :data="hisData" stripe style="width: 100%" height="530">
-        <el-table-column
-          v-for="(item, index) in tableHead"
-          :key="index"
-          width="160px"
-          :label="item.label"
-          :prop="item.property"
-        >
-          <template slot-scope="scope">{{
-            scope.row[scope.column.property]
-          }}</template>
-        </el-table-column>
-        <el-table-column label="" prop=""></el-table-column>
-      </el-table>
-      <div class="pagination">
-        <el-pagination
-          background
-          layout="prev, pager, next,sizes,jumper"
-          :total="totalNum"
-          :page-sizes="[10, 20, 30, 50]"
-          :page-size="10"
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-        >
-        </el-pagination>
+      <div v-show="tabtable == 1">
+        <el-table :data="hisData" stripe style="width: 100%" height="530">
+          <el-table-column
+            v-for="(item, index) in tableHead"
+            :key="index"
+            width="160px"
+            :label="item.label"
+            :prop="item.property"
+          >
+            <template slot-scope="scope">{{
+              scope.row[scope.column.property]
+            }}</template>
+          </el-table-column>
+          <el-table-column label="" prop=""></el-table-column>
+        </el-table>
+        <div class="pagination">
+          <el-pagination
+            background
+            layout="prev, pager, next,sizes,jumper"
+            :total="totalNum"
+            :page-sizes="[10, 20, 30, 50]"
+            :page-size="10"
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+          >
+          </el-pagination>
+        </div>
+      </div>
+      <div v-show="tabtable == 2">
+        <el-row :gutter="10">
+          <el-col
+            :xs="24"
+            :sm="24"
+            :md="12"
+            :lg="6"
+            :xl="6"
+            v-for="(item, index) in echartOptions"
+            :key="index"
+          >
+            <el-card class="box-card" style="margin-bottom:15px;">
+              <highcharts :options="item"></highcharts>
+            </el-card>
+          </el-col>
+        </el-row>
       </div>
     </div>
     <!-- 导出对话框 -->
@@ -134,7 +165,7 @@
 
 <script>
 //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
-
+import Highcharts from "highcharts";
 export default {
   //import引入的组件需要注入到对象中才能使用
   components: {},
@@ -164,6 +195,8 @@ export default {
         },
       ],
       flag: false,
+      tabtable: 1,
+      echartOptions: [],
     };
   },
   //监听属性 类似于data概念
@@ -193,15 +226,17 @@ export default {
       }
       console.log(this.start_time);
       this.getHisDataList();
+      this.getEchartsHisDataList()
     },
     timechange(e) {
       console.log(e);
-      this.flag = true
+      this.flag = true;
       if (e) {
         this.start_time = Math.floor(+new Date(e[0]) / 1000);
         this.end_time = Math.floor(+new Date(e[1]) / 1000);
         this.page = 1;
         this.getHisDataList();
+        this.getEchartsHisDataList()
       } else {
         this.empty(1);
       }
@@ -236,7 +271,7 @@ export default {
         window.location.href =
           this.$http +
           "/api/qxz_data_export?device_id=" +
-          that.queryInfo.device_id +
+          this.$route.params.id +
           "&filename=" +
           that.value +
           "&begin=" +
@@ -270,6 +305,7 @@ export default {
           // this.$message.success("刷新成功");
           setTimeout(() => {
             this.getHisDataList();
+            this.getEchartsHisDataList()
             // this.refreshload = false;
           }, 2000);
         } else {
@@ -372,6 +408,159 @@ export default {
       this.page = e;
       this.getHisDataList();
     },
+    //获取图表历史数据
+    getEchartsHisDataList() {
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=weather.weather.qxz_data_chart",
+        data: this.qs.stringify({
+          begin: this.start_time,
+          end: this.end_time,
+          device_id: this.$route.params.id,
+        }),
+      })
+        .then((res) => {
+          console.log(res.data.data);
+          this.echartsFn(res.data.data);
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    },
+    echartsFn(data) {
+      let conf = data.conf;
+      let eData = data.data;
+      let ChartData = [];
+      console.log(conf);
+      console.log(eData);
+      console.log(eData.length);
+      if (conf && eData && eData.length > 0) {
+        this.isEchartData = true;
+        for (let i in conf) {
+          if (conf[i]) {
+            //判断是否有值
+            ChartData.push({
+              name: i,
+              tit: conf[i].split("#")[0],
+              unit: conf[i].split("#")[1],
+              dat: [],
+            });
+          }
+        }
+        for (let m of eData) {
+          //m是对象
+          for (let n in m.dat) {
+            //dat是对象 n是key
+            for (let j of ChartData) {
+              //j是对象
+              if (j.name == n && m.dat[n].split("#")[0] != "-99.99") {
+                j.dat.push([
+                  m.time * 1000 + 8 * 3600000,
+                  Number(m.dat[n].split("#")[0]),
+                ]);
+              }
+            }
+          }
+        }
+      } else {
+        this.isEchartData = false;
+      }
+      console.log(ChartData);
+
+      // 判断是否有数据
+      if (ChartData.length !== 0) {
+        this.isEchartData = true;
+        this.echartOptions = ChartData.map((item) => {
+          return this.OptionFn(item);
+        });
+      } else {
+        this.isEchartData = false;
+      }
+    },
+    OptionFn(item) {
+      return {
+        title: {
+          text: item.tit,
+          align: "left",
+        },
+        lang: {
+          noData: "暂无数据",
+        },
+        noData: {
+          style: {
+            fontWeight: "bold",
+            fontSize: "15px",
+            color: "#303030",
+          },
+        },
+        xAxis: {
+          crosshair: true, //十字基准线
+          type: "datetime",
+          dateTimeLabelFormats: {
+            //根据时间间距X轴自动显示哪种格式
+            millisecond: "%H:%M:%S.%L",
+            second: "%H:%M:%S",
+            minute: "%H:%M",
+            hour: "%H:%M",
+            day: "%m-%d",
+            week: "%m-%d",
+            month: "%Y-%m",
+            year: "%Y",
+          },
+        },
+        yAxis: {
+          title: { text: "" },
+        },
+        legend: {
+          // layout: 'vertical',
+          align: "right",
+          verticalAlign: "top",
+        },
+        plotOptions: {
+          series: {
+            label: {
+              connectorAllowed: false,
+            },
+            pointStart: 2010, //该参数定义了数据点的起点
+          },
+        },
+        series: [
+          {
+            name: item.name,
+            data: item.dat,
+          },
+        ],
+        colors: ["#00e29d", "#6cbbff", "#ff3f3f"],
+        credits: {
+          //去掉默认的highcharts.com
+          enabled: false,
+        },
+        tooltip: {
+          // crosshairs: true,
+          shared: true, //折线共享
+          headerFormat: "<b>{point.x:%Y-%m-%e %H:%M:%S}</b><br>",
+          pointFormatter: function () {
+            return item.tit + ":" + this.y + item.unit;
+          },
+        },
+        responsive: {
+          rules: [
+            {
+              condition: {
+                maxWidth: 500,
+              },
+              chartOptions: {
+                legend: {
+                  layout: "horizontal",
+                  align: "center",
+                  verticalAlign: "bottom",
+                },
+              },
+            },
+          ],
+        },
+      };
+    },
   },
   beforeCreate() {}, //生命周期 - 创建之前
   //生命周期 - 创建完成(可以访问当前this实例)
@@ -379,6 +568,7 @@ export default {
     this.end_time = Math.floor(+new Date() / 1000);
     this.start_time = this.end_time - 24 * 60 * 60;
     this.getHisDataList();
+    this.getEchartsHisDataList()
   },
   beforeMount() {}, //生命周期 - 挂载之前
   //生命周期 - 挂载完成(可以访问DOM元素)
@@ -439,9 +629,14 @@ export default {
           font-size: 14px;
           margin-right: 20px;
           line-height: 26px;
+          cursor: pointer;
+        }
+        .timebtn1 {
           background-color: #4f71ff;
           color: #fff;
-          cursor: pointer;
+        }
+        .timebtn2 {
+          color: #4f71ff;
         }
       }
       .search_right {

+ 3 - 2
pingpu_vue/src/page/specialist/specialist.vue

@@ -1,11 +1,12 @@
 <!--  -->
 <template>
   <div class="speciabox">
-    <iframe
+    <!-- <iframe
       :src="`http://103.89.185.161:3010/#/start?token=`+keys+`&code=zhwd`"
       frameborder="0"
       class="iframe"
-    ></iframe>
+    ></iframe> -->
+    <iframe src="http://192.168.1.14:8003/#/index/home?token=55555555555555" frameborder="0" class="iframe"></iframe>
   </div>
 </template>
 

+ 1 - 1
pingpu_vue/src/page/sqz/Data24.vue

@@ -3,7 +3,7 @@
   <div class="data24box">
     <div class="baselistbox_top">
       <div class="baselistbox_top_title">
-        <p @click="backtrack">
+        <p @click="backtrack" style="cursor: pointer">
           <i class="el-icon-back"></i>
           <span>返回</span>
         </p>

+ 1 - 1
pingpu_vue/src/page/sqz/HistoryData.vue

@@ -3,7 +3,7 @@
   <div class="hisbox">
     <div class="baselistbox_top">
       <div class="baselistbox_top_title">
-        <p @click="backtrack">
+        <p @click="backtrack" style="cursor: pointer">
           <i class="el-icon-back"></i>
           <span>返回</span>
         </p>

+ 1 - 1
pingpu_vue/src/page/user/userlist.vue

@@ -3,7 +3,7 @@
   <div class="userbox">
     <div class="baselistbox_top">
       <div class="baselistbox_top_title">
-        <p>虫情监测</p>
+        <p>用户管理</p>
       </div>
       <p class="baselistbox_top_line"></p>
       <div class="baselistbox_top_search">

+ 19 - 11
pingpu_vue/src/router/index.js

@@ -53,7 +53,9 @@ import gisshow from '../../src/page/gis/gisshow.vue'
 import userlist from '../../src/page/user/userlist.vue'
 //专家
 import specialist from '../../src/page/specialist/specialist.vue'
-
+//接入设备
+import joincbd from '../../src/page/join/joincbd.vue'
+import joinqxz from '../../src/page/join/joinqxz.vue'
 Vue.use(Router)
 
 export default new Router({
@@ -168,32 +170,38 @@ export default new Router({
         }, {
           path: "plotlist",
           component: plotlist
-        },{
+        }, {
           path: "maphandle",
           component: maphandle
-        },{
+        }, {
           path: "maofacility",
           component: maofacility
-        },{
+        }, {
           path: "mapplot",
           component: mapplot
-        },{
+        }, {
           path: "earlywarning",
           component: earlywarning
-        },{
+        }, {
           path: "faultinfo",
           component: faultinfo
-        },
-        {
+        }, {
           path: "gisshow",
           component: gisshow
-        },{
+        }, {
           path: "userlist",
           component: userlist
-        },{
+        }, {
           path: "specialist",
           component: specialist
-        }
+        }, {
+          path: "joinqxz",
+          component: joinqxz
+        }, {
+          path: "joincbd",
+          component: joincbd
+        },
+
       ]
     }
   ]

+ 41 - 41
pingpu_vue/src/util/formatTime.js

@@ -1,44 +1,44 @@
 import Vue from 'vue'
 Vue.filter('formatTime', function (thistime, fmt = 'yyyy-MM-dd hh:mm:ss') {
-      let $this = new Date(thistime)
-      let o = {
-        'M+': $this.getMonth() + 1,
-        'd+': $this.getDate(),
-        'h+': $this.getHours(),
-        'm+': $this.getMinutes(),
-        's+': $this.getSeconds(),
-        'q+': Math.floor(($this.getMonth() + 3) / 3),
-        'S': $this.getMilliseconds()
-      }
-      if (/(y+)/.test(fmt)) {
-        fmt = fmt.replace(RegExp.$1, ($this.getFullYear() + '').substr(4 - RegExp.$1.length))
-      }
-      for (var k in o) {
-        if (new RegExp('(' + k + ')').test(fmt)) {
-          fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
-        }
-      }
-      return fmt
-    })
+  let $this = new Date(thistime)
+  let o = {
+    'M+': $this.getMonth() + 1,
+    'd+': $this.getDate(),
+    'h+': $this.getHours(),
+    'm+': $this.getMinutes(),
+    's+': $this.getSeconds(),
+    'q+': Math.floor(($this.getMonth() + 3) / 3),
+    'S': $this.getMilliseconds()
+  }
+  if (/(y+)/.test(fmt)) {
+    fmt = fmt.replace(RegExp.$1, ($this.getFullYear() + '').substr(4 - RegExp.$1.length))
+  }
+  for (var k in o) {
+    if (new RegExp('(' + k + ')').test(fmt)) {
+      fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
+    }
+  }
+  return fmt
+})
 
-    Vue.prototype.formatTime = function (thistime,fmt = 'yyyy-MM-dd hh:mm:ss') {
-        let $this = new Date(thistime)
-        let o = {
-          'M+': $this.getMonth() + 1,
-          'd+': $this.getDate(),
-          'h+': $this.getHours(),
-          'm+': $this.getMinutes(),
-          's+': $this.getSeconds(),
-          'q+': Math.floor(($this.getMonth() + 3) / 3),
-          'S': $this.getMilliseconds()
-        }
-        if (/(y+)/.test(fmt)) {
-          fmt = fmt.replace(RegExp.$1, ($this.getFullYear() + '').substr(4 - RegExp.$1.length))
-        }
-        for (var k in o) {
-          if (new RegExp('(' + k + ')').test(fmt)) {
-            fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
-          }
-        }
-        return fmt
-      }
+Vue.prototype.formatTime = function (thistime, fmt = 'yyyy-MM-dd hh:mm:ss') {
+  let $this = new Date(thistime)
+  let o = {
+    'M+': $this.getMonth() + 1,
+    'd+': $this.getDate(),
+    'h+': $this.getHours(),
+    'm+': $this.getMinutes(),
+    's+': $this.getSeconds(),
+    'q+': Math.floor(($this.getMonth() + 3) / 3),
+    'S': $this.getMilliseconds()
+  }
+  if (/(y+)/.test(fmt)) {
+    fmt = fmt.replace(RegExp.$1, ($this.getFullYear() + '').substr(4 - RegExp.$1.length))
+  }
+  for (var k in o) {
+    if (new RegExp('(' + k + ')').test(fmt)) {
+      fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
+    }
+  }
+  return fmt
+}

pingpu_vue/static/images/home/环境监测.png → pingpu_vue/static/images/home/气象监测.png