Files
houyi-admin/dist/src__pages__manage__admin__$id__create.c79ebac7.async.js
PC-202306242200\Administrator 23dc139a31 first commit
2026-03-28 23:25:01 +08:00

2 lines
4.1 KiB
JavaScript

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[2847],{36428:function(x,h,e){var i=e(88351),d=e(87841),A=e(993),E=e(96268),M=e(93236),O=e(90040),R=e(8263),m=e(62086),o=["fieldProps","options","radioType","layout","proFieldProps","valueEnum"],T=M.forwardRef(function(n,p){var P=n.fieldProps,f=n.options,b=n.radioType,y=n.layout,j=n.proFieldProps,c=n.valueEnum,a=(0,d.Z)(n,o);return(0,m.jsx)(R.Z,(0,i.Z)((0,i.Z)({valueType:b==="button"?"radioButton":"radio",ref:p,valueEnum:(0,A.h)(c,void 0)},a),{},{fieldProps:(0,i.Z)({options:f,layout:y},P),proFieldProps:j,filedConfig:{customLightMode:!0}}))}),B=M.forwardRef(function(n,p){var P=n.fieldProps,f=n.children;return(0,m.jsx)(E.ZP,(0,i.Z)((0,i.Z)({},P),{},{ref:p,children:f}))}),u=(0,O.G)(B,{valuePropName:"checked",ignoreWidth:!0}),l=u;l.Group=T,l.Button=E.ZP.Button,l.displayName="ProFormComponent",h.Z=l},98203:function(x,h,e){e.r(h);var i=e(25359),d=e.n(i),A=e(57213),E=e.n(A),M=e(49811),O=e.n(M),R=e(54306),m=e.n(R),o=e(93236),T=e(33045),B=e(50336),u=e(40882),l=e(61786),n=e(36428),p=e(23674),P=e(18123),f=e.n(P),b=e(23653),y=e(85968),j=e(48970),c=e(90627),a=e(62086),S=c.Z.PermissionController.permissionTree,I=c.Z.ArticleController,k=I.articleCreate,G=I.articleUpdate,$=I.articleItem,q=c.Z.ArticleCategoryController.articleCategoryItems,W=c.Z.AdminController,N=W.adminCreate,ee=W.adminUpdate;h.default=function(){var V=(0,o.useState)([]),L=m()(V,2),C=L[0],z=L[1];(0,o.useEffect)(function(){S().then(function(r){var _=r.data;z(_)})},[]);var H=(0,p.useParams)(),g=(0,o.useRef)(),_e=(0,o.useRef)(),K={id:"",cid:1,is_up:1,title:"",cover:"",video:"",note:null},J=(0,o.useState)(K),F=m()(J,2),Q=F[0],U=F[1],X=(0,o.useState)(""),Z=m()(X,2),ae=Z[0],ne=Z[1],te={toolbar:[["bold","italic","underline","strike"],["blockquote","code-block"],["link","image"],[{header:1},{header:2}],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{direction:"rtl"}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["clean"]]};(0,o.useEffect)(function(){$(H).then(function(r){var _=r.data;_&&U(_)})},[]);var Y=function(){var r=O()(d()().mark(function _(s){var v,D;return d()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return console.log(s),U(s),t.next=4,N(E()({},s));case 4:v=t.sent,D=v.success,D&&(U(K),history.back());case 7:case"end":return t.stop()}},_)}));return function(s){return r.apply(this,arguments)}}(),re=function(){var r=O()(d()().mark(function _(s){var v,D;return d()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,G(E()({},s));case 2:v=t.sent,D=v.success;case 5:case"end":return t.stop()}},_)}));return function(s){return r.apply(this,arguments)}}();return(0,a.jsx)(B._z,{header:{title:"\u7BA1\u7406\u5458\u6DFB\u52A0"},ghost:!0,children:(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(u.A,{initialValues:Q,formRef:g,onFinish:function(_){Y(_)},children:[(0,a.jsxs)(u.A.Group,{children:[(0,a.jsx)(l.Z,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}],width:"md",name:"mobile",label:"\u624B\u673A\u53F7",placeholder:"\u8BF7\u8F93\u5165"}),(0,a.jsx)(l.Z.Password,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}],width:"md",name:"password",label:"\u5BC6\u7801",placeholder:"\u8BF7\u8F93\u5165"})]}),(0,a.jsxs)(u.A.Group,{children:[(0,a.jsx)(l.Z,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}],width:"md",name:"nickname",label:"\u6635\u79F0",placeholder:"\u8BF7\u8F93\u5165"}),(0,a.jsx)(u.A.Item,{label:"\u5934\u50CF",name:"avatar",children:(0,a.jsx)(j.Z,{fileType:"image",defaultValue:"",count:1,mode:""})})]}),(0,a.jsx)(n.Z.Group,{name:"status",radioType:"button",label:"\u72B6\u6001",options:[{label:"\u6B63\u5E38",value:0},{label:"\u51BB\u7ED3",value:1},{label:"\u7981\u7528",value:2}]}),(0,a.jsx)(u.A.Item,{label:"\u8BBE\u7F6E\u6743\u9650",name:"permission_ids",children:(C==null?void 0:C.length)>0&&(0,a.jsx)(T.Z,{checkable:!0,multiple:!0,showLine:!0,showIcon:!1,defaultExpandAll:!0,name:"permission_ids",onCheck:function(_){console.log(_),g.current.setFieldsValue({permission_ids:_})},onSelect:function(_,s){console.log(_),console.log(s)},fieldNames:{title:"name",key:"id"},treeData:C})})]})})})}}}]);