浏览代码

1.1.1:

4IM: Anpassung Fehlende Teile und Bonusteil
tags/v1.1.1
akimmig 1年前
父节点
当前提交
1cc28cb926
共有 3 个文件被更改,包括 28 次插入6 次删除
  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 查看文件

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

+ 26
- 4
client/src/views/components/event/event.vue 查看文件

:title="g.apparatus.name" :title="g.apparatus.name"
color="rgb(150,150,150)" color="rgb(150,150,150)"
> >
<v-checkbox
<!--v-checkbox
v-model="results(g._apparatus).teile" v-model="results(g._apparatus).teile"
:label="`Teile OK? (max ${g.elements}, Malus +${g.malus}s)`" :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-checkbox
v-model="results(g._apparatus).bonus" v-model="results(g._apparatus).bonus"
import moment from 'moment' import moment from 'moment'
import { generateUrkunde } from '@/urkunde' 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} }` const query = `_id name date _organizer organizer { name } apparatus { _apparatus apparatus { name logo } elements bonus malus } timeslots { ${timeslotquery} }`


export default { export default {
bonus () { bonus () {
return this.apparatus.reduce((acc, curr) => { return this.apparatus.reduce((acc, curr) => {
if (this.results(curr._apparatus).bonus) acc += parseInt(curr.bonus) if (this.results(curr._apparatus).bonus) acc += parseInt(curr.bonus)
if (this.results(curr._apparatus).bonusteil) acc += parseInt(curr.bonus)
return acc return acc
}, 0) }, 0)
}, },
malus () { malus () {
return this.apparatus.reduce((acc, curr, i, arr) => { return this.apparatus.reduce((acc, curr, i, arr) => {
if (!this.results(curr._apparatus).teile) acc += parseInt(curr.malus) 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) if (i !== arr.length - 1 && !this.results(curr._apparatus).wechsel) acc += parseInt(curr.malus)
return acc return acc
}, 0) }, 0)
const ret = { const ret = {
_id: a._apparatus, _id: a._apparatus,
teile: data?.teile !== undefined ? data.teile : true, 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) { if (i !== arr.length - 1) {
ret.wechsel = data?.wechsel !== undefined ? data.wechsel : true ret.wechsel = data?.wechsel !== undefined ? data.wechsel : true
runtime: Math.round((this.result.time) * 100) / 100, runtime: Math.round((this.result.time) * 100) / 100,
bonus: this.bonusmalus, bonus: this.bonusmalus,
calctime: Math.round((this.result.time + this.bonusmalus) * 100) / 100, 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 查看文件

{ {
"name": "schoolINmotion-server", "name": "schoolINmotion-server",
"version": "1.0.1",
"version": "1.1.1",
"description": "", "description": "",
"author": "", "author": "",
"private": true, "private": true,

正在加载...
取消
保存