@eturnity/eturnity_reusable_components 7.45.5-EPDM-12680.0 → 7.45.5-EPDM-12680.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
@@ -9,18 +9,18 @@
|
|
9
9
|
@click="toggleAllSections"
|
10
10
|
/>
|
11
11
|
</PageTitleContainer>
|
12
|
-
<SectionContainer v-for="item in dataList" :key="item.
|
12
|
+
<SectionContainer v-for="item in dataList" :key="item.inverterId">
|
13
13
|
<TitleContainer>
|
14
|
-
<IconWrapper size="20px" @click="toggleSection(item.
|
14
|
+
<IconWrapper size="20px" @click="toggleSection(item.inverterId)">
|
15
15
|
<RCIcon
|
16
16
|
color="white"
|
17
|
-
:name="isExpanded(item.
|
17
|
+
:name="isExpanded(item.inverterId) ? 'arrow_up' : 'arrow_down'"
|
18
18
|
size="10px"
|
19
19
|
/>
|
20
20
|
</IconWrapper>
|
21
21
|
<TextContainer>
|
22
|
-
<TitleText>{{ item.
|
23
|
-
<TitleSubText>{{ item.
|
22
|
+
<TitleText :title="item.model">{{ item.model }}</TitleText>
|
23
|
+
<TitleSubText>{{ item.brandName }}</TitleSubText>
|
24
24
|
</TextContainer>
|
25
25
|
<IconsContainer>
|
26
26
|
<IconWrapper>
|
@@ -45,27 +45,27 @@
|
|
45
45
|
</IconsContainer>
|
46
46
|
</TitleContainer>
|
47
47
|
<MarkersContainer>
|
48
|
-
<MarkerItem
|
48
|
+
<MarkerItem>??%</MarkerItem>
|
49
49
|
<MarkerItem>{{
|
50
|
-
item.
|
50
|
+
item.hasTemplate ? 'Template!' : 'No Template!'
|
51
51
|
}}</MarkerItem>
|
52
52
|
<MarkerItem>
|
53
53
|
<RCIcon color="white" :name="getIconName(item.type)" size="14px" />
|
54
54
|
<div>{{ getTypeName(item.type) }}</div>
|
55
55
|
</MarkerItem>
|
56
|
-
<ContainerValue
|
56
|
+
<ContainerValue>? kWp</ContainerValue>
|
57
57
|
</MarkersContainer>
|
58
58
|
<BoxContainer
|
59
|
-
v-for="mppt in item.mppts"
|
60
|
-
v-show="isExpanded(item.
|
61
|
-
:key="mppt.
|
59
|
+
v-for="(mppt, index) in item.mppts"
|
60
|
+
v-show="isExpanded(item.inverterId)"
|
61
|
+
:key="mppt.mpptId"
|
62
62
|
>
|
63
63
|
<BoxTitleWrapper>
|
64
|
-
<IconWrapper size="20px" @click="toggleMppt(mppt.
|
64
|
+
<IconWrapper size="20px" @click="toggleMppt(mppt.mpptId)">
|
65
65
|
<RCIcon
|
66
66
|
color="white"
|
67
67
|
cursor="pointer"
|
68
|
-
:name="isMpptExpanded(mppt.
|
68
|
+
:name="isMpptExpanded(mppt.mpptId) ? 'arrow_up' : 'arrow_down'"
|
69
69
|
size="10px"
|
70
70
|
/>
|
71
71
|
</IconWrapper>
|
@@ -78,7 +78,11 @@
|
|
78
78
|
name="string_design"
|
79
79
|
size="11px"
|
80
80
|
/>
|
81
|
-
<div>
|
81
|
+
<div>
|
82
|
+
{{ mppt.strings.length }}/{{
|
83
|
+
mppt.numberOfMppts ? mppt.numberOfMppts : 0
|
84
|
+
}}
|
85
|
+
</div>
|
82
86
|
</BoxIconWrapper>
|
83
87
|
<BoxIconWrapper>
|
84
88
|
<RCIcon
|
@@ -87,17 +91,21 @@
|
|
87
91
|
name="panels_tool"
|
88
92
|
size="11px"
|
89
93
|
/>
|
90
|
-
<div>{{ mppt.
|
94
|
+
<div>{{ getNumberOfMpptModules(mppt.strings) }}</div>
|
91
95
|
</BoxIconWrapper>
|
92
96
|
</BoxIconsContainer>
|
93
97
|
</BoxTitleWrapper>
|
94
|
-
<div v-show="isMpptExpanded(mppt.
|
95
|
-
<StringBox v-for="string in mppt.strings" :key="string.id">
|
96
|
-
<StringColorContainer
|
98
|
+
<div v-show="isMpptExpanded(mppt.mpptId)">
|
99
|
+
<StringBox v-for="(string, idx) in mppt.strings" :key="string.id">
|
100
|
+
<StringColorContainer
|
101
|
+
:background-color="
|
102
|
+
getStringColor(getGlobalStringIndex(item, mppt, idx))
|
103
|
+
"
|
104
|
+
/>
|
97
105
|
<StringContainer>
|
98
106
|
<div>{{ string.name }}</div>
|
99
107
|
<StringIconContainer>
|
100
|
-
<div>{{ string.
|
108
|
+
<div>{{ string.modules.length }}</div>
|
101
109
|
<RCIcon color="white" name="module" size="14px" />
|
102
110
|
</StringIconContainer>
|
103
111
|
</StringContainer>
|
@@ -144,6 +152,9 @@
|
|
144
152
|
|
145
153
|
const TitleText = styled.div`
|
146
154
|
font-size: 13px;
|
155
|
+
white-space: nowrap;
|
156
|
+
overflow: hidden;
|
157
|
+
text-overflow: ellipsis;
|
147
158
|
`
|
148
159
|
|
149
160
|
const TitleSubText = styled.div`
|
@@ -152,6 +163,7 @@
|
|
152
163
|
|
153
164
|
const MarkersContainer = styled.div`
|
154
165
|
display: flex;
|
166
|
+
flex-wrap: wrap;
|
155
167
|
gap: 8px;
|
156
168
|
margin: 8px 0 16px 30px;
|
157
169
|
align-items: end;
|
@@ -438,6 +450,50 @@
|
|
438
450
|
},
|
439
451
|
},
|
440
452
|
methods: {
|
453
|
+
getGlobalStringIndex(inverter, currentMppt, stringIdx) {
|
454
|
+
// This might need to be optimized, but let's see after we get real data
|
455
|
+
let globalIndex = 0
|
456
|
+
|
457
|
+
// Count strings in previous inverters
|
458
|
+
const inverterIndex = this.dataList.findIndex(
|
459
|
+
(inv) => inv.inverterId === inverter.inverterId
|
460
|
+
)
|
461
|
+
for (let i = 0; i < inverterIndex; i++) {
|
462
|
+
for (const mppt of this.dataList[i].mppts) {
|
463
|
+
globalIndex += mppt.strings.length
|
464
|
+
}
|
465
|
+
}
|
466
|
+
|
467
|
+
// Count strings in previous MPPTs of current inverter
|
468
|
+
const mpptIndex = inverter.mppts.findIndex(
|
469
|
+
(mppt) => mppt.mpptId === currentMppt.mpptId
|
470
|
+
)
|
471
|
+
for (let i = 0; i < mpptIndex; i++) {
|
472
|
+
globalIndex += inverter.mppts[i].strings.length
|
473
|
+
}
|
474
|
+
|
475
|
+
// Add current string index
|
476
|
+
return globalIndex + stringIdx
|
477
|
+
},
|
478
|
+
getNumberOfMpptModules(strings) {
|
479
|
+
return strings.reduce((acc, curr) => acc + curr.modules.length, 0)
|
480
|
+
},
|
481
|
+
getStringColor(idx) {
|
482
|
+
// ToDo: get correct colors
|
483
|
+
const colors = [
|
484
|
+
'#FF6B6B', // coral red
|
485
|
+
'#4ECDC4', // turquoise
|
486
|
+
'#45B7D1', // sky blue
|
487
|
+
'#96CEB4', // sage green
|
488
|
+
'#FFEEAD', // cream yellow
|
489
|
+
'#D4A5A5', // dusty rose
|
490
|
+
'#9B59B6', // purple
|
491
|
+
'#3498DB', // bright blue
|
492
|
+
'#E67E22', // orange
|
493
|
+
'#27AE60', // emerald green
|
494
|
+
]
|
495
|
+
return colors[idx]
|
496
|
+
},
|
441
497
|
isExpanded(id) {
|
442
498
|
return this.expandedInverters.includes(id)
|
443
499
|
},
|
@@ -465,9 +521,9 @@
|
|
465
521
|
this.expandedInverters = []
|
466
522
|
this.expandedMppts = []
|
467
523
|
} else {
|
468
|
-
this.expandedInverters = this.dataList.map((item) => item.
|
524
|
+
this.expandedInverters = this.dataList.map((item) => item.inverterId)
|
469
525
|
this.expandedMppts = this.dataList.flatMap((item) =>
|
470
|
-
item.mppts.map((mppt) => mppt.
|
526
|
+
item.mppts.map((mppt) => mppt.mpptId)
|
471
527
|
)
|
472
528
|
}
|
473
529
|
},
|