智能标注服务管理页面和智能标注页面开发

This commit is contained in:
weiweiw 2024-12-17 15:46:35 +08:00
parent 7cca20599b
commit f72eec2a32
3 changed files with 37 additions and 13 deletions

View File

@ -52,7 +52,8 @@ export function autoAnnotate(data) {
return request({
url: '/ai/intelligentAnnotation/annotate',
method: 'post',
data:data
data:data,
timeout: 60000
})
}

View File

@ -234,6 +234,7 @@ export default {
},
handleDimension(row) {
this.aiOpen = true
this.taskId = row.taskId
},
handleAnnotation(row) {
this.$tab.openPage('数据标注', '/dataCenter/annotationTask/dataAnnotations/index/' + row.taskId)

View File

@ -85,19 +85,24 @@ export default {
visible: false,
loading: false,
form: {
learningType: 'active',
learningType: 'pre',
algorithmType: 'fast',
serviceList: ''
serviceId: '' // Initialize serviceId
},
serviceList:[],
showWarning: true,
currentRow: null
}
},
watch: {
isOpen(newVal) {
if (newVal) {
this.getServiceList()
if (this.serviceList.length > 0) {
console.log("this.form.serviceId = this.serviceList[0].serviceId")
this.form.serviceId = this.serviceList[0].serviceId
}
}
}
},
@ -111,19 +116,15 @@ export default {
async handleSubmit() {
try {
this.loading = true
autoAnnotate(this.taskId).then(response => {
const data = {taskId:this.taskId, intelligentAnnotationServiceId:this.form.serviceId}
autoAnnotate(data).then(response => {
console.log("response" + response.data)
this.serviceList = response.data
this.$message.success('智能标注成功')
})
// vuex action
// await this.$store.dispatch('annotation/submitAnnotation', {
// ...this.form,
// row: this.currentRow
// })
this.$message.success('提交成功')
this.cancel()
} catch (error) {
this.$message.error(error.message || '提交失败')
this.$message.error(error.message || '智能标注失败')
} finally {
this.loading = false
}
@ -136,8 +137,29 @@ export default {
},
//
reset() {
this.form = {} //
}
this.form = {
learningType: 'pre',
algorithmType: 'fast',
serviceList: ''
} //
},
change(value) {
// Implement any logic needed when the selection changes
console.log('Selected service ID:', value)
},
fetchServiceList() {
try {
// Assuming you have an API call to get the service list
this.getServiceList();
if (this.serviceList.length > 0) {
console.log("this.form.serviceId = this.serviceList[0].serviceId")
this.form.serviceId = this.serviceList[0].serviceId
}
} catch (error) {
console.error('Error fetching service list:', error)
this.$message.error('获取服务列表失败')
}
},
}
}
</script>