text: (window.webpackJsonp=window.webpackJsonp||[]).push([[46],{"0b6a5fce95cc6be643c8":function(e,t,n){var a=n("d1b98b961818c2b0c25f");"string"===typeof a&&(a=[[e.i,a,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n("81325eb2f60ee91338da")(a,r);a.locals&&(e.exports=a.locals)},"57b6c1419ffe50cf8eee":function(e,t,n){(t=e.exports=n("0ec10d64fe1c5691a934")(!1)).push([e.i,"._1q4V-Xm8DpnMlz7R_SHZDE {\n  padding: 8px;\n}\n._1q4V-Xm8DpnMlz7R_SHZDE ._2sIEMq1uG6Umq6iw6ciwM4 {\n  min-height: 40px;\n}\n.vS-xiE-385Mvw0Pc3dbv1 {\n  width: 28px;\n}\n.kSxmsrsfAmkwdt9oR3viI {\n  width: 100%;\n}\n",""]),t.locals={rows:"_1q4V-Xm8DpnMlz7R_SHZDE",rowBlock:"_2sIEMq1uG6Umq6iw6ciwM4",color:"vS-xiE-385Mvw0Pc3dbv1",colControl:"kSxmsrsfAmkwdt9oR3viI"}},d1b98b961818c2b0c25f:function(e,t,n){(t=e.exports=n("0ec10d64fe1c5691a934")(!1)).push([e.i,"._24fz2HwY8KJrtd3FW4zkjt {\n  width: 80px;\n}\n._1Pwl0V2fmG4y409Ca6jyuz i {\n  margin-left: 8px;\n}\n._1Pwl0V2fmG4y409Ca6jyuz i:hover {\n  cursor: pointer;\n}\n._2UDzx1oc-P3i2RF7VxXzzl {\n  max-height: 600px;\n  overflow-y: auto;\n}\n",""]),t.locals={tableInput:"_24fz2HwY8KJrtd3FW4zkjt",tableEditCell:"_1Pwl0V2fmG4y409Ca6jyuz",headerTable:"_2UDzx1oc-P3i2RF7VxXzzl"}},d7cf1b4945a97d9fb8a7:function(e,t,n){var a=n("57b6c1419ffe50cf8eee");"string"===typeof a&&(a=[[e.i,a,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n("81325eb2f60ee91338da")(a,r);a.locals&&(e.exports=a.locals)},f593cab48525cf136650:function(e,t,n){"use strict";n.r(t);n("a66bcec15b7afd3a76f4");var a=n("5ec22e33e5dbc0df87ab"),r=(n("e70e2f9e241591bc778f"),n("307b71721cfe1d24904a")),o=(n("b36896e101ee4310f08e"),n("17039584def8c4a98365")),c=(n("c933c23d12df09752a53"),n("2645f6876a268a5fcbb7")),l=(n("6f8a75b683edb46e6ba4"),n("0622d4e3cdfb3ecf33cc")),i=(n("0512d0f24e6194f4a71e"),n("cb876e1434d30ea7ee88")),f=(n("2e5e3a1dbbc1cf8a22f8"),n("5d5601ca3545162b462f")),u=(n("5965a49ff94d800950b6"),n("1a23c317665c95518b76")),s=(n("59c302ae8b7636afd4f8"),n("f789a538346125b10186")),d=(n("7b33a0cb8918c57bbd73"),n("fd18e651ed7c9b56b2ff")),p=(n("b644bd399130fdb14d70"),n("2ccc92ca52c351c6dde2")),m=n("246df9874efc20494c0b"),y=n.n(m),b=n("0d9e341897112a3de7da"),g=n.n(b),v=n("55c69f0ea731e712b8f3"),h=n("3bb731ebd40812aa4cb1"),C=n("39619bfaf8da2322503f"),E=n("a21591280e67f469f560"),w=n("0b6a5fce95cc6be643c8"),k=n.n(w),S=n("d7cf1b4945a97d9fb8a7"),j=n.n(S);function x(e){return(x="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function H(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],a=!0,r=!1,o=void 0;try{for(var c,l=e[Symbol.iterator]();!(a=(c=l.next()).done)&&(n.push(c.value),!t||n.length!==t);a=!0);}catch(e){r=!0,o=e}finally{try{a||null==l.return||l.return()}finally{if(r)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach(function(t){K(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function N(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function I(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function z(e){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A(e,t){return(A=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function K(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var D=p.a.Group,M=d.a.Group,R=d.a.Button,F=y.a.createElement(R,{value:"flex-start"},"\u5de6\u5bf9\u9f50"),G=y.a.createElement(R,{value:"center"},"\u5c45\u4e2d"),V=y.a.createElement(R,{value:"flex-end"},"\u53f3\u5bf9\u9f50"),J=y.a.createElement(u.a,{type:"arrow-up"}),q=y.a.createElement(u.a,{type:"arrow-down"}),T=y.a.createElement(i.a,{span:1},y.a.createElement(l.a,{type:"flex",justify:"end"},y.a.createElement(a.a,{title:"\u8868\u683c\u6570\u636e\u5217\u8bf7\u5728\u5916\u90e8\u62d6\u62fd\u4ee5\u66f4\u6539\u987a\u5e8f"},y.a.createElement(u.a,{type:"info-circle"})))),B=function(e){function t(e){var n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=z(t).call(this,e),n=!r||"object"!==x(r)&&"function"!==typeof r?_(a):r,K(_(n),"headerNameInput",y.a.createRef()),K(_(n),"moveUp",function(){var e=n.state,t=e.localConfig,a=e.mapHeaderParent,r=e.currentSelectedKeys;r.length<=0?s.a.warning("\u8bf7\u52fe\u9009\u8981\u4e0a\u79fb\u7684\u5217"):(r.forEach(function(e){var n=a[e],r=n?n.children:t,o=r.findIndex(function(t){return t.key===e});if(!(o<1)){var c=r[o-1];r[o-1]=r[o],r[o]=c}}),n.setState({localConfig:N(t)}))}),K(_(n),"moveDown",function(){var e=n.state,t=e.localConfig,a=e.mapHeaderParent,r=e.currentSelectedKeys;r.length<=0?s.a.warning("\u8bf7\u52fe\u9009\u8981\u4e0b\u79fb\u7684\u5217"):(r.forEach(function(e){var n=a[e],r=n?n.children:t,o=r.findIndex(function(t){return t.key===e});if(!(o>=r.length-1)){var c=r[o];r[o]=r[o+1],r[o+1]=c}}),n.setState({localConfig:N(t)}))}),K(_(n),"mergeColumns",function(){var e=n.state,t=e.localConfig,a=e.mapHeader,r=e.mapHeaderParent,o=e.currentSelectedKeys;if(o.length<=0)s.a.warning("\u8bf7\u52fe\u9009\u8981\u5408\u5e76\u7684\u5217");else{var c=[];if(o.forEach(function(e){for(var t=a[e];o.includes(t.key);){var n=r[t.key];if(!n)break;t=n}c.findIndex(function(e){return e.key===t.key})<0&&c.push(t)}),c.every(function(e){return!r[e.key]})){var l={key:Object(v.d)(5),headerName:"\u65b0\u5efa\u5408\u5e76\u5217",alias:null,visualType:null,isGroup:!0,style:P({},h.a,{justifyContent:"center"}),children:c},i=t.length-c.length;i=c.reduce(function(e,n){return Math.min(e,t.findIndex(function(e){return e.key===n.key}))},i);var f=c.map(function(e){return e.key}),u=t.filter(function(e){return!f.includes(e.key)});u.splice(i,0,l);var d=H(n.getMapHeaderKeyAndConfig(u),2),p=d[0],m=d[1];n.setState({localConfig:u,mapHeader:p,mapHeaderParent:m,currentEditingConfig:l,currentSelectedKeys:[]},function(){n.headerNameInput.current.focus(),n.headerNameInput.current.select()})}else s.a.warning("\u52fe\u9009\u7684\u5217\u5e94\u662f\u5f53\u524d\u6700\u4e0a\u7ea7\u5217")}}),K(_(n),"cancel",function(){n.props.onCancel()}),K(_(n),"save",function(){n.props.onSave(n.state.localConfig)}),K(_(n),"propChange",function(e,t){return function(a){var r=a.target?a.target.value:a,o=n.state.localConfig,c=e.key,l=function(e){var n=c===e.key;return n&&(e.style[t]=r),n};o.some(function(e){return n.traverseHeaderConfig(e,null,l)}),n.setState({localConfig:N(o)})}}),K(_(n),"editHeaderName",function(e){return function(){n.state.localConfig.some(function(t){return n.traverseHeaderConfig(t,null,function(t){var a=t.key===e;return a&&n.setState({currentEditingConfig:t},function(){n.headerNameInput.current.focus(),n.headerNameInput.current.select()}),a})})}}),K(_(n),"deleteHeader",function(e){return function(){var t=n.state,a=t.localConfig,r=(t.mapHeader,t.mapHeaderParent);a.some(function(t){return n.traverseHeaderConfig(t,null,function(t){var n=t.key===e;if(n){var o,c,l=r[t.key];if(l)o=l.children.findIndex(function(e){return e.key===t.key}),(c=l.children).splice.apply(c,[o,1].concat(N(t.children)));else o=a.findIndex(function(e){return e.key===t.key}),a.splice.apply(a,[o,1].concat(N(t.children)))}return n})});var o=H(n.getMapHeaderKeyAndConfig(a),2),c=o[0],l=o[1];n.setState({mapHeader:c,mapHeaderParent:l,localConfig:a})}}),K(_(n),"saveEditingHeaderName",function(e){var t=e.target.value;if(t){var a=n.state,r=a.localConfig,o=a.currentEditingConfig;r.some(function(e){return n.traverseHeaderConfig(e,null,function(e){var n=e.key===o.key;return n&&(e.headerName=t),n})}),n.setState({localConfig:N(r),currentEditingConfig:null})}else s.a.warning("\u8bf7\u8f93\u5165\u548c\u5e76\u5217\u540d\u79f0")}),K(_(n),"columns",[{title:"\u8868\u683c\u5217",dataIndex:"headerName",key:"headerName",render:function(e,t){var a=n.state.currentEditingConfig,r=t.key,o=t.headerName,c=t.alias,l=t.isGroup;if(!a||a.key!==r)return l?y.a.createElement("span",{className:k.a.tableEditCell},y.a.createElement("label",null,c||o),y.a.createElement(u.a,{type:"edit",onClick:n.editHeaderName(r)}),y.a.createElement(u.a,{type:"delete",onClick:n.deleteHeader(r)})):y.a.createElement("label",null,c||o);var i=a.headerName;return y.a.createElement(f.a,{ref:n.headerNameInput,className:k.a.tableInput,defaultValue:i,onPressEnter:n.saveEditingHeaderName})}},{title:"\u80cc\u666f\u8272",dataIndex:"backgroundColor",key:"backgroundColor",width:60,render:function(e,t){var a=t.style.backgroundColor;return y.a.createElement(l.a,{type:"flex",justify:"center"},y.a.createElement(i.a,null,y.a.createElement(C.a,{className:j.a.color,value:a,onChange:n.propChange(t,"backgroundColor")})))}},{title:"\u5b57\u4f53",dataIndex:"font",key:"font",width:285,render:function(e,t){var a=t.style,r=a.fontSize,o=a.fontFamily,f=a.fontColor,u=a.fontStyle,s=a.fontWeight;return y.a.createElement(y.a.Fragment,null,y.a.createElement(l.a,{gutter:8,type:"flex",align:"middle",className:j.a.rowBlock},y.a.createElement(i.a,{span:14},y.a.createElement(c.a,{size:"small",className:j.a.colControl,placeholder:"\u5b57\u4f53",value:o,onChange:n.propChange(t,"fontFamily")},h.b)),y.a.createElement(i.a,{span:6},y.a.createElement(c.a,{size:"small",className:j.a.colControl,placeholder:"\u6587\u5b57\u5927\u5c0f",value:r,onChange:n.propChange(t,"fontSize")},h.c)),y.a.createElement(i.a,{span:4},y.a.createElement(C.a,{className:j.a.color,value:f,onChange:n.propChange(t,"fontColor")}))),y.a.createElement(l.a,{gutter:8,type:"flex",align:"middle",className:j.a.rowBlock},y.a.createElement(i.a,{span:12},y.a.createElement(c.a,{size:"small",className:j.a.colControl,value:u,onChange:n.propChange(t,"fontStyle")},h.d)),y.a.createElement(i.a,{span:12},y.a.createElement(c.a,{size:"small",className:j.a.colControl,value:s,onChange:n.propChange(t,"fontWeight")},h.e))))}},{title:"\u5bf9\u9f50",dataIndex:"justifyContent",key:"justifyContent",width:180,render:function(e,t){var a=t.style.justifyContent;return y.a.createElement(M,{size:"small",value:a,onChange:n.propChange(t,"justifyContent")},F,G,V)}}]),K(_(n),"modalFooter",[y.a.createElement(p.a,{key:"cancel",size:"large",onClick:n.cancel},"\u53d6 \u6d88"),y.a.createElement(p.a,{key:"submit",size:"large",type:"primary",onClick:n.save},"\u4fdd \u5b58")]),K(_(n),"tableRowSelection",{hideDefaultSelections:!0,onChange:function(e){n.setState({currentSelectedKeys:e})}});var o=Object(E.fromJS)(e.config).toJS(),d=H(n.getMapHeaderKeyAndConfig(o),2),m=d[0],b=d[1];return n.state={localConfig:o,currentEditingConfig:null,mapHeader:m,mapHeaderParent:b,currentSelectedKeys:[]},n}var n,a,d;return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&A(e,t)}(t,y.a.PureComponent),n=t,(a=[{key:"componentWillReceiveProps",value:function(e){if(e.config!==this.props.config){var t=Object(E.fromJS)(e.config).toJS(),n=H(this.getMapHeaderKeyAndConfig(t),2),a=n[0],r=n[1];this.setState({localConfig:t,mapHeader:a,mapHeaderParent:r,currentSelectedKeys:[]})}}},{key:"getMapHeaderKeyAndConfig",value:function(e){var t=this,n={},a={};return e.forEach(function(e){return t.traverseHeaderConfig(e,null,function(e,t){return n[e.key]=e,a[e.key]=t,!1})}),[n,a]}},{key:"traverseHeaderConfig",value:function(e,t,n){var a=this,r=n(e,t);return r||(r=Array.isArray(e.children)&&e.children.some(function(t){return a.traverseHeaderConfig(t,e,n)}))}},{key:"render",value:function(){var e,t=this.props.visible,n=this.state,a=n.localConfig,c=n.currentSelectedKeys,f=P({},this.tableRowSelection,{selectedRowKeys:c}),u=g()((K(e={},j.a.rows,!0),K(e,k.a.headerTable,!0),e));return y.a.createElement(r.a,{title:"\u8868\u5934\u6837\u5f0f\u4e0e\u5206\u7ec4",width:1e3,maskClosable:!1,footer:this.modalFooter,visible:t,onCancel:this.cancel,onOk:this.save},y.a.createElement("div",{className:j.a.rows},y.a.createElement(l.a,{gutter:8,className:j.a.rowBlock,type:"flex",align:"middle"},y.a.createElement(i.a,{span:4},y.a.createElement(p.a,{type:"primary",onClick:this.mergeColumns},"\u5408\u5e76")),y.a.createElement(i.a,{span:19},y.a.createElement(l.a,{gutter:8,type:"flex",justify:"end",align:"middle"},y.a.createElement(D,null,y.a.createElement(p.a,{onClick:this.moveUp},J,"\u4e0a\u79fb"),y.a.createElement(p.a,{onClick:this.moveDown},"\u4e0b\u79fb",q)))),T)),y.a.createElement("div",{className:u},y.a.createElement(l.a,{gutter:8,className:j.a.rowBlock},y.a.createElement(i.a,{span:24},y.a.createElement(o.a,{bordered:!0,pagination:!1,columns:this.columns,dataSource:a,rowSelection:f})))))}}])&&I(n.prototype,a),d&&I(n,d),t}();t.default=B}}]);