(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["3812d8d0"],{"674b":function(t,e,i){},bf9d:function(t,e,i){"use strict";i.r(e);var o=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"full-height page-content bg-white content padding-20"},[i("div",{staticClass:"font-16 text-weight-bold",staticStyle:{"padding-bottom":"8px"}},[t._v("说明：")]),i("div",{staticClass:"font-14",staticStyle:{"padding-bottom":"8px"}},[t._v("1、logo整体尺寸建议150*40px，logo图标建议36*36px；logo图片背景透明，png格式显示效果最佳；logo图片大小不能超过2M；")]),i("div",{staticClass:"font-14",staticStyle:{"padding-bottom":"8px"}},[t._v("2、点击“+”图标可选择图片进行上传；如需重新上传可将鼠标移到图片处点击“删除”图标清除图片，清除后可重新上传。")]),i("q-form",{staticClass:"dialog-content form-inline block",staticStyle:{"padding-right":"0","padding-left":"0"},attrs:{greedy:""},on:{submit:t.submit}},[t.logoUrl?i("q-icon",{staticClass:"del",staticStyle:{"font-size":"24px !important",color:"#D3D3D3"},attrs:{size:"24px",name:"iconfont icontubiao-52"},on:{click:t.delImg}}):t._e(),i("div",{staticClass:"photo-box"},[i("q-img",{staticClass:"photo",attrs:{fit:"contain",src:t.logoUrl,"spinner-color":"white"}},[t.logoUrl?t._e():i("div",{staticStyle:{height:"100%",width:"100%",background:"#fff"}}),i("q-btn",{staticClass:"upload-btn",class:{"dashed-border":!t.logoUrl},attrs:{unelevated:""},on:{click:t._onUploadPhotoClick}},[t.logoUrl?t._e():i("q-icon",{staticClass:"photo",staticStyle:{"font-size":"24px !important",color:"#D3D3D3"},attrs:{size:"24px",name:"iconfont icontubiao-56"}})],1)],1),i("input",{ref:"fileInput",staticStyle:{display:"none"},attrs:{type:"file",accept:"image/jpg, image/jpeg, image/png"},on:{input:t.onPhotoFileSelected}})],1),i("q-btn",{staticStyle:{"margin-left":"102px"},attrs:{unelevated:"",label:"确认",color:"primary",type:"submit"}})],1)],1)},s=[],n=(i("456d"),i("8a81"),i("d25f"),i("9986"),i("8e6e"),i("9523")),c=i.n(n),l=(i("7f7f"),i("c7e0")),a=i("116d"),r=i("2f62"),f=i("2ef0"),u=i.n(f);function p(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,o)}return i}function d(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?p(Object(i),!0).forEach((function(e){c()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):p(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var g={name:"set-logo",data:function(){return{fileName:"",logoUrl:"",systemLogo:null}},computed:d({},Object(r["c"])(["client"])),created:function(){this.getCustomerSet()},methods:d({delImg:function(){this.$refs.fileInput.value=null,this.logoUrl=""},getCustomerSet:function(){var t=this;this.fileName="",Object(a["a"])().then((function(e){var i=u.a.isNil(e.systemLogo)?null:e.systemLogo;t.systemLogo=i,t.logoUrl=i})),this.$nextTick((function(){t.$refs.fileInput.value=null}))},_onUploadPhotoClick:function(){this.$refs.fileInput.dispatchEvent(new MouseEvent("click"))},onPhotoFileSelected:function(t){var e=this,i=this.$refs.fileInput.files[0],o=new FileReader;o.readAsDataURL(i),o.onload=function(){e.logoUrl=o.result}},submit:function(){if(this.systemLogo!==this.logoUrl)if(""===this.logoUrl)this.setCustomerSet("");else{var t=this.$refs.fileInput.files;if(!this.$utils.fileTypeHoldUp(t[0].name,[".jpg",".jpeg",".png"]))return;var e=t[0].size,i=2097152;if(e<=i){var o=this.CommonConfig.ossFilePath.logoImagesDir,s=this.$getUploadPath(t,o);this.fileName=s.fileNameNew,this.onSubscribe(),this.uploadFlie(s.uploadPath,t[0],s.fileNameNew)}else this.$message.warning("文件大小不能超过2M")}},uploadFlie:function(t,e,i){var o=this;Object(l["d"])(t,e,i).then((function(t){"1200"!==t.code&&(o.$showErrTips("上传失败，请稍后重试"),o.closeUbscribeTopic())})).catch((function(){o.closeUbscribeTopic()}))},onSubscribe:function(){var t=this;this.client?this.client.subscribe("".concat(this.CommonConfig.socketConfig.SOCKET_TOPIC.uploadFile.subscribeTopic).concat(this.fileName),this.onImgMessageArrived,{id:"".concat(this.fileName)}):setTimeout((function(){t.onSubscribe()}),200)},closeUbscribeTopic:function(){this.client.unsubscribe("".concat(this.fileName)),this.$q.loading.hide()},onImgMessageArrived:function(t){var e=JSON.parse(t.body).data;if(e.requestId===this.fileName){if(e.code+""!=="200")return this.$showErrTips("上传失败，请稍后重试"),void this.closeUbscribeTopic();this.closeUbscribeTopic(),this.setCustomerSet(e.data)}},setCustomerSet:function(t){var e=this,i={systemLogo:t};Object(a["d"])(i).then((function(){e.getCustomerSet(),e.$message.success("保存成功！"),e.saveCustomerSet()}))}},Object(r["b"])(["saveCustomerSet"]))},h=g,b=(i("ed4f"),i("2877")),m=Object(b["a"])(h,o,s,!1,null,"30b00c99",null);e["default"]=m.exports},ed4f:function(t,e,i){"use strict";var o=i("674b"),s=i.n(o);s.a}}]);