yf_zd 4 лет назад
Родитель
Сommit
981171f144

+ 3 - 3
src/components/index.vue

@@ -388,8 +388,8 @@ export default {
                   "id": "5",
                   "children": [
                      {
-                     "name": "灌溉展示",
-                     "path": "/irrigate",
+                     "name": "灌溉项目",
+                     "path": "/irrigateProject",
                      "id": "6"
                      },
                      {
@@ -481,7 +481,7 @@ export default {
                }
           ];
           
-          let userType = res.data.data.myuser_type; //用户类型
+          let userType = res.data.data.myuser_type; //用户类型 管理员1 普通用户4
           let userName = res.data.data.username; //用户名
           let myuid = res.data.data.myuid; //用户id
           

+ 0 - 23
src/pages/plantGuard/irrigate/indexdemo.html

@@ -1,23 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <title>Document</title>
-</head>
-<body>
-    <div>
-        <p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p>
-        <p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p>
-        <p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p>
-        <p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p>
-    </div>
-    <script>
-        window.addEventListener("scroll", function() { 
-            let scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
-            console.log(scrollTop);
-
-         });
-    </script>
-</body>
-</html>

+ 6 - 5
src/pages/plantGuard/irrigate/irrigate.vue

@@ -193,6 +193,7 @@ export default {
   data() {
     //这里存放数据
     return {
+      id:this.$store.state.irrigate_id,
       map: null,
       center: [116.3683244, 39.915085],
       zoom: 4.5,
@@ -458,7 +459,7 @@ export default {
         method: "post",
         url: "/api/api_gateway?method=weather.weather.sf_status",
         data: this.qs.stringify({
-          device_id: 15112501
+          device_id: this.id
         })
       }).then(res => {
         var data = res.data.data;
@@ -669,11 +670,11 @@ export default {
       }
     },
     lookEleHistory(){
-      this.$store.commit('setEleHistoryId',15112501)
+      this.$store.commit('setEleHistoryId',this.id)
       this.$router.push('eleHistory');
     },
     lookCtrlHistory(){
-      this.$store.commit('setOperatId',15112501)
+      this.$store.commit('setOperatId',this.id)
       this.$router.push('operatData');
     },
     ScrollUp() {
@@ -706,7 +707,7 @@ export default {
         method: "post",
         url: "/api/api_gateway?method=weather.weather.sf_control",
         data: this.qs.stringify({
-          device_id: 15112501,
+          device_id: this.id,
           relayNum:switchNum,
           relayState:relayState,
         })
@@ -736,7 +737,7 @@ export default {
         method: "post",
         url: "/api/api_gateway?method=weather.weather.sf_control_addr",
         data: this.qs.stringify({
-          device_id: 15112501,
+          device_id: this.id,
           device_addr:addr.join('/')
         })
       }).then(res => {

+ 6 - 4
src/pages/plantGuard/sysManage/userManage.vue

@@ -706,10 +706,12 @@ export default {
 						})
 						localStorage.setItem('cUsername',username) //修改当前登录的用户名
 						this.reload() //整体刷新
-						this.$EventBus.$on('firstPage', (data) => {
-							//默认显示菜单第一项
-							this.$router.push(`${data}`)
-						})
+						window.sessionStorage.removeItem("menuTabs");
+          				window.sessionStorage.removeItem("menuTabsValue");
+						// this.$EventBus.$on('firstPage', (data) => {
+						// 	//默认显示菜单第一项
+						// 	this.$router.push(`${data}`)
+						// })
 					} else {
 						this.$message({
 							type: 'warning',

+ 7 - 0
src/router/index.js

@@ -43,6 +43,7 @@ const Page9 = () => import('@/Pages/plantGuard/page9') //水价管理-地图展
 const Page10 = () => import('@/Pages/plantGuard/page10') //水价管理-地图展示
 const Page11 = () => import('@/Pages/plantGuard/page11') //水价管理-地图展示
 
+const IrrigateProject = () => import('@/Pages/plantGuard/irrigate/index') //智能灌溉-灌溉展示
 const Irrigate = () => import('@/Pages/plantGuard/irrigate/irrigate') //智能灌溉-灌溉展示
 const OperatData = () => import('@/Pages/plantGuard/irrigate/operatData') //智能灌溉-操作记录
 const WranData = () => import('@/Pages/plantGuard/irrigate/wranData') //智能灌溉-设备预警
@@ -82,6 +83,12 @@ export default new Router({
           meta: { title: '农林植保',order:0, navname:'设备列表',}
         },
         {
+          path:'irrigateProject',
+          name: 'irrigateProject',
+          component: IrrigateProject,
+          meta: { title: '智能灌溉系统',order:2 ,navname:'灌溉项目',}
+        },
+        {
           path: 'irrigate',
           name: 'irrigate',
           component: Irrigate,

+ 5 - 0
src/store/store.js

@@ -17,6 +17,7 @@ const store = new Vuex.Store({
         bzy_photo_id:'',//测报灯查看图片设备id
         bzy_photo_did:'',//测报灯查看图片设备did
         ele_history_id:'',//历史数据水肥设备id
+        irrigate_id:'',//灌溉项目设备id
         ele_operat_id:'',//操作记录水肥设备id
         
     },
@@ -51,9 +52,13 @@ const store = new Vuex.Store({
       setEleHistoryId (state,val) {
         state.ele_history_id = val;
       },
+      irrigateId (state,val) {
+        state.irrigate_id = val;
+      },
       setOperatId (state,val) {
         state.ele_operat_id = val;
       },
+      
     },
     plugins: [createPersistedState({ storage: window.sessionStorage })]
 })