"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[988],{24493:function(R,f,e){var M=e(97857),o=e.n(M),a=e(56002);f.Z={Add:function(r){return(0,a.request)("/api/process/add",{method:"POST",data:o()({},r)})},Del:function(r){return(0,a.request)("/api/process/del",{method:"POST",data:o()({},r)})},Update:function(r){return(0,a.request)("/api/process/update",{method:"POST",data:o()({},r)})},Detail:function(r){return(0,a.request)("/api/process/detail?id=".concat(r),{method:"GET"})},List:function(r){return(0,a.request)("/api/process/list",{method:"POST",data:o()({},r)})},PagedList:function(r){return(0,a.request)("/api/process/pagedlist",{method:"POST",data:o()({},r)})},Selectlist:function(){return(0,a.request)("/api/process/selectlist",{method:"GET"})}}},60744:function(R,f,e){e.r(f);var M=e(15009),o=e.n(M),a=e(99289),u=e.n(a),r=e(5574),A=e.n(r),C=e(51042),B=e(86550),L=e(78957),S=e(86738),i=e(45360),b=e(14726),E=e(67294),g=e(27484),F=e.n(g),P=e(24493),_=e(85893);f.default=function(){var U=(0,E.useState)("table"),T=A()(U,2),p=T[0],c=T[1],D=(0,E.useRef)(),I=(0,E.useRef)(),K=(0,E.useState)(),j=A()(K,2),h=j[0],v=j[1],O=function(){var t,n;(t=D.current)===null||t===void 0||t.resetFields(),(n=I.current)===null||n===void 0||n.reload()},W=[{title:"\u4E3B\u952E",dataIndex:"id",width:160,hideInForm:!0,hideInSearch:!0},{title:"\u540D\u79F0",dataIndex:"name",ellipsis:!0,width:120,formItemProps:{rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879!"}]}},{title:"\u7C7B\u578B",hideInDescriptions:!0,dataIndex:"processType",width:120,search:!1,valueEnum:{0:{text:"\u4EBA\u5DE5"},1:{text:"\u8BBE\u5907"}},formItemProps:{rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879!"}]}},{title:"\u63CF\u8FF0",dataIndex:"des",search:!1},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createTime",render:function(t,n){return(0,_.jsx)(_.Fragment,{children:F()(n.createTime).format("YYYY-MM-DD HH:mm:ss")})},search:!1,hideInForm:!0},{title:"\u64CD\u4F5C",valueType:"option",dataIndex:"id",render:function(t,n){return[(0,_.jsxs)(L.Z,{children:[(0,_.jsx)("a",{onClick:function(){var s;c("form"),v(n),(s=D.current)===null||s===void 0||s.setFieldsValue(n)},target:"_blank",rel:"noopener noreferrer",children:"\u7F16\u8F91"},+new Date+Math.random()),(0,_.jsx)(S.Z,{title:"\u786E\u5B9A\u8981\u5220\u9664\u6B64\u6761\u6570\u636E\u5417\uFF1F",onConfirm:function(){P.Z.Del(n).then(function(s){s.statusCode===200?(i.ZP.info("\u5220\u9664\u6210\u529F!"),O()):i.ZP.error(s.errors)})},onCancel:function(){i.ZP.info("\u5DF2\u53D6\u6D88\u5220\u9664")},okText:"\u786E\u8BA4",cancelText:"\u5173\u95ED",children:(0,_.jsx)("a",{children:"\u5220\u9664"})},"del")]},+new Date+Math.random())]}}];return(0,_.jsx)(_.Fragment,{children:(0,_.jsx)(B.Z,{columns:W,type:p,formRef:D,actionRef:I,onSubmit:function(t){t.id=h==null?void 0:h.id,console.log(t),p==="form"&&(t.id?P.Z.Update(t).then(function(n){n.statusCode===200?(i.ZP.info("\u66F4\u65B0\u6210\u529F!"),c("table"),O()):i.ZP.error(n.errors)}):P.Z.Add(t).then(function(n){n.statusCode===200?(i.ZP.info("\u65B0\u589E\u6210\u529F!"),c("table"),O()):i.ZP.error(n.errors)}))},form:{ignoreRules:!0,submitter:{onReset:function(){var t;(t=D.current)===null||t===void 0||t.resetFields(),c("table")},searchConfig:{resetText:p==="form"?"\u8FD4\u56DE":"\u91CD\u7F6E"}}},request:u()(o()().mark(function l(){var t,n,m,s=arguments;return o()().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return t=s.length>0&&s[0]!==void 0?s[0]:{},n={pageIndex:t.current||1,pageSize:t.pageSize||10,name:t.name||""},d.next=4,P.Z.PagedList(n);case 4:if(m=d.sent,m.statusCode!==200){d.next=9;break}return d.abrupt("return",{data:m.data.items,success:!0,total:m.data.total});case 9:return d.abrupt("return",{data:[],success:!1,total:0});case 10:case"end":return d.stop()}},l)})),pagination:{pageSize:10,showSizeChanger:!1},rowKey:"id",dateFormatter:"string",headerTitle:"\u5217\u8868",toolBarRender:function(){return[(0,_.jsxs)(b.ZP,{type:"primary",onClick:function(){c("form"),v({id:"",createTime:new Date})},children:[(0,_.jsx)(C.Z,{}),"\u65B0\u5EFA"]},"3")]}})})}}}]);
