7525-devToTest #419
|
@ -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);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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">
|
||||||
|
|
Loading…
Reference in New Issue