2 lines
37 KiB
JavaScript
2 lines
37 KiB
JavaScript
import{c as a,I as ge,d as Ue,n as we,O as it,o as i,b as g,w as u,p as l,h as m,t as P,F as z,e as re,i as $,Q as ut,f as j,m as S,s as W,J as se,U as ct,r as C,q as M,R as We,G as Oe,y as Z,_ as Ce,S as dt,x as Xe,T as ae,V as pt,a as E,P as Qe,W as $e,X as Le,z as Ve,u as _t,k as vt,A as mt,H as ft,Y as gt,Z as yt,l as bt,E as ht,$ as kt}from"./index-DD3cbXLI.js";import{c as wt,u as Ot,_ as ze}from"./ImageUploadInput.vue_vue_type_script_setup_true_lang-BZ7bKgm9.js";import{i as $t}from"./image-BDx1eoPX.js";import{A as Vt}from"./AppstoreOutlined-BdnZq8fh.js";var St={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M518.3 459a8 8 0 00-12.6 0l-112 141.7a7.98 7.98 0 006.3 12.9h73.9V856c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V613.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 459z"}},{tag:"path",attrs:{d:"M811.4 366.7C765.6 245.9 648.9 160 512.2 160S258.8 245.8 213 366.6C127.3 389.1 64 467.2 64 560c0 110.5 89.5 200 199.9 200H304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8h-40.1c-33.7 0-65.4-13.4-89-37.7-23.5-24.2-36-56.8-34.9-90.6.9-26.4 9.9-51.2 26.2-72.1 16.7-21.3 40.1-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0152.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10C846.1 454.5 884 503.8 884 560c0 33.1-12.9 64.3-36.3 87.7a123.07 123.07 0 01-87.6 36.3H720c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h40.1C870.5 760 960 670.5 960 560c0-92.7-63.1-170.7-148.6-193.3z"}}]},name:"cloud-upload",theme:"outlined"};function Ne(t){for(var o=1;o<arguments.length;o++){var s=arguments[o]!=null?Object(arguments[o]):{},d=Object.keys(s);typeof Object.getOwnPropertySymbols=="function"&&(d=d.concat(Object.getOwnPropertySymbols(s).filter(function(_){return Object.getOwnPropertyDescriptor(s,_).enumerable}))),d.forEach(function(_){Ut(t,_,s[_])})}return t}function Ut(t,o,s){return o in t?Object.defineProperty(t,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[o]=s,t}var xe=function(o,s){var d=Ne({},o,s.attrs);return a(ge,Ne({},d,{icon:St}),null)};xe.displayName="CloudUploadOutlined";xe.inheritAttrs=!1;var Ct={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M553.1 509.1l-77.8 99.2-41.1-52.4a8 8 0 00-12.6 0l-99.8 127.2a7.98 7.98 0 006.3 12.9H696c6.7 0 10.4-7.7 6.3-12.9l-136.5-174a8.1 8.1 0 00-12.7 0zM360 442a40 40 0 1080 0 40 40 0 10-80 0zm494.6-153.4L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file-image",theme:"outlined"};function Te(t){for(var o=1;o<arguments.length;o++){var s=arguments[o]!=null?Object(arguments[o]):{},d=Object.keys(s);typeof Object.getOwnPropertySymbols=="function"&&(d=d.concat(Object.getOwnPropertySymbols(s).filter(function(_){return Object.getOwnPropertyDescriptor(s,_).enumerable}))),d.forEach(function(_){xt(t,_,s[_])})}return t}function xt(t,o,s){return o in t?Object.defineProperty(t,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[o]=s,t}var Re=function(o,s){var d=Te({},o,s.attrs);return a(ge,Te({},d,{icon:Ct}),null)};Re.displayName="FileImageOutlined";Re.inheritAttrs=!1;var Rt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2zM304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z"}}]},name:"picture",theme:"outlined"};function Me(t){for(var o=1;o<arguments.length;o++){var s=arguments[o]!=null?Object(arguments[o]):{},d=Object.keys(s);typeof Object.getOwnPropertySymbols=="function"&&(d=d.concat(Object.getOwnPropertySymbols(s).filter(function(_){return Object.getOwnPropertyDescriptor(s,_).enumerable}))),d.forEach(function(_){Pt(t,_,s[_])})}return t}function Pt(t,o,s){return o in t?Object.defineProperty(t,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[o]=s,t}var _e=function(o,s){var d=Me({},o,s.attrs);return a(ge,Me({},d,{icon:Rt}),null)};_e.displayName="PictureOutlined";_e.inheritAttrs=!1;var jt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M483.2 790.3L861.4 412c1.7-1.7 2.5-4 2.3-6.3l-25.5-301.4c-.7-7.8-6.8-13.9-14.6-14.6L522.2 64.3c-2.3-.2-4.7.6-6.3 2.3L137.7 444.8a8.03 8.03 0 000 11.3l334.2 334.2c3.1 3.2 8.2 3.2 11.3 0zm62.6-651.7l224.6 19 19 224.6L477.5 694 233.9 450.5l311.9-311.9zm60.16 186.23a48 48 0 1067.88-67.89 48 48 0 10-67.88 67.89zM889.7 539.8l-39.6-39.5a8.03 8.03 0 00-11.3 0l-362 361.3-237.6-237a8.03 8.03 0 00-11.3 0l-39.6 39.5a8.03 8.03 0 000 11.3l243.2 242.8 39.6 39.5c3.1 3.1 8.2 3.1 11.3 0l407.3-406.6c3.1-3.1 3.1-8.2 0-11.3z"}}]},name:"tags",theme:"outlined"};function Be(t){for(var o=1;o<arguments.length;o++){var s=arguments[o]!=null?Object(arguments[o]):{},d=Object.keys(s);typeof Object.getOwnPropertySymbols=="function"&&(d=d.concat(Object.getOwnPropertySymbols(s).filter(function(_){return Object.getOwnPropertyDescriptor(s,_).enumerable}))),d.forEach(function(_){Et(t,_,s[_])})}return t}function Et(t,o,s){return o in t?Object.defineProperty(t,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[o]=s,t}var Pe=function(o,s){var d=Be({},o,s.attrs);return a(ge,Be({},d,{icon:jt}),null)};Pe.displayName="TagsOutlined";Pe.inheritAttrs=!1;const qt={class:"gallery-upload"},At={class:"gallery-upload__zone"},It={class:"gallery-upload__title"},Lt={key:0,class:"gallery-upload__grid"},zt=["src","onError"],Nt={key:0,class:"tile__progress"},Tt={key:1,class:"tile__overlay"},Mt=["onClick"],Bt=["onClick"],Dt={key:1,class:"gallery-upload__meta"},Ft={key:0,class:"gallery-upload__pending"},Ht=["src"],Gt=3,Jt=Ue({__name:"GalleryUploadInput",props:{modelValue:{default:()=>[]},purpose:{default:void 0},placeholder:{default:"افزودن تصاویر گالری"}},emits:["update:modelValue"],setup(t,{emit:o}){const s=t,d=o,_=S([]),p=S(!1),N=S(""),X=()=>_.value.filter(v=>v.status==="done"&&v.url).map(v=>v.url),U=W(()=>_.value.filter(v=>v.status==="done").length),L=W(()=>_.value.filter(v=>v.status==="uploading").length);function K(){d("update:modelValue",X())}we(()=>s.modelValue,v=>{if(JSON.stringify(X())===JSON.stringify(v??[]))return;const h=_.value.filter(k=>k.status==="uploading");_.value=[...(v??[]).map(k=>({uid:k,status:"done",url:k,percent:100})),...h]},{immediate:!0});function ee(v){const h=wt(v);return h?(se.error(h),ct.LIST_IGNORE):!0}let G=0;const y=[];function B(v){return new Promise((h,k)=>{const O=()=>{G++,v().then(h,k).finally(()=>{var c;G--,(c=y.shift())==null||c()})};G<Gt?O():y.push(O)})}const D=v=>_.value.find(h=>h.uid===v);function Q({file:v}){const h=v.uid??`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;_.value.push({uid:h,status:"uploading",preview:URL.createObjectURL(v),percent:0}),B(async()=>{if(!D(h))return null;const k=new FormData;k.append("file",v),s.purpose&&k.append("purpose",s.purpose);const{data:O}=await Z.post("file/create",k,{onUploadProgress:c=>{const r=D(h);r&&c.total&&(r.percent=Math.round(c.loaded/c.total*100))}});return O}).then(k=>{const O=D(h);!O||!(k!=null&&k.url)||(O.preview&&URL.revokeObjectURL(O.preview),Object.assign(O,{status:"done",url:k.url,preview:void 0,percent:100}),K())}).catch(k=>{se.error(Ot(k,v.name)),te(h)})}function te(v){const h=_.value.findIndex(O=>O.uid===v);if(h===-1)return;const[k]=_.value.splice(h,1);k.preview&&URL.revokeObjectURL(k.preview)}function ue(v){te(v),K()}function Y(v){N.value=v.url??v.preview??"",p.value=!0}function I(v,h){const k=v.target;h.url&&k.src!==new URL(h.url,window.location.origin).href&&(k.src=h.url)}return it(()=>{_.value.forEach(v=>v.preview&&URL.revokeObjectURL(v.preview))}),(v,h)=>{const k=C("a-upload-dragger"),O=C("a-progress"),c=C("a-modal");return i(),g("div",qt,[a(k,{accept:"image/jpeg,image/png,image/webp,image/gif,image/avif,image/bmp,image/tiff,image/heic,image/heif,image/svg+xml",multiple:"","show-upload-list":!1,"custom-request":Q,"before-upload":ee},{default:u(()=>[l("div",At,[a(m(xe),{class:"gallery-upload__icon"}),l("p",It,P(t.placeholder),1),h[1]||(h[1]=l("p",{class:"gallery-upload__hint"}," تصاویر را اینجا بکشید و رها کنید یا کلیک کنید — انتخاب چند تصویر بهصورت همزمان امکانپذیر است ",-1))])]),_:1}),_.value.length?(i(),g("div",Lt,[(i(!0),g(z,null,re(_.value,r=>(i(),g("div",{key:r.uid,class:M(["tile",{"is-uploading":r.status==="uploading"}])},[l("img",{src:m($t)(r.url,400)??r.preview,alt:"",onError:A=>I(A,r)},null,40,zt),r.status==="uploading"?(i(),g("div",Nt,[a(O,{type:"circle",percent:r.percent,size:40,"stroke-width":8,"stroke-color":"#fff","trail-color":"rgba(255,255,255,.3)","show-info":!1},null,8,["percent"])])):(i(),g("div",Tt,[l("button",{type:"button",class:"tile__btn",title:"نمایش",onClick:A=>Y(r)},[a(m(We))],8,Mt),l("button",{type:"button",class:"tile__btn tile__btn--danger",title:"حذف",onClick:A=>ue(r.uid)},[a(m(Oe))],8,Bt)]))],2))),128))])):$("",!0),_.value.length?(i(),g("div",Dt,[l("span",null,P(U.value)+" تصویر",1),L.value?(i(),g("span",Ft,[a(m(ut)),j(" در حال بارگذاری "+P(L.value)+" تصویر… ",1)])):$("",!0)])):$("",!0),a(c,{open:p.value,footer:null,onCancel:h[0]||(h[0]=r=>p.value=!1)},{default:u(()=>[l("img",{src:N.value,style:{width:"100%"},alt:""},null,8,Ht)]),_:1},8,["open"])])}}}),De=Ce(Jt,[["__scopeId","data-v-c7d31a13"]]);function Se(){return`v-${Date.now()}-${Math.random().toString(36).slice(2,7)}`}function Fe(t){return{__key:Se(),id:void 0,title:"",grams:null,percentage_pay:t??null,qty:null,is_active:!0,is_pre_order:!1,color:null,color_str:null,rial_pay:null,details:"",description:"",image_id:null,image_url:null}}const de=(t,o=3)=>Number(t).toLocaleString("fa-IR",{maximumFractionDigits:o});function fe(t){var d;if(!t||typeof t.scrollIntoView!="function")return;const o=((d=t.closest)==null?void 0:d.call(t,".ant-form-item"))??t;o.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"});const s=o.querySelector('input:not([type="hidden"]):not([disabled]), textarea:not([disabled]), .ant-select-selector, .ant-input-number-input, button:not([disabled])');window.setTimeout(()=>{var _;return(_=s==null?void 0:s.focus)==null?void 0:_.call(s,{preventScroll:!0})},280)}const Wt=t=>t.replace(/[۰-۹]/g,o=>String("۰۱۲۳۴۵۶۷۸۹".indexOf(o))).replace(/[٫٬,]/g,o=>o==="٫"?".":"");function He(t){return{formatter:(o,s)=>{if(s!=null&&s.userTyping)return s.input;if(o===""||o===null||o===void 0)return"";const d=Number(o);return Number.isFinite(d)?String(Number(d.toFixed(t))):String(o)},parser:o=>{const s=Wt(o??"").replace(/[^\d.]/g,"").match(/^(\d*)(?:\.(\d*))?/);return s?s[2]!==void 0?`${s[1]}.${s[2].slice(0,t)}`:s[1]:""}}}function Xt(t){return t!=null&&t>0?`${de(t)} گرمی`:""}const ie=t=>t==null||t==="";function Ge(t){const o={};return ie(t.grams)?o.grams="وزن را وارد کنید":Number(t.grams)<=0&&(o.grams="وزن باید بیشتر از صفر باشد"),!ie(t.qty)&&Number(t.qty)<0&&(o.qty="تعداد منفی نمیشود"),ie(t.percentage_pay)&&(o.percentage_pay="اجرت درصدی را وارد کنید"),ie(t.rial_pay)&&(o.rial_pay="اجرت ریالی را وارد کنید؛ اگر ندارد صفر بزنید"),o}function Qt(t){return[t.color!=null,!ie(t.qty),!!t.image_id,!!t.details,!!t.description,!t.is_active,t.is_pre_order].filter(Boolean).length}function Ye(t){var o;return!!((o=t.title)!=null&&o.trim()||!ie(t.grams)||!ie(t.qty)||t.image_id||t.details||t.description)}const Yt=["aria-label"],Zt={class:"vre__primary"},Kt=["aria-expanded"],el={key:0,class:"vre__more-count"},tl=["inert"],ll={class:"vre__more-inner"},al={class:"vre__more"},ol={class:"vre__more-col"},nl={class:"vre__pair"},sl={class:"vre-color"},rl={class:"vre__switches"},il={class:"vre__switch"},ul={class:"vre__switch"},cl={class:"vre__more-col"},dl={key:0,class:"vre-picker"},pl=["onClick"],_l=["src"],vl={key:0,class:"vre-picker__check"},ml={key:1,class:"vre-picker-empty"},fl={class:"vre__actions"},gl={class:"vre__keys"},yl=Ue({__name:"VariantRowEditor",props:Le({mode:{},colorOptions:{},gallery:{},emptyGalleryText:{default:"تصویری در گالری محصول ثبت نشده است."},autofocus:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:Le(["submit","cancel"],["update:modelValue"]),setup(t,{expose:o,emit:s}){const d=t,_=s,p=dt(t,"modelValue"),N=S(null),X=S(null),U=Ve({}),L=S(!1),K=W(()=>Object.keys(U).length>0),ee=W(()=>Qt(p.value)),G=W(()=>Ye(p.value)),y=W(()=>Xt(p.value.grams));we(y,c=>{p.value.title=c},{immediate:!0}),we(p,c=>{if(!K.value)return;const r=Ge(c);Object.keys(U).forEach(A=>{r[A]||delete U[A]})},{deep:!0});function B(c){p.value.image_id=c?c.id:null,p.value.image_url=c?c.url:null}const D=He(3),Q=He(2),te=c=>c==null||c===""?"":String(c).replace(/\B(?=(\d{3})+(?!\d))/g,","),ue=c=>c?c.replace(/,/g,""):"";async function Y(){var r;await ae();const c=Ge(p.value);return Object.keys(U).forEach(A=>delete U[A]),Object.assign(U,c),Object.keys(c).length?(c.qty&&(L.value=!0),await ae(),fe((r=N.value)==null?void 0:r.querySelector(".ant-form-item-has-error")),!1):!0}async function I(){await Y()&&_("submit")}function v(){_("cancel")}function h(c){const r=c.target;!r||r.closest(".ant-select")||r.tagName==="TEXTAREA"||(c.key==="Enter"&&!c.isComposing?(c.preventDefault(),I()):c.key==="Escape"&&d.mode==="edit"&&(c.preventDefault(),v()))}function k(){Object.keys(U).forEach(c=>delete U[c]),p.value.title=y.value}function O(){var c;(c=X.value)==null||c.focus()}return Xe(()=>{L.value=d.mode==="edit"&&ee.value>0,d.autofocus&&ae(O)}),o({focus:O,reset:k,validateAndScroll:Y}),(c,r)=>{const A=C("a-input-number"),F=C("a-form-item"),J=C("a-select-option"),T=C("a-select"),ce=C("a-switch"),ve=C("a-input"),ye=C("a-textarea"),pe=C("a-button");return i(),g("div",{ref_key:"rootRef",ref:N,class:M(["vre",[`vre--${t.mode}`,{"vre--invalid":K.value}]]),role:"group","aria-label":t.mode==="create"?"افزودن تنوع جدید":"ویرایش تنوع",onKeydown:h},[l("div",Zt,[a(F,{class:"vre__item",label:"وزن",required:"","validate-status":U.grams?"error":"",help:U.grams},{default:u(()=>[a(A,{ref_key:"gramsRef",ref:X,value:p.value.grams,"onUpdate:value":r[0]||(r[0]=b=>p.value.grams=b),class:"w-full",min:0,step:.001,"addon-after":"گرم",placeholder:"مثلاً ۴٫۵",formatter:m(D).formatter,parser:m(D).parser},null,8,["value","formatter","parser"])]),_:1},8,["validate-status","help"]),a(F,{class:"vre__item",label:"اجرت درصدی",required:"","validate-status":U.percentage_pay?"error":"",help:U.percentage_pay},{default:u(()=>[a(A,{value:p.value.percentage_pay,"onUpdate:value":r[1]||(r[1]=b=>p.value.percentage_pay=b),class:"w-full",min:0,step:.1,"addon-after":"٪",placeholder:"مثلاً ۱۸",formatter:m(Q).formatter,parser:m(Q).parser},null,8,["value","formatter","parser"])]),_:1},8,["validate-status","help"]),a(F,{class:"vre__item",label:"اجرت ریالی",required:"","validate-status":U.rial_pay?"error":"",help:U.rial_pay},{default:u(()=>[a(A,{value:p.value.rial_pay,"onUpdate:value":r[2]||(r[2]=b=>p.value.rial_pay=b),class:"w-full",min:0,step:5e4,"addon-after":"ریال",placeholder:"نداشت: صفر",formatter:te,parser:ue},null,8,["value"])]),_:1},8,["validate-status","help"])]),l("button",{type:"button",class:M(["vre__more-toggle",{"is-open":L.value}]),"aria-expanded":L.value,onClick:r[3]||(r[3]=b=>L.value=!L.value)},[a(m(pt),{class:"vre__more-chevron"}),r[11]||(r[11]=l("span",{class:"vre__more-title"},"موارد بیشتر",-1)),r[12]||(r[12]=l("span",{class:"vre__more-hint"},"رنگ، تعداد، وضعیت فروش، تصویر و توضیحات",-1)),ee.value?(i(),g("span",el,P(m(de)(ee.value))+" مورد تنظیم شده",1)):$("",!0)],10,Kt),l("div",{class:M(["vre__more-wrap",{"is-open":L.value}]),inert:!L.value||void 0},[l("div",ll,[l("div",al,[l("div",ol,[l("div",nl,[a(F,{class:"vre__item",label:"رنگ طلا"},{default:u(()=>[a(T,{value:p.value.color,"onUpdate:value":r[4]||(r[4]=b=>p.value.color=b),placeholder:"انتخاب رنگ","allow-clear":""},{default:u(()=>[(i(!0),g(z,null,re(t.colorOptions,b=>(i(),E(J,{key:b.id,value:b.id},{default:u(()=>[l("span",sl,[l("span",{class:M(["vre-color__dot",`vre-color__dot--${b.id}`])},null,2),j(" "+P(b.title),1)])]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1}),a(F,{class:"vre__item",label:"تعداد موجودی","validate-status":U.qty?"error":"",help:U.qty,extra:!U.qty&&!p.value.qty&&!p.value.is_pre_order?"خالی یا صفر: در اپ «ناموجود»":void 0},{default:u(()=>[a(A,{value:p.value.qty,"onUpdate:value":r[5]||(r[5]=b=>p.value.qty=b),class:"w-full",min:0,precision:0,"addon-after":"عدد",placeholder:"اختیاری"},null,8,["value"])]),_:1},8,["validate-status","help","extra"])]),l("div",rl,[l("label",il,[l("span",null,[r[13]||(r[13]=l("b",null,"فعال برای فروش",-1)),l("small",null,P(p.value.is_active?"در اپ قابل سفارش است":"پنهان از مشتری"),1)]),a(ce,{checked:p.value.is_active,"onUpdate:checked":r[6]||(r[6]=b=>p.value.is_active=b),size:"small"},null,8,["checked"])]),l("label",ul,[l("span",null,[r[14]||(r[14]=l("b",null,"پیشسفارش",-1)),l("small",null,P(p.value.is_pre_order?"بدون موجودی هم سفارش میگیرد":"فقط با موجودی"),1)]),a(ce,{checked:p.value.is_pre_order,"onUpdate:checked":r[7]||(r[7]=b=>p.value.is_pre_order=b),size:"small"},null,8,["checked"])])]),a(F,{class:"vre__item",label:"توضیح مختصر"},{default:u(()=>[a(ve,{value:p.value.details,"onUpdate:value":r[8]||(r[8]=b=>p.value.details=b),placeholder:"مثلاً: طراحی مات با تراش برلیان"},null,8,["value"])]),_:1})]),l("div",cl,[a(F,{class:"vre__item",label:"تصویر اختصاصی تنوع"},{default:u(()=>[t.gallery.length?(i(),g("div",dl,[l("button",{type:"button",class:M(["vre-picker__item vre-picker__item--none",{"is-active":!p.value.image_id}]),onClick:r[9]||(r[9]=b=>B(null))},[a(m(_e)),r[15]||(r[15]=l("span",null,"بدون عکس",-1))],2),(i(!0),g(z,null,re(t.gallery,b=>(i(),g("button",{key:b.id,type:"button",class:M(["vre-picker__item",{"is-active":p.value.image_id===b.id}]),onClick:be=>B(b)},[l("img",{src:b.url,alt:""},null,8,_l),p.value.image_id===b.id?(i(),g("span",vl,[a(m($e))])):$("",!0)],10,pl))),128))])):(i(),g("div",ml,P(t.emptyGalleryText),1))]),_:1}),a(F,{class:"vre__item",label:"توضیحات کامل"},{default:u(()=>[a(ye,{value:p.value.description,"onUpdate:value":r[10]||(r[10]=b=>p.value.description=b),"auto-size":{minRows:3,maxRows:6},placeholder:"ویژگیهای خاص این تنوع..."},null,8,["value"])]),_:1})])])])],10,tl),l("div",fl,[t.mode==="edit"||G.value?(i(),E(pe,{key:0,onClick:v},{default:u(()=>[j(P(t.mode==="create"?"پاک کردن":"انصراف"),1)]),_:1})):$("",!0),a(pe,{type:"primary",onClick:I},{icon:u(()=>[t.mode==="create"?(i(),E(m(Qe),{key:0})):(i(),E(m($e),{key:1}))]),default:u(()=>[j(" "+P(t.mode==="create"?"افزودن ردیف":"ذخیره ردیف"),1)]),_:1}),l("span",gl,[r[18]||(r[18]=l("kbd",null,"Enter",-1)),j(" "+P(t.mode==="create"?"افزودن":"ذخیره")+" ",1),t.mode==="edit"?(i(),g(z,{key:0},[r[16]||(r[16]=l("kbd",null,"Esc",-1)),r[17]||(r[17]=j(" انصراف",-1))],64)):$("",!0)])])],42,Yt)}}}),Je=Ce(yl,[["__scopeId","data-v-f6420fac"]]),bl={id:"page-user-view",class:"pf-page product-form-page"},hl={class:"pf-head"},kl={class:"pf-head__text"},wl={class:"pf-layout"},Ol={class:"pf-main"},$l={class:"pf-section pf-order--basic"},Vl={class:"pf-section__head"},Sl={class:"pf-section__icon"},Ul={key:0,class:"pf-section pf-order--variants"},Cl={class:"pf-section__head"},xl={class:"pf-section__icon"},Rl={class:"vlist"},Pl={key:0,class:"vlist__cols","aria-hidden":"true"},jl={class:"vlist__rows"},El=["onDblclick"],ql={class:"vrow__thumb"},Al=["src"],Il={class:"vrow__main"},Ll={class:"vrow__title"},zl={class:"vrow__meta"},Nl={key:0,class:"vrow__chip"},Tl={key:1,class:"vrow__chip"},Ml={key:2,class:"vrow__chip vrow__chip--blue"},Bl={key:3,class:"vrow__chip vrow__chip--red"},Dl={key:4,class:"vrow__chip vrow__chip--green"},Fl={class:"vrow__cell vrow__cell--1","data-label":"وزن"},Hl={key:1,class:"muted"},Gl={class:"vrow__cell vrow__cell--2","data-label":"اجرت درصدی"},Jl={key:1,class:"muted"},Wl={class:"vrow__cell vrow__cell--3","data-label":"اجرت ریالی"},Xl={key:1,class:"muted"},Ql={class:"vrow__ops"},Yl={key:1,class:"vlist__empty"},Zl={class:"pf-section pf-order--gallery"},Kl={class:"pf-section__head"},ea={class:"pf-section__icon"},ta={class:"pf-side"},la={class:"pf-section pf-order--status"},aa={class:"pf-section__head"},oa={class:"pf-section__icon"},na={class:"pf-section pf-order--category"},sa={class:"pf-section__head"},ra={class:"pf-section__icon"},ia={class:"pf-section pf-order--featured"},ua={class:"pf-section__head"},ca={class:"pf-section__icon"},da={class:"pf-uploads"},pa={class:"pf-actions"},_a={class:"pf-actions__hint"},va=Ue({__name:"AddProduct",setup(t){const o=vt(),s=bt(),d=_t(),_=f=>!!d.hasPermission(f),p=o.params.id,N=S(!1),X=S(void 0),U=S(!1),L=S([]),K=S([]),ee=S([]),G=S([]),y=Ve({title:"",product_code:"",show_type:3,category_id:void 0,brand_id:void 0,tags:[],ciny_ids:[],body_html:"",is_active:!0,indicator_id:null,mobile_pic:null}),B=Ve({}),D=S([]),Q=S([]),te=S([]),ue=W(()=>p?"برای این محصول تصویری در گالری ثبت نشده است.":"پس از ذخیرهٔ محصول، تصاویر گالری برای انتخاب در دسترس است."),Y=S([]),I=S([]),v=W(()=>_("product.list.variants.add")),h=W(()=>_("product.list.variants.edit")),k=W(()=>_("product.list.variants.remove")),O=S(Fe()),c=S(null),r=S(null),A=S(null),F=S(null),J=S(null),T=S(null),ce=S(null);let ve;function ye(){const f=F.value;return f?f instanceof HTMLElement?f:f.$el??null:null}const pe=f=>{var e;return((e=Y.value.find(w=>w.id===f))==null?void 0:e.title)??null};function b(f){ce.value=f,clearTimeout(ve),ve=setTimeout(()=>ce.value=null,1600)}function be(){var f,e;(f=r.value)==null||f.scrollIntoView({behavior:"smooth",block:"center"}),(e=c.value)==null||e.focus()}function je(f){var R;const e=O.value,w=Fe(X.value);f&&Object.assign(w,{percentage_pay:e.percentage_pay,rial_pay:e.rial_pay,color:e.color,is_active:e.is_active,is_pre_order:e.is_pre_order}),Object.assign(O.value,w),(R=c.value)==null||R.reset()}function Ze(){const f={...O.value,__key:Se(),color_str:pe(O.value.color)};I.value.push(f),b(f.__key),je(!0),ae(()=>{var e;return(e=c.value)==null?void 0:e.focus()})}const Ke=(f,e)=>JSON.stringify(f)===JSON.stringify(e);function Ee(f){if(J.value!==f.__key){if(J.value&&T.value){const e=I.value.find(w=>w.__key===J.value);if(e&&!Ke(e,T.value)){se.warning("ابتدا ویرایش ردیف فعلی را ذخیره یا لغو کنید.");return}}T.value={...f},J.value=f.__key}}function et(f){if(!T.value)return;const e={...T.value,color_str:pe(T.value.color)};I.value[f]=e,he(),b(e.__key)}function he(){J.value=null,T.value=null}function tt(f){var e;Object.assign(O.value,{...f,__key:Se(),id:void 0,title:""}),(e=c.value)==null||e.reset(),ae(be)}function qe(f){const[e]=I.value.splice(f,1);(e==null?void 0:e.__key)===J.value&&he()}async function lt(){var f,e,w;return J.value?(await((f=A.value)==null?void 0:f.validateAndScroll())===!1||(se.warning("ویرایش یک ردیف تنوع هنوز ذخیره نشده است؛ «ذخیره ردیف» یا «انصراف» را بزنید."),await ae(),fe(document.querySelector(".vre--edit .vre__actions"))),!0):v.value&&Ye(O.value)?(await((e=c.value)==null?void 0:e.validateAndScroll())===!1||(se.warning("ردیف تنوع جدید هنوز اضافه نشده است؛ «افزودن ردیف» را بزنید یا آن را پاک کنید."),await ae(),fe(((w=r.value)==null?void 0:w.querySelector(".vre__actions"))??r.value)),!0):!1}function Ae(){window.history.length>1?s.back():s.push("/apps/product/list")}async function at(){return Object.keys(B).forEach(f=>delete B[f]),y.title||(B.title="لطفا مقدار را وارد کنید"),Object.keys(B).length?(await ae(),fe(ye()??document.querySelector(".pf-field--title.ant-form-item-has-error")),!1):!0}async function Ie(){var f,e;if(await at()&&!await lt())try{U.value=!0;const w={...y,cats:y.category_id?[y.category_id]:[],images:D.value,images_mobile:Q.value,variants:I.value.map(R=>({id:R.id,title:R.title,grams:R.grams,percentage_pay:R.percentage_pay,qty:R.qty,is_active:R.is_active,is_pre_order:R.is_pre_order,color:R.color??null,rial_pay:R.rial_pay??null,details:R.details||null,description:R.description||null,image_id:R.image_id??null}))};p?await Z.put(`product/update/${p}`,w):await Z.post("product/create",w),se.info("اطلاعات با موفقیت به ثبت رسید."),s.push("/apps/product/list")}catch(w){se.error(((e=(f=w==null?void 0:w.response)==null?void 0:f.data)==null?void 0:e.message)??"خطا در ثبت اطلاعات.")}finally{U.value=!1}}return Xe(async()=>{var f,e,w,R;try{const[V,x,q,H,oe]=await Promise.all([Z.get("brand"),Z.post("category"),d.isSuperAdmin?Z.get("admin/products/collections"):Promise.resolve({data:[]}),Z.get("admin/products/colors").catch(()=>({data:[]})),Z.get("admin/products/tags").catch(()=>({data:[]}))]);L.value=V.data,G.value=oe.data??[],K.value=(x.data.rows??x.data).map(le=>({id:le.id,title:le.type_str?`${le.title} (${le.type_str}) `:le.title,type:le.type})),ee.value=q.data,Y.value=H.data??[]}catch(V){console.log(V)}if(p)try{const{data:V}=await Z.get(`product/show/${p}`);N.value=!!((f=V.accounting)!=null&&f.locked),X.value=((e=V.accounting)==null?void 0:e.sale_wage_percent)!=null?Number(V.accounting.sale_wage_percent):void 0,O.value.percentage_pay==null&&(O.value.percentage_pay=X.value??null),Object.assign(y,{title:V.title??"",product_code:V.product_code??"",show_type:V.show_type??3,category_id:((w=V.category)==null?void 0:w.id)??void 0,brand_id:((R=V.brand)==null?void 0:R.id)??void 0,tags:V.tags??[],ciny_ids:V.ciny_ids??[],body_html:V.body_html??"",is_active:V.is_active??!0,indicator_id:V.indicator_id??null,mobile_pic:V.mobile_pic??null}),D.value=V.images_gallery??[],Q.value=V.images_mobile??[],te.value=V.gallery??[],I.value=(V.variants_all??[]).map((x,q)=>{var H;return{__key:x.id??`v-${q}`,id:x.id,title:x.title,grams:Number(x.grams),percentage_pay:Number(x.percentage_pay),qty:x.qty,is_active:x.is_active,is_pre_order:x.is_pre_order,color:x.color!=null?Number(x.color):void 0,color_str:x.color_str??null,rial_pay:x.rial_pay!=null?Number(x.rial_pay):void 0,details:x.details??"",description:x.description??"",image_id:x.image_id??null,image_url:((H=x.image)==null?void 0:H.url)??null}})}catch(V){console.log(V)}}),(f,e)=>{const w=C("a-button"),R=C("a-tag"),V=C("a-alert"),x=C("a-input"),q=C("a-form-item"),H=C("a-select-option"),oe=C("a-select"),le=C("a-textarea"),me=C("a-tooltip"),ot=C("a-popconfirm"),nt=C("a-switch"),st=C("a-form"),rt=C("a-spin");return i(),g("div",bl,[a(rt,{spinning:U.value},{default:u(()=>[l("header",hl,[a(w,{class:"pf-head__back",shape:"circle",onClick:Ae},{icon:u(()=>[a(m(mt))]),_:1}),l("div",kl,[l("h1",null,P(m(p)?"ویرایش محصول":"افزودن محصول"),1)]),m(p)?(i(),E(R,{key:0,color:y.is_active?"green":"default",class:"pf-head__status"},{default:u(()=>[j(P(y.is_active?"فعال":"غیر فعال"),1)]),_:1},8,["color"])):$("",!0)]),a(st,{layout:"vertical",class:"pf-form",onSubmit:ft(Ie,["prevent"])},{default:u(()=>[l("div",wl,[l("div",Ol,[l("section",$l,[l("div",Vl,[l("span",Sl,[a(m(gt))]),e[16]||(e[16]=l("div",null,[l("h3",null,"اطلاعات پایه")],-1))]),N.value?(i(),E(V,{key:0,class:"pf-alert",type:"info","show-icon":"",message:"این محصول به نرمافزار حسابداری متصل است؛ نام و کد محصول از آنجا خوانده میشود."})):$("",!0),a(q,{ref_key:"titleItemRef",ref:F,class:"pf-field--title",label:"نام محصول",required:"","validate-status":B.title?"error":"",help:B.title||(N.value?"از نرمافزار حسابداری — برای تغییر، آن را در حسابداری ویرایش کنید":void 0)},{default:u(()=>[a(x,{value:y.title,"onUpdate:value":e[0]||(e[0]=n=>y.title=n),placeholder:"مثلاً: گردنبند طلا",disabled:N.value},null,8,["value","disabled"])]),_:1},8,["validate-status","help"]),l("div",{class:M({"pf-grid-2":m(d).isSuperAdmin})},[a(q,{label:"کد محصول",class:M({"mb-0":!m(d).isSuperAdmin}),help:N.value?"از نرمافزار حسابداری":void 0},{default:u(()=>[a(x,{value:y.product_code,"onUpdate:value":e[1]||(e[1]=n=>y.product_code=n),disabled:N.value},null,8,["value","disabled"])]),_:1},8,["class","help"]),m(d).isSuperAdmin?(i(),E(q,{key:0,label:"نوع نمایش"},{default:u(()=>[a(oe,{value:y.show_type,"onUpdate:value":e[2]||(e[2]=n=>y.show_type=n)},{default:u(()=>[a(H,{value:1},{default:u(()=>[...e[17]||(e[17]=[j("سایت",-1)])]),_:1}),a(H,{value:2},{default:u(()=>[...e[18]||(e[18]=[j("گوشی",-1)])]),_:1}),a(H,{value:3},{default:u(()=>[...e[19]||(e[19]=[j("سایت و گوشی",-1)])]),_:1})]),_:1},8,["value"])]),_:1})):$("",!0)],2),m(d).isSuperAdmin?(i(),E(q,{key:1,label:"شرح محصول (سایت)",class:"mb-0"},{default:u(()=>[a(le,{value:y.body_html,"onUpdate:value":e[3]||(e[3]=n=>y.body_html=n),"auto-size":{minRows:5,maxRows:12},placeholder:"توضیحات محصول برای نمایش در سایت"},null,8,["value"])]),_:1})):$("",!0)]),_("product.list.variants")?(i(),g("section",Ul,[l("div",Cl,[l("span",xl,[a(m(Vt))]),e[21]||(e[21]=l("div",null,[l("h3",null,"تنوع ها")],-1)),v.value&&I.value.length>3?(i(),E(w,{key:0,class:"pf-section__action",onClick:be},{icon:u(()=>[a(m(Qe))]),default:u(()=>[e[20]||(e[20]=j(" افزودن تنوع ",-1))]),_:1})):$("",!0)]),l("div",Rl,[I.value.length?(i(),g("div",Pl,[...e[22]||(e[22]=[l("span",null,null,-1),l("span",null,"عنوان تنوع",-1),l("span",null,"وزن",-1),l("span",null,"اجرت درصدی",-1),l("span",null,"اجرت ریالی",-1),l("span",null,null,-1)])])):$("",!0),l("div",jl,[(i(!0),g(z,null,re(I.value,(n,ke)=>(i(),g(z,{key:n.__key},[J.value===n.__key&&T.value?(i(),E(Je,{key:0,ref_for:!0,ref_key:"editRef",ref:A,modelValue:T.value,"onUpdate:modelValue":e[4]||(e[4]=ne=>T.value=ne),mode:"edit",autofocus:"","color-options":Y.value,gallery:te.value,"empty-gallery-text":ue.value,onSubmit:ne=>et(ke),onCancel:he},null,8,["modelValue","color-options","gallery","empty-gallery-text","onSubmit"])):(i(),g("div",{key:1,class:M(["vrow",{"is-inactive":!n.is_active,"is-flash":ce.value===n.__key,"is-editable":h.value}]),onDblclick:ne=>h.value&&Ee(n)},[l("span",ql,[n.image_url?(i(),g("img",{key:0,src:n.image_url,alt:""},null,8,Al)):(i(),E(m(_e),{key:1}))]),l("div",Il,[l("span",Ll,P(n.title),1),l("span",zl,[n.color_str?(i(),g("span",Nl,[l("span",{class:M(["vrow__dot",`vrow__dot--${n.color}`])},null,2),j(P(n.color_str),1)])):$("",!0),n.qty?(i(),g("span",Tl,"موجودی "+P(m(de)(n.qty))+" عدد",1)):$("",!0),n.is_pre_order?(i(),g("span",Ml,"پیشسفارش")):$("",!0),n.is_active?$("",!0):(i(),g("span",Bl,"غیرفعال")),n.id?$("",!0):(i(),g("span",Dl,"جدید، ذخیره نشده"))])]),l("span",Fl,[n.grams!=null?(i(),g(z,{key:0},[j(P(m(de)(n.grams))+" ",1),e[23]||(e[23]=l("small",null,"گرم",-1))],64)):(i(),g("span",Hl,"—"))]),l("span",Gl,[n.percentage_pay!=null?(i(),g(z,{key:0},[j(P(m(de)(n.percentage_pay,2)),1),e[24]||(e[24]=l("small",null,"٪",-1))],64)):(i(),g("span",Jl,"—"))]),l("span",Wl,[n.rial_pay!=null?(i(),g(z,{key:0},[j(P(m(de)(n.rial_pay,0))+" ",1),e[25]||(e[25]=l("small",null,"ریال",-1))],64)):(i(),g("span",Xl,"—"))]),l("div",Ql,[h.value?(i(),E(me,{key:0,title:"ویرایش (دابلکلیک)"},{default:u(()=>[a(w,{type:"text",size:"small","aria-label":"ویرایش",onClick:ne=>Ee(n)},{icon:u(()=>[a(m(ht))]),_:1},8,["onClick"])]),_:2},1024)):$("",!0),v.value?(i(),E(me,{key:1,title:"کپی در ردیف جدید"},{default:u(()=>[a(w,{type:"text",size:"small","aria-label":"کپی در ردیف جدید",onClick:ne=>tt(n)},{icon:u(()=>[a(m(kt))]),_:1},8,["onClick"])]),_:2},1024)):$("",!0),k.value?(i(),g(z,{key:2},[n.id?(i(),E(ot,{key:0,title:"این تنوع پس از «ثبت اطلاعات» غیرفعال میشود. ادامه میدهید؟","ok-text":"حذف","cancel-text":"خیر",onConfirm:ne=>qe(ke)},{default:u(()=>[a(me,{title:"حذف"},{default:u(()=>[a(w,{type:"text",size:"small",danger:"","aria-label":"حذف"},{icon:u(()=>[a(m(Oe))]),_:1})]),_:1})]),_:1},8,["onConfirm"])):(i(),E(me,{key:1,title:"حذف"},{default:u(()=>[a(w,{type:"text",size:"small",danger:"","aria-label":"حذف",onClick:ne=>qe(ke)},{icon:u(()=>[a(m(Oe))]),_:1},8,["onClick"])]),_:2},1024))],64)):$("",!0)])],42,El))],64))),128))]),!I.value.length&&!v.value?(i(),g("div",Yl," هنوز تنوعی برای این محصول ثبت نشده است. ")):$("",!0),v.value?(i(),g("div",{key:2,ref_key:"composerWrap",ref:r,class:"vlist__composer"},[a(Je,{ref_key:"composerRef",ref:c,modelValue:O.value,"onUpdate:modelValue":e[5]||(e[5]=n=>O.value=n),mode:"create","color-options":Y.value,gallery:te.value,"empty-gallery-text":ue.value,onSubmit:Ze,onCancel:e[6]||(e[6]=n=>je(!1))},null,8,["modelValue","color-options","gallery","empty-gallery-text"])],512)):$("",!0)])])):$("",!0),l("section",Zl,[l("div",Kl,[l("span",ea,[a(m(_e))]),e[26]||(e[26]=l("div",null,[l("h3",null,"گالری تصاویر")],-1))]),m(d).isSuperAdmin?(i(),g(z,{key:0},[a(q,{label:"گالری تصاویر سایت"},{default:u(()=>[a(De,{modelValue:D.value,"onUpdate:modelValue":e[7]||(e[7]=n=>D.value=n),purpose:"product.gallery",placeholder:"افزودن تصاویر گالری سایت"},null,8,["modelValue"])]),_:1}),e[27]||(e[27]=l("div",{class:"pf-divider"},null,-1))],64)):$("",!0),a(q,{label:"گالری تصاویر موبایل",class:"mb-0"},{default:u(()=>[a(De,{modelValue:Q.value,"onUpdate:modelValue":e[8]||(e[8]=n=>Q.value=n),purpose:"product.gallery_mobile",placeholder:"افزودن تصاویر گالری موبایل"},null,8,["modelValue"])]),_:1})])]),l("aside",ta,[l("section",la,[l("div",aa,[l("span",oa,[a(m(We))]),e[28]||(e[28]=l("div",null,[l("h3",null,"وضعیت نمایش")],-1))]),a(q,{label:"نمایش محصول",extra:y.is_active?"محصول برای مشتریان قابل مشاهده است":"محصول پنهان است",class:"mb-0"},{default:u(()=>[a(nt,{checked:y.is_active,"onUpdate:checked":e[9]||(e[9]=n=>y.is_active=n)},null,8,["checked"])]),_:1},8,["extra"])]),l("section",na,[l("div",sa,[l("span",ra,[a(m(Pe))]),e[29]||(e[29]=l("div",null,[l("h3",null,"دستهبندی")],-1))]),a(q,{label:"دسته بندی"},{default:u(()=>[a(oe,{value:y.category_id,"onUpdate:value":e[10]||(e[10]=n=>y.category_id=n),"allow-clear":"","show-search":"","option-filter-prop":"label",placeholder:"انتخاب کنید"},{default:u(()=>[(i(!0),g(z,null,re(K.value,n=>(i(),E(H,{key:n.id,value:n.id,label:n.title},{default:u(()=>[j(P(n.title),1)]),_:2},1032,["value","label"]))),128))]),_:1},8,["value"])]),_:1}),a(q,{label:"برند"},{default:u(()=>[a(oe,{value:y.brand_id,"onUpdate:value":e[11]||(e[11]=n=>y.brand_id=n),"allow-clear":"","show-search":"","option-filter-prop":"label",placeholder:"انتخاب کنید"},{default:u(()=>[(i(!0),g(z,null,re(L.value,n=>(i(),E(H,{key:n.id,value:n.id,label:n.title},{default:u(()=>[j(P(n.title),1)]),_:2},1032,["value","label"]))),128))]),_:1},8,["value"])]),_:1}),a(q,{label:"برچسبها",class:M({"mb-0":!m(d).isSuperAdmin}),extra:G.value.length?"روی کارت محصول در اپ نمایش داده میشود و محصول در بخش «ویژهها»ی صفحه اصلی اپ میآید.":"برچسبی تعریف نشده است؛ از «پیکربندی ← مدیریت ثابتها ← برچسبها» اضافه کنید."},{default:u(()=>[a(oe,{value:y.tags,"onUpdate:value":e[12]||(e[12]=n=>y.tags=n),mode:"multiple","allow-clear":"",disabled:!G.value.length,options:G.value.map(n=>({value:n,label:n})),placeholder:"انتخاب کنید"},null,8,["value","disabled","options"])]),_:1},8,["class","extra"]),m(d).isSuperAdmin?(i(),E(q,{key:0,label:"سینی ها",class:"mb-0"},{default:u(()=>[a(oe,{value:y.ciny_ids,"onUpdate:value":e[13]||(e[13]=n=>y.ciny_ids=n),mode:"multiple","allow-clear":"","option-filter-prop":"label",placeholder:"انتخاب کنید"},{default:u(()=>[(i(!0),g(z,null,re(ee.value,n=>(i(),E(H,{key:n.id,value:n.id,label:n.title},{default:u(()=>[j(P(n.title),1)]),_:2},1032,["value","label"]))),128))]),_:1},8,["value"])]),_:1})):$("",!0)]),l("section",ia,[l("div",ua,[l("span",ca,[a(m(Re))]),e[30]||(e[30]=l("div",null,[l("h3",null,"تصویر شاخص")],-1))]),l("div",da,[m(d).isSuperAdmin?(i(),E(q,{key:0,label:"سایت",class:"mb-0"},{default:u(()=>[a(ze,{modelValue:y.indicator_id,"onUpdate:modelValue":e[14]||(e[14]=n=>y.indicator_id=n),purpose:"product.indicator",placeholder:"تصویر شاخص"},null,8,["modelValue"])]),_:1})):$("",!0),a(q,{label:"موبایل",class:"mb-0"},{default:u(()=>[a(ze,{modelValue:y.mobile_pic,"onUpdate:modelValue":e[15]||(e[15]=n=>y.mobile_pic=n),purpose:"product.indicator_mobile",placeholder:"تصویر شاخص موبایل"},null,8,["modelValue"])]),_:1})])])])]),l("div",pa,[l("span",_a,[a(m(yt)),e[31]||(e[31]=j(" تغییرات تنوعها و تصاویر پس از «ثبت اطلاعات» ذخیره میشوند. ",-1))]),a(w,{onClick:Ae},{default:u(()=>[...e[32]||(e[32]=[j("انصراف",-1)])]),_:1}),a(w,{type:"primary",class:"form-submit",loading:U.value,onClick:Ie},{icon:u(()=>[a(m($e))]),default:u(()=>[e[33]||(e[33]=j(" ثبت اطلاعات ",-1))]),_:1},8,["loading"])])]),_:1})]),_:1},8,["spinning"])])}}}),ba=Ce(va,[["__scopeId","data-v-2aa20d52"]]);export{ba as default};
|