提交代码

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

View File

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

View File

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

View File

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

View File

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