Updated forms and some UI for new data structure

This commit is contained in:
Stefan Zermatten
2021-09-28 14:25:11 +02:00
parent b471d0c5cf
commit cb10b53a10
52 changed files with 304 additions and 301 deletions

View File

@@ -10,7 +10,7 @@
<div
class="text-no-wrap text-truncate"
>
<span v-if="model.amountResult < 0">+</span>
<span v-if="amount < 0">+</span>
{{ absoluteAmount }} {{ model.stat }}
<span v-if="typeof absoluteAmount === 'string' || absoluteAmount >= 0">
damage
@@ -25,11 +25,14 @@ import treeNodeViewMixin from '/imports/ui/properties/treeNodeViews/treeNodeView
export default {
mixins: [treeNodeViewMixin],
computed: {
amount(){
return this.model.amount && this.model.amount.value;
},
absoluteAmount(){
if (typeof this.model.amountResult === 'number'){
return Math.abs(this.model.amountResult);
if (typeof this.amount === 'number'){
return Math.abs(this.amount);
} else {
return this.model.amountResult;
return this.amount;
}
},
}

View File

@@ -11,7 +11,7 @@
<div
class="text-no-wrap text-truncate"
>
{{ model.amountResult }}
{{ model.amount && model.amount.value }}
{{ model.damageType }}<span
v-if="model.damageType !== 'healing'"
>&nbsp;damage</span>

View File

@@ -37,7 +37,8 @@ export default {
mixins: [treeNodeViewMixin],
computed: {
resolvedValue(){
return this.model.result !== undefined ? this.model.result : this.model.calculation;
return (this.model.amount && this.model.amount.value) !== undefined ?
this.model.amount.value : this.model.amount && this.model.amount.calculation;
},
effectIcon(){
let value = this.resolvedValue;