7525-devToTest #419

Merged
alexm merged 177 commits from 7525-devToTest into test 2024-06-04 08:06:27 +00:00
2 changed files with 13 additions and 9 deletions
Showing only changes of commit ce02d21b3b - Show all commits

View File

@ -43,6 +43,7 @@ const setUserConfigViewData = (data) => {
name: col, name: col,
active: data[col] == undefined ? true : data[col], active: data[col] == undefined ? true : data[col],
})); }));
console.log('formattedCols: ', formattedCols.value);
emitSavedConfig(); emitSavedConfig();
}; };
@ -63,6 +64,7 @@ const fetchViewConfigData = async () => {
where: { tableCode: $props.tableCode, userFk: user.id }, where: { tableCode: $props.tableCode, userFk: user.id },
}; };
const userConfig = await getConfig('UserConfigViews', userConfigFilter); const userConfig = await getConfig('UserConfigViews', userConfigFilter);
console.log('userConfig: ', userConfig);
if (userConfig) { if (userConfig) {
initialUserConfigViewData.value = userConfig; initialUserConfigViewData.value = userConfig;
@ -72,6 +74,7 @@ const fetchViewConfigData = async () => {
const defaultConfigFilter = { where: { tableCode: $props.tableCode } }; const defaultConfigFilter = { where: { tableCode: $props.tableCode } };
const defaultConfig = await getConfig('DefaultViewConfigs', defaultConfigFilter); const defaultConfig = await getConfig('DefaultViewConfigs', defaultConfigFilter);
console.log('defaultConfig: ', defaultConfig);
if (defaultConfig) { if (defaultConfig) {
setUserConfigViewData(defaultConfig.columns); setUserConfigViewData(defaultConfig.columns);
@ -131,6 +134,7 @@ const emitSavedConfig = () => {
const activeColumns = formattedCols.value const activeColumns = formattedCols.value
.filter((col) => col.active) .filter((col) => col.active)
.map((col) => col.name); .map((col) => col.name);
console.log('activeColumns: ', activeColumns);
emit('onConfigSaved', activeColumns); emit('onConfigSaved', activeColumns);
}; };

View File

@ -32,9 +32,7 @@ const { viewSummary } = useSummaryDialog();
const router = useRouter(); const router = useRouter();
onMounted(async () => { onMounted(async () => {
stateStore.rightDrawer = true; stateStore.rightDrawer = true;
const filteredColumns = columns.value.filter((col) => col.name !== 'picture'); allColumnNames.value = columns.value.map((col) => col.name);
allColumnNames.value = filteredColumns.map((col) => col.name);
allColumnNames.value = columns.value;
await arrayData.fetch({ append: false }); await arrayData.fetch({ append: false });
}); });
onUnmounted(() => (stateStore.rightDrawer = false)); onUnmounted(() => (stateStore.rightDrawer = false));
@ -327,6 +325,14 @@ const openTicketsDialog = (id) => {
<FetchData url="Vehicles" @on-fetch="(data) => (vehicleList = data)" auto-load /> <FetchData url="Vehicles" @on-fetch="(data) => (vehicleList = data)" auto-load />
<QPage class="column items-center"> <QPage class="column items-center">
<VnSubToolbar> <VnSubToolbar>
<template #st-data>
<TableVisibleColumns
class="LeftIcon"
:all-columns="allColumnNames"
table-code="routesList"
@on-config-saved="visibleColumns = [...$event]"
/>
</template>
<template #st-actions> <template #st-actions>
<QBtn <QBtn
icon="vn:clone" icon="vn:clone"
@ -355,12 +361,6 @@ const openTicketsDialog = (id) => {
> >
<QTooltip>{{ t('Mark as served') }}</QTooltip> <QTooltip>{{ t('Mark as served') }}</QTooltip>
</QBtn> </QBtn>
<TableVisibleColumns
class="LeftIcon"
:all-columns="allColumnNames"
table-code="routes"
@on-config-saved="visibleColumns = [...$event]"
/>
</template> </template>
</VnSubToolbar> </VnSubToolbar>
<div class="route-list"> <div class="route-list">