1 |
- "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[194],{86615:function(ae,K,e){var B=e(1413),l=e(45987),u=e(22270),Z=e(78045),R=e(62435),w=e(28614),m=e(34176),L=e(86074),S=["fieldProps","options","radioType","layout","proFieldProps","valueEnum"],P=R.forwardRef(function(s,A){var C=s.fieldProps,n=s.options,U=s.radioType,a=s.layout,r=s.proFieldProps,h=s.valueEnum,E=(0,l.Z)(s,S);return(0,L.jsx)(m.Z,(0,B.Z)((0,B.Z)({valueType:U==="button"?"radioButton":"radio",ref:A,valueEnum:(0,u.h)(h,void 0)},E),{},{fieldProps:(0,B.Z)({options:n,layout:a},C),proFieldProps:r,filedConfig:{customLightMode:!0}}))}),j=R.forwardRef(function(s,A){var C=s.fieldProps,n=s.children;return(0,L.jsx)(Z.ZP,(0,B.Z)((0,B.Z)({},C),{},{ref:A,children:n}))}),T=(0,w.G)(j,{valuePropName:"checked",ignoreWidth:!0}),g=T;g.Group=P,g.Button=Z.ZP.Button,g.displayName="ProFormComponent",K.Z=g},5966:function(ae,K,e){var B=e(97685),l=e(1413),u=e(45987),Z=e(21770),R=e(23323),w=e(55241),m=e(97435),L=e(62435),S=e(34176),P=e(86074),j=["fieldProps","proFieldProps"],T=["fieldProps","proFieldProps"],g="text",s=function(a){var r=a.fieldProps,h=a.proFieldProps,E=(0,u.Z)(a,j);return(0,P.jsx)(S.Z,(0,l.Z)({valueType:g,fieldProps:r,filedConfig:{valueType:g},proFieldProps:h},E))},A=function(a){var r=(0,Z.Z)(a.open||!1,{value:a.open,onChange:a.onOpenChange}),h=(0,B.Z)(r,2),E=h[0],H=h[1];return(0,P.jsx)(R.Z.Item,{shouldUpdate:!0,noStyle:!0,children:function(Q){var O,X=Q.getFieldValue(a.name||[]);return(0,P.jsx)(w.Z,(0,l.Z)((0,l.Z)({getPopupContainer:function(t){return t&&t.parentNode?t.parentNode:t},onOpenChange:function(t){return H(t)},content:(0,P.jsxs)("div",{style:{padding:"4px 0"},children:[(O=a.statusRender)===null||O===void 0?void 0:O.call(a,X),a.strengthText?(0,P.jsx)("div",{style:{marginTop:10},children:(0,P.jsx)("span",{children:a.strengthText})}):null]}),overlayStyle:{width:240},placement:"rightTop"},a.popoverProps),{},{open:E,children:a.children}))}})},C=function(a){var r=a.fieldProps,h=a.proFieldProps,E=(0,u.Z)(a,T),H=(0,L.useState)(!1),J=(0,B.Z)(H,2),Q=J[0],O=J[1];return r!=null&&r.statusRender&&E.name?(0,P.jsx)(A,{name:E.name,statusRender:r==null?void 0:r.statusRender,popoverProps:r==null?void 0:r.popoverProps,strengthText:r==null?void 0:r.strengthText,open:Q,onOpenChange:O,children:(0,P.jsx)("div",{children:(0,P.jsx)(S.Z,(0,l.Z)({valueType:"password",fieldProps:(0,l.Z)((0,l.Z)({},(0,m.Z)(r,["statusRender","popoverProps","strengthText"])),{},{onBlur:function(p){var t;r==null||(t=r.onBlur)===null||t===void 0||t.call(r,p),O(!1)},onClick:function(p){var t;r==null||(t=r.onClick)===null||t===void 0||t.call(r,p),O(!0)}}),proFieldProps:h,filedConfig:{valueType:g}},E))})}):(0,P.jsx)(S.Z,(0,l.Z)({valueType:"password",fieldProps:r,proFieldProps:h,filedConfig:{valueType:g}},E))},n=s;n.Password=C,n.displayName="ProFormComponent",K.Z=n},84618:function(ae,K,e){e.r(K),e.d(K,{default:function(){return X}});var B=e(5574),l=e.n(B),u=e(62435),Z=e(59530),R=e(28459),w=e(15009),m=e.n(w),L=e(99289),S=e.n(L),P=e(95338),j=e(42075),T=e(14726),g=e(17788),s=e(68872),A=e(86738),C=e(39680),n=e(86074),U=function(t){var D=t.dispatch,b=t.openModel,z=t.getId,i=(0,u.useRef)(),Y=(0,u.useState)([]),I=l()(Y,2),$=I[0],_=I[1],G=(0,u.useState)(0),q=l()(G,2),ee=q[0],N=q[1],k=(0,u.useState)(1),F=l()(k,2),x=F[0],o=F[1],v=(0,u.useState)(10),ne=l()(v,2),te=ne[0],M=ne[1],ue=(0,u.useState)([]),oe=l()(ue,2),se=oe[0],ie=oe[1],le=function(f){z(f)};return(0,u.useEffect)(function(){if(!b.openModal){var y;(y=i.current)===null||y===void 0||y.reload()}},[b.openModal]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(R.ZP,{theme:{token:{colorPrimary:"#4FBE70",colorLink:"#4FBE70"}},children:(0,n.jsx)(P.Z,{size:"small",search:!1,scroll:{y:480,x:"auto"},bordered:!0,actionRef:i,dataSource:$,tableAlertRender:function(f){var c=f.selectedRowKeys,V=f.selectedRows,d=f.onCleanSelected;return ie(V),(0,n.jsx)(j.Z,{size:24,children:(0,n.jsxs)("span",{children:["\u5DF2\u9009 ",V.length," \u9879",(0,n.jsx)("a",{style:{marginInlineStart:8},onClick:d,children:"\u53D6\u6D88\u9009\u62E9"})]})})},tableAlertOptionRender:function(){return(0,n.jsxs)(j.Z,{children:[(0,n.jsx)(T.ZP,{danger:!0,type:"primary",onClick:function(){g.Z.confirm({title:"\u6279\u91CF\u5220\u9664",content:"\u786E\u5B9A\u8981\u5220\u9664\u6240\u9009\u7684\u6570\u636E\u5417",onOk:function(){var V=se.map(function(d){return(0,C.CdK)({id:d.id})});Promise.all(V).then(function(){var d,W;s.ZP.success("\u6279\u91CF\u5220\u9664\u6210\u529F"),(d=i.current)===null||d===void 0||d.clearSelected(),(W=i.current)===null||W===void 0||W.reload()}).catch(function(d){console.error("\u6279\u91CF\u5220\u9664\u6210\u529F:",d),s.ZP.error("\u6279\u91CF\u5220\u9664\u6210\u529F")})},onCancel:function(){console.log("Cancel")},okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",centered:!0})},children:"\u6279\u91CF\u5220\u9664"}),","]})},rowSelection:{type:"checkbox"},columns:[{title:"ID",dataIndex:"id"},{title:"\u5B57\u5178\u540D",dataIndex:"name"},{title:"\u5B57\u5178\u6807\u8BC6\u540D",dataIndex:"code"},{title:"\u5B57\u5178\u4EE3\u7801\u503C",dataIndex:"value"},{title:"\u64CD\u4F5C",key:"option",valueType:"option",render:function(f,c,V){return[(0,n.jsx)(T.ZP,{type:"link",onClick:function(){le(c),D({type:"openModel/getOpenModal",payload:!0})},children:"\u7F16\u8F91"},"1"),(0,n.jsx)(T.ZP,{type:"link",onClick:function(){c.nextlevel=c.id,le(c),D({type:"openModel/getOpenModal",payload:!0})},children:"\u6DFB\u52A0\u4E0B\u7EA7\u5B57\u5178"},"1"),(0,n.jsx)(A.Z,{title:"\u662F\u5426\u5220\u9664",onConfirm:function(W){(0,C.CdK)({id:c.id}).then(function(de){var re;s.ZP.success("\u5220\u9664\u6210\u529F"),(re=i.current)===null||re===void 0||re.reload()})},okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",children:(0,n.jsx)(T.ZP,{danger:!0,type:"link",children:"\u5220\u9664"})})]}}],rowKey:"id",pagination:{current:x,pageSize:te,showSizeChanger:!0,total:ee,pageSizeOptions:[9,18,27,99],onChange:function(f,c){o(f),M(c)},onShowSizeChange:function(f,c){o(f),M(c)}},request:S()(m()().mark(function y(){var f,c=arguments;return m()().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return f=c.length>0&&c[0]!==void 0?c[0]:{},d.abrupt("return",(0,C.ONw)({page:x,pagesize:te,sort:"id",sortby:"desc",keyword:f.name,parent_id:-1,show_childs:!0}).then(function(W){_(W.data.dicts),N(W.data.total)}));case 2:case"end":return d.stop()}},y)})),headerTitle:"\u5B57\u5178\u5217\u8868",toolBarRender:function(){return[(0,n.jsx)(T.ZP,{type:"primary",onClick:function(){D({type:"openModel/getOpenModal",payload:!0})},children:"\u6DFB\u52A0\u5B57\u5178"})]},expandable:{childrenColumnName:"children"}})})})},a=(0,Z.connect)(function(p){var t=p.openModel;return{openModel:t}})(U),r=e(97269),h=e(5966),E=e(86615),H=e(86250),J=function(t){var D=t.dispatch,b=t.dictModel,z=t.openModel,i=t.id,Y=(0,u.useRef)(),I=(0,u.useState)(!1),$=l()(I,2),_=$[0],G=$[1],q=(0,u.useState)(null),ee=l()(q,2),N=ee[0],k=ee[1];return(0,u.useEffect)(function(){G(z.openModal)},[z.openModal]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(R.ZP,{theme:{token:{colorPrimary:"#4FBE70"},components:{Segmented:{itemSelectedBg:"#19be6e",itemSelectedColor:"#ffffff"}}},children:(0,n.jsx)(g.Z,{open:_,title:i?"\u7F16\u8F91\u5B57\u5178":"\u6DFB\u52A0\u5B57\u5178",centered:!0,maskClosable:!1,footer:null,destroyOnClose:!0,width:600,onCancel:function(){D({type:"openModel/getOpenModal",payload:!1})},children:(0,n.jsxs)(r.A,{formRef:Y,request:S()(m()().mark(function F(){var x;return m()().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(!i){v.next=13;break}if(!i.nextlevel){v.next=6;break}return k(null),v.abrupt("return",{code:"",parent_id:i.nextlevel,name:"",value:"",display:"S",childs:null});case 6:return v.next=8,(0,C.dBj)({id:i.id});case 8:return x=v.sent,k(x.data),v.abrupt("return",x.data);case 11:v.next=15;break;case 13:return k(null),v.abrupt("return",{code:"",parent_id:-1,name:"",value:"",display:"S",childs:null});case 15:case"end":return v.stop()}},F)})),submitter:{searchConfig:{resetText:"\u53D6\u6D88",submitText:"\u4FDD\u5B58"},render:function(x,o){return(0,n.jsxs)(H.Z,{justify:"flex-end",children:[" ",(0,n.jsx)(j.Z,{children:o})]})},onReset:function(){k(null),G(!1)}},onFinish:function(){var F=S()(m()().mark(function x(o){var v,ne;return m()().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(i.nextlevel?o.parent_id=i.nextlevel:N&&N.id?o.parent_id=N.parent_id:o.parent_id=-1,o.childs=null,console.log(o),!N){M.next=12;break}return o.id=i.id,M.next=7,(0,C.GFC)(o);case 7:v=M.sent,s.ZP.success("\u63D0\u4EA4\u6210\u529F"),D({type:"openModel/getOpenModal",payload:!1}),M.next=17;break;case 12:return M.next=14,(0,C.K4V)(o);case 14:ne=M.sent,s.ZP.success("\u63D0\u4EA4\u6210\u529F"),D({type:"openModel/getOpenModal",payload:!1});case 17:case"end":return M.stop()}},x)}));return function(x){return F.apply(this,arguments)}}(),children:[(0,n.jsx)(h.Z,{label:"\u5B57\u5178\u540D",name:"name",placeholder:"\u8BF7\u8F93\u5165\u5B57\u5178\u540D",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5B57\u5178\u540D"}]}),(0,n.jsx)(h.Z,{label:"\u5B57\u5178\u6807\u8BC6\u540D,\u5B57\u5178\u6807\u8BC6\u540D\u4E3A\u6570\u5B57\uFF0C\u5E26\u4E0A\u4E0A\u7EA7\u7684\u6807\u8BC6\u540D\uFF0C\u4E00\u822C\u9876\u7EA7\u4E3A\u56DB\u4F4D\u6570\u5B57\uFF0C\u4F8B\u5982\uFF1A2009\uFF0C\u4E00\u7EA7\u4E3A\u516B\u4F4D\uFF0C\u4F8B\u5982\uFF1A20090001\uFF0C20090002\uFF0C\u4EE5\u6B64\u7C7B\u63A8",name:"code",placeholder:"\u8BF7\u8F93\u5165\u5B57\u5178\u6807\u8BC6\u540D",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5B57\u5178\u6807\u8BC6\u540D"}]}),(0,n.jsx)(h.Z,{label:"\u5B57\u5178\u4EE3\u7801\u503C",name:"value",placeholder:"\u8BF7\u8F93\u5165\u5B57\u5178\u4EE3\u7801\u503C"}),(0,n.jsx)(E.Z.Group,{name:"display",label:"\u662F\u5426\u663E\u793A",request:S()(m()().mark(function F(){return m()().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",[{label:"\u662F",value:"S"},{label:"\u5426",value:"H"}]);case 1:case"end":return o.stop()}},F)})),rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u662F\u5426\u663E\u793A"}]})]})})})})},Q=(0,Z.connect)(function(p){var t=p.dictModel,D=p.openModel;return{dictModel:t,openModel:D}})(J),O=function(t){var D=t.dispatch,b=t.openModel,z=(0,u.useState)(0),i=l()(z,2),Y=i[0],I=i[1],$=function(G){I(G)};return(0,u.useEffect)(function(){b.openModal||I(0)},[b.openModal]),(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(R.ZP,{theme:{token:{colorPrimary:"#4FBE70"}},children:[(0,n.jsx)(a,{getId:$}),(0,n.jsx)(Q,{id:Y})]})})},X=(0,Z.connect)(function(p){var t=p.openModel;return{openModel:t}})(O)}}]);
|