1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<template>
    <div class="image-gallery">
        <!-- 顶部筛选区域 -->
        <div class="filter-section">
            <el-form :inline="true" class="filter-form">
                <!-- 摄像机名称 -->
                <el-form-item label="">
                    <el-input style="width: 256px;" v-model="filter.cameraName" placeholder="请输入摄像机名称" clearable />
                </el-form-item>
 
                <!-- 选择时段 -->
                <el-form-item label="选择时段">
                    <el-date-picker style="width: 256px;" v-model="filter.timeRange" type="daterange"
                        value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
                </el-form-item>
 
                <!-- 分类 -->
                <el-form-item label="分类">
                    <el-select style="width: 91px;" v-model="filter.category" placeholder="全部">
                        <el-option v-for="item in categories" :key="item.value" :label="item.label"
                            :value="item.value" />
                    </el-select>
                </el-form-item>
 
                <!-- 操作按钮 -->
                <el-form-item>
                    <el-button type="primary" icon="el-icon-search" @click="handleSearch">搜索</el-button>
                    <el-button @click="handleReset">重置</el-button>
                </el-form-item>
 
                <!-- 右侧功能按钮 -->
                <div class="action-buttons">
                    <el-button type="primary" class="action-btn">
                        批量标注
                    </el-button>
 
                    <el-dropdown>
                        <el-button type="primary" class="action-btn">
                            <i class="el-icon-download"></i> 导入
                        </el-button>
                        <el-dropdown-menu slot="dropdown">
                            <el-dropdown-item>正样本</el-dropdown-item>
                            <el-dropdown-item>负样本</el-dropdown-item>
                            <el-dropdown-item>待标记样本</el-dropdown-item>
                        </el-dropdown-menu>
                    </el-dropdown>
                    <el-button type="primary" class="action-btn">
                        模型训练
                    </el-button>
                </div>
            </el-form>
        </div>
 
        <!-- 图片展示区域 -->
        <div class="gallery-section">
            <el-row :gutter="20" class="image-grid">
                <image-card v-for="(item, index) in galleryItems" :key="index" :item="item"
                    @status-change="handleStatusChange" @card-click="handleCardClick" @show-details="showImageDetails"
                    @edit-annotation="editAnnotation" @download="downloadImage" />
            </el-row>
        </div>
    </div>
</template>
 
