|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[29601],{23717:function(e,n,t){t.d(n,{Z:function(){return s}});var i=t(1565),r=t(59301),l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},a=t(99194),o=function(e,n){return r.createElement(a.Z,(0,i.Z)({},e,{ref:n,icon:l}))};var s=r.forwardRef(o)},33051:function(e,n,t){t.d(n,{Z:function(){return w}});var i=t(7557),r=t.n(i),l=t(41498),a=t.n(l),o=t(79800),s=t.n(o),d=t(59301),c=t(78241),u=t(8591),f=t(43418),m=t(8772),p=t(5112),x=t(21068),_={flex_box_center:"flex_box_center___ze4wf",flex_space_between:"flex_space_between___JpH0B",flex_box_vertical_center:"flex_box_vertical_center___NbRyF",flex_box_center_end:"flex_box_center_end___fUFoB",flex_box_column:"flex_box_column___i2BZL",form:"form____yVeV",btn:"btn___X16NC",img:"img___sQnKq"},h=t(14661),g=t(27065),v=t(70481),b=t(37712),w=function(e){var n,t,i=e.visible,l=e.onOk,o=e.onCancel,w=e.title,j=void 0===w?"":w,y=c.Z.useForm(),$=s()(y,1)[0],Z=(0,d.useState)(!1),z=s()(Z,2),S=z[0],N=z[1],k=(0,d.useState)([]),C=s()(k,2),I=C[0],P=C[1],O=(0,d.useState)([]),B=s()(O,2),E=B[0],M=B[1],L=(0,d.useState)(!1),V=s()(L,2),R=V[0],H=V[1];(0,d.useEffect)((function(){if(null!=i&&i.name){var e,n,t,r;$.setFieldsValue({name:null==i?void 0:i.name});var l=null!=i&&null!==(e=i.cover_url)&&void 0!==e&&e.includes("attachments")?[{response:{id:null==i||null===(n=i.cover_url)||void 0===n?void 0:n.split("/")[3]}}]:[],a=null!=i&&null!==(t=i.backbground_image_url)&&void 0!==t&&t.includes("attachments")?[{response:{id:null==i||null===(r=i.backbground_image_url)||void 0===r?void 0:r.split("/")[3]}}]:[];P(l),M(a)}}),[i]);var W=function(){var e=a()(r()().mark((function e(n){var t,i,a;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:N(!0),console.log(I,E,3333),a={name:null==n?void 0:n.name,vs_type:null==n?void 0:n.vs_type,identifier:null==n?void 0:n.identifier,cover_id:(null==I||null===(t=I[0])||void 0===t||null===(t=t.response)||void 0===t?void 0:t.id)||"",backbground_image_id:(null==E||null===(i=E[0])||void 0===i||null===(i=i.response)||void 0===i?void 0:i.id)||""},l(a,(function(e){-3===(null==e?void 0:e.status)&&$.setFields([{name:"identifier",errors:["该标识已存在,请更换"]}]),N(!1)}));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),G=function(e,n){["uploading","done","removed"].includes(e.file.status)&&("uploading"===e.file.status&&H(!0),"done"===e.file.status&&H(!1),1===n?P(e.fileList):M(e.fileList))},T=function(e,n){1===n?P([]):M([])},A=function(e,n){if(!("image/jpeg"===e.type||"image/png"===e.type))return u.ZP.warning("请上传jpg或png的图片!"),!1;var t=e.size/1024>200,i=e.size/1024/1024>1;return t&&1===n?(u.ZP.warning("文件大小必须小于200KB"),!1):i&&2===n?(u.ZP.warning("文件大小必须小于1MB"),!1):(1===n?P([]):M([]),!0)},F=function(e){var n,t;return(0,b.jsxs)("div",{className:_.img,children:[(0,b.jsx)("img",{src:g.Z.API_SERVER+"/api/attachments/"+(1===e?null==I||null===(n=I[0])||void 0===n||null===(n=n.response)||void 0===n?void 0:n.id:null==E||null===(t=E[0])||void 0===t||null===(t=t.response)||void 0===t?void 0:t.id),alt:"avatar",style:{width:"100%"}}),(0,b.jsx)("div",{children:(0,b.jsx)(v.Z,{onClick:function(){1===e?P([]):M([])},style:{fontSize:"16px",color:"red"}})})]})};return(0,b.jsx)(f.Z,{title:j,open:i,onOk:function(){$.submit()},centered:!0,onCancel:function(){o()},confirmLoading:S,okButtonProps:{disabled:R},width:694,afterClose:function(){N(!1),P([]),M([]),$.resetFields()},okText:null!=i&&i.name?"确认":"确认新建",cancelText:"取消",wrapClassName:h.Z.CustomCss,children:(0,b.jsxs)(c.Z,{form:$,colon:!1,onFinish:W,className:_.form,children:[(0,b.jsx)(c.Z.Item,{label:"社区名称",name:"name",rules:[{required:!0,message:"请输入社区名称"},{whitespace:!0,message:"请输入社区名称"},{max:60,message:"只能输入60个字符"}],children:(0,b.jsx)(m.Z,{maxLength:60,placeholder:"请输入社区名称"})}),(0,b.jsx)(c.Z.Item,{label:"社区类型",initialValue:"classroom",name:"vs_type",rules:[{required:!0,message:"请输入社区类型"}],children:(0,b.jsxs)(p.ZP.Group,{children:[(0,b.jsx)(p.ZP,{value:"classroom",children:"虚拟教研室"}),(0,b.jsx)(p.ZP,{className:"ml20",value:"plan",children:"101计划"})]})}),(0,b.jsx)(c.Z.Item,{label:(0,b.jsx)("span",{style:{width:66},children:"标识"}),name:"identifier",rules:[{pattern:/^[a-zA-Z0-9]+$/,message:"仅支持填写英文和数字"}],children:(0,b.jsx)(m.Z,{maxLength:15})}),(0,b.jsxs)("div",{style:{marginLeft:78},children:[(0,b.jsx)("div",{className:"14px c-grey-999",children:"用于单独标识虚拟社区,在链接中体现,如:www.educoder.net/vtrs/+标识"}),(0,b.jsxs)("div",{className:"14px c-grey-333",children:["注意:",(0,b.jsx)("br",{}),"1、标识不可重复",(0,b.jsx)("br",{}),"2、仅支持填写英文和数字",(0,b.jsx)("br",{}),"3、不超过15个字符",(0,b.jsx)("br",{}),"4、未填写时,系统自动生成独立标识"]})]}),(0,b.jsx)(c.Z.Item,{name:"cover_id",label:"上传封面图",valuePropName:"fileList",className:"mt30",children:(0,b.jsx)("div",{className:_.upload,children:null!=I&&null!==(n=I[0])&&void 0!==n&&null!==(n=n.response)&&void 0!==n&&n.id?F(1):(0,b.jsx)(x.Z,{fileList:I,action:"".concat(g.Z.API_SERVER,"/api/attachments.json"),onChange:function(e){return G(e,1)},onRemove:function(e){return T(0,1)},beforeUpload:function(e){return A(e,1)},withCredentials:!0,accept:"image/*",children:(0,b.jsxs)("div",{className:_.btn,children:[(0,b.jsx)("i",{className:"iconfont icon-shangchuantupian2"}),"上传图片"]})})})}),(0,b.jsx)("aside",{children:"仅支持上传jpg/png格式文件,文件大小不能超过200KB,建议使用282*228像素;如不上传,默认使用系统图片。"}),(0,b.jsx)(c.Z.Item,{name:"backbground_image_id",label:"详情顶部背景",valuePropName:"fileList",className:"mt30",children:(0,b.jsx)("div",{className:_.upload,children:null!=E&&null!==(t=E[0])&&void 0!==t&&null!==(t=t.response)&&void 0!==t&&t.id?F(2):(0,b.jsx)(x.Z,{fileList:E,action:"".concat(g.Z.API_SERVER,"/api/attachments.json"),onChange:function(e){return G(e,2)},onRemove:function(e){return T(0,2)},beforeUpload:function(e){return A(e,2)},withCredentials:!0,accept:"image/*",children:(0,b.jsxs)("div",{className:_.btn,children:[(0,b.jsx)("i",{className:"iconfont icon-shangchuantupian2"}),"上传图片"]})})})}),(0,b.jsx)("aside",{children:"仅支持上传jpg/png格式文件,文件大小不能超过1MB,建议使用3840*148像素;如不上传,默认使用系统图片。"})]})})}},14661:function(e,n){n.Z={flex_box_center:"flex_box_center___vG4eV",flex_space_between:"flex_space_between___qVVxe",flex_box_vertical_center:"flex_box_vertical_center___P8Z8s",flex_box_center_end:"flex_box_center_end___VMme3",flex_box_column:"flex_box_column___VMHwm",dropdownmenus:"dropdownmenus___oVzoj",popupClassNames:"popupClassNames___OcZq7",selectdown:"selectdown___mmcA8"}},28103:function(e,n,t){t.d(n,{Z:function(){return m}});var i=t(92310),r=t.n(i),l=t(59301),a=t(36355),o=t(17313),s=t(83116),d=t(37613);const c=e=>{const{componentCls:n,sizePaddingEdgeHorizontal:t,colorSplit:i,lineWidth:r,textPaddingInline:l,orientationMargin:a,verticalMarginInline:s}=e;return{[n]:Object.assign(Object.assign({},(0,o.Wf)(e)),{borderBlockStart:`${r}px solid ${i}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:s,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${r}px solid ${i}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${e.dividerHorizontalGutterMargin}px 0`},[`&-horizontal${n}-with-text`]:{display:"flex",alignItems:"center",margin:`${e.dividerHorizontalWithTextGutterMargin}px 0`,color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${i}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${r}px solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${n}-with-text-left`]:{"&::before":{width:100*a+"%"},"&::after":{width:100-100*a+"%"}},[`&-horizontal${n}-with-text-right`]:{"&::before":{width:100-100*a+"%"},"&::after":{width:100*a+"%"}},[`${n}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:l},"&-dashed":{background:"none",borderColor:i,borderStyle:"dashed",borderWidth:`${r}px 0 0`},[`&-horizontal${n}-with-text${n}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${n}-dashed`]:{borderInlineStartWidth:r,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${n}-with-text`]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},[`&-horizontal${n}-with-text-left${n}-no-default-orientation-margin-left`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${n}-inner-text`]:{paddingInlineStart:t}},[`&-horizontal${n}-with-text-right${n}-no-default-orientation-margin-right`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${n}-inner-text`]:{paddingInlineEnd:t}}})}};var u=(0,s.Z)("Divider",(e=>{const n=(0,d.TS)(e,{dividerHorizontalWithTextGutterMargin:e.margin,dividerHorizontalGutterMargin:e.marginLG,sizePaddingEdgeHorizontal:0});return[c(n)]}),(e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}))),f=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)n.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(t[i[r]]=e[i[r]])}return t};var m=e=>{const{getPrefixCls:n,direction:t,divider:i}=l.useContext(a.E_),{prefixCls:o,type:s="horizontal",orientation:d="center",orientationMargin:c,className:m,rootClassName:p,children:x,dashed:_,plain:h,style:g}=e,v=f(e,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),b=n("divider",o),[w,j]=u(b),y=d.length>0?`-${d}`:d,$=!!x,Z="left"===d&&null!=c,z="right"===d&&null!=c,S=r()(b,null==i?void 0:i.className,j,`${b}-${s}`,{[`${b}-with-text`]:$,[`${b}-with-text${y}`]:$,[`${b}-dashed`]:!!_,[`${b}-plain`]:!!h,[`${b}-rtl`]:"rtl"===t,[`${b}-no-default-orientation-margin-left`]:Z,[`${b}-no-default-orientation-margin-right`]:z},m,p),N=l.useMemo((()=>"number"==typeof c?c:/^\d+$/.test(c)?Number(c):c),[c]),k=Object.assign(Object.assign({},Z&&{marginLeft:N}),z&&{marginRight:N});return w(l.createElement("div",Object.assign({className:S,style:Object.assign(Object.assign({},null==i?void 0:i.style),g)},v,{role:"separator"}),x&&"vertical"!==s&&l.createElement("span",{className:`${b}-inner-text`,style:k},x)))}}}]); |