xujunjie 1 год назад
Родитель
Сommit
42543ad282

+ 14 - 9
src/components/ManagementPage/chartModule.js

@@ -90,15 +90,20 @@ const ChartModule = (props) => {
             Math.abs(
               dayjs(xData[xData?.length - 1]).diff(dayjs(xData[0]), 'days'),
             ) + 1;
-          option.xAxis.data = xData.map((item) => {
-            if (timeFormat > 150 || chartType === 'bar') {
-              return dayjs(item).format('YYYY-MM');
-            }
-            if (timeFormat >= 7) {
-              return dayjs(item).format('YYYY-MM-DD');
-            }
-            return dayjs(item).format('HH:mm');
-          });
+          if (timeFormat > 150 || chartType === 'bar') {
+            option.xAxis.data = xData.map((item) =>
+              dayjs(item).format('YYYY-MM'),
+            );
+          } else if (timeFormat >= 7) {
+            option.xAxis.data = xData.map((item) =>
+              dayjs(item).format('YYYY-MM-DD'),
+            );
+          } else {
+            option.xAxis.data = xData.map((item) =>
+              dayjs(item).format('YYYY-MM-DD HH:mm'),
+            );
+            option.xAxis.axisLabel.formatter = (value) => value?.split(' ')[1];
+          }
         } else {
           option.xAxis.data = xData || [];
         }

+ 9 - 9
src/pages/EqSelfInspection/components/Table/WaterInCom.js

@@ -112,12 +112,12 @@ function WaterInTable(props) {
     {
       title: '差值',
       // width: '15%',
-      dataIndex: 'current_val',
+      dataIndex: 'result_val',
     },
     {
       title: '时间',
       // width: '15%',
-      dataIndex: 'create_time',
+      dataIndex: 'created_time',
       render: (text) => {
         if (text) {
           return dayjs(text).format('HH:mm:ss');
@@ -130,11 +130,14 @@ function WaterInTable(props) {
       width: '30%',
       render: (record) => (
         <ThresholdDetail
-          current={record.current_val || 0}
+          current={record.result_val || 0}
           data={{
             JsonNumThreshold: {
               exception: [
-                { ThresholdValue: record?.thresholds, ThresholdType: 1 },
+                {
+                  ThresholdValue: record?.threshold_error,
+                  ThresholdType: record.result_val > 0 ? 1 : 2,
+                },
               ],
             },
             Type: 2,
@@ -146,7 +149,7 @@ function WaterInTable(props) {
       title: '状态',
       dataIndex: 'status',
       width: 140,
-      render: (status) => {
+      render: (status, record) => {
         switch (status) {
           case -1:
           case 0:
@@ -167,10 +170,7 @@ function WaterInTable(props) {
                   style={{ background: '#FF8600' }}
                 />
                 异常
-                <a style={{ marginLeft: 20 }}>
-                  关联任务
-                  <MandateBtn relationId={record.id} />
-                </a>
+                <MandateBtn relationId={record.id} />
               </div>
             );
           case 2:

+ 3 - 6
src/pages/Home/EnergyCostDetail.js

@@ -58,7 +58,7 @@ export const EnergyDetail = () => {
         {
           project_id: Number(projectId),
           start_time: dayjs().startOf('day').format('YYYY-MM-DD 00:00:00'),
-          end_time: dayjs().format('YYYY-MM-DD 23:59:59'),
+          end_time: dayjs().format('YYYY-MM-DD HH:mm:ss'),
         },
       ],
       pollingInterval: TIMER,
@@ -87,11 +87,8 @@ export const EnergyDetail = () => {
       queryChartList({
         project_id: Number(projectId),
         metric_code: 'plant_electricity',
-        start_time: dayjs()
-          .subtract(2, 'day')
-          .startOf('day')
-          .format('YYYY-MM-DD 00:00:00'),
-        end_time: dayjs().subtract(1, 'day').format('YYYY-MM-DD 23:59:59'),
+        start_time: dayjs().startOf('day').format('YYYY-MM-DD 00:00:00'),
+        end_time: dayjs().format('YYYY-MM-DD HH:mm:ss'),
       }),
     {
       pollingInterval: TIMER,

+ 6 - 6
src/pages/SmartOps/predictionAnalysis/PredictionDetail.js

@@ -387,14 +387,14 @@ function getOption(data = [], active) {
         type: 'shadow',
       },
       textStyle: {
-        fontSize: 12,
+        fontSize: 16,
       },
       formatter,
     },
     legend: {
       textStyle: {
         // color: '#fff',
-        fontSize: 14,
+        fontSize: 16,
       },
       type: 'scroll',
     },
@@ -409,10 +409,10 @@ function getOption(data = [], active) {
       type: 'category',
       data: xAxis,
       nameTextStyle: {
-        fontSize: 12,
+        fontSize: 16,
       },
       axisLabel: {
-        fontSize: 12,
+        fontSize: 16,
       },
     },
     yAxis: {
@@ -420,10 +420,10 @@ function getOption(data = [], active) {
       type: 'value',
       boundaryGap: [0, 0.01],
       nameTextStyle: {
-        fontSize: 14,
+        fontSize: 16,
       },
       axisLabel: {
-        fontSize: 12,
+        fontSize: 16,
       },
       splitNumber: 5,
     },