added setting for users
This commit is contained in:
@@ -202,7 +202,7 @@ import SettingValueField from './SettingValueField.vue'
|
||||
import SettingCard from './SettingCard.vue'
|
||||
import { refreshAppModeMenu } from '@/router'
|
||||
import { useUserStore } from '@/store/userStore'
|
||||
import { applyBannerEnabledFromRows, applyTrackingSystemsEnabledFromRows, applyConditionalOrderEnabledFromRows, applyProductFundsEnabledFromRows, applyPriceTriggerEnabledFromRows, applyAppNotificationEnabledFromRows, applyPriceProviderFromRows, applyPriceChannelAccessFromRows, applySupportChatMenuEnabledFromRows, applyGroupSmsFromRows, setBannerEnabledFromSettings, setConditionalOrderEnabledFromSettings, setProductFundsEnabledFromSettings, setPriceTriggerEnabledFromSettings, setAppNotificationEnabledFromSettings, setPriceProviderFromSettings, setPriceChannelAccessFromSettings, setStoreModeFromSettings, setTrackingSystemsEnabledFromSettings, setGroupSmsEnabledFromSettings } from '@/utils/config'
|
||||
import { applyBannerEnabledFromRows, applyTrackingSystemsEnabledFromRows, applyConditionalOrderEnabledFromRows, applyProductFundsEnabledFromRows, applyPriceTriggerEnabledFromRows, applyAppNotificationEnabledFromRows, applyPriceProviderFromRows, applyPriceChannelAccessFromRows, applySupportChatMenuEnabledFromRows, applyGroupSmsFromRows, applyCustomerSpecialPricingFromRows, setBannerEnabledFromSettings, setConditionalOrderEnabledFromSettings, setProductFundsEnabledFromSettings, setPriceTriggerEnabledFromSettings, setAppNotificationEnabledFromSettings, setPriceProviderFromSettings, setPriceChannelAccessFromSettings, setStoreModeFromSettings, setTrackingSystemsEnabledFromSettings, setGroupSmsEnabledFromSettings, setCustomerSpecialPricingEnabledFromSettings } from '@/utils/config'
|
||||
import {
|
||||
EDITABLE_SETTING_GROUPS,
|
||||
SYSTEM_SETTING_GROUPS,
|
||||
@@ -485,12 +485,14 @@ async function initConfig() {
|
||||
applyPriceChannelAccessFromRows(baseData.value)
|
||||
applySupportChatMenuEnabledFromRows(baseData.value)
|
||||
applyGroupSmsFromRows(baseData.value)
|
||||
applyCustomerSpecialPricingFromRows(baseData.value)
|
||||
// در صفحهٔ عادی price_provider و show_to_users_chat و price_channel_access (can_edit=0) نیستند — از کل تنظیمات بخوان
|
||||
if (
|
||||
!baseData.value.some((row) => row.key === 'price_provider') ||
|
||||
!baseData.value.some((row) => row.key === 'show_to_users_chat') ||
|
||||
!baseData.value.some((row) => row.key === 'price_channel_access') ||
|
||||
!baseData.value.some((row) => row.key === 'group_sms')
|
||||
!baseData.value.some((row) => row.key === 'group_sms') ||
|
||||
!baseData.value.some((row) => row.key === 'customer_special_pricing')
|
||||
) {
|
||||
try {
|
||||
const { getConfiguration } = await import('@/api/configuration')
|
||||
@@ -500,6 +502,7 @@ async function initConfig() {
|
||||
applySupportChatMenuEnabledFromRows(rows)
|
||||
applyPriceChannelAccessFromRows(rows)
|
||||
applyGroupSmsFromRows(rows)
|
||||
applyCustomerSpecialPricingFromRows(rows)
|
||||
} catch {
|
||||
/* کش قبلی میماند */
|
||||
}
|
||||
@@ -572,6 +575,9 @@ function syncMenuFlagsFromSetting(key: string | undefined, value: string) {
|
||||
if (key === 'group_sms') {
|
||||
setGroupSmsEnabledFromSettings(isSwitchOn(value))
|
||||
}
|
||||
if (key === 'customer_special_pricing') {
|
||||
setCustomerSpecialPricingEnabledFromSettings(isSwitchOn(value))
|
||||
}
|
||||
}
|
||||
|
||||
function onValueChange(row: Const, value: string) {
|
||||
|
||||
Reference in New Issue
Block a user