|
|
@@ -2,13 +2,14 @@ import React, { Component } from "react";
|
|
|
import ContentWrapper from "@/components/Layout/ContentWrapper";
|
|
|
import { Row, Col } from "reactstrap";
|
|
|
import { getPelaporan } from "@/actions/pelaporan";
|
|
|
-import { getGraph } from "@/actions/graph";
|
|
|
+import { getGraph, getExcel } from "@/actions/graph";
|
|
|
import CaseProgress from "@/components/Pemeriksaan/CaseProgress";
|
|
|
import TableLaporan from "@/components/Pemeriksaan/TableLaporan";
|
|
|
import { connect } from "react-redux";
|
|
|
import Loader from "@/components/Common/Loader";
|
|
|
import Link from "next/link";
|
|
|
import Button from "reactstrap/lib/Button";
|
|
|
+import Router from "next/router";
|
|
|
|
|
|
class Pemeriksaan extends Component {
|
|
|
constructor(props) {
|
|
|
@@ -43,6 +44,11 @@ class Pemeriksaan extends Component {
|
|
|
if (prevState.graph !== this.state.graph) return true;
|
|
|
};
|
|
|
|
|
|
+ excel = () => {
|
|
|
+ const url = getExcel(this.props.token, "Laporan", { tahun: this.state.tahun });
|
|
|
+ Router.push(url);
|
|
|
+ };
|
|
|
+
|
|
|
render() {
|
|
|
const { pelaporan, graph } = this.state;
|
|
|
return (
|
|
|
@@ -66,7 +72,7 @@ class Pemeriksaan extends Component {
|
|
|
</div>
|
|
|
</div>
|
|
|
<Row>
|
|
|
- <Col lg="4">{graph?.data ? <CaseProgress data={graph.data} nextButton={this.nextButton} prevButton={this.prevButton} tahun={this.state.tahun} /> : <Loader />}</Col>
|
|
|
+ <Col lg="4">{graph?.data ? <CaseProgress data={graph.data} nextButton={this.nextButton} prevButton={this.prevButton} tahun={this.state.tahun} excel={this.excel} /> : <Loader />}</Col>
|
|
|
<Col lg="8">{pelaporan?.data ? <TableLaporan status noBy listData={pelaporan.data} to="/app/pemeriksaan/new" linkName="Evaluasi" /> : <Loader />}</Col>
|
|
|
</Row>
|
|
|
</ContentWrapper>
|