/
home
/
maktab
/
admin
/
js
/
File Upload :
llllll
Current File: /home/maktab/admin/js/chunk-7c14e58a.46fc577e.js
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7c14e58a"],{"0147":function(e,t,a){},"09a5":function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e._self._c;return t("a-spin",{attrs:{spinning:e.loading}},[t("vx-card",{attrs:{title:"پاپ آپ اعلان"}},[t("div",[t("span",[e._v("متن اعلان")]),t("a-textarea",{staticClass:"mt-4",attrs:{placeholder:"متن را وارد کنید."},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}})],1),t("a-button",{staticClass:"px-10",staticStyle:{"margin-top":"3em"},attrs:{type:"primary"},on:{click:e.handleSubmitMessage}},[e._v("\n ثبت اعلان\n ")])],1)],1)},i=[],s=(a("96cf"),a("1da1")),r=a("8143"),o=a("bb36"),l=a("df6e"),u=a("8855"),c={name:"notification-first-popup",components:{FileUploadInput:l["a"],ImageList:r["a"]},data:function(){return{value:"",loading:!1,input:u["a"]}},methods:{handleSubmitMessage:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,this.loading=!0,e.next=4,o["b"].put("admin/const/42",{value:this.value});case 4:this.$message.success("اعلان با موفقیت ثبت شد."),e.next=11;break;case 7:e.prev=7,e.t0=e["catch"](0),console.log(e.t0),this.$message.error("خطا در ثبت اعلان!");case 11:return e.prev=11,this.loading=!1,e.finish(11);case 14:case"end":return e.stop()}}),e,this,[[0,7,11,14]])})));function t(t){return e.apply(this,arguments)}return t}()}},d=c,p=a("2877"),h=Object(p["a"])(d,n,i,!1,null,"34e93168",null);t["default"]=h.exports},"0ae6":function(e,t,a){"use strict";a("0147")},"3c0b":function(e,t,a){},8143:function(e,t,a){"use strict";var n=function(){var e=this,t=e._self._c;return t("div",{staticClass:"clearfix"},[t("a-upload",{attrs:{action:e.url,headers:e.headers,"list-type":"picture-card","file-list":e.fileList,data:e.getData,remove:e.handleRemove},on:{preview:e.handlePreview,change:e.handleChange}},[e.fileList.length<10?t("div",[t("a-icon",{attrs:{type:"plus"}}),t("div",{staticClass:"ant-upload-text"},[e._v("\n بارگذاری\n ")])],1):e._e()]),t("a-modal",{attrs:{visible:e.previewVisible,footer:null},on:{cancel:e.handleCancel}},[t("img",{staticStyle:{width:"100%"},attrs:{alt:"example",src:e.previewImage}})])],1)},i=[],s=(a("96cf"),a("1da1")),r=a("bb36");function o(e){return new Promise((function(t,a){var n=new FileReader;n.readAsDataURL(e),n.onload=function(){return t(n.result)},n.onerror=function(e){return a(e)}}))}var l={data:function(){return{url:"".concat(r["a"],"site/file"),previewVisible:!1,previewImage:"",fileList:[]}},computed:{headers:function(){return{Authorization:"Bearer "+localStorage.getItem("accessToken")||!1}}},methods:{handleCancel:function(){this.previewVisible=!1},handlePreview:function(){var e=Object(s["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,o(t.originFileObj);case 3:t.preview=e.sent;case 4:this.previewImage=t.url||t.preview,this.previewVisible=!0;case 6:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}(),handleChange:function(e){var t=e.fileList,a=e.file;"done"===a.status&&a.response&&a.response.id&&this.$emit("ok",a.response.id),this.fileList=t},handleRemove:function(e){console.log("remove",e.response.id),this.$emit("remove",e.response.id)},getData:function(){return{has_thumb:1,has_watermark:0,subject:1,title:1,type:3}}}},u=l,c=(a("a741"),a("2877")),d=Object(c["a"])(u,n,i,!1,null,null,null);t["a"]=d.exports},a741:function(e,t,a){"use strict";a("3c0b")},df6e:function(e,t,a){"use strict";var n=function(){var e=this,t=e._self._c;return t("a-upload",{attrs:{name:"file",multiple:!1,action:e.url,headers:e.headers,remove:e.handleRemove,"file-list":e.fileList,data:e.getData},on:{change:e.handleChange}},[t("a-button",{attrs:{disabled:e.uploaded}},[t("a-icon",{staticClass:"pl-2",attrs:{type:"upload"}}),e._v("\n\t\tبارگذاری فایل\n\t")],1)],1)},i=[],s=a("bb36"),r={name:"FileUploadInput",watch:{fileList:function(e){e.length>0&&(this.uploaded=!0)}},data:function(){return{uploaded:!1,fileList:[],url:"".concat(s["a"],"site/file")}},computed:{headers:function(){return{Authorization:"Bearer "+localStorage.getItem("accessToken")||!1}}},methods:{handleChange:function(e){var t=e.fileList,a=e.event,n=e.file;console.log(t),console.log(a),console.log(n),"done"===n.status&&n.response&&n.response.id&&(this.$emit("ok",n.response.id),this.uploaded=!0,this.$message.success("آپلود سند با موفقیت انجام شد")),"uploading"===n.status&&(this.uploaded=!0),"removed"===n.status&&(console.log("gggggg"),this.uploaded=!1),"error"===n.status&&this.$message.error("خطا در بارگذاری اطلاعات"),this.fileList=t},handleRemove:function(e){this.$emit("remove",e)},getData:function(){return{has_thumb:1,has_watermark:0,subject:1,title:"pdf",type:4}}}},o=r,l=(a("0ae6"),a("2877")),u=Object(l["a"])(o,n,i,!1,null,null,null);t["a"]=u.exports}}]); //# sourceMappingURL=chunk-7c14e58a.46fc577e.js.map
Copyright ©2k19 -
Hexid
|
Tex7ure