소스 검색

合并更新

dingdang01 2 년 전
부모
커밋
6e49b9725c

+ 10 - 3
pingpu_vue/config/index.js

@@ -11,18 +11,25 @@ module.exports = {
     assetsPublicPath: '/',
     proxyTable: {
       '/api': {
-        // target: 'http://192.168.1.77:8003', //曹世祥本地服务
         target: ' http://106.119.196.18:10004', //线上
-        // target: 'http://192.168.1.52:8005',
         changeOrigin: true,
         pathRewrite: {
           '^/api': '/api' //重写接口
         }
       },
+      '/baoziyi': { // 孢子仪后台地址,请求时地址以baoziyi开头,就会走下面的地址。
+        target: ' http://106.119.196.18:7005', // 生产
+        // target: ' http://103.89.185.87:7005', // 测试
+        // target: ' http://localhost:7005',
+        changeOrigin: true,
+        pathRewrite: {
+          '^/baoziyi': '/baoziyi' //重写接口
+        }
+      }
     },
 
     // Various Dev Server settings
-    host: '192.168.1.14', // can be overwritten by process.env.HOST
+    host: '192.168.151.95', // can be overwritten by process.env.HOST
     port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
     autoOpenBrowser: false,
     errorOverlay: true,

+ 5 - 2
pingpu_vue/index.html

@@ -49,8 +49,11 @@
   </script>
   <script
     src="https://webapi.amap.com/maps?v=2.0&key=c907b4265ae043cbdbf64304f1f80b2b&plugin=AMap.PolygonEditor,AMap.MarkerClusterer,AMap.DistrictSearch"></script>
-  <script src="https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/js/ezuikit.js"></script>
-  <script src="https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/js/jsencrypt.min.js"></script>
+  <!-- <script src="https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/js/ezuikit.js"></script> -->
+  <script src="https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/js/ezuikit.js" integrity="sha384-c04Hx/aw5tjO2+wOkP0qgfBIDSsOde7j/NMmkkZhsRN1oR5uGPb8/JPGGgqqfDu8" crossorigin="anonymous"></script>
+  <!-- <script src="https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/js/jsencrypt.min.js"></script>
+   -->
+   <script src="https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/js/jsencrypt.min.js" integrity="sha384-um7kEhiTTYAZgvwNbwMpjPLGNzw2e3iHdjr2CKg/vGkH6o3M7z8Y4+CvLaCeI9pe" crossorigin="anonymous"></script>
   <script src="./static/imouplayer.js"></script>
 </body>
 

+ 49 - 14
pingpu_vue/src/page/bzy/BzyPhotos.vue

@@ -15,12 +15,12 @@
         </div>
         <div class="check-btns">
           <div class="type-check">
-            <el-button type="primary" size="mini" @click="equipStatusCheck('0')"
+            <!--<el-button type="primary" size="mini" @click="equipStatusCheck('0')"
               >拍照</el-button
             >
             <el-button type="primary" size="mini" @click="equipStatusCheck('1')"
               >刷新</el-button
-            >
+            >-->
             <template>
               <el-button
                 v-if="delBtnState"
@@ -71,6 +71,12 @@
                 class="quxiao"
                 >取消</el-button
               >
+              <el-button
+                size="mini"
+                @click="tosuggest"
+                class="primary"
+              >专家建议</el-button
+              >
             </template>
           </div>
           <div class="search-box">
@@ -83,6 +89,7 @@
               clearable
               start-placeholder="开始日期"
               end-placeholder="结束日期"
+              :default-time="['00:00:00', '23:59:59']"
               @change="DateChange"
             ></el-date-picker>
           </div>
@@ -101,7 +108,7 @@
           :lg="6"
           :xl="6"
           v-for="item in photoList"
-          :key="item.addr"
+          :key="item.file"
         >
           <div class="photoItem">
             <div class="photoInfo">
@@ -121,18 +128,18 @@
             </div>
             <div class="photoImg">
               <!-- 有的图片放到阿里云,有的放到了服务器 -->
-              <template v-if="item.addr.indexOf('http') != -1">
+              <template v-if="item.file.indexOf('http') != -1">
                 <!-- <img :src="item.addr" /> -->
-                <img v-lazy="item.addr" alt="" />
+                <img v-lazy="item.file" alt="" />
               </template>
               <template v-else>
                 <!-- <img :src="$host + item.addr" /> -->
-                <img v-lazy="$host + item.addr" />
+                <img v-lazy="item.file" />
               </template>
             </div>
             <div class="date" style="background: #fff">
               <div>
-                {{ (item.addtime * 1000) | formatTime }}
+                {{ (item.createDate) | formatTime }}
               </div>
               <div>
                 <span
@@ -288,6 +295,10 @@ export default {
     },
   },
   methods: {
+    // 专家建议
+    tosuggest(){
+      this.$router.push("/index/suggest-bzy")
+    },
     // 册数多选框
     stopDefault(e, item) {
       if (this.idList.indexOf(item.id) == -1) {
@@ -436,21 +447,19 @@ export default {
     equipBtnControl(cmd) {
       this.$axios({
         method: "POST",
-        url: "/api/api_gateway?method=forecast.send_control.admin_device_control",
+        url: "/baoziyi/photograph",
         data: this.qs.stringify({
-          cmd,
-          device_type_id: 7,
-          d_id: this.$route.query.d_id,
+          deviceAddr: this.device_id
         }),
       }).then((res) => {
-        if (res.data.message == "") {
+        if (res.data.code == 0) {
           if (document.getElementsByClassName("el-message").length == 0) {
             this.$message.success("指令下发成功!");
           }
         }
       });
     },
-    getPhoteList() {
+    /*getPhoteList() {
       this.$axios({
         method: "POST",
         url: "/api/api_gateway?method=forecast.forecast_system.equip_photo",
@@ -473,6 +482,31 @@ export default {
           console.log(this.totalNum);
         }
       });
+    },*/
+    getPhoteList() {
+      this.$axios({
+        method: "POST",
+        url: "/baoziyi/imagepage",
+        data: this.qs.stringify({
+          deviceAddr: this.device_id,
+          page: this.queryInfo.page,
+          limit: 8,
+          timeBegin: this.queryInfo.begin,
+          timeEnd: this.queryInfo.end,
+        }),
+      }).then((res) => {
+        if (res.data.code == 0) {
+          console.log(123123, res.data)
+          let data = res.data.data.list;
+          console.log(111, data)
+          this.photoList = data.map((item) => {
+            item.checked = false;
+            return item;
+          });
+          this.totalNum = res.data.data.total;
+          console.log(this.totalNum);
+        }
+      });
     },
     //改变page
     changePage(val) {
@@ -480,6 +514,7 @@ export default {
       this.getPhoteList();
     },
     DateChange() {
+      console.log(this.timeRange)
       this.queryInfo.page = 1;
       if (this.timeRange) {
         this.queryInfo.begin = parseInt(
@@ -839,4 +874,4 @@ export default {
     }
   }
 }
-</style>
+</style>

+ 31 - 35
pingpu_vue/src/page/bzy/DataDetail.vue

@@ -12,10 +12,10 @@
       <div class="baselistbox_top_search">
         <div class="equipInfo">
           <div class="detail">
-            <span>设备ID:{{ id }}</span>
+            <span>设备ID:{{ $route.query.deviceAddr }}</span>
             <span>设备名称:{{ $route.query.name }}</span>
             <span>位置:{{ $route.query.address }}</span>
-            <span>已培养时间(h):{{ staytime }}</span>
+            <!--<span>已培养时间(h):{{ staytime }}</span>-->
           </div>
           <DateSearch
             ref="timeCirculation"
@@ -23,17 +23,17 @@
             @timeScreen="timeScreen"
           ></DateSearch>
         </div>
-        <div class="ctrl-check">
+        <!--<div class="ctrl-check">
           <el-button
             type="primary"
             size="mini"
             @click="$throttle(refresh, 2000)"
             >刷新</el-button
           >
-        </div>
+        </div>-->
       </div>
     </div>
-    <el-row :gutter="20" v-loading="refreshload" style="margin-top: 10px">
+    <!--<el-row :gutter="20" v-loading="refreshload" style="margin-top: 10px">
       <el-col :md="24" :lg="12">
         <el-card class="box-card" id="box-card1">
           <highcharts :options="option1"></highcharts>
@@ -49,8 +49,8 @@
       <el-button type="primary" size="mini" @click="deriveData()"
         >导出</el-button
       >
-    </div>
-    <el-card class="box-card" v-loading="refreshload">
+    </div>-->
+    <el-card class="box-card">
       <el-table :data="tableData" stripe style="width: 100%">
         <el-table-column
           v-for="(item, index) in tableHeadTxt2"
@@ -144,21 +144,11 @@ export default {
       timeRange: "",
       lineTime: "",
       tableHeadTxt2: [
-        ["设备开关", "on_off"],
-        ["环境温度(°C)", "at"],
-        ["环境湿度(%)", "ah"],
-        ["保温仓设定温度(°C)", "set_temp"],
-        ["保温仓当前温度(°C)", "pre_temp"],
-        ["电池状态", "batStatus"],
-        ["雨控状态", "rps"],
-        // ["摄像头状态", "usb_sta"],
-        ["工作状态", "work_sta"],
-        // ["电压(V)", "v_bat"],
-        // ["电压(V)", "vbat"],
-        // ["电流(mA)", "current"],
-        // ["信号强度", "csq"],
-        ["设备版本", "dver"],
-        ["上报时间", "addtime"],
+        ["设备门状态", "switchstatus"],
+        ["单次移动脉冲采样", "pulsecurrent"],
+        ["累计脉冲采样", "pulsetotal"],
+        ["运行模式", "controlmode"],
+        ["时间", "createDate"]
       ],
       queryInfo: {
         begin: "",
@@ -222,14 +212,14 @@ export default {
     // this.getHisDataList();
     this.equipStateDict = Circulation;
     this.refreshData();
-    this.loadingInstance1 = Loading.service({
+    /*this.loadingInstance1 = Loading.service({
       fullscreen: false,
       target: document.getElementById("box-card1"),
     });
     this.loadingInstance2 = Loading.service({
       fullscreen: false,
       target: document.getElementById("box-card2"),
-    });
+    });*/
     console.log(this.ChartData);
   },
   computed: {
@@ -430,7 +420,7 @@ export default {
       });
     },
     //获取折线数据
-    getChartDataList() {
+    /*getChartDataList() {
       this.$axios({
         method: "POST",
         url: "/api/api_gateway?method=forecast.worm_lamp.device_polyline_data",
@@ -492,7 +482,7 @@ export default {
         this.loadingInstance1.close();
         this.loadingInstance2.close();
       });
-    },
+    },*/
     // 当使用日期筛选
     timeScreen(data) {
       this.timeScreenData = data;
@@ -501,7 +491,7 @@ export default {
     getHisDataList() {
       this.$axios({
         method: "POST",
-        url: "/api/api_gateway?method=forecast.worm_lamp.device_history_data",
+        url: "/baoziyi/typepage",
         data: this.qs.stringify({
           device_type_id: 7,
           device_id: this.queryInfo.e_id,
@@ -511,10 +501,16 @@ export default {
           page_size: this.queryInfo.page_size,
         }),
       }).then((res) => {
-        if (res.data.message == "") {
-          this.total = res.data.data.counts;
-          var data = res.data.data.data;
-          if (data.length > 0) {
+        if (res.data.code == 0) {
+          this.total = res.data.data.total;
+          this.tableData = res.data.data.list;
+          if (this.tableData.length > 0) {
+            for (let i = 0; i < this.tableData.length; i++) {
+              this.tableData[i].switchstatus = this.tableData[i].switchstatus == '0' ? '关闭' : '开启'
+              this.tableData[i].controlmode = this.tableData[i].controlmode == '0' ? '手动' : '自动'
+            }
+          }
+          /*if (data.length > 0) {
             this.staytime = data[0].d_h_t.staytime; //已培养时间
             this.tableData = [];
             for (var i = 0; i < data.length; i++) {
@@ -548,7 +544,7 @@ export default {
             }
           } else {
             this.tableData = [];
-          }
+          }*/
           console.log(this.tableData);
         }
       });
@@ -558,7 +554,7 @@ export default {
       this.queryInfo.begin = data.begin;
       this.queryInfo.end = data.end;
       this.getHisDataList();
-      this.getChartDataList();
+      //this.getChartDataList();
     },
     handleSizeChange(e) {
       this.queryInfo.page = 1;
@@ -587,7 +583,7 @@ export default {
         if (res.data.message == "") {
           this.refreshload = true;
           setTimeout(() => {
-            this.getChartDataList();
+            //this.getChartDataList();
             this.getHisDataList();
             if (document.getElementsByClassName("el-message").length == 0) {
               this.$message.success("刷新成功");
@@ -777,4 +773,4 @@ export default {
     background-color: #f1f1f3;
   }
 }
-</style>
+</style>

+ 89 - 40
pingpu_vue/src/page/bzy/bzy.vue

@@ -11,7 +11,7 @@
           <div class="firstsearch">
             <span class="biaoti">设备ID或名称</span>
             <el-input
-              v-model="queryInfo.f_id"
+              v-model="queryInfo.fId"
               size="mini"
               placeholder="请输入设备ID或名称"
             ></el-input>
@@ -56,16 +56,16 @@
           width="250"
         >
           <template slot-scope="scope">{{
-            scope.row.device_name == "" ? "无" : scope.row.device_name
+            scope.row.deviceName == "" ? "无" : scope.row.deviceName
           }}</template>
         </el-table-column>
-        <el-table-column prop="imei" label="设备ID" width="180">
-          <template slot-scope="scope">{{ scope.row.imei }}</template>
+        <el-table-column prop="deviceAddr" label="设备ID" width="180">
+          <template slot-scope="scope">{{ scope.row.deviceAddr }}</template>
         </el-table-column>
-        <el-table-column prop="is_online" label="在线状态">
+        <el-table-column prop="isOnline" label="在线状态">
           <template slot-scope="scope">
-            <p style="color: #17bb89" v-if="scope.row.is_online == 1">在线</p>
-            <p style="color: #eb6765" v-if="scope.row.is_online == 0">离线</p>
+            <p style="color: #17bb89" v-if="scope.row.isOnline == 1">在线</p>
+            <p style="color: #eb6765" v-if="scope.row.isOnline == 0">离线</p>
           </template>
         </el-table-column>
         <el-table-column prop="address" label="位置" width="280">
@@ -78,20 +78,20 @@
             (scope.row.uptime * 1000) | formatTime
           }}</template>
         </el-table-column>
-        <el-table-column label="操作" width="250">
+        <el-table-column label="操作" width="180">
           <template slot-scope="scope">
             <span
               style="color: #4f71ff; margin-right: 15px; cursor: pointer"
-              @click="viewImage(scope.row.imei, scope.row.d_id)"
+              @click="viewImage(scope.row.deviceAddr, scope.row.d_id)"
               >查看图片</span
             >
-            <span
+            <!--<span
               style="color: #4f71ff; margin-right: 15px; cursor: pointer"
               @click="
-                equipSet(scope.row.d_id, scope.row.imei, scope.row.device_name)
+                equipSet(scope.row.d_id, scope.row.deviceAddr, scope.row.deviceName)
               "
               >设备控制</span
-            >
+            >-->
             <span
               style="color: #4f71ff; margin-right: 15px; cursor: pointer"
               @click="dataDetail(scope.row)"
@@ -140,7 +140,7 @@
             style="width: 200px"
           ></el-input>
         </el-form-item>
-        <el-form-item label="载玻片滴液时间(s): " prop="drop_time">
+        <!--<el-form-item label="载玻片滴液时间(s): " prop="drop_time">
           <el-select v-model="setFrom.drop_time">
             <el-option
               v-for="item in 30"
@@ -149,12 +149,12 @@
               :value="item"
             ></el-option>
           </el-select>
-        </el-form-item>
-        <el-form-item label="孢子培养时间(h): " prop="cul_time">
+        </el-form-item>-->
+        <el-form-item label="工作时长(h): " prop="cul_time">
           <div class="sliderParent">
             <div class="block">
               <el-slider
-                v-model="setFrom.cul_time"
+                v-model="setFrom.workhour"
                 show-input
                 :min="1"
                 :max="24"
@@ -162,23 +162,23 @@
             </div>
           </div>
         </el-form-item>
-        <el-form-item label="保温仓设定温度(℃): " prop="set_temp">
+        <el-form-item label="采样时长(h): " prop="set_temp">
           <div class="sliderParent">
             <div class="block">
               <el-slider
-                v-model="setFrom.set_temp"
+                v-model="setFrom.samplinghour"
                 show-input
-                :min="10"
-                :max="40"
+                :min="1"
+                :max="24"
               ></el-slider>
             </div>
           </div>
         </el-form-item>
-        <el-form-item label="数据上传时间间隔(min): " prop="datt">
+        <el-form-item label="工作间隔(min): " prop="datt">
           <div class="sliderParent">
             <div class="block">
               <el-slider
-                v-model="setFrom.datt"
+                v-model="setFrom.workintervalminute"
                 show-input
                 :min="10"
                 :max="60"
@@ -186,7 +186,7 @@
             </div>
           </div>
         </el-form-item>
-        <el-form-item label="采集开启和关闭时间: ">
+        <!--<el-form-item label="采集开启和关闭时间: ">
           <div class="timeSet">
             <el-time-select
               size="mini"
@@ -261,7 +261,7 @@
               }"
             ></el-time-select>
           </div>
-        </el-form-item>
+        </el-form-item>-->
       </el-form>
       <span slot="footer" class="dialog-footer">
         <el-button size="mini" @click="setDialogVisible = false"
@@ -305,7 +305,7 @@ export default {
         page_size: "10",
         page: "1",
         is_online: "",
-        f_id: "",
+        fId: "",
         pagekey:1
       },
       options: [
@@ -329,6 +329,7 @@ export default {
       equipInfo: {},
       totalNum: 0,
       setFrom: {
+        deviceName: "",
         drop_time: "1", //载玻片滴液时间
         imgres: "0", //图片上传分辨率
         cul_time: 0, //孢子培养时间
@@ -353,7 +354,7 @@ export default {
   //方法集合
   methods: {
     //获取设备列表
-    getEquipList() {
+    /*getEquipList() {
       this.$axios({
         method: "POST",
         url: "/api/api_gateway?method=forecast.worm_lamp.lamp_list",
@@ -399,6 +400,47 @@ export default {
         //     "末页";
         // });
       });
+    },*/
+    getEquipList() {
+      this.$axios({
+        method: "POST",
+        url: "/baoziyi/page",
+        data: this.qs.stringify({
+          fId: this.queryInfo.fId,
+          isOnline: this.queryInfo.is_online,
+          limit: this.queryInfo.page_size,
+          page: this.queryInfo.page
+        }),
+      }).then((res) => {
+        if (res.data.code == 0) {
+          // 列表数据
+          this.equipList = res.data.data.list;
+          // insectVal
+          for (var i = 0; i < this.equipList.length; i++) {
+            if (this.equipList[i].disable == 0) {
+              // 禁用
+              this.equipList[i].insectVal = "禁用";
+            } else if (this.equipList[i].disable == 1) {
+              // 识别
+              this.equipList[i].insectVal = "识别";
+            } else if (this.equipList[i].disable == 2) {
+              // 计数
+              this.equipList[i].insectVal = "计数";
+            }
+          }
+          // 数据数量
+          this.equipList.insectVal = this.totalNum = res.data.data.total;
+          this.loading = false;
+        }
+        var data = res.data.data.list;
+        for (var i = 0; i < data.length; i++) {
+          if (data[i].disable == "2") {
+            console.log(data[i].deviceAddr + "这是计数");
+          } else if (data[i].disable == "1") {
+            console.log(data[i].deviceAddr + "这是带识别的");
+          }
+        }
+      });
     },
     handleSizeChange(e) {
       this.queryInfo.page_size = e;
@@ -457,12 +499,12 @@ export default {
       }
       this.$axios({
         method: "POST",
-        url: "/api/api_gateway?method=forecast.send_control.device_control",
+        url: "/baoziyi/updateautomode",
         data: this.qs.stringify({
-          device_type_id: 7,
-          d_id: this.d_id,
-          config: JSON.stringify(this.setFrom),
-          device_name:this.equipInfo.device_name
+          workhour: this.setFrom.workhour,
+          samplinghour: this.setFrom.samplinghour,
+          workintervalminute: this.setFrom.workintervalminute,
+          deviceAddr: this.equipInfo.device_id
         }),
       }).then((res) => {
         if (res.data.message == "") {
@@ -483,22 +525,28 @@ export default {
       this.equipInfo = { device_id, device_name };
       this.$axios({
         method: "POST",
-        url: "/api/api_gateway?method=forecast.send_control.device_control_info",
+        url: "/baoziyi/deviceconfig",
         data: this.qs.stringify({ d_id, cmd: "paramconf" }),
       }).then((res) => {
         if (res.data.data && Object.keys(res.data.data).length > 0) {
           let data = res.data.data;
+          console.log(222,data)
           // this.setFrom = data;
           var obj = {};
-          obj["cold_sw"] = parseInt(data.cold_sw);
-          obj["cul_time"] = parseInt(data.cul_time);
-          obj["drop_time"] = parseInt(data.drop_time);
+          /*obj["workhour"] = parseInt(data.workhour);
+          obj["samplinghour"] = parseInt(data.samplinghour);
+          obj["workintervalminute"] = parseInt(data.workintervalminute);
           obj["on_off"] = parseInt(data.on_off);
           obj["set_temp"] = parseInt(data.set_temp);
           obj["datt"] = parseInt(data.datt);
           obj["coll_time"] = data.coll_time;
-          obj["admin"] = data.admin;
-          this.setFrom = obj;
+          obj["admin"] = data.admin;*/
+          this.setFrom.deviceAddr = this.equipInfo.device_id;
+          this.setFrom.deviceName = this.equipInfo.device_name;
+          this.setFrom.workhour = parseInt(data.workhour);
+          this.setFrom.samplinghour = parseInt(data.samplinghour);
+          this.setFrom.workintervalminute = parseInt(data.workintervalminute);
+          console.log(123,this.setFrom)
 
           let { coll_time } = this.setFrom;
           for (let i in coll_time) {
@@ -550,12 +598,13 @@ export default {
     // 数据详情
     //数据详情
     dataDetail(data) {
-      this.itemId = data.device_id;
+      this.itemId = data.deviceAddr;
       this.$router.push({
         path: `/index/dataDetail/${data.imei}/${data.d_id}`,
         query: {
+          deviceAddr: data.deviceAddr,
           address: data.address,
-          name: data.device_name,
+          name: data.deviceName,
         },
       });
     },
@@ -688,4 +737,4 @@ export default {
 /deep/.el-slider__bar {
   background-color: #4f71ff !important;
 }
-</style>
+</style>

+ 4 - 3
pingpu_vue/src/page/login/login.vue

@@ -39,7 +39,7 @@
 
 <script>
 //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
-
+import Base64 from "../../util/base64";
 export default {
   //import引入的组件需要注入到对象中才能使用
   components: {},
@@ -65,12 +65,13 @@ export default {
     register() {
       this.$refs["ruleForm"].validate((valid) => {
         if (valid) {
+          var base = new Base64();
           this.$axios({
             method: "POST",
             url: "/api/api_gateway?method=user.login.login_user",
             data: this.qs.stringify({
-              username: this.ruleForm.username,
-              password: this.ruleForm.password,
+              username: base.encode(this.ruleForm.username),
+              password: base.encode(this.ruleForm.password),
             }),
           }).then((res) => {
             if (res.data.message == "") {

+ 4 - 4
pingpu_vue/src/page/monitor/Monitor.vue

@@ -2079,9 +2079,9 @@ li {
       }
       .direc {
         text-align: center;
-        width: 100%;
+        width: 180px;
         height: 180px;
-        margin: 5% 0 5% 0;
+        margin: 5% auto;
         position: relative;
         background: url(../../assets/images/forecasting/monitor/direction-btn.png)
           no-repeat center;
@@ -2104,12 +2104,12 @@ li {
         }
         .leftCtr {
           top: 50%;
-          left: 112px;
+          left: 8px;
           margin-top: -25px;
         }
         .rightCtr {
           top: 50%;
-          right: 118px;
+          right: 8px;
           margin-top: -25px;
         }
         .cameraCtr {

+ 6 - 4
pingpu_vue/src/page/qxz/envi.vue

@@ -334,8 +334,8 @@ export default {
     //这里存放数据
     return {
       queryInfo: {
-        page_size: "10",
-        page: "1",
+        page_size: 10,
+        page: 1,
         is_online: "",
         f_id: "",
         pagekey:1
@@ -358,7 +358,9 @@ export default {
       loading: false,
       setDialogVisible: false,
       parameterLoading: false,
-      setFrom: {},
+      setFrom: {
+        interval:0
+      },
       equipInfo: {},
       setDialogTxt: "请求中",
       simCodeVisible: false,
@@ -503,7 +505,7 @@ export default {
           this.getEquipList()
         } else {
           if (document.getElementsByClassName("el-message").length == 0) {
-            this.$message.err("操作失败");
+            this.$message.error(res.data.message);
           }
         }
         this.setDialogVisible = false;

+ 490 - 0
pingpu_vue/src/page/specialist/suggest-bzy.vue

@@ -0,0 +1,490 @@
+<!--  -->
+<template>
+  <div class="sugbox">
+    <div class="baselistbox_top">
+      <div class="baselistbox_top_title">
+        <p @click="backtrack" style="cursor: pointer">
+          <i class="el-icon-back"></i>
+          <span>返回</span>
+        </p>
+        <p>专家建议</p>
+      </div>
+      <p class="baselistbox_top_line"></p>
+      <div class="baselistbox_top_search" v-show="listoradd == 0">
+        <div class="left_search">
+          <div class="btnbox2" @click="listoradd = 1">新增建议</div>
+        </div>
+        <div class="right_search">
+          <el-date-picker
+            v-model="value1"
+            type="daterange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            size="mini"
+            @change="timechange"
+          >
+          </el-date-picker>
+          <div class="firstsearch">
+            <el-input
+              v-model="key_word"
+              size="mini"
+              placeholder="请输入关键字搜索"
+            ></el-input>
+          </div>
+          <div class="btnbox" @click="searchChange">查询</div>
+        </div>
+      </div>
+      <div class="baselistbox_top_search" v-show="listoradd == 1">
+        <div class="left_search">
+          <div class="btnbox2" @click="listoradd = 0">列 表</div>
+        </div>
+      </div>
+    </div>
+    <div class="baselistbox_table" v-show="listoradd == 0">
+      <div class="listbox">
+        <div
+          class="listbox_item"
+          v-for="(item, index) in suggestlist"
+          :key="index"
+        >
+          <div class="listbox_title">
+            <!--<p>分析人员:{{ item.user_name }}</p>-->
+            <p>{{ item.createDate }}</p>
+          </div>
+          <div class="listbox_text">{{ getHtmlPlainText(item.content).slice(0, 150) }}<span v-if="item.content.length>=150">...</span></div>
+          <div class="listbox_btn">
+            <!--<p @click="dellist(item)">删除</p>-->
+            <p @click="seeinfo(item)">查看详细</p>
+          </div>
+        </div>
+      </div>
+      <div class="none" v-if="!suggestlist.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="[4, 8, 12, 16]"
+          :page-size="page_size"
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-size.sync="page"
+          :key="pagekey"
+        >
+        </el-pagination>
+      </div>
+    </div>
+    <div class="baselistbox_table" v-show="listoradd == 1">
+      <editor :tinymceHtml="sugaddinfo.content" @inp="inp($event)"></editor>
+      <div class="btnbigbox">
+        <div class="btnbox" @click="sugadd">提交</div>
+      </div>
+    </div>
+    <el-dialog
+      title="专家建议"
+      :visible.sync="dialogVisible"
+      width="766px"
+      :close-on-click-modal="false"
+    >
+      <div class="infobox">
+        <div v-html="infohtml"></div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+import Editor from "@/components/editor/Editor";
+export default {
+  //import引入的组件需要注入到对象中才能使用
+  components: {
+    Editor,
+  },
+  data() {
+    //这里存放数据
+    return {
+      value1: "",
+      key_word: "",
+      totalnum: 10,
+      page: 1,
+      pagekey: 1,
+      page_size: 4,
+      suggestlist: [],
+      listoradd: 0,
+      prevention: "",
+      sugaddinfo: {
+        content: "",
+        foreword: "",
+      },
+      start_time: "",
+      end_time: "",
+      dialogVisible:false,
+      infohtml:"",
+      type:""
+    };
+  },
+  //监听属性 类似于data概念
+  computed: {},
+  //监控data中的数据变化
+  watch: {},
+  //方法集合
+  methods: {
+    backtrack() {
+      this.$router.go(-1);
+    },
+    handleSizeChange(e) {
+      this.page_size = e;
+      this.page = 1;
+      this.pagekey = Math.random() * 10 + 1;
+      this.getsuglist();
+    },
+    handleCurrentChange(e) {
+      this.page = e;
+      this.getsuglist();
+    },
+    timechange(e) {
+      console.log(e);
+      if (e) {
+        var time = new Date(e[0]);
+        var year1 = time.getFullYear();
+        var month1 = time.getMonth() + 1;
+        var date1 = time.getDate();
+        var time2 = new Date(e[1]);
+        var year2 = time2.getFullYear();
+        var month2 = time2.getMonth() + 1;
+        var date2 = time2.getDate();
+        this.start_time = year1 + "-" + month1 + "-" + date1;
+        this.end_time = year2 + "-" + month2 + "-" + date2;
+      } else {
+        this.start_time = "";
+        this.end_time = "";
+      }
+      this.page = 1;
+      this.pagekey = Math.random() * 10 + 1;
+      this.getsuglist();
+    },
+    inp(el) {
+      //   console.log(this.getHtmlPlainText(el.sunHtml));
+      this.sugaddinfo.content = el.sunHtml;
+      this.sugaddinfo.foreword = this.getHtmlPlainText(el.sunHtml);
+    },
+    getHtmlPlainText(str) {
+      str = str.replace(/(\n)/g, "");
+      str = str.replace(/(\t)/g, "");
+      str = str.replace(/(\r)/g, "");
+      str = str.replace(/(&nbsp;)/g, "");
+      str = str.replace(/<\/?[^>]*>/g, "");
+      str = str.replace(/\s*/g, "");
+      str = str.replace(/<[^>]*>/g, "");
+      //或
+      //var text = html_str.replace(/<[^<>]+>/g, "");
+      return str;
+    },
+    searchChange() {
+      this.page = 1;
+      this.pagekey = Math.random() * 10 + 1;
+      this.getsuglist();
+    },
+    getsuglist() {
+      this.$axios({
+        method: "post",
+        url: "baoziyi/analysepage",
+        data: this.qs.stringify({
+          start_time: this.start_time,
+          end_time: this.end_time,
+          key_word: this.key_word,
+          article_type: this.type,
+          page: this.page,
+          limit: this.page_size,
+        }),
+      }).then((res) => {
+        if (res.data.code == 0) {
+          this.suggestlist = res.data.data.list;
+          this.totalnum = res.data.data.total;
+        }
+        console.log(this.suggestlist)
+      });
+    },
+    sugadd() {
+      console.log(this.sugaddinfo.foreword);
+      if (this.sugaddinfo.foreword == "") {
+        if (document.getElementsByClassName("el-message").length == 0) {
+          this.$message.error("请输入内容");
+        }
+      } else {
+        console.log(this.sugaddinfo.foreword.slice(0, 150));
+        this.$axios({
+          method: "post",
+          url: "baoziyi/saveanalysepage",
+          data: this.qs.stringify({
+            article_type: this.type,
+            content: this.sugaddinfo.content
+          }),
+        }).then((res) => {
+          if (res.data.code == 0) {
+            if (document.getElementsByClassName("el-message").length == 0) {
+              this.$message.success("添加成功");
+            }
+            this.listoradd = 0;
+            this.sugaddinfo.content = "";
+            this.sugaddinfo.foreword = "";
+            this.getsuglist();
+          } else {
+            if (document.getElementsByClassName("el-message").length == 0) {
+              this.$message.error(res.data.message);
+            }
+          }
+        });
+      }
+    },
+    dellist(item) {
+      this.$confirm("此操作将删除该条建议, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          this.$axios({
+            method: "post",
+            url: "api/api_gateway?method=article.article.del_article",
+            data: this.qs.stringify({
+              ea_id: item.ea_id,
+            }),
+          }).then((res) => {
+            if (res.data.message == "") {
+              this.$message({
+                type: "success",
+                message: "删除成功!",
+              });
+              this.getsuglist();
+            } else {
+              this.$message({
+                type: "error",
+                message: res.data.message,
+              });
+            }
+          });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消删除",
+          });
+        });
+    },
+    seeinfo(item){
+      this.infohtml = item.content
+      this.dialogVisible = true
+    }
+  },
+  beforeCreate() {}, //生命周期 - 创建之前
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+    this.type = this.$route.query.type
+    console.log(this.$route)
+    this.getsuglist();
+  },
+  beforeMount() {}, //生命周期 - 挂载之前
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {},
+  beforeUpdate() {}, //生命周期 - 更新之前
+  updated() {}, //生命周期 - 更新之后
+  beforeDestroy() {}, //生命周期 - 销毁之前
+  destroyed() {}, //生命周期 - 销毁完成
+  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+<style lang="less" scoped>
+.sugbox {
+  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;
+      p:first-child {
+        font-size: 14px;
+      }
+      p:last-child {
+        font-size: 18px;
+        font-weight: 700;
+        margin-left: 20px;
+      }
+    }
+    .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;
+        .btnbox,
+        .btnbox2 {
+          width: 80px;
+          height: 26px;
+          border: 1px solid #4f71ff;
+          text-align: center;
+          border-radius: 3px;
+          font-size: 14px;
+          cursor: pointer;
+          line-height: 26px;
+        }
+        .btnbox {
+          background-color: #4f71ff;
+          color: #fff;
+        }
+        .btnbox2 {
+          color: #4f71ff;
+        }
+      }
+      .right_search {
+        display: flex;
+        .firstsearch,
+        .secsearch {
+          display: flex;
+          margin-left: 20px;
+          /deep/.el-input {
+            width: 240px;
+          }
+          .biaoti {
+            font-size: 14px;
+            margin-right: 20px;
+          }
+        }
+        .btnbox,
+        .btnbox2 {
+          width: 68px;
+          height: 26px;
+          border: 1px solid #4f71ff;
+          text-align: center;
+          border-radius: 3px;
+          font-size: 14px;
+          margin-left: 20px;
+          cursor: pointer;
+          line-height: 26px;
+        }
+        .btnbox {
+          background-color: #4f71ff;
+          color: #fff;
+        }
+        .btnbox2 {
+          color: #4f71ff;
+        }
+      }
+    }
+  }
+  .baselistbox_table {
+    width: 100%;
+    background-color: #fff;
+    margin-top: 10px;
+    padding: 20px;
+    box-sizing: border-box;
+    position: relative;
+    border-radius: 10px;
+    .listbox {
+      width: 100%;
+      .listbox_item {
+        width: 100%;
+        border-bottom: 1px solid #f2f2f2;
+        margin-bottom: 20px;
+        .listbox_title {
+          display: flex;
+          justify-content: space-between;
+          p:first-child {
+            font-size: 18px;
+            color: #4f71ff;
+          }
+          p:last-child {
+            color: #8c8c8c;
+            font-size: 14px;
+          }
+        }
+        .listbox_text {
+          margin: 15px 0;
+          color: #595959;
+          font-size: 14px;
+          letter-spacing: 1px;
+          line-height: 22px;
+        }
+        .listbox_btn {
+          display: flex;
+          justify-content: flex-end;
+          margin-bottom: 10px;
+          p {
+            margin-left: 10px;
+            font-size: 14px;
+            color: #4f71ff;
+            cursor: pointer;
+          }
+        }
+      }
+    }
+    /deep/.tinymce {
+      .mce-container-body > .mce-first > .mce-container-body > .mce-menubar {
+        display: none;
+      }
+      .mce-flow-layout > .mce-btn-group:nth-child(8) {
+        display: none;
+      }
+    }
+    .btnbigbox {
+      display: flex;
+      justify-content: flex-end;
+    }
+    .btnbox {
+      width: 68px;
+      height: 26px;
+      border: 1px solid #4f71ff;
+      text-align: center;
+      border-radius: 3px;
+      font-size: 14px;
+      cursor: pointer;
+      line-height: 26px;
+      background-color: #4f71ff;
+      color: #fff;
+      margin-top: 15px;
+    }
+    .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;
+      }
+    }
+  }
+}
+.infobox{
+  overflow: hidden;
+}
+</style>

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

@@ -356,7 +356,9 @@ export default {
       loading: false,
       setDialogVisible: false,
       parameterLoading: false,
-      setFrom: {},
+      setFrom: {
+        interval:0
+      },
       equipInfo: {},
       setDialogTxt: "请求中",
       simCodeVisible: false,

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

@@ -214,7 +214,7 @@ export default {
     return {
       username: "",
       page: 1,
-      page_size: 1,
+      page_size: 10,
       pagekey: 1,
       userlist: [],
       totalnum: 10,

+ 6 - 1
pingpu_vue/src/router/index.js

@@ -54,6 +54,7 @@ import userlist from '../../src/page/user/userlist.vue'
 //专家
 import specialist from '../../src/page/specialist/specialist.vue'
 import suggest from '../../src/page/specialist/suggest.vue'//专家建议
+import suggestBzy from '../../src/page/specialist/suggest-bzy.vue'//专家建议
 //接入设备
 import joincbd from '../../src/page/join/joincbd.vue'
 import joinqxz from '../../src/page/join/joinqxz.vue'
@@ -195,7 +196,11 @@ export default new Router({
         }, {
           path: "suggest",
           component: suggest
-        }, {
+        },
+        {
+          path: "suggest-bzy",
+          component: suggestBzy
+        },{
           path: "joinqxz",
           component: joinqxz
         }, {

+ 122 - 0
pingpu_vue/src/util/base64.js

@@ -0,0 +1,122 @@
+//1.加密解密方法使用:
+
+//1.加密
+// var str = '124中文内容';
+// var base = new Base64();
+// var result = base.encode(str);
+// //document.write(result);
+
+// //2.解密
+// var result2 = base.decode(result);
+// document.write(result2);
+// //2.加密、解密算法封装:
+
+function Base64() {
+
+  // private property
+  var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
+
+  // public method for encoding
+  this.encode = function (input) {
+    if (!input) { //console.log('请传入要加密的值') 
+      return
+    }
+    var output = "";
+    var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
+    var i = 0;
+    input = _utf8_encode(input);
+    while (i < input.length) {
+      chr1 = input.charCodeAt(i++);
+      chr2 = input.charCodeAt(i++);
+      chr3 = input.charCodeAt(i++);
+      enc1 = chr1 >> 2;
+      enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
+      enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
+      enc4 = chr3 & 63;
+      if (isNaN(chr2)) {
+        enc3 = enc4 = 64;
+      } else if (isNaN(chr3)) {
+        enc4 = 64;
+      }
+      output = output +
+        _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +
+        _keyStr.charAt(enc3) + _keyStr.charAt(enc4);
+    }
+    return output;
+  }
+
+  // public method for decoding
+  this.decode = function (input) {
+    if (!input) { //console.log('请传入要解密的值')
+      return
+    }
+    var output = "";
+    var chr1, chr2, chr3;
+    var enc1, enc2, enc3, enc4;
+    var i = 0;
+    input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
+    while (i < input.length) {
+      enc1 = _keyStr.indexOf(input.charAt(i++));
+      enc2 = _keyStr.indexOf(input.charAt(i++));
+      enc3 = _keyStr.indexOf(input.charAt(i++));
+      enc4 = _keyStr.indexOf(input.charAt(i++));
+      chr1 = (enc1 << 2) | (enc2 >> 4);
+      chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
+      chr3 = ((enc3 & 3) << 6) | enc4;
+      output = output + String.fromCharCode(chr1);
+      if (enc3 != 64) {
+        output = output + String.fromCharCode(chr2);
+      }
+      if (enc4 != 64) {
+        output = output + String.fromCharCode(chr3);
+      }
+    }
+    output = _utf8_decode(output);
+    return output;
+  }
+
+  // private method for UTF-8 encoding
+  var _utf8_encode = function (string) {
+    string = string.replace(/\r\n/g, "\n");
+    var utftext = "";
+    for (var n = 0; n < string.length; n++) {
+      var c = string.charCodeAt(n);
+      if (c < 128) {
+        utftext += String.fromCharCode(c);
+      } else if ((c > 127) && (c < 2048)) {
+        utftext += String.fromCharCode((c >> 6) | 192);
+        utftext += String.fromCharCode((c & 63) | 128);
+      } else {
+        utftext += String.fromCharCode((c >> 12) | 224);
+        utftext += String.fromCharCode(((c >> 6) & 63) | 128);
+        utftext += String.fromCharCode((c & 63) | 128);
+      }
+    }
+    return utftext;
+  }
+  // private method for UTF-8 decoding
+  var _utf8_decode = function (utftext) {
+    var string = "";
+    var i = 0;
+    let c = 0, c1 = 0, c2 = 0;
+    while (i < utftext.length) {
+      c = utftext.charCodeAt(i);
+      if (c < 128) {
+        string += String.fromCharCode(c);
+        i++;
+      } else if ((c > 191) && (c < 224)) {
+        c2 = utftext.charCodeAt(i + 1);
+        string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
+        i += 2;
+      } else {
+        c2 = utftext.charCodeAt(i + 1);
+        c1 = utftext.charCodeAt(i + 2);
+        string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c1 & 63));
+        i += 3;
+      }
+    }
+    return string;
+  }
+}
+export default Base64
+