提交代码

This commit is contained in:
jiang 2024-12-02 11:19:17 +08:00
parent bd2ad482b7
commit 11690d21f3
6 changed files with 130 additions and 96 deletions

View File

@ -1,7 +1,7 @@
<template>
<div>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="85px">
<el-form-item label="任务标题" prop="datasetName">
<el-form-item label="任务标题" prop="taskName">
<el-input
v-model="queryParams.taskName"
placeholder="请输入任务标题"
@ -15,7 +15,8 @@
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item>
@ -30,26 +31,29 @@
size="mini"
@click="handleAdd"
v-hasPermi="['dataCenter:task:create']"
>新建</el-button>
>新建
</el-button>
</el-form>
<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="index" label="序号" align="center" min-width="50" />
<el-table-column label="开始时间-结束时间" align="center" show-overflow-tooltip prop="datasetName" min-width="200">
<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="index" label="序号" align="center" min-width="50"/>
<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>
<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="ownerName" min-width="100"/>
<el-table-column label="任务状态" show-overflow-tooltip align="center" prop="annotateTaskStatus" width="160">
<template slot-scope="scope">
<span>{{annotateTaskStatus.find(opt => opt.value === scope.row.annotateTaskStatus).label}}</span>
</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" >
<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 时渲染进度条 -->
@ -57,15 +61,16 @@
v-if="scope.row.totalCount > 0"
color="#13ce66"
:percentage="getPercentage(scope.row)"
style="width: 150px;"/>
style="width: 150px;"
/>
<!-- 显示标注进度 -->
<span >({{ (scope.row.totalCount - scope.row.status0Count) + '/' + scope.row.totalCount }})</span>
<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>
<span>{{ scope.row.totalCount - scope.row.status0Count }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="140" class-name="small-padding fixed-width">
@ -73,31 +78,31 @@
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleExamine(scope.row)"
v-hasPermi="['dataCenter:sample:edit']"
>审核</el-button>
>审核
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleDimension(scope.row)"
v-hasPermi="['dataCenter:sample:edit']"
>智能标注</el-button>
>智能标注
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleAnnotation(scope.row)"
v-hasPermi="['dataCenter:sample:edit']"
>标注</el-button>
>标注
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleRelease(scope.row)"
v-hasPermi="['dataCenter:sample:edit']"
>发布</el-button>
>发布
</el-button>
</template>
</el-table-column>
</el-table>
@ -112,33 +117,34 @@
<!-- 新建数据集弹窗 -->
<add-task-dialog :open="addOpen" :get-list="getList" @dialog-cancel="handleCancel"></add-task-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>
<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>
</template>
<script>
import { list,del,setPublic} from '@/api/dataCenter/annotationTask'
import { list, del, setPublic } from '@/api/dataCenter/annotationTask'
import addTaskDialog from '../dialog/addTaskDialog'
import releaseVersionDialog from '../dialog/releaseVersionDialog.vue'
import { parseTime } from '@/utils/bonus'
export default {
components: { releaseVersionDialog, addTaskDialog},
name: "allTasks",
components: { releaseVersionDialog, addTaskDialog },
name: 'allTasks',
data() {
return {
annotateTaskStatus:[
{label:'未标注',value:'0'},
{label:'正在标注',value:'1'},
{label:'已标注',value:'2'},
{label:'正在审核',value:'3'},
{label:'已审核',value:'4'},
annotateTaskStatus: [
{ label: '未标注', value: '0' },
{ label: '正在标注', value: '1' },
{ label: '已标注', value: '2' },
{ label: '正在审核', value: '3' },
{ label: '已审核', value: '4' }
],
lastVersionName:'',
taskId:0,
lastVersionName: '',
taskId: 0,
datasetId: 0,
//
loading: true,
@ -160,101 +166,104 @@ export default {
releaseOpen: false,
//
queryParams: {
time:[],
time: [],
pageNum: 1,
pageSize: 10,
datasetName: null,
},
};
taskName: null
}
}
},
created() {
this.getList();
this.getList()
//
this.updateTableHeight();
this.updateTableHeight()
//
window.addEventListener("resize", this.updateTableHeight);
window.addEventListener('resize', this.updateTableHeight)
},
methods: {
parseTime,
updateTableHeight() {
//
const headerHeight = 300; //
const footerHeight = 80; //
this.tableHeight = window.innerHeight - headerHeight - footerHeight;
const headerHeight = 300 //
const footerHeight = 80 //
this.tableHeight = window.innerHeight - headerHeight - footerHeight
},
/**获取数据 **/
getList(){
this.loading =true
if ( this.queryParams.time.length>0){
getList() {
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)
list(this.queryParams).then(response => {
console.log(response);
this.list = response.rows;
this.total = response.total;
this.loading =false
console.log(response)
this.list = response.rows
this.total = response.total
this.loading = false
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
this.resetForm('queryForm')
this.queryParams.time = []
this.queryParams.startTime = null
this.queryParams.endTime = null
this.handleQuery()
},
handleAdd(){
this.addOpen = true;
handleAdd() {
this.addOpen = true
},
handleRelease(row){
this.datasetId = row.datasetId;
this.taskId = row.taskId;
this.lastVersionName = row.lastVersionName || '';
console.log(this.lastVersionName);
this.releaseOpen = true;
handleRelease(row) {
this.datasetId = row.datasetId
this.taskId = row.taskId
this.lastVersionName = row.lastVersionName || ''
console.log(this.lastVersionName)
this.releaseOpen = true
},
handleDimension(row){
handleDimension(row) {
this.$modal.msgSuccess('功能开发中')
},
handleAnnotation(row){
this.$tab.openPage("数据标注", '/dataCenter/annotationTask/dataAnnotations/index/' + row.taskId);
handleAnnotation(row) {
this.$tab.openPage('数据标注', '/dataCenter/annotationTask/dataAnnotations/index/' + row.taskId)
},
handleExamine(row){
this.$tab.openPage("数据审核", '/dataCenter/annotationTask/examine/index/' + row.taskId);
handleExamine(row) {
this.$tab.openPage('数据审核', '/dataCenter/annotationTask/examine/index/' + row.taskId)
},
getPercentage(row) {
if (row.totalCount > 0 && row.status0Count >= 0) {
let percentage = Math.floor(((row.totalCount - row.status0Count) / row.totalCount) * 100);
let percentage = Math.floor(((row.totalCount - row.status0Count) / row.totalCount) * 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){
const ids = row.datasetId || this.ids;
handleDelete(row) {
const ids = row.datasetId || this.ids
this.$modal.confirm('是否确认删除数据项?').then(function() {
return del(ids);
return del(ids)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess('删除成功')
}).catch(() => {
})
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.datasetId)
this.single = selection.length!==1
this.single = selection.length !== 1
this.multiple = !selection.length
},
//
handleCancel() {
this.addOpen = false;
this.releaseOpen =false;
},
this.addOpen = false
this.releaseOpen = false
}
}
}
</script>
@ -262,10 +271,12 @@ export default {
.demo-table-expand {
font-size: 0;
}
.demo-table-expand label {
width: 90px;
color: #99a9bf;
}
.demo-table-expand .el-form-item {
margin-right: 0;
margin-bottom: 0;

View File

@ -103,7 +103,8 @@ export default {
//
async handleAnnotationSubmit(LS, annotation, task) {
const results = annotation.serializeAnnotation();
if (!results) return;
console.log(results)
if (results.length === 0) return;
const formattedAnnotations = results.map(result => {
if (result.type === 'rectanglelabels') {

View File

@ -121,6 +121,10 @@ export default {
default: false,
required: true
},
getList: {
type: Function,
required: true,
}
},
computed: {
isOpen: {
@ -295,6 +299,7 @@ export default {
},
//
reset() {
this.getList();
this.tableData = [];
this.form = {} //
this.$refs.form.resetFields() // Element UI

View File

@ -109,6 +109,7 @@ import { add } from '@/api/dataCenter/annotationTask'
import { listDataSetLabels } from '@/api/dataCenter/labels'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { parseTime } from '../../../../utils/bonus'
export default {
dicts: ['ai_annotate_type'],
@ -178,7 +179,7 @@ export default {
delete node.children
}
return {
id: node.labelId,
id: node.labelName,
label: node.labelName,
children: node.children
}
@ -214,8 +215,10 @@ export default {
}
this.$refs['form'].validate(valid => {
if (valid) {
this.form.labels = this.form.label.join(',')
this.form.isStartTeam = this.form.startTeam ? '1' : '0'
this.form.startTime = parseTime(this.form.data[0])
this.form.endTime = parseTime(this.form.data[1])
this.form.isStartTeam = this.form.startTeam?'1':'0';
this.form.labels = this.form.label.join(",")
if (this.form.isStartTeam) {
let annotators = []
let reviewers = []

View File

@ -1,10 +1,10 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="85px">
<el-form-item label="版本名称" prop="versionName">
<el-form-item label="版本" prop="versionName">
<el-input
v-model="queryParams.versionName"
placeholder="请输入版本名称"
placeholder="请输入版本"
clearable
@keyup.enter.native="handleQuery"
/>
@ -115,6 +115,7 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
versionName:undefined
},
};
},
@ -129,6 +130,18 @@ export default {
watch:{
datasetId(newVal, oldVal){
this.getList();
},
$route(to, from) {
//
if (to.fullPath !== from.fullPath) {
this.dataType = this.$route.query && this.$route.query.dataType
this.datasetId = this.$route.params && this.$route.params.dataSetId
this.getList()
//
this.updateTableHeight()
//
window.addEventListener('resize', this.updateTableHeight)
}
}
},
methods: {

View File

@ -228,7 +228,8 @@ export default {
},
handleVersion(row){
this.$tab.openPage("数据集版本管理", '/dataCenter/dataSet-version/index/' + row.datasetId);
this.$tab.openPage("数据集版本管理", '/dataCenter/dataSet-version/index/' + row.datasetId,
{_t: Date.now() });
},
getPercentage(row) {
if (row.annotatedCount > 0 && row.notAnnotatedCount >= 0) {