Fixing report

This commit is contained in:
2025-10-28 11:47:15 +07:00
parent 47f7c7b682
commit fd361f21cf
4 changed files with 84 additions and 29 deletions

View File

@@ -43,7 +43,7 @@ const ListHistoryAlarm = memo(function ListHistoryAlarm(props) {
case 1:
return (
<span>
{record.lim_low + 1} : {record.lim_high - 1}
{record.lim_low} : {record.lim_high}
</span>
);
case 2:
@@ -51,13 +51,13 @@ const ListHistoryAlarm = memo(function ListHistoryAlarm(props) {
case 3:
return (
<span>
{record.lim_low_crash + 1} : {record.lim_low - 1}
{record.lim_low_crash} : {record.lim_low}
</span>
);
case 4:
return (
<span>
{record.lim_high + 1} : {record.lim_high_crash - 1}
{record.lim_high} : {record.lim_high_crash}
</span>
);
case 5:

View File

@@ -3,7 +3,10 @@ import { Button, Row, Col, Card, Input, DatePicker, Select, Typography } from 'a
import TableList from '../../../../components/Global/TableList';
import dayjs from 'dayjs';
import { FileTextOutlined } from '@ant-design/icons';
import { getAllHistoryValueReport } from '../../../../api/history-value';
import {
getAllHistoryValueReport,
getAllHistoryValueReportPivot,
} from '../../../../api/history-value';
import { getAllPlantSection } from '../../../../api/master-plant-section';
const { Text } = Typography;
@@ -29,19 +32,19 @@ const ListReport = memo(function ListReport(props) {
key: 'tag_name',
width: '70%',
},
{
title: 'Value',
dataIndex: 'val',
key: 'val',
width: '10%',
render: (_, record) => Number(record.val).toFixed(4),
},
{
title: 'Stat',
dataIndex: 'status',
key: 'status',
width: '10%',
},
// {
// title: 'Value',
// dataIndex: 'val',
// key: 'val',
// width: '10%',
// render: (_, record) => Number(record.val).toFixed(4),
// },
// {
// title: 'Stat',
// dataIndex: 'status',
// key: 'status',
// width: '10%',
// },
];
const dateNow = dayjs();
@@ -49,21 +52,21 @@ const ListReport = memo(function ListReport(props) {
const [trigerFilter, setTrigerFilter] = useState(false);
const [plantSubSection, setPlantSubSection] = useState(0);
const [plantSubSectionList, setPlantSubSectionList] = useState([]);
const [startDate, setStartDate] = useState(dateNow);
const [endDate, setEndDate] = useState(dateNow);
const [periode, setPeriode] = useState(10);
const defaultFilter = {
criteria: '',
plant_sub_section_id: 0,
from: dateNowFormated,
to: dateNowFormated,
interval: 10,
interval: periode,
};
const [formDataFilter, setFormDataFilter] = useState(defaultFilter);
const [plantSubSection, setPlantSubSection] = useState(0);
const [plantSubSectionList, setPlantSubSectionList] = useState([]);
const [startDate, setStartDate] = useState(dateNow);
const [endDate, setEndDate] = useState(dateNow);
const [periode, setPeriode] = useState(5);
const handleSearch = () => {
const formattedDateStart = startDate.format('YYYY-MM-DD');
const formattedDateEnd = endDate.format('YYYY-MM-DD');
@@ -199,9 +202,13 @@ const ListReport = memo(function ListReport(props) {
<Col xs={24} sm={24} md={24} lg={24} xl={24} style={{ marginTop: '16px' }}>
<TableList
firstLoad={false}
getData={getAllHistoryValueReport}
mobile
cardColor={'#d38943ff'}
header={'datetime'}
getData={getAllHistoryValueReportPivot}
queryParams={formDataFilter}
columns={columns}
columnDynamic={'columns'}
triger={trigerFilter}
/>
</Col>

View File

@@ -62,10 +62,10 @@ const ReportTrending = memo(function ReportTrending(props) {
: [],
}));
// setTrendingValue(cleanedData);
setTrendingValue(cleanedData);
} else {
// 🔹 Jika tidak ada data dari API
// setTrendingValue([]);
setTrendingValue([]);
}
};