|
@@ -113,7 +113,7 @@
|
|
|
:data="pageData"
|
|
|
empty-text="无数据"
|
|
|
:span-method="objectSpanMethod"
|
|
|
- @sort-change="changeSort"
|
|
|
+ @sort-change="handleSortChanged"
|
|
|
@selection-change="handleSelectionChange"
|
|
|
v-fixed-scroll="handleScroll"
|
|
|
border
|
|
@@ -124,18 +124,18 @@
|
|
|
<span>{{ (queryParams.page_index - 1) * queryParams.page_size + scope.$index + 1 }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="boxName" label="盒子名称" align="center" width="180" show-overflow-tooltip fixed sortable>
|
|
|
+ <el-table-column prop="boxName" label="盒子名称" align="center" width="180" show-overflow-tooltip fixed>
|
|
|
<template slot-scope="scope">
|
|
|
<span @click="debug(scope)">{{ scope.row.boxName }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="runStatus" label="在线状态" align="center" width="120" fixed sortable>
|
|
|
+ <el-table-column prop="runStatus" label="在线状态" align="center" width="120" fixed sortable="custom">
|
|
|
<template slot-scope="scope">
|
|
|
<span class="el-table-tag" :style="{ background: runStatMap[scope.row.runStatus].color }">{{
|
|
|
runStatMap[scope.row.runStatus].label }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="runMode" label="运行模式" align="center" width="120" fixed>
|
|
|
+ <el-table-column prop="runMode" label="运行模式" align="center" width="120" fixed sortable="custom">
|
|
|
<template slot-scope="scope">
|
|
|
<span class="el-table-tag"
|
|
|
:style="{ background: scope.row.runStatus == 2 ? '' : runModeMap[scope.row.runMode].color }">
|
|
@@ -151,7 +151,7 @@
|
|
|
<span>{{ scope.row.host_order || '/' }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="host_connect_status" label="通讯状态" align="center" width="120" sortable>
|
|
|
+ <el-table-column prop="host_connect_status" label="通讯状态" align="center" width="120" sortable="custom">
|
|
|
<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') }">
|
|
@@ -160,7 +160,7 @@
|
|
|
<span v-else>/</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="host_fault" label="故障" align="center" width="90" sortable>
|
|
|
+ <el-table-column prop="host_fault" label="故障" align="center" width="90" sortable="custom">
|
|
|
<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') }">
|
|
@@ -169,7 +169,7 @@
|
|
|
<span v-else>/</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="host_su_temp" label="供水水温(℃)" align="center" width="140" sortable>
|
|
|
+ <el-table-column prop="host_su_temp" label="供水水温(℃)" align="center" width="140" sortable="custom">
|
|
|
<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') }}
|
|
@@ -177,7 +177,7 @@
|
|
|
<span v-else>/</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="host_re_temp" label="回水水温(℃)" align="center" width="140" sortable>
|
|
|
+ <el-table-column prop="host_re_temp" label="回水水温(℃)" align="center" width="140" sortable="custom">
|
|
|
<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') }}
|
|
@@ -185,7 +185,7 @@
|
|
|
<span v-else>/</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="host_temp_diff" label="温差" align="center" width="120" sortable>
|
|
|
+ <el-table-column prop="host_temp_diff" label="温差" align="center" width="120" sortable="custom">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
<span class="el-table-tag" :style="{ background: calcArgsColor(scope) }">
|
|
@@ -206,7 +206,7 @@
|
|
|
<span>{{ scope.row.nt_order || '/' }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="nt_connect_status" label="通讯状态" align="center" width="120" sortable>
|
|
|
+ <el-table-column prop="nt_connect_status" label="通讯状态" align="center" width="120" sortable="custom">
|
|
|
<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') }">
|
|
@@ -215,7 +215,7 @@
|
|
|
<span v-else>/</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="nt_fault" label="故障" align="center" width="90" sortable>
|
|
|
+ <el-table-column prop="nt_fault" label="故障" align="center" width="90" sortable="custom">
|
|
|
<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') }">
|
|
@@ -224,7 +224,7 @@
|
|
|
<span v-else>/</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="nt_in_temp" label="送风温度(℃)" align="center" width="140" sortable>
|
|
|
+ <el-table-column prop="nt_in_temp" label="送风温度(℃)" align="center" width="140" sortable="custom">
|
|
|
<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') }}
|
|
@@ -232,7 +232,7 @@
|
|
|
<span v-else>/</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="nt_in_humidity" label="送风湿度(%)" align="center" width="140" sortable>
|
|
|
+ <el-table-column prop="nt_in_humidity" label="送风湿度(%)" align="center" width="140" sortable="custom">
|
|
|
<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') }}
|
|
@@ -240,7 +240,7 @@
|
|
|
<span v-else>/</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="nt_dew_point" label="露点(℃)" align="center" width="140" sortable>
|
|
|
+ <el-table-column prop="nt_dew_point" label="露点(℃)" align="center" width="140" sortable="custom">
|
|
|
<template slot-scope="scope">
|
|
|
<div v-if="scope.row.nt_dew_point">
|
|
|
<span class="el-table-tag" :style="{ background: calcArgsColor(scope) }">
|
|
@@ -262,7 +262,7 @@
|
|
|
<span>{{ scope.row.hex_order || '/' }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="hex_connect_status" label="通讯状态" align="center" width="120" sortable>
|
|
|
+ <el-table-column prop="hex_connect_status" label="通讯状态" align="center" width="120" sortable="custom">
|
|
|
<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') }">
|
|
@@ -271,7 +271,7 @@
|
|
|
<span v-else>/</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="hex_fault" label="故障" align="center" width="90" sortable>
|
|
|
+ <el-table-column prop="hex_fault" label="故障" align="center" width="90" sortable="custom">
|
|
|
<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') }">
|
|
@@ -280,7 +280,7 @@
|
|
|
<span v-else>/</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="hex_su_temp" label="供水水温(℃)" align="center" width="140" sortable>
|
|
|
+ <el-table-column prop="hex_su_temp" label="供水水温(℃)" align="center" width="140" sortable="custom">
|
|
|
<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') }}
|
|
@@ -288,7 +288,7 @@
|
|
|
<span v-else>/</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="hex_re_temp" label="回水水温(℃)" align="center" width="140" sortable>
|
|
|
+ <el-table-column prop="hex_re_temp" label="回水水温(℃)" align="center" width="140" sortable="custom">
|
|
|
<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') }}
|
|
@@ -296,7 +296,7 @@
|
|
|
<span v-else>/</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="hex_temp_diff" label="温差(℃)" align="center" width="120" sortable>
|
|
|
+ <el-table-column prop="hex_temp_diff" label="温差(℃)" align="center" width="120" sortable="custom">
|
|
|
<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) }">
|
|
@@ -305,7 +305,7 @@
|
|
|
<span v-else>/</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="hex_pump_status" label="水泵状态" align="center" width="120" sortable>
|
|
|
+ <el-table-column prop="hex_pump_status" label="水泵状态" align="center" width="120" sortable="custom">
|
|
|
<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) }">
|
|
@@ -323,7 +323,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="160" sortable>
|
|
|
+ <el-table-column prop="end_exception_num" label="通讯异常数量" align="center" width="160" sortable="custom">
|
|
|
<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) }">
|
|
@@ -398,7 +398,7 @@
|
|
|
<el-dialog :title="titleTxt" :visible.sync="showTitle" width="60%">
|
|
|
<div style="margin: 20px" v-html="this.Title"></div>
|
|
|
</el-dialog>
|
|
|
- <el-dialog :title="endPop.title" :visible.sync="endPop.show" width="50%">
|
|
|
+ <el-dialog :title="endPop.title" :visible.sync="endPop.show" width="30%">
|
|
|
<pop-end-info :visible="endPop.show" :data="endPop.row"></pop-end-info>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -412,6 +412,12 @@ import PopEndInfo from './PopEndInfo.vue';
|
|
|
|
|
|
import { listBox, listArgs } from '../../../js/api.js';
|
|
|
import { expandAllNodes, mergeTableRows } from '../../../js/merge.js';
|
|
|
+import {
|
|
|
+ sortBoxListByHost,
|
|
|
+ sortBoxListByNewTrend,
|
|
|
+ sortBoxListByHeatExchange,
|
|
|
+ sortBoxListByEnd
|
|
|
+} from '../../../js/sort.js';
|
|
|
import { exportToExcel } from '../../../js/export.js';
|
|
|
import define from '../../../js/common.js';
|
|
|
|
|
@@ -420,7 +426,6 @@ import ScrollBar from '../../../js/scrollbar.js';
|
|
|
import "perfect-scrollbar/css/perfect-scrollbar.css";
|
|
|
import { getAreaList, getCityList, getProvinceList } from "../../../js/api";
|
|
|
import { getReportTitle } from "@/js/api";
|
|
|
-import { deepClone } from '@/utils';
|
|
|
Vue.directive('fixed-scroll', ScrollBar);
|
|
|
|
|
|
export default {
|
|
@@ -523,7 +528,6 @@ export default {
|
|
|
queryParams: {
|
|
|
page_index: 1,
|
|
|
page_size: 20,
|
|
|
- project_name: undefined,
|
|
|
box_name: undefined,
|
|
|
online_status: undefined,
|
|
|
run_mode: undefined,
|
|
@@ -562,7 +566,6 @@ export default {
|
|
|
project_addr: "",
|
|
|
project_area: "",
|
|
|
project_manager_id: 0,
|
|
|
- project_name: "",
|
|
|
province: "",
|
|
|
room_number: "",
|
|
|
stage_id: 0,
|
|
@@ -580,7 +583,7 @@ export default {
|
|
|
argsList: [],
|
|
|
selection: [], // 选中的数据
|
|
|
nameset: [], // 选中的项目名称集合
|
|
|
- mergeColums: ['projectName', 'boxName', 'runStatus', 'runMode'],
|
|
|
+ mergeColums: ['boxName', 'runStatus', 'runMode'],
|
|
|
runStatMap: define.runStatDict,
|
|
|
runModeMap: define.runModeDict,
|
|
|
connectStatMap: define.connectStatDict,
|
|
@@ -609,14 +612,6 @@ export default {
|
|
|
this.getBoxList();
|
|
|
this.getArgsList();
|
|
|
},
|
|
|
- // async getDistrictListFunc () {
|
|
|
- // const res = await getDistrictList({
|
|
|
- // area_cn: this.operateSubjectForm.area
|
|
|
- // });
|
|
|
- // if (res.code === 200) {
|
|
|
- // this.districtOption = res.result;
|
|
|
- // }
|
|
|
- // },
|
|
|
methods: {
|
|
|
renderHeader(h, { column, $index }, type) {
|
|
|
let that = this;
|
|
@@ -650,8 +645,8 @@ export default {
|
|
|
],
|
|
|
)
|
|
|
},
|
|
|
- changeSort(val) {
|
|
|
- console.log('changeSort.val is:', val, val.prop, val.order)
|
|
|
+ handleSortChanged(val) {
|
|
|
+ // console.log('handleSortChanged:', val)
|
|
|
this.prop = val.prop
|
|
|
this.order = val.order
|
|
|
this.getBoxList(val);
|
|
@@ -685,7 +680,6 @@ export default {
|
|
|
province: this.operateSubjectForm.province
|
|
|
});
|
|
|
if (res.code === 200) {
|
|
|
- // this.cityOption = res.result;
|
|
|
let temp = [];
|
|
|
res.result.map(item => {
|
|
|
if (temp && temp.length === 0) {
|
|
@@ -734,7 +728,8 @@ export default {
|
|
|
listBox(params).then(resp => {
|
|
|
let data = resp.data || {};
|
|
|
let result = data.result || {};
|
|
|
- this.sortAndFilterDataSource(result.data || [], sort);
|
|
|
+ this.filterOriginData(result.data || []);
|
|
|
+ this.sortDataSource(sort);
|
|
|
this.genTableData(true);
|
|
|
loading.close();
|
|
|
}).catch(err => {
|
|
@@ -750,14 +745,8 @@ export default {
|
|
|
console.log('[args/list]请求错误: ', err);
|
|
|
});
|
|
|
},
|
|
|
- /** 本地数据先排序再过滤 */
|
|
|
- sortAndFilterDataSource(data, sort) {
|
|
|
- console.log("原始数据: ", data);
|
|
|
-
|
|
|
- // 先排序
|
|
|
- // this.sortDataSource(data, sort);
|
|
|
- // console.log("排序后的数据: ", data);
|
|
|
-
|
|
|
+ /** 本地数据过滤 */
|
|
|
+ filterOriginData(data) {
|
|
|
/**
|
|
|
* 使用filter()方法过滤不满足条件的数据
|
|
|
*/
|
|
@@ -765,10 +754,9 @@ export default {
|
|
|
const filterDhDewPoint = (this.extraParams.dhDewPointMax > this.extraParams.dhDewPointMin);
|
|
|
const filterHexSuTemp = (this.extraParams.hexSuTempMax > this.extraParams.hexSuTempMin);
|
|
|
let filterData = data.filter(box => {
|
|
|
- let hasFilter1 = false; // 主机供水温度是否把盒子过滤掉了
|
|
|
- let hasFilter2 = false; // 新风送风露点是否把盒子过滤掉了
|
|
|
-
|
|
|
- // 根据主机供水温度过滤盒子
|
|
|
+ let hasFilter1 = false;
|
|
|
+ let hasFilter2 = false;
|
|
|
+ // 根据 主机供水温度 过滤盒子
|
|
|
if (filterHpSuTemp) {
|
|
|
const hostCtrl = box.hostCtrl || [];
|
|
|
if (!hostCtrl.length || box.runStatus == 2) {
|
|
@@ -784,8 +772,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- // 过滤新风机
|
|
|
+ // 根据 新风送风露点 过滤盒子
|
|
|
if (filterDhDewPoint && !hasFilter1) {
|
|
|
const newTrendCtrl = box.newTrendCtrl || [];
|
|
|
if (!newTrendCtrl.length || box.runStatus == 2) {
|
|
@@ -801,8 +788,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- // 过滤换热站
|
|
|
+ // 根据 换热站供水水温度 过滤盒子
|
|
|
if (filterHexSuTemp && !hasFilter1 && hasFilter2) {
|
|
|
const heatExchangeCtrl = box.hex || [];
|
|
|
if (!heatExchangeCtrl.length || box.runStatus == 2) {
|
|
@@ -818,65 +804,39 @@ export default {
|
|
|
}
|
|
|
return true;
|
|
|
});
|
|
|
-
|
|
|
this.total = filterData.length;
|
|
|
this.dataSource = filterData;
|
|
|
},
|
|
|
- /** 数据排序 */
|
|
|
- sortDataSource(data, sort) {
|
|
|
- if (!sort || sort.prop.length) {
|
|
|
- return data;
|
|
|
+ sortDataSource(sort) {
|
|
|
+ // 先排序
|
|
|
+ if (!sort || !sort.prop.length) {
|
|
|
+ return;
|
|
|
}
|
|
|
+ console.log(">>> sort: ", sort.prop, sort.order)
|
|
|
// 主机
|
|
|
- if (sort.prop.indexOf('host_')) {
|
|
|
- return this.sortByHostData(data, sort);
|
|
|
+ if (sort.prop.indexOf('host_') >= 0) {
|
|
|
+ return sortBoxListByHost(this.dataSource, sort);
|
|
|
}
|
|
|
// 新风机
|
|
|
- else if (sort.prop.indexOf('nt_')) {
|
|
|
-
|
|
|
+ else if (sort.prop.indexOf('nt_') >= 0) {
|
|
|
+ return sortBoxListByNewTrend(this.dataSource, sort);
|
|
|
}
|
|
|
// 换热站
|
|
|
- else if (sort.prop.indexOf('hex_')) {
|
|
|
-
|
|
|
+ else if (sort.prop.indexOf('hex_') >= 0) {
|
|
|
+ return sortBoxListByHeatExchange(this.dataSource, sort);
|
|
|
}
|
|
|
// 末端
|
|
|
- else if (sort.prop.indexOf('end_')) {
|
|
|
-
|
|
|
+ else if (sort.prop.indexOf('end_') >= 0) {
|
|
|
+ return sortBoxListByEnd(this.dataSource, sort);
|
|
|
}
|
|
|
- },
|
|
|
- /** 根据主机展开所有的盒子与主机的对应数据 */
|
|
|
- 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;
|
|
|
+ console.log("排序后的数据: ", this.dataSource);
|
|
|
},
|
|
|
/** 生成tableData */
|
|
|
genTableData(reset = false) {
|
|
|
// 展开所有项目下的设备及单机
|
|
|
if (reset || !this.tableData.length) {
|
|
|
- this.tableData = expandAllNodes(this.dataSource);
|
|
|
- let dataSolve = mergeTableRows(this.tableData, this.mergeColums);
|
|
|
+ let expandNodes = expandAllNodes(this.dataSource);
|
|
|
+ let dataSolve = mergeTableRows(expandNodes, this.mergeColums);
|
|
|
this.tableData = dataSolve;
|
|
|
console.log('>>> tableData: ', this.tableData);
|
|
|
}
|