index.js 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. import React, { Component } from "react";
  2. import ContentWrapper from "@/components/Layout/ContentWrapper";
  3. import Link from "next/link";
  4. import { Row, Col, Button, Card, CardBody, Table } from "reactstrap";
  5. import { connect } from "react-redux";
  6. import Loader from "@/components/Common/Loader";
  7. import Router from "next/router";
  8. import TableRiwayat from "@/components/Riwayat/TableRiwayat";
  9. import ChartData from "@/components/Riwayat/ChartData";
  10. import ChartDataBar from "@/components/Riwayat/ChartDataBar";
  11. import Maps from "@/components/Riwayat/Maps"
  12. import TableRiwayatt from "../../../components/Riwayat/TableRiwayatt";
  13. import TableRadarr from "../../../components/Riwayat/TableRadarr";
  14. import { getjumlahStatusLaporan } from "../../../actions/graph";
  15. import ChartRadarB from "../../../components/Riwayat/ChartRadarB";
  16. import ChartRadarA from "../../../components/Riwayat/ChartRadarA";
  17. class Riwayat extends Component {
  18. constructor(props) {
  19. super(props);
  20. this.state = {
  21. jumlahStatusLaporan: {}
  22. };
  23. }
  24. handleClick = (e, idPembina) => {
  25. e.preventDefault();
  26. Router.push({
  27. pathname: "/app/riwayat/detail",
  28. query: { id: idPembina },
  29. });
  30. };
  31. componentDidMount = async () => {
  32. const { token } = this.props;
  33. const jumlahStatusLaporan = await getjumlahStatusLaporan(token);
  34. this.setState({ jumlahStatusLaporan });
  35. };
  36. render() {
  37. const { jumlahStatusLaporan } = this.state;
  38. return (
  39. <ContentWrapper>
  40. <div className="content-heading">
  41. <span className="font-color-white">Riwayat</span>
  42. </div>
  43. <Row>
  44. <Col lg="6">
  45. <ChartDataBar />
  46. </Col>
  47. <Col lg="6">
  48. <Maps />
  49. </Col>
  50. <Col lg="6">
  51. <ChartRadarA />
  52. </Col>
  53. <Col lg="6">
  54. <ChartRadarB />
  55. </Col>
  56. <Col lg="12">
  57. {/* {jumlahStatusLaporan?.data ? <TableRadarr listData={jumlahStatusLaporan.data} to="/app/riwayat/detail" /> : <Loader />} */}
  58. <Card className="card-default">
  59. <CardBody>
  60. <Table bordered responsive>
  61. <thead>
  62. <tr >
  63. <th>Wilayah LLDikti\Menu</th>
  64. <th style={{
  65. backgroundColor: '#80b1ff',
  66. color: "black",
  67. }}>Penjadwalan Evaluasi</th>
  68. <th style={{
  69. backgroundColor: '#de8383',
  70. color: "black",
  71. }}>Pemeriksaan</th>
  72. <th style={{
  73. backgroundColor: '#fdda80',
  74. color: "black",
  75. }}>Sanksi</th>
  76. <th style={{
  77. backgroundColor: '#cfab80',
  78. color: "black",
  79. }}>Keberatan</th>
  80. <th style={{
  81. backgroundColor: '#ef90df',
  82. color: "black",
  83. }}>Banding</th>
  84. <th style={{
  85. backgroundColor: '#80df89',
  86. color: "black",
  87. }}>Pemantauan Perbaikan</th>
  88. <th style={{
  89. backgroundColor: '#a3d4d1',
  90. color: "black",
  91. }}>Pencabutan Sanksi</th>
  92. <th style={{
  93. backgroundColor: '#a3d4d1',
  94. color: "black",
  95. }}>Lihat laporan</th>
  96. {/* <th style={{
  97. backgroundColor: '#a3d4d1',
  98. color: "black",
  99. }}>list laporan</th> */}
  100. </tr>
  101. </thead>
  102. {jumlahStatusLaporan.data && jumlahStatusLaporan.data.map((data) => {
  103. return (
  104. <tr key={data.id}>
  105. <td>{data.pembina.name}</td>
  106. <td style={{
  107. backgroundColor: '#80b1ff',
  108. color: "black",
  109. textAlign: "center",
  110. }}>{data.jumlah_jadwal_evaluasi}</td>
  111. <td style={{
  112. backgroundColor: '#de8383',
  113. color: "black",
  114. textAlign: "center",
  115. }}>{data.jumlah_pemeriksaan}</td>
  116. <td style={{
  117. backgroundColor: '#fdda80',
  118. color: "black",
  119. textAlign: "center",
  120. }}>{data.jumlah_sanksi}</td>
  121. <td style={{
  122. backgroundColor: '#cfab80',
  123. color: "black",
  124. textAlign: "center",
  125. }}>{data.jumlah_keberatan}</td>
  126. <td style={{
  127. backgroundColor: '#ef90df',
  128. color: "black",
  129. textAlign: "center",
  130. }}>{data.jumlah_banding}</td>
  131. <td style={{
  132. backgroundColor: '#80df89',
  133. color: "black",
  134. textAlign: "center",
  135. }}>{data.jumlah_pemantauan_perbaikan}</td>
  136. <td style={{
  137. backgroundColor: '#a3d4d1',
  138. color: "black",
  139. textAlign: "center",
  140. }}>{data.jumlah_pencabutan_sanksi}
  141. </td>
  142. <td style={{
  143. backgroundColor: '#a3d4d1',
  144. color: "black",
  145. textAlign: "center",
  146. }}><div className="ml-auto">
  147. <Button className="color-3e3a8e" color size="sm" onClick={(e) => this.handleClick(e, data.pembina.id)}>
  148. <span className="font-color-white">
  149. View
  150. </span>
  151. </Button>
  152. </div>
  153. </td>
  154. </tr>)
  155. })}
  156. </Table>
  157. </CardBody>
  158. </Card>
  159. </Col>
  160. {/* <Col lg="12">
  161. {jumlahStatusLaporan?.data ? <TableRadar listData={jumlahStatusLaporan.data} /> : <Loader />}
  162. </Col> */}
  163. <ChartData />
  164. {/* <TableRiwayat /> */}
  165. <Col lg="12">
  166. <TableRiwayatt />
  167. </Col>
  168. </Row>
  169. </ContentWrapper>
  170. );
  171. }
  172. }
  173. const mapStateToProps = (state) => ({ user: state.user, token: state.token });
  174. export default connect(mapStateToProps)(Riwayat);