Skip to content

Commit

Permalink
fix hangup on logging, improve component details
Browse files Browse the repository at this point in the history
  • Loading branch information
phcreery committed Jun 18, 2023
1 parent 49a0a7c commit c609f78
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
14 changes: 9 additions & 5 deletions src/views/inventory/components/ComponentDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
<div class="block">
<!-- <span class="demonstration">Custom</span> -->
<div class="demo-image__preview">
<el-image :src="getFileUrl(props.rowData, props.rowData!.image)" :zoom-rate="1.2" fit="cover">
<el-image
:src="(props.rowData && props.rowData.image) ? getFileUrl(props.rowData, props.rowData!.image) : undefined"
:zoom-rate="1.2"
fit="cover"
>
<template #error>
<div class="image-slot">
<el-icon><icon-picture /></el-icon>
Expand All @@ -36,21 +40,21 @@
<el-descriptions-item v-if="props.enumMap" label="Footprint" label-align="right">
{{ enumRender("footprint", props.rowData?.footprint) }}
</el-descriptions-item>
<el-descriptions-item v-if="props.enumMap" label="Supplier" label-align="right">{{
<!-- <el-descriptions-item v-if="props.enumMap" label="Supplier" label-align="right">{{
enumRender("footprint", props.rowData?.supplier)
}}</el-descriptions-item>
}}</el-descriptions-item> -->
<el-descriptions-item v-if="props.enumMap" label="Supplier Part Number" label-align="right">{{
props.rowData?.spn
}}</el-descriptions-item>
<el-descriptions-item label="Internal Part Number" label-align="right">{{ props.rowData?.ipn }}</el-descriptions-item>
<el-descriptions-item
<!-- <el-descriptions-item
v-for="item in props.rowData?.specs"
:key="item.attribute"
:label="item.attribute.name"
label-align="right"
>
{{ item.value }} {{ item.units }}
</el-descriptions-item>
</el-descriptions-item> -->

<el-descriptions-item label="Comments" label-align="right">{{ props.rowData?.comment }}</el-descriptions-item>
</el-descriptions>
Expand Down
30 changes: 12 additions & 18 deletions src/views/settings/components/CompareComponentDetails.vue
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
<template>
<div>
<el-row>
<el-col :span="24"> What changed: {{ prettyPrint(compareObj(componentA, componentB)) }} </el-col>
<el-row justify="center">
<el-col :span="23">
<h2>What changed:</h2>
<code>{{ prettyPrint(compareObj(componentA, componentB)) }}</code>
</el-col>
</el-row>
<el-row justify="space-around">
<el-col :span="12">
Before:
<!-- <div style="white-space: pre-wrap">{{ prettyPrint(props.componentA) }}</div> -->
<ComponentDetails
:title="props.componentA?.mpn ?? '[empty]'"
:isView="true"
:rowData="props.componentA"
></ComponentDetails>
<el-col :span="11">
<h3>Before:</h3>
<ComponentDetails :title="props.componentA?.mpn ?? '[empty]'" :isView="true" :rowData="props.componentA" />
</el-col>
<el-col :span="12">
After:
<!-- <div style="white-space: pre-wrap">{{ prettyPrint(props.componentB) }}</div> -->
<ComponentDetails
:title="props.componentB?.mpn ?? '[empty]'"
:isView="true"
:rowData="props.componentB"
></ComponentDetails>
<el-divider direction="vertical" style="height: auto" />
<el-col :span="11">
<h3>After:</h3>
<ComponentDetails :title="props.componentB?.mpn ?? '[empty]'" :isView="true" :rowData="props.componentB" />
</el-col>
</el-row>
</div>
Expand Down

0 comments on commit c609f78

Please sign in to comment.