Bladeren bron

即时通讯逻辑调整,数据填报校验

yf_zhb 2 jaren geleden
bovenliggende
commit
2856a6b570

+ 4 - 4
minggao/index.html

@@ -1,10 +1,10 @@
 <!DOCTYPE html>
 <html>
   <head>
-    <meta charset="utf-8">
-    <meta name="viewport" content="width=device-width,initial-scale=1.0">
-    <title>监测指挥平台</title>
-    <link rel="SHORTCUT ICON" href="../static/images/ico.ico">
+    <meta charset="utf-8" />
+    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
+    <title>外来入侵物种智能监测平台</title>
+    <link rel="SHORTCUT ICON" href="../static/images/ico.ico" />
   </head>
   <body style="margin: 0;">
     <div id="app"></div>

+ 3 - 2
minggao/src/App.vue

@@ -6,7 +6,7 @@
 
 <script>
 export default {
-  name: "App",
+  name: 'App',
   data() {
     return {};
   },
@@ -16,7 +16,7 @@ export default {
 </script>
 
 <style lang="less">
-@import "./assets/css/global.css";
+@import './assets/css/global.css';
 html,
 body {
   height: 100%;
@@ -29,6 +29,7 @@ body {
     left: 0;
     top: 0;
     background: #f1f1f1;
+    overflow: hidden;
   }
 }
 /deep/.customClass {

+ 125 - 36
minggao/src/page/commandCenter/realTime.vue

@@ -398,6 +398,21 @@
         placeholder="按下enter按键发送消息"
       ></el-input>
     </el-dialog>
+
+    <el-dialog
+      title="视频通话通知"
+      :close-on-click-modal="false"
+      :modal="false"
+      :close-on-press-escape="false"
+      :visible.sync="videoNoticeDialogVisible"
+      width="500px"
+    >
+      <div style="padding:40px 20px;">{{ videoNoticeTitle }}</div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="cancleNoticeClik">取 消</el-button>
+        <el-button type="primary" @click="confrimNoticeClick">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -495,7 +510,10 @@ export default {
       // 消息发送加载
       msgSetTime: null,
       socketTimeoutLogs: [],
-      currentVideoCallUserID: ''
+      currentVideoCallUserID: '',
+      videoNoticeTitle: '',
+      videoNoticeDialogVisible: false,
+      currentVideoNoticeData: null
     };
   },
   //监听属性 类似于data概念
@@ -532,6 +550,8 @@ export default {
     // 聊天框
     dialogVisible(val) {
       if (val == false) {
+        console.log('update table read status');
+        this.updateTableUnreadStatus();
         this.msgList = [];
       }
     },
@@ -548,19 +568,7 @@ export default {
     // 给表格文本消息增加提示,数据从webscoket中获取
     tableData(val) {
       var that = this;
-      for (var i = 0; i < val.length; i++) {
-        let sdhkj = val[i];
-        for (var k = 0; k < this.websockMsgList.length; k++) {
-          let sdjaks = this.websockMsgList[k];
-          if (
-            sdhkj.real_name == sdjaks.real_name &&
-            sdjaks.unread !== 0 &&
-            sdjaks.unread
-          ) {
-            this.tableData[i]['unread'] = sdjaks.unread;
-          }
-        }
-      }
+      this.updateTableUnreadStatus();
     },
     deep: true,
 
@@ -585,11 +593,21 @@ export default {
     isVideoCallRefused(val) {
       console.warn(val, 'isVideoCallRefused video');
       if (val) {
-        this.$message({
-          message: '对方正忙,请稍后再试!',
-          type: 'warning',
-          duration: 1500
-        });
+        if (this.videoNoticeDialogVisible) {
+          this.$message({
+            message: '对方已挂断',
+            type: 'warning',
+            duration: 1500
+          });
+
+          this.videoNoticeDialogVisible = false;
+        } else {
+          this.$message({
+            message: '对方正忙,请稍后再试!',
+            type: 'warning',
+            duration: 1500
+          });
+        }
 
         this.notLogin();
       }
@@ -603,6 +621,21 @@ export default {
       'updateVideoInfo',
       'updateTalkingStatus'
     ]),
+    updateTableUnreadStatus() {
+      for (var i = 0; i < this.websockMsgList.length; i++) {
+        let sdhkj = this.websockMsgList[i];
+        for (var k = 0; k < this.websockMsgList.length; k++) {
+          let sdjaks = this.websockMsgList[k];
+          if (
+            sdhkj.real_name == sdjaks.real_name &&
+            sdjaks.unread !== 0 &&
+            sdjaks.unread
+          ) {
+            this.tableData[i]['unread'] = sdjaks.unread;
+          }
+        }
+      }
+    },
     //动态获取浏览器高度
     get_boderHeight() {
       const that = this;
@@ -643,7 +676,8 @@ export default {
         data: this.qs.stringify({
           page: this.page,
           page_item: '100000000',
-          org_name: ''
+          org_name: '',
+          is_mails: 1
         })
       })
         .then(res => {
@@ -975,23 +1009,31 @@ export default {
             this.RoomID = data.data.room_id; // 房间号
             this.Token = data.data.room_token; // Token
 
+            this.videoNoticeDialogVisible = true;
+            this.currentVideoNoticeData = data.data;
             //TODO 提示弹窗,确认后登录房间
-            this.$confirm(`${data.data.real_name}邀请你进行视频通话...`)
-              .then(_ => {
-                this.videoTle = '正在和' + data.data.real_name + '视频通话';
-                this.loginRoom();
-              })
-              .catch(_ => {
-                console.log('------------------------ confirm catch', _);
-                const socketData = {
-                  action: 'reject_video', // 动作标识,必填
-                  recv_user_id: data.data.user_id, // 接收人用户id, 非必填
-                  data: {}
-                };
-
-                console.warn('send reject_video', socketData);
-                this.websock.send(JSON.stringify(socketData));
-              });
+            // const confrimInstance = this.$confirm(
+            //   `${data.data.real_name}邀请你进行视频通话...`
+            // )
+            //   .then(_ => {
+            //     this.videoTle = '正在和' + data.data.real_name + '视频通话';
+            //     this.loginRoom();
+            //   })
+            //   .catch(_ => {
+            //     console.log('------------------------ confirm catch', _);
+            //     const socketData = {
+            //       action: 'reject_video', // 动作标识,必填
+            //       recv_user_id: data.data.user_id, // 接收人用户id, 非必填
+            //       data: {}
+            //     };
+
+            //     console.warn('send reject_video', socketData);
+            //     this.websock.send(JSON.stringify(socketData));
+            //   });
+
+            this.videoNoticeTitle = `${data.data.real_name}邀请你进行视频通话...`;
+
+            console.log('confirm instance', this.$confirm.done);
             //
           } else if (data.action == 'send_video_rsp') {
             console.warn('recv_video---------------- response', data.data);
@@ -1019,11 +1061,29 @@ export default {
             this.updateIsRefusedCall(true);
           } else if (data.action == 'occupy_rsp') {
             console.warn('----------------------- is refused');
+
+            this.currentVideoCallUserID = '';
             // 占线中,挂断发起通话
             this.updateIsRefusedCall(true);
           } else if (data.action == 'ok') {
             // 心跳机制 - 当前状态是websocket连接没有问题
             this.start(); // 心跳机制
+          } else if (data.action == 'error') {
+            if (data.code == 403) {
+              this.websock.close(); // 关闭socket
+              localStorage.removeItem('session');
+              this.$message({
+                message:
+                  (data.data && data.data.error_info) ||
+                  '账号异地登陆,请重新登陆',
+                type: 'warning',
+                duration: 2500
+              });
+
+              setTimeout(() => {
+                this.$router.push('/Login');
+              }, 3000);
+            }
           }
         };
         this.websock.onerror = event => {
@@ -1053,6 +1113,30 @@ export default {
         };
       }
     },
+    confrimNoticeClick() {
+      this.videoNoticeDialogVisible = false;
+      if (!this.currentVideoNoticeData) {
+        return;
+      }
+
+      this.videoTle =
+        '正在和' + this.currentVideoNoticeData.real_name + '视频通话';
+      this.loginRoom();
+    },
+    cancleNoticeClik() {
+      this.videoNoticeDialogVisible = false;
+
+      const socketData = {
+        action: 'reject_video', // 动作标识,必填
+        recv_user_id: this.currentVideoNoticeData.user_id, // 接收人用户id, 非必填
+        data: {}
+      };
+
+      console.warn('send reject_video', socketData);
+      this.websock.send(JSON.stringify(socketData));
+
+      this.currentVideoNoticeData = null;
+    },
     loginRoom() {
       const userID = localStorage.getItem('userID');
       console.warn(`userID:${userID};userName:${this.userName}`);
@@ -1289,6 +1373,9 @@ export default {
 
       console.warn('send reject_video', socketData);
       this.websock.send(JSON.stringify(socketData));
+    },
+    handleTextDialogClose() {
+      console.log('text dialog close ');
     }
   },
   //生命周期 - 创建完成(可以访问当前this实例)
@@ -1506,11 +1593,13 @@ export default {
   }
 
   .list_msgBox1 {
+    padding: 0 10px;
     display: flex;
     margin-top: 22px;
     justify-content: flex-end;
   }
   .list_msgBox2 {
+    padding: 0 10px;
     display: flex;
     margin-top: 22px;
   }

File diff suppressed because it is too large
+ 246 - 242
minggao/src/page/commandCenter/taskRegulator.vue


+ 84 - 73
minggao/src/page/homepage/facilitydistribute.vue

@@ -15,16 +15,16 @@
     <div class="amap-demo" id="mapContainer2"></div>
     <div class="searchbox">
       <el-select
-        v-model="inoffvalue"
-        placeholder="请选择所在监测点"
+        v-model="typevalue"
+        placeholder="请选择设备类型"
         size="mini"
         @change="search"
       >
         <el-option
-          v-for="item in inoffoptions"
-          :key="item.point_id"
-          :label="item.point_name"
-          :value="item.point_id"
+          v-for="item in typeoptions"
+          :key="item.type_id"
+          :label="item.type_name"
+          :value="item.type_id"
         >
         </el-option>
       </el-select>
@@ -57,19 +57,20 @@
         </el-option>
       </el-select>
       <el-select
-        v-model="typevalue"
-        placeholder="请选择设备类型"
+        v-model="inoffvalue"
+        placeholder="请选择所在监测点"
         size="mini"
         @change="search"
       >
         <el-option
-          v-for="item in typeoptions"
-          :key="item.type_id"
-          :label="item.type_name"
-          :value="item.type_id"
+          v-for="item in inoffoptions"
+          :key="item.point_id"
+          :label="item.point_name"
+          :value="item.point_id"
         >
         </el-option>
       </el-select>
+
       <div class="inputbox">
         <el-input
           v-model="idinput"
@@ -84,13 +85,13 @@
       <div class="tallybox_item">
         <img src="../../../static/images/homepage/cbd.png" alt="" />
         <p>
-          测报灯:<span style="color: #27c2ff">{{ cbdnum }}台</span>
+          智能测报灯:<span style="color: #27c2ff">{{ cbdnum }}台</span>
         </p>
       </div>
       <div class="tallybox_item">
         <img src="../../../static/images/homepage/ybq.png" alt="" />
         <p>
-          诱捕器:<span style="color: #ff00ff">{{ ybqnum }}台</span>
+          实蝇诱捕器:<span style="color: #ff00ff">{{ ybqnum }}台</span>
         </p>
       </div>
       <div class="tallybox_item">
@@ -130,7 +131,7 @@
                 'background-color':
                   tracklistdata_backups[trackpage] &&
                   tracklistdata_backups[trackpage][index] &&
-                  tracklistdata_backups[trackpage][index].color,
+                  tracklistdata_backups[trackpage][index].color
               }"
             >
               {{ item.user_name.slice(0, 1) }}
@@ -143,7 +144,7 @@
                 tracklistdata_backups[trackpage][index] &&
                 tracklistdata_backups[trackpage][index].type &&
                 'tracklist_btn tracklist_btn_none') ||
-              'tracklist_btn'
+                'tracklist_btn'
             "
             @click="seeteack(item, index)"
           >
@@ -152,7 +153,7 @@
                 tracklistdata_backups[trackpage][index] &&
                 tracklistdata_backups[trackpage][index].type &&
                 '关闭') ||
-              '查看轨迹'
+                '查看轨迹'
             }}
           </div>
         </div>
@@ -323,12 +324,12 @@ export default {
       stateoptions: [
         {
           value: '0',
-          label: '停用(离线)',
+          label: '停用(离线)'
         },
         {
           value: '1',
-          label: '正常(在线)',
-        },
+          label: '正常(在线)'
+        }
       ], //设备状态列表
       typevalue: '', //设备类型
       typeoptions: [], //设备类型 列表
@@ -340,11 +341,11 @@ export default {
             ah: '',
             ds: '',
             ws: '',
-            csq: '',
+            csq: ''
           },
           uptime: '',
-          pest_list: [],
-        },
+          pest_list: []
+        }
       ], //设备详情
       loading: false,
       device_type_id: 0,
