/
home
/
henzagold
/
admin_report
/
js
/
File Upload :
llllll
Current File: /home/henzagold/admin_report/js/chunk-6a83d3a6.08718243.js
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6a83d3a6"],{"0f55":function(t,e,n){"use strict";n("50e3")},"2f21":function(t,e,n){"use strict";var i=n("79e5");t.exports=function(t,e){return!!t&&i((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},"50e3":function(t,e,n){},"55dd":function(t,e,n){"use strict";var i=n("5ca1"),s=n("d8e8"),a=n("4bf8"),r=n("79e5"),c=[].sort,o=[1,2,3];i(i.P+i.F*(r((function(){o.sort(void 0)}))||!r((function(){o.sort(null)}))||!n("2f21")(c)),"Array",{sort:function(t){return void 0===t?c.call(a(this)):c.call(a(this),s(t))}})},6015:function(t,e,n){},a9d6:function(t,e,n){},ac4c:function(t,e,n){"use strict";n.r(e);n("ac6a");var i=function(){var t=this,e=t._self._c;return e("div",[e("vx-card",{attrs:{title:"مدیریت ثابت ها"}},[e("div",{staticClass:"tabs-container px-6 pt-6",attrs:{slot:"no-body"},slot:"no-body"},[e("a-spin",{attrs:{spinning:t.loading,tip:"لطفا کمی تامل کنید"}},[e("vs-tabs",{staticClass:"tab-action-btn-fill-conatiner"},t._l(t.keys,(function(n,i){return e("vs-tab",{key:i,attrs:{label:n.title,"icon-pack":n.iconPack,icon:n.icon}},[0===i?e("Brand"):t._e(),1===i?e("Slide"):t._e()],1)})),1)],1)],1)])],1)},s=[],a=function(){var t=this,e=t._self._c;return e("div",[t._m(0),e("div",{attrs:{id:"container"}},[t._l(t.slides,(function(n,i){return e("div",{key:i,staticClass:"card"},[e("div",{staticClass:"flex justify-between"},[e("span",{staticClass:"font-bold text-lg"},[t._v("اسلاید "+t._s(n.w))]),e("span",{staticClass:"cursor-pointer",on:{click:function(e){return t.modalDelete(i)}}},[e("svg",{attrs:{focusable:"false","data-icon":"close",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"64 64 896 896"}},[e("path",{attrs:{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"}})])])]),e("div",{staticClass:"flex"},[e("div",{staticClass:"mt-5"},[e("XUpload",{attrs:{item:n},on:{"upload-finished":function(t){n.src=t}}})],1),e("div",{staticClass:"w-full"},[e("div",[e("span",[t._v("محل قرار گیری :")]),e("span",[e("a-select",{staticClass:"ml-5",staticStyle:{width:"5em"},attrs:{"default-value":n.w},on:{change:t.changeValue},model:{value:n.w,callback:function(e){t.$set(n,"w",e)},expression:"item.w"}},t._l(t.slides.length,(function(i,s){return e("a-select-option",{key:s,attrs:{value:i,loading:!0},on:{click:function(e){return t.changeLocation(n,s)}}},[t._v("\n "+t._s(i)+"\n ")])})),1)],1),e("span",{staticClass:"pl-5"},[e("a-checkbox",{on:{change:function(e){return t.onChange(e,n)}},model:{value:n.show_in_site,callback:function(e){t.$set(n,"show_in_site",e)},expression:"item.show_in_site"}},[t._v("\n نمایش در سایت\n ")])],1)]),t._m(1,!0),e("div",[e("a-textarea",{attrs:{placeholder:"متن توضیحات ...",rows:2},model:{value:n.description,callback:function(e){t.$set(n,"description",e)},expression:"item.description"}})],1)])])])})),e("div",{staticClass:"flex justify-center place-items-center cursor-pointer card",on:{click:t.addSlide}},[t._v("افزودن")])],2),e("div",{staticClass:"mt-5"},[e("a-button",{attrs:{type:"primary"},on:{click:t.saveChanges}},[t._v("ذخیره تغییرات")])],1),e("vs-prompt",{attrs:{title:"حذف اسلاید",color:"danger",active:t.visible_delete,"accept-text":"بله","cancel-text":"خیر"},on:{cancel:function(e){t.visible_delete=!1},accept:t.deleteSlide,close:function(e){t.visible_delete=!1},"update:active":function(e){t.visible_delete=e}}},[e("div",[t._v("\n آیا می خواهید این اسلاید را حذف کنید؟\n ")])])],1)},r=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"flex justify-between"},[e("h4",[t._v("لیست اسلایدها")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"py-2"},[e("span",[t._v("توضیحات پاپ آپ :")])])}],c=(n("96cf"),n("1da1")),o=n("bb36"),l=function(){var t=this,e=t._self._c;return e("div",{staticClass:"clearfix"},[e("a-upload",{attrs:{action:t.url,"list-type":"picture-card","file-list":t.fileList,accept:"image/*",headers:t.headers},on:{preview:t.handlePreview,change:t.handleChange}},[0===t.fileList.length?e("div",[e("a-icon",{attrs:{type:"plus"}}),e("div",{staticClass:"ant-upload-text"},[t._v("\n بارگذاری عکس\n ")])],1):t._e()]),e("a-modal",{attrs:{visible:t.previewVisible,footer:null},on:{cancel:t.handleCancel}},[e("img",{staticStyle:{width:"100%"},attrs:{alt:"example",src:t.previewImage}})])],1)},d=[];function u(t){return new Promise((function(e,n){var i=new FileReader;i.readAsDataURL(t),i.onload=function(){return e(i.result)},i.onerror=function(t){return n(t)}}))}var h={name:"UploadFileComponent",props:{item:{type:Object,required:!1,default:void 0}},watch:{item:function(t,e){this.fileList=[{status:"done",url:t.src,uid:"0",name:"image"}]}},data:function(){return{url:"".concat(o["a"],"/admin/file"),headers:{Authorization:"Bearer ".concat(o["c"])},previewVisible:!1,previewImage:"",fileList:[]}},methods:{handleCancel:function(){this.previewVisible=!1},handlePreview:function(){var t=Object(c["a"])(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.url||e.preview){t.next=4;break}return t.next=3,u(e.originFileObj);case 3:e.preview=t.sent;case 4:this.previewImage=e.url||e.preview,this.previewVisible=!0;case 6:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}(),handleChange:function(t){var e=t.fileList,n=t.file;"done"===n.status&&this.$emit("upload-finished",n.response.src),this.fileList=e}},mounted:function(){this.item.src&&this.fileList.push({status:"done",url:this.item.src,uid:"0",name:"image"})}},p=h,f=(n("e68a"),n("2877")),v=Object(f["a"])(p,l,d,!1,null,null,null),m=v.exports,b={name:"Slide",components:{XUpload:m},data:function(){return{slides:[],visible_delete:!1,temp_row_id:null,delete_id:""}},computed:{rows:function(){return this.$store.state.const.rows},loading:{get:function(){return this.$store.state.const.loading},set:function(t){this.$store.commit("const/LOADING",t)}}},mounted:function(){this.$store.dispatch("const/init"),this.getSlides()},methods:{getSlides:function(){var t=Object(c["a"])(regeneratorRuntime.mark((function t(){var e,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,this.loading=!0,t.next=4,o["b"].get("admin/banner/list");case 4:e=t.sent,n=e.data,this.slides=n,t.next=13;break;case 9:throw t.prev=9,t.t0=t["catch"](0),this.$ntSetError(),t.t0;case 13:return t.prev=13,this.loading=!1,t.finish(13);case 16:case"end":return t.stop()}}),t,this,[[0,9,13,16]])})));function e(){return t.apply(this,arguments)}return e}(),deleteSlide:function(){var t=Object(c["a"])(regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:for(t.prev=0,this.loading=!0,this.slides.splice(this.delete_id,1),e=this.delete_id;e<this.slides.length;e++)this.slides[e].w-=1;return t.next=6,this.saveChanges();case 6:this.delete_id="",t.next=12;break;case 9:t.prev=9,t.t0=t["catch"](0),this.$ntSetError();case 12:return t.prev=12,this.loading=!1,t.finish(12);case 15:case"end":return t.stop()}}),t,this,[[0,9,12,15]])})));function e(){return t.apply(this,arguments)}return e}(),changeLocation:function(t,e){var n=this.slides.indexOf(t),i=this.slides.splice(n,1)[0];this.slides.splice(e,0,i);for(var s=0;s<this.slides.length;s++)this.slides[s].w=s+1},changeValue:function(){var t=this.slides;this.slides=[],this.slides=t},saveChanges:function(){var t=Object(c["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,this.loading=!0,t.next=4,o["b"].post("admin/banner/create",this.slides);case 4:return this.$message.success("تغییرات با موفقیت ذخیره شد"),this.slides=[],t.next=8,this.getSlides();case 8:t.next=13;break;case 10:t.prev=10,t.t0=t["catch"](0),this.$ntSetError();case 13:return t.prev=13,this.loading=!1,t.finish(13);case 16:case"end":return t.stop()}}),t,this,[[0,10,13,16]])})));function e(){return t.apply(this,arguments)}return e}(),addSlide:function(){this.slides.push({title:"",title_fa:"",src:"",description:"",w:this.slides.length+1,position:1,show_in_site:!1})},modalDelete:function(t){this.visible_delete=!0,this.delete_id=t},onChange:function(t,e){e.show_in_site=t.target.checked}}},_=b,g=(n("0f55"),Object(f["a"])(_,a,r,!1,null,"530279bb",null)),w=g.exports,x=function(){var t=this,e=t._self._c;return e("div",[t._m(0),[t._l(t.brand,(function(n){return e("a-tag",{staticClass:"mt-2",attrs:{color:"cyan"},on:{click:function(e){return t.edit(n)}}},[t._v("\n "+t._s(n.title)+"\n ")])})),e("a-tag",{staticClass:"mt-2 ant-tag-blue text-black",attrs:{color:"cyan"},on:{click:t.create}},[t._v("\n + افزودن\n ")])],e("vs-prompt",{attrs:{title:t.is_mode_edit?"ویرایش برند":"افزودن برند",color:"primary",active:t.visible,"buttons-hidden":!0},on:{close:function(e){t.visible=!1},"update:active":function(e){t.visible=e}}},[e("div",{staticClass:"brand space-y-10"},[e("vs-alert",{attrs:{color:"primary",icon:"new_releases"}},[t._v("\n لطفا نام برند را به درستی وارد کنید.\n ")]),e("vs-input",{staticClass:"brand-inp",attrs:{"label-placeholder":"نام برند"},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.addBrand.apply(null,arguments)}},model:{value:t.brand_name,callback:function(e){t.brand_name=e},expression:"brand_name"}}),e("div",{staticClass:"flex flex-row"},[e("div",[e("vs-button",{staticClass:"mr-1 pr-5 pl-5",on:{click:t.addBrand}},[t._v("\n تایید\n ")]),e("vs-button",{staticClass:"pr-3 pl-3",attrs:{color:"danger",type:"border"},on:{click:function(e){t.visible=!1}}},[t._v("\n انصراف\n ")])],1),e("vs-button",{staticClass:"ml-auto",attrs:{color:"danger"},on:{click:function(e){return t.modalDelete(t.temp_row_id)}}},[t._v("\n حذف برند\n ")])],1)],1)]),e("vs-prompt",{attrs:{title:"حذف برند",color:"danger",active:t.visible_delete,"accept-text":"بله","cancel-text":"خیر"},on:{cancel:function(e){t.visible_delete=!1},accept:t.deleteBrand,close:function(e){t.visible_delete=!1},"update:active":function(e){t.visible_delete=e}}},[e("div",[t._v("\n آیا می خواهید حذف کنید؟\n ")])])],2)},k=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"flex justify-between"},[e("h4",[t._v("لیست برندها")])])}],y=(n("55dd"),{name:"Brand",data:function(){return{brand:[],visible:!1,visible_delete:!1,brand_name:null,is_mode_edit:!1,temp_row_id:null,delete_id:""}},computed:{rows:function(){return this.$store.state.const.rows},loading:{get:function(){return this.$store.state.const.loading},set:function(t){this.$store.commit("const/LOADING",t)}}},mounted:function(){this.$store.dispatch("const/init"),this.getBrand()},methods:{getBrand:function(){var t=Object(c["a"])(regeneratorRuntime.mark((function t(){var e,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,this.loading=!0,t.next=4,o["b"].get("admin/brand");case 4:e=t.sent,n=e.data,this.brand=n.sort((function(t,e){return e.id-t.id})),t.next=13;break;case 9:throw t.prev=9,t.t0=t["catch"](0),this.$ntSetError(),t.t0;case 13:return t.prev=13,this.loading=!1,t.finish(13);case 16:case"end":return t.stop()}}),t,this,[[0,9,13,16]])})));function e(){return t.apply(this,arguments)}return e}(),addBrand:function(){var t=Object(c["a"])(regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(t.prev=0,this.loading=!0,!this.is_mode_edit){t.next=8;break}return e=this.temp_row_id,t.next=6,o["b"].put("admin/brand/".concat(e),{brand:this.brand_name});case 6:t.next=10;break;case 8:return t.next=10,o["b"].post("admin/brand",{brand:this.brand_name});case 10:return this.brand_name=null,this.visible=!1,t.next=14,this.getBrand();case 14:t.next=20;break;case 16:throw t.prev=16,t.t0=t["catch"](0),this.$ntSetError(),t.t0;case 20:return t.prev=20,this.loading=!1,t.finish(20);case 23:case"end":return t.stop()}}),t,this,[[0,16,20,23]])})));function e(){return t.apply(this,arguments)}return e}(),edit:function(t){this.is_mode_edit=!0,this.visible=!0,this.brand_name=t.title,this.temp_row_id=t.id},create:function(){this.visible=!0,this.is_mode_edit=!1,this.brand_name&&(this.brand_name=null)},modalDelete:function(t){this.visible_delete=!0,this.visible=!1,this.temp_row_id=t,this.delete_id=t},deleteBrand:function(){var t=Object(c["a"])(regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,this.loading=!0,e=this.delete_id,t.next=5,o["b"].delete("admin/brand/".concat(e));case 5:return this.visible_delete=!1,t.next=8,this.getBrand();case 8:this.$ntSet("حذف برند با موفقیت انجام شد."),t.next=14;break;case 11:t.prev=11,t.t0=t["catch"](0),this.$ntSetError();case 14:return t.prev=14,this.loading=!1,t.finish(14);case 17:case"end":return t.stop()}}),t,this,[[0,11,14,17]])})));function e(){return t.apply(this,arguments)}return e}()}}),C=y,$=Object(f["a"])(C,x,k,!1,null,"12d1389d",null),S=$.exports,O={name:"Const",components:{Brand:S,Slide:w},computed:{keys:function(){return this.$store.state.const.keys},loading:{get:function(){return this.$store.state.const.loading},set:function(t){this.$store.commit("const/LOADING",t)}}},mounted:function(){this.$store.dispatch("const/init"),this.getBrand()}},j=O,L=(n("da25"),Object(f["a"])(j,i,s,!1,null,null,null));e["default"]=L.exports},da25:function(t,e,n){"use strict";n("a9d6")},e68a:function(t,e,n){"use strict";n("6015")}}]); //# sourceMappingURL=chunk-6a83d3a6.08718243.js.map
Copyright ©2k19 -
Hexid
|
Tex7ure