@lancom/shared 0.0.338 → 0.0.340
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.
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
class="EditorLayersGroup__header">
|
|
49
49
|
<div>
|
|
50
50
|
<h5 class="lc_h5">
|
|
51
|
-
{{ group.printArea.name }} ({{ group.layers.length }})
|
|
51
|
+
{{ group.printArea.name }} | {{ group.printArea.printSize.name }} ({{ group.layers.length }})
|
|
52
52
|
</h5>
|
|
53
53
|
<div class="lc_caption">{{ group.printArea.side }}</div>
|
|
54
54
|
</div>
|
|
@@ -146,11 +146,19 @@ export default {
|
|
|
146
146
|
if (!selected || !selected.editableDetails) {
|
|
147
147
|
this.setEditModeSelectedLayer(false);
|
|
148
148
|
}
|
|
149
|
+
if (selected) {
|
|
150
|
+
this.openSelectedLayerGroup(selected);
|
|
151
|
+
}
|
|
149
152
|
},
|
|
150
153
|
editableSide() {
|
|
151
154
|
this.setEditModeSelectedLayer(false);
|
|
152
155
|
}
|
|
153
156
|
},
|
|
157
|
+
mounted() {
|
|
158
|
+
if (this.selectedLayer) {
|
|
159
|
+
this.openSelectedLayerGroup(this.selectedLayer);
|
|
160
|
+
}
|
|
161
|
+
},
|
|
154
162
|
methods: {
|
|
155
163
|
...mapMutations([
|
|
156
164
|
'setSelectedLayer',
|
|
@@ -164,8 +172,14 @@ export default {
|
|
|
164
172
|
'setEditablePrintArea'
|
|
165
173
|
]),
|
|
166
174
|
...mapActions(['increaseLayersUpdatesCount']),
|
|
167
|
-
|
|
168
|
-
|
|
175
|
+
openSelectedLayerGroup(selected) {
|
|
176
|
+
const group = this.editableLayersGroups.find(g => g.layers?.includes(selected));
|
|
177
|
+
if (group?.printArea) {
|
|
178
|
+
this.toggleOpenedGroup(group?.printArea, true);
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
toggleOpenedGroup(printArea, foreOpen) {
|
|
182
|
+
this.openedGroup = (printArea?._id === this.openedGroup && !foreOpen) ? null : printArea?._id;
|
|
169
183
|
if (printArea) {
|
|
170
184
|
if (this.editableSide.id !== printArea.side) {
|
|
171
185
|
this.setEditableSide({ id: printArea.side });
|
|
@@ -63,16 +63,19 @@ export default {
|
|
|
63
63
|
});
|
|
64
64
|
const productsOptions = (this.product.printAreas || [])
|
|
65
65
|
.map(printArea => {
|
|
66
|
-
const mainOption = { ...groupItemToOption(printArea), sides: [printArea.side] };
|
|
67
66
|
const suboptions = [
|
|
68
|
-
|
|
67
|
+
{ ...groupItemToOption(printArea), sides: [printArea.side] },
|
|
69
68
|
...(printArea.sizes || []).map(i => ({ ...groupItemToOption({ ...i, side: printArea.side, parentPrintArea: printArea._id }), sides: [printArea.side] }))
|
|
70
|
-
]
|
|
69
|
+
]
|
|
70
|
+
.filter(s => !this.product.printAreasDisabled?.includes(s.printArea?._id));
|
|
71
|
+
// console.log('suboptions: ', suboptions);
|
|
71
72
|
return {
|
|
72
|
-
...(suboptions.find(s => s.printArea?._id === this.selected || this.hasPrintAreaLayers(s.printArea)) ||
|
|
73
|
+
...(suboptions.find(s => s.printArea?._id === this.selected || this.hasPrintAreaLayers(s.printArea)) || suboptions[0] || {}),
|
|
73
74
|
suboptions
|
|
74
75
|
};
|
|
75
|
-
})
|
|
76
|
+
})
|
|
77
|
+
.filter(pa => !!pa.printArea?._id);
|
|
78
|
+
// console.log('productsOptions: ', productsOptions);
|
|
76
79
|
const options = productsOptions.filter(({ sides }) => sides.includes(this.side));
|
|
77
80
|
return this.allowNoPrint ? [...options, { label: 'No Print' }] : options;
|
|
78
81
|
}
|