Преглед изворни кода

解决table详情对标无法显示问题

mw_666 пре 4 година
родитељ
комит
86bd706504

+ 3 - 3
src/views/Decision/Decision1Mx.vue

@@ -67,12 +67,12 @@
 		<div class="contentMx">
 			<div class="activeMx">
 				<el-row :type="'flex'" class="content">
-					<el-col :span="12" class="pd-r-8">
+					<el-col :span="10" class="pd-r-8">
 						<toolbar-panel title="风机绩效榜明细" :showLine="false">
 							<bar-line-chart :height="'calc(100vh - 200px)'" :bardata="bardata" :lineData="lineData" :color="barColor" lineName="理论发电量"/>
 						</toolbar-panel>
 					</el-col>
-					<el-col :span="12" class="pd-l-8">
+					<el-col :span="14" class="pd-l-8">
 						<panel :title="'项目列表'" :showLine="false">
 							<div class="project-table">
 								<Table :data="tableData"></Table>
@@ -366,7 +366,7 @@
 				var that = this;
 				that.API.requestData({
 					method: "GET",
-					subUrl: "benchmarking/fjjxb",
+					subUrl: "benchmarking/fjjxbmx",
 					data: {
 						wpids: that.value1,
 						projectids: that.value2,

+ 20 - 10
src/views/Decision/Decision2.vue

@@ -62,7 +62,7 @@
 		<div v-show="detailShow==1">
 			<div class="mg-b-16">
 				<div class="project-table">
-					<Table :data="tableData" :canScroll="false"></Table>
+					<Table :data="tableData" :canScroll="false" ref="curRef"></Table>
 				</div>
 			</div>
 			<el-row class="mg-b-16">
@@ -88,11 +88,6 @@
 						:units='["(万KWh)"]' />
 				</panel>
 			</div>
-			<el-dialog title="对标排名分析" v-model="dialogVisible" width="70%" top="10vh" custom-class="modal"
-				:close-on-click-modal="false">
-				<dayinfo :radarValue="radarValue" :windNum="windNum" :windNum2="windNum2" :tabs="tabs"
-					:analyisDialog="analyisDialog" />
-			</el-dialog>
 		</div>
 		<el-row :type="'flex'" class="content" v-show="detailShow==2">
 			<el-col :span="24" class="pd-l-8">
@@ -103,6 +98,11 @@
 				</panel>
 			</el-col>
 		</el-row>
+		<el-dialog title="对标排名分析" v-model="dialogVisible" width="70%" top="10vh" custom-class="modal"
+			:close-on-click-modal="false">
+			<dayinfo :radarValue="radarValue" :windNum="windNum" :windNum2="windNum2" :tabs="tabs"
+				:analyisDialog="analyisDialog" />
+		</el-dialog>
 	</div>
 </template>
 
@@ -140,8 +140,8 @@
 							field: "check",
 							is_num: false,
 							is_light: false,
-							template: function() {
-								return "<input class='check' type='CheckBox'/>";
+							template:() => {
+								return "<input class='check curCheckBox' type='CheckBox' />";
 							},
 							click: function(event, data) {
 								// checkbox 事件
@@ -409,7 +409,7 @@
 							is_num: false,
 							is_light: false,
 							template: function() {
-								return "<input class='check checkItem' type='CheckBox' check v-model="+checkData+"/>";
+								return "<input class='check checkItem' type='CheckBox'/>";
 							},
 							click: function(event, data) {
 								var dataId = that.tableIdArr[data.index - 1];
@@ -614,6 +614,7 @@
 				this.value3 = [];
 				this.AjaxCommon();
 				this.XiangMuVal(val);
+				this.clearDb();
 			},
 			XiangMuVal(val) {
 				var that = this;
@@ -633,6 +634,7 @@
 				this.value3 = [];
 				this.AjaxCommon();
 				this.XianLuVal(val);
+				this.clearDb();
 			},
 			XianLuVal(val) {
 				var that = this;
@@ -650,14 +652,17 @@
 			XianLuChange(val) {
 				this.value3 = val;
 				this.AjaxCommon();
+				this.clearDb();
 			},
 			BeginChange(val) {
 				this.value4 = val;
 				this.AjaxCommon();
+				this.clearDb();
 			},
 			EndChange(val) {
 				this.value5 = val;
 				this.AjaxCommon();
+				this.clearDb();
 			},
 			getTime(val) { //时间戳处理,val=1是默认开始时间(当前月第一天),val=2是默认结束时间(今天)
 				var date = new Date();
@@ -939,9 +944,14 @@
 				if (that.tableId.length == 2) {
 					that.dialogVisible = true;
 					this.AjaxDbfx();
+					this.clearDb();
 				}
 			},
-
+			clearDb(){//清空对标状态
+				this.$refs.curRef.clearCheckBox();
+				this.tableId = [];
+				this.checkLength = 0;
+			}
 		}
 	};
 </script>

+ 16 - 8
src/views/Decision/Decision2Cjdb.vue

@@ -42,7 +42,7 @@
 		<div v-show="detailShow==1">
 			<div class="mg-b-16">
 				<div class="project-table">
-					<Table :data="tableData" :canScroll="false"></Table>
+					<Table :data="tableData" :canScroll="false" ref="curRef"></Table>
 				</div>
 			</div>
 			<el-row class="mg-b-16">
@@ -63,11 +63,6 @@
 						:units='["(万KWh)"]' />
 				</panel>
 			</div>
-			<el-dialog title="对标排名分析" v-model="dialogVisible" width="70%" top="10vh" custom-class="modal"
-				:close-on-click-modal="false">
-				<dayinfo :radarValue="radarValue" :windNum="windNum" :windNum2="windNum2" :tabs="tabs"
-					:analyisDialog="analyisDialog" />
-			</el-dialog>
 		</div>
 		<el-row :type="'flex'" class="content" v-show="detailShow==2">
 			<el-col :span="24" class="pd-l-8">
@@ -78,6 +73,11 @@
 				</panel>
 			</el-col>
 		</el-row>
+		<el-dialog title="对标排名分析" v-model="dialogVisible" width="70%" top="10vh" custom-class="modal"
+			:close-on-click-modal="false">
+			<dayinfo :radarValue="radarValue" :windNum="windNum" :windNum2="windNum2" :tabs="tabs"
+				:analyisDialog="analyisDialog" />
+		</el-dialog>
 	</div>
 </template>
 
@@ -116,7 +116,7 @@
 							is_num: false,
 							is_light: false,
 							template: function() {
-								return "<input class='check' type='CheckBox'/>";
+								return "<input class='check curCheckBox' type='CheckBox'/>";
 							},
 							click: function(event, data) {
 								// checkbox 事件
@@ -578,14 +578,17 @@
 			ChangZhanChange(val) {
 				this.value1 = val;
 				this.AjaxCommon();
+				this.clearDb();
 			},
 			BeginChange(val) {
 				this.value4 = val;
 				this.AjaxCommon();
+				this.clearDb();
 			},
 			EndChange(val) {
 				this.value5 = val;
 				this.AjaxCommon();
+				this.clearDb();
 			},
 			getTime(val) { //时间戳处理,val=1是默认开始时间(当前月第一天),val=2是默认结束时间(今天)
 				var date = new Date();
@@ -617,7 +620,6 @@
 						sort: ''
 					},
 					success(res) {
-						console.log(JSON.stringify(res))
 						that.ajaxData = res.data;
 						var dataTab = [], //表格
 							fdl = [],
@@ -864,7 +866,13 @@
 				if (that.tableId.length == 2) {
 					that.dialogVisible = true;
 					this.AjaxDbfx();
+					this.clearDb();
 				}
+			},
+			clearDb(){//清空对标状态
+				this.$refs.curRef.clearCheckBox();
+				this.tableId = [];
+				this.checkLength = 0;
 			}
 		}
 	};

+ 16 - 10
src/views/Decision/Decision2Cndb.vue

@@ -41,7 +41,7 @@
 		<div v-show="detailShow==1">
 			<div class="mg-b-16">
 				<div class="project-table">
-					<Table :data="tableData" :canScroll="false"></Table>
+					<Table :data="tableData" :canScroll="false" ref="curRef"></Table>
 				</div>
 			</div>
 			<el-row :type="'flex'" class="content">
@@ -52,11 +52,6 @@
 					</panel>
 				</el-col>
 			</el-row>
-			<el-dialog title="对标排名分析" v-model="dialogVisible" width="70%" top="10vh" custom-class="modal"
-				:close-on-click-modal="false">
-				<dayinfo :radarValue="radarValue" :windNum="windNum" :windNum2="windNum2" :tabs="tabs"
-					:analyisDialog="analyisDialog" />
-			</el-dialog>
 		</div>
 		<el-row :type="'flex'" class="content" v-show="detailShow==2">
 			<el-col :span="24" class="pd-l-8">
@@ -67,6 +62,11 @@
 				</panel>
 			</el-col>
 		</el-row>
+		<el-dialog title="对标排名分析" v-model="dialogVisible" width="70%" top="10vh" custom-class="modal"
+			:close-on-click-modal="false">
+			<dayinfo :radarValue="radarValue" :windNum="windNum" :windNum2="windNum2" :tabs="tabs"
+				:analyisDialog="analyisDialog" />
+		</el-dialog>
 	</div>
 </template>
 
@@ -106,7 +106,7 @@
 							is_num: false,
 							is_light: false,
 							template: function() {
-								return "<input class='check' type='CheckBox'/>";
+								return "<input class='check curCheckBox' type='CheckBox'/>";
 							},
 							click: function(event, data) {
 								var dataDate = that.tableDateArr[data.index - 1];
@@ -561,14 +561,17 @@
 			ChangZhanChange(val) {
 				this.value1 = val;
 				this.AjaxCommon();
+				this.clearDb();
 			},
 			BeginChange(val) {
 				this.value4 = val;
 				this.AjaxCommon();
+				this.clearDb();
 			},
 			EndChange(val) {
 				this.value5 = val;
 				this.AjaxCommon();
+				this.clearDb();
 			},
 			getTime(val) { //时间戳处理,val=1是默认开始时间(当前月第一天),val=2是默认结束时间(今天)
 				var date = new Date();
@@ -804,9 +807,6 @@
 					value: slssdl
 				})
 				that.analyisDialog = analyis;
-
-
-
 			},
 			tooltip(param, callback) {
 				var color = ["#05bb4c", "#4b55ae", "#fa8c16", "#f8de5b"];
@@ -825,7 +825,13 @@
 				if (that.tableDate.length == 2) {
 					that.dialogVisible = true;
 					this.AjaxDbfx();
+					this.clearDb();
 				}
+			},
+			clearDb(){//清空对标状态
+				this.$refs.curRef.clearCheckBox();
+				this.tableId = [];
+				this.checkLength = 0;
 			}
 		}
 	};

