|
|
@@ -10,25 +10,46 @@
|
|
|
<el-tabs v-model="activeTab" @tab-change="handleTabChange">
|
|
|
<el-tab-pane label="信息任务管理" name="data">
|
|
|
<el-table v-loading="loading" :data="taskList" border stripe style="width: 100%">
|
|
|
- <el-table-column prop="id" label="任务序号" width="100" />
|
|
|
- <el-table-column prop="business_id" label="基本信息ID" min-width="180" />
|
|
|
- <el-table-column prop="name" label="名称" min-width="250" show-overflow-tooltip />
|
|
|
- <el-table-column prop="task_id" label="任务ID (task_id)" min-width="200">
|
|
|
+ <el-table-column type="index" label="序号" width="70" align="center" />
|
|
|
+ <el-table-column prop="project_name" label="项目名称" min-width="180" />
|
|
|
+ <el-table-column label="任务标签" min-width="150">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <div class="tag-group">
|
|
|
+ <el-tag
|
|
|
+ v-for="tag in parseTags(row.tag)"
|
|
|
+ :key="tag"
|
|
|
+ size="small"
|
|
|
+ class="mr-1 mb-1"
|
|
|
+ >
|
|
|
+ {{ tag }}
|
|
|
+ </el-tag>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="file_count" label="文件数量" width="100" align="center" />
|
|
|
+ <el-table-column prop="task_id" label="标注平台任务ID" min-width="200">
|
|
|
<template #default="{ row }">
|
|
|
<el-tag v-if="row.task_id" type="info">{{ row.task_id }}</el-tag>
|
|
|
<span v-else class="placeholder">暂无任务ID</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" width="220" fixed="right">
|
|
|
+ <el-table-column label="操作" width="280" fixed="right">
|
|
|
<template #default="{ row }">
|
|
|
<el-button-group>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="info"
|
|
|
+ @click="handleViewDetails(row)"
|
|
|
+ >
|
|
|
+ 详情
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
|
size="small"
|
|
|
type="primary"
|
|
|
:disabled="!row.task_id"
|
|
|
@click="handleCheckProgress(row)"
|
|
|
>
|
|
|
- 查看进度
|
|
|
+ 进度
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
size="small"
|
|
|
@@ -36,7 +57,7 @@
|
|
|
:disabled="!row.task_id"
|
|
|
@click="handleExportData(row)"
|
|
|
>
|
|
|
- 导出结果
|
|
|
+ 导出
|
|
|
</el-button>
|
|
|
</el-button-group>
|
|
|
</template>
|
|
|
@@ -46,44 +67,46 @@
|
|
|
|
|
|
<el-tab-pane label="图片任务管理" name="image">
|
|
|
<el-table v-loading="loading" :data="taskList" border stripe style="width: 100%">
|
|
|
- <el-table-column prop="id" label="任务序号" width="100" />
|
|
|
- <el-table-column label="图片预览" width="120">
|
|
|
+ <el-table-column type="index" label="序号" width="70" align="center" />
|
|
|
+ <el-table-column prop="project_name" label="项目名称" min-width="180" />
|
|
|
+ <el-table-column label="任务标签" min-width="150">
|
|
|
<template #default="{ row }">
|
|
|
- <el-image
|
|
|
- v-if="row.image_url"
|
|
|
- class="table-image"
|
|
|
- :src="row.image_url"
|
|
|
- :preview-src-list="[row.image_url]"
|
|
|
- fit="cover"
|
|
|
- preview-teleported
|
|
|
- >
|
|
|
- <template #error>
|
|
|
- <div class="image-error">
|
|
|
- <el-icon><Picture /></el-icon>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-image>
|
|
|
- <span v-else class="placeholder">无预览图</span>
|
|
|
+ <div class="tag-group">
|
|
|
+ <el-tag
|
|
|
+ v-for="tag in parseTags(row.tag)"
|
|
|
+ :key="tag"
|
|
|
+ size="small"
|
|
|
+ class="mr-1 mb-1"
|
|
|
+ >
|
|
|
+ {{ tag }}
|
|
|
+ </el-tag>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="business_id" label="图片ID" min-width="180" />
|
|
|
- <el-table-column prop="name" label="名称" min-width="250" show-overflow-tooltip />
|
|
|
- <el-table-column prop="task_id" label="任务ID (task_id)" min-width="200">
|
|
|
+ <el-table-column prop="file_count" label="文件数量" width="100" align="center" />
|
|
|
+ <el-table-column prop="task_id" label="标注平台任务ID" min-width="200">
|
|
|
<template #default="{ row }">
|
|
|
<el-tag v-if="row.task_id" type="info">{{ row.task_id }}</el-tag>
|
|
|
<span v-else class="placeholder">暂无任务ID</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" width="220" fixed="right">
|
|
|
+ <el-table-column label="操作" width="280" fixed="right">
|
|
|
<template #default="{ row }">
|
|
|
<el-button-group>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="info"
|
|
|
+ @click="handleViewDetails(row)"
|
|
|
+ >
|
|
|
+ 详情
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
|
size="small"
|
|
|
type="primary"
|
|
|
:disabled="!row.task_id"
|
|
|
@click="handleCheckProgress(row)"
|
|
|
>
|
|
|
- 查看进度
|
|
|
+ 进度
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
size="small"
|
|
|
@@ -91,7 +114,7 @@
|
|
|
:disabled="!row.task_id"
|
|
|
@click="handleExportData(row)"
|
|
|
>
|
|
|
- 导出结果
|
|
|
+ 导出
|
|
|
</el-button>
|
|
|
</el-button-group>
|
|
|
</template>
|
|
|
@@ -100,6 +123,53 @@
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</el-card>
|
|
|
+
|
|
|
+ <!-- 项目详情对话框 -->
|
|
|
+ <el-dialog
|
|
|
+ v-model="detailsVisible"
|
|
|
+ :title="`项目详情: ${currentProject?.project_name}`"
|
|
|
+ width="800px"
|
|
|
+ destroy-on-close
|
|
|
+ >
|
|
|
+ <el-table :data="currentProjectFiles" v-loading="detailsLoading" border stripe style="width: 100%" max-height="500">
|
|
|
+ <el-table-column type="index" label="序号" width="60" align="center" />
|
|
|
+ <el-table-column v-if="activeTab === 'image'" label="图片预览" width="100">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-image
|
|
|
+ v-if="row.image_url"
|
|
|
+ class="detail-table-image"
|
|
|
+ :src="row.image_url"
|
|
|
+ :preview-src-list="[row.image_url]"
|
|
|
+ fit="cover"
|
|
|
+ preview-teleported
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="name" label="文件名称" min-width="200" show-overflow-tooltip />
|
|
|
+ <el-table-column label="任务标签" min-width="120">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <div class="tag-group">
|
|
|
+ <el-tag
|
|
|
+ v-for="tag in parseTags(row.tag)"
|
|
|
+ :key="tag"
|
|
|
+ size="small"
|
|
|
+ class="mr-1 mb-1"
|
|
|
+ >
|
|
|
+ {{ tag }}
|
|
|
+ </el-tag>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="business_id" label="业务ID" width="180" />
|
|
|
+ <el-table-column prop="annotation_status" label="状态" width="100">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-tag :type="row.annotation_status === 'completed' ? 'success' : 'warning'" size="small">
|
|
|
+ {{ row.annotation_status === 'completed' ? '已完成' : '标注中' }}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -110,12 +180,16 @@ import { Picture } from '@element-plus/icons-vue'
|
|
|
import request from '@/api/request'
|
|
|
|
|
|
interface TaskItem {
|
|
|
- id: number
|
|
|
+ id?: number
|
|
|
business_id: string
|
|
|
task_id: string | null
|
|
|
- project_id: string // 项目名称
|
|
|
+ project_id: string
|
|
|
+ project_name: string
|
|
|
type: string
|
|
|
name: string
|
|
|
+ file_count: number
|
|
|
+ status: string
|
|
|
+ tag?: string
|
|
|
image_url?: string
|
|
|
}
|
|
|
|
|
|
@@ -130,6 +204,23 @@ const activeTab = ref('data')
|
|
|
const loading = ref(false)
|
|
|
const taskList = ref<TaskItem[]>([])
|
|
|
|
|
|
+// 详情相关
|
|
|
+const detailsVisible = ref(false)
|
|
|
+const detailsLoading = ref(false)
|
|
|
+const currentProject = ref<TaskItem | null>(null)
|
|
|
+const currentProjectFiles = ref<any[]>([])
|
|
|
+
|
|
|
+// 解析标签
|
|
|
+const parseTags = (tagStr: string | null | undefined): string[] => {
|
|
|
+ if (!tagStr) return []
|
|
|
+ try {
|
|
|
+ const parsed = JSON.parse(tagStr)
|
|
|
+ return Array.isArray(parsed) ? parsed : [parsed]
|
|
|
+ } catch (e) {
|
|
|
+ return [tagStr]
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
const loadTasks = async () => {
|
|
|
loading.value = true
|
|
|
try {
|
|
|
@@ -149,6 +240,31 @@ const loadTasks = async () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// 查看项目详情
|
|
|
+const handleViewDetails = async (row: TaskItem) => {
|
|
|
+ currentProject.value = row
|
|
|
+ detailsVisible.value = true
|
|
|
+ detailsLoading.value = true
|
|
|
+ try {
|
|
|
+ const response = await request.get<any, ApiResponse<any[]>>('/api/v1/sample/tasks/details', {
|
|
|
+ params: {
|
|
|
+ project_id: row.project_id,
|
|
|
+ type: activeTab.value
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (response.code === 0) {
|
|
|
+ currentProjectFiles.value = response.data
|
|
|
+ } else {
|
|
|
+ ElMessage.error(response.message || '获取项目详情失败')
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('获取详情出错:', error)
|
|
|
+ ElMessage.error('获取项目详情失败')
|
|
|
+ } finally {
|
|
|
+ detailsLoading.value = false
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
const handleTabChange = () => {
|
|
|
taskList.value = []
|
|
|
loadTasks()
|
|
|
@@ -266,6 +382,12 @@ onMounted(() => {
|
|
|
font-size: 20px;
|
|
|
}
|
|
|
|
|
|
+.detail-table-image {
|
|
|
+ width: 60px;
|
|
|
+ height: 45px;
|
|
|
+ border-radius: 4px;
|
|
|
+}
|
|
|
+
|
|
|
:deep(.el-tabs__header) {
|
|
|
margin-bottom: 20px;
|
|
|
}
|