You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.5 KiB

4 years ago
4 years ago
4 years ago
  1. <template>
  2. <v-stepper-content step="1">
  3. <v-card>
  4. <v-card-text class="pa-0">
  5. <v-form v-model="valid">
  6. <h4 class="text-h6">Select a config template</h4>
  7. <p class="font-weight-regular body-1">
  8. You can select the template to create the auto-labeling configuration.
  9. </p>
  10. <v-select
  11. v-model="templateName"
  12. :items="templateNames"
  13. :rules="templateNameRules()"
  14. label="Select a config template"
  15. outlined
  16. />
  17. </v-form>
  18. </v-card-text>
  19. <v-card-actions class="pa-0">
  20. <v-spacer />
  21. <v-btn
  22. :disabled="!valid"
  23. color="primary"
  24. class="text-capitalize"
  25. @click="$emit('next')"
  26. >
  27. Next
  28. </v-btn>
  29. </v-card-actions>
  30. </v-card>
  31. </v-stepper-content>
  32. </template>
  33. <script lang="ts">
  34. import Vue from 'vue'
  35. import { templateNameRules } from '@/rules/index'
  36. export default Vue.extend({
  37. data() {
  38. return {
  39. templateName: null,
  40. templateNames: [] as string[],
  41. templateNameRules,
  42. valid: false
  43. }
  44. },
  45. computed: {
  46. projectId() {
  47. return this.$route.params.id
  48. }
  49. },
  50. watch: {
  51. async templateName(val) {
  52. const response = await this.$services.template.find(this.projectId, val)
  53. this.$emit('input', response.toObject())
  54. },
  55. },
  56. async created() {
  57. this.templateNames = await this.$services.template.list(this.projectId)
  58. }
  59. })
  60. </script>