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