annotate client/src/components/sections/SectionForm.vue @ 3297:0358bf723769

client: define sections: removed margin in form
author Markus Kottlaender <markus@intevation.de>
date Thu, 16 May 2019 16:27:28 +0200
parents 3ada3d0347bd
children 008bc1ae8897
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3290
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
1 <template>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
2 <div class="d-flex flex-column">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
3 <div class="d-flex justify-content-between mt-2 px-2">
3297
0358bf723769 client: define sections: removed margin in form
Markus Kottlaender <markus@intevation.de>
parents: 3290
diff changeset
4 <div class="text-left flex-fill">
3290
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
5 <small class="text-muted">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
6 <translate>ID</translate>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
7 </small>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
8 <input
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
9 id="id"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
10 type="text"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
11 class="form-control form-control-sm"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
12 placeholder="AT_Section_12"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
13 v-model="id"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
14 :disabled="editSection"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
15 />
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
16 <span class="text-left text-danger">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
17 <small v-if="errors.id && !id">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
18 <translate>Please enter an id</translate>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
19 </small>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
20 </span>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
21 </div>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
22 </div>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
23 <div class="d-flex justify-content-between mt-2 px-2">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
24 <div class="text-left flex-fill">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
25 <small class="text-muted">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
26 <translate>Start rhm</translate>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
27 </small>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
28 <div class="d-flex flex-row position-relative">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
29 <input
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
30 id="startrhm"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
31 type="text"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
32 class="form-control form-control-sm"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
33 placeholder="e.g. ATXXX000010000019900"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
34 v-model="startrhm"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
35 ref="startrhm"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
36 @focus="enablePipette('start')"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
37 @blur="disablePipette('start')"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
38 />
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
39 <span
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
40 class="input-group-text position-absolute input-button"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
41 @click="$refs.startrhm.focus()"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
42 v-tooltip="pipetteTooltip"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
43 >
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
44 <font-awesome-icon
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
45 :class="{ 'text-info': pipetteStart }"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
46 icon="crosshairs"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
47 />
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
48 </span>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
49 </div>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
50 <span class="text-left text-danger">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
51 <small v-if="errors.startrhm && !startrhm">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
52 <translate>Please enter a start point</translate>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
53 </small>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
54 </span>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
55 </div>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
56 <div class="text-left flex-fill ml-2">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
57 <small class="text-muted">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
58 <translate>End rhm</translate>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
59 </small>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
60 <div class="d-flex flex-row position-relative">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
61 <input
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
62 id="endrhm"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
63 type="text"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
64 class="form-control form-control-sm"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
65 placeholder="e.g. ATXXX000010000019900"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
66 v-model="endrhm"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
67 ref="endrhm"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
68 @focus="enablePipette('end')"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
69 @blur="disablePipette('end')"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
70 />
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
71 <span
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
72 class="input-group-text position-absolute input-button"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
73 @click="$refs.endrhm.focus()"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
74 v-tooltip="pipetteTooltip"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
75 >
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
76 <font-awesome-icon
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
77 :class="{ 'text-info': pipetteEnd }"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
78 icon="crosshairs"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
79 />
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
80 </span>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
81 </div>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
82 <span class="text-left text-danger">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
83 <small v-if="errors.endrhm && !endrhm">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
84 <translate>Please enter an end point</translate>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
85 </small>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
86 </span>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
87 </div>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
88 <div class="text-left ml-2" v-if="!editSection">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
89 <small class="text-muted">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
90 <translate>Tolerance for snapping to axis</translate>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
91 </small>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
92 <div class="d-flex flex-row position-relative">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
93 <input
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
94 class="form-control form-control-sm"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
95 v-model.number="tolerance"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
96 type="number"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
97 min="0"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
98 step="any"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
99 id="tolerance"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
100 />
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
101 <span class="input-group-text position-absolute input-button">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
102 m
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
103 </span>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
104 </div>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
105 <span class="text-left text-danger">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
106 <small v-if="errors.tolerance && !tolerance">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
107 <translate>Please enter a tolerance value</translate>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
108 </small>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
109 </span>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
110 </div>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
111 </div>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
112 <div class="d-flex flex-row justify-content-between px-2">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
113 <div class="mt-2 mr-2 w-50 text-left">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
114 <small class="text-muted">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
115 <translate>Object name</translate>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
116 </small>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
117 <input
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
118 id="objbn"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
119 type="text"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
120 class="form-control form-control-sm"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
121 placeholder=""
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
122 v-model="objbn"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
123 />
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
124 <span class="text-left text-danger">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
125 <small v-if="errors.objbn && !objbn">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
126 <translate>Please enter an objectname</translate>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
127 </small>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
128 </span>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
129 </div>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
130 <div class="mt-2 w-50 text-left">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
131 <small class="text-muted">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
132 <translate>National Object name</translate>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
133 </small>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
134 <input
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
135 id="nobjbn"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
136 type="text"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
137 class="form-control form-control-sm"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
138 v-model="nobjbn"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
139 />
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
140 </div>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
141 </div>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
142 <div class="d-flex flex-row justify-content-between px-2">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
143 <div class="mt-2 w-50 text-left">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
144 <small class="text-muted">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
145 <translate>Date info</translate>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
146 </small>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
147 <input
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
148 id="date_info"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
149 type="date"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
150 class="form-control form-control-sm"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
151 placeholder="date_info"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
152 v-model="date_info"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
153 />
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
154 <span class="text-left text-danger">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
155 <small v-if="errors.date_info && !date_info">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
156 <translate>Please enter a date</translate>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
157 </small>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
158 </span>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
159 </div>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
160 <div class="mt-2 ml-2 w-50 text-left">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
161 <small class="text-muted">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
162 <translate>Source Organization</translate>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
163 </small>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
164 <input
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
165 id="source_organization"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
166 type="text"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
167 class="form-control form-control-sm"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
168 v-model="source_organization"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
169 />
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
170 <span class="text-left text-danger">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
171 <small v-if="errors.source_organization && !source_organization">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
172 <translate>Please enter a source organization</translate>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
173 </small>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
174 </span>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
175 </div>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
176 </div>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
177 <div class="d-flex justify-content-between mt-2 p-2 border-top">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
178 <button @click="$parent.showForm = false" class="btn btn-sm btn-warning">
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
179 <translate>Back</translate>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
180 </button>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
181 <button
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
182 @click="save"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
183 type="submit"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
184 class="shadow-sm btn btn-sm btn-info submit-button"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
185 >
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
186 <translate>Submit</translate>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
187 </button>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
188 </div>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
189 </div>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
190 </template>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
191
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
192 <style lang="sass" scoped>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
193 .input-button
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
194 border-top-left-radius: 0
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
195 border-bottom-left-radius: 0
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
196 right: 0
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
197 height: 31px
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
198 </style>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
199
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
200 <script>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
201 /* This is Free Software under GNU Affero General Public License v >= 3.0
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
202 * without warranty, see README.md and license for details.
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
203 *
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
204 * SPDX-License-Identifier: AGPL-3.0-or-later
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
205 * License-Filename: LICENSES/AGPL-3.0.txt
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
206 *
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
207 * Copyright (C) 2018, 2019 by via donau
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
208 * – Österreichische Wasserstraßen-Gesellschaft mbH
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
209 * Software engineering by Intevation GmbH
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
210 *
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
211 * Author(s):
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
212 * Thomas Junk <thomas.junk@intevation.de>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
213 * Tom Gottfried <tom.gottfried@intevation.de>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
214 * Markus Kottländer <markus.kottlaender@intevation.de>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
215 */
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
216 import { mapState, mapGetters } from "vuex";
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
217 import { displayError, displayInfo } from "@/lib/errors";
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
218 import { sortTable } from "@/lib/mixins";
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
219
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
220 export default {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
221 mixins: [sortTable],
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
222 props: ["editSection"],
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
223 data() {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
224 return {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
225 pipetteStart: false,
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
226 pipetteEnd: false,
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
227 id: null,
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
228 startrhm: null,
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
229 endrhm: null,
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
230 tolerance: 5,
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
231 objbn: null,
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
232 nobjbn: null,
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
233 date_info: new Date().toISOString().split("T")[0],
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
234 source_organization: null,
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
235 errors: {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
236 id: false,
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
237 startrhm: false,
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
238 endrhm: false,
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
239 tolerance: false,
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
240 objbn: false,
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
241 nobjbn: false,
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
242 date_info: false,
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
243 source_organization: false
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
244 }
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
245 };
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
246 },
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
247 computed: {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
248 ...mapState("map", ["identifiedFeatures"]),
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
249 ...mapGetters("map", ["openLayersMap"]),
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
250 pipetteTooltip() {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
251 return this.$gettext("Choose a distance mark by clicking on the map.");
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
252 }
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
253 },
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
254 watch: {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
255 identifiedFeatures() {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
256 const distanceMark = this.identifiedFeatures.find(x =>
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
257 /^distance_marks_geoserver/.test(x["id_"])
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
258 );
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
259 if (distanceMark) {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
260 const location = distanceMark.get("location");
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
261 this.startrhm = this.pipetteStart ? location : this.startrhm;
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
262 this.endrhm = this.pipetteEnd ? location : this.endrhm;
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
263 this.pipetteStart = false;
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
264 this.pipetteEnd = false;
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
265 this.$store.commit("map/mapPopupEnabled", true);
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
266 }
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
267 }
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
268 },
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
269 methods: {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
270 enablePipette(t) {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
271 this.openLayersMap()
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
272 .getLayer("DISTANCEMARKSAXIS")
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
273 .setVisible(true);
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
274 this.$store.commit("map/mapPopupEnabled", false);
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
275 if (t === "start") {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
276 this.pipetteStart = true;
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
277 this.pipetteEnd = false;
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
278 } else {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
279 this.pipetteStart = false;
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
280 this.pipetteEnd = true;
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
281 }
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
282 },
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
283 disablePipette() {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
284 this.$store.commit("map/mapPopupEnabled", true);
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
285 this.pipetteStart = false;
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
286 this.pipetteEnd = false;
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
287 },
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
288 validate() {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
289 const fields = [
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
290 "id",
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
291 "startrhm",
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
292 "endrhm",
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
293 "objbn",
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
294 "date_info",
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
295 "source_organization"
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
296 ];
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
297 if (!this.editSection) fields.push("tolerance");
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
298 fields.forEach(field => {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
299 if (!this[field]) {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
300 this.errors[field] = true;
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
301 } else {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
302 this.errors[field] = false;
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
303 }
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
304 });
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
305
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
306 // return true if no errors
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
307 return !Object.values(this.errors).reduce((a, b) => a + b, 0);
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
308 },
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
309 save() {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
310 if (this.validate()) {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
311 const data = {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
312 name: this.id,
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
313 from: this.startrhm,
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
314 to: this.endrhm,
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
315 "source-organization": this.source_organization,
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
316 "date-info": this.date_info,
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
317 objnam: this.objbn,
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
318 nobjnam: this.nobjbn
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
319 };
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
320 if (!this.editSection) {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
321 data["tolerance"] = this.tolerance;
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
322 }
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
323 this.$parent.loading = true;
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
324 this.$store
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
325 .dispatch("imports/saveSection", data)
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
326 .then(() => {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
327 displayInfo({
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
328 title: this.$gettext("Import"),
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
329 message: this.$gettext("Starting import of section")
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
330 });
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
331 this.$store.dispatch("imports/loadSections").then(() => {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
332 this.$parent.loading = false;
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
333 this.$parent.showForm = false;
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
334 });
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
335 })
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
336 .catch(error => {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
337 const { status, data } = error.response;
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
338 displayError({
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
339 title: this.$gettext("Backend Error"),
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
340 message: `${status}: ${data.message || data}`
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
341 });
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
342 });
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
343 }
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
344 }
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
345 },
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
346 mounted() {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
347 if (this.editSection) {
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
348 const props = this.editSection.properties;
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
349 this.id = props.name;
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
350 this.startrhm = props.lower.replace(/[,()]/g, "");
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
351 this.endrhm = props.upper.replace(/[,()]/g, "");
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
352 this.tolerance = props.tolerance;
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
353 this.objbn = props.objnam;
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
354 this.nobjbn = props.nobjnam;
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
355 this.date_info = props.date_info.split("T")[0];
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
356 this.source_organization = props.source_organization;
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
357 }
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
358 }
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
359 };
3ada3d0347bd client: define sections: duplicated and adjusted code from stretches
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
360 </script>