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
@@ -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
}"
>
<div class="setting-card__head">
<div class="setting-card__title-row">
<span v-if="readonly" class="setting-card__lock" title="فقط‌خواندنی">🔒</span>
<span class="setting-card__title">{{ title }}</span>
<a-switch
v-if="fieldType !== 'switch'"
:checked="isActive"
size="small"
class="setting-card__active-switch"
@change="onActiveChange"
>
<template #checkedChildren>فعال</template>
<template #unCheckedChildren>غیرفعال</template>
</a-switch>
</div>
<div class="setting-card__key">کلید: {{ settingKey }}</div>
<div v-if="help" class="setting-card__help">{{ help }}</div>
@@ -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<SettingFieldType>(() =>
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))
</script>
@@ -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;