detail.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  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 Scrollable from "@/components/Common/Scrollable";
  6. import Datatable from "@/components/Tables/Datatable";
  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 JawabanBanding 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. Permohonan Banding
  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: "diterima", label: "Diterima", className: "State-ACT" },
  257. { value: "ditolak", label: "Ditolak", className: "State-ACT" },
  258. ]}
  259. required
  260. />
  261. {/* <span className="form-text">Pilih Jenis Pelanggaran</span> */}
  262. </div>
  263. </FormGroup>
  264. <FormGroup>
  265. <label className="row-form-label">Upload Dokumen Jawaban</label>
  266. <div className="row-md-10">
  267. <DropzoneWrapper className="" onDrop={this.onDrop}>
  268. {({ getRootProps, getInputProps, isDragActive }) => {
  269. return (
  270. <div {...getRootProps()} className={"dropzone card p-3 " + (isDragActive ? "dropzone-drag-active" : "")}>
  271. <input {...getInputProps()} />
  272. <div className="dropzone-previews flex">
  273. {this.state.files.length > 0 ? <Row>{thumbs}</Row> : <div className="text-center dz-default dz-message">Drop files here to upload</div>}
  274. </div>
  275. <div className="d-flex align-items-center">
  276. <small className="ml-auto">
  277. <button type="button" className="btn btn-link" onClick={this.clearFiles}>
  278. Clear files
  279. </button>
  280. </small>
  281. </div>
  282. </div>
  283. );
  284. }}
  285. </DropzoneWrapper>
  286. </div>
  287. </FormGroup>
  288. <FormGroup>
  289. <div className="row-xl-10">
  290. <button className="btn btn-sm btn-primary" type="submit">
  291. Simpan
  292. </button>
  293. </div>
  294. </FormGroup>
  295. </form>
  296. </Col>
  297. </Row>
  298. </CardBody>
  299. </Card>
  300. {/* END card */}
  301. </Col>
  302. <Col xl="3">
  303. <div className="card card-default">
  304. <div className="card-body">
  305. <div className="text-center">
  306. <h3 className="mt-0">Universitas Satyagama</h3>
  307. <p>0742/O/1990</p>
  308. </div>
  309. <hr />
  310. <ul className="list-unstyled px-4">
  311. <li>
  312. <em className="fa fa-globe fa-fw mr-3"></em>www.satyagama.ac.id
  313. </li>
  314. <li>
  315. <em className="fa fa-graduation-cap fa-fw mr-3"></em>Status Pelanggaran : Tidak Ada
  316. </li>
  317. </ul>
  318. </div>
  319. </div>
  320. </Col>
  321. </Row>
  322. <Row>
  323. <Col>
  324. <Card className="card-default">
  325. <CardHeader>
  326. <CardTitle>Riwayat</CardTitle>
  327. {/* <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> */}
  328. </CardHeader>
  329. <CardBody>
  330. <Datatable options={{ responsive: true }}>
  331. <table className="table table-striped my-4 w-100">
  332. <thead>
  333. <tr>
  334. <th>Tanggal</th>
  335. <th>Status</th>
  336. <th>Dokumen Jawaban</th>
  337. </tr>
  338. </thead>
  339. <tbody>
  340. <tr>
  341. <td>23/01/2022</td>
  342. <td>Ditolak</td>
  343. <td>
  344. <em className="fa-lg far fa-file-code"></em>
  345. <a className="text-muted" href="">
  346. database.controller.js
  347. </a>
  348. </td>
  349. </tr>
  350. <tr>
  351. <td>23/01/2022</td>
  352. <td>Ditolak</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>
  364. <em className="fa-lg far fa-file-code"></em>
  365. <a className="text-muted" href="">
  366. database.controller.js
  367. </a>
  368. </td>
  369. </tr>
  370. </tbody>
  371. </table>
  372. </Datatable>
  373. </CardBody>
  374. </Card>
  375. </Col>
  376. </Row>
  377. </div>
  378. </ContentWrapper>
  379. );
  380. }
  381. }
  382. export default JawabanBanding;