|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[5462],{50727:function(Jt,yt,n){"use strict";var Ke=n(9715),ie=n(55843),Ue=n(57663),ke=n(71577),We=n(96156),Dt=n(28481),N=n(81253),pt=n(55507),Ht=n(92137),$=n(28991),se=n(85893),wt=n(49101),pe=n(97462),qe=n(952),Se=n(78775),it=n(26369),et=n(22270),It=n(48171),Rt=n(60249),c=n(21770),Lt=n(88306),A=n(8880),S=n(67294),Ft=n(99185),Y=["onTableChange","maxLength","formItemProps","recordCreatorProps","rowKey","controlled","defaultValue","onChange","editableFormRef"],y=["record","position","creatorButtonText","newRecordType","parentKey","style"],I=S.createContext(void 0);function p(r){var s=r.children,U=r.record,je=r.position,Te=r.newRecordType,Ee=r.parentKey,i=(0,S.useContext)(I);return S.cloneElement(s,(0,$.Z)((0,$.Z)({},s.props),{},{onClick:function(){var be=(0,Ht.Z)((0,pt.Z)().mark(function De(he){var $e,e,we,Ie;return(0,pt.Z)().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.next=2,($e=(e=s.props).onClick)===null||$e===void 0?void 0:$e.call(e,he);case 2:if(Ie=R.sent,Ie!==!1){R.next=5;break}return R.abrupt("return");case 5:i==null||(we=i.current)===null||we===void 0||we.addEditRecord(U,{position:je,newRecordType:Te,parentKey:Ee});case 6:case"end":return R.stop()}},De)}));function ve(De){return be.apply(this,arguments)}return ve}()}))}function d(r){var s,U,je=(0,Se.YB)(),Te=r.onTableChange,Ee=r.maxLength,i=r.formItemProps,be=r.recordCreatorProps,ve=r.rowKey,De=r.controlled,he=r.defaultValue,$e=r.onChange,e=r.editableFormRef,we=(0,N.Z)(r,Y),Ie=(0,it.Z)(r.value),tt=(0,S.useRef)(),R=(0,S.useRef)();(0,S.useImperativeHandle)(we.actionRef,function(){return tt.current});var Wt=(0,c.Z)(function(){return r.value||he||[]},{value:r.value,onChange:r.onChange}),at=(0,Dt.Z)(Wt,2),O=at[0],_=at[1],Re=S.useMemo(function(){return typeof ve=="function"?ve:function(ue,V){return ue[ve]||V}},[ve]),Nt=function(V){if(typeof V=="number"&&!r.name){if(V>=O.length)return V;var M=O&&O[V];return Re==null?void 0:Re(M,V)}if((typeof V=="string"||V>=O.length)&&r.name){var z=O.findIndex(function(J,me){var de;return(Re==null||(de=Re(J,me))===null||de===void 0?void 0:de.toString())===(V==null?void 0:V.toString())});return z}return V};(0,S.useImperativeHandle)(e,function(){var ue=function(z){var J,me;if(z==null)throw new Error("rowIndex is required");var de=Nt(z),nt=[r.name,(J=de==null?void 0:de.toString())!==null&&J!==void 0?J:""].flat(1).filter(Boolean);return(me=R.current)===null||me===void 0?void 0:me.getFieldValue(nt)},V=function(){var z,J=[r.name].flat(1).filter(Boolean);if(Array.isArray(J)&&J.length===0){var me,de=(me=R.current)===null||me===void 0?void 0:me.getFieldsValue();return Array.isArray(de)?de:Object.keys(de).map(function(nt){return de[nt]})}return(z=R.current)===null||z===void 0?void 0:z.getFieldValue(J)};return(0,$.Z)((0,$.Z)({},R.current),{},{getRowData:ue,getRowsData:V,setRowData:function(z,J){var me,de,nt,Ut;if(z==null)throw new Error("rowIndex is required");var ua=Nt(z),da=[r.name,(me=ua==null?void 0:ua.toString())!==null&&me!==void 0?me:""].flat(1).filter(Boolean),nn=((de=R.current)===null||de===void 0||(nt=de.getFieldsValue)===null||nt===void 0?void 0:nt.call(de))||{},ca=(0,A.Z)(nn,da,(0,$.Z)((0,$.Z)({},ue(z)),J||{}));return(Ut=R.current)===null||Ut===void 0?void 0:Ut.setFieldsValue(ca)}})}),(0,S.useEffect)(function(){!r.controlled||O.forEach(function(ue,V){var M;(M=R.current)===null||M===void 0||M.setFieldsValue((0,We.Z)({},Re(ue,V),ue))},{})},[O,r.controlled]),(0,S.useEffect)(function(){if(r.name){var ue;R.current=r==null||(ue=r.editable)===null||ue===void 0?void 0:ue.form}},[(s=r.editable)===null||s===void 0?void 0:s.form,r.name]);var st=be||{},bt=st.record,ut=st.position,la=st.creatorButtonText,an=st.newRecordType,ia=st.parentKey,Pa=st.style,sa=(0,N.Z)(st,y),Ca=ut==="top",Zt=(0,S.useMemo)(function(){return Ee&&Ee<=(O==null?void 0:O.length)?!1:be!==!1&&(0,se.jsx)(p,{record:(0,et.h)(bt,O==null?void 0:O.length,O)||{},position:ut,parentKey:(0,et.h)(ia,O==null?void 0:O.length,O),newRecordType:an,children:(0,se.jsx)(ke.Z,(0,$.Z)((0,$.Z)({type:"dashed",style:(0,$.Z)({display:"block",margin:"10px 0",width:"100%"},Pa),icon:(0,se.jsx)(wt.Z,{})},sa),{},{children:la||je.getMessage("editableTable.action.add","\u6DFB\u52A0\u4E00\u884C\u6570\u636E")}))})},[be,Ee,O==null?void 0:O.length]),Da=(0,S.useMemo)(function(){return Zt?Ca?{components:{header:{wrapper:function(V){var M,z=V.className,J=V.children;return(0,se.jsxs)("thead",{className:z,children:[J,(0,se.jsxs)("tr",{style:{position:"relative"},children:[(0,se.jsx)("td",{colSpan:0,style:{visibility:"hidden"},children:Zt}),(0,se.jsx)("td",{style:{position:"absolute",left:0,width:"100%"},colSpan:(M=we.columns)===null||M===void 0?void 0:M.length,children:Zt})]})]})}}}}:{tableViewRender:function(V,M){var z,J;return(0,se.jsxs)(se.Fragment,{children:[(z=(J=r.tableViewRender)===null||J===void 0?void 0:J.call(r,V,M))!==null&&z!==void 0?z:M,Zt]})}}:{}},[Ca,Zt]),Kt=(0,$.Z)({},r.editable),wa=(0,It.J)(function(ue,V){var M,z,J;if((M=r.editable)===null||M===void 0||(z=M.onValuesChange)===null||z===void 0||z.call(M,ue,V),(J=r.onValuesChange)===null||J===void 0||J.call(r,V,ue),r.controlled){var me;r==null||(me=r.onChange)===null||me===void 0||me.call(r,V)}});return((r==null?void 0:r.onValuesChange)||((U=r.editable)===null||U===void 0?void 0:U.onValuesChange)||r.controlled&&(r==null?void 0:r.onChange))&&(Kt.onValuesChange=wa),(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(I.Provider,{value:tt,children:(0,se.jsx)(Ft.Z,(0,$.Z)((0,$.Z)((0,$.Z)({search:!1,options:!1,pagination:!1,rowKey:ve,revalidateOnFocus:!1},we),Da),{},{tableLayout:"fixed",actionRef:tt,onChange:Te,editable:(0,$.Z)((0,$.Z)({},Kt),{},{formProps:(0,$.Z)({formRef:R},Kt.formProps)}),dataSource:O,onDataSourceChange:function(V){if(_(V),r.name&&ut==="top"){var M,z=(0,A.Z)({},[r.name].flat(1).filter(Boolean),V);(M=R.current)===null||M===void 0||M.setFieldsValue(z)}}}))}),r.name?(0,se.jsx)(pe.Z,{name:[r.name],children:function(V){var M,z,J=(0,Lt.Z)(V,[r.name].flat(1)),me=J==null?void 0:J.find(function(de,nt){return!(0,Rt.Z)(de,Ie==null?void 0:Ie[nt])});return me&&Ie&&(r==null||(M=r.editable)===null||M===void 0||(z=M.onValuesChange)===null||z===void 0||z.call(M,me,J)),null}}):null]})}function m(r){var s=qe.ZP.useFormInstance();return r.name?(0,se.jsx)(ie.Z.Item,(0,$.Z)((0,$.Z)({style:{maxWidth:"100%"}},r==null?void 0:r.formItemProps),{},{name:r.name,children:(0,se.jsx)(d,(0,$.Z)((0,$.Z)({},r),{},{editable:(0,$.Z)((0,$.Z)({},r.editable),{},{form:s})}))})):(0,se.jsx)(d,(0,$.Z)({},r))}m.RecordCreator=p,yt.Z=m},86788:function(Jt){Jt.exports={main:"main___2WFgL",headerList:"headerList___biBTa",stepDescription:"stepDescription___1s2vA",pageHeader:"pageHeader___s3P6L",moreInfo:"moreInfo___69vNN",formlable:"formlable___f0Dsl",formlabletxt:"formlabletxt___3mBrA"}},6599:function(){},43237:function(){},31666:function(){},61070:function(){},58856:function(){},52953:function(){},70736:function(Jt,yt,n){"use strict";n.r(yt),n.d(yt,{default:function(){return fo}});var Ke=n(58024),ie=n(91894),Ue=n(77576),ke=n(59314),We=n(11849),Dt=n(43185),N=n(93349),pt=n(62999),Ht=n(85733),$=n(77883),se=n(21888),wt=n(49111),pe=n(19650),qe=n(57663),Se=n(71577),it=n(48736),et=n(27049),It=n(62350),Rt=n(24565),c=n(39428),Lt=n(34792),A=n(48086),S=n(3182),Ft=n(9715),Y=n(55843),y=n(2824),I=n(47673),p=n(4107),d=n(43358),m=n(34041),r=n(35556),s=n(57748),U=n(49101),je=n(84391),Te=n(6700),Ee=n(28790),i=n(67294),be=n(94184),ve=n.n(be),De=n(16894),he=n(71194),$e=n(50146),e=n(85893),we=function(t){var l,a=m.Z.Option,j=m.Z.OptGroup;return(0,e.jsx)($e.Z,{title:"\u5173\u8054\u5546\u54C1\u914D\u65B9",width:640,visible:t.createModalVisible,bodyStyle:{padding:"32px 40px 1px 48px"},footer:null,onCancel:function(){t.onCancel()},destroyOnClose:!0,children:(0,e.jsxs)(Y.Z,{labelCol:{span:4},layout:"horizontal",preserve:!1,onFinish:t.onFinish,children:[(0,e.jsx)(Y.Z.Item,{name:"bomId",label:"\u914D\u65B9\u4FE1\u606F",rules:[{required:!0,message:"\u914D\u65B9\u4FE1\u606F"}],children:(0,e.jsx)(m.Z,{showSearch:!0,mode:"multiple",optionFilterProp:"children",placeholder:"\u8BF7\u9009\u914D\u65B9\u4FE1\u606F",children:(l=t.Bomdata)===null||l===void 0?void 0:l.map(function(h,L){return(0,e.jsx)(a,{index:L,value:h.id,children:h.name},h.id)})})}),(0,e.jsxs)(Y.Z.Item,{children:[(0,e.jsx)(Se.Z,{htmlType:"button",style:{float:"right",left:10},onClick:t.onCancel,children:"\u53D6\u6D88"}),(0,e.jsx)(Se.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})]})]})})},Ie=we,tt=n(88983),R=n(47933),Wt=n(71153),at=n(60331),O=n(86582),_=n(48971);function Re(o){return Nt.apply(this,arguments)}function Nt(){return Nt=(0,S.Z)((0,c.Z)().mark(function o(t){return(0,c.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,_.WY)("/saasbase/api/goods/getgoodsbompage",{method:"Post",data:t}));case 1:case"end":return a.stop()}},o)})),Nt.apply(this,arguments)}function st(o){return bt.apply(this,arguments)}function bt(){return bt=_asyncToGenerator(_regeneratorRuntime().mark(function o(t){return _regeneratorRuntime().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",request("/saasbase/api/bom/getpage",{method:"Post",data:t}));case 1:case"end":return a.stop()}},o)})),bt.apply(this,arguments)}function ut(o){return la.apply(this,arguments)}function la(){return la=(0,S.Z)((0,c.Z)().mark(function o(t){return(0,c.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,_.WY)("/saasbase/api/systemconfig/GetCosRequestSignURL",{method:"POST",data:t}));case 1:case"end":return a.stop()}},o)})),la.apply(this,arguments)}function an(o){return ia.apply(this,arguments)}function ia(){return ia=_asyncToGenerator(_regeneratorRuntime().mark(function o(t){return _regeneratorRuntime().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",request("/saasbase/api/GoodsBom/AddBom",{method:"Post",data:t}));case 1:case"end":return a.stop()}},o)})),ia.apply(this,arguments)}function Pa(o){return sa.apply(this,arguments)}function sa(){return sa=(0,S.Z)((0,c.Z)().mark(function o(t){return(0,c.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,_.WY)("/saasbase/api/bom/getbomtypelist",{method:"Get"}));case 1:case"end":return a.stop()}},o)})),sa.apply(this,arguments)}function Ca(o){return Zt.apply(this,arguments)}function Zt(){return Zt=(0,S.Z)((0,c.Z)().mark(function o(t){return(0,c.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,_.WY)("/saasbase/api/bom/addbomtype",{method:"Post",data:t}));case 1:case"end":return a.stop()}},o)})),Zt.apply(this,arguments)}function Da(o){return Kt.apply(this,arguments)}function Kt(){return Kt=(0,S.Z)((0,c.Z)().mark(function o(t){return(0,c.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,_.WY)("/saasbase/api/goods/delgoodsbom?Ids=".concat(t),{method:"GET"}));case 1:case"end":return a.stop()}},o)})),Kt.apply(this,arguments)}function wa(o){return ue.apply(this,arguments)}function ue(){return ue=(0,S.Z)((0,c.Z)().mark(function o(t){return(0,c.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,_.WY)("\u200B/saasbase/api\u200B/goodstype/tree",{method:"GET",data:(0,We.Z)({},t)}));case 1:case"end":return a.stop()}},o)})),ue.apply(this,arguments)}function V(){return M.apply(this,arguments)}function M(){return M=(0,S.Z)((0,c.Z)().mark(function o(){return(0,c.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",(0,_.WY)("/saasbase/api/goods/getgoodsuintlist",{method:"Get"}));case 1:case"end":return l.stop()}},o)})),M.apply(this,arguments)}function z(o){return J.apply(this,arguments)}function J(){return J=(0,S.Z)((0,c.Z)().mark(function o(t){return(0,c.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,_.WY)("/saasbase/api/goods/addgoodsuint",{method:"Post",data:t}));case 1:case"end":return a.stop()}},o)})),J.apply(this,arguments)}function me(o){return de.apply(this,arguments)}function de(){return de=(0,S.Z)((0,c.Z)().mark(function o(t){return(0,c.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,_.WY)("/saasbase/api/goodsattribute/getbygoodsidattribute?id="+t,{method:"Get"}));case 1:case"end":return a.stop()}},o)})),de.apply(this,arguments)}function nt(){return Ut.apply(this,arguments)}function Ut(){return Ut=(0,S.Z)((0,c.Z)().mark(function o(){return(0,c.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",(0,_.WY)("/saasbase/api/bom/getbomlist",{method:"Get"}));case 1:case"end":return l.stop()}},o)})),Ut.apply(this,arguments)}function ua(o){return da.apply(this,arguments)}function da(){return da=(0,S.Z)((0,c.Z)().mark(function o(t){return(0,c.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,_.WY)("/saasbase/api/batching/getbatchingselectlist",{method:"Get"}));case 1:case"end":return a.stop()}},o)})),da.apply(this,arguments)}function nn(o){return ca.apply(this,arguments)}function ca(){return ca=_asyncToGenerator(_regeneratorRuntime().mark(function o(t){return _regeneratorRuntime().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",request("/saasbase/api/bom/getbomtypepage",{method:"Post",data:t}));case 1:case"end":return a.stop()}},o)})),ca.apply(this,arguments)}function hn(o){return Ia.apply(this,arguments)}function Ia(){return Ia=(0,S.Z)((0,c.Z)().mark(function o(t){return(0,c.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,_.WY)("/saasbase/api/goods/addgoodsbomattribute",{method:"Post",data:t}));case 1:case"end":return a.stop()}},o)})),Ia.apply(this,arguments)}function mn(o){return Ra.apply(this,arguments)}function Ra(){return Ra=(0,S.Z)((0,c.Z)().mark(function o(t){return(0,c.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,_.WY)("/saasbase/api/goods/addgoodsbom",{method:"Post",data:t}));case 1:case"end":return a.stop()}},o)})),Ra.apply(this,arguments)}function vn(o){return Fa.apply(this,arguments)}function Fa(){return Fa=(0,S.Z)((0,c.Z)().mark(function o(t){return(0,c.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,_.WY)("/saasbase/api/goods/getbyidgoods?id="+t,{method:"Get"}));case 1:case"end":return a.stop()}},o)})),Fa.apply(this,arguments)}function go(o){return Na.apply(this,arguments)}function Na(){return Na=_asyncToGenerator(_regeneratorRuntime().mark(function o(t){return _regeneratorRuntime().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",request("/saasbase/api/goodstechnology/GetGoodsTechnology",{method:"Post",data:t}));case 1:case"end":return a.stop()}},o)})),Na.apply(this,arguments)}function yo(o){return Ga.apply(this,arguments)}function Ga(){return Ga=_asyncToGenerator(_regeneratorRuntime().mark(function o(t){return _regeneratorRuntime().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",request("/saasbase/api/goodstechnology/gettechnologyactionList?GoodstechnologyId="+t,{method:"Get"}));case 1:case"end":return a.stop()}},o)})),Ga.apply(this,arguments)}function gn(){return ka.apply(this,arguments)}function ka(){return ka=(0,S.Z)((0,c.Z)().mark(function o(){return(0,c.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",(0,_.WY)("/saasbase/api/devicetechnology/gettechnologyactionlist",{method:"Get"}));case 1:case"end":return l.stop()}},o)})),ka.apply(this,arguments)}function yn(o){return $a.apply(this,arguments)}function $a(){return $a=(0,S.Z)((0,c.Z)().mark(function o(t){return(0,c.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,_.WY)("/saasbase/api/goodstechnology/addgoodstechnologyaction",{method:"Post",data:t}));case 1:case"end":return a.stop()}},o)})),$a.apply(this,arguments)}function pn(o){return Oa.apply(this,arguments)}function Oa(){return Oa=(0,S.Z)((0,c.Z)().mark(function o(t){return(0,c.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,_.WY)("/saasbase/api/goodstechnology/updategoodstechnologyaction",{method:"Post",data:t}));case 1:case"end":return a.stop()}},o)})),Oa.apply(this,arguments)}function on(o){return Va.apply(this,arguments)}function Va(){return Va=(0,S.Z)((0,c.Z)().mark(function o(t){return(0,c.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,_.WY)("/saasbase/api/goodstechnology/getGoodstechnologyaction?goodsId="+t,{method:"Get"}));case 1:case"end":return a.stop()}},o)})),Va.apply(this,arguments)}function bn(o){return Ma.apply(this,arguments)}function Ma(){return Ma=(0,S.Z)((0,c.Z)().mark(function o(t){return(0,c.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,_.WY)("/saasbase/api/goodstechnology/deletegoodstechnologyaction?id="+t,{method:"Get"}));case 1:case"end":return a.stop()}},o)})),Ma.apply(this,arguments)}function Zn(o){return La.apply(this,arguments)}function La(){return La=(0,S.Z)((0,c.Z)().mark(function o(t){return(0,c.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,_.WY)("/saasbase/api/goodstechnology/deletebydevidegoodstechnologyaction",{method:"Post",data:t}));case 1:case"end":return a.stop()}},o)})),La.apply(this,arguments)}function Cn(){return Wa.apply(this,arguments)}function Wa(){return Wa=(0,S.Z)((0,c.Z)().mark(function o(){return(0,c.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",(0,_.WY)("/saasbase/api/goodstechnology/getdevicetechnology",{method:"Get"}));case 1:case"end":return l.stop()}},o)})),Wa.apply(this,arguments)}function Sn(){return Ka.apply(this,arguments)}function Ka(){return Ka=(0,S.Z)((0,c.Z)().mark(function o(){return(0,c.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",(0,_.WY)("/saasbase/api/batching/getbytypebatching",{method:"Get"}));case 1:case"end":return l.stop()}},o)})),Ka.apply(this,arguments)}var xn=n(50727),jn=function(t){var l=m.Z.Option,a=m.Z.OptGroup,j=(0,i.useState)([]),h=(0,y.Z)(j,2),L=h[0],D=h[1],W=(0,i.useState)([]),P=(0,y.Z)(W,2),F=P[0],Q=P[1],Oe=(0,i.useState)([]),ge=(0,y.Z)(Oe,2),Be=ge[0],G=ge[1],xe=(0,i.useState)([]),ne=(0,y.Z)(xe,2),x=ne[0],B=ne[1],oe=(0,i.useState)([]),E=(0,y.Z)(oe,2),w=E[0],X=E[1],Fe=(0,i.useRef)(),_e=Y.Z.useForm(),Gt=(0,y.Z)(_e,1),Ne=Gt[0],Ve=(0,i.useState)(""),kt=(0,y.Z)(Ve,2),ct=kt[0],St=kt[1],xt=(0,i.useRef)(null),Xt=function(K){St(K.target.value)},$t=function(K){K.preventDefault(),St("");var ee={name:ct};Ca(ee).then(function(q){q.succeeded?(A.default.success("\u6DFB\u52A0\u6210\u529F"),t.initTypeList()):A.default.error(q.errors)})};(0,i.useEffect)(function(){if(console.log("111111111"),console.log(t.defaultmatedata),Ne.setFieldsValue({bomName:t.goodsname}),t.defaultmatedata){var H=[];t.defaultmatedata.forEach(function(K,ee){var q={id:ee,batchingId:K,dosage:0};H.push(q)}),X(H.map(function(K){return K.id})),B(H)}},[]);var Ot=[{title:"\u7269\u6599\u540D\u79F0",dataIndex:"batchingId",formItemProps:function(K,ee){var q=ee.rowIndex;return{rules:q>1?[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879"}]:[]}},valueType:"select",fieldProps:{showSearch:!0,options:t.matedata.map(function(H,K){return{label:H.name,value:H.id}})},width:"25%"},{title:"\u7528\u91CF",dataIndex:"dosage",valueType:"digit",width:"15%"},{title:"\u64CD\u4F5C",valueType:"option",width:"15%",render:function(){return null}}],jt=function(){Ne.validateFields().then(function(K){var ee=!0,q=K;console.log(x),Be.length==0?(ee=!1,A.default.error("\u8BF7\u9009\u62E9\u5546\u54C1\u5C5E\u6027")):q.shuxing=Be,x.length==0?(ee=!1,A.default.error("\u8BF7\u9009\u62E9\u7269\u6599")):q.mate=x.map(function(Ye){return{batchingId:Ye.batchingId,dosage:Ye.dosage}}),ee&&(Ne.resetFields(),t.onFinish(q),B([]))}).catch(function(K){A.default.error("\u8BF7\u586B\u5199\u5FC5\u586B\u4FE1\u606F")})},Me=function(K){for(var ee=K.target,q=ee.name,Ye=ee.value,Ae="",le=(0,O.Z)(Be),ze=0;ze<t.goodsAttriburteData.length;ze++)q==="radiogroup"+ze&&(le[ze]=Ye);t.goodsAttriburteData.forEach(function(ot){for(var Et=function(rt){var Je;Bt=(Je=ot.goodsAttributeValueList.find(function(_t){return _t.goodsAttributeValuId==le[rt]}))===null||Je===void 0?void 0:Je.attributeValue,Bt&&(Ae=Ae+Bt,rt<le.length-1&&(Ae=Ae+"-"))},Tt=0;Tt<le.length;Tt++){var Bt;Et(Tt)}}),Ne.setFieldsValue({bomName:t.goodsname+"("+Ae+")"}),G(le)};return(0,e.jsxs)($e.Z,{title:"\u65B0\u5EFA\u914D\u65B9",width:1040,visible:t.handleCreateoodsBomModalVisible,bodyStyle:{padding:"32px 40px 1px 48px"},okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:jt,onCancel:function(){t.onCancel()},destroyOnClose:!0,children:[(0,e.jsxs)(Y.Z,{layout:"horizontal",preserve:!1,form:Ne,children:[(0,e.jsx)(Y.Z.Item,{name:"bomName",label:"\u914D\u65B9\u540D\u79F0",rules:[{required:!0,message:"\u914D\u65B9\u540D\u79F0"}],children:(0,e.jsx)(p.Z,{placeholder:"\u8BF7\u8F93\u5165\u914D\u65B9\u540D\u79F0"})}),(0,e.jsx)(Y.Z.Item,{name:"bomTypeList",rules:[{required:!0,message:"\u914D\u65B9\u5206\u7C7B"}],label:"\u914D\u65B9\u5206\u7C7B",children:(0,e.jsx)(m.Z,{style:{width:"100%"},mode:"tags",placeholder:"\u8BF7\u9009\u914D\u65B9\u5206\u7C7B",options:t.bomTypeData,dropdownRender:function(K){return(0,e.jsxs)(e.Fragment,{children:[K,(0,e.jsx)(et.Z,{style:{margin:"8px 0"}}),(0,e.jsxs)(pe.Z,{style:{padding:"0 8px 4px"},children:[(0,e.jsx)(p.Z,{placeholder:"\u8BF7\u8F93\u5165\u914D\u65B9\u5206\u7C7B",ref:xt,value:ct,onChange:Xt,onKeyDown:function(q){return q.stopPropagation()}}),(0,e.jsx)(Se.Z,{type:"text",icon:(0,e.jsx)(U.Z,{}),onClick:$t,children:"\u65B0\u589E"})]})]})}})}),(0,e.jsx)(Y.Z.Item,{name:"bomType",label:"\u914D\u65B9\u7C7B\u578B",initialValue:"1",rules:[{required:!0,message:"\u914D\u65B9\u7C7B\u578B"}],children:(0,e.jsx)(m.Z,{placeholder:"\u8BF7\u9009\u914D\u65B9\u7C7B\u578B",onChange:function(K){Ne.setFieldsValue({bomType:K})},children:(0,e.jsxs)(a,{children:[(0,e.jsx)(m.Z.Option,{value:"1",children:"\u4E3B\u6599\u914D\u65B9"}),(0,e.jsx)(m.Z.Option,{value:"0",children:"\u8F85\u6599\u914D\u65B9"})]})})})]}),(0,e.jsxs)("span",{children:[(0,e.jsx)("span",{style:{color:"red",marginRight:3},children:"*"}),"\u5546\u54C1\u5C5E\u6027"]}),t.goodsAttriburteData==null?"":t.goodsAttriburteData.map(function(H,K){return(0,e.jsx)("div",{style:{marginLeft:80},children:(0,e.jsxs)("div",{children:[(0,e.jsxs)("span",{style:{marginRight:10},children:[" ",(0,e.jsx)(at.Z,{color:"blue",children:H.attributeName}),"\uFF1A"]}),(0,e.jsx)("span",{children:(0,e.jsx)(R.ZP.Group,{name:"radiogroup"+K,buttonStyle:"solid",size:"small",onChange:Me,children:H.goodsAttributeValueList.map(function(ee,q){return(0,e.jsx)(R.ZP.Button,{name:q,value:ee.goodsAttributeValuId,style:{marginRight:22,marginTop:16},children:ee.attributeValue})})})})]})})}),(0,e.jsx)(xn.Z,{headerTitle:(0,e.jsxs)("span",{children:[(0,e.jsx)("span",{style:{color:"red",marginRight:3},children:"*"}),"\u914D\u65B9\u8BE6\u60C5"]}),columns:Ot,rowKey:"id",value:x,onChange:B,recordCreatorProps:{newRecordType:"dataSource",record:function(){return{id:Date.now()}}},editable:{type:"multiple",editableKeys:w,actionRender:function(K,ee,q){return[q.delete,q.Button]},onValuesChange:function(K,ee){B(ee)},onDelete:function(){var H=(0,S.Z)((0,c.Z)().mark(function ee(q,Ye){return(0,c.Z)().wrap(function(le){for(;;)switch(le.prev=le.next){case 0:console.log(q),console.log(Ye);case 2:case"end":return le.stop()}},ee)}));function K(ee,q){return H.apply(this,arguments)}return K}(),onChange:X}})]})},En=jn,po=n(98858),rn=n(4914),Tn=n(54977),Ua=n(73171),ce=n(28991),bo=n(18106),ln=n(25499),Ze=n(96156),sn=n(90484),un=n(28481),Zo=n(84305),_a=n(88182),Ya=n(81253),Co=n(6999),Bn=n(75302),An=n(8812),Pn=n(53621),Dn=n(97435),wn=n(50344),In=n(80334),So=n(58856),Rn=["tab","children"],Fn=["key","tab","tabKey","disabled","destroyInactiveTabPane","children","className","style","cardProps"];function Nn(o){return o.filter(function(t){return t})}function Gn(o,t,l){if(o)return o.map(function(j){return(0,ce.Z)((0,ce.Z)({},j),{},{children:(0,e.jsx)(ha,(0,ce.Z)((0,ce.Z)({},l==null?void 0:l.cardProps),{},{children:j.children}))})});(0,In.ET)(!l,"Tabs.TabPane is deprecated. Please use `items` directly.");var a=(0,wn.Z)(t).map(function(j){if(i.isValidElement(j)){var h=j.key,L=j.props,D=L||{},W=D.tab,P=D.children,F=(0,Ya.Z)(D,Rn),Q=(0,ce.Z)((0,ce.Z)({key:String(h)},F),{},{children:(0,e.jsx)(ha,(0,ce.Z)((0,ce.Z)({},l==null?void 0:l.cardProps),{},{children:P})),label:W});return Q}return null});return Nn(a)}var kn=function(t){var l=t.key,a=t.tab,j=t.tabKey,h=t.disabled,L=t.destroyInactiveTabPane,D=t.children,W=t.className,P=t.style,F=t.cardProps,Q=(0,Ya.Z)(t,Fn),Oe=(0,i.useContext)(_a.ZP.ConfigContext),ge=Oe.getPrefixCls,Be=ge("pro-card-tabpane"),G=ve()(Be,W);return(0,e.jsx)(ln.Z.TabPane,(0,ce.Z)((0,ce.Z)({tabKey:j,tab:a,className:G,style:P,disabled:h,destroyInactiveTabPane:L},Q),{},{children:(0,e.jsx)(ha,(0,ce.Z)((0,ce.Z)({},F),{},{children:D}))}),l)},$n=kn,On=n(21770),xo=n(6599),Vn=function(t){var l=t.actions,a=t.prefixCls;return Array.isArray(l)&&(l==null?void 0:l.length)?(0,e.jsx)("ul",{className:"".concat(a,"-actions"),children:l.map(function(j,h){return(0,e.jsx)("li",{style:{width:"".concat(100/l.length,"%")},children:(0,e.jsx)("span",{children:j})},"action-".concat(h))})}):l?(0,e.jsx)("ul",{className:"".concat(a,"-actions"),children:l}):null},Mn=Vn,jo=n(89032),dt=n(15746),Eo=n(13062),fa=n(71230),To=n(61070),Ln=function(t){var l=t.style,a=t.prefix;return(0,e.jsxs)("div",{className:"".concat(a,"-loading-content"),style:l,children:[(0,e.jsx)(fa.Z,{gutter:8,children:(0,e.jsx)(dt.Z,{span:22,children:(0,e.jsx)("div",{className:"".concat(a,"-loading-block")})})}),(0,e.jsxs)(fa.Z,{gutter:8,children:[(0,e.jsx)(dt.Z,{span:8,children:(0,e.jsx)("div",{className:"".concat(a,"-loading-block")})}),(0,e.jsx)(dt.Z,{span:15,children:(0,e.jsx)("div",{className:"".concat(a,"-loading-block")})})]}),(0,e.jsxs)(fa.Z,{gutter:8,children:[(0,e.jsx)(dt.Z,{span:6,children:(0,e.jsx)("div",{className:"".concat(a,"-loading-block")})}),(0,e.jsx)(dt.Z,{span:18,children:(0,e.jsx)("div",{className:"".concat(a,"-loading-block")})})]}),(0,e.jsxs)(fa.Z,{gutter:8,children:[(0,e.jsx)(dt.Z,{span:13,children:(0,e.jsx)("div",{className:"".concat(a,"-loading-block")})}),(0,e.jsx)(dt.Z,{span:9,children:(0,e.jsx)("div",{className:"".concat(a,"-loading-block")})})]}),(0,e.jsxs)(fa.Z,{gutter:8,children:[(0,e.jsx)(dt.Z,{span:4,children:(0,e.jsx)("div",{className:"".concat(a,"-loading-block")})}),(0,e.jsx)(dt.Z,{span:3,children:(0,e.jsx)("div",{className:"".concat(a,"-loading-block")})}),(0,e.jsx)(dt.Z,{span:16,children:(0,e.jsx)("div",{className:"".concat(a,"-loading-block")})})]})]})},Wn=Ln,Bo=n(43237),Kn=["className","style","bodyStyle","headStyle","title","subTitle","extra","tip","wrap","layout","loading","gutter","tooltip","split","headerBordered","bordered","children","size","actions","ghost","hoverable","direction","collapsed","collapsible","collapsibleIconRender","defaultCollapsed","onCollapse","checked","onChecked","tabs","type"],Un=Bn.ZP.useBreakpoint,_n=i.forwardRef(function(o,t){var l,a,j,h=o.className,L=o.style,D=o.bodyStyle,W=D===void 0?{}:D,P=o.headStyle,F=P===void 0?{}:P,Q=o.title,Oe=o.subTitle,ge=o.extra,Be=o.tip,G=o.wrap,xe=G===void 0?!1:G,ne=o.layout,x=o.loading,B=o.gutter,oe=B===void 0?0:B,E=o.tooltip,w=o.split,X=o.headerBordered,Fe=X===void 0?!1:X,_e=o.bordered,Gt=_e===void 0?!1:_e,Ne=o.children,Ve=o.size,kt=o.actions,ct=o.ghost,St=ct===void 0?!1:ct,xt=o.hoverable,Xt=xt===void 0?!1:xt,$t=o.direction,Ot=o.collapsed,jt=o.collapsible,Me=jt===void 0?!1:jt,H=o.collapsibleIconRender,K=o.defaultCollapsed,ee=K===void 0?!1:K,q=o.onCollapse,Ye=o.checked,Ae=o.onChecked,le=o.tabs,ze=o.type,ot=(0,Ya.Z)(o,Kn),Et=(0,i.useContext)(_a.ZP.ConfigContext),Tt=Et.getPrefixCls,Bt=Un(),qt=(0,On.Z)(ee,{value:Ot,onChange:q}),rt=(0,un.Z)(qt,2),Je=rt[0],_t=rt[1],Vt=["xxl","xl","lg","md","sm","xs"],Yt=Gn(le==null?void 0:le.items,Ne,le),ea=function(ye){var fe=[0,0],Pe=Array.isArray(ye)?ye:[ye,0];return Pe.forEach(function(Ge,Qe){if((0,sn.Z)(Ge)==="object")for(var Xe=0;Xe<Vt.length;Xe+=1){var gt=Vt[Xe];if(Bt[gt]&&Ge[gt]!==void 0){fe[Qe]=Ge[gt];break}}else fe[Qe]=Ge||0}),fe},Mt=function(ye,fe){return ye?fe:{}},va=function(ye){var fe=ye;if((0,sn.Z)(ye)==="object")for(var Pe=0;Pe<Vt.length;Pe+=1){var Ge=Vt[Pe];if(Bt[Ge]&&ye[Ge]!==void 0){fe=ye[Ge];break}}var Qe=Mt(typeof fe=="string"&&/\d%|\dpx/i.test(fe),{width:fe,flexShrink:0});return{span:fe,colSpanStyle:Qe}},k=Tt("pro-card"),ft=ea(oe),ht=(0,un.Z)(ft,2),mt=ht[0],He=ht[1],lt=!1,At=i.Children.toArray(Ne),ga=At.map(function(Ce,ye){var fe;if(Ce==null||(fe=Ce.type)===null||fe===void 0?void 0:fe.isProCard){var Pe;lt=!0;var Ge=Ce.props.colSpan,Qe=va(Ge),Xe=Qe.span,gt=Qe.colSpanStyle,ya=ve()(["".concat(k,"-col")],(Pe={},(0,Ze.Z)(Pe,"".concat(k,"-split-vertical"),w==="vertical"&&ye!==At.length-1),(0,Ze.Z)(Pe,"".concat(k,"-split-horizontal"),w==="horizontal"&&ye!==At.length-1),(0,Ze.Z)(Pe,"".concat(k,"-col-").concat(Xe),typeof Xe=="number"&&Xe>=0&&Xe<=24),Pe));return(0,e.jsx)("div",{style:(0,ce.Z)((0,ce.Z)((0,ce.Z)({},gt),Mt(mt>0,{paddingRight:mt/2,paddingLeft:mt/2})),Mt(He>0,{paddingTop:He/2,paddingBottom:He/2})),className:ya,children:i.cloneElement(Ce)},"pro-card-col-".concat((Ce==null?void 0:Ce.key)||ye))}return Ce}),zt=ve()("".concat(k),h,(l={},(0,Ze.Z)(l,"".concat(k,"-border"),Gt),(0,Ze.Z)(l,"".concat(k,"-contain-card"),lt),(0,Ze.Z)(l,"".concat(k,"-loading"),x),(0,Ze.Z)(l,"".concat(k,"-split"),w==="vertical"||w==="horizontal"),(0,Ze.Z)(l,"".concat(k,"-ghost"),St),(0,Ze.Z)(l,"".concat(k,"-hoverable"),Xt),(0,Ze.Z)(l,"".concat(k,"-size-").concat(Ve),Ve),(0,Ze.Z)(l,"".concat(k,"-type-").concat(ze),ze),(0,Ze.Z)(l,"".concat(k,"-collapse"),Je),(0,Ze.Z)(l,"".concat(k,"-checked"),Ye),l)),ta=ve()("".concat(k,"-body"),(a={},(0,Ze.Z)(a,"".concat(k,"-body-center"),ne==="center"),(0,Ze.Z)(a,"".concat(k,"-body-direction-column"),w==="horizontal"||$t==="column"),(0,Ze.Z)(a,"".concat(k,"-body-wrap"),xe&<),a)),aa=(0,ce.Z)((0,ce.Z)((0,ce.Z)({},Mt(mt>0,{marginRight:-mt/2,marginLeft:-mt/2})),Mt(He>0,{marginTop:-He/2,marginBottom:-He/2})),W),na=i.isValidElement(x)?x:(0,e.jsx)(Wn,{prefix:k,style:W.padding===0||W.padding==="0px"?{padding:24}:void 0}),vt=Me&&Ot===void 0&&(H?H({collapsed:Je}):(0,e.jsx)(An.Z,{rotate:Je?void 0:90,className:"".concat(k,"-collapsible-icon")}));return(0,e.jsxs)("div",(0,ce.Z)((0,ce.Z)({className:zt,style:L,ref:t,onClick:function(ye){var fe;Ae==null||Ae(ye),ot==null||(fe=ot.onClick)===null||fe===void 0||fe.call(ot,ye)}},(0,Dn.Z)(ot,["prefixCls","colSpan"])),{},{children:[(Q||ge||vt)&&(0,e.jsxs)("div",{className:ve()("".concat(k,"-header"),(j={},(0,Ze.Z)(j,"".concat(k,"-header-border"),Fe||ze==="inner"),(0,Ze.Z)(j,"".concat(k,"-header-collapsible"),vt),j)),style:F,onClick:function(){vt&&_t(!Je)},children:[(0,e.jsxs)("div",{className:"".concat(k,"-title"),children:[vt,(0,e.jsx)(Pn.Z,{label:Q,tooltip:E||Be,subTitle:Oe})]}),ge&&(0,e.jsx)("div",{className:"".concat(k,"-extra"),children:ge})]}),le?(0,e.jsx)("div",{className:"".concat(k,"-tabs"),children:(0,e.jsx)(ln.Z,(0,ce.Z)((0,ce.Z)({onChange:le.onChange},le),{},{items:Yt,children:x?na:Ne}))}):(0,e.jsx)("div",{className:ta,style:aa,children:x?na:ga}),(0,e.jsx)(Mn,{actions:kt,prefixCls:k})]}))}),ha=_n,Ao=n(31666),Yn=function(t){var l=(0,i.useContext)(_a.ZP.ConfigContext),a=l.getPrefixCls,j=a("pro-card-divider"),h=t.className,L=t.style,D=L===void 0?{}:L,W=t.type,P=ve()(j,h,(0,Ze.Z)({},"".concat(j,"-").concat(W),W));return(0,e.jsx)("div",{className:P,style:D})},zn=Yn,Jn=function(t){return(0,e.jsx)(ha,(0,ce.Z)({bodyStyle:{padding:0}},t))},ma=ha;ma.isProCard=!0,ma.Divider=zn,ma.TabPane=$n,ma.Group=Jn;var Qt=ma,Hn=n(86788),Ct=n.n(Hn),Qn=p.Z.TextArea,Xn=function(t){var l=function(L,D,W){console.log("id",D),console.log("props.optiondata",t.optiondata),console.log("props.fromdata",t.fromdata),t.fromdata.forEach(function(P){W?P.id==W&&P.optiondata.forEach(function(F){F.technologyactionId==D&&(console.log("e.target.value",L.target.value),F.actionValue=L.target.value)}):(console.log("\u8FDB\u6765\u4E86"),console.log(t.index),P.optiondata.forEach(function(F){F.technologyactionId==D&&P.index==t.index&&(console.log("e.target.value",L.target.value),F.actionValue=L.target.value)}))}),console.log(t.fromdata),t.onSaveClick(t.fromdata)},a=function(L,D,W){t.fromdata.forEach(function(P){W?P.id==W&&P.optiondata.forEach(function(F){F.technologyactionId==D&&(console.log("e.target.value",L),F.actionValue=L)}):P.optiondata.forEach(function(F,Q){F.technologyactionId==D&&P.index==t.index&&(console.log("e.target.value",L),F.actionValue=L)})}),console.log(t.fromdata),t.onSaveClick(t.fromdata)},j=function(L,D,W){console.log(L),console.log(D),t.optiondata.forEach(function(P){P.technologyactionId==D&&(P.actionValue=L.label)}),t.onSaveClick(t.fromdata)};return(0,e.jsx)("div",{children:t.propsdata.length>0?t.propsdata.map(function(h,L){var D=t.optiondata.find(function(F){return F.id==h.technologyactionId&&F.actionName==h.actionName}).actionValue;if(h.actionType=="text")return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:Ct().formlable,style:{display:"block",float:"left",backgroundColor:"#dcf4ff",marginBottom:5},children:h.actionName}),(0,e.jsx)("div",{style:{display:"block",float:"left",marginBottom:5},children:(0,e.jsx)(p.Z,{defaultValue:D,style:{width:240},onChange:function(Q){l(Q,h.id,h.goddteid)}},h.id)})]});if(h.actionType=="digit")return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:Ct().formlable,style:{display:"block",float:"left",backgroundColor:"#dcf4ff",marginBottom:5},children:h.actionName}),(0,e.jsx)("div",{style:{display:"block",float:"left",marginBottom:5},children:(0,e.jsx)(se.Z,{defaultValue:D,style:{width:240},onChange:function(Q){a(Q,h.id,h.goddteid)}},h.id)})]});if(h.actionType=="textarea")return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:Ct().formlable,style:{display:"block",float:"left",backgroundColor:"#dcf4ff",marginBottom:5},children:h.actionName}),(0,e.jsx)("div",{style:{display:"block",float:"left",marginBottom:5},children:(0,e.jsx)(Qn,{defaultValue:D,style:{width:240},onChange:function(Q){l(Q,h.id,h.goddteid)}},h.id)})]});if(h.actionType=="switch")return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:Ct().formlable,style:{display:"block",float:"left",backgroundColor:"#dcf4ff",marginBottom:5},children:h.actionName}),(0,e.jsx)("div",{style:{display:"block",float:"left",marginBottom:5},children:(0,e.jsx)(ke.Z,{defaultValue:D,onChange:function(Q){l(Q,h.id,h.goddteid)}},h.id)})]});if(h.actionType=="select"){var W=[];h.actionValue&&h.actionValue.length>0&&(W=JSON.parse(h.actionValue));var P=W.map(function(F,Q){return{value:Q,label:F.actionValueName}});return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:Ct().formlable,style:{display:"block",float:"left",backgroundColor:"#dcf4ff",marginBottom:5},children:h.actionName}),(0,e.jsx)("div",{style:{display:"block",float:"left",marginBottom:5},children:(0,e.jsx)(m.Z,{defaultValue:D,labelInValue:!0,options:P,style:{width:240},onChange:function(Q){j(Q,h.id,h.goddteid)}},h.id)})]})}}):""})},qn=Xn,Po=p.Z.TextArea,eo=function(t){var l=(0,i.useState)(!1),a=(0,y.Z)(l,2),j=a[0],h=a[1],L=(0,i.useState)([]),D=(0,y.Z)(L,2),W=D[0],P=D[1],F=(0,i.useState)([]),Q=(0,y.Z)(F,2),Oe=Q[0],ge=Q[1],Be=(0,i.useRef)(),G=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0,render:function(B,oe){return(0,e.jsx)("a",{onClick:function(){},children:B})}},{title:"\u540D\u79F0",dataIndex:"name",valueType:"textarea",ellipsis:!0,search:!1}];(0,i.useEffect)(function(){if(console.log("\u6DB2\u6001\u6599",t.optiondata),t.fromdata[0].optiondata.length>0){var x=[];t.fromdata[0].optiondata.forEach(function(B){x.push({id:B.technologyactionId,name:B.actionName})}),ge(x.map(function(B){return B.id})),P(x)}P([]),ge([])},[t.modalVisible]);var xe=function(B,oe){console.log("id",oe),console.log("props.optiondata",t.optiondata),console.log("props.fromdata",t.fromdata),t.fromdata.forEach(function(E){E.optiondata.forEach(function(w){w.technologyactionId==oe&&E.index==t.index&&(console.log("e.target.value",B.target.value),w.actionValue=B.target.value)})}),console.log(t.fromdata),t.onSaveClick(t.fromdata)},ne=function(){h(!0)};return(0,e.jsxs)("div",{children:[t.optiondata.length>0?t.optiondata.map(function(x,B){return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:Ct().formlable,style:{display:"block",float:"left"},children:x.actionName}),(0,e.jsx)("div",{style:{display:"block",float:"left"},children:(0,e.jsx)(p.Z,{defaultValue:x.actionValue,style:{width:240},onChange:function(E){xe(E,x.technologyactionId)}},x.technologyactionId)})]})}):"",(0,e.jsx)(Se.Z,{type:"dashed",style:{width:100,marginLeft:140,marginTop:10},block:!0,onClick:ne,children:"\u6DFB\u52A0"}),(0,e.jsx)($e.Z,{title:"\u7269\u6599\u5217\u8868",width:640,visible:j,bodyStyle:{padding:"32px 40px 1px 48px"},focusTriggerAfterClose:!1,onCancel:function(){h(!1),P([])},onOk:function(){h(!1)},maskClosable:!1,children:(0,e.jsx)(De.ZP,{headerTitle:"\u7269\u6599\u5217\u8868",rowKey:"id",actionRef:Be,search:{labelWidth:120},columns:G,request:function(B){var oe="",E=[],w=t.batchingdata.filter(function(X){return X.typeName==t.typeName});return E.length>0&&(P(E),ge(E.map(function(X){return X.id}))),{data:w,success:!0,total:w.length}},rowSelection:{selectedRowKeys:Oe,onSelect:function(B,oe){var E=(0,O.Z)(Oe),w=[],X=E.findIndex(function(Fe){return Fe===B.id});oe?(X<0&&E.push(B.id),w.push({id:B.id,name:B.name})):X>-1&&E.splice(X,1),ge(E)},onSelectAll:function(B,oe,E){var w=(0,O.Z)(Oe);B?oe.forEach(function(X){if(!!X){var Fe=w.findIndex(function(_e){return _e===X.id});Fe<0&&w.push(X.id)}}):E.forEach(function(X){var Fe=w.findIndex(function(_e){return _e===X.id});Fe>-1&&w.splice(Fe,1)}),ge(w)},onChange:function(B,oe){oe.forEach(function(E){t.optiondata.findIndex(function(w){return w.technologyactionId==E.id})==-1&&t.optiondata.push({actionName:E.name,actionValue:"",technologyactionId:E.id})}),P(oe)}}})})]})},to=eo,ao=function(t){var l=(0,i.useState)([]),a=(0,y.Z)(l,2),j=a[0],h=a[1],L=(0,i.useState)(1),D=(0,y.Z)(L,2),W=D[0],P=D[1];(0,i.useEffect)(function(){console.log("\u589E\u52A0\u7F16\u8F91\u72B6\u6001\u503C",t.UpdataStatus),console.log("props.fromdata",t.fromdata),t.fromdata.length==0?h([]):t.UpdataStatus=="update"&&(t.fromdata.forEach(function(G){G.index=G.sort}),h(t.fromdata))},[t.fromdata]);var F=function(xe,ne){if(t.devideId=="0")A.default.error("\u8BF7\u9009\u62E9\u8BBE\u5907\u540E\u5728\u65B0\u589E");else{var x=W;console.log("fromdata",j),P(W+1);var B=(0,O.Z)(j),oe=j.length;if(j.length==0)x=1;else{var E=j.reduce(function(w,X){return w.sort>X.sort?w:X});console.log("\u6700\u5927\u5E8F\u53F7\uFF1A",E.sort),x=E.sort+1}B.push({index:oe+1,id:"",stepName:"",chnologyId:"",actionJson:"",sort:x,goodsId:"",goodsAttributeId:"",optiondata:[],propsdata:[],isBatch:!0,typeName:"",disabled:!1}),h(B),t.onUpdataStatus("add")}},Q=function(xe){console.log(xe),console.log(j);var ne=j.filter(function(x){return x.sort!=xe});ne.forEach(function(x,B){x.sort=B+1}),h(ne),console.log(ne),ne.length==0?P(1):P(W-1),t.onUpdataStatus("view"),t.onSaveClick(ne)},Oe=function(xe,ne,x){console.log(j),console.log(x);var B=t.technologyattralldata.filter(function(E){return E.goodstechnologyId==xe}),oe=j.map(function(E){if(E.index==x){B.length>0?E.isBatch=!0:E.isBatch=!1,E.typeName=ne.label,E.stepName=ne.label,E.chnologyId=ne.value;var w=[];B.forEach(function(X,Fe){w.push({actionName:X.actionName,actionValue:"",technologyactionId:X.id,index:Fe})}),E.propsdata=B,E.optiondata=w}return E});h(oe),console.log("from",oe)},ge=function(xe){t.onSaveClick(xe)},Be=function(){t.onUpdataStatus("view"),h([]),P(1),t.onSaveClick([])};return(0,e.jsxs)("div",{children:[j.length>0?j.map(function(G,xe){return(0,e.jsxs)(Qt,{boxShadow:!0,title:"\u5DE5\u5E8F\u53F7"+G.sort,bordered:!0,bodyStyle:{padding:15,display:"flex"},headStyle:{padding:"0px 24px"},style:{marginBlockEnd:8},extra:(0,e.jsx)(Ua.Z,{onClick:function(){Q(G.sort)}}),children:[(0,e.jsx)("div",{style:{float:"left",width:"20%"},children:(0,e.jsx)(m.Z,{name:"chnologyId",style:{width:"108px"},value:G.chnologyId,disabled:G.disabled,options:t.goodstechnologydata,onChange:function(){var ne=(0,S.Z)((0,c.Z)().mark(function x(B,oe){return(0,c.Z)().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:Oe(B,oe,G.index);case 1:case"end":return w.stop()}},x)}));return function(x,B){return ne.apply(this,arguments)}}()},G.sort)}),(0,e.jsx)("div",{style:{float:"left",width:"360px"},children:G.isBatch?(0,e.jsx)(qn,{propsdata:G.propsdata,fromdata:j,onSaveClick:ge,optiondata:G.optiondata,index:G.index}):(0,e.jsx)(to,{batchingdata:t.batchingdata,typeName:G.typeName,modalVisible:!0,optiondata:G.optiondata,onSaveClick:ge,index:G.index,fromdata:j})})]})}):"",(0,e.jsx)(Se.Z,{type:"dashed",block:!0,onClick:F,ghost:!0,style:{background:"#FA541C"},children:"\u6DFB\u52A0\u5DE5\u827A"}),(0,e.jsx)(Se.Z,{block:!0,onClick:Be,children:"\u91CD\u7F6E"})]})},no=ao,oo=function(t){var l=(0,i.useState)(""),a=(0,y.Z)(l,2),j=a[0],h=a[1],L=(0,i.useState)([]),D=(0,y.Z)(L,2),W=D[0],P=D[1],F=(0,i.useState)([]),Q=(0,y.Z)(F,2),Oe=Q[0],ge=Q[1],Be=(0,i.useState)([]),G=(0,y.Z)(Be,2),xe=G[0],ne=G[1],x=(0,i.useState)([]),B=(0,y.Z)(x,2),oe=B[0],E=B[1],w=(0,i.useState)([]),X=(0,y.Z)(w,2),Fe=X[0],_e=X[1],Gt=(0,i.useState)({}),Ne=(0,y.Z)(Gt,2),Ve=Ne[0],kt=Ne[1],ct=(0,i.useState)([]),St=(0,y.Z)(ct,2),xt=St[0],Xt=St[1],$t=(0,i.useState)([]),Ot=(0,y.Z)($t,2),jt=Ot[0],Me=Ot[1],H=(0,i.useState)(1),K=(0,y.Z)(H,2),ee=K[0],q=K[1],Ye=(0,i.useState)([]),Ae=(0,y.Z)(Ye,2),le=Ae[0],ze=Ae[1],ot=(0,i.useState)([]),Et=(0,y.Z)(ot,2),Tt=Et[0],Bt=Et[1],qt=(0,i.useState)([]),rt=(0,y.Z)(qt,2),Je=rt[0],_t=rt[1],Vt=(0,i.useState)("block"),Yt=(0,y.Z)(Vt,2),ea=Yt[0],Mt=Yt[1],va=(0,i.useState)([]),k=(0,y.Z)(va,2),ft=k[0],ht=k[1],mt=(0,i.useState)("view"),He=(0,y.Z)(mt,2),lt=He[0],At=He[1],ga=(0,i.useState)(!1),zt=(0,y.Z)(ga,2),ta=zt[0],aa=zt[1],na=(0,i.useState)("0"),vt=(0,y.Z)(na,2),Ce=vt[0],ye=vt[1],fe=(0,i.useState)(""),Pe=(0,y.Z)(fe,2),Ge=Pe[0],Qe=Pe[1],Xe=(0,i.useState)(""),gt=(0,y.Z)(Xe,2),ya=gt[0],za=gt[1],Ja=(0,i.useState)("add"),Sa=(0,y.Z)(Ja,2),dn=Sa[0],xa=Sa[1];(0,i.useEffect)(function(){ja()},[]);var ja=function(){vn(t.goodsid).then(function(g){if(g.succeeded){g.data.goodsAttributeList.length==0?Mt("none"):g.data.goodsAttributeList.forEach(function(b){b.defalutvalue=[],b.goodsAttributeValueList.forEach(function(u){b.attributeName=="\u9ED8\u8BA4\u5C5E\u6027"?(u.check=!0,h(u.attributeValue),b.defalutvalue.push(u.goodsAttributeValuId)):u.check=!1})}),console.log("\u5546\u54C1\u5C5E\u6027",g.data),kt(g.data);var Z=[{key:"1",label:"\u5546\u54C1\u540D\u79F0",children:g.data.name},{key:"2",label:"\u5546\u54C1\u4EF7\u683C",children:g.data.price},{key:"3",label:"\u5546\u54C1\u7C7B\u578B",children:g.data.goodsTypeName},{key:"4",label:"\u5546\u54C1\u5355\u4F4D",children:g.data.goodsUintName}];ge(Z)}else A.default.error("\u67E5\u8BE2\u5546\u54C1\u4FE1\u606F\u5931\u8D25")}),gn().then(function(g){_e(g.data)}),on(t.goodsid).then(function(g){if(g.data.length>0){Me(g.data);var Z=g.data.reduce(function(b,u){return b.sort>u.sort?b:u});console.log("\u6700\u5927\u5E8F\u53F7\uFF1A",Z.sort),q(Z.sort)}}),Sn().then(function(g){ze(g.data)}),Cn().then(function(g){if(Bt(g.data),g.data.length>0){var Z=g.data.map(function(b){return{value:b.id,label:b.deviceName}});_t(Z)}})},pa=function(g){console.log(W);for(var Z=g.target,b=Z.name,u=Z.value,f="",v=(0,O.Z)(W),T=0;T<Ve.goodsAttributeList.length;T++)b==="radiogroup"+T&&(v[T]=u);Ve.goodsAttributeList.forEach(function(re){for(var C=function(ra){var Za;Le=(Za=re.goodsAttributeValueList.find(function(Ba){return Ba.goodsAttributeValuId==v[ra]}))===null||Za===void 0?void 0:Za.attributeValue,Le&&(f=f+Le,ra<v.length-1&&(f=f+"-"))},ae=0;ae<v.length;ae++){var Le;C(ae)}re.goodsAttributeValueList.forEach(function(Pt){u==Pt.goodsAttributeValuId&&(Pt.check=!0)})}),h(f),P(v)},Ha=function(g,Z,b){if(xa("update"),lt!="add"){Qe(Z.deviceId),ba(Z.deviceId);var u=[];Z.data.forEach(function(f){var v={},T=[],re=Fe.filter(function(C){return C.goodstechnologyId==f.chnologyId});v.stepName=f.stepName,v.id=f.id,v.chnologyId=f.chnologyId,v.sort=f.sort,v.actionJson=f.actionJson,v.optiondata=JSON.parse(f.actionJson),re.forEach(function(C){var ae={id:C.id,actionName:C.actionName,actionType:C.actionType,actionValue:C.actionValue,goodstechnologyId:C.goodstechnologyId,isBatch:C.isBatch,sort:C.sort,goddteid:f.id};T.push(ae)}),v.propsdata=T,v.isBatch=f.isBatch,v.typeName=f.stepName,u.push(v)}),console.log("attr",u),ht(u),At("update")}else A.default.error("\u8BF7\u4FDD\u5B58\u5F53\u524D\u6570\u636E\u540E\u5728\u7F16\u8F91")},Qa=function(g,Z,b){bn(Z.id).then(function(u){u.data?(A.default.success("\u5220\u9664\u6210\u529F"),console.log(ft),oa()):A.default.error("\u5220\u9664\u5931\u8D25")})},Ea=function(g,Z,b){Zn({devideId:Z,goodsId:t.goodsid}).then(function(u){u.data?(A.default.success("\u5220\u9664\u6210\u529F"),Me([]),oa()):A.default.error("\u5220\u9664\u5931\u8D25")})},oa=function(){on(t.goodsid).then(function(g){if(g.data.length>0){Me(g.data);var Z=g.data.reduce(function(u,f){return u.sort>f.sort?u:f});q(Z.sort);var b={attributes:[]};E(b)}else E([]),Me([])})},ba=function(g){console.log("\u8FDB\u6765\u4E86",g),Qe(g),ye(g);var Z=[],b=Tt.find(function(u){return u.id==g});b&&(b.goodsTechnologyInfo.length>0&&(Z=b.goodsTechnologyInfo.map(function(u){return{value:u.goodsTechnologyId,label:u.name}}),ne(Z)),ht([])),console.log("godata",Z),ne(Z)},Xa=function(g){At(g)},qa=function(g){console.log("222",g),ht(g)},en=function(){console.log("\u4FDD\u5B58\u7684\u6570\u636E",ft);var g=!0,Z=[];ft.forEach(function(b){var u={};u.deviceId=Ce,u.id=b.id,u.stepName=b.stepName,u.chnologyId=b.chnologyId,u.isBatch=b.isBatch,lt!="add"&&(u.sort=b.sort),b.optiondata.length==0?g=!1:u.actionJson=JSON.stringify(b.optiondata),b.optiondata.forEach(function(f){var v=b.propsdata.find(function(T){return T.id==f.technologyactionId});v?(v.actionType=="select"&&f.actionValue==""&&(g=!1),v.actionType=="digit"&&(f.actionValue===""||f.actionValue===null)&&(g=!1)):f.actionValue===""&&(g=!1)}),u.goodsId=t.goodsid,u.goodsAttributeId=W.join(","),b.chnologyId==""&&(g=!1),Z.push(u)}),console.log("\u8F6C\u5316\u540E\u8981\u4FDD\u5B58\u7684\u6570\u636E",Z),console.log("\u66F4\u65B0\u6DFB\u52A0\u72B6\u6001",lt),Z.length>0&&g?(lt=="add"?yn(Z).then(function(b){b.data?(A.default.success("\u4FDD\u5B58\u6210\u529F"),ht([]),oa()):A.default.error("\u4FDD\u5B58\u5931\u8D25")}):pn(Z).then(function(b){b.data?(A.default.success("\u4FDD\u5B58\u6210\u529F"),ht([]),oa()):A.default.error("\u4FDD\u5B58\u5931\u8D25")}),At("view"),aa(!1),xa("add")):A.default.error("\u6CA1\u6709\u8981\u4FDD\u5B58\u7684\u6570\u636E\u6216\u6570\u636E\u683C\u5F0F\u4E0D\u6B63\u786E")},Ta=function(g){console.log(g),A.default.error("\u53D6\u6D88\u5220\u9664")};return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(ie.Z,{bodyStyle:{padding:15},children:[(0,e.jsx)("div",{style:{fontSize:16,marginBottom:5,color:"#1890ff",fontWeight:600},children:"\u5546\u54C1\u4FE1\u606F"}),(0,e.jsx)("div",{style:{float:"left"},children:(0,e.jsx)("img",{style:{width:100,height:100},src:Ve.imgUrl})}),(0,e.jsx)(rn.Z,{style:{float:"left",width:"71%",marginLeft:"10px"},labelStyle:{fontSize:16,fontWeight:600},children:Oe.map(function(te,g){return(0,e.jsx)(rn.Z.Item,{label:te.label,children:te.children},g)})})]}),(0,e.jsxs)(ie.Z,{bodyStyle:{padding:15},style:{display:ea},children:[(0,e.jsx)("div",{style:{fontSize:16,marginBottom:5,color:"#1890ff",fontWeight:600},children:"\u5546\u54C1\u5C5E\u6027"}),Ve.goodsAttributeList==null?"":Ve.goodsAttributeList.map(function(te,g){return(0,e.jsx)("div",{style:{marginLeft:10},children:(0,e.jsxs)("div",{children:[(0,e.jsxs)("span",{style:{marginRight:10},children:[" ",(0,e.jsx)(at.Z,{color:"blue",style:{fontSize:14,fontWeight:600},children:te.attributeName}),"\uFF1A"]}),(0,e.jsx)("span",{children:(0,e.jsx)(R.ZP.Group,{name:"radiogroup"+g,buttonStyle:"solid",onChange:pa,defaultValue:te.defalutvalue,children:te.goodsAttributeValueList.map(function(Z,b){return(0,e.jsx)(R.ZP.Button,{name:b,defaultChecked:Z.check,value:Z.goodsAttributeValuId,style:{marginRight:22,marginTop:10},children:Z.attributeValue},b)})})})]})})})]}),(0,e.jsx)(ie.Z,{bodyStyle:{padding:15},style:{display:ea},children:(0,e.jsxs)("div",{style:{fontSize:16,marginBottom:5,color:"#1890ff",fontWeight:600},children:["\u9009\u62E9\u8BBE\u5907\uFF1A",(0,e.jsx)(m.Z,{showSearch:!0,style:{width:200,marginRight:10},value:Ge,placeholder:"\u8BF7\u9009\u62E9\u8BBE\u5907",optionFilterProp:"children",filterOption:function(g,Z){var b;return((b=Z==null?void 0:Z.label)!==null&&b!==void 0?b:"").includes(g)},filterSort:function(g,Z){var b,u;return((b=g==null?void 0:g.label)!==null&&b!==void 0?b:"").toLowerCase().localeCompare(((u=Z==null?void 0:Z.label)!==null&&u!==void 0?u:"").toLowerCase())},onChange:ba,options:Je})]})}),(0,e.jsxs)(ie.Z,{bodyStyle:{padding:15},children:[(0,e.jsx)("div",{style:{fontSize:16,marginBottom:5,color:"#1890ff",fontWeight:600},children:"\u5DE5\u827A\u8BBE\u8BA1"}),(0,e.jsxs)(Qt,{split:"vertical",children:[(0,e.jsxs)(Qt,{title:"\u7F16\u8F91\u5DE5\u827A",type:"inner",colSpan:"33%",bodyStyle:{padding:5},headerBordered:!0,headStyle:{paddingLeft:"5%"},extra:[(0,e.jsx)(Se.Z,{type:"primary",ghost:!0,onClick:function(){en()},children:"\u4FDD\u5B58\u5DE5\u827A"})],children:[(0,e.jsx)("div",{style:{textAlign:"center",marginBottom:10,color:"brown"},children:j}),(0,e.jsx)(no,{devideId:Ce,disabled:ta,fromdata:ft,maxsort:ee,UpdataStatus:lt,onUpdataStatus:Xa,onSaveClick:qa,goodstechnologydata:xe,technologyattralldata:Fe,batchingdata:le})]}),(0,e.jsx)(Qt,{title:"\u67E5\u770B\u5DE5\u827A",type:"inner",headStyle:{paddingLeft:"45%"},bodyStyle:{padding:5,width:"1072px","overflow-x":"scroll"},headerBordered:!0,children:(0,e.jsx)("div",{style:{width:"max-content"},children:jt==null?"":jt.map(function(te,g){return(0,e.jsx)(Qt,{wrap:!0,gutter:16,boxShadow:!0,title:te.deviceName+"\u3010"+j+"\u3011",bodyStyle:{padding:0,"overflow-x":"scrol"},headStyle:{padding:"0px 0px",backgroundColor:"burlywood",paddingLeft:"40%",height:45},extra:[(0,e.jsx)(Tn.Z,{style:{marginRight:10},onClick:function(b){Ha(b,te)}}),(0,e.jsx)(Rt.Z,{title:"\u786E\u8BA4\u5220\u9664\u5417?",description:"\u786E\u8BA4\u5220\u9664\u5417",onConfirm:function(b){Ea(b,te.deviceId)},onCancel:Ta,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,e.jsx)(Ua.Z,{style:{marginRight:6}})})],style:{marginBlockEnd:8,width:453,float:"left",marginRight:"10px"},children:te.data.map(function(Z){var b=JSON.parse(Z.actionJson);return(0,e.jsx)(Qt,{type:"inner",hoverable:!0,layout:"center",title:"\u5DE5\u5E8F\u53F7"+Z.sort,bordered:!0,bodyStyle:{padding:5},headStyle:{padding:"0px 5px",border:"none",backgroundColor:"#e8f0fd"},extra:[(0,e.jsx)(Rt.Z,{title:"\u786E\u8BA4\u5220\u9664\u5417?",description:"\u786E\u8BA4\u5220\u9664\u5417",onConfirm:function(f){Qa(f,Z,b)},onCancel:Ta,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,e.jsx)(Ua.Z,{})})],style:{boxShadow:"5px 8px 24px 5px rgba(208, 216, 243, 0.6)"},children:(0,e.jsxs)("div",{style:{lineHeight:"200px",height:"100%",width:"100%"},children:[(0,e.jsx)("div",{className:Ct().formlable,style:{float:"left",width:"29%",backgroundColor:"#4eaaf5",color:"white"},children:Z.stepName}),(0,e.jsx)("div",{style:{float:"left",marginBottom:"5px",width:"67%"},children:b.map(function(u){return(0,e.jsxs)("div",{style:{float:"left",marginBottom:"5px"},children:[(0,e.jsx)("div",{className:Ct().formlable,style:{display:"block",float:"left",backgroundColor:"#dcf4ff"},children:u.actionName}),(0,e.jsxs)("div",{className:Ct().formlabletxt,style:{display:"block",float:"left"},children:[" ",u.actionValue]})]})})})]})})})})})})})]})]})]})},ro=oo,lo=n(82539),io=n(9669),so=n.n(io),Do=s.Z.Step,wo=m.Z.Option,Io=m.Z.OptGroup,uo=p.Z.TextArea,co=function(t){var l,a,j,h,L=Y.Z.useForm(),D=(0,y.Z)(L,1),W=D[0],P=(0,i.useState)([]),F=(0,y.Z)(P,2),Q=F[0],Oe=F[1],ge=(0,i.useState)([]),Be=(0,y.Z)(ge,2),G=Be[0],xe=Be[1],ne=(0,i.useState)([]),x=(0,y.Z)(ne,2),B=x[0],oe=x[1],E=(0,i.useState)([]),w=(0,y.Z)(E,2),X=w[0],Fe=w[1],_e=(0,i.useState)(),Gt=(0,y.Z)(_e,2),Ne=Gt[0],Ve=Gt[1],kt=(0,i.useState)(!1),ct=(0,y.Z)(kt,2),St=ct[0],xt=ct[1],Xt=(0,i.useState)([]),$t=(0,y.Z)(Xt,2),Ot=$t[0],jt=$t[1],Me=(0,i.useRef)(),H=(0,i.useState)("basis"),K=(0,y.Z)(H,2),ee=K[0],q=K[1],Ye=(0,i.useState)(t.location.query.values?t.location.query.values.imgUrl:null),Ae=(0,y.Z)(Ye,2),le=Ae[0],ze=Ae[1],ot=(0,i.useState)(0),Et=(0,y.Z)(ot,2),Tt=Et[0],Bt=Et[1],qt=(0,i.useState)([]),rt=(0,y.Z)(qt,2),Je=rt[0],_t=rt[1],Vt=(0,i.useState)([]),Yt=(0,y.Z)(Vt,2),ea=Yt[0],Mt=Yt[1],va=(0,i.useState)([]),k=(0,y.Z)(va,2),ft=k[0],ht=k[1],mt=(0,i.useState)(),He=(0,y.Z)(mt,2),lt=He[0],At=He[1],ga=(0,i.useState)(""),zt=(0,y.Z)(ga,2),ta=zt[0],aa=zt[1],na=(0,i.useState)([]),vt=(0,y.Z)(na,2),Ce=vt[0],ye=vt[1],fe=(0,i.useRef)(null),Pe=(0,i.useState)([]),Ge=(0,y.Z)(Pe,2),Qe=Ge[0],Xe=Ge[1],gt=(0,i.useState)([]),ya=(0,y.Z)(gt,2),za=ya[0],Ja=ya[1],Sa=function(){var u=(0,S.Z)((0,c.Z)().mark(function f(v){var T;return(0,c.Z)().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return T=A.default.loading("\u6B63\u5728\u6267\u884C"),console.log(v),C.prev=2,t.location.query.isAdd&&(v.id=null),v.imgUrl=le||v.imgUrl,v.defaultMate?v.defaultMate=v.defaultMate.join():v.defaultMate="",C.next=8,(0,lo.Rq)(JSON.stringify(v)).then(function(ae){ae.succeeded?(A.default.success("\u64CD\u4F5C\u6210\u529F"),_.m8.push({pathname:"/database/goods/newgoods"})):A.default.error(ae.errors)});case 8:return T(),C.abrupt("return",!0);case 12:return C.prev=12,C.t0=C.catch(2),T(),A.default.error("\u64CD\u4F5C\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),C.abrupt("return",!1);case 17:case"end":return C.stop()}},f,null,[[2,12]])}));return function(v){return u.apply(this,arguments)}}(),dn={name:"file",showUploadList:!1,multiple:!1,accept:".png, .jpg, .jpeg, .gif",headers:{"Content-Type":"application/octet-stream"},customRequest:function(f){var v=f.action,T=f.file,re=f.headers,C=f.onError,ae=f.onProgress,Le=f.onSuccess,Pt=f.withCredentials;console.log("\u4E0A\u4F20\u56FE\u7247",T);var ra=T.name.lastIndexOf("."),Za=T.name.substr(ra+1),Ba=null;return ut({directory:"goods",fileExtension:Za,method:"PUT"}).then(function(tn){v=tn.allUrl;var cn=new FileReader;cn.readAsArrayBuffer(T),cn.onload=function(ho){Ba=ho.target.result,so().put(v,Ba,{withCredentials:Pt,headers:re,onUploadProgress:function(fn){var mo=fn.total,vo=fn.loaded;ae({percent:Math.round(vo/mo*100).toFixed(2)},T)}}).then(function(Aa){console.log("onSuccess",Aa,T),(Aa.status==200||Aa.statusText=="OK")&&ze(tn.seeUrl)}).catch(C)}}),{abort:function(){console.log("upload progress is aborted.")}}}},xa=(0,i.useState)({operationKey:t.location.query.tabStatus?t.location.query.tabStatus:"basis",tabActiveKey:t.location.query.tabStatus?t.location.query.tabStatus:"basis"}),ja=(0,y.Z)(xa,2),pa=ja[0],Ha=ja[1];(0,i.useEffect)(function(){q(pa.tabActiveKey),Ea(),oa(),ba(),Xa()},[pa]);var Qa=function(f){if(Tt===1){A.default.info("\u5957\u9910\u4E0D\u80FD\u8BBE\u7F6E\u914D\u65B9");return}Ha({operationKey:f,tabActiveKey:f})};function Ea(){V().then(function(u){var f=[];u.data.length>0&&u.data.forEach(function(v){f.push({text:v.name,value:v.id,label:v.name})}),console.log("list",f),xe(f)})}function oa(){wa().then(function(u){At(u.data)})}function ba(){Pa().then(function(u){var f=[];u.data.length>0&&u.data.forEach(function(v){f.push({text:v.name,value:v.id,label:v.name})}),ye(f)})}function Xa(){ua().then(function(u){ht(u.data)})}function qa(){ba()}var en=function(f){aa(f.target.value)},Ta=function(f){f.preventDefault(),aa("");var v={name:ta};z(v).then(function(T){T.succeeded?(A.default.success("\u6DFB\u52A0\u6210\u529F"),Ea()):A.default.error(T.errors)})},te=[{key:"basis",tab:"\u5546\u54C1\u57FA\u7840\u4FE1\u606F"},{key:"goodsbom",tab:"\u5546\u54C1\u914D\u65B9"},{key:"goodstechnologymaken",tab:"\u5546\u54C1\u5DE5\u827A"}],g=[{title:"\u4E3B\u952E",dataIndex:"id",key:"id",hideInTable:!0,hideInSearch:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u914D\u65B9\u540D\u79F0",key:"name",dataIndex:"name",valueType:"textarea"},{title:"\u914D\u65B9\u7C7B\u578B",dataIndex:"isMain",hideInForm:!0,valueEnum:{false:{text:"\u8F85\u6599",status:"Processing"},true:{text:"\u4E3B\u6599",status:"Success"}}},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(f,v){return[(0,e.jsx)("a",{type:"primary",onClick:function(){},children:"\u66F4\u65B0"},"primary"),(0,e.jsx)("a",{type:"primary",onClick:function(){},children:"\u914D\u65B9\u8BE6\u60C5"},"primary"),(0,e.jsx)(Rt.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:(0,S.Z)((0,c.Z)().mark(function T(){var re;return(0,c.Z)().wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:return re=A.default.loading("\u6B63\u5728\u5220\u9664"),ae.prev=1,Da(v.id),re(),A.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"),Me.current.reload(),ae.abrupt("return",!0);case 9:return ae.prev=9,ae.t0=ae.catch(1),re(),A.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),Me.current.reload(),ae.abrupt("return",!1);case 15:case"end":return ae.stop()}},T,null,[[1,9]])})),onCancel:function(){},children:(0,e.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary")]}}],Z={basis:(0,e.jsx)(ie.Z,{title:"\u5546\u54C1\u57FA\u7840\u4FE1\u606F",style:{marginBottom:24},bordered:!1,children:(0,e.jsxs)(Y.Z,{form:W,labelCol:{span:4},wrapperCol:{span:6},layout:"horizontal",preserve:!1,initialValues:t.location.query.values,onFinish:Sa,children:[(0,e.jsx)(Y.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(p.Z,{})}),(0,e.jsx)(Y.Z.Item,{name:"name",label:"\u5546\u54C1\u540D\u79F0",rules:[{required:!0}],children:(0,e.jsx)(p.Z,{})}),(0,e.jsx)(Y.Z.Item,{name:"goodsUintId",label:"\u5546\u54C1\u5355\u4F4D",rules:[{required:!0}],children:(0,e.jsx)(m.Z,{style:{width:400},placeholder:"\u8BF7\u9009\u62E9\u5355\u4F4D",options:G,dropdownRender:function(f){return(0,e.jsxs)(e.Fragment,{children:[f,(0,e.jsx)(et.Z,{style:{margin:"8px 0"}}),(0,e.jsxs)(pe.Z,{style:{padding:"0 8px 4px"},children:[(0,e.jsx)(p.Z,{placeholder:"\u8BF7\u8F93\u5165\u5355\u4F4D",ref:fe,value:ta,onChange:en,onKeyDown:function(T){return T.stopPropagation()}}),(0,e.jsx)(Se.Z,{type:"text",icon:(0,e.jsx)(U.Z,{}),onClick:Ta,children:"\u65B0\u589E"})]})]})}})}),(0,e.jsx)(Y.Z.Item,{name:"price",label:"\u5546\u54C1\u4EF7\u683C",rules:[{required:!0}],children:(0,e.jsx)(se.Z,{placeholder:"\u4EF7\u683C",min:0})}),(0,e.jsx)(Y.Z.Item,{name:"goodsTypeId",label:"\u5546\u54C1\u7C7B\u578B",rules:[{required:!0}],children:(0,e.jsx)(Ht.Z,{allowClear:!0,showSearch:!0,style:{width:"100%"},dropdownStyle:{maxHeight:400,overflow:"auto"},treeData:lt,placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u7C7B\u578B",treeDefaultExpandAll:!0})}),(0,e.jsx)(Y.Z.Item,{name:"foreignKeyRe",label:"\u5173\u8054\u5916\u952E",rules:[{required:!1}],children:(0,e.jsx)(p.Z,{})}),(0,e.jsx)(Y.Z.Item,{name:"defaultMate",label:"\u9ED8\u8BA4\u539F\u6599",rules:[{required:!1}],children:(0,e.jsx)(m.Z,{mode:"multiple",allowClear:!0,children:ft==null?"":ft.map(function(u,f){return(0,e.jsx)(m.Z.Option,{index:f,value:u.id,children:u.name},u.id)})})}),(0,e.jsx)(Y.Z.Item,{name:"remark",label:"\u5907\u6CE8",children:(0,e.jsx)(p.Z,{})}),(0,e.jsxs)(Y.Z.Item,{name:"design",label:"\u89C4\u683C",children:["\xA0 \xA0 \xA0 \xA0 \xA0 ",(0,e.jsx)(uo,{rows:4}),"\xA0 \xA0 \xA0 \xA0 \xA0 "]}),(0,e.jsx)(Y.Z.Item,{name:"imgUrl",hidden:!0,children:(0,e.jsx)(p.Z,{})}),(0,e.jsx)(Y.Z.Item,{name:"imgUrl1",label:"\u5546\u54C1\u56FE\u7247\u5730\u5740",children:(0,e.jsx)(N.Z,(0,We.Z)((0,We.Z)({},dn),{},{children:le?(0,e.jsx)("img",{src:le,alt:"avatar",style:{width:"100%"}}):(0,e.jsx)(Se.Z,{icon:(0,e.jsx)(je.Z,{}),children:"\u4E0A\u4F20"})}))}),(0,e.jsx)(Y.Z.Item,{label:"\u662F\u5426\u79F0\u91CD",name:"isWeigh",valuePropName:"checked",initialValue:"false",children:(0,e.jsx)(ke.Z,{checkedChildren:"\u662F",unCheckedChildren:"\u5426",defaultChecked:"false"})}),(0,e.jsx)(Y.Z.Item,{label:"\u662F\u5426\u591A\u5C5E\u6027",name:"isAttrubute",valuePropName:"checked",initialValue:"false",children:(0,e.jsx)(ke.Z,{checkedChildren:"\u662F",unCheckedChildren:"\u5426",defaultChecked:"false"})}),(0,e.jsx)(Y.Z.Item,{children:(0,e.jsx)(Se.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})}),goodsbom:(0,e.jsxs)(ie.Z,{title:"\u5546\u54C1\u914D\u65B9",style:{marginBottom:24},bordered:!1,children:[(0,e.jsx)(De.ZP,{columns:g,actionRef:Me,rowKey:"id",search:!1,toolBarRender:function(){return[(0,e.jsxs)(Se.Z,{type:"primary",onClick:function(){var v,T;((v=t.location.query.values)===null||v===void 0?void 0:v.id)==null||((T=t.location.query.values)===null||T===void 0?void 0:T.id)==null?A.default.info("\u8BF7\u5148\u6DFB\u52A0\u5546\u54C1\u57FA\u7840\u4FE1\u606F!"):(nt().then(function(re){if(za.length>0){var C=[];re.data.map(function(ae){var Le={},Pt=za.find(function(ra){return ra==ae.id});Pt||C.push(ae)})}console.log("da",C),Xe(C)}),Ve(!0))},children:[(0,e.jsx)(U.Z,{})," \u9009\u62E9\u914D\u65B9"]},"primary"),(0,e.jsxs)(Se.Z,{type:"primary",onClick:(0,S.Z)((0,c.Z)().mark(function f(){var v,T;return(0,c.Z)().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:if(!(((v=t.location.query.values)===null||v===void 0?void 0:v.id)==null||((T=t.location.query.values)===null||T===void 0?void 0:T.id)==null)){C.next=4;break}A.default.info("\u8BF7\u5148\u6DFB\u52A0\u5546\u54C1\u57FA\u7840\u4FE1\u606F!"),C.next=7;break;case 4:return C.next=6,me(t.location.query.values.id).then(function(ae){_t(ae.data)});case 6:xt(!0);case 7:case"end":return C.stop()}},f)})),children:[(0,e.jsx)(U.Z,{})," \u65B0\u5EFA\u914D\u65B9"]},"primary")]},request:function(){var u=(0,S.Z)((0,c.Z)().mark(function f(v){var T,re,C;return(0,c.Z)().wrap(function(Le){for(;;)switch(Le.prev=Le.next){case 0:if(!(t.location.query.values.id==null||t.location.query.values.id==null)){Le.next=3;break}Le.next=10;break;case 3:return v.GoodsId=t.location.query.values.id,T=0,Le.next=7,Re(v);case 7:return re=Le.sent,re.data.data.length>0&&(C=re.data.data.map(function(Pt){return Pt.bomId}),Ja(C)),Le.abrupt("return",{data:re.data.data,success:!0,total:T});case 10:case"end":return Le.stop()}},f)}));return function(f){return u.apply(this,arguments)}}(),rowSelection:{onChange:function(f,v){return jt(v)}}}),(0,e.jsx)(Ie,{Bomdata:Qe,onFinish:function(){var u=(0,S.Z)((0,c.Z)().mark(function f(v){var T;return(0,c.Z)().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return console.log("value",v),v.GoodsId=t.location.query.values.id,T=!1,C.next=5,mn(v);case 5:T=C.sent,T&&Ve(!1),Me.current.reload();case 8:case"end":return C.stop()}},f)}));return function(f){return u.apply(this,arguments)}}(),onCancel:function(){Ve(!1)},createModalVisible:Ne}),(0,e.jsx)(En,{handleCreateoodsBomModalVisible:St,bomTypeData:Ce,initTypeList:qa,onFinish:function(){var u=(0,S.Z)((0,c.Z)().mark(function f(v){return(0,c.Z)().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return v.goodsId=t.location.query.values.id,console.log(v),re.next=4,hn(v).then(function(C){console.log(C),C.data?(A.default.success("\u6DFB\u52A0\u6210\u529F"),xt(!1)):A.default.error("\u6DFB\u52A0\u5931\u8D25"),Me.current.reload()});case 4:case"end":return re.stop()}},f)}));return function(f){return u.apply(this,arguments)}}(),goodsid:(l=t.location.query.values)===null||l===void 0?void 0:l.id,goodsname:(a=t.location.query.values)===null||a===void 0?void 0:a.name,goodsAttriburteData:Je,matedata:ft,bomtype:ea,defaultmatedata:(j=t.location.query.values)===null||j===void 0?void 0:j.defaultMate,onCancel:function(){xt(!1)}})]}),goodstechnologymaken:(0,e.jsx)(ie.Z,{title:"\u5546\u54C1\u5DE5\u827A",style:{marginBottom:24},bordered:!1,children:(0,e.jsx)(ro,{goodsid:(h=t.location.query.values)===null||h===void 0?void 0:h.id})})},b={data:(0,e.jsx)("a",{onClick:function(){_.m8.push({pathname:"/database/goods/newgoods"})},children:"\u8FD4\u56DE"},"back")};return(0,e.jsx)(Ee.ZP,{host:!0,header:{title:[(0,e.jsxs)("a",{onClick:function(){_.m8.push({pathname:"/database/goods/newgoods"})},children:[(0,e.jsx)(Te.Z,{}),"\u8FD4\u56DE"]},"back")],breadcrumb:{}},title:t.location.query.isAdd?"\u5546\u54C1\u65B0\u589E":"\u8BE6\u60C5",tabActiveKey:ee,onTabChange:Qa,tabList:te,children:Z[pa.operationKey]})},fo=co},82539:function(Jt,yt,n){"use strict";n.d(yt,{lO:function(){return We},Rq:function(){return pe},e3:function(){return Se},yR:function(){return et},FM:function(){return Lt}});var Ke=n(11849),ie=n(39428),Ue=n(3182),ke=n(48971);function We(d){return Dt.apply(this,arguments)}function Dt(){return Dt=(0,Ue.Z)((0,ie.Z)().mark(function d(m){return(0,ie.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",(0,ke.WY)("/saasbase/api/goods/page",{method:"Post",data:m}));case 1:case"end":return s.stop()}},d)})),Dt.apply(this,arguments)}function N(d){return pt.apply(this,arguments)}function pt(){return pt=_asyncToGenerator(_regeneratorRuntime().mark(function d(m){return _regeneratorRuntime().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",request("/saasbase/api/bom/getpage",{method:"Post",data:m}));case 1:case"end":return s.stop()}},d)})),pt.apply(this,arguments)}function Ht(d){return $.apply(this,arguments)}function $(){return $=_asyncToGenerator(_regeneratorRuntime().mark(function d(m){return _regeneratorRuntime().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",request("/saasbase/api/GoodsBom/AddBom",{method:"Post",data:m}));case 1:case"end":return s.stop()}},d)})),$.apply(this,arguments)}function se(d){return wt.apply(this,arguments)}function wt(){return wt=_asyncToGenerator(_regeneratorRuntime().mark(function d(m){return _regeneratorRuntime().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",request("/saasbase/api/GoodsBom/getBomInfo",{method:"Post",data:m}));case 1:case"end":return s.stop()}},d)})),wt.apply(this,arguments)}function pe(d){return qe.apply(this,arguments)}function qe(){return qe=(0,Ue.Z)((0,ie.Z)().mark(function d(m){return(0,ie.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",(0,ke.WY)("/saasbase/api/goods/add",{method:"POST",data:m}));case 1:case"end":return s.stop()}},d)})),qe.apply(this,arguments)}function Se(d){return it.apply(this,arguments)}function it(){return it=(0,Ue.Z)((0,ie.Z)().mark(function d(m){return(0,ie.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return console.log("\u5546\u54C1\u6570\u636E\u4FEE\u6539",m),s.abrupt("return",(0,ke.WY)("/saasbase/api/goods/update",{method:"Post",data:m}));case 2:case"end":return s.stop()}},d)})),it.apply(this,arguments)}function et(d){return It.apply(this,arguments)}function It(){return It=(0,Ue.Z)((0,ie.Z)().mark(function d(m){return(0,ie.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",(0,ke.WY)("/saasbase/api/goods/delete?id="+m,{method:"Get"}));case 1:case"end":return s.stop()}},d)})),It.apply(this,arguments)}function Rt(d){return c.apply(this,arguments)}function c(){return c=_asyncToGenerator(_regeneratorRuntime().mark(function d(m){return _regeneratorRuntime().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",request("/saasbase/api/goods-type/goods-types",{method:"POST",data:m}));case 1:case"end":return s.stop()}},d)})),c.apply(this,arguments)}function Lt(d){return A.apply(this,arguments)}function A(){return A=(0,Ue.Z)((0,ie.Z)().mark(function d(m){return(0,ie.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",(0,ke.WY)("\u200B/saasbase/api\u200B/goodstype/tree",{method:"GET",data:(0,Ke.Z)({},m)}));case 1:case"end":return s.stop()}},d)})),A.apply(this,arguments)}function S(d){return Ft.apply(this,arguments)}function Ft(){return Ft=_asyncToGenerator(_regeneratorRuntime().mark(function d(m){return _regeneratorRuntime().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",request("/saasbase/api/goodstaste/getlist"));case 1:case"end":return s.stop()}},d)})),Ft.apply(this,arguments)}function Y(d){return y.apply(this,arguments)}function y(){return y=_asyncToGenerator(_regeneratorRuntime().mark(function d(m){return _regeneratorRuntime().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",request("/saasbase//api/goods/exportgood",{method:"POST",data:m}));case 1:case"end":return s.stop()}},d)})),y.apply(this,arguments)}function I(){return p.apply(this,arguments)}function p(){return p=_asyncToGenerator(_regeneratorRuntime().mark(function d(){return _regeneratorRuntime().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",request("/saasbase/api/goods/goodstemplateexport",{method:"post",responseType:"blob"}));case 1:case"end":return r.stop()}},d)})),p.apply(this,arguments)}},4914:function(Jt,yt,n){"use strict";n.d(yt,{K:function(){return c},Z:function(){return y}});var Ke=n(96156),ie=n(28481),Ue=n(90484),ke=n(94184),We=n.n(ke),Dt=n(50344),N=n(67294),pt=n(53124),Ht=n(96159),$=n(24308),se=function(p){var d=p.children;return d},wt=se,pe=n(22122);function qe(I){return I!=null}var Se=function(p){var d=p.itemPrefixCls,m=p.component,r=p.span,s=p.className,U=p.style,je=p.labelStyle,Te=p.contentStyle,Ee=p.bordered,i=p.label,be=p.content,ve=p.colon,De=m;if(Ee){var he;return N.createElement(De,{className:We()((he={},(0,Ke.Z)(he,"".concat(d,"-item-label"),qe(i)),(0,Ke.Z)(he,"".concat(d,"-item-content"),qe(be)),he),s),style:U,colSpan:r},qe(i)&&N.createElement("span",{style:je},i),qe(be)&&N.createElement("span",{style:Te},be))}return N.createElement(De,{className:We()("".concat(d,"-item"),s),style:U,colSpan:r},N.createElement("div",{className:"".concat(d,"-item-container")},(i||i===0)&&N.createElement("span",{className:We()("".concat(d,"-item-label"),(0,Ke.Z)({},"".concat(d,"-item-no-colon"),!ve)),style:je},i),(be||be===0)&&N.createElement("span",{className:We()("".concat(d,"-item-content")),style:Te},be)))},it=Se;function et(I,p,d){var m=p.colon,r=p.prefixCls,s=p.bordered,U=d.component,je=d.type,Te=d.showLabel,Ee=d.showContent,i=d.labelStyle,be=d.contentStyle;return I.map(function(ve,De){var he=ve.props,$e=he.label,e=he.children,we=he.prefixCls,Ie=we===void 0?r:we,tt=he.className,R=he.style,Wt=he.labelStyle,at=he.contentStyle,O=he.span,_=O===void 0?1:O,Re=ve.key;return typeof U=="string"?N.createElement(it,{key:"".concat(je,"-").concat(Re||De),className:tt,style:R,labelStyle:(0,pe.Z)((0,pe.Z)({},i),Wt),contentStyle:(0,pe.Z)((0,pe.Z)({},be),at),span:_,colon:m,component:U,itemPrefixCls:Ie,bordered:s,label:Te?$e:null,content:Ee?e:null}):[N.createElement(it,{key:"label-".concat(Re||De),className:tt,style:(0,pe.Z)((0,pe.Z)((0,pe.Z)({},i),R),Wt),span:1,colon:m,component:U[0],itemPrefixCls:Ie,bordered:s,label:$e}),N.createElement(it,{key:"content-".concat(Re||De),className:tt,style:(0,pe.Z)((0,pe.Z)((0,pe.Z)({},be),R),at),span:_*2-1,component:U[1],itemPrefixCls:Ie,bordered:s,content:e})]})}var It=function(p){var d=N.useContext(c),m=p.prefixCls,r=p.vertical,s=p.row,U=p.index,je=p.bordered;return r?N.createElement(N.Fragment,null,N.createElement("tr",{key:"label-".concat(U),className:"".concat(m,"-row")},et(s,p,(0,pe.Z)({component:"th",type:"label",showLabel:!0},d))),N.createElement("tr",{key:"content-".concat(U),className:"".concat(m,"-row")},et(s,p,(0,pe.Z)({component:"td",type:"content",showContent:!0},d)))):N.createElement("tr",{key:U,className:"".concat(m,"-row")},et(s,p,(0,pe.Z)({component:je?["th","td"]:"td",type:"item",showLabel:!0,showContent:!0},d)))},Rt=It,c=N.createContext({}),Lt={xxl:3,xl:3,lg:3,md:3,sm:2,xs:1};function A(I,p){if(typeof I=="number")return I;if((0,Ue.Z)(I)==="object")for(var d=0;d<$.c4.length;d++){var m=$.c4[d];if(p[m]&&I[m]!==void 0)return I[m]||Lt[m]}return 3}function S(I,p,d){var m=I;return(p===void 0||p>d)&&(m=(0,Ht.Tm)(I,{span:d})),m}function Ft(I,p){var d=(0,Dt.Z)(I).filter(function(U){return U}),m=[],r=[],s=p;return d.forEach(function(U,je){var Te,Ee=(Te=U.props)===null||Te===void 0?void 0:Te.span,i=Ee||1;if(je===d.length-1){r.push(S(U,Ee,s)),m.push(r);return}i<s?(s-=i,r.push(U)):(r.push(S(U,i,s)),m.push(r),s=p,r=[])}),m}function Y(I){var p,d=I.prefixCls,m=I.title,r=I.extra,s=I.column,U=s===void 0?Lt:s,je=I.colon,Te=je===void 0?!0:je,Ee=I.bordered,i=I.layout,be=I.children,ve=I.className,De=I.style,he=I.size,$e=I.labelStyle,e=I.contentStyle,we=N.useContext(pt.E_),Ie=we.getPrefixCls,tt=we.direction,R=Ie("descriptions",d),Wt=N.useState({}),at=(0,ie.Z)(Wt,2),O=at[0],_=at[1],Re=A(U,O);N.useEffect(function(){var bt=$.ZP.subscribe(function(ut){(0,Ue.Z)(U)==="object"&&_(ut)});return function(){$.ZP.unsubscribe(bt)}},[]);var Nt=Ft(be,Re),st=N.useMemo(function(){return{labelStyle:$e,contentStyle:e}},[$e,e]);return N.createElement(c.Provider,{value:st},N.createElement("div",{className:We()(R,(p={},(0,Ke.Z)(p,"".concat(R,"-").concat(he),he&&he!=="default"),(0,Ke.Z)(p,"".concat(R,"-bordered"),!!Ee),(0,Ke.Z)(p,"".concat(R,"-rtl"),tt==="rtl"),p),ve),style:De},(m||r)&&N.createElement("div",{className:"".concat(R,"-header")},m&&N.createElement("div",{className:"".concat(R,"-title")},m),r&&N.createElement("div",{className:"".concat(R,"-extra")},r)),N.createElement("div",{className:"".concat(R,"-view")},N.createElement("table",null,N.createElement("tbody",null,Nt.map(function(bt,ut){return N.createElement(Rt,{key:ut,index:ut,colon:Te,prefixCls:R,vertical:i==="vertical",bordered:Ee,row:bt})}))))))}Y.Item=wt;var y=Y},98858:function(Jt,yt,n){"use strict";var Ke=n(38663),ie=n.n(Ke),Ue=n(52953),ke=n.n(Ue)}}]);
|