forked from verdnatura/salix-front
feat: replace stickyButtons by subtoolbar
This commit is contained in:
parent
4cbca1ca64
commit
fceeaea1f5
|
@ -392,22 +392,6 @@ function highlightNewRow(index) {
|
|||
const openEditTableCellDialog = () => {
|
||||
editTableCellDialogRef.value.show();
|
||||
};
|
||||
async function showBadDates() {
|
||||
try {
|
||||
if (!checked.value) fixedPrices.value = fixedPricesOriginalData.value;
|
||||
else {
|
||||
rowsSelected.value = [];
|
||||
const { data } = await axios.get('FixedPrices/filter', {
|
||||
params: {
|
||||
showBadDates: checked.value,
|
||||
},
|
||||
});
|
||||
fixedPrices.value = data;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
const onEditCellDataSaved = async () => {
|
||||
rowsSelected.value = [];
|
||||
await fetchFixedPrices();
|
||||
|
@ -480,13 +464,16 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
</RightMenu>
|
||||
<VnSubToolbar>
|
||||
<template #st-data>
|
||||
<QCheckbox
|
||||
size="sm"
|
||||
v-model="checked"
|
||||
:label="t(`Show future items`)"
|
||||
@update:model-value="showBadDates"
|
||||
<QBtn
|
||||
v-if="rowsSelected.length"
|
||||
@click="openEditTableCellDialog()"
|
||||
color="primary"
|
||||
icon="edit"
|
||||
>
|
||||
</QCheckbox>
|
||||
<QTooltip>
|
||||
{{ t('Edit fixed price(s)') }}
|
||||
</QTooltip>
|
||||
</QBtn>
|
||||
</template>
|
||||
</VnSubToolbar>
|
||||
<QPage class="column items-center q-pa-md">
|
||||
|
@ -700,32 +687,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
{{ t('Add') }}
|
||||
</QTooltip>
|
||||
</QPageSticky>
|
||||
<QPageSticky v-if="rowsSelected.length" :offset="[20, 60]">
|
||||
<QBtn @click="openEditTableCellDialog()" color="primary" fab icon="edit" />
|
||||
<QTooltip>
|
||||
{{ t('Edit fixed price(s)') }}
|
||||
</QTooltip>
|
||||
</QPageSticky>
|
||||
<QPageSticky
|
||||
:offset="[20, 120]"
|
||||
v-if="tableRef?.rows?.length > 0 && checked && rowsSelected.length > 0"
|
||||
>
|
||||
<QBtn
|
||||
color="primary"
|
||||
fab
|
||||
icon="delete"
|
||||
@click.stop="
|
||||
openConfirmationModal(
|
||||
t('This row will be removed'),
|
||||
t('Do you want to clone this item?'),
|
||||
() => removeFuturePrice()
|
||||
)
|
||||
"
|
||||
/>
|
||||
<QTooltip>
|
||||
{{ t('Add') }}
|
||||
</QTooltip>
|
||||
</QPageSticky>
|
||||
|
||||
<QDialog ref="editTableCellDialogRef">
|
||||
<EditTableCellValueForm
|
||||
edit-url="FixedPrices/editFixedPrice"
|
||||
|
|
|
@ -30,7 +30,9 @@ const sanitizeParam = (param) => {
|
|||
};
|
||||
const $params = ref({});
|
||||
onMounted(() => {
|
||||
['mine', 'hasMinPrice'].forEach((tag) => ($params.value[tag] = sanitizeParam(tag)));
|
||||
['mine', 'hasMinPrice', 'showBadDates'].forEach(
|
||||
(tag) => ($params.value[tag] = sanitizeParam(tag))
|
||||
);
|
||||
});
|
||||
const pushParam = (param) => ({
|
||||
param: { [param]: $params.value[param] },
|
||||
|
@ -109,6 +111,17 @@ const pushParam = (param) => ({
|
|||
@update:model-value="searchFn(pushParam('mine'))"
|
||||
/>
|
||||
</QItemSection>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
size="sm"
|
||||
v-model="checked"
|
||||
:label="t(`Show future items`)"
|
||||
:true-value="'true'"
|
||||
:false-value="'false'"
|
||||
@update:model-value="searchFn(pushParam('showBadDates'))"
|
||||
>
|
||||
</QCheckbox>
|
||||
</QItemSection>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
:label="t('components.itemsFilterPanel.hasMinPrice')"
|
||||
|
|
Loading…
Reference in New Issue