detail.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. import React, { Component } from "react";
  2. import Router from "next/router";
  3. import Link from "next/link";
  4. import Select from "react-select";
  5. import Datatable from "@/components/Tables/Datatable";
  6. import Scrollable from "@/components/Common/Scrollable";
  7. import ContentWrapper from "@/components/Layout/ContentWrapper";
  8. import {
  9. Row,
  10. Col,
  11. Card,
  12. CardHeader,
  13. CardBody,
  14. CardTitle,
  15. FormGroup,
  16. FormFeedback,
  17. FormText,
  18. Label,
  19. InputGroup,
  20. InputGroupAddon,
  21. InputGroupButtonDropdown,
  22. InputGroupText,
  23. Input,
  24. Button,
  25. DropdownToggle,
  26. DropdownMenu,
  27. CustomInput,
  28. DropdownItem,
  29. } from "reactstrap";
  30. let Dropzone = null;
  31. class DropzoneWrapper extends Component {
  32. state = {
  33. isClient: false,
  34. };
  35. componentDidMount = () => {
  36. Dropzone = require("react-dropzone").default;
  37. this.setState({ isClient: true });
  38. };
  39. render() {
  40. return Dropzone ? <Dropzone {...this.props}>{this.props.children}</Dropzone> : null;
  41. }
  42. }
  43. const styleHeaderText = {
  44. color: "brown",
  45. };
  46. const selectInstanceId = 1;
  47. class UploadKeberatan extends Component {
  48. constructor(props) {
  49. super(props);
  50. this.state = {
  51. selectedOption: null,
  52. files: [],
  53. };
  54. }
  55. handleChangeSelect = (selectedOption) => {
  56. this.setState({ selectedOption });
  57. };
  58. onDrop = (files) => {
  59. this.setState({
  60. files: files.map((file) =>
  61. Object.assign(file, {
  62. preview: URL.createObjectURL(file),
  63. })
  64. ),
  65. stat: "Added " + files.length + " file(s)",
  66. });
  67. };
  68. uploadFiles = (e) => {
  69. e.preventDefault();
  70. e.stopPropagation();
  71. this.setState({
  72. stat: this.state.files.length ? "Dropzone ready to upload " + this.state.files.length + " file(s)" : "No files added.",
  73. });
  74. };
  75. clearFiles = (e) => {
  76. e.preventDefault();
  77. e.stopPropagation();
  78. this.setState({
  79. stat: this.state.files.length ? this.state.files.length + " file(s) cleared." : "No files to clear.",
  80. });
  81. this.setState({
  82. files: [],
  83. });
  84. };
  85. render() {
  86. const { files } = this.state;
  87. const thumbs = files.map((file, index) => (
  88. <Col md={3} key={index}>
  89. <img className="img-fluid mb-2" src={file.preview} alt="Item" />
  90. </Col>
  91. ));
  92. return (
  93. <ContentWrapper unwrap>
  94. <div className="bg-cover" style={{ backgroundImage: "url(/static/img/profile-bg.png)" }}>
  95. <div className="p-4 text-center" style={styleHeaderText}>
  96. <img className="img-thumbnail rounded-circle thumb128" src="/static/img/univ-avatar.png" alt="Avatar" />
  97. <h3 className="m-0">Universitas Satyagama</h3>
  98. <p>0742/O/1990</p>
  99. <p>Jalan Kamal Raya No 2-A Cengkareng</p>
  100. </div>
  101. </div>
  102. <div className="p-3">
  103. <div className="content-heading">
  104. <div>
  105. Jawaban Permohonan Keberatan
  106. {/* <small>Form pembuatan laporan baru v.0.1</small> */}
  107. </div>
  108. <div className="ml-auto">
  109. <Link href="/app/pt/keberatan">
  110. <button className="btn btn-sm btn-secondary text-sm">&lt; back</button>
  111. </Link>
  112. </div>
  113. </div>
  114. <Row>
  115. <Col xl="9">
  116. <Card className="card-default">
  117. {/* <CardHeader>
  118. <label>Informasi Dokumen</label>
  119. </CardHeader> */}
  120. <CardBody>
  121. <Row>
  122. <Col lg="6">
  123. <p className="lead bb">Detail Laporan</p>
  124. <form className="form-horizontal">
  125. <FormGroup row>
  126. <Col md="4">Nomor Laporan:</Col>
  127. <Col md="8">
  128. <strong>987654</strong>
  129. </Col>
  130. </FormGroup>
  131. <FormGroup row>
  132. <Col md="4">Nama Perguruan Tinggi:</Col>
  133. <Col md="8">
  134. <strong>Universitas Satyagama</strong>
  135. </Col>
  136. </FormGroup>
  137. <FormGroup row>
  138. <Col md="4">Jenis Pelanggaran:</Col>
  139. <Col md="8">
  140. <Scrollable height="75px" className="list-group">
  141. <ul>
  142. <li>Lorem ipsum dolor sit amet.</li>
  143. <li>Lorem, ipsum dolor.</li>
  144. <li>Lorem ipsum dolor sit.</li>
  145. </ul>
  146. </Scrollable>
  147. </Col>
  148. </FormGroup>
  149. <FormGroup row>
  150. <Col md="4">Keterangan Laporan:</Col>
  151. <Col md="8">
  152. <Scrollable height="100px" className="list-group">
  153. <p>
  154. Lorem ipsum dolor sit, amet consectetur adipisicing elit. Amet dicta placeat enim illo aspernatur adipisci neque repellendus itaque blanditiis fugit. Quam obcaecati sed
  155. perferendis facere.
  156. </p>
  157. </Scrollable>
  158. </Col>
  159. </FormGroup>
  160. <FormGroup row>
  161. <Col md="4">Dibuat Pada:</Col>
  162. <Col md="8">
  163. <strong>23 Januari 2022</strong>
  164. </Col>
  165. </FormGroup>
  166. <FormGroup row>
  167. <Col md="4">Status</Col>
  168. <Col md="8">
  169. <div className="badge badge-info">Ditindaklanjuti</div>
  170. </Col>
  171. </FormGroup>
  172. <FormGroup row>
  173. <Col md="4">File Pendukung</Col>
  174. <Col md="8">
  175. <Scrollable height="120px" className="list-group">
  176. <table className="table table-bordered bg-transparent">
  177. <tbody>
  178. <tr>
  179. <td>
  180. <em className="fa-lg far fa-file-code"></em>
  181. </td>
  182. <td>
  183. <a className="text-muted" href="">
  184. database.controller.js
  185. </a>
  186. </td>
  187. </tr>
  188. <tr>
  189. <td>
  190. <em className="fa-lg far fa-file-image"></em>
  191. </td>
  192. <td>
  193. <a className="text-muted" href="">
  194. baground-lg.png
  195. </a>
  196. </td>
  197. </tr>
  198. <tr>
  199. <td>
  200. <em className="fa-lg far fa-file-code"></em>
  201. </td>
  202. <td>
  203. <a className="text-muted" href="">
  204. picture.controller.js
  205. </a>
  206. </td>
  207. </tr>
  208. <tr>
  209. <td>
  210. <em className="fa-lg far fa-file-word"></em>
  211. </td>
  212. <td>
  213. <a className="text-muted" href="">
  214. applicat-diagrams.docx
  215. </a>
  216. </td>
  217. </tr>
  218. <tr>
  219. <td>
  220. <em className="fa-lg far fa-file-code"></em>
  221. </td>
  222. <td>
  223. <a className="text-muted" href="">
  224. database.controller.js
  225. </a>
  226. </td>
  227. </tr>
  228. <tr>
  229. <td>
  230. <em className="fa-lg far fa-file-code"></em>
  231. </td>
  232. <td>
  233. <a className="text-muted" href="">
  234. database.controller.js
  235. </a>
  236. </td>
  237. </tr>
  238. </tbody>
  239. </table>
  240. </Scrollable>
  241. </Col>
  242. </FormGroup>
  243. </form>
  244. </Col>
  245. <Col lg={6}>
  246. <p className="lead bb">Jawaban</p>
  247. <form className="form-horizontal" method="get" action="/" onSubmit={this.onSubmit}>
  248. <FormGroup>
  249. <label className="row-form-label">Status</label>
  250. <div className="row-md-10">
  251. <Select
  252. instanceId={selectInstanceId + 1}
  253. value={this.state.selectedOption}
  254. onChange={this.handleChangeSelect}
  255. options={[
  256. { value: "ditolak", label: "Ditolak", className: "State-ACT" },
  257. { value: "mengubah sanksi", label: "Mengubah Sanksi", className: "State-ACT" },
  258. { value: "mencabut sanksi", label: "Mencabut Sanksi", className: "State-ACT" },
  259. ]}
  260. required
  261. />
  262. {/* <span className="form-text">Pilih Jenis Pelanggaran</span> */}
  263. </div>
  264. </FormGroup>
  265. <FormGroup>
  266. <label className="row-form-label">Keterangan Dokumen</label>
  267. <div className="row-md-10">
  268. <Input type="textarea" value={this.state.keteranganLaporan} onChange={this.setKeteranganPelaporan} required />
  269. {/* <span className="form-text">Deskripsi pelaporan minimum karakter 50 maksimum 200 karakter</span> */}
  270. </div>
  271. </FormGroup>
  272. <FormGroup>
  273. <label className="row-form-label">Upload Dokumen Jawaban</label>
  274. <div className="row-md-10">
  275. <DropzoneWrapper className="" onDrop={this.onDrop}>
  276. {({ getRootProps, getInputProps, isDragActive }) => {
  277. return (
  278. <div {...getRootProps()} className={"dropzone card p-3 " + (isDragActive ? "dropzone-drag-active" : "")}>
  279. <input {...getInputProps()} />
  280. <div className="dropzone-previews flex">
  281. {this.state.files.length > 0 ? <Row>{thumbs}</Row> : <div className="text-center dz-default dz-message">Drop files here to upload</div>}
  282. </div>
  283. <div className="d-flex align-items-center">
  284. <small className="ml-auto">
  285. <button type="button" className="btn btn-link" onClick={this.clearFiles}>
  286. Clear files
  287. </button>
  288. </small>
  289. </div>
  290. </div>
  291. );
  292. }}
  293. </DropzoneWrapper>
  294. </div>
  295. </FormGroup>
  296. <FormGroup>
  297. <div className="row-xl-10">
  298. <button className="btn btn-sm btn-primary" type="submit">
  299. Simpan
  300. </button>
  301. </div>
  302. </FormGroup>
  303. </form>
  304. </Col>
  305. </Row>
  306. </CardBody>
  307. </Card>
  308. {/* END card */}
  309. </Col>
  310. <Col xl="3">
  311. <div className="card card-default">
  312. <div className="card-body">
  313. <div className="text-center">
  314. <h3 className="mt-0">Universitas Satyagama</h3>
  315. <p>0742/O/1990</p>
  316. </div>
  317. <hr />
  318. <ul className="list-unstyled px-4">
  319. <li>
  320. <em className="fa fa-globe fa-fw mr-3"></em>www.satyagama.ac.id
  321. </li>
  322. <li>
  323. <em className="fa fa-graduation-cap fa-fw mr-3"></em>Status Pelanggaran : Tidak Ada
  324. </li>
  325. </ul>
  326. </div>
  327. </div>
  328. </Col>
  329. </Row>
  330. <Row>
  331. <Col>
  332. <Card className="card-default">
  333. <CardHeader>
  334. <CardTitle>Riwayat</CardTitle>
  335. {/* <div className="text-sm">DataTables has most features enabled by default, so all you need to do to use it with your own tables is to call the construction function: $().DataTable();.</div> */}
  336. </CardHeader>
  337. <CardBody>
  338. <Datatable options={{ responsive: true }}>
  339. <table className="table table-striped my-4 w-100">
  340. <thead>
  341. <tr>
  342. <th>Tanggal</th>
  343. <th>Status</th>
  344. <th>Keterangan Dokumen</th>
  345. <th>Dokumen Jawaban</th>
  346. </tr>
  347. </thead>
  348. <tbody>
  349. <tr>
  350. <td>23/01/2022</td>
  351. <td>Ditolak</td>
  352. <td>Lorem ipsum dolor sit amet consectetur adipisicing elit. Quos, maxime.</td>
  353. <td>
  354. <em className="fa-lg far fa-file-code"></em>
  355. <a className="text-muted" href="">
  356. database.controller.js
  357. </a>
  358. </td>
  359. </tr>
  360. <tr>
  361. <td>23/01/2022</td>
  362. <td>Ditolak</td>
  363. <td>Lorem ipsum dolor sit amet consectetur adipisicing.</td>
  364. <td>
  365. <em className="fa-lg far fa-file-code"></em>
  366. <a className="text-muted" href="">
  367. database.controller.js
  368. </a>
  369. </td>
  370. </tr>
  371. <tr>
  372. <td>23/01/2022</td>
  373. <td>Ditolak</td>
  374. <td>Lorem ipsum dolor sit.</td>
  375. <td>
  376. <em className="fa-lg far fa-file-code"></em>
  377. <a className="text-muted" href="">
  378. database.controller.js
  379. </a>
  380. </td>
  381. </tr>
  382. </tbody>
  383. </table>
  384. </Datatable>
  385. </CardBody>
  386. </Card>
  387. </Col>
  388. </Row>
  389. </div>
  390. </ContentWrapper>
  391. );
  392. }
  393. }
  394. export default UploadKeberatan;