|
|
@@ -30,7 +30,7 @@ section.w-flex.column.pb5
|
|
30
|
30
|
p {{ tabContent[item].tab }}
|
|
31
|
31
|
SpiderChart(
|
|
32
|
32
|
:labels='aspects.map(label => label.name)'
|
|
33
|
|
- :profile-data='aspects.map(data => data.percentage * 10)'
|
|
|
33
|
+ :profile-data='profileScore'
|
|
34
|
34
|
:target-data='targetScore'
|
|
35
|
35
|
profile-name='lucy'
|
|
36
|
36
|
v-if='isTab'
|
|
|
@@ -62,6 +62,7 @@ section.w-flex.column.pb5
|
|
62
|
62
|
|
|
63
|
63
|
<script>
|
|
64
|
64
|
import SpiderChart from './SpiderChart.vue'
|
|
|
65
|
+import { currentProfile } from '../services'
|
|
65
|
66
|
|
|
66
|
67
|
export default {
|
|
67
|
68
|
components: { SpiderChart },
|
|
|
@@ -86,10 +87,19 @@ export default {
|
|
86
|
87
|
},
|
|
87
|
88
|
},
|
|
88
|
89
|
emits: ['tab-change'],
|
|
89
|
|
- data: () => ({
|
|
90
|
|
- // profileScore: [5.7, 5.2, 4.8, 5.2, 4.9, 4.9], // lucy
|
|
91
|
|
- targetScore: [5.3, 4.8, 5.7, 4.8, 5.6, 4.8], // Role
|
|
92
|
|
- }),
|
|
|
90
|
+ // data: () => ({
|
|
|
91
|
+ // profileScore: [5.7, 5.2, 4.8, 5.2, 4.9, 4.9], // lucy
|
|
|
92
|
+ // targetScore: [5.3, 4.8, 5.7, 4.8, 5.6, 4.8], // Role
|
|
|
93
|
+ // }),
|
|
|
94
|
+ computed: {
|
|
|
95
|
+ profileScore(){ // take from built up aspects object
|
|
|
96
|
+ return this.aspects.map(data => data.percentage * .1)
|
|
|
97
|
+ },
|
|
|
98
|
+ targetScore(){ // take directly from currentUser profile
|
|
|
99
|
+ let aspectResponses = currentProfile.responses.filter(r => [1,2,3,4,5,6].indexOf(r.response_key_id) !== -1)
|
|
|
100
|
+ return aspectResponses.map(r => r.val * .1)
|
|
|
101
|
+ }
|
|
|
102
|
+ },
|
|
93
|
103
|
methods: {
|
|
94
|
104
|
onTabChanged(tabs) {
|
|
95
|
105
|
this.$emit('tab-change', tabs)
|