-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
159 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import { Breadcrumbs } from "@/common/breadcrumb"; | ||
import LoaderCenter from "@/components/shared/Loader/LoaderCenter"; | ||
import { getDecimalPlace } from "@/helpers/number"; | ||
import { IInputValue } from "@/interfaces/entities/InputValues"; | ||
import MainLayout from "@/layouts/MainLayout"; | ||
import { useResultPredictByresultId } from "@/services/query/Result"; | ||
import { Card, Col, Row, Table } from "antd"; | ||
import { ColumnsType } from "antd/es/table"; | ||
import React from "react"; | ||
import { useParams } from "react-router-dom"; | ||
|
||
const DetailResultPredict: React.FC = () => { | ||
const { id } = useParams(); | ||
const query = useResultPredictByresultId(id); | ||
const columnsResultPredict: ColumnsType = [ | ||
{ | ||
title: "Variable Output", | ||
dataIndex: "variableOutputName", | ||
}, | ||
{ | ||
title: "Value", | ||
dataIndex: "value", | ||
render: (value) => getDecimalPlace(value, 3), | ||
}, | ||
]; | ||
|
||
const columnsVariableInput: ColumnsType<IInputValue> = [ | ||
{ | ||
title: "Variable Input", | ||
render: (_, record) => record?.variableInput?.name, | ||
}, | ||
{ | ||
title: "Value", | ||
render: (_, record) => record?.value, | ||
}, | ||
]; | ||
|
||
const mainContent = ( | ||
<Row gutter={20} justify="center"> | ||
<Col> | ||
<Table | ||
pagination={false} | ||
bordered | ||
size="small" | ||
dataSource={query?.data?.data?.result?.inputValues} | ||
columns={columnsVariableInput} | ||
/> | ||
</Col> | ||
<Col> | ||
<Table | ||
pagination={false} | ||
bordered | ||
size="small" | ||
dataSource={query?.data?.data?.predict} | ||
columns={columnsResultPredict} | ||
/> | ||
</Col> | ||
</Row> | ||
); | ||
|
||
return ( | ||
<MainLayout | ||
title="Detail Predict" | ||
breadcrumbs={Breadcrumbs.Result.Detail(id)} | ||
> | ||
<Card> | ||
{query?.isLoading || query?.isFetching ? ( | ||
<LoaderCenter /> | ||
) : ( | ||
mainContent | ||
)} | ||
</Card> | ||
</MainLayout> | ||
); | ||
}; | ||
|
||
export default DetailResultPredict; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters