This commit is contained in:
Viet An
2026-05-25 15:23:12 +07:00
parent 5f2a98977b
commit 6685a43360
48 changed files with 732 additions and 2901 deletions

View File

@@ -206,10 +206,12 @@ const layoutMode = ref(layoutModes.GRID);
const convertToWebp = ref(false);
const webpQuality = ref(80);
const project = await $getdata("project", { id: props.projectId }, undefined, true);
const project = await $getdata("project", { filter: { id: props.projectId }, first: true });
const images = ref([]);
const isForProduct = computed(() => props.productId !== undefined);
const product = isForProduct.value ? await $getdata("product", { id: props.productId }, undefined, true) : undefined;
const product = isForProduct.value
? await $getdata("product", { filter: { id: props.productId }, first: true })
: undefined;
const showmodal = ref();
const imgshow = ref([]);
const hashtag = ref();
@@ -219,17 +221,21 @@ async function loadImages() {
const values =
"id,file__hashtag,file__code,file,create_time,file__code,file__type,file__doc_type,file__name,file__file,file__size,file__caption,file__user__fullname,";
const projectImages = await $getdata("projectfile", undefined, {
filter: { project: project.id, file__type: 2 },
values: values + "project",
sort: "-create_time",
const projectImages = await $getdata("projectfile", {
params: {
filter: { project: project.id, file__type: 2 },
values: values + "project",
sort: "-create_time",
},
});
if (isForProduct.value) {
const productImages = await $getdata("productfile", undefined, {
filter: { product: props.productId, file__type: 2 },
values: values + "product",
sort: "-create_time",
params: {
filter: { product: props.productId, file__type: 2 },
values: values + "product",
sort: "-create_time",
},
});
const sameTemplateImages = projectImages.filter((img) => img.file__name.startsWith(product.template_name));