Newer
Older
<template>
<div class="row">
<div class="col-md-12">
<div class="form-group row">
<label class="col-md-4 col-form-label">Minimal sequence size</label>
<div class="col-md-8">
<input
type="number"
class="form-control"
step="1"
v-model="minSequenceSize"
@input="updateValue($event.target.value, 'minSequenceSize')"
/>
</div>
</div>
<p v-if="minSequenceSize > 20" class="alert alert-warning">
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<div class="form-group row">
<label class="col-md-4 col-form-label">Prediction Model</label>
<div class="col-md-8">
<select class="form-control" v-model="selectedModel">
<option value="model1">Model 1</option>
<option value="model2">Model 2</option>
</select>
</div>
</div>
<div>
<div class="form-group row">
<label class="col-md-4 col-form-label">Score GC</label>
<div class="col-md-8">
<input
type="number"
class="form-control"
step="0.1"
min="0.1"
v-model="score_gc"
@input="updateValue($event.target.value, 'score_gc')"
/>
</div>
</div>
<div class="form-group row">
<label class="col-md-4 col-form-label">Score GT/AC</label>
<div class="col-md-8">
<input
type="number"
class="form-control"
v-model="score_gtac"
step="0.1"
min="0.1"
@input="updateValue($event.target.value, 'score_gtac')"
/>
</div>
</div>
<div class="form-group row">
<label class="col-md-4 col-form-label">Score AT</label>
<div class="col-md-8">
<input
type="number"
class="form-control"
step="0.1"
min="0.1"
v-model="score_at"
@input="updateValue($event.target.value, 'score_at')"
/>
</div>
</div>
<div class="form-group row">
<label class="col-md-4 col-form-label">Score Others</label>
<div class="col-md-8">
<input
type="number"
class="form-control"
step="0.1"
min="0"
v-model="score_oth"
@input="updateValue($event.target.value, 'score_oth')"
/>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-md-4 col-form-label">Threshold</label>
<div class="col-md-8">
<input
type="number"
class="form-control"
step="0.1"
v-model="threshold"
@input="updateValue($event.target.value, 'threshold')"
/>
</div>
</div>
<div class="alert alert-danger" v-if="$v.$anyError">
<div v-if="!$v.minSequenceSize.required">Minimal sequence size is required.</div>
<div v-if="!$v.minSequenceSize.numeric">Minimal sequence size must be numeric.</div>
<div v-if="!$v.minSequenceSize.minValue">Minimal length of sequence is {{ $v.minSequenceSize.$params.minValue.min }}.</div>
<div v-if="!$v.threshold.required">Threshold is required.</div>
<div v-if="!$v.threshold.decimal">Threshold must be decimal number.</div>
<div v-if="!$v.threshold.minValue">Minimal value of threshold is {{ $v.threshold.$params.minValue.min }}.</div>
</div>
<div class="text-right">
<slot name="additionalButtons"></slot>
</div>
</div>
</div>
</template>
<script>
import { required, numeric, minValue, decimal } from 'vuelidate/lib/validators'
export default {
default: 1
},
score_gc: {
type: [Number, String],
default: 25
},
score_gtac: {
type: [Number, String],
default: 3
},
score_at: {
type: [Number, String],
default: 3
},
score_oth: {
type: [Number, String],
default: 0
}
},
data() {
return {
selectedModel: 'model1',
this.minSequenceSize = Number(this.minSequenceSize);
this.threshold = Number(this.threshold);
this.score_gc = Number(this.score_gc);
this.score_gtac = Number(this.score_gtac);
this.score_at = Number(this.score_at);
this.score_oth = Number(this.score_oth);
validations: {
minSequenceSize: {
required,
numeric,
minValue: minValue(6)
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
score_gc: {
required,
decimal,
minValue: minValue(0.1)
},
score_gtac: {
required,
decimal,
minValue: minValue(0.1)
},
score_at: {
required,
decimal,
minValue: minValue(0.1)
},
score_oth: {
required,
decimal,
minValue: minValue(0)
}
},
watch: {
selectedModel(newModel) {
if (newModel === 'model1') {
this.score_gc = 25;
this.updateValue(25, 'score_gc')
this.score_gtac = 3;
this.updateValue(3, 'score_gtac')
this.score_at = 3;
this.updateValue(3, 'score_at')
this.score_oth = 0;
this.updateValue(0, 'score_oth')
} else if (newModel === 'model2') {
this.score_gc = 1;
this.updateValue(1, 'score_gc')
this.score_gtac = 0.5;
this.updateValue(0.5, 'score_gtac')
this.score_at = 0.25;
this.updateValue(0.25, 'score_at')
this.score_oth = 0;
this.updateValue(0, 'score_oth')
}
},