setting in better position

This commit is contained in:
2026-06-14 16:27:18 +03:30
parent 0c404ee3e1
commit 6d0601f464
4 changed files with 75 additions and 38 deletions
@@ -4,6 +4,9 @@
<BaseButton :loading="syncing" @click="handleSync">
همگام‌سازی از محصولات
</BaseButton>
<span class="text-sm text-gray-500">
تب فیلتر اپ خودکار از دسته‌های فعالی است که محصول دارند.
</span>
</div>
<a-spin :spinning="loading">
@@ -24,12 +27,6 @@
@change="(checked: boolean) => toggleField(record, 'active', checked)"
/>
</template>
<template v-else-if="column.key === 'show_in_filter'">
<a-switch
:checked="asBool(record.show_in_filter)"
@change="(checked: boolean) => toggleField(record, 'show_in_filter', checked)"
/>
</template>
<template v-else-if="column.key === 'show_in_select'">
<a-switch
:checked="asBool(record.show_in_select)"
@@ -62,7 +59,7 @@ const loading = ref(false)
const syncing = ref(false)
const items = ref<Category[]>([])
type CategoryField = 'active' | 'show_in_filter' | 'show_in_select' | 'sort_order'
type CategoryField = 'active' | 'show_in_select' | 'sort_order'
const pendingPatches = new Map<number, Partial<Record<CategoryField, number>>>()
const debouncedFlush = new Map<number, ReturnType<typeof debounce>>()
@@ -76,12 +73,6 @@ const columns: TableColumnType<Category>[] = [
width: 160,
align: 'center'
},
{
title: 'تب فیلتر اپ',
key: 'show_in_filter',
width: 120,
align: 'center'
},
{
title: 'سلکت افزودن محصول',
key: 'show_in_select',
@@ -137,7 +128,6 @@ async function flushSave(id: number) {
const snapshot = {
active: record.active,
show_in_filter: record.show_in_filter,
show_in_select: record.show_in_select,
sort_order: record.sort_order
}
@@ -154,7 +144,7 @@ async function flushSave(id: number) {
function toggleField(
record: Category,
field: 'active' | 'show_in_filter' | 'show_in_select',
field: 'active' | 'show_in_select',
checked: boolean
) {
if (asBool(record[field]) === checked) return