|
|
(this.webpackJsonp=this.webpackJsonp||[]).push([[77,197],{"33l4":function(t,e,n){"use strict";n.d(e,"a",(function(){return w}));var a=n("xwgP"),r=n.n(a),o=n("sYIF"),i=(n("pb8e"),n("ex8r"),n("NTv2"));function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function l(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){g(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function u(t,e){for(var n=0;n<e.length;n++){var a=e[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function f(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=d(t);if(e){var r=d(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return h(this,n)}}function h(t,e){return!e||"object"!==c(e)&&"function"!=typeof e?m(t):e}function m(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function g(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n("2XVP");var y=window.$;function b(t,e,n){window.sessionStorage.removeItem(t+e);var a="#e_tip_"+n;"content"==t?y("#e_tips_"+n).html(" "):y(a).html(" ")}function v(t,e,n){if(window.sessionStorage){var a=window.sessionStorage.getItem("content"+e);if(null!==a&&a!=t.getValue()){console.log("#e_tips_"+n),y("#e_tips_"+n).data("editor",t);var r='您上次有已保存的数据,是否<a style="cursor: pointer;" class="link-color-blue" onclick="md_rec_data(\'content\',\''+e+"','"+n+'\')">恢复</a> ? / <a style="cursor: pointer;" class="link-color-blue" onclick="md_clear_data(\'content\',\''+e+"','"+n+"')\">不恢复</a>";y("#e_tips_"+n).html(r)}setInterval((function(){var a=new Date,r=a.getHours(),o=a.getMinutes(),i=a.getSeconds();if(r=r<10?"0"+r:r,o=o<10?"0"+o:o,i=i<10?"0"+i:i,""!=t.getValue().trim()){!function(t,e,n){window.sessionStorage.setItem(t+e,n)}("content",e,t.getValue());var c="#e_tips_"+n,s=" 数据已于 "+r+":"+o+":"+i+" 保存 ",l=y(c).html();l&&" "!=l&&0==l.startsWith(" 数据已于 ")?y(c).html(l.split(" (")[0]+" (".concat(s,")")):y(c).html(s)}}),1e4)}else y("#e_tip_"+n).after("您的浏览器不支持localStorage.无法开启自动保存草稿服务,请升级浏览器!")}window.md_clear_data=b,window.md_rec_data=function(t,e,n){null!==window.sessionStorage.getItem(t+e)&&(y("#e_tips_"+n).data("editor").setValue(window.sessionStorage.getItem(t+e)),b(t,e,n))};var w=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&p(t,e)}(s,t);var e,n,a,c=f(s);function s(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),g(m(e=c.call(this,t)),"componentDidMount",(function(){var t=e.props,n=t.mdID,a=t.initValue,r=t.placeholder,c=(t.showNullButton,"mdEditor_".concat(n));e.contentChanged=!1;var s=r||"",l="".concat(Object(o.H)()),u="react_".concat(c);window[u]=m(e);!function(t,e,n,a,r,i,c,s,l,u,p){var f=u.noStorage,h=void 0!==f&&f,m=(u.showNullButton,u.emoji);window.editormd(t,{width:e,height:void 0===n?400:n,path:Object(o.L)("/editormd/lib/"),markdown:c,dialogLockScreen:!1,watch:void 0===l||l,syncScrolling:"single",tex:!0,tocm:!0,emoji:!!m,taskList:!0,codeFold:!0,searchReplace:!0,htmlDecode:"style,script,iframe",sequenceDiagram:!0,autoFocus:!1,toolbarIcons:function(){var e="react_".concat(t),n=["bold","italic","|","list-ul","list-ol","|","code","code-block","link","|","testIcon","testIcon1","|","image","table","|","line-break","watch","clear"];return window[e].props.showNullButton&&n.push("nullBtton"),n},toolbarIconsClass:{"line-break":"fa-minus"},toolbarHandlers:{"line-break":function(t,e,n,a){t.replaceSelection("<hr/>")}},lang:{toolbar:{"line-break":"换行"}},toolbarCustomIcons:{testIcon:"<a type=\"inline\" class=\"latex\" ><i name='inline-latex' class='fa iconfont icon-hangneigongshi font-14'></i></a>",testIcon1:"<a type=\"latex\" class=\"latex\" ><i name='latex' class='fa iconfont icon-duohanggongshi font-16'></i></a>",nullBtton:"<a type=\"nullBtton\" class='pr' title='增加填空'><div class='border-left'><span></span></div><span class='fillTip'>点击插入填空项</span><i class=\"iconfont icon-edit font-16\"></i></a>"},saveHTMLToTextarea:!0,dialogMaskOpacity:.6,placeholder:a,imageUpload:!0,imageFormats:["jpg","jpeg","gif","png","bmp","webp","JPG","JPEG","GIF","PNG","BMP","WEBP"],imageUploadURL:r,onload:function(){var t=this.id,e=this,n="react_".concat(e.id),a=window[n];if(y("#"+t+' [type="latex"]').bind("click",(function(){e.cm.replaceSelection("```latex"),e.cm.replaceSelection("\n"),e.cm.replaceSelection("\n"),e.cm.replaceSelection("```");var t=e.cm.getDoc().getCursor();e.cm.setCursor(t.line-1,0)})),y("#"+t+' [type="inline"]').bind("click",(function(){e.cm.replaceSelection("$$$$");var t=e.cm.getDoc().getCursor();e.cm.setCursor(t.line,t.ch-2),e.cm.focus()})),y('[type="inline"]').attr("title","行内公式"),y('[type="latex"]').attr("title","多行公式"),a.props.showNullButton){y("#"+t+' [type="nullBtton"]').bind("click",(function(){e.cm.replaceSelection("▁")}))}1==!h&&v(e,"MDEditor__".concat(t),t),i&&i(e)}})}(c,"100%",e.props.height,s,l,(function(t){var n=t;u="react_".concat(n.id);var a=window[u];setTimeout((function(){1==a.props.needRecreate?n.recreate():n.resize(),n.cm&&n.cm.refresh()}),a.props.refreshTimeout||500),e.props.noSetValueOnInit?a.onEditorChange():(null!=a.props.initValue&&""!=a.props.initValue&&n.setValue(a.props.initValue),a.state.initValue&&n.setValue(a.state.initValue)),n.cm.on("change",(function(t,e){a.contentChanged=!0,a.state.showError&&a.setState({showError:!1}),a.onEditorChange()})),a.props.onCMBlur&&n.cm.on("blur",(function(){a.props.onCMBlur()})),a.props.onCMBeforeChange&&n.cm.on("beforeChange",(function(t,e){a.props.onCMBeforeChange(t,e)})),a.answers_editormd=n,i.a.publish("markdown-editor-loaded"),window[n.id+"_"]=n}),a,e.onEditorChange,e.props.watch,{noStorage:e.props.noStorage,showNullButton:e.props.showNullButton,emoji:e.props.emoji},m(e))})),g(m(e),"showError",(function(){e.setState({showError:!0})})),g(m(e),"onEditorChange",(function(){if(e.answers_editormd){var t=e.answers_editormd.getValue();try{e.props.onChange&&e.props.onChange(t)}catch(t){console.error("出错"),console.error(t)}}})),g(m(e),"resize",(function(){e.answers_editormd&&(e.answers_editormd.resize(),e.answers_editormd.cm&&e.answers_editormd.cm.refresh(),e.answers_editormd.cm.focus())})),g(m(e),"getValue",(function(){try{return e.answers_editormd.getValue()}catch(t){return""}})),g(m(e),"setValue",(function(t){try{e.answers_editormd.setValue(t)}catch(n){e.setState({initValue:t})}})),e.state={initValue:""},e}return e=s,(n=[{key:"render",value:function(){var t=this.state.showError,e=this.props,n=e.mdID,a=e.className,o=e.noStorage,i=e.imageExpand,c={};return t&&(c.border="1px solid red"),r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"df ".concat(a," ").concat(i&&"editormd-image-click-expand")},r.a.createElement("div",{className:"edu-back-greyf5 radius4",id:"mdEditor_".concat(n),style:l({},c)},r.a.createElement("textarea",{style:{display:"none"},id:"mdEditors_".concat(n),name:"content"}),r.a.createElement("div",{className:"CodeMirror cm-s-defualt"}))),r.a.createElement("div",{className:"fr rememberTip"},1==o?" ":r.a.createElement("div",{id:"e_tips_mdEditor_".concat(n),className:"edu-txt-right color-grey-cd font-12"}," ")))}}])&&u(e.prototype,n),a&&u(e,a),s}(a.Component)},NTv2:function(t,e,n){"use strict";var a=new function(t){var e={},n={subscribe:function(t,n){return e[t]||(e[t]=[]),e[t].push(n),this.unsubscribe.bind(null,t,n)},unsubscribe:function(t,n){var a=e[t],r=-1;if(a){for(var o=0;o<a.length;o++)if(a[o].name===n.name){r=o;break}if(r>=0)return e[t].splice(r,1),!0}return!1},publish:function(t){if(!e[t])return!1;var n=Array.prototype.slice.call(arguments,1);return e[t].forEach((function(t){t.apply(null,n)})),this}};return t?Object.assign(t,n):n};e.a=a},QNIM:function(t,e,n){"use strict";n.r(e);n("N452");var a=n("Wyac"),r=(n("qb5G"),n("wLbl")),o=(n("ZuIQ"),n("DbVt")),i=(n("R/VY"),n("ZzqE")),c=(n("bqBU"),n("4OHk")),s=(n("7fbo"),n("LCR/")),l=(n("Y5Ue"),n("xc0u")),u=(n("mvry"),n("2L3m")),p=(n("bjE3"),n("wty1")),f=(n("rJH4"),n("nKmx")),h=n("xwgP"),m=n.n(h),d=n("91MD"),g=n.n(d),y=n("sYIF"),b=n("5A3O"),v=n("1thW"),w=(n("6rnn"),n("d6B9")),k=n("33l4");function E(t){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _(t,e){for(var n=0;n<e.length;n++){var a=e[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function x(t,e){return(x=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function O(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=j(t);if(e){var r=j(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return S(this,n)}}function S(t,e){return!e||"object"!==E(e)&&"function"!=typeof e?N(t):e}function N(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function j(t){return(j=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function C(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var P=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&x(t,e)}(o,t);var e,n,a,r=O(o);function o(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),C(N(e=r.call(this,t)),"componentDidUpdate",(function(t){})),C(N(e),"changeTitle",(function(t){e.setState({title_num:t.target.value.length,title_value:t.target.value})})),C(N(e),"handleSubmit",(function(){var t=e.state.title_value,n=e.contentMdRef.current.getValue().trim();g.a.post("/osshackathon/update_hackathon.json",{name:t,description:n}).then((function(t){0===t.data.status&&(e.props.getosshackathon(),e.props.hidehackathonedit(),e.props.showNotification("提交成功"))})).catch((function(t){console.log(t)}))})),e.contentMdRef=m.a.createRef(),e.state={title_num:0,title_value:void 0},e}return e=o,(n=[{key:"componentDidMount",value:function(){var t=this;g.a.get("/osshackathon/edit_hackathon.json").then((function(e){200==e.status&&(t.setState({title_value:e.data.name}),t.contentMdRef.current.setValue(null===e.data.description?"":e.data.description))}))}},{key:"render",value:function(){var t=this;return m.a.createElement("div",{className:"mt20"},m.a.createElement(w.a,null,m.a.createElement(w.a.Item,{label:"标题"},m.a.createElement(f.a,{placeholder:"请输入标题",value:this.state.title_value,onInput:this.changeTitle,className:"searchView searchViewAfter h45input",style:{width:"100%"},maxLength:"60",addonAfter:String(void 0===this.state.title_value||null===this.state.title_value?0:this.state.title_value.length)+"/60"})),m.a.createElement(w.a.Item,{label:"描述"},m.a.createElement(k.a,{ref:this.contentMdRef,placeholder:"请输入描述",mdID:"courseContentMD",refreshTimeout:1500,className:"courseMessageMD",initValue:null===this.state.description?"":this.state.description}))),m.a.createElement("div",{className:"clearfix mt30 mb30"},m.a.createElement("div",{className:"fr"},m.a.createElement(l.a,{type:"primary",onClick:this.handleSubmit,className:"defalutSubmitbtn fl mr20"},"提交"),m.a.createElement("a",{className:"defalutCancelbtn fl",onClick:function(){return t.props.hidehackathonedit()}},"取消"))))}}])&&_(e.prototype,n),a&&_(e,a),o}(h.Component),T=(n("ZmnP"),n("U4At"),n("KiF4"));function I(t){return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function R(t,e){for(var n=0;n<e.length;n++){var a=e[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function B(t,e){return(B=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function M(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=A(t);if(e){var r=A(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return D(this,n)}}function D(t,e){return!e||"object"!==I(e)&&"function"!=typeof e?V(t):e}function V(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function A(t){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function H(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var L=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&B(t,e)}(o,t);var e,n,a,r=M(o);function o(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),H(V(e=r.call(this,t)),"componentDidUpdate",(function(t){})),H(V(e),"handleSubmit",(function(){var t=e.state,n=t.title_value,a=t.Textarea_comment;if(void 0===e.props.modelid){g.a.post("/osshackathon.json",{name:n,description:a}).then((function(t){0===t.data.status&&(e.props.getosshackathon(),e.props.hideeditSignupentry(),e.props.showNotification("提交成功"))})).catch((function(t){console.log(t)}))}else{var r="/osshackathon/".concat(e.props.modelid,".json");g.a.put(r,{name:n,description:a}).then((function(t){0===t.data.status&&(e.props.getosshackathon(),e.props.hideeditSignupentry(),e.props.showNotification("提交成功"))})).catch((function(t){console.log(t)}))}})),H(V(e),"changeTitle",(function(t){e.setState({title_value:t.target.value,title_num:t.target.value.length})})),H(V(e),"Textarea_comment",(function(t){e.setState({Textarea_comment:t.target.value})})),e.state={title_num:0,title_value:void 0,Textarea_comment:void 0},e}return e=o,(n=[{key:"componentDidMount",value:function(){var t=this;if(void 0===this.props.modelid)this.setState({title_value:void 0,Textarea_comment:void 0});else{var e="/osshackathon/".concat(this.props.modelid,"/edit.json");g.a.get(e).then((function(e){200==e.status&&t.setState({title_value:e.data.name,Textarea_comment:e.data.description})}))}}},{key:"render",value:function(){var t=this,e=this.state.textareavaltype;return m.a.createElement("div",null,m.a.createElement("style",null,"\n\t\t\t\t\t\t\t\t@media (max-width: 2000px) {\n\t\t\t\t\t\t\t\t\t\t\t.WordNumberTextarea{\n\t\t\t\t\t\t\t\t\t\t\t height: 130px !important;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t @media (max-width: 1350px) {\n\t\t\t\t\t\t\t\t\t\t.HomeworkModal{\n \t\t\t\t\t\t\t\t\t\t top:10px !important;\n \t\t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t\t\t.WordNumberTextarea{\n\t\t\t\t\t\t\t\t\t\t\t height: 80px !important;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t \t\t\t\t\t\t\t\t@media (max-width: 1250px) {\n \t\t\t\t\t\t\t\t\t\t.HomeworkModal{\n \t\t\t\t\t\t\t\t\t\t top:0px !important;\n \t\t\t\t\t\t\t\t\t\t}\n\n \t\t\t\t\t\t\t\t\t\t.WordNumberTextarea{\n\t\t\t\t\t\t\t\t\t\t\t height: 40px !important;\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t"),m.a.createElement(T.a,{keyboard:!1,className:"HomeworkModal",title:void 0===this.props.modelid?"新建项目":"编辑项目",visible:this.props.Osshackathonmodeltype,closable:!1,footer:null,destroyOnClose:!0},m.a.createElement("div",{className:"pd015"},m.a.createElement("style",null,"\n\t\t\t\t\t\t\t\t.pd015{\n\t\t\t\t\t\t\t\t padding: 0px 15px 15px 15px;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.font{\n\t\t\t\t\t\t\t\t\tfont-size: 14px;\n\t\t\t\t\t\t\t\t\tfont-weight: 400;\n\t\t\t\t\t\t\t\t\tcolor: rgba(5,16,26,1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.newfont{\n\t\t\t\t\t\t\t\t height: 16px;\n\t\t\t\t\t\t\t\t\t\tfont-size: 16px;\n\t\t\t\t\t\t\t\t\t\tfont-weight: 400;\n\t\t\t\t\t\t\t\t\t\tcolor: rgba(5,16,26,1);\n\t\t\t\t\t\t\t\t\t\tline-height: 16px;\n\t\t\t\t\t\t\t\t\t\tmargin-bottom: 5px;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.Osshackathonmodelinput .ant-input, .ant-input .ant-input-suffix{\n\t\t\t\t\t\t\t\t\t\tbackground: #fff !important;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.Osshackathonmodelinput .ant-input-group-wrapper{\n\t\t\t\t\t\t\t\t width:510px !important;\n \t\t\t\t\t\t\t\t margin-left: 10px;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t"),m.a.createElement("div",{className:"clearfix"},m.a.createElement("p",{className:"font mt10 mb10 ml10"},"名称"),m.a.createElement(f.a,{placeholder:"请输入项目名称",value:this.state.title_value,onInput:function(e){return t.changeTitle(e)},className:"Osshackathonmodelinput",style:{width:"100%"},maxLength:"60",addonAfter:String(void 0===this.state.title_value||null===this.state.title_value?0:this.state.title_value.length)+"/60"}),m.a.createElement("p",{className:"font mt10 mb10 ml10"},"描述"),m.a.createElement(y.o,{placeholder:"请输入项目描述",onInput:function(e){return t.Textarea_comment(e)},value:this.state.Textarea_comment,maxlength:250}),m.a.createElement("li",{style:{height:"20px",lineHeight:"20px"},className:!0===e?"color-red mt20 mb10":"none"},m.a.createElement("span",null,"评阅内容至少有一个不为空"))),m.a.createElement("div",{className:!1===e?"mt20 clearfix edu-txt-center":"clearfix edu-txt-center mt20"},m.a.createElement("a",{className:"task-btn color-white mr30",onClick:function(){return t.props.hideeditSignupentry()}},"取消"),m.a.createElement("a",{className:"task-btn task-btn-orange",onClick:function(){return t.handleSubmit()}},"确定")))))}}])&&R(e.prototype,n),a&&R(e,a),o}(h.Component),F=n("bjH3");function U(t){return(U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function z(){return(z=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t}).apply(this,arguments)}function $(t,e){for(var n=0;n<e.length;n++){var a=e[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function W(t,e){return(W=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function J(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=Y(t);if(e){var r=Y(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return G(this,n)}}function G(t,e){return!e||"object"!==U(e)&&"function"!=typeof e?q(t):e}function q(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Y(t){return(Y=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Z(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var K=f.a.Search,Q=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&W(t,e)}(d,t);var e,n,f,h=J(d);function d(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,d),Z(q(e=h.call(this,t)),"getosshackathon",(function(t,n,a){e.setState({spinning:!0});g.a.get("/osshackathon.json",{params:{page:t,limit:n,search:a}}).then((function(t){200==t.status?e.setState({data:t.data,spinning:!1}):e.setState({spinning:!1})})).catch((function(t){e.setState({spinning:!0})}))})),Z(q(e),"getosshackathonlist",(function(){var t=e.state,n=(t.page,t.limit);t.search;e.setState({page:1,search:void 0}),e.getosshackathon(1,n,void 0)})),Z(q(e),"componentDidUpdate",(function(t,n){if(n.data!=e.state.data){var a=document.getElementById("Osshackathonfontlists");a&&e.setState({boxoffsetHeigh:a.offsetHeight})}})),Z(q(e),"PaginationTask",(function(t){if(!0===e.state.hackathonedit)e.props.showNotification("请先保存或者关闭编辑状态");else{e.setState({page:t});var n=e.state,a=(n.page,n.limit),r=n.search;e.getosshackathon(t,a,r)}})),Z(q(e),"hackathonedit",(function(t){e.setState({hackathonedit:!0})})),Z(q(e),"hidehackathonedit",(function(){e.setState({hackathonedit:!1})})),Z(q(e),"Signupentry",(function(t){!1!==e.props.checkIfLogin()?!1!==e.props.checkIfProfileCompleted()?null!==e.props.user.email||null!==e.props.user.phone?e.props.confirm({content:"是否确认报名?",onOk:function(){e.Signupentrys(t)}}):e.props.showhideAccountPhoneemailDialog():e.props.showProfileCompleteDialog():e.props.showLoginDialog()})),Z(q(e),"Signupentrys",(function(t){var n="/osshackathon/".concat(t,"/entry.json");g.a.post(n).then((function(t){0===t.data.status&&(e.getosshackathonlist(),e.props.showNotification("报名成功,预祝您夺得桂冠"))})).catch((function(t){console.log(t)}))})),Z(q(e),"editSignupentry",(function(t,n,a){!0===e.state.hackathonedit?e.props.showNotification("请先保存或者关闭编辑状态"):(e.setState({Osshackathonmodeltype:!0}),void 0===t?e.setState({modelid:void 0,modelname:void 0,modeldescription:void 0}):e.setState({modelid:t,modelname:n,modeldescription:a}))})),Z(q(e),"hideeditSignupentry",(function(t){e.setState({Osshackathonmodeltype:!1})})),Z(q(e),"delSignupentry",(function(t){!0===e.state.hackathonedit?e.props.showNotification("请先保存或者关闭编辑状态"):e.props.confirm({content:"是否确认删除该项目?",onOk:function(){e.delSignupentrys(t)}})})),Z(q(e),"delSignupentrys",(function(t){var n="/osshackathon/".concat(t,".json");g.a.delete(n).then((function(t){0==t.data.status&&(e.getosshackathonlist(),e.props.showNotification("删除成功"))})).catch((function(t){console.log(t)}))})),Z(q(e),"onsearchvalue",(function(t){if(!0===e.state.hackathonedit)e.props.showNotification("请先保存或者关闭编辑状态");else{e.setState({search:t}),t.length>300&&e.props.showNotification("搜索字数大于300个字");var n=e.state,a=n.page,r=n.limit;n.search;e.getosshackathon(a,r,t)}})),Z(q(e),"onsetsearchvalue",(function(t){e.setState({search:t.target.value})})),Z(q(e),"opentitle",(function(){e.setState({opentitletype:!1})})),e.state={page:1,limit:10,search:void 0,data:void 0,hackathonedit:!1,Osshackathonmodeltype:!1,spinning:!1,opentitletype:!0,boxoffsetHeigh:0},e}return e=d,(n=[{key:"componentDidMount",value:function(){this.getosshackathonlist(),window.document.title="竞赛报名"}},{key:"render",value:function(){var t=this,e=this.state,n=e.page,f=e.data,h=e.hackathonedit,d=e.opentitletype;return m.a.createElement("div",{className:"newMain clearfix newMainybot"},m.a.createElement("style",null,"\n\t\t\t\t\t\t.ant-btn-primary{\n\t\t\t\t\t\t\tbackground: #4CACFF;\n\t\t\t\t\t\t\tborder-color: #4CACFF;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t.ant-btn-primary:hover, .ant-btn-primary:focus {\n\t\t\t\t\t\t\t\tcolor: #4CACFF;\n\t\t\t\t\t\t\t\tbackground-color: #40a9ff;\n\t\t\t\t\t\t\t\tborder-color: #40a9ff;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t"),m.a.createElement("div",{className:"educontent mb60 persmstyle",style:{width:"1200px",marginTop:"26px"}},m.a.createElement("div",{className:"registrationback",style:{background:"url(".concat(Object(y.C)("images/educoder/competitions/heikesong.jpg"),")"),height:"360px"}}),m.a.createElement(a.a,{spinning:this.state.spinning},this.props.user&&!0===this.props.user.admin?m.a.createElement(u.a,{className:"mt20"},m.a.createElement(p.a,{span:6},m.a.createElement(K,{className:"Osshackathon-btn-primary",placeholder:"请输入项目名称进行搜索",enterButton:"搜索",size:"large",value:this.state.search,onInput:function(e){return t.onsetsearchvalue(e)},onSearch:function(e){return t.onsearchvalue(e)}})),m.a.createElement(p.a,{span:3,className:"fr textright"},m.a.createElement("div",null,"报名总数:",m.a.createElement("span",{className:"color-red"},f&&f.hackathon.hackathon_users_count)," 个"))):"",!0===h?"":m.a.createElement(u.a,{className:"mt20"},m.a.createElement(p.a,{span:6,className:"Osshackathonfont"},f&&f.hackathon.name),this.props.user&&!0===this.props.user.admin?m.a.createElement(p.a,{span:3,className:"fr textright"},m.a.createElement(l.a,{type:"primary",className:"OsshackprimaryButtonsyle",onClick:function(){return t.hackathonedit(f&&f.hackathon.id)}},"编辑")):""),!0===h?"":m.a.createElement("style",null,"\n\t\t\t\t\t\t\t.ant-divider-horizontal{\n \t\t\t\t\t\tmargin: 19px 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t"),!0===h?"":m.a.createElement(s.a,null),!0===d?m.a.createElement("style",null,"\n\t\t\t\t\t\t\t\t\t.Osshackathonfontlist{\n\t\t\t\t\t\t\t\t \tmax-height: 180px;\n\t\t\t\t\t\t\t\t\t overflow: hidden;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t"):"",!0===h?"":m.a.createElement("p",{className:"Osshackathonfontlist mb30",id:"Osshackathonfontlists"},f&&null===f.hackathon.description?"":m.a.createElement(F.a,{value:f&&f.hackathon.description})),!0===d&&180===this.state.boxoffsetHeigh?m.a.createElement(s.a,{dashed:!0,onClick:function(){return t.opentitle()},className:"pointer Breadcrumbfont"},"展开阅读全文",m.a.createElement(c.a,{type:"down"})):"",!0===h?m.a.createElement(P,z({getosshackathon:function(){return t.getosshackathonlist()},hidehackathonedit:function(){return t.hidehackathonedit()}},this.props,this.state)):"",!0===this.state.Osshackathonmodeltype?m.a.createElement(L,z({getosshackathon:function(){return t.getosshackathonlist()},hideeditSignupentry:function(){return t.hideeditSignupentry()}},this.props,this.state)):"",this.props.user&&!0===this.props.user.admin?m.a.createElement(u.a,{className:"mb20 mt30"},m.a.createElement(p.a,{span:8}),m.a.createElement(p.a,{span:8},m.a.createElement(l.a,{type:"primary",className:"OsshackprimaryButton OsshackprimaryButtonsyle",onClick:function(){return t.editSignupentry()}},m.a.createElement(c.a,{type:"plus"}),"新建项目")),m.a.createElement(p.a,{span:8})):"",this.props.user&&!1===this.props.user.admin?f&&0==f.hacks.length?"":f&&f.hacks.map((function(e,n){return m.a.createElement(i.a,{className:"OsshackathonCard mb20",key:n},m.a.createElement(u.a,null,m.a.createElement(p.a,{span:20,className:"OsshackathonCardtitle"},e.name),m.a.createElement(p.a,{span:6,className:"fr textright"},m.a.createElement("span",{style:{"line-height":"30px","margin-right":"30px"}},"报名人数:",e.hack_users_count),!0===e.entry_info?m.a.createElement(l.a,{type:"primary fr mr20",disabled:!0},"已报名"):m.a.createElement(l.a,{type:"primary fr issignup",onClick:function(){return t.Signupentry(e.id)}},"立即报名"))),m.a.createElement("p",{className:"mt20"},e.description))})):"",this.props.user&&!0===this.props.user.admin?m.a.createElement("style",null,"\n\t\t\t\t\t\t\t.ant-col-pull-6 {\n\t\t\t\t\t\t\t\t\tright: 17%;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t.ant-col-18 {\n\t\t\t\t\t\t\t\t\twidth: 82%;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t.CompetitionsIndexbottomvalue{\n \t\t\t\t\t\t\t text-align: center;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t"):"",this.props.user&&!0===this.props.user.admin?f&&0==f.hacks.length?"":f&&f.hacks.map((function(e,n){return m.a.createElement(i.a,{className:"OsshackathonCard mb20"},m.a.createElement(u.a,null,m.a.createElement(p.a,{span:20,className:"OsshackathonCardtitle"},e.name),m.a.createElement(p.a,{span:4,className:"fr textcenter width14bai"},m.a.createElement(o.a,{separator:"|"},m.a.createElement(o.a.Item,{className:"Breadcrumbfont iscursor",onClick:function(){return t.editSignupentry(e.id,e.name,e.description)}},"编辑"),m.a.createElement(o.a.Item,{className:"Breadcrumbfont iscursor",onClick:function(){return t.delSignupentry(e.id)}},"删除")))),m.a.createElement(u.a,{className:"mt20"},m.a.createElement(p.a,{span:4,push:20,className:"minheight50px borderDEDEDE"},m.a.createElement("div",{className:"pl80pt6"},m.a.createElement(u.a,{gutter:16},m.a.createElement(p.a,{className:"gutter-row",span:15},m.a.createElement("div",{className:"gutter-box Osshackprimaryfonttop"},e.hack_users_count))),m.a.createElement(u.a,{gutter:16},m.a.createElement(p.a,{className:"gutter-row",span:15},m.a.createElement("div",{className:"gutter-box CompetitionsIndexbottomvalue"},"报名数"))))),m.a.createElement(p.a,{span:18,pull:6,className:"minheight50px ml5"},e.description)))})):"",f&&f.hacks_count>10?f&&0===f.hacks.length?"":m.a.createElement("div",{className:"mb40 edu-txt-center padding20-30"},m.a.createElement(r.a,{showQuickJumper:!0,defaultCurrent:1,pageSize:10,total:f&&f.hacks_count,current:n,onChange:this.PaginationTask})):"")))}}])&&$(e.prototype,n),f&&$(e,f),d}(h.Component);e.default=Object(v.a)()(Object(b.a)(Q))},ZmnP:function(t,e,n){},bjH3:function(t,e,n){"use strict";var a=n("xwgP"),r=n.n(a),o=(n("j7XF"),n("ciBv")),i=n("RtKN"),c=n.n(i),s=n("fNVv");function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],a=!0,r=!1,o=void 0;try{for(var i,c=t[Symbol.iterator]();!(a=(i=c.next()).done)&&(n.push(i.value),!e||n.length!==e);a=!0);}catch(t){r=!0,o=t}finally{try{a||null==c.return||c.return()}finally{if(r)throw o}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return u(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}var p=[],f=["<ul>"],h=new c.a.Renderer,m=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function d(){p=[],f=["<ul>"]}function g(){return function t(e,n,a,r){if(n>=e.length||e[n].level<=a)return n;var o=e[n];r.push("<li><a href='#"+o.anchor+"'>"+o.text+"</a>");var i=[];return n=t(e,++n,o.level,i),i.length>0&&(r.push("<ul>"),i.forEach((function(t){r.push(t)})),r.push("</ul>")),r.push("</li>"),n=t(e,n,a,r)}(p,0,0,f),f.push("</ul>"),f.join("")}var y={heading:function(t){var e=m.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[1].length,text:e[2]}},fences:function(t){var e=this.rules.block.fences.exec(t);if(e){var n=e[0],a=function(t,e){var n=t.match(/^(\s+)(?:```)/);if(null===n)return e;var a=n[1];return e.split("\n").map((function(t){var e=t.match(/^\s+/);return null===e?t:l(e,1)[0].length>=a.length?t.slice(a.length):t})).join("\n")}(n,e[3]||""),r=e[2]?e[2].trim():e[2];if(["latex","katex","math"].indexOf(r)>=0){var o=w(),i=a;a=o,k[o]={type:"block",expression:i}}return{type:"code",raw:n,lang:r,text:a}}}},b=/(?:\${2})([^\n`]+?)(?:\${2})/gi,v=0,w=function(){return"__special_katext_id_".concat(v++,"__")},k={};function E(){v=0,k={}}function _(t){return t.replace(b,(function(t,e){var n=w();return k[n]={type:"inline",expression:e},n}))}var x=h.listitem;h.listitem=function(t,e,n){return x(_(t),e,n)};var O=h.paragraph;h.paragraph=function(t){return O(_(t))};var S=h.tablecell;h.tablecell=function(t,e){return S(_(t),e)},h.code=function(t,e,n){var a=(e||"").match(/\S*/)[0];return a?["latex","katex","math"].indexOf(a)>=0?"<p class='editormd-tex'>".concat(t,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(e,'">').concat(n?t:Object(s.escape)(t,!0),"</code></pre>\n"):'<pre class="prettyprint linenums"><code>'+(n?t:Object(s.escape)(t,!0))+"</code></pre>"},h.heading=function(t,e,n){var a=this.options.headerPrefix+n.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return p.push({anchor:a,level:e,text:t}),"<h"+e+' id="'+a+'">'+t+"</h"+e+">"},c.a.setOptions({silent:!0,smartypants:!0,gfm:!0,pedantic:!1}),c.a.use({tokenizer:y,renderer:h});var N=c.a,j=(n("8+LE"),/<pre[^>]*>/g);e.a=function(t){var e=t.value,n=void 0===e?"":e,i=t.className,c=t.style,s=void 0===c?{}:c,l=String(n),u=Object(a.useMemo)((function(){var t=N(l),e=k;return l.match(/\[TOC\]/)&&(t=t.replace("<p>[TOC]</p>",g()),d()),t=(t=t.replace(/(__special_katext_id_\d+__)/g,(function(t,n){var a=e[n],r=a.type,i=a.expression;return Object(o.renderToString)(function(t){var e=document.createElement("div");return e.innerHTML=t,0===e.childNodes.length?"":e.childNodes[0].nodeValue}(i),{displayMode:"block"===r,throwOnError:!1,output:"html"})}))).replace(/▁/g,"▁▁▁"),E(),t}),[l]),p=Object(a.useRef)();function f(t){var e=t.target;if("A"===e.tagName.toUpperCase()){var n=e.getAttribute("href");if(n.startsWith("#")){t.preventDefault();var a=document.getElementById(n.replace("#",""));a&&(a.parentNode.scrollTop=a.offsetTop)}}}return Object(a.useEffect)((function(){if(p.current&&u&&u.match(j)&&window.PR.prettyPrint(),p.current)return p.current.addEventListener("click",f),function(){p.current.removeEventListener("click",f),E(),d()}}),[u,p.current,f]),r.a.createElement("div",{ref:p,style:s,className:"".concat(i||""," markdown-body"),dangerouslySetInnerHTML:{__html:u}})}},ex8r:function(t,e,n){}}]); |