|
- "use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[36],{37387:function(K,D,t){var y=t(97857),c=t.n(y),l=t(12578);D.Z={Add:function(o){return(0,l.request)("/api/devicesinfo/add",{method:"POST",data:c()({},o)})},Del:function(o){return(0,l.request)("/api/devicesinfo/del",{method:"POST",data:c()({},o)})},Update:function(o){return(0,l.request)("/api/devicesinfo/update",{method:"POST",data:c()({},o)})},Detail:function(o){return(0,l.request)("/api/devicesinfo/detail?id=".concat(o),{method:"GET"})},List:function(){return(0,l.request)("/api/devicesinfo/list",{method:"POST"})},UnBindList:function(){return(0,l.request)("/api/devicesinfo/UnBindList",{method:"GET"})},PagedList:function(o){return(0,l.request)("/api/devicesinfo/pagedlist",{method:"POST",data:c()({},o)})},BatchUpdate:function(o){return(0,l.request)("/api/devicerecipe/batchupdate",{method:"POST",data:o})},RecipeList:function(o){return(0,l.request)(" api/devicerecipe/list",{method:"POST",data:{deviceId:o}})},selectlist:function(){return(0,l.request)("/api/devicesinfo/selectlist",{method:"GET"})}}},77386:function(K,D,t){var y=t(97857),c=t.n(y),l=t(12578);D.Z={Add:function(o){return(0,l.request)("/api/deviceProduct/add",{method:"POST",data:c()({},o)})},Del:function(o){return(0,l.request)("/api/deviceProduct/del",{method:"POST",data:c()({},o)})},Update:function(o){return(0,l.request)("/api/deviceProduct/update",{method:"POST",data:c()({},o)})},Detail:function(o){return(0,l.request)("/api/deviceProduct/detail?id=".concat(o),{method:"GET"})},List:function(o){return(0,l.request)("/api/deviceProduct/list",{method:"POST",data:c()({},o)})},PagedList:function(o){return(0,l.request)("/api/deviceProduct/pagedlist",{method:"POST",data:c()({},o)})},SelectList:function(){return(0,l.request)("/api/deviceProduct/selectlist",{method:"GET"})}}},99260:function(K,D,t){t.r(D);var y=t(15009),c=t.n(y),l=t(99289),n=t.n(l),o=t(5574),R=t.n(o),U=t(15513),N=t(76239),O=t(12029),I=t(71577),z=t(86738),M=t(45360),B=t(5914),J=t(51904),j=t(12096),x=t(67294),Z=t(37387),V=t(77386),H=t(27484),F=t.n(H),s=t(85893),W=N.Z;D.default=function(){var G=O.Z.useForm(),e=R()(G,1),d=e[0],i=(0,x.useState)(),r=R()(i,2),a=r[0],m=r[1],P=(0,x.useState)(!1),L=R()(P,2),T=L[0],g=L[1],S=(0,x.useRef)(),A=[{title:"id",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0},{title:"\u8BBE\u5907\u540D\u79F0",dataIndex:"name",ellipsis:!0},{title:"\u8BBE\u5907\u7F16\u53F7",dataIndex:"code",ellipsis:!0},{title:"\u8BBE\u5907\u63CF\u8FF0",dataIndex:"describe",ellipsis:!0,hideInSearch:!0},{title:"\u8BBE\u5907\u7C7B\u578B",dataIndex:"deviceType",ellipsis:!0,hideInSearch:!0,valueType:"select",request:function(){var f=n()(c()().mark(function p(){var E;return c()().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return _.next=2,V.Z.SelectList();case 2:return E=_.sent,console.log(E),_.abrupt("return",E.data);case 5:case"end":return _.stop()}},p)}));function v(){return f.apply(this,arguments)}return v}()},{title:"\u8BBE\u5907\u7EF4\u4FDD\u65E5\u671F",dataIndex:"repairDate",ellipsis:!0,hideInSearch:!0,render:function(v,p){return(0,s.jsx)(s.Fragment,{children:F()(p.repairDate).format("YYYY-MM-DD")})}},{title:"\u64CD\u4F5C",valueType:"option",key:"option",render:function(v,p){return[(0,s.jsx)(I.ZP,{type:"primary",ghost:!0,onClick:n()(c()().mark(function E(){var h;return c()().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:g(!0),m("\u7F16\u8F91\u4FE1\u606F"),h=JSON.parse(JSON.stringify(p)),h.repairDate=F()(p.repairDate),console.log("record",p),d.setFieldsValue(h);case 6:case"end":return u.stop()}},E)})),children:"\u7F16\u8F91"},"edit"),(0,s.jsx)(z.Z,{title:"\u786E\u5B9A\u8981\u5220\u9664\u6B64\u6761\u6570\u636E\u5417\uFF1F",onConfirm:function(){var h={id:p.id};Z.Z.Del(h).then(function(_){if(_.statusCode===200){var u;M.ZP.success(_.statusCode===200?"\u5220\u9664\u6210\u529F":_.message),(u=S.current)===null||u===void 0||u.reload()}})},onCancel:function(){M.ZP.info("\u5DF2\u53D6\u6D88\u5220\u9664")},okText:"\u786E\u8BA4",cancelText:"\u5173\u95ED",children:(0,s.jsx)(I.ZP,{type:"primary",danger:!0,ghost:!0,children:"\u5220\u9664"})},"del")]}}],$=function(){var f=n()(c()().mark(function v(p){var E,h,_,u;return c()().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(!p.id){b.next=7;break}return b.next=3,Z.Z.Update(p);case 3:E=b.sent,E.statusCode===200?(M.ZP.success("\u4FEE\u6539\u6210\u529F"),(h=S.current)===null||h===void 0||h.reload(),g(!1)):M.ZP.error(JSON.stringify(E.errors)||"\u4FEE\u6539\u5931\u8D25"),b.next=12;break;case 7:return b.next=9,Z.Z.Add(p);case 9:_=b.sent,console.log("response",_),_.statusCode===200?(M.ZP.success("\u6DFB\u52A0\u6210\u529F"),(u=S.current)===null||u===void 0||u.reload(),g(!1)):M.ZP.error(JSON.stringify(_.errors)||"\u6DFB\u52A0\u5931\u8D25");case 12:case"end":return b.stop()}},v)}));return function(p){return f.apply(this,arguments)}}();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(U.Z,{columns:A,actionRef:S,cardBordered:!0,request:n()(c()().mark(function f(){var v,p,E,h=arguments;return c()().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return v=h.length>0&&h[0]!==void 0?h[0]:{},p={pageIndex:v.current||1,pageSize:v.pageSize||10,name:v.name||"",code:v.code},u.next=4,Z.Z.PagedList(p);case 4:if(E=u.sent,E.statusCode!==200){u.next=9;break}return u.abrupt("return",{data:E.data.items,success:!0,total:E.data.total});case 9:return u.abrupt("return",{data:[],success:!1,total:0});case 10:case"end":return u.stop()}},f)})),rowKey:"id",pagination:{pageSize:10,showSizeChanger:!1},dateFormatter:"string",headerTitle:"\u8BBE\u5907\u5217\u8868",toolBarRender:function(){return[(0,s.jsx)(I.ZP,{type:"primary",onClick:function(){d.resetFields(),g(!0),m("\u65B0\u589E\u4FE1\u606F")},children:"\u65B0\u5EFA\u8BBE\u5907"},"button")]}},"myTable"),(0,s.jsx)(B.Z,{maskClosable:!1,width:800,title:(0,s.jsx)(J.Z,{color:"#cd201f",children:a}),open:T,onCancel:function(){g(!1)},footer:[(0,s.jsx)(I.ZP,{onClick:function(){g(!1)},children:"\u8FD4\u56DE"},"back"),(0,s.jsx)(I.ZP,{form:"deviceInfoForm",type:"primary",htmlType:"submit",children:"\u63D0\u4EA4"},"submit")],children:(0,s.jsxs)(O.Z,{form:d,name:"basic",id:"deviceInfoForm",onFinish:$,autoComplete:"off",children:[(0,s.jsx)(O.Z.Item,{label:"id",name:"id",hidden:!0,children:(0,s.jsx)(j.Z,{})}),(0,s.jsx)(O.Z.Item,{label:"\u8BBE\u5907\u540D\u79F0",name:"name",rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879!"}],children:(0,s.jsx)(j.Z,{})}),(0,s.jsx)(O.Z.Item,{label:"\u8BBE\u5907\u7F16\u53F7",name:"code",rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879!"}],children:(0,s.jsx)(j.Z,{})}),(0,s.jsx)(O.Z.Item,{label:"\u8BBE\u5907\u63CF\u8FF0",name:"describe",children:(0,s.jsx)(j.Z,{})}),(0,s.jsx)(O.Z.Item,{label:"\u8BBE\u5907\u7C7B\u578B",name:"deviceType",rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879!"}],children:(0,s.jsx)(j.Z,{})}),(0,s.jsx)(O.Z.Item,{label:"\u8BBE\u5907\u7EF4\u4FDD\u65E5\u671F",name:"repairDate",rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879!"}],children:(0,s.jsx)(W,{})})]})},"01")]})}},51904:function(K,D,t){t.d(D,{Z:function(){return G}});var y=t(62208),c=t(94184),l=t.n(c),n=t(67294),o=t(98787),R=t(45353),U=t(53124);function N(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}var O=t(14747),I=t(98719),z=t(67968),M=t(45503);const B=(e,d,i)=>{const r=N(i);return{[`${e.componentCls}-${d}`]:{color:e[`color${i}`],background:e[`color${r}Bg`],borderColor:e[`color${r}Border`],[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}},J=e=>(0,I.Z)(e,(d,i)=>{let{textColor:r,lightBorderColor:a,lightColor:m,darkColor:P}=i;return{[`${e.componentCls}-${d}`]:{color:r,background:m,borderColor:a,"&-inverse":{color:e.colorTextLightSolid,background:P,borderColor:P},[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}}),j=e=>{const{paddingXXS:d,lineWidth:i,tagPaddingHorizontal:r,componentCls:a}=e,m=r-i,P=d-i;return{[a]:Object.assign(Object.assign({},(0,O.Wf)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:m,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",[`&${a}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${a}-close-icon`]:{marginInlineStart:P,color:e.colorTextDescription,fontSize:e.tagIconSize,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${a}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${e.iconCls}-close, ${e.iconCls}-close:hover`]:{color:e.colorTextLightSolid}},["&-checkable"]:{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${a}-checkable-checked):hover`]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive}},["&-hidden"]:{display:"none"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:m}}),[`${a}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}};var x=(0,z.Z)("Tag",e=>{const{lineWidth:d,fontSizeIcon:i}=e,r=e.fontSizeSM,a=`${e.lineHeightSM*r}px`,m=(0,M.TS)(e,{tagFontSize:r,tagLineHeight:a,tagIconSize:i-2*d,tagPaddingHorizontal:8,tagBorderlessBg:e.colorFillTertiary});return[j(m),J(m),B(m,"success","Success"),B(m,"processing","Info"),B(m,"error","Error"),B(m,"warning","Warning")]},e=>({defaultBg:e.colorFillQuaternary,defaultColor:e.colorText})),Z=function(e,d){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&d.indexOf(r)<0&&(i[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)d.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(i[r[a]]=e[r[a]]);return i},H=e=>{const{prefixCls:d,className:i,checked:r,onChange:a,onClick:m}=e,P=Z(e,["prefixCls","className","checked","onChange","onClick"]),{getPrefixCls:L}=n.useContext(U.E_),T=f=>{a==null||a(!r),m==null||m(f)},g=L("tag",d),[S,A]=x(g),$=l()(g,{[`${g}-checkable`]:!0,[`${g}-checkable-checked`]:r},i,A);return S(n.createElement("span",Object.assign({},P,{className:$,onClick:T})))},F=function(e,d){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&d.indexOf(r)<0&&(i[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)d.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(i[r[a]]=e[r[a]]);return i};const s=(e,d)=>{const{prefixCls:i,className:r,rootClassName:a,style:m,children:P,icon:L,color:T,onClose:g,closeIcon:S,closable:A=!1,bordered:$=!0}=e,f=F(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","closeIcon","closable","bordered"]),{getPrefixCls:v,direction:p}=n.useContext(U.E_),[E,h]=n.useState(!0);n.useEffect(()=>{"visible"in f&&h(f.visible)},[f.visible]);const _=(0,o.o2)(T)||(0,o.yT)(T),u=Object.assign({backgroundColor:T&&!_?T:void 0},m),C=v("tag",i),[b,q]=x(C),k=l()(C,{[`${C}-${T}`]:_,[`${C}-has-color`]:T&&!_,[`${C}-hidden`]:!E,[`${C}-rtl`]:p==="rtl",[`${C}-borderless`]:!$},r,a,q),Y=X=>{X.stopPropagation(),g==null||g(X),!X.defaultPrevented&&h(!1)},ee=n.useMemo(()=>A?S?n.createElement("span",{className:`${C}-close-icon`,onClick:Y},S):n.createElement(y.Z,{className:`${C}-close-icon`,onClick:Y}):null,[A,S,C,Y]),te=typeof f.onClick=="function"||P&&P.type==="a",Q=L||null,re=Q?n.createElement(n.Fragment,null,Q,n.createElement("span",null,P)):P,w=n.createElement("span",Object.assign({},f,{ref:d,className:k,style:u}),re,ee);return b(te?n.createElement(R.Z,null,w):w)},W=n.forwardRef(s);W.CheckableTag=H;var G=W}}]);
|