@@ -382,21 +383,21 @@ export default {
         'rgb(97, 76, 115)',
         'rgb(9, 117, 139)',
         'rgb(165, 7, 62)',
-        'rgb(7, 107, 42)',
+        'rgb(7, 107, 42)'
       ],
       trackpage: 1,
       pagekey: 1,
       total: 8,
       tracklistdata_backups: {},
       arealistmouse: {},
-      trackloading: true,
+      trackloading: true
     };
   },
   //监听属性 类似于data概念
   computed: {},
   //监控data中的数据变化
   watch: {
-    pietf: function (val) {
+    pietf: function(val) {
       // console.log(this.width)
       if (val) {
         this.width = '500px';
@@ -417,14 +418,14 @@ export default {
       }
       // console.log(this.width)
     },
-    device_type_id: function (val) {
+    device_type_id: function(val) {
       // console.log(val);
       if (val != 6) {
         if (this.myVideo2[`myPlayer`]) {
           this.myVideo2[`myPlayer`].stop();
         }
       }
-    },
+    }
   },
   //方法集合
   methods: {
@@ -467,14 +468,14 @@ export default {
         zoom: 11,
         lang: 'en',
         mapStyle: 'amap://styles/fresh',
-        layers: [],
+        layers: []
       });
       //new AMap.TileLayer.Satellite(),new AMap.TileLayer.RoadNet()
       AMap.plugin(['AMap.ToolBar', 'AMap.Geocoder'], () => {
         map.addControl(new AMap.ToolBar());
         this.geocoder = new AMap.Geocoder({
           city: '全国',
-          radius: 1000,
+          radius: 1000
         });
       });
       AMap.plugin(['AMap.MouseTool'], () => {
@@ -491,15 +492,16 @@ export default {
       // this.pestboxloading = true
       this.$axios({
         method: 'POST',
-        url: '/api/api_gateway?method=monitor_manage.home_map.device_distribute_new',
+        url:
+          '/api/api_gateway?method=monitor_manage.home_map.device_distribute_new',
         data: this.qs.stringify({
           trap_number: this.idinput, //              非必传(string)               设备编号 搜索项
           point_id: this.inoffvalue, //                  非必传(string)               设备所属监测点id 搜索项
           org_id: this.versionsvalue2, //                    非必传(string)               设备所属组织id   搜索项
           trap_status: this.statevalue, //               非必传(num)                  诱捕器状态  0停用 1正常 搜索项
-          type_id: this.typevalue, //                   非必传(num)                  3测报灯  4诱捕器  6监控 搜索项
-        }),
-      }).then((res) => {
+          type_id: this.typevalue //                   非必传(num)                  3测报灯  4诱捕器  6监控 搜索项
+        })
+      }).then(res => {
         // this.init(res.data.data);
         console.log(res.data.data);
         var resdata = res.data.data;
@@ -548,18 +550,25 @@ export default {
         icon = '../../../static/images/homepage/jk.png';
         this.jknum++;
       }
+
+      var iconInstance = new AMap.Icon({
+        size: new AMap.Size(18, 23), // 图标尺寸
+        imageSize: new AMap.Size(16, 20),
+        image: icon // Icon的图像
+      });
+
       var marker = new AMap.Marker({
         position: new AMap.LngLat(
           this.ToDigital(data.lng),
           this.ToDigital(data.lat)
         ),
         offset: new AMap.Pixel(-10, -10),
-        icon: icon, // 添加 Icon 图标 URL
+        icon: iconInstance, // 添加 Icon 图标 URL
         title: '设备标点',
         d_id: data.d_id,
-        type_id: data.device_type_id,
+        type_id: data.device_type_id
       });
-      marker.on('click', (e) => {
+      marker.on('click', e => {
         console.log(e.target._originOpts.title);
         this.device_type_id = e.target._originOpts.type_id;
         this.pietf = true;
@@ -594,9 +603,9 @@ export default {
         method: 'POST',
         url: '/api/api_gateway?method=monitor_manage.trap_manage.trap_org',
         data: this.qs.stringify({
-          page_item: '1000000',
-        }),
-      }).then((res) => {
+          page_item: '1000000'
+        })
+      }).then(res => {
         // console.log(res.data.data);
         this.versionsoptions2 = res.data.data.org_data;
         this.inoffoptions = res.data.data.point_data;
@@ -605,8 +614,9 @@ export default {
     gettype() {
       this.$axios({
         method: 'POST',
-        url: '/api/api_gateway?method=monitor_manage.home_map.home_map_device_type',
-      }).then((res) => {
+        url:
+          '/api/api_gateway?method=monitor_manage.home_map.home_map_device_type'
+      }).then(res => {
         // console.log(res.data.data);
         this.typeoptions = res.data.data;
         this.initmap();
@@ -617,11 +627,12 @@ export default {
       this.loading = true;
       this.$axios({
         method: 'POST',
-        url: '/api/api_gateway?method=monitor_manage.home_map.device_distribute_details',
+        url:
+          '/api/api_gateway?method=monitor_manage.home_map.device_distribute_details',
         data: this.qs.stringify({
-          d_id: d_id,
-        }),
-      }).then((res) => {
+          d_id: d_id
+        })
+      }).then(res => {
         // console.log(res.data.data);
         this.loading = false;
         this.baseinfo = res.data.data;
@@ -689,35 +700,35 @@ export default {
               icon: new AMap.Icon({
                 size: new AMap.Size(19, 31), //图标大小
                 imageSize: new AMap.Size(19, 31),
-                image: '//webapi.amap.com/theme/v1.3/markers/b/start.png',
+                image: '//webapi.amap.com/theme/v1.3/markers/b/start.png'
               }),
-              offset: new AMap.Pixel(-9, -31),
+              offset: new AMap.Pixel(-9, -31)
             },
             endMarkerOptions: {
               //可缺省
               icon: new AMap.Icon({
                 size: new AMap.Size(19, 31), //图标大小
                 imageSize: new AMap.Size(19, 31),
-                image: '//webapi.amap.com/theme/v1.3/markers/b/end.png',
+                image: '//webapi.amap.com/theme/v1.3/markers/b/end.png'
               }),
-              offset: new AMap.Pixel(-9, -31),
+              offset: new AMap.Pixel(-9, -31)
             },
             midMarkerOptions: {
               //可缺省
               icon: new AMap.Icon({
                 size: new AMap.Size(19, 31), //图标大小
                 imageSize: new AMap.Size(19, 31),
-                image: '//webapi.amap.com/theme/v1.3/markers/b/mid.png',
+                image: '//webapi.amap.com/theme/v1.3/markers/b/mid.png'
               }),
-              offset: new AMap.Pixel(-9, -31),
+              offset: new AMap.Pixel(-9, -31)
             },
             lineOptions: {
               //可缺省
               strokeStyle: 'solid',
               strokeColor: '#FF33FF',
               strokeOpacity: 1,
-              strokeWeight: 2,
-            },
+              strokeWeight: 2
+            }
             //同 RangingTool 的 自定义 设置,缺省为默认样式
           });
           break;
@@ -736,7 +747,7 @@ export default {
             strokeOpacity: 0.5,
             fillColor: '#1791fc',
             fillOpacity: 0.4,
-            strokeStyle: 'solid',
+            strokeStyle: 'solid'
           });
           break;
         }
@@ -744,7 +755,7 @@ export default {
     },
     drawend() {
       var mouseTool = this.mouseTool;
-      mouseTool.on('draw', (ev) => {
+      mouseTool.on('draw', ev => {
         // 确定时测量面积鼠标工具
         if (ev.obj.CLASS_NAME === 'Overlay.Polygon') {
           const id = ev.obj._amap_id;
@@ -756,7 +767,7 @@ export default {
             position: new AMap.LngLat(position[0], position[1]),
             icon: 'https://webapi.amap.com/images/destroy.png',
             offset: new AMap.Pixel(-7, 7),
-            id: id,
+            id: id
           });
           // 计算区域面积
           var area =
@@ -767,11 +778,11 @@ export default {
           text = new AMap.Text({
             position: center,
             text: area + '平方公里',
-            offset: new AMap.Pixel(-20, -20),
+            offset: new AMap.Pixel(-20, -20)
           });
           this.map.add(text);
           this.map.add(marker);
-          marker.on('click', (e) => {
+          marker.on('click', e => {
             var ids = e.target._originOpts.id;
             this.map.remove(this.arealistmouse[ids].text);
             this.map.remove(this.arealistmouse[ids].marker);
@@ -780,7 +791,7 @@ export default {
           var obj = {
             text: text,
             marker: marker,
-            mouse: ev.obj,
+            mouse: ev.obj
           };
           this.arealistmouse[id] = obj;
         }
@@ -792,7 +803,7 @@ export default {
       let X = 0;
       let Y = 0;
       let Z = 0;
-      PolygonArr.forEach((lnglat) => {
+      PolygonArr.forEach(lnglat => {
         let lng = (lnglat[0] * Math.PI) / 180;
         let lat = (lnglat[1] * Math.PI) / 180;
         let x, y, z;
@@ -822,9 +833,9 @@ export default {
         data: this.qs.stringify({
           create_time: this.tracktime,
           page: this.trackpage,
-          page_item: '5',
-        }),
-      }).then((res) => {
+          page_item: '5'
+        })
+      }).then(res => {
         console.log(res.data.data);
         var data = res.data.data.page_list;
         // if(data.length){
@@ -841,7 +852,7 @@ export default {
             var obj = {
               type: false,
               color: colorlist[i],
-              walk_list_arr: [],
+              walk_list_arr: []
             };
             arr.push(obj);
           }
@@ -888,8 +899,8 @@ export default {
         console.log(
           this.tracklistdata_backups[this.trackpage][index].walk_list_arr
         );
-        var walk_list_arr =
-          this.tracklistdata_backups[this.trackpage][index].walk_list_arr;
+        var walk_list_arr = this.tracklistdata_backups[this.trackpage][index]
+          .walk_list_arr;
         for (var i = 0; i < walk_list_arr.length; i++) {
           this.map.remove(walk_list_arr[i]);
         }
@@ -898,8 +909,8 @@ export default {
         console.log(this.tracklistdata_backups[this.trackpage][index].type);
         this.initteack_info(data.walk_list, index);
       }
-      this.tracklistdata_backups[this.trackpage][index].type =
-        !this.tracklistdata_backups[this.trackpage][index].type;
+      this.tracklistdata_backups[this.trackpage][index].type = !this
+        .tracklistdata_backups[this.trackpage][index].type;
     },
     //绘制路径
     initteack_info(walk_list, index) {
@@ -918,7 +929,7 @@ export default {
           strokeColor: this.tracklistdata_backups[this.trackpage][index].color, //线颜色
           strokeOpacity: 1, //线透明度
           strokeWeight: 6, //线宽
-          zIndex: 51,
+          zIndex: 51
         });
         this.tracklistdata_backups[this.trackpage][index].walk_list_arr.push(
           polyline2
@@ -932,7 +943,7 @@ export default {
       month = month < 10 ? '0' + month : month;
       day = day < 10 ? '0' + day : day;
       return years + '-' + month + '-' + day;
-    },
+    }
   },
   beforeCreate() {}, //生命周期 - 创建之前
   //生命周期 - 创建完成(可以访问当前this实例)
@@ -960,7 +971,7 @@ export default {
       this.myVideo2[`myPlayer`].stop();
     }
   }, //生命周期 - 销毁完成
-  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
 };
 </script>
 <style lang="less" scoped>
@@ -1230,4 +1241,4 @@ export default {
 /deep/.amap-controls {
   display: none !important;
 }
-</style>
+</style>

+ 24 - 10
minggao/src/page/recordForm/fieldSurveys.vue

@@ -225,7 +225,7 @@
               <!-- <el-input v-model="baseForm.lng"></el-input> -->
               <el-input-number
                 v-model="baseForm.lng"
-                :precision="2"
+                :precision="5"
                 :step="0.1"
                 :min="0.1"
                 :max="999999999"
@@ -237,7 +237,7 @@
               <!-- <el-input v-model="baseForm.lat"></el-input> -->
               <el-input-number
                 v-model="baseForm.lat"
-                :precision="2"
+                :precision="5"
                 :step="0.1"
                 :min="0.1"
                 :max="999999999"
@@ -284,7 +284,7 @@
             v-model="baseForm.inspect_area"
             :precision="2"
             :step="0.1"
-            :min="0.1"
+            :min="0"
             :max="999999999"
           ></el-input-number>
         </el-form-item>
@@ -330,7 +330,7 @@
             v-model="baseForm.occurs_area"
             :precision="2"
             :step="0.1"
-            :min="0.1"
+            :min="0"
             :max="999999999"
           ></el-input-number>
         </el-form-item>
@@ -377,7 +377,7 @@
             v-model="baseForm.harm_rate"
             :precision="2"
             :step="0.1"
-            :min="0.1"
+            :min="0"
             :max="100"
           ></el-input-number>
         </el-form-item>
@@ -463,12 +463,21 @@ export default {
       },
       rules: {
         inspect_name: [
-          { required: true, message: '请输入踏查点名称', trigger: 'blur' },
-          { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' }
+          { required: true, message: '请输入踏查点名称', trigger: 'blur' }
+          // { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' }
+        ],
+        lng: [
+          { required: true, message: '请输入经度', trigger: 'blur' }
+          // { max: 50, message: '长度在 最多 50 个字符', trigger: 'blur' }
+        ],
+        lat: [
+          { required: true, message: '请输入纬度', trigger: 'blur' }
+          // { max: 50, message: '长度在 最多 50 个字符', trigger: 'blur' }
+        ],
+        height: [
+          { required: true, message: '请输入海拔', trigger: 'blur' }
+          // { max: 50, message: '长度在 最多 50 个字符', trigger: 'blur' }
         ],
-        // lng: [{ required: true, message: '请输入经度', trigger: 'blur' }],
-        // lat: [{ required: true, message: '请输入纬度', trigger: 'blur' }],
-        // height: [{ required: true, message: '请输入海拔', trigger: 'blur' }],
         inspect_area: [
           { required: true, message: '请输入踏查点面积', trigger: 'blur' }
         ],
@@ -613,6 +622,11 @@ export default {
         return;
       }
 
+      if (!this.tableData.length) {
+        this.$message.error('当前无数据可导出');
+        return;
+      }
+
       this.exportLoading = true;
       this.$axios({
         method: 'POST',

+ 5 - 0
minggao/src/page/recordForm/sampleAppraisal.vue

@@ -331,6 +331,11 @@ export default {
         return;
       }
 
+      if (!this.tableData.length) {
+        this.$message.error('当前无数据可导出');
+        return;
+      }
+
       let payload = {
         sample_ids: ''
       };

+ 27 - 5
minggao/src/page/recordForm/samplePlot.vue

@@ -210,7 +210,7 @@
               <!-- <el-input v-model="baseForm.lng"></el-input> -->
               <el-input-number
                 v-model="baseForm.lng"
-                :precision="2"
+                :precision="5"
                 :step="0.1"
                 :min="0.1"
                 :max="999999999"
@@ -222,7 +222,7 @@
               <!-- <el-input v-model="baseForm.lat"></el-input> -->
               <el-input-number
                 v-model="baseForm.lat"
-                :precision="2"
+                :precision="5"
                 :step="0.1"
                 :min="0.1"
                 :max="999999999"
@@ -348,7 +348,6 @@
                 <el-input-number
                   :precision="2"
                   :step="1"
-                  :min="0.1"
                   :max="999999999"
                   @change="value => handleInputChange(value, scope.row)"
                   v-model="scope.row.num_1"
@@ -375,7 +374,6 @@
                 <el-input-number
                   :precision="2"
                   :step="1"
-                  :min="0.1"
                   :max="999999999"
                   @change="value => handleInputChange(value, scope.row)"
                   v-model="scope.row.num_2"
@@ -402,7 +400,6 @@
                 <el-input-number
                   :precision="2"
                   :step="1"
-                  :min="0.1"
                   :max="999999999"
                   @change="value => handleInputChange(value, scope.row)"
                   v-model="scope.row.num_3"
@@ -660,6 +657,26 @@ export default {
         ],
         harm_crop: [
           { max: 50, message: '长度在 最多 50 个字符', trigger: 'blur' }
+        ],
+        lng: [
+          { required: true, message: '请输入经度', trigger: 'blur' }
+          // { max: 50, message: '长度在 最多 50 个字符', trigger: 'blur' }
+        ],
+        lat: [
+          { required: true, message: '请输入纬度', trigger: 'blur' }
+          // { max: 50, message: '长度在 最多 50 个字符', trigger: 'blur' }
+        ],
+        height: [
+          { required: true, message: '请输入海拔', trigger: 'blur' }
+          // { max: 50, message: '长度在 最多 50 个字符', trigger: 'blur' }
+        ],
+        occurs_list: [
+          {
+            type: 'array',
+            required: true,
+            message: '请选择发生境',
+            trigger: 'change'
+          }
         ]
       },
       habitatList: [
@@ -789,6 +806,11 @@ export default {
         return;
       }
 
+      if (!this.tableData.length) {
+        this.$message.error('当前无数据可导出');
+        return;
+      }
+
       let payload = {
         as_ids: ''
       };

+ 19 - 2
minggao/src/page/recordForm/trapRecord.vue

@@ -202,7 +202,7 @@
                 <!-- <el-input v-model="baseForm.lng"></el-input> -->
                 <el-input-number
                   v-model="baseForm.lng"
-                  :precision="2"
+                  :precision="5"
                   :step="0.1"
                   :min="0.1"
                   :max="999999999"
@@ -213,7 +213,7 @@
               <el-form-item label="纬度:" prop="lat">
                 <el-input-number
                   v-model="baseForm.lat"
-                  :precision="2"
+                  :precision="5"
                   :step="0.1"
                   :min="0.1"
                   :max="999999999"
@@ -479,6 +479,18 @@ export default {
         inducer_name: [
           { required: true, message: '请输入诱剂名称', trigger: 'blur' },
           { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' }
+        ],
+        lng: [
+          { required: true, message: '请输入经度', trigger: 'blur' }
+          // { max: 50, message: '长度在 最多 50 个字符', trigger: 'blur' }
+        ],
+        lat: [
+          { required: true, message: '请输入纬度', trigger: 'blur' }
+          // { max: 50, message: '长度在 最多 50 个字符', trigger: 'blur' }
+        ],
+        height: [
+          { required: true, message: '请输入海拔', trigger: 'blur' }
+          // { max: 50, message: '长度在 最多 50 个字符', trigger: 'blur' }
         ]
       },
       habitatList: [
@@ -569,6 +581,11 @@ export default {
         return;
       }
 
+      if (!this.tableData.length) {
+        this.$message.error('当前无数据可导出');
+        return;
+      }
+
       let payload = {
         tc_ids: ''
       };

+ 1 - 0
minggao/src/util/http.js

@@ -64,6 +64,7 @@ axios.interceptors.response.use(
     // console.log(res.data.message)
     if (res.data.message != '' && res.data.message != undefined) {
       if (res.data.errorCode == 403) {
+        localStorage.removeItem('session');
         setTimeout(() => {
           router.push('/Login');
         }, 3000);