webpackJsonp([20],{FuPi:function(e,o,t){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var i={data:function(){return{isShowChangePwd:!1,collapsed:!1,username:"",logoConfig:{logoName:"",logoImg:""},logoConfigDatas:{isDelImg:!1,previewImage:"",file:""},logoConfigFormvisible:!0,confirmLoading:!1,formLayout:"horizontal",prjConfigForm:this.$form.createForm(this),previewVisible:!1,fileList:[],fileUpload:{acceptTypes:".jpg,.jpeg,.png",acceptTypesArray:["jpg","jpeg","png"]},postParams:{}}},created:function(){this.getLogo(),this.getInfo()},methods:{getInfo:function(){var e=this;this.$ajax.get({url:this.$api.GET_USER_INFO}).then(function(o){var t=o.data.content,i=void 0;o.data&&o.data.content?(i=(t=o.data.content).username=o.data.content.name||o.data.content.phone,e.$store.commit("SET_USERINFO",t),e.$cookie.set("userName",i),e.$store.commit("SET_USERNAME",i)):(t={},i="")})},getLogo:function(){var e=this;this.$ajax.get({url:this.$api.GET_PROJECT}).then(function(o){if(200==o.code){var t=e.$com.confirm(o,"data.content",{});e.logoConfig.logoName=t.prjName?t.prjName:"",e.logoConfig.logoImg=t.titleImg?t.titleImg:"",e.logoConfigDatas.previewImage=e.logoConfig.logoImg,document.title=e.logoConfig.logoName,e.showLogoConfigFormModal()}})},beforeUpload:function(e){var o=e.name.split("."),t=o[o.length-1].toLowerCase(),i=this.$com.oneOf(t,this.fileUpload.acceptTypesArray),a=e.size/1024/1024<5,n="";return i||(n+=i?"":"文件格式限定为"+this.fileUpload.acceptTypes+"；"),a||(n+=islt200m?"":"一寸照需小于5M；"),!(!i||!a)||(this.$modal.error({title:"上传文件验证未通过",content:n,okText:"确认",cancelText:"取消"}),!1)},handleUpload:function(e){var o=this,t=new FormData;t.append("file",e.file),e.onProgress(),this.$ajax.post({url:this.$api.UPLOAD_TEMP,params:t}).then(function(e){if("200"===e.code){var t=o.$com.confirm(e,"data.content",{});o.logoConfigDatas.file=t.titleImg?t.titleImg:"",o.logoConfigDatas.previewImage=t.titleImg?t.titleImg:"",o.fileList=[]}})},handlePreview:function(){this.previewVisible=!0},delImg:function(){this.fileList=[],this.logoConfig.logoImg="",this.logoConfigDatas.previewImage="",this.logoConfigDatas.isDelImg=!0},showLogoConfigFormModal:function(){this.logoConfigDatas.isDelImg=!1,this.logoConfigFormvisible=!0,this.$nextTick(function(){this.prjConfigForm.setFieldsValue({prjName:this.logoConfig.logoName})})},handleSubmitLogoConfig:function(){var e=this;this.prjConfigForm.validateFields(function(o){if(!o){var t={file:e.logoConfigDatas.file,prjName:e.prjConfigForm.getFieldValue("prjName"),isDelImg:e.logoConfigDatas.isDelImg};e.$ajax.post({url:e.$api.POST_PROJECT,params:t,contentType:"application/x-www-form-urlencoded"}).then(function(o){if("200"==o.code){e.logoConfigFormvisible=!1;var t=e.$com.confirm(o,"data.content",{});e.logoConfig.logoName=t.prjName?t.prjName:"",e.logoConfig.logoImg=t.titleImg?t.titleImg:"",e.logoConfigDatas.previewImage=e.logoConfig.logoImg,document.title=e.logoConfig.logoName}else e.$message.error(o.msg)})}})}}},a=function(){var e=this,o=e.$createElement,t=e._self._c||o;return t("div",{staticClass:"routerWapper"},["sysInfoSetting"==e.$route.name?t("div",{staticClass:"layoutMargin layoutPadding"},[t("a-tabs",{attrs:{"default-active-key":"1"}},[t("a-tab-pane",{key:"1",attrs:{tab:"系统信息"}},[t("a-form",{attrs:{form:e.prjConfigForm}},[t("a-form-item",{attrs:{label:"项目名","label-col":{span:5},"wrapper-col":{span:12}}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["prjName",{rules:[{required:!0,message:"请输入项目名!"}]}],expression:"['prjName', { rules: [{ required: true, message: '请输入项目名!' }] }]"}]})],1),e._v(" "),t("a-form-item",{attrs:{label:"图片","label-col":{span:5},"wrapper-col":{span:12}}},[t("img",{attrs:{src:e.logoConfigDatas.previewImage,alt:"",width:"105",height:"105"},on:{click:function(o){e.previewVisible=!0}}}),e._v(" "),t("a-upload",{attrs:{listType:"picture-card",fileList:e.fileList,customRequest:function(o){e.handleUpload(o,e.fileList)},beforeUpload:e.beforeUpload,accept:e.fileUpload.acceptTypes},on:{preview:e.handlePreview}},[e.fileList.length<1?t("div",[t("a-icon",{attrs:{type:"cloud-upload"}}),e._v(" "),t("div",{staticClass:"ant-upload-text",staticStyle:{fontSize:"12px"}},[e._v("图片仅支持jpg、png、jpeg格式")])],1):e._e()]),e._v(" "),t("a-button",{on:{click:e.delImg}},[e._v("删除图片")])],1)],1),e._v(" "),t("a-row",[t("a-col",{attrs:{span:16}}),e._v(" "),t("a-col",{attrs:{span:8}},[t("a-button",{attrs:{type:"default"},on:{click:e.handleSubmitLogoConfig}},[e._v("保存信息")])],1)],1),e._v(" "),t("a-modal",{staticStyle:{"text-align":"center"},attrs:{visible:e.previewVisible,width:600,footer:null},on:{cancel:function(o){e.previewVisible=!1}}},[t("img",{staticStyle:{width:"80%",height:"auto"},attrs:{alt:"项目logo",src:e.logoConfigDatas.previewImage}})])],1)],1)],1):e._e()])};a._withStripped=!0;var n={render:a,staticRenderFns:[]},l=n;var s=t("C7Lr")(i,l,!1,null,null,null);s.options.__file="src/views/personal/sysInfoSetting.vue";o.default=s.exports}});