This commit is contained in:
parent
0cfcda7062
commit
ce02d21b3b
|
@ -43,6 +43,7 @@ const setUserConfigViewData = (data) => {
|
|||
name: col,
|
||||
active: data[col] == undefined ? true : data[col],
|
||||
}));
|
||||
console.log('formattedCols: ', formattedCols.value);
|
||||
emitSavedConfig();
|
||||
};
|
||||
|
||||
|
@ -63,6 +64,7 @@ const fetchViewConfigData = async () => {
|
|||
where: { tableCode: $props.tableCode, userFk: user.id },
|
||||
};
|
||||
const userConfig = await getConfig('UserConfigViews', userConfigFilter);
|
||||
console.log('userConfig: ', userConfig);
|
||||
|
||||
if (userConfig) {
|
||||
initialUserConfigViewData.value = userConfig;
|
||||
|
@ -72,6 +74,7 @@ const fetchViewConfigData = async () => {
|
|||
|
||||
const defaultConfigFilter = { where: { tableCode: $props.tableCode } };
|
||||
const defaultConfig = await getConfig('DefaultViewConfigs', defaultConfigFilter);
|
||||
console.log('defaultConfig: ', defaultConfig);
|
||||
|
||||
if (defaultConfig) {
|
||||
setUserConfigViewData(defaultConfig.columns);
|
||||
|
@ -131,6 +134,7 @@ const emitSavedConfig = () => {
|
|||
const activeColumns = formattedCols.value
|
||||
.filter((col) => col.active)
|
||||
.map((col) => col.name);
|
||||
console.log('activeColumns: ', activeColumns);
|
||||
emit('onConfigSaved', activeColumns);
|
||||
};
|
||||
|
||||
|
|
|
@ -32,9 +32,7 @@ const { viewSummary } = useSummaryDialog();
|
|||
const router = useRouter();
|
||||
onMounted(async () => {
|
||||
stateStore.rightDrawer = true;
|
||||
const filteredColumns = columns.value.filter((col) => col.name !== 'picture');
|
||||
allColumnNames.value = filteredColumns.map((col) => col.name);
|
||||
allColumnNames.value = columns.value;
|
||||
allColumnNames.value = columns.value.map((col) => col.name);
|
||||
await arrayData.fetch({ append: false });
|
||||
});
|
||||
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||
|
@ -327,6 +325,14 @@ const openTicketsDialog = (id) => {
|
|||
<FetchData url="Vehicles" @on-fetch="(data) => (vehicleList = data)" auto-load />
|
||||
<QPage class="column items-center">
|
||||
<VnSubToolbar>
|
||||
<template #st-data>
|
||||
<TableVisibleColumns
|
||||
class="LeftIcon"
|
||||
:all-columns="allColumnNames"
|
||||
table-code="routesList"
|
||||
@on-config-saved="visibleColumns = [...$event]"
|
||||
/>
|
||||
</template>
|
||||
<template #st-actions>
|
||||
<QBtn
|
||||
icon="vn:clone"
|
||||
|
@ -355,12 +361,6 @@ const openTicketsDialog = (id) => {
|
|||
>
|
||||
<QTooltip>{{ t('Mark as served') }}</QTooltip>
|
||||
</QBtn>
|
||||
<TableVisibleColumns
|
||||
class="LeftIcon"
|
||||
:all-columns="allColumnNames"
|
||||
table-code="routes"
|
||||
@on-config-saved="visibleColumns = [...$event]"
|
||||
/>
|
||||
</template>
|
||||
</VnSubToolbar>
|
||||
<div class="route-list">
|
||||
|
|
Loading…
Reference in New Issue