提交代码

This commit is contained in:
jiang 2024-11-28 14:03:49 +08:00
parent 5dd9d8b251
commit 65c63d3317
2 changed files with 128 additions and 31 deletions

View File

@ -36,13 +36,38 @@
<el-table style="width: 100%" v-loading="loading" :data="list" :height="tableHeight" @selection-change="handleSelectionChange"> <el-table style="width: 100%" v-loading="loading" :data="list" :height="tableHeight" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" /> <el-table-column type="selection" width="50" align="center" />
<el-table-column type="index" label="序号" align="center" min-width="50" /> <el-table-column type="index" label="序号" align="center" min-width="50" />
<el-table-column label="开始时间-结束时间" align="center" show-overflow-tooltip prop="datasetName"/> <el-table-column label="开始时间-结束时间" align="center" show-overflow-tooltip prop="datasetName" min-width="200">
<template slot-scope="scope">
<span v-show="scope.row.startTime !==null && scope.row.endTime !==null">{{parseTime(scope.row.startTime) +" " +parseTime(scope.row.endTime)}}</span>
</template>
</el-table-column>
<el-table-column label="任务标题" align="center" show-overflow-tooltip prop="taskName" /> <el-table-column label="任务标题" align="center" show-overflow-tooltip prop="taskName" />
<el-table-column label="负责人员" align="center" show-overflow-tooltip prop="createBy" min-width="100"/> <el-table-column label="负责人员" align="center" show-overflow-tooltip prop="ownerName" min-width="100"/>
<el-table-column label="任务状态" show-overflow-tooltip align="center" prop="annotateTaskStatus" width="160"/> <el-table-column label="任务状态" show-overflow-tooltip align="center" prop="annotateTaskStatus" width="160">
<el-table-column label="所属数据集" show-overflow-tooltip align="center" prop="datasetDesc" /> <template slot-scope="scope">
<el-table-column label="标注进度(已标注个数/总数)" show-overflow-tooltip min-width="140" align="center" prop="createBy" /> <span>{{annotateTaskStatus.find(opt => opt.value === scope.row.annotateTaskStatus).label}}</span>
<el-table-column label="待审核个数" show-overflow-tooltip align="center" prop="createBy" /> </template>
</el-table-column>
<el-table-column label="所属数据集" show-overflow-tooltip align="center" prop="datasetName" />
<el-table-column label="标注进度(已标注个数/总数)" show-overflow-tooltip min-width="140" align="center" prop="createBy" >
<template slot-scope="scope">
<div style="display: flex;align-items: center;">
<!-- 使用 v-if 确保当 annotatedCount > 0 时渲染进度条 -->
<el-progress
v-if="scope.row.totalCount > 0"
color="#13ce66"
:percentage="getPercentage(scope.row)"
style="width: 150px;"/>
<!-- 显示标注进度 -->
<span >({{ (scope.row.totalCount - scope.row.status0Count) + '/' + scope.row.totalCount }})</span>
</div>
</template>
</el-table-column>
<el-table-column label="待审核个数" show-overflow-tooltip align="center" prop="createBy">
<template slot-scope="scope">
<span>{{ scope.row.totalCount - (scope.row.status2Count+scope.row.status3Count)}}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="140" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" min-width="140" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -87,7 +112,7 @@
<!-- 新建数据集弹窗 --> <!-- 新建数据集弹窗 -->
<add-task-dialog :open="addOpen" :get-list="getList" @dialog-cancel="handleCancel"></add-task-dialog> <add-task-dialog :open="addOpen" :get-list="getList" @dialog-cancel="handleCancel"></add-task-dialog>
<release-version-dialog :dataset-id="datasetId" :open="releaseOpen" @dialog-cancel="handleCancel"></release-version-dialog> <release-version-dialog :get-list="getList" :dataset-id="datasetId" :open="releaseOpen" :task-id="taskId" :last-version-name="lastVersionName" @dialog-cancel="handleCancel"></release-version-dialog>
</div> </div>
</template> </template>
@ -95,14 +120,25 @@
import { creation,del} from '@/api/dataCenter/annotationTask' import { creation,del,setPublic} from '@/api/dataCenter/annotationTask'
import addTaskDialog from '../dialog/addTaskDialog' import addTaskDialog from '../dialog/addTaskDialog'
import releaseVersionDialog from '../dialog/releaseVersionDialog.vue' import releaseVersionDialog from '../dialog/releaseVersionDialog.vue'
import { parseTime } from '@/utils/bonus'
export default { export default {
components: { releaseVersionDialog, addTaskDialog}, components: { releaseVersionDialog, addTaskDialog},
name: "allTasks", name: "allTasks",
data() { data() {
return { return {
annotateTaskStatus:[
{label:'未标注',value:'0'},
{label:'正在标注',value:'1'},
{label:'已标注',value:'2'},
{label:'正在审核',value:'3'},
{label:'已审核',value:'4'},
],
lastVersionName:'',
taskId:0,
datasetId: 0, datasetId: 0,
// //
loading: true, loading: true,
@ -124,6 +160,7 @@ export default {
releaseOpen: false, releaseOpen: false,
// //
queryParams: { queryParams: {
time:[],
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
datasetName: null, datasetName: null,
@ -138,6 +175,7 @@ export default {
window.addEventListener("resize", this.updateTableHeight); window.addEventListener("resize", this.updateTableHeight);
}, },
methods: { methods: {
parseTime,
updateTableHeight() { updateTableHeight() {
// //
const headerHeight = 300; // const headerHeight = 300; //
@ -147,6 +185,12 @@ export default {
/**获取数据 **/ /**获取数据 **/
getList(){ getList(){
this.loading =true this.loading =true
if ( this.queryParams.time.length>0){
this.queryParams.startTime = parseTime(this.queryParams.time[0])
this.queryParams.endTime = parseTime(this.queryParams.time[1])
}
console.log(this.queryParams)
creation(this.queryParams).then(response => { creation(this.queryParams).then(response => {
console.log(response); console.log(response);
this.list = response.rows; this.list = response.rows;
@ -168,8 +212,11 @@ export default {
this.addOpen = true; this.addOpen = true;
}, },
handleRelease(row){ handleRelease(row){
this.releaseOpen = true;
this.datasetId = row.datasetId; this.datasetId = row.datasetId;
this.taskId = row.taskId;
this.lastVersionName = row.lastVersionName || '';
console.log(this.lastVersionName);
this.releaseOpen = true;
}, },
handleDimension(row){ handleDimension(row){
@ -181,8 +228,8 @@ export default {
this.$tab.openPage("数据审核", '/dataCenter/annotationTask/examine/index/' + row.taskId); this.$tab.openPage("数据审核", '/dataCenter/annotationTask/examine/index/' + row.taskId);
}, },
getPercentage(row) { getPercentage(row) {
if (row.annotatedCount > 0 && row.notAnnotatedCount >= 0) { if (row.totalCount > 0 && row.status0Count >= 0) {
let percentage = ((row.annotatedCount - row.notAnnotatedCount) / row.annotatedCount) * 100; let percentage = Math.floor(((row.totalCount - row.status0Count) / row.totalCount) * 100);
// percentage 0 100 // percentage 0 100
return Math.min(Math.max(percentage, 0), 100); return Math.min(Math.max(percentage, 0), 100);
} }

View File

@ -36,13 +36,38 @@
<el-table style="width: 100%" v-loading="loading" :data="list" :height="tableHeight" @selection-change="handleSelectionChange"> <el-table style="width: 100%" v-loading="loading" :data="list" :height="tableHeight" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" /> <el-table-column type="selection" width="50" align="center" />
<el-table-column type="index" label="序号" align="center" min-width="50" /> <el-table-column type="index" label="序号" align="center" min-width="50" />
<el-table-column label="开始时间-结束时间" align="center" show-overflow-tooltip prop="datasetName"/> <el-table-column label="开始时间-结束时间" align="center" show-overflow-tooltip prop="datasetName" min-width="200">
<template slot-scope="scope">
<span v-show="scope.row.startTime !==null && scope.row.endTime !==null">{{parseTime(scope.row.startTime) +" " +parseTime(scope.row.endTime)}}</span>
</template>
</el-table-column>
<el-table-column label="任务标题" align="center" show-overflow-tooltip prop="taskName" /> <el-table-column label="任务标题" align="center" show-overflow-tooltip prop="taskName" />
<el-table-column label="负责人员" align="center" show-overflow-tooltip prop="createBy" min-width="100"/> <el-table-column label="负责人员" align="center" show-overflow-tooltip prop="ownerName" min-width="100"/>
<el-table-column label="任务状态" show-overflow-tooltip align="center" prop="annotateTaskStatus" width="160"/> <el-table-column label="任务状态" show-overflow-tooltip align="center" prop="annotateTaskStatus" width="160">
<el-table-column label="所属数据集" show-overflow-tooltip align="center" prop="datasetDesc" /> <template slot-scope="scope">
<el-table-column label="标注进度(已标注个数/总数)" show-overflow-tooltip min-width="140" align="center" prop="createBy" /> <span>{{annotateTaskStatus.find(opt => opt.value === scope.row.annotateTaskStatus).label}}</span>
<el-table-column label="待审核个数" show-overflow-tooltip align="center" prop="createBy" /> </template>
</el-table-column>
<el-table-column label="所属数据集" show-overflow-tooltip align="center" prop="datasetName" />
<el-table-column label="标注进度(已标注个数/总数)" show-overflow-tooltip min-width="140" align="center" prop="createBy" >
<template slot-scope="scope">
<div style="display: flex;align-items: center;">
<!-- 使用 v-if 确保当 annotatedCount > 0 时渲染进度条 -->
<el-progress
v-if="scope.row.totalCount > 0"
color="#13ce66"
:percentage="getPercentage(scope.row)"
style="width: 150px;"/>
<!-- 显示标注进度 -->
<span >({{ (scope.row.totalCount - scope.row.status0Count) + '/' + scope.row.totalCount }})</span>
</div>
</template>
</el-table-column>
<el-table-column label="待审核个数" show-overflow-tooltip align="center" prop="createBy">
<template slot-scope="scope">
<span>{{ scope.row.totalCount - (scope.row.status2Count+scope.row.status3Count)}}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="140" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" min-width="140" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -87,7 +112,7 @@
<!-- 新建数据集弹窗 --> <!-- 新建数据集弹窗 -->
<add-task-dialog :open="addOpen" :get-list="getList" @dialog-cancel="handleCancel"></add-task-dialog> <add-task-dialog :open="addOpen" :get-list="getList" @dialog-cancel="handleCancel"></add-task-dialog>
<release-version-dialog :dataset-id="datasetId" :open="releaseOpen" @dialog-cancel="handleCancel"></release-version-dialog> <release-version-dialog :get-list="getList" :dataset-id="datasetId" :open="releaseOpen" :task-id="taskId" :last-version-name="lastVersionName" @dialog-cancel="handleCancel"></release-version-dialog>
</div> </div>
</template> </template>
@ -95,14 +120,25 @@
import { participant,del} from '@/api/dataCenter/annotationTask' import { participant,del,setPublic} from '@/api/dataCenter/annotationTask'
import addTaskDialog from '../dialog/addTaskDialog' import addTaskDialog from '../dialog/addTaskDialog'
import releaseVersionDialog from '../dialog/releaseVersionDialog.vue' import releaseVersionDialog from '../dialog/releaseVersionDialog.vue'
import { parseTime } from '@/utils/bonus'
export default { export default {
components: { releaseVersionDialog, addTaskDialog}, components: { releaseVersionDialog, addTaskDialog},
name: "allTasks", name: "allTasks",
data() { data() {
return { return {
annotateTaskStatus:[
{label:'未标注',value:'0'},
{label:'正在标注',value:'1'},
{label:'已标注',value:'2'},
{label:'正在审核',value:'3'},
{label:'已审核',value:'4'},
],
lastVersionName:'',
taskId:0,
datasetId: 0, datasetId: 0,
// //
loading: true, loading: true,
@ -124,6 +160,7 @@ export default {
releaseOpen: false, releaseOpen: false,
// //
queryParams: { queryParams: {
time:[],
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
datasetName: null, datasetName: null,
@ -138,6 +175,7 @@ export default {
window.addEventListener("resize", this.updateTableHeight); window.addEventListener("resize", this.updateTableHeight);
}, },
methods: { methods: {
parseTime,
updateTableHeight() { updateTableHeight() {
// //
const headerHeight = 300; // const headerHeight = 300; //
@ -147,6 +185,12 @@ export default {
/**获取数据 **/ /**获取数据 **/
getList(){ getList(){
this.loading =true this.loading =true
if ( this.queryParams.time.length>0){
this.queryParams.startTime = parseTime(this.queryParams.time[0])
this.queryParams.endTime = parseTime(this.queryParams.time[1])
}
console.log(this.queryParams)
participant(this.queryParams).then(response => { participant(this.queryParams).then(response => {
console.log(response); console.log(response);
this.list = response.rows; this.list = response.rows;
@ -164,49 +208,53 @@ export default {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },
handleAdd(){ handleAdd() {
this.addOpen = true; this.addOpen = true;
}, },
handleRelease(row){ handleRelease(row) {
this.releaseOpen = true;
this.datasetId = row.datasetId; this.datasetId = row.datasetId;
this.taskId = row.taskId;
this.lastVersionName = row.lastVersionName || '';
console.log(this.lastVersionName);
this.releaseOpen = true;
}, },
handleDimension(row){ handleDimension(row) {
}, },
handleAnnotation(row){ handleAnnotation(row) {
this.$tab.openPage("数据标注", '/dataCenter/annotationTask/dataAnnotations/index/' + row.taskId); this.$tab.openPage("数据标注", '/dataCenter/annotationTask/dataAnnotations/index/' + row.taskId);
}, },
handleExamine(row){ handleExamine(row) {
this.$tab.openPage("数据审核", '/dataCenter/annotationTask/examine/index/' + row.taskId); this.$tab.openPage("数据审核", '/dataCenter/annotationTask/examine/index/' + row.taskId);
}, },
getPercentage(row) { getPercentage(row) {
if (row.annotatedCount > 0 && row.notAnnotatedCount >= 0) { if (row.totalCount > 0 && row.status0Count >= 0) {
let percentage = ((row.annotatedCount - row.notAnnotatedCount) / row.annotatedCount) * 100; let percentage = Math.floor(((row.totalCount - row.status0Count) / row.totalCount) * 100);
// percentage 0 100 // percentage 0 100
return Math.min(Math.max(percentage, 0), 100); return Math.min(Math.max(percentage, 0), 100);
} }
return 0; // 0% return 0; // 0%
}, },
handleDelete(row){ handleDelete(row) {
const ids = row.datasetId || this.ids; const ids = row.datasetId || this.ids;
this.$modal.confirm('是否确认删除数据项?').then(function() { this.$modal.confirm('是否确认删除数据项?').then(function() {
return del(ids); return del(ids);
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {
});
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.datasetId) this.ids = selection.map(item => item.datasetId)
this.single = selection.length!==1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
// //
handleCancel() { handleCancel() {
this.addOpen = false; this.addOpen = false;
this.releaseOpen =false; this.releaseOpen = false;
}, },
} }
} }
@ -215,10 +263,12 @@ export default {
.demo-table-expand { .demo-table-expand {
font-size: 0; font-size: 0;
} }
.demo-table-expand label { .demo-table-expand label {
width: 90px; width: 90px;
color: #99a9bf; color: #99a9bf;
} }
.demo-table-expand .el-form-item { .demo-table-expand .el-form-item {
margin-right: 0; margin-right: 0;
margin-bottom: 0; margin-bottom: 0;