Selaa lähdekoodia

地理信息模块开发 9/18

zhangyun 4 vuotta sitten
vanhempi
commit
30df909478

+ 3 - 2
config/index.js

@@ -12,9 +12,10 @@ module.exports = {
     proxyTable: {
       '/api': {
         // target: 'http://182.92.193.64:8002/',
-        target: 'http://192.168.1.77:8000/',
+        // target: 'http://192.168.1.76:8000/',
         // target: 'http://8.136.98.49:8005/',
         // target: "http://182.92.193.64:8002", //测试环境
+        target:'http://192.168.1.200:8005',
         changeOrigin: true,
         pathRewrite: {
           '^/api': '/api' //重写接口
@@ -23,7 +24,7 @@ module.exports = {
     },
 
     // Various Dev Server settings
-    host: '192.168.1.116', // can be overwritten by process.env.HOST
+    host: '192.168.3.20', // can be overwritten by process.env.HOST
     port: 8000, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
     autoOpenBrowser: false,
     errorOverlay: true,

+ 5 - 2
index.html

@@ -12,12 +12,15 @@
     <meta name="format-detection" content="telephone=no, email=no"/>
     <script src="./static/js/ezuikit.js"></script>
     <!-- <script src="https://webapi.amap.com/maps?v=2.0&key=3939967b919a8003377dd113fc445a3d&plugin=AMap.PolygonEditor,AMap.DistrictSearch"></script> -->
-    <script src="https://webapi.amap.com/maps?v=1.4.15&key=3939967b919a8003377dd113fc445a3d&plugin=AMap.PolygonEditor,AMap.DistrictSearch,AMap.Geocoder"></script>
-    <script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=dpxgaz5jyHbmg7cVAXjbxjVmOZp7TGcd"></script>
+    <script src="https://webapi.amap.com/maps?v=1.4.15&key=3939967b919a8003377dd113fc445a3d&plugin=AMap.PolygonEditor,AMap.DistrictSearch,AMap.Geocoder,AMap.PolyEditor"></script>
+    <!-- <script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=dpxgaz5jyHbmg7cVAXjbxjVmOZp7TGcd"></script> -->
     <!-- UI组件库 1.0 -->
     <!-- <script src="//webapi.amap.com/ui/1.1/main.js?v=1.1.1"></script> -->
     <!-- <script src="//webapi.amap.com/ui/1.1/main.js?v=1.1.1"></script> -->
     <script src="//webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
+    <script src="https://openlayers.org/en/v3.20.1/build/ol.js"></script>
+    <script src="https://unpkg.com/gcoord/dist/gcoord.js"></script>
+
     <style>
     .figEldialog .el-dialog{
       background: rgba(12, 20, 44, 0.8);

+ 327 - 283
src/components/index.vue

@@ -7,35 +7,42 @@
         <!-- logo -->
         <div class="logoinfo">
           <div>
-            <img :src="$imghost + logoIcon" width="40" alt v-if="!loginInfo.role_logo" />
+            <img
+              :src="$imghost + logoIcon"
+              width="40"
+              alt
+              v-if="!loginInfo.role_logo"
+            />
             <img :src="loginInfo.role_logo" v-else width="40px" />
-            <span>{{ loginInfo.role_header || "河南省高标准农田管理系统" }}</span>
+            <span>{{
+              loginInfo.role_header || "河南省高标准农田管理系统"
+            }}</span>
           </div>
           <!-- {{menuTabs}} -->
         </div>
         <!-- 菜单 -->
         <ul class="topMenu">
           <li
-            v-for="(item,index) in menuList"
+            v-for="(item, index) in menuList"
             :key="item.index"
-            :class="{'active':item.name==currTopMenuId}"
+            :class="{ active: item.name == currTopMenuId }"
             :id="'nav' + index"
-            v-trigger="(that)"
-            @click="topMenuClick(item,index)"
+            v-trigger="that"
+            @click="topMenuClick(item, index)"
           >
             <div class="navContent">
               <div class="a1">
                 <div class="blueMenu">
-                  <img src="../../static/images/indexTab.png" alt="" >
+                  <img src="../../static/images/indexTab.png" alt="" />
                 </div>
               </div>
               <div class="a2">
                 <div class="blueMenu indexTabActive">
-                  <img src="../../static/images/indexTabActive.png" alt="" >
+                  <img src="../../static/images/indexTabActive.png" alt="" />
                 </div>
               </div>
-              
-              <div class="navTxt">{{item.name}}</div>
+
+              <div class="navTxt">{{ item.name }}</div>
             </div>
           </li>
           <!-- <li
@@ -52,14 +59,14 @@
         </ul>
         <div class="userInfo">
           欢迎您!
-          <el-dropdown  @command="dropdownHandle" >
+          <el-dropdown @command="dropdownHandle">
             <span class="el-dropdown-link">
-              {{username}}
+              {{ username }}
               <i class="el-icon-arrow-down el-icon--right"></i>
             </span>
             <el-dropdown-menu slot="dropdown">
-                <el-dropdown-item command="personMsg">个人中心</el-dropdown-item>
-                <el-dropdown-item command="editPwd">修改密码</el-dropdown-item>
+              <el-dropdown-item command="personMsg">个人中心</el-dropdown-item>
+              <el-dropdown-item command="editPwd">修改密码</el-dropdown-item>
             </el-dropdown-menu>
           </el-dropdown>
           <div class="exit" @click="outSys()">
@@ -110,19 +117,25 @@
           <li
             v-for="(item, index) in leftMenuList"
             :key="item.path"
-            :class="{'active':item.name==currLeftMenuId}"
-            @click="leftMenuClick(item,index)"
+            :class="{ active: item.name == currLeftMenuId }"
+            @click="leftMenuClick(item, index)"
           >
             <i :class="['iconfont', iconimgs[item.pur_id]]"></i>
-            <div>{{item.name}}</div>
+            <div>{{ item.name }}</div>
           </li>
         </ul>
       </el-aside>
       <el-main>
         <div class="tabsNav">
-          <el-tabs v-model="menuTabsValue" type="card" closable @tab-click="clickTab" @tab-remove="removeTab">
+          <el-tabs
+            v-model="menuTabsValue"
+            type="card"
+            closable
+            @tab-click="clickTab"
+            @tab-remove="removeTab"
+          >
             <el-tab-pane
-              v-for="(item, index) in menuTabs"
+              v-for="item in menuTabs"
               :key="item.path"
               :label="item.name"
               :name="item.name"
@@ -130,14 +143,14 @@
           </el-tabs>
         </div>
         <div class="content">
-            <!-- <div>{{menuTabsValue}}</div> -->
-            <!-- <keep-alive> -->
-              <!-- <router-view></router-view> -->
-            <!-- </keep-alive> -->
-            <keep-alive>
-              <router-view v-if="$route.meta.keepAlive"></router-view>
-            </keep-alive>
-            <router-view v-if="!$route.meta.keepAlive"></router-view>
+          <!-- <div>{{menuTabsValue}}</div> -->
+          <!-- <keep-alive> -->
+          <!-- <router-view></router-view> -->
+          <!-- </keep-alive> -->
+          <keep-alive>
+            <router-view v-if="$route.meta.keepAlive"></router-view>
+          </keep-alive>
+          <router-view v-if="!$route.meta.keepAlive"></router-view>
         </div>
       </el-main>
     </el-container>
@@ -147,7 +160,7 @@
 <script>
 //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
 //例如:import 《组件名称》 from '《组件路径》';
-import '@/plugin/flexible.js'
+import "@/plugin/flexible.js";
 export default {
   //import引入的组件需要注入到对象中才能使用
   components: {},
@@ -177,45 +190,46 @@ export default {
       logoIcon: "/images/logo.png",
       menuList: [],
       leftMenuList: [],
-      currTopMenuId: '农林植保',
-      currLeftMenuId: '设备列表',
+      currTopMenuId: "农林植保",
+      currLeftMenuId: "设备列表",
       iconimgs: {
-        "1": 'icon-dingdianxuncha',
-        "2": 'icon-dingdianxuncha',
-        "100": 'icon-dingdianxuncha',
-        "3": 'icon-shipinwulian',
-        "4": 'icon-shipinwulian',
-        "5": 'icon-yujing',
-        "101": 'icon-yujing',
-        "6": 'icon-yujing',
-        "7": 'icon-shebeibaoyan',
-        "8": 'icon-xingxiang',
-        "9": 'icon-rizhi',
-        "10": 'icon-shuizhi',
-        "102": 'icon-shuizhi',
-        "11": 'icon-shuizhi',
-        "12": 'icon-rizhi',
-        "13": 'icon-yujing',
-        "14": 'icon-1',
-        "15": 'icon-1',
-        "16": 'icon-yen-2',
-        "17": 'icon-inbox-1',
-        "18": 'icon-inbox-1',
-        "19": 'icon-inbox-1',
-        "20": 'icon-yonghu2',
-        "21": 'icon-yonghu2',
-        "22": 'icon-moxingguanli',
-        "23": 'icon-shiming',
-        "24": 'icon-BIM',
+        1: "icon-dingdianxuncha",
+        2: "icon-dingdianxuncha",
+        100: "icon-dingdianxuncha",
+        3: "icon-shipinwulian",
+        4: "icon-shipinwulian",
+        5: "icon-yujing",
+        101: "icon-yujing",
+        6: "icon-yujing",
+        7: "icon-shebeibaoyan",
+        8: "icon-xingxiang",
+        9: "icon-rizhi",
+        10: "icon-shuizhi",
+        102: "icon-shuizhi",
+        11: "icon-shuizhi",
+        12: "icon-rizhi",
+        13: "icon-yujing",
+        14: "icon-1",
+        15: "icon-1",
+        16: "icon-yen-2",
+        17: "icon-inbox-1",
+        18: "icon-inbox-1",
+        19: "icon-inbox-1",
+        20: "icon-yonghu2",
+        21: "icon-yonghu2",
+        22: "icon-moxingguanli",
+        23: "icon-shiming",
+        24: "icon-BIM",
+        25: "icon-BIM",
       },
       //动态标签
       // menuTabs:[{ "path": "/plantGuard/base", "name": "设备列表", "par": "农林植保", "order": 0 } ],
-      menuTabs:[],
-      menuTabsValue:'',
-      username:"",
+      menuTabs: [],
+      menuTabsValue: "",
+      username: "",
       // 用户信息
-      loginInfo:{},
-      resetPassDialogVisible:false,
+      loginInfo: {},
+      resetPassDialogVisible: false,
       resetPassForm: {
         oldPass: "",
         newPass: "",
@@ -240,47 +254,51 @@ export default {
   computed: {},
   //监控data中的数据变化
   watch: {
-    '$route' (to, from) {
-         console.log('--------------');
-         console.log(to.meta.keepAlive);
-      let flag = false
+    $route(to, from) {
+      console.log("--------------");
+      console.log(to.meta.keepAlive);
+      let flag = false;
       for (let item of this.menuTabs) {
         if (item.name === to.meta.navname) {
-          this.menuTabsValue = to.meta.navname
-          flag = true
-          break
+          this.menuTabsValue = to.meta.navname;
+          flag = true;
+          break;
         }
       }
       console.log(this.menuList);
-      
-      if (!flag) {  
+
+      if (!flag) {
         var breakFlag = false;
-        for(var i = 0 ;i<this.menuList.length;i++){
-          if(!this.menuList[i].children){
+        for (var i = 0; i < this.menuList.length; i++) {
+          if (!this.menuList[i].children) {
             continue;
           }
-          for(var j = 0 ;j<this.menuList[i].children.length;j++){
-            if(this.menuList[i].children[j].name == to.meta.navname){
+          for (var j = 0; j < this.menuList[i].children.length; j++) {
+            if (this.menuList[i].children[j].name == to.meta.navname) {
               console.log(i);
-              
+
               var order = i;
               breakFlag = true;
               break;
             }
           }
-          if(breakFlag){
+          if (breakFlag) {
             break;
           }
         }
 
-        
-        this.add_tabs({path: to.path, name: to.meta.navname,par:to.meta.title,order:order})
-        this.menuTabsValue = to.meta.navname
+        this.add_tabs({
+          path: to.path,
+          name: to.meta.navname,
+          par: to.meta.title,
+          order: order,
+        });
+        this.menuTabsValue = to.meta.navname;
       }
 
       sessionStorage.setItem("menuTabs", JSON.stringify(this.menuTabs));
       sessionStorage.setItem("menuTabsValue", this.menuTabsValue);
-    }
+    },
   },
   //vue自定义指令
   directives: {
@@ -288,13 +306,15 @@ export default {
       inserted(el, binging) {
         var menuTabsValue = sessionStorage.getItem("menuTabsValue");
         var menuTabs = sessionStorage.getItem("menuTabs");
-        if(menuTabs){
-          binging.value.that.menuTabs = JSON.parse(menuTabs)
-          binging.value.that.menuTabsValue = menuTabsValue
-          binging.value.that.leftMenuList = JSON.parse(sessionStorage.getItem("leftMenuList"));
-          binging.value.that.currLeftMenuId = sessionStorage.getItem("currLeftMenuId");
-          
-        }else{
+        if (menuTabs) {
+          binging.value.that.menuTabs = JSON.parse(menuTabs);
+          binging.value.that.menuTabsValue = menuTabsValue;
+          binging.value.that.leftMenuList = JSON.parse(
+            sessionStorage.getItem("leftMenuList")
+          );
+          binging.value.that.currLeftMenuId =
+            sessionStorage.getItem("currLeftMenuId");
+        } else {
           el.id == "nav0" ? el.click() : null; // 只点击第一个,id是在循环中手动添加的
           console.log(2);
         }
@@ -306,125 +326,125 @@ export default {
     topMenuClick(item, index) {
       // console.log(item);
       // console.log(this.$router.options.routes);
-      
-      if(item.children){
-        this.$router.options.routes.forEach(route => { 
-          if(route.children && route.children.length){
-            route.children.forEach(child => { 
-              if(child.meta){
-                if(child.meta.navname == item.children[0].name){
+
+      if (item.children) {
+        this.$router.options.routes.forEach((route) => {
+          if (route.children && route.children.length) {
+            route.children.forEach((child) => {
+              if (child.meta) {
+                if (child.meta.navname == item.children[0].name) {
                   child.meta.keepAlive = false;
                 }
               }
-            })
+            });
           }
-        }) 
+        });
 
         this.currTopMenuId = item.name;
         this.leftMenuList = item.children;
         this.currLeftMenuId = item.children[0].name;
         sessionStorage.setItem("leftMenuList", JSON.stringify(item.children));
         sessionStorage.setItem("currLeftMenuId", item.children[0].name);
-        this.$router.push({ path: '/plantGuard/'+item.children[0].path });
-      }else if(item.name == '产品溯源'){
+        this.$router.push({ path: "/plantGuard/" + item.children[0].path });
+      } else if (item.name == "产品溯源") {
         // var routeUrl = this.$router.resolve({
         //   path: '/index/farmBaseManger'
         // })
         // window.open(routeUrl.href, '_blank')
-        window.open('http://182.92.193.64/#/syLogin')
-
-      }else{
+        window.open("http://114.115.147.140/#/syLogin");
+      } else {
         this.$message({
-          message: '系统开发中',
-          type: 'warning'
+          message: "系统开发中",
+          type: "warning",
         });
       }
-      
     },
     leftMenuClick(item, index) {
       console.log(item);
-      
-      this.$router.options.routes.forEach(route => { 
-        if(route.children && route.children.length){
-          route.children.forEach(child => { 
-            if(child.meta){
-              if(child.meta.navname == item.name){
+
+      this.$router.options.routes.forEach((route) => {
+        if (route.children && route.children.length) {
+          route.children.forEach((child) => {
+            if (child.meta) {
+              if (child.meta.navname == item.name) {
                 child.meta.keepAlive = false;
               }
             }
-          })
+          });
         }
-      }) 
+      });
       this.currLeftMenuId = item.name;
       sessionStorage.setItem("currLeftMenuId", item.name);
-      console.log(item)
-      if(item.path=="operatData"){
-        this.$store.commit('setData',{
-          name:'ele_operat_id',
-          val:''
-        })
+      console.log(item);
+      if (item.path == "operatData") {
+        this.$store.commit("setData", {
+          name: "ele_operat_id",
+          val: "",
+        });
       }
-      this.$router.push({ path: '/plantGuard/'+item.path });
+      this.$router.push({ path: "/plantGuard/" + item.path });
     },
     //添加tab标签
-    add_tabs (data) {
-      this.menuTabs.push(data)
+    add_tabs(data) {
+      this.menuTabs.push(data);
     },
     //移除tab标签
     removeTab(targetName) {
-        let tabs = this.menuTabs;
-        let activeName = this.menuTabsValue;
-        if (activeName === targetName) {
-          tabs.forEach((tab, index) => {
-            if (tab.name === targetName) {
-              let nextTab = tabs[index + 1] || tabs[index - 1];
-              if (nextTab) {
-                activeName = nextTab.name;
-                this.$router.push({ path: nextTab.path });
-                this.menuList.forEach((item)=>{
-                  if(item.name == nextTab.par){
-                    this.leftMenuList = item.children;
-                    sessionStorage.setItem("leftMenuList", JSON.stringify(item.children));
-                  }
-                })
-                this.currTopMenuId=nextTab.par;
-                this.currLeftMenuId=nextTab.name;
-                sessionStorage.setItem("currLeftMenuId", nextTab.name);
-              }
+      let tabs = this.menuTabs;
+      let activeName = this.menuTabsValue;
+      if (activeName === targetName) {
+        tabs.forEach((tab, index) => {
+          if (tab.name === targetName) {
+            let nextTab = tabs[index + 1] || tabs[index - 1];
+            if (nextTab) {
+              activeName = nextTab.name;
+              this.$router.push({ path: nextTab.path });
+              this.menuList.forEach((item) => {
+                if (item.name == nextTab.par) {
+                  this.leftMenuList = item.children;
+                  sessionStorage.setItem(
+                    "leftMenuList",
+                    JSON.stringify(item.children)
+                  );
+                }
+              });
+              this.currTopMenuId = nextTab.par;
+              this.currLeftMenuId = nextTab.name;
+              sessionStorage.setItem("currLeftMenuId", nextTab.name);
             }
-          });
-        }
-        
-        this.menuTabsValue = activeName;
-        this.menuTabs = tabs.filter(tab => tab.name !== targetName);
+          }
+        });
+      }
+
+      this.menuTabsValue = activeName;
+      this.menuTabs = tabs.filter((tab) => tab.name !== targetName);
     },
     //切换标签
     clickTab(tab) {
-      console.log('tab')
-      console.log(tab)
-      this.$router.options.routes.forEach(route => { 
-        if(route.children && route.children.length){
-          route.children.forEach(child => { 
-            if(child.meta){
-              if(child.meta.navname == this.menuTabs[tab.index].name){
+      console.log("tab");
+      console.log(tab);
+      this.$router.options.routes.forEach((route) => {
+        if (route.children && route.children.length) {
+          route.children.forEach((child) => {
+            if (child.meta) {
+              if (child.meta.navname == this.menuTabs[tab.index].name) {
                 child.meta.keepAlive = true;
               }
             }
-          })
+          });
         }
-      })
-      this.$router.push({path: this.menuTabs[tab.index].path})
-      this.menuList.forEach((item)=>{
-        if(item.name == this.menuTabs[tab.index].par){
+      });
+      this.$router.push({ path: this.menuTabs[tab.index].path });
+      this.menuList.forEach((item) => {
+        if (item.name == this.menuTabs[tab.index].par) {
           this.leftMenuList = item.children;
           sessionStorage.setItem("leftMenuList", JSON.stringify(item.children));
         }
-      })
-      this.menuTabsValue = this.menuTabs[tab.index].name
-      this.currTopMenuId=this.menuTabs[tab.index].par;
-      this.currLeftMenuId=this.menuTabs[tab.index].name;
+      });
+      this.menuTabsValue = this.menuTabs[tab.index].name;
+      this.currTopMenuId = this.menuTabs[tab.index].par;
+      this.currLeftMenuId = this.menuTabs[tab.index].name;
       sessionStorage.setItem("currLeftMenuId", this.menuTabs[tab.index].name);
-    
     },
     // 获取用户主题
     getUserInfo() {
@@ -446,38 +466,42 @@ export default {
         url: "/api/api_gateway?method=user.login.user_login_info",
       }).then((res) => {
         if (res.data.message == "") {
-          var menuLists=res.data.data.children;
-          
+          var menuLists = res.data.data.children;
+
           let userType = res.data.data.myuser_type; //用户类型 管理员1 普通用户4
           let userName = res.data.data.username; //用户名
           let myuid = res.data.data.myuid; //用户id
-          
-          this.$store.commit('setData',{
-            name:'myuser_type',
-            val:userType
-          })
-          this.$store.commit('setData',{
-            name:'user_id',
-            val:myuid
-          })
+
+          this.$store.commit("setData", {
+            name: "myuser_type",
+            val: userType,
+          });
+          this.$store.commit("setData", {
+            name: "user_id",
+            val: myuid,
+          });
           console.log(menuLists);
-          if(userType == 4){
-            menuLists.forEach((item,index)=>{
+          if (userType == 4) {
+            menuLists.forEach((item, index) => {
               console.log(item);
               console.log(index);
-              if(item.name == '农林植保'){
-                item.children = [{
-                  "name": "植保示范点",
-                  "path": "base",
-                  "pur_id": "100"
-                }]
+              if (item.name == "农林植保") {
+                item.children = [
+                  {
+                    name: "植保示范点",
+                    path: "base",
+                    pur_id: "100",
+                  },
+                ];
               }
-              if(item.name == '灾害预警'){
-                item.children[0] = [{
-                  "name": "预警示范点",
-                  "path": "disasterWarn",
-                  "pur_id": "101"
-                }]
+              if (item.name == "灾害预警") {
+                item.children[0] = [
+                  {
+                    name: "预警示范点",
+                    path: "disasterWarn",
+                    pur_id: "101",
+                  },
+                ];
               }
 
               // if(item.name == '智能灌溉'){
@@ -487,36 +511,37 @@ export default {
               //     "pur_id": "102"
               //   }]
               // }
-              
-            })
+            });
             console.log(menuLists);
-            if(menuLists[0].children){
-              var path = "/plantGuard/"+menuLists[0].children[0].path;
+            if (menuLists[0].children) {
+              var path = "/plantGuard/" + menuLists[0].children[0].path;
               var name = menuLists[0].children[0].name;
-              var parName =  menuLists[0].name;
-              this.menuTabs = [{ "path": path, "name": name, "par": parName, "order": 0}]
-            }else{
-              for(var i = 0;i<menuLists.length;i++){
-                if(menuLists[i].children){
-                  var path = "/plantGuard/"+menuLists[i].children[0].path;
+              var parName = menuLists[0].name;
+              this.menuTabs = [
+                { path: path, name: name, par: parName, order: 0 },
+              ];
+            } else {
+              for (var i = 0; i < menuLists.length; i++) {
+                if (menuLists[i].children) {
+                  var path = "/plantGuard/" + menuLists[i].children[0].path;
                   var name = menuLists[i].children[0].name;
-                  var parName =  menuLists[i].name;
-                  this.menuTabs = [{ "path": path, "name": name, "par": parName, "order": i}];
+                  var parName = menuLists[i].name;
+                  this.menuTabs = [
+                    { path: path, name: name, par: parName, order: i },
+                  ];
                   break;
                 }
               }
-              
             }
-            
-
-          }else{
-            var path = "/plantGuard/"+menuLists[0].children[0].path;
+          } else {
+            var path = "/plantGuard/" + menuLists[0].children[0].path;
             var name = menuLists[0].children[0].name;
-            var parName =  menuLists[0].name;
-            this.menuTabs = [{ "path": path, "name": name, "par": parName, "order": 0}]
+            var parName = menuLists[0].name;
+            this.menuTabs = [
+              { path: path, name: name, par: parName, order: 0 },
+            ];
           }
-          
-          
+
           // if(menuLists[0].name=='农林植保'){
           //   if(userType == 4){
           //     menuLists[0].children= [
@@ -538,9 +563,31 @@ export default {
           //     this.menuTabs = [{ "path": "/plantGuard/baseAll", "name": "植保监测", "par": "农林植保", "order": 0 }]
           //   }
           // }
+          var items = menuLists;
+          var paths = this.$route.path  //当前路由地址
+          var Findex = paths.indexOf("/",1) // 当前地址第一个 / 的位置
+          var Sindex = paths.indexOf("/",Findex)// 当前地址第二个 / 的位置
+          var newpath = "" //获取到当前路由对用的页面
+          if(Sindex==-1){//判断是否存在第二个 /
+            newpath = paths.slice(Findex+1,Sindex) // 截取路由中当前页面的地址
+          }else{
+            newpath = paths.slice(Findex+1)// 截取路由中当前页面的地址
+          }
+          console.log(newpath)
+          for (var i = 0; i < items.length; i++) { // 循环遍历 查看对应的页面地址
+            if (items[i].children) {
+              for (var j = 0; j < items[i].children.length; j++) {
+                if (items[i].children[j].path==newpath) {
+                  console.log(items[i].name)
+                  this.currTopMenuId = items[i].name
+                }
+              }
+            }
+          }
+
+          console.log(this.$route.path);
           this.menuList = menuLists;
           console.log(this.menuList);
-          
         }
       });
     },
@@ -559,8 +606,8 @@ export default {
         url: "/api/api_gateway?method=user.login.logout_user",
       }).then((res) => {
         if (res.data.message == "") {
-          window.sessionStorage.clear()
-          window.localStorage.clear()
+          window.sessionStorage.clear();
+          window.localStorage.clear();
           this.$router.push("/login");
         }
       });
@@ -591,7 +638,6 @@ export default {
       });
     },
     resetPassDialogClosed() {},
-
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {},
@@ -610,20 +656,20 @@ export default {
   destroyed() {
     // window.removeEventListener('beforeunload', e => this.beforeunloadHandler(e))
   }, //生命周期 - 销毁完成
-  activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
 };
 </script>
 <style scoped lang="less">
 @keyframes step {
-    0% {
-        -webkit-transform: translateX(0);
-        transform: translateX(0)
-    }
+  0% {
+    -webkit-transform: translateX(0);
+    transform: translateX(0);
+  }
 
-    to {
-        -webkit-transform: translate3d(-41.625rem, 0, 0);
-        transform: translate3d(-41.625rem, 0, 0)
-    }
+  to {
+    -webkit-transform: translate3d(-41.625rem, 0, 0);
+    transform: translate3d(-41.625rem, 0, 0);
+  }
 }
 .el-header {
   background-color: #182037;
@@ -635,7 +681,7 @@ export default {
     justify-content: space-between;
     align-items: center;
     .logoinfo {
-      >div{
+      > div {
         display: flex;
         align-items: center;
       }
@@ -643,9 +689,9 @@ export default {
         vertical-align: top;
       }
       span {
-        font-size: .3rem;
-        letter-spacing: .0375rem;
-        margin-left: .125rem;
+        font-size: 0.3rem;
+        letter-spacing: 0.0375rem;
+        margin-left: 0.125rem;
       }
     }
     .topMenu {
@@ -659,23 +705,23 @@ export default {
         // width: 100px;
         width: 1.3875rem;
         // text-align: center;
-        margin: 0 .125rem;
+        margin: 0 0.125rem;
         // line-height: 20px;
 
         height: 100%;
         display: flex;
         align-items: center;
-        .navContent{
+        .navContent {
           width: 100%;
           position: relative;
         }
-        .blueMenu{
+        .blueMenu {
           position: absolute;
           width: 100%;
-          height: .4875rem;
+          height: 0.4875rem;
           overflow: hidden;
           // background: url(../../../static/images/indexTab.png);
-          img{
+          img {
             width: 41.625rem;
             animation: step 5s steps(30) infinite;
           }
@@ -683,56 +729,56 @@ export default {
         // .indexTabActive{
         //   display: none;
         // }
-        .a2{
+        .a2 {
           // display: none;
-          visibility:hidden
+          visibility: hidden;
         }
-        .navTxt{
-          line-height: .4875rem;
-          padding-left: .375rem;
-          font-size: .175rem;
+        .navTxt {
+          line-height: 0.4875rem;
+          padding-left: 0.375rem;
+          font-size: 0.175rem;
         }
       }
       .active {
         // background: #0195ff;
-        .a1{
+        .a1 {
           // display: none;
-          visibility:hidden
+          visibility: hidden;
         }
-        .a2{
+        .a2 {
           // display: block;
-          visibility:visible
+          visibility: visible;
         }
       }
       li:hover {
-        .a1{
+        .a1 {
           // display: none;
-          visibility:hidden
+          visibility: hidden;
         }
-        .a2{
+        .a2 {
           // display: block;
-          visibility:visible
+          visibility: visible;
         }
         // background: #003e66;
       }
     }
     .userInfo {
-      font-size: .175rem;
+      font-size: 0.175rem;
       .el-dropdown {
         color: #fff;
         cursor: pointer;
-        margin-right: .125rem;
+        margin-right: 0.125rem;
       }
       .exit {
         display: inline-block;
-        font-size: .3rem;
+        font-size: 0.3rem;
         border-left: 1px solid #727272;
-        padding-left: .1875rem;
+        padding-left: 0.1875rem;
         cursor: pointer;
-        i{
-          font-size: .25rem;
+        i {
+          font-size: 0.25rem;
         }
-        i:hover{
+        i:hover {
           color: #0195ff;
         }
       }
@@ -746,11 +792,11 @@ export default {
   .leftMenu {
     text-align: center;
     li {
-      padding: .125rem 0;
+      padding: 0.125rem 0;
       cursor: pointer;
-      line-height: .275rem;
-      i{
-        font-size: .325rem;
+      line-height: 0.275rem;
+      i {
+        font-size: 0.325rem;
         line-height: 27px;
       }
     }
@@ -766,44 +812,42 @@ export default {
 .el-main {
   background-color: #fff;
   color: #333;
-  padding: 0!important;
-  .tabsNav{
+  padding: 0 !important;
+  .tabsNav {
     position: fixed;
     background: #fff;
     z-index: 3000;
     width: 100%;
   }
-  .content{
+  .content {
     padding-top: 56px;
     height: calc(100vh - 136px);
-    .innerMargin{
+    .innerMargin {
       padding: 0px 20px 20px;
     }
   }
 }
-/deep/.el-tabs__nav .el-tabs__item:nth-child(1) span{
-      display: none;
-  }
-
-
-
+/deep/.el-tabs__nav .el-tabs__item:nth-child(1) span {
+  display: none;
+}
 
-  /deep/.el-tabs__item.is-active,
-  /deep/.el-tabs__item:hover{
-    color: #0295ff;
-  }
-  /deep/.el-radio__input.is-checked .el-radio__inner{
-    border-color: #0195ff;
-    background: #0195ff;
-  }
-  /deep/.el-radio__input.is-checked + .el-radio__label {
-    color: #0195ff;
-  }
-  .el-dropdown-menu{
-    z-index:99999 !important
-  }
-.el-dropdown-menu__item:not(.is-disabled):hover, .el-dropdown-menu__item:focus {
-    background-color: #dff1ff;
-    color: #0295ff;
+/deep/.el-tabs__item.is-active,
+/deep/.el-tabs__item:hover {
+  color: #0295ff;
+}
+/deep/.el-radio__input.is-checked .el-radio__inner {
+  border-color: #0195ff;
+  background: #0195ff;
+}
+/deep/.el-radio__input.is-checked + .el-radio__label {
+  color: #0195ff;
+}
+.el-dropdown-menu {
+  z-index: 99999 !important;
+}
+.el-dropdown-menu__item:not(.is-disabled):hover,
+.el-dropdown-menu__item:focus {
+  background-color: #dff1ff;
+  color: #0295ff;
 }
 </style>

+ 1 - 1
src/main.js

@@ -75,7 +75,7 @@ Vue.use(VueLazyLoad, {
 Vue.prototype.jsonUrl = 'http://182.92.193.64'; //地图三级下钻页面使用-韩有波
 Vue.prototype.$imghost = 'http://static.yfpyx.com/projectimg' // 线上图片服务器路径常量
 Vue.prototype.$insectHost = 'https://images.weserv.nl/?url=' // 线上图片服务器路径常量
-Vue.prototype.$deriveData = 'http://182.92.193.64:8002' // 导出
+Vue.prototype.$deriveData = 'http://114.115.147.140:8002' // 导出
 Vue.prototype.$faultvideo = 'http://192.168.1.3:8000' //售后视频地址前缀
 
 Vue.config.productionTip = false

+ 1 - 1
src/pages/plantGuard/disasterWarn/windowPopUp.vue

@@ -61,7 +61,7 @@ export default {
         city:null,
         addtime:0,
       },
-      recognitionImage:['http://182.92.193.64:8003/Basics/cbd/867435052201324/2021/3/11/20210311161847620251.jpg'],
+      recognitionImage:['http://114.115.147.140:8003/Basics/cbd/867435052201324/2021/3/11/20210311161847620251.jpg'],
       loading:false
     };
   },

+ 824 - 0
src/pages/plantGuard/geoinfo/mapdisplay.vue

@@ -0,0 +1,824 @@
+<!--  -->
+<template>
+  <div class="mapbox">
+    <div id="container"></div>
+    <!-- <div class="input-card" style="width: 120px">
+      <button class="btn" @click="polyEditoradd">创建地块</button>
+      <button class="btn" @click="polyEditoropen">开始编辑</button>
+      <button class="btn" @click="polyEditorclose">结束编辑</button>
+      <button class="btn" @click="polyEditordel">删除地块</button>
+      <button class="btn" @click="deletesingle">删除选中标点</button>
+      <button class="btn" @click="deleteall">删除全部标点</button>
+    </div> -->
+    <div id="map" v-show="canvasdisplay" v-loading="loading">
+      <!-- <div class="ol-toggle-options ol-unselectable">
+            <a title="Toggle options toolbar" onClick="toggleControlPanel()"
+                href="#toggle">...</a>
+        </div> -->
+      <div class="mapdel" @click="canvasdisplay = false">×</div>
+    </div>
+    <div id="wrapper">
+      <div id="location"></div>
+      <div id="scale"></div>
+      <!-- <div id="nodelist">
+            <em>Click on the map to get feature info</em>
+        </div> -->
+    </div>
+    <div class="listBox">
+      <div class="projectSearch">
+        <div>项目列表</div>
+        <div>
+          <el-input
+            size="small"
+            placeholder="请输入项目名称"
+            v-model="input"
+            suffix-icon="el-icon-search"
+            @change="getEquipList"
+            clearable
+          >
+          </el-input>
+        </div>
+      </div>
+      <div class="inner">
+        <div class="scroll">
+          <el-scrollbar>
+            <div class="equipList">
+              <div
+                class="item"
+                @click="equipLocate(item)"
+                @dblclick="enterBase(item.uid)"
+                v-for="item in mapData"
+                :key="item.uuid"
+              >
+                <img
+                  src="../../../../static/images/baseIcon.png"
+                  width="25px"
+                  alt=""
+                />
+                {{ item.projectname }}
+              </div>
+              <div class="item noDate" v-if="!mapData.length">暂无数据</div>
+            </div>
+          </el-scrollbar>
+        </div>
+      </div>
+    </div>
+    <el-dialog
+      title="一号基地"
+      :visible.sync="dialogVisible"
+      width="30%"
+      top="15%"
+    >
+      <div class="baseinfobox">
+        <p>负责人:老张</p>
+        <p>联系方式:12021090909</p>
+        <p>面积:50亩</p>
+        <p>地址:河南省郑州市金水区</p>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="sureclick"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
+    <div id="marker" style="width: 60px; height: 17px"></div>
+  </div>
+</template>
+
+<script>
+//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+export default {
+  //import引入的组件需要注入到对象中才能使用
+  components: {},
+  data() {
+    //这里存放数据
+    return {
+      map: null,
+      polyEditor: null,
+      path: [
+        [113.68140126451851, 34.81200282135321],
+        [113.68242785774319, 34.81199264120153],
+        [113.68244463980199, 34.81117921221168],
+        [113.68139715166922, 34.81116052257837],
+      ],
+      marker: null,
+      markers: [],
+      markerstwo: [],
+      polygon: null,
+      canvasdisplay: false,
+      dialogVisible: false,
+      loading: false,
+      input: "", //基地搜索框
+      mapData: [
+        {
+          projectname: "一号基地",
+          uuid: 1,
+        },
+        {
+          projectname: "二号基地",
+          uuid: 2,
+        },
+        {
+          projectname: "三号基地",
+          uuid: 3,
+        },
+        {
+          projectname: "四号基地",
+          uuid: 4,
+        },
+      ],
+    };
+  },
+  //监听属性 类似于data概念
+  computed: {},
+  //监控data中的数据变化
+  watch: {},
+  //方法集合
+  methods: {
+    //初始化地图事件
+    initmap() {
+      this.map = new AMap.Map("container", {
+        resizeEnable: true,
+        expandZoomRange: true,
+        center: [113.681471, 34.810371], //中心点
+        zoom: 15, //初始化缩放等级
+        zooms: [3, 24], //设置最大、最小缩放等级
+        layers: [new AMap.TileLayer.Satellite()], //加载卫星图
+      });
+      this.map.on("click", (e) => {
+        console.log(e.lnglat);
+        // var arr = [e.lnglat.lng, e.lnglat.lat];
+        // this.addmarker(e.lnglat.lng, e.lnglat.lat);
+        // this.path.push(arr);
+      });
+      // this.addmarker();
+      this.addpolygon();
+    },
+    //添加标点事件
+    addmarker() {
+      var marker = new AMap.Marker({
+        icon: "http://webapi.amap.com/theme/v1.3/markers/n/mark_b.png",
+        position: [113.68189478963615, 34.81164827843166],
+      });
+      marker.on("click", (e) => {
+        this.dialogVisible = true;
+        // this.canvasdisplay = true;
+      });
+      // marker.setMap(this.map);
+      this.map.add(marker);
+      // this.marker = marker
+      this.markers.push(marker);
+    },
+    //点击标点事件
+    // updateMarker(lng, lat, marker) {
+    //   console.log(lng);
+    //   // 自定义点标记内容
+    //   var markerContent = document.createElement("div");
+    //   // 点标记中的图标
+    //   var markerImg = document.createElement("img");
+    //   markerImg.className = "markerlnglat";
+    //   markerImg.src = "http://webapi.amap.com/theme/v1.3/markers/n/mark_r.png";
+    //   markerContent.appendChild(markerImg);
+
+    //   // 点标记中的文本
+    //   // var markerSpan = document.createElement("span");
+    //   // markerSpan.className = "marker";
+    //   // markerSpan.innerHTML = "Hi,我换新装备啦!";
+    //   // markerContent.appendChild(markerSpan);
+
+    //   marker.setContent(markerContent); //更新点标记内容
+    //   marker.setPosition([lng, lat]); //更新点标记位置
+    //   this.markerstwo.push(marker);
+    // },
+    //初始化圈地
+    addpolygon() {
+      var polygon = new AMap.Polygon({
+        path: this.path,
+        strokeColor: "#FF33FF", //外围边框颜色
+        strokeWeight: 6,
+        strokeOpacity: 0.2,
+        fillOpacity: 0.4,
+        fillColor: "#1791fc", //内部颜色
+        zIndex: 50,
+      });
+      polygon.on("click", (e) => {
+        this.dialogVisible = true;
+        console.log(e);
+      });
+      this.polygon = polygon;
+      this.map.add(polygon);
+      // 缩放地图到合适的视野级别
+      this.map.setFitView([polygon]);
+    },
+    //   var polyEditor = new AMap.PolyEditor(this.map, polygon);
+    //   this.polyEditor = polyEditor;
+    //   polyEditor.on("addnode", function (event) {
+    //     console.log("触发事件:addnode");
+    //   });
+
+    //   polyEditor.on("adjust", function (event) {
+    //     console.log("触发事件:adjust");
+    //   });
+
+    //   polyEditor.on("removenode", function (event) {
+    //     console.log("触发事件:removenode");
+    //   });
+
+    //   polyEditor.on("end", function (event) {
+    //     console.log("触发事件: end");
+    //   });
+    // },
+    // //创建新的地块
+    // polyEditoradd() {
+    //   if(this.polygon){
+    //     this.$message({
+    //       message: "亲,您已存在一个地块了!",
+    //       type: "warning",
+    //     });
+    //   }else{
+    //     if (this.path.length<3) {
+    //     this.$message({
+    //       message: "亲,您还没有选定地块的区域哦!",
+    //       type: "warning",
+    //     });
+    //   } else {
+    //     // this.addpolygon();
+    //     this.deleteall();
+    //   }
+    //   }
+    // },
+    // //开始圈地
+    // polyEditoropen() {
+    //   if (this.path.length == 0) {
+    //     this.$message({
+    //       message: "亲,您还没有创建地块哦!",
+    //       type: "warning",
+    //     });
+    //   } else {
+    //     this.polyEditor.open();
+    //   }
+    // },
+    // //结束圈地
+    // polyEditorclose() {
+    //   if (this.path.length == 0) {
+    //     this.$message({
+    //       message: "亲,您还没有创建地块哦!",
+    //       type: "warning",
+    //     });
+    //   } else {
+    //     this.polyEditor.close();
+    //   }
+    // },
+    // //删除地块
+    // polyEditordel() {
+    //   if (this.polygon) {
+    //     this.$message({
+    //       message: "亲,您还没有创建地块哦!",
+    //       type: "warning",
+    //     });
+    //   } else {
+    //     this.map.remove(this.polygon);
+    //   }
+    // },
+    // 切片转经度
+    tile2lon(x, z) {
+      return (x / Math.pow(2, z)) * 360 - 180;
+    },
+    // 切片转纬度
+    tile2lat(y, z) {
+      var n = Math.PI - (2 * Math.PI * y) / Math.pow(2, z);
+      return (180 / Math.PI) * Math.atan(0.5 * (Math.exp(n) - Math.exp(-n)));
+    },
+    addWMSLayer() {
+      var that = this;
+      var resolutions = [];
+      for (var i = 0; i < 19; i++) {
+        resolutions[i] = Math.pow(2, 18 - i);
+      }
+      var tileLayer = new AMap.TileLayer({
+        tileSize: 256,
+        tileUrl: function (x, y, z) {
+          let xmin = that.tile2lon(x, z);
+          let xmax = that.tile2lon(x + 1, z);
+          let ymin = that.tile2lat(y + 1, z);
+          let ymax = that.tile2lat(y, z);
+          // console.log(xmin, ymin)
+          // 转换对应坐标
+          // console.log(xmin, ymin);
+          // console.log(xmax, ymax);
+          let t1 = gcoord.transform(
+            [xmin, ymin],
+            gcoord.GCJ02,
+            gcoord.EPSG3857
+          );
+          let t2 = gcoord.transform(
+            [xmax, ymax],
+            gcoord.GCJ02,
+            gcoord.EPSG3857
+          );
+          // console.log(t1,t2)
+          // 查询对象
+          let url = "http://192.168.1.17:18080/geoserver/zhai/wms?";
+          let params = {
+            service: "WMS",
+            version: "1.3.0",
+            transparent: true,
+            request: "GetMap",
+            layers: "zhai:result",
+            width: 769,
+            height: 620,
+            srs: "EPSG:3857",
+            format: "image/png",
+            bbox: [t1[0], t1[1], t2[0], t2[1]].join(","),
+          };
+          // 构建查询字符串
+          let str = that.objToParams(params);
+
+          return url + str;
+        },
+        zIndex: 10,
+      });
+      this.map.add(tileLayer);
+      // var url =
+      //   "https://webapi.amap.com/maps?v=1.4.15&key=27273b81090f78759e4057f94474516f&plugin=AMap.PolyEditor";
+      // var jsapi = document.createElement("script");
+      // jsapi.charset = "utf-8";
+      // jsapi.src = url;
+      // document.head.appendChild(jsapi);
+    },
+    //构建查询字符串
+    objToParams(obj) {
+      return Object.keys(obj)
+        .map(function (key) {
+          return ""
+            .concat(encodeURIComponent(key), "=")
+            .concat(encodeURIComponent(obj[key]));
+        })
+        .join("&");
+    },
+    //添加canvas 实现方法查看
+    addcanvas() {
+      let t1 = gcoord.transform(
+        [113.67756042972206, 34.80739645121581],
+        gcoord.GCJ02,
+        gcoord.EPSG3857
+      );
+      let t2 = gcoord.transform(
+        [113.68402446359391, 34.8139473227472],
+        gcoord.GCJ02,
+        gcoord.EPSG3857
+      );
+      console.log(t1, t2);
+      var bounds = [t1[0], t1[1], t2[0], t2[1]];
+      console.log(bounds);
+
+      var format = "image/png";
+      var mousePositionControl = new ol.control.MousePosition({
+        // className: "custom-mouse-position",
+        // target: document.getElementById("location"),
+        // coordinateFormat: ol.coordinate.createStringXY(5),
+        // undefinedHTML: "&nbsp;",
+      });
+      var source = new ol.source.ImageWMS({
+        ratio: 1,
+        url: "http://192.168.1.17:18080/geoserver/zhai/wms",
+        params: {
+          FORMAT: format,
+          VERSION: "1.1.1",
+          STYLES: "",
+          LAYERS: "zhai:result",
+          exceptions: "application/vnd.ogc.se_inimage",
+        },
+      });
+
+      var untiled = new ol.layer.Image({
+        source: source,
+      });
+      source.on("imageloadend", (val) => {
+        // console.log(val);
+        this.loading = false;
+      });
+      source.on("imageloaderror", function () {
+        alert(11111);
+      });
+      var source2 = new ol.source.TileWMS({
+        url: "http://192.168.1.17:18080/geoserver/zhai/wms",
+        params: {
+          FORMAT: format,
+          VERSION: "1.1.1",
+          tiled: true,
+          STYLES: "",
+          LAYERS: "zhai:result",
+          exceptions: "application/vnd.ogc.se_inimage",
+          tilesOrigin: bounds[0] + "," + bounds[1], //bounds 的第一项
+          bbox: "",
+        },
+      });
+      var tiled = new ol.layer.Tile({
+        visible: false,
+        source: source2,
+      });
+      var createLabelStyle = function (feature) {
+        //返回一个样式
+        return new ol.style.Style({
+          image: new ol.style.Icon({
+            //控制标注图片和文字之间的距离
+            anchor: [0.5, 60],
+            //标注样式的起点位置
+            anchorOrigin: "top-right",
+            //X方向单位:分数
+            anchorXUnits: "fraction",
+            //Y方向单位:像素
+            anchorYUnits: "pixels",
+            //偏移起点位置的方向
+            offsetOrigin: "top-right",
+            //透明度
+            opacity: 0.75,
+            //图片路径
+            src: "../../../../static/images/jidi2.png",
+          }),
+          //文本样式
+          text: new ol.style.Text({
+            //对齐方式
+            textAlign: "center",
+            //文本基线
+            textBaseline: "middle",
+            //字体样式
+            font: "normal 14px 微软雅黑",
+            //文本内容
+            text: feature.get("name"),
+            //填充样式
+            fill: new ol.style.Fill({
+              color: "#aa3300",
+            }),
+            //笔触
+            stroke: new ol.style.Stroke({
+              color: "#ffcc33",
+              width: 2,
+            }),
+          }),
+        });
+      };
+      var beijing = gcoord.transform(
+        [113.68258608341216, 34.811427520345376],
+        gcoord.GCJ02,
+        gcoord.EPSG3857
+      );
+      var map = new ol.Map({
+        controls: ol.control
+          .defaults({
+            attribution: false,
+          })
+          .extend([mousePositionControl]),
+        target: "map",
+        layers: [untiled, tiled],
+        view: new ol.View({
+          // projection: projection,
+          // center: beijing,
+          // zoom: 6,
+          // minZoom: 2,
+        }),
+      });
+      //初始化要素
+      var iconFeature = new ol.Feature({
+        //点要素
+        geometry: new ol.geom.Point(beijing),
+        //名称属性
+        name: "设备一号",
+        //人口属性
+        // population: 2115,
+      });
+      //为点要素添加样式
+      iconFeature.setStyle(createLabelStyle(iconFeature));
+      //初始化矢量数据源
+      var vectorSource = new ol.source.Vector({
+        //指定要素
+        features: [iconFeature],
+      });
+
+      //初始化矢量图层
+      var vectorLayer = new ol.layer.Vector({
+        //数据源
+        source: vectorSource,
+      });
+
+      //将矢量图层添加到map中
+      map.addLayer(vectorLayer);
+      //初始化覆盖层标注
+      // var markerclick = document.getElementById("marker");
+      // var marker = new ol.Overlay({
+      //   //位置坐标
+      //   position: beijing,
+      //   //覆盖层如何与位置坐标匹配
+      //   positioning: "center-center",
+      //   //覆盖层的元素
+      //   element: markerclick, //ToDo 此处不能用JQuery方式$('#marker')获取元素
+      //   //事件传播到地图视点的时候是否应该停止
+      //   stopEvent: false,
+      // });
+      // map.addOverlay(marker);
+      // console.log(markerclick);
+      // markerclick.addEventListener("click", function (e) {
+      //   //生效
+      //   console.log(e);
+      // });
+      // markerclick.on("click", function () {
+      //   //生效
+      //   alert("点击地图覆盖物!");
+      // });
+      // map.getView().on("change:resolution", function (evt) {
+      //   var resolution = evt.target.get("resolution");
+      //   var units = map.getView().getProjection().getUnits();
+      //   // console.log(units)
+      //   var dpi = 25.4 / 0.28;
+      //   // console.log(ol.proj)
+      //   var mpu = ol.proj.Units.METERS_PER_UNIT[units];
+      //   var scale = resolution * mpu * 39.37 * dpi;
+      //   if (scale >= 9500 && scale <= 950000) {
+      //     scale = Math.round(scale / 1000) + "K";
+      //   } else if (scale >= 950000) {
+      //     scale = Math.round(scale / 1000000) + "M";
+      //   } else {
+      //     scale = Math.round(scale);
+      //   }
+      //   document.getElementById("scale").innerHTML = "Scale = 1 : " + scale;
+      // });
+      // console.log(map.getSize())
+      map.getView().fit(bounds, [768, 754]);
+    },
+    //基地搜索
+    getEquipList() {},
+    //基地点击
+    equipLocate() {},
+    //基地双击
+    enterBase() {},
+    sureclick(){
+      this.dialogVisible = false;
+      this.canvasdisplay = true;
+      var canvar = document.getElementsByClassName("ol-viewport")
+      console.log(canvar)
+      if(canvar.length==0){
+        this.loading = true;
+        this.addcanvas();
+      }
+    }
+  },
+  beforeCreate() {}, //生命周期 - 创建之前
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {},
+  beforeMount() {}, //生命周期 - 挂载之前
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {
+    this.initmap();
+    // this.addWMSLayer();
+    
+  },
+  beforeUpdate() {}, //生命周期 - 更新之前
+  updated() {}, //生命周期 - 更新之后
+  beforeDestroy() {}, //生命周期 - 销毁之前
+  destroyed() {}, //生命周期 - 销毁完成
+  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+<style lang="less" scoped>
+.mapbox {
+  height: 100%;
+  position: relative;
+}
+#container {
+  height: 100%;
+}
+.input-card {
+  display: flex;
+  flex-direction: column;
+  min-width: 0;
+  word-wrap: break-word;
+  background-color: #fff;
+  background-clip: border-box;
+  border-radius: 3px;
+  width: 264px;
+  border-width: 0;
+  border-radius: 4.8px;
+  box-shadow: 0 2px 6px 0 rgba(116, 114, 245, 0.5);
+  position: fixed;
+  bottom: 12px;
+  right: 12px;
+  -ms-flex: 1 1 auto;
+  flex: 1 1 auto;
+  padding: 9px 15px;
+  .btn {
+    display: inline-block;
+    font-weight: 400;
+    text-align: center;
+    white-space: nowrap;
+    vertical-align: middle;
+    -webkit-user-select: none;
+    -moz-user-select: none;
+    -ms-user-select: none;
+    user-select: none;
+    border: 1px solid transparent;
+    // transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
+    //   border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
+    background-color: transparent;
+    background-image: none;
+    color: #25a5f7;
+    border-color: #25a5f7;
+    padding: 3px 6px;
+    line-height: 1.5;
+    border-radius: 12px;
+    -webkit-appearance: button;
+    cursor: pointer;
+    font-size: 12px;
+    margin-bottom: 5px;
+    outline-color: #fff;
+  }
+  .btn:hover {
+    background-color: #25a5f7;
+    color: #fff;
+  }
+}
+.ol-zoom {
+  top: 52px;
+  /* display: none; */
+}
+
+.ol-toggle-options {
+  z-index: 1000;
+  background: rgba(255, 255, 255, 0.4);
+  border-radius: 4px;
+  padding: 2px;
+  position: absolute;
+  left: 8px;
+  top: 8px;
+  display: none;
+}
+
+body {
+  font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+  font-size: small;
+}
+
+iframe {
+  width: 100%;
+  height: 250px;
+  border: none;
+}
+
+#map {
+  clear: both;
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 768px;
+  height: 754px;
+  border-right: 4px solid #182037;
+  border-bottom: 4px solid #182037;
+  .mapdel {
+    position: absolute;
+    top: 0;
+    right: 0;
+    width: 30px;
+    height: 30px;
+    border-radius: 50%;
+    background-color: rgba(128, 128, 128, 0.8);
+    text-align: center;
+    line-height: 30px;
+    font-size: 25px;
+    color: #fff;
+    z-index: 99;
+  }
+}
+
+#wrapper {
+  width: 768px;
+  position: relative;
+  z-index: 999999;
+  background-color: #fff;
+  display: none;
+}
+
+#location {
+  float: right;
+}
+
+/* Styles used by the default GetFeatureInfo output, added to make IE happy */
+table.featureInfo,
+table.featureInfo td,
+table.featureInfo th {
+  border: 1px solid #ddd;
+  border-collapse: collapse;
+  margin: 0;
+  padding: 0;
+  font-size: 90%;
+  padding: 0.2em 0.1em;
+}
+
+table.featureInfo th {
+  padding: 0.2em 0.2em;
+  font-weight: bold;
+  background: #eee;
+}
+
+table.featureInfo td {
+  background: #fff;
+}
+
+table.featureInfo tr.odd td {
+  background: #eee;
+}
+
+table.featureInfo caption {
+  text-align: left;
+  font-size: 100%;
+  font-weight: bold;
+  padding: 0.2em 0.2em;
+}
+.baseinfobox {
+  padding-left: 30px;
+  p {
+    margin-bottom: 10px;
+  }
+}
+.listBox {
+  position: absolute;
+  overflow: hidden;
+  width: 4.25rem;
+  height: 90%;
+  margin-top: 16px;
+  border-radius: 6px;
+  background: rgba(255, 255, 255, 0.58);
+  box-shadow: 0px 3px 9px 0px #a7a7a7;
+  right: 20px;
+  top: 0;
+  .projectSearch {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    padding: 0.15rem;
+    background: #182037;
+    color: #fff;
+    font-size: 0.175rem;
+    border-radius: 6px 6px 0 0;
+    /deep/.el-input {
+      width: 2.5rem;
+    }
+  }
+  .inner {
+    position: absolute;
+    top: 57px;
+    bottom: -18px;
+    left: 0;
+    right: 0;
+    .scroll {
+      height: 100%;
+      overflow: auto;
+      .equipList {
+        .item {
+          padding: 0.175rem;
+          color: #454545;
+          font-size: 0.175rem;
+          // background: red;
+          cursor: pointer;
+          img {
+            vertical-align: middle;
+            margin-right: 2px;
+          }
+          &:hover {
+            background: #182037;
+            color: #fff;
+          }
+        }
+        .noDate {
+          text-align: center;
+        }
+        .item.active {
+          background: darkblue;
+        }
+      }
+    }
+    .scroll {
+      height: 100%;
+      overflow-y: hidden;
+    }
+    .el-scrollbar {
+      height: 100%;
+    }
+    .el-scrollbar__bar {
+      &.is-vertical {
+        width: 100px; //滚动条宽度
+      }
+    }
+    .el-scrollbar__wrap {
+      overflow-y: auto;
+      overflow-x: hidden;
+    }
+    .el-scrollbar__thumb {
+      // 可设置滚动条颜色
+      background: red;
+    }
+  }
+}
+</style>

+ 17 - 3
src/pages/plantGuard/plantProtection/base.vue

@@ -780,7 +780,7 @@ export default {
       jkDialogVisible:false,
       bzyDialogVisible:false,
       player:null,
-      polygonString:"114.407233,34.763419;114.409615,34.763067;114.409551,34.761427;114.407856,34.758378;114.407019,34.758942;114.404508,34.759823;114.405839,34.762362"
+      polygonString:"114.403832,34.763975;114.41293,34.762811;114.410806,34.757011;114.400957,34.759568"
     };
   },
   //监听属性 类似于data概念
@@ -845,9 +845,13 @@ export default {
       // this.map.add(this.tileLayer2);
       this.renderPolygon()
       this.changeEquip(0,this.equipType[0])
+      this.map.on("click",(e)=>{
+        console.log(e.lnglat)
+      })
     },
     renderPolygon(){
       var path = this.polygonString.split(';');
+      console.log(path)
       var polygonPath = path.map((item)=>{
         var lnglat = item.split(',')
         return new AMap.LngLat(lnglat[0],lnglat[1])
@@ -864,6 +868,17 @@ export default {
         this.map.add(polygon);
       }
     },
+    getbasescope(){
+      this.$axios({
+        method:"POST",
+        url:"/api/api_gateway?method=user.login.project_map",
+        data:this.qs.stringify({
+          addr:115
+        })
+      }).then(res => {
+        console.log(res)
+      })
+    },
     getUserEquipType(){
       this.$axios({
         method: "POST",
@@ -1280,7 +1295,6 @@ export default {
     //tabs每次切换只渲染一个界面
     tabshandleClick(tab) {
       this.nowPage = tab.name;
-     
     },
     // 设备控制控制
     lookmore(){
@@ -1321,7 +1335,7 @@ export default {
     this.user_id = this.$store.state.plantProtectionUserId || this.$store.state.user_id;
     this.getUserEquipType()
     this.infoMap()
-
+    this.getbasescope()
   },
   beforeCreate() {}, //生命周期 - 创建之前
   beforeMount() {}, //生命周期 - 挂载之前

+ 0 - 1
src/pages/plantGuard/plantProtection/baseAll.vue

@@ -485,7 +485,6 @@ methods: {
                 this.pointSimplifierIns.setData(this.mapData)
             })
         })
-        
         this.search('district',keyword)
     },
     search(levelSub,keyword) {

+ 73 - 70
src/pages/plantGuard/plantProtection/baseComponents/bzyTabPhoto.vue

@@ -1,28 +1,30 @@
 <!-- 测报灯图片 -->
 <template>
   <div class>
-      <div class="ctrlsBtn">
-          <div>
-            <el-button type="blueInfo" size="small" @click="equipStatusCheck('0')" >拍照</el-button>
-            <el-button type="blueInfo" size="small" @click="equipStatusCheck('1')" >刷新</el-button>
-          </div>
-          <div>
-            <el-button type="orangeInfo" size="small" @click="lookmore()" >查看全部图片</el-button>
-          </div>
+    <div class="ctrlsBtn">
+      <div>
+        <el-button type="blueInfo" size="small" @click="equipStatusCheck('0')"
+          >拍照</el-button
+        >
+        <el-button type="blueInfo" size="small" @click="equipStatusCheck('1')"
+          >刷新</el-button
+        >
       </div>
-      <div class="photos" v-viewer>
-          <div v-for="i in photoList" :key="i.addtime">
-              <div class="photo">
-                <img
-                  v-lazy="i.addr"
-                  @error="errImg"
-                  alt
-                />
-              </div>
-              <div class="time">{{i.addtime*1000|formatTime}}</div>
-          </div>
+      <div>
+        <el-button type="orangeInfo" size="small" @click="lookmore()"
+          >查看全部图片</el-button
+        >
       </div>
-      <div v-if="!photoList.length">暂无数据</div>
+    </div>
+    <div class="photos" v-viewer>
+      <div v-for="i in photoList" :key="i.addtime">
+        <div class="photo">
+          <img v-lazy="i.addr" @error="errImg" alt />
+        </div>
+        <div class="time">{{ (i.addtime * 1000) | formatTime }}</div>
+      </div>
+    </div>
+    <div v-if="!photoList.length">暂无数据</div>
   </div>
 </template>
 
@@ -33,11 +35,11 @@
 export default {
   //import引入的组件需要注入到对象中才能使用
   components: {},
-  props: ["equipId", "equipType","d_id"],
+  props: ["equipId", "equipType", "d_id"],
   data() {
     //这里存放数据
     return {
-      photoList:[]
+      photoList: [],
     };
   },
   //监听属性 类似于data概念
@@ -65,8 +67,7 @@ export default {
     equipBtnControl(cmd) {
       this.$axios({
         method: "POST",
-        url:
-          "/api/api_gateway?method=forecast.send_control.admin_device_control",
+        url: "/api/api_gateway?method=forecast.send_control.admin_device_control",
         data: this.qs.stringify({
           cmd,
           device_type_id: 7,
@@ -78,19 +79,19 @@ export default {
         }
       });
     },
-    lookmore(){
-      this.$store.commit('setData',{
-        name:'bzy_photo_id',
-        val:this.equipId
-      })
-      this.$store.commit('setData',{
-        name:'bzy_photo_did',
-        val:this.d_id
-      })
-      this.$router.push('bzyPhoto')
+    lookmore() {
+      this.$store.commit("setData", {
+        name: "bzy_photo_id",
+        val: this.equipId,
+      });
+      this.$store.commit("setData", {
+        name: "bzy_photo_did",
+        val: this.d_id,
+      });
+      this.$router.push("bzyPhoto");
     },
-     //图片列表数据请求
-     getPhoteList() {
+    //图片列表数据请求
+    getPhoteList() {
       this.$axios({
         method: "POST",
         url: "/api/api_gateway?method=forecast.forecast_system.equip_photo",
@@ -99,13 +100,13 @@ export default {
           ret: "list",
           page: 1,
           page_number: 6,
-          time_begin: '',
-          time_end: '',
+          time_begin: "",
+          time_end: "",
         }),
       }).then((res) => {
         if (res.data.message == "") {
           let data = res.data.data.data;
-          this.photoList = data
+          this.photoList = data;
         }
       });
     },
@@ -122,41 +123,43 @@ export default {
   updated() {}, //生命周期 - 更新之后
   beforeDestroy() {}, //生命周期 - 销毁之前
   destroyed() {}, //生命周期 - 销毁完成
-  activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
 };
 </script>
 <style scoped lang="less">
-.ctrlsBtn{
-    display: flex;
-    justify-content: space-between;
-    margin-bottom: 15px;
+.ctrlsBtn {
+  display: flex;
+  justify-content: space-between;
+  margin-bottom: 15px;
 }
-.photos{
-    display: flex;
-    justify-content: space-between;
-    flex-wrap: wrap;
-    >div{
-        flex: 1;
-        width: 33.3333%;
-        max-width: 33.3333%;
-        min-width: 33.3333%;
-        text-align: center;
-        .photo{
-          width: 220px;
-          height: 170px;
-          position: relative;
-          overflow: hidden;
-          img{
-            height: 100%;
-          position: absolute;
-          left: 50%;
-          transform: translate(-50%);
-          }
-        }
-        .time{
-          color: #04d5e8;
-          line-height: 25px;
-        }
+.photos {
+  display: flex;
+  justify-content: space-between;
+  flex-wrap: wrap;
+  > div {
+    // flex: 1;
+    // width: 33.3333%;
+    // max-width: 33.3333%;
+    // min-width: 33.3333%;
+    text-align: center;
+    .photo {
+      width: 240px;
+      height: 170px;
+      // position: relative;
+      // overflow: hidden;
+      img {
+        height: 100%;
+        width: 100%;
+        // position: absolute;
+        // left: 50%;
+        // transform: translate(-50%);
+        margin: 0;
+      }
+    }
+    .time {
+      color: #04d5e8;
+      line-height: 25px;
     }
+  }
 }
 </style>

+ 2 - 1
src/pages/plantGuard/plantProtection/baseComponents/cbdTabPhoto.vue

@@ -327,7 +327,8 @@ export default {
       color: #04d5e8;
       line-height: 25px;
       display: flex;
-      justify-content: space-around;
+      justify-content: space-between;
+      width: 85%;
       > span:nth-child(2):hover {
         cursor: pointer;
         text-decoration: underline;

+ 16 - 8
src/pages/plantGuard/plantProtection/baseComponents/equipHistoryDate.vue

@@ -336,8 +336,10 @@ export default {
                   this.tableData = data
                 }else{
                   if(this.queryInfo.flag == 'auto'){
-                    this.queryInfo.currNum++;
-                    this.$refs.timeSearchRefs.timeBtnClick(this.queryInfo.currNum,this.queryInfo.flag);
+                    if(this.queryInfo.currNum<5){
+                      this.queryInfo.currNum++;
+                      this.$refs.timeSearchRefs.timeBtnClick(this.queryInfo.currNum,this.queryInfo.flag);
+                    }
                   }else{
                     this.tableData = [];
                   }
@@ -419,8 +421,10 @@ export default {
                   this.tableData = data
                 }else{
                   if(this.queryInfo.flag == 'auto'){
-                    this.queryInfo.currNum++;
-                    this.$refs.timeSearchRefs.timeBtnClick(this.queryInfo.currNum,this.queryInfo.flag);
+                    if(this.queryInfo.currNum<5){
+                      this.queryInfo.currNum++;
+                      this.$refs.timeSearchRefs.timeBtnClick(this.queryInfo.currNum,this.queryInfo.flag);
+                    }
                   }else{
                     this.tableData = [];
                   }
@@ -508,8 +512,10 @@ export default {
                   this.tableData = data
                 }else{
                   if(this.queryInfo.flag == 'auto'){
-                    this.queryInfo.currNum++;
-                    this.$refs.timeSearchRefs.timeBtnClick(this.queryInfo.currNum,this.queryInfo.flag);
+                    if(this.queryInfo.currNum<5){
+                      this.queryInfo.currNum++;
+                      this.$refs.timeSearchRefs.timeBtnClick(this.queryInfo.currNum,this.queryInfo.flag);
+                    }
                   }else{
                     this.tableData = [];
                   }
@@ -589,8 +595,10 @@ export default {
                   this.tableData = data
                 }else{
                   if(this.queryInfo.flag == 'auto'){
-                    this.queryInfo.currNum++;
-                    this.$refs.timeSearchRefs.timeBtnClick(this.queryInfo.currNum,this.queryInfo.flag);
+                    if(this.queryInfo.currNum<5){
+                      this.queryInfo.currNum++;
+                      this.$refs.timeSearchRefs.timeBtnClick(this.queryInfo.currNum,this.queryInfo.flag);
+                    }
                   }else{
                     this.tableData = [];
                   }

+ 181 - 164
src/pages/plantGuard/plantProtection/baseComponents/equipHistoryDateQxz.vue

@@ -1,22 +1,33 @@
 <!-- 气象站设备历史数据 -->
 <template>
   <div class="equipInfo">
-    <DateSearch @dateChange="dateChange" ref="timeSearchRefs" @toggleSwitcState="toggleSwitcState"></DateSearch>
-    <div v-loading="dataLoading"  element-loading-background="rgba(0, 0, 0, 0.8)">
+    <DateSearch
+      @dateChange="dateChange"
+      ref="timeSearchRefs"
+      @toggleSwitcState="toggleSwitcState"
+    ></DateSearch>
+    <div
+      v-loading="dataLoading"
+      element-loading-background="rgba(0, 0, 0, 0.8)"
+    >
       <div v-if="switcState">
-        <highcharts v-if="ChartData.length"
-          :options="options"
-        ></highcharts>
+        <highcharts v-if="ChartData.length" :options="options"></highcharts>
         <div class="noDataClass" v-else>暂无数据</div>
       </div>
       <div v-if="!switcState">
-        <el-table :data="hisData" max-height="405" class="customTable" :header-row-class-name="tableth"  style="width: 100%">
+        <el-table
+          :data="hisData"
+          max-height="405"
+          class="customTable"
+          :header-row-class-name="tableth"
+          style="width: 100%"
+        >
           <el-table-column
             v-for="(item, index) in tableHead"
             :key="index"
             :width="item.property == 'date' ? '160px' : ''"
             :label="item.label"
-            :fixed="item.property == 'date'?'left':false"
+            :fixed="item.property == 'date' ? 'left' : false"
             :prop="item.property"
           >
             <template slot-scope="scope">{{
@@ -33,7 +44,6 @@
         ></el-pagination>
       </div>
     </div>
-    
   </div>
 </template>
 
@@ -42,33 +52,33 @@
 //例如:import 《组件名称》 from '《组件路径》';
 import HighCharts from "highcharts";
 import DateSearch from "@/components/highStand/timeSearch";
-import qxz_dict from './qxz_dict.json'
+import qxz_dict from "./qxz_dict.json";
 export default {
   //import引入的组件需要注入到对象中才能使用
   components: {
-    DateSearch
+    DateSearch,
   },
-  props: ["equipId", "equipType","d_id"],
+  props: ["equipId", "equipType", "d_id"],
   data() {
     //这里存放数据
     return {
       qxz_dict,
-      queryInfo:{
-        begin:"",
-        end:"",
-        page:1,
-        currNum:'',
-        flag:'',
+      queryInfo: {
+        begin: "",
+        end: "",
+        page: 1,
+        currNum: "",
+        flag: "",
       },
-      switcState:true,
-      options:{},
-      ChartData:[],
+      switcState: true,
+      options: {},
+      ChartData: [],
       // 表格数据
-      total:0,
+      total: 0,
       // 动态表头
-			tableHead: [],
-      hisData:[],
-      dataLoading:false,
+      tableHead: [],
+      hisData: [],
+      dataLoading: false,
     };
   },
   //监听属性 类似于data概念
@@ -100,7 +110,7 @@ export default {
       return {
         chart: {
           zoomType: "x",
-          backgroundColor: 'rgba(0,0,0,0)'
+          backgroundColor: "rgba(0,0,0,0)",
         },
         title: {
           text: "",
@@ -130,31 +140,31 @@ export default {
             month: "%Y-%m",
             year: "%Y",
           },
-          lineColor:'#fff',
+          lineColor: "#fff",
           labels: {
             style: {
-              color: '#fff',
-            }
-	        },
+              color: "#fff",
+            },
+          },
         },
         yAxis: {
           title: {
             text: "",
           },
-          lineColor:'#fff',
+          lineColor: "#fff",
           labels: {
             style: {
-              color: '#fff',
-            }
-	        },
+              color: "#fff",
+            },
+          },
         },
         legend: {
           // layout: 'vertical',
           align: "right",
           verticalAlign: "top",
-          itemStyle:{
-            color:'#fff',
-          }
+          itemStyle: {
+            color: "#fff",
+          },
         },
         plotOptions: {
           series: {
@@ -190,134 +200,138 @@ export default {
             },
           ],
         },
-        previous:0
+        previous: 0,
       };
     },
     //获取图表历史数据
-		getEchartsHisDataList() {
+    getEchartsHisDataList() {
       this.dataLoading = true;
-			this.$axios({
-				method: 'POST',
-				url: '/api/api_gateway?method=weather.weather.qxz_data_chart',
-				data: this.qs.stringify({
-					begin: this.queryInfo.begin,
-					end: this.queryInfo.end,
-					device_id: this.equipId
-				})
-			})
-				.then((res) => {
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=weather.weather.qxz_data_chart",
+        data: this.qs.stringify({
+          begin: this.queryInfo.begin,
+          end: this.queryInfo.end,
+          device_id: this.equipId,
+        }),
+      })
+        .then((res) => {
           this.dataLoading = false;
-					this.echartsFn(res.data.data)
-				})
-				.catch((err) => {
-					console.log(err)
-				})
-		},
-		echartsFn(data) {
-			let conf = data.conf
-			let eData = data.data
-      this.ChartData = []
-			if (conf && eData && eData.length > 0) {
-				for (let i in conf) {
-					if (conf[i]) {
-						//判断是否有值
-						this.ChartData.push({
-							key: i,
-							name: conf[i].split('#')[0],
-							unit: conf[i].split('#')[1],
-							data: []
-						})
-					}
-				}
-				for (let m of eData) {
-					//m是对象
-					for (let n in m.dat) {
-						//dat是对象 n是key
-						for (let j of this.ChartData) {
-							//j是对象
-							if (j.key == n && m.dat[n].split('#')[0] != '-99.99') {
-								j.data.push([
-									m.time * 1000 + 8 * 3600000,
-									Number(m.dat[n].split('#')[0])
-								])
-							}
-						}
-					}
-				}
-			} else {
-				this.ChartData = []
+          this.echartsFn(res.data.data);
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    },
+    echartsFn(data) {
+      let conf = data.conf;
+      let eData = data.data;
+      this.ChartData = [];
+      if (conf && eData && eData.length > 0) {
+        for (let i in conf) {
+          if (conf[i]) {
+            //判断是否有值
+            this.ChartData.push({
+              key: i,
+              name: conf[i].split("#")[0],
+              unit: conf[i].split("#")[1],
+              data: [],
+            });
+          }
+        }
+        for (let m of eData) {
+          //m是对象
+          for (let n in m.dat) {
+            //dat是对象 n是key
+            for (let j of this.ChartData) {
+              //j是对象
+              if (j.key == n && m.dat[n].split("#")[0] != "-99.99") {
+                j.data.push([
+                  m.time * 1000 + 8 * 3600000,
+                  Number(m.dat[n].split("#")[0]),
+                ]);
+              }
+            }
+          }
+        }
+      } else {
+        this.ChartData = [];
       }
-      this.$nextTick(()=>{
+      this.$nextTick(() => {
         this.options = this.optionFn(this.ChartData);
-      })
-
-		},
+      });
+    },
     getHisDataList() {
       this.dataLoading = true;
-			this.$axios({
-				method: 'POST',
-				url: '/api/api_gateway?method=weather.weather.qxz_detail',
-				data: this.qs.stringify({
-					start_time: this.queryInfo.begin,
-					end_time: this.queryInfo.end,
-					page: this.queryInfo.page,
-					device_id: this.equipId
-				})
-			}).then((res) => {
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=weather.weather.qxz_detail",
+        data: this.qs.stringify({
+          start_time: this.queryInfo.begin,
+          end_time: this.queryInfo.end,
+          page: this.queryInfo.page,
+          device_id: this.equipId,
+        }),
+      }).then((res) => {
         this.dataLoading = false;
-				this.total = Number(res.data.data.nums)
-				if (res.data.data.nums > 0) {
-					let arr1 = [{ label: '日期', property: 'date' }]
-					let arr2 = []
-					let conf = res.data.data.conf
-					let data = res.data.data.data
-					for (let i in conf) {
-						let obj = {}
-						if (conf[i]) {
-							let arr = conf[i].split('#')
-							obj.label = `${arr[0]}(${arr[1]})`
-							obj.property = i
-							arr1.push(obj)
-						}
-					}
-					this.tableHead = arr1
-					for (let item of data) {
-						let obj = {}
-						obj.date = this.formatTime(item.time * 1000)
-						for (let i1 in item.dat) {
-							if (item.dat[i1]) {
-								obj[i1] =
-									item.dat[i1].split('#')[0] == '-99.99'
-										? 'N/A'
-										: item.dat[i1].split('#')[0]
-							}
-						}
-						arr2.push(obj)
-					}
-					this.hisData = arr2
-				} else {
-          if(this.queryInfo.flag == 'auto'){
-            this.queryInfo.currNum++;
-            this.$refs.timeSearchRefs.timeBtnClick(this.queryInfo.currNum,this.queryInfo.flag);
-          }else{
+        this.total = Number(res.data.data.nums);
+        if (res.data.data.nums > 0) {
+          let arr1 = [{ label: "日期", property: "date" }];
+          let arr2 = [];
+          let conf = res.data.data.conf;
+          let data = res.data.data.data;
+          for (let i in conf) {
+            let obj = {};
+            if (conf[i]) {
+              let arr = conf[i].split("#");
+              obj.label = `${arr[0]}(${arr[1]})`;
+              obj.property = i;
+              arr1.push(obj);
+            }
+          }
+          this.tableHead = arr1;
+          for (let item of data) {
+            let obj = {};
+            obj.date = this.formatTime(item.time * 1000);
+            for (let i1 in item.dat) {
+              if (item.dat[i1]) {
+                obj[i1] =
+                  item.dat[i1].split("#")[0] == "-99.99"
+                    ? "N/A"
+                    : item.dat[i1].split("#")[0];
+              }
+            }
+            arr2.push(obj);
+          }
+          this.hisData = arr2;
+        } else {
+          if (this.queryInfo.flag == "auto") {
+            if (this.queryInfo.currNum < 5) {
+              this.queryInfo.currNum++;
+              this.$refs.timeSearchRefs.timeBtnClick(
+                this.queryInfo.currNum,
+                this.queryInfo.flag
+              );
+            }
+          } else {
             this.tableData = [];
           }
 
-					this.hisData = []
-				}
-			})
+          this.hisData = [];
+        }
+      });
     },
-    toggleSwitcState(data){
-      this.switcState = data
+    toggleSwitcState(data) {
+      this.switcState = data;
     },
     //改变page
     changePage(val) {
       this.queryInfo.page = val;
       this.getHisDataList();
     },
-    tableth(){
-      return 'headerth'
-    }
+    tableth() {
+      return "headerth";
+    },
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {},
@@ -331,7 +345,7 @@ export default {
   updated() {}, //生命周期 - 更新之后
   beforeDestroy() {}, //生命周期 - 销毁之前
   destroyed() {}, //生命周期 - 销毁完成
-  activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
 };
 </script>
 <style scoped lang="less">
@@ -343,33 +357,36 @@ export default {
   color: rgb(122, 115, 115);
 }
 // table样式
-/deep/.customTable.el-table tr,/deep/.customTable.el-table .headerth th.is-leaf{
-    background-color: #1b222f;
-    border-bottom: 1px solid #434343;
-    color: #eee;
-} 
-/deep/.customTable.el-table--enable-row-hover .el-table__body tr:hover > td,/deep/.el-table__body tr.hover-row > td{
-  background-color:#042741
+/deep/.customTable.el-table tr,
+/deep/.customTable.el-table .headerth th.is-leaf {
+  background-color: #1b222f;
+  border-bottom: 1px solid #434343;
+  color: #eee;
+}
+/deep/.customTable.el-table--enable-row-hover .el-table__body tr:hover > td,
+/deep/.el-table__body tr.hover-row > td {
+  background-color: #042741;
 }
-/deep/.customTable.el-table th.is-leaf,/deep/.customTable.el-table td{
+/deep/.customTable.el-table th.is-leaf,
+/deep/.customTable.el-table td {
   border-bottom: 1px solid #515151;
 }
-/deep/.customTable.el-table--scrollable-x .el-table__body-wrapper{
-    background-color: #1b222f;
-    color: #eee;
+/deep/.customTable.el-table--scrollable-x .el-table__body-wrapper {
+  background-color: #1b222f;
+  color: #eee;
 }
-/deep/.customTable.el-table .is-scrolling-none{
-    background-color: #1b222f;
-    color: #eee;
+/deep/.customTable.el-table .is-scrolling-none {
+  background-color: #1b222f;
+  color: #eee;
 }
-/deep/.customTable.el-table::before{
-	background-color: #7d7d7d;
+/deep/.customTable.el-table::before {
+  background-color: #7d7d7d;
 }
 // 分页
-/deep/.el-pagination .el-pager li.active{
-  background-color: #0195ff!important;
+/deep/.el-pagination .el-pager li.active {
+  background-color: #0195ff !important;
 }
-/deep/.el-pagination.is-background .el-pager li:not(.disabled):hover{
+/deep/.el-pagination.is-background .el-pager li:not(.disabled):hover {
   color: #0195ff;
 }
 </style>

+ 1 - 5
src/pages/plantGuard/sysManage/userManage.vue

@@ -29,7 +29,7 @@
               placeholder="请选择用户类型"
             >
               <el-option label="超级管理员" :value="1"></el-option>
-              <el-option label="经销商" :value="2"></el-option>
+              <el-option label="高级用户" :value="2"></el-option>
               <el-option label="农林政府单位" :value="3"></el-option>
               <el-option label="普通用户" :value="4"></el-option>
             </el-select>
@@ -1286,10 +1286,6 @@ export default {
     vertical-align: middle;
   }
 }
-/deep/.el-table th,
-/deep/.el-table td {
-  //   text-align: center;
-}
 /deep/.el-table th {
   background-color: #232733;
 }

+ 9 - 1
src/router/index.js

@@ -30,7 +30,7 @@ const BzyPhoto = () => import('@/Pages/plantGuard/plantProtection/bzyphoto') //
 const PersonMsg = () => import('@/Pages/plantGuard/sysManage/personMsg') //个人中心
 
 const UserManage = () => import('@/Pages/plantGuard/sysManage/userManage') //系统管理-用户管理
-// const UserManage = () => import('@/Pages/plantGuard/sysManage/ceshimap') //测试地图
+// const UserManage = () => import('@/Pages/plantGuard/sysManage/ceshi') //测试地图
 const AllotEquip = () => import('@/Pages/plantGuard/sysManage/allotEquip') //系统管理-设备分配
 const RoleManage = () => import('@/Pages/plantGuard/sysManage/roleManage') //系统管理-角色管理
 const TopicManage = () => import('@/Pages/plantGuard/sysManage/topicManage') //系统管理-主题定制
@@ -56,6 +56,8 @@ const WarnPhoto = () => import('@/Pages/plantGuard/disasterWarn/warnPhoto') //
 const DisasterWarnList = () => import('@/Pages/plantGuard/disasterWarn/disasterWarnList') //灾害预警-预警历史记录
 const DisasterWarnSet = () => import('@/Pages/plantGuard/disasterWarn/disasterWarnSet') //灾害预警-预警历史记录
 
+//---------------------------------------农林植保----------------------------------------------------
+const MapDisplay = () => import('@/Pages/plantGuard/geoinfo/mapdisplay') //测试地图
 
 Vue.use(Router)
 
@@ -233,6 +235,12 @@ export default new Router({
           name: 'disasterWarnSet',
           component: DisasterWarnSet,
           meta: { title: '灾害预警',order:2,navname: '预警设置', keepAlive: false}
+        },
+        {
+          path:'mapdisplay',
+          name: 'mapdisplay',
+          component: MapDisplay,
+          meta: { title: '地理信息',order:5,navname: '基地展示', keepAlive: false}
         }
       ]
     },

+ 1 - 1
src/util/server.js

@@ -1,7 +1,7 @@
 //1.定义所有环境服务器地址
 const server = {
   pro: "http://8.136.98.49:8005", //生产环境
-  dev: "http://182.92.193.64:8002", //测试环境
+  dev: "http://114.115.147.140:8002", //测试环境
   util: "http://192.168.1.14:8002/" //其他环境,可以为空,为空则适配到测试环境
 }
 //2.获取当前访问域名,并根据域名判断当前环境,然后获取指定环境的服务器地址

BIN
static/images/jidi2.png