feat: add options to select aspect ratio and cron algo for product images
This commit is contained in:
@@ -61,7 +61,3 @@ function confirmedRemove(event) {
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
||||
|
||||
@@ -13,10 +13,6 @@
|
||||
<span class="tw:font-bold tw:dark:text-slate-200">Максимальное кол-во страниц:</span>
|
||||
{{ value.data.max_page_count }}
|
||||
</div>
|
||||
<div>
|
||||
<span class="tw:font-bold tw:dark:text-slate-200">Соотношение сторон:</span>
|
||||
{{ value.data.image_aspect_ratio || '1:1' }}
|
||||
</div>
|
||||
</div>
|
||||
</BaseBlock>
|
||||
</template>
|
||||
|
||||
@@ -37,18 +37,6 @@
|
||||
</template>
|
||||
</FormItem>
|
||||
|
||||
<!-- Раздел Изображения -->
|
||||
<div class="tw:border-t tw:border-gray-200 tw:pt-6">
|
||||
<h3 class="tw:text-lg tw:font-medium tw:mb-4">Изображения</h3>
|
||||
<FormItem label="Соотношение сторон">
|
||||
<template #default>
|
||||
<AspectRatioSelect v-model="imageAspectRatio"/>
|
||||
</template>
|
||||
<template #help>
|
||||
Выберите соотношение сторон для изображений товаров.
|
||||
</template>
|
||||
</FormItem>
|
||||
</div>
|
||||
</div>
|
||||
</Panel>
|
||||
|
||||
@@ -149,30 +137,13 @@ import BaseForm from "@/components/MainPageConfigurator/Forms/BaseForm.vue";
|
||||
import FormItem from "@/components/MainPageConfigurator/Forms/FormItem.vue";
|
||||
import CategorySelect from "@/components/Form/CategorySelect.vue";
|
||||
import {Fieldset, InputNumber, InputText, Panel, ToggleSwitch} from "primevue";
|
||||
import AspectRatioSelect from "@/components/MainPageConfigurator/Forms/AspectRatioSelect.vue";
|
||||
|
||||
const draft = ref(null);
|
||||
const model = defineModel();
|
||||
const emit = defineEmits(['cancel']);
|
||||
|
||||
const imageAspectRatio = computed({
|
||||
get() {
|
||||
return draft.value.data.image_aspect_ratio || '1:1';
|
||||
},
|
||||
set(value) {
|
||||
draft.value.data.image_aspect_ratio = value;
|
||||
}
|
||||
});
|
||||
|
||||
const isChanged = computed(() => {
|
||||
const normalize = (obj) => {
|
||||
const clone = JSON.parse(JSON.stringify(obj));
|
||||
if (clone.data && !clone.data.image_aspect_ratio) {
|
||||
clone.data.image_aspect_ratio = '1:1';
|
||||
}
|
||||
return JSON.stringify(clone);
|
||||
};
|
||||
return md5(normalize(model.value)) !== md5(normalize(draft.value));
|
||||
return md5(JSON.stringify(model.value)) !== md5(JSON.stringify(draft.value));
|
||||
});
|
||||
|
||||
// Инициализация carousel, если его нет (только для записи)
|
||||
|
||||
@@ -26,15 +26,6 @@
|
||||
Ограничение страниц снижает нагрузку на сервер.
|
||||
</template>
|
||||
</FormItem>
|
||||
|
||||
<FormItem label="Соотношение сторон">
|
||||
<template #default>
|
||||
<AspectRatioSelect v-model="draft.data.image_aspect_ratio"/>
|
||||
</template>
|
||||
<template #help>
|
||||
Выберите соотношение сторон для изображений товаров.
|
||||
</template>
|
||||
</FormItem>
|
||||
</div>
|
||||
</BaseForm>
|
||||
</div>
|
||||
@@ -46,7 +37,6 @@ import {md5} from "js-md5";
|
||||
import BaseForm from "@/components/MainPageConfigurator/Forms/BaseForm.vue";
|
||||
import {InputNumber} from "primevue";
|
||||
import FormItem from "@/components/MainPageConfigurator/Forms/FormItem.vue";
|
||||
import AspectRatioSelect from "@/components/MainPageConfigurator/Forms/AspectRatioSelect.vue";
|
||||
|
||||
const draft = ref(null);
|
||||
const model = defineModel();
|
||||
@@ -72,7 +62,6 @@ onMounted(() => {
|
||||
draft.value = JSON.parse(JSON.stringify(model.value));
|
||||
if (draft.value.data) {
|
||||
if (draft.value.data.max_page_count) draft.value.data.max_page_count = parseInt(draft.value.data.max_page_count);
|
||||
if (!draft.value.data.image_aspect_ratio) draft.value.data.image_aspect_ratio = '1:1';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@ export const blocks = [
|
||||
goal_name: '',
|
||||
data: {
|
||||
max_page_count: 10,
|
||||
image_aspect_ratio: '1:1',
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -70,7 +69,6 @@ export const blocks = [
|
||||
data: {
|
||||
category_id: null,
|
||||
all_text: null,
|
||||
image_aspect_ratio: '1:1',
|
||||
carousel: {
|
||||
slides_per_view: null,
|
||||
space_between: null,
|
||||
|
||||
Reference in New Issue
Block a user