banding.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. import React, { Component } from "react";
  2. import Router from "next/router";
  3. import ContentWrapper from "@/components/Layout/ContentWrapper";
  4. import { Row, Col, Progress } from "reactstrap";
  5. import { getPelaporan } from "../../actions/pelaporan";
  6. import Sparkline from "@/components/Common/Sparklines";
  7. import Datatable from "@/components/Tables/Datatable";
  8. import moment from "moment";
  9. class Pelaporan extends Component {
  10. constructor(props) {
  11. super(props);
  12. }
  13. static getInitialProps = async () => {
  14. const pelaporan = await getPelaporan();
  15. return { pelaporan };
  16. };
  17. newReportClick = (e) => {
  18. e.preventDefault();
  19. Router.push({
  20. pathname: "/app/pelaporan/search",
  21. });
  22. };
  23. detailLaporanClick = (e, ptId, number) => {
  24. e.preventDefault();
  25. Router.push({
  26. pathname: "/app/pelaporan/detail",
  27. query: { ptId, number },
  28. });
  29. };
  30. render() {
  31. const { pelaporan } = this.props;
  32. return (
  33. <ContentWrapper>
  34. <div className="content-heading">Banding</div>
  35. <Row>
  36. <Col lg="4">
  37. <div className="card b">
  38. <div className="card-body bb">
  39. <p>Overvall progress</p>
  40. <div className="d-flex align-items-center mb-2">
  41. <div className="w-100">
  42. <Progress className="progress-xs m0" color="info" value={20} />
  43. </div>
  44. <div className="ml-auto">
  45. <div className="col wd-xxs text-right">
  46. <div className="text-bold text-muted">20%</div>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. <div className="card-body">
  52. <p>Metrics</p>
  53. <div className="row text-center">
  54. <div className="col-6 col-lg-6 col-xl-6">
  55. <Sparkline
  56. values={[20, 80]}
  57. options={{
  58. type: "pie",
  59. height: "50",
  60. sliceColors: ["#edf1f2", "#23b7e5"],
  61. }}
  62. className="sparkline"
  63. />
  64. <p className="mt-3">Open Case</p>
  65. </div>
  66. <div className="col-6 col-lg-6 col-xl-6">
  67. <Sparkline
  68. values={[80, 20]}
  69. options={{
  70. type: "pie",
  71. height: "50",
  72. sliceColors: ["#edf1f2", "#27c24c"],
  73. }}
  74. className="sparkline"
  75. />
  76. <p className="mt-3">Close Case</p>
  77. </div>
  78. </div>
  79. </div>
  80. <table className="table bb">
  81. <tbody>
  82. <tr>
  83. <td>
  84. <strong>Open Case</strong>
  85. </td>
  86. <td>80</td>
  87. </tr>
  88. <tr>
  89. <td>
  90. <strong>Close Case</strong>
  91. </td>
  92. <td>20</td>
  93. </tr>
  94. <tr>
  95. <td>
  96. <strong>Performance</strong>
  97. </td>
  98. <td>
  99. <em className="far fa-smile fa-lg text-warning"></em>
  100. </td>
  101. </tr>
  102. <tr>
  103. <td>
  104. <strong>Last Case Closed</strong>
  105. </td>
  106. <td>BI:1107 - 12/01/2016</td>
  107. </tr>
  108. </tbody>
  109. </table>
  110. </div>
  111. </Col>
  112. <Col lg="8">
  113. <div className="card b">
  114. <div className="card-body">
  115. <Datatable options={{ responsive: true }}>
  116. <table className="table w-100">
  117. <thead>
  118. <tr>
  119. <th>#ID</th>
  120. <th>Description</th>
  121. <th>Created</th>
  122. <th>Status</th>
  123. <th></th>
  124. </tr>
  125. </thead>
  126. <tbody>
  127. {pelaporan.data.map((value) => {
  128. return (
  129. <tr key={value._id}>
  130. <td>BI:{value._number}</td>
  131. <td className="text-nowrap">
  132. <div className="media align-items-center">
  133. <img className="img-fluid rounded thumb64" src="/static/img/dummy-search.png" alt="Dummy" />
  134. <div className="media-body d-flex">
  135. <div>
  136. <h4 className="m-0">Universitas Satyagama</h4>
  137. <small className="text-muted">0742/O/1990 - www.satyagama.ac.id - info@satyagama.ac.id</small>
  138. <p>{value.description}</p>
  139. </div>
  140. </div>
  141. </div>
  142. </td>
  143. <td>{moment(value.createdAt).fromNow()}</td>
  144. <td>
  145. <div className="inline wd-xxs badge badge-success">open</div>
  146. </td>
  147. <td>
  148. <button onClick={(e) => this.detailLaporanClick(e, value.pt_id, value.number)}>Detail</button>
  149. </td>
  150. </tr>
  151. );
  152. })}
  153. </tbody>
  154. </table>
  155. </Datatable>
  156. </div>
  157. </div>
  158. </Col>
  159. </Row>
  160. </ContentWrapper>
  161. );
  162. }
  163. }
  164. export default Pelaporan;