Browse Source

性能下降模块代码优化

mw_666 3 years ago
parent
commit
5b6961ce3a
1 changed files with 4 additions and 6 deletions
  1. 4 6
      src/views/sampleDatabase/performance/index.vue

+ 4 - 6
src/views/sampleDatabase/performance/index.vue

@@ -102,7 +102,6 @@
 					},
 				},
 				ids: [],
-				windId: '',
 				checkLength: 0, //对标分析只能选择5个
 				yblx: 0,
 				yblxArr: [{
@@ -138,7 +137,6 @@
 							},
 							click: function(event, data) {
 								let id = data.id;
-								that.windId = data.windturbineid;
 								if (event.target.checked == false && that.checkLength <= 5) {
 									that.ids.forEach((item, i) => {
 										if (item == id) {
@@ -245,10 +243,10 @@
 			},
 			onClickOption(e, row) { // 操作按钮
 				if ("config" == e.target.getAttribute("value")) { //查看
-					this.chart([row.id], row.windturbineid);
+					this.chart([row.id]);
 				}
 			},
-			chart(ids, windId) {
+			chart(ids) {
 				const that = this;
 				BASE.showLoading({ text:"加载中..." });
 				that.API.requestData({
@@ -267,7 +265,7 @@
 								zs = [],
 								dotData = [];
 							keys.forEach(ele => {
-								let keyId = ele.substring(ele.indexOf("_") + 1, ele.indexOf("_" + windId)),
+								let keyId = ele.split('_')[1],
 									dataType = ele.slice(0, 1);
 								ids.forEach(ele2 => {
 									if (ele2 == keyId && dataType == 'C') {
@@ -294,7 +292,7 @@
 			dbfx() {
 				var that = this;
 				if (that.ids.length <= 5 && that.ids.length != 0) {
-					that.chart(that.ids, that.windId);
+					that.chart(that.ids);
 				} else {
 					this.BASE.showMsg({
 						type: "warning",