|
@@ -2,6 +2,126 @@ import { reactive, markRaw, defineAsyncComponent } from 'vue';
|
|
|
import { getAssetURL } from '/@/utils/ui';
|
|
|
import { useGlobSetting } from '/@/hooks/setting';
|
|
|
|
|
|
+
|
|
|
+export const getMaxY = function (param) {
|
|
|
+ console.log(param,'999999')
|
|
|
+ let maxval=0
|
|
|
+ if (param.length == 1) {
|
|
|
+ maxval = Math.max(...param[0]);
|
|
|
+ } else if (param.length == 2) {
|
|
|
+ const max1 = Math.max(...param[0]);
|
|
|
+ const max2 = Math.max(...param[1]);
|
|
|
+ maxval = Math.max(max1,max2)
|
|
|
+ } else if (param.length == 3) {
|
|
|
+ const max1 = Math.max(...param[0]);
|
|
|
+ const max2 = Math.max(...param[1]);
|
|
|
+ const max3 = Math.max(...param[2]);
|
|
|
+ maxval=Math.max(max1,max2,max3)
|
|
|
+ }
|
|
|
+ const digitCount = maxval.toFixed(0).length;
|
|
|
+ console.log(digitCount,'digitCount')
|
|
|
+ let yMax = 0;
|
|
|
+ if (digitCount < 2) {
|
|
|
+ if (yMax < 0.5) {
|
|
|
+ yMax = 1;
|
|
|
+ } else if (yMax < 0.9) {
|
|
|
+ yMax = 1.5;
|
|
|
+ } else if (yMax < 5) {
|
|
|
+ yMax = 10;
|
|
|
+ } else {
|
|
|
+ yMax = 15;
|
|
|
+ }
|
|
|
+ } else if (digitCount < 3) {
|
|
|
+ const n = Number((Number(yMax.toFixed(0)) / 10).toFixed(0));
|
|
|
+ if (yMax < n * 10 + 5) {
|
|
|
+ yMax = (n + 1) * 10;
|
|
|
+ } else {
|
|
|
+ yMax = (n + 2) * 10;
|
|
|
+ }
|
|
|
+ } else if (digitCount < 4) {
|
|
|
+ const n = Number((Number(yMax.toFixed(0)) / 100).toFixed(0));
|
|
|
+ if (yMax < n * 100 + 50) {
|
|
|
+ yMax = (n + 1) * 100;
|
|
|
+ } else {
|
|
|
+ yMax = (n + 2) * 100;
|
|
|
+ }
|
|
|
+ } else if (digitCount < 5) {
|
|
|
+ const n = Number((Number(yMax.toFixed(0)) / 1000).toFixed(0));
|
|
|
+ if (yMax < n * 1000 + 500) {
|
|
|
+ yMax = (n + 1) * 1000;
|
|
|
+ } else {
|
|
|
+ yMax = (n + 1) * 1000 + 500;
|
|
|
+ }
|
|
|
+ } else if (digitCount < 6) {
|
|
|
+ const n = Number((Number(yMax.toFixed(0)) / 10000).toFixed(0));
|
|
|
+ if (yMax < n * 10000 + 5000) {
|
|
|
+ yMax = (n + 1) * 10000;
|
|
|
+ } else {
|
|
|
+ yMax = (n + 1) * 10000 + 5000;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return yMax
|
|
|
+}
|
|
|
+
|
|
|
+export const getMinY = function (param) {
|
|
|
+ let minval=0
|
|
|
+ if (param.length == 1) {
|
|
|
+ minval = Math.min(...param[0]);
|
|
|
+ } else if (param.length == 2) {
|
|
|
+ const min1 = Math.min(...param[0]);
|
|
|
+ const min2 = Math.min(...param[1]);
|
|
|
+ minval=Math.min(min1,min2)
|
|
|
+ } else if (param.length == 3) {
|
|
|
+ const min1 = Math.min(...param[0]);
|
|
|
+ const min2 = Math.min(...param[1]);
|
|
|
+ const min3 = Math.min(...param[2]);
|
|
|
+ minval=Math.min(min1,min2,min3)
|
|
|
+ }
|
|
|
+ const minDigitCount = minval.toFixed(0).length;
|
|
|
+ let yMin = 0;
|
|
|
+ if (minDigitCount < 2) {
|
|
|
+ if (yMin> 0.5) {
|
|
|
+ yMin = 0.5;
|
|
|
+ } else if (yMin > 1.5) {
|
|
|
+ yMin = 1.0;
|
|
|
+ } else if (yMin > 10) {
|
|
|
+ yMin = 5;
|
|
|
+ } else {
|
|
|
+ yMin = 15;
|
|
|
+ }
|
|
|
+ } else if (minDigitCount < 3) {
|
|
|
+ const n = Number((Number(yMin.toFixed(0)) / 10).toFixed(0));
|
|
|
+ if (n > 1) {
|
|
|
+ yMin = (n - 1) * 10;
|
|
|
+ } else {
|
|
|
+ yMin = 10;
|
|
|
+ }
|
|
|
+ } else if (minDigitCount < 4) {
|
|
|
+ const n = Number((Number(yMin.toFixed(0)) / 100).toFixed(0));
|
|
|
+ if (n > 1) {
|
|
|
+ yMin = (n - 1) * 100;
|
|
|
+ } else {
|
|
|
+ yMin = 100;
|
|
|
+ }
|
|
|
+ } else if (minDigitCount < 5) {
|
|
|
+ const n = Number((Number(yMin.toFixed(0)) / 1000).toFixed(0));
|
|
|
+ if (n > 1) {
|
|
|
+ yMin = (n - 1) * 1000;
|
|
|
+ } else {
|
|
|
+ yMin = 1000;
|
|
|
+ }
|
|
|
+ } else if (minDigitCount < 6) {
|
|
|
+ const n = Number((Number(yMin.toFixed(0)) / 10000).toFixed(0));
|
|
|
+ if (n > 1) {
|
|
|
+ yMin = (n - 1) * 10000;
|
|
|
+ } else {
|
|
|
+ yMin = 10000;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return yMin
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
//中间区域数据-通风
|
|
|
export const centerAreaListT1 = [
|
|
|
{ id: 0, label: '进风量(m³/min)' },
|