提交
This commit is contained in:
317
src/pages/keyDetection/detail.vue
Normal file
317
src/pages/keyDetection/detail.vue
Normal file
@ -0,0 +1,317 @@
|
||||
<template>
|
||||
<div class="detail-page">
|
||||
<!-- 顶部导航栏 -->
|
||||
<div class="nav-bar">
|
||||
<van-icon name="arrow-left" class="nav-back" @click="goBack" />
|
||||
<div class="nav-title">重点检测详情</div>
|
||||
<div class="nav-placeholder"></div>
|
||||
</div>
|
||||
|
||||
<!-- 检测信息卡片 -->
|
||||
<div class="detail-card">
|
||||
<div class="card-header">
|
||||
<div class="detail-type" :class="detail.typeClass">
|
||||
{{ detail.typeText }}
|
||||
</div>
|
||||
<div class="detail-status" :class="detail.statusClass">
|
||||
{{ detail.statusText }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="info-row">
|
||||
<span class="label">检测对象:</span>
|
||||
<span class="value">{{ detail.objectInfo }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="label">发布时间:</span>
|
||||
<span class="value">{{ detail.issueTime }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="label">发布人:</span>
|
||||
<span class="value">{{ detail.issuer }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="label">联系方式:</span>
|
||||
<span class="value link">{{ detail.contact }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-desc">
|
||||
<div class="desc-title">详细描述</div>
|
||||
<div class="desc-content">{{ detail.description }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 处理记录 -->
|
||||
<div class="record-card" v-if="detail.records && detail.records.length > 0">
|
||||
<div class="card-title">处理记录</div>
|
||||
<div class="record-list">
|
||||
<div v-for="(record, index) in detail.records" :key="index" class="record-item">
|
||||
<div class="record-dot"></div>
|
||||
<div class="record-content">
|
||||
<div class="record-time">{{ record.time }}</div>
|
||||
<div class="record-text">{{ record.content }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 底部操作按钮 -->
|
||||
<div class="action-bar">
|
||||
<van-button block round type="primary" class="action-btn" @click="handleReport">
|
||||
上报处理结果
|
||||
</van-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { Toast } from "vant";
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
// 检测详情数据
|
||||
const detail = ref({
|
||||
id: "",
|
||||
type: "vehicle",
|
||||
typeText: "重点车辆监控",
|
||||
typeClass: "type-vehicle",
|
||||
status: "unread",
|
||||
statusText: "未读",
|
||||
statusClass: "status-unread",
|
||||
objectInfo: "鄂A88888号车辆为重点监控对象",
|
||||
issueTime: "2026/03/27 10:30",
|
||||
issuer: "指挥中心",
|
||||
contact: "027-88888888",
|
||||
description: "该车辆为重点监控对象,发现请立即上报处理。近期有多次违章记录,需重点关注。",
|
||||
records: []
|
||||
});
|
||||
|
||||
// 返回
|
||||
function goBack() {
|
||||
router.back();
|
||||
}
|
||||
|
||||
// 上报处理结果
|
||||
function handleReport() {
|
||||
router.push("/dataReport");
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
const detection = route.query;
|
||||
if (detection.id) {
|
||||
detail.value.id = detection.id;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.detail-page {
|
||||
min-height: 100vh;
|
||||
background: #f5f5f5;
|
||||
padding-bottom: 100px;
|
||||
}
|
||||
|
||||
.nav-bar {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: white;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
padding: 12px 16px;
|
||||
|
||||
.nav-back {
|
||||
font-size: 20px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.nav-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.nav-placeholder {
|
||||
width: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.detail-card,
|
||||
.record-card {
|
||||
background: white;
|
||||
margin: 16px;
|
||||
border-radius: 16px;
|
||||
padding: 16px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 16px;
|
||||
padding-bottom: 12px;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
.detail-type {
|
||||
padding: 4px 10px;
|
||||
border-radius: 6px;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
|
||||
&.type-vehicle {
|
||||
background: #fef3c7;
|
||||
color: #d97706;
|
||||
}
|
||||
|
||||
&.type-person {
|
||||
background: #e0e7ff;
|
||||
color: #4f46e5;
|
||||
}
|
||||
}
|
||||
|
||||
.detail-status {
|
||||
padding: 4px 10px;
|
||||
border-radius: 6px;
|
||||
font-size: 12px;
|
||||
border: 1px solid;
|
||||
|
||||
&.status-unread {
|
||||
background: #fee2e2;
|
||||
color: #dc2626;
|
||||
border-color: #fecaca;
|
||||
}
|
||||
|
||||
&.status-read {
|
||||
background: #f0fdf4;
|
||||
color: #16a34a;
|
||||
border-color: #bbf7d0;
|
||||
}
|
||||
}
|
||||
|
||||
.card-body {
|
||||
.info-row {
|
||||
display: flex;
|
||||
margin-bottom: 10px;
|
||||
font-size: 14px;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.label {
|
||||
color: #999;
|
||||
width: 80px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.value {
|
||||
color: #333;
|
||||
flex: 1;
|
||||
|
||||
&.link {
|
||||
color: #2563eb;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.card-desc {
|
||||
margin-top: 16px;
|
||||
padding-top: 16px;
|
||||
border-top: 1px solid #f0f0f0;
|
||||
|
||||
.desc-title {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.desc-content {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
line-height: 1.6;
|
||||
}
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.record-list {
|
||||
position: relative;
|
||||
padding-left: 20px;
|
||||
|
||||
&::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 5px;
|
||||
top: 8px;
|
||||
bottom: 8px;
|
||||
width: 2px;
|
||||
background: #e5e5e5;
|
||||
}
|
||||
|
||||
.record-item {
|
||||
position: relative;
|
||||
padding-bottom: 16px;
|
||||
|
||||
&:last-child {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.record-dot {
|
||||
position: absolute;
|
||||
left: -17px;
|
||||
top: 4px;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background: #2563eb;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.record-content {
|
||||
.record-time {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.record-text {
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.action-bar {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: white;
|
||||
border-top: 1px solid #e5e5e5;
|
||||
padding: 12px 16px;
|
||||
padding-bottom: calc(12px + env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
height: 44px;
|
||||
font-size: 16px;
|
||||
background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
|
||||
border: none;
|
||||
}
|
||||
</style>
|
||||
255
src/pages/keyDetection/index.vue
Normal file
255
src/pages/keyDetection/index.vue
Normal file
@ -0,0 +1,255 @@
|
||||
<template>
|
||||
<div class="key-detection-page">
|
||||
<!-- 顶部导航栏 -->
|
||||
<div class="nav-bar">
|
||||
<van-icon name="arrow-left" class="nav-back" @click="goBack" />
|
||||
<h1 class="nav-title">重点检测推送</h1>
|
||||
<div class="nav-placeholder"></div>
|
||||
</div>
|
||||
|
||||
<!-- 标签筛选 -->
|
||||
<div class="filter-tabs">
|
||||
<div
|
||||
v-for="tab in tabs"
|
||||
:key="tab.value"
|
||||
class="tab-btn"
|
||||
:class="{ active: activeTab === tab.value }"
|
||||
@click="handleTabChange(tab.value)"
|
||||
>
|
||||
{{ tab.label }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 检测列表 -->
|
||||
<div class="detection-list">
|
||||
<div
|
||||
v-for="item in filteredDetections"
|
||||
:key="item.id"
|
||||
class="detection-card"
|
||||
@click="goToDetail(item)"
|
||||
>
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">{{ item.title }}</h3>
|
||||
<span class="status-tag" :class="item.statusClass">
|
||||
{{ item.statusText }}
|
||||
</span>
|
||||
</div>
|
||||
<p class="card-description">{{ item.description }}</p>
|
||||
<div class="card-footer">
|
||||
<div class="footer-item">
|
||||
<van-icon name="clock-o" class="footer-icon" />
|
||||
<span>{{ item.issueTime }}</span>
|
||||
</div>
|
||||
<div class="footer-item">
|
||||
<span>{{ item.issuer }}</span>
|
||||
<van-icon name="arrow" class="footer-icon" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 底部导航 -->
|
||||
<BottomTabs />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import BottomTabs from "@/components/bottomTabs.vue";
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const activeTab = ref("all");
|
||||
|
||||
const tabs = [
|
||||
{ label: "全部", value: "all" },
|
||||
{ label: "未读", value: "unread" },
|
||||
{ label: "已读", value: "read" }
|
||||
];
|
||||
|
||||
const detections = ref([
|
||||
{
|
||||
id: 1,
|
||||
title: "重点车辆监控",
|
||||
description: "鄂A88888号车辆为重点监控对象,发现请立即上报",
|
||||
issuer: "指挥中心",
|
||||
issueTime: "2026/03/27 10:30",
|
||||
status: "unread",
|
||||
objectType: "vehicle",
|
||||
statusText: "未读",
|
||||
statusClass: "status-unread"
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: "重点人员预警",
|
||||
description: "张某经系统分析为重点关注人员,请各巡逻队员注意发现并上报",
|
||||
issuer: "情报中心",
|
||||
issueTime: "2026/03/26 14:20",
|
||||
status: "read",
|
||||
objectType: "person",
|
||||
statusText: "已读",
|
||||
statusClass: "status-read"
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: "异常行为检测",
|
||||
description: "辖区内发现可疑人员聚集,请附近队员前往核查",
|
||||
issuer: "指挥中心",
|
||||
issueTime: "2026/03/25 09:15",
|
||||
status: "unread",
|
||||
objectType: "behavior",
|
||||
statusText: "未读",
|
||||
statusClass: "status-unread"
|
||||
}
|
||||
]);
|
||||
|
||||
const filteredDetections = computed(() => {
|
||||
if (activeTab.value === "all") {
|
||||
return detections.value;
|
||||
}
|
||||
return detections.value.filter(item => item.status === activeTab.value);
|
||||
});
|
||||
|
||||
function handleTabChange(value) {
|
||||
activeTab.value = value;
|
||||
}
|
||||
|
||||
function goBack() {
|
||||
router.back();
|
||||
}
|
||||
|
||||
function goToDetail(item) {
|
||||
router.push({
|
||||
path: "/key-detection-detail",
|
||||
query: { id: item.id }
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.key-detection-page {
|
||||
min-height: 100vh;
|
||||
background: #f5f5f5;
|
||||
padding-bottom: 70px;
|
||||
}
|
||||
|
||||
.nav-bar {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: white;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
padding: 12px 16px;
|
||||
|
||||
.nav-back {
|
||||
font-size: 20px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.nav-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.nav-placeholder {
|
||||
width: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.filter-tabs {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
padding: 16px;
|
||||
background: #f5f5f5;
|
||||
|
||||
.tab-btn {
|
||||
padding: 8px 16px;
|
||||
border-radius: 20px;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
background: white;
|
||||
transition: all 0.2s;
|
||||
|
||||
&.active {
|
||||
background: #2563eb;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.detection-list {
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
.detection-card {
|
||||
background: white;
|
||||
border-radius: 16px;
|
||||
padding: 16px;
|
||||
margin-bottom: 12px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
flex: 1;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.status-tag {
|
||||
padding: 2px 8px;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
flex-shrink: 0;
|
||||
|
||||
&.status-unread {
|
||||
background: #fef2f2;
|
||||
color: #dc2626;
|
||||
border: 1px solid #fecaca;
|
||||
}
|
||||
|
||||
&.status-read {
|
||||
background: #f5f5f5;
|
||||
color: #666;
|
||||
border: 1px solid #e5e5e5;
|
||||
}
|
||||
}
|
||||
|
||||
.card-description {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
margin-bottom: 12px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.card-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.footer-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
|
||||
.footer-icon {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user