LLEdit.vue 3.78 KB
Newer Older
Andrzej Obracaj's avatar
Andrzej Obracaj committed
1
<template>
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
2
  <l-modal :showing="showing" text="Observations" icon="edit" color="bg-orange-500" @close="close">
Andrzej Obracaj's avatar
Andrzej Obracaj committed
3
4
5
    <div class="w-full text-xs" v-if="editObj.id">
      <div class="w-full flex mb-4">
        <div class="w-1/3 mr-2">
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
6
7
          <b>Id</b>
          <br />
Andrzej Obracaj's avatar
bug    
Andrzej Obracaj committed
8
          <l-input placeholder="Id" v-model="editObj.id" inputClass="text-2xs" :disabled="true"></l-input>
Andrzej Obracaj's avatar
Andrzej Obracaj committed
9
10
        </div>
        <div class="w-2/3">
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
11
12
13
14
15
16
17
          <b>Sampling Point ID</b>
          <br />
          <l-input
            placeholder="sampling_point_id"
            v-model="editObj.sampling_point_id"
            inputClass="text-2xs"
          ></l-input>
Andrzej Obracaj's avatar
Andrzej Obracaj committed
18
19
        </div>
      </div>
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
20

Andrzej Obracaj's avatar
Andrzej Obracaj committed
21
22
      <div class="w-full flex mb-4">
        <div class="w-1/3 mr-2">
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
23
24
25
26
          <b>Begin Position</b>
          <br />
          <l-input
            placeholder="begin_position"
Andrzej Obracaj's avatar
bug    
Andrzej Obracaj committed
27
            v-model="editObj.begin_position"
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
28
29
            inputClass="text-2xs"
          ></l-input>
Andrzej Obracaj's avatar
Andrzej Obracaj committed
30
31
        </div>
        <div class="w-2/3">
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
32
33
          <b>End Position</b>
          <br />
Andrzej Obracaj's avatar
Andrzej Obracaj committed
34
35
36
          <l-input placeholder="end_position" v-model="editObj.end_position" inputClass="text-2xs"></l-input>
        </div>
      </div>
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
37
      <div class="w-full flex mb-4">
Andrzej Obracaj's avatar
Andrzej Obracaj committed
38
        <div class="w-1/3 mr-2">
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
39
40
          <b>Value</b>
          <br />
Andrzej Obracaj's avatar
bug    
Andrzej Obracaj committed
41
          <l-input placeholder="value" v-model="editObj.value" inputClass="text-2xs"></l-input>
Andrzej Obracaj's avatar
Andrzej Obracaj committed
42
43
        </div>
        <div class="w-2/3">
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
44
45
46
47
48
49
50
          <b>Verification Flag</b>
          <br />
          <l-input
            placeholder="verification_flag"
            v-model="editObj.verification_flag"
            inputClass="text-2xs"
          ></l-input>
Andrzej Obracaj's avatar
Andrzej Obracaj committed
51
52
        </div>
      </div>
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
53
      <div class="w-full flex mb-4">
Andrzej Obracaj's avatar
Andrzej Obracaj committed
54
        <div class="w-1/3 mr-2">
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
55
56
57
58
          <b>Validation Flag</b>
          <br />
          <l-input
            placeholder="validation_flag"
Andrzej Obracaj's avatar
bug    
Andrzej Obracaj committed
59
            v-model="editObj.validation_flag"
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
60
61
            inputClass="text-2xs"
          ></l-input>
Andrzej Obracaj's avatar
Andrzej Obracaj committed
62
63
        </div>
        <div class="w-2/3">
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
64
65
          <b>Touched</b>
          <br />
Andrzej Obracaj's avatar
Andrzej Obracaj committed
66
67
68
          <l-input placeholder="touched" v-model="editObj.touched" inputClass="text-2xs"></l-input>
        </div>
      </div>
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
69
      <div class="w-full flex mb-4">
Andrzej Obracaj's avatar
Andrzej Obracaj committed
70
        <div class="w-1/3 mr-2">
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
71
72
          <b>Concentration</b>
          <br />
Andrzej Obracaj's avatar
bug    
Andrzej Obracaj committed
73
          <l-input placeholder="concentration" v-model="editObj.concentration" inputClass="text-2xs"></l-input>
Andrzej Obracaj's avatar
Andrzej Obracaj committed
74
75
        </div>
        <div class="w-2/3">
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
76
77
          <b>Timestep</b>
          <br />
Andrzej Obracaj's avatar
Andrzej Obracaj committed
78
79
80
          <l-input placeholder="timestep" v-model="editObj.timestep" inputClass="text-2xs"></l-input>
        </div>
      </div>
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
81
      <div class="w-full flex mb-4">
Andrzej Obracaj's avatar
Andrzej Obracaj committed
82
        <div class="w-1/3 mr-2">
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
83
84
          <b>From Time</b>
          <br />
Andrzej Obracaj's avatar
bug    
Andrzej Obracaj committed
85
          <l-input placeholder="from_time" v-model="editObj.from_time" inputClass="text-2xs"></l-input>
Andrzej Obracaj's avatar
Andrzej Obracaj committed
86
87
        </div>
        <div class="w-2/3">
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
88
89
          <b>To Time</b>
          <br />
Andrzej Obracaj's avatar
Andrzej Obracaj committed
90
91
92
          <l-input placeholder="to_time" v-model="editObj.to_time" inputClass="text-2xs"></l-input>
        </div>
      </div>
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
93

Andrzej Obracaj's avatar
Andrzej Obracaj committed
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
      <div class="flex w-full justify-between">
        <l-button type="success" @click="onSave">Save changes</l-button>
        <l-button type="danger" @click="close">Cancel</l-button>
      </div>
    </div>
  </l-modal>
</template>

<script>
import LModal from "@/components/LModal";
import { LInput, LButton, LSelect, LOption } from "@/components/forms";

export default {
  name: "LLEdit",
  props: ["showing", "observations", "selected"],
  components: {
    LModal,
    LInput,
    LButton,
    LSelect,
    LOption
  },
  computed: {
    editObj: function() {
118
      // debugger;
Andrzej Obracaj's avatar
Andrzej Obracaj committed
119
120
121
      return Object.assign({}, this.selected);
    }
  },
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
122
  methods: {
Andrzej Obracaj's avatar
Andrzej Obracaj committed
123
124
125
126
    close() {
      this.$emit("close");
    },
    onSave() {
127
      // debugger;
Andrzej Obracaj's avatar
Andrzej Obracaj committed
128
129
130
131
132
133
134

      this.$emit("save", this.editObj);
      this.close();
    }
  }
};
</script>