8197-perf_vnTableInside #1175
|
@ -14,6 +14,7 @@ defineProps({
|
|||
hide-dropdown-icon
|
||||
focus-on-mount
|
||||
@update:model-value="promise"
|
||||
data-cy="vnBtnSelect_select"
|
||||
/>
|
||||
</QBtnDropdown>
|
||||
</template>
|
||||
|
|
|
@ -297,7 +297,7 @@ defineExpose({
|
|||
ref="dmsRef"
|
||||
:data-key="$props.model"
|
||||
:url="$props.model"
|
||||
:filter="dmsFilter"
|
||||
:user-filter="dmsFilter"
|
||||
alexm marked this conversation as resolved
|
||||
:order="['dmsFk DESC']"
|
||||
:auto-load="true"
|
||||
@on-fetch="setData"
|
||||
|
|
|
@ -20,16 +20,15 @@ const hasContent = ref();
|
|||
let observer;
|
||||
|
||||
onMounted(() => {
|
||||
if (teleportRef.value) {
|
||||
const checkContent = () => {
|
||||
hasContent.value = teleportRef.value.innerHTML.trim() !== '';
|
||||
};
|
||||
if (!teleportRef.value) return;
|
||||
const checkContent = () => {
|
||||
hasContent.value = teleportRef.value?.innerHTML?.trim() !== '';
|
||||
};
|
||||
|
||||
observer = new MutationObserver(checkContent);
|
||||
observer.observe(teleportRef.value, { childList: true, subtree: true });
|
||||
observer = new MutationObserver(checkContent);
|
||||
observer.observe(teleportRef.value, { childList: true, subtree: true });
|
||||
|
||||
checkContent();
|
||||
}
|
||||
checkContent();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -39,6 +39,10 @@ const $props = defineProps({
|
|||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
keepData: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
});
|
||||
|
||||
const route = useRoute();
|
||||
|
@ -56,6 +60,7 @@ onBeforeMount(() => {
|
|||
if ($props.dataKey)
|
||||
arrayData = useArrayData($props.dataKey, {
|
||||
searchUrl: 'table',
|
||||
keepData: $props.keepData,
|
||||
...$props.arrayDataProps,
|
||||
navigate: $props.redirect,
|
||||
});
|
||||
|
|
|
@ -111,6 +111,7 @@ onMounted(async () => {
|
|||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
if (!store.keepData) arrayData.reset(['data']);
|
||||
arrayData.resetPagination();
|
||||
});
|
||||
alexm
commented
Aixina en els List no borrem mai els datos, pero en tot lo demes si. Aixina en els List no borrem mai els datos, pero en tot lo demes si.
Aixina se fora forsa a que quan canvies el id, te fasa reload
|
||||
|
||||
|
|
|
@ -53,6 +53,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
|||
'searchUrl',
|
||||
'navigate',
|
||||
'mapKey',
|
||||
'keepData',
|
||||
];
|
||||
if (typeof userOptions === 'object') {
|
||||
for (const option in userOptions) {
|
||||
|
@ -302,7 +303,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
|||
for (const row of data) {
|
||||
const key = row[store.mapKey];
|
||||
const val = { ...row, key };
|
||||
if (store.map.has(key)) {
|
||||
if (key && store.map.has(key)) {
|
||||
const { position } = store.map.get(key);
|
||||
val.position = position;
|
||||
store.map.set(key, val);
|
||||
|
|
|
@ -18,6 +18,7 @@ export const useArrayDataStore = defineStore('arrayDataStore', () => {
|
|||
navigate: null,
|
||||
page: 1,
|
||||
mapKey: 'id',
|
||||
keepData: false,
|
||||
};
|
||||
|
||||
function get(key) {
|
||||
|
|
|
@ -16,7 +16,9 @@ describe('Ticket expedtion', () => {
|
|||
|
||||
cy.wait('@show');
|
||||
cy.selectRows([1, 2]);
|
||||
cy.selectOption('[data-cy="change-state"]', 'Perdida');
|
||||
|
||||
cy.dataCy('change-state').click();
|
||||
cy.selectOption('[data-cy="vnBtnSelect_select"]', 'Perdida');
|
||||
cy.wait('@add');
|
||||
|
||||
cy.get(`${tableContent} tr:nth-child(-n+2) ${stateTd}`).each(($el) => {
|
||||
|
|
|
@ -16,6 +16,7 @@ describe('VnBreadcrumbs', () => {
|
|||
cy.visit('#/customer/list');
|
||||
cy.get('.q-breadcrumbs__el').should('have.length', 2);
|
||||
|
||||
cy.writeSearchbar('{enter}');
|
||||
cy.get(firstCard).click();
|
||||
cy.get(`${lastBreadcrumb} > .q-icon`).should('have.text', 'launch');
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
En lo nou del map en ArrayData, si no se espeicifica falla.