From 0c404ee3e1a84927e1b9c5e5b7f80f3d19da333d Mon Sep 17 00:00:00 2001 From: adonis Date: Sat, 13 Jun 2026 17:38:35 +0330 Subject: [PATCH] admin big changes --- .../menuPages/configuration/SettingCard.vue | 30 +----- .../configuration/SettingValueField.vue | 15 +-- src/pages/menuPages/configuration/index.vue | 79 ++++++---------- .../menuPages/configuration/settingTypes.ts | 93 +++++++++++-------- src/pages/menuPages/customers/base/index.vue | 2 +- .../components/PriceMobileCardList.vue | 25 ++--- .../components/PriceMobileListItem.vue | 21 +++-- .../menuPages/pricing/components/table.vue | 46 +++------ src/pages/menuPages/pricing/index.vue | 75 +-------------- src/pages/menuPages/products/base/index.vue | 33 ++----- src/router/index.ts | 7 +- src/router/routes/products.ts | 3 +- src/utils/categorySelect.ts | 32 +++++++ src/utils/productCategories.ts | 3 + 14 files changed, 188 insertions(+), 276 deletions(-) create mode 100644 src/utils/categorySelect.ts diff --git a/src/pages/menuPages/configuration/SettingCard.vue b/src/pages/menuPages/configuration/SettingCard.vue index 07787b8..b78d73c 100644 --- a/src/pages/menuPages/configuration/SettingCard.vue +++ b/src/pages/menuPages/configuration/SettingCard.vue @@ -3,24 +3,13 @@ class="setting-card" :class="{ 'setting-card--readonly': readonly, - 'setting-card--saving': saving, - 'setting-card--inactive': !isActive && fieldType !== 'switch' + 'setting-card--saving': saving }" >
🔒 {{ title }} - - - -
کلید: {{ settingKey }}
{{ help }}
@@ -62,7 +51,6 @@ const props = defineProps<{ const emit = defineEmits<{ 'update:value': [value: string] - 'update:isActive': [value: boolean] }>() const settingKey = computed(() => props.row.key ?? '') @@ -74,12 +62,6 @@ const fieldType = computed(() => resolveSettingFieldType({ key: props.row.key, type: props.row.type }) ) -const isActive = computed(() => props.row.is_active !== false && props.row.is_active !== 0) - -function onActiveChange(checked: boolean) { - emit('update:isActive', checked) -} - const help = computed(() => helpText(props.row)) @@ -108,11 +90,6 @@ const help = computed(() => helpText(props.row)) border-color: #91caff; } - &--inactive { - opacity: 0.72; - background: #fafafa; - } - &__head { flex-shrink: 0; } @@ -123,11 +100,6 @@ const help = computed(() => helpText(props.row)) gap: 6px; } - &__active-switch { - margin-right: auto; - flex-shrink: 0; - } - &__lock { flex-shrink: 0; font-size: 13px; diff --git a/src/pages/menuPages/configuration/SettingValueField.vue b/src/pages/menuPages/configuration/SettingValueField.vue index e20b99b..1d652be 100644 --- a/src/pages/menuPages/configuration/SettingValueField.vue +++ b/src/pages/menuPages/configuration/SettingValueField.vue @@ -6,8 +6,8 @@ :disabled="disabled" @change="onSwitchChange" > - - + + import ZaarboxPriceKeyField from './ZaarboxPriceKeyField.vue' import { - isSwitchOn, parseSelectOptions, resolveSettingFieldType, - switchToString, + resolveSwitchChecked, + switchLabels, + switchValueFromChecked, type SettingFieldType } from './settingTypes' @@ -101,10 +102,12 @@ const selectItems = computed(() => }) ) -const switchChecked = computed(() => isSwitchOn(props.modelValue)) +const labels = computed(() => switchLabels(props.settingKey)) + +const switchChecked = computed(() => resolveSwitchChecked(props.settingKey, props.modelValue)) function onSwitchChange(checked: boolean) { - emit('update:value', switchToString(checked)) + emit('update:value', switchValueFromChecked(props.settingKey, checked)) } function onSelectChange(val: string | undefined) { diff --git a/src/pages/menuPages/configuration/index.vue b/src/pages/menuPages/configuration/index.vue index be5f49e..b09b179 100644 --- a/src/pages/menuPages/configuration/index.vue +++ b/src/pages/menuPages/configuration/index.vue @@ -14,16 +14,6 @@
-