p__生态系统碳汇平台__系统管理员__用户管理__UserList.8b877635.async.js 16 KB

1
  1. (self["webpackChunk"]=self["webpackChunk"]||[]).push([[828],{31930:function(e){e.exports={"ant-popover":"ant-popover","ant-popover-hidden":"ant-popover-hidden","ant-popover-placement-top":"ant-popover-placement-top","ant-popover-placement-topLeft":"ant-popover-placement-topLeft","ant-popover-placement-topRight":"ant-popover-placement-topRight","ant-popover-placement-right":"ant-popover-placement-right","ant-popover-placement-rightTop":"ant-popover-placement-rightTop","ant-popover-placement-rightBottom":"ant-popover-placement-rightBottom","ant-popover-placement-bottom":"ant-popover-placement-bottom","ant-popover-placement-bottomLeft":"ant-popover-placement-bottomLeft","ant-popover-placement-bottomRight":"ant-popover-placement-bottomRight","ant-popover-placement-left":"ant-popover-placement-left","ant-popover-placement-leftTop":"ant-popover-placement-leftTop","ant-popover-placement-leftBottom":"ant-popover-placement-leftBottom","ant-popover-inner":"ant-popover-inner","ant-popover-title":"ant-popover-title","ant-popover-inner-content":"ant-popover-inner-content","ant-popover-message":"ant-popover-message",anticon:"anticon","ant-popover-message-title":"ant-popover-message-title","ant-popover-buttons":"ant-popover-buttons","ant-popover-arrow":"ant-popover-arrow","ant-popover-content":"ant-popover-content"}},40031:function(e,t,n){"use strict";n.d(t,{wo:function(){return o},FO:function(){return r},uD:function(){return a},Ye:function(){return i},b5:function(){return l}});var o={labelCol:{span:6},wrapperCol:{span:18}},r={labelCol:{span:7},wrapperCol:{span:16}},a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,n=null;return function(o){n&&clearTimeout(n),n=setTimeout(e,t,o)}},i="#52c41a",l="#d9d9d9"},63544:function(e,t,n){"use strict";n.d(t,{Vp:function(){return r},vU:function(){return a}});n(68059);var o=n(94966),r=function(e){o.default.success({message:e})},a=function(e){o.default.error({message:e})}},7515:function(e,t,n){"use strict";n.d(t,{K1:function(){return r},FI:function(){return o},Vd:function(){return a}});var o=function(e){return sessionStorage.setItem("globalSize",e)},r=function(){return sessionStorage.getItem("globalSize")||10},a=["10","20","30","40","100","200","300","500","1000"]},41611:function(e,t,n){"use strict";n.d(t,{us:function(){return o},bt:function(){return r},aH:function(){return a}});var o=[{required:!0,message:"\u5fc5\u9009\uff01"}],r=[{required:!0,message:"\u5fc5\u586b\uff01"}],a=/^((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/},36660:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return P}});n(26780);var o=n(49283),r=(n(29585),n(92527)),a=(n(13753),n(60287)),i=(n(67604),n(67329)),l=(n(68137),n(11718)),s=(n(12284),n(28930)),c=(n(33827),n(50190)),p=(n(14943),n(74356)),u=n(11849),d=n(69610),f=n(54941),m=n(81306),h=n(80017),v=(n(97140),n(90407)),g=n(67294),b=n(7515),y=n(40031),x=n(13245),Z=n(41611),w=n(45375),C=n(63544),j=n(85893),S=v.Z.Option,k=function(e){(0,m.Z)(n,e);var t=(0,h.Z)(n);function n(e){var o;return(0,d.Z)(this,n),o=t.call(this,e),o.getType=function(){(0,w.U2)("website/down-list").then((function(e){o.setState({proType:e.data})}))},o.getDetail=function(e){(0,w.U2)("eco-user/".concat(e)).then((function(e){o.props.form.setFieldsValue((0,u.Z)({},e.data)),o.setState({detailInfo:e.data})}))},o.handleOk=function(){var e=o.props.editId,t=o.state,n=t.detailInfo;t.picUrl;o.props.form.validateFieldsAndScroll((function(t,r){if(t)return!1;if(o.setState({loading:!0}),e){var a=(0,u.Z)((0,u.Z)((0,u.Z)({},n),r),{},{id:e,roleCode:"ROLE_MANAGER"});(0,w.gz)("eco-user",a).then((function(e){(0,C.Vp)("\u4fee\u6539\u6210\u529f"),o.handleCancel()})).catch((function(e){o.setState({loading:!1})}))}else{var i=(0,u.Z)((0,u.Z)({},r),{},{roleCode:"ROLE_MANAGER"});(0,w.v_)("eco-user",i).then((function(e){(0,C.Vp)("\u65b0\u589e\u6210\u529f"),o.handleCancel()})).catch((function(e){o.setState({loading:!1})}))}}))},o.handleCancel=function(){o.setState({loading:!1}),o.props.form.resetFields(),o.props.handleClose()},o.handlePreview=function(){o.setState({previewVisible:!0})},o.state={loading:!1,proType:[],previewVisible:!1,previewImage:"",detailInfo:{},picUrl:"",fileList:[]},o}return(0,f.Z)(n,[{key:"componentDidMount",value:function(){this.getType();var e=this.props.editId;e&&this.getDetail(e)}},{key:"render",value:function(){var e=this.props.form.getFieldDecorator,t=this.props,n=t.visible,r=t.editId,a=this.state,s=a.loading,c=a.proType,p=r?"\u4fee\u6539":"\u65b0\u589e",d=null===c||void 0===c?void 0:c.map((function(e,t){return(0,j.jsx)(S,{value:e.id,children:e.name},t)}));return(0,j.jsx)(o.Z,{visible:n,title:p,onOk:this.handleOk,onCancel:this.handleCancel,confirmLoading:s,children:(0,j.jsxs)(i.Z,(0,u.Z)((0,u.Z)({},y.FO),{},{children:[(0,j.jsx)(i.Z.Item,{label:"\u6240\u5c5e\u7f51\u7ad9",children:e("websiteId",{rules:Z.us})((0,j.jsx)(v.Z,{allowClear:!0,placeholder:"\u8bf7\u9009\u62e9",children:d}))}),(0,j.jsx)(i.Z.Item,{label:"\u59d3\u540d",children:e("realName",{getValueFromEvent:function(e){return(0,x.bc)(e.target.value)},rules:Z.bt})((0,j.jsx)(l.Z,{allowClear:!0,placeholder:"\u8bf7\u8f93\u5165",maxLength:20}))}),(0,j.jsx)(i.Z.Item,{label:"\u7528\u6237\u540d",children:e("login",{getValueFromEvent:function(e){return(0,x.bc)(e.target.value)},rules:[{required:!0,message:"\u5fc5\u586b!"},{pattern:/^[^\s]*$/,message:"\u7981\u6b62\u8f93\u5165\u7a7a\u683c"},{pattern:/^[0-9a-z]{6,}$/,message:"\u81f3\u5c116\u4f4d\u82f1\u6587\u5c0f\u5199\u5b57\u6bcd\u6216\u6570\u5b57"}]})((0,j.jsx)(l.Z,{placeholder:"\u81f3\u5c116\u4f4d\u82f1\u6587\u5c0f\u5199\u5b57\u6bcd\u6216\u6570\u5b57",disabled:this.props.editId,allowClear:!0,maxLength:20}))}),!this.props.editId&&(0,j.jsx)(i.Z.Item,{label:"\u5bc6\u7801",children:e("password",{getValueFromEvent:function(e){return(0,x.bc)(e.target.value)},rules:[{required:!0,message:"\u5fc5\u586b!"},{pattern:/^[^\s]*$/,message:"\u7981\u6b62\u8f93\u5165\u7a7a\u683c"},{pattern:/^[0-9a-z]{6,}$/,message:"\u81f3\u5c116\u4f4d\u82f1\u6587\u5c0f\u5199\u5b57\u6bcd\u6216\u6570\u5b57"}]})((0,j.jsx)(l.Z.Password,{allowClear:!0,placeholder:"\u8bf7\u8f93\u5165"}))})]}))})}}]),n}(g.Component),I=i.Z.create()(k),O=n(56721),V=v.Z.Option,T=function(e){(0,m.Z)(n,e);var t=(0,h.Z)(n);function n(e){var o;return(0,d.Z)(this,n),o=t.call(this,e),o.getType=function(){(0,w.U2)("website/down-list").then((function(e){o.setState({proType:e.data})}))},o.fetch=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{size:o.state.pagination.pageSize,page:o.state.pagination.current},t=e.page-1||0,n=void 0===e.size?(0,b.K1)():e.size,r={};o.props.form.validateFieldsAndScroll((function(e,t){e||(r=t)})),o.setState({loading:!0});var a=(0,u.Z)({page:t,size:n},r);(0,w.U2)("eco-user",a).then((function(t){var n=o.state.pagination;0===Object.keys(e).length&&0!==n.current&&(n.current=0),n.total=parseInt(t.headers["x-total-count"],10),o.setState({loading:!1,dataSource:t.data,pagination:n})})).catch((function(e){o.setState({loading:!1})}))},o.handleTableChange=function(e){var t=(0,u.Z)({},o.state.pagination);t.current=e.current,t.pageSize=e.pageSize,(0,b.FI)(e.pageSize),o.setState({pagination:t}),o.fetch({size:e.pageSize,page:e.current})},o.qingkong=function(){o.props.form.resetFields();var e=o.state.pagination;e.current=1,o.setState({pagination:e},(function(){o.fetch()}))},o.handleModal=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";o.setState({editId:e,addVisible:!0})},o.handleReset=function(e){o.setState({editId:e,resetVisible:!0})},o.handleClose=function(){o.setState({addVisible:!1,editId:""},(function(){o.fetch()}))},o.handleDelete=function(e){(0,w.IV)("eco-user/".concat(e)).then((function(e){(0,C.Vp)("\u5220\u9664\u6210\u529f"),o.handleClose()}))},o.state={dataSource:[],loading:!1,pagination:{current:1,showQuickJumper:!0,showSizeChanger:!0,showTotal:function(e){return"\u5171 ".concat(e," \u6761 ")},size:"default",pageSizeOptions:b.Vd,defaultPageSize:(0,b.K1)()},proType:[],addVisible:!1,editId:"",resetVisible:!1,password:""},o}return(0,f.Z)(n,[{key:"componentDidMount",value:function(){this.fetch(),this.getType()}},{key:"render",value:function(){var e=this,t=this.props.form.getFieldDecorator,n=this.state,d=n.dataSource,f=n.loading,m=n.pagination,h=n.addVisible,g=n.editId,b=n.proType,y=n.resetVisible,x=[{title:"\u6240\u5c5e\u7f51\u7ad9",dataIndex:"websiteName",ellipsis:!0,render:function(e){return e||(0,j.jsx)(p.Z,{})}},{title:"\u59d3\u540d",align:"center",ellipsis:!0,dataIndex:"realName",render:function(e){return e||(0,j.jsx)(p.Z,{})}},{title:"\u7528\u6237\u540d",align:"center",ellipsis:!0,dataIndex:"login",render:function(e){return e||(0,j.jsx)(p.Z,{})}},{title:"\u6dfb\u52a0\u65f6\u95f4",align:"center",dataIndex:"addTime",render:function(e){return(0,O.kY)(e)||(0,j.jsx)(p.Z,{})}},{title:"\u64cd\u4f5c",dataIndex:"operation",width:180,render:function(t,n){var o=(0,j.jsx)("a",{className:"tb_a_btn",onClick:function(){e.handleModal(n.id,"\u4fee\u6539")},children:"\u4fee\u6539"}),r=(0,j.jsx)("a",{className:"tb_a_btn org",onClick:function(){e.handleReset(n.id)},children:"\u91cd\u7f6e"}),a=(0,j.jsx)(s.Z,{title:"\u786e\u5b9a\u5220\u9664\u5417\uff1f",onConfirm:function(){return e.handleDelete(n.id)},icon:(0,j.jsx)(c.Z,{type:"delete",style:{color:"red"}}),children:(0,j.jsx)("a",{className:"tb_a_btn red",children:"\u5220\u9664"})});return(0,j.jsxs)("span",{children:[o,r,a]})}}],Z=null===b||void 0===b?void 0:b.map((function(e,t){return(0,j.jsx)(V,{value:e.name,children:e.name},t)}));return(0,j.jsxs)("div",{className:"content-box",children:[(0,j.jsxs)(i.Z,{layout:"inline",children:[(0,j.jsx)(i.Z.Item,{className:"formStyle",label:"\u7528\u6237\u540d",children:t("login")((0,j.jsx)(l.Z,{allowClear:!0,style:{width:200},placeholder:"\u8bf7\u8f93\u5165"}))}),(0,j.jsx)(i.Z.Item,{className:"formStyle",label:"\u6240\u5c5e\u7f51\u7ad9",children:t("websiteName")((0,j.jsx)(v.Z,{allowClear:!0,style:{width:200},placeholder:"\u8bf7\u9009\u62e9",children:Z}))}),(0,j.jsx)(i.Z.Item,{className:"formStyle",label:"\u59d3\u540d",children:t("realName")((0,j.jsx)(l.Z,{allowClear:!0,style:{width:200},placeholder:"\u8bf7\u8f93\u5165"}))}),(0,j.jsxs)(i.Z.Item,{children:[(0,j.jsx)(a.Z,{type:"primary",onClick:function(){e.setState({pagination:(0,u.Z)((0,u.Z)({},e.state.pagination),{},{current:1,pageSize:10})},(function(){e.fetch()}))},children:"\u67e5\u8be2"}),(0,j.jsx)(a.Z,{onClick:this.qingkong,style:{margin:"0 10px"},children:"\u91cd\u7f6e"})]}),(0,j.jsx)("br",{}),(0,j.jsx)(a.Z,{type:"primary",icon:"plus",style:{margin:"20px 0"},onClick:function(){return e.handleModal("","\u65b0\u5efa")},children:"\u65b0\u5efa"})]}),(0,j.jsx)(r.Z,{dataSource:d,columns:x,rowKey:function(e){return e.id},pagination:m,loading:f,onChange:this.handleTableChange}),(0,j.jsx)(I,{visible:h,handleClose:this.handleClose,editId:g},h),y&&(0,j.jsxs)(o.Z,{title:"\u91cd\u7f6e\u5bc6\u7801",visible:y,onCancel:function(){return e.setState({resetVisible:!1})},onOk:function(){var t,n,o=new FormData;if(o.append("password",e.state.password),(null===(t=e.state.password)||void 0===t?void 0:t.length)<6||(null===(n=e.state.password)||void 0===n?void 0:n.length)>10)return(0,C.vU)("\u5bc6\u7801\u5e94\u8bbe\u7f6e\u4f4d6-10\u4f4d\u5b57\u6bcd\u6216\u6570\u5b57");(0,w.v_)("eco-user/change-password/".concat(g),o).then((function(t){(0,C.Vp)("\u5bc6\u7801\u91cd\u7f6e\u6210\u529f"),e.fetch(),e.setState({resetVisible:!1,password:""})}))},children:["\u65b0\u5bc6\u7801\uff1a",(0,j.jsx)(l.Z.Password,{style:{width:300},placeholder:"\u8bf7\u8f93\u5165\u5bc6\u78016-10\u4f4d\u5b57\u6bcd\u6216\u6570\u5b57",minLength:6,maxLength:10,value:this.state.password,onChange:function(t){e.setState({password:t.target.value?t.target.value.trim():""})}})]})]})}}]),n}(g.Component),P=i.Z.create()(T)},56721:function(e,t,n){"use strict";n.d(t,{Pv:function(){return i},kY:function(){return a},Hw:function(){return l}});var o=n(56051),r=n.n(o);function a(e){return r()(e).format("YYYY-MM-DD HH:mm:ss")}function i(e){return r()(e).format("YYYY-MM-DD")}function l(e){return r()(e).format("YYYY-MM-DD")}},28930:function(e,t,n){"use strict";var o=n(67294),r=n(63387),a=n(82692),i=n(50190),l=n(60287),s=n(56701),c=n(16980),p=n(19954);function u(e){return u="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},u(e)}function d(){return d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},d.apply(this,arguments)}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function h(e,t,n){return t&&m(e.prototype,t),n&&m(e,n),e}function v(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&&g(e,t)}function g(e,t){return g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},g(e,t)}function b(e){var t=Z();return function(){var n,o=w(e);if(t){var r=w(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return y(this,n)}}function y(e,t){return!t||"object"!==u(t)&&"function"!==typeof t?x(e):t}function x(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Z(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function w(e){return w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},w(e)}var C=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},j=function(e){v(n,e);var t=b(n);function n(e){var r;return f(this,n),r=t.call(this,e),r.onConfirm=function(e){r.setVisible(!1,e);var t=r.props.onConfirm;t&&t.call(x(r),e)},r.onCancel=function(e){r.setVisible(!1,e);var t=r.props.onCancel;t&&t.call(x(r),e)},r.onVisibleChange=function(e){var t=r.props.disabled;t||r.setVisible(e)},r.saveTooltip=function(e){r.tooltip=e},r.renderOverlay=function(e,t){var n=r.props,a=n.okButtonProps,i=n.cancelButtonProps,s=n.title,c=n.cancelText,p=n.okText,u=n.okType,f=n.icon;return o.createElement("div",null,o.createElement("div",{className:"".concat(e,"-inner-content")},o.createElement("div",{className:"".concat(e,"-message")},f,o.createElement("div",{className:"".concat(e,"-message-title")},s)),o.createElement("div",{className:"".concat(e,"-buttons")},o.createElement(l.Z,d({onClick:r.onCancel,size:"small"},i),c||t.cancelText),o.createElement(l.Z,d({onClick:r.onConfirm,type:u,size:"small"},a),p||t.okText))))},r.renderConfirm=function(e){var t=e.getPrefixCls,n=r.props,i=n.prefixCls,l=n.placement,p=C(n,["prefixCls","placement"]),u=t("popover",i),f=o.createElement(s.Z,{componentName:"Popconfirm",defaultLocale:c.Z.Popconfirm},(function(e){return r.renderOverlay(u,e)}));return o.createElement(a.Z,d({},p,{prefixCls:u,placement:l,onVisibleChange:r.onVisibleChange,visible:r.state.visible,overlay:f,ref:r.saveTooltip}))},r.state={visible:e.visible},r}return h(n,[{key:"getPopupDomNode",value:function(){return this.tooltip.getPopupDomNode()}},{key:"setVisible",value:function(e,t){var n=this.props;"visible"in n||this.setState({visible:e});var o=n.onVisibleChange;o&&o(e,t)}},{key:"render",value:function(){return o.createElement(p.C,null,this.renderConfirm)}}],[{key:"getDerivedStateFromProps",value:function(e){return"visible"in e?{visible:e.visible}:"defaultVisible"in e?{visible:e.defaultVisible}:null}}]),n}(o.Component);j.defaultProps={transitionName:"zoom-big",placement:"top",trigger:"click",okType:"primary",icon:o.createElement(i.Z,{type:"exclamation-circle",theme:"filled"}),disabled:!1},(0,r.polyfill)(j),t["Z"]=j},12284:function(e,t,n){"use strict";n(65056),n(31930),n(13753)}}]);