<script>
import imageCard from './imageCard';
export default {
    components: {
        imageCard
    },
    name: 'ImageGallery',
    data() {
        return {
            // 筛选条件
            filter: {
                cameraName: '',
                timeRange: ['2025-06-22', '2025-06-28'],
                category: 'all'
            },
 
            // 分类选项
            categories: [
                { label: '全部', value: 'all' },
                { label: '正确', value: 'correct' },
                { label: '错误', value: 'incorrect' },
                { label: '不确定', value: 'unknown' }
            ],
 
            // 图片数据
            galleryItems: [
                {
                    image: "@/assets/img/样本图.png",
                    date: '2025-07-01 10:00:09',
                    camera: '大门口检测摄像头',
                    status: 'correct'
                },
                {
                    image: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='200' viewBox='0 0 300 200'%3E%3Crect width='300' height='200' fill='%23f0f7ff'/%3E%3Crect x='50' y='30' width='200' height='140' rx='5' ry='5' fill='%23d5e8ff' stroke='%23409EFF' stroke-width='1'/%3E%3Cpath d='M100,60 L200,60 M100,80 L200,80 M100,100 L200,100 M100,120 L200,120 M100,140 L200,140' stroke='%23409EFF' stroke-width='1'/%3E%3Cpath d='M80,80 L120,120 M80,120 L120,80' stroke='%23FF4D4F' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E",
                    date: '2025-07-01 10:00:09',
                    camera: '大门口检测摄像头',
                    status: 'incorrect'
                },
                {
                    image: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='200' viewBox='0 0 300 200'%3E%3Crect width='300' height='200' fill='%23f0f7ff'/%3E%3Crect x='50' y='30' width='200' height='140' rx='5' ry='5' fill='%23d5e8ff' stroke='%23409EFF' stroke-width='1'/%3E%3Cellipse cx='150' cy='100' rx='70' ry='40' stroke='%23409EFF' stroke-width='1' fill='none'/%3E%3Ccircle cx='130' cy='80' r='5' fill='%23409EFF'/%3E%3Ccircle cx='170' cy='80' r='5' fill='%23409EFF'/%3E%3Cpath d='M150,100 Q160,120 140,120' stroke='%23409EFF' stroke-width='1' fill='none'/%3E%3C/svg%3E",
                    date: '2025-07-01 10:00:09',
                    camera: '大门口检测摄像头',
                    status: 'correct'
                },
                {
                    image: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='200' viewBox='0 0 300 200'%3E%3Crect width='300' height='200' fill='%23f0f7ff'/%3E%3Crect x='50' y='30' width='200' height='140' rx='5' ry='5' fill='%23d5e8ff' stroke='%23409EFF' stroke-width='1'/%3E%3Cpath d='M80,80 L220,80 M150,50 L150,110' stroke='%23409EFF' stroke-width='1'/%3E%3Ccircle cx='150' cy='80' r='40' stroke='%23409EFF' stroke-width='1' fill='none'/%3E%3C/svg%3E",
                    date: '2025-07-01 10:00:09',
                    camera: '大门口检测摄像头',
                    status: 'unknown'
                },
                {
                    image: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='200' viewBox='0 0 300 200'%3E%3Crect width='300' height='200' fill='%23f0f7ff'/%3E%3Crect x='50' y='30' width='200' height='140' rx='5' ry='5' fill='%23d5e8ff' stroke='%23409EFF' stroke-width='1'/%3E%3Cpath d='M100,60 L200,60 M100,80 L200,80 M100,100 L200,100 M100,120 L200,120' stroke='%23409EFF' stroke-width='1'/%3E%3Cpath d='M120,100 A20,20 0 1,1 180,100 A20,20 0 1,1 120,100' stroke='%23409EFF' stroke-width='1' fill='none'/%3E%3C/svg%3E",
                    date: '2025-07-01 10:00:09',
                    camera: '大门口检测摄像头',
                    status: 'correct'
                },
                {
                    image: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='200' viewBox='0 0 300 200'%3E%3Crect width='300' height='200' fill='%23f0f7ff'/%3E%3Crect x='50' y='30' width='200' height='140' rx='5' ry='5' fill='%23d5e8ff' stroke='%23409EFF' stroke-width='1'/%3E%3Crect x='70' y='60' width='60' height='40' rx='3' ry='3' fill='%23a0c8ff' stroke='%23409EFF' stroke-width='1'/%3E%3Crect x='170' y='60' width='60' height='40' rx='3' ry='3' fill='%23a0c8ff' stroke='%23409EFF' stroke-width='1'/%3E%3Crect x='120' y='120' width='60' height='20' rx='2' ry='2' fill='%23a0c8ff' stroke='%23409EFF' stroke-width='1'/%3E%3C/svg%3E",
                    date: '2025-07-01 10:00:09',
                    camera: '大门口检测摄像头',
                    status: 'incorrect'
                }
            ]
        }
    },
    methods: {
        // 处理搜索
        handleSearch() {
            console.log('执行搜索:', this.filter);
            // 这里可以添加实际的搜索逻辑
        },
 
        // 重置筛选条件
        handleReset() {
            this.filter = {
                cameraName: '',
                timeRange: ['2025-06-22', '2025-06-28'],
                category: 'all'
            };
            console.log('已重置筛选条件');
        },
    }
}
</script>
 
<style scoped>
.image-gallery {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
    font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
}
 
/* 筛选区域样式 */
.filter-section {
    padding: 20px;
    background-color: #f5f7fa;
    border-radius: 4px;
    margin-bottom: 20px;
}
 
.filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}
 
.action-buttons {
    display: flex;
    margin-left: auto;
    gap: 10px;
    margin-bottom: 20px;
}
 
.action-btn {
    padding: 10px 20px;
}
 
::v-deep .el-form-item {
    margin-bottom: 18px;
    margin-right: 20px;
}
 
::v-deep .el-form-item__label {
    font-weight: bold;
    color: #606266;
}
 
/* 图片展示区域 */
.gallery-section {
    margin-top: 20px;
}
 
.image-card {
    margin-bottom: 20px;
    border-radius: 4px;
    overflow: hidden;
    background-color: #f9fbfd;
    border: 1px solid #e6ebf5;
    transition: all 0.3s ease;
}
</style>