fix: sort selected field
This commit is contained in:
parent
eaa92f214d
commit
42585c859c
2 changed files with 25 additions and 11 deletions
|
|
@ -101,11 +101,19 @@ defineProps<{
|
|||
<slot name="data"></slot>
|
||||
<template v-if="!$slots.data">
|
||||
<div
|
||||
v-for="key in fieldSelected || [
|
||||
'branchLabelAddress',
|
||||
'branchLabelTel',
|
||||
'branchLabelType',
|
||||
]"
|
||||
v-for="key in (
|
||||
fieldSelected || [
|
||||
'branchLabelAddress',
|
||||
'branchLabelTel',
|
||||
'branchLabelType',
|
||||
]
|
||||
).sort((lhs, rhs) => {
|
||||
let order = Object.keys(data);
|
||||
return (
|
||||
order.findIndex((i) => i === lhs) -
|
||||
order.findIndex((i) => i === rhs)
|
||||
);
|
||||
})"
|
||||
:key="key"
|
||||
class="branch-card__data"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -1603,17 +1603,23 @@ const emptyCreateDialog = ref(false);
|
|||
<div
|
||||
class="col-12 q-py-sm row"
|
||||
v-for="key in fieldSelected
|
||||
.filter((v) => {
|
||||
return columnsCustomer.some(
|
||||
(c) => c.name === v,
|
||||
);
|
||||
})
|
||||
.filter((v) => {
|
||||
return (
|
||||
v !== 'orderNumber' &&
|
||||
v !== 'titleName' &&
|
||||
v !== 'address' &&
|
||||
v !== 'contactName'
|
||||
v !== 'contactName' &&
|
||||
columnsCustomer.some((c) => c.name === v)
|
||||
);
|
||||
})
|
||||
.sort((lhs, rhs) => {
|
||||
const fields = [
|
||||
...columnsEmployee,
|
||||
...columnsCustomer,
|
||||
];
|
||||
return (
|
||||
fields.findIndex((i) => i.name === lhs) -
|
||||
fields.findIndex((i) => i.name === rhs)
|
||||
);
|
||||
})"
|
||||
:key="key"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue