|
@@ -1,5 +1,20 @@
|
|
|
/** 根据盒子属性进行排序(比较最大值) */
|
|
|
-export function sortBoxList(data, sort) {
|
|
|
+export function sortBoxListById(data) {
|
|
|
+ return data.sort(function(obj1, obj2) {
|
|
|
+ let val1 = obj1.box_create_time;
|
|
|
+ let val2 = obj2.box_create_time;
|
|
|
+ if (val1 < val2) {
|
|
|
+ return -1;
|
|
|
+ } else if (val1 > val2) {
|
|
|
+ return 1;
|
|
|
+ } else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/** 根据盒子属性进行排序(比较最大值) */
|
|
|
+export function sortBoxListBySystem(data, sort) {
|
|
|
return data.sort(function(obj1, obj2) {
|
|
|
let val1 = -99;
|
|
|
let val2 = -99;
|
|
@@ -23,8 +38,12 @@ export function sortBoxList(data, sort) {
|
|
|
/** 根据主机属性进行排序(比较最大值) */
|
|
|
export function sortBoxListByHost(data, sort) {
|
|
|
let comparedProp = sort.prop;
|
|
|
- if (sort.prop == "host_su_temp" || sort.prop == "host_re_temp" || sort.prop == "host_temp_diff") {
|
|
|
- comparedProp = 'colorval_' + sort.prop;
|
|
|
+ if (
|
|
|
+ sort.prop == "host_su_temp" ||
|
|
|
+ sort.prop == "host_re_temp" ||
|
|
|
+ sort.prop == "host_temp_diff"
|
|
|
+ ) {
|
|
|
+ comparedProp = "colorval_" + sort.prop;
|
|
|
} else {
|
|
|
comparedProp = sort.prop;
|
|
|
}
|
|
@@ -52,7 +71,11 @@ export function sortBoxListByHost(data, sort) {
|
|
|
/** 根据新风机属性进行排序(比较最大值) */
|
|
|
export function sortBoxListByNewTrend(data, sort) {
|
|
|
let comparedProp = sort.prop;
|
|
|
- if (sort.prop == "nt_in_temp" || sort.prop == "nt_in_humidity" || sort.prop == "nt_dew_point") {
|
|
|
+ if (
|
|
|
+ sort.prop == "nt_in_temp" ||
|
|
|
+ sort.prop == "nt_in_humidity" ||
|
|
|
+ sort.prop == "nt_dew_point"
|
|
|
+ ) {
|
|
|
comparedProp = "colorval_" + sort.prop;
|
|
|
} else {
|
|
|
comparedProp = sort.prop;
|
|
@@ -82,7 +105,11 @@ export function sortBoxListByNewTrend(data, sort) {
|
|
|
/** 根据换热站属性进行排序(比较最大值) */
|
|
|
export function sortBoxListByHeatExchange(data, sort) {
|
|
|
let comparedProp = sort.prop;
|
|
|
- if (sort.prop == "hex_su_temp" || sort.prop == "hex_re_temp" || sort.prop == "hex_temp_diff") {
|
|
|
+ if (
|
|
|
+ sort.prop == "hex_su_temp" ||
|
|
|
+ sort.prop == "hex_re_temp" ||
|
|
|
+ sort.prop == "hex_temp_diff"
|
|
|
+ ) {
|
|
|
comparedProp = "colorval_" + sort.prop;
|
|
|
}
|
|
|
// 先计算最大值
|
|
@@ -97,7 +124,11 @@ export function sortBoxListByHeatExchange(data, sort) {
|
|
|
maxVal = hex[comparedProp];
|
|
|
}
|
|
|
} else {
|
|
|
- if (hex[comparedProp] > maxVal && box.runStatus == 1 && hex[sort.prop]) {
|
|
|
+ if (
|
|
|
+ hex[comparedProp] > maxVal &&
|
|
|
+ box.runStatus == 1 &&
|
|
|
+ hex[sort.prop]
|
|
|
+ ) {
|
|
|
maxVal = hex[comparedProp];
|
|
|
}
|
|
|
}
|
|
@@ -127,8 +158,7 @@ export function sortBoxListByEnd(data, sort) {
|
|
|
} else {
|
|
|
box.max_end_exception_num = -1;
|
|
|
}
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
let maxVal = -99;
|
|
|
for (let j = 0; j < endCtrl.length; j++) {
|
|
|
const end = endCtrl[j];
|
|
@@ -137,7 +167,11 @@ export function sortBoxListByEnd(data, sort) {
|
|
|
maxVal = end[comparedProp];
|
|
|
}
|
|
|
} else {
|
|
|
- if (end[comparedProp] > maxVal && box.runStatus == 1 && end[sort.prop]) {
|
|
|
+ if (
|
|
|
+ end[comparedProp] > maxVal &&
|
|
|
+ box.runStatus == 1 &&
|
|
|
+ end[sort.prop]
|
|
|
+ ) {
|
|
|
maxVal = end[comparedProp];
|
|
|
}
|
|
|
}
|