Browse Source

1.1.1:

4IM: Anpassung Fehlende Teile und Bonusteil
tags/v1.1.1
akimmig 1 year ago
parent
commit
1cc28cb926
3 changed files with 28 additions and 6 deletions
  1. +1
    -1
      client/package.json
  2. +26
    -4
      client/src/views/components/event/event.vue
  3. +1
    -1
      server/package.json

+ 1
- 1
client/package.json View File

@@ -1,6 +1,6 @@
{
"name": "schoolINmotion-client",
"version": "1.0.1",
"version": "1.1.1",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",

+ 26
- 4
client/src/views/components/event/event.vue View File

@@ -448,9 +448,20 @@
:title="g.apparatus.name"
color="rgb(150,150,150)"
>
<v-checkbox
<!--v-checkbox
v-model="results(g._apparatus).teile"
:label="`Teile OK? (max ${g.elements}, Malus +${g.malus}s)`"
/-->
<v-text-field
type="number"
min="0"
max="3"
v-model="results(g._apparatus).fehler"
:label="`fehlende oder fehlerhafte Teile (Malus jeweils +${g.malus}s)`"
/>
<v-checkbox
v-model="results(g._apparatus).bonusteil"
:label="`Bonusteil? (Bonus -${g.bonus}s)`"
/>
<v-checkbox
v-model="results(g._apparatus).bonus"
@@ -600,7 +611,7 @@ import gql from 'graphql-tag'
import moment from 'moment'
import { generateUrkunde } from '@/urkunde'

const timeslotquery = '_id time duration team { _id name } result { bonus runtime calctime results { _id teile bonus wechsel } }'
const timeslotquery = '_id time duration team { _id name } result { bonus runtime calctime results { _id teile bonus wechsel bonusteil fehler } }'
const query = `_id name date _organizer organizer { name } apparatus { _apparatus apparatus { name logo } elements bonus malus } timeslots { ${timeslotquery} }`

export default {
@@ -747,12 +758,18 @@ export default {
bonus () {
return this.apparatus.reduce((acc, curr) => {
if (this.results(curr._apparatus).bonus) acc += parseInt(curr.bonus)
if (this.results(curr._apparatus).bonusteil) acc += parseInt(curr.bonus)
return acc
}, 0)
},
malus () {
return this.apparatus.reduce((acc, curr, i, arr) => {
if (!this.results(curr._apparatus).teile) acc += parseInt(curr.malus)

const f = parseInt(this.results(curr._apparatus).fehler)
if (!!f && !isNaN(f)) {
acc += f * parseInt(curr.malus)
}
if (i !== arr.length - 1 && !this.results(curr._apparatus).wechsel) acc += parseInt(curr.malus)
return acc
}, 0)
@@ -921,7 +938,9 @@ export default {
const ret = {
_id: a._apparatus,
teile: data?.teile !== undefined ? data.teile : true,
bonus: data?.bonus !== undefined ? data.bonus : false
bonus: data?.bonus !== undefined ? data.bonus : false,
bonusteil: data?.bonusteil !== undefined ? data.bonusteil : false,
fehler: data?.fehler || 0
}
if (i !== arr.length - 1) {
ret.wechsel = data?.wechsel !== undefined ? data.wechsel : true
@@ -973,7 +992,10 @@ export default {
runtime: Math.round((this.result.time) * 100) / 100,
bonus: this.bonusmalus,
calctime: Math.round((this.result.time + this.bonusmalus) * 100) / 100,
results: this.result.results
results: this.result.results?.map(r => ({
...r,
fehler: parseInt(r.fehler)
})) || []
}
}


+ 1
- 1
server/package.json View File

@@ -1,6 +1,6 @@
{
"name": "schoolINmotion-server",
"version": "1.0.1",
"version": "1.1.1",
"description": "",
"author": "",
"private": true,

Loading…
Cancel
Save