|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[8865],{64317:function(Xa,Oe,o){"use strict";var oe=o(28991),Me=o(81253),_e=o(85893),Se=o(22270),je=o(67294),K=o(66758),r=o(31649),g=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","showSearch","options"],za=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","options"],Te=je.forwardRef(function(c,Ke){var Ze=c.fieldProps,fe=c.children,we=c.params,s=c.proFieldProps,Ee=c.mode,se=c.valueEnum,Ne=c.request,de=c.showSearch,Ge=c.options,Be=(0,Me.Z)(c,g),ze=(0,je.useContext)(K.Z);return(0,_e.jsx)(r.Z,(0,oe.Z)((0,oe.Z)({valueEnum:(0,Se.h)(se),request:Ne,params:we,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,oe.Z)({options:Ge,mode:Ee,showSearch:de,getPopupContainer:ze.getPopupContainer},Ze),ref:Ke,proFieldProps:s},Be),{},{children:fe}))}),h=je.forwardRef(function(c,Ke){var Ze=c.fieldProps,fe=c.children,we=c.params,s=c.proFieldProps,Ee=c.mode,se=c.valueEnum,Ne=c.request,de=c.options,Ge=(0,Me.Z)(c,za),Be=(0,oe.Z)({options:de,mode:Ee||"multiple",labelInValue:!0,showSearch:!0,showArrow:!1,autoClearSearchValue:!0,optionLabelProp:"label"},Ze),ze=(0,je.useContext)(K.Z);return(0,_e.jsx)(r.Z,(0,oe.Z)((0,oe.Z)({valueEnum:(0,Se.h)(se),request:Ne,params:we,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,oe.Z)({getPopupContainer:ze.getPopupContainer},Be),ref:Ke,proFieldProps:s},Ge),{},{children:fe}))}),Ja=Te,ea=h,We=Ja;We.SearchSelect=ea,We.displayName="ProFormComponent",Oe.Z=We},97958:function(Xa,Oe,o){"use strict";o.r(Oe),o.d(Oe,{default:function(){return Tt}});var oe=o(18106),Me=o(25499),_e=o(58024),Se=o(91894),je=o(57663),K=o(71577),r=o(39428),g=o(3182),za=o(62350),Te=o(24565),h=o(2824),Ja=o(43185),ea=o(93349),We=o(34792),c=o(48086),Ke=o(402),Ze=o(56256),fe=o(49101),we=o(6700),s=o(67294),Ee=o(28790),se=o(16894),Ne=o(71194),de=o(50146),Ge=o(22385),Be=o(94199),ze=o(77883),aa=o(21888),wt=o(49111),_a=o(19650),Et=o(88983),X=o(47933),Bt=o(47673),k=o(4107),It=o(9715),m=o(55843),Vt=o(43358),_=o(34041),et=o(54549),at=o(1870),tt=[{value:"L/min",label:"\u5347/\u6BCF\u5206\u949F"},{value:"mg/kg",label:"\u6BEB\u514B/\u6BCF\u5343\u514B"},{value:"NTU",label:"\u6D4A\u5EA6"},{value:"pH",label:"PH\u503C"},{value:"dS/m",label:"\u571F\u58E4EC\u503C"},{value:"W/\u33A1",label:"\u592A\u9633\u603B\u8F90\u5C04"},{value:"mm/hour",label:"\u964D\u96E8\u91CF"},{value:"var",label:"\u4E4F"},{value:"cP",label:"\u5398\u6CCA"},{value:"aw",label:"\u9971\u548C\u5EA6"},{value:"pcs",label:"\u4E2A"},{value:"cst",label:"\u5398\u65AF"},{value:"bar",label:"\u5DF4"},{value:"ppt",label:"\u7EB3\u514B/\u6BCF\u5347"},{value:"ppb",label:"\u5FAE\u514B/\u6BCF\u5347"},{value:"uS/cm",label:"\u5FAE\u897F/\u6BCF\u5398\u7C73"},{value:"N/C",label:"\u725B\u987F/\u6BCF\u5E93\u4ED1"},{value:"V/m",label:"\u4F0F\u7279/\u6BCF\u7C73"},{value:"ml/min",label:"\u6EF4\u901F"},{value:"mmHg",label:"\u6BEB\u7C73\u6C5E\u67F1"},{value:"mmol/L",label:"\u8840\u7CD6"},{value:"mm/s",label:"\u6BEB\u7C73/\u6BCF\u79D2"},{value:"turn/m",label:"\u8F6C\u6BCF/\u5206\u949F"},{value:"count",label:"\u6B21"},{value:"gear",label:"\u6863"},{value:"stepCount",label:"\u6B65"},{value:"Nm3/h",label:"\u6807\u51C6\u7ACB\u65B9\u7C73/\u6BCF\u5C0F\u65F6"},{value:"kV",label:"\u5343\u4F0F"},{value:"kVA",label:"\u5343\u4F0F\u5B89"},{value:"kVar",label:"\u5343\u4E4F"},{value:"uw/cm2",label:"\u5FAE\u74E6/\u6BCF\u5E73\u65B9\u5398\u7C73"},{value:"\u53EA",label:"\u53EA"},{value:"%RH",label:"\u76F8\u5BF9\u6E7F\u5EA6"},{value:"m\xB3/s",label:"\u7ACB\u65B9\u7C73\u6BCF\u79D2"},{value:"kg/s",label:"\u516C\u65A4/\u6BCF\u79D2"},{value:"r/min",label:"\u8F6C/\u6BCF\u5206\u949F"},{value:"t/h",label:"\u5428/\u6BCF\u5C0F\u65F6"},{value:"KCL/h",label:"\u5343\u5361/\u6BCF\u5C0F\u65F6"},{value:"L/s",label:"\u5347\u6BCF\u79D2"},{value:"Mpa",label:"\u5146\u5E15"},{value:"m\xB3/h",label:"\u7ACB\u65B9\u7C73/\u6BCF\u5C0F\u65F6"},{value:"kvarh",label:"\u5343\u4E4F\u65F6"},{value:"\u03BCg/L",label:"\u5FAE\u514B/\u6BCF\u5347"},{value:"kcal",label:"\u5343\u5361\u8DEF\u91CC"},{value:"GB",label:"\u5409\u5B57\u8282"},{value:"MB",label:"\u5146\u5B57\u8282"},{value:"KB",label:"\u5343\u5B57\u8282"},{value:"B",label:"\u5B57\u8282"},{value:"\u03BCg/(d\u33A1\xB7d)",label:"\u5FAE\u514B/\u6BCF\u5E73\u65B9\u5206\u7C73/\u6BCF\u5929"},{value:"",label:"\u65E0"},{value:"ppm",label:"\u767E\u4E07\u5206\u7387"},{value:"pixel",label:"\u50CF\u7D20"},{value:"Lux",label:"\u7167\u5EA6"},{value:"grav",label:"\u91CD\u529B\u52A0\u901F\u5EA6"},{value:"dB",label:"\u5206\u8D1D"},{value:"%",label:"\u767E\u5206\u6BD4"},{value:"lm",label:"\u6D41\u660E"},{value:"bit",label:"\u6BD4\u7279"},{value:"g/mL",label:"\u514B/\u6BCF\u6BEB\u5347"},{value:"g/L",label:"\u514B/\u6BCF\u5347"},{value:"mg/L",label:"\u6BEB\u514B/\u6BCF\u5347"},{value:"\u03BCg/m\xB3",label:"\u5FAE\u514B/\u6BCF\u7ACB\u65B9\u7C73"},{value:"mg/m\xB3",label:"\u6BEB\u514B/\u6BCF\u7ACB\u65B9\u7C73"},{value:"g/m\xB3",label:"\u514B/\u6BCF\u7ACB\u65B9\u7C73"},{value:"kg/m\xB3",label:"\u5343\u514B/\u6BCF\u7ACB\u65B9\u7C73"},{value:"nF",label:"\u7EB3\u6CD5"},{value:"pF",label:"\u76AE\u6CD5"},{value:"\u03BCF",label:"\u5FAE\u6CD5"},{value:"F",label:"\u6CD5\u62C9"},{value:"\u03A9",label:"\u6B27\u59C6"},{value:"\u03BCA",label:"\u5FAE\u5B89"},{value:"mA",label:"\u6BEB\u5B89"},{value:"kA",label:"\u5343\u5B89"},{value:"A",label:"\u5B89\u57F9"},{value:"mV",label:"\u6BEB\u4F0F"},{value:"V",label:"\u4F0F\u7279"},{value:"ms",label:"\u6BEB\u79D2"},{value:"s",label:"\u79D2"},{value:"min",label:"\u5206\u949F"},{value:"h",label:"\u5C0F\u65F6"},{value:"day",label:"\u65E5"},{value:"week",label:"\u5468"},{value:"month",label:"\u6708"},{value:"year",label:"\u5E74"},{value:"kn",label:"\u8282"},{value:"km/h",label:"\u5343\u7C73/\u6BCF\u5C0F\u65F6"},{value:"m/s",label:"\u7C73/\u6BCF\u79D2"},{value:"\u2033",label:"\u79D2"},{value:"\u2032",label:"\u5206"},{value:"\xB0",label:"\u5EA6"},{value:"rad",label:"\u5F27\u5EA6"},{value:"Hz",label:"\u8D6B\u5179"},{value:"\u03BCW",label:"\u5FAE\u74E6"},{value:"mW",label:"\u6BEB\u74E6"},{value:"kW",label:"\u5343\u74E6\u7279"},{value:"W",label:"\u74E6\u7279"},{value:"cal",label:"\u5361\u8DEF\u91CC"},{value:"kW\xB7h",label:"\u5343\u74E6\u65F6"},{value:"Wh",label:"\u74E6\u65F6"},{value:"eV",label:"\u7535\u5B50\u4F0F"},{value:"kJ",label:"\u5343\u7126"},{value:"J",label:"\u7126\u8033"},{value:"\u2109",label:"\u534E\u6C0F\u5EA6"},{value:"K",label:"\u5F00\u5C14\u6587"},{value:"t",label:"\u5428"},{value:"\xB0C",label:"\u6444\u6C0F\u5EA6"},{value:"mPa",label:"\u6BEB\u5E15"},{value:"hPa",label:"\u767E\u5E15"},{value:"kPa",label:"\u5343\u5E15"},{value:"Pa",label:"\u5E15\u65AF\u5361"},{value:"mg",label:"\u6BEB\u514B"},{value:"g",label:"\u514B"},{value:"kg",label:"\u5343\u514B"},{value:"N",label:"\u725B"},{value:"mL",label:"\u6BEB\u5347"},{value:"L",label:"\u5347"},{value:"mm\xB3",label:"\u7ACB\u65B9\u6BEB\u7C73"},{value:"cm\xB3",label:"\u7ACB\u65B9\u5398\u7C73"},{value:"km\xB3",label:"\u7ACB\u65B9\u5343\u7C73"},{value:"m\xB3",label:"\u7ACB\u65B9\u7C73"},{value:"h\u33A1",label:"\u516C\u9877"},{value:"c\u33A1",label:"\u5E73\u65B9\u5398\u7C73"},{value:"m\u33A1",label:"\u5E73\u65B9\u6BEB\u7C73"},{value:"k\u33A1",label:"\u5E73\u65B9\u5343\u7C73"},{value:"\u33A1",label:"\u5E73\u65B9\u7C73"},{value:"nm",label:"\u7EB3\u7C73"},{value:"\u03BCm",label:"\u5FAE\u7C73"},{value:"mm",label:"\u6BEB\u7C73"},{value:"cm",label:"\u5398\u7C73"},{value:"dm",label:"\u5206\u7C73"},{value:"km",label:"\u5343\u7C73"},{value:"m",label:"\u7C73"}],a=o(85893),lt=function(e){var x,n=_.Z.Option,xe=_.Z.OptGroup,P=(0,s.useState)("block"),ee=(0,h.Z)(P,2),j=ee[0],D=ee[1],J=(0,s.useState)(0),L=(0,h.Z)(J,2),N=L[0],Y=L[1],z=(0,s.useState)(!1),q=(0,h.Z)(z,2),H=q[0],le=q[1],$=(0,s.useState)("block"),O=(0,h.Z)($,2),B=O[0],T=O[1],M=(0,s.useState)("none"),Q=(0,h.Z)(M,2),ne=Q[0],w=Q[1],U=(0,s.useState)("none"),ce=(0,h.Z)(U,2),E=ce[0],p=ce[1],C=(0,s.useState)("none"),F=(0,h.Z)(C,2),Z=F[0],y=F[1],ue=(0,s.useState)("none"),A=(0,h.Z)(ue,2),I=A[0],V=A[1],ve=(0,s.useState)("false"),re=(0,h.Z)(ve,2),he=re[0],ae=re[1],ga=(0,s.useState)("none"),te=(0,h.Z)(ga,2),me=te[0],Ce=te[1],pa=(0,s.useState)(0),Ie=(0,h.Z)(pa,2),Ve=Ie[0],ye=Ie[1],ie=(0,s.useState)(1),Je=(0,h.Z)(ie,2),Za=Je[0],be=Je[1],Ya=(0,s.useState)(0),Ue=(0,h.Z)(Ya,2),xa=Ue[0],Ye=Ue[1],qa=m.Z.useForm(),Ca=(0,h.Z)(qa,1),W=Ca[0],qe=(0,s.useState)(""),Fe=(0,h.Z)(qe,2),Pe=Fe[0],Ae=Fe[1],Fa=(0,s.useState)(""),He=(0,h.Z)(Fa,2),De=He[0],ke=He[1],$e=k.Z.TextArea,Sa=[{value:"digit",label:"int32(\u6574\u578B)"},{value:"text",label:"text(\u5B57\u7B26\u4E32)"},{value:"textareaary",label:"textarea(\u5B57\u7B26\u4E32\u6570\u7EC4)"},{value:"select",label:"enum(\u679A\u4E3E)"},{value:"textarea",label:"text(\u6587\u672C\u57DF)"},{value:"switch",label:"bool(\u5E03\u5C14\u578B)"}];(0,s.useEffect)(function(){var i;if(e!=null&&(i=e.values)!==null&&i!==void 0&&i.id){var l,t,d,u,f,b,S,ge,pe,Ba,Ia,Va,Pa,Aa,Da,ka,Ra,La,Oa,Ma,Wa,Ka;console.log(JSON.parse(e==null||(l=e.values)===null||l===void 0?void 0:l.enumValue)),le(!0),Y(e==null||(t=e.values)===null||t===void 0?void 0:t.type),(e==null||(d=e.values)===null||d===void 0?void 0:d.type)==1?(D("none"),T("none"),V("none")):(e==null||(u=e.values)===null||u===void 0?void 0:u.type)==0&&D("block"),Le(e==null||(f=e.values)===null||f===void 0?void 0:f.dataType);var Ha=[];if(Ha=JSON.parse(e==null||(b=e.values)===null||b===void 0?void 0:b.enumValue),W.setFieldsValue({id:e==null||(S=e.values)===null||S===void 0?void 0:S.id,type:e==null||(ge=e.values)===null||ge===void 0?void 0:ge.type,name:e==null||(pe=e.values)===null||pe===void 0?void 0:pe.name,dataType:e==null||(Ba=e.values)===null||Ba===void 0?void 0:Ba.dataType,dataRange:e==null||(Ia=e.values)===null||Ia===void 0?void 0:Ia.dataRange,stepSize:e==null||(Va=e.values)===null||Va===void 0?void 0:Va.stepSize,unit:e==null||(Pa=e.values)===null||Pa===void 0?void 0:Pa.unit,foreignKeyRe:e==null||(Aa=e.values)===null||Aa===void 0?void 0:Aa.foreignKeyRe,enumvaluelist:Ha,description:e==null||(Da=e.values)===null||Da===void 0?void 0:Da.description,readWrite:e==null||(ka=e.values)===null||ka===void 0?void 0:ka.readWrite,dataLength:e==null||(Ra=e.values)===null||Ra===void 0?void 0:Ra.dataLength,boolLabel:e==null||(La=e.values)===null||La===void 0?void 0:La.boolLabel,dataJson:e==null||(Oa=e.values)===null||Oa===void 0?void 0:Oa.dataJson}),e!=null&&(Ma=e.values)!==null&&Ma!==void 0&&Ma.boolLabel){var Na,$a=e==null||(Na=e.values)===null||Na===void 0?void 0:Na.boolLabel.split(":");Ae($a[0]),ke($a[1])}else Ae(""),ke("");if(e!=null&&(Wa=e.values)!==null&&Wa!==void 0&&Wa.dataRange){var Ga,Qa=e==null||(Ga=e.values)===null||Ga===void 0?void 0:Ga.dataRange.split("-");ye(Qa[0]),be(Qa[1])}else ye(0),be(1);e!=null&&(Ka=e.values)!==null&&Ka!==void 0&&Ka.isDefault?ae(!0):ae(!1)}else ae(!1),console.log("xinjian"),le(!1),D("block"),ye(0),be(1),W.resetFields(),Y(0),Le("digit"),W.setFieldsValue({type:0,dataType:"digit"})},[e==null?void 0:e.values]);var ja=function(l){Y(l.target.value),W.setFieldsValue({type:l.target.value}),l.target.value==1?(D("none"),y("none"),p("none"),w("none"),T("none"),Ce("none")):l.target.value==0?(D("block"),Ce("none"),W.setFieldsValue({dataType:"digit"}),T("block")):l.target.value==2&&(Ce("block"),D("none"),T("none"),y("none"),p("none"),W.setFieldsValue({eventType:0}))},Re=function(l){ye(l)},Qe=function(l){Ve>l?c.default.error("\u6700\u5927\u503C\u4E0D\u80FD\u5C0F\u4E8E\u6700\u5C0F\u503C"):(be(l),W.setFieldsValue({dataRange:Ve+"-"+l}))},Le=function(l){console.log(l),l=="digit"?(T("block"),w("none"),p("none"),y("none")):l=="select"?(w("block"),T("none"),p("none"),y("none"),V("none")):l=="switch"?(p("block"),w("none"),T("none"),y("none"),V("none")):l=="text"?(p("none"),w("none"),T("none"),y("block"),V("none")):l=="textareaary"?(p("none"),w("none"),T("none"),y("none"),V("block")):(y("none"),p("none"),w("none"),T("none"),V("none"))},Ta=function(l){Ye(l.target.value)},Xe=function(l){Ae(l.target.value)},wa=function(l){ke(l.target.value)},Ea=function(l){W.setFieldsValue({eventType:l.target.value})};return(0,a.jsx)(de.Z,{title:e!=null&&(x=e.values)!==null&&x!==void 0&&x.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:e==null?void 0:e.createModalVisible,bodyStyle:{padding:"32px 40px 8px"},footer:null,onCancel:function(){e==null||e.onCancel()},destroyOnClose:!0,maskClosable:!1,children:(0,a.jsxs)(m.Z,{layout:"vertical",preserve:!1,form:W,onFinish:function(){Pe.length>0&&De.length>0&&W.setFieldsValue({boolLabel:Pe+":"+De}),console.log("form.getFieldsValue()",W.getFieldsValue()),e==null||e.onFinish(W.getFieldsValue())},children:[(0,a.jsx)(m.Z.Item,{name:"id",hidden:!0,children:(0,a.jsx)(k.Z,{})}),(0,a.jsx)(m.Z.Item,{name:"type",label:"\u529F\u80FD\u7C7B\u578B",children:(0,a.jsxs)(X.ZP.Group,{name:"type",defaultValue:0,value:N,onChange:ja,disabled:H,children:[(0,a.jsx)(X.ZP.Button,{value:0,children:"\u5C5E\u6027"}),(0,a.jsx)(X.ZP.Button,{value:1,children:"\u670D\u52A1"}),(0,a.jsx)(X.ZP.Button,{value:2,children:"\u4E8B\u4EF6"})]})}),(0,a.jsx)(m.Z.Item,{name:"name",label:"\u529F\u80FD\u540D\u79F0",rules:[{required:!0,max:64,whitespace:!0}],children:(0,a.jsx)(k.Z,{placeholder:"\u8BF7\u8F93\u5165\u529F\u80FD\u540D\u79F0",disabled:he})}),(0,a.jsx)(m.Z.Item,{style:{display:j},label:"\u6570\u636E\u7C7B\u578B",name:"dataType",rules:[{required:!1}],children:(0,a.jsx)(_.Z,{onChange:Le,defaultValue:"digit",children:Sa.map(function(i,l){return(0,a.jsx)(_.Z.Option,{index:l,value:i.value,children:i.label},i.value)})})}),(0,a.jsx)(m.Z.Item,{style:{display:ne},label:"\u679A\u4E3E\u9879",name:"enumValue",rules:[{required:!1}],children:(0,a.jsx)(m.Z.List,{name:"enumvaluelist",children:function(l,t){return(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",rowGap:16},children:[l.map(function(d){return(0,a.jsxs)(_a.Z,{children:[(0,a.jsx)(m.Z.Item,{name:[d.name,"enumvalue"],children:(0,a.jsx)(k.Z,{placeholder:"\u53C2\u6570\u503C"})}),(0,a.jsx)(m.Z.Item,{name:[d.name,"enumlabel"],children:(0,a.jsx)(k.Z,{placeholder:"\u53C2\u6570\u63CF\u8FF0"})}),(0,a.jsx)(et.Z,{onClick:function(){t.remove(d.name)}})]},d.key)}),(0,a.jsx)(K.Z,{type:"dashed",onClick:function(){console.log(JSON.stringify(W.getFieldsValue(),null,2)),console.log(l),console.log(t),t.add()},block:!0,children:"+ \u6DFB\u52A0\u679A\u4E3E"})]})}})}),(0,a.jsxs)(m.Z.Item,{style:{display:B},label:"\u53D6\u503C\u8303\u56F4",name:"dataRange",rules:[{required:!1}],children:[(0,a.jsx)(aa.Z,{placeholder:"\u6700\u5C0F\u503C",style:{width:"49%"},value:Ve,onChange:Re}),"~",(0,a.jsx)(aa.Z,{value:Za,placeholder:"\u6700\u5927\u503C",onChange:Qe,style:{width:"49%"}})]}),(0,a.jsx)(m.Z.Item,{style:{display:B},label:"\u6B65\u957F",name:"stepSize",rules:[{required:!1}],children:(0,a.jsx)(aa.Z,{placeholder:"\u8BF7\u8F93\u5165\u6B65\u957F",style:{width:"100%"}})}),(0,a.jsx)(m.Z.Item,{style:{display:B},label:"\u5355\u4F4D",name:"unit",rules:[{required:!1}],children:(0,a.jsx)(_.Z,{allowClear:!0,showSearch:!0,optionFilterProp:"Name",filterOption:function(l,t){var d;return((d=t==null?void 0:t.label)!==null&&d!==void 0?d:"").includes(l)},filterSort:function(l,t){var d,u;return((d=l==null?void 0:l.label)!==null&&d!==void 0?d:"").localeCompare((u=t==null?void 0:t.label)!==null&&u!==void 0?u:"")},options:tt})}),(0,a.jsxs)(m.Z.Item,{style:{display:E},name:"boolLabel",label:"\u5E03\u5C14\u503C",rules:[{required:!1}],children:["0 -",(0,a.jsx)(k.Z,{placeholder:"\u5982\uFF1A\u5173",defaultValue:Pe,onChange:Xe,style:{width:"46%"}}),"1 -",(0,a.jsx)(k.Z,{placeholder:"\u5982\uFF1A\u5F00",defaultValue:De,onChange:wa,style:{width:"46%"}})]}),(0,a.jsx)(m.Z.Item,{style:{display:Z},name:"dataLength",label:"\u6570\u636E\u957F\u5EA6",rules:[{required:!1}],children:(0,a.jsx)(k.Z,{placeholder:"10240",defaultValue:"10240",addonAfter:"\u5B57\u8282"})}),(0,a.jsx)(m.Z.Item,{style:{display:me},name:"eventType",label:(0,a.jsxs)("span",{children:["\u4E8B\u4EF6\u7C7B\u578B",(0,a.jsx)(Be.Z,{placement:"top",title:"\u201C\u4FE1\u606F\u201D\u662F\u8BBE\u5907\u4E0A\u62A5\u7684\u4E00\u822C\u6027\u901A\u77E5\uFF0C\u5982\u5B8C\u6210\u67D0\u9879\u4EFB\u52A1\u7B49\u3002\u201C\u544A\u8B66\u201D\u548C\u201C\u6545\u969C\u201D\u662F\u8BBE\u5907\u8FD0\u884C\u8FC7\u7A0B\u4E2D\u4E3B\u52A8\u4E0A\u62A5\u7684\u7A81\u53D1\u6216\u5F02\u5E38\u60C5\u51B5\uFF0C\u4F18\u5148\u7EA7\u9AD8\u3002\u4E0D\u540C\u7684\u4E8B\u4EF6\u7C7B\u578B\u5C06\u7528\u4E8E\u7EDF\u8BA1\u5206\u6790\u3002",children:(0,a.jsx)(at.Z,{})})]}),rules:[{required:!1}],children:(0,a.jsxs)(X.ZP.Group,{defaultValue:0,onChange:Ea,value:0,children:[(0,a.jsx)(X.ZP,{value:0,children:"\u4FE1\u606F"}),(0,a.jsx)(X.ZP,{value:1,children:"\u544A\u8B66"}),(0,a.jsx)(X.ZP,{value:2,children:"\u6545\u969C"})]})}),(0,a.jsx)(m.Z.Item,{style:{display:I},name:"dataJson",label:"\u6570\u7EC4\u5B57\u7B26\u4E32",rules:[{required:!1}],children:(0,a.jsx)($e,{placeholder:"\u6570\u636E\u683C\u5F0F\uFF1A[data1:{value1:'1'},{value2:'2'},data2:{value1:'1'},{value2:'2'}]",autoSize:{minRows:10,maxRows:100}})}),(0,a.jsx)(m.Z.Item,{style:{display:j},name:"readWrite",label:"\u8BFB\u5199\u7C7B\u578B",rules:[{required:!1}],children:(0,a.jsx)(X.ZP.Group,{onChange:Ta,name:"radiogroup",defaultValue:0,value:xa,children:(0,a.jsx)(X.ZP,{value:0,children:"\u8BFB\u5199"})})}),(0,a.jsx)(m.Z.Item,{name:"description",label:"\u63CF\u8FF0",rules:[{required:!1}],children:(0,a.jsx)($e,{showCount:!0,maxLength:100,style:{height:120,resize:"none"},placeholder:"\u8BF7\u8F93\u5165\u63CF\u8FF0"})}),(0,a.jsxs)(m.Z.Item,{children:[(0,a.jsx)(K.Z,{htmlType:"button",style:{float:"right",left:10},onClick:e.onCancel,children:"\u53D6\u6D88"}),(0,a.jsx)(K.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})]})]})})},nt=lt,ut=o(64317),rt=o(76615),it=function(e){var x=m.Z.useForm(),n=(0,h.Z)(x,1),xe=n[0],P=s.useRef(null),ee=(0,s.useState)("text"),j=(0,h.Z)(ee,2),D=j[0],J=j[1],L=(0,s.useState)("Form"),N=(0,h.Z)(L,2),Y=N[0],z=N[1],q=(0,s.useState)([]),H=(0,h.Z)(q,2),le=H[0],$=H[1],O=(0,s.useState)(""),B=(0,h.Z)(O,2),T=B[0],M=B[1],Q=(0,s.useState)(!1),ne=(0,h.Z)(Q,2),w=ne[0],U=ne[1],ce=(0,s.useState)(!1),E=(0,h.Z)(ce,2),p=E[0],C=E[1],F=k.Z.TextArea;(0,s.useEffect)(function(){var A;if((A=P.current)===null||A===void 0||A.setFieldsValue(e.values),e.createModalVisible)if(e.values.actionType==null){var I;(I=P.current)===null||I===void 0||I.setFieldsValue({actionType:"text"}),e.values.actionType="text",J("text"),z("Form"),$([])}else{var V;if((V=P.current)===null||V===void 0||V.setFieldsValue({actionType:e.values.actionType}),J(e.values.actionType),e.values.actionType=="select"){z("ModalForm");for(var ve=[],re=JSON.parse(e.values.actionValue),he=0;he<re.length;he++)ve.push({actionValueName:re[he].actionValueName});$(ve)}e.values.actionType=="textareaary"?M(e.values.actionValue):(J(e.values.actionType),z("Form"),$([]))}},[e.createModalVisible]);var Z=function(I){if(console.log(JSON.stringify(I)),I){var V;(V=P.current)===null||V===void 0||V.setFieldsValue({actionValue:JSON.stringify(I)})}U(!1),c.default.success("\u4FDD\u5B58\u6210\u529F")},y=[{value:"text",label:"text(\u5B57\u7B26\u4E32)"},{value:"textareaary",label:"textarea(\u5B57\u7B26\u4E32\u6570\u7EC4)"},{value:"select",label:"enum(\u679A\u4E3E)"},{value:"textarea",label:"text(\u6587\u672C\u57DF)"},{value:"digit",label:"int32(\u6574\u578B)"},{value:"switch",label:"bool(\u5E03\u5C14\u578B)"}],ue=[{dataIndex:"actionValue",valueType:"dependency",name:["valueType"],columns:function(I){var V=I.actionType;switch(console.log(D),D){case"select":return[{dataIndex:"list",valueType:"formList",initialValue:le,style:{paddingTop:"20px"},columns:[{valueType:"group",columns:[{title:"\u679A\u4E3E\u540D\u79F0",dataIndex:"actionValueName",width:"md",formItemProps:{rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879"}]}}]}]},{renderFormItem:function(re,he,ae){return[(0,a.jsx)("div",{style:{float:"right"},children:(0,a.jsx)(K.Z,{type:"primary",style:{"margin-left":"5px"},onClick:function(){var te,me;return Z(ae==null||(te=ae.formRef)===null||te===void 0||(me=te.current)===null||me===void 0?void 0:me.getFieldValue("list")),!0},children:"\u4FDD\u5B58"})})]}}];case"text":return[{dataIndex:"actionValue",valueType:"text",renderFormItem:function(){return(0,a.jsx)(k.Z,{placeholder:"\u8F93\u5165\u7C7B\u578B\u503C",disabled:!0})}}];case"textareaary":return[{dataIndex:"actionValue",valueType:"text",initialValue:T,renderFormItem:function(){return(0,a.jsx)(F,{placeholder:"\u6570\u636E\u683C\u5F0F\uFF1A[data1:{value1:'1'},{value2:'2'},data2:{value1:'1'},{value2:'2'}]",autoSize:{minRows:10,maxRows:100}})}}];default:return[{dataIndex:"actionValue",valueType:D,fieldProps:{disabled:!0}}]}}}];return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(de.Z,{title:"\u65B0\u589E\u53C2\u6570",width:640,ref:P,visible:e==null?void 0:e.createModalVisible,bodyStyle:{padding:"32px 40px 1px 48px"},footer:null,onCancel:function(){e==null||e.onCancel()},destroyOnClose:!0,maskClosable:!1,children:(0,a.jsxs)(m.Z,{layout:"vertical",preserve:!1,initialValues:e==null?void 0:e.values,onFinish:e==null?void 0:e.onFinish,ref:P,children:[(0,a.jsx)(m.Z.Item,{name:"id",hidden:!0,children:(0,a.jsx)(k.Z,{})}),(0,a.jsxs)(m.Z.Item,{children:[(0,a.jsx)(m.Z.Item,{name:"actionName",label:"\u53C2\u6570\u540D\u79F0",rules:[{required:!0,max:64,whitespace:!0}],children:(0,a.jsx)(k.Z,{placeholder:"\u8BF7\u8F93\u5165\u53C2\u6570\u540D\u79F0"})}),(0,a.jsx)(m.Z.Item,{name:"actionType",label:"\u6570\u636E\u7C7B\u578B",rules:[{required:!0,max:64,whitespace:!0}],children:(0,a.jsx)(ut.Z,{options:y,fieldProps:{value:D,onChange:function(I){I=="select"?z("ModalForm"):z("Form"),J(I)}}})}),(0,a.jsx)(m.Z.Item,{name:"actionValue",label:"\u8F93\u5165\u7C7B\u578B\u63A7\u4EF6",children:(0,a.jsx)(rt.Z,{trigger:(0,a.jsx)("a",{onClick:function(){return U(!0)},children:"\u6DFB\u52A0\u679A\u4E3E"}),columns:ue,layoutType:Y,visible:w,modalProps:{forceRender:!0,onCancel:function(){return U(!1)}},onVisibleChange:function(I){C(I)},width:420,shouldUpdate:p,submitter:!1,style:{padding:"40px 10px 1px 10px;"}})}),(0,a.jsx)(K.Z,{htmlType:"button",style:{float:"right",left:10},onClick:e.onCancel,children:"\u53D6\u6D88"}),(0,a.jsx)(K.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})]})]})})})},ot=it,R=o(48971),G=o(96690);function Ua(v){return ta.apply(this,arguments)}function ta(){return ta=(0,g.Z)((0,r.Z)().mark(function v(e){return(0,r.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,R.WY)((0,G.w)()+"/api/productfunction/page",{method:"Post",data:e}));case 1:case"end":return n.stop()}},v)})),ta.apply(this,arguments)}function st(v){return la.apply(this,arguments)}function la(){return la=(0,g.Z)((0,r.Z)().mark(function v(e){return(0,r.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,R.WY)((0,G.w)()+"/api/productfunction/add",{method:"Post",data:e}));case 1:case"end":return n.stop()}},v)})),la.apply(this,arguments)}function dt(v){return na.apply(this,arguments)}function na(){return na=(0,g.Z)((0,r.Z)().mark(function v(e){return(0,r.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,R.WY)((0,G.w)()+"/api/productfunction/update",{method:"Post",data:e}));case 1:case"end":return n.stop()}},v)})),na.apply(this,arguments)}function ct(v){return ua.apply(this,arguments)}function ua(){return ua=(0,g.Z)((0,r.Z)().mark(function v(e){return(0,r.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,R.WY)((0,G.w)()+"/api/productfunction/delete",{method:"Post",data:e}));case 1:case"end":return n.stop()}},v)})),ua.apply(this,arguments)}function ra(v){return ia.apply(this,arguments)}function ia(){return ia=(0,g.Z)((0,r.Z)().mark(function v(e){return(0,r.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,R.WY)((0,G.w)()+"/api/producttopics/page",{method:"Post",data:e}));case 1:case"end":return n.stop()}},v)})),ia.apply(this,arguments)}function vt(v){return oa.apply(this,arguments)}function oa(){return oa=(0,g.Z)((0,r.Z)().mark(function v(e){return(0,r.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,R.WY)((0,G.w)()+"/api/producttopics/add",{method:"Post",data:e}));case 1:case"end":return n.stop()}},v)})),oa.apply(this,arguments)}function ht(v){return sa.apply(this,arguments)}function sa(){return sa=(0,g.Z)((0,r.Z)().mark(function v(e){return(0,r.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,R.WY)((0,G.w)()+"/api/producttopics/update",{method:"Post",data:e}));case 1:case"end":return n.stop()}},v)})),sa.apply(this,arguments)}function ft(v){return da.apply(this,arguments)}function da(){return da=(0,g.Z)((0,r.Z)().mark(function v(e){return(0,r.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,R.WY)((0,G.w)()+"/api/producttopics/delete",{method:"Post",data:e}));case 1:case"end":return n.stop()}},v)})),da.apply(this,arguments)}function mt(v){return ca.apply(this,arguments)}function ca(){return ca=(0,g.Z)((0,r.Z)().mark(function v(e){return(0,r.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,R.WY)((0,G.w)()+"/api/productfunction/getproductfunctionaction?productFunctionId="+e,{method:"Get"}));case 1:case"end":return n.stop()}},v)})),ca.apply(this,arguments)}function yt(v){return va.apply(this,arguments)}function va(){return va=(0,g.Z)((0,r.Z)().mark(function v(e){return(0,r.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,R.WY)((0,G.w)()+"/api/productfunction/addproductfunctionaction",{method:"Post",data:e}));case 1:case"end":return n.stop()}},v)})),va.apply(this,arguments)}function bt(v){return ha.apply(this,arguments)}function ha(){return ha=(0,g.Z)((0,r.Z)().mark(function v(e){return(0,r.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,R.WY)((0,G.w)()+"/api/productfunction/updateproductfunctionaction",{method:"Post",data:e}));case 1:case"end":return n.stop()}},v)})),ha.apply(this,arguments)}function gt(v){return fa.apply(this,arguments)}function fa(){return fa=(0,g.Z)((0,r.Z)().mark(function v(e){return(0,r.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,R.WY)((0,G.w)()+"/api/productfunction/delproductfunctionaction",{method:"Post",data:e}));case 1:case"end":return n.stop()}},v)})),fa.apply(this,arguments)}function Pt(v){return ma.apply(this,arguments)}function ma(){return ma=_asyncToGenerator(_regeneratorRuntime().mark(function v(e){return _regeneratorRuntime().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",request(getDataBaseUrl()+"/api/devicevesion/getdevicevesion?productId=".concat(e),{method:"Get"}));case 1:case"end":return n.stop()}},v)})),ma.apply(this,arguments)}function pt(v){return ya.apply(this,arguments)}function ya(){return ya=(0,g.Z)((0,r.Z)().mark(function v(e){return(0,r.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,R.WY)((0,G.w)()+"/api/product/getproduct?productId=".concat(e),{method:"Get"}));case 1:case"end":return n.stop()}},v)})),ya.apply(this,arguments)}var At=_.Z.Option,Dt=_.Z.OptGroup,Zt=function(e){var x=(0,s.useState)([]),n=(0,h.Z)(x,2),xe=n[0],P=n[1],ee=(0,s.useState)([]),j=(0,h.Z)(ee,2),D=j[0],J=j[1],L=(0,s.useRef)(),N=m.Z.useForm(),Y=(0,h.Z)(N,1),z=Y[0],q=(0,s.useState)(),H=(0,h.Z)(q,2),le=H[0],$=H[1],O=(0,s.useState)(!1),B=(0,h.Z)(O,2),T=B[0],M=B[1],Q={text:{value:"text",text:"text(\u5B57\u7B26\u4E32)"},textareaary:{value:"textareaary",text:"textarea(\u5B57\u7B26\u4E32\u6570\u7EC4)"},select:{value:"select",text:"enum(\u679A\u4E3E)"},textarea:{value:"textarea",text:"text(\u6587\u672C\u57DF)"},digit:{value:"digit",text:"int32(\u6574\u578B)"},switch:{value:"switch",text:"bool(\u5E03\u5C14\u578B)"}},ne=[{title:"\u53C2\u6570\u540D\u79F0",dataIndex:"actionName",width:"15%"},{title:"\u6570\u636E\u7C7B\u578B",key:"actionType",dataIndex:"actionType",valueType:"select",width:"15%",valueEnum:Q},{title:"\u64CD\u4F5C",valueType:"option",width:200,render:function(p,C,F,Z){return[(0,a.jsx)("a",{onClick:function(){M(!0),P(C)},children:"\u7F16\u8F91"},"editable"),(0,a.jsx)(Te.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){var ue;ce([C.id]),(ue=L.current)===null||ue===void 0||ue.reloadAndRest()},onCancel:function(){},children:(0,a.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary"),,]}}],w=function(){var E=(0,g.Z)((0,r.Z)().mark(function p(C){return(0,r.Z)().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return console.log(C),Z.next=3,yt(JSON.stringify(C)).then(function(y){y.data?c.default.success("\u6DFB\u52A0\u6210\u529F"):c.default.error(y.errors)});case 3:return Z.abrupt("return",!0);case 4:case"end":return Z.stop()}},p)}));return function(C){return E.apply(this,arguments)}}(),U=function(){var E=(0,g.Z)((0,r.Z)().mark(function p(C){return(0,r.Z)().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,bt(JSON.stringify(C)).then(function(y){y.data?c.default.success("\u4FEE\u6539\u6210\u529F"):c.default.error(y.errors)});case 2:return Z.abrupt("return",!0);case 3:case"end":return Z.stop()}},p)}));return function(C){return E.apply(this,arguments)}}(),ce=function(){var E=(0,g.Z)((0,r.Z)().mark(function p(C){return(0,r.Z)().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.prev=0,gt(C).then(function(y){y.data?(c.default.success("\u5220\u9664\u6210\u529F"),L.current.reloadAndRest()):c.default.error(y.errors)}),Z.abrupt("return",!0);case 5:Z.prev=5,Z.t0=Z.catch(0),c.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");case 8:case"end":return Z.stop()}},p,null,[[0,5]])}));return function(C){return E.apply(this,arguments)}}();return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(de.Z,{title:"\u53C2\u6570\u914D\u7F6E",width:1140,visible:e==null?void 0:e.actionFormModalVisible,bodyStyle:{padding:"32px 40px 1px 48px"},footer:null,onCancel:function(){e==null||e.onCancel()},destroyOnClose:!0,maskClosable:!1,children:[(0,a.jsx)(se.ZP,{rowKey:"id",headerTitle:"\u53C2\u6570\u914D\u7F6E\u5217\u8868",actionRef:L,pagination:!1,search:!1,toolBarRender:function(){return[(0,a.jsxs)(K.Z,{type:"primary",onClick:function(){M(!0),P({})},children:[(0,a.jsx)(fe.Z,{})," \u65B0\u5EFA"]},"primary")]},columns:ne,request:(0,g.Z)((0,r.Z)().mark(function E(){var p;return(0,r.Z)().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return p=[],console.log(e.values.id),F.next=4,mt(e.values.id).then(function(Z){p=Z.data});case 4:return F.abrupt("return",{data:p,success:!0});case 5:case"end":return F.stop()}},E)}))}),(0,a.jsx)(ot,{onFinish:function(){var E=(0,g.Z)((0,r.Z)().mark(function p(C){var F;return(0,r.Z)().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(F=!1,console.log(C),console.log(C.actionValue),C.productFunctionId=e.values.id,!C.id){y.next=10;break}return y.next=7,U(C);case 7:F=y.sent,y.next=13;break;case 10:return y.next=12,w(C);case 12:F=y.sent;case 13:F&&(M(!1),L.current&&L.current.reloadAndRest());case 14:case"end":return y.stop()}},p)}));return function(p){return E.apply(this,arguments)}}(),onCancel:function(){P(void 0),M(!1)},createModalVisible:T,actionValueName:le,values:xe||{}})]})})},xt=Zt,kt=o(17462),Ct=o(76772),Ft=function(e){var x,n=_.Z.Option,xe=_.Z.OptGroup,P=m.Z.useForm(),ee=(0,h.Z)(P,1),j=ee[0],D=k.Z.TextArea,J=(0,s.useState)(""),L=(0,h.Z)(J,2),N=L[0],Y=L[1],z=(0,s.useState)("Topic \u683C\u5F0F\u5FC5\u987B\u4EE5\u201C/\u201D\u8FDB\u884C\u5206\u5C42\uFF0C\u533A\u5206\u6BCF\u4E2A\u7C7B\u76EE\u3002\u5176\u4E2D\u524D\u4E09\u4E2A\u7C7B\u76EE\u5DF2\u7ECF\u89C4\u5B9A\u597D\uFF0C\u7B2C\u4E00\u4E2A\u4EE3\u8868\u4EA7\u54C1\u6807\u8BC6 ProductKey\uFF0C\u7B2C\u4E8C\u4E2A ${deviceKey} \u901A\u914D deviceKey\uFF0C\u7B2C\u4E09\u4E2A user \u7528\u6765\u6807\u8BC6\u4EA7\u54C1\u7684\u81EA\u5B9A\u4E49 Topic \u7C7B\u3002\u7B80\u5355\u6765\u8BF4\uFF0CTopic \u7C7B\uFF1A/a15T****dhK/${deviceKey}/user/update \u662F\u5177\u4F53 Topic\uFF1A/a15T****dhK/mydevice1/user/update \u548C /a15T****dhK/mydevice2/user/update \u7B49\u7684\u96C6\u5408\u3002"),q=(0,h.Z)(z,2),H=q[0],le=q[1];(0,s.useEffect)(function(){var O;if(e!=null&&(O=e.values)!==null&&O!==void 0&&O.id){var B,T,M,Q;j.setFieldsValue({id:e==null||(B=e.values)===null||B===void 0?void 0:B.id,topics:e==null||(T=e.values)===null||T===void 0?void 0:T.topics,topicsType:e==null||(M=e.values)===null||M===void 0?void 0:M.topicsType,description:e==null||(Q=e.values)===null||Q===void 0?void 0:Q.description})}},[e==null?void 0:e.values]);var $=function(B){console.log(B),Y(B.target.value)};return(0,a.jsxs)(de.Z,{title:e!=null&&(x=e.values)!==null&&x!==void 0&&x.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:e==null?void 0:e.createModalVisible,bodyStyle:{padding:"32px 40px 8px"},footer:null,onCancel:function(){e==null||e.onCancel()},destroyOnClose:!0,maskClosable:!1,children:[(0,a.jsx)(Ct.Z,{message:"\u8BF4\u660E",description:H,type:"info"}),(0,a.jsxs)(m.Z,{layout:"vertical",preserve:!1,form:j,onFinish:function(){j.setFieldsValue({topics:"/"+e.productCode+"/"+e.productVesion+"/${deviceKey}/use/"+N}),console.log(j.getFieldsValue()),e==null||e.onFinish(j.getFieldsValue())},children:[(0,a.jsx)(m.Z.Item,{name:"id",hidden:!0,children:(0,a.jsx)(k.Z,{})}),(0,a.jsx)(m.Z.Item,{name:"topics",label:"Topics\u7C7B",rules:[{required:!0,max:64,whitespace:!0}],children:(0,a.jsx)(k.Z,{addonBefore:e.productCode+"/"+e.productVesion+"/${deviceKey}/use/",onChange:$,placeholder:"\u8BF7\u8F93\u5165Topics\u7C7B"})}),(0,a.jsx)(m.Z.Item,{label:"\u7C7B\u578B",name:"topicsType",rules:[{required:!0}],children:(0,a.jsx)(_.Z,{options:[{value:0,label:"\u53D1\u5E03"},{value:1,label:"\u8BA2\u9605"},{value:2,label:"\u53D1\u5E03\u548C\u8BA2\u9605"}]})}),(0,a.jsx)(m.Z.Item,{name:"description",label:"\u63CF\u8FF0",rules:[{required:!1}],children:(0,a.jsx)(D,{showCount:!0,maxLength:100,style:{height:120,resize:"none"},placeholder:"\u8BF7\u8F93\u5165\u63CF\u8FF0"})}),(0,a.jsxs)(m.Z.Item,{children:[(0,a.jsx)(K.Z,{htmlType:"button",style:{float:"right",left:10},onClick:e.onCancel,children:"\u53D6\u6D88"}),(0,a.jsx)(K.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})]})]})]})},St=Ft,ba=Ze.Z.Paragraph,Rt=Ze.Z.Text,Lt={beforeUpload:function(e){return e.type!=="application/vnd.ms-excel"&&e.type!=="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"&&c.default.error("".concat(e.name," \u4E0D\u662F exelce \u6587\u4EF6")),e.type=="application/vnd.ms-excel"||e.type=="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"?!0:ea.Z.LIST_IGNORE},name:"file",action:"/saasbase/api/goodes/DeviceVersionTemplateImport",headers:{Authorization:"Bearer "+localStorage.getItem("token")},onChange:function(e){e.file.status!=="uploading"&&console.log(e.file,e.fileList),e.file.status==="done"?c.default.success("".concat(e.file.name," file uploaded successfully")):e.file.status==="error"&&c.default.error("".concat(e.file.name," file upload failed."))}},jt=function(e){var x,n,xe=(0,s.useState)(!1),P=(0,h.Z)(xe,2),ee=P[0],j=P[1],D=(0,s.useState)(!1),J=(0,h.Z)(D,2),L=J[0],N=J[1],Y=(0,s.useState)("basis"),z=(0,h.Z)(Y,2),q=z[0],H=z[1],le=(0,s.useState)(!1),$=(0,h.Z)(le,2),O=$[0],B=$[1],T=(0,s.useState)(!1),M=(0,h.Z)(T,2),Q=M[0],ne=M[1],w=(0,s.useRef)(),U=(0,s.useRef)(),ce=(0,s.useRef)(),E=(0,s.useState)(),p=(0,h.Z)(E,2),C=p[0],F=p[1],Z=(0,s.useState)(),y=(0,h.Z)(Z,2),ue=y[0],A=y[1],I=(0,s.useState)([]),V=(0,h.Z)(I,2),ve=V[0],re=V[1],he=(0,s.useState)([]),ae=(0,h.Z)(he,2),ga=ae[0],te=ae[1],me=(0,s.useState)([]),Ce=(0,h.Z)(me,2),pa=Ce[0],Ie=Ce[1],Ve=(0,s.useState)({}),ye=(0,h.Z)(Ve,2),ie=ye[0],Je=ye[1],Za=(0,s.useState)(0),be=(0,h.Z)(Za,2),Ya=be[0],Ue=be[1],xa=(0,s.useState)(0),Ye=(0,h.Z)(xa,2),qa=Ye[0],Ca=Ye[1],W=(0,s.useState)({operationKey:e.location.query.tabStatus?e.location.query.tabStatus:"basis",tabActiveKey:e.location.query.tabStatus?e.location.query.tabStatus:"basis"}),qe=(0,h.Z)(W,2),Fe=qe[0],Pe=qe[1];(0,s.useEffect)(function(){H(Fe.tabActiveKey),e.location.query.values.id?pt(e.location.query.values.productId).then(function(i){Je(i.data);var l={productId:e.location.query.values.productId,productVesionId:e.location.query.values.id,isDefault:!0,current:1,pageSize:10};Qe(l),Re(l)}):R.m8.push({pathname:"/device/deviceVesion"})},[Fe]);var Ae=function(l){var t=[];return(l.type==1||l.type==2)&&t.push((0,a.jsx)("a",{onClick:function(){var u,f;B(!0),F(l),(u=w.current)===null||u===void 0||(f=u.reloadAndRest)===null||f===void 0||f.call(u)},children:"\u53C2\u6570\u914D\u7F6E"},"config")),t.push((0,a.jsx)("a",{onClick:function(){j(!0),F(l)},children:"\u66F4\u65B0"},"config")),l.isDefault||t.push((0,a.jsx)(Te.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){Sa([l.id])},onCancel:function(){},children:(0,a.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary")),t},Fa=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0,render:function(l,t){return(0,a.jsx)("a",{onClick:function(){F(t),ne(!0)},children:l})}},{title:"\u529F\u80FD\u540D\u79F0",dataIndex:"name",valueType:"textarea",ellipsis:!0,search:!0},{title:"\u529F\u80FD\u7C7B\u578B",dataIndex:"type",valueType:"select",ellipsis:!0,search:!0,valueEnum:{0:{text:"\u5C5E\u6027"},1:{text:"\u670D\u52A1"},2:{text:"\u4E8B\u4EF6"}}},{title:"\u63CF\u8FF0",dataIndex:"description",valueType:"textarea",hideInSearch:!0},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createAt",valueType:"date",hideInSearch:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",fixed:"right",width:400,render:function(l,t){return Ae(t)}}],He=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0,render:function(l,t){return(0,a.jsx)("a",{onClick:function(){F(t),ne(!0)},children:l})}},{title:"Topics\u7C7B",dataIndex:"topics",valueType:"textarea",with:500,render:function(l){return(0,a.jsx)(ba,{style:{display:"inline"},copyable:!0,children:l})}},{title:"\u7C7B\u578B",dataIndex:"topicsType",valueType:"select",ellipsis:!0,search:!0,valueEnum:{0:{text:"\u53D1\u5E03"},1:{text:"\u8BA2\u9605"},2:{text:"\u53D1\u5E03\u548C\u8BA2\u9605"}}},{title:"\u63CF\u8FF0",dataIndex:"description",valueType:"textarea",ellipsis:!0,search:!1,with:350},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",fixed:"right",width:250,render:function(l,t){return[(0,a.jsx)("a",{onClick:function(){N(!0),A(t)},children:" \u66F4\u65B0"},"config"),(0,a.jsx)(Te.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:(0,g.Z)((0,r.Z)().mark(function d(){return(0,r.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,ft([t.id]).then(function(b){c.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"),U.current.reload()});case 2:case"end":return f.stop()}},d)})),onCancel:function(){},children:(0,a.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary")]}}],De=[{title:"\u529F\u80FD",dataIndex:"name",with:"10%",onCell:function(l,t){return{rowSpan:t%2==0?2:0}}},{title:"Topics\u7C7B",dataIndex:"topics",valueType:"textarea",with:"40%",render:function(l){return(0,a.jsx)(ba,{style:{display:"inline"},copyable:!0,children:l})}},{title:"\u7C7B\u578B",dataIndex:"topicsType",valueType:"select",ellipsis:!0,search:!0,with:"10%",valueEnum:{0:{text:"\u53D1\u5E03"},1:{text:"\u8BA2\u9605"},2:{text:"\u53D1\u5E03\u548C\u8BA2\u9605"}}},{title:"\u63CF\u8FF0",dataIndex:"description",valueType:"textarea",ellipsis:!0,search:!1,with:"40%"}],ke=[{key:"basis",tab:"\u529F\u80FD"},{key:"topis",tab:"topics\u7C7B\u5217\u8868"}],$e=function(){var i=(0,g.Z)((0,r.Z)().mark(function l(t){var d;return(0,r.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(f.prev=0,d=!0,console.log(t),t.dataType=="select"&&(t.enumvaluelist?t.enumValue=JSON.stringify(t.enumvaluelist):(c.default.error("\u8BF7\u6DFB\u52A0\u679A\u4E3E\u503C"),d=!1)),t.type==1&&(t.dataType=""),!d){f.next=9;break}return t.dataJson!=null&&(t.dataJson=JSON.parse(t.dataJson)),f.next=9,st(JSON.stringify(t)).then(function(b){if(b.data){c.default.success("\u6DFB\u52A0\u6210\u529F");var S={productId:e.location.query.values.productId,productVesionId:e.location.query.values.productId,current:1,pageSize:10};Qe(S),j(!1),w.current&&w.current.reloadAndRest()}else c.default.error(b.errors)});case 9:f.next=14;break;case 11:f.prev=11,f.t0=f.catch(0),c.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01");case 14:case"end":return f.stop()}},l,null,[[0,11]])}));return function(t){return i.apply(this,arguments)}}(),Sa=function(){var i=(0,g.Z)((0,r.Z)().mark(function l(t){return(0,r.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,ct(t).then(function(f){f.data?(c.default.success("\u5220\u9664\u6210\u529F"),w.current.reload()):c.default.error(f.errors)}),u.abrupt("return",!0);case 5:u.prev=5,u.t0=u.catch(0),c.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");case 8:case"end":return u.stop()}},l,null,[[0,5]])}));return function(t){return i.apply(this,arguments)}}(),ja=function(){var i=(0,g.Z)((0,r.Z)().mark(function l(t){var d;return(0,r.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:try{d=!0,t.dataType=="select"&&(t.enumvaluelist.length==0?(c.default.error("\u8BF7\u6DFB\u52A0\u679A\u4E3E\u503C"),d=!1):t.enumValue=JSON.stringify(t.enumvaluelist)),d&&(console.log("actionRef.current",w.current.current),dt(t).then(function(b){b.data?(c.default.success("\u4FEE\u6539\u6210\u529F"),j(!1),w.current&&w.current.reloadAndRest()):c.default.error(b.errors)}))}catch(b){c.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")}case 1:case"end":return f.stop()}},l)}));return function(t){return i.apply(this,arguments)}}(),Re=function(){var i=(0,g.Z)((0,r.Z)().mark(function l(t){return(0,r.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,ra(t).then(function(f){te(f.data.data),Ue(f.data.total)});case 2:case"end":return u.stop()}},l)}));return function(t){return i.apply(this,arguments)}}(),Qe=function(){var i=(0,g.Z)((0,r.Z)().mark(function l(t){return(0,r.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,Ua(t).then(function(f){var b,S;Ie((b=f.data)===null||b===void 0?void 0:b.data),Ca((S=f.data)===null||S===void 0?void 0:S.total)});case 2:case"end":return u.stop()}},l)}));return function(t){return i.apply(this,arguments)}}(),Le=function(l){console.log(l),Pe({operationKey:l,tabActiveKey:l})},Ta=function(l){console.log(l);var t={};l=="1"?(t.productId=e.location.query.values.productId,t.productVesionId=e.location.query.values.id,t.isDefault=!0,t.current=1,t.pageSize=10,Re(t)):(t.productId=e.location.query.values.productId,t.productVesionId=e.location.query.values.id,t.isDefault=!1,t.current=1,t.pageSize=10,Re(t))},Xe={zdy:(0,a.jsx)(se.ZP,{id:"table1",actionRef:U,rowKey:"id",pagination:{defaultPageSize:10},search:{labelWidth:120},columns:He,toolBarRender:function(){return[(0,a.jsxs)(K.Z,{type:"primary",onClick:function(){N(!0),A({})},children:[(0,a.jsx)(fe.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var i=(0,g.Z)((0,r.Z)().mark(function l(t){var d,u;return(0,r.Z)().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return d=[],u=0,t.productId=e.location.query.values.productId,t.productVesionId=e.location.query.values.id,t.isDefault=!1,b.next=7,ra(t).then(function(S){te(S.data.data),d=S.data.data,u=S.data.total});case 7:return b.abrupt("return",{data:d,success:!0,total:u});case 8:case"end":return b.stop()}},l)}));return function(l){return i.apply(this,arguments)}}(),rowSelection:{onChange:function(l,t){re(t)}}}),mr:(0,a.jsx)(se.ZP,{id:"table3",actionRef:ce,rowKey:"id",search:!1,pagination:{defaultPageSize:10},columns:De,toolBarRender:!1,scroll:{x:"100%"},request:function(){var i=(0,g.Z)((0,r.Z)().mark(function l(t){var d,u;return(0,r.Z)().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return d=[],u=0,t.productId=e.location.query.values.productId,t.productVesionId=e.location.query.values.id,t.isDefault=!0,b.next=7,ra(t).then(function(S){te(S.data.data),d=S.data.data,u=S.data.total});case 7:return b.abrupt("return",{data:d,success:!0,total:u});case 8:case"end":return b.stop()}},l)}));return function(l){return i.apply(this,arguments)}}()})},wa=[{key:"1",label:"\u9ED8\u8BA4topics",children:Xe.mr},{key:"2",label:"\u81EA\u5B9A\u4E49topics",children:Xe.zdy}],Ea={basis:(0,a.jsxs)(Se.Z,{style:{marginBottom:24},bordered:!1,children:[(0,a.jsx)(se.ZP,{id:"table2",actionRef:w,rowKey:"id",pagination:{defaultPageSize:10},search:{labelWidth:120},columns:Fa,toolBarRender:function(){return[(0,a.jsxs)(K.Z,{type:"primary",onClick:function(){j(!0),F({})},children:[(0,a.jsx)(fe.Z,{})," \u65B0\u5EFA"]},"primary")]},dataSource:pa,request:function(){var i=(0,g.Z)((0,r.Z)().mark(function l(t){var d,u;return(0,r.Z)().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return d=[],u=0,t.productId=e.location.query.values.productId,t.productVesionId=e.location.query.values.id,b.next=6,Ua(t).then(function(S){var ge,pe;d=S.data.data,Ie((ge=S.data)===null||ge===void 0?void 0:ge.data),u=(pe=S.data)===null||pe===void 0?void 0:pe.total});case 6:return b.abrupt("return",{data:d,success:!0,total:u});case 7:case"end":return b.stop()}},l)}));return function(l){return i.apply(this,arguments)}}(),rowSelection:{onChange:function(l,t){re(t)}}}),(0,a.jsx)(nt,{onFinish:function(){var i=(0,g.Z)((0,r.Z)().mark(function l(t){return(0,r.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(console.log("jnlaile "),console.log(t),t.productId=e.location.query.values.productId,t.deviceVersionKey=e.location.query.values.id,!t.id){u.next=9;break}return u.next=7,ja(t);case 7:u.next=11;break;case 9:return u.next=11,$e(t);case 11:case"end":return u.stop()}},l)}));return function(l){return i.apply(this,arguments)}}(),onCancel:function(){F(void 0),j(!1)},createModalVisible:ee,values:C||{}}),(0,a.jsx)(xt,{actionFormModalVisible:O,values:C||{},onCancel:function(){F(void 0),B(!1)}})]}),topis:(0,a.jsxs)(Se.Z,{style:{marginBottom:24},bordered:!1,children:[(0,a.jsx)(Me.Z,{tabPosition:"left",items:wa,onChange:Ta}),(0,a.jsx)(St,{createModalVisible:L,productCode:ie.key,productVesion:(x=e.location.query.values)===null||x===void 0?void 0:x.vesion,values:ue||{},onFinish:function(){var i=(0,g.Z)((0,r.Z)().mark(function l(t){return(0,r.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(t.productId=e.location.query.values.productId,t.productVesionId=e.location.query.values.id,!t.id){u.next=7;break}return u.next=5,ht(t).then(function(f){f.data?(c.default.success("\u4FEE\u6539\u6210\u529F"),U.current.reload(),N(!1)):c.default.error(f.errors)});case 5:u.next=9;break;case 7:return u.next=9,vt(t).then(function(f){f.data?(c.default.success("\u6DFB\u52A0\u6210\u529F"),U.current.reload(),N(!1)):c.default.error(f.errors)});case 9:case"end":return u.stop()}},l)}));return function(l){return i.apply(this,arguments)}}(),onCancel:function(){A(void 0),N(!1)}})]})};return(0,a.jsx)(Ee.ZP,{host:!0,header:{title:[(0,a.jsxs)("a",{onClick:function(){R.m8.push({pathname:"/device/deviceVesion"})},children:[(0,a.jsx)(we.Z,{}),"\u8FD4\u56DE"]},"back"),(0,a.jsx)("div",{style:{backgroundColor:"#f3eaea",width:"1640px",height:"54px"},children:(0,a.jsxs)("div",{style:{fontSize:"14px",color:"cornflowerblue"},children:[(0,a.jsxs)("span",{style:{marginRight:20,marginLeft:10,marginTop:10,float:"left"},children:["\u4EA7\u54C1\u7248\u672C:",(0,a.jsx)("span",{style:{marginLeft:10},children:(n=e.location.query.values)===null||n===void 0?void 0:n.vesion})]}),(0,a.jsxs)("span",{style:{marginRight:20,marginLeft:10,marginTop:10,float:"left"},children:["\u4EA7\u54C1\u540D\u79F0:",(0,a.jsx)("span",{style:{marginLeft:10},children:ie==null?void 0:ie.name})]}),(0,a.jsxs)("span",{style:{marginRight:120,marginLeft:10,marginTop:10,float:"right"},children:["\u4EA7\u54C1key: ",(0,a.jsx)(ba,{style:{display:"inline"},copyable:!0,children:ie==null?void 0:ie.key})]})]})})],breadcrumb:{}},title:e.location.query.isAdd?"\u5546\u54C1\u65B0\u589E":"\u8BE6\u60C5",tabActiveKey:q,onTabChange:Le,tabList:ke,children:Ea[Fe.operationKey]})},Tt=jt}}]);
|