admin big changes

This commit is contained in:
2026-06-13 17:38:35 +03:30
parent 213ef1a1b7
commit 0c404ee3e1
14 changed files with 188 additions and 276 deletions
@@ -6,8 +6,8 @@
:disabled="disabled"
@change="onSwitchChange"
>
<template #checkedChildren>فعال</template>
<template #unCheckedChildren>غیرفعال</template>
<template #checkedChildren>{{ labels.on }}</template>
<template #unCheckedChildren>{{ labels.off }}</template>
</a-switch>
<ZaarboxPriceKeyField
@@ -63,10 +63,11 @@
<script setup lang="ts">
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) {