Browse Source

1.1 报表排序 恢复失败,我乱改先

64060764@qq.com 1 year ago
parent
commit
41daf5555b

+ 42 - 30
src/views/equip-management/report/list.vue

@@ -4,36 +4,36 @@
 			<div style="padding-top: 12px;">
 				<el-form :inline="true" :model="queryParams" ref="queryRef" v-show="true" label-width="60px">
 					<el-form-item label="" prop="province">
-						<el-select 
-							size="small" 
-							v-model="operateSubjectForm.province" 
+						<el-select
+							size="small"
+							v-model="operateSubjectForm.province"
 							@visible-change="getProvinceListFnc"
-							placeholder="省" 
-							@change="provinceChange" 
+							placeholder="省"
+							@change="provinceChange"
 							clearable
-							filterable 
+							filterable
 						>
-							<el-option 
-								v-for="(item, index) in provinceOption" 
-								:label="item.province" 
+							<el-option
+								v-for="(item, index) in provinceOption"
+								:label="item.province"
 								:value="item.province"
 								:key="+new Date() + index"
 							></el-option>
 						</el-select>
 					</el-form-item>
 					<el-form-item>
-						<el-select 
-							size="small" 
-							v-model="operateSubjectForm.city" 
-							@visible-change="getCityListFnc" 
+						<el-select
+							size="small"
+							v-model="operateSubjectForm.city"
+							@visible-change="getCityListFnc"
 							placeholder="市"
-							@change="cityChange" 
+							@change="cityChange"
 							clearable
 							filterable
 						>
-							<el-option 
-								v-for="(item, index) in cityOption" 
-								:label="item.city" 
+							<el-option
+								v-for="(item, index) in cityOption"
+								:label="item.city"
 								:value="item.city"
 								:key="+new Date() + index"
 							></el-option>
@@ -412,9 +412,9 @@ import PopEndInfo from './PopEndInfo.vue';
 
 import { listBox, listArgs } from '../../../js/api.js';
 import { expandAllNodes, mergeTableRows } from '../../../js/merge.js';
-import { 
+import {
 	sortBoxList,
-	sortBoxListByHost, 
+	sortBoxListByHost,
 	sortBoxListByNewTrend,
 	sortBoxListByHeatExchange,
 	sortBoxListByEnd
@@ -646,16 +646,27 @@ export default {
 			)
 		},
 		handleSortChanged(val) {
+			console.log('val is: ',val)
 			this.queryParams.page_index = 1;
 			this.prop = val.prop
 			this.order = val.order
-			if (this.dataSource && this.dataSource.length > 0) {
-				define.setPropColorVal(this.dataSource, this.argsList);
-				this.sortDataSource(val);
-				this.genTableData();
-			} else {
-				this.getBoxList(val);
+			if (val.order != null){
+				console.log('val.order != null',this.order,this.prop)
+				if (this.dataSource && this.dataSource.length > 0) {
+					define.setPropColorVal(this.dataSource, this.argsList);
+					this.sortDataSource(val);
+					this.genTableData();
+				} else {
+					this.getBoxList(val);
+				}
+			}else{
+				console.log('val.order == null',this.order,this.prop)
+				console.log('无排序条件,重新拉取数据')
+				this.queryParams.page_index = 1;
+				this.getBoxList();
+				//this.getBoxList(val);
 			}
+
 		},
 		debug(val) {
 			console.log('val is', val)
@@ -830,6 +841,7 @@ export default {
 			this.dataSource = filterData;
 		},
 		sortDataSource(sort) {
+			console.log('sort is: ',sort)
 			// 先排序
 			if (!sort || !sort.prop.length) {
 				return;
@@ -1016,12 +1028,12 @@ export default {
 	margin-top: 10px;
 }
 
-.el-table__body-wrapper {    
-  &::-webkit-scrollbar { // 滚动条高 解决行未对齐      
-    height: 18px;    
-  } 
+.el-table__body-wrapper {
+  &::-webkit-scrollbar { // 滚动条高 解决行未对齐
+    height: 18px;
+  }
 }
-.el-table__fixed-body-wrapper .el-table__body {  
+.el-table__fixed-body-wrapper .el-table__body {
   padding-bottom: 18px; // 滚动条高度
 }
 </style>

+ 7 - 6
src/views/oa-management/consumble-watch/index.vue

@@ -534,10 +534,11 @@ export default {
 				type: "warning"
 			}).then(async () => {
 				//下发mqtt,value=0给盒子
-				const res = await sendCtrlMessage(
-						row.uuid,
-						row.box_id,
+				const res = await sendConsumablesMessage(
 						row.newtrend_order,
+						row.box_id,
+						row.order,
+						row.uuid,
 						"newtrend",
 						[{ key: 'consumables', value: 0 }]
 				);
@@ -580,10 +581,10 @@ export default {
 					const res = await sendConsumablesMessage(
 							row.newtrend_order,
 							row.box_id,
-							r.result[0].order,
-							r.result[0].uuid,
+							row.order,
+							row.uuid,
 							"newtrend",
-							[{ key: 'consumables', value: r.result[0].count }]
+							[{ key: 'consumables', value: 1 }]
 					);
 					if (res.code === 200) {
 						this.$notify({