feat: improve machine component hierarchy handling
This commit is contained in:
@@ -203,18 +203,7 @@
|
||||
Constructeur :
|
||||
{{ findComponentById(entry.composantId)?.constructeur?.name || findComponentById(entry.composantId)?.constructeurName || "—" }}
|
||||
</div>
|
||||
<div>
|
||||
Machines liées :
|
||||
{{ formatAssignmentList(getComponentMachineAssignments(findComponentById(entry.composantId))) || 'Aucune' }}
|
||||
</div>
|
||||
<div
|
||||
v-if="formatAssignmentList(getComponentMachineAssignments(findComponentById(entry.composantId)))"
|
||||
class="text-warning mt-1"
|
||||
>
|
||||
Ce composant est déjà lié à
|
||||
{{ formatAssignmentList(getComponentMachineAssignments(findComponentById(entry.composantId))) }}.
|
||||
La création ajoutera un nouveau lien.
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -321,20 +310,7 @@
|
||||
Constructeur :
|
||||
{{ findPieceById(entry.pieceId)?.constructeur?.name || findPieceById(entry.pieceId)?.constructeurName || "—" }}
|
||||
</div>
|
||||
<div>
|
||||
Machines liées :
|
||||
{{ formatAssignmentList(getPieceMachineAssignments(findPieceById(entry.pieceId))) || 'Aucune' }}
|
||||
</div>
|
||||
<div>
|
||||
Composants liés :
|
||||
{{ formatAssignmentList(getPieceComponentAssignments(findPieceById(entry.pieceId))) || 'Aucun' }}
|
||||
</div>
|
||||
<div
|
||||
v-if="formatAssignmentList(getPieceMachineAssignments(findPieceById(entry.pieceId))) || formatAssignmentList(getPieceComponentAssignments(findPieceById(entry.pieceId)))"
|
||||
class="text-warning mt-1"
|
||||
>
|
||||
Cette pièce dispose déjà de liaisons existantes. La création ajoutera un nouveau lien.
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1353,18 +1329,8 @@ const machinePreview = computed(() => {
|
||||
issues.push({ message: 'Sélectionner un composant pour chaque entrée.', kind: 'error', anchor: `component-group-${requirement.id}` })
|
||||
}
|
||||
|
||||
normalizedEntries.forEach((entrySummary) => {
|
||||
if (entrySummary.assignmentLabel) {
|
||||
issues.push({
|
||||
message: `Le composant "${entrySummary.title}" est déjà lié à ${entrySummary.assignmentLabel}.`,
|
||||
kind: 'warning',
|
||||
anchor: `component-group-${requirement.id}`,
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
const hasErrors = issues.some(issue => issue.kind === 'error')
|
||||
const hasWarnings = issues.some(issue => issue.kind === 'warning') || completed < entries.length
|
||||
const hasWarnings = completed < entries.length
|
||||
|
||||
const status = hasErrors
|
||||
? 'error'
|
||||
@@ -1441,25 +1407,8 @@ const machinePreview = computed(() => {
|
||||
issues.push({ message: 'Sélectionner une pièce pour chaque entrée.', kind: 'error', anchor: `piece-group-${requirement.id}` })
|
||||
}
|
||||
|
||||
normalizedEntries.forEach((entrySummary) => {
|
||||
if (entrySummary.machineAssignmentLabel) {
|
||||
issues.push({
|
||||
message: `La pièce "${entrySummary.title}" est déjà liée aux machines ${entrySummary.machineAssignmentLabel}.`,
|
||||
kind: 'warning',
|
||||
anchor: `piece-group-${requirement.id}`,
|
||||
})
|
||||
}
|
||||
if (entrySummary.componentAssignmentLabel) {
|
||||
issues.push({
|
||||
message: `La pièce "${entrySummary.title}" est déjà rattachée aux composants ${entrySummary.componentAssignmentLabel}.`,
|
||||
kind: 'warning',
|
||||
anchor: `piece-group-${requirement.id}`,
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
const hasErrors = issues.some(issue => issue.kind === 'error')
|
||||
const hasWarnings = issues.some(issue => issue.kind === 'warning') || completed < entries.length
|
||||
const hasWarnings = completed < entries.length
|
||||
|
||||
const status = hasErrors
|
||||
? 'error'
|
||||
|
||||
Reference in New Issue
Block a user