+ 51 - 9
src/views/Decision/Decision2Xldb.vue

@@ -13,6 +13,16 @@
 					</div>
 				</div>
 				<div class="query-item">
+					<div class="lable">项目:</div>
+					<div class="search-input">
+						<el-select v-model="value2" @change="XiangMuChange(value2)" multiple placeholder="请选择"
+							popper-class="select">
+							<el-option v-for="item in XiangMu" :key="item.id" :value="item.id" :label="item.name">
+							</el-option>
+						</el-select>
+					</div>
+				</div>
+				<div class="query-item">
 					<div class="lable">线路:</div>
 					<div class="search-input">
 						<el-select v-model="value3" @change="XianLuChange(value3)" multiple placeholder="请选择"
@@ -52,7 +62,7 @@
 		<div v-show="detailShow==1">
 			<div class="mg-b-16">
 				<div class="project-table">
-					<Table :data="tableData" :canScroll="false"></Table>
+					<Table :data="tableData" :canScroll="false" ref="curRef"></Table>
 				</div>
 			</div>
 			<el-row class="mg-b-16">
@@ -73,11 +83,6 @@
 						:units='["(万KWh)"]' />
 				</panel>
 			</div>
-			<el-dialog title="对标排名分析" v-model="dialogVisible" width="70%" top="10vh" custom-class="modal"
-				:close-on-click-modal="false">
-				<dayinfo :radarValue="radarValue" :windNum="windNum" :windNum2="windNum2" :tabs="tabs"
-					:analyisDialog="analyisDialog" />
-			</el-dialog>
 		</div>
 		<el-row :type="'flex'" class="content" v-show="detailShow==2">
 			<el-col :span="24" class="pd-l-8">
