fix: long product name in order details
This commit is contained in:
parent
8ab688dc41
commit
751271eb65
2 changed files with 10 additions and 4 deletions
|
|
@ -89,7 +89,9 @@
|
||||||
<div class="col-1">{{item.quantity}}</div>
|
<div class="col-1">{{item.quantity}}</div>
|
||||||
<div class="col-1">x</div>
|
<div class="col-1">x</div>
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
{{productName(props.row, item.product_id)}}
|
<p :title="productName(props.row, item.product_id)">
|
||||||
|
{{shortLabel(productName(props.row, item.product_id))}}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-2">
|
<div class="col-2">
|
||||||
{{productPrice(props.row, item.product_id)}}
|
{{productPrice(props.row, item.product_id)}}
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,10 @@ async function orderList(path) {
|
||||||
formatFiat(value, currency) {
|
formatFiat(value, currency) {
|
||||||
return Math.trunc(value) + ' ' + currency
|
return Math.trunc(value) + ' ' + currency
|
||||||
},
|
},
|
||||||
|
shortLabel(value = ''){
|
||||||
|
if (value.length <= 44) return value
|
||||||
|
return value.substring(0, 20) + '...'
|
||||||
|
},
|
||||||
productName: function (order, productId) {
|
productName: function (order, productId) {
|
||||||
product = order.extra.products.find(p => p.id === productId)
|
product = order.extra.products.find(p => p.id === productId)
|
||||||
if (product) {
|
if (product) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue