Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-06-18 18:13:58 +03:00
parent d1fbe60aeb
commit 6fc7313ae6
3 changed files with 77 additions and 40 deletions

View File

@@ -3,18 +3,20 @@
<q-inner-loading :showing="pageBusy"> <q-inner-loading :showing="pageBusy">
<q-spinner-gears size="52px" color="primary" /> <q-spinner-gears size="52px" color="primary" />
</q-inner-loading> </q-inner-loading>
<div <teleport to="body">
v-if="pageBusy" <div
class="page-busy-overlay" v-if="pageBusy"
@click.stop class="page-busy-overlay"
@mousedown.stop @click.stop
@mouseup.stop @mousedown.stop
@touchstart.stop @mouseup.stop
@wheel.stop @touchstart.stop
> @wheel.stop
<q-spinner-gears size="56px" color="primary" /> >
<div class="page-busy-label">Yukleniyor...</div> <q-spinner-gears size="56px" color="primary" />
</div> <div class="page-busy-label">Yukleniyor...</div>
</div>
</teleport>
<div class="top-bar row items-center justify-between q-mb-xs"> <div class="top-bar row items-center justify-between q-mb-xs">
<div class="text-subtitle1 text-weight-bold">Urun Fiyatlandirma</div> <div class="text-subtitle1 text-weight-bold">Urun Fiyatlandirma</div>
@@ -871,7 +873,8 @@ const $q = useQuasar()
const store = useProductPricingStore() const store = useProductPricingStore()
const isReloading = ref(false) const isReloading = ref(false)
const pageBusy = computed(() => Boolean(isReloading.value || store.loading || saving.value || bulkCalcLoading.value || exportAllLoading.value)) const reloadScheduled = ref(false)
const pageBusy = computed(() => Boolean(reloadScheduled.value || isReloading.value || store.loading || saving.value || bulkCalcLoading.value || exportAllLoading.value))
const PAGE_LIMIT = 250 const PAGE_LIMIT = 250
const currentPage = ref(1) const currentPage = ref(1)
let reloadTimer = null let reloadTimer = null
@@ -1660,6 +1663,13 @@ function toggleColumnFilterValue (field, value) {
} }
return return
} }
if (field === 'productCode') {
columnFilters.value = {
...columnFilters.value,
[field]: current.has(value) ? [value] : []
}
return
}
columnFilters.value = { columnFilters.value = {
...columnFilters.value, ...columnFilters.value,
[field]: Array.from(current) [field]: Array.from(current)
@@ -1675,6 +1685,13 @@ function selectAllColumnFilterOptions (field) {
} }
return return
} }
if (field === 'productCode') {
columnFilters.value = {
...columnFilters.value,
[field]: options.length > 0 ? [options[0].value] : []
}
return
}
columnFilters.value = { columnFilters.value = {
...columnFilters.value, ...columnFilters.value,
[field]: options.map((option) => option.value) [field]: options.map((option) => option.value)
@@ -2443,6 +2460,7 @@ function buildServerFilters () {
} }
function scheduleReload () { function scheduleReload () {
reloadScheduled.value = true
if (reloadTimer) clearTimeout(reloadTimer) if (reloadTimer) clearTimeout(reloadTimer)
reloadTimer = setTimeout(() => { reloadTimer = setTimeout(() => {
reloadTimer = null reloadTimer = null
@@ -2493,9 +2511,13 @@ async function fetchChunk ({ page = 1, useCache = true } = {}) {
} }
async function reloadData ({ page = 1, useCache = true } = {}) { async function reloadData ({ page = 1, useCache = true } = {}) {
if (isReloading.value) return if (isReloading.value) {
reloadScheduled.value = false
return
}
const startedAt = Date.now() const startedAt = Date.now()
isReloading.value = true isReloading.value = true
reloadScheduled.value = false
console.info('[product-pricing][ui] reload:start', { console.info('[product-pricing][ui] reload:start', {
at: new Date(startedAt).toISOString() at: new Date(startedAt).toISOString()
}) })
@@ -2521,6 +2543,7 @@ async function reloadData ({ page = 1, useCache = true } = {}) {
duration_ms: Date.now() - startedAt, duration_ms: Date.now() - startedAt,
row_count: Array.isArray(store.rows) ? store.rows.length : 0 row_count: Array.isArray(store.rows) ? store.rows.length : 0
}) })
reloadScheduled.value = false
isReloading.value = false isReloading.value = false
} }
} }
@@ -2594,7 +2617,7 @@ onBeforeUnmount(() => {
.page-busy-overlay { .page-busy-overlay {
position: fixed; position: fixed;
inset: 0; inset: 0;
z-index: 9000; z-index: 30000;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;

View File

@@ -3,18 +3,20 @@
<q-inner-loading :showing="pageBusy"> <q-inner-loading :showing="pageBusy">
<q-spinner-gears size="52px" color="primary" /> <q-spinner-gears size="52px" color="primary" />
</q-inner-loading> </q-inner-loading>
<div <teleport to="body">
v-if="pageBusy" <div
class="page-busy-overlay" v-if="pageBusy"
@click.stop class="page-busy-overlay"
@mousedown.stop @click.stop
@mouseup.stop @mousedown.stop
@touchstart.stop @mouseup.stop
@wheel.stop @touchstart.stop
> @wheel.stop
<q-spinner-gears size="56px" color="primary" /> >
<div class="page-busy-label">Yukleniyor...</div> <q-spinner-gears size="56px" color="primary" />
</div> <div class="page-busy-label">Yukleniyor...</div>
</div>
</teleport>
<div class="top-bar row items-center justify-between q-mb-xs"> <div class="top-bar row items-center justify-between q-mb-xs">
<div class="text-subtitle1 text-weight-bold">Toptan Kampanya Yonetimi</div> <div class="text-subtitle1 text-weight-bold">Toptan Kampanya Yonetimi</div>
@@ -875,9 +877,9 @@ const $q = useQuasar()
const store = useProductPricingStore() const store = useProductPricingStore()
const isReloading = ref(false) const isReloading = ref(false)
const pageBusy = computed(() => Boolean(isReloading.value || store.loading || variantLoading.value || saving.value || exportAllLoading.value)) const reloadScheduled = ref(false)
// Variant rows explode product rows; keep this smaller than ProductPricing for responsiveness. const pageBusy = computed(() => Boolean(reloadScheduled.value || isReloading.value || store.loading || variantLoading.value || saving.value || exportAllLoading.value))
const PAGE_LIMIT = 50 const PAGE_LIMIT = 250
const currentPage = ref(1) const currentPage = ref(1)
let reloadTimer = null let reloadTimer = null
const variantRows = ref([]) const variantRows = ref([])
@@ -1734,6 +1736,13 @@ function toggleColumnFilterValue (field, value) {
} }
return return
} }
if (field === 'productCode') {
columnFilters.value = {
...columnFilters.value,
[field]: current.has(value) ? [value] : []
}
return
}
columnFilters.value = { columnFilters.value = {
...columnFilters.value, ...columnFilters.value,
[field]: Array.from(current) [field]: Array.from(current)
@@ -1749,6 +1758,13 @@ function selectAllColumnFilterOptions (field) {
} }
return return
} }
if (field === 'productCode') {
columnFilters.value = {
...columnFilters.value,
[field]: options.length > 0 ? [options[0].value] : []
}
return
}
columnFilters.value = { columnFilters.value = {
...columnFilters.value, ...columnFilters.value,
[field]: options.map((option) => option.value) [field]: options.map((option) => option.value)
@@ -2456,6 +2472,7 @@ function buildServerFilters () {
} }
function scheduleReload () { function scheduleReload () {
reloadScheduled.value = true
if (reloadTimer) clearTimeout(reloadTimer) if (reloadTimer) clearTimeout(reloadTimer)
reloadTimer = setTimeout(() => { reloadTimer = setTimeout(() => {
reloadTimer = null reloadTimer = null
@@ -2700,9 +2717,13 @@ async function buildVariantRowsForProductPage (baseProductRows = []) {
} }
async function reloadData ({ page = 1, useCache = true } = {}) { async function reloadData ({ page = 1, useCache = true } = {}) {
if (isReloading.value) return if (isReloading.value) {
reloadScheduled.value = false
return
}
const startedAt = Date.now() const startedAt = Date.now()
isReloading.value = true isReloading.value = true
reloadScheduled.value = false
console.info('[product-pricing][ui] reload:start', { console.info('[product-pricing][ui] reload:start', {
at: new Date(startedAt).toISOString() at: new Date(startedAt).toISOString()
}) })
@@ -2732,6 +2753,7 @@ async function reloadData ({ page = 1, useCache = true } = {}) {
row_count: Array.isArray(store.rows) ? store.rows.length : 0, row_count: Array.isArray(store.rows) ? store.rows.length : 0,
variant_row_count: Array.isArray(variantRows.value) ? variantRows.value.length : 0 variant_row_count: Array.isArray(variantRows.value) ? variantRows.value.length : 0
}) })
reloadScheduled.value = false
isReloading.value = false isReloading.value = false
} }
} }
@@ -2808,7 +2830,7 @@ onBeforeUnmount(() => {
.page-busy-overlay { .page-busy-overlay {
position: fixed; position: fixed;
inset: 0; inset: 0;
z-index: 9000; z-index: 30000;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;

View File

@@ -317,14 +317,6 @@ export const useProductPricingStore = defineStore('product-pricing-store', {
this.applyPageResult(payload, page) this.applyPageResult(payload, page)
} }
// Background prefetch for next page to reduce perceived wait on page change.
if (this.page < this.totalPages) {
void this.prefetchPage({
limit,
page: this.page + 1,
filters
})
}
console.info('[product-pricing][frontend] request:success', { console.info('[product-pricing][frontend] request:success', {
trace_id: traceId, trace_id: traceId,
duration_ms: Date.now() - startedAt, duration_ms: Date.now() - startedAt,