@@ -88,6 +93,11 @@
 				</panel>
 			</el-col>
 		</el-row>
+		<el-dialog title="对标排名分析" v-model="dialogVisible" width="70%" top="10vh" custom-class="modal"
+			:close-on-click-modal="false">
+			<dayinfo :radarValue="radarValue" :windNum="windNum" :windNum2="windNum2" :tabs="tabs"
+				:analyisDialog="analyisDialog" />
+		</el-dialog>
 	</div>
 </template>
 
@@ -126,7 +136,7 @@
 							is_num: false,
 							is_light: false,
 							template: function() {
-								return "<input class='check' type='CheckBox'/>";
+								return "<input class='check curCheckBox' type='CheckBox'/>";
 							},
 							click: function(event, data) {
 								// checkbox 事件
@@ -329,7 +339,6 @@
 							click: function(event, data) {
 								var dataId = that.tableIdArr[data.index - 1];
 								that.detailShow = 2;
-								// var that = this;
 								that.API.requestData({
 									method: "GET",
 									subUrl: "benchmarking/details",
@@ -411,6 +420,7 @@
 								} else if (that.checkLength == 2) {
 									event.target.checked = false;
 								}
+								console.log(that.tableId)
 							},
 						},
 						{
@@ -555,6 +565,7 @@
 				XiangMu: [], //项目
 				XianLu: [], //线路
 				value1: [],
+				value2: [],
 				value3: [],
 				value4: "",
 				value5: "",
@@ -594,9 +605,31 @@
 			},
 			ChangZhanChange(val) {
 				this.value1 = val;
+				this.value2 = [];
+				this.value3 = [];
+				this.AjaxCommon();
+				this.XiangMuVal(val);
+				this.clearDb();
+			},
+			XiangMuVal(val) {
+				var that = this;
+				that.API.requestData({
+					method: "GET",
+					subUrl: "benchmarking/projectList",
+					data: {
+						wpids: val
+					},
+					success(res) {
+						that.XiangMu = res.data;
+					}
+				});
+			},
+			XiangMuChange(val) {
+				this.value2 = val;
 				this.value3 = [];
 				this.AjaxCommon();
 				this.XianLuVal(val);
+				this.clearDb();
 			},
 			XianLuVal(val) {
 				var that = this;
@@ -614,14 +647,17 @@
 			XianLuChange(val) {
 				this.value3 = val;
 				this.AjaxCommon();
+				this.clearDb();
 			},
 			BeginChange(val) {
 				this.value4 = val;
 				this.AjaxCommon();
+				this.clearDb();
 			},
 			EndChange(val) {
 				this.value5 = val;
 				this.AjaxCommon();
+				this.clearDb();
 			},
 			getTime(val) { //时间戳处理,val=1是默认开始时间(当前月第一天),val=2是默认结束时间(今天)
 				var date = new Date();
@@ -645,7 +681,7 @@
 					subUrl: "benchmarking/xldb",
 					data: {
 						wpids: that.value1,
-						projectids: '',
+						projectids: that.value2,
 						lineids: that.value3,
 						beginDate: that.value4,
 						endDate: that.value5,
@@ -904,7 +940,13 @@
 				if (that.tableId.length == 2) {
 					that.dialogVisible = true;
 					this.AjaxDbfx();
+					this.clearDb();
 				}
+			},
+			clearDb(){//清空对标状态
+				this.$refs.curRef.clearCheckBox();
+				this.tableId = [];
+				this.checkLength = 0;
 			}
 		}
 	};

+ 17 - 9
src/views/Decision/Decision2Xmdb.vue

@@ -52,7 +52,7 @@
 		<div v-show="detailShow==1">
 			<div class="mg-b-16">
 				<div class="project-table">
-					<Table :data="tableData" :canScroll="false"></Table>
+					<Table :data="tableData" :canScroll="false" ref="curRef"></Table>
 				</div>
 			</div>
 			<el-row class="mg-b-16">
@@ -73,11 +73,6 @@
 						:units='["(万KWh)"]' />
 				</panel>
 			</div>
-			<el-dialog title="对标排名分析" v-model="dialogVisible" width="70%" top="10vh" custom-class="modal"
-				:close-on-click-modal="false">
-				<dayinfo :radarValue="radarValue" :windNum="windNum" :windNum2="windNum2" :tabs="tabs"
-					:analyisDialog="analyisDialog" />
-			</el-dialog>
 		</div>
 		<el-row :type="'flex'" class="content" v-show="detailShow==2">
 			<el-col :span="24" class="pd-l-8">
@@ -88,6 +83,11 @@
 				</panel>
 			</el-col>
 		</el-row>
+		<el-dialog title="对标排名分析" v-model="dialogVisible" width="70%" top="10vh" custom-class="modal"
+			:close-on-click-modal="false">
+			<dayinfo :radarValue="radarValue" :windNum="windNum" :windNum2="windNum2" :tabs="tabs"
+				:analyisDialog="analyisDialog" />
+		</el-dialog>
 	</div>
 </template>
 
@@ -126,7 +126,7 @@
 							is_num: false,
 							is_light: false,
 							template: function() {
-								return "<input class='check' type='CheckBox'/>";
+								return "<input class='check curCheckBox' type='CheckBox'/>";
 							},
 							click: function(event, data) {
 								// checkbox 事件
@@ -596,6 +596,7 @@
 				this.value2 = [];
 				this.AjaxCommon();
 				this.XiangMuVal(val);
+				this.clearDb();
 			},
 			XiangMuVal(val) {
 				var that = this;
@@ -613,14 +614,17 @@
 			XiangMuChange(val) {
 				this.value2 = val;
 				this.AjaxCommon();
+				this.clearDb();
 			},
 			BeginChange(val) {
 				this.value4 = val;
 				this.AjaxCommon();
+				this.clearDb();
 			},
 			EndChange(val) {
 				this.value5 = val;
 				this.AjaxCommon();
+				this.clearDb();
 			},
 			getTime(val) { //时间戳处理,val=1是默认开始时间(当前月第一天),val=2是默认结束时间(今天)
 				var date = new Date();
@@ -882,8 +886,6 @@
 					value: slssdl
 				})
 				that.analyisDialog = analyis;
-				
-				
 			},
 			tooltip(param, callback) {
 				var color = ["#05bb4c", "#4b55ae", "#fa8c16", "#f8de5b"];
@@ -902,7 +904,13 @@
 				if (that.tableId.length == 2) {
 					that.dialogVisible = true;
 					this.AjaxDbfx();
+					this.clearDb();
 				}
+			},
+			clearDb(){//清空对标状态
+				this.$refs.curRef.clearCheckBox();
+				this.tableId = [];
+				this.checkLength = 0;
 			}
 		}
 	};