/
home
/
henzagold
/
adminold
/
export
/
js
/
File Upload :
llllll
Current File: /home/henzagold/adminold/export/js/chunk-5ca920f9.ac1f3afb.js
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5ca920f9"],{1275:function(e,t,i){"use strict";i("fa53")},5436:function(e,t,i){"use strict";i("e61d")},9535:function(e,t,i){},"9f0a":function(e,t,i){"use strict";i.r(t);var a,r=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"page-user-view"}},[t("ASpin",{attrs:{type:"loading",spinning:e.loading}},[t("div",{attrs:{id:"user-data"}},[t("a-form",{attrs:{form:e.form},on:{submit:e.handleSubmit}},[t("ASpin",{attrs:{type:"loading",spinning:e.loading}},[t("vx-card",{staticClass:"mb-base",attrs:{title:"اطلاعات پایه"}},[t("div",{staticClass:"grid sm:grid-cols-1 md:grid-cols-2 gap-4"},[t("a-form-item",{attrs:{label:"کد محصول"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["product_code",{rules:[{required:!0,message:"لطفا مقدار را وارد کنید"}]}],expression:"['product_code', { rules: [{ required: true, message: 'لطفا مقدار را وارد کنید' }] }]"}]})],1),t("a-form-item",{attrs:{label:"نام محصول"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["title",{rules:[{required:!0,message:"لطفا مقدار را وارد کنید"}]}],expression:"['title', { rules: [{ required: true, message: 'لطفا مقدار را وارد کنید' }] }]"}]})],1),t("a-form-item",{attrs:{label:"نوع نمایش"}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["show_type",{initialValue:3,rules:[{required:!0,message:""}]}],expression:"['show_type',{initialValue:3,rules: [{ required: true, message: '' }],}]"}],model:{value:e.show_type,callback:function(t){e.show_type=t},expression:"show_type"}},[t("a-radio",{attrs:{value:1}},[e._v("\n سایت\n ")]),t("a-radio",{attrs:{value:2}},[e._v("\n اپلیکشن موبایل\n ")]),t("a-radio",{attrs:{value:3}},[e._v("\n سایت و اپلیکشن موبایل\n ")])],1)],1),t("a-form-item",{attrs:{label:"دسته بندی "}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["cats",{rules:[{required:!0,message:"وارد کردن دسته بندی الزامی است"}]}],expression:"['cats',{rules: [{ required: true, message: 'وارد کردن دسته بندی الزامی است' }],}]"}],staticClass:"mt-3",staticStyle:{width:"100%",direction:"rtl !important"},attrs:{mode:"multiple","filter-option":e.filterOption,"show-search":"",placeholder:"جستجو"}},e._l(e.treeData,(function(i,a){return t("a-select-option",{key:i.id},[e._v("\n "+e._s(i.title)+"\n ")])})),1)],1),t("a-form-item",{attrs:{label:"برند "}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["brand_id",{rules:[{required:!0,message:"وارد کردن برند الزامی است"}]}],expression:"['brand_id',\n {rules: [{ required: true,\n message: 'وارد کردن برند الزامی است' }]\n ,},]"}],staticClass:"mt-3",staticStyle:{width:"100%",direction:"rtl !important"},attrs:{"filter-option":e.filterOption,"show-search":"",placeholder:""}},e._l(e.brands,(function(i,a){return t("a-select-option",{key:i.id},[e._v("\n "+e._s(i.title)+"\n ")])})),1)],1),t("a-form-item",{attrs:{label:"سینی ها "}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["ciny_ids"],expression:"['ciny_ids',\n /*{rules: [{ required: true,\n message: 'وارد کردن سینی الزامی است' }]\n ,},*/]"}],staticClass:"mt-3",staticStyle:{width:"100%",direction:"rtl !important"},attrs:{"filter-option":e.filterOption,"show-search":"",mode:"multiple",placeholder:""}},e._l(e.collection,(function(i,a){return t("a-select-option",{key:i.id},[e._v("\n "+e._s(i.title)+"\n ")])})),1)],1),e.tags?[t("a-form-item",{attrs:{label:"برچسب ها"}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["tags",{rules:[{required:!1,message:"وارد کردن برچسب الزامی است "}]}],expression:"['tags',{rules: [{ required: false, message: 'وارد کردن برچسب الزامی است ' }],},]"}],staticStyle:{width:"100%"},attrs:{mode:"tags","token-separators":[","],placeholder:"لطفا انتخاب کنید"}},e._l(e.tags,(function(i,a){return t("a-select-option",{key:a},[e._v("\n "+e._s(e.tags[a])+"\n ")])})),1)],1)]:e._e()],2),t("div",{staticClass:"grid sm:grid-cols-1 md:grid-cols-1 gap-4"},[t("a-form-item",{attrs:{label:"شرح محصول (موبایل)"}},[t("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["body_html",{}],expression:"['body_html', {}]"}],attrs:{disabled:1==e.show_type}})],1),t("a-form-item",{attrs:{label:"شرح محصول (سایت)"}},[t("quill-editor",{ref:"myQuillEditor",attrs:{disabled:2==e.show_type,options:e.editorOption},model:{value:e.desk_note,callback:function(t){e.desk_note=t},expression:"desk_note"}})],1)],1),t("div",{staticClass:"grid sm:grid-cols-1 md:grid-cols-2 gap-4"},[t("a-form-item",{attrs:{label:"نوع تحویل"}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["delivery_type",{initialValue:1,rules:[{required:!0,message:""}]}],expression:"['delivery_type',{initialValue:1,rules: [{ required: true, message: '' }],}]"}]},[t("a-radio",{attrs:{value:1}},[e._v("\n کوتاه مدت\n ")]),t("a-radio",{attrs:{value:2}},[e._v("\n بلند مدت\n ")])],1)],1),t("a-form-item",{attrs:{label:"متن پیام نمایش به کاربر در بازه بلند مدت"}},[t("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["message_long_delivery",{}],expression:"['message_long_delivery', {}]"}],attrs:{disabled:2!=e.form.getFieldValue("delivery_type")}})],1),t("div",{staticClass:"flex gap-4"},[t("a-form-item",{attrs:{label:"نمایش محصول"}},[t("a-switch",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_active",{initialValue:!0,valuePropName:"checked"}],expression:"['is_active', {initialValue: true,valuePropName: 'checked' }]"}]})],1),t("a-form-item",{attrs:{label:"پیشنهاد روز"}},[t("a-switch",{directives:[{name:"decorator",rawName:"v-decorator",value:["offer_day",{initialValue:!0,valuePropName:"checked"}],expression:"['offer_day', {initialValue: true, valuePropName: 'checked' }]"}]})],1),t("a-form-item",{attrs:{label:"تضمین قیمت"}},[t("a-switch",{directives:[{name:"decorator",rawName:"v-decorator",value:["has_warranty",{initialValue:!0,valuePropName:"checked"}],expression:"['has_warranty', {initialValue: true,valuePropName: 'checked' }]"}]})],1),t("a-form-item",{attrs:{label:"موجود"}},[t("a-switch",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_exist",{initialValue:!0,valuePropName:"checked"}],expression:"['is_exist', {initialValue: true,valuePropName: 'checked' }]"}]})],1)],1)],1)])],1),t("div",{staticClass:"grid sm:grid-cols-1 md:grid-cols-3 gap-4"},[t("div",[t("vx-card",{staticClass:"mb-8"},[t("div",{staticClass:"vx-row"},[t("div",{staticClass:"vx-col w-full"},[t("div",{staticClass:"flex items-end px-3"},[t("feather-icon",{staticClass:"mr-2",attrs:{svgClasses:"w-6 h-6",icon:"CameraIcon"}}),t("span",{staticClass:"font-medium text-lg leading-none"},[e._v("تصویر شاخص")])],1),t("vs-divider")],1)]),t("SingleUploadInput",{ref:"indexImage",on:{ok:e.uploadIndexImage,remove:e.removeIndexImage}})],1)],1),t("div",[t("vx-card",{staticClass:"mb-8"},[t("div",{staticClass:"vx-row"},[t("div",{staticClass:"vx-col w-full"},[t("div",{staticClass:"flex items-end px-3"},[t("feather-icon",{staticClass:"mr-2",attrs:{svgClasses:"w-6 h-6",icon:"CameraIcon"}}),t("span",{staticClass:"font-medium text-lg leading-none"},[e._v("تصویر شاخص موبایل")])],1),t("vs-divider")],1)]),t("SingleUploadInput",{ref:"indexImageMobile",on:{ok:e.uploadIndexImageMobile,remove:e.removeIndexImageMobile}})],1)],1),t("div",[t("vx-card",{staticClass:"mb-8",staticStyle:{"min-height":"213px"}},[t("div",{staticClass:"vx-row"},[t("div",{staticClass:"vx-col w-full"},[t("div",{staticClass:"flex items-end px-3"},[t("feather-icon",{staticClass:"mr-2",attrs:{svgClasses:"w-6 h-6",icon:"PlayCircleIcon"}}),t("span",{staticClass:"font-medium text-lg leading-none"},[e._v("پادکست")])],1),t("vs-divider")],1)]),t("PodcastUploadInput",{ref:"indexPodcast",on:{ok:e.uploadIndexPodcast,remove:e.removeIndexPodcast}})],1)],1)]),t("div",{staticClass:"grid grid-cols-1 gap-4"},[t("div",[t("vx-card",{staticClass:"mb-8"},[t("div",{staticClass:"vx-row"},[t("div",{staticClass:"vx-col w-full"},[t("div",{staticClass:"flex items-end px-3"},[t("feather-icon",{staticClass:"mr-2",attrs:{svgClasses:"w-6 h-6",icon:"CameraIcon"}}),t("span",{staticClass:"font-medium text-lg leading-none"},[e._v("گالری تصاویر موبایل")])],1),t("vs-divider")],1)]),t("UploadInput",{ref:"images",on:{ok:e.uploadImages,remove:e.removeImages,view:function(t){e.activeMobileImage=t.id},close:function(t){e.activeMobileImage=-1}}})],1)],1),t("div",[t("vx-card",{staticClass:"mb-8"},[t("div",{staticClass:"vx-row"},[t("div",{staticClass:"vx-col w-full"},[t("div",{staticClass:"flex items-end px-3"},[t("feather-icon",{staticClass:"mr-2",attrs:{svgClasses:"w-6 h-6",icon:"CameraIcon"}}),t("span",{staticClass:"font-medium text-lg leading-none"},[e._v("گالری تصاویر سایت")])],1),t("vs-divider")],1)]),t("UploadInput",{ref:"upload",on:{ok:e.uploadGallery,remove:e.removeGallery,view:function(t){e.imageModel=t,e.imageBody=t.body},close:e.updateFile}},[t("div",{staticClass:"grid grid-cols-1 \x3c!--md:grid-cols-4--\x3e gap-4 mt-4"},[t("a-form-item",{staticClass:"\x3c!--md:col-span-3--\x3e",attrs:{label:"توضیحات"}},[t("a-input",{model:{value:e.imageBody,callback:function(t){e.imageBody=t},expression:"imageBody"}})],1)],1)])],1)],1),t("div",[e.$hasPermission("product.list.variants")?t("vx-card",{staticClass:"mb-8 overflow-auto"},[t("div",{staticClass:"vx-row"},[t("div",{staticClass:"vx-col w-full"},[t("div",{staticClass:"flex items-end justify-between px-3"},[t("div",[t("feather-icon",{staticClass:"mr-2",attrs:{svgClasses:"w-6 h-6",icon:"CameraIcon"}}),t("span",{staticClass:"font-medium text-lg leading-none"},[e._v("تنوع محصول")])],1),e.$hasPermission("product.list.variants.add")?t("a-button",{attrs:{type:"primary"},on:{click:function(t){return e.showModal()}}},[e._v("\n افزودن تنوع\n ")]):e._e()],1),t("vs-divider")],1)]),t("a-table",{ref:"variants",attrs:{columns:e.variantColumns,"data-source":e.variants,pagination:!1},scopedSlots:e._u([{key:"sts",fn:function(t){return[e._v("\n "+e._s(t?"فعال":"غیر فعال")+"\n ")]}},{key:"color",fn:function(t){return[e._v("\n "+e._s(e.colors[t])+"\n ")]}},{key:"op",fn:function(i,a,r){return[e.$hasPermission("product.list.variants.edit")?t("ATooltip",[t("span",{attrs:{slot:"title"},slot:"title"},[e._v("ویرایش")]),t("FeatherIcon",{staticClass:"cursor-pointer mx-1",attrs:{icon:"EditIcon",svgClasses:"h-6 w-6 text-primary"},on:{click:function(t){return e.toEdit(r)}}})],1):e._e(),e.$hasPermission("product.list.variants.remove")?t("ATooltip",[t("span",{attrs:{slot:"title"},slot:"title"},[e._v("حذف")]),t("FeatherIcon",{staticClass:"cursor-pointer mx-1",attrs:{icon:"Trash2Icon",svgClasses:"h-6 w-6 text-danger"},on:{click:function(t){return e.variants.splice(r,1)}}})],1):e._e()]}}],null,!1,11439646)})],1):e._e()],1)]),t("div",{staticClass:"vx-col w-full flex mb-10"},[t("vs-button",{ref:"btn",staticClass:"mr-4",attrs:{"icon-pack":"feather",disabled:e.loading},on:{click:e.handleSubmit}},[this.id?t("span",[e._v("ویرایش")]):t("span",[e._v("ثبت محصول")])])],1)],1)],1)]),t("AModal",{attrs:{"force-render":!0,title:"".concat(e.editMode?"ویرایش":"افزودن"," تنوع "),width:"80%",cancelText:"بستن",okText:"".concat(e.editMode?"ویرایش":"افزودن")},on:{cancel:e.afterCloseModal,ok:e.toggleFunction},model:{value:e.variantModel,callback:function(t){e.variantModel=t},expression:"variantModel"}},[t("ASpin",{attrs:{spinning:e.variantLoading}},[t("a-form",{attrs:{form:e.variantForm,"label-col":{span:5},"wrapper-col":{span:12}},on:{submit:e.toggleFunction}},[t("div",{staticClass:"vx-row"},[t("div",{staticClass:"vx-col w-full"},[t("h4",[e._v("اطلاعات جامع")]),t("div",{staticClass:"flex"},[t("div",{staticClass:"w-full md:w-1/2"},[t("a-form-item",{attrs:{label:"عنوان"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["title",{rules:[{required:!0,message:""}]}],expression:"[\n 'title',\n { rules: [{ required: true, message: '' }] },\n ]"}]})],1),t("a-form-item",{attrs:{label:"تعداد"}},[t("AInputNumber",{directives:[{name:"decorator",rawName:"v-decorator",value:["qty",{rules:[{required:!0,message:""}]}],expression:"[\n 'qty',\n { rules: [{ required: true, message: '' }] },\n ]"}]})],1)],1),t("div",{staticClass:"w-full md:w-1/2"},[t("a-form-item",{attrs:{label:"وزن"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["grams",{rules:[{required:!0,message:""}]}],expression:"[\n 'grams',\n { rules: [{ required: true, message: '' }] },\n ]"}]})],1),t("a-form-item",{attrs:{label:"رنگ"}},[t("ASelect",{directives:[{name:"decorator",rawName:"v-decorator",value:["color",{rules:[{required:!0,message:"لطفا مقدار را وارد کنید"}]}],expression:"['color',{rules: [{ required: true,message: 'لطفا مقدار را وارد کنید'}],},]"}]},e._l(e.colors,(function(i,a){return t("a-select-option",{attrs:{value:a}},[e._v("\n "+e._s(i)+"\n ")])})),1)],1),t("a-form-item",{attrs:{label:"فعال"}},[t("a-switch",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_active",{valuePropName:"checked"}],expression:"['is_active', { valuePropName: 'checked' }]"}]})],1),t("a-form-item",{attrs:{label:" پیش سفارش"}},[t("a-switch",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_pre_order",{valuePropName:"checked"}],expression:"['is_pre_order', { valuePropName: 'checked' }]"}]})],1)],1)]),t("h4",[e._v("قیمت")]),t("div",{staticClass:"grid grid-cols-1 md:grid-cols-2"},[t("a-form-item",{attrs:{label:"اجرت ریالی"}},[t("AInputNumber",{directives:[{name:"decorator",rawName:"v-decorator",value:["rial_pay",{rules:[{required:!0,message:""}]}],expression:"[\n 'rial_pay',\n { rules: [{ required: true, message: '' }] },\n ]"}]})],1),t("a-form-item",{attrs:{label:"اجرت درصدی"}},[t("AInputNumber",{directives:[{name:"decorator",rawName:"v-decorator",value:["percentage_pay",{rules:[{required:!0,message:""}]}],expression:"[\n 'percentage_pay',\n { rules: [{ required: true, message: '' }] },\n ]"}]})],1)],1),t("h4",[e._v("جزئیات بیشتر")]),t("a-form-item",{attrs:{label:"توضیح مختصر"}},[t("ATextarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["details",{}],expression:"['details', {}]"}]})],1),t("a-form-item",{attrs:{label:"توضیحات کامل"}},[t("ATextarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["description",{}],expression:"['description', {}]"}]})],1),t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["product_id_id",{}],expression:"['product_id_id', {}]"}],attrs:{type:"hidden"}}),t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["id",{}],expression:"['id', {}]"}],attrs:{type:"hidden"}})],1)])])],1)],1)],1)},s=[],n=(i("ac4d"),i("8a81"),i("5df3"),i("1c4c"),i("7f7f"),i("55dd"),i("2fdb"),i("6762"),i("28a5"),i("6b54"),i("ac6a"),i("96cf"),i("1da1")),o=(i("20d6"),i("a753"),i("8096"),i("14e1"),i("953d")),l=i("bb36"),d=function(){var e=this,t=e._self._c;return t("div",{staticClass:"clearfix"},[t("AUpload",{attrs:{action:e.url,headers:e.headers,"list-type":"picture-card",multiple:!0,data:e.getData,"file-list":e.fileList,"default-file-list":e.fileList,remove:e.handleRemove,"before-upload":e.handlebeforeUpload},on:{preview:e.handlePreview,select:e.select,change:e.handleChange}},[e.fileList.length<e.limit?t("div",[t("a-icon",{attrs:{type:"plus"}}),t("div",{staticClass:"ant-upload-text"},[e._v("\n بارگذاری\n ")])],1):e._e()]),t("AModal",{attrs:{visible:e.previewVisible,footer:null,afterClose:function(){return e.$emit("close")}},on:{cancel:e.handleCancel}},[t("img",{staticClass:"block m-auto",staticStyle:{width:"80%"},attrs:{alt:"example",src:e.previewImage}}),e._t("default")],2)],1)},c=[];i("c5f6");function u(e){return new Promise((function(t,i){var a=new FileReader;a.readAsDataURL(e),a.onload=function(){return t(a.result)},a.onerror=function(e){return i(e)}}))}var v,m={name:"UploadInput",props:{limit:{type:Number,required:!1,default:20}},data:function(){return{url:l["a"]+"file/create",previewVisible:!1,previewImage:"",fileList:[]}},watch:{fileList:function(e,t){e.length>t.length?this.$emit("add-file",e):e.length<t.length&&this.$emit("remove-file",e)}},methods:{handleRemove:function(e){this.$emit("remove",e)},handleCancel:function(){this.previewVisible=!1},handlePreview:function(e){return(a=a||Object(n["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.url||t.preview){e.next=4;break}return e.next=3,u(t.originFileObj);case 3:t.preview=e.sent;case 4:this.previewImage=t.url||t.preview,this.$emit("view",t.response),this.previewVisible=!0;case 7:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)},handleChange:function(e){var t=e.fileList,i=(e.event,e.file);console.log("file list",t),console.log("file",i),"done"==i.status&&i.response&&i.response.id&&this.$emit("ok",i.response),this.fileList=t},select:function(){console.log("555 ==> ",555)},getData:function(){return{has_thumb:1,has_watermark:1,subject:1,title:1}},handlebeforeUpload:function(e){}},computed:{headers:function(){return{Authorization:"Bearer "+localStorage.getItem("accessToken")||!1}}}},p=m,h=(i("5436"),i("2877")),f=Object(h["a"])(p,d,c,!1,null,null,null),g=f.exports,b=i("fe2f"),x=function(){var e=this,t=e._self._c;return t("div",{staticClass:"clearfix",staticStyle:{position:"relative"}},[t("AUpload",{attrs:{action:e.url,"list-type":"picture",headers:e.headers,multiple:!1,data:e.getData,"file-list":e.fileList,remove:e.handleRemove},on:{change:e.handleChange}},[0===e.fileList.length?t("div",[t("div",{staticClass:"ant-upload ant-upload-select ant-upload-select-picture-card",attrs:{type:"upload"}},[t("span",{staticClass:"ant-upload",attrs:{role:"button",tabindex:"0"}},[t("div",[t("i",{staticClass:"anticon anticon-plus",attrs:{"aria-label":"icon: plus"}},[t("svg",{attrs:{viewBox:"64 64 896 896","data-icon":"plus",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false"}},[t("path",{attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}}),t("path",{attrs:{d:"M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"}})])]),t("div",{staticClass:"ant-upload-text"},[e._v("\n بارگذاری\n ")])])])])]):e._e()]),e.audioSurce?t("audio",{staticStyle:{"margin-top":"10px",width:"90%",position:"absolute",top:"4px",right:"4px"},attrs:{controls:""}},[t("source",{attrs:{src:e.audioSurce,type:"audio/".concat(e.audioType)}})]):e._e()],1)},y=[];function w(e){return new Promise((function(t,i){var a=new FileReader;a.readAsDataURL(e),a.onload=function(){return t(a.result)},a.onerror=function(e){return i(e)}}))}var C,I={name:"UploadInput",props:{limit:{type:Number,required:!1,default:20}},data:function(){return{url:l["a"]+"file/create",previewVisible:!1,previewImage:"",fileList:[],audioSurce:null,audioType:null}},watch:{fileList:function(e,t){e.length>t.length?this.$emit("add-file",e):e.length<t.length&&this.$emit("remove-file",e)}},methods:{handleRemove:function(e){this.$emit("remove",e),this.audioSurce=null,this.audioType=null},handleCancel:function(){this.previewVisible=!1},handlePreview:function(e){return(v=v||Object(n["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(console.log(t),t.url||t.preview){e.next=5;break}return e.next=4,w(t.originFileObj);case 4:t.preview=e.sent;case 5:this.previewImage=t.url||t.preview,this.previewVisible=!0;case 7:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)},handleChange:function(e){var t=e.fileList,i=(e.event,e.file);"done"==i.status&&i.response&&i.response.id&&(this.$emit("ok",i.response),this.audioSurce=i.response.image,this.audioType=i.response.ext),this.fileList=t},getData:function(){return{has_thumb:1,has_watermark:1,subject:1,title:1}}},computed:{headers:function(){return{Authorization:"Bearer "+localStorage.getItem("accessToken")||!1}}}},k=I,q=(i("1275"),Object(h["a"])(k,x,y,!1,null,null,null)),M=q.exports,S=i("04c5"),R=function(){var e=this,t=e._self._c;return t("a-select",{attrs:{"show-search":"",value:e.value,placeholder:"جستجو","default-active-first-option":!1,"show-arrow":!0,"v-decorator":e.vDecorator,"filter-option":!1,"not-found-content":null},on:{"update:vDecorator":function(t){e.vDecorator=t},"update:v-decorator":function(t){e.vDecorator=t},search:e.handleSearch,change:e.handleChange,select:e.select}},e._l(e.data,(function(i){return t("a-select-option",{key:i.id},[t("div",{staticClass:"flex"},[t("div",{staticClass:"flex-1"},[e._v(e._s(i.title))])])])})),1)},$=[];function D(e,t,i){var a;function r(){return(a=a||Object(n["a"])(regeneratorRuntime.mark((function a(){var r;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,l["b"].get(i,{params:{text_search:e}});case 2:r=a.sent,t(r.data);case 4:case"end":return a.stop()}}),a)})))).apply(this,arguments)}C&&(clearTimeout(C),C=null),e,C=setTimeout(r,300)}var N,O,F,T,L,P={name:"QuerySelect",props:["vDecorator","url"],data:function(){return{data:[],value:void 0}},methods:{select:function(e){},handleSearch:function(e){var t=this;D(e,(function(e){return t.data=e}),this.url)},handleChange:function(e){var t=this;this.value=e,D(e,(function(e){return t.data=e}),this.url),this.$emit("change",e)}},mounted:function(){}},j=P,A=Object(h["a"])(j,R,$,!1,null,null,null),V=A.exports,U=function(){var e=this,t=e._self._c;return t("div",{},[t("div",{staticClass:"w-full"},[e.file?t("div",{staticClass:"relative",staticStyle:{width:"200px"}},[t("VsImage",{staticClass:"w-full",attrs:{src:e.file.image}}),t("div",{staticClass:"absolute cursor-pointer",staticStyle:{"background-color":"#f5222d",top:"0","z-index":"1500",margin:"auto",display:"flex",padding:"5px","border-radius":"5px"},on:{click:e.remove}},[t("FeatherIcon",{attrs:{icon:"TrashIcon",svgClasses:"text-white"}})],1),t("div",{staticStyle:{clear:"both"}})],1):t("AUploadDragger",{attrs:{name:"image",multiple:!1,action:e.uploadURl},on:{change:e.handleChange}},[t("p",{staticClass:"ant-upload-drag-icon"},[t("a-icon",{attrs:{type:"inbox"}})],1),t("p",{staticClass:"ant-upload-text"},[e._v("\n تصویر شاخص محصول\n ")]),t("p",{staticClass:"ant-upload-hint"},[e._v("\n تصاویر باید پسوند png داشته باشند و حداکثر 1 مگابایت حجم داشته باشند.\n ")])])],1),e._e()])},B=[],E={name:"ProductUploader",props:["value"],data:function(){return{file:void 0,uploadURl:l["a"]+"config/image"}},methods:{remove:function(){this.value=void 0,this.file=void 0},handleChange:function(e){e.fileList[0].response&&(this.file=e.fileList[0].response,this.value=e.fileList[0].response.id,this.$emit("change",this.value),this.$emit("input",this.value))}}},G=E,z=Object(h["a"])(G,U,B,!1,null,"f8156020",null),H=z.exports,Y=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"divider-demo"}},[t("divider-default"),t("divider-text"),t("divider-text-position"),t("divider-color"),t("divider-icon"),t("divider-style")],1)},Q=[],X=function(){var e=this,t=e._self._c;return t("vx-card",{attrs:{title:"Default","code-toggler":""}},[t("p",[e._v("You can add a line to divide with the component "),t("code",[e._v("vs-divider")])]),t("div",{staticClass:"op-block mt-5"},[e._v("\n\n Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n "),t("vs-divider"),e._v("\n Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n\n ")],1),t("template",{slot:"codeContainer"},[e._v("\nUt enim ad minim veniam, quis nostrud....mollit anim id est laborum.\n<vs-divider/>\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n ")])],2)},J=[],W={},K=Object(h["a"])(W,X,J,!1,null,null,null),Z=K.exports,ee=function(){var e=this,t=e._self._c;return t("vx-card",{attrs:{title:"Text","code-toggler":""}},[t("p",[e._v("You can add a text between the line to delimit two elements and have a description for the user")]),t("div",{staticClass:"op-block mt-5"},[e._v("\n\n Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n "),t("vs-divider",[e._v(" My Text ")]),e._v("\n Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n\n ")],1),t("template",{slot:"codeContainer"},[e._v("\nUt enim ad minim veniam, quis nostrud....mollit anim id est laborum.\n<vs-divider> My Text </vs-divider>\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n ")])],2)},te=[],ie={},ae=Object(h["a"])(ie,ee,te,!1,null,null,null),re=ae.exports,se=function(){var e=this,t=e._self._c;return t("vx-card",{attrs:{title:"Text Position","code-toggler":""}},[t("p",[e._v("You can guide the text in 5 ways with property "),t("code",[e._v("position")]),e._v(":")]),t("vx-list",{staticClass:"mt-3",attrs:{list:["left","left-center","center(default)","right-center","right"]}}),t("div",{staticClass:"op-block mt-5"},[t("vs-divider",{attrs:{position:"left"}},[e._v(" Left ")]),t("vs-divider",{attrs:{position:"left-center"}},[e._v(" Left-Center ")]),t("vs-divider",{attrs:{position:"center"}},[e._v(" Center(default) ")]),t("vs-divider",{attrs:{position:"right-center"}},[e._v(" Right-Center ")]),t("vs-divider",{attrs:{position:"right"}},[e._v("Right")])],1),t("template",{slot:"codeContainer"},[e._v('\n<vs-divider position="left">Left</vs-divider>\n\n<vs-divider position="left-center">Left-Center</vs-divider>\n\n<vs-divider position="center">Center(default)</vs-divider>\n\n<vs-divider position="right-center">Right-Center</vs-divider>\n\n<vs-divider position="right">Right</vs-divider>\n ')])],2)},ne=[],oe={},le=Object(h["a"])(oe,se,ne,!1,null,null,null),de=le.exports,ce=function(){var e=this,t=e._self._c;return t("vx-card",{attrs:{title:"Color","code-toggler":""}},[t("p",[e._v("You can change the color of the divider line with the property "),t("code",[e._v("color")]),e._v(", you can use the main colors or "),t("strong",[e._v("RGB")]),e._v(" and "),t("strong",[e._v("HEX")]),e._v(".")]),t("vs-alert",{staticClass:"mt-5",attrs:{icon:"warning",active:"true",color:"warning"}},[t("span",[e._v("Only "),t("strong",[e._v("RGB")]),e._v(" and "),t("strong",[e._v("HEX")]),e._v(" colors are supported.")])]),t("div",{staticClass:"op-block mt-5"},[t("vs-divider",{attrs:{color:"Default"}},[e._v(" Default ")]),t("vs-divider",{attrs:{color:"primary"}},[e._v(" Primary ")]),t("vs-divider",{attrs:{color:"success"}},[e._v(" Success ")]),t("vs-divider",{attrs:{color:"danger"}},[e._v(" Danger ")]),t("vs-divider",{attrs:{color:"warning"}},[e._v(" Warning ")]),t("vs-divider",{attrs:{color:"dark"}},[e._v(" Dark ")]),t("vs-divider",{attrs:{color:"rgb(29, 222, 194)"}},[e._v(" RGB ")]),t("vs-divider",{attrs:{color:"#ad289f"}},[e._v(" HEX ")])],1),t("template",{slot:"codeContainer"},[e._v('\n<vs-divider>Default</vs-divider>\n\n<vs-divider color="primary">Primary</vs-divider>\n\n<vs-divider color="success">Success</vs-divider>\n\n<vs-divider color="danger">Danger</vs-divider>\n\n<vs-divider color="warning">Warning</vs-divider>\n\n<vs-divider color="dark">Dark</vs-divider>\n\n<vs-divider color="rgb(29, 222, 194)">RGB</vs-divider>\n\n<vs-divider color="#ad289f">HEX</vs-divider>\n ')])],2)},ue=[],ve={},me=Object(h["a"])(ve,ce,ue,!1,null,null,null),pe=me.exports,he=function(){var e=this,t=e._self._c;return t("vx-card",{attrs:{title:"Icon","code-toggler":""}},[t("p",[e._v("To add an icon within the division we have the property "),t("code",[e._v("icon")])]),t("vs-alert",{staticClass:"mt-5",attrs:{color:"primary",icon:"new_releases",active:"true"}},[t("p",[e._v("Vuesax uses the Google Material Icons font library by default. For a list of all available icons, visit the official "),t("a",{attrs:{href:"https://material.io/icons/",target:"_blank"}},[e._v("Material Icons page")]),e._v(".")]),t("p",[e._v("FontAwesome and other fonts library are supported. Simply use the icon-pack with fa or fas. You still need to include the Font Awesome icons in your project.")])]),t("div",{staticClass:"op-block mt-5"},[t("vs-divider",{attrs:{"icon-pack":"feather",icon:"icon-arrow-down",position:"left"}}),t("vs-divider",{attrs:{"icon-pack":"feather",icon:"icon-star",position:"left-center",color:"primary"}}),t("vs-divider",{attrs:{"icon-pack":"feather",icon:"icon-check",position:"center",color:"success"}}),t("vs-divider",{attrs:{"icon-pack":"feather",icon:"icon-x-circle",position:"right-center",color:"danger"}}),t("vs-divider",{attrs:{"icon-pack":"feather",icon:"icon-alert-triangle",position:"right",color:"warning"}}),t("vs-divider",{attrs:{"icon-pack":"feather",icon:"icon-clock",position:"center",color:"dark"}})],1),t("template",{slot:"codeContainer"},[e._v('\n<vs-divider icon-pack="feather" icon="icon-arrow-down" position="left"></vs-divider>\n\n<vs-divider icon-pack="feather" icon="icon-star" position="left-center" color="primary"></vs-divider>\n\n<vs-divider icon-pack="feather" icon="icon-check" position="center" color="success"></vs-divider>\n\n<vs-divider icon-pack="feather" icon="icon-x-circle" position="right-center" color="danger"></vs-divider>\n\n<vs-divider icon-pack="feather" icon="icon-alert-triangle" position="right" color="warning"></vs-divider>\n\n<vs-divider icon-pack="feather" icon="icon-clock" position="center" color="dark"></vs-divider>\n ')])],2)},fe=[],ge={},_e=Object(h["a"])(ge,he,fe,!1,null,null,null),be=_e.exports,xe=function(){var e=this,t=e._self._c;return t("vx-card",{attrs:{title:"Style","code-toggler":""}},[t("p",[e._v("You can change line's style with the property "),t("code",[e._v("border-style")]),e._v(". The allowed values are equivalent to the "),t("code",[e._v("border-style")]),e._v(" property in CSS.")]),t("vx-list",{staticClass:"mt-3 mb-5",attrs:{list:e.styleTypes}}),t("div",{staticClass:"op-block"},[t("vs-divider",{attrs:{"border-style":"dotted",color:"primary"}},[e._v("dotted")]),t("vs-divider",{attrs:{"border-style":"dashed",color:"success"}},[e._v("dashed")]),t("vs-divider",{attrs:{"border-style":"solid",color:"danger"}},[e._v("solid")])],1),t("template",{slot:"codeContainer"},[e._v('\n<vs-divider border-style="dotted" color="primary">dotted</vs-divider>\n<vs-divider border-style="dashed" color="success">dashed</vs-divider>\n<vs-divider border-style="solid" color="danger">solid</vs-divider>\n ')])],2)},ye=[],we={data:function(){return{styleTypes:["<strong>dotted</strong> - Defines a dotted border","<strong>dashed</strong> - Defines a dotteddashed border","<strong>solid</strong> - Defines a solid border(default)"]}}},Ce=we,Ie=Object(h["a"])(Ce,xe,ye,!1,null,null,null),ke=Ie.exports,qe={components:{DividerDefault:Z,DividerText:re,DividerTextPosition:de,DividerColor:pe,DividerIcon:be,DividerStyle:ke}},Me=qe,Se=Object(h["a"])(Me,Y,Q,!1,null,null,null),Re=Se.exports,$e={data:function(){return{activeMobileImage:-1,imageModel:{},imageBody:void 0}},computed:{isThumb:function(){return this.imageModel.id==this.imageIndexId},isTMobile:function(){return this.activeMobileImage===this.imageIndexMobileId}},methods:{setThumb:function(e){this.imageIndexId=e?this.imageModel.id:null},setTMobile:function(e){this.imageIndexMobileId=e?this.activeMobileImage:null},updateFile:function(){return(N=N||Object(n["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(e.prev=0,this.loading=!0,this.imageBody===this.imageModel.body){e.next=5;break}return e.next=5,l["b"].put("file/update/"+this.imageModel.id,{body:this.imageBody});case 5:this.imageModel={},this.imageBody=void 0,e.next=13;break;case 9:e.prev=9,e.t0=e["catch"](0),this.$vs.notify({title:"خطا در ثبت اطلاعات",text:"".concat(e.t0.message),color:"danger"}),console.log("get created error:",e.t0);case 13:return e.prev=13,this.loading=!1,e.finish(13);case 16:case"end":return e.stop()}}),e,this,[[0,9,13,16]])})))).apply(this,arguments)},uploadGallery:function(e){this.gallery.push(e.id)},removeGallery:function(e){var t=this.gallery.findIndex((function(t){return t==e.response.id}));t>-1&&this.gallery.splice(t,1)}}};function De(e,t){var i="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=Ne(e))||t&&e&&"number"===typeof e.length){i&&(e=i);var a=0,r=function(){};return{s:r,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,n=!0,o=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return n=e.done,e},e:function(e){o=!0,s=e},f:function(){try{n||null==i.return||i.return()}finally{if(o)throw s}}}}function Ne(e,t){if(e){if("string"===typeof e)return Oe(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Oe(e,t):void 0}}function Oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,a=new Array(t);i<t;i++)a[i]=e[i];return a}var Fe={mixins:[$e],components:{quillEditor:o["quillEditor"],Divider:Re,ProductUploader:H,QuerySelect:V,FeatherIcon:S["a"],UploadInput:g,SingleUploadInput:b["a"],PodcastUploadInput:M},data:function(){return{show_type:3,formLayout:"horizontal",category:[],brands:[],collection:[],data:void 0,thumb:void 0,thumb_id:void 0,mobile_pic:void 0,imageIndexId:null,imageIndexMobileId:null,podcastIndexId:null,gallery:[],images:[],attrs:[],loading:!1,form:this.$form.createForm(this,{name:"coordinated"}),tags:[],returnedTags:[],helperArray:{add:{},rm:{}},desk_note:"",editorOption:{modules:{toolbar:[["bold","italic","underline","strike"],["blockquote","code-block"],[{header:[1,2,3,4,5,6,!0]}],[{list:"ordered"},{list:"bullet"}],[{indent:"-1"},{indent:"+1"}],[{direction:"rtl"}],[{color:[]}],[{align:[]}],["link"],["image"]]},placeholder:"",theme:"snow"},treeData:void 0,cats:void 0,variants:[],variantForm:this.$form.createForm(this,{name:"coordinated"}),variantModel:!1,variantLoading:!1,colors:[],variantColumns:[{title:"نام تنوع",dataIndex:"title"},{title:"درصد اجرت",dataIndex:"percentage_pay"},{title:"اجرت ریالی",dataIndex:"rial_pay"},{title:"تعداد",dataIndex:"qty"},{title:"وضعیت",dataIndex:"is_active",scopedSlots:{customRender:"sts"}},{title:"عملیات",dataIndex:"op",scopedSlots:{customRender:"op"}}],editMode:!1,variantId:void 0}},computed:{editor:function(){return this.$refs.myQuillEditor.quill},loading:{get:function(){return this.$store.state.variant.loading},set:function(e){this.$store.commit("product/LOADING",e)}},id:function(){return this.$router.history.current.params.id},variant_id:function(){return this.$router.history.current.params.variant_id}},methods:{afterCloseModal:function(){this.variantForm.resetFields(),this.focusOnBtn()},focusOnBtn:function(){this.$refs.btn.$refs.btn.focus();var e=Math.max(document.body.scrollHeight,document.body.offsetHeight);window.scrollTo({top:e,left:0,behavior:"smooth"})},editVariantFromRoute:function(){var e=this,t=this.variants.findIndex((function(t){if(t.id==e.variant_id)return!0}));this.toEdit(t)},removeImages:function(e){var t=this.images.findIndex((function(t){return t==e.response.id}));t>-1&&this.images.splice(t,1)},removeIndexImage:function(e){this.imageIndexId=null},removeIndexImageMobile:function(e){this.imageIndexMobileId=null},uploadIndexImage:function(e){this.imageIndexId=e.id},uploadIndexImageMobile:function(e){this.imageIndexMobileId=e.id},uploadIndexPodcast:function(e){this.pocastIndexId=e.id},removeIndexPodcast:function(e){this.pocastIndexId=null},filterOption:function(e,t){return t.componentOptions.children[0].text.toLowerCase().indexOf(e.toLowerCase())>=0},uploadImages:function(e){this.images.push(e.id)},addAttr:function(){this.attrs.push({})},removeAttr:function(e){this.$delete(this.attrs,e)},handleSubmit:function(e){this.id?this.update(e):this.create(e)},create:function(e){return(O=O||Object(n["a"])(regeneratorRuntime.mark((function e(t){var i,a=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.preventDefault(),this.form.validateFields((function(e,t){return(i=i||Object(n["a"])(regeneratorRuntime.mark((function e(t,i){var r,s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t){e.next=21;break}if(e.prev=1,a.loading=!0,r=a.margeTags(i.tags),!(a.variants.length<1)){e.next=6;break}throw"وارد کردن حداقل یک تنوع الزامی است";case 6:return s=Object.assign(i,{id:a.id,indicator_id:a.imageIndexId,mobile_pic:a.imageIndexMobileId,file_id:a.pocastIndexId,attrs:a.attrs,gallery:a.gallery,images:a.images,variant:a.variants,tags:r,is_active:i.is_active?1:0,body_html:2==a.show_type||3==a.show_type?i.body_html:void 0,desk_note:1==a.show_type||3==a.show_type?a.desk_note:void 0}),console.log("exp",s),e.next=10,l["b"].post("product/create",s);case 10:a.$router.push({name:"product"}),e.next=18;break;case 13:e.prev=13,e.t0=e["catch"](1),console.log("e ==> ",e.t0),a.$vs.notify({title:"خطا در دریافت اطلاعات",text:"".concat(e.t0),color:"danger"}),a.loading=!1;case 18:return e.prev=18,a.loading=!1,e.finish(18);case 21:case"end":return e.stop()}}),e,null,[[1,13,18,21]])})))).apply(this,arguments)}));case 2:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)},update:function(e){return(F=F||Object(n["a"])(regeneratorRuntime.mark((function e(t){var i,a=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.preventDefault(),this.form.validateFields((function(e,t){return(i=i||Object(n["a"])(regeneratorRuntime.mark((function e(t,i){var r,s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t){e.next=21;break}if(e.prev=1,a.loading=!0,r=a.margeTags(i.tags),!(a.variants.length<1)){e.next=6;break}throw"وارد کردن حداقل یک تنوع الزامی است";case 6:return s=Object.assign(i,{indicator_id:a.imageIndexId,mobile_pic:a.imageIndexMobileId,file_id:a.pocastIndexId,attrs:a.attrs,gallery:a.gallery,images:a.images,variant:a.variants,tags:r,is_active:i.is_active?1:0,body_html:2==a.show_type||3==a.show_type?i.body_html:void 0,desk_note:1==a.show_type||3==a.show_type?a.desk_note:void 0}),console.log("exp",s),e.next=10,l["b"].put("product/update/".concat(a.id),s);case 10:a.$router.push({name:"product"}),e.next=18;break;case 13:e.prev=13,e.t0=e["catch"](1),console.log("e ==> ",e.t0),a.$vs.notify({title:"خطا در دریافت اطلاعات",text:"".concat(e.t0),color:"danger"}),a.loading=!1;case 18:return e.prev=18,a.loading=!1,e.finish(18);case 21:case"end":return e.stop()}}),e,null,[[1,13,18,21]])})))).apply(this,arguments)}));case 2:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)},getData:function(){return(T=T||Object(n["a"])(regeneratorRuntime.mark((function e(){var t,i,a,r,s=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!this.id){e.next=33;break}return e.prev=1,this.loading=!0,e.next=5,l["b"].get("product/show/".concat(this.id));case 5:t=e.sent,i=t.data,this.cats=i.collect.map((function(e){return e.collection_id_id})),i.cats=this.cats,i.brand_id=i.brand_id,i.ciny_ids=i.ciny.map((function(e){return e.ciny_id})),this.pocastIndexId=i.file_id,this.imageIndexMobileId=i.mobile_pic_id,this.show_type=i.show_type,this.variants=i.variants_all,i.file&&(this.$refs.indexPodcast.fileList.push({uid:i.file.id,status:"done",response:{id:i.file.id,image:i.file.image},url:i.file.image}),this.$refs.indexPodcast.audioSurce=i.file.image,this.$refs.indexPodcast.audioType=i.file.ext),i.thumb&&(this.imageIndexId=i.thumb.id,this.$refs.indexImage.fileList.push({uid:i.thumb.id,status:"done",response:{id:i.thumb.id,image:i.thumb.full},url:i.thumb.full})),i.tmobile&&this.$refs.indexImageMobile.fileList.push({uid:i.tmobile.id,status:"done",response:{id:i.tmobile.id,image:i.tmobile.full},url:i.tmobile.full}),i.gallery.forEach((function(e){s.gallery.push(e.id),s.$refs.upload.fileList.push({uid:e.id,status:"done",response:{id:e.id,image:e.image,body:e.body},url:e.image})})),i.images&&i.images.forEach((function(e){s.images.push(e.image_id),s.$refs.images.fileList.push({uid:e.image_id,status:"done",response:{id:e.image_id,image:e.image&&e.image.image?e.image.image:null},url:e.image&&e.image.image?e.image.image:null})})),i.tags&&(this.returnedTags=i.tags.map((function(e){return e.const_id})),i.tags.map((function(e){s.helperArray.add[e.const_id]={const_id:e.const_id,id:e.id},s.helperArray.rm[e.const_id]={const_id:e.const_id,id:e.id,remove:!0}})),i.tags=i.tags.map((function(e){return e.cnt.id.toString()}))),i.is_active=!!i.is_active,this.form.setFieldsValue(i),i.desk_note&&(this.editor.blur(),this.desk_note=i.desk_note),this.variant_id&&this.editVariantFromRoute(),e.next=30;break;case 26:e.prev=26,e.t0=e["catch"](1),this.$vs.notify({title:"خطا در دریافت اطلاعات",text:"".concat(e.t0.message),color:"danger"}),console.log("get dta error:",e.t0);case 30:return e.prev=30,this.loading=!1,e.finish(30);case 33:return e.prev=33,this.loading=!0,e.next=37,l["b"].get("/product/color");case 37:a=e.sent,r=a.data,this.colors=r.map((function(e){return e.split("/").filter((function(e){return"#"!==e[0]}))[0]})),e.next=46;break;case 42:e.prev=42,e.t1=e["catch"](33),this.$vs.notify({title:"خطا در دریافت اطلاعات",text:"".concat(e.t1.message),color:"danger"}),console.log("get dta error:",e.t1);case 46:return e.prev=46,this.loading=!1,e.finish(46);case 49:case"end":return e.stop()}}),e,this,[[1,26,30,33],[33,42,46,49]])})))).apply(this,arguments)},handleChange:function(e){var t,i=!0,a=_.map(e.fileList,"response"),r=De(a);try{for(r.s();!(t=r.n()).done;){var s=t.value;if(!s){i=!1;break}}}catch(n){r.e(n)}finally{r.f()}i&&(this.gallery=a)},margeTags:function(e){var t,i=[],a=[],r=De(this.returnedTags);try{for(r.s();!(t=r.n()).done;){var s=t.value;e.includes(s.toString())?(i.push(s),console.log("has","val",e,"tag",s,"h_id",i),a.push(this.helperArray.add[s])):(i.push(s),console.log("has not","val",e,"tag",s,"h_id",i),a.push(this.helperArray.rm[s]))}}catch(o){r.e(o)}finally{r.f()}var n=[];return e&&e.length>0&&(n=e.filter((function(e){return!i.includes(parseInt(e))})),console.log("h1",n),n&&n.length>0&&(n.map((function(e){a.push({const_id:e,id:null})})),console.log(a))),a&&a.length>0?a:void 0},showModal:function(){this.variantForm.setFieldsValue({product_id_id:this.id}),this.variantModel=!0},toEdit:function(e){var t=Object.assign(this.variants[e],{product_id_id:this.id});this.variantForm.setFieldsValue(t),this.editMode=!0,this.variantModel=!0,this.variantId=e},toggleFunction:function(e){this.editMode?this.editVariant(e):this.addVariant(e),this.focusOnBtn()},addVariant:function(e){var t,i=this;e.preventDefault(),this.variantForm.validateFields((function(e,a){return(t=t||Object(n["a"])(regeneratorRuntime.mark((function e(t,a){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t||(a.is_pre_order=a.is_pre_order?1:0,a.is_active=a.is_active?1:0,i.variants.push(a),i.variantModel=!1,i.variantForm.resetFields());case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}))},editVariant:function(e){var t,i=this;e.preventDefault(),this.variantForm.validateFields((function(e,a){return(t=t||Object(n["a"])(regeneratorRuntime.mark((function e(t,a){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t||(a.is_pre_order=a.is_pre_order?1:0,a.is_active=a.is_active?1:0,i.variants[i.variantId]=a,i.variantId=void 0,i.editMode=!1,i.variantModel=!1,i.variantForm.resetFields(),i.$refs.variants.$forceUpdate());case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}))}},watch:{show_type:function(e){console.log(e),this.treeData=3!==e?this.category.filter((function(t){return t.type==e})):this.category}},created:function(){return(L=L||Object(n["a"])(regeneratorRuntime.mark((function e(){var t,i,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,this.loading=!0,e.next=4,l["b"].post("category");case 4:return t=e.sent,i=t.data,this.category=i.rows.map((function(e){return{title:e.title+" (".concat(e.type_str,") "),id:e.id,type:e.type}})).sort((function(e,t){return e.title.localeCompare(t.title)})),this.treeData=this.category,e.next=10,l["b"].get("brand",{params:{text_search:"%"}});case 10:return a=e.sent,this.brands=a.data,e.next=14,l["b"].get("/const/__list__tags");case 14:return a=e.sent,this.tags=a.data,e.next=18,l["b"].get("https://henzagold.com/oapi/admin/ciny");case 18:return a=e.sent,this.collection=a.data.rows,e.next=22,this.getData();case 22:e.next=28;break;case 24:e.prev=24,e.t0=e["catch"](0),this.$vs.notify({title:"خطا در دریافت اطلاعات",text:"".concat(e.t0.message),color:"danger"}),console.log("get created error:",e.t0);case 28:return e.prev=28,this.loading=!1,e.finish(28);case 31:case"end":return e.stop()}}),e,this,[[0,24,28,31]])})))).apply(this,arguments)}},Te=Fe,Le=(i("b51f"),Object(h["a"])(Te,r,s,!1,null,null,null));t["default"]=Le.exports},b51f:function(e,t,i){"use strict";i("9535")},e61d:function(e,t,i){},fa53:function(e,t,i){}}]);
Copyright ©2k19 -
Hexid
|
Tex7ure