Browse Source

Merge branch 'mw2' of http://61.161.152.110:10101/r/electronic-map into sl3

shilin 3 years ago
parent
commit
c0b8b47426

+ 14 - 38
src/views/WindSite/WindSite.vue

@@ -10,9 +10,9 @@
 					<div class="page-common-body-menu-border left bottom"></div>
 					<div class="page-common-body-menu-border right top"></div>
 					<div class="page-common-body-menu-border right bottom"></div>
-					<router-link v-for="(menuData, index) of menuDatas" :key="index" :to="menuData.path">
-						<div class="page-common-body-menu-item" @click="clickMenu(index)"
-							:class="{ active: activeIndex == index }">
+					<router-link v-for="(menuData, index) of menuDatas" :key="index" :to="menuData.path" >
+						<div class="page-common-body-menu-item"
+							:class="{ active: activeIndex == index}">
 							<span class="svg-icon" :class="activeIndex == index ? 'svg-icon-yellow' : 'svg-icon-green'">
 								<SvgIcon :svgid="menuData.icon"></SvgIcon>
 							</span>
@@ -37,6 +37,7 @@
 		// 数据
 		data() {
 			return {
+				endPath: 0,
 				windsitePath: '',
 				activeIndex: 0,
 				menuDatas: [{
@@ -69,50 +70,25 @@
 					},
 					{
 						icon: "svg-wind-site",
-						path: this.windsitePath,
+						path: '/monitor/windsite/info/MHS_FDC/MG01_01',
 					},
+					
 				],
 			};
 		},
 		// 函数
 		methods: {
-			jumpUrl() {
-				var p = this.$route.path.split('/');
-				var pData = p[p.length - 1].split('_');
-				var fdjData = pData[0].substr(0,1);
-				var wpId = p[p.length - 1];
-				if (wpId.indexOf("FDC") !== -1) {
-					this.windsitePath = `/monitor/windsite/info/${wpId}/${fdjData[0] + 'G01_01'}`
-				} else {
-					this.windsitePath = `../../windsite/inverter-info/${wpId}/${pData[0] + '01_01'}`
-				}
-			},
-			clickMenu: function(index) {
-				if (index == 7) { //风场
-					this.jumpUrl();
-					this.menu(index);
-					$('.page-common-body-menu-box a').eq(7).hide();
-				}else{
-					$('.page-common-body-menu-box a').eq(7).show();
-				}
-				this.activeIndex = index;
+			menu() {
+				this.menuDatas.forEach((ele) => {
+					if (ele.icon == 'svg-wind-site') {
+						ele.path = ele.path
+					} else {
+						ele.path = ele.path + "/" + this.$route.params.wpId;
+					}
+				});
 			},
-			menu(index) {
-				if(index){
-					this.menuDatas[index].path = this.windsitePath;
-				}else{
-					this.menuDatas.forEach((ele) => {
-						if (ele.icon == 'svg-wind-site') {
-							ele.path = this.windsitePath
-						} else {
-							ele.path = ele.path + "/" + this.$route.params.wpId;
-						}
-					});
-				}
-			}
 		},
 		created() {
-			this.jumpUrl();
 			this.menu();
 		},
 	};

+ 26 - 1
src/views/WindSite/components/generalappearance/mhs.vue

@@ -1625,10 +1625,35 @@ export default {
       green: "#02A434",
       red: "#FF0000",
       datas: undefined,
+	  fjID:'',
     };
   },
