Hide box settings and rename customization labels

This commit is contained in:
Ruslan Bakiev
2026-04-09 16:42:14 +07:00
parent d6f1a03501
commit de5fc6b4a8
2 changed files with 8 additions and 19 deletions

View File

@@ -14,7 +14,6 @@ definePageMeta({
type CatalogSettingItem = CatalogProductTypeSettingsQuery['catalogProductTypeSettings'][number];
type CatalogSettingForm = {
productType: string;
showQuantityPerBox: boolean;
allowCustomLength: boolean;
customLengthMinM: string;
customLengthMaxM: string;
@@ -40,7 +39,6 @@ function toInputValue(value: number | null | undefined) {
function createForm(item: CatalogSettingItem): CatalogSettingForm {
return {
productType: item.productType,
showQuantityPerBox: item.showQuantityPerBox,
allowCustomLength: item.allowCustomLength,
customLengthMinM: toInputValue(item.customLengthMinM),
customLengthMaxM: toInputValue(item.customLengthMaxM),
@@ -92,7 +90,7 @@ async function saveAllSettings() {
const result = await saveSettingMutation.mutate({
input: {
productType: form.productType,
showQuantityPerBox: form.showQuantityPerBox,
showQuantityPerBox: false,
allowCustomLength: form.allowCustomLength,
customLengthMinM: form.allowCustomLength ? parseOptionalInteger(form.customLengthMinM) : null,
customLengthMaxM: form.allowCustomLength ? parseOptionalInteger(form.customLengthMaxM) : null,
@@ -139,24 +137,19 @@ async function saveAllSettings() {
<div class="grid gap-3 md:grid-cols-2">
<label class="surface-card flex items-center justify-between gap-4 rounded-[22px] p-4">
<span class="text-sm font-semibold text-[#123824]">Своя длина</span>
<span class="text-sm font-semibold text-[#123824]">Любая длина</span>
<input v-model="formFor(item).allowCustomLength" type="checkbox" class="toggle toggle-success">
</label>
<label class="surface-card flex items-center justify-between gap-4 rounded-[22px] p-4">
<span class="text-sm font-semibold text-[#123824]">Своя втулка</span>
<span class="text-sm font-semibold text-[#123824]">Втулка с логотипом</span>
<input v-model="formFor(item).allowCustomSleeveBrand" type="checkbox" class="toggle toggle-success">
</label>
<label class="surface-card flex items-center justify-between gap-4 rounded-[22px] p-4">
<span class="text-sm font-semibold text-[#123824]">Своя надпись</span>
<span class="text-sm font-semibold text-[#123824]">Нанесение надписи</span>
<input v-model="formFor(item).allowCustomLabel" type="checkbox" class="toggle toggle-success">
</label>
<label class="surface-card flex items-center justify-between gap-4 rounded-[22px] p-4">
<span class="text-sm font-semibold text-[#123824]">Показывать короб</span>
<input v-model="formFor(item).showQuantityPerBox" type="checkbox" class="toggle toggle-success">
</label>
</div>
<div v-if="formFor(item).allowCustomLength" class="rounded-[24px] bg-[#f7fbf8] p-4">