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 @@
-