-  created() {},
+  beforeUpdate() {
+	if(this.fjID == ''){
+		this.fjClcik();
+	}
+  },
   methods: {
+	fjClcik(){
+		var that = this;
+		$('#fan g').click(function(){
+			if($(this).attr('id') != undefined){
+				if(that.fjID == ''){
+					that.fjID = $(this).attr('id');
+					var p = that.$route.path.split('/');
+					var pData = p[p.length - 1].split('_')[0].substr(0,1);
+					var wpId = p[p.length - 1];
+					var id = parseInt($(this).attr('id'));
+					if(id<10){
+						id = '0'+id
+					}
+					if (wpId.indexOf("FDC") !== -1) {
+						that.$router.replace(`/monitor/windsite/info/${wpId}/${pData[0] + 'G01_'+id}`);
+					}
+				}
+			}
+		})
+	},
     refreshFan: function (data) {
       if (data) {
         data.forEach((element) => {

+ 30 - 4
src/views/WindSite/components/generalappearance/nss.vue

@@ -3632,6 +3632,7 @@
 </template>
 <script>
 import previewPicture from "../previewPicture.vue";
+import $ from "jquery";
 export default {
   components: {
     previewPicture,
@@ -3643,10 +3644,35 @@ export default {
       green: "#02A434",
       red: "#FF0000",
       datas: undefined,
-    };
-  },
-  created() {},
-  methods: {
+		fjID:'',
+     };
+   },
+   beforeUpdate() {
+   	if(this.fjID == ''){
+   		this.fjClcik();
+   	}
+   },
+   methods: {
+   	fjClcik(){
+   		var that = this;
+   		$('#fan g').click(function(){
+   			if($(this).attr('id') != undefined){
+   				if(that.fjID == ''){
+   					that.fjID = $(this).attr('id');
+   					var p = that.$route.path.split('/');
+   					var pData = p[p.length - 1].split('_')[0].substr(0,1);
+   					var wpId = p[p.length - 1];
+   					var id = parseInt($(this).attr('id').split('_')[2]);
+   					if(id<10){
+   						id = '0'+id
+   					}
+   					if (wpId.indexOf("FDC") !== -1) {
+   						that.$router.replace(`/monitor/windsite/info/${wpId}/${pData[0] + 'G01_'+id}`);
+   					}
+   				}
+   			}
+   		})
+   	},
     refreshFan: function (data) {
       if (data) {
         data.forEach((element) => {

+ 30 - 4
src/views/WindSite/components/generalappearance/qs.vue

@@ -3386,6 +3386,7 @@
 </template>
 <script>
 import previewPicture from "../previewPicture.vue";
+import $ from "jquery";
 export default {
   components: {
     previewPicture,
@@ -3397,10 +3398,35 @@ export default {
       green: "#02A434",
       red: "#FF0000",
       datas: undefined,
-    };
-  },
-  created() {},
-  methods: {
+		fjID:'',
+     };
+   },
+   beforeUpdate() {
+   	if(this.fjID == ''){
+   		this.fjClcik();
+   	}
+   },
+   methods: {
+   	fjClcik(){
+   		var that = this;
+   		$('#fan g').click(function(){
+   			if($(this).attr('id') != undefined){
+   				if(that.fjID == ''){
+   					that.fjID = $(this).attr('id');
+   					var p = that.$route.path.split('/');
+   					var pData = p[p.length - 1].split('_')[0].substr(0,1);
+   					var wpId = p[p.length - 1];
+   					var id = parseInt($(this).attr('id').split('_')[2]);
+   					if(id<10){
+   						id = '0'+id
+   					}
+   					if (wpId.indexOf("FDC") !== -1) {
+   						that.$router.replace(`/monitor/windsite/info/${wpId}/${pData[0] + 'G01_'+id}`);
+   					}
+   				}
+   			}
+   		})
+   	},
     refreshFan: function (data) {
       if (data) {
         data.forEach((element) => {

+ 30 - 4
src/views/WindSite/components/generalappearance/sbq.vue

@@ -4323,6 +4323,7 @@
 </template>
 <script>
 import previewPicture from "../previewPicture.vue";
+import $ from "jquery";
 export default {
   components: {
     previewPicture,
@@ -4334,10 +4335,35 @@ export default {
       green: "#02A434",
       red: "#FF0000",
       datas: undefined,
-    };
-  },
-  created() {},
-  methods: {
+		fjID:'',
+     };
+   },
+   beforeUpdate() {
+   	if(this.fjID == ''){
+   		this.fjClcik();
+   	}
+   },
+   methods: {
+   	fjClcik(){
+   		var that = this;
+   		$('#fan g').click(function(){
+   			if($(this).attr('id') != undefined){
+   				if(that.fjID == ''){
+   					that.fjID = $(this).attr('id');
+   					var p = that.$route.path.split('/');
+   					var pData = p[p.length - 1].split('_')[0].substr(0,1);
+   					var wpId = p[p.length - 1];
+   					var id = parseInt($(this).attr('id').split('_')[2]);
+   					if(id<10){
+   						id = '0'+id
+   					}
+   					if (wpId.indexOf("FDC") !== -1) {
+   						that.$router.replace(`/monitor/windsite/info/${wpId}/${pData[0] + 'G01_'+id}`);
+   					}
+   				}
+   			}
+   		})
+   	},
     refreshFan: function (data) {
       if (data) {
         data.forEach((element) => {

+ 30 - 4
src/views/WindSite/components/generalappearance/xs.vue

@@ -7108,6 +7108,7 @@
 </template>
 <script>
 import previewPicture from "../previewPicture.vue";
+import $ from "jquery";
 export default {
   components: {
     previewPicture,
@@ -7119,10 +7120,35 @@ export default {
       green: "#02A434",
       red: "#FF0000",
       datas: undefined,
-    };
-  },
-  created() {},
-  methods: {
+		fjID:'',
+     };
+   },
+   beforeUpdate() {
+   	if(this.fjID == ''){
+   		this.fjClcik();
+   	}
+   },
+   methods: {
+   	fjClcik(){
+   		var that = this;
+   		$('#fan g').click(function(){
+   			if($(this).attr('id') != undefined){
+   				if(that.fjID == ''){
+   					that.fjID = $(this).attr('id');
+   					var p = that.$route.path.split('/');
+   					var pData = p[p.length - 1].split('_')[0].substr(0,1);
+   					var wpId = p[p.length - 1];
+   					var id = parseInt($(this).attr('id').split('_')[2]);
+   					if(id<10){
+   						id = '0'+id
+   					}
+   					if (wpId.indexOf("FDC") !== -1) {
+   						that.$router.replace(`/monitor/windsite/info/${wpId}/${pData[0] + 'G01_'+id}`);
+   					}
+   				}
+   			}
+   		})
+   	},
     refreshFan: function (data) {
       if (data) {
         data.forEach((element) => {