提交代码

This commit is contained in:
jiang 2024-12-15 17:55:50 +08:00
parent 4014e2918a
commit 57b395125d
5 changed files with 52 additions and 46 deletions

View File

@ -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>

View File

@ -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())

View File

@ -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;

View File

@ -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>

View File

@ -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>