fix price

This commit is contained in:
2026-06-25 00:13:03 +03:30
parent 78ce8ad4b4
commit edffc5df76
5 changed files with 35 additions and 3 deletions
+7 -2
View File
@@ -174,7 +174,7 @@ import SettingValueField from './SettingValueField.vue'
import SettingCard from './SettingCard.vue'
import { refreshAppModeMenu } from '@/router'
import { useUserStore } from '@/store/userStore'
import { setStoreModeFromSettings } from '@/utils/config'
import { applyBannerEnabledFromRows, setBannerEnabledFromSettings, setStoreModeFromSettings } from '@/utils/config'
import {
EDITABLE_SETTING_GROUPS,
SYSTEM_SETTING_GROUPS,
@@ -420,7 +420,9 @@ async function initConfig() {
(isSystemMode.value
? await getSystemConfiguration()
: await getEditableConfiguration()) ?? []
if (!isSystemMode.value) {
if (isSystemMode.value) {
applyBannerEnabledFromRows(baseData.value)
} else {
const storeRow = baseData.value.find((row) => row.key === 'is_store')
if (storeRow) {
setStoreModeFromSettings(isSwitchOn(storeRow.value))
@@ -531,6 +533,9 @@ async function saveSettingRow(row: Const) {
setStoreModeFromSettings(isSwitchOn(value))
refreshMenuAfterStoreChange()
}
if (row.key === 'banner_enabled' && isSystemMode.value) {
setBannerEnabledFromSettings(isSwitchOn(value))
}
savedFlashIds.value.add(id)
if (saveTimers.has(id)) clearTimeout(saveTimers.get(id))
saveTimers.set(
@@ -4,7 +4,11 @@ import { usePrice } from '@core/utils/usePrice'
const SOURCE_LABELS: Record<string, string> = {
zaarbox: 'تابلو Zaarbox',
legacy: 'فید قدیمی'
legacy: 'فید قدیمی',
montzar: 'منتظر',
main_product: 'محصول اصلی',
database_last: 'آخرین قیمت DB',
store: 'فروشگاه'
}
export const storePriceColumns: BaseTableColumn[] = [
+2
View File
@@ -25,6 +25,7 @@ import BasicMenu from '@/components/BasicMenu/index.vue'
import { useRouterStore } from '@core/stores/router'
import { useUserStore } from '@/store/userStore'
import { isDeployAdmin } from '@/utils/deployAdmin'
import { bannerEnabledSetting } from '@/utils/config'
import { get } from 'lodash'
import type { RouteRecordRaw } from 'vue-router'
@@ -36,6 +37,7 @@ const menu = computed(() => {
const children = get(item, 'children[0].children', []) as RouteRecordRaw[]
return children
.filter((child) => !child.meta?.hideMenu)
.filter((child) => child.name !== 'banners' || bannerEnabledSetting.value)
.filter(
(child) =>
!child.meta?.deployAdminOnly || isDeployAdmin(userStore.userInfo?.mobile)