Browse Source

Add fields to project model

pull/2199/head
Hironsan 1 year ago
parent
commit
6e45f69e9b
2 changed files with 13 additions and 12 deletions
  1. 10
      frontend/domain/models/project/project.ts
  2. 15
      frontend/pages/projects/_id/dataset/index.vue

10
frontend/domain/models/project/project.ts

@ -138,4 +138,14 @@ export class Project {
}
return `${this.projectType}Project`
}
get isImageProject(): boolean {
return [ImageClassification, ImageCaptioning, BoundingBox, Segmentation].includes(
this.projectType
)
}
get isAudioProject(): boolean {
return [Speech2text].includes(this.projectType)
}
}

15
frontend/pages/projects/_id/dataset/index.vue

@ -35,7 +35,7 @@
</v-dialog>
</v-card-title>
<image-list
v-if="isImageTask"
v-if="project.isImageProject"
v-model="selected"
:items="item.items"
:is-loading="isLoading"
@ -44,7 +44,7 @@
@click:labeling="movePage"
/>
<audio-list
v-else-if="isAudioTask"
v-else-if="project.isAudioProject"
v-model="selected"
:items="item.items"
:is-loading="isLoading"
@ -122,17 +122,8 @@ export default Vue.extend({
return this.$route.params.id
},
isImageTask(): boolean {
const imageTasks = ['ImageClassification', 'ImageCaptioning', 'BoundingBox', 'Segmentation']
return imageTasks.includes(this.project.projectType)
},
isAudioTask(): boolean {
return this.project.projectType === 'Speech2text'
},
itemKey(): string {
if (this.isImageTask || this.isAudioTask) {
if (this.project.isImageProject || this.project.isAudioProject) {
return 'filename'
} else {
return 'text'

Loading…
Cancel
Save