提交代码
This commit is contained in:
parent
4014e2918a
commit
57b395125d
|
|
@ -118,7 +118,8 @@
|
|||
<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>
|
||||
:last-version-name="lastVersionName" @dialog-cancel="handleCancel"
|
||||
></release-version-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -133,6 +133,7 @@ export default {
|
|||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
this.loadTaskList() // 初始化时加载任务列表
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -149,11 +150,13 @@ export default {
|
|||
loadTaskList() {
|
||||
getMyNoAnnotatedTask().then(res => {
|
||||
this.taskList = res.data
|
||||
this.taskId = Number(this.$route.params && this.$route.params.taskId);
|
||||
})
|
||||
},
|
||||
|
||||
// 根据任务ID选择任务并加载对应的文件
|
||||
selectTask(id) {
|
||||
console.log(id)
|
||||
this.resetImages()
|
||||
const result = this.taskList.find(item => item.taskId === id)
|
||||
const labels = result.labels.split(',').map(role => role.trim())
|
||||
|
|
|
|||
|
|
@ -72,7 +72,9 @@
|
|||
<ul>
|
||||
<li v-for="(item, index) in images" :key="item.fileId" class="list-item">
|
||||
<div @click="setItem(item, index)">
|
||||
<input type="checkbox" :checked="item.fileAnnotationStatus==='2' || item.fileAnnotationStatus==='3' " disabled>
|
||||
<input type="checkbox"
|
||||
:checked="item.fileAnnotationStatus==='2' || item.fileAnnotationStatus==='3' " disabled
|
||||
>
|
||||
<span :class="{'highlighted': itemIndex === index}" style="font-size: 14px; margin-left: 5px;"
|
||||
>{{ item.fileName }}</span>
|
||||
</div>
|
||||
|
|
@ -135,30 +137,34 @@ export default {
|
|||
}
|
||||
},
|
||||
created() {
|
||||
this.loadTaskList(); // 初始化时加载任务列表
|
||||
this.loadTaskList() // 初始化时加载任务列表
|
||||
},
|
||||
|
||||
watch: {
|
||||
// 监听 $route 对象
|
||||
$route(to, from) {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 更新项的索引并切换任务数据
|
||||
updateItemIndex(val) {
|
||||
const item = this.images[val];
|
||||
this.images[val - 1].fileAnnotationStatus = '2';
|
||||
this.itemIndex = val;
|
||||
this.updateTaskData(item);
|
||||
const item = this.images[val]
|
||||
this.images[val - 1].fileAnnotationStatus = '2'
|
||||
this.itemIndex = val
|
||||
this.updateTaskData(item)
|
||||
},
|
||||
|
||||
// 加载未标注的任务列表
|
||||
loadTaskList() {
|
||||
getMyNoAnnotatedTask().then(res => {
|
||||
this.taskList = res.data;
|
||||
});
|
||||
this.taskList = res.data
|
||||
this.taskId = Number(this.$route.params && this.$route.params.taskId);
|
||||
})
|
||||
},
|
||||
|
||||
// 根据任务ID选择审核并加载对应的文件
|
||||
// 根据任务ID选择任务并加载对应的文件
|
||||
selectTask(id) {
|
||||
this.resetImages()
|
||||
const result = this.taskList.find(item => item.taskId === id)
|
||||
console.log(result)
|
||||
const labels = result.labels.split(',').map(role => role.trim())
|
||||
const labelElements = labels
|
||||
.map((label, index) => `<Label value="${label}" background="${this.getColor(index)}"/>`)
|
||||
|
|
@ -174,55 +180,54 @@ export default {
|
|||
},
|
||||
getColor(index) {
|
||||
const randomColor = () => {
|
||||
const r = Math.floor(Math.random() * 256); // 0-255
|
||||
const g = Math.floor(Math.random() * 256); // 0-255
|
||||
const b = Math.floor(Math.random() * 256); // 0-255
|
||||
return `rgb(${r}, ${g}, ${b})`;
|
||||
};
|
||||
return randomColor();
|
||||
const r = Math.floor(Math.random() * 256) // 0-255
|
||||
const g = Math.floor(Math.random() * 256) // 0-255
|
||||
const b = Math.floor(Math.random() * 256) // 0-255
|
||||
return `rgb(${r}, ${g}, ${b})`
|
||||
}
|
||||
return randomColor()
|
||||
},
|
||||
|
||||
// 切换标注类型并加载任务文件
|
||||
toggleSelected(type) {
|
||||
if (this.annotationType === type) return;
|
||||
this.annotationType = type;
|
||||
this.resetImages();
|
||||
this.fetchImages();
|
||||
if (this.annotationType === type) return
|
||||
this.annotationType = type
|
||||
this.resetImages()
|
||||
this.fetchImages()
|
||||
},
|
||||
|
||||
// 设置标注项,更新任务数据和标注结果
|
||||
setItem(item, index) {
|
||||
console.log(item)
|
||||
this.annotationResult = JSON.parse(item.annotationResult);
|
||||
this.itemIndex = index;
|
||||
this.updateTaskData(item);
|
||||
this.annotationResult = JSON.parse(item.annotationResult)
|
||||
this.itemIndex = index
|
||||
this.updateTaskData(item)
|
||||
},
|
||||
|
||||
// 重置图像数据
|
||||
resetImages() {
|
||||
this.images = [];
|
||||
this.images = []
|
||||
//this.annotationType = 0;
|
||||
},
|
||||
|
||||
// 获取当前任务ID审核注类型的图像数据
|
||||
fetchImages() {
|
||||
if (!this.taskId) return;
|
||||
if (!this.taskId) return
|
||||
getMyAuditFiles(this.annotationType, this.taskId).then(response => {
|
||||
console.log(response)
|
||||
this.itemIndex = 0;
|
||||
this.images = response.data;
|
||||
this.itemIndex = 0
|
||||
this.images = response.data
|
||||
this.updateTaskData(
|
||||
this.images[this.itemIndex]);
|
||||
});
|
||||
this.images[this.itemIndex])
|
||||
})
|
||||
},
|
||||
|
||||
// 更新任务的数据
|
||||
updateTaskData(item) {
|
||||
if (item !== undefined){
|
||||
let url = JSON.parse(localStorage.getItem('minIoUrl'))
|
||||
this.task.data.image = `${url.minioUrl}${item.fileUrl}`;
|
||||
this.task.id = item.fileId;
|
||||
this.annotationResult = JSON.parse(item.annotationResult);
|
||||
if (item !== undefined) {
|
||||
let url = JSON.parse(localStorage.getItem('minIoUrl'))
|
||||
this.task.data.image = `${url.minioUrl}${item.fileUrl}`
|
||||
this.task.id = item.fileId
|
||||
this.annotationResult = JSON.parse(item.annotationResult)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -410,7 +415,7 @@ export default {
|
|||
}
|
||||
}
|
||||
|
||||
.bottom-content-center {
|
||||
.bottom-content-center {
|
||||
width: 80%;
|
||||
padding: 5px;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:manager:add']"
|
||||
v-hasPermi="['mirror:manager:add']"
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:manager:edit']"
|
||||
v-hasPermi="['mirror:manager:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
|
|
@ -47,7 +47,7 @@
|
|||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:manager:remove']"
|
||||
v-hasPermi="['mirror:manager:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
|
|
@ -113,7 +113,7 @@
|
|||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:manager:edit']"
|
||||
v-hasPermi="['mirror:manager:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
|
|
@ -121,7 +121,7 @@
|
|||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:manager:remove']"
|
||||
v-hasPermi="['mirror:manager:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -85,7 +85,6 @@
|
|||
size="mini"
|
||||
type="text"
|
||||
@click="handleDownload(scope.row.modelPath,scope.row.modelFileName)"
|
||||
v-hasPermi="['model:manager:edit']"
|
||||
>下载
|
||||
</el-button>
|
||||
</template>
|
||||
|
|
@ -96,14 +95,12 @@
|
|||
size="mini"
|
||||
type="text"
|
||||
@click="handleDownload(scope.row.modelManual,scope.row.manualFileName)"
|
||||
v-hasPermi="['model:manager:edit']"
|
||||
>下载
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleSee(scope.row.modelManual)"
|
||||
v-hasPermi="['model:manager:remove']"
|
||||
>查看
|
||||
</el-button>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Reference in New Issue