You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2 lines
9.0 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[8688],{82746:function(fe,P,a){"use strict";a.r(P),a.d(P,{default:function(){return ne}});var he=a(57338),Y=a(273),ve=a(57663),E=a(71577),pe=a(62350),L=a(24565),x=a(2824),i=a(39428),me=a(34792),h=a(48086),y=a(3182),z=a(49101),D=a(67294),K=a(78009),H=a(85224),J=a(16894),Q=a(12826),Ze=a(71194),X=a(50146),ye=a(9715),C=a(55843),De=a(47673),R=a(4107),Ce=a(43358),j=a(34041),e=a(85893),q=function(r){var f=j.Z.Option,p=j.Z.OptGroup;return(0,e.jsx)(X.Z,{title:r.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:r.createModalVisible,bodyStyle:{padding:"32px 40px 1px 48px"},footer:null,onCancel:function(){r.onCancel()},destroyOnClose:!0,maskClosable:!1,children:(0,e.jsxs)(C.Z,{preserve:!1,layout:"horizontal",labelCol:{span:4},initialValues:r.values,onFinish:r.onFinish,children:[(0,e.jsx)(C.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(R.Z,{})}),(0,e.jsx)(C.Z.Item,{name:"value",label:"\u5B57\u5178\u503C",rules:[{required:!0,max:64}],children:(0,e.jsx)(R.Z,{placeholder:"\u8BF7\u8F93\u5165\u5B57\u5178\u503C"})}),(0,e.jsx)(C.Z.Item,{name:"code",label:"\u5B57\u5178\u7F16\u7801",rules:[{required:!0,max:64}],children:(0,e.jsx)(R.Z,{placeholder:"\u8BF7\u8F93\u5165\u5B57\u5178\u7F16\u7801"})}),(0,e.jsx)(C.Z.Item,{name:"typeId",label:"\u5B57\u5178\u7C7B\u578B",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5B57\u5178\u7C7B\u578B"}],children:(0,e.jsx)(j.Z,{children:r.typeNameData.map(function(t,u){return(0,e.jsx)(j.Z.Option,{index:u,value:t.typeId,children:t.text},t.typeId)})})}),(0,e.jsx)(C.Z.Item,{name:"status",label:"\u72B6\u6001",defaultValue:r.values.status,rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001"}],children:(0,e.jsx)(j.Z,{placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",children:(0,e.jsxs)(p,{children:[(0,e.jsx)(j.Z.Option,{value:"0",children:"\u6B63\u5E38"}),(0,e.jsx)(j.Z.Option,{value:"1",children:"\u505C\u7528"})]})})}),(0,e.jsx)(C.Z.Item,{name:"remark",label:"\u5907\u6CE8",rules:[{required:!0,max:200}],children:(0,e.jsx)(R.Z,{placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"})}),(0,e.jsxs)(C.Z.Item,{children:[(0,e.jsx)(E.Z,{htmlType:"button",style:{float:"right",left:10},onClick:r.onCancel,children:"\u53D6\u6D88"}),(0,e.jsx)(E.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})]})]})})},_=q,V=a(11849),g=a(48971),I={GetDictData:function(r){return(0,g.WY)("/kitchen/api/dict-data/dict-data",{method:"Post",data:r})},AddDictData:function(r){return(0,g.WY)("/kitchen/api/dict-data",{method:"POST",data:(0,V.Z)({},r)})},UpdateDictData:function(r){return(0,g.WY)("/kitchen/api/dict-data",{method:"PUT",data:(0,V.Z)({},r)})},removeDictData:function(r){return(0,g.WY)("/kitchen/api/dict-data",{method:"DELETE",data:r})},getDictTypeList:function(){return(0,g.WY)("/kitchen/api/select/dicttype",{method:"Get"})}},ee=function(){var v=(0,y.Z)((0,i.Z)().mark(function r(f){return(0,i.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,I.AddDictData(f).then(function(u){u.data?h.default.success("\u6DFB\u52A0\u6210\u529F"):h.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 3:return t.abrupt("return",!0);case 6:return t.prev=6,t.t0=t.catch(0),h.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),t.abrupt("return",!1);case 10:case"end":return t.stop()}},r,null,[[0,6]])}));return function(f){return v.apply(this,arguments)}}(),te=function(){var v=(0,y.Z)((0,i.Z)().mark(function r(f){return(0,i.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,I.UpdateDictData(f).then(function(u){u.data?h.default.success("\u914D\u7F6E\u6210\u529F"):h.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 3:return t.abrupt("return",!0);case 6:return t.prev=6,t.t0=t.catch(0),h.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),t.abrupt("return",!1);case 10:case"end":return t.stop()}},r,null,[[0,6]])}));return function(f){return v.apply(this,arguments)}}(),ae=function(){var v=(0,y.Z)((0,i.Z)().mark(function r(f){var p;return(0,i.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(p=h.default.loading("\u6B63\u5728\u5220\u9664\u6570\u636E\u5B57\u5178"),f){u.next=3;break}return u.abrupt("return",!0);case 3:return u.prev=3,u.next=6,I.removeDictData(f.map(function(F){return F.id})).then(function(F){if(F.data)return p(),h.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"),!0;p(),h.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5")});case 6:return u.abrupt("return",!0);case 9:return u.prev=9,u.t0=u.catch(3),p(),h.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),u.abrupt("return",!1);case 14:case"end":return u.stop()}},r,null,[[3,9]])}));return function(f){return v.apply(this,arguments)}}(),re=function(){var r=(0,D.useState)(),f=(0,x.Z)(r,2),p=f[0],t=f[1],u=(0,D.useState)({}),F=(0,x.Z)(u,2),ue=F[0],A=F[1],le=(0,D.useState)(),w=(0,x.Z)(le,2),ie=w[0],G=w[1],S=(0,D.useRef)(),se=(0,D.useState)(),W=(0,x.Z)(se,2),m=W[0],$=W[1],de=(0,D.useState)(),M=(0,x.Z)(de,2),T=M[0],U=M[1],ce=(0,D.useState)([]),k=(0,x.Z)(ce,2),O=k[0],oe=k[1];(0,D.useEffect)(function(){var s=function(){var l=(0,y.Z)((0,i.Z)().mark(function n(d){var c,o,Z;return(0,i.Z)().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return B.next=2,I.getDictTypeList();case 2:c=B.sent,o=[];for(Z in c.data)o.push({typeId:Z.toString(),text:c.data[Z.toString()]});oe(o);case 6:case"end":return B.stop()}},n)}));return function(d){return l.apply(this,arguments)}}();s()},[]);var N=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"key",hideInSearch:!0,hideInTable:!0,render:function(l,n){return(0,e.jsx)("a",{onClick:function(){$(n),G(!0)},children:l})}},{title:"\u5B57\u5178\u503C",dataIndex:"value"},{title:"\u5B57\u5178\u7F16\u7801",dataIndex:"code"},{title:"\u5B57\u5178\u7C7B\u578B",dataIndex:"typeName",hideInForm:!0,hideInSearch:!0},{title:"\u5B57\u5178\u7C7B\u578B",dataIndex:"typeId",hideInForm:!0,hideInTable:!0,valueEnum:O},{title:"\u5907\u6CE8",dataIndex:"remark",hideInSearch:!0},{title:"\u72B6\u6001",dataIndex:"status",hideInForm:!0,valueEnum:{0:{text:"\u6B63\u5E38",status:"Processing"},1:{text:"\u505C\u7528",status:"Success"}}},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createAt",valueType:"dateTime",hideInForm:!0,hideInSearch:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(l,n){return[(0,e.jsxs)("a",{onClick:function(){t(!0),A(n)},children:[" ","\u66F4\u65B0"]}),(0,e.jsx)(L.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){I.removeDictData([n.id]).then(function(c){c.data?(h.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"),S.current.reload()):h.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5")})},onCancel:function(){},children:(0,e.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary")]}}];return(0,e.jsxs)(K.ZP,{children:[(0,e.jsx)(J.ZP,{headerTitle:"\u5B57\u5178\u4FE1\u606F\u5217\u8868",actionRef:S,rowKey:"id",search:{labelWidth:120},toolBarRender:function(){return[(0,e.jsxs)(E.Z,{type:"primary",onClick:function(){t(!0)},children:[(0,e.jsx)(z.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var s=(0,y.Z)((0,i.Z)().mark(function l(n){var d,c;return(0,i.Z)().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return d=[],c=0,n.typeId!=null&&(n.typeId=O[n.typeId].typeId),Z.next=5,I.GetDictData(n).then(function(b){d=b.data.data,c=b.data.total});case 5:return Z.abrupt("return",{data:d,success:!0,total:c});case 6:case"end":return Z.stop()}},l)}));return function(l){return s.apply(this,arguments)}}(),columns:N,rowSelection:{onChange:function(l,n){U(n)}}}),(T==null?void 0:T.length)>0&&(0,e.jsx)(H.Z,{extra:(0,e.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,e.jsx)("a",{style:{fontWeight:600},children:T.length})," ","\u9879 \xA0\xA0"]}),children:(0,e.jsx)(E.Z,{type:"primary",onClick:(0,y.Z)((0,i.Z)().mark(function s(){var l,n;return(0,i.Z)().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,ae(T);case 2:U([]),(l=S.current)===null||l===void 0||(n=l.reloadAndRest)===null||n===void 0||n.call(l);case 4:case"end":return c.stop()}},s)})),children:"\u6279\u91CF\u5220\u9664"})}),(0,e.jsx)(_,{typeNameData:O,onFinish:function(){var s=(0,y.Z)((0,i.Z)().mark(function l(n){var d;return(0,i.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(d=!1,!n.id){o.next=7;break}return o.next=4,te(n);case 4:d=o.sent,o.next=10;break;case 7:return o.next=9,ee(n);case 9:d=o.sent;case 10:d&&(t(!1),A({}),$(void 0),S.current&&S.current.reload()),S.current.reload();case 12:case"end":return o.stop()}},l)}));return function(l){return s.apply(this,arguments)}}(),onCancel:function(){t(!1),A({})},createModalVisible:p,values:ue||{}}),(0,e.jsx)(Y.Z,{width:600,visible:ie,onClose:function(){$(void 0),G(!1)},closable:!1,children:(m==null?void 0:m.name)&&(0,e.jsx)(Q.ZP,{column:2,title:m==null?void 0:m.name,request:(0,y.Z)((0,i.Z)().mark(function s(){return(0,i.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",{data:m||{}});case 1:case"end":return n.stop()}},s)})),params:{id:m==null?void 0:m.name},columns:N})})]})},ne=re}}]);