Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
<q-inner-loading :showing="pageBusy">
|
||||
<q-spinner-gears size="52px" color="primary" />
|
||||
</q-inner-loading>
|
||||
<teleport to="body">
|
||||
<div
|
||||
v-if="pageBusy"
|
||||
class="page-busy-overlay"
|
||||
@@ -15,6 +16,7 @@
|
||||
<q-spinner-gears size="56px" color="primary" />
|
||||
<div class="page-busy-label">Yukleniyor...</div>
|
||||
</div>
|
||||
</teleport>
|
||||
|
||||
<div class="top-bar row items-center justify-between q-mb-xs">
|
||||
<div class="text-subtitle1 text-weight-bold">Urun Fiyatlandirma</div>
|
||||
@@ -871,7 +873,8 @@ const $q = useQuasar()
|
||||
const store = useProductPricingStore()
|
||||
|
||||
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 currentPage = ref(1)
|
||||
let reloadTimer = null
|
||||
@@ -1660,6 +1663,13 @@ function toggleColumnFilterValue (field, value) {
|
||||
}
|
||||
return
|
||||
}
|
||||
if (field === 'productCode') {
|
||||
columnFilters.value = {
|
||||
...columnFilters.value,
|
||||
[field]: current.has(value) ? [value] : []
|
||||
}
|
||||
return
|
||||
}
|
||||
columnFilters.value = {
|
||||
...columnFilters.value,
|
||||
[field]: Array.from(current)
|
||||
@@ -1675,6 +1685,13 @@ function selectAllColumnFilterOptions (field) {
|
||||
}
|
||||
return
|
||||
}
|
||||
if (field === 'productCode') {
|
||||
columnFilters.value = {
|
||||
...columnFilters.value,
|
||||
[field]: options.length > 0 ? [options[0].value] : []
|
||||
}
|
||||
return
|
||||
}
|
||||
columnFilters.value = {
|
||||
...columnFilters.value,
|
||||
[field]: options.map((option) => option.value)
|
||||
@@ -2443,6 +2460,7 @@ function buildServerFilters () {
|
||||
}
|
||||
|
||||
function scheduleReload () {
|
||||
reloadScheduled.value = true
|
||||
if (reloadTimer) clearTimeout(reloadTimer)
|
||||
reloadTimer = setTimeout(() => {
|
||||
reloadTimer = null
|
||||
@@ -2493,9 +2511,13 @@ async function fetchChunk ({ 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()
|
||||
isReloading.value = true
|
||||
reloadScheduled.value = false
|
||||
console.info('[product-pricing][ui] reload:start', {
|
||||
at: new Date(startedAt).toISOString()
|
||||
})
|
||||
@@ -2521,6 +2543,7 @@ async function reloadData ({ page = 1, useCache = true } = {}) {
|
||||
duration_ms: Date.now() - startedAt,
|
||||
row_count: Array.isArray(store.rows) ? store.rows.length : 0
|
||||
})
|
||||
reloadScheduled.value = false
|
||||
isReloading.value = false
|
||||
}
|
||||
}
|
||||
@@ -2594,7 +2617,7 @@ onBeforeUnmount(() => {
|
||||
.page-busy-overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 9000;
|
||||
z-index: 30000;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<q-inner-loading :showing="pageBusy">
|
||||
<q-spinner-gears size="52px" color="primary" />
|
||||
</q-inner-loading>
|
||||
<teleport to="body">
|
||||
<div
|
||||
v-if="pageBusy"
|
||||
class="page-busy-overlay"
|
||||
@@ -15,6 +16,7 @@
|
||||
<q-spinner-gears size="56px" color="primary" />
|
||||
<div class="page-busy-label">Yukleniyor...</div>
|
||||
</div>
|
||||
</teleport>
|
||||
|
||||
<div class="top-bar row items-center justify-between q-mb-xs">
|
||||
<div class="text-subtitle1 text-weight-bold">Toptan Kampanya Yonetimi</div>
|
||||
@@ -875,9 +877,9 @@ const $q = useQuasar()
|
||||
const store = useProductPricingStore()
|
||||
|
||||
const isReloading = ref(false)
|
||||
const pageBusy = computed(() => Boolean(isReloading.value || store.loading || variantLoading.value || saving.value || exportAllLoading.value))
|
||||
// Variant rows explode product rows; keep this smaller than ProductPricing for responsiveness.
|
||||
const PAGE_LIMIT = 50
|
||||
const reloadScheduled = ref(false)
|
||||
const pageBusy = computed(() => Boolean(reloadScheduled.value || isReloading.value || store.loading || variantLoading.value || saving.value || exportAllLoading.value))
|
||||
const PAGE_LIMIT = 250
|
||||
const currentPage = ref(1)
|
||||
let reloadTimer = null
|
||||
const variantRows = ref([])
|
||||
@@ -1734,6 +1736,13 @@ function toggleColumnFilterValue (field, value) {
|
||||
}
|
||||
return
|
||||
}
|
||||
if (field === 'productCode') {
|
||||
columnFilters.value = {
|
||||
...columnFilters.value,
|
||||
[field]: current.has(value) ? [value] : []
|
||||
}
|
||||
return
|
||||
}
|
||||
columnFilters.value = {
|
||||
...columnFilters.value,
|
||||
[field]: Array.from(current)
|
||||
@@ -1749,6 +1758,13 @@ function selectAllColumnFilterOptions (field) {
|
||||
}
|
||||
return
|
||||
}
|
||||
if (field === 'productCode') {
|
||||
columnFilters.value = {
|
||||
...columnFilters.value,
|
||||
[field]: options.length > 0 ? [options[0].value] : []
|
||||
}
|
||||
return
|
||||
}
|
||||
columnFilters.value = {
|
||||
...columnFilters.value,
|
||||
[field]: options.map((option) => option.value)
|
||||
@@ -2456,6 +2472,7 @@ function buildServerFilters () {
|
||||
}
|
||||
|
||||
function scheduleReload () {
|
||||
reloadScheduled.value = true
|
||||
if (reloadTimer) clearTimeout(reloadTimer)
|
||||
reloadTimer = setTimeout(() => {
|
||||
reloadTimer = null
|
||||
@@ -2700,9 +2717,13 @@ async function buildVariantRowsForProductPage (baseProductRows = []) {
|
||||
}
|
||||
|
||||
async function reloadData ({ page = 1, useCache = true } = {}) {
|
||||
if (isReloading.value) return
|
||||
if (isReloading.value) {
|
||||
reloadScheduled.value = false
|
||||
return
|
||||
}
|
||||
const startedAt = Date.now()
|
||||
isReloading.value = true
|
||||
reloadScheduled.value = false
|
||||
console.info('[product-pricing][ui] reload:start', {
|
||||
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,
|
||||
variant_row_count: Array.isArray(variantRows.value) ? variantRows.value.length : 0
|
||||
})
|
||||
reloadScheduled.value = false
|
||||
isReloading.value = false
|
||||
}
|
||||
}
|
||||
@@ -2808,7 +2830,7 @@ onBeforeUnmount(() => {
|
||||
.page-busy-overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 9000;
|
||||
z-index: 30000;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
@@ -317,14 +317,6 @@ export const useProductPricingStore = defineStore('product-pricing-store', {
|
||||
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', {
|
||||
trace_id: traceId,
|
||||
duration_ms: Date.now() - startedAt,
|
||||
|
||||
Reference in New Issue
Block a user