Merge remote-tracking branch 'origin/feature/frontend-optimization' into dev
This commit is contained in:
commit
b708af177f
1 changed files with 105 additions and 1 deletions
|
|
@ -107,6 +107,27 @@
|
||||||
<modal :z-index="2000" :state="modalShow">
|
<modal :z-index="2000" :state="modalShow">
|
||||||
<div class="modal-content-container">
|
<div class="modal-content-container">
|
||||||
<h3 class="sub-header">{{ modalTitle }}</h3>
|
<h3 class="sub-header">{{ modalTitle }}</h3>
|
||||||
|
|
||||||
|
<!-- Part Number Chips -->
|
||||||
|
<div v-if="shouldShowPartNumbers" class="parts-selection-container">
|
||||||
|
<div class="parts-chips">
|
||||||
|
<basic-badge
|
||||||
|
v-for="partNumber in selectedPartNumbers.slice(0, 5)"
|
||||||
|
:key="partNumber"
|
||||||
|
variant="primary"
|
||||||
|
size="compact"
|
||||||
|
class="part-chip"
|
||||||
|
>
|
||||||
|
{{ partNumber }}
|
||||||
|
</basic-badge>
|
||||||
|
<span v-if="selectedPartNumbers.length > 5" class="parts-ellipsis">...</span>
|
||||||
|
</div>
|
||||||
|
<div v-if="partNumberCountText" class="parts-count">
|
||||||
|
{{ partNumberCountText }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- END: Part Number Chips -->
|
||||||
|
|
||||||
<component
|
<component
|
||||||
:is="modalComponentType"
|
:is="modalComponentType"
|
||||||
ref="modalComponent"
|
ref="modalComponent"
|
||||||
|
|
@ -176,6 +197,7 @@ import Modal from "@/components/UI/Modal.vue";
|
||||||
import PriceEdit from "@/components/layout/edit/PriceEdit.vue";
|
import PriceEdit from "@/components/layout/edit/PriceEdit.vue";
|
||||||
import MaterialEdit from "@/components/layout/edit/MaterialEdit.vue";
|
import MaterialEdit from "@/components/layout/edit/MaterialEdit.vue";
|
||||||
import PackagingEdit from "@/components/layout/edit/PackagingEdit.vue";
|
import PackagingEdit from "@/components/layout/edit/PackagingEdit.vue";
|
||||||
|
import BasicBadge from "@/components/UI/BasicBadge.vue";
|
||||||
|
|
||||||
import {useNotificationStore} from "@/store/notification.js";
|
import {useNotificationStore} from "@/store/notification.js";
|
||||||
import {useDestinationEditStore} from "@/store/destinationEdit.js";
|
import {useDestinationEditStore} from "@/store/destinationEdit.js";
|
||||||
|
|
@ -211,7 +233,8 @@ export default {
|
||||||
CalculationListItem,
|
CalculationListItem,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
BulkEditRow,
|
BulkEditRow,
|
||||||
BasicButton
|
BasicButton,
|
||||||
|
BasicBadge
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -286,6 +309,55 @@ export default {
|
||||||
return "Please wait. Prepare calculation ..."
|
return "Please wait. Prepare calculation ..."
|
||||||
|
|
||||||
return this.processingMessage;
|
return this.processingMessage;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extrahiert eindeutige Teilenummern aus ausgewählten Premises
|
||||||
|
* @returns {Array<string>} Array eindeutiger Teilenummern, sortiert
|
||||||
|
*/
|
||||||
|
selectedPartNumbers() {
|
||||||
|
// Guard: Keine editIds oder nicht relevant
|
||||||
|
if (!this.editIds || this.editIds.length === 0) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Nur für Material/Price/Packaging Modals anzeigen
|
||||||
|
const relevantTypes = ['material', 'price', 'packaging'];
|
||||||
|
if (!relevantTypes.includes(this.modalType)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Teilenummern extrahieren
|
||||||
|
const partNumbers = this.editIds
|
||||||
|
.map(id => {
|
||||||
|
const premise = this.premiseEditStore.getById(id);
|
||||||
|
return premise?.material?.part_number;
|
||||||
|
})
|
||||||
|
.filter(partNumber => partNumber != null && partNumber !== '');
|
||||||
|
|
||||||
|
// Duplikate entfernen und sortieren
|
||||||
|
return [...new Set(partNumbers)].sort();
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
logger.log('Error extracting part numbers:', error);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prüft ob Part Numbers angezeigt werden sollen
|
||||||
|
*/
|
||||||
|
shouldShowPartNumbers() {
|
||||||
|
return this.selectedPartNumbers.length > 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Anzahl-Text für viele Teile (> 5)
|
||||||
|
*/
|
||||||
|
partNumberCountText() {
|
||||||
|
const count = this.selectedPartNumbers.length;
|
||||||
|
return count > 5 ? `${count} part numbers` : null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
@ -630,6 +702,38 @@ export default {
|
||||||
margin-bottom: 1.6rem;
|
margin-bottom: 1.6rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Part Number Chips Styling */
|
||||||
|
.parts-selection-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0.4rem;
|
||||||
|
margin-bottom: 1.6rem;
|
||||||
|
padding-bottom: 1.6rem;
|
||||||
|
border-bottom: 0.1rem solid rgba(107, 134, 156, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.parts-chips {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 0.6rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.part-chip {
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.parts-ellipsis {
|
||||||
|
font-size: 1.4rem;
|
||||||
|
color: #6B869C;
|
||||||
|
align-self: center;
|
||||||
|
padding: 0 0.4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.parts-count {
|
||||||
|
font-size: 1.2rem;
|
||||||
|
color: #9CA3AF;
|
||||||
|
}
|
||||||
|
|
||||||
/* Global style für copy-mode cursor */
|
/* Global style für copy-mode cursor */
|
||||||
.edit-calculation-container.has-selection :deep(.edit-calculation-list-header-cell--copyable:hover) {
|
.edit-calculation-container.has-selection :deep(.edit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