Browse Source

bug fixed

kukuasir@vip.qq.com 1 year ago
parent
commit
b9471299c9
3 changed files with 170 additions and 144 deletions
  1. 5 1
      src/js/api.js
  2. 29 34
      src/js/merge.js
  3. 136 109
      src/views/equip-management/report/list.vue

+ 5 - 1
src/js/api.js

@@ -1,14 +1,18 @@
 import axios from 'axios'
 const base = "http://47.110.15.40:9001/";
+
 export function listProjects(queryParams) {
 	return axios.post('http://47.110.15.40:9001/proj/reportList', queryParams)
 }
 
+export function listBox(queryParams) {
+  return axios.post("http://47.110.15.40:9001/proj/reportBoxList", queryParams);
+}
+
 export function listArgs() {
 	return axios.get('http://47.110.15.40:9001/proj/args/list')
 }
 
-//
 export function updateRecord (data) {
 	return post('http://47.110.15.40:9001/version/update/record', data)
 }

+ 29 - 34
src/js/merge.js

@@ -1,41 +1,36 @@
 import define from './common.js'
 
 // 展开所有数据
-export function expandAllNodes(projects) {
+export function expandAllNodes(boxList) {
 	let tableData = []
-	projects.forEach((p, index) => {
-		if (Array.isArray(p.boxList)) {
-			p.boxList.forEach(b => {
-				// 继续判断有多少单机,主机、新风机、换热站、末端单机数量取最大值
-				let maxCnt = define.calcMaxStandaloneCnt(b)
-				for (let i = 0; i < maxCnt; i++) {
-					let hpStandalone = b.hostCtrl && i < b.hostCtrl.length ? b.hostCtrl[i] : {}
-					let dhStandalone = b.newTrendCtrl && i < b.newTrendCtrl.length ? b.newTrendCtrl[i] : {}
-					let hexStandalone = b.hex && i < b.hex.length ? b.hex[i] : {}
-					let cbStandalone = define.calcEndMinAndMaxValue(b.end || [])
-					tableData.push({
-            // projectId: p.project_auto_id,
-            projectId: index + 1,
-            projectName: p.projectName,
-            boxId: b.box_id,
-            boxName: b.boxName,
-            runStatus: b.runStatus,
-            runMode: b.runMode,
-            hpCnt: b.hostCtrl && b.hostCtrl.length,
-            dhCnt: b.newTrendCtrl && b.newTrendCtrl.length,
-            hexCnt: b.hex && b.hex.length,
-            cbCnt: b.end && b.end.length,
-            maxCnt,
-            standaloneIndex: i,
-            ...hpStandalone,
-            ...dhStandalone,
-            ...hexStandalone,
-            ...cbStandalone,
-          });
-				}
-			})
-		}
-	})
+	boxList.forEach(b => {
+    // 继续判断有多少单机,主机、新风机、换热站、末端单机数量取最大值
+    let maxCnt = define.calcMaxStandaloneCnt(b);
+    for (let i = 0; i < maxCnt; i++) {
+      let hpStandalone =
+        b.hostCtrl && i < b.hostCtrl.length ? b.hostCtrl[i] : {};
+      let dhStandalone =
+        b.newTrendCtrl && i < b.newTrendCtrl.length ? b.newTrendCtrl[i] : {};
+      let hexStandalone = b.hex && i < b.hex.length ? b.hex[i] : {};
+      let cbStandalone = define.calcEndMinAndMaxValue(b.end || []);
+      tableData.push({
+        boxId: b.box_id,
+        boxName: b.boxName,
+        runStatus: b.runStatus,
+        runMode: b.runMode,
+        hpCnt: b.hostCtrl && b.hostCtrl.length,
+        dhCnt: b.newTrendCtrl && b.newTrendCtrl.length,
+        hexCnt: b.hex && b.hex.length,
+        cbCnt: b.end && b.end.length,
+        maxCnt,
+        standaloneIndex: i,
+        ...hpStandalone,
+        ...dhStandalone,
+        ...hexStandalone,
+        ...cbStandalone,
+      });
+    }
+  });
 	// 合并单机
 	return _getStandaloneSpanRows(tableData)
 }

+ 136 - 109
src/views/equip-management/report/list.vue

@@ -87,7 +87,7 @@
 					</el-row>
 				</div>
 				<el-table
-					:data="tableData" 
+					:data="pageData" 
 					@sort-change="changeSort" 
 					:span-method="objectSpanMethod"
 					@selection-change="handleSelectionChange" 
@@ -97,10 +97,9 @@
 					<el-table-column type="selection" width="60" align="center" fixed />
 					<el-table-column label="序号" width="60" align="center" fixed>
 						<template slot-scope="scope">
-							<span>{{ (queryParams.page_index - 1) * queryParams.page_size + scope.row.projectId }}</span>
+							<span>{{ (queryParams.page_index - 1) * queryParams.page_size + scope.$index + 1 }}</span>
 						</template>
 					</el-table-column>
-					<!-- <el-table-column prop="projectName" label="项目名称" align="center" width="180" fixed sortable /> -->
 					<el-table-column prop="boxName" label="盒子名称" align="center" width="180" fixed sortable>
 						<template slot-scope="scope">
 							<span @click="debug(scope)">{{ scope.row.boxName }}</span>
@@ -128,7 +127,7 @@
 								<span>{{ scope.row.host_order || '/' }}</span>
 							</template>
 						</el-table-column>
-						<el-table-column prop="host_connect_status" label="通讯状态" align="center" width="100">
+						<el-table-column prop="host_connect_status" label="通讯状态" align="center" width="100" sortable>
 							<template slot-scope="scope">
 								<span v-if="scope.row.host_connect_status != undefined && scope.row.host_connect_status != null"
 									class="el-table-tag" :style="{ background: connectStatColor(scope.row, 'host_connect_status') }">
@@ -137,7 +136,7 @@
 								<span v-else>/</span>
 							</template>
 						</el-table-column>
-						<el-table-column prop="host_fault" label="故障" align="center" width="90">
+						<el-table-column prop="host_fault" label="故障" align="center" width="90" sortable>
 							<template slot-scope="scope">
 								<span v-if="scope.row.host_fault != undefined && scope.row.host_fault != null" class="el-table-tag"
 									:style="{ background: faultColor(scope.row, 'host_fault') }">
@@ -146,7 +145,7 @@
 								<span v-else>/</span>
 							</template>
 						</el-table-column>
-						<el-table-column prop="host_su_temp" label="供水水温(℃)" align="center" width="120">
+						<el-table-column prop="host_su_temp" label="供水水温(℃)" align="center" width="120" sortable>
 							<template slot-scope="scope">
 								<span v-if="scope.row.host_su_temp" class="el-table-tag" :style="{ background: calcArgsColor(scope) }">
 									{{ fixedVal(scope.row, 'host_su_temp') }}
@@ -154,7 +153,7 @@
 								<span v-else>/</span>
 							</template>
 						</el-table-column>
-						<el-table-column prop="host_re_temp" label="回水水温(℃)" align="center" width="120">
+						<el-table-column prop="host_re_temp" label="回水水温(℃)" align="center" width="120" sortable>
 							<template slot-scope="scope">
 								<span v-if="scope.row.host_re_temp" class="el-table-tag" :style="{ background: calcArgsColor(scope) }">
 									{{ fixedVal(scope.row, 'host_re_temp') }}
@@ -162,7 +161,7 @@
 								<span v-else>/</span>
 							</template>
 						</el-table-column>
-						<el-table-column prop="host_temp_diff" label="温差" align="center" width="100">
+						<el-table-column prop="host_temp_diff" label="温差" align="center" width="100" sortable>
 							<template slot-scope="scope">
 								<div>
 									<span class="el-table-tag" :style="{ background: calcArgsColor(scope) }">
@@ -183,7 +182,7 @@
 								<span>{{ scope.row.nt_order || '/' }}</span>
 							</template>
 						</el-table-column>
-						<el-table-column prop="nt_connect_status" label="通讯状态" align="center" width="100">
+						<el-table-column prop="nt_connect_status" label="通讯状态" align="center" width="100" sortable>
 							<template slot-scope="scope">
 								<span v-if="scope.row.nt_connect_status != undefined && scope.row.nt_connect_status != null"
 									class="el-table-tag" :style="{ background: connectStatColor(scope.row, 'nt_connect_status') }">
@@ -192,7 +191,7 @@
 								<span v-else>/</span>
 							</template>
 						</el-table-column>
-						<el-table-column prop="nt_fault" label="故障" align="center" width="90">
+						<el-table-column prop="nt_fault" label="故障" align="center" width="90" sortable>
 							<template slot-scope="scope">
 								<span v-if="scope.row.nt_fault != undefined && scope.row.nt_fault != null" class="el-table-tag"
 									:style="{ background: faultColor(scope.row, 'nt_fault') }">
@@ -201,7 +200,7 @@
 								<span v-else>/</span>
 							</template>
 						</el-table-column>
-						<el-table-column prop="nt_in_temp" label="送风温度(℃)" align="center" width="120">
+						<el-table-column prop="nt_in_temp" label="送风温度(℃)" align="center" width="120" sortable>
 							<template slot-scope="scope">
 								<span v-if="scope.row.nt_in_temp" class="el-table-tag" :style="{ background: calcArgsColor(scope) }">
 									{{ fixedVal(scope.row, 'nt_in_temp') }}
@@ -209,7 +208,7 @@
 								<span v-else>/</span>
 							</template>
 						</el-table-column>
-						<el-table-column prop="nt_in_humidity" label="送风湿度(%)" align="center" width="120">
+						<el-table-column prop="nt_in_humidity" label="送风湿度(%)" align="center" width="120" sortable>
 							<template slot-scope="scope">
 								<span v-if="scope.row.nt_in_humidity" class="el-table-tag" :style="{ background: calcArgsColor(scope) }">
 									{{ fixedVal(scope.row, 'nt_in_humidity') }}
@@ -217,7 +216,7 @@
 								<span v-else>/</span>
 							</template>
 						</el-table-column>
-						<el-table-column prop="nt_dew_point" label="露点(℃)" align="center" width="120">
+						<el-table-column prop="nt_dew_point" label="露点(℃)" align="center" width="120" sortable>
 							<template slot-scope="scope">
 								<div v-if="scope.row.nt_dew_point">
 									<span class="el-table-tag" :style="{ background: calcArgsColor(scope) }">
@@ -239,7 +238,7 @@
 								<span>{{ scope.row.hex_order || '/' }}</span>
 							</template>
 						</el-table-column>
-						<el-table-column prop="hex_connect_status" label="通讯状态" align="center" width="100">
+						<el-table-column prop="hex_connect_status" label="通讯状态" align="center" width="100" sortable>
 							<template slot-scope="scope">
 								<span v-if="scope.row.hex_connect_status != undefined && scope.row.hex_connect_status != null"
 									class="el-table-tag" :style="{ background: connectStatColor(scope.row, 'hex_connect_status') }">
@@ -248,7 +247,7 @@
 								<span v-else>/</span>
 							</template>
 						</el-table-column>
-						<el-table-column prop="hex_fault" label="故障" align="center" width="90">
+						<el-table-column prop="hex_fault" label="故障" align="center" width="90" sortable>
 							<template slot-scope="scope">
 								<span v-if="scope.row.hex_fault != undefined && scope.row.hex_fault != null" class="el-table-tag"
 									:style="{ background: faultColor(scope.row, 'hex_fault') }">
@@ -257,7 +256,7 @@
 								<span v-else>/</span>
 							</template>
 						</el-table-column>
-						<el-table-column prop="hex_su_temp" label="供水水温(℃)" align="center" width="120">
+						<el-table-column prop="hex_su_temp" label="供水水温(℃)" align="center" width="120" sortable>
 							<template slot-scope="scope">
 								<span v-if="scope.row.hex_su_temp" class="el-table-tag" :style="{ background: calcArgsColor(scope) }">
 									{{ fixedVal(scope.row, 'hex_su_temp') }}
@@ -265,7 +264,7 @@
 								<span v-else>/</span>
 							</template>
 						</el-table-column>
-						<el-table-column prop="hex_re_temp" label="回水水温(℃)" align="center" width="120">
+						<el-table-column prop="hex_re_temp" label="回水水温(℃)" align="center" width="120" sortable>
 							<template slot-scope="scope">
 								<span v-if="scope.row.hex_re_temp" class="el-table-tag" :style="{ background: calcArgsColor(scope) }">
 									{{ fixedVal(scope.row, 'hex_re_temp') }}
@@ -273,7 +272,7 @@
 								<span v-else>/</span>
 							</template>
 						</el-table-column>
-						<el-table-column prop="hex_temp_diff" label="温差(℃)" align="center" width="90">
+						<el-table-column prop="hex_temp_diff" label="温差(℃)" align="center" width="90" sortable>
 							<template slot-scope="scope">
 								<span v-if="scope.row.hex_temp_diff != undefined && scope.row.hex_temp_diff != null" class="el-table-tag"
 									:style="{ background: calcArgsColor(scope) }">
@@ -282,7 +281,7 @@
 								<span v-else>/</span>
 							</template>
 						</el-table-column>
-						<el-table-column prop="hex_pump_status" label="水泵状态" align="center" width="100">
+						<el-table-column prop="hex_pump_status" label="水泵状态" align="center" width="100" sortable>
 							<template slot-scope="scope">
 								<div v-if="scope.row.hex_pump_status != undefined && scope.row.hex_pump_status != null">
 									<span class="el-table-tag" :style="{ background: hexPumpStateColor(scope.row) }">
@@ -300,7 +299,7 @@
 					<!-- 末端列 Begin -->
 					<el-table-column label="" align="center" width="60" :render-header="(h, obj) => renderHeader(h, obj, '末端控制器')">
 						<!-- <el-table-column prop="end_order" label="编号" align="center" width="60" /> -->
-						<el-table-column prop="end_exception_num" label="通讯异常数量" align="center" width="120">
+						<el-table-column prop="end_exception_num" label="通讯异常数量" align="center" width="120" sortable>
 							<template slot-scope="scope">
 								<span v-if="scope.row.end_exception_num != undefined && scope.row.end_exception_num != null"
 									class="el-table-tag" :style="{ background: endExceptionNumColor(scope.row) }">
@@ -309,7 +308,7 @@
 								<span v-else>/</span>
 							</template>
 						</el-table-column>
-						<el-table-column prop="end_min_temp" label="最低室内温度(℃)" align="center" width="140">
+						<el-table-column prop="end_min_temp" label="最低室内温度(℃)" align="center" width="140" sortable>
 							<template slot-scope="scope">
 								<span id="end_min_temp" class="el-table-tag" :style="{ background: calcArgsColor(scope) }"
 									@click="handleItemClick(scope)">
@@ -317,7 +316,7 @@
 								</span>
 							</template>
 						</el-table-column>
-						<el-table-column prop="end_min_humidity" label="最低室内湿度(%)" align="center" width="140">
+						<el-table-column prop="end_min_humidity" label="最低室内湿度(%)" align="center" width="140" sortable>
 							<template slot-scope="scope">
 								<span id="end_min_humidity" class="el-table-tag" :style="{ background: calcArgsColor(scope) }"
 									@click="handleItemClick(scope)">
@@ -325,7 +324,7 @@
 								</span>
 							</template>
 						</el-table-column>
-						<el-table-column prop="end_min_dew_point" label="最低室内露点(℃)" align="center" width="140">
+						<el-table-column prop="end_min_dew_point" label="最低室内露点(℃)" align="center" width="140" sortable>
 							<template slot-scope="scope">
 								<span id="end_min_dew_point" class="el-table-tag" :style="{ background: calcArgsColor(scope) }"
 									@click="handleItemClick(scope)">
@@ -333,7 +332,7 @@
 								</span>
 							</template>
 						</el-table-column>
-						<el-table-column prop="end_max_temp" label="最高室内温度(℃)" align="center" width="140">
+						<el-table-column prop="end_max_temp" label="最高室内温度(℃)" align="center" width="140" sortable>
 							<template slot-scope="scope">
 								<span id="end_max_temp" class="el-table-tag" :style="{ background: calcArgsColor(scope) }"
 									@click="handleItemClick(scope)">
@@ -341,7 +340,7 @@
 								</span>
 							</template>
 						</el-table-column>
-						<el-table-column prop="end_max_humidity" label="最高室内湿度(%)" align="center" width="140">
+						<el-table-column prop="end_max_humidity" label="最高室内湿度(%)" align="center" width="140" sortable>
 							<template slot-scope="scope">
 								<span id="end_max_humidity" class="el-table-tag" :style="{ background: calcArgsColor(scope) }"
 									@click="handleItemClick(scope)">
@@ -349,7 +348,7 @@
 								</span>
 							</template>
 						</el-table-column>
-						<el-table-column prop="end_max_dew_point" label="最高室内露点(℃)" align="center" width="140">
+						<el-table-column prop="end_max_dew_point" label="最高室内露点(℃)" align="center" width="140" sortable>
 							<template slot-scope="scope">
 								<div>
 									<span id="end_max_dew_point" class="el-table-tag" :style="{ background: calcArgsColor(scope) }"
@@ -387,7 +386,7 @@
 import PopMoreTable from '../../../components/PopMoreTable.vue';
 import PopEndInfo from './PopEndInfo.vue';
 
-import { listProjects, listArgs } from '../../../js/api.js';
+import { listBox, listArgs } from '../../../js/api.js';
 import { expandAllNodes, mergeTableRows } from '../../../js/merge.js';
 import { exportToExcel } from '../../../js/export.js';
 import define from '../../../js/common.js';
@@ -502,7 +501,7 @@ export default {
 		return {
 			queryParams: {
 				page_index: 1,
-				page_size: 10,
+				page_size: 20,
 				project_name: undefined,
 				box_name: undefined,
 				online_status: undefined,
@@ -586,7 +585,7 @@ export default {
 		};
 	},
 	created() {
-		this.getProjects();
+		this.getBoxList();
 		this.getArgsList();
 	},
 	// async getDistrictListFunc () {
@@ -634,7 +633,7 @@ export default {
 			console.log('changeSort.val is:', val, val.prop, val.order)
 			this.prop = val.prop
 			this.order = val.order
-			this.getProjects();
+			this.getBoxList(val);
 		},
 		debug(val) {
 			console.log('val is', val)
@@ -693,8 +692,8 @@ export default {
 				this.areaOption = res.result;
 			}
 		},
-		/** 获取项目列表 */
-		getProjects() {
+		/** 获取盒子列表 */
+		getBoxList(sort) {
 			const loading = this.$loading({
 				lock: true,
 				text: '拼命加载中...',
@@ -703,7 +702,6 @@ export default {
 				target: document.querySelector('#container')
 			});
 			var params = {
-				project_name: this.queryParams.project_name,
 				box_name: this.queryParams.box_name,
 				online_status: this.queryParams.online_status,
 				run_mode: this.queryParams.run_mode,
@@ -712,11 +710,11 @@ export default {
 				prop: this.prop,
 				order: this.order,
 			};
-			listProjects(params).then(resp => {
+			listBox(params).then(resp => {
 				let data = resp.data || {};
 				let result = data.result || {};
-				this.filterDataSource(result.data || []);
-				this.genTableData();
+				this.sortAndFilterDataSource(result.data || [], sort);
+				this.genTableData(true);
 				loading.close();
 			}).catch(err => {
 				console.log('[reportList]请求错误: ', err);
@@ -731,9 +729,12 @@ export default {
 				console.log('[args/list]请求错误: ', err);
 			});
 		},
-		/** 本地过滤数据 */
-		filterDataSource(data) {
-			let newDataSource = [];
+		/** 本地数据先排序再过滤 */
+		sortAndFilterDataSource(data, sort) {
+			// 先排序
+			// this.sortDataSource(data, sort);
+			// console.log("排序后的数据: ", data);
+
 			const hpSuTempMin = this.extraParams.hpSuTempMin;
 			const hpSuTempMax = this.extraParams.hpSuTempMax;
 			const dhDewPointMin = this.extraParams.dhDewPointMin;
@@ -744,95 +745,121 @@ export default {
 			const filterDhDewPoint = (this.extraParams.dhDewPointMax > this.extraParams.dhDewPointMin);
 			const filterHexSuTemp = (this.extraParams.hexSuTempMax > this.extraParams.hexSuTempMin);
 			// 凡是不满足条件的盒子,全都过滤掉
+			let newBoxList = deepClone(data);
 			for (let i = 0; i < data.length; i++) {
-				const element = data[i];
-				const boxList = element.boxList || [];
-				let newBoxList = deepClone(boxList);
-				for (let j = 0; j < boxList.length; j++) {
-					const box = boxList[j];
-					let hasFilter1 = false;  // 主机供水温度是否把盒子过滤掉了
-					let hasFilter2 = false;  // 新风送风露点是否把盒子过滤掉了
-					// 过滤主机
-					if (filterHpSuTemp) {
-						const hostCtrl = box.hostCtrl || [];
-						for (let x = 0; x < hostCtrl.length; x++) {
-							const hp = hostCtrl[x];
-							if (hp.host_su_temp < hpSuTempMin || hp.host_su_temp > hpSuTempMax) {
-								newBoxList.splice(j, 1);
-								hasFilter1 = true;
-								break;
-							}
+				const box = data[i];
+				let hasFilter1 = false;  // 主机供水温度是否把盒子过滤掉了
+				let hasFilter2 = false;  // 新风送风露点是否把盒子过滤掉了
+				// 过滤主机
+				if (filterHpSuTemp) {
+					const hostCtrl = box.hostCtrl || [];
+					for (let j = 0; j < hostCtrl.length; j++) {
+						const hp = hostCtrl[j];
+						if (hp.host_su_temp < hpSuTempMin || hp.host_su_temp > hpSuTempMax) {
+							newBoxList.splice(i, 1);
+							hasFilter1 = true;
+							break;
 						}
 					}
-					// 过滤新风机
-					if (filterDhDewPoint && !hasFilter1) {
-						const newTrendCtrl = box.newTrendCtrl || [];
-						for (let x = 0; x < newTrendCtrl.length; x++) {
-							const dh = newTrendCtrl[x];
-							if (dh.nt_dew_point < dhDewPointMin || dh.nt_dew_point > dhDewPointMax) {
-								newBoxList.splice(j, 1);
-								hasFilter2 = true;
-								break;
-							}
+				}
+				// 过滤新风机
+				if (filterDhDewPoint && !hasFilter1) {
+					const newTrendCtrl = box.newTrendCtrl || [];
+					for (let j = 0; j < newTrendCtrl.length; j++) {
+						const dh = newTrendCtrl[j];
+						if (dh.nt_dew_point < dhDewPointMin || dh.nt_dew_point > dhDewPointMax) {
+							newBoxList.splice(i, 1);
+							hasFilter2 = true;
+							break;
 						}
 					}
-					// 过滤换热站
-					if (filterHexSuTemp && !hasFilter1 && hasFilter2) {
-						const heatExchangeCtrl = box.hex || [];
-						for (let x = 0; x < heatExchangeCtrl.length; x++) {
-							const hex = heatExchangeCtrl[x];
-							if (hex.hex_su_temp < hexSuTempMin || hex.hex_su_temp > hexSuTempMax) {
-								newBoxList.splice(j, 1);
-								break;
-							}
+				}
+				// 过滤换热站
+				if (filterHexSuTemp && !hasFilter1 && hasFilter2) {
+					const heatExchangeCtrl = box.hex || [];
+					for (let j = 0; j < heatExchangeCtrl.length; j++) {
+						const hex = heatExchangeCtrl[j];
+						if (hex.hex_su_temp < hexSuTempMin || hex.hex_su_temp > hexSuTempMax) {
+							newBoxList.splice(i, 1);
+							break;
 						}
 					}
 				}
-				if (newBoxList.length > 0) {
-					element.boxList = newBoxList;
-					newDataSource.push(element);
-				}
 			}
-			this.total = newDataSource.length;
-			this.dataSource = newDataSource;
-		},
-		/** 计算主机供水温度属性值是否在范围内 */
-		hpSuTempIsInRange(ele) {
-			const hpSuTempMin = this.extraParams.hpSuTempMin;
-			const hpSuTempMax = this.extraParams.hpSuTempMax;
-			return ele.host_su_temp >= hpSuTempMin && ele.host_su_temp <= hpSuTempMax;
+			this.total = newBoxList.length;
+			this.dataSource = newBoxList;
 		},
-		/** 计算新风送风露点属性值是否在范围内 */
-		dhDewPointIsInRange(ele) {
-			const dhDewPointMin = this.extraParams.dhDewPointMin;
-			const dhDewPointMax = this.extraParams.dhDewPointMax;
-			return ele.nt_dew_point >= dhDewPointMin && ele.nt_dew_point <= dhDewPointMax;
+		/** 数据排序 */
+		sortDataSource(data, sort) {
+			if (!sort || sort.prop.length) {
+				return data;
+			}
+			// 主机
+			if (sort.prop.indexOf('host_')) {
+				
+			}
+			// 新风机
+			else if (sort.prop.indexOf('nt_')) {
+
+			}
+			// 换热站
+			else if (sort.prop.indexOf('hex_')) {
+
+			}
+			// 末端
+			else if (sort.prop.indexOf('end_')) {
+
+			}
 		},
-		/** 计算换热站供水温度属性值是否在范围内 */
-		hexSuTempIsInRange(ele) {
-			const hexSuTempMin = this.extraParams.hexSuTempMin;
-			const hexSuTempMax = this.extraParams.hexSuTempMax;
-			return ele.hex_su_temp >= hexSuTempMin && ele.hex_su_temp <= hexSuTempMax;
+		/** 根据主机展开所有的盒子与主机的对应数据 */
+		sortByHostData(data, sort) {
+			var hostData = [];
+			for (let i = 0; i < data.length; i++) {
+				const box = data[i];
+				const hostCtrl = box.hostCtrl || [];
+				for (let j = 0; j < hostCtrl.length; j++) {
+					const hp = hostCtrl[j];
+					let data = { box_id: box.box_id, host_order: hp.host_order };
+					data[sort.prop] = hp[sort.prop];
+					hostData.push(data);
+				}
+			}
+			// 排序
+			hostData.sort(function(obj1, obj2) {
+				let val1 = obj1[sort.prop];
+				let val2 = obj2[sort.prop];
+				if (val1 < val2) {
+					return sort.order === 'descending' ? 1 : -1;
+				} else if (value1 > value2) {
+					return sort.order === 'descending' ? -1 : 1;
+				} else {
+					return 0;
+				}
+			});
+
+			return hostData;
 		},
 		/** 生成tableData */
-		genTableData() {
+		genTableData(reset = false) {
+			// 展开所有项目下的设备及单机
+			if (reset || !this.tableData.length) {
+				this.tableData = expandAllNodes(this.dataSource);
+				let dataSolve = mergeTableRows(this.tableData, this.mergeColums);
+				this.tableData = dataSolve;
+				console.log('>>> tableData: ', this.tableData);
+			}
 			this.pageData = [];
 			const start = (this.queryParams.page_index - 1) * this.queryParams.page_size;
-			const end = Math.min(this.queryParams.page_index * this.queryParams.page_size, this.dataSource.length);
+			const end = Math.min(this.queryParams.page_index * this.queryParams.page_size, this.tableData.length);
 			for (let index = start; index < end; index++) {
-				const element = this.dataSource[index];
+				const element = this.tableData[index];
 				this.pageData.push(element);
 			}
-			// 展开所有项目下的设备及单机
-			this.tableData = expandAllNodes(this.pageData);
-			let dataSolve = mergeTableRows(this.tableData, this.mergeColums);
-			this.tableData = dataSolve;
-			console.log('>>> tableData: ', this.tableData);
 		},
 		/** 数据行合并 */
 		objectSpanMethod({ row, column, rowIndex, columnIndex }) {
 			if (columnIndex == 0 || columnIndex == 1) {
-				if (row['projectName-span']) return row['projectName-span'];
+				if (row['boxName-span']) return row['boxName-span'];
 			}
 			// 主机合并
 			if (columnIndex >= 6 && columnIndex <= 11) {
@@ -882,7 +909,7 @@ export default {
 		/** 搜索 */
 		handleQuery() {
 			this.queryParams.page_index = 1;
-			this.getProjects();
+			this.getBoxList();
 		},
 		/** 导出 */
 		handleDerive() {
@@ -914,7 +941,7 @@ export default {
 			if (this.dataSource.length) {
 				this.genTableData();
 			} else {
-				this.getProjects();
+				this.getBoxList();
 			}
 		},
 		handleCurrentChange(val) {
@@ -922,7 +949,7 @@ export default {
 			if (this.dataSource.length) {
 				this.genTableData();
 			} else {
-				this.getProjects();
+				this.getBoxList();
 			}
 		},
 		handleClickMore(row, category) {