|
@@ -1,13 +1,13 @@
|
|
|
import React, { Component } from "react";
|
|
import React, { Component } from "react";
|
|
|
import ContentWrapper from "@/components/Layout/ContentWrapper";
|
|
import ContentWrapper from "@/components/Layout/ContentWrapper";
|
|
|
-import Link from "next/link";
|
|
|
|
|
import { Row, Col, Button } from "reactstrap";
|
|
import { Row, Col, Button } from "reactstrap";
|
|
|
import { getPelaporan } from "@/actions/pelaporan";
|
|
import { getPelaporan } from "@/actions/pelaporan";
|
|
|
-import { getGraph } from "@/actions/graph";
|
|
|
|
|
|
|
+import { getGraph, getExcel } from "@/actions/graph";
|
|
|
import CaseProgress from "@/components/Delegasi/CaseProgress";
|
|
import CaseProgress from "@/components/Delegasi/CaseProgress";
|
|
|
import TableLaporan from "@/components/Main/TableLaporan";
|
|
import TableLaporan from "@/components/Main/TableLaporan";
|
|
|
import { connect } from "react-redux";
|
|
import { connect } from "react-redux";
|
|
|
import Loader from "@/components/Common/Loader";
|
|
import Loader from "@/components/Common/Loader";
|
|
|
|
|
+import Router from "next/router";
|
|
|
|
|
|
|
|
class Pelaporan extends Component {
|
|
class Pelaporan extends Component {
|
|
|
constructor(props) {
|
|
constructor(props) {
|
|
@@ -41,6 +41,11 @@ class Pelaporan extends Component {
|
|
|
if (prevState.graph !== this.state.graph) return true;
|
|
if (prevState.graph !== this.state.graph) return true;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ excel = () => {
|
|
|
|
|
+ const url = getExcel(this.props.token, "Laporan Delegasi", { tahun: this.state.tahun });
|
|
|
|
|
+ Router.push(url);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
render() {
|
|
render() {
|
|
|
const { pelaporan, graph } = this.state;
|
|
const { pelaporan, graph } = this.state;
|
|
|
return (
|
|
return (
|
|
@@ -50,7 +55,7 @@ class Pelaporan extends Component {
|
|
|
<div className="ml-auto"></div>
|
|
<div className="ml-auto"></div>
|
|
|
</div>
|
|
</div>
|
|
|
<Row>
|
|
<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 listData={pelaporan.data} to="/app/laporan-delegasi/detail" linkName="Detail" /> : <Loader />}</Col>
|
|
<Col lg="8">{pelaporan?.data ? <TableLaporan listData={pelaporan.data} to="/app/laporan-delegasi/detail" linkName="Detail" /> : <Loader />}</Col>
|
|
|
</Row>
|
|
</Row>
|
|
|
</ContentWrapper>
|
|
</ContentWrapper>
|