nidus-sync/ts/rmo/content/compliance/Evidence.vue

198 lines
5 KiB
Vue

<style scoped>
.upload-area {
border: 2px dashed #0d6efd;
border-radius: 8px;
padding: 32px 16px;
text-align: center;
background-color: #fff;
cursor: pointer;
transition: all 0.2s ease;
}
.upload-area:hover {
background-color: #f8f9fa;
border-color: #0a58ca;
}
.upload-area.dragover {
background-color: #e7f1ff;
border-color: #0a58ca;
}
#file-input {
display: none;
}
.photo-preview {
position: relative;
width: 100%;
height: 120px;
border-radius: 8px;
overflow: hidden;
background-color: #e9ecef;
border: 1px solid #dee2e6;
}
.photo-preview img {
width: 100%;
height: 100%;
object-fit: cover;
}
.photo-preview .remove-btn {
position: absolute;
top: 4px;
right: 4px;
background-color: rgba(220, 53, 69, 0.9);
color: white;
border: none;
border-radius: 50%;
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.2s ease;
}
.photo-preview .remove-btn:hover {
background-color: rgba(220, 53, 69, 1);
transform: scale(1.1);
}
.guidance-list {
list-style: none;
padding-left: 0;
}
.guidance-list li {
padding: 8px 0;
padding-left: 28px;
position: relative;
}
.guidance-list li::before {
content: "✓";
position: absolute;
left: 0;
color: #198754;
font-weight: bold;
}
</style>
<template>
<div class="container-fluid px-3 py-3">
<HeaderCompliance :district="district" />
<!-- Progress Bar -->
<ProgressBarCompliance :step="4" />
<!-- Main Content -->
<main>
<h2 class="h4 mb-3">Upload photos of the area</h2>
<p class="text-muted mb-3">
Please provide current photos to help us assess the situation.
</p>
<!-- Photo Guidance -->
<div class="card mb-4">
<div class="card-body">
<h6 class="card-subtitle mb-3 text-muted">
<i class="bi bi-lightbulb"></i> Helpful photos are:
</h6>
<ul class="guidance-list mb-0">
<li>Recent (taken within the last 24 hours)</li>
<li>Showing the specific area of concern</li>
<li>Making water conditions clearly visible</li>
</ul>
</div>
</div>
<form
id="photo-form"
method="POST"
action="/compliance/photos"
enctype="multipart/form-data"
>
<!-- Upload Area -->
<div class="mb-4">
<label class="form-label fw-semibold">Photos</label>
<div
class="upload-area"
id="upload-area"
onclick="document.getElementById('file-input').click()"
>
<i
class="bi bi-camera-fill"
style="font-size: 2.5rem; color: #0d6efd"
></i>
<p class="mb-2 mt-2 fw-semibold">Tap to take photo or upload</p>
<p class="text-muted small mb-0">You can add multiple photos</p>
</div>
<input
type="file"
id="file-input"
name="photos"
accept="image/*"
capture="environment"
multiple
/>
</div>
<!-- Photo Previews -->
<div id="photo-previews" class="mb-4">
<!-- Thumbnails will be dynamically added here -->
<div class="row g-2" id="preview-container" style="display: none">
<!-- Example preview structure (hidden by default, shown when photos added):
<div class="col-4">
<div class="photo-preview">
<img src="..." alt="Preview">
<button type="button" class="remove-btn" data-index="0">
<i class="bi bi-x-lg"></i>
</button>
</div>
</div>
-->
</div>
</div>
<!-- Additional Comments -->
<div class="mb-4">
<label for="comments" class="form-label fw-semibold">
Additional Comments
<span class="text-muted fw-normal">(Optional)</span>
</label>
<textarea
class="form-control"
id="comments"
name="comments"
rows="4"
placeholder="Provide any additional information that may be helpful..."
></textarea>
<div class="form-text">
Example: "This standing water appeared after recent rain" or "I've
already taken steps to address this issue"
</div>
</div>
<!-- Navigation Buttons -->
<div class="d-flex gap-2 mt-4">
<RouterLink to="./concern" class="btn btn-outline-secondary">
Back
</RouterLink>
<RouterLink to="permission" class="btn btn-primary flex-grow-1">
Continue
</RouterLink>
</div>
</form>
</main>
</div>
</template>
<script setup lang="ts">
import type { District } from "@/type/api";
import HeaderCompliance from "@/rmo/components/HeaderCompliance.vue";
import ProgressBarCompliance from "@/rmo/components/ProgressBarCompliance.vue";
interface Props {
district: District;
}
const props = defineProps<Props>();
</script>