4/5/1404
This commit is contained in:
@@ -0,0 +1,151 @@
|
||||
import { defineComponent, ref, watch, unref, withCtx, createTextVNode, toDisplayString, createVNode, useSSRContext } from 'vue';
|
||||
import { ssrRenderAttr, ssrInterpolate, ssrRenderList, ssrRenderComponent } from 'vue/server-renderer';
|
||||
import { _ as _imports_0 } from './close_light-DbrEdRZI.mjs';
|
||||
import { u as useRouter, a as useConfigStore, t as reactiveProjectName } from './server.mjs';
|
||||
import { m as mediaFilesUrl, p as previewImg } from './handle-Bvvl_htN.mjs';
|
||||
import { _ as __nuxt_component_1, a as __nuxt_component_2 } from './RadioButton--E7lmHK3.mjs';
|
||||
|
||||
const maxFiles = 10;
|
||||
const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
__name: "index",
|
||||
__ssrInlineRender: true,
|
||||
setup(__props) {
|
||||
const router = useRouter();
|
||||
const config = useConfigStore();
|
||||
ref(null);
|
||||
const type = ref("");
|
||||
watch(mediaFilesUrl, (files) => {
|
||||
if (mediaFilesUrl.value.length === 0) previewImg.value = "";
|
||||
else if (mediaFilesUrl.value.length === 1) previewImg.value = mediaFilesUrl.value[0];
|
||||
else {
|
||||
previewImg.value = files[files.length - 1];
|
||||
}
|
||||
});
|
||||
const isVideo = (file) => file.includes(".mp4") || file.includes(".mov") || file.includes("video");
|
||||
return (_ctx, _push, _parent, _attrs) => {
|
||||
const _component_a_radio_group = __nuxt_component_1;
|
||||
const _component_a_radio_button = __nuxt_component_2;
|
||||
_push(`<!--[--><div class="w-full h-screen bg-black text-white"><div class="flex w-full p-4 gap-8 justify-between items-center"><div class="flex gap-8 items-center"><img${ssrRenderAttr("src", _imports_0)}${ssrRenderAttr("alt", unref(reactiveProjectName))} class="w-4"><div class="font-semibold text-lg">${ssrInterpolate(unref(config).useString("newStory"))}</div></div><div class="text-primary text-sm">${ssrInterpolate(unref(config).useString("next"))}</div></div><div class="w-full flex items-center justify-center">`);
|
||||
if (unref(previewImg)) {
|
||||
_push(`<img${ssrRenderAttr("src", unref(previewImg))}${ssrRenderAttr("alt", unref(reactiveProjectName))} class="w-full aspect-square">`);
|
||||
} else if (unref(mediaFilesUrl).length === 0) {
|
||||
_push(`<p class="empty-state">${ssrInterpolate(unref(config).useString("tapPlusToAdd"))}</p>`);
|
||||
} else {
|
||||
_push(`<!---->`);
|
||||
}
|
||||
_push(`</div><div class="media-picker"><div class="drop-area"><div class="media-grid"><!--[-->`);
|
||||
ssrRenderList(unref(mediaFilesUrl), (media, index) => {
|
||||
_push(`<div class="media-container">`);
|
||||
if (isVideo(media)) {
|
||||
_push(`<video${ssrRenderAttr("src", media)} class="media-preview" controls></video>`);
|
||||
} else {
|
||||
_push(`<img${ssrRenderAttr("src", media)} class="media-preview">`);
|
||||
}
|
||||
_push(`<button class="remove-btn">\u2716</button></div>`);
|
||||
});
|
||||
_push(`<!--]-->`);
|
||||
if (unref(mediaFilesUrl).length < maxFiles) {
|
||||
_push(`<div class="add-media text-black"><span>+</span></div>`);
|
||||
} else {
|
||||
_push(`<!---->`);
|
||||
}
|
||||
_push(`</div></div><input type="file" accept="image/*,video/*" multiple hidden></div></div><div class="absolute bottom-5 right-5 addStyle">`);
|
||||
_push(ssrRenderComponent(_component_a_radio_group, {
|
||||
value: type.value,
|
||||
"onUpdate:value": ($event) => type.value = $event,
|
||||
"button-style": "solid"
|
||||
}, {
|
||||
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
||||
if (_push2) {
|
||||
_push2(ssrRenderComponent(_component_a_radio_button, {
|
||||
onClick: ($event) => unref(router).push({ name: "add-product-excel-inputProductExcel" }),
|
||||
value: "productExcel"
|
||||
}, {
|
||||
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
||||
if (_push3) {
|
||||
_push3(`${ssrInterpolate(unref(config).useString("productExcel"))}`);
|
||||
} else {
|
||||
return [
|
||||
createTextVNode(toDisplayString(unref(config).useString("productExcel")), 1)
|
||||
];
|
||||
}
|
||||
}),
|
||||
_: 1
|
||||
}, _parent2, _scopeId));
|
||||
_push2(ssrRenderComponent(_component_a_radio_button, {
|
||||
onClick: ($event) => unref(router).push({ name: "add-product-inputProduct" }),
|
||||
value: "product"
|
||||
}, {
|
||||
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
||||
if (_push3) {
|
||||
_push3(`${ssrInterpolate(unref(config).useString("product2"))}`);
|
||||
} else {
|
||||
return [
|
||||
createTextVNode(toDisplayString(unref(config).useString("product2")), 1)
|
||||
];
|
||||
}
|
||||
}),
|
||||
_: 1
|
||||
}, _parent2, _scopeId));
|
||||
_push2(ssrRenderComponent(_component_a_radio_button, {
|
||||
onClick: ($event) => unref(router).push({ name: "add-story-inputStory" }),
|
||||
value: "story"
|
||||
}, {
|
||||
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
||||
if (_push3) {
|
||||
_push3(`${ssrInterpolate(unref(config).useString("story2"))}`);
|
||||
} else {
|
||||
return [
|
||||
createTextVNode(toDisplayString(unref(config).useString("story2")), 1)
|
||||
];
|
||||
}
|
||||
}),
|
||||
_: 1
|
||||
}, _parent2, _scopeId));
|
||||
} else {
|
||||
return [
|
||||
createVNode(_component_a_radio_button, {
|
||||
onClick: ($event) => unref(router).push({ name: "add-product-excel-inputProductExcel" }),
|
||||
value: "productExcel"
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(toDisplayString(unref(config).useString("productExcel")), 1)
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["onClick"]),
|
||||
createVNode(_component_a_radio_button, {
|
||||
onClick: ($event) => unref(router).push({ name: "add-product-inputProduct" }),
|
||||
value: "product"
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(toDisplayString(unref(config).useString("product2")), 1)
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["onClick"]),
|
||||
createVNode(_component_a_radio_button, {
|
||||
onClick: ($event) => unref(router).push({ name: "add-story-inputStory" }),
|
||||
value: "story"
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(toDisplayString(unref(config).useString("story2")), 1)
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["onClick"])
|
||||
];
|
||||
}
|
||||
}),
|
||||
_: 1
|
||||
}, _parent));
|
||||
_push(`</div><!--]-->`);
|
||||
};
|
||||
}
|
||||
});
|
||||
const _sfc_setup = _sfc_main.setup;
|
||||
_sfc_main.setup = (props, ctx) => {
|
||||
const ssrContext = useSSRContext();
|
||||
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("views/add/story/inputMedia/index.vue");
|
||||
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
||||
};
|
||||
|
||||
export { _sfc_main as _ };
|
||||
//# sourceMappingURL=index-CtLZsrmp.mjs.map
|
||||
Reference in New Issue
Block a user