`);
_push(ssrRenderComponent(_component_AForm, {
model: unref(formFields),
ref_key: "formRef",
ref: formRef
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_AFormItem, {
label: "",
name: "description",
rules: unref(inputRules)()
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$3, {
"place-holder": unref(config).useString("addACaption"),
value: unref(formFields).description,
"onUpdate:value": ($event) => unref(formFields).description = $event,
class: "customCaption border-zinc-5"
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$3, {
"place-holder": unref(config).useString("addACaption"),
value: unref(formFields).description,
"onUpdate:value": ($event) => unref(formFields).description = $event,
class: "customCaption border-zinc-5"
}, null, 8, ["place-holder", "value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`
`);
_push2(ssrRenderComponent(BasicIconOld, { icon: "vuesax-linear:document-text" }, null, _parent2, _scopeId));
_push2(`
${ssrInterpolate(unref(config).useString("productInformation"))}
`);
_push2(ssrRenderComponent(_sfc_main$4, {
rules: unref(inputRulesNoMessage)(),
value: unref(formFields).title_fa,
"onUpdate:value": ($event) => unref(formFields).title_fa = $event,
label: "name",
name: "title_fa"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("name"),
value: unref(formFields).title_fa,
"onUpdate:value": ($event) => unref(formFields).title_fa = $event
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("name"),
value: unref(formFields).title_fa,
"onUpdate:value": ($event) => unref(formFields).title_fa = $event
}, null, 8, ["place-holder", "value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_sfc_main$4, {
value: unref(formFields).collection_id,
"onUpdate:value": ($event) => unref(formFields).collection_id = $event,
label: "category"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$6, {
autofocus: false,
value: unref(formFields).collection_id,
"onUpdate:value": ($event) => unref(formFields).collection_id = $event,
items: collections.value,
placeholder: unref(config).useString("selectAnOption"),
size: "small",
"key-name": "id",
"value-name": "title",
focusable: false,
onChange: changeCollections,
getPopupContainer: (trigger) => trigger.parentNode
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$6, {
autofocus: false,
value: unref(formFields).collection_id,
"onUpdate:value": ($event) => unref(formFields).collection_id = $event,
items: collections.value,
placeholder: unref(config).useString("selectAnOption"),
size: "small",
"key-name": "id",
"value-name": "title",
focusable: false,
onChange: changeCollections,
getPopupContainer: (trigger) => trigger.parentNode
}, null, 8, ["value", "onUpdate:value", "items", "placeholder", "getPopupContainer"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_sfc_main$4, {
value: unref(formFields).code,
"onUpdate:value": ($event) => unref(formFields).code = $event,
label: "code"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("code"),
value: unref(formFields).code,
"onUpdate:value": ($event) => unref(formFields).code = $event
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("code"),
value: unref(formFields).code,
"onUpdate:value": ($event) => unref(formFields).code = $event
}, null, 8, ["place-holder", "value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
if (unref(formFields).collection_id === 1 || unref(formFields).collection_id === 2) {
_push2(`
`);
if (unref(config).useModule("productPercentFeeField")) {
_push2(ssrRenderComponent(_sfc_main$4, {
rules: unref(justNumberNoMessage)(),
value: unref(formFields).rial_fee,
"onUpdate:value": ($event) => unref(formFields).rial_fee = $event,
label: "rialFee",
name: "rial_fee"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("rialFee"),
value: unref(formFields).rial_fee,
"onUpdate:value": ($event) => unref(formFields).rial_fee = $event,
type: "price",
"addon-after": unref(config).lang == "en" ? unref(config).priceUnit : false,
"addon-before": unref(config).lang == "fa" ? unref(config).priceUnit : false
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("rialFee"),
value: unref(formFields).rial_fee,
"onUpdate:value": ($event) => unref(formFields).rial_fee = $event,
type: "price",
"addon-after": unref(config).lang == "en" ? unref(config).priceUnit : false,
"addon-before": unref(config).lang == "fa" ? unref(config).priceUnit : false
}, null, 8, ["place-holder", "value", "onUpdate:value", "addon-after", "addon-before"])
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(``);
}
if (unref(config).useModule("productPercentFeeField")) {
_push2(ssrRenderComponent(_sfc_main$4, {
value: unref(formFields).percent_fee,
"onUpdate:value": ($event) => unref(formFields).percent_fee = $event,
label: "percentFee",
rules: unref(justNumberRequiredNoMessage)(),
name: "percent_fee"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("percentFee"),
value: unref(formFields).percent_fee,
"onUpdate:value": ($event) => unref(formFields).percent_fee = $event,
type: "number",
inputmode: "decimal",
"addon-after": unref(config).lang == "en" ? "%" : false,
"addon-before": unref(config).lang == "fa" ? "%" : false
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("percentFee"),
value: unref(formFields).percent_fee,
"onUpdate:value": ($event) => unref(formFields).percent_fee = $event,
type: "number",
inputmode: "decimal",
"addon-after": unref(config).lang == "en" ? "%" : false,
"addon-before": unref(config).lang == "fa" ? "%" : false
}, null, 8, ["place-holder", "value", "onUpdate:value", "addon-after", "addon-before"])
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(``);
}
_push2(`
`);
} else {
_push2(``);
}
if (unref(config).useModule("productWeightField") && unref(priceType) === 1 && (unref(formFields).collection_id === 1 || unref(formFields).collection_id === 2)) {
_push2(ssrRenderComponent(_sfc_main$4, {
value: unref(formFields).weight,
"onUpdate:value": ($event) => unref(formFields).weight = $event,
label: "weight",
rules: unref(justNumberRequiredNoMessage)(),
name: "weight"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("weight"),
value: unref(formFields).weight,
"onUpdate:value": ($event) => unref(formFields).weight = $event,
type: "number",
inputmode: "decimal"
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("weight"),
value: unref(formFields).weight,
"onUpdate:value": ($event) => unref(formFields).weight = $event,
type: "number",
inputmode: "decimal"
}, null, 8, ["place-holder", "value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(``);
}
if (unref(priceType) === 1) {
_push2(ssrRenderComponent(_sfc_main$4, {
value: unref(formFields).price,
"onUpdate:value": ($event) => unref(formFields).price = $event,
label: "price",
rules: unref(formFields).auto_calculate ? "" : unref(justNumberRequiredNoMessage)(),
name: "price"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("price"),
value: unref(formFields).price,
"onUpdate:value": ($event) => unref(formFields).price = $event,
type: "price",
disabled: unref(formFields).auto_calculate,
"addon-before": unref(config).priceUnit
}, createSlots({ _: 2 }, [
unref(formFields).collection_id === 1 || unref(formFields).collection_id === 2 ? {
name: "addonAfter",
fn: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_select, {
value: unref(formFields).auto_calculate,
"onUpdate:value": ($event) => unref(formFields).auto_calculate = $event,
style: { "width": "90px" },
onChange: ($event) => unref(formFields).auto_calculate ? unref(formFields).price = void 0 : ""
}, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(ssrRenderComponent(_component_a_select_option, { value: true }, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(`${ssrInterpolate(unref(config).useString("auto"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("auto")), 1)
];
}
}),
_: 1
}, _parent5, _scopeId4));
_push5(ssrRenderComponent(_component_a_select_option, { value: false }, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(`${ssrInterpolate(unref(config).useString("manual"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("manual")), 1)
];
}
}),
_: 1
}, _parent5, _scopeId4));
} else {
return [
createVNode(_component_a_select_option, { value: true }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("auto")), 1)
]),
_: 1
}),
createVNode(_component_a_select_option, { value: false }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("manual")), 1)
]),
_: 1
})
];
}
}),
_: 1
}, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_select, {
value: unref(formFields).auto_calculate,
"onUpdate:value": ($event) => unref(formFields).auto_calculate = $event,
style: { "width": "90px" },
onChange: ($event) => unref(formFields).auto_calculate ? unref(formFields).price = void 0 : ""
}, {
default: withCtx(() => [
createVNode(_component_a_select_option, { value: true }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("auto")), 1)
]),
_: 1
}),
createVNode(_component_a_select_option, { value: false }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("manual")), 1)
]),
_: 1
})
]),
_: 1
}, 8, ["value", "onUpdate:value", "onChange"])
];
}
}),
key: "0"
} : void 0
]), _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("price"),
value: unref(formFields).price,
"onUpdate:value": ($event) => unref(formFields).price = $event,
type: "price",
disabled: unref(formFields).auto_calculate,
"addon-before": unref(config).priceUnit
}, createSlots({ _: 2 }, [
unref(formFields).collection_id === 1 || unref(formFields).collection_id === 2 ? {
name: "addonAfter",
fn: withCtx(() => [
createVNode(_component_a_select, {
value: unref(formFields).auto_calculate,
"onUpdate:value": ($event) => unref(formFields).auto_calculate = $event,
style: { "width": "90px" },
onChange: ($event) => unref(formFields).auto_calculate ? unref(formFields).price = void 0 : ""
}, {
default: withCtx(() => [
createVNode(_component_a_select_option, { value: true }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("auto")), 1)
]),
_: 1
}),
createVNode(_component_a_select_option, { value: false }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("manual")), 1)
]),
_: 1
})
]),
_: 1
}, 8, ["value", "onUpdate:value", "onChange"])
]),
key: "0"
} : void 0
]), 1032, ["place-holder", "value", "onUpdate:value", "disabled", "addon-before"])
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(``);
}
if (unref(priceType) === 1) {
_push2(ssrRenderComponent(_sfc_main$4, {
value: unref(formFields).count,
"onUpdate:value": ($event) => unref(formFields).count = $event,
label: "count",
rules: unref(justNumberNoMessage)(),
name: "count"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("count"),
value: unref(formFields).count,
"onUpdate:value": ($event) => unref(formFields).count = $event,
type: "number"
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("count"),
value: unref(formFields).count,
"onUpdate:value": ($event) => unref(formFields).count = $event,
type: "number"
}, null, 8, ["place-holder", "value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(``);
}
_push2(ssrRenderComponent(_sfc_main$4, {
height: "9rem",
value: unref(formFields).count,
"onUpdate:value": ($event) => unref(formFields).count = $event,
label: "pack"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_a_radio_group, {
class: "flex flex-col gap-4",
value: unref(formFields).sell_type,
"onUpdate:value": ($event) => unref(formFields).sell_type = $event
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_radio, { value: "numeric" }, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`
${ssrInterpolate(unref(config).useString("single"))}
${ssrInterpolate(unref(config).useString("easyDes"))}
`);
} else {
return [
createVNode("div", { class: "!flex !flex-col !w-full" }, [
createVNode("div", { class: "" }, toDisplayString(unref(config).useString("single")), 1),
createVNode("div", { class: "!text-xs text-gray-5" }, toDisplayString(unref(config).useString("easyDes")), 1)
])
];
}
}),
_: 1
}, _parent4, _scopeId3));
_push4(ssrRenderComponent(_component_a_radio, { value: "box" }, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`
${ssrInterpolate(unref(config).useString("box"))}
${ssrInterpolate(unref(config).useString("variantDes"))}
`);
} else {
return [
createVNode("div", { class: "!flex !flex-col !w-full" }, [
createVNode("div", { class: "" }, toDisplayString(unref(config).useString("box")), 1),
createVNode("div", { class: "!text-xs text-gray-5" }, toDisplayString(unref(config).useString("variantDes")), 1)
])
];
}
}),
_: 1
}, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_radio, { value: "numeric" }, {
default: withCtx(() => [
createVNode("div", { class: "!flex !flex-col !w-full" }, [
createVNode("div", { class: "" }, toDisplayString(unref(config).useString("single")), 1),
createVNode("div", { class: "!text-xs text-gray-5" }, toDisplayString(unref(config).useString("easyDes")), 1)
])
]),
_: 1
}),
createVNode(_component_a_radio, { value: "box" }, {
default: withCtx(() => [
createVNode("div", { class: "!flex !flex-col !w-full" }, [
createVNode("div", { class: "" }, toDisplayString(unref(config).useString("box")), 1),
createVNode("div", { class: "!text-xs text-gray-5" }, toDisplayString(unref(config).useString("variantDes")), 1)
])
]),
_: 1
})
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_a_radio_group, {
class: "flex flex-col gap-4",
value: unref(formFields).sell_type,
"onUpdate:value": ($event) => unref(formFields).sell_type = $event
}, {
default: withCtx(() => [
createVNode(_component_a_radio, { value: "numeric" }, {
default: withCtx(() => [
createVNode("div", { class: "!flex !flex-col !w-full" }, [
createVNode("div", { class: "" }, toDisplayString(unref(config).useString("single")), 1),
createVNode("div", { class: "!text-xs text-gray-5" }, toDisplayString(unref(config).useString("easyDes")), 1)
])
]),
_: 1
}),
createVNode(_component_a_radio, { value: "box" }, {
default: withCtx(() => [
createVNode("div", { class: "!flex !flex-col !w-full" }, [
createVNode("div", { class: "" }, toDisplayString(unref(config).useString("box")), 1),
createVNode("div", { class: "!text-xs text-gray-5" }, toDisplayString(unref(config).useString("variantDes")), 1)
])
]),
_: 1
})
]),
_: 1
}, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
if (unref(formFields).sell_type === "box") {
_push2(ssrRenderComponent(_sfc_main$4, {
value: unref(formFields).box_size,
"onUpdate:value": ($event) => unref(formFields).box_size = $event,
name: "box_size",
rules: unref(inputRules)(),
label: "countInBox"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
value: unref(formFields).box_size,
"onUpdate:value": ($event) => unref(formFields).box_size = $event,
type: "number",
onClick: unref(hotSelect),
"addon-after": unref(config).lang == "en" ? unref(config).useString("numberInCarton") : false,
"addon-before": unref(config).lang == "fa" ? unref(config).useString("numberInCarton") : false
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
value: unref(formFields).box_size,
"onUpdate:value": ($event) => unref(formFields).box_size = $event,
type: "number",
onClick: unref(hotSelect),
"addon-after": unref(config).lang == "en" ? unref(config).useString("numberInCarton") : false,
"addon-before": unref(config).lang == "fa" ? unref(config).useString("numberInCarton") : false
}, null, 8, ["value", "onUpdate:value", "onClick", "addon-after", "addon-before"])
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(``);
}
_push2(`
`);
if (unref(priceType) === 1) {
_push2(`
`);
_push2(ssrRenderComponent(BasicIconOld, { icon: "vuesax-linear:discount-circle" }, null, _parent2, _scopeId));
_push2(`
${ssrInterpolate(unref(config).useString("discount"))}
`);
_push2(ssrRenderComponent(_sfc_main$4, {
value: unref(formFields).discount_type,
"onUpdate:value": ($event) => unref(formFields).discount_type = $event,
label: "discountType"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_a_radio_group, {
value: unref(formFields).discount_type,
"onUpdate:value": ($event) => unref(formFields).discount_type = $event
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_radio, { value: void 0 }, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`${ssrInterpolate(unref(config).useString("disable"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("disable")), 1)
];
}
}),
_: 1
}, _parent4, _scopeId3));
_push4(ssrRenderComponent(_component_a_radio, { value: "simple" }, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`${ssrInterpolate(unref(config).useString("simple"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("simple")), 1)
];
}
}),
_: 1
}, _parent4, _scopeId3));
_push4(ssrRenderComponent(_component_a_radio, { value: "percent" }, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`${ssrInterpolate(unref(config).useString("percent"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("percent")), 1)
];
}
}),
_: 1
}, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_radio, { value: void 0 }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("disable")), 1)
]),
_: 1
}),
createVNode(_component_a_radio, { value: "simple" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("simple")), 1)
]),
_: 1
}),
createVNode(_component_a_radio, { value: "percent" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("percent")), 1)
]),
_: 1
})
];
}
}),
_: 1
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_a_radio_group, {
value: unref(formFields).discount_type,
"onUpdate:value": ($event) => unref(formFields).discount_type = $event
}, {
default: withCtx(() => [
createVNode(_component_a_radio, { value: void 0 }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("disable")), 1)
]),
_: 1
}),
createVNode(_component_a_radio, { value: "simple" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("simple")), 1)
]),
_: 1
}),
createVNode(_component_a_radio, { value: "percent" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("percent")), 1)
]),
_: 1
})
]),
_: 1
}, 8, ["value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
if (unref(priceType) === 1 && unref(formFields).discount_type) {
_push2(ssrRenderComponent(_sfc_main$4, {
value: unref(formFields).discount,
"onUpdate:value": ($event) => unref(formFields).discount = $event,
rules: unref(justNumberRequired)(),
name: "discount",
label: "amount"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
if (unref(formFields).discount_type) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("amount"),
value: unref(formFields).discount,
"onUpdate:value": ($event) => unref(formFields).discount = $event,
type: unref(formFields).discount_type === "simple" ? "price" : "number",
"addon-before": unref(formFields).discount_type === "simple" ? unref(config).priceUnit : "%"
}, null, _parent3, _scopeId2));
} else {
_push3(``);
}
} else {
return [
unref(formFields).discount_type ? (openBlock(), createBlock(_sfc_main$5, {
key: 0,
"place-holder": unref(config).useString("amount"),
value: unref(formFields).discount,
"onUpdate:value": ($event) => unref(formFields).discount = $event,
type: unref(formFields).discount_type === "simple" ? "price" : "number",
"addon-before": unref(formFields).discount_type === "simple" ? unref(config).priceUnit : "%"
}, null, 8, ["place-holder", "value", "onUpdate:value", "type", "addon-before"])) : createCommentVNode("", true)
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
_push2(``);
}
_push2(`
`);
} else {
_push2(``);
}
if (isEditForm.value) {
_push2(`
`);
_push2(ssrRenderComponent(BasicIconOld, { icon: "vuesax-linear:google-1" }, null, _parent2, _scopeId));
_push2(`
${ssrInterpolate(unref(config).useString("seo"))}
`);
_push2(ssrRenderComponent(_sfc_main$4, {
value: unref(formFields).seo_title,
"onUpdate:value": ($event) => unref(formFields).seo_title = $event,
name: "seo_title",
label: "seoTitle"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("seoTitle"),
value: unref(formFields).seo_title,
"onUpdate:value": ($event) => unref(formFields).seo_title = $event
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("seoTitle"),
value: unref(formFields).seo_title,
"onUpdate:value": ($event) => unref(formFields).seo_title = $event
}, null, 8, ["place-holder", "value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_sfc_main$4, {
value: unref(formFields).meta,
"onUpdate:value": ($event) => unref(formFields).meta = $event,
name: "meta",
label: "meta"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("meta"),
value: unref(formFields).meta,
"onUpdate:value": ($event) => unref(formFields).meta = $event
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("meta"),
value: unref(formFields).meta,
"onUpdate:value": ($event) => unref(formFields).meta = $event
}, null, 8, ["place-holder", "value", "onUpdate:value"])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_sfc_main$4, {
value: unref(formFields).meta,
"onUpdate:value": ($event) => unref(formFields).meta = $event,
key: "body",
class: "mt-3",
label: "aboutProduct"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`
`);
_push3(ssrRenderComponent(_sfc_main$3, {
value: unref(formFields).body,
"place-holder": unref(config).useString("writeAnyThingAboutProduct")
}, null, _parent3, _scopeId2));
_push3(`
`);
} else {
return [
createVNode("div", { dir: "ltr" }, [
createVNode(_sfc_main$3, {
value: unref(formFields).body,
"place-holder": unref(config).useString("writeAnyThingAboutProduct")
}, null, 8, ["value", "place-holder"])
])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`
`);
} else {
_push2(``);
}
_push2(`
`);
_push2(ssrRenderComponent(BasicIconOld, { icon: "vuesax-linear:layer" }, null, _parent2, _scopeId));
_push2(`
${ssrInterpolate(unref(config).useString("attributes"))}
`);
if (unref(items).length === 0) {
_push2(`
${ssrInterpolate(unref(config).useString("desAttribute"))}
`);
_push2(ssrRenderComponent(_sfc_main$7, {
type: "primary",
onClick: ($event) => addFeatureModal.value = true,
size: "small",
class: "!h-full !py-0 mt2"
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`
`);
_push3(ssrRenderComponent(BasicIconOld, { icon: "vuesax-linear:add" }, null, _parent3, _scopeId2));
_push3(`
${ssrInterpolate(unref(config).useString("addAttribute"))}
`);
} else {
return [
createVNode("div", { class: "flex items-center" }, [
createVNode(BasicIconOld, { icon: "vuesax-linear:add" }),
createVNode("div", null, toDisplayString(unref(config).useString("addAttribute")), 1)
])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`
`);
_push2(ssrRenderComponent(BasicIconOld, {
icon: "vuesax-linear:tag-2",
size: "50",
color: "gray"
}, null, _parent2, _scopeId));
_push2(`
`);
} else {
_push2(`
`);
ssrRenderList(unref(items), (val, i) => {
_push2(`
`);
_push2(ssrRenderComponent(BasicIconOld, { icon: "vuesax-linear:note-2" }, null, _parent2, _scopeId));
_push2(`
${ssrInterpolate(val.name)}
`);
ssrRenderList(val.new_feature, (attr) => {
_push2(ssrRenderComponent(_component_a_tag, null, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(attr.value)}`);
} else {
return [
createTextVNode(toDisplayString(attr.value), 1)
];
}
}),
_: 2
}, _parent2, _scopeId));
});
_push2(`
`);
});
_push2(`
`);
_push2(ssrRenderComponent(_sfc_main$1, {
type: "primary",
icon: "vuesax-linear:edit-2",
onClick: ($event) => addFeatureModal.value = true
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`${ssrInterpolate(unref(config).useString("edit"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("edit")), 1)
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(`
`);
}
_push2(`
`);
if (unref(priceType) == 2) {
_push2(`
`);
_push2(ssrRenderComponent(BasicIconOld, { icon: "vuesax-linear:data" }, null, _parent2, _scopeId));
_push2(`
${ssrInterpolate(unref(config).useString("variants"))}
`);
_push2(ssrRenderComponent(_sfc_main$7, {
disabled: unref(myAttributes).length === 0,
type: "primary",
class: "px-10 !h-2.5rem",
size: "small",
block: "",
onClick: ($event) => unref(addToVariants)()
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`
`);
_push3(ssrRenderComponent(BasicIconOld, { icon: "vuesax-linear:add" }, null, _parent3, _scopeId2));
_push3(`
${ssrInterpolate(unref(config).useString("addVariant"))}
`);
} else {
return [
createVNode("div", { class: "flex" }, [
createVNode(BasicIconOld, { icon: "vuesax-linear:add" }),
createVNode("div", null, toDisplayString(unref(config).useString("addVariant")), 1)
])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(``);
ssrRenderList(unref(formFields).variants, (item, index) => {
_push2(`
`);
ssrRenderList(unref(myAttributes), (val, ind) => {
_push2(`
`);
_push2(ssrRenderComponent(_component_AFormItem, {
label: val == null ? void 0 : val.name
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$6, {
value: unref(formFields).variants[index].attribute_values[unref(myAttributes)[ind].valueKey],
"onUpdate:value": ($event) => unref(formFields).variants[index].attribute_values[unref(myAttributes)[ind].valueKey] = $event,
items: val == null ? void 0 : val.values,
placeholder: unref(config).useString("pleaseSelectAnOption"),
size: "large",
"key-name": "id",
"value-name": "value"
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$6, {
value: unref(formFields).variants[index].attribute_values[unref(myAttributes)[ind].valueKey],
"onUpdate:value": ($event) => unref(formFields).variants[index].attribute_values[unref(myAttributes)[ind].valueKey] = $event,
items: val == null ? void 0 : val.values,
placeholder: unref(config).useString("pleaseSelectAnOption"),
size: "large",
"key-name": "id",
"value-name": "value"
}, null, 8, ["value", "onUpdate:value", "items", "placeholder"])
];
}
}),
_: 2
}, _parent2, _scopeId));
_push2(`
`);
});
_push2(`
`);
_push2(ssrRenderComponent(_component_AFormItem, {
name: ["variants", index, "sku"],
label: unref(config).useString("code")
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("code"),
value: unref(formFields).variants[index].sku,
"onUpdate:value": ($event) => unref(formFields).variants[index].sku = $event
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("code"),
value: unref(formFields).variants[index].sku,
"onUpdate:value": ($event) => unref(formFields).variants[index].sku = $event
}, null, 8, ["place-holder", "value", "onUpdate:value"])
];
}
}),
_: 2
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_AFormItem, {
name: ["variants", index, "price"],
label: unref(config).useString("price"),
rules: unref(formFields).variants[index].auto_calculate ? "" : unref(justNumberRequired)()
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("price"),
value: unref(formFields).variants[index].price,
"onUpdate:value": ($event) => unref(formFields).variants[index].price = $event,
type: "price",
disabled: unref(formFields).variants[index].auto_calculate,
"addon-before": unref(config).priceUnit
}, createSlots({ _: 2 }, [
unref(formFields).collection_id === 1 || unref(formFields).collection_id === 2 ? {
name: "addonAfter",
fn: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_select, {
value: unref(formFields).variants[index].auto_calculate,
"onUpdate:value": ($event) => unref(formFields).variants[index].auto_calculate = $event,
style: { "width": "90px" },
onChange: ($event) => unref(formFields).variants[index].auto_calculate ? unref(formFields).variants[index].price = void 0 : ""
}, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(ssrRenderComponent(_component_a_select_option, { value: true }, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(`${ssrInterpolate(unref(config).useString("auto"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("auto")), 1)
];
}
}),
_: 2
}, _parent5, _scopeId4));
_push5(ssrRenderComponent(_component_a_select_option, { value: false }, {
default: withCtx((_5, _push6, _parent6, _scopeId5) => {
if (_push6) {
_push6(`${ssrInterpolate(unref(config).useString("manual"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("manual")), 1)
];
}
}),
_: 2
}, _parent5, _scopeId4));
} else {
return [
createVNode(_component_a_select_option, { value: true }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("auto")), 1)
]),
_: 1
}),
createVNode(_component_a_select_option, { value: false }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("manual")), 1)
]),
_: 1
})
];
}
}),
_: 2
}, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_select, {
value: unref(formFields).variants[index].auto_calculate,
"onUpdate:value": ($event) => unref(formFields).variants[index].auto_calculate = $event,
style: { "width": "90px" },
onChange: ($event) => unref(formFields).variants[index].auto_calculate ? unref(formFields).variants[index].price = void 0 : ""
}, {
default: withCtx(() => [
createVNode(_component_a_select_option, { value: true }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("auto")), 1)
]),
_: 1
}),
createVNode(_component_a_select_option, { value: false }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("manual")), 1)
]),
_: 1
})
]),
_: 2
}, 1032, ["value", "onUpdate:value", "onChange"])
];
}
}),
key: "0"
} : void 0
]), _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("price"),
value: unref(formFields).variants[index].price,
"onUpdate:value": ($event) => unref(formFields).variants[index].price = $event,
type: "price",
disabled: unref(formFields).variants[index].auto_calculate,
"addon-before": unref(config).priceUnit
}, createSlots({ _: 2 }, [
unref(formFields).collection_id === 1 || unref(formFields).collection_id === 2 ? {
name: "addonAfter",
fn: withCtx(() => [
createVNode(_component_a_select, {
value: unref(formFields).variants[index].auto_calculate,
"onUpdate:value": ($event) => unref(formFields).variants[index].auto_calculate = $event,
style: { "width": "90px" },
onChange: ($event) => unref(formFields).variants[index].auto_calculate ? unref(formFields).variants[index].price = void 0 : ""
}, {
default: withCtx(() => [
createVNode(_component_a_select_option, { value: true }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("auto")), 1)
]),
_: 1
}),
createVNode(_component_a_select_option, { value: false }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("manual")), 1)
]),
_: 1
})
]),
_: 2
}, 1032, ["value", "onUpdate:value", "onChange"])
]),
key: "0"
} : void 0
]), 1032, ["place-holder", "value", "onUpdate:value", "disabled", "addon-before"])
];
}
}),
_: 2
}, _parent2, _scopeId));
if (unref(config).useModule("productWe@ightField") && (unref(formFields).collection_id === 1 || unref(formFields).collection_id === 2)) {
_push2(ssrRenderComponent(_component_AFormItem, {
label: unref(config).useString("weight"),
name: ["variants", index, "weight"],
rules: unref(justNumberRequired)()
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("weight"),
value: unref(formFields).variants[index].weight,
"onUpdate:value": ($event) => unref(formFields).variants[index].weight = $event,
inputmode: "decimal",
type: "number",
"addon-before": unref(config).useString("gram")
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("weight"),
value: unref(formFields).variants[index].weight,
"onUpdate:value": ($event) => unref(formFields).variants[index].weight = $event,
inputmode: "decimal",
type: "number",
"addon-before": unref(config).useString("gram")
}, null, 8, ["place-holder", "value", "onUpdate:value", "addon-before"])
];
}
}),
_: 2
}, _parent2, _scopeId));
} else {
_push2(``);
}
_push2(ssrRenderComponent(_component_AFormItem, {
name: ["variants", index, "discount_type"],
label: unref(config).useString("discountType")
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_a_radio_group, {
value: unref(formFields).variants[index].discount_type,
"onUpdate:value": ($event) => unref(formFields).variants[index].discount_type = $event
}, {
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
if (_push4) {
_push4(ssrRenderComponent(_component_a_radio, { value: void 0 }, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`${ssrInterpolate(unref(config).useString("disable"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("disable")), 1)
];
}
}),
_: 2
}, _parent4, _scopeId3));
_push4(ssrRenderComponent(_component_a_radio, { value: "simple" }, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`${ssrInterpolate(unref(config).useString("simple"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("simple")), 1)
];
}
}),
_: 2
}, _parent4, _scopeId3));
_push4(ssrRenderComponent(_component_a_radio, { value: "percent" }, {
default: withCtx((_4, _push5, _parent5, _scopeId4) => {
if (_push5) {
_push5(`${ssrInterpolate(unref(config).useString("percent"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("percent")), 1)
];
}
}),
_: 2
}, _parent4, _scopeId3));
} else {
return [
createVNode(_component_a_radio, { value: void 0 }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("disable")), 1)
]),
_: 1
}),
createVNode(_component_a_radio, { value: "simple" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("simple")), 1)
]),
_: 1
}),
createVNode(_component_a_radio, { value: "percent" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("percent")), 1)
]),
_: 1
})
];
}
}),
_: 2
}, _parent3, _scopeId2));
} else {
return [
createVNode(_component_a_radio_group, {
value: unref(formFields).variants[index].discount_type,
"onUpdate:value": ($event) => unref(formFields).variants[index].discount_type = $event
}, {
default: withCtx(() => [
createVNode(_component_a_radio, { value: void 0 }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("disable")), 1)
]),
_: 1
}),
createVNode(_component_a_radio, { value: "simple" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("simple")), 1)
]),
_: 1
}),
createVNode(_component_a_radio, { value: "percent" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("percent")), 1)
]),
_: 1
})
]),
_: 2
}, 1032, ["value", "onUpdate:value"])
];
}
}),
_: 2
}, _parent2, _scopeId));
if (unref(formFields).variants[index].discount_type && unref(priceType) === 2) {
_push2(ssrRenderComponent(_component_AFormItem, {
name: ["variants", index, "discount"],
label: unref(config).useString("amount"),
rules: unref(formFields).variants[index].discount_type === "simple" ? unref(justNumberRequiredMaxMin)(unref(formFields).variants[index].price) : unref(justNumberRequiredMaxMin)(-1)
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("amount"),
value: unref(formFields).variants[index].discount,
"onUpdate:value": ($event) => unref(formFields).variants[index].discount = $event,
type: unref(formFields).variants[index].discount_type === "simple" ? "price" : "number",
"addon-after": unref(formFields).variants[index].discount_type === "simple" ? unref(config).priceUnit : "%"
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("amount"),
value: unref(formFields).variants[index].discount,
"onUpdate:value": ($event) => unref(formFields).variants[index].discount = $event,
type: unref(formFields).variants[index].discount_type === "simple" ? "price" : "number",
"addon-after": unref(formFields).variants[index].discount_type === "simple" ? unref(config).priceUnit : "%"
}, null, 8, ["place-holder", "value", "onUpdate:value", "type", "addon-after"])
];
}
}),
_: 2
}, _parent2, _scopeId));
} else {
_push2(``);
}
_push2(ssrRenderComponent(_component_AFormItem, {
name: ["variants", index, "stock"],
label: unref(config).useString("stock")
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_sfc_main$5, {
"place-holder": unref(config).useString("stock"),
onClick: unref(hotSelect),
value: unref(formFields).variants[index].stock,
"onUpdate:value": ($event) => unref(formFields).variants[index].stock = $event,
type: "number"
}, null, _parent3, _scopeId2));
} else {
return [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("stock"),
onClick: unref(hotSelect),
value: unref(formFields).variants[index].stock,
"onUpdate:value": ($event) => unref(formFields).variants[index].stock = $event,
type: "number"
}, null, 8, ["place-holder", "onClick", "value", "onUpdate:value"])
];
}
}),
_: 2
}, _parent2, _scopeId));
_push2(`
`);
_push2(ssrRenderComponent(_sfc_main$7, {
icon: "vuesax-linear:trash",
danger: "",
block: "",
class: "!h-3rem",
onClick: ($event) => deleteVariant(item)
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`
${ssrInterpolate(unref(config).useString("deleteVariant"))}
`);
} else {
return [
createVNode("div", null, toDisplayString(unref(config).useString("deleteVariant")), 1)
];
}
}),
_: 2
}, _parent2, _scopeId));
_push2(`
`);
});
_push2(`
`);
} else {
_push2(``);
}
} else {
return [
createVNode(_component_AFormItem, {
label: "",
name: "description",
rules: unref(inputRules)()
}, {
default: withCtx(() => [
createVNode(_sfc_main$3, {
"place-holder": unref(config).useString("addACaption"),
value: unref(formFields).description,
"onUpdate:value": ($event) => unref(formFields).description = $event,
class: "customCaption border-zinc-5"
}, null, 8, ["place-holder", "value", "onUpdate:value"])
]),
_: 1
}, 8, ["rules"]),
createVNode("div", { class: "border-1 border-solid mt-5 py-5 border-gray-500 rounded-lg px-3" }, [
createVNode("div", {
class: ["relative top--8 px-2 w-fit flex gap-2 items-center", unref(config).isNightStore ? "bg-[#121212]" : "bg-white"]
}, [
createVNode(BasicIconOld, { icon: "vuesax-linear:document-text" }),
createVNode("div", { class: "text-[18px]" }, toDisplayString(unref(config).useString("productInformation")), 1)
], 2),
createVNode(_sfc_main$4, {
rules: unref(inputRulesNoMessage)(),
value: unref(formFields).title_fa,
"onUpdate:value": ($event) => unref(formFields).title_fa = $event,
label: "name",
name: "title_fa"
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("name"),
value: unref(formFields).title_fa,
"onUpdate:value": ($event) => unref(formFields).title_fa = $event
}, null, 8, ["place-holder", "value", "onUpdate:value"])
]),
_: 1
}, 8, ["rules", "value", "onUpdate:value"]),
createVNode(_sfc_main$4, {
value: unref(formFields).collection_id,
"onUpdate:value": ($event) => unref(formFields).collection_id = $event,
label: "category"
}, {
default: withCtx(() => [
createVNode(_sfc_main$6, {
autofocus: false,
value: unref(formFields).collection_id,
"onUpdate:value": ($event) => unref(formFields).collection_id = $event,
items: collections.value,
placeholder: unref(config).useString("selectAnOption"),
size: "small",
"key-name": "id",
"value-name": "title",
focusable: false,
onChange: changeCollections,
getPopupContainer: (trigger) => trigger.parentNode
}, null, 8, ["value", "onUpdate:value", "items", "placeholder", "getPopupContainer"])
]),
_: 1
}, 8, ["value", "onUpdate:value"]),
createVNode(_sfc_main$4, {
value: unref(formFields).code,
"onUpdate:value": ($event) => unref(formFields).code = $event,
label: "code"
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("code"),
value: unref(formFields).code,
"onUpdate:value": ($event) => unref(formFields).code = $event
}, null, 8, ["place-holder", "value", "onUpdate:value"])
]),
_: 1
}, 8, ["value", "onUpdate:value"]),
unref(formFields).collection_id === 1 || unref(formFields).collection_id === 2 ? (openBlock(), createBlock("div", { key: 0 }, [
unref(config).useModule("productPercentFeeField") ? (openBlock(), createBlock(_sfc_main$4, {
key: 0,
rules: unref(justNumberNoMessage)(),
value: unref(formFields).rial_fee,
"onUpdate:value": ($event) => unref(formFields).rial_fee = $event,
label: "rialFee",
name: "rial_fee"
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("rialFee"),
value: unref(formFields).rial_fee,
"onUpdate:value": ($event) => unref(formFields).rial_fee = $event,
type: "price",
"addon-after": unref(config).lang == "en" ? unref(config).priceUnit : false,
"addon-before": unref(config).lang == "fa" ? unref(config).priceUnit : false
}, null, 8, ["place-holder", "value", "onUpdate:value", "addon-after", "addon-before"])
]),
_: 1
}, 8, ["rules", "value", "onUpdate:value"])) : createCommentVNode("", true),
unref(config).useModule("productPercentFeeField") ? (openBlock(), createBlock(_sfc_main$4, {
key: 1,
value: unref(formFields).percent_fee,
"onUpdate:value": ($event) => unref(formFields).percent_fee = $event,
label: "percentFee",
rules: unref(justNumberRequiredNoMessage)(),
name: "percent_fee"
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("percentFee"),
value: unref(formFields).percent_fee,
"onUpdate:value": ($event) => unref(formFields).percent_fee = $event,
type: "number",
inputmode: "decimal",
"addon-after": unref(config).lang == "en" ? "%" : false,
"addon-before": unref(config).lang == "fa" ? "%" : false
}, null, 8, ["place-holder", "value", "onUpdate:value", "addon-after", "addon-before"])
]),
_: 1
}, 8, ["value", "onUpdate:value", "rules"])) : createCommentVNode("", true)
])) : createCommentVNode("", true),
unref(config).useModule("productWeightField") && unref(priceType) === 1 && (unref(formFields).collection_id === 1 || unref(formFields).collection_id === 2) ? (openBlock(), createBlock(_sfc_main$4, {
key: 1,
value: unref(formFields).weight,
"onUpdate:value": ($event) => unref(formFields).weight = $event,
label: "weight",
rules: unref(justNumberRequiredNoMessage)(),
name: "weight"
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("weight"),
value: unref(formFields).weight,
"onUpdate:value": ($event) => unref(formFields).weight = $event,
type: "number",
inputmode: "decimal"
}, null, 8, ["place-holder", "value", "onUpdate:value"])
]),
_: 1
}, 8, ["value", "onUpdate:value", "rules"])) : createCommentVNode("", true),
unref(priceType) === 1 ? (openBlock(), createBlock(_sfc_main$4, {
key: 2,
value: unref(formFields).price,
"onUpdate:value": ($event) => unref(formFields).price = $event,
label: "price",
rules: unref(formFields).auto_calculate ? "" : unref(justNumberRequiredNoMessage)(),
name: "price"
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("price"),
value: unref(formFields).price,
"onUpdate:value": ($event) => unref(formFields).price = $event,
type: "price",
disabled: unref(formFields).auto_calculate,
"addon-before": unref(config).priceUnit
}, createSlots({ _: 2 }, [
unref(formFields).collection_id === 1 || unref(formFields).collection_id === 2 ? {
name: "addonAfter",
fn: withCtx(() => [
createVNode(_component_a_select, {
value: unref(formFields).auto_calculate,
"onUpdate:value": ($event) => unref(formFields).auto_calculate = $event,
style: { "width": "90px" },
onChange: ($event) => unref(formFields).auto_calculate ? unref(formFields).price = void 0 : ""
}, {
default: withCtx(() => [
createVNode(_component_a_select_option, { value: true }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("auto")), 1)
]),
_: 1
}),
createVNode(_component_a_select_option, { value: false }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("manual")), 1)
]),
_: 1
})
]),
_: 1
}, 8, ["value", "onUpdate:value", "onChange"])
]),
key: "0"
} : void 0
]), 1032, ["place-holder", "value", "onUpdate:value", "disabled", "addon-before"])
]),
_: 1
}, 8, ["value", "onUpdate:value", "rules"])) : createCommentVNode("", true),
unref(priceType) === 1 ? (openBlock(), createBlock(_sfc_main$4, {
key: 3,
value: unref(formFields).count,
"onUpdate:value": ($event) => unref(formFields).count = $event,
label: "count",
rules: unref(justNumberNoMessage)(),
name: "count"
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("count"),
value: unref(formFields).count,
"onUpdate:value": ($event) => unref(formFields).count = $event,
type: "number"
}, null, 8, ["place-holder", "value", "onUpdate:value"])
]),
_: 1
}, 8, ["value", "onUpdate:value", "rules"])) : createCommentVNode("", true),
createVNode(_sfc_main$4, {
height: "9rem",
value: unref(formFields).count,
"onUpdate:value": ($event) => unref(formFields).count = $event,
label: "pack"
}, {
default: withCtx(() => [
createVNode(_component_a_radio_group, {
class: "flex flex-col gap-4",
value: unref(formFields).sell_type,
"onUpdate:value": ($event) => unref(formFields).sell_type = $event
}, {
default: withCtx(() => [
createVNode(_component_a_radio, { value: "numeric" }, {
default: withCtx(() => [
createVNode("div", { class: "!flex !flex-col !w-full" }, [
createVNode("div", { class: "" }, toDisplayString(unref(config).useString("single")), 1),
createVNode("div", { class: "!text-xs text-gray-5" }, toDisplayString(unref(config).useString("easyDes")), 1)
])
]),
_: 1
}),
createVNode(_component_a_radio, { value: "box" }, {
default: withCtx(() => [
createVNode("div", { class: "!flex !flex-col !w-full" }, [
createVNode("div", { class: "" }, toDisplayString(unref(config).useString("box")), 1),
createVNode("div", { class: "!text-xs text-gray-5" }, toDisplayString(unref(config).useString("variantDes")), 1)
])
]),
_: 1
})
]),
_: 1
}, 8, ["value", "onUpdate:value"])
]),
_: 1
}, 8, ["value", "onUpdate:value"]),
unref(formFields).sell_type === "box" ? (openBlock(), createBlock(_sfc_main$4, {
key: 4,
value: unref(formFields).box_size,
"onUpdate:value": ($event) => unref(formFields).box_size = $event,
name: "box_size",
rules: unref(inputRules)(),
label: "countInBox"
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
value: unref(formFields).box_size,
"onUpdate:value": ($event) => unref(formFields).box_size = $event,
type: "number",
onClick: unref(hotSelect),
"addon-after": unref(config).lang == "en" ? unref(config).useString("numberInCarton") : false,
"addon-before": unref(config).lang == "fa" ? unref(config).useString("numberInCarton") : false
}, null, 8, ["value", "onUpdate:value", "onClick", "addon-after", "addon-before"])
]),
_: 1
}, 8, ["value", "onUpdate:value", "rules"])) : createCommentVNode("", true)
]),
unref(priceType) === 1 ? (openBlock(), createBlock("div", {
key: 0,
class: "border-1 border-solid mt-5 py-5 border-gray-500 rounded-lg px-3"
}, [
createVNode("div", {
class: ["relative top--8 px-2 w-fit flex gap-2 items-center", unref(config).isNightStore ? "bg-[#121212]" : "bg-white"]
}, [
createVNode(BasicIconOld, { icon: "vuesax-linear:discount-circle" }),
createVNode("div", { class: "text-[18px]" }, toDisplayString(unref(config).useString("discount")), 1)
], 2),
createVNode(_sfc_main$4, {
value: unref(formFields).discount_type,
"onUpdate:value": ($event) => unref(formFields).discount_type = $event,
label: "discountType"
}, {
default: withCtx(() => [
createVNode(_component_a_radio_group, {
value: unref(formFields).discount_type,
"onUpdate:value": ($event) => unref(formFields).discount_type = $event
}, {
default: withCtx(() => [
createVNode(_component_a_radio, { value: void 0 }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("disable")), 1)
]),
_: 1
}),
createVNode(_component_a_radio, { value: "simple" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("simple")), 1)
]),
_: 1
}),
createVNode(_component_a_radio, { value: "percent" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("percent")), 1)
]),
_: 1
})
]),
_: 1
}, 8, ["value", "onUpdate:value"])
]),
_: 1
}, 8, ["value", "onUpdate:value"]),
unref(priceType) === 1 && unref(formFields).discount_type ? (openBlock(), createBlock(_sfc_main$4, {
key: 0,
value: unref(formFields).discount,
"onUpdate:value": ($event) => unref(formFields).discount = $event,
rules: unref(justNumberRequired)(),
name: "discount",
label: "amount"
}, {
default: withCtx(() => [
unref(formFields).discount_type ? (openBlock(), createBlock(_sfc_main$5, {
key: 0,
"place-holder": unref(config).useString("amount"),
value: unref(formFields).discount,
"onUpdate:value": ($event) => unref(formFields).discount = $event,
type: unref(formFields).discount_type === "simple" ? "price" : "number",
"addon-before": unref(formFields).discount_type === "simple" ? unref(config).priceUnit : "%"
}, null, 8, ["place-holder", "value", "onUpdate:value", "type", "addon-before"])) : createCommentVNode("", true)
]),
_: 1
}, 8, ["value", "onUpdate:value", "rules"])) : createCommentVNode("", true)
])) : createCommentVNode("", true),
isEditForm.value ? (openBlock(), createBlock("div", {
key: 1,
class: "border-1 border-solid mt-5 py-5 border-gray-500 rounded-lg px-3"
}, [
createVNode("div", {
class: ["relative top--8 px-2 w-fit flex gap-2 items-center", unref(config).isNightStore ? "bg-[#121212]" : "bg-white"]
}, [
createVNode(BasicIconOld, { icon: "vuesax-linear:google-1" }),
createVNode("div", { class: "text-[18px]" }, toDisplayString(unref(config).useString("seo")), 1)
], 2),
createVNode(_sfc_main$4, {
value: unref(formFields).seo_title,
"onUpdate:value": ($event) => unref(formFields).seo_title = $event,
name: "seo_title",
label: "seoTitle"
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("seoTitle"),
value: unref(formFields).seo_title,
"onUpdate:value": ($event) => unref(formFields).seo_title = $event
}, null, 8, ["place-holder", "value", "onUpdate:value"])
]),
_: 1
}, 8, ["value", "onUpdate:value"]),
createVNode(_sfc_main$4, {
value: unref(formFields).meta,
"onUpdate:value": ($event) => unref(formFields).meta = $event,
name: "meta",
label: "meta"
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("meta"),
value: unref(formFields).meta,
"onUpdate:value": ($event) => unref(formFields).meta = $event
}, null, 8, ["place-holder", "value", "onUpdate:value"])
]),
_: 1
}, 8, ["value", "onUpdate:value"]),
createVNode(_sfc_main$4, {
value: unref(formFields).meta,
"onUpdate:value": ($event) => unref(formFields).meta = $event,
key: "body",
class: "mt-3",
label: "aboutProduct"
}, {
default: withCtx(() => [
createVNode("div", { dir: "ltr" }, [
createVNode(_sfc_main$3, {
value: unref(formFields).body,
"place-holder": unref(config).useString("writeAnyThingAboutProduct")
}, null, 8, ["value", "place-holder"])
])
]),
_: 1
}, 8, ["value", "onUpdate:value"])
])) : createCommentVNode("", true),
createVNode("div", { class: "border-1 border-solid mt-5 py-5 border-gray-500 rounded-lg px-3" }, [
createVNode("div", {
class: ["relative top--8 px-2 w-fit flex gap-2 items-center", unref(config).isNightStore ? "bg-[#121212]" : "bg-white"]
}, [
createVNode(BasicIconOld, { icon: "vuesax-linear:layer" }),
createVNode("div", { class: "text-[18px]" }, toDisplayString(unref(config).useString("attributes")), 1)
], 2),
unref(items).length === 0 ? (openBlock(), createBlock("div", {
key: 0,
class: "flex items-center gap-2"
}, [
createVNode("div", { class: "gap-2" }, [
createVNode("div", { class: "mb-1" }, toDisplayString(unref(config).useString("desAttribute")), 1),
createVNode(_sfc_main$7, {
type: "primary",
onClick: ($event) => addFeatureModal.value = true,
size: "small",
class: "!h-full !py-0 mt2"
}, {
default: withCtx(() => [
createVNode("div", { class: "flex items-center" }, [
createVNode(BasicIconOld, { icon: "vuesax-linear:add" }),
createVNode("div", null, toDisplayString(unref(config).useString("addAttribute")), 1)
])
]),
_: 1
}, 8, ["onClick"])
]),
createVNode(BasicIconOld, {
icon: "vuesax-linear:tag-2",
size: "50",
color: "gray"
})
])) : (openBlock(), createBlock("div", { key: 1 }, [
(openBlock(true), createBlock(Fragment, null, renderList(unref(items), (val, i) => {
return openBlock(), createBlock("div", { class: "mb3" }, [
createVNode("div", { class: "flex gap-2" }, [
createVNode("div", null, [
createVNode(BasicIconOld, { icon: "vuesax-linear:note-2" })
]),
createVNode("div", null, toDisplayString(val.name), 1)
]),
createVNode("div", { class: "mt2" }, [
(openBlock(true), createBlock(Fragment, null, renderList(val.new_feature, (attr) => {
return openBlock(), createBlock(_component_a_tag, null, {
default: withCtx(() => [
createTextVNode(toDisplayString(attr.value), 1)
]),
_: 2
}, 1024);
}), 256))
])
]);
}), 256)),
createVNode("div", { class: "flex justify-end" }, [
createVNode(_sfc_main$1, {
type: "primary",
icon: "vuesax-linear:edit-2",
onClick: ($event) => addFeatureModal.value = true
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("edit")), 1)
]),
_: 1
}, 8, ["onClick"])
])
]))
]),
unref(priceType) == 2 ? (openBlock(), createBlock("div", {
key: 2,
class: "border-1 border-solid mt-5 py-5 border-gray-500 rounded-lg px-3"
}, [
createVNode("div", {
class: ["relative top--8 px-2 w-fit flex gap-2 items-center", unref(config).isNightStore ? "bg-[#121212]" : "bg-white"]
}, [
createVNode(BasicIconOld, { icon: "vuesax-linear:data" }),
createVNode("div", { class: "text-[18px]" }, toDisplayString(unref(config).useString("variants")), 1)
], 2),
createVNode(_sfc_main$7, {
disabled: unref(myAttributes).length === 0,
type: "primary",
class: "px-10 !h-2.5rem",
size: "small",
block: "",
onClick: ($event) => unref(addToVariants)()
}, {
default: withCtx(() => [
createVNode("div", { class: "flex" }, [
createVNode(BasicIconOld, { icon: "vuesax-linear:add" }),
createVNode("div", null, toDisplayString(unref(config).useString("addVariant")), 1)
])
]),
_: 1
}, 8, ["disabled", "onClick"]),
(openBlock(true), createBlock(Fragment, null, renderList(unref(formFields).variants, (item, index) => {
return openBlock(), createBlock("div", {
key: index,
onChange: ($event) => variants.value = unref(formFields).variants,
class: ["w-full rounded-lg mt-2 p-2", unref(config).isNightStore ? "bg-zinc-9" : "bg-gray-100"]
}, [
createVNode("div", { class: "grid grid-cols-2 gap-2 rounded-lg border-1 border-solid p-2 border-gray-200 w-full" }, [
(openBlock(true), createBlock(Fragment, null, renderList(unref(myAttributes), (val, ind) => {
return openBlock(), createBlock("div", {
class: "w-full",
onFocus: (e) => e.preventDefault()
}, [
createVNode(_component_AFormItem, {
label: val == null ? void 0 : val.name
}, {
default: withCtx(() => [
createVNode(_sfc_main$6, {
value: unref(formFields).variants[index].attribute_values[unref(myAttributes)[ind].valueKey],
"onUpdate:value": ($event) => unref(formFields).variants[index].attribute_values[unref(myAttributes)[ind].valueKey] = $event,
items: val == null ? void 0 : val.values,
placeholder: unref(config).useString("pleaseSelectAnOption"),
size: "large",
"key-name": "id",
"value-name": "value"
}, null, 8, ["value", "onUpdate:value", "items", "placeholder"])
]),
_: 2
}, 1032, ["label"])
], 40, ["onFocus"]);
}), 256))
]),
createVNode("div", { class: "" }, [
createVNode("div", { class: "" }, [
createVNode(_component_AFormItem, {
name: ["variants", index, "sku"],
label: unref(config).useString("code")
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("code"),
value: unref(formFields).variants[index].sku,
"onUpdate:value": ($event) => unref(formFields).variants[index].sku = $event
}, null, 8, ["place-holder", "value", "onUpdate:value"])
]),
_: 2
}, 1032, ["name", "label"]),
createVNode(_component_AFormItem, {
name: ["variants", index, "price"],
label: unref(config).useString("price"),
rules: unref(formFields).variants[index].auto_calculate ? "" : unref(justNumberRequired)()
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("price"),
value: unref(formFields).variants[index].price,
"onUpdate:value": ($event) => unref(formFields).variants[index].price = $event,
type: "price",
disabled: unref(formFields).variants[index].auto_calculate,
"addon-before": unref(config).priceUnit
}, createSlots({ _: 2 }, [
unref(formFields).collection_id === 1 || unref(formFields).collection_id === 2 ? {
name: "addonAfter",
fn: withCtx(() => [
createVNode(_component_a_select, {
value: unref(formFields).variants[index].auto_calculate,
"onUpdate:value": ($event) => unref(formFields).variants[index].auto_calculate = $event,
style: { "width": "90px" },
onChange: ($event) => unref(formFields).variants[index].auto_calculate ? unref(formFields).variants[index].price = void 0 : ""
}, {
default: withCtx(() => [
createVNode(_component_a_select_option, { value: true }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("auto")), 1)
]),
_: 1
}),
createVNode(_component_a_select_option, { value: false }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("manual")), 1)
]),
_: 1
})
]),
_: 2
}, 1032, ["value", "onUpdate:value", "onChange"])
]),
key: "0"
} : void 0
]), 1032, ["place-holder", "value", "onUpdate:value", "disabled", "addon-before"])
]),
_: 2
}, 1032, ["name", "label", "rules"]),
unref(config).useModule("productWe@ightField") && (unref(formFields).collection_id === 1 || unref(formFields).collection_id === 2) ? (openBlock(), createBlock(_component_AFormItem, {
key: 0,
label: unref(config).useString("weight"),
name: ["variants", index, "weight"],
rules: unref(justNumberRequired)()
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("weight"),
value: unref(formFields).variants[index].weight,
"onUpdate:value": ($event) => unref(formFields).variants[index].weight = $event,
inputmode: "decimal",
type: "number",
"addon-before": unref(config).useString("gram")
}, null, 8, ["place-holder", "value", "onUpdate:value", "addon-before"])
]),
_: 2
}, 1032, ["label", "name", "rules"])) : createCommentVNode("", true),
createVNode(_component_AFormItem, {
name: ["variants", index, "discount_type"],
label: unref(config).useString("discountType")
}, {
default: withCtx(() => [
createVNode(_component_a_radio_group, {
value: unref(formFields).variants[index].discount_type,
"onUpdate:value": ($event) => unref(formFields).variants[index].discount_type = $event
}, {
default: withCtx(() => [
createVNode(_component_a_radio, { value: void 0 }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("disable")), 1)
]),
_: 1
}),
createVNode(_component_a_radio, { value: "simple" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("simple")), 1)
]),
_: 1
}),
createVNode(_component_a_radio, { value: "percent" }, {
default: withCtx(() => [
createTextVNode(toDisplayString(unref(config).useString("percent")), 1)
]),
_: 1
})
]),
_: 2
}, 1032, ["value", "onUpdate:value"])
]),
_: 2
}, 1032, ["name", "label"]),
unref(formFields).variants[index].discount_type && unref(priceType) === 2 ? (openBlock(), createBlock(_component_AFormItem, {
key: 1,
name: ["variants", index, "discount"],
label: unref(config).useString("amount"),
rules: unref(formFields).variants[index].discount_type === "simple" ? unref(justNumberRequiredMaxMin)(unref(formFields).variants[index].price) : unref(justNumberRequiredMaxMin)(-1)
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("amount"),
value: unref(formFields).variants[index].discount,
"onUpdate:value": ($event) => unref(formFields).variants[index].discount = $event,
type: unref(formFields).variants[index].discount_type === "simple" ? "price" : "number",
"addon-after": unref(formFields).variants[index].discount_type === "simple" ? unref(config).priceUnit : "%"
}, null, 8, ["place-holder", "value", "onUpdate:value", "type", "addon-after"])
]),
_: 2
}, 1032, ["name", "label", "rules"])) : createCommentVNode("", true),
createVNode(_component_AFormItem, {
name: ["variants", index, "stock"],
label: unref(config).useString("stock")
}, {
default: withCtx(() => [
createVNode(_sfc_main$5, {
"place-holder": unref(config).useString("stock"),
onClick: unref(hotSelect),
value: unref(formFields).variants[index].stock,
"onUpdate:value": ($event) => unref(formFields).variants[index].stock = $event,
type: "number"
}, null, 8, ["place-holder", "onClick", "value", "onUpdate:value"])
]),
_: 2
}, 1032, ["name", "label"])
]),
createVNode(_sfc_main$7, {
icon: "vuesax-linear:trash",
danger: "",
block: "",
class: "!h-3rem",
onClick: ($event) => deleteVariant(item)
}, {
default: withCtx(() => [
createVNode("div", null, toDisplayString(unref(config).useString("deleteVariant")), 1)
]),
_: 2
}, 1032, ["onClick"])
])
], 42, ["onChange"]);
}), 128))
])) : createCommentVNode("", true)
];
}
}),
_: 1
}, _parent));
_push(`