Browse Source

Update FormDelete.vue to show filename

pull/1370/head
Hironsan 3 years ago
parent
commit
815e1399b5
3 changed files with 18 additions and 3 deletions
  1. 6
      frontend/components/document/FormDelete.vue
  2. 2
      frontend/domain/models/project/project.ts
  3. 13
      frontend/pages/projects/_id/dataset/index.vue

6
frontend/components/document/FormDelete.vue

@ -3,7 +3,7 @@
:items="selected"
:title="$t('dataset.deleteDocumentsTitle')"
:message="$t('dataset.deleteDocumentsMessage')"
item-key="text"
:item-key="itemKey"
@ok="$emit('remove')"
@cancel="$emit('cancel')"
/>
@ -22,6 +22,10 @@ export default Vue.extend({
selected: {
type: Array,
default: () => []
},
itemKey: {
type: String,
default: 'text'
}
}
})

2
frontend/domain/models/project/project.ts

@ -4,7 +4,7 @@ export interface CurrentUsersRole {
is_annotation_approver: boolean;
}
export type ProjectType = 'DocumentClassification' | 'SequenceLabeling' | 'Seq2seq'
export type ProjectType = 'DocumentClassification' | 'SequenceLabeling' | 'Seq2seq' | 'ImageClassification'
export class ProjectReadItem {

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

@ -25,6 +25,7 @@
<v-dialog v-model="dialogDelete">
<form-delete
:selected="selected"
:item-key="itemKey"
@cancel="dialogDelete=false"
@remove="remove"
/>
@ -42,7 +43,7 @@
</v-dialog>
</v-card-title>
<image-list
v-if="project.projectType === 'ImageClassification'"
v-if="isImageTask"
v-model="selected"
:items="item.items"
:is-loading="isLoading"
@ -110,6 +111,16 @@ export default Vue.extend({
},
projectId(): string {
return this.$route.params.id
},
isImageTask(): boolean {
return this.project.projectType === 'ImageClassification'
},
itemKey(): string {
if (this.isImageTask) {
return 'filename'
} else {
return 'text'
}
}
},

Loading…
Cancel
Save