You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

p__Company__Department__index.e64fca52.async.js 13KB

1
  1. "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[256],{64317:function(se,J,e){var x=e(1413),s=e(45987),l=e(22270),D=e(62435),L=e(66758),$=e(34176),S=e(86074),X=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","showSearch","options"],B=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","options"],f=function(i,u){var n=i.fieldProps,o=i.children,t=i.params,y=i.proFieldProps,h=i.mode,C=i.valueEnum,R=i.request,A=i.showSearch,E=i.options,_=(0,s.Z)(i,X),W=(0,D.useContext)(L.Z);return(0,S.jsx)($.Z,(0,x.Z)((0,x.Z)({valueEnum:(0,l.h)(C),request:R,params:t,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,x.Z)({options:E,mode:h,showSearch:A,getPopupContainer:W.getPopupContainer},n),ref:u,proFieldProps:y},_),{},{children:o}))},V=D.forwardRef(function(v,i){var u=v.fieldProps,n=v.children,o=v.params,t=v.proFieldProps,y=v.mode,h=v.valueEnum,C=v.request,R=v.options,A=(0,s.Z)(v,B),E=(0,x.Z)({options:R,mode:y||"multiple",labelInValue:!0,showSearch:!0,suffixIcon:null,autoClearSearchValue:!0,optionLabelProp:"label"},u),_=(0,D.useContext)(L.Z);return(0,S.jsx)($.Z,(0,x.Z)((0,x.Z)({valueEnum:(0,l.h)(h),request:C,params:o,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,x.Z)({getPopupContainer:_.getPopupContainer},E),ref:i,proFieldProps:t},A),{},{children:n}))}),K=D.forwardRef(f),I=V,N=K;N.SearchSelect=I,N.displayName="ProFormComponent",J.Z=N},5966:function(se,J,e){var x=e(97685),s=e(1413),l=e(45987),D=e(21770),L=e(23323),$=e(55241),S=e(97435),X=e(62435),B=e(34176),f=e(86074),V=["fieldProps","proFieldProps"],K=["fieldProps","proFieldProps"],I="text",N=function(o){var t=o.fieldProps,y=o.proFieldProps,h=(0,l.Z)(o,V);return(0,f.jsx)(B.Z,(0,s.Z)({valueType:I,fieldProps:t,filedConfig:{valueType:I},proFieldProps:y},h))},v=function(o){var t=(0,D.Z)(o.open||!1,{value:o.open,onChange:o.onOpenChange}),y=(0,x.Z)(t,2),h=y[0],C=y[1];return(0,f.jsx)(L.Z.Item,{shouldUpdate:!0,noStyle:!0,children:function(A){var E,_=A.getFieldValue(o.name||[]);return(0,f.jsx)($.Z,(0,s.Z)((0,s.Z)({getPopupContainer:function(c){return c&&c.parentNode?c.parentNode:c},onOpenChange:function(c){return C(c)},content:(0,f.jsxs)("div",{style:{padding:"4px 0"},children:[(E=o.statusRender)===null||E===void 0?void 0:E.call(o,_),o.strengthText?(0,f.jsx)("div",{style:{marginTop:10},children:(0,f.jsx)("span",{children:o.strengthText})}):null]}),overlayStyle:{width:240},placement:"rightTop"},o.popoverProps),{},{open:h,children:o.children}))}})},i=function(o){var t=o.fieldProps,y=o.proFieldProps,h=(0,l.Z)(o,K),C=(0,X.useState)(!1),R=(0,x.Z)(C,2),A=R[0],E=R[1];return t!=null&&t.statusRender&&h.name?(0,f.jsx)(v,{name:h.name,statusRender:t==null?void 0:t.statusRender,popoverProps:t==null?void 0:t.popoverProps,strengthText:t==null?void 0:t.strengthText,open:A,onOpenChange:E,children:(0,f.jsx)("div",{children:(0,f.jsx)(B.Z,(0,s.Z)({valueType:"password",fieldProps:(0,s.Z)((0,s.Z)({},(0,S.Z)(t,["statusRender","popoverProps","strengthText"])),{},{onBlur:function(W){var c;t==null||(c=t.onBlur)===null||c===void 0||c.call(t,W),E(!1)},onClick:function(W){var c;t==null||(c=t.onClick)===null||c===void 0||c.call(t,W),E(!0)}}),proFieldProps:y,filedConfig:{valueType:I}},h))})}):(0,f.jsx)(B.Z,(0,s.Z)({valueType:"password",fieldProps:t,proFieldProps:y,filedConfig:{valueType:I}},h))},u=N;u.Password=i,u.displayName="ProFormComponent",J.Z=u},18829:function(se,J,e){e.r(J),e.d(J,{default:function(){return c}});var x=e(5574),s=e.n(x),l=e(62435),D=e(59530),L=e(28459),$=e(15009),S=e.n($),X=e(99289),B=e.n(X),f=e(95338),V=e(64317),K=e(42075),I=e(14726),N=e(17788),v=e(86738),i=e(68872),u=e(39680),n=e(86074),o={label:"full_name",value:"id"},t=function(d){var O=d.dispatch,Y=d.getId,U=d.openModel,g=(0,l.useRef)(),k=(0,l.useState)([]),w=s()(k,2),G=w[0],q=w[1],H=(0,l.useState)(0),ee=s()(H,2),ne=ee[0],le=ee[1],oe=(0,l.useState)(1),Z=s()(oe,2),M=Z[0],p=Z[1],m=(0,l.useState)(10),te=s()(m,2),ae=te[0],F=te[1],pe=(0,l.useState)(0),ie=s()(pe,2),ce=ie[0],ue=ie[1],me=(0,l.useState)([]),de=s()(me,2),fe=de[0],ve=de[1],he=function(a){Y(a)};return(0,l.useEffect)(function(){if(!U.openModal){var P;(P=g.current)===null||P===void 0||P.reload()}return function(){sessionStorage.removeItem("company_info"),sessionStorage.removeItem("post_company_info"),sessionStorage.removeItem("vip_company_info")}},[U.openModal]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(L.ZP,{theme:{token:{colorPrimary:"#4FBE70",colorLink:"#4FBE70"},components:{Modal:{colorPrimary:"#4FBE70"}}},children:(0,n.jsx)(f.Z,{size:"small",scroll:{y:480,x:"auto"},bordered:!0,actionRef:g,dataSource:G,search:{span:8,labelWidth:"auto"},tableAlertRender:function(a){var r=a.selectedRowKeys,z=a.selectedRows,T=a.onCleanSelected;return ve(r),(0,n.jsx)(K.Z,{size:24,children:(0,n.jsxs)("span",{children:["\u5DF2\u9009 ",r.length," \u9879",(0,n.jsx)("a",{style:{marginInlineStart:8},onClick:T,children:"\u53D6\u6D88\u9009\u62E9"})]})})},tableAlertOptionRender:function(a){var r=a.onCleanSelected;return(0,n.jsxs)(K.Z,{size:16,children:[(0,n.jsx)(I.ZP,{type:"primary",onClick:function(){N.Z.confirm({title:"\u6279\u91CF\u5220\u9664",content:"\u786E\u5B9A\u8981\u5220\u9664\u6240\u9009\u7684\u6570\u636E\u5417",onOk:function(){(0,u.A7x)({ids:fe}).then(function(b){var Q;r(),(Q=g.current)===null||Q===void 0||Q.reload()})},onCancel:function(){console.log("Cancel")},okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",centered:!0})},children:"\u6279\u91CF\u5220\u9664"}),","]})},rowSelection:{type:"checkbox"},columns:[{title:"\u90E8\u95E8\u540D\u79F0",dataIndex:"name",width:200},{title:"\u6240\u5C5E\u4F01\u4E1A",dataIndex:"company_name",width:200},{title:"\u6240\u5C5E\u4F01\u4E1A",dataIndex:"company_id",width:200,hidden:!0,valueType:"select",renderFormItem:function(){return(0,n.jsx)(V.Z,{width:"lg",fieldProps:{fieldNames:o,defaultValue:sessionStorage.getItem("company_info")?JSON.parse(sessionStorage.getItem("company_info")).full_name:null},request:function(){var a=B()(S()().mark(function r(z){return S()().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return b.abrupt("return",(0,u.m_v)({page:1,pagesize:100,keyword:z.keyWords}).then(function(Q){return Q.data.list}));case 1:case"end":return b.stop()}},r)}));return function(r){return a.apply(this,arguments)}}(),placeholder:"\u8BF7\u9009\u62E9\u6240\u5C5E\u4F01\u4E1A",onChange:function(r){ue(r),(0,u.vNO)({id:r}).then(function(z){sessionStorage.setItem("company_info",JSON.stringify(z.data))})}})}},{title:"\u8054\u7CFB\u4EBA",search:!1,width:200,dataIndex:"contact"},{title:"\u8054\u7CFB\u7535\u8BDD",search:!1,width:200,dataIndex:"phone"},{title:"\u624B\u673A",search:!1,width:200,dataIndex:"mobile"},{title:"\u90AE\u7BB1",search:!1,width:200,dataIndex:"email"},{title:"\u64CD\u4F5C",key:"option",valueType:"option",render:function(a,r,z){return[(0,n.jsx)(I.ZP,{type:"link",onClick:function(){he(r.id),O({type:"openModel/getOpenModal",payload:!0})},children:"\u7F16\u8F91"},"1"),(0,n.jsx)(v.Z,{title:"\u662F\u5426\u5220\u9664",onConfirm:function(b){(0,u.mZ4)({id:r.id}).then(function(Q){var re;i.ZP.success("\u5220\u9664\u6210\u529F"),(re=g.current)===null||re===void 0||re.reload()})},okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",children:(0,n.jsx)(I.ZP,{danger:!0,type:"link",children:"\u5220\u9664"})})]}}],rowKey:"id",pagination:{current:M,pageSize:ae,showSizeChanger:!0,total:ne,pageSizeOptions:[9,18,27,99],onChange:function(a,r){p(a),F(r)},onShowSizeChange:function(a,r){p(a),F(r)}},request:B()(S()().mark(function P(){var a,r=arguments;return S()().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return a=r.length>0&&r[0]!==void 0?r[0]:{},T.abrupt("return",(0,u.UEv)({page:M,pagesize:ae,sort:"id",sortby:"desc",keyword:a.name,company_id:sessionStorage.getItem("company_info")?JSON.parse(sessionStorage.getItem("company_info")).id:ce}).then(function(b){q(b.data.rows),le(b.data.total)}));case 2:case"end":return T.stop()}},P)})),onReset:function(){var a;sessionStorage.getItem("company_info")&&sessionStorage.removeItem("company_info"),ue(0),(a=g.current)===null||a===void 0||a.reload()},headerTitle:"\u90E8\u95E8\u5217\u8868",toolBarRender:function(){return[(0,n.jsx)(I.ZP,{type:"primary",onClick:function(){O({type:"openModel/getOpenModal",payload:!0})},children:"\u6DFB\u52A0\u90E8\u95E8"})]}})})})},y=(0,D.connect)(function(j){var d=j.dictModel,O=j.openModel;return{dictModel:d,openModel:O}})(t),h=e(97269),C=e(5966),R=e(86250),A={label:"full_name",value:"id"},E=function(d){var O=d.dispatch,Y=d.dictModel,U=d.openModel,g=d.id,k=(0,l.useRef)(),w=(0,l.useState)(!1),G=s()(w,2),q=G[0],H=G[1],ee=(0,l.useState)(null),ne=s()(ee,2),le=ne[0],oe=ne[1];return(0,l.useEffect)(function(){H(U.openModal)},[U.openModal]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(L.ZP,{theme:{token:{colorPrimary:"#4FBE70"}},children:(0,n.jsx)(N.Z,{open:q,title:g?"\u7F16\u8F91\u90E8\u95E8":"\u6DFB\u52A0\u90E8\u95E8",centered:!0,maskClosable:!1,footer:null,destroyOnClose:!0,width:600,onCancel:function(){O({type:"openModel/getOpenModal",payload:!1})},children:(0,n.jsxs)(h.A,{formRef:k,request:B()(S()().mark(function Z(){var M;return S()().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(!g){m.next=7;break}return m.next=3,(0,u.REc)({id:g});case 3:return M=m.sent,m.abrupt("return",M.data);case 7:return m.abrupt("return",{name:"",company_id:sessionStorage.getItem("company_info")?JSON.parse(sessionStorage.getItem("company_info")).id:null,contact:sessionStorage.getItem("company_info")?JSON.parse(sessionStorage.getItem("company_info")).contact:"",phone:sessionStorage.getItem("company_info")?JSON.parse(sessionStorage.getItem("company_info")).phone:"",mobile:sessionStorage.getItem("company_info")?JSON.parse(sessionStorage.getItem("company_info")).mobile:"",email:sessionStorage.getItem("company_info")?JSON.parse(sessionStorage.getItem("company_info")).email:""});case 8:case"end":return m.stop()}},Z)})),submitter:{searchConfig:{resetText:"\u53D6\u6D88",submitText:"\u4FDD\u5B58"},render:function(M,p){return(0,n.jsxs)(R.Z,{justify:"flex-end",children:[" ",(0,n.jsx)(K.Z,{children:p})]})},onReset:function(){oe(null),H(!1)}},onFinish:function(){var Z=B()(S()().mark(function M(p){var m,te;return S()().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:if(console.log(p),!g){F.next=10;break}return p.id=g,F.next=5,(0,u.T7U)(p);case 5:m=F.sent,i.ZP.success("\u63D0\u4EA4\u6210\u529F"),O({type:"openModel/getOpenModal",payload:!1}),F.next=15;break;case 10:return F.next=12,(0,u.Ldp)(p);case 12:te=F.sent,i.ZP.success("\u63D0\u4EA4\u6210\u529F"),O({type:"openModel/getOpenModal",payload:!1});case 15:case"end":return F.stop()}},M)}));return function(M){return Z.apply(this,arguments)}}(),children:[(0,n.jsx)(V.Z,{showSearch:!0,name:"company_id",label:"\u9009\u62E9\u4F01\u4E1A",placeholder:"\u8BF7\u9009\u62E9\u4F01\u4E1A",fieldProps:{fieldNames:A,defaultValue:sessionStorage.getItem("company_info")?JSON.parse(sessionStorage.getItem("company_info")).full_name:"",disabled:!!sessionStorage.getItem("company_info")},onChange:function(M){(0,u.vNO)({id:M}).then(function(p){var m;(m=k.current)===null||m===void 0||m.setFieldsValue({contact:sessionStorage.getItem("company_info")?JSON.parse(sessionStorage.getItem("company_info")).contact:p.data.contact,phone:sessionStorage.getItem("company_info")?JSON.parse(sessionStorage.getItem("company_info")).phone:p.data.phone,mobile:sessionStorage.getItem("company_info")?JSON.parse(sessionStorage.getItem("company_info")).mobile:p.data.mobile,email:sessionStorage.getItem("company_info")?JSON.parse(sessionStorage.getItem("company_info")).email:p.data.email})})},request:function(M){return(0,u.m_v)({page:1,pagesize:100,keyword:M.keyWords}).then(function(p){return p.data.list})}}),(0,n.jsx)(C.Z,{name:"name",label:"\u90E8\u95E8\u540D\u79F0",placeholder:"\u8BF7\u8F93\u5165\u90E8\u95E8\u540D\u79F0",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u90E8\u95E8\u540D\u79F0"}]}),(0,n.jsx)(C.Z,{name:"contact",label:"\u8054\u7CFB\u4EBA",placeholder:"\u8BF7\u8F93\u5165\u8054\u7CFB\u4EBA",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8054\u7CFB\u4EBA"}]}),(0,n.jsx)(C.Z,{name:"phone",label:"\u8054\u7CFB\u7535\u8BDD",placeholder:"\u8BF7\u8F93\u5165\u8054\u7CFB\u7535\u8BDD",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8054\u7CFB\u7535\u8BDD"}]}),(0,n.jsx)(C.Z,{name:"mobile",label:"\u624B\u673A\u53F7",placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7"}]}),(0,n.jsx)(C.Z,{name:"email",label:"\u7535\u5B50\u90AE\u7BB1",placeholder:"\u8BF7\u8F93\u5165\u7535\u5B50\u90AE\u7BB1",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7535\u5B50\u90AE\u7BB1"}]})]})})})})},_=(0,D.connect)(function(j){var d=j.dictModel,O=j.openModel;return{dictModel:d,openModel:O}})(E),W=function(d){var O=d.dispatch,Y=d.openModel,U=(0,l.useState)(0),g=s()(U,2),k=g[0],w=g[1],G=function(H){w(H)};return(0,l.useEffect)(function(){Y.openModal||w(0)},[Y.openModal]),(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(L.ZP,{theme:{token:{colorPrimary:"#4FBE70"}},children:[(0,n.jsx)(y,{getId:G}),(0,n.jsx)(_,{id:k})]})})},c=(0,D.connect)(function(j){var d=j.openModel;return{openModel:d}})(W)}}]);