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