(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[15],{nm0N:function(e,t,a){"use strict";var l=a("tAuX"),n=a("g09b");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a("+L6B");var r=n(a("2/Rp"));a("DZo9");var i=n(a("8z0m"));a("5NDa");var u=n(a("5rEg"));a("IzEo");var o=n(a("bx4M"));a("Pwec");var d=n(a("CtXQ")),s=n(a("2Taf")),f=n(a("vZ4D")),c=n(a("l4Ni")),p=n(a("ujKo")),m=n(a("MhPg"));a("miYZ");var g=n(a("tsqr"));a("y8nQ");var v=n(a("Vl3Y")),h=l(a("q1tI")),b=a("y1Nh"),y=a("MuoO"),E=a("Y2fQ"),C=function(e,t,a,l){var n,r=arguments.length,i=r<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,a):l;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,a,l);else for(var u=e.length-1;u>=0;u--)(n=e[u])&&(i=(r<3?n(i):r>3?n(t,a,i):n(t,a))||i);return r>3&&i&&Object.defineProperty(t,a,i),i},j=v.default.Item;function w(e,t){var a=new FileReader;a.addEventListener("load",function(){return t(a.result)}),a.readAsDataURL(e)}function O(e){var t="image/jpeg"===e.type||"image/png"===e.type;t||g.default.error("You can only upload JPG/PNG file!");var a=e.size/1024/1024<2;return a||g.default.error("Image must smaller than 2MB!"),t&&a}var M=function(e){function t(){var e;return(0,s.default)(this,t),e=(0,c.default)(this,(0,p.default)(t).apply(this,arguments)),e.state={loading:!1,imageUrl:""},e.handleSubmit=function(t){var a=e.props,l=a.adminConfig.data,n=a.dispatch,r=a.form;t.preventDefault(),r.validateFieldsAndScroll(function(e,t){e||Object.keys(t).forEach(function(e){t[e]!==l.list[e].value&&n({type:"adminConfig/update",payload:{id:e,value:t[e]}})})})},e.handleChange=function(t){if("uploading"!==t.file.status){if("done"===t.file.status){w(t.file.originFileObj,function(t){return e.setState({imageUrl:t,loading:!1})});var a=e.props.dispatch;a({type:"adminConfig/update",payload:{id:153,value:t.file.response.url}})}}else e.setState({loading:!0})},e}return(0,m.default)(t,e),(0,f.default)(t,[{key:"componentDidMount",value:function(){var e=this.props.dispatch;e({type:"adminConfig/fetch"})}},{key:"render",value:function(){var e=this.props,t=e.adminConfig.data,a=e.form.getFieldDecorator,l={labelCol:{xs:{span:24},sm:{span:7}},wrapperCol:{xs:{span:24},sm:{span:12},md:{span:10}}},n={wrapperCol:{xs:{span:24,offset:0},sm:{span:10,offset:7}}};if(0===t.list.length)return h.default.createElement(b.PageHeaderWrapper,null);var s=h.default.createElement("div",null,h.default.createElement(d.default,{type:this.state.loading?"loading":"plus"}),h.default.createElement("div",{className:"ant-upload-text"},"Upload")),f=this.state.imageUrl?this.state.imageUrl:t.list[153].value,c=void 0===localStorage.getItem("token")?"":"Bearer ".concat(localStorage.getItem("token"));return h.default.createElement(b.PageHeaderWrapper,null,h.default.createElement(o.default,{bordered:!1},h.default.createElement(v.default,{onSubmit:this.handleSubmit,hideRequiredMark:!0,style:{marginTop:8}},h.default.createElement(j,Object.assign({},l,{label:"".concat((0,E.formatMessage)({id:"Article"})," ID")}),a("150",{rules:[{required:!0}],initialValue:t.list[150].value})(h.default.createElement(u.default,null))),h.default.createElement(j,Object.assign({},l,{label:(0,E.formatMessage)({id:"QQ group number"})}),a("151",{rules:[{required:!0}],initialValue:t.list[151].value})(h.default.createElement(u.default,null))),h.default.createElement(j,Object.assign({},l,{label:(0,E.formatMessage)({id:"QQ group code"})}),a("152",{rules:[{required:!0}],initialValue:t.list[152].value})(h.default.createElement(u.default,null))),h.default.createElement(j,Object.assign({},l,{label:(0,E.formatMessage)({id:"QQ group QR code"})}),h.default.createElement(i.default,{name:"file",listType:"picture-card",className:"avatar-uploader",showUploadList:!1,action:"/api/configs/uploadQqQunOrCode",beforeUpload:O,onChange:this.handleChange,headers:{Authorization:c}},f?h.default.createElement("img",{src:f,alt:"file",style:{width:"100%"}}):s)),h.default.createElement(j,Object.assign({},n,{style:{marginTop:32}}),h.default.createElement(r.default,{type:"primary",htmlType:"submit"},(0,E.formatMessage)({id:"Submit"}))))))}}]),t}(h.Component);M=C([(0,y.connect)(function(e){var t=e.adminConfig,a=e.loading;return{adminConfig:t,loading:a.models.adminConfig}})],M);var Q=v.default.create()(M);t.default=Q}}]);