Features.vue 1.67 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<template>
<v-container grid-list-md>
  <v-layout row wrap>
    <v-flex xs12>
      <h3>{{header}}</h3>
    </v-flex>

    <v-flex xs12>
      <v-select
        v-bind:items="letters"
        v-model="e1"
        label="Select"
        single-line
        bottom
        prepend-icon="local_post_office"
        ></v-select>
    </v-flex>

    <v-flex xs12 sm4>
      <v-text-field v-model="feature_category" type="text" label="Category"></v-text-field>
    </v-flex>
    <v-flex xs12 sm4>
      <v-text-field v-model="feature_type" type="text" label="Type"></v-text-field>
    </v-flex>
    <v-flex xs12 sm4>
      <v-text-field v-model="feature_subtype" type="text" label="Subtype"></v-text-field>
    </v-flex>

    <v-flex xs12>
      <v-btn @click="validate" color="blue darken-4" class="white--text">Search</v-btn>
      <v-btn @click="clear" color="blue darken-4" class="white--text">Clear</v-btn>
    </v-flex>

    <!-- Progress Bar -->
    <v-flex xs12 v-if="searching">
      <v-progress-linear indeterminate color="primary"></v-progress-linear>
    </v-flex>

  </v-layout>
 </v-container>
</template>

<script>
export default {
  data () {
    return {
      header: 'Feature Search',
      searching: false,
      feature_category: null,
      feature_type: null,
      feature_subtype: null,
      letters: [
        { text: 'All' }
      ]
    }
  },
  methods: {
    clear () {
      this.feature_category = null
      this.feature_type = null
      this.feature_subtype = null
    }
  },
  created () {
    this.$http.get('http://localhost:3000/api/letters').then(function (data) {
      for (var value of data.body) {
        this.letters.push({text: value.name})
      }
    })
  }
}
</script>