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.
NewEduCoderBuild/p__Classrooms__Lists__Progr...

1 line
230 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(self.webpackChunk=self.webpackChunk||[]).push([[3951,91585],{27667:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,_typeof=__webpack_require__(31468).default;(function(){if("function"!=typeof window.GGBApplet){var isRenderGGBElementEnabled=!1,scriptLoadStarted=!1,html5AppletsToProcess=null,ggbHTML5LoadedCodebaseIsWebSimple=!1,ggbHTML5LoadedCodebaseVersion=null,ggbHTML5LoadedScript=null,GGBApplet=function(){"use strict";for(var e={},n="5.0",t={},i=null,o=!1,a=!1,r=null,s=!1,l=null,c=null,u=0;u<arguments.length;u++){var d=arguments[u];if(null!==d)switch(_typeof(d)){case"number":n=d.toFixed(1);break;case"string":d.match(new RegExp("^[0-9]\\.[0-9]+$"))?n=d:r=d;break;case"object":void 0!==d.is3D?i=d:t=d;break;case"boolean":o=d,a=!0}}null===i&&(i={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},void 0===t.material_id||a||(o=!0)),null!==r&&void 0===t.id&&(t.id=r);var p="",m=!1,h=null,f=null,g=null,x=!1,v=null,_=null,w=null;void 0!==t.height&&(t.height=Math.round(t.height)),void 0!==t.width&&(t.width=Math.round(t.width));var y=function(e){return parseFloat(e)>4?parseFloat(e):5};function j(){try{return window.self!==window.top}catch(e){return!0}}function b(){return(!t.hasOwnProperty("screenshotGenerator")||!t.screenshotGenerator)&&Math.max(screen.width,screen.height)<800}e.setHTML5Codebase=function(e,n){c=e,B(e,n)},e.setJavaCodebase=e.setJavaCodebaseVersion=e.isCompiledInstalled=e.setPreCompiledScriptPath=e.setPreCompiledResourcePath=function(){},e.setHTML5CodebaseVersion=function(e,n){var t=parseFloat(e);NaN!==t&&t<5?console.log("The GeoGebra HTML5 codebase version "+t+" is deprecated. Using version latest instead."):(l=e,E(e,n))},e.getHTML5CodebaseVersion=function(){return f},e.getParameters=function(){return t},e.setFontsCSSURL=function(e){w=e},e.setGiacJSURL=function(e){},e.setJNLPFile=function(e){e},e.setJNLPBaseDir=function(e){},e.inject=function(){function n(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var i,o="auto",a=t.id,r=!1,l=0;l<arguments.length;l++){var c=arguments[l];"string"==typeof c?(c=c.toLowerCase()).match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?o=c:a=arguments[l]:"boolean"==typeof c?r=c:c instanceof HTMLElement&&(i=c)}function u(){if(s){o=P(o);var l=i||document.getElementById(a);if(l)if(e.removeExistingApplet(l,!1),void 0===t.width&&l.clientWidth&&(t.width=l.clientWidth),void 0===t.height&&l.clientHeight&&(t.height=l.clientHeight),t.width&&t.height||"html5"!==o||(delete t.width,delete t.height),h=o,"screenshot"===o)L(l,t);else{var c=!1;t.hasOwnProperty("playButton")&&t.playButton||t.hasOwnProperty("clickToLoad")&&t.clickToLoad?c=!0:t.hasOwnProperty("playButtonAutoDecide")&&t.playButtonAutoDecide&&(c=(!j()||n())&&b()),c?(h="screenshot",C(l,t,r,o)):N(l,t,r)}else console.log("possibly bug on ajax loading? ")}else setTimeout(u,200)}u()},e.getViews=function(){return i},e.isJavaInstalled=function(){return!1};var k=function(n){var o=function(){t.onError&&t.onError(),D("Error: Fetching material (id "+t.material_id+") failed.",t)},a=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",r="/materials/"+t.material_id+"?scope=basic";T("https://"+a+"/api/proxy.php?path="+encodeURIComponent(r),(function(a){var r=JSON.parse(a),s=r.elements?r.elements.filter((function(e){return"G"==e.type||"E"==e.type}))[0]:r;if(s&&s.url){t.fileName=s.url,S(s.settings||{}),i.is3D=!0;var l="https://www.geogebra.org/images/";e.setPreviewImage(v||s.previewUrl,l+"GeoGebra_loading.png",l+"applet_play.png"),n()}else o()}),o)};function S(e){["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach((function(n){e[n]=!!e[n]})),["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"].forEach((function(n){void 0===t[n]&&void 0!==e[n]&&(t[n]=e[n])})),void 0===t.showToolBarHelp&&(t.showToolBarHelp=t.showToolBar)}function T(e,n,t){var i=new XMLHttpRequest;i.open("GET",e),i.onload=function(){n(i.responseText)},i.onerror=t,i.send()}e.isHTML5Installed=function(){return!0},e.getLoadedAppletType=function(){return h},e.setPreviewImage=function(e,n,t){v=e,_=n,t},e.removeExistingApplet=function(e,n){var i;"string"==typeof e&&(e=document.getElementById(e)),h=null;var o=null;for(i=0;i<e.childNodes.length;i++){var a=e.childNodes[i],r=a.className;"applet_screenshot"===r?n?(a.style.display="block",h="screenshot"):a.style.display="none":"applet_scaler prerender"!==r&&(e.removeChild(a),o=r&&-1!=r.indexOf("appletParameters")?a.id:null,i--)}var s=void 0!==t.id?t.id:o,l=window[s];l&&"function"==typeof l.getBase64&&(l.remove(),window[s]=null)},e.refreshHitPoints=function(){if(y(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var n=e.getAppletObject();return!(!n||"function"!=typeof n.recalculateEnvironments)&&(n.recalculateEnvironments(),!0)},e.startAnimation=function(){var n=e.getAppletObject();return!(!n||"function"!=typeof n.startAnimation)&&(n.startAnimation(),!0)},e.stopAnimation=function(){var n=e.getAppletObject();return!(!n||"function"!=typeof n.stopAnimation)&&(n.stopAnimation(),!0)},e.getAppletObject=function(){var e=void 0!==t.id?t.id:"ggbApplet";return window[e]},e.resize=function(){};var Z=function(e){return e&&"false"!==e},N=function(n,t,i){y(f)<=4.2&&(i=!0);var o=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==f||ggbHTML5LoadedCodebaseIsWebSimple&&!x)&&(o=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var a=document.createElement("div");a.classList.add("appletParameters","notranslate");var r=t.width,s=t.height;if(t.disableAutoScale=void 0===t.disableAutoScale?GGBAppletUtils.isFlexibleWorksheetEditor():t.disableAutoScale,void 0!==t.width)if(y(f)<=4.4)Z(t.showToolBar)&&(t.height-=7),Z(t.showAlgebraInput)&&(t.height-=37),t.width<605&&Z(t.showToolBar)&&(t.width=605,r=605);else{var u=100;(Z(t.showToolBar)||Z(t.showMenuBar))&&(t.hasOwnProperty("customToolBar")&&(t.customToolbar=t.customToolBar),u=Z(t.showMenuBar)?245:155),r<u&&(t.width=u,r=u)}for(var d in a.style.border="none",a.style.display="inline-block",t)t.hasOwnProperty(d)&&"appletOnLoad"!==d&&a.setAttribute("data-param-"+d,t[d]);w&&a.setAttribute("data-param-fontscssurl",w),e.resize=function(){GGBAppletUtils.responsiveResize(n,t)},window.addEventListener("resize",(function(n){e.resize()}));var m="function"==typeof t.appletOnLoad?t.appletOnLoad:function(){};if(i||void 0===t.width){var h=document.createElement("div");h.className="applet_scaler",h.style.position="relative",h.style.display="block",h.appendChild(a),n.appendChild(h),t.appletOnLoad=function(n){e.resize(),m(n)}}else{t.hasOwnProperty("showSplash")||a.setAttribute("data-param-showSplash","false");var v=n.querySelector(".applet_scaler.prerender"),_=null!==v;if(_)j=v.querySelector(".ggb_preview");else{var j=I(r,s,t.borderColor,!1);(v=document.createElement("div")).className="applet_scaler",v.style.position="relative",v.style.display="block",v.style.width=r+"px",v.style.height=s+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(v,"66%"),y(f)>=5?(t.appletOnLoad=function(e){var t=n.querySelector(".ggb_preview");t&&t.parentNode.removeChild(t),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(v),window.GGBT_wsf_view&&$(window).trigger("resize"),m(e)},_||v.appendChild(j)):a.appendChild(j),v.appendChild(a),_||n.appendChild(v),setTimeout((function(){e.resize()}),1)}function b(e,n){n&&"function"==typeof n.appletOnLoad&&"function"==typeof renderGGBElement?renderGGBElement(e,n.appletOnLoad):renderGGBElement(e),D("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",n)}function k(e,n){"undefined"==typeof renderGGBElement?(null===html5AppletsToProcess&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:e,params:n}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,null!==html5AppletsToProcess&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach((function(e){b(e.article,e.params)})),html5AppletsToProcess=null)},y(f)<5&&(e.className+=" geogebraweb")):b(e,n)}if(o){scriptLoadStarted=!0;for(var S=0;S<a.childNodes.length;S++){"TABLE"===a.childNodes[S].tagName&&(a.removeChild(a.childNodes[S]),S--)}if(null!==ggbHTML5LoadedScript){var T=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');null!=T&&T.parentNode.removeChild(T)}var N=document.createElement("script"),L=function(){k(a,t)};N.src=p+g,ggbHTML5LoadedCodebaseIsWebSimple=x,ggbHTML5LoadedCodebaseVersion=f,ggbHTML5LoadedScript=N.src,D("GeoGebra HTML5 codebase loaded: '"+p+"'.",t),c||l&&"5.0"!=l?p.requirejs?__webpack_require__.e(49710).then(function(){var e=[__webpack_require__(49710)];L.apply(null,e)}.bind(this)).catch(__webpack_require__.oe):(N.onload=L,n.appendChild(N)):(x?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),L())}else k(a,t);t.height=s,t.width=r},L=function(n,t,i){var o=I(t.width,t.height,t.borderColor,i),a=document.createElement("div");a.style.position="relative",a.style.display="block",a.style.width=t.width+"px",a.style.height=t.height+"px",a.className="applet_screenshot applet_scaler"+(i?" applet_screenshot_play":""),a.appendChild(o);var r=GGBAppletUtils.getScale(t,n,i);i?(n.appendChild(A()),window.GGBT_wsf_view||(n.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(a,"66%"),n.appendChild(a),1===r||isNaN(r)||(GGBAppletUtils.scaleElement(a,r),a.style.width=t.width+"px",a.style.height=t.height+"px",a.parentNode.style.width=t.width*r+"px",a.parentNode.style.height=t.height*r+"px"),e.resize=function(){M(n,o,a,i)},window.addEventListener("resize",(function(n){e.resize()})),e.resize()};function M(e,n,i,o){if(e.contains(n)){if("object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()){if("fullscreencontent"!==e.id)return;window.GGBT_wsf_view.setCloseBtnPosition(e)}var a=GGBAppletUtils.getScale(t,e,o);null!==i.parentNode&&(isNaN(a)||1===a?(GGBAppletUtils.scaleElement(i,1),i.parentNode.style.width=t.width+"px",i.parentNode.style.height=t.height+"px"):(GGBAppletUtils.scaleElement(i,a),i.parentNode.style.width=t.width*a+"px",i.parentNode.style.height=t.height*a+"px")),"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(e),"object"===_typeof(window.GGBT_ws_header_footer)&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}e.onExitFullscreen=function(e,n){n.appendChild(e)};var C=function(e,n,t,i){L(e,n,!0);for(var o=function(){var t=[];for(r=0;r<e.childNodes.length;r++)t.push(e.childNodes[r]);if(window.GGBT_wsf_view){var o=window.GGBT_wsf_view.renderFullScreen(e,n.id),a=document.getElementById("fullscreencontainer"),s=jQuery(e).find(".fullscreencontent");s.length>0?(o.remove(),s.attr("id","fullscreencontent").show(),jQuery(a).append(s),window.dispatchEvent(new Event("resize"))):N(o,n,!1),window.GGBT_wsf_view.launchFullScreen(a)}else h=i,N(e,n,!1);if(!window.GGBT_wsf_view)for(r=0;r<t.length;r++)e.removeChild(t[r])},a=e.getElementsByClassName("ggb_preview_play"),r=0;r<a.length;r++)a[r].addEventListener("click",o,!1),a[r].addEventListener("ontouchstart",o,!1);"function"==typeof window.ggbAppletPlayerOnload&&window.ggbAppletPlayerOnload(e),b()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},A=function(){var e=document.createElement("div");if(e.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var n='.icon-applet-play { width: 100%; height: 100%;box-sizing: border-box;position: absolute;z-index: 1001;cursor: pointer;border-width: 0px; background-color: transparent;background-repeat: no-repeat;left: 0;top: 0;background-position: center center; background-image: url("https://www.geogebra.org/images/worksheet/icon-start-applet.png");}.icon-applet-play:hover {background-image: url("https://www.geogebra.org/images/worksheet/icon-start-applet-hover.png");}',t=document.createElement("style");t.styleSheet?t.styleSheet.cssText=n:t.appendChild(document.createTextNode(n)),document.getElementsByTagName("head")[0].appendChild(t)}return e},I=function(e,n,t,i){var o=document.createElement("div");o.className="ggb_preview",o.style.position="absolute",o.style.zIndex="90",o.style.width=e-2+"px",o.style.height=n-2+"px",o.style.top="0px",o.style.left="0px",o.style.overflow="hidden",o.style.backgroundColor="white";var a="lightgrey";void 0!==t&&(a="none"===t?"transparent":t),o.style.border="1px solid "+a;var r,s,l,c=document.createElement("img");if((c.style.position="relative",c.style.zIndex="1000",c.style.top="-1px",c.style.left="-1px",null!==v&&c.setAttribute("src",v),c.style.opacity=.7,null!==_)&&!i){(r=document.createElement("img")).style.position="absolute",r.style.zIndex="1001",r.style.opacity=1,c.style.opacity=.3,(s=360)>e/4*3&&(s=e/4*3),l=s/5.8,r.setAttribute("src",_),r.setAttribute("width",s),r.setAttribute("height",l);var u=(e-s)/2,d=(n-l)/2;r.style.left=u+"px",r.style.top=d+"px",o.appendChild(r)}return o.appendChild(c),o},P=function(e){return"html5"===(e=e.toLowerCase())||"screenshot"===e?e:"html5"},O=["web","webSimple","web3d","tablet","tablet3d","phone"],E=function(e,n){if(f=e,n)B(f,!0);else{var a,r,s=!o;if(s){var l=y(f);!isNaN(l)&&l<4.4&&(s=!1)}a="http"===window.location.protocol.substr(0,4)?window.location.protocol:"http:";var c=f.indexOf("//");for(var u in r=c>0?f:0===c?a+f:"https://www.geogebra.org/apps/5.2.814.0/",O)if(f.slice(-1*O[u].length)===O[u]||f.slice(-1*(O[u].length+1))===O[u]+"/")return void B(r,!1);GGBAppletUtils.isFlexibleWorksheetEditor()||!s||i.is3D||i.AV||i.SV||i.CV||i.EV2||i.CP||i.PC||i.DA||i.FI||i.PV||Z(t.showToolBar)||Z(t.showMenuBar)||Z(t.showAlgebraInput)||Z(t.enableRightClick)||t.appName&&"classic"!=t.appName?r+="web3d/":r+="webSimple/",B(r,!1)}},B=function(e,n){if(e.requirejs)p=e;else{"/"!==e.slice(-1)&&(e+="/"),p=e,null===n&&(n=-1===e.indexOf("http")),m=n,g="web.nocache.js",x=!1;var t=p.split("/");t.length>1&&(n||"webSimple"!==t[t.length-2]?O.indexOf(t[t.length-2])>=0&&(g=t[t.length-2]+".nocache.js"):(g="webSimple.nocache.js",x=!0)),t=e.split("/"),"test"===(f=t[t.length-3]).substr(0,4)?f=f.substr(4,1)+"."+f.substr(5,1):"war"!==f.substr(0,3)&&"beta"!==f.substr(0,4)||(f="5.0");var i=parseFloat(f);NaN!==i&&i<5&&e.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+i+" is deprecated. Using version latest instead."),E("5.0",n))}},D=function(e,n){window.console&&window.console.log&&(!n||void 0===n.showLogging||n.showLogging&&"false"!==n.showLogging)&&console.log(e)};function H(){var e=n;null!==l?e=l:parseFloat(e)<5&&(e="5.0"),E(e,!1),null!==c&&B(c,m),s=!0}return void 0!==t.material_id?k(H):H(),e},GGBAppletUtils=function(){"use strict";function e(){return void 0!==window.GGBT_wsf_edit}function n(e,n){1!=n?(e.style.transformOrigin="0% 0% 0px",e.style.webkitTransformOrigin="0% 0% 0px",e.style.transform="scale("+n+","+n+")",e.style.webkitTransform="scale("+n+","+n+")",e.style.maxWidth="initial",null!==e.querySelector(".ggb_preview")&&(e.querySelector(".ggb_preview").style.maxWidth="initial"),void 0!==e.querySelectorAll(".ggb_preview img")[0]&&(e.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),void 0!==e.querySelectorAll(".ggb_preview img")[1]&&(e.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(e.style.transform="none",e.style.webkitTransform="none")}function t(e,n,t,i,o){if(e.isScreenshoGenerator)return 1;var a,r=void 0!==i&&i,s=null!=e.noScaleMargin&&e.noScaleMargin,l=(a=e.autoHeight)&&"false"!==a,c=function(e,n,t,i,o,a){var r=null;if(null!=a&&""!=a)for(var s=e.parentNode;null!=s;){if((" "+s.className+" ").indexOf(" "+a+" ")>-1){r=s;break}s=s.parentNode}var l=0,c=0,u=0,d=0,p=0,m=0,h=0;if(r)l=r.offsetWidth,c=Math.max(i?r.offsetWidth:0,r.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(l=Math.min(window.innerWidth,document.documentElement.clientWidth),c=Math.min(window.innerHeight,document.documentElement.clientHeight),u=l):(l=window.innerWidth,c=window.innerHeight,u=window.innerWidth),e){var f=e.getBoundingClientRect();f.left>0&&f.left<=l&&(void 0===o||!o)&&("rtl"===document.dir?(p=l-f.width-f.left,m=u<=480?10:30):(m=f.left,p=u<=480?10:30),d=m+p)}e&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(e.getBoundingClientRect(),"closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(d=40,h=0):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(d=0,h=40))}return e&&((void 0===t||!t)&&n>0&&n+d<l?l=n:l-=d,"object"!==_typeof(window.GGBT_wsf_view)||!window.GGBT_wsf_view.isFullscreen()||void 0!==t&&t||(c-=h)),{width:l,height:c}}(n,e.width,t,l,r&&window.GGBT_wsf_view||s,o),u=parseInt(c.width),d=e.width,p=e.height;if(void 0===d){var m=n.querySelector(".appletParameters");m&&(d=m.offsetWidth,p=m.offsetHeight)}var h=u/d,f=r?1:c.height/p;return void 0===t||t||(h=Math.min(1,h),f=Math.min(1,f)),Math.min(h,f)}function i(e,n,i){var o,a=1,r=!1;return e.hasOwnProperty("allowUpscale")&&(r=e.allowUpscale),e.hasOwnProperty("scale")&&(a=parseFloat(e.scale),(isNaN(a)||null===a||0===a)&&(a=1),a>1&&(r=!0)),n&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(r=!0),e.hasOwnProperty("disableAutoScale")&&e.disableAutoScale?a:(o=t(e,n,r,i,e.scaleContainerClass),!r||e.hasOwnProperty("scale")&&1!==a?Math.min(a,o):o)}function o(e){var n=Math.min(window.innerWidth,document.documentElement.clientWidth),t=Math.min(window.innerHeight,document.documentElement.clientHeight),i=e.getBoundingClientRect(),o=(n-i.width)/2,a=(t-i.height)/2;a<0&&(a=0),e.style.position="relative","closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(e.style.left=o<40?"40px":o+"px",e.style.top=a+"px"):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(e.style.top=a<40?"40px":a+"px",e.style.left=o+"px")}return{responsiveResize:function(t,a){var r=t.querySelector(".appletParameters");if(r){if("object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()){if(a.id!==r.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(t)}if(r.parentElement&&/fullscreen/.test(r.parentElement.className))return;var s=i(a,t);e()&&r.setAttribute("data-param-scale",s);for(var l=null,c=0;c<t.childNodes.length;c++)if(void 0!==t.childNodes[c].className&&t.childNodes[c].className.match(/^applet_scaler/)){l=t.childNodes[c];break}if(null!==l&&null!==l.querySelector(".noscale"))return;var u=void 0!==a.id?a.id:"ggbApplet",d=window[u];null!=d&&d.recalculateEnvironments||null===l||l.className.match(/fullscreen/)||(l.parentNode.style.transform="",isNaN(s)||1===s?(n(l,1),l.parentNode.style.width=a.width+"px",l.parentNode.style.height=a.height+"px"):(l.parentNode.style.width=a.width*s+"px",l.parentNode.style.height=a.height*s+"px",n(l,s))),"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&o(t),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(r).parents(".content-added-content"))}},isFlexibleWorksheetEditor:e,positionCenter:o,getScale:i,scaleElement:n}}();__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return GGBApplet}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__),GGBAppletUtils.makeModule=function(name,permutation){function webModule(){var H="bootstrap",I="begin",J="gwt.codesvr."+name+"=",K="gwt.codesvr=",L=name,M="startup",N="DUMMY",O=0,P=1,Q="iframe",R="position:absolute; width:0; height:0; border:none; left: -1000px;",S=" top: -1000px;",T="Chrome",U="CSS1Compat",V="<!doctype html>",W="",X="<html><head></head><body></body></html>",Y="undefined",Z="readystatechange",$=10,_="script",ab="javascript",bb="Failed to load ",cb="moduleStartup",db="scriptTagAdded",eb="moduleRequested",fb="meta",gb="name",hb=name+"::",ib="::",jb="gwt:property",kb="content",lb="=",mb="gwt:onPropertyErrorFn",nb='Bad handler "',ob='" for "gwt:onPropertyErrorFn"',pb="gwt:onLoadErrorFn",qb='" for "gwt:onLoadErrorFn"',rb="#",sb="?",tb="/",ub="img",vb="clear.cache.gif",wb="baseUrl",xb=name+".nocache.js",yb="base",zb="//",Ab="selectingPermutation",Bb=name+".devmode.js",Cb=permutation,Db=":",Eb=".cache.js",Fb="loadExternalRefs",Gb="end",n=window,o=document;function p(){var e=n.location.search;return-1!=e.indexOf(J)||-1!=e.indexOf(K)}function q(e,n){}q(H,I),webModule.__sendStats=q,webModule.__moduleName=L,webModule.__errFn=null,webModule.__moduleBase=N,webModule.__softPermutationId=O,webModule.__computePropValue=null,webModule.__getPropMap=null,webModule.__installRunAsyncCode=function(){},webModule.__gwtStartLoadingFragment=function(){return null},webModule.__gwt_isKnownPropertyValue=function(){return!1},webModule.__gwt_getMetaProperty=function(){return null};var r=null,s=n.__gwt_activeModules=n.__gwt_activeModules||{},t;function u(){return v(),t}function v(){if(!t){var e=o.createElement(Q);if(e.id=L,e.style.cssText=R+S,e.tabIndex=-1,o.body.appendChild(e),t=e.contentWindow.document,-1==navigator.userAgent.indexOf(T)){t.open();var n=document.compatMode==U?V:W;t.write(n+X),t.close()}}}function w(e){q(cb,eb),function(e){function n(){return _typeof(o.readyState)==Y?_typeof(o.body)!=Y&&null!=o.body:/loaded|complete/.test(o.readyState)}var t=n();if(t)e();else{o.addEventListener&&o.addEventListener(Z,a,!1);var i=setInterval((function(){a()}),$)}function a(){if(!t){if(!n())return;t=!0,e(),o.removeEventListener&&o.removeEventListener(Z,a,!1),i&&clearInterval(i)}}}((function(){var n,t,i,o;n=e,t=u(),i=t.body,(o=t.createElement(_)).language=ab,o.crossOrigin=W,o.src=n,webModule.__errFn&&(o.onerror=function(){webModule.__errFn(L,new Error(bb+n))}),i.appendChild(o),q(cb,db)}))}function A(){for(var c={},d,e,f=o.getElementsByTagName(fb),g=O,h=f.length;g<h;++g){var i=f[g],j=i.getAttribute(gb),k;if(j){if(j=j.replace(hb,W),j.indexOf(ib)>=O)continue;if(j==jb){if(k=i.getAttribute(kb),k){var l,m=k.indexOf(lb);m>=O?(j=k.substring(O,m),l=k.substring(m+P)):(j=k,l=W),c[j]=l}}else if(j==mb){if(k=i.getAttribute(kb),k)try{d=eval(k)}catch(e){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(e){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(e){var n=c[e];return null==n?null:n},r=d,webModule.__errFn=e}function B(){function e(e){var n=e.lastIndexOf(rb);-1==n&&(n=e.length);var t=e.indexOf(sb);-1==t&&(t=e.length);var i=e.lastIndexOf(tb,Math.min(t,n));return i>=O?e.substring(O,i+P):W}var n,t=null!=(n=__gwt_getMetaProperty(wb))?n:W;return t==W&&(t=function(){for(var n=o.getElementsByTagName(_),t=O;t<n.length;++t)if(-1!=n[t].src.indexOf(xb))return e(n[t].src);return W}()),t==W&&(t=function(){var e=o.getElementsByTagName(yb);return e.length>O?e[e.length-P].href:W}()),t==W&&function(){var e=o.location;return e.href==e.protocol+zb+e.host+e.pathname+e.search+e.hash}()&&(t=e(o.location.href)),t=function(n){if(n.match(/^\w+:\/\//));else{var t=o.createElement(ub);t.src=n+vb,n=e(t.src)}return n}(t),t}function C(e){return e.match(/^\//)||e.match(/^[a-zA-Z]+:\/\//)?e:webModule.__moduleBase+e}function D(){var e,t=O,i=[],o=[];function a(e){var n=o[e](),t=i[e];if(n in t)return n;var a=[];for(var s in t)a[t[s]]=s;throw r&&r(e,a,n),null}if(__gwt_isKnownPropertyValue=function(e,n){return n in i[e]},webModule.__getPropMap=function(){var e={};for(var n in i)i.hasOwnProperty(n)&&(e[n]=a(n));return e},webModule.__computePropValue=a,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);try{var s=(e=Cb).indexOf(Db);-1!=s&&(t=parseInt(e.substring(s+P),$),e=e.substring(O,s))}catch(e){}return webModule.__softPermutationId=t,C(e+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}s[L]={moduleName:L},webModule.__moduleStartupDone=function(e){var n=s[L].bindings;s[L].bindings=function(){for(var t=n?n():{},i=e[webModule.__softPermutationId],o=O;o<i.length;o++){var a=i[o];t[a[O]]=a[P]}return t}},webModule.__startLoadingFragment=function(e){return C(e)},webModule.__installRunAsyncCode=function(e){var n=u(),t=n.body,i=n.createElement(_);i.language=ab,i.text=e,t.appendChild(i),t.removeChild(i)},A(),webModule.__moduleBase="/js/mathematicalGraphics/"+name+"/",s[L].moduleBase=webModule.__moduleBase;var G=D();return F(),w(G),!0}return webModule},"function"!=typeof window.web3d&&(window.web3d=GGBAppletUtils.makeModule("web3d","A18F540516513B1292CA7CEF2F6AFC7E")),"function"!=typeof window.webSimple&&(window.webSimple=GGBAppletUtils.makeModule("webSimple","96B09BF1B436BF53F0DF54116700F16A")),window.GGBApplet=GGBApplet}else console.warn("deployggb.js was loaded twice")})()},10036:function(e,n,t){"use strict";function i(e){var n=!0;if(e.length>0){for(var t=0;t<e.length;t++)if(0==e[t].compile_success||!e[t].compile_success){n=!1;break}}else n=!1;return n}function o(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=[],i=0;i<e.length;i++){var o=e[i],a=n?"".concat(n,"/").concat(o.name):"".concat(o.name);t.push({title:o.name,type:o.type,isLeaf:"tree"!==o.type,key:a})}return t}function a(e,n,t){for(var i=0;i<e.length;i++){var o=e[i];if(o.key===n){o.children=t;break}o.children&&a(o.children,n,t)}return e}function r(e,n,t){var i;return function(){var o=this,a=arguments,r=function(){i=null,t||e.apply(o,a)},s=t&&!i;clearTimeout(i),i=setTimeout(r,n),s&&e.apply(o,a)}}t.d(n,{Ax:function(){return a},Ds:function(){return r},KI:function(){return s},SI:function(){return o},f1:function(){return i}});var s=t(98242).Z.API_SERVER},98833:function(e,n,t){"use strict";t.d(n,{Z:function(){return T}});var i=t(7557),o=t.n(i),a=t(41498),r=t.n(a),s=t(79800),l=t.n(s),c=t(59301),u=t(78241),d=t(8591),p=t(43418),m=t(30518),h=t(92832),f=t(51945),g=t(95237),x=t(43604),v=t(61186),_=t.n(v),w=t(34601),y=t(81322),j={tips:"tips___e8J4O",homeworkType:"homeworkType___ZjN2X",antdTable:"antdTable___amDdp",modalWrapper:"modalWrapper___XPojI"},b=t(22365),k=t(47253),S=t(37712),T=(0,y.connect)((function(e){return{shixunHomeworks:e.shixunHomeworks,classroomList:e.classroomList}}))((function(e){var n=e.dispatch,t=e.courseEndTime,i=(e.classroomList,e.successCallback),a=void 0===i?function(){}:i,s=e.visible,v=e.homeworkIds,y=e.courseId,T=e.isBatch,Z=(e.shixunHomeworks,u.Z.useForm()),N=l()(Z,1)[0],L=(0,c.useState)(!1),M=l()(L,2),C=M[0],A=M[1],I=(0,c.useState)(!1),P=l()(I,2),O=P[0],E=P[1],B=(0,c.useState)(!1),D=l()(B,2),H=D[0],z=D[1],G=(0,c.useState)([]),R=l()(G,2),F=R[0],Y=R[1],W=(0,c.useState)([]),V=l()(W,2),U=V[0],q=V[1],J=(0,c.useState)([]),Q=l()(J,2),K=Q[0],X=Q[1],$=(0,c.useState)([]),ee=l()($,2),ne=ee[0],te=ee[1],ie=(0,c.useState)([]),oe=l()(ie,2),ae=oe[0],re=oe[1],se=(0,c.useState)([]),le=l()(se,2),ce=le[0],ue=le[1],de=(0,c.useState)([]),pe=l()(de,2),me=pe[0],he=pe[1],fe=(0,c.useState)([]),ge=l()(fe,2),xe=ge[0],ve=ge[1],_e=(0,c.useState)([]),we=l()(_e,2),ye=we[0],je=we[1];(0,c.useEffect)((function(){s?be():Se()}),[s]);var be=function(){var e=r()(o()().mark((function e(){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A(!0),e.next=3,(0,b.oR)(v[0],{course_id:y});case 3:n=e.sent,z(n.no_group),T?(he(n.all_course_groups),ve(n.all_course_groups)):(te(n.late_course_groups),re(n.late_course_groups),Y(n.submit_course_groups),q(n.submit_course_groups)),A(!1),N.setFieldsValue({end_time:_()()});case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ke=function(){var e=r()(o()().mark((function e(){var t,i,r;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=N.getFieldsValue(),i=_()(t.end_time).format("YYYY-MM-DD HH:mm"),!(T?0===ye.length:0===K.length&&0===ce.length)||H){e.next=6;break}return d.ZP.warning("请选择需要操作的班级"),e.abrupt("return");case 6:return E(!0),e.next=9,(0,b.Mc)(y,{no_group:H,homework_ids:v,group_ids:T?ye:K,end_time:i,late_group_ids:T?ye:ce});case 9:r=e.sent,E(!1),0===r.status&&(Se(),d.ZP.success("操作成功"),a(),n({type:"classroomList/setActionTabs",payload:{key:"清除选择数据"}}));case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Se=function(){X([]),ue([]),q([]),re([])};return(0,S.jsxs)(p.Z,{centered:!0,title:"立即截止",className:j.modalWrapper,width:T||H?520:760,open:s,confirmLoading:O,destroyOnClose:!0,okText:"截止",cancelText:"取消",onOk:function(){return ke()},onCancel:function(){Se(),n({type:"classroomList/setActionTabs",payload:{}})},children:[(0,S.jsxs)("div",{className:j.tips,children:[(0,S.jsx)("div",{children:"1、截止后学生不能再提交作业。"}),(0,S.jsx)("div",{children:"2、本操作只对“提交中”、“补交中”的作业有效。"})]}),(0,S.jsx)(u.Z,{form:N,layout:"vertical",children:(0,S.jsx)(u.Z.Item,{name:"end_time",label:"截止时间",children:(0,S.jsx)(m.default,{style:{width:"100%"},disabledDate:function(e){return(0,k.Q8)(e,t)},disabledTime:function(e){return(0,k.d0)(e)},placeholder:"请选择结束时间",showTime:{format:"HH:mm",defaultValue:_()((0,w.U6)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1})})}),!H&&(0,S.jsx)(S.Fragment,{children:T?(0,S.jsxs)("div",{children:[(0,S.jsx)(h.Z,{placeholder:"搜索班级",onChange:function(e){ve(me.filter((function(n){return n.name.indexOf(e.target.value)>-1})))}}),(0,S.jsx)(f.Z,{style:{marginTop:"10px",height:"300px",overflow:"auto"},className:j.antdTable,rowSelection:{type:"checkbox",onChange:function(e){je(e)}},rowKey:"id",pagination:!1,dataSource:xe,loading:C,columns:[{title:"班级",dataIndex:"name"}]})]}):(0,S.jsxs)(g.Z,{gutter:24,children:[(0,S.jsxs)(x.Z,{span:14,children:[(0,S.jsx)("div",{className:j.homeworkType,children:"作业截止"}),(0,S.jsx)(h.Z,{placeholder:"搜索班级",onChange:function(e){q(F.filter((function(n){return n.name.indexOf(e.target.value)>-1})))}}),(0,S.jsx)("div",{className:j.tableWrapper,children:(0,S.jsx)(f.Z,{style:{marginTop:"10px",height:"260px",overflow:"auto"},className:j.antdTable,rowSelection:{type:"checkbox",onChange:function(e){X(e)}},rowKey:"id",pagination:!1,dataSource:U,loading:C,columns:[{title:"班级",dataIndex:"name",ellipsis:!0},{title:"发布时间",dataIndex:"publish_time"},{title:"截止时间",dataIndex:"end_time"}]})})]}),(0,S.jsxs)(x.Z,{flex:10,style:{maxWidth:"280px"},children:[(0,S.jsx)("div",{className:j.homeworkType,children:"补交截止"}),(0,S.jsx)(h.Z,{placeholder:"搜索班级",onChange:function(e){re(ne.filter((function(n){return n.name.indexOf(e.target.value)>-1})))}}),(0,S.jsx)("div",{className:j.tableWrapper,children:(0,S.jsx)(f.Z,{style:{marginTop:"10px",height:"260px",overflow:"auto",maxWidth:"280px"},className:j.antdTable,rowSelection:{type:"checkbox",onChange:function(e){ue(e)}},rowKey:"id",pagination:!1,loading:C,dataSource:ae,columns:[{title:"班级",dataIndex:"name",ellipsis:!0,width:120},{title:"截止时间",dataIndex:"late_time"}]})})]})]})})]})}))},70060:function(e,n,t){"use strict";t.d(n,{Z:function(){return w}});var i=t(7557),o=t.n(i),a=t(41498),r=t.n(a),s=t(79800),l=t.n(s),c=t(59301),u="imageDimensions___a7crR",d="img___Kroat",p="fullWidth___c492T",m=t(92310),h=t.n(m),f=t(71418),g=t(2859),x=t(25600),v=t(34601),_=t(37712),w=function(e){var n=e.data,t=e.className,i=e.fullWidth,a=e.style,s=void 0===a?{}:a,m=e.onClose,w=e.onOk,y=e.showFullTools,j=e.noAssociationId,b=(0,c.useRef)(null),k=(0,c.useRef)(null),S=(0,c.useRef)(null),T=(0,c.useRef)(null),Z=(0,c.useState)(!1),N=l()(Z,2),L=N[0],M=N[1],C=(0,c.useState)("正在加载中"),A=l()(C,2),I=A[0],P=A[1];(0,c.useEffect)((function(){S.current||(S.current=document.createElement("style"),document.head.appendChild(S.current)),null!=n&&n.visible?(document.body.setAttribute("data-custom","y-hidden"),S.current.innerHTML=" html { overflow-y: hidden; }",null!=n&&n.src&&O()):(document.body.removeAttribute("data-custom"),S.current&&(document.head.removeChild(S.current),S.current=null))}),[null==n?void 0:n.visible]);var O=function(){var e=r()(o()().mark((function e(){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return M(!0),P("正在加载中"),e.next=4,(0,v.ZJ)(null==n?void 0:n.src);case 4:t=e.sent,b.current.src="",b.current.src=t,b.current.onload=function(){B()},M(!1),P("");case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),E=function(){var e=r()(o()().mark((function e(t){var i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return M(!0),P("正在保存中"),e.next=4,(0,x.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:n.title,file:t.dataUrl}});case 4:if(null==(i=e.sent)||!i.id||j){e.next=12;break}return e.next=8,(0,x.ZP)("/api/attachments/".concat(n.id,"/add_subitem.json"),{method:"post",body:{subitem_id:null==i?void 0:i.id,settings:JSON.stringify(t.state)}});case 8:0===e.sent.status&&w(),e.next=13;break;case 12:null!=i&&i.id&&w(i);case 13:M(!1),P("");case 15:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),B=function(){k.current=new g.hP(b.current),k.current.targetRoot=T.current,k.current.addEventListener("render",E),k.current.addEventListener("beforeclose",m),y&&(k.current.availableMarkerTypes=k.current.ALL_MARKER_TYPES,k.current.uiStyleSettings.redoButtonVisible=!0,k.current.uiStyleSettings.notesButtonVisible=!0,k.current.uiStyleSettings.zoomButtonVisible=!0,k.current.uiStyleSettings.zoomOutButtonVisible=!0,k.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=k.current.uiStyleSettings,k.current.show(),null!=n&&n.snapshotData&&k.current.restoreState(n.snapshotData),setTimeout((function(){var e;window.scrollTo(0,0),(e=document.querySelector('a[href="https://markerjs.com/"]'))&&e.parentNode&&(e.parentNode.style.display="none"),[{name:'[data-action="select"]',title:"选择"},{name:'[data-action="delete"]',title:"删除元素"},{name:'[data-action="undo"]',title:"撤销"},{name:'[data-type-name="FrameMarker"]',title:"矩形"},{name:'[data-type-name="FreehandMarker"]',title:"画线"},{name:'[data-type-name="ArrowMarker"]',title:"箭头"},{name:'[data-type-name="TextMarker"]',title:"文本"},{name:'[data-type-name="EllipseMarker"]',title:"椭圆"},{name:'[data-type-name="HighlightMarker"]',title:"方块"},{name:'[data-type-name="CalloutMarker"]',title:"注释"},{name:'[data-action="render"]',title:"保存"},{name:'[data-action="close"]',title:"退出"}].forEach((function(e){var n=document.querySelector(e.name);n&&n.setAttribute("title",e.title)}))}),300)};return(0,_.jsx)(c.Fragment,{children:(null==n?void 0:n.visible)&&(0,_.jsx)(f.Z,{spinning:L,tip:I,style:{position:"absolute"},children:(0,_.jsx)("div",{ref:T,className:h()(u,t,i?p:""),style:s,children:(0,_.jsx)("img",{className:d,ref:b})})})})}},20417:function(e,n,t){"use strict";t.d(n,{h:function(){return x}});var i=t(82242),o=t.n(i),a=t(79800),r=t.n(a),s=t(59301),l=t(57809),c=t(78241),u=t(3113),d=t(89780),p=t.n(d),m=(t(99974),t(33819),t(37712)),h=l.default.Option,f={labelCol:{span:4},wrapperCol:{span:20}},g={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};function x(e){var n=e.value,t=e.onChange,i=e.mode,a=e.options,l=void 0===a?{}:a,c=(0,s.useRef)(),u=(0,s.useState)(),d=r()(u,2),h=d[0],f=d[1];return(0,s.useEffect)((function(){if(h){var e=function(e){var n=e.getValue();t&&t(n)};return h.on("change",e),function(){h.off("change",e)}}}),[h,t]),(0,s.useEffect)((function(){h&&h.setOption("mode",i)}),[h,i]),(0,s.useEffect)((function(){h&&(n===h.getValue()&&""!==n||setTimeout((function(){h.setValue(n||"")}),300))}),[h,n]),(0,s.useEffect)((function(){if(c.current&&!h){var e=p().fromTextArea(c.current,o()({mode:i,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},l));f(e)}}),[c.current,h]),(0,m.jsx)("div",{className:"my-codemirror-container",children:(0,m.jsx)("textarea",{ref:c})})}n.Z=function(e){var n=e.callback,t=e.onCancel,i=(0,s.useState)("python"),a=r()(i,2),d=a[0],p=a[1];return(0,m.jsxs)(c.Z,o()(o()({},f),{},{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){n(e)},style:{width:500},children:[(0,m.jsx)(c.Z.Item,{label:"代码语言",name:"language",children:(0,m.jsx)(l.default,{getPopupContainer:function(e){return e.parentNode},onChange:function(e){p(g[e][1])},children:Object.keys(g).map((function(e){return(0,m.jsx)(h,{value:e,children:g[e][0]},e)}))})}),(0,m.jsx)(c.Z.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}],children:(0,m.jsx)(x,{mode:d})}),(0,m.jsxs)("div",{className:"flex-container flex-end",children:[(0,m.jsx)(u.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,m.jsx)(u.ZP,{type:"ghost",onClick:t,children:"取消"})]})]}))}},94064:function(e,n,t){"use strict";t.d(n,{Z:function(){return ye}});var i=t(91232),o=t.n(i),a=t(79800),r=t.n(a),s=t(85573),l=t.n(s),c=t(59301),u=t(89780),d=t.n(u),p=t(76374),m=(t(99974),t(6313),t(25717),t(99498),t(25419),t(67549),t(19211)),h=t(37712),f=function(e){var n=e.value,t=void 0===n?"":n,i=(e.className,e.showTextOnly,e.showLines,e.style,(0,c.useMemo)((function(){return""}),[t]));return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)("div",{dangerouslySetInnerHTML:{__html:i}})})},g=t(82242),x=t.n(g),v=[{title:"粗体",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"斜体",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"无序列表",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"有序列表",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"行内代码",icon:"md-iconfont icon-code",actionName:"code"},{title:"代码块(多语言风格)",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"链接",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"行内公式",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"数学图像",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"多行公式",icon:"iconfont icon-jisuan1",actionName:"latex"},"|",{title:"添加图片",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"插入画图",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"插入流程图",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"表格",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"换行",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"清空",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function _(e){var n=e.onActionCallback,t=e.title,i=e.icon,o=e.actionName,a=e.className,r=void 0===a?"":a,s=e.children;return(0,h.jsxs)("a",{title:t,className:r,onClick:function(){n(o)},children:[(0,h.jsx)("i",{className:"".concat(i)}),s]})}var w=function(e){var n=e.watch,t=e.showNullButton,i=e.showNullProgramButton,o=e.onActionCallback,a=e.fullScreen,r=e.insertTemp,s=e.hidetoolBar,l=e.extraUse,c=[].concat(v,[{title:"".concat(n?"关闭实时预览":"开启实时预览"),icon:"".concat(n?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"),actionName:"trigger-watch"}]);return(0,h.jsxs)("ul",{className:"markdown-toolbar-container",children:[!s&&c.map((function(e,n){return(0,h.jsx)("li",{children:e.actionName?(0,h.jsx)(_,x()(x()({},e),{},{onActionCallback:o})):(0,h.jsx)("span",{className:"v-line"})},n)})),t?(0,h.jsx)("li",{children:(0,h.jsx)(_,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-null-ch",onActionCallback:o,children:(0,h.jsx)("span",{className:"fill-tip",children:"点击插入\b填空项"})})}):null,i?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("li",{children:(0,h.jsx)(_,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-signal",onActionCallback:o,children:(0,h.jsx)("span",{className:"fill-tip",children:"+单行填空项"})})}),(0,h.jsx)("li",{children:(0,h.jsx)(_,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"增加填空",actionName:"add-multiple",onActionCallback:o,children:(0,h.jsx)("span",{className:"fill-tip",children:"+多行填空项"})})})]}):null,r&&(0,h.jsx)("li",{children:(0,h.jsx)(_,{icon:"md-iconfont icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(r),onActionCallback:o,children:(0,h.jsx)("span",{className:"fill-tip",children:"插入模板"})})}),l&&(0,h.jsx)("li",{children:l}),(0,h.jsx)("li",{className:"btn-full-screen",children:(0,h.jsx)(_,{icon:"".concat(a?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"),title:a?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:o})})]})},y=t(50605),j=t(78241),b=t(92832),k=t(3113),S={labelCol:{span:4},wrapperCol:{span:20}},T=function(e){var n=e.callback,t=e.onCancel;return(0,h.jsxs)(j.Z,x()(x()({},S),{},{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(e){n(e)},style:{width:500},children:[(0,h.jsx)(j.Z.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}],children:(0,h.jsx)(b.Z,{})}),(0,h.jsx)(j.Z.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}],children:(0,h.jsx)(b.Z,{})}),(0,h.jsxs)("div",{className:"flex-container flex-end",children:[(0,h.jsx)(k.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,h.jsx)(k.ZP,{type:"ghost",onClick:t,children:"取消"})]})]}))},Z=t(20417),N=t(55208),L=t(95237),M=t(70060),C=function(e){var n=e.callback,t=e.onCancel,i=document.createElement("canvas"),o=i.getContext("2d");i.width=1e3,i.height=800,o.fillStyle="#ffffff",o.fillRect(0,0,i.width,i.height);var a=i.toDataURL("image/png");return(0,h.jsx)(L.Z,{style:{height:"100vh"},children:(0,h.jsx)(M.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:a,visible:!0,title:String(Date.now())},onOk:function(e){n({src:e.url})},onClose:t})})},A=t(7557),I=t.n(A),P=t(41498),O=t.n(P),E=t(37205),B=t.n(E),D=t(12378);function H(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(H,go.CommandHandler),H.prototype.canAlignSelection=function(){var e=this.diagram;return null!==e&&!e.isReadOnly&&!e.isModelReadOnly&&!(e.selection.count<2)},H.prototype.alignLeft=function(){var e=this.diagram;e.startTransaction("aligning left");var n=1/0;e.selection.each((function(e){e instanceof go.Link||(n=Math.min(e.position.x,n))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(n,e.position.y))})),e.commitTransaction("aligning left")},H.prototype.alignRight=function(){var e=this.diagram;e.startTransaction("aligning right");var n=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var t=e.actualBounds.x+e.actualBounds.width;n=Math.max(t,n)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(n-e.actualBounds.width,e.position.y))})),e.commitTransaction("aligning right")},H.prototype.alignTop=function(){var e=this.diagram;e.startTransaction("alignTop");var n=1/0;e.selection.each((function(e){e instanceof go.Link||(n=Math.min(e.position.y,n))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.position.x,n))})),e.commitTransaction("alignTop")},H.prototype.alignBottom=function(){var e=this.diagram;e.startTransaction("aligning bottom");var n=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var t=e.actualBounds.y+e.actualBounds.height;n=Math.max(t,n)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,n-e.actualBounds.height))})),e.commitTransaction("aligning bottom")},H.prototype.alignCenterX=function(){var e=this.diagram,n=e.selection.first();if(n){e.startTransaction("aligning Center X");var t=n.actualBounds.x+n.actualBounds.width/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(t-e.actualBounds.width/2,e.actualBounds.y))})),e.commitTransaction("aligning Center X")}},H.prototype.alignCenterY=function(){var e=this.diagram,n=e.selection.first();if(n){e.startTransaction("aligning Center Y");var t=n.actualBounds.y+n.actualBounds.height/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,t-e.actualBounds.height/2))})),e.commitTransaction("aligning Center Y")}},H.prototype.alignColumn=function(e){var n=this.diagram;n.startTransaction("align Column"),void 0===e&&(e=0),e=parseFloat(e);var t=new Array;n.selection.each((function(e){e instanceof go.Link||t.push(e)}));for(var i=0;i<t.length-1;i++){var o=t[i],a=o.actualBounds.y+o.actualBounds.height+e;t[i+1].move(new go.Point(o.actualBounds.x,a))}n.commitTransaction("align Column")},H.prototype.alignRow=function(e){void 0===e&&(e=0),e=parseFloat(e);var n=this.diagram;n.startTransaction("align Row");var t=new Array;n.selection.each((function(e){e instanceof go.Link||t.push(e)}));for(var i=0;i<t.length-1;i++){var o=t[i],a=o.actualBounds.x+o.actualBounds.width+e;t[i+1].move(new go.Point(a,o.actualBounds.y))}n.commitTransaction("align Row")},H.prototype.canRotate=function(e){var n=this.diagram;return null!==n&&!n.isReadOnly&&!n.isModelReadOnly&&!(n.selection.count<1)},H.prototype.rotate=function(e){var n;void 0===e&&(e=90),(n=this.diagram).startTransaction("rotate "+e.toString()),(n=this.diagram).selection.each((function(n){n instanceof go.Link||n instanceof go.Group||(n.angle+=e)})),n.commitTransaction("rotate "+e.toString())},H.prototype.pullToFront=function(){var e=this.diagram;e.startTransaction("pullToFront");var n=new go.Map;e.selection.each((function(e){n.set(e.layer,0)})),n.iteratorKeys.each((function(e){var t=0;e.parts.each((function(e){if(!e.isSelected){var n=e.zOrder;isNaN(n)?e.zOrder=0:t=Math.max(t,n)}})),n.set(e,t)})),e.selection.each((function(e){H._assignZOrder(e,n.get(e.layer)+1)})),e.commitTransaction("pullToFront")},H.prototype.pushToBack=function(){var e=this.diagram;e.startTransaction("pushToBack");var n=new go.Map;e.selection.each((function(e){n.set(e.layer,0)})),n.iteratorKeys.each((function(e){var t=0;e.parts.each((function(e){if(!e.isSelected){var n=e.zOrder;isNaN(n)?e.zOrder=0:t=Math.min(t,n)}})),n.set(e,t)})),e.selection.each((function(e){H._assignZOrder(e,n.get(e.layer)-1-H._findGroupDepth(e))})),e.commitTransaction("pushToBack")},H._assignZOrder=function(e,n,t){void 0===t&&(t=e),e.layer===t.layer&&(e.zOrder=n),e instanceof go.Group&&e.memberParts.each((function(e){H._assignZOrder(e,n+1,t)}))},H._findGroupDepth=function(e){if(e instanceof go.Group){var n=0;return e.memberParts.each((function(e){n=Math.max(n,H._findGroupDepth(e))})),n+1}return 0},H.prototype.doKeyDown=function(){var e=this.diagram;if(null!==e){var n=e.lastInput;if("Up"===n.key||"Down"===n.key||"Left"===n.key||"Right"===n.key){var t=this.arrowKeyBehavior;if("none"===t)return;if("select"===t)return void this._arrowKeySelect();if("move"===t)return void this._arrowKeyMove();if("tree"===t)return void this._arrowKeyTree()}go.CommandHandler.prototype.doKeyDown.call(this)}},H.prototype._getAllParts=function(){var e=new Array;return this.diagram.nodes.each((function(n){e.push(n)})),this.diagram.parts.each((function(n){e.push(n)})),e},H.prototype._arrowKeyMove=function(){var e=this.diagram,n=e.lastInput,t=0,i=0;if(n.control||n.meta)t=1,i=1;else if(null!==e.grid){var o=e.grid.gridCellSize;i=o.width,t=o.height}e.startTransaction("arrowKeyMove"),e.selection.each((function(e){"Up"===n.key?e.move(new go.Point(e.actualBounds.x,e.actualBounds.y-t)):"Down"===n.key?e.move(new go.Point(e.actualBounds.x,e.actualBounds.y+t)):"Left"===n.key?e.move(new go.Point(e.actualBounds.x-i,e.actualBounds.y)):"Right"===n.key&&e.move(new go.Point(e.actualBounds.x+i,e.actualBounds.y))})),e.commitTransaction("arrowKeyMove")},H.prototype._arrowKeySelect=function(){var e=this.diagram,n=e.lastInput,t=null;"Up"===n.key?t=this._findNearestPartTowards(270):"Down"===n.key?t=this._findNearestPartTowards(90):"Left"===n.key?t=this._findNearestPartTowards(180):"Right"===n.key&&(t=this._findNearestPartTowards(0)),null!==t&&(n.shift?t.isSelected=!0:n.control||n.meta?t.isSelected=!t.isSelected:e.select(t))},H.prototype._findNearestPartTowards=function(e){var n=this.diagram.selection.first();if(null===n)return null;for(var t=n.actualBounds.center,i=this._getAllParts(),o=1/0,a=n,r=0;r<i.length;r++){var s=i[r];if(s!==n&&s.canSelect()){var l=s.actualBounds.center,c=t.directionPoint(l),u=this._angleCloseness(c,e);if(u<=45){var d=t.distanceSquaredPoint(l);(d*=1+Math.sin(u*Math.PI/180))<o&&(o=d,a=s)}}}return a},H.prototype._angleCloseness=function(e,n){return Math.min(Math.abs(n-e),Math.min(Math.abs(n+360-e),Math.abs(n-360-e)))},H.prototype._arrowKeyTree=function(){var e=this.diagram,n=e.selection.first();if(n instanceof go.Node){var t=e.lastInput;if("Right"===t.key)if(n.isTreeLeaf);else if(n.isTreeExpanded){null!==(o=this._sortTreeChildrenByY(n).first())&&e.select(o)}else e.commandHandler.canExpandTree(n)&&e.commandHandler.expandTree(n);else if("Left"===t.key){if(!n.isTreeLeaf&&n.isTreeExpanded)e.commandHandler.canCollapseTree(n)&&e.commandHandler.collapseTree(n);else null!==(a=n.findTreeParentNode())&&e.select(a)}else if("Up"===t.key){if(null!==(a=n.findTreeParentNode()))if((s=(r=this._sortTreeChildrenByY(a)).indexOf(n))>0){for(var i=r.elt(s-1);null!==i&&i.isTreeExpanded&&!i.isTreeLeaf;){i=this._sortTreeChildrenByY(i).last()}null!==i&&e.select(i)}else e.select(a)}else if("Down"===t.key){var o;if(n.isTreeExpanded&&!n.isTreeLeaf)null!==(o=this._sortTreeChildrenByY(n).first())&&e.select(o);else for(;null!==n;){var a,r,s;if(null===(a=n.findTreeParentNode()))break;if((s=(r=this._sortTreeChildrenByY(a)).indexOf(n))<r.length-1){e.select(r.elt(s+1));break}n=a}}var l=e.selection.first();null!==l&&e.scrollToRect(l.actualBounds)}},H.prototype._sortTreeChildrenByY=function(e){var n=(new go.List).addAll(e.findTreeChildrenNodes());return n.sort((function(e,n){var t=e.location,i=n.location;return t.y<i.y?-1:t.y>i.y?1:t.x<i.x?-1:t.x>i.x?1:0})),n},H.prototype.copyToClipboard=function(e){go.CommandHandler.prototype.copyToClipboard.call(this,e),this._lastPasteOffset.set(this.pasteOffset)},H.prototype.pasteFromClipboard=function(){var e=go.CommandHandler.prototype.pasteFromClipboard.call(this);return this.diagram.moveParts(e,this._lastPasteOffset),this._lastPasteOffset.add(this.pasteOffset),e},Object.defineProperty(H.prototype,"arrowKeyBehavior",{get:function(){return this._arrowKeyBehavior},set:function(e){if("move"!==e&&"select"!==e&&"scroll"!==e&&"tree"!==e&&"none"!==e)throw new Error('DrawCommandHandler.arrowKeyBehavior must be either "move", "select", "scroll", "tree", or "none", not: '+e);this._arrowKeyBehavior=e}}),Object.defineProperty(H.prototype,"pasteOffset",{get:function(){return this._pasteOffset},set:function(e){if(!(e instanceof go.Point))throw new Error("DrawCommandHandler.pasteOffset must be a Point, not: "+e);this._pasteOffset.set(e)}});var z=H,G=(t(23529),t(85160)),R=t(43418),F=t(43604),Y=t(25600),W="myPaletteDiv___Xjz2I",V="maxH60___Pd4Re";window.go=D;var U=function(e){var n=e.onCancel,t=e.callback,i=(0,c.useRef)(),o=(0,c.useRef)(),a=(0,c.useRef)(),s=(0,c.useRef)(!1),l=(0,c.useRef)(!1),u=(0,c.useState)(0),d=r()(u,2),p=d[0],m=d[1],f=function(){var e=O()(I()().mark((function e(){var n,o;return I()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.current.makeImage(),e.next=3,(0,Y.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:n.src}});case 3:o=e.sent,t({src:o.url});case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,c.useEffect)((function(){m(p+1)}),[]),(0,h.jsx)("div",{ref:l,className:s.current?"".concat(V," body-overflow-initial"):"body-overflow-initial",children:(0,h.jsx)(R.Z,{width:1200,icon:null,footer:null,closable:!0,visible:!!p,destroyOnClose:!0,maskClosable:!1,getContainer:l.current,rootClassName:"zIndex-9999",title:(0,h.jsxs)(L.Z,{children:[(0,h.jsx)(F.Z,{flex:1,children:"插入流程图"}),(0,h.jsx)(F.Z,{onClick:function(){s.current=!s.current,m(p+1)},children:(0,h.jsx)("span",{className:"current c-blue mr30",style:{fontWeight:400},children:"展开/收起"})})]}),onCancel:n,children:(0,h.jsxs)("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative"},children:[(0,h.jsxs)("div",{style:{display:"flex",height:"100%"},children:[(0,h.jsxs)("div",{style:{width:"300px",height:"100%"},children:[(0,h.jsx)("div",{style:{background:"#fff",position:"relative",zIndex:12,fontSize:16,color:"#3061d0"},children:"图形库"}),(0,h.jsx)("div",{style:{height:"calc(100% - 50px)"},className:W,ref:a})]}),(0,h.jsxs)("div",{style:{flex:1,position:"relative"},children:[(0,h.jsx)(G.FI,{initDiagram:function(){var e=D.GraphObject.make,n="#ff3333",t="#3358ff",r="#25ad23",s="#d533ff",l="#7d33ff",c="#ff6233",u="#ffffff",d="#000000",p="#fffcd5",m="#d5ebff",h="#f2dfe0",f="#a5d2fa",g="#cccccc",x="#b3e6b3",v="#fcbbbd";function _(n,t){var i=function(e,t){e.handled=!0,e.diagram.model.commit((function(i){var o=t.part.adornedPart,a=(new D.Point).setRectSpot(o.actualBounds,n);a.subtract(o.location),a.scale(2,2),a.x+=130*Math.sign(a.x),a.y+=130*Math.sign(a.y),a.add(o.location),a.snapToGridPoint(e.diagram.grid.gridOrigin,e.diagram.grid.gridCellSize);var r=i.copyNodeData(o.data);i.setGroupKeyForNodeData(r,i.getGroupKeyForNodeData(o.data)),i.addNodeData(r);var s={from:o.key,to:i.getKeyForNodeData(r)};i.addLinkData(s);var l=e.diagram.findNodeForData(r);l.location=a,e.diagram.select(l),setTimeout((function(){e.diagram.commandHandler.editTextBlock()}),20)}))};return e(D.Shape,{figure:t,alignment:n,alignmentFocus:n.opposite(),width:n.equals(D.Spot.Top)||n.equals(D.Spot.Bottom)?25:18,height:n.equals(D.Spot.Top)||n.equals(D.Spot.Bottom)?18:25,fill:"orange",stroke:u,strokeWidth:4,mouseEnter:function(e,n){return n.fill="dodgerblue"},mouseLeave:function(e,n){return n.fill="orange"},isActionable:!0,click:i,contextClick:i})}function w(n){return e(D.Shape,{fill:"orange",stroke:"rgba(0, 0, 0, 0)",strokeWidth:15,background:"transparent",geometryString:"F1 M0 0 b 0 360 -4 0 4 z M10 0 b 0 360 -4 0 4 z M20 0 b 0 360 -4 0 4",isActionable:!0,cursor:"context-menu",mouseEnter:function(e,n){return n.fill="dodgerblue"},mouseLeave:function(e,n){return n.fill="orange"},click:function(e,n){e.diagram.commandHandler.showContextMenu(n.part.adornedPart)}},n||{})}function y(e,n){return function(t,i){t.handled=!0,t.diagram.model.commit((function(t){t.set(i.part.adornedPart.data,e,n)}))}}function j(n,t){return t||(t="color"),e(D.Shape,{width:16,height:16,stroke:"lightgray",fill:n,margin:1,background:"transparent",mouseEnter:function(e,n){return n.stroke="dodgerblue"},mouseLeave:function(e,n){return n.stroke="lightgray"},click:y(t,n),contextClick:y(t,n)})}function b(){return[e("ContextMenuButton",e(D.Panel,"Horizontal",j(u,"fill"),j(p,"fill"),j(m,"fill"),j(h,"fill"))),e("ContextMenuButton",e(D.Panel,"Horizontal",j(g,"fill"),j(x,"fill"),j(f,"fill"),j(v,"fill")))]}function k(){return[e("ContextMenuButton",e(D.Panel,"Horizontal",j(d),j(r),j(t),j(n))),e("ContextMenuButton",e(D.Panel,"Horizontal",j(u),j(s),j(l),j(c)))]}function S(n,t){return t||(t="thickness"),e(D.Shape,"LineH",{width:16,height:16,strokeWidth:n,margin:1,background:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:y(t,n),contextClick:y(t,n)})}function T(n,t){return t||(t="dash"),e(D.Shape,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:n,margin:1,background:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:y(t,n),contextClick:y(t,n)})}function Z(){return[e("ContextMenuButton",e(D.Panel,"Horizontal",S(1),S(2),S(3),S(4))),e("ContextMenuButton",e(D.Panel,"Horizontal",T(null),T([2,4]),T([4,4])))]}function N(n,t){return t||(t="figure"),e(D.Shape,{width:32,height:32,scale:.5,fill:"lightgray",figure:n,margin:1,background:"transparent",mouseEnter:function(e,n){return n.fill="dodgerblue"},mouseLeave:function(e,n){return n.fill="lightgray"},click:y(t,n),contextClick:y(t,n)})}function L(n){return e(D.Shape,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(n+4).toString()+" H3"})}function M(n){var t="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return 0===n?t="M0 0 M16 16 M0 8 L16 8":2===n&&(t="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),e(D.Shape,{geometryString:t,margin:2,background:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:y("dir",n),contextClick:y("dir",n)})}function C(n){var t=function(e,t){e.handled=!0,e.diagram.model.commit((function(e){var i=t.part.adornedPart;e.set(i.data,n?"toSpot":"fromSpot",D.Spot.stringify(D.Spot.AllSides)),(n?i.toNode:i.fromNode).invalidateConnectedLinks()}))};return e(D.Shape,{width:12,height:12,fill:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:t,contextClick:t})}function A(n,t){var i=0,o=D.Spot.RightSide;n.equals(D.Spot.Top)?(i=270,o=D.Spot.TopSide):n.equals(D.Spot.Left)?(i=180,o=D.Spot.LeftSide):n.equals(D.Spot.Bottom)&&(i=90,o=D.Spot.BottomSide),t||(i-=180);var a=function(e,n){e.handled=!0,e.diagram.model.commit((function(e){var i=n.part.adornedPart;e.set(i.data,t?"toSpot":"fromSpot",D.Spot.stringify(o)),(t?i.toNode:i.fromNode).invalidateConnectedLinks()}))};return e(D.Shape,{alignment:n,alignmentFocus:n.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:i,background:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:a,contextClick:a})}return i.current=new D.Diagram(o.current,{padding:20,grid:e(D.Panel,"Grid",e(D.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(D.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),"draggingTool.isGridSnapEnabled":!0,handlesDragDropForTopLevelParts:!0,mouseDrop:function(e){e.diagram.commandHandler.addTopLevelParts(e.diagram.selection,!0)||e.diagram.currentTool.doCancel()},commandHandler:e(z),"clickCreatingTool.archetypeNodeData":{text:"未命名",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:function(e){var n=e.subject;n.location=n.location.copy().snapToGridPoint(e.diagram.grid.gridOrigin,e.diagram.grid.gridCellSize),setTimeout((function(){e.diagram.commandHandler.editTextBlock()}),20)},"commandHandler.archetypeGroupData":{isGroup:!0,text:"NEW GROUP"},SelectionGrouped:function(e){e.subject;setTimeout((function(){e.diagram.commandHandler.editTextBlock()}))},LinkRelinked:function(e){e.parameter.part.invalidateConnectedLinks();var n=e.subject;e.diagram.toolManager.linkingTool.isForwards?n.toNode.invalidateConnectedLinks():n.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),i.current.nodeTemplate=e(D.Node,"Auto",{locationSpot:D.Spot.Center,locationObjectName:"SHAPE",desiredSize:new D.Size(120,60),minSize:new D.Size(40,40),resizable:!0,resizeCellSize:new D.Size(10,10),rotatable:!0},new D.Binding("location","loc",D.Point.parse).makeTwoWay(D.Point.stringify),new D.Binding("desiredSize","size",D.Size.parse).makeTwoWay(D.Size.stringify),e(D.Shape,{name:"SHAPE",fill:u,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:D.Spot.AllSides,toSpot:D.Spot.AllSides},new D.Binding("figure"),new D.Binding("fill"),new D.Binding("stroke","borderColor"),new D.Binding("strokeWidth","thickness"),new D.Binding("strokeDashArray","dash")),e(D.Shape,{width:100,height:20,strokeWidth:0,fill:"transparent"}),e(D.TextBlock,{margin:1,textAlign:"center",overflow:D.TextBlock.OverflowEllipsis,editable:!0},new D.Binding("text").makeTwoWay(),new D.Binding("stroke","color"))),i.current.nodeTemplate.toolTip=e("ToolTip",e(D.Panel,"Vertical",{maxSize:new D.Size(200,NaN)},e(D.TextBlock,{font:"bold 10pt sans-serif",textAlign:"center"},new D.Binding("text")),e(D.TextBlock,{font:"10pt sans-serif",textAlign:"center"},new D.Binding("text","details")))),i.current.nodeTemplate.selectionAdornmentTemplate=e(D.Adornment,"Spot",e(D.Placeholder,{padding:10}),_(D.Spot.Top,"TriangleUp"),_(D.Spot.Left,"TriangleLeft"),_(D.Spot.Right,"TriangleRight"),_(D.Spot.Bottom,"TriangleDown"),w({alignment:new D.Spot(.75,0)})),i.current.nodeTemplate.contextMenu=e("ContextMenu",e("ContextMenuButton",e(D.Panel,"Horizontal",N("Rectangle"),N("RoundedRectangle"),N("Ellipse"),N("Diamond"))),e("ContextMenuButton",e(D.Panel,"Horizontal",N("Parallelogram2"),N("ManualOperation"),N("Procedure"),N("Cylinder1"))),e("ContextMenuButton",e(D.Panel,"Horizontal",N("Terminator"),N("CreateRequest"),N("Document"),N("TriangleDown"))),b(),k(),Z()),i.current.groupTemplate=e(D.Group,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:D.Spot.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:function(e,n){n.addMembers(n.diagram.selection,!0)||n.diagram.currentTool.doCancel()},avoidable:!1},new D.Binding("location","loc",D.Point.parse).makeTwoWay(D.Point.stringify),e(D.Panel,"Auto",{name:"BODY"},e(D.Shape,{parameter1:10,fill:u,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:D.Spot.AllSides,toSpot:D.Spot.AllSides},new D.Binding("fill"),new D.Binding("stroke","color"),new D.Binding("strokeWidth","thickness"),new D.Binding("strokeDashArray","dash")),e(D.Placeholder,{background:"transparent",margin:20})),e(D.TextBlock,{alignment:D.Spot.Top,alignmentFocus:D.Spot.Bottom,font:"bold 12pt sans-serif",editable:!0},new D.Binding("text"),new D.Binding("stroke","color"))),i.current.groupTemplate.selectionAdornmentTemplate=e(D.Adornment,"Spot",e(D.Panel,"Auto",e(D.Shape,{fill:null,stroke:"dodgerblue",strokeWidth:3}),e(D.Placeholder,{margin:1.5})),w({alignment:D.Spot.TopRight,alignmentFocus:D.Spot.BottomRight})),i.current.groupTemplate.contextMenu=e("ContextMenu",b(),k(),Z()),i.current.linkTemplate=e(D.Link,{layerName:"Foreground",routing:D.Link.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new D.Binding("fromSpot","fromSpot",D.Spot.parse),new D.Binding("toSpot","toSpot",D.Spot.parse),new D.Binding("fromShortLength","dir",(function(e){return e>=1?10:0})),new D.Binding("toShortLength","dir",(function(e){return e>=1?10:0})),new D.Binding("points").makeTwoWay(),e(D.Shape,{strokeWidth:2},new D.Binding("stroke","color"),new D.Binding("strokeWidth","thickness"),new D.Binding("strokeDashArray","dash")),e(D.Shape,{segmentIndex:0,segmentOffset:new D.Point(15,0),segmentOrientation:D.Link.OrientAlong,alignmentFocus:D.Spot.Right,figure:"circle",width:10,strokeWidth:0},new D.Binding("fill","color"),new D.Binding("visible","dir",(function(e){return 1===e}))),e(D.Shape,{segmentIndex:-1,segmentOffset:new D.Point(-10,6),segmentOrientation:D.Link.OrientPlus90,alignmentFocus:D.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new D.Binding("fill","color"),new D.Binding("visible","dir",(function(e){return e>=1})),new D.Binding("width","thickness",(function(e){return 7+3*e})),new D.Binding("height","thickness",(function(e){return 7+3*e})),new D.Binding("segmentOffset","thickness",(function(e){return new D.Point(-15,4+1.5*e)}))),e(D.Shape,{segmentIndex:0,segmentOffset:new D.Point(15,-6),segmentOrientation:D.Link.OrientMinus90,alignmentFocus:D.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new D.Binding("fill","color"),new D.Binding("visible","dir",(function(e){return 2===e})),new D.Binding("width","thickness",(function(e){return 7+3*e})),new D.Binding("height","thickness",(function(e){return 7+3*e})),new D.Binding("segmentOffset","thickness",(function(e){return new D.Point(-15,4+1.5*e)}))),e(D.TextBlock,{alignmentFocus:new D.Spot(0,1,-4,0),editable:!0},new D.Binding("text").makeTwoWay(),new D.Binding("stroke","color"))),i.current.linkTemplate.selectionAdornmentTemplate=e(D.Adornment,e(D.Shape,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:L(2)},new D.Binding("pathPattern","thickness",L)),w({alignmentFocus:new D.Spot(0,0,-6,-4)})),i.current.linkTemplate.contextMenu=e("ContextMenu",k(),Z(),e("ContextMenuButton",e(D.Panel,"Horizontal",M(0),M(1),M(2))),e("ContextMenuButton",e(D.Panel,"Horizontal",e(D.Panel,"Spot",C(!1),A(D.Spot.Top,!1),A(D.Spot.Left,!1),A(D.Spot.Right,!1),A(D.Spot.Bottom,!1)),e(D.Panel,"Spot",{margin:new D.Margin(0,0,0,2)},C(!0),A(D.Spot.Top,!0),A(D.Spot.Left,!0),A(D.Spot.Right,!0),A(D.Spot.Bottom,!0))))),new D.Palette(a.current,{maxSelectionCount:1,linkTemplate:e(D.Link,{locationSpot:D.Spot.Center,selectionAdornmentTemplate:e(D.Adornment,"Link",{locationSpot:D.Spot.Center},e(D.Shape,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),e(D.Shape,{toArrow:"Standard",stroke:null}))},{routing:D.Link.AvoidsNodes,curve:D.Link.JumpOver,corner:5,toShortLength:4},new D.Binding("points"),e(D.Shape,{isPanelMain:!0,strokeWidth:2}),e(D.Shape,{toArrow:"Standard",stroke:null})),model:new D.GraphLinksModel([{text:"未命名",size:"100 100",fill:null,stroke:"#000"}].concat(B()(D.Shape.getFigureGenerators().toArray().map((function(e){return{text:"未命名",size:"100 100",figure:e.key,fill:"white",stroke:"#666",borderColor:"#000"}})))))}).nodeTemplate=e(D.Node,"Auto",{locationSpot:D.Spot.Center},new D.Binding("location","location",D.Point.parse).makeTwoWay(D.Point.stringify),e(D.Shape,"Circle",{fill:"white",stroke:"gray",strokeWidth:2,width:20,height:20,portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromLinkableSelfNode:!0,toLinkableSelfNode:!0},new D.Binding("stroke").makeTwoWay(),new D.Binding("fill").makeTwoWay(),new D.Binding("figure")),e(D.TextBlock,{margin:new D.Margin(5,5,3,5),font:"10pt sans-serif",minSize:new D.Size(16,16),maxSize:new D.Size(10,NaN),textAlign:"center",editable:!0},new D.Binding("key").makeTwoWay())),setTimeout((function(){i.current.grid=e(D.Panel,"Grid",e(D.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(D.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),i.current.grid.visible=!0,i.current.grid.gridCellStroke="darkgray",i.current.grid.gridCellStrokeWidth=1}),300),window.myDiagrams=i.current,i.current},divClassName:"diagram-component",style:{height:"80vh"}}),(0,h.jsx)("div",{ref:o})]})]}),(0,h.jsx)("div",{className:"tr",children:(0,h.jsx)(k.ZP,{size:"large",onClick:f,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary",children:"保存到编辑器"})})]})})})},q=t(5112),J=t(94001),Q=q.ZP.Group,K={margin:"0 8px"},X=function(e){var n=e.callback,t=e.onCancel;return(0,h.jsxs)(j.Z,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(e){n(e)},children:[(0,h.jsxs)("div",{className:"flex-container",style:{alignItems:"baseline"},children:[(0,h.jsx)("span",{style:K,children:"单元格数:"}),(0,h.jsx)("span",{style:K,children:"行数"}),(0,h.jsx)(j.Z.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}],children:(0,h.jsx)(J.Z,{})}),(0,h.jsx)("span",{style:K,children:"列数"}),(0,h.jsx)(j.Z.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}],children:(0,h.jsx)(J.Z,{})})]}),(0,h.jsxs)("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"},children:[(0,h.jsx)("span",{style:K,children:"对齐方式:"}),(0,h.jsx)(j.Z.Item,{name:"align",children:(0,h.jsxs)(Q,{children:[(0,h.jsx)(q.ZP,{value:"default",children:(0,h.jsx)("i",{className:"fa fa-align-justify"})}),(0,h.jsx)(q.ZP,{value:"left",children:(0,h.jsx)("i",{className:"fa fa-align-left"})}),(0,h.jsx)(q.ZP,{value:"center",children:(0,h.jsx)("i",{className:"fa fa-align-center"})}),(0,h.jsx)(q.ZP,{value:"right",children:(0,h.jsx)("i",{className:"fa fa-align-right"})})]})})]}),(0,h.jsxs)("div",{className:"flex-container flex-end",children:[(0,h.jsx)(k.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,h.jsx)(k.ZP,{type:"ghost",onClick:t,children:"取消"})]})]})},$=t(78673),ee=t(27667),ne=t.n(ee),te=(0,c.forwardRef)((function(e,n){var t=e.use3d,i=e.width,o=e.height,a=e.callback,s=(e.showSaveButton,(0,c.useRef)()),l=(0,c.useRef)(),u=(0,c.useState)(!1),d=r()(u,2),p=d[0],m=d[1],f=(0,c.useRef)({id:s,appName:"graphing",width:i||1e3,height:o||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,c.useEffect)((function(){l.current=new(ne())(f.current,!0),window.onload=function(){l.current.inject("applet_container")}}),[]);var g=function(){var e=window.ggbApplet.getPNGBase64(1,!0,72);return a&&a(e),e};return(0,c.useEffect)((function(){f.current.appName=p?"3D":"graphing",l.current.inject("applet_container")}),[p]),(0,c.useEffect)((function(){m(t)}),[t]),(0,c.useImperativeHandle)(n,(function(){return{getImgData:g}})),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:s}),(0,h.jsxs)(L.Z,{align:"middle",children:[(0,h.jsx)(F.Z,{flex:1,children:(0,h.jsx)($.Z,{size:"default",checkedChildren:"关闭3D图像",unCheckedChildren:"开启3D图像",checked:p,onChange:function(e){return m(e)}})}),(0,h.jsx)(F.Z,{children:(0,h.jsx)(k.ZP,{size:"large",onClick:g,style:{zIndex:8,marginTop:10},type:"primary",children:"保存到编辑器"})})]})]})})),ie=t(51294),oe=t(98242),ae=t(8591),re="link",se="upload-image",le="add-flowchart",ce="draw-image",ue="code-block",de="add-table",pe="------------",me={default:pe,left:":".concat(pe),center:":".concat(pe,":"),right:"".concat(pe,":")},he=t(11788);var fe="@▁▁@",ge=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"];function xe(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var ve=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",_e=l()(l()({},ve+"-B","bold"),ve+"-I","italic"),we=l()(l()(l()(l()(l()(l()(l()(l()({},re,"添加链接"),ue,"添加代码块"),se,"添加图片"),ce,"添加画图"),le,"插入流程图"),de,"添加表格"),"maths-latex","数学图像"),"inline-latex","LATEX公式"),ye=function(e){var n=e.defaultValue,t=void 0===n?"":n,i=e.onChange,a=e.width,s=void 0===a?"100%":a,u=e.height,g=void 0===u?400:u,x=e.miniToolbar,v=void 0!==x&&x,_=e.isFocus,j=void 0!==_&&_,b=e.watch,k=e.insertTemp,S=e.mode,L=void 0===S?"markdown":S,M=e.id,A=void 0===M?"markdown-editor-id":M,I=e.showResizeBar,P=void 0!==I&&I,O=e.noStorage,E=void 0!==O&&O,B=e.showNullButton,D=void 0!==B&&B,H=e.showNullProgramButton,z=void 0!==H&&H,G=e.hidetoolBar,F=void 0!==G&&G,Y=e.fullScreen,W=void 0!==Y&&Y,V=e.onBlur,q=e.onCMBeforeChange,J=e.onFullScreen,Q=e.className,K=void 0===Q?"":Q,$=e.disablePaste,ee=void 0!==$&&$,ne=e.disabled,pe=void 0!==ne&&ne,ve=e.disabledFill,ye=void 0!==ve&&ve,je=e.placeholder,be=void 0===je?"":je,ke=e.values,Se=void 0===ke?"":ke,Te=e.extraUse,Ze=(0,c.useState)(null),Ne=r()(Ze,2),Le=Ne[0],Me=Ne[1],Ce=(0,c.useState)(t),Ae=r()(Ce,2),Ie=Ae[0],Pe=Ae[1],Oe=(0,c.useState)(b),Ee=r()(Oe,2),Be=Ee[0],De=Ee[1],He=(0,c.useState)(W),ze=r()(He,2),Ge=ze[0],Re=ze[1],Fe=(0,c.useState)(""),Ye=r()(Fe,2),We=Ye[0],Ve=Ye[1],Ue=(0,c.useState)(0),qe=r()(Ue,2),Je=qe[0],Qe=qe[1],Ke=(0,c.useState)(g),Xe=r()(Ke,2),$e=Xe[0],en=Xe[1],nn=(0,c.useState)(!1),tn=r()(nn,2),on=(tn[0],tn[1]),an=(0,c.useState)(0),rn=r()(an,2),sn=rn[0],ln=rn[1],cn=(0,c.useState)(0),un=r()(cn,2),dn=un[0],pn=un[1],mn=(0,c.useRef)(),hn=(0,c.useRef)(),fn=(0,c.useRef)(),gn=(0,c.useRef)();(0,c.useEffect)((function(){var e=window.scrollY||window.pageYOffset;Pe(Se),null==Le||Le.setValue(Se),window.scrollTo(0,e)}),[Se]),(0,c.useEffect)((function(){null==J||J(Ge)}),[Ge]),(0,c.useEffect)((function(){if(mn.current){var e=function(e,t){if(!ee){var i=t.clipboardData;if(i){var o=i.types.toString(),a=i.items;if("Files"===o||i.types.indexOf("Files")>-1){if(t.preventDefault(),"stex"==L)return;try{var r,s=a[1];"file"===(null===(r=a[0])||void 0===r?void 0:r.kind)&&(s=a[0]);var l=s.getAsFile(),c=l.name.split(".").pop();(0,N.I)(l,(function(e){var t,i,o;e.id?(null==l||null===(t=l.type)||void 0===t?void 0:t.indexOf("image"))>-1?n.replaceSelection("![,](/api/attachments/".concat(e.id,"?type=").concat(e.content_type,")")):(null==l||null===(i=l.type)||void 0===i?void 0:i.indexOf("video"))>-1?n.replaceSelection('<video width="100%" controls src="'.concat(oe.Z.API_SERVER,"/api/attachments/").concat(e.id,'"></video>')):(null==l||null===(o=l.type)||void 0===o?void 0:o.indexOf("pdf"))>-1?n.replaceSelection('<a href="'.concat(oe.Z.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(l.type,'&disposition=inline" target="_blank">').concat(l.name,"</a>")):ge.includes(c)?n.replaceSelection('<a href="'.concat(oe.Z.API_SERVER,"/api/attachments/").concat(e.id,'?type=office&disposition=inline" target="_blank">').concat(l.name,"</a>")):n.replaceSelection("[".concat(l.name,"](").concat(oe.Z.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}))}catch(t){ae.ZP.warning("请使用chrome浏览器粘贴")}return!0}return!0}return!0}t.preventDefault()},n=d().fromTextArea(mn.current,{mode:L,lineNumbers:!v,lineWrapping:!0,value:t,autoCloseTags:!0,autoCloseBrackets:!0});return n.on("keyup",(function(e,t){8===t.keyCode&&(""==e.getValue()?n.setOption("placeholder",be):n.setOption("placeholder",null))})),n.on("keydown",(function(e,n){if(8===n.keyCode){var t=function(e,n){var t=e.getDoc(),i=t.getCursor(),o=t.getLine(i.line),a=o.charAt(i.ch-1),r=o.lastIndexOf("@▁@",i.ch),s=o.lastIndexOf("@▁▁@",i.ch),l=r>s?r:s,c=r>s?3:4;if(-1===fe.indexOf(a))return null;if(console.log("change1:",n,e,o,i,l,r,s,a),l>=0&&i.ch-l<5){var u=l+c;return t.replaceRange("",{line:i.line,ch:l},{line:i.line,ch:u}),{line:i.line,ch:u}}return null}(e);t&&n.preventDefault()}})),j&&n.focus(),n.on("paste",e),pe&&n.on("beforeChange",(function(e,n){"paste"!==n.origin&&"+input"!==n.origin||n.cancel()})),Me(n),function(){n.off("paste",e)}}}),[]);var xn=(0,c.useCallback)((function(){hn.current}),[$e,hn,Ge]);(0,c.useEffect)((function(){if(Le){var e=function(){var e=new p.Z((function(e){var n,t=o()(e);try{for(t.s();!(n=t.n()).done;){var i=n.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&(xn(),Le.setSize("100%","100%"),Le.refresh())}}catch(e){t.e(e)}finally{t.f()}}));return e.observe(mn.current.parentElement),e}();return function(){var n,t;null!==(n=mn.current)&&void 0!==n&&n.parentElement&&e.unobserve(null===(t=mn.current)||void 0===t?void 0:t.parentElement)}}}),[Le,xn]),(0,c.useEffect)((function(){if(Le){for(var e=[],n=function(){var n=r()(i[t],2),o=n[0],a=n[1],s=l()({},o,(function(){vn(a)}));e.push(s),Le.addKeyMap(s)},t=0,i=Object.entries(_e);t<i.length;t++)n();return function(){for(var n=0,t=e;n<t.length;n++){var i=t[n];Le.removeKeyMap(i)}}}}),[Le]),(0,c.useEffect)((function(){W!==Ge&&Re(W)}),[W]),(0,he.Z)((function(){if(!E&&Je>0){var e=(new Date).getTime(),n=window.sessionStorage.getItem(A);e>=Je+1e4&&(!n||n!==Ie)&&(window.sessionStorage.setItem(A,Ie),on(!0))}}),1e4),(0,c.useEffect)((function(){De(b)}),[Le,b]),(0,c.useEffect)((function(){Le&&j&&Le.focus()}),[Le,j]),(0,c.useEffect)((function(){if(Be&&Le){var e=function(e){var n=e.target;if(gn.current){var t=n.scrollTop/n.scrollHeight;gn.current.scrollTop=gn.current.scrollHeight*t}},n=Le.getScrollerElement();return n.addEventListener("scroll",e),function(){n.removeEventListener("scroll",e)}}}),[Le,Be]),(0,c.useEffect)((function(){if(Le&&q){var e=function(e,n){q(e,n)};return Le.on("beforeChange",e),function(){Le.off("beforeChange",e)}}}),[Le,q]),(0,c.useEffect)((function(){if(Le&&V){var e=function(){V(Le.getValue())};return Le.on("blur",e),function(){Le.off("blur",e)}}}),[Le,V]),(0,c.useEffect)((function(){if(Le){var e=function(e,n){var t=e.getValue();Pe(t),Qe((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),i&&(z?i(t,bn(t)):i(t))};return Le.on("change",e),function(){Le.off("change",e)}}}),[Le,i]),(0,c.useEffect)((function(){if(Le)if(null==t)Le.setValue(""),Pe("");else{var e=window.scrollY||window.pageYOffset;t!==Le.getValue()&&(Le.setValue(t),Pe(t),Le.setCursor(pe?1:Le.lineCount(),0),window.scrollTo(0,e))}}),[Le,t]);var vn=(0,c.useCallback)((function(e){var n=Le.getCursor(),t=Le.getSelection(),i=t.split("\n");switch(e){case"bold":return Le.replaceSelection("**"+t+"**"),""===t&&Le.setCursor(n.line,n.ch+2),Le.focus();case"italic":return Le.replaceSelection("*"+t+"*"),""===t&&Le.setCursor(n.line,n.ch+1),Le.focus();case"code":return Le.replaceSelection("`"+t+"`"),""===t&&Le.setCursor(n.line,n.ch+1),Le.focus();case"inline-latex":return Ve("inline-latex"),Le.focus();case"latex":return Le.replaceSelection("```latex\n"+t+"\n```"),Le.setCursor(n.line+1,t.length+1),Le.focus();case"line-break":return Le.replaceSelection("<br/>\n"),Le.focus();case"list-ul":return""===t?Le.replaceSelection("- "+t):Le.replaceSelection(i.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),Le.focus();case"list-ol":return""===t?Le.replaceSelection("1. "+t):Le.replaceSelection(i.map((function(e,n){return""===e?"":"".concat(n+1,". ").concat(e)})).join("\n")),Le.focus();case"add-null-ch":return""===t&&Le.setCursor(n.line,n.ch),Le.replaceSelection("▁"),Le.focus();case"add-signal":return""===t&&Le.setCursor(n.line,n.ch),Le.replaceSelection("@▁@"),Le.focus();case"add-multiple":return""===t&&Le.setCursor(n.line,n.ch),Le.replaceSelection(fe),Le.focus();case"inster-template-1":return""===t&&Le.setCursor(n.line,n.ch),Le.replaceSelection("\n**模板标题**\n模板正文内容可输入文本内容和粘贴图片等操作"),Le.focus();case"eraser":return Le.setValue(""),Le.focus();case"trigger-watch":return De(!Be),Le.focus();case"trigger-full-screen":return Re(!Ge),Le.focus();case re:return void Ve(re);case ue:return void Ve(ue);case se:return void Ve(se);case ce:return void Ve(ce);case"maths-latex":return void Ve("maths-latex");case le:return void Ve(le);case de:return void Ve(de);default:throw new Error}}),[Le,Be,Ge]),_n=(0,c.useCallback)((function(e,n){var t,i,o,a,r;switch(Ve(""),We){case re:var s=e.title,l=e.link;return Le.replaceSelection("[".concat(s,"](").concat(l,")")),Le.focus();case ue:var c=e.language,u=e.content;return Le.replaceSelection(["```"+c,u,"```"].join("\n")),Le.focus();case"maths-latex":for(var d=atob(e),p=new Uint8Array(d.length),m=0;m<d.length;m++)p[m]=d.charCodeAt(m);var h=new Blob([p],{type:"image/png"});(0,N.I)(h,(function(e){e.id?Le.replaceSelection("![,](/api/attachments/".concat(e.id,"?type=").concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}));break;case"inline-latex":Le.replaceSelection("`$$"+e+"$$`");break;case se:case ce:case"add-flowchart":var f=e.src,g=e.alt,x=n,v=null==x||null===(t=x.name)||void 0===t||null===(t=t.split("."))||void 0===t||null===(i=t.pop)||void 0===i?void 0:i.call(t);return(null==x||null===(o=x.type)||void 0===o?void 0:o.indexOf("image"))>-1||null==x||!x.type?g?Le.replaceSelection("![ ".concat(g," ]( ").concat(f,' "').concat(g,'" )')):Le.replaceSelection("![,](".concat(f,")")):(null==x||null===(a=x.type)||void 0===a?void 0:a.indexOf("video"))>-1?Le.replaceSelection('<video width="100%" controls src="'.concat(oe.Z.API_SERVER).concat(f,'"></video>')):(null==x||null===(r=x.type)||void 0===r?void 0:r.indexOf("pdf"))>-1?Le.replaceSelection('<a href="'.concat(oe.Z.API_SERVER).concat(f,"?type=").concat(x.type,'&disposition=inline" target="_blank">').concat(x.name,"</a>")):ge.includes(v)?Le.replaceSelection('<a href="'.concat(oe.Z.API_SERVER).concat(f,'?type=office&disposition=inline" target="_blank">').concat(x.name,"</a>")):Le.replaceSelection("[".concat(x.name,"](").concat(oe.Z.API_SERVER).concat(f,")")),Le.focus();case de:for(var _=e.row,w=e.col,y=e.align,j="\n",b=0;b<_;b++){for(var k=[],S=[],T=0;T<w;T++)1===b&&S.push(me[y]),k.push(" ");1===b&&(j+="| ".concat(S.join(" | ")," |\n")),j+="| ".concat(k.join(1===w?"":" | ")," |\n")}return Le.replaceSelection(j+"\n"),Le.focus();default:throw new Error}}),[Le,We]),wn=(0,c.useMemo)((function(){switch(We){case re:return(0,h.jsx)(T,{callback:_n,onCancel:yn});case ue:return(0,h.jsx)(Z.Z,{callback:_n,onCancel:yn});case se:return(0,h.jsx)(N.Z,{callback:_n,onCancel:yn});case le:return(0,h.jsx)(U,{callback:_n,onCancel:yn});case de:return(0,h.jsx)(X,{callback:_n,onCancel:yn});case"maths-latex":return(0,h.jsx)(te,{showSaveButton:!0,callback:_n});case"inline-latex":return(0,h.jsx)(ie.Z,{showSaveButton:!0,callback:_n});default:return null}}),[We]);function yn(){Ve("")}(0,c.useEffect)((function(){if(fn.current){var e=function(e){o=!0,a=e.pageY},n=function(){o=!1},t=function(e){if(o){var n=e.pageY-a;n<0&&(n=0),n>300&&(n=300),en(g+n+"px")}},i=fn.current,o=!1,a=0;return i.addEventListener("mousedown",e),document.addEventListener("mousemove",t),document.addEventListener("mouseup",n),function(){i.removeEventListener("mousedown",e),document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",n)}}}),[Le,fn]),(0,c.useEffect)((function(){en(g)}),[g]);var jn={width:xe(s),height:xe($e)},bn=((0,c.useMemo)((function(){if(Je){var e=new Date(Je),n=e.getHours(),t=e.getMinutes(),i=e.getSeconds();return t=t<10?"0"+t:t,i=i<10?"0"+i:i,"".concat(n=n<10?"0"+n:n,":").concat(t,":").concat(i)}return 0}),[Je]),function(e){var n=[];if(z){e=e.replace(/(@▁▁@|@▁@)/g,(function(e,t,i){n.push({multiLine:!("@▁@"===e)})}))}return n});(0,c.useEffect)((function(){we[We]&&We!==ce&&We!==le&&setTimeout((function(){var e=document.getElementsByClassName("markdown-popup-form")[0],n=window.innerWidth/2-e.offsetWidth/2,t=window.innerHeight/2-e.offsetHeight/2;ln(n),pn(t)}),0)}),[We]);var kn=function(e,n,t,i){var o=document.body.clientHeight,a=document.body.clientWidth;return!(e<20&&t>e||e>a-20&&t<e||n<20&&i>n||n>o-20&&i<n)||(document.body.onmousemove=null,document.body.onmouseup=null,!1)};return(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)("div",{className:"markdown-editor-wrapper",ref:hn,children:(0,h.jsxs)("div",{className:"markdown-editor-container ".concat(K," ").concat(Be?"on-preview":""," ").concat(v?"mini":""," ").concat(Ge?"full-screen":""),style:jn,children:[(0,h.jsx)(w,{insertTemp:k,watch:Be,fullScreen:Ge,showNullButton:D,showNullProgramButton:z,onActionCallback:vn,hidetoolBar:F,extraUse:Te}),(0,h.jsxs)("div",{className:"markdown-editor-body",children:[(0,h.jsx)("div",{className:"codemirror-container",children:(0,h.jsx)("textarea",{ref:mn,placeholder:be})}),Be?(0,h.jsxs)("div",{ref:gn,className:"preview-container",children:["stex"===L&&(0,h.jsx)(f,{value:Ie}),"stex"!==L&&(0,h.jsx)(m.Z,{disabledFill:ye,showProgramFill:z,value:Ie})]}):null]})]})}),P?(0,h.jsx)("a",{ref:fn,className:"editor-resize"}):null,We===ce&&(0,h.jsx)(C,{callback:_n,onCancel:yn}),We===le&&(0,h.jsx)(U,{callback:_n,onCancel:yn}),(0,h.jsx)(y.Z,{children:we[We]&&We!==ce&&We!==le?(0,h.jsx)(R.Z,{maskClosable:!1,centered:!0,style:{position:"absolute",left:sn,top:dn},title:(0,h.jsx)("div",{style:{cursor:"move"},onMouseDown:function(e){e.preventDefault();var n=e.clientX-sn,t=e.clientY-dn;document.body.onmousemove=function(e){var i=e.clientX-n,o=e.clientY-t,a=document.getElementsByClassName("markdown-popup-form")[0],r=window.innerWidth-a.offsetWidth,s=window.innerHeight-a.offsetHeight;i=Math.max(0,Math.min(i,r)),o=Math.max(0,Math.min(o,s)),kn(e.clientX,e.clientY,n,t)&&(ln(i),pn(o))},document.body.onmouseup=function(){document.body.onmousemove=null}},children:we[We]}),open:!0,onCancel:yn,footer:null,destroyOnClose:!0,width:We===le?"1200px":null,height:We===le?"80vh":null,className:"markdown-popup-form",children:wn}):null})]})}},55208:function(e,n,t){"use strict";t.d(n,{Z:function(){return x},I:function(){return _}});var i=t(82242),o=t.n(i),a=t(79800),r=t.n(a),s=t(78241),l=t(8591),c=t(92832),u=t(3113),d=t(10036),p=t(59301),m=t(37712),h=s.Z.useForm,f={width:280,marginRight:10},g={labelCol:{span:5},wrapperCol:{span:19}},x=function(e){var n=e.callback,t=e.onCancel,i=h(),a=r()(i,1)[0],d=(0,p.useRef)();function x(e,n){-1!==e.status?a.setFieldsValue({src:"/api/attachments/".concat(e.id),type:n.type}):l.ZP.error(e.message)}return(0,m.jsxs)(s.Z,o()(o()({form:a},g),{},{className:"upload-image-panel",onFinish:function(e){n(e,d.current)},style:{width:470,overflow:"hidden"},children:[(0,m.jsx)(s.Z.Item,{label:"图片地址",required:!0,children:(0,m.jsxs)("div",{className:"flex-container",children:[(0,m.jsx)(s.Z.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入图片地址"}],children:(0,m.jsx)(c.Z,{style:f})}),(0,m.jsx)(v,{onFileChange:function(e){var n=e.target.files[0];d.current=n,_(n,x)}})]})}),(0,m.jsx)(s.Z.Item,{label:"图片描述",name:"alt",children:(0,m.jsx)(c.Z,{style:{width:264}})}),(0,m.jsxs)(s.Z.Item,{style:{textAlign:"right"},children:[(0,m.jsx)(u.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,m.jsx)(u.ZP,{type:"default",onClick:t,children:"取消"})]})]}))};function v(e){var n=e.onFileChange;return(0,m.jsxs)("label",{className:"upload-button",style:{cursor:"pointer"},children:["本地上传",(0,m.jsx)("input",{type:"file",onChange:n})]})}function _(e,n){if(!e)throw new String("没有文件");var t=new FormData;t.append("editormd-image-file",e),t.append("file_param_name","editormd-image-file"),t.append("byxhr","true");var i=new window.XMLHttpRequest;i.withCredentials=!0,i.addEventListener("load",(function(t){n(JSON.parse(t.target.responseText),e)}),!1),i.addEventListener("error",(function(e){console.error(e)}),!1),i.open("POST","".concat(d.KI,"/api/attachments.json")),i.send(t)}},50605:function(e,n,t){"use strict";t.d(n,{Z:function(){return m}});var i=t(82100),o=t.n(i),a=t(29186),r=t.n(a),s=t(80619),l=t.n(s),c=t(47074),u=t.n(c),d=t(59301),p=t(4676),m=function(e){l()(t,e);var n=u()(t);function t(e){var i;o()(this,t),i=n.call(this,e);var a=window.document;return i.node=a.createElement("div"),a.body.appendChild(i.node),i}return r()(t,[{key:"render",value:function(){var e=this.props.children;return(0,p.createPortal)(e,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),t}(d.Component)},11788:function(e,n,t){"use strict";t.d(n,{Z:function(){return o}});var i=t(59301);function o(e,n){var t=(0,i.useRef)();(0,i.useEffect)((function(){t.current=e})),(0,i.useEffect)((function(){if(null!==n){var e=setInterval((function(){t.current()}),n);return function(){return clearInterval(e)}}}),[n])}},58469:function(e,n,t){"use strict";t.d(n,{Z:function(){return A}});var i=t(7557),o=t.n(i),a=t(41498),r=t.n(a),s=t(79800),l=t.n(s),c=t(82242),u=t.n(c),d=t(59301),p=t(5112),m=t(3113),h=t(8591),f=t(43418),g=t(94001),x=t(95237),v=t(43604),_=t(28103),w=t(76533),y="title___dVHM9",j=t(97600),b=t(24334),k=t(25600),S=t(81322),T=t(19211),Z=t(38524),N=t(3148),L=t(37064),M=t(37712),C={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,enableSplitViewResizing:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1};var A=function(e){var n=e.language,t=e.dispatch,i=e.shixunWorkReport,a=e.v,s=e.languages,c=e.classroomList,A=e.autoHeight,I=(e.diff_code_count,e.data,(0,d.useState)(null==s?void 0:s[0])),P=l()(I,2),O=P[0],E=P[1],B=(0,S.useParams)();return(0,d.useEffect)((function(){E(null==s?void 0:s[0])}),[]),(0,d.useEffect)((function(){var e;E(null==s||null===(e=s.filter((function(e){return e.language===(null==O?void 0:O.language)})))||void 0===e?void 0:e[0])}),[s]),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)("h2",{children:[" ",(0,M.jsxs)("span",{children:[a.is_finish?(0,M.jsxs)("span",{children:["最后通关代码",(0,M.jsx)("span",{className:"ml5 font12 c-grey-999",children:"通过了本题,在作业时间内最后一次提交的通关代码"})]}):(0,M.jsxs)("span",{children:["最新代码",(0,M.jsx)("span",{className:"ml5 font12 c-grey-999",children:"未通过本题,展示最新编写的代码详情"})]}),(null==s?void 0:s.length)>1&&(0,M.jsx)(p.ZP.Group,{defaultValue:n,style:{marginLeft:10},onChange:function(e){var n;a.language=e.target.value,E(null==s||null===(n=s.filter((function(n){return n.language===e.target.value})))||void 0===n?void 0:n[0])},children:null==s?void 0:s.map((function(e){return(0,M.jsx)(p.ZP,{value:null==e?void 0:e.language,children:null==e?void 0:e.language})}))})]}),(0,j.GJ)()&&"shixunWorkReport"!=i&&(0,M.jsxs)("span",{children:[(0,M.jsxs)("span",{children:["得分 ",null==O?void 0:O.score,"/",null==O?void 0:O.total_score]}),(0,M.jsx)(m.ZP,{style:{margin:"0px 10px"},onClick:function(){var e;if(null!==(e=c.AssistantObject)&&void 0!==e&&null!==(e=e.hack)&&void 0!==e&&e.can_appraise||!(0,j.Rm)()){var n,i=null==O?void 0:O.score;f.Z.confirm({title:"调分",content:(0,M.jsxs)("div",{children:[(0,M.jsxs)("p",{children:["得分:",null==O?void 0:O.score,"/",null==O?void 0:O.total_score]}),(0,M.jsxs)("p",{children:["调分:",(0,M.jsx)(g.Z,{min:0,max:null==O?void 0:O.total_score,defaultValue:null==O?void 0:O.score,onChange:function(e){i=e}})]})]}),okText:"确认",onOk:(n=r()(o()().mark((function e(){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,k.ZP)("/api/courses/".concat(null==B?void 0:B.coursesId,"/homework_commons/update_hack_score"),{method:"put",body:{course_id:null==B?void 0:B.coursesId,hack_user_code_id:null==O?void 0:O.hack_user_id,score:i}});case 2:0===e.sent.status&&(h.ZP.success("调分成功"),t({type:"shixunHomeworks/setActionTabs",payload:{}}),t({type:"shixunHomeworks/getShixunWorkReports",payload:u()({},B)}));case 4:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)}),cancelText:"取消"})}else h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},type:"primary",children:"调分"}),(0,j.GJ)()&&"shixunWorkReport"!=i&&(0,M.jsx)(m.ZP,{onClick:function(){var e;null!==(e=c.AssistantObject.hack)&&void 0!==e&&e.can_appraise||!(0,j.Rm)()?t({type:"shixunHomeworks/setActionTabs",payload:{key:"更改点评",selectArrs:{myshixun_identifier:i.user_id,type:"1",language:null==O?void 0:O.language,v:a,data:u()({},i)}}}):h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:"点评代码"})]})]}),(0,M.jsx)(w.ZP,{height:300,language:null==O?void 0:O.language,value:null!=O&&O.code?b.Base64.decode(null==O?void 0:O.code):"",autoHeight:A,theme:"default",options:C}),((null==O?void 0:O.comment)||(null==O?void 0:O.hidden_comment))&&(0,M.jsxs)("div",{children:[(0,M.jsxs)(x.Z,{align:"middle",style:{borderTop:"1px solid #eee"},children:[(0,M.jsx)(v.Z,{flex:1,children:(0,M.jsx)("h1",{className:y,children:"点评内容"})}),(0,M.jsx)(v.Z,{className:"pr30",children:(0,j.GJ)()&&(0,M.jsxs)(m.ZP,{onClick:r()(o()().mark((function e(){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",icon:(0,M.jsx)(N.Z,{}),content:"是否确认删除?",onOk:function(){return r()(o()().mark((function e(){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Z.gZ)({comment_id:null==O?void 0:O.comment_id,homeworkId:B.homeworkId,type:"hack"});case 2:0===e.sent.status&&(h.ZP.success("删除成功"),t({type:"shixunHomeworks/getShixunWorkReports",payload:u()({},B)}));case 4:case"end":return e.stop()}}),e)})))()}});case 1:case"end":return e.stop()}}),e)}))),children:[(0,M.jsx)(L.Z,{}),"删除"]})})]}),(0,M.jsx)(_.Z,{style:{margin:0}}),(null==O?void 0:O.comment)&&(0,M.jsxs)("aside",{className:"pl30 pr30 mt20",children:[(0,M.jsx)("span",{className:"c-light-black font12",children:"# 学生和课堂老师可见"}),(0,M.jsx)("br",{}),(0,M.jsx)(T.Z,{value:null==O?void 0:O.comment})]}),(null==O?void 0:O.hidden_comment)&&(0,M.jsxs)("aside",{className:"pl30 pr30 mt20",children:[(0,M.jsx)("span",{className:"c-light-black font12",children:"# 仅课堂老师可见"}),(0,M.jsx)("br",{}),(0,M.jsx)(T.Z,{value:null==O?void 0:O.hidden_comment})]})]})]})}},23730:function(e,n,t){"use strict";var i=t(7557),o=t.n(i),a=t(82242),r=t.n(a),s=t(41498),l=t.n(s),c=t(39647),u=t.n(c),d=(t(59301),t(43418)),p=t(8591),m=t(25600),h=t(81322),f=t(37712),g=["shixunHomeworks","dispatch"];n.Z=(0,h.connect)((function(e){return{shixunHomeworks:e.shixunHomeworks}}))((function(e){var n=e.shixunHomeworks,t=e.dispatch,i=(u()(e,g),(0,h.useParams)());return(0,f.jsxs)(d.Z,{centered:!0,title:"提示",open:"打回重做"===n.actionTabs.key,okText:"确定",cancelText:"取消",onOk:l()(o()().mark((function e(){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,m.ZP)("/api/myshixuns/".concat(n.actionTabs.selectArrs.myshixun_identifier,"/reset_my_game.json"),{method:"GET",params:{course_id:i.coursesId}});case 2:e.sent.shixun_identifier&&(p.ZP.success("操作成功"),t({type:"shixunHomeworks/setActionTabs",payload:{}}),t({type:"shixunHomeworks/getWorkList",payload:r()({},n.actionTabs.params)}));case 4:case"end":return e.stop()}}),e)}))),onCancel:function(){t({type:"shixunHomeworks/setActionTabs",payload:{}})},children:[(0,f.jsx)("p",{children:"该作业将被打回重做,学生实训记录将被清空!"}),(0,f.jsx)("p",{children:"确定打回?"})]})}))},65762:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return rn}});var i=t(82242),o=t.n(i),a=t(7557),r=t.n(a),s=t(41498),l=t.n(s),c=t(79800),u=t.n(c),d=t(59301),p=t(25600),m=t(81322),h=t(8591),f=t(43418),g=t(3113),x=t(66104),v=t(6848),_=t(99313),w=t(51945),y=t(40362),j=t(34601),b=t(19211),k=t(37712),S=(0,m.connect)((function(e){return{shixunHomeworks:e.shixunHomeworks}}))((function(e){var n=e.shixunHomeworks,t=e.dispatch;(0,m.useParams)();return(0,k.jsx)(f.Z,{centered:!0,title:"提示",open:"删除"===n.actionTabs.key,okText:"确定",cancelText:"取消",onOk:l()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t({type:"shixunHomeworks/deleteReply",payload:{object_id:n.actionTabs.selectArr.id,object_type:"journals_for_message"}});case 2:0===e.sent.status&&(h.ZP.success("删除成功"),t({type:"shixunHomeworks/setActionTabs",payload:{}}),t({type:"shixunHomeworks/getReplyList",payload:o()({},n.actionTabs.params)}));case 4:case"end":return e.stop()}}),e)}))),onCancel:function(){t({type:"shixunHomeworks/setActionTabs",payload:{}})},children:(0,k.jsx)("p",{children:"确定要删除该条回复吗?"})})})),T=t(61186),Z=t.n(T),N=t(71418),L=t(86859),M={flex_box_center:"flex_box_center___zN9Rd",flex_space_between:"flex_space_between___OHt3Z",flex_box_vertical_center:"flex_box_vertical_center___xzO8Q",flex_box_center_end:"flex_box_center_end___LuRwh",flex_box_column:"flex_box_column___rEgTS",top:"top___vNhKr",desc:"desc___IlwMy",liked:"liked___gFxXM",likedActive:"likedActive___bEcK_",reply:"reply___q4nj7",replyList:"replyList___qxCAX",comment:"comment___gIcRF"},C=t(97600),A=t(64461);Z().locale("ZH-cn");var I=["","简单","中等","困难"],P=(0,m.connect)((function(e){var n=e.shixunHomeworks,t=e.classroomList,i=e.loading,o=e.user;return{shixunHomeworks:n,globalSetting:e.globalSetting,classroomList:t,user:o,loading:i.effects}}))((function(e){var n,t,i=e.shixunHomeworks,a=e.classroomList,s=(e.globalSetting,e.user,e.loading,e.dispatch,(0,d.useState)(o()(o()({},(0,m.useParams)()),{},{per_page:10}))),c=u()(s,2),x=c[0],v=c[1],y=(0,d.useState)([]),j=u()(y,2),T=j[0],Z=j[1],P=(0,d.useState)(-1),O=u()(P,2),E=(O[0],O[1],(0,d.useState)("")),B=u()(E,2),D=(B[0],B[1],(0,d.useState)("")),H=u()(D,2),z=(H[0],H[1],a.detailLeftMenus,(0,m.useLocation)(),(0,d.useState)({})),G=u()(z,2),R=(G[0],G[1],i.workDetail,i.workList),F=(0,d.useState)("1"),Y=u()(F,2),W=Y[0],V=Y[1],U=(0,d.useState)(!1),q=u()(U,2),J=q[0],Q=q[1];function K(){return X.apply(this,arguments)}function X(){return(X=l()(r()().mark((function e(){var n,t,i;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Q(!0),e.next=3,(0,p.ZP)("/api/courses/".concat(x.coursesId,"/homework_commons/edit_hack_homework.json"),{method:"get",params:o()(o()({},x),{},{id:x.categoryId})});case 3:if(t=e.sent,Z(t),Q(!1),x.defaultExpandedRowKeys=["".concat(null==t||null===(n=t.data)||void 0===n||null===(n=n[0])||void 0===n?void 0:n.identifier)],"2"==W){e.next=11;break}if(null===(i=R.homework_status)||void 0===i||!i.includes("导入")){e.next=10;break}return e.abrupt("return");case 10:V(null!=t&&t.description?"1":"2");case 11:v(o()({},x));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,d.useEffect)((function(){R.homework_status&&K()}),[R]),(0,k.jsxs)("section",{className:M.bg,children:[(0,k.jsx)(N.Z,{spinning:J,children:(0,k.jsxs)(_.Z,{onChange:function(e){V(e)},activeKey:W,children:[(0,k.jsx)(_.Z.TabPane,{tab:"说明",children:(0,k.jsxs)("section",{className:" edu-container",style:{padding:"20px 20px",background:"#fff"},children:[!(null!=T&&T.description)&&(0,k.jsx)(A.Z,{customText:"暂无说明"}),(0,k.jsx)(b.Z,{value:(null==T?void 0:T.description)||""})]})},1),!(null!==(n=R.homework_status)&&void 0!==n&&n.includes("导入"))&&(0,k.jsx)(_.Z.TabPane,{tab:"题目列表",children:(0,k.jsxs)("div",{children:[(0,k.jsx)("section",{className:" edu-container",style:{padding:"20px 20px",background:"#fff"},children:x.defaultExpandedRowKeys&&(0,k.jsx)(w.Z,{dataSource:null==T?void 0:T.data,rowKey:function(e){return null==e?void 0:e.identifier},pagination:!1,expandable:{expandedRowRender:function(e){var n,t;return(0,k.jsxs)("div",{style:{padding:"10px 48px",borderRadius:2},children:[(0,k.jsxs)("p",{children:["题目:",null==e?void 0:e.name]}),(0,k.jsxs)("p",{children:["描述:",null==e?void 0:e.description]}),!(0,C.dE)()&&(0,k.jsxs)("p",{children:["题目解析:",(0,k.jsx)(b.Z,{style:{fontSize:"14px"},value:(null==e?void 0:e.analysis)||"暂无解析"})]}),(0,k.jsxs)("div",{style:{width:"100%",textAlign:"end"},children:[(0,C.GJ)()&&(null==T||null===(n=T.homework_status)||void 0===n?void 0:n.includes("未发布"))&&(0,k.jsx)(g.ZP,{type:"primary",ghost:!0,onClick:function(){window.open("/problems/".concat(null==e?void 0:e.identifier,"/edit?type=1")),localStorage.setItem("program_homework",[x.coursesId,x.categoryId])},children:"编辑"}),(0,C.GJ)()&&(null==T||null===(t=T.homework_status)||void 0===t?void 0:t.includes("未发布"))&&(0,k.jsx)(g.ZP,{type:"primary",style:{marginLeft:20},ghost:!0,onClick:function(){var n;f.Z.confirm({title:"提示",content:"是否确认删除",okText:"确认",cancelText:"取消",onOk:(n=l()(r()().mark((function n(){var t;return r()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,p.ZP)("/api/problems/".concat(null==e?void 0:e.identifier,".json"),{method:"delete"});case 2:0===(null==(t=n.sent)?void 0:t.status)&&(h.ZP.info("删除成功"),x.page=1,K());case 4:case"end":return n.stop()}}),n)}))),function(){return n.apply(this,arguments)})})},children:"删除"})]})]})},defaultExpandedRowKeys:x.defaultExpandedRowKeys},columns:[{title:"题目",dataIndex:"name",ellipsis:!0,width:"20%",key:"name"},{title:"难度",dataIndex:"difficult",key:"difficult",render:function(e,n,t){return(0,k.jsx)("div",{children:I[e]})}},{title:"通过率",dataIndex:"pass_rate",key:"pass_rate"},{title:"通过人数",dataIndex:"submit_info",key:"submit_info"},{title:"知识点",dataIndex:"tag_discipline",ellipsis:!0,width:"10%",key:"tag_discipline"},{title:"操作",dataIndex:"identifier",key:"identifier",render:function(e,n,t){return(0,k.jsxs)("div",{children:[(0,k.jsx)("a",{onClick:function(){var n;!(0,C.Rm)()||null!==(n=a.AssistantObject.hack)&&void 0!==n&&n.can_question_eaderboard?window.open("/classrooms/".concat(x.coursesId,"/program_homework/").concat(x.categoryId,"/").concat(e,"/ranking")):h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:"排行"}),(0,k.jsx)("a",{onClick:l()(r()().mark((function e(){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,p.ZP)("/api/problems/".concat(null==n?void 0:n.identifier,"/start.json"),{method:"get"});case 2:(t=e.sent)&&(window.open("/myproblems/".concat(null==t?void 0:t.identifier,"?type=1")),localStorage.setItem("program_homework",[x.coursesId,x.categoryId]));case 4:case"end":return e.stop()}}),e)}))),style:{margin:"0px 20px"},children:(0,C.GJ)()?"体验":"进入答题"})]})}}]})}),console.log("---",["".concat(null==T||null===(t=T.data)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.identifier)]),(0,k.jsx)("aside",{className:"tc mt30 pb30",children:(0,k.jsx)(L.Z,{defaultCurrent:1,total:null==T?void 0:T.count,hideOnSinglePage:!0,showTotal:function(e){return(0,k.jsxs)("span",{children:["共",e,"条"]})},current:x.page||1,pageSize:x.per_page||10,onChange:function(e,n){x.page=e,x.per_page=n,v(o()({},x)),K()}})})]})},2)]})}),(0,k.jsx)(S,{})]})})),O=t(37205),E=t.n(O),B=t(85573),D=t.n(B),H=t(78241),z=t(20834),G=t(24905),R=t(95237),F=t(43604),Y=t(92832),W=t(38854),V=t(5112),U=t(94001),q=t(46952),J=t(80836),Q=t(98578),K=t(44483),X=t(23730),$=t(39647),ee=t.n($),ne=t(90584),te=["shixunHomeworks","dispatch"],ie=(0,m.connect)((function(e){return{shixunHomeworks:e.shixunHomeworks}}))((function(e){var n=e.shixunHomeworks,t=e.dispatch,i=(ee()(e,te),(0,m.useParams)()),a=(0,d.useState)(!0),s=u()(a,2),c=s[0],g=s[1],x=(0,d.useState)(!1),v=u()(x,2),_=v[0],w=v[1],y=H.Z.useForm(),j=u()(y,1)[0],b=function(){var e=l()(r()().mark((function e(){var a;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=j.getFieldValue(),e.next=3,(0,p.ZP)("/api/homework_commons/".concat(i.categoryId,"/batch_comment.json"),{method:"post",body:{student_work_ids:E()(n.actionTabs.selectArrs),cover_all:c,hidden_comment:a.hidden_comment,comment:a.comment}});case 3:0===e.sent.status&&(h.ZP.success("评阅成功"),j.resetFields(),t({type:"shixunHomeworks/setActionTabs",payload:{}}),t({type:"shixunHomeworks/getWorkList",payload:o()({},n.actionTabs.params)}));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(f.Z,{centered:!0,title:"一键点评",open:"一键点评"===n.actionTabs.key,okText:"确定",cancelText:"取消",onOk:l()(r()().mark((function e(){var i;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=j.getFieldValue(),"{}"===JSON.stringify(i)||""===i.hidden_comment&&""===i.comment?w(!0):n.workList.partial_comment?t({type:"shixunHomeworks/setActionTabs",payload:{key:"一键点评确认",selectArrs:n.actionTabs.selectArrs,params:n.actionTabs.params}}):b();case 2:case"end":return e.stop()}}),e)}))),onCancel:function(){t({type:"shixunHomeworks/setActionTabs",payload:{}})},children:[(0,k.jsxs)(H.Z,{form:j,onChange:function(){_&&w(!1)},children:[(0,k.jsx)("p",{children:"学生和课堂老师可见"}),(0,k.jsx)(H.Z.Item,{name:"comment",children:(0,k.jsx)(Y.Z.TextArea,{placeholder:"请输入评阅内容",rows:8})}),(0,k.jsx)("p",{children:"仅课堂老师可见"}),(0,k.jsx)(H.Z.Item,{name:"hidden_comment",children:(0,k.jsx)(Y.Z.TextArea,{placeholder:"请输入评阅内容",rows:8})})]}),_&&(0,k.jsx)("p",{className:"c-red",children:"评阅内容至少有一个不为空"})]}),(0,k.jsx)(f.Z,{centered:!0,title:(0,k.jsxs)("span",{children:[(0,k.jsx)(ne.Z,{className:"c-orange mr20"}),"提示"]}),open:"一键点评确认"===n.actionTabs.key,okText:"确定点评",cancelText:"放弃点评",onOk:function(){b()},onCancel:function(){t({type:"shixunHomeworks/setActionTabs",payload:{}})},width:400,children:(0,k.jsxs)("div",{className:"tc",children:[(0,k.jsx)("p",{children:"部分学生已有点评内容,是否覆盖已有点评内容?"}),(0,k.jsx)("p",{children:(0,k.jsxs)(V.ZP.Group,{onChange:function(e){g(e.target.value)},value:c,children:[(0,k.jsx)(V.ZP,{value:!0,children:"覆盖已有点评"}),(0,k.jsx)(V.ZP,{value:!1,children:"跳过已有点评"})]})})]})})]})})),oe=t(38524),ae="wrap___altfw",re="MdEditor___OuyKH",se="tr1___nwwbX",le=["shixunHomeworks","dispatch"],ce=(0,m.connect)((function(e){return{shixunHomeworks:e.shixunHomeworks}}))((function(e){var n,t,i=e.shixunHomeworks,o=e.dispatch,a=(ee()(e,le),(0,m.useParams)()),s=(0,d.useState)(!1),c=u()(s,2),g=c[0],x=c[1],v=(0,d.useState)(null===(n=i.actionTabs.selectArrs)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.name),_=u()(v,2),w=_[0],y=_[1],j=H.Z.useForm(),b=u()(j,1)[0];(0,d.useEffect)((function(){var e,n,t;"更改点评"===i.actionTabs.key&&b.setFieldsValue({comment:null===(e=i.actionTabs.selectArrs)||void 0===e||null===(e=e.data)||void 0===e?void 0:e.work_comment,hidden_comment:null===(n=i.actionTabs.selectArrs)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.work_comment_hidden}),y(null===(t=i.actionTabs.selectArrs)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.name)}),[i.actionTabs.key]);var S=function(){var e=l()(r()().mark((function e(){var n,t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=b.getFieldValue(),e.next=3,(0,p.ZP)("/api/student_works/".concat(null===(n=i.actionTabs.selectArrs)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.homeworkId,"/shixun_work_comment.json"),{method:"post",body:{hidden_comment:t.hidden_comment,comment:t.comment}});case 3:if(0!==e.sent.status){e.next=9;break}return h.ZP.success("评阅成功"),b.resetFields(),o({type:"shixunHomeworks/setActionTabs",payload:{}}),e.abrupt("return",o({type:"shixunHomeworks/getWorkList",payload:a}));case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,k.jsx)(k.Fragment,{children:(0,k.jsxs)(f.Z,{centered:!0,title:null!==(t=i.actionTabs.selectArrs)&&void 0!==t&&null!==(t=t.data)&&void 0!==t&&t.work_comment_hidden?"更改"+w+"点评":w+"点评",open:"更改点评"===i.actionTabs.key,okText:"确定",cancelText:"取消",onOk:l()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=b.getFieldValue(),"{}"===JSON.stringify(n)||""===n.hidden_comment&&""===n.comment?x(!0):S();case 2:case"end":return e.stop()}}),e)}))),onCancel:function(){o({type:"shixunHomeworks/setActionTabs",payload:{}})},children:[(0,k.jsxs)(H.Z,{form:b,onChange:function(){g&&x(!1)},children:[(0,k.jsx)("p",{children:"学生和课堂老师可见"}),(0,k.jsx)(H.Z.Item,{name:"comment",children:(0,k.jsx)(Y.Z.TextArea,{placeholder:"请输入评阅内容",rows:8})}),(0,k.jsx)("p",{children:"仅课堂老师可见"}),(0,k.jsx)(H.Z.Item,{name:"hidden_comment",children:(0,k.jsx)(Y.Z.TextArea,{placeholder:"请输入评阅内容",rows:8})})]}),g&&(0,k.jsx)("p",{className:"c-red",children:"评阅内容至少有一个不为空"})]})})})),ue=["shixunHomeworks","dispatch"],de=(0,m.connect)((function(e){return{shixunHomeworks:e.shixunHomeworks}}))((function(e){var n=e.shixunHomeworks,t=e.dispatch,i=(ee()(e,ue),(0,m.useParams)()),o=(0,d.useState)([]),a=u()(o,2),s=a[0],c=a[1],h=(0,d.useState)([]),g=u()(h,2),x=g[0],v=g[1];function _(){return(_=l()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,p.ZP)("/api/homework_commons/".concat(i.categoryId,"/code_quality_analyses/group_list.json"),{method:"GET",params:{page:1,limit:200}});case 2:n=e.sent,c(n);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,d.useEffect)((function(){"质量检测"===n.actionTabs.key&&function(){_.apply(this,arguments)}()}),[n.actionTabs.key]);return(0,k.jsx)(k.Fragment,{children:(0,k.jsx)(f.Z,{centered:!0,title:"代码质量评分",open:"质量检测"===n.actionTabs.key,width:700,okText:"确定",cancelText:"取消",onOk:l()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,p.ZP)("/api/homework_commons/".concat(i.categoryId,"/code_quality_analyses.json"),{method:"POST",body:{group_ids:x}});case 2:0===(null==(n=e.sent)?void 0:n.status)&&(m.history.replace("/classrooms/".concat(i.coursesId,"/shixun_homework/").concat(i.categoryId,"/detail?tabs=4")),window.location.reload(),t({type:"shixunHomeworks/setActionTabs",payload:{}}),v([]));case 4:case"end":return e.stop()}}),e)}))),onCancel:function(){v([]),t({type:"shixunHomeworks/setActionTabs",payload:{}})},children:(0,k.jsx)(w.Z,{rowSelection:{type:"checkbox",onChange:function(e,n){v(E()(e))},selectedRowKeys:x,getCheckboxProps:function(e){return{disabled:"进行中"===e.status||0===e.works_count}}},rowKey:function(e){return e.key||e.id},scroll:{y:300},pagination:!1,columns:[{title:"分班情况",dataIndex:"name"},{title:"有效作品数",dataIndex:"works_count"},{title:"检测进度",dataIndex:"status"},{title:"上次评分时间",dataIndex:"last_analysis_time"}],dataSource:null==s?void 0:s.group_list})})})})),pe=t(94064),me=t(14996),he=t(89736),fe=(0,m.connect)((function(e){return{shixunHomeworks:e.shixunHomeworks}}))((function(e){e.shixunHomeworks,e.dispatch;var n=e.isShow,t=e.setIsShow,i=e.item,a=(e.coursesId,e.categoryId,(0,d.useState)({page:1,limit:10})),s=u()(a,2),c=s[0],m=s[1],h=(0,d.useState)([]),g=u()(h,2),x=g[0],v=g[1],_=(0,d.useState)(!1),y=u()(_,2),j=y[0],b=y[1];function S(){return T.apply(this,arguments)}function T(){return(T=l()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b(!0),e.next=3,(0,p.ZP)("/api/student_works/".concat(i.id,"/game_details.json"),{method:"get",params:o()({},c)});case 3:n=e.sent,b(!1),0===n.status&&v(null==n?void 0:n.data);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,d.useEffect)((function(){n&&S()}),[n]);var Z=[{title:"序号",dataIndex:"number",width:50,fixed:"left",ellipsis:!0,render:function(e,n,t){return(0,k.jsx)("span",{style:{color:"#000"},children:c.limit*(c.page-1)+t+1})}},{title:"任务名称",dataIndex:"name",key:"name",ellipsis:!0,render:function(e,n,t){return(0,k.jsx)("span",{style:{color:"#000"},children:e})}},{title:"通关详情",dataIndex:"complete_status",key:"complete_status",ellipsis:!0,width:100,render:function(e,n,t){return(0,k.jsx)("span",{children:0==e?"未通关":4==e?"截止后通关":"已通关"})}},{title:"评测次数",dataIndex:"evaluate_count",key:"evaluate_count",width:100,ellipsis:!0,render:function(e,n,t){return(0,k.jsx)("span",{style:{color:"#333"},children:e})}},{title:"实训耗时",dataIndex:"time_consuming",key:"time_consuming",width:120,ellipsis:!0,render:function(e,n,t){return(0,k.jsx)("span",{style:{color:"#333"},children:e})}}];return(0,k.jsx)(k.Fragment,{children:(0,k.jsxs)(f.Z,{centered:!0,title:"通关情况",open:n,width:700,footer:null,maskClosable:!1,onCancel:function(){c.page=1,c.limit=10,m(o()({},c)),t(!1)},children:[(0,k.jsxs)("div",{style:{display:"flex",justifyContent:"flex-start",alignItems:"center",marginBottom:"20px"},children:[(0,k.jsxs)("div",{style:{maxWidth:"200px",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",WebkitLineClamp:1},children:[(0,k.jsx)("span",{style:{color:"#666",marginRight:"10px"},children:"学生姓名"}),(0,k.jsx)("span",{title:null==i?void 0:i.user_name,style:{color:"#232B40"},children:null==i?void 0:i.user_name})]}),(0,k.jsxs)("div",{style:{marginLeft:"50px",marginRight:"50px",maxWidth:"180px",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",WebkitLineClamp:1},children:[(0,k.jsx)("span",{style:{color:"#666",marginRight:"10px"},children:"学号"}),(0,k.jsx)("span",{title:null==i?void 0:i.student_id,style:{color:"#232B40"},children:(null==i?void 0:i.student_id)||"--"})]}),(0,k.jsxs)("div",{style:{maxWidth:"200px",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",WebkitLineClamp:1},children:[(0,k.jsx)("span",{style:{color:"#666",marginRight:"10px"},children:"班级"}),(0,k.jsx)("span",{title:null==i?void 0:i.group_name,style:{color:"#232B40"},children:(null==i?void 0:i.group_name)||"--"})]})]}),(0,k.jsx)(w.Z,{scroll:{y:380},columns:Z,loading:j,style:{marginBottom:c.limit>(null==x?void 0:x.count)?"16px":"0"},dataSource:x.games,pagination:{size:"default",showQuickJumper:!0,showSizeChanger:!0,pageSizeOptions:["10","15","50","100","200"],hideOnSinglePage:!0,pageSize:c.limit,current:c.page,position:["bottomRight"],onChange:function(e,n){c.page=e,c.limit=n,m(o()({},c)),S()},total:null==x?void 0:x.count,showTotal:function(e,n){return(0,k.jsxs)("span",{children:["共",(0,k.jsxs)("span",{style:{color:"#165DFF"},children:[" ",e," "]}),"条数据"]})}}})]})})})),ge=(0,m.connect)((function(e){var n=e.shixunHomeworks,t=e.classroomList,i=e.loading,o=e.user;return{shixunHomeworks:n,classroomList:t,loading:i.effects,user:o}}))((function(e){var n,t,i,a,s,c,x,_,y,b,S,T,Z=e.shixunHomeworks,N=e.classroomList,M=e.loading,I=e.dispatch,P=e.setExportParams,O=e.user,B=(0,m.useParams)(),$=(0,d.useState)(o()(o()({},{page:1,limit:20,order:"work_score",b_order:"desc"}),B)),ee=u()($,2),ne=ee[0],te=(ee[1],H.Z.useForm()),le=u()(te,1)[0],ue=(0,d.useState)(),ge=u()(ue,2),xe=ge[0],ve=(ge[1],(0,d.useState)({})),_e=u()(ve,2),we=_e[0],ye=_e[1],je=(0,d.useState)([]),be=u()(je,2),ke=(be[0],be[1]),Se=(0,d.useState)(!1),Te=u()(Se,2),Ze=Te[0],Ne=Te[1],Le=(0,d.useState)([]),Me=u()(Le,2),Ce=Me[0],Ae=Me[1],Ie=(0,d.useState)(!1),Pe=u()(Ie,2),Oe=Pe[0],Ee=Pe[1],Be=(0,d.useState)(),De=u()(Be,2),He=De[0],ze=De[1],Ge=(0,d.useState)(1),Re=u()(Ge,2),Fe=Re[0],Ye=Re[1],We=(0,d.useState)(),Ve=u()(We,2),Ue=(Ve[0],Ve[1]),qe=(0,d.useState)(),Je=u()(qe,2),Qe=Je[0],Ke=Je[1],Xe=(0,d.useState)(),$e=u()(Xe,2),en=$e[0],nn=$e[1],tn=(0,d.useState)(),on=u()(tn,2),an=on[0],rn=on[1],sn=(0,d.useState)(),ln=u()(sn,2),cn=ln[0],un=ln[1],dn=(0,d.useState)(!1),pn=u()(dn,2),mn=pn[0],hn=pn[1],fn=(0,d.useState)(!1),gn=u()(fn,2),xn=gn[0],vn=gn[1],_n=(0,d.useState)(),wn=u()(_n,2),yn=wn[0],jn=wn[1];(0,m.useLocation)();(0,d.useEffect)((function(){return bn(),function(){ye([]),ke([])}}),[ne.coursesId]),(0,d.useEffect)((function(){var e,n=JSON.parse(JSON.stringify(Z.workList));null!=n&&null!==(e=n.student_works)&&void 0!==e&&e.length||null==n||!n.id?(null!=n&&n.id&&ke([o()(o()({},n),{number:"我"})]),ye(o()({},n))):(n.student_works=[o()({},n)],ye(n))}),[Z.workList]);var bn=function(e){return P(o()({},ne)),I({type:"shixunHomeworks/getWorkList",payload:ne})};(0,d.useEffect)((function(){}),[]);var kn=function(){var e=l()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return I({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"成绩计算中,请稍候..."}}),e.next=3,(0,oe.Vs)({categoryId:B.categoryId});case 3:n=e.sent,I({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}}),0===(null==n?void 0:n.status)&&(h.ZP.success(null==n?void 0:n.message),bn());case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,d.useEffect)((function(){document.getElementById("divhe")&&(document.getElementById("divhe").scrollHeight>47&&(un(47),hn(!0)))}),[document.getElementById("divhe")]);function Sn(){Ye(1),Ue(""),Ke(""),nn(""),rn(""),Ae([])}var Tn=[{title:"序号",dataIndex:"number",align:"center",fixed:"left",ellipsis:{showTitle:!1},render:function(e,n,t){return ne.limit*(ne.page-1)+t+1}},{title:"姓名",dataIndex:"user_name",align:"center",fixed:"left",ellipsis:{showTitle:!1},render:function(e){return(0,k.jsx)(v.Z,{placement:"bottomLeft",title:e,children:(0,k.jsx)("span",{className:"current",children:e})})}},!(0,C.Jd)()&&{title:"学号",dataIndex:"student_id",align:"center",sorter:!0,fixed:"left",showSorterTooltip:!1,ellipsis:{showTitle:!1},sortOrder:"student_id"===ne.order?"desc"===ne.b_order?"descend":"ascend":null,render:function(e){return(0,k.jsx)(v.Z,{placement:"bottomLeft",title:e||"--",children:(0,k.jsx)("span",{className:"current",children:e||"--"})})}},{title:"分班",dataIndex:"group_name",align:"center",fixed:"left",ellipsis:{showTitle:!1},render:function(e,n){return e?(0,k.jsx)(v.Z,{placement:"bottom",title:e,children:(0,k.jsx)("span",{className:"current",children:e})}):"--"}},{title:"作业状态",dataIndex:"work_status",align:"center",fixed:"left",sorter:!0,ellipsis:{showTitle:!1},showSorterTooltip:!1,sortOrder:"work_status"===ne.order?"desc"===ne.b_order?"descend":"ascend":null,render:function(e){return(0,k.jsx)(j.lC,{status:e})}},{title:"完成时间",align:"center",dataIndex:"achieve_time",ellipsis:{showTitle:!1},render:function(e,n){return(0,k.jsx)(v.Z,{placement:"bottomLeft",title:e,children:(0,k.jsx)("span",{className:"current",children:e})})}},{title:"通过情况",align:"center",dataIndex:"achieve_info",ellipsis:{showTitle:!1},render:function(e,n){return(0,k.jsx)("span",{onClick:function(e){var t;e.stopPropagation(),null!==(t=we.homework_status)&&void 0!==t&&t.includes("导入")&&(jn(n),vn(!0))},children:e||"- -"})}},{title:"最终成绩",align:"center",dataIndex:"score",ellipsis:{showTitle:!1},render:function(e,n){return(0,k.jsx)("span",{children:e||"- -"})}},{title:"完成时长",dataIndex:"achieve_time_long",align:"center",render:function(e,n){return e&&"--"!=e?(0,k.jsx)(v.Z,{placement:"bottom",title:e,children:(0,k.jsx)("span",{className:"current",children:e})}):"--"}},(null===(n=we.homework_status)||void 0===n?void 0:n.includes("导入"))&&{title:"评测次数",dataIndex:"sum_evaluate_count",align:"center"},!(null!==(t=we.homework_status)&&void 0!==t&&t.includes("导入"))&&{title:(0,k.jsx)("span",{children:"评阅状态"}),align:"center",dataIndex:"has_comment",fixed:"right",ellipsis:!0,render:function(e){return e?"已评阅":"未评阅"}},{title:"操作",dataInex:"action",align:"center",fixed:"right",ellipsis:!0,className:"workListTable",render:function(e,n){var t;return null!==(t=we.homework_status)&&void 0!==t&&t.includes("导入")?(0,C.GJ)()?(0,k.jsx)("a",{onClick:function(e){e.stopPropagation(),I({type:"classroomList/setActionTabs",payload:{key:"修改成绩",id:null==n?void 0:n.id,type:"normal"}})},children:"修改成绩"}):(0,k.jsx)("a",{onClick:function(e){e.stopPropagation(),jn(n),vn(!0)},children:"查看"}):(0,C.dE)()?(0,k.jsx)("div",{children:"未开启"===(0,j.JL)(null==n?void 0:n.work_status)?(0,k.jsx)("span",{children:"--"}):(0,k.jsx)("a",{onClick:function(e){var t;e.stopPropagation(),!(0,C.Rm)()||null!==(t=N.AssistantObject.hack)&&void 0!==t&&t.can_view?window.open("/classrooms/".concat(ne.coursesId,"/program_homework/").concat(ne.categoryId,"/").concat(n.id,"/").concat(n.user_id,"/comment"),"_blank"):h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:"查看"})}):(0,k.jsx)("a",{target:"_blank",onClick:function(e){var t,i;if(!(0,C.Rm)()||null!==(t=N.AssistantObject.hack)&&void 0!==t&&t.can_view){if(e.stopPropagation(),null===(i=O.userInfo)||void 0===i||!i.professional_certification)return f.Z.confirm({title:"提示",centered:!0,content:(0,k.jsx)("div",{className:"tc",children:"您需要去完成您的职业认证,才能使用此功能"}),okText:"立即完善",cancelText:"稍后完善",onOk:function(){(0,j.xg)("/account/certification")}}),!1;window.open("/classrooms/".concat(ne.coursesId,"/program_homework/").concat(ne.categoryId,"/").concat(n.id,"/").concat(n.user_id,"/comment"),"_blank")}else h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:"查看作业"})}}].filter((function(e){return!!e}));return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)("section",{className:"".concat(ae," minH500 bg-white pl30 pr30 pt30"),children:[(null===(i=we.homework_status)||void 0===i?void 0:i.includes("未发布"))&&(0,k.jsx)(A.Z,{}),!(null!==(a=we.homework_status)&&void 0!==a&&a.includes("未发布"))&&(0,k.jsxs)("aside",{children:[!(0,C.GJ)()&&(0,k.jsxs)("div",{className:"c-light-black font12",children:[(0,k.jsxs)("span",{children:["发布时间 ",null==we?void 0:we.publish_time]}),(0,k.jsxs)("span",{className:"ml5",children:["截止时间 ",null==we?void 0:we.end_time]}),(0,k.jsxs)("span",{className:"ml5",children:["补交时间 ",(null==we?void 0:we.late_time)||"- -"]})]}),(0,C.GJ)()&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(H.Z,{form:le,onChange:function(){ne.page=1;var e=Object.assign({},le.getFieldsValue());delete ne.course_group,delete ne.teacher_comment,Object.keys(e).map((function(n){switch(n){case"task_status":e[n].includes("all")||!e[n].length?(delete ne.work_status,le.setFieldsValue(D()({},"task_status","all"))):(ne.work_status=e[n],le.setFieldsValue(D()({},"task_status",ne.work_status)));break;case"course_group_info":e[n].includes("all")||!e[n].length?(delete ne.course_group,le.setFieldsValue(D()({},"course_group_info","all"))):(ne.course_group=e[n],le.setFieldsValue(D()({},"course_group_info",ne.course_group)));break;case"teacher_comment":var t;if(e[n].includes("all")||!e[n].length)delete ne.teacher_comment,le.setFieldsValue(D()({},"teacher_comment","all"));else ne.teacher_comment=1===(null===(t=e[n])||void 0===t?void 0:t.length)?Number(e[n][0]):"",le.setFieldsValue(D()({},"teacher_comment",e[n]))}})),bn()},initialValues:D()(D()(D()({},"task_status","all"),"course_group_info","all"),"teacher_comment","all"),children:[(null===(s=we.task_status)||void 0===s?void 0:s.length)>0&&(0,k.jsx)(H.Z.Item,{name:"task_status",children:(0,k.jsx)(G.Z.Group,{value:[],style:{width:"100%"},children:(0,k.jsxs)(R.Z,{children:[(0,k.jsx)(F.Z,{className:"font14",flex:"80px",children:"作业状态:"}),(0,k.jsx)(F.Z,{flex:"80px",children:(0,k.jsx)(G.Z,{value:"all",children:"全部"})}),(0,k.jsx)(F.Z,{flex:"1",children:we.task_status&&we.task_status.map((function(e,n){return(0,k.jsxs)(G.Z,{name:"task_status",value:e.id,children:[e.name,"(",e.count,")"]})}))})]})})}),(null===(c=we.course_group_info)||void 0===c?void 0:c.length)>0&&(0,k.jsx)(H.Z.Item,{name:"course_group_info",children:(0,k.jsx)(G.Z.Group,{style:{width:"100%"},children:(0,k.jsxs)(R.Z,{children:[(0,k.jsx)(F.Z,{className:"font14",flex:"80px",children:"分班情况:"}),(0,k.jsx)(F.Z,{flex:"80px",children:(0,k.jsx)(G.Z,{value:"all",children:"全部"})}),(0,k.jsx)(F.Z,{flex:"1",id:"divhe",style:{height:cn+"px",overflow:"hidden"},children:null===(x=we.course_group_info)||void 0===x?void 0:x.map((function(e,n){return(0,k.jsxs)(G.Z,{value:e.course_group_id,children:[e.group_group_name,"(",e.count,")"]})}))}),mn&&(0,k.jsxs)("span",{onClick:function(){var e=document.getElementById("divhe").scrollHeight;un(cn>47?47:e)},style:{color:"rgb(76, 172, 255)",cursor:"pointer",alignItems:"flex-end",display:"flex"},children:[47===cn?"展开":"收起",47===cn?(0,k.jsx)(q.Z,{style:{marginBottom:"3px",marginLeft:"2px"}}):(0,k.jsx)(J.Z,{style:{marginBottom:"3px",marginLeft:"2px"}})]})]})})}),(null===(_=we.teacher_comment)||void 0===_?void 0:_.length)>0&&(0,k.jsx)(H.Z.Item,{name:"teacher_comment",children:(0,k.jsx)(G.Z.Group,{style:{width:"100%"},children:(0,k.jsxs)(R.Z,{children:[(0,k.jsx)(F.Z,{className:"font14",flex:"80px",children:"追加点评:"}),(0,k.jsx)(F.Z,{flex:"80px",children:(0,k.jsx)(G.Z,{value:"all",children:"全部"})}),(0,k.jsx)(F.Z,{flex:"1",children:we.teacher_comment&&we.teacher_comment.map((function(e,n){return(0,k.jsxs)(G.Z,{value:String(e.id),children:[e.name,"(",e.count,")"]})}))})]})})})]}),(0,k.jsxs)(R.Z,{align:"middle",children:[(0,k.jsx)(F.Z,{flex:"1",children:(0,k.jsxs)(R.Z,{align:"middle",children:[(0,k.jsx)(F.Z,{children:(0,k.jsx)(Y.Z.Search,{allowClear:!0,placeholder:"请输入姓名或者学号搜索",onSearch:function(e){ne.search=e.trim(),ne.page=1,bn()},style:{width:240}})}),(0,k.jsx)(F.Z,{children:(0,k.jsxs)("span",{className:"ml5",children:[(0,k.jsx)("span",{className:"c-red",children:we.work_count}),"个检索结果(",we.work_count,"个学生)"]})})]})}),(0,k.jsxs)(F.Z,{children:[(0,C.GJ)()&&!(null!==(y=we.homework_status)&&void 0!==y&&y.includes("导入"))&&(0,k.jsxs)(g.ZP,{className:"ml10",onClick:function(){I({type:"shixunHomeworks/setActionTabs",payload:{key:"代码查重",selectArrs:we.student_works.map((function(e){return e.id})),params:ne}})},children:[(0,k.jsx)("span",{className:"".concat(se," iconfont icon-daimachazhong")}),"代码查重"]}),(0,C.GJ)()&&!(null!==(b=we.homework_status)&&void 0!==b&&b.includes("导入"))&&(0,k.jsxs)(g.ZP,{className:"ml10",onClick:kn,children:[(0,k.jsx)("i",{className:"iconfont icon-gengxinchengji font14 pr5"}),"更新成绩"]}),(0,C.GJ)()&&(0,k.jsx)(W.Z,{dropdownRender:function(){var e,n;return(0,k.jsxs)(z.Z,{children:[(0,k.jsx)(z.Z.Item,{onClick:function(){(0,me.Iy)(JSON.parse(sessionStorage.all_student_works_params),"hack_work_list")},children:"学生成绩"},"1"),(0,C.GJ)()&&(null==we||null===(e=we.student_works)||void 0===e?void 0:e.length)>0&&!(null!=we&&null!==(n=we.homework_status)&&void 0!==n&&n.includes("导入"))&&(0,k.jsx)(z.Z.Item,{onClick:function(){var e,n;I({type:"shixunHomeworks/setActionTabs",payload:{key:"导出编程报告",type:2}}),localStorage.setItem("dowolders","1"),m.history.push("/classrooms/".concat(null==ne?void 0:ne.coursesId,"/program_homework/").concat(ne.categoryId,"/").concat(null==we||null===(e=we.student_works)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.id,"/").concat(null==we||null===(n=we.student_works)||void 0===n||null===(n=n[0])||void 0===n?void 0:n.user_id,"/comment"))},children:"编程报告"},"3"),(0,k.jsx)(z.Z.Item,{children:(0,k.jsx)(m.Link,{to:"/classrooms/".concat(ne.coursesId,"/exportlist/hack_work_list"),children:"历史导出"})},"2")]})},className:"ml10",children:(0,k.jsxs)(g.ZP,{children:[(0,k.jsx)(Q.Z,{}),"导出",(0,k.jsx)(K.Z,{})]})})]})]})]}),(0,k.jsx)(R.Z,{style:{justifyContent:"end",marginTop:"5px"},children:(0,C.GJ)()&&xe&&(0,k.jsxs)("span",{children:[(0,k.jsx)("span",{style:{color:"red"},children:"*"}),"列表中作业记录存在差异,请点击“更新成绩”按钮"]})}),(0,k.jsx)(w.Z,{className:"mt30",loading:M["shixunHomeworks/getWorkList"],pagination:!1,style:{cursor:"pointer"},onRow:function(e){return{onClick:function(n){var t,i;null!==(t=we.homework_status)&&void 0!==t&&t.includes("导入")||(!(0,C.Rm)()||null!==(i=N.AssistantObject.hack)&&void 0!==i&&i.can_view?(0,he.O5)()&&window.open("/classrooms/".concat(ne.coursesId,"/program_homework/").concat(ne.categoryId,"/").concat(e.id,"/").concat(e.user_id,"/comment"),"_blank"):h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能"))}}},scroll:{x:"max-content"},dataSource:we.student_works,columns:Tn,onChange:function(e,n,t){t.field&&(ne.order=t.field),t.order||(ne.b_order="asc"),"ascend"===t.order&&(ne.b_order="asc"),"descend"===t.order&&(ne.b_order="desc"),t.order||(ne.b_order="asc"),bn()}}),(0,k.jsx)(ie,{}),(0,k.jsx)(ce,{}),(0,k.jsx)(X.Z,{})]}),(0,k.jsx)(f.Z,{title:"一键打回重做",open:Ze,centered:!0,destroyOnClose:!0,forceRender:!0,width:700,onOk:l()(r()().mark((function e(){var n,t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(2!==Fe){e.next=13;break}if(!(Ce.length<=0)){e.next=4;break}return h.ZP.info("请选择作业状态"),e.abrupt("return");case 4:if(an){e.next=7;break}return h.ZP.info("评语不能为空"),e.abrupt("return");case 7:return e.next=9,(0,p.ZP)("/api/homework_commons/".concat(ne.categoryId,"/confirm_redo_modal.json"),{method:"post",body:{id:ne.categoryId,comment:an,status:Ce}});case 9:0===(n=e.sent).status&&(ze(n),Ne(!1),Ee(!0)),e.next=32;break;case 13:if(0!==en&&0!==Qe){e.next=16;break}e.next=22;break;case 16:if(en){e.next=19;break}return h.ZP.info("最低分不能为空"),e.abrupt("return");case 19:if(Qe){e.next=22;break}return h.ZP.info("最高分不能为空"),e.abrupt("return");case 22:if(!(en>Qe)){e.next=25;break}return h.ZP.info("最高分不能大于最低分"),e.abrupt("return");case 25:if(an){e.next=28;break}return h.ZP.info("评语不能为空"),e.abrupt("return");case 28:return e.next=30,(0,p.ZP)("/api/homework_commons/".concat(ne.categoryId,"/confirm_redo_modal.json"),{method:"post",body:{id:ne.categoryId,comment:an,min_score:en,max_score:Qe}});case 30:0===(t=e.sent).status&&(ze(t),Ne(!1),Ee(!0));case 32:case"end":return e.stop()}}),e)}))),onCancel:function(){Ne(!1),Sn()},children:(0,k.jsx)("div",{style:{padding:"32px"},children:(0,k.jsxs)("div",{children:[(0,k.jsxs)("div",{children:[(0,k.jsx)("span",{style:{width:"80px"},children:"打回方式:"}),(0,k.jsxs)(V.ZP.Group,{value:Fe,onChange:function(e){Ye(e.target.value)},children:[(0,k.jsx)(V.ZP,{value:1,children:"按成绩打回"}),(0,k.jsx)(V.ZP,{value:2,children:"按作业状态打回"})]})]}),1===Fe&&(0,k.jsxs)("div",{style:{display:"flex",marginTop:"20px"},children:[(0,k.jsxs)("span",{style:{width:"70px",textAlign:"end"},children:[(0,k.jsx)("span",{style:{color:"red"},children:"*"}),"最低分:"]}),(0,k.jsx)(U.Z,{min:0,max:100,value:en,onChange:function(e){return nn(e)},style:{width:"100px"}}),(0,k.jsxs)("span",{style:{width:"80px",textAlign:"end"},children:[(0,k.jsx)("span",{style:{color:"red"},children:"*"}),"最高分:"]}),(0,k.jsx)(U.Z,{min:0,max:100,value:Qe,onChange:function(e){return Ke(e)},style:{width:"100px"}})]}),2===Fe&&(0,k.jsxs)("div",{style:{display:"flex",marginTop:"20px"},children:[(0,k.jsx)("span",{style:{width:"80px"},children:"作业状态:"}),(0,k.jsx)(G.Z.Group,{onChange:function(e){Ae(E()(e))},style:{width:"100%"},children:null===(S=we.task_status)||void 0===S?void 0:S.map((function(e,n){return(0,k.jsxs)(G.Z,{name:"task_status",value:e.id,children:[e.name,"(",e.count,")"]})}))})]}),(0,k.jsxs)("div",{style:{display:"flex",marginTop:"20px"},children:[(0,k.jsxs)("span",{style:{width:"70px",textAlign:"end"},children:[(0,k.jsx)("span",{style:{color:"red"},children:"*"})," 评语:"]}),(0,k.jsx)(pe.Z,{className:re,onChange:function(e){return rn(e)},placeholder:"请填写评语"})]})]})})}),(0,k.jsx)(f.Z,{open:Oe,title:"打回确认",onOk:l()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(2!==Fe){e.next=7;break}return e.next=3,(0,p.ZP)("/api/homework_commons/".concat(ne.categoryId,"/batch_redo_modal.json"),{method:"post",body:{id:ne.categoryId,comment:an,status:Ce}});case 3:0===e.sent.status&&(h.ZP.info("打回成功"),Sn(),bn(),Ee(!1)),e.next=11;break;case 7:return e.next=9,(0,p.ZP)("/api/homework_commons/".concat(ne.categoryId,"/batch_redo_modal.json"),{method:"post",body:{id:ne.categoryId,comment:an,min_score:en,max_score:Qe}});case 9:0===e.sent.status&&(h.ZP.info("打回成功"),Sn(),bn(),Ee(!1));case 11:case"end":return e.stop()}}),e)}))),onCancel:function(){Sn(),Ee(!1)},children:(0,k.jsxs)("div",{style:{padding:"32px"},children:[1===Fe&&(0,k.jsxs)("span",{children:["确认将成绩在",en,"-",Qe,"的学生进行打回重做吗?"]}),2===Fe&&(0,k.jsxs)("span",{children:["确认将作业状态为",(null===(T=we.task_status)||void 0===T?void 0:T.filter((function(e){return null==Ce?void 0:Ce.includes(e.id)})).map((function(e){return e.name})).toString())+",","的学生进行作业打回重做吗?"]}),(0,k.jsx)("br",{}),(0,k.jsxs)("span",{children:["该条件下共有",null==He?void 0:He.count,"名学生"]})]})})]}),(0,k.jsx)(de,{}),(0,k.jsx)(fe,{isShow:xn,setIsShow:vn,item:yn,coursesId:ne.coursesId,categoryId:ne.categoryId}),(0,k.jsx)("aside",{className:"tc mb50 mt30",children:(0,k.jsx)(L.Z,{showQuickJumper:!0,hideOnSinglePage:!0,showSizeChanger:!1,onChange:function(e,n){ne.page=e,ne.limit=20,bn()},current:ne.page||1,defaultPageSize:20,total:we.work_count})})]})})),xe=(0,m.connect)((function(e){return{shixunHomeworks:e.shixunHomeworks,classroomList:e.classroomList,loading:e.loading.effects}}))((function(e){var n,t=e.shixunHomeworks,i=e.loading,a=e.dispatch,s=e.classroomList,c=(0,m.useParams)(),p=(0,d.useState)(o()(o()({},{page:1,limit:20,group_ids:[]}),c)),f=u()(p,2),x=f[0],v=f[1],_=((0,m.useLocation)(),t.codeReview),y=(0,d.useState)({}),j=u()(y,2),b=(j[0],j[1],H.Z.useForm());u()(b,1)[0];x.order="code_rate",x.sort="desc",x.category=x.categoryId,(0,d.useEffect)((function(){S(),console.log("params",x)}),[x]),(0,d.useEffect)((function(){"执行代码查重"===t.actionTabs.key&&S()}),[t.actionTabs.key]);var S=function(){var e=l()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a({type:"shixunHomeworks/getCodeReview",payload:o()({},x)});case 2:-2===e.sent.status&&setTimeout((function(){return S()}),1500);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),T=[{title:"序号",dataIndex:"number",render:function(e,n,t){return x.limit*(x.page-1)+t+1}},{title:"姓名",dataIndex:"username"},{title:"学号",dataIndex:"student_id"},{title:"相似度",dataIndex:"code_rate",render:function(e){return(0,k.jsx)("span",{className:"c-orange",children:e})}},{title:"操作",dataInex:"action",render:function(e,n){return(0,k.jsxs)("div",{children:[(0,k.jsx)("a",{onClick:function(){var e;!(0,C.Rm)()||null!==(e=s.AssistantObject.hack)&&void 0!==e&&e.can_view?window.open("/classrooms/".concat(x.coursesId,"/program_homework/").concat(x.categoryId,"/review_detail/").concat(n.user_id)):h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:"查看"}),(0,k.jsx)("br",{})]})}}];return(0,k.jsxs)("section",{className:"minH500 bg-white pl30 pr30 pt10",children:[-2===(null==_?void 0:_.status)&&(0,k.jsx)(A.Z,{customText:"正在进行代码查重,请稍候。查重结束后,页面将自动更新显示结果"}),-2!==(null==_?void 0:_.status)&&(0,k.jsxs)("div",{children:[(0,k.jsxs)(R.Z,{children:[(0,k.jsx)(F.Z,{flex:"1",children:(0,k.jsxs)("p",{className:"mt10",children:["查重时间:",_.last_review_time,(0,k.jsx)(g.ZP,{ghost:!0,danger:!0,style:{color:"#29BD8B",borderColor:"#29BD8B",marginLeft:10},onClick:function(){a({type:"shixunHomeworks/setActionTabs",payload:{key:"代码查重",params:x}})},children:"代码查重"})]})}),(0,k.jsxs)(F.Z,{children:[(0,k.jsx)(Y.Z.Search,{allowClear:!0,placeholder:"请输入姓名或者学号搜索",onSearch:function(e){x.search=e,a({type:"shixunHomeworks/getCodeReview",payload:x})},style:{width:200}}),(0,k.jsx)("span",{className:"ml5 c-red"})]})]}),(null===(n=_.group_info)||void 0===n?void 0:n.length)>0&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(R.Z,{children:[(0,k.jsx)(F.Z,{flex:"80px",className:"font14",children:"分班情况:"}),(0,k.jsx)(F.Z,{flex:"80px",children:(0,k.jsx)(G.Z,{checked:""==x.group_ids,value:"all",onChange:function(e){delete x.group_ids,x.group_ids=[],x.page=1,v(o()({},x))},children:"全部"})}),(0,k.jsx)(F.Z,{flex:"1",children:_.group_info&&_.group_info.map((function(e,n){return(0,k.jsxs)(G.Z,{style:{marginLeft:0},value:e.id,checked:x.group_ids.includes(e.id),onChange:function(n){n.target.checked?x.group_ids.push(e.id):x.group_ids.splice(x.group_ids.indexOf(e.id),1),x.page=1,v(o()({},x))},children:[e.name,"(",e.members_count,")"]})}))})]}),(0,k.jsx)(R.Z,{className:"font14 c-red mt5",children:(0,k.jsx)(F.Z,{children:"本页仅显示全部已查重分班"})})]}),(0,k.jsxs)("p",{className:"mt10",children:[(0,k.jsx)("span",{className:"c-red",children:_.copy_reviews_count}),"个疑似抄袭作品(",_.all_reviews_count,"作品)"]}),(0,k.jsx)(w.Z,{className:"mt30",loading:i["shixunHomeworks/getCodeReview"],pagination:!1,dataSource:_.users_reviews,columns:T,onChange:function(e,n,t){"ascend"===t.order&&(x.b_order="asc"),"descend"===t.order&&(x.b_order="desc"),t.order||delete x.b_order,a({type:"shixunHomeworks/getCodeReview",payload:o()({},x)})}}),(0,k.jsx)("aside",{className:"tc mb50 mt30",children:(0,k.jsx)(L.Z,{showSizeChanger:!1,onChange:function(e,n){x.page=e,x.limit=20,a({type:"shixunHomeworks/getCodeReview",payload:o()({},x)})},defaultCurrent:x.page||1,current:x.page||1,defaultPageSize:20,hideOnSinglePage:!0,total:_.copy_reviews_count})})]})]})})),ve=t(30518),_e=t(57809),we=t(37064),ye=t(65547),je=t(2842),be=t(89392),ke="form___dWO2F",Se="hackList___nh6e9",Te="title___tyrHF",Ze=t(1481),Ne=t(47253),Le=ve.default.RangePicker,Me=_e.default.Option,Ce=(0,m.connect)((function(e){var n=e.shixunHomeworks,t=e.classroomList,i=e.user;return{shixunHomeworks:n,loading:e.loading.effects,user:i,classroomList:t}}))((function(e){var n,t,i,a,s,c,x,_,w,y,b,S,T,N=e.shixunHomeworks,L=e.user,M=(e.loading,e.classroomList),A=e.dispatch,I=(0,m.useParams)(),P=N.workSetting,O=N.workList,B=N.changeData,D=(0,d.useState)(!0),H=u()(D,2),z=H[0],Y=H[1],W=(0,d.useState)(!1),q=u()(W,2),J=q[0],Q=q[1],K=(0,d.useState)([]),X=u()(K,2),$=X[0],ee=X[1],ne=(0,d.useState)([]),te=u()(ne,2),ie=te[0],oe=te[1],ae=(0,d.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_minus_score:0,penalty_type:Ze.Q.Percent,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,comment_public:!0,total_score:"",eff_score:0,send_type:void 0,difficult_count:[],difficult_settings:[],late_penalty:0}),re=u()(ae,2),se=re[0],le=re[1];(0,d.useEffect)((function(){return ce(),function(){ee([].concat())}}),[]);var ce=function(){A({type:"shixunHomeworks/getWorkSetting",payload:o()({},I)})};(0,d.useEffect)((function(){var e;null!=P&&P.course_id&&(Object.keys(se).map((function(e){se[e]=P[e]})),se.allow_late&&se.unified_late||(se.late_minus_score=20,se.penalty_type=Ze.Q.Percent),se.unified_setting||(se.unified_late=!1,se.unified_anonymous_comment=!1,se.unified_anonymous_appeal=!1),$=JSON.parse(JSON.stringify(P.group_settings.map((function(e){return o()(o()({},e),{},{group_name:[e.group_name]})})).filter((function(e){return null!==e.publish_time})))),ie=JSON.parse(JSON.stringify(P.allow_late_settings.map((function(e){return o()(o()({},e),{},{group_name:[e.group_name]})})).filter((function(e){return null!==e.late_time})))),0===se.difficult_settings.length&&(se.difficult_settings=[0,0,0]),le(o()({},se)),ee($.length?E()($):[{}]),(null===(e=ie)||void 0===e?void 0:e.length)<=0?oe([{late_minus_score:20}]):oe(E()(ie)))}),[P]);var ue=function(e){var n;if(null!==e.total_score)if(null!=e&&e.work_efficiency&&null===e.eff_score)h.ZP.warning("效率分不能为空");else{var t={shixun_evaluation:e.shixun_evaluation,challenge_settings:e.challenge_settings},i=function(){var n=l()(r()().mark((function n(){return r()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return Q(!0),n.next=3,(0,p.ZP)("/api/homework_commons/".concat(I.categoryId,"/publish_setting.json"),{method:"post",body:o()({},e)});case 3:0===n.sent.status&&(h.ZP.success("更新成功"),Y(!0),ce(),A({type:"shixunHomeworks/getWorkList",payload:o()({},I)})),Q(!1);case 6:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}();(0,be.isEqual)(B,t)||null!=O&&null!==(n=O.homework_status)&&void 0!==n&&n.includes("未发布")?i():f.Z.confirm({title:"更新成绩",content:"您改动了本次作业的关卡得分设置,这可能导致已完成作业的学生的成绩产生错误。点击“确定”按钮将保存最新设置并按最新设置更新全班成绩。",okText:"确认",cancelText:"取消",onOk:i})}else h.ZP.warning("总分值不能为空")},de=function(e,n){var t,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"group_id";return n?n.find((function(n){return n[i]===e})):null==P||null===(t=P.group_settings)||void 0===t?void 0:t.find((function(n){return n.group_id[0]===e}))},pe=((null==P?void 0:P.allow_late)||(null==P||P.anonymous_comment),function(e){var n,t,i=de(e,null==P?void 0:P.allow_late_settings,"id"),o=de(e,null==P?void 0:P.anonymous_comment_settings),a=de(e);return(null==P?void 0:P.allow_late)&&i&&Z()(null==i?void 0:i.late_time)<=Z()()||(null==P?void 0:P.anonymous_comment)&&o&&null!==(null==o?void 0:o.evaluation_start)||null!=(null===(n=(Z()(null==a?void 0:a.end_time)<=Z()()&&(null==P||null===(t=P.allow_late_settings)||void 0===t?void 0:t.filter((function(n){return n.group_id.includes(e)}))))[0])||void 0===n?void 0:n.late_time)}),me=null==P?void 0:P.anonymous_comment,fe=function(e){if(!e)return!1;var n=de(e,null==P?void 0:P.anonymous_comment_settings);return(null==P?void 0:P.anonymous_comment)&&n&&null!==(null==n?void 0:n.evaluation_start)};return(0,k.jsxs)("section",{className:ke,children:[(0,k.jsxs)(R.Z,{align:"middle",children:[(0,k.jsx)(F.Z,{flex:"1",children:(0,k.jsx)("div",{className:Te,children:"试题发布"})}),(0,k.jsxs)(F.Z,{children:[(0,C.GJ)()&&z&&(0,k.jsx)(g.ZP,{type:"primary",size:"middle",ghost:!0,onClick:function(){var e,n;!(0,C.Rm)()||null!==(e=M.AssistantObject.hack)&&void 0!==e&&e.can_late||null!==(n=M.AssistantObject.hack)&&void 0!==n&&n.can_publish?Y(!1):h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:"编辑设置"}),!z&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(g.ZP,{type:"primary",loading:J,onClick:function(){return function(){var e,n;if(2!==(null==L||null===(e=L.userInfo)||void 0===e?void 0:e.user_status)){var t=JSON.parse(JSON.stringify(se));if(t.categoryId=I.categoryId,se.unified_setting||($=null===(n=$)||void 0===n?void 0:n.map((function(e){var n;if(!e.publish_time||!e.end_time)throw h.ZP.error("请把发布时间填写完整"),new String("请把发布时间填写完整");if(!e.group_name)throw h.ZP.error("请选择分班名称"),new String("请选择分班名称");return e.group_name="string"==typeof(null==e?void 0:e.group_name)?[null==e?void 0:e.group_name]:null==e?void 0:e.group_name,e.group_id=null===(n=P.group_settings)||void 0===n?void 0:n.filter((function(n){var t;return null==e||null===(t=e.group_name)||void 0===t?void 0:t.includes(n.group_name)})).map((function(e){return e.group_id||e.id})).toString().split(","),e}))),t.group_settings=$,se.allow_late)if(se.unified_late){if(null===se.late_minus_score||void 0===se.late_minus_score||se.late_minus_score<0||se.late_minus_score>100)throw h.ZP.error("迟交扣分填写区间为0~100"),new String("迟交扣分填写区间为0~100");if(!se.late_time)throw h.ZP.error("请把截止时间填写完整"),new String("请把截止时间填写完整")}else{var i;ie=null===(i=ie)||void 0===i?void 0:i.map((function(e){var n;if(null===e.late_minus_score||void 0===e.late_minus_score||e.late_minus_score<0||e.late_minus_score>100)throw h.ZP.error("迟交扣分填写区间为0~100"),new String("迟交扣分填写区间为0~100");if(!e.late_time)throw h.ZP.error("请把截止时间填写完整"),new String("请把截止时间填写完整");if(!e.group_name)throw h.ZP.error("请选择分班名称"),new String("请选择分班名称");return e.group_name="string"==typeof(null==e?void 0:e.group_name)?[null==e?void 0:e.group_name]:null==e?void 0:e.group_name,e.group_id=null==e||null===(n=e.group_name)||void 0===n||null===(n=n.map((function(e){var n,t=null===(n=P.group_settings)||void 0===n||null===(n=n.filter((function(n){return(null==n?void 0:n.group_name)===e})))||void 0===n?void 0:n[0];return null==t?void 0:t.group_id})))||void 0===n?void 0:n.toString().split(","),e})),t.allow_late_settings=ie}1===t.send_type&&(t.difficult_settings=t.difficult_settings.map((function(e){return e||0}))),ue(t)}else(0,he.Rd)()}()},children:"提交"}),(0,k.jsx)(g.ZP,{type:"primary",ghost:!0,className:"ml20",onClick:function(){Y(!0),ce()},children:"取消"})]})]})]}),(0,k.jsxs)("div",{className:"mt10",children:[(0,k.jsx)("label",{className:"mr20",children:"发布方式"})," ",(0,k.jsxs)(V.ZP.Group,{disabled:z||!(null!=O&&null!==(n=O.homework_status)&&void 0!==n&&n.includes("未发布"))||!(null!==(t=M.AssistantObject.hack)&&void 0!==t&&t.can_publish)&&(0,C.Rm)(),value:se.send_type,onChange:function(e){se.send_type=e.target.value,le(Object.assign({},se))},children:[(0,k.jsx)(V.ZP,{value:0,children:"全部固定试题"}),(0,k.jsx)(V.ZP,{className:"ml20",value:1,children:"随机抽题"})]}),1===se.send_type&&(0,k.jsxs)(R.Z,{className:"mt20",style:{marginLeft:94},children:[(0,k.jsxs)(F.Z,{children:["简单题数",(0,k.jsx)(U.Z,{precision:0,disabled:z||!(null!=O&&null!==(i=O.homework_status)&&void 0!==i&&i.includes("未发布")),placeholder:"最大".concat(se.difficult_count[0]||0),min:0,max:se.difficult_count[0]||0,value:se.difficult_settings[0],onChange:function(e){se.difficult_settings[0]=e,le(Object.assign({},se))},className:"ml10 mr20"})]}),(0,k.jsxs)(F.Z,{children:["适中题数",(0,k.jsx)(U.Z,{precision:0,disabled:z||!(null!=O&&null!==(a=O.homework_status)&&void 0!==a&&a.includes("未发布")),placeholder:"最大".concat(se.difficult_count[1]||0),min:0,max:se.difficult_count[1]||0,value:se.difficult_settings[1],onChange:function(e){se.difficult_settings[1]=e,le(Object.assign({},se))},className:"ml10 mr20"})]}),(0,k.jsxs)(F.Z,{children:["困难题数",(0,k.jsx)(U.Z,{precision:0,disabled:z||!(null!=O&&null!==(s=O.homework_status)&&void 0!==s&&s.includes("未发布")),placeholder:"最大".concat(se.difficult_count[2]||0),min:0,max:se.difficult_count[2]||0,value:se.difficult_settings[2],onChange:function(e){se.difficult_settings[2]=e,le(Object.assign({},se))},className:"ml10 mr20"})]})]})]}),(0,k.jsxs)("div",{className:"mt30",children:[(0,k.jsx)("h1",{className:"mb10",children:"发布设置"}),(0,k.jsx)("label",{className:"mr20",children:"发布方式"})," ",(0,k.jsxs)(V.ZP.Group,{disabled:z||!(null!=O&&null!==(c=O.homework_status)&&void 0!==c&&c.includes("未发布"))||!(null!==(x=M.AssistantObject.hack)&&void 0!==x&&x.can_publish)&&(0,C.Rm)(),value:se.unified_setting,onChange:function(e){var n;null!=O&&null!==(n=O.homework_status)&&void 0!==n&&n.includes("未发布")?(se.unified_setting=!se.unified_setting,se.unified_setting||(se.unified_late=!1),le(Object.assign({},se)),!1!==se.unified_setting||""!=$?se.unified_setting&&(ee([]),oe([{late_minus_score:5}])):ee($.concat({}))):h.ZP.error("已发布,不能再修改统一设置")},children:[(0,k.jsx)(V.ZP,{value:!0,disabled:!(null!=P&&P.manage_all_group),children:"统一发布"}),(0,k.jsx)(V.ZP,{className:"ml20",disabled:0===(null==P||null===(_=P.group_settings)||void 0===_?void 0:_.length),value:!1,children:"分班发布"})]}),0===(null==P||null===(w=P.group_settings)||void 0===w?void 0:w.length)&&(0,k.jsx)("p",{style:{marginLeft:"65px",color:"rgba(0, 0, 0, 0.25)"},children:"(本课堂无分班,仅支持选择“统一发布“)"})]}),se.unified_setting&&(0,k.jsxs)("div",{style:{marginLeft:50},children:[(0,k.jsxs)(R.Z,{align:"middle",className:"mt25 pl30",children:[(0,k.jsx)(F.Z,{children:"发布时间"}),(0,k.jsx)(F.Z,{className:"ml10",children:(0,k.jsx)(ve.default,{style:{width:170},placeholder:"请选择发布时间",showTime:{format:"HH:mm"},allowClear:!1,format:"YYYY-MM-DD HH:mm",disabledDate:function(e){return(0,Ne.Q8)(e,null==P?void 0:P.course_end_date)},disabledTime:function(e){return(0,Ne.d0)(e)},disabled:z||Z()()>=Z()(null==P?void 0:P.publish_time)||!(null!==(y=M.AssistantObject.hack)&&void 0!==y&&y.can_publish)&&(0,C.Rm)(),value:se.publish_time?Z()(se.publish_time):"",onChange:function(e,n){se.publish_time=n,""!=se.end_time&&se.end_time||!se.unified_setting||(se.end_time=Z()(e).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),le(Object.assign({},se))}})}),(0,k.jsx)(F.Z,{children:(0,k.jsx)("span",{className:"c-grey-c ml10",children:"(学生收到作业的时间)"})})]}),(0,k.jsxs)(R.Z,{align:"middle",className:"mt25 pl30",children:[(0,k.jsx)(F.Z,{children:"截止时间"}),(0,k.jsx)(F.Z,{className:"ml10",children:(0,k.jsx)(ve.default,{style:{width:170},allowClear:!1,placeholder:"请选择截止时间",showTime:{format:"HH:mm",defaultValue:Z()((0,j.U6)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:(null==P?void 0:P.allow_late)&&(null==P?void 0:P.homework_status.includes("已截止"))||z||(null==P?void 0:P.allow_late)&&Z()()>=Z()(null==P?void 0:P.end_time)||!(null!==(b=M.AssistantObject.hack)&&void 0!==b&&b.can_publish)&&(0,C.Rm)(),disabledDate:function(e){return(0,Ne.Q8)(e,null==P?void 0:P.course_end_date,se.publish_time)},disabledTime:function(e){return(0,Ne.d0)(e,se.publish_time)},value:se.end_time?Z()(se.end_time):"",onChange:function(e,n){se.end_time=n,le(Object.assign({},se))}})}),(0,k.jsx)(F.Z,{children:(0,k.jsx)("span",{className:"c-grey-c ml10",children:"(学生“按时”提交作品的时间截点)"})})]})]}),!se.unified_setting&&(null===(S=$)||void 0===S?void 0:S.length)>0&&(0,k.jsxs)(R.Z,{style:{marginTop:30,paddingTop:20,marginLeft:80,borderTop:"1px solid #eee"},children:[(0,k.jsx)(F.Z,{span:24,children:(0,k.jsxs)(R.Z,{children:[(0,k.jsx)(F.Z,{span:10}),(0,k.jsx)(F.Z,{span:10,children:(0,k.jsxs)(R.Z,{className:"c-grey-c ml30",children:[(0,k.jsx)(F.Z,{flex:"1",children:"(学生收到作业时间)"}),(0,k.jsx)(F.Z,{flex:"1",children:"(学生“按时”提交作品时间截点)"})]})}),(0,k.jsx)(F.Z,{span:4})]})}),$&&$.map((function(e,n){var t,i,a,r;return console.log(null===(t=de(e.id))||void 0===t?void 0:t.publish_time,"发布时间"),console.log(pe(e.id),"截止时间"),(0,k.jsx)(F.Z,{span:24,children:(0,k.jsxs)(R.Z,{gutter:[8,16],children:[(0,k.jsx)(F.Z,{span:10,children:(0,k.jsxs)(R.Z,{gutter:[8,16],children:[(0,k.jsxs)(F.Z,{children:["发布规则 ",n+1]}),(0,k.jsx)(F.Z,{flex:"1",style:{maxWidth:300},children:(0,k.jsx)(_e.default,{disabled:z||!(null!=P&&null!==(i=P.homework_status)&&void 0!==i&&i.includes("未发布")&&e.id||Z()()<Z()(null==e?void 0:e.publish_time))&&!(null==e||!e.publish_time),className:"ml20",mode:"multiple",style:{width:"100%"},value:e.group_name,placeholder:"请选择分班名称",onChange:function(t){var i;if(null!==(i=M.AssistantObject.hack)&&void 0!==i&&i.can_publish||!(0,C.Rm)()){$[n].group_name=t,$[n].group_id=e.group_id;var a=(0,be.flattenDeep)($.map((function(e){return e.group_name}))),r=ie.map((function(e){var n=(null==e?void 0:e.group_name)||[];return o()(o()({},e),{},{group_name:(0,be.remove)(n,(function(e){return a.includes(e)}))})}));oe(r),ee($.slice())}else h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:P.group_settings&&P.group_settings.map((function(e){if(!$.map((function(e){return e.group_name})).toString().split(",").includes(String(e.group_name)))return(0,k.jsx)(Me,{value:e.group_name,children:e.group_name},e.id)}))})})]})}),(0,k.jsx)(F.Z,{span:10,children:(0,k.jsx)("div",{className:"ml30",children:(0,k.jsx)(Le,{allowClear:!1,ranges:{"此刻":[e.publish_time?Z()(e.publish_time):Z()(),Z()()]},disabled:z||!(Z()()<=Z()(null===(a=de(e.id))||void 0===a?void 0:a.publish_time))&&[!0,pe(e.id)],style:{width:400},placeholder:["请选择发布时间","请选择截止时间"],disabledDate:function(e){return(0,Ne.Q8)(e,null==P?void 0:P.course_end_date)},disabledTime:function(e){return(0,Ne.d0)(e)},showTime:{format:"HH:mm",defaultValue:[Z()((0,j.U6)(),"HH:mm"),Z()((0,j.U6)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:e.publish_time&&[Z()(e.publish_time),e.end_time?Z()(e.end_time):void 0],onChange:function(e,t){var i;null!==(i=M.AssistantObject.hack)&&void 0!==i&&i.can_publish||!(0,C.Rm)()?($[n].publish_time=t[0],$[n].end_time=t[1],ee(E()($))):h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})})}),!z&&(0,k.jsxs)(F.Z,{span:4,children:[((null==e?void 0:e.publish_time)&&Z()()<Z()(null==e?void 0:e.publish_time)||!(null!=e&&e.publish_time))&&0!=n&&(0,k.jsx)(we.Z,{onClick:function(){var e;if(null!==(e=M.AssistantObject.hack)&&void 0!==e&&e.can_publish||!(0,C.Rm)()){var t=(0,be.cloneDeep)(ie);t.forEach((function(e,t){e.group_name&&(e.group_name=e.group_name.filter((function(e){var t;return!(null!==(t=$[n].group_name)&&void 0!==t&&t.includes(e))})))})),oe(t),$=$.filter((function(e,t){return n!==t})),ee($.slice()),setTimeout((function(){return ee($.slice())}),10)}else h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}}),$.length<(null==P||null===(r=P.group_settings)||void 0===r?void 0:r.length)&&(0,k.jsx)(ye.Z,{className:"c-green ml20",onClick:function(){ee($.concat({}))}})]})]})},n)}))]}),(0,k.jsxs)(R.Z,{className:"mt30",children:[(0,k.jsx)(F.Z,{children:(0,k.jsx)(R.Z,{align:"middle",children:(0,k.jsx)("h1",{style:{marginBottom:0},children:"补交设置"})})}),(0,k.jsxs)(F.Z,{span:24,className:"mt10",children:[(0,k.jsx)(G.Z,{checked:se.allow_late,disabled:z||(null==P?void 0:P.allow_late),onChange:function(e){var n;null!==(n=M.AssistantObject.hack)&&void 0!==n&&n.can_late||!(0,C.Rm)()?(e.target.checked&&f.Z.warning({title:"开启补交提示",width:480,centered:!0,content:(0,k.jsxs)("div",{style:{padding:10,background:"#f5f6f9"},children:[(0,k.jsx)("div",{children:"1.开启补交后不可关闭,补交方式提交保存后不可修改;"}),(0,k.jsx)("div",{children:"2.补交截止时间必须晚于作业截止时间;"}),(0,k.jsx)("div",{children:"3.班级阶段进入“补交中”则不可变更作业截止时间。"})]})}),se.allow_late=!se.allow_late,""==ie&&oe([{late_minus_score:5}]),le(Object.assign({},se))):h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:(0,k.jsx)("span",{style:{fontSize:"14px"},children:"开启补交"})}),(0,k.jsx)(v.Z,{overlayStyle:{width:380,maxWidth:380},title:(0,k.jsxs)("div",{style:{display:"flex",flexFlow:"column"},children:[(0,k.jsx)("span",{children:"补交规则说明"}),(0,k.jsx)("span",{children:"开启补交,学生只在补交时间内才通关则扣除分值,未通关不扣分;"}),(0,k.jsx)("span",{children:"学生在正常作业规定时间内通关,在补交阶段再次通关不扣分。"})]}),children:(0,k.jsx)(je.Z,{})})]})]}),(null==se?void 0:se.allow_late)&&(0,k.jsxs)("div",{style:{marginLeft:50},children:[(0,k.jsxs)("div",{className:"ml30 mt20",style:{marginLeft:50},children:[(0,k.jsx)("span",{children:"补交方式:"}),(0,k.jsxs)(V.ZP.Group,{disabled:z||(null==P?void 0:P.anonymous_comment)||(null==P?void 0:P.allow_late),value:se.unified_late,onChange:function(e){var n;!(0,C.Rm)()||null!==(n=M.AssistantObject.hack)&&void 0!==n&&n.can_late?(se.unified_late=e.target.value,""!=ie||e.target.value||oe([{late_minus_score:5}]),le(o()({},se))):h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:[(null==se?void 0:se.unified_setting)&&(0,k.jsx)(V.ZP,{value:!0,disabled:!(null!=P&&P.manage_all_group),children:" 统一补交 "}),(null==P||null===(T=P.group_settings)||void 0===T?void 0:T.length)&&(0,k.jsx)(V.ZP,{value:!1,children:" 分班补交 "})]})]}),null!=se&&se.unified_late?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(R.Z,{align:"middle",className:"mt25 pl30",children:[(0,k.jsx)(F.Z,{children:"补交扣分:"}),(0,k.jsx)(F.Z,{className:"ml5",children:(0,k.jsx)(Ze.Z,{disabled:z||me,value:{type:se.penalty_type,inputValue:se.late_minus_score},onChange:function(e){var n;!(0,C.Rm)()||null!==(n=M.AssistantObject.hack)&&void 0!==n&&n.can_late?le(o()(o()({},se),{},{late_minus_score:e.inputValue,penalty_type:e.type})):h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})}),(0,k.jsx)(F.Z,{flex:"1",className:"ml5",children:(0,k.jsx)("span",{className:"c-grey-c ml10",children:se.penalty_type===Ze.Q.Number?"(补交时按照学生总成绩扣分)":"(学生成绩将扣除补交关卡分值的百分比)"})})]}),(0,k.jsxs)(R.Z,{align:"middle",className:"mt25 pl30",children:[(0,k.jsx)(F.Z,{children:"补交截止时间:"}),(0,k.jsx)(F.Z,{className:"ml5",children:(0,k.jsx)(ve.default,{allowClear:!1,style:{width:170},placeholder:"请选择截止时间",showTime:{format:"HH:mm",defaultValue:Z()((0,j.U6)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:z||me,value:se.late_time?Z()(se.late_time):"",disabledDate:function(e){return(0,Ne.Q8)(e,null==P?void 0:P.course_end_date)},disabledTime:function(e){return(0,Ne.d0)(e)},onChange:function(e,n){var t;!(0,C.Rm)()||null!==(t=M.AssistantObject.hack)&&void 0!==t&&t.can_late?(se.late_time=n,le(Object.assign({},se))):h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})}),(0,k.jsx)(F.Z,{children:(0,k.jsx)("span",{className:"c-grey-c ml10",children:"(学生“延时”提交作品的时间截点)"})})]})]}):ie.map((function(e,n){var t;return(0,k.jsx)(F.Z,{span:24,children:(0,k.jsxs)(R.Z,{className:"mt25",children:[(0,k.jsxs)(F.Z,{style:{marginLeft:30},children:[(0,k.jsxs)("span",{children:["补交规则",n+1,""]}),(0,k.jsx)(_e.default,{disabled:z||!(null!=O&&null!==(t=O.homework_status)&&void 0!==t&&t.includes("未发布"))&&e.id||(null==P?void 0:P.anonymous_comment),mode:"multiple",style:{width:306},value:"string"==typeof e.group_name?[e.group_name]:e.group_name,placeholder:"请选择分班名称",onChange:function(t){var i;!(0,C.Rm)()||null!==(i=M.AssistantObject.hack)&&void 0!==i&&i.can_late?(ie[n].group_name=t,ie[n].group_id=e.group_id,oe(ie.slice())):h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:P.group_settings&&P.group_settings.map((function(e){return null!=se&&se.unified_setting&&!ie.map((function(e){return e.group_name})).toString().split(",").includes(String(e.group_name))||$.map((function(e){return e.group_name})).toString().split(",").includes(String(e.group_name))&&!ie.map((function(e){return e.group_name})).toString().split(",").includes(String(e.group_name))?(0,k.jsx)(Me,{value:e.group_name,children:e.group_name},e.id):void 0}))})]}),(0,k.jsxs)(F.Z,{className:"ml20",children:[(0,k.jsx)("span",{children:"补交扣分:"}),(0,k.jsx)(Ze.Z,{disabled:z||fe(e.id),value:{type:e.penalty_type,inputValue:e.late_minus_score},onChange:function(e){var t;!(0,C.Rm)()||null!==(t=M.AssistantObject.hack)&&void 0!==t&&t.can_late?(ie[n].late_minus_score=e.inputValue,ie[n].penalty_type=e.type,oe(E()(ie))):h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})]}),(0,k.jsxs)(F.Z,{className:"ml20",children:[(0,k.jsx)("span",{children:"补交截止时间:"}),(0,k.jsx)(ve.default,{disabled:z||fe(e.id),style:{width:200},showTime:{format:"HH:mm",defaultValue:Z()((0,j.U6)(),"HH:mm")},placeholder:"请选择截止时间",disabledDate:function(e){return(0,Ne.Q8)(e,null==P?void 0:P.course_end_date)},disabledTime:function(e){return(0,Ne.d0)(e)},format:"YYYY-MM-DD HH:mm",value:null!=e&&e.late_time?Z()(e.late_time):void 0,onChange:function(e,t){var i;!(0,C.Rm)()||null!==(i=M.AssistantObject.hack)&&void 0!==i&&i.can_late?(ie[n].late_time=t,oe(E()(ie))):h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})]}),!z&&(0,k.jsxs)(F.Z,{className:"ml20",children:[n>0&&!e.id&&(0,k.jsx)(we.Z,{onClick:function(){ie=ie.filter((function(e,t){return n!==t})),oe(ie.slice()),setTimeout((function(){return oe(ie.slice())}),10)}}),(0,k.jsx)(ye.Z,{className:"c-green ml20",onClick:function(){var e;!(0,C.Rm)()||null!==(e=M.AssistantObject.hack)&&void 0!==e&&e.can_late?oe(ie.concat({penalty_type:Ze.Q.Percent,late_minus_score:20})):h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})]})]})},n)}))]})]})}));function Ae(e,n){for(var t=[],i=e;i<n;i++)t.push(i);return t}var Ie=function(e){var n=new Date,t=Z()(e).format("HH");if(Z()(e).isSame(Z()(n),"day")){var i=Z()(n).format("HH"),o=Z()(n).format("mm");return{disabledHours:function(){return Ae(0,24).splice(1,1*i-1)},disabledMinutes:function(){return console.log("禁止时间:",t,i),Z()(e).isSame(Z()(n),"hour")&&t<=i?Ae(0,60).splice(0,o):Ae(60,60)}}}if(Z()(e).isSame(Z()(),"day")){var a=Z()().format("HH"),r=Z()().format("mm");return{disabledHours:function(){return Ae(0,24).splice(0,a)},disabledMinutes:function(){return t<=a?Ae(0,r):Ae(60,60)}}}},Pe=ve.default.RangePicker,Oe=_e.default.Option,Ee=(0,m.connect)((function(e){return{shixunHomeworks:e.shixunHomeworks,loading:e.loading.effects}}))((function(e){var n,t=e.shixunHomeworks,i=(e.loading,e.dispatch),a=(0,m.useParams)(),s=((0,m.useLocation)(),t.workSetting),c=t.workList,f=(t.changeData,(0,d.useState)(!0)),x=u()(f,2),v=x[0],_=x[1],w=(0,d.useState)({}),y=u()(w,2),b=(y[0],y[1],(0,d.useState)(!1)),S=u()(b,2),T=S[0],N=S[1],L=H.Z.useForm(),M=(u()(L,1)[0],(0,d.useState)([])),C=u()(M,2),A=C[0],I=C[1],P=(0,d.useState)([]),O=u()(P,2),B=O[0],D=O[1],z=(0,d.useState)([]),Y=u()(z,2),W=(Y[0],Y[1],(0,d.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,open_code:!1,rank_forbidden:!1,open_code_type:void 0,comment_public:!0,total_score:"",eff_score:0,rank_forbidden_start:"",rank_forbidden_end:""})),U=u()(W,2),q=U[0],J=U[1];(0,d.useEffect)((function(){return Q(),function(){I([].concat())}}),[]);var Q=function(){i({type:"shixunHomeworks/getWorkSetting",payload:o()({},a)})},K=function(e){return e&&e<Z()().startOf("day")};(0,d.useEffect)((function(){var e;null!=s&&s.course_id&&(Object.keys(q).map((function(e){q[e]=s[e]})),q.allow_late&&q.unified_late||(q.late_penalty=5),A=JSON.parse(JSON.stringify(s.group_settings.map((function(e){return o()(o()({},e),{},{group_name:[e.group_name]})})).filter((function(e){return null!==e.publish_time})))),B=JSON.parse(JSON.stringify(s.allow_late_settings.map((function(e){return o()(o()({},e),{},{group_name:[e.group_name]})})).filter((function(e){return null!==e.rank_forbidden_start})))),J(o()({},q)),I(E()(A)),(null===(e=B)||void 0===e?void 0:e.length)<=0?D([{}]):D(E()(B)))}),[s]),console.log(q,"data");var X=function(e){if(console.log(e.total_score,e.eff_score),null!==e.total_score)if(null!=e&&e.work_efficiency&&null===e.eff_score)h.ZP.warning("效率分不能为空");else{e.shixun_evaluation;var n=function(){var n=l()(r()().mark((function n(){return r()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return N(!0),n.next=3,(0,p.ZP)("/api/homework_commons/".concat(a.categoryId,"/public_setting.json"),{method:"post",body:o()({},e)});case 3:0===n.sent.status&&(h.ZP.success("更新成功"),_(!0),Q(),i({type:"shixunHomeworks/getWorkList",payload:o()({},a)})),N(!1);case 6:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}();n()}else h.ZP.warning("总分值不能为空")};return(0,k.jsxs)("section",{className:ke,children:[(0,k.jsxs)(R.Z,{align:"middle",children:[(0,k.jsx)(F.Z,{flex:"1",children:(0,k.jsx)("div",{className:Te,children:"公开设置"})}),(0,k.jsxs)(F.Z,{children:[(null==s?void 0:s.can_edit)&&v&&(0,k.jsx)(g.ZP,{type:"primary",size:"middle",ghost:!0,onClick:function(){return _(!1)},children:"编辑设置"}),!v&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(g.ZP,{type:"primary",loading:T,onClick:function(){return function(){var e,n=JSON.parse(JSON.stringify(q));if(n.categoryId=a.categoryId,q.unified_setting||(A=null===(e=A)||void 0===e?void 0:e.map((function(e){var n;if(!e.publish_time||!e.end_time)throw h.ZP.error("请把开始时间填写完整"),new String("请把开始时间填写完整");if(!e.group_name)throw h.ZP.error("请选择分班名称"),new String("请选择分班名称");return e.group_name="string"==typeof(null==e?void 0:e.group_name)?[null==e?void 0:e.group_name]:null==e?void 0:e.group_name,e.group_id=null===(n=s.group_settings)||void 0===n?void 0:n.filter((function(n){var t;return null==e||null===(t=e.group_name)||void 0===t?void 0:t.includes(n.group_name)})).map((function(e){return e.group_id||e.id})).toString().split(","),e}))),n.group_settings=A,q.rank_forbidden)if(q.unified_setting){if(!q.rank_forbidden_start)throw h.ZP.error("请把开始时间填写完整"),new String("请把开始时间填写完整");if(!q.rank_forbidden_end)throw h.ZP.error("请把截止时间填写完整"),new String("请把截止时间填写完整");if(Z()(q.rank_forbidden_end)<Z()(q.rank_forbidden_start))throw h.ZP.error("截止时间不能早于开始时间"),new String("截止时间不能早于开始时间")}else{var t;B=null===(t=B)||void 0===t?void 0:t.map((function(e){var n;if(!e.rank_forbidden_start)throw h.ZP.error("请把开始时间填写完整"),new String("请把开始时间填写完整");if(!e.rank_forbidden_end)throw h.ZP.error("请把截止时间填写完整"),new String("请把截止时间填写完整");if(!e.group_name)throw h.ZP.error("请选择分班名称"),new String("请选择分班名称");return e.group_name="string"==typeof(null==e?void 0:e.group_name)?[null==e?void 0:e.group_name]:null==e?void 0:e.group_name,e.group_id=null==e||null===(n=e.group_name)||void 0===n||null===(n=n.map((function(e){var n,t=null===(n=s.group_settings)||void 0===n||null===(n=n.filter((function(n){return(null==n?void 0:n.group_name)===e})))||void 0===n?void 0:n[0];return null==t?void 0:t.group_id})))||void 0===n?void 0:n.toString().split(","),e})),n.group_settingss=B}X(n)}()},children:"提交"}),(0,k.jsx)(g.ZP,{type:"primary",ghost:!0,className:"ml20",onClick:function(){_(!0),Q()},children:"取消"})]})]})]}),(0,k.jsxs)(R.Z,{children:[(0,k.jsxs)(F.Z,{span:24,className:"mt15 mt20",children:[(0,k.jsx)(G.Z,{checked:q.score_open,disabled:v,onChange:function(e){q.score_open=e.target.checked,J(Object.assign({},q))},children:(0,k.jsx)("span",{className:"font14",children:"公开成绩"})}),(0,k.jsx)("span",{className:"c-grey-c font12",children:"(选中,则在作业截止/补交结束时间之后,已提交作品的学生可以查看其它学生的成绩,否则只能查看自己的成绩)"})]}),(0,k.jsxs)(F.Z,{span:24,className:"mt15",children:[(0,k.jsx)(G.Z,{checked:q.open_code,disabled:v,onChange:function(e){q.open_code=e.target.checked,J(Object.assign({},q))},children:(0,k.jsx)("span",{className:"font14",children:"公开代码"})}),(0,k.jsx)("span",{className:"c-grey-c font12",children:"(选中,学生可以查看其他学生的代码详情)"})]}),!!q.open_code&&(0,k.jsx)(F.Z,{span:24,className:"mt10 ml25",children:(0,k.jsxs)(V.ZP.Group,{disabled:v,value:q.open_code_type,onChange:function(e){q.open_code_type=e.target.value,J(Object.assign({},q))},children:[(0,k.jsx)(V.ZP,{value:0,children:"任意时间查看"}),(0,k.jsx)(V.ZP,{style:{marginLeft:60},value:1,children:"练习时间结束后"})]})}),(0,k.jsxs)(F.Z,{span:24,className:"mt15 mt20",children:[(0,k.jsx)(G.Z,{checked:q.rank_forbidden,disabled:v,onChange:function(e){q.rank_forbidden=e.target.checked,J(Object.assign({},q))},children:(0,k.jsx)("span",{className:"font14",children:"开启封榜"})}),(0,k.jsx)("span",{className:"c-grey-c font12",children:"(选中则在设置的这段时间内,学生看不到排行榜信息,其他时间可以查看)"})]}),!!q.rank_forbidden&&q.unified_setting&&(0,k.jsx)(F.Z,{span:24,className:"mt10 ",children:(0,k.jsxs)("div",{style:{marginLeft:50},children:[(0,k.jsxs)(R.Z,{align:"middle",className:"mt25 ",children:[(0,k.jsx)(F.Z,{children:"开始时间"}),(0,k.jsx)(F.Z,{className:"ml10",children:(0,k.jsx)(ve.default,{style:{width:170},placeholder:"请选择开始时间",showTime:{format:"HH:mm"},allowClear:!1,format:"YYYY-MM-DD HH:mm",disabledDate:K,disabledTime:Ie,disabled:v||Z()()>Z()(s.rank_forbidden_start),value:q.rank_forbidden_start?Z()(q.rank_forbidden_start):"",onChange:function(e,n){q.rank_forbidden_start=n,""!=q.end_time&&q.end_time||!q.unified_setting||(q.end_time=Z()(e).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),J(Object.assign({},q))}})}),(0,k.jsx)(F.Z,{children:(0,k.jsx)("span",{className:"c-grey-c ml10",children:"(学生看不到排行榜的开始时间)"})})]}),(0,k.jsxs)(R.Z,{align:"middle",className:"mt25",children:[(0,k.jsx)(F.Z,{children:"截止时间"}),(0,k.jsx)(F.Z,{className:"ml10",children:(0,k.jsx)(ve.default,{style:{width:170},allowClear:!1,placeholder:"请选择截止时间",showTime:{format:"HH:mm",defaultValue:Z()((0,j.U6)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:v,disabledDate:K,value:q.rank_forbidden_end?Z()(q.rank_forbidden_end):"",onChange:function(e,n){q.rank_forbidden_end=n,J(Object.assign({},q))}})}),(0,k.jsx)(F.Z,{children:(0,k.jsx)("span",{className:"c-grey-c ml10",children:"(学生看不到排行榜的结束时间)"})})]})]})}),!q.unified_setting&&(null===(n=A)||void 0===n?void 0:n.length)>0&&!!q.rank_forbidden&&(0,k.jsxs)(R.Z,{style:{marginTop:30,paddingTop:20,marginLeft:80,borderTop:"1px solid #eee"},children:[(0,k.jsx)(F.Z,{span:24,children:(0,k.jsxs)(R.Z,{children:[(0,k.jsx)(F.Z,{span:10}),(0,k.jsx)(F.Z,{span:10,children:(0,k.jsxs)(R.Z,{className:"c-grey-c ml30",children:[(0,k.jsx)(F.Z,{flex:"1",children:"(学生看不到排行榜的开始时间)"}),(0,k.jsx)(F.Z,{flex:"1",children:"(学生看不到排行榜的结束时间)"})]})}),(0,k.jsx)(F.Z,{span:4})]})}),B.map((function(e,n){var t,i,o;return(0,k.jsx)(F.Z,{span:24,children:(0,k.jsxs)(R.Z,{className:"mt25",children:[(0,k.jsxs)(F.Z,{style:{marginLeft:30},children:[(0,k.jsxs)("span",{children:["封榜规则",n+1,""]}),(0,k.jsx)(_e.default,{disabled:v||!(null!=c&&null!==(t=c.homework_status)&&void 0!==t&&t.includes("未发布"))&&e.id,mode:"multiple",style:{width:306},value:"string"==typeof e.group_name?[e.group_name]:e.group_name,placeholder:"请选择分班名称",onChange:function(t){B[n].group_name=t,B[n].group_id=e.group_id,D(B.slice())},children:s.group_settings&&s.group_settings.map((function(e){return null!=q&&q.unified_setting&&!B.map((function(e){return e.group_name})).toString().split(",").includes(String(e.group_name))||A.map((function(e){return e.group_name})).toString().split(",").includes(String(e.group_name))&&!B.map((function(e){return e.group_name})).toString().split(",").includes(String(e.group_name))?(0,k.jsx)(Oe,{value:e.group_name,children:e.group_name},e.id):void 0}))})]}),(0,k.jsx)(F.Z,{span:10,children:(0,k.jsx)("div",{className:"ml30",children:(0,k.jsx)(Pe,{allowClear:!1,disabled:v||!(null==s||null===(i=s.group_settings)||void 0===i||null===(i=i.filter((function(n){return n.id===e.id})))||void 0===i||null===(i=i[0])||void 0===i||!i.rank_forbidden_start)&&(!(Z()()<Z()(null==s||null===(o=s.group_settings)||void 0===o||null===(o=o.filter((function(n){return n.id===e.id})))||void 0===o||null===(o=o[0])||void 0===o?void 0:o.rank_forbidden_start))&&[!0,!1]),style:{width:400},placeholder:["请选择开始时间","请选择结束时间"],disabledDate:K,disabledTime:Ie,showTime:{format:"HH:mm",defaultValue:[Z()((0,j.U6)(),"HH:mm"),Z()((0,j.U6)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:e.rank_forbidden_start&&[Z()(e.rank_forbidden_start),e.rank_forbidden_end?Z()(e.rank_forbidden_end):void 0],onChange:function(e,t){B[n].rank_forbidden_start=t[0],B[n].rank_forbidden_end=t[1],D(E()(B))}})})}),!v&&(0,k.jsxs)(F.Z,{className:"ml20",children:[n>0&&!e.id&&(0,k.jsx)(we.Z,{onClick:function(){B=B.filter((function(e,t){return n!==t})),D(B.slice()),setTimeout((function(){return D(B.slice())}),10)}}),(0,k.jsx)(ye.Z,{className:"c-green ml20",onClick:function(){D(B.concat({}))}})]})]})},n)}))]})]})]})})),Be=(0,m.connect)((function(e){return{shixunHomeworks:e.shixunHomeworks,loading:e.loading.effects}}))((function(e){var n,t=e.shixunHomeworks,i=(e.loading,e.dispatch),a=(0,m.useParams)(),s=t.workSetting,c=t.workList,x=(t.changeData,(0,d.useState)(!0)),v=u()(x,2),_=v[0],w=v[1],y=(0,d.useState)(!1),j=u()(y,2),b=j[0],S=j[1],T=(0,d.useState)(!1),Z=u()(T,2),N=(Z[0],Z[1],H.Z.useForm()),L=(u()(N,1)[0],(0,d.useState)([])),M=u()(L,2),C=M[0],A=M[1],I=(0,d.useState)([]),P=u()(I,2),O=P[0],B=P[1],D=!(null!=c&&null!==(n=c.homework_status)&&void 0!==n&&n.includes("未发布")),z=(0,d.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,comment_public:!0,total_score:"",eff_score:0,is_onpage_time:!0,training_time_rules:1,hack_settings:[],punish_time:void 0,hack_score_settings:void 0}),G=u()(z,2),Y=G[0],W=G[1];(0,d.useEffect)((function(){return q(),function(){A([].concat())}}),[]);var q=function(){i({type:"shixunHomeworks/getWorkSetting",payload:o()({},a)})};(0,d.useEffect)((function(){null!=s&&s.course_id&&(Object.keys(Y).map((function(e){Y[e]=s[e]})),Y.allow_late&&Y.unified_late||(Y.late_penalty=5),C=JSON.parse(JSON.stringify(s.group_settings.map((function(e){return o()(o()({},e),{},{group_name:[e.group_name]})})).filter((function(e){return null!==e.publish_time})))),O=JSON.parse(JSON.stringify(s.allow_late_settings.map((function(e){return o()(o()({},e),{},{group_name:[e.group_name]})})).filter((function(e){return null!==e.late_time})))),Q(),W(o()({},Y)),A(E()(C)),B(E()(O)))}),[s]);var J=function(e){if(console.log(e.total_score,e.eff_score),null!==e.total_score){var n=function(){var n=l()(r()().mark((function n(){return r()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return S(!0),n.next=3,(0,p.ZP)("/api/homework_commons/".concat(a.categoryId,"/hack_score_setting.json"),{method:"post",body:o()({},e)});case 3:0===n.sent.status&&(h.ZP.success("更新成功"),w(!0),q(),i({type:"shixunHomeworks/getWorkList",payload:o()({},a)})),S(!1);case 6:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}();(null==Y?void 0:Y.hack_score_settings)!==(null==s?void 0:s.hack_score_settings)&&D?f.Z.confirm({title:"更新成绩",content:"您改动了本次作业的得分设置,这可能导致已完成作业的学生的成绩产生错误。点击“确定”按钮将保存最新设置并按最新设置更新全班成绩。",okText:"确认",cancelText:"取消",onOk:n}):n()}else h.ZP.warning("总分值不能为空")},Q=function(){var e,n,t=Y.total_score,i=null===(e=Y.hack_settings)||void 0===e?void 0:e.length,o=0;switch(Y.hack_score_settings){case 0:var a=(t/i).toFixed(2);Y.hack_settings.map((function(e,n){o=n,e.hack_score=a>0?a:0})),n=(t-a*(i-1)).toFixed(2),Y.hack_settings[o].hack_score=n>0?n:0;break;case 1:var r=[0,1,3,6],s=0,l=t/(Y.hack_settings.filter((function(e){return 1===e.difficult})).length*r[1]+Y.hack_settings.filter((function(e){return 2===e.difficult})).length*r[2]+Y.hack_settings.filter((function(e){return 3===e.difficult})).length*r[3]);console.log(l,2222),Y.hack_settings.map((function(e,n){o=n,e.hack_score=(r[e.difficult]*l).toFixed(2),s+=Number(e.hack_score)}));var c=Y.hack_settings[o].hack_score;n=(t-s+Number(c)).toFixed(2),Y.hack_settings[o].hack_score=n>0?n:0}};return(0,k.jsxs)("section",{className:ke,children:[(0,k.jsxs)(R.Z,{align:"middle",children:[(0,k.jsx)(F.Z,{flex:"1"}),(0,k.jsxs)(F.Z,{children:[(null==s?void 0:s.can_edit)&&_&&(0,k.jsx)(g.ZP,{type:"primary",size:"middle",ghost:!0,onClick:function(){return w(!1)},children:"编辑设置"}),!_&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(g.ZP,{type:"primary",loading:b,onClick:function(){return e=JSON.parse(JSON.stringify(Y)),void J(e);var e},children:"提交"}),(0,k.jsx)(g.ZP,{type:"primary",ghost:!0,className:"ml20",onClick:function(){w(!0),q()},children:"取消"})]})]})]}),(0,k.jsxs)(R.Z,{align:"middle",children:[(0,k.jsxs)(F.Z,{children:[(0,k.jsx)("span",{children:"总分值"}),(0,k.jsx)(U.Z,{min:0,className:"ml10 mr10",style:{width:160},value:Y.total_score,disabled:_||D,onChange:function(e){Y.total_score=e,W(Object.assign({},Y)),Q()}})," 分"]}),(0,k.jsxs)(F.Z,{style:{marginLeft:100},children:[(0,k.jsx)("span",{children:"测评单次报错增加时长"}),(0,k.jsx)(U.Z,{className:"ml10 mr10",style:{width:160},min:0,value:Y.punish_time,precision:0,disabled:_,onChange:function(e){Y.punish_time=e,W(Object.assign({},Y)),Q()}})," 分钟"]})]}),(0,k.jsxs)(R.Z,{align:"middle",style:{marginTop:20},children:[(0,k.jsx)(F.Z,{children:(0,k.jsx)("span",{children:"试题分值设置规则"})}),(0,k.jsx)(F.Z,{flex:"1",children:(0,k.jsx)(H.Z.Item,{className:"ml20",children:(0,k.jsxs)(V.ZP.Group,{disabled:_||D,value:Y.hack_score_settings,onChange:function(e){Y.hack_score_settings=e.target.value,W(Object.assign({},Y)),Q()},children:[(0,k.jsx)(V.ZP,{value:0,children:"均分比例"}),(0,k.jsx)(V.ZP,{className:"ml20 mr20",value:1,children:"难易度"}),(0,k.jsx)(V.ZP,{value:2,children:"自定义分值"})]})})})]}),(0,k.jsx)("div",{className:Se,children:Y.hack_settings&&Y.hack_settings.map((function(e,n){return(0,k.jsxs)(R.Z,{align:"middle",style:{marginTop:20},children:[(0,k.jsx)(F.Z,{flex:"1",className:"pr10",children:(0,k.jsx)("strong",{children:e.hack_name})}),(0,k.jsxs)(F.Z,{flex:"150px",children:[(0,k.jsx)(U.Z,{min:0,step:.1,value:e.hack_score,disabled:_||2!==Y.hack_score_settings||D,onChange:function(e){Y.hack_settings[n].hack_score=e;var t=Y.hack_settings.reduce((function(e,n){return e+Number(n.hack_score)}),0);Y.total_score=t.toFixed(2),W(o()({},Y))}}),(0,k.jsx)("span",{className:"ml10",children:"分"})]}),(0,k.jsxs)(F.Z,{style:{lineHeight:"20px"},children:[1===e.difficult&&(0,k.jsx)("span",{className:"tag-style-border-small bg-green c-white mr10",children:"简单"}),2===e.difficult&&(0,k.jsx)("span",{className:"tag-style-border-small bg-blue c-white mr10",children:"适中"}),3===e.difficult&&(0,k.jsx)("span",{className:"tag-style-border-small bg-orange c-white mr10",children:"困难"})]})]},n)}))}),(0,k.jsx)("div",{style:{height:100}})]})})),De=(0,m.connect)((function(e){return{shixunHomeworks:e.shixunHomeworks,loading:e.loading.effects}}))((function(e){e.shixunHomeworks,e.loading,e.dispatch;var n,t,i=(0,d.useState)(!0),o=u()(i,2),a=o[0],s=o[1],c=(0,d.useState)(!1),x=u()(c,2),v=x[0],_=x[1],y=(0,d.useState)([]),j=u()(y,2),b=j[0],S=j[1],T=(0,d.useState)([]),Z=u()(T,2),N=Z[0],L=Z[1],M=(0,d.useState)([]),C=u()(M,2),I=C[0],P=C[1],O=(0,d.useState)([]),E=u()(O,2),B=E[0],D=E[1],H=(0,m.useParams)();function z(){return G.apply(this,arguments)}function G(){return(G=l()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,p.ZP)("/api/homework_commons/".concat(H.categoryId,"/homework_common_collaborators.json"),{method:"get"});case 2:n=e.sent,L(n);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function W(){return V.apply(this,arguments)}function V(){return(V=l()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,p.ZP)("/api/courses/".concat(null==H?void 0:H.coursesId,"/teachers"),{method:"get",params:{homework_id:H.categoryId,limit:1e3}});case 2:null==(n=e.sent)||n.teacher_list.map((function(e){e.key=e.user_id})),P(null==n?void 0:n.teacher_list),D(null==n?void 0:n.teacher_list);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,d.useEffect)((function(){z(),W()}),[H]);return(0,k.jsxs)("section",{className:ke,children:[(0,k.jsx)(R.Z,{children:(0,k.jsxs)(F.Z,{flex:"1",children:[(0,k.jsx)("span",{style:{fontSize:"16px"},children:"协作设置"}),(null==N?void 0:N.can_edit)&&(0,k.jsx)("span",{style:{cursor:"pointer",color:"#0152d9",marginLeft:"10px"},onClick:function(){_(!0)},children:"+添加协作者"})]})}),(0,k.jsxs)(R.Z,{style:{marginTop:"20px",marginBottom:"20px"},children:[(null==N||null===(n=N.data)||void 0===n?void 0:n.length)<=0&&(0,k.jsx)(A.Z,{customText:"该作业暂无协作者"}),null==N||null===(t=N.data)||void 0===t?void 0:t.map((function(e){return(0,k.jsxs)("span",{style:{display:"inline-flex",height:"40px",borderRadius:"4px",border:"1px solid #44D7B6",padding:"7px 20px",color:"#44D7B6",marginRight:"40px"},children:[(0,k.jsx)("span",{style:{flex:"1"},children:null==e?void 0:e.real_name}),(null==N?void 0:N.can_edit)&&(0,k.jsx)("span",{style:{cursor:"pointer",marginLeft:"10px"},onClick:l()(r()().mark((function n(){return r()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,p.ZP)("/api/homework_commons/".concat(H.categoryId,"/homework_common_collaborators/delete.json"),{method:"delete",body:{user_id:e.id}});case 2:0===n.sent.status&&(h.ZP.info("删除成功"),z(),W());case 4:case"end":return n.stop()}}),n)}))),children:"X"})]})}))]}),(0,k.jsx)(R.Z,{children:!a&&(0,k.jsxs)(F.Z,{className:"mb50",children:[(0,k.jsx)(g.ZP,{type:"primary",size:"middle",onClick:function(){},children:"提交"}),(0,k.jsx)(g.ZP,{type:"primary",size:"middle",ghost:!0,className:"ml20",onClick:function(){s(!0)},children:"取消"})]})}),(0,k.jsx)(f.Z,{title:"添加协作者",open:v,onCancel:function(){return _(!1)},onOk:l()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==b.length){e.next=3;break}return h.ZP.info("请选择协作老师"),e.abrupt("return");case 3:return e.next=5,(0,p.ZP)("/api/homework_commons/".concat(H.categoryId,"/homework_common_collaborators.json"),{method:"post",body:{user_ids:b}});case 5:0===e.sent.status&&(h.ZP.info("添加成功"),S([]),z(),W(),_(!1));case 7:case"end":return e.stop()}}),e)}))),children:(0,k.jsxs)("div",{children:[(0,k.jsxs)("div",{style:{display:"flex"},children:[(0,k.jsx)("label",{style:{width:"50px"},children:"姓名:"})," ",(0,k.jsx)(Y.Z.Search,{onChange:function(e){P(B.filter((function(n){return n.name.indexOf(e.target.value)>-1})))}})]}),(0,k.jsx)(w.Z,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(e,n){S(e)},selectedRowKeys:b,getCheckboxProps:function(e){return{disabled:e.is_collaborator}}},pagination:!1,dataSource:I,columns:[{title:"姓名",dataIndex:"name",key:"name"},{title:"角色",dataIndex:"role",key:"role"}]})]})})]})})),He=function(){return(0,k.jsx)("section",{className:"bg-white pl30 pr30 pt10 mb10",children:(0,k.jsxs)(_.Z,{destroyInactiveTabPane:!0,children:[(0,k.jsx)(_.Z.TabPane,{tab:"发布设置",children:(0,k.jsx)(Ce,{})},1),(0,k.jsx)(_.Z.TabPane,{tab:"评分设置",children:(0,k.jsx)(Be,{})},2),(0,k.jsx)(_.Z.TabPane,{tab:"公开设置",children:(0,k.jsx)(Ee,{})},3),(0,k.jsx)(_.Z.TabPane,{tab:"协作设置",children:(0,k.jsx)(De,{})},4)]})})},ze=t(26724),Ge=t.n(ze),Re=(0,m.connect)((function(e){return{shixunHomeworks:e.shixunHomeworks,loading:e.loading}}))((function(e){var n=e.shixunHomeworks,t=e.loading,i=e.dispatch,a=(0,m.useParams)(),s=((0,m.useLocation)(),(0,d.useState)([])),c=u()(s,2),h=c[0],g=c[1],x=(0,d.useState)([]),v=u()(x,2),_=(v[0],v[1],(0,d.useState)(!0)),y=u()(_,2),j=y[0],b=y[1],S=(0,d.useState)(!1),T=u()(S,2),N=T[0],L=T[1],M=(0,d.useState)(1),C=u()(M,2),A=C[0],I=C[1],P=(0,d.useState)([]),O=u()(P,2),B=(O[0],O[1]),z=(0,d.useState)(!1),Y=u()(z,2),W=Y[0],V=Y[1],U=(0,d.useState)(!1),q=u()(U,2),J=q[0],Q=q[1],K=(0,d.useState)(!1),X=u()(K,2),$=X[0],ee=X[1];(0,d.useEffect)((function(){"代码查重"===n.actionTabs.key?(te.resetFields(),g([]),V(!0),ie()):V(!1)}),[n.actionTabs.key]);var ne=H.Z.useForm(),te=u()(ne,1)[0],ie=function(){var e=l()(r()().mark((function e(){var n,t,i;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!j||N){e.next=11;break}return L(!0),I(A+1),e.next=5,(0,oe.JG)(o()(o()({},a),{},{page:A}));case 5:t=e.sent,i=E()(t.group_list),null!=t&&t.ungroup_list&&i.push({id:null==t?void 0:t.ungroup_list.id,name:null==t?void 0:t.ungroup_list.name,works_count:null==t?void 0:t.ungroup_list.work_count,last_review_time:null==t?void 0:t.ungroup_list.last_review_time}),g([].concat(E()(h),E()(i))),L(!1),(null===(n=t.group_list)||void 0===n?void 0:n.length)<10&&b(!1);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ae=function(){i({type:"shixunHomeworks/setActionTabs",payload:{}}),Q(!1),b(!0),L(!1),I(1),g([]),te.resetFields()},re=[{title:"",dataIndex:"id",width:280,render:function(e,n){return(0,k.jsx)(G.Z,{disabled:!(n.works_count>1),value:String(n.id),children:n.name})}},{title:"有效作品数",dataIndex:"works_count"},{title:"上次查重时间",dataIndex:"last_review_time",width:130}];return(0,k.jsxs)(f.Z,{centered:!0,title:"代码查重",keyboard:!1,maskClosable:!1,open:W,okText:"确认",cancelText:"取消",width:820,bodyStyle:{minHeight:200},onOk:l()(r()().mark((function e(){var t,o;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=te.getFieldValue(),ee(!0),e.next=4,(0,p.ZP)("/api/homework_commons/".concat(a.categoryId,"/hack_homework_code_repeat.json"),{method:"post",body:{group_ids:E()(t.group_ids)}});case 4:if(o=e.sent,ee(!1),0!==o.status){e.next=12;break}return ae(),e.next=10,i({type:"shixunHomeworks/getWorkList",payload:n.actionTabs.params});case 10:m.history.push("/classrooms/".concat(a.coursesId,"/program_homework/").concat(a.categoryId,"/detail?tabs=2")),i({type:"shixunHomeworks/setActionTabs",payload:{key:"执行代码查重"}});case 12:case"end":return e.stop()}}),e)}))),okButtonProps:{loading:$},onCancel:ae,children:[(0,k.jsx)("div",{children:"请注意:在执行代码查重操作后,若学生提交新的作品代码,新作品代码不计入本次查重结果。"}),n.codeReviewCourse&&(0,k.jsxs)(H.Z,{form:te,onChange:function(e){B(o()({},te.getFieldValue()))},initialValues:D()(D()({},"group_ids",[]),"end_time",Z()(Z()().add(7,"days").format("YYYY-MM-DD HH:mm"))),children:[(0,k.jsx)("div",{className:"flexd-table-header mt20",children:(0,k.jsx)(w.Z,{pagination:!1,dataSource:[],columns:re})}),(0,k.jsx)(H.Z.Item,{name:"group_ids",children:(0,k.jsx)(G.Z.Group,{className:"w100",children:(0,k.jsx)("div",{style:{width:"100%",maxHeight:260,overflow:"auto"},children:(0,k.jsx)(Ge(),{initialLoad:!1,pageStart:1,threshold:20,loadMore:function(e){ie()},hasMore:j,useWindow:!1,children:(0,k.jsx)(w.Z,{loading:t.effects["shixunHomeworks/getCodeReviewCourse"],showHeader:!1,columns:re,dataSource:h,pagination:!1})})})})})]}),(0,k.jsx)(R.Z,{children:(0,k.jsx)(F.Z,{className:"ml10",children:(0,k.jsx)(G.Z,{checked:J,onChange:function(e){Q(e.target.checked);var n=[];e.target.checked&&(n=h.filter((function(e){return e.works_count>1})).map((function(e){return e.id+""}))),te.setFieldsValue(D()({},"group_ids",n))},children:"全选"})})})]})})),Fe=t(98833),Ye=t(79849),We=t(92713),Ve=t(60937),Ue=t(98242),qe=t(51756),Je=t(24132),Qe=t(25943),Ke=t(58469),Xe=[qe.Z,Je.Z,Qe.Z],$e=(0,m.connect)((function(e){return{user:e.user,classroomList:e.classroomList}}))((function(e){var n,t,i=e.user,a=e.classroomList,s=(0,d.useState)(o()(o()({},(0,m.useParams)()),{},{page:1,per_page:10,rank_type:2,course_group:(0,C.dE)()?[i.userInfo.course.course_group_id]:[]},(0,m.useParams)())),c=u()(s,2),x=c[0],_=c[1],y=(0,d.useState)([]),j=u()(y,2),b=j[0],S=j[1],T=(0,d.useState)([]),Z=u()(T,2),M=Z[0],I=Z[1],P=(0,d.useState)([]),O=u()(P,2),B=O[0],D=O[1],H=(0,d.useState)(!1),z=u()(H,2),R=z[0],F=z[1],Y=(0,d.useState)([{title:"排行",dataIndex:"rank",width:100,fixed:"left",render:function(e,n,t){return e<4?(0,k.jsx)("img",{src:Xe[e-1]}):e}},{title:"用户",dataIndex:"user_name",width:150,fixed:"left",key:"user_name",render:function(e,n,t){return(0,k.jsxs)("div",{children:[(0,k.jsx)("img",{style:{width:30,height:30,borderRadius:"50%",marginRight:10},src:Ue.Z.IMG_SERVER+"/images/"+(null==n?void 0:n.image_url)}),e]})}},{title:"分班",dataIndex:"course_group",key:"course_group",ellipsis:!0,width:150,fixed:"left"},{title:"学号",dataIndex:"student_id",key:"student_id",width:150,ellipsis:!0,fixed:"left",render:function(e){return e||"- -"}},{title:"通过",dataIndex:"passed_count",width:100,fixed:"left",key:"passed_count"},{title:"得分",dataIndex:"score",width:100,fixed:"left",key:"score"}]),W=u()(Y,2),U=W[0],q=W[1];function J(e){return Q.apply(this,arguments)}function Q(){return(Q=l()(r()().mark((function e(n){var t,s,c,u,d,m;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return F(!0),e.next=3,(0,p.ZP)("/api/courses/rank_list.json",{method:"get",params:o()(o()({},x),{},{id:x.coursesId,rank_type:2,homework_common_id:x.categoryId})});case 3:if(t=e.sent,S(t),F(!1),-1==t.status){e.next=19;break}if((0,C.dE)()?(1===n&&I([null==t||null===(s=t.course_group)||void 0===s||null===(s=s[0])||void 0===s?void 0:s.id]),null!=t&&t.my_rank?D([null==t?void 0:t.my_rank].concat(E()(null==t?void 0:t.rank_list))):D(E()(null==t?void 0:t.rank_list))):D(E()(null==t?void 0:t.rank_list)),1!==n){e.next=19;break}c={title:(0,k.jsxs)(v.Z,{title:"总耗时时为做题通过时长和罚时时长的总和,\n 罚时时长=评测出错次数X设置的罚时当前为".concat(null==t?void 0:t.punish_time,"分)"),children:[(0,k.jsx)("span",{style:{marginRight:3},children:"总耗时"})," ",(0,k.jsx)("span",{style:{fontSize:"14px"},className:"iconfont icon-tishixiaowenhao c-blue"})]}),dataIndex:"finish_time",width:150,ellipsis:!0,fixed:"left",key:"finish_time"},U.push(c),u=r()().mark((function e(n){var s,c,u;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(u={}).title=null!=t&&t.sent_type?(0,k.jsx)("span",{children:"题目"+(n+1)+"".concat(null==t||null===(s=t.question_data)||void 0===s||null===(s=s[n])||void 0===s?void 0:s.question_score,"")}):(0,k.jsx)("a",{onClick:l()(r()().mark((function e(){var i,o;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,p.ZP)("/api/problems/".concat(null==t||null===(i=t.question_data)||void 0===i||null===(i=i[n])||void 0===i?void 0:i.identifier,"/start.json"),{method:"get"});case 2:(o=e.sent)&&(window.open("/myproblems/".concat(null==o?void 0:o.identifier,"?type=1")),localStorage.setItem("program_homework",[x.coursesId,x.categoryId]));case 4:case"end":return e.stop()}}),e)}))),children:"题目"+(n+1)+"".concat(null==t||null===(c=t.question_data)||void 0===c||null===(c=c[n])||void 0===c?void 0:c.question_score,"")}),u.dataIndex="question_data",u.width=250,u.render=function(e,t){var s,c,u,d,m;return(0,k.jsx)("div",{children:(null==e||null===(s=e[n])||void 0===s?void 0:s.answer_question_time)&&(0,k.jsxs)("div",{children:[(0,k.jsx)("span",{style:{cursor:"pointer"},className:"iconfont icon-shixun4 c-blue",onClick:l()(r()().mark((function t(){var s,l,c,u,d,m,g,v,_;return r()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(0,C.Rm)()||null!==(s=a.AssistantObject.hack)&&void 0!==s&&s.can_view){t.next=3;break}return h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能"),t.abrupt("return");case 3:if(null!=e&&null!==(l=e[n])&&void 0!==l&&l.open_code){t.next=6;break}return h.ZP.info("暂不允许查看代码"),t.abrupt("return");case 6:return t.next=8,(0,p.ZP)("/api/courses/view_code.json",{method:"get",params:o()(o()({},x),{},{id:x.coursesId,homework_common_id:x.categoryId,hack_user_code_id:null==e||null===(c=e[n])||void 0===c?void 0:c.hack_user_code_id})});case 8:_=t.sent,f.Z.warning({icon:null,width:800,title:(0,k.jsxs)("div",{children:[(0,k.jsx)("span",{children:"代码"}),(0,k.jsxs)("span",{children:["使用语言:",null==e||null===(u=e[n])||void 0===u?void 0:u.current_language]}),(0,k.jsxs)("span",{children:["运行内存:",null==e||null===(d=e[n])||void 0===d?void 0:d.memory,"KB"]}),(0,k.jsxs)("span",{children:["运行时长:",null==e||null===(m=e[n])||void 0===m?void 0:m.run_time,"ms"]}),(0,k.jsxs)("span",{children:["得分:",null==e||null===(g=e[n])||void 0===g?void 0:g.score]})]}),content:(0,k.jsx)(Ke.Z,{classroomList:a,user:i,languages:[{language:null==e||null===(v=e[n])||void 0===v?void 0:v.language,code:null==_?void 0:_.code}],v:e,shixunWorkReport:"shixunWorkReport",dispatch:"dispatch",autoHeight:!1,language:e.language,game_id:e.id,diff_code_count:e.diff_code_count})});case 10:case"end":return t.stop()}}),t)})))}),(0,k.jsx)("span",{style:{margin:"0px 10px"},children:(null==e||null===(c=e[n])||void 0===c?void 0:c.answer_question_time)||"- -"}),null!=e&&null!==(u=e[n])&&void 0!==u&&u.submit_count?(0,k.jsxs)(v.Z,{title:"".concat((null==e||null===(d=e[n])||void 0===d?void 0:d.submit_count)||0,"次尝试出错"),children:[(0,k.jsx)("span",{style:{color:"red",marginRight:5},className:"iconfont icon-Bug"}),(null==e||null===(m=e[n])||void 0===m?void 0:m.submit_count)||0]}):null]})})},U.push(u);case 6:case"end":return e.stop()}}),e)})),d=0;case 13:if(!(d<(null==t||null===(m=t.question_data)||void 0===m?void 0:m.length))){e.next=18;break}return e.delegateYield(u(d),"t0",15);case 15:d++,e.next=13;break;case 18:q(E()(U));case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,d.useEffect)((function(){U.splice(7);for(var e=function(e){var n,t,s={};s.title=null!=b&&b.sent_type?(0,k.jsx)("span",{children:"题目"+(e+1)+"".concat(null==b||null===(n=b.question_data)||void 0===n||null===(n=n[e])||void 0===n?void 0:n.question_score,"")}):(0,k.jsx)("a",{onClick:l()(r()().mark((function n(){var t,i;return r()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,p.ZP)("/api/problems/".concat(null==b||null===(t=b.question_data)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.identifier,"/start.json"),{method:"get"});case 2:(i=n.sent)&&(window.open("/myproblems/".concat(null==i?void 0:i.identifier,"?type=1")),localStorage.setItem("program_homework",[x.coursesId,x.categoryId]));case 4:case"end":return n.stop()}}),n)}))),children:"题目"+(e+1)+"".concat(null==b||null===(t=b.question_data)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.question_score,"")}),s.dataIndex="question_data",s.width=250,s.render=function(n,t){var s,c,u,d,m;return(0,k.jsx)("div",{children:(null==n||null===(s=n[e])||void 0===s?void 0:s.answer_question_time)&&(0,k.jsxs)("div",{children:[(0,k.jsx)("span",{style:{cursor:"pointer"},className:"iconfont icon-shixun4 c-blue",onClick:l()(r()().mark((function t(){var s,l,c,u,d,m,g,v,_;return r()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(0,C.Rm)()||null!==(s=a.AssistantObject.hack)&&void 0!==s&&s.can_appraise){t.next=3;break}return h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能"),t.abrupt("return");case 3:if(null!=n&&null!==(l=n[e])&&void 0!==l&&l.open_code){t.next=6;break}return h.ZP.info("暂不允许查看代码"),t.abrupt("return");case 6:return t.next=8,(0,p.ZP)("/api/courses/view_code.json",{method:"get",params:o()(o()({},x),{},{id:x.coursesId,homework_common_id:x.categoryId,hack_user_code_id:null==n||null===(c=n[e])||void 0===c?void 0:c.hack_user_code_id})});case 8:_=t.sent,f.Z.warning({icon:null,width:800,title:(0,k.jsxs)("div",{children:[(0,k.jsx)("span",{children:"代码"}),(0,k.jsxs)("span",{children:["使用语言:",null==n||null===(u=n[e])||void 0===u?void 0:u.current_language]}),(0,k.jsxs)("span",{children:["运行内存:",null==n||null===(d=n[e])||void 0===d?void 0:d.memory,"KB"]}),(0,k.jsxs)("span",{children:["运行时长:",null==n||null===(m=n[e])||void 0===m?void 0:m.run_time,"ms"]}),(0,k.jsxs)("span",{children:["得分:",null==n||null===(g=n[e])||void 0===g?void 0:g.score]})]}),content:(0,k.jsx)(Ke.Z,{classroomList:a,user:i,languages:[{language:null==n||null===(v=n[e])||void 0===v?void 0:v.language,code:null==_?void 0:_.code}],v:n,shixunWorkReport:"shixunWorkReport",dispatch:"dispatch",autoHeight:!1,language:n.language,game_id:n.id,diff_code_count:n.diff_code_count})});case 10:case"end":return t.stop()}}),t)})))}),(0,k.jsx)("span",{style:{margin:"0px 10px"},children:(null==n||null===(c=n[e])||void 0===c?void 0:c.answer_question_time)||"- -"}),null!=n&&null!==(u=n[e])&&void 0!==u&&u.submit_count?(0,k.jsxs)(v.Z,{title:"".concat((null==n||null===(d=n[e])||void 0===d?void 0:d.submit_count)||0,"次尝试出错"),children:[(0,k.jsx)("span",{style:{color:"red",marginRight:5},className:"iconfont icon-Bug"}),(null==n||null===(m=n[e])||void 0===m?void 0:m.submit_count)||0]}):null]})})},U.push(s)},n=0;n<(null==b||null===(t=b.question_data)||void 0===t?void 0:t.length);n++){var t;e(n)}q(E()(U))}),[null==b?void 0:b.question_data]),(0,d.useEffect)((function(){var e;null!=i&&null!==(e=i.userInfo)&&void 0!==e&&e.course&&((0,C.dE)()&&(x.course_group=(0,C.dE)()?[i.userInfo.course.course_group_id]:[],_(o()({},x))),J(1))}),[null==i?void 0:i.userInfo]),console.log("----",U),(0,k.jsx)("div",{style:{width:1200,margin:"0px auto"},children:"封榜中"===(null==b?void 0:b.message)?(0,k.jsx)(A.Z,{customText:"答题时间进入倒计时,暂时封榜,请加速竞技通关答题"}):(0,k.jsxs)("div",{style:{background:"#fff",padding:20},children:[(0,k.jsxs)("div",{style:{display:"inline-flex"},children:[(0,k.jsx)("label",{children:"分班情况:"}),(0,C.GJ)()&&(0,k.jsx)("div",{style:{flex:1},children:(0,k.jsxs)(G.Z.Group,{className:We.Z.checkboxgroup,value:M,onChange:function(e){if(1===x.type)I([]),x.course_group=[],x.page=1,_(o()({},x)),J();else if(2===x.type){var n;I(["全部"].concat()),x.course_group=null==b||null===(n=b.course_group)||void 0===n?void 0:n.map((function(e){return e.id})),x.page=1,_(o()({},x)),J()}else I(E()(e.filter((function(e){return"全部"!=e})))),x.course_group=e.filter((function(e){return"全部"!=e})),x.page=1,_(o()({},x)),J()},children:[(0,k.jsx)(G.Z,{value:"全部",onChange:function(e){e.target.checked?x.type=2:x.type=1},children:"全部分班"}),null==b||null===(n=b.course_group)||void 0===n?void 0:n.map((function(e,n){return(0,k.jsx)(G.Z,{onChange:function(e){x.type=3},value:e.id,children:null==e?void 0:e.name})}))]})}),(0,C.dE)()&&(0,k.jsxs)(V.ZP.Group,{onChange:function(e){"全部"===e.target.value?(x.course_group=[],x.page=1,_(o()({},x)),J()):(x.course_group=[e.target.value],x.page=1,_(o()({},x)),J())},defaultValue:i.userInfo.course.course_group_id,children:[(0,k.jsx)(V.ZP,{value:"全部",children:"全部分班"}),null==b||null===(t=b.course_group)||void 0===t?void 0:t.map((function(e,n){return(0,k.jsx)(V.ZP,{value:e.id,children:e.name})}))]})]}),(0,C.GJ)()&&(0,k.jsxs)("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",marginTop:10},children:[(0,k.jsxs)("span",{style:{fontSize:14,color:"#B1BACD"},children:["排行规则:时间结束后正式封榜,时间段之外的提交不计入排行。 ",(0,k.jsx)("a",{onClick:function(){f.Z.warning({title:"计分规则",width:500,content:(0,k.jsxs)("div",{children:[(0,k.jsx)("p",{children:"排名规则经典ACM规则"}),(0,k.jsx)("p",{children:"AC通过题目越多排名越靠前。"}),(0,k.jsx)("p",{children:"AC相同总用时越少排名越靠前。"}),(0,k.jsx)("p",{children:"总用时=∑(每一个题目的用时)"}),(0,k.jsx)("p",{children:"每一个题目的用时=比赛开始到提交被通过的时间+罚时"}),(0,k.jsx)("p",{children:"罚时=(通过前)错误代码提交次数*每次罚时"}),(0,k.jsx)("p",{children:"不算罚时的情况:没有通过的题目、(系统)内部错误、编译错误"})]})})},children:"点击查看计分规则"})]}),(0,k.jsx)(g.ZP,{onClick:function(){(0,me.VY)(o()(o()({},x),{},{id:x.coursesId,rank_type:2,homework_common_id:x.categoryId}))},children:"导出"})]}),(0,k.jsx)(N.Z,{spinning:R,children:(0,k.jsx)(w.Z,{style:{marginTop:10},pagination:!1,scroll:{x:1200},rowClassName:function(e,n){return 0===n&&(0,C.dE)()&&We.Z.tables},dataSource:B,columns:U})}),(0,k.jsx)("div",{style:{width:"100%",textAlign:"center",marginTop:10},children:(0,k.jsx)(L.Z,{current:x.page,pageSize:x.per_page,total:null==b?void 0:b.count,hideOnSinglePage:!0,onChange:function(e,n){x.page=e,x.per_page=n,_(o()({},x)),J()}})})]})})})),en=t(51907),nn=t(30963),tn=t(81210),on=t(45322),an=[{live:"A",gz:"0个错误",ld:"0个漏洞",gf:"0 - 5%"},{live:"B",gz:"至少1个次要错误",ld:"至少1个次要漏洞",gf:"6% - 10%"},{live:"C",gz:"至少1个主要错误",ld:"至少1个主要漏洞",gf:"11% - 20%"},{live:"D",gz:"至少1个严重错误",ld:"至少1个严重漏洞",gf:"21% - 50%"},{live:"E",gz:"至少1个崩溃错误",ld:"至少1个崩溃漏洞",gf:"超过50%"}],rn=(0,m.connect)((function(e){var n=e.shixunHomeworks,t=e.classroomList,i=e.loading,o=e.user;return{classroomList:t,shixunHomeworks:n,globalSetting:e.globalSetting,user:o,loading:i.effects}}))((function(e){var n,t,i,a,s=e.shixunHomeworks,c=e.classroomList,b=(e.globalSetting,e.user),S=(e.loading,e.dispatch),T=(0,m.useParams)(),Z=(0,m.useSearchParams)(),N=u()(Z,1)[0],L=(0,d.useState)(N.get("tabs")||"0"),M=u()(L,2),A=M[0],I=M[1],O=(0,d.useState)({}),E=u()(O,2),B=E[0],D=E[1],H=s.workList,z=s.workSetting,G=(0,d.useState)(!1),R=u()(G,2),F=R[0],Y=R[1];T.category=N.get("category_id"),T.order="work_score",T.b_order="desc",(0,d.useEffect)((function(){S({type:"classroomList/getAssistantPermissions",payload:{course_id:T.coursesId}})}),[(0,C.bg)()]);var W,V,U,q,J,Q,K,X,$=function(){var e;f.Z.confirm({centered:!0,width:530,title:"提示",okText:"确定",cancelText:"取消",content:(0,k.jsxs)("div",{className:"tc font16",children:["你在该实训的学习记录将被清空,无法恢复",(0,k.jsx)("br",{}),"是否确认重做?"]}),onOk:(e=l()(r()().mark((function e(){var n,t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=null===(n=s.workList)||void 0===n?void 0:n.myshixun_identifier,e.next=3,(0,oe.Fr)({id:t});case 3:e.sent&&(h.ZP.info("已清空本实训的学习记录\n\n请点击“开启挑战”重做课程实验"),S({type:"shixunHomeworks/getWorkList",payload:B}));case 5:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})},ee=function e(n){var t,i;n=null!==(t=n)&&void 0!==t&&t.includes(".json")?n:"".concat(n,".json"),f.Z.confirm({centered:!0,title:"提示",okText:"确定",cancelText:"取消",content:(0,k.jsx)("div",{className:"tc font16",children:"实训已经更新了,正在为您重置!"}),onOk:(i=l()(r()().mark((function t(){var i,o;return r()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,Ve.$Q)({url:n});case 2:if(i=t.sent){t.next=5;break}return t.abrupt("return");case 5:return h.ZP.success("重置成功,正在进入实践项目!"),t.next=8,(0,Ve.Ir)({id:i.shixun_identifier});case 8:if(null==(o=t.sent)||!o.game_identifier){t.next=12;break}return(0,j.xg)("/tasks/".concat(o.game_identifier,"?coursesId=").concat(T.coursesId)),t.abrupt("return");case 12:2===(null==o?void 0:o.status)?e(null==o?void 0:o.message):3===(null==o?void 0:o.status)&&ne(null==o?void 0:o.message);case 13:case"end":return t.stop()}}),t)}))),function(){return i.apply(this,arguments)})})},ne=function(e){f.Z.confirm({centered:!0,title:"提示",okText:"确定",cancelText:"取消",content:(0,k.jsxs)("div",{className:"tc font16",children:["目前该实践项目尚在内测中,将于",e,"之后开放,谢谢!"]})})},te=function(){var e=l()(r()().mark((function e(n){var t,i;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=null!==(t=n)&&void 0!==t&&t.includes(".json")?n:"".concat(n,".json"),e.next=3,(0,Ve.$Q)({url:n});case 3:if(i=e.sent,console.log(i,"execRes"),null==i||!i.game_identifier){e.next=8;break}return(0,j.xg)("/tasks/".concat(i.game_identifier,"?coursesId=").concat(T.coursesId)),e.abrupt("return");case 8:-3===(null==i?void 0:i.status)?(0,j.eF)():2===(null==i?void 0:i.status)?ee(null==i?void 0:i.message):3===(null==i?void 0:i.status)&&ne(null==i?void 0:i.message);case 9:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),ie=[{name:"作业列表",id:"0",compontent:(0,k.jsx)(ge,{setExportParams:D}),forceRender:!0},{name:"作业详情",id:"1",compontent:(0,k.jsx)(P,{})},{name:"排行榜",id:"5",compontent:(0,k.jsx)($e,{})},{name:"代码查重",id:"2",compontent:(0,k.jsx)(xe,{})},{name:"重做记录",id:"9",compontent:(0,k.jsx)(on.Z,{})},{name:(0,C.GJ)()?"高级设置":"得分规则",id:"3",compontent:null!==(n=H.homework_status)&&void 0!==n&&n.includes("导入")?(0,k.jsx)(tn.Z,{}):(0,k.jsx)(He,{}),forceRender:!0},{name:(0,k.jsx)("a",{style:{color:"#b9b8b8"},href:"/classrooms/".concat(T.coursesId,"/program_homework/").concat(T.categoryId,"/answer"),children:"解答&讨论"}),id:"6",compontent:!1}].filter((function(e){var n,t;return(0,C.dE)()?"代码查重"!==e.name:(0,C.dE)()||"已截止"!==(null==H||null===(n=H.homework_status)||void 0===n?void 0:n[0])?"质量检测"!==e.name:!H.code_review&&"未发布"!==(null==H||null===(t=H.homework_status)||void 0===t?void 0:t[0])||"代码查重"!==e.name})).filter((function(e){return!!H.open_code_quality_analysis||"质量检测"!==e.name})).filter((function(e){var n;return null===(n=H.homework_status)||void 0===n||!n.includes("导入")||((0,C.dE)()?["0","1"].includes(e.id):["0","1","3"].includes(e.id))}));return(0,k.jsxs)("section",{children:[(0,k.jsxs)("div",{className:"edu-container",children:[H.homework_name&&(0,k.jsxs)("section",{className:"animated fadeIn",children:[(0,k.jsx)("aside",{className:"mt10",children:H.category&&(0,k.jsxs)(x.Z,{separator:">",children:[(0,k.jsx)(x.Z.Item,{children:(0,k.jsx)(m.Link,{to:"/classrooms/".concat(null==T?void 0:T.coursesId,"/program_homework"),children:H.course_name})}),(0,k.jsx)(x.Z.Item,{children:(0,k.jsx)(m.Link,{to:"/classrooms/".concat(null==T?void 0:T.coursesId,"/program_homework/").concat(H.category.main?"":H.category.category_id),children:H.category.category_name})}),(0,k.jsx)(x.Z.Item,{children:"作业详情"})]})}),(0,k.jsxs)("aside",{className:[We.Z.title,"mt20"].join(" "),children:[(0,k.jsx)(m.Link,{to:"/classrooms/".concat(H.course_id,"/program_homework/").concat(H.category.main?"":H.category.category_id),children:(0,k.jsx)(y.Z,{className:"font16 c-black"})}),(0,k.jsx)(v.Z,{title:H.homework_name,placement:"bottom",children:(0,k.jsx)("strong",{className:"font20 ml5",children:H.homework_name})}),(0,k.jsx)(j.VV,{temporary:!0,status:H.homework_status}),(0,C.dE)()&&!(null!==(t=H.homework_status)&&void 0!==t&&t.includes("导入"))&&(0,k.jsx)("span",{style:{fontWeight:800,color:"#0152d9",textAlign:"end",flex:1,cursor:"pointer"},children:(0,k.jsxs)(g.ZP,{onClick:l()(r()().mark((function e(){var n,t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,p.ZP)("/api/problems/".concat(null===(n=s.workList)||void 0===n?void 0:n.start_identifier,"/start.json"),{method:"get"});case 2:(t=e.sent)&&(window.open("/myproblems/".concat(null==t?void 0:t.identifier,"?type=1")),localStorage.setItem("program_homework",[T.coursesId,T.categoryId]));case 4:case"end":return e.stop()}}),e)}))),type:"primary",children:[null!==(i=H.homework_status)&&void 0!==i&&i.includes("已截止")?"查看作业":"进入练习"," "]})})]})]}),(0,k.jsx)("aside",{className:"mt30 relative ".concat(We.Z.workListTabWrap),children:(0,k.jsx)(_.Z,{type:"card",defaultActiveKey:A,activeKey:A,tabBarExtraContent:null!==(a=H.homework_status)&&void 0!==a&&a.includes("导入")&&(0,C.GJ)()?(0,k.jsx)(g.ZP,{icon:(0,k.jsx)("span",{className:"iconfont icon-shixun3 translateY1"}),onClick:function(){S({type:"classroomList/setActionTabs",payload:{key:"补充成绩",name:null==H?void 0:H.homework_name,id:null==H?void 0:H.homework_id,type:"hack"}})},type:"primary",children:"补充成绩"}):(0,k.jsxs)("aside",{className:We.Z.workListTabButton,children:[(0,C.dE)()&&(null===(W=s.workList)||void 0===W?void 0:W.redo_work)&&(0,k.jsx)(g.ZP,{onClick:$,type:"primary",icon:(0,k.jsx)("i",{className:"iconfont icon-dahuizhongzuo3x"}),children:"重做"}),(null===(V=s.workList)||void 0===V?void 0:V.shixun_status)>1&&(null===(U=s.workList)||void 0===U?void 0:U.time_status)<5&&(0,C.dE)()&&(0,k.jsx)(g.ZP,{type:"primary",icon:(0,k.jsx)("i",{className:"iconfont icon-kaiqizhong"}),onClick:function(){var e,n,t;(0,he.tJ)(S,!0)&&(null!==(e=s.workList)&&void 0!==e&&null!==(e=e.task_operation)&&void 0!==e&&null!==(e=e[1])&&void 0!==e&&e.includes("/")?te(null===(n=s.workList)||void 0===n||null===(n=n.task_operation)||void 0===n?void 0:n[1]):(0,j.xg)("/tasks/".concat(null===(t=s.workList)||void 0===t||null===(t=t.task_operation)||void 0===t?void 0:t[1])))},children:null===(q=s.workList)||void 0===q||null===(q=q.task_operation)||void 0===q?void 0:q[0]}),(null===(J=s.workList)||void 0===J?void 0:J.commit_des)&&(null===(Q=s.workList)||void 0===Q?void 0:Q.commit_des)&&(0,k.jsx)(g.ZP,{type:"primary",icon:(0,k.jsx)("i",{className:"iconfont icon-tijiaozongjie"}),onClick:function(){var e;(0,j.xg)("/classrooms/".concat(T.coursesId,"/shixun_homework/").concat(T.categoryId,"/").concat(null===(e=s.workList)||void 0===e?void 0:e.id,"/commitsummary"))},children:null===(K=s.workList)||void 0===K?void 0:K.commit_des}),(0,C.GJ)()&&"未发布"===(null==H||null===(X=H.homework_status)||void 0===X?void 0:X[0])&&(0,k.jsx)(g.ZP,{type:"primary",icon:(0,k.jsx)("i",{className:"iconfont icon-bianji2"}),onClick:function(){var e;null!==(e=c.AssistantObject.hack)&&void 0!==e&&e.can_create||!(0,C.Rm)()?m.history.push("/classrooms/".concat(T.coursesId,"/program_homework/").concat(T.categoryId,"/edit")):h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:"编辑作业"}),(0,C.GJ)()&&H.publish_immediately&&(0,k.jsx)(g.ZP,{type:"primary",icon:(0,k.jsx)("i",{className:"iconfont icon-yishezhifabushijian1"}),onClick:function(){var e,n;null!==(e=c.AssistantObject.hack)&&void 0!==e&&e.can_publish||!(0,C.Rm)()?2!==(null==b||null===(n=b.userInfo)||void 0===n?void 0:n.user_status)?S({type:"classroomList/setActionTabs",payload:{key:"立即发布",selectArrs:[T.categoryId],selectArrsAll:[H],params:T,detail:!0,type:2,manage_all_group:null==z?void 0:z.manage_all_group}}):(0,he.Rd)():h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:"立即发布"}),(0,C.GJ)()&&H.end_immediately&&(0,k.jsx)(g.ZP,{style:{background:"#0152d9",color:"#fff"},type:"primary",icon:(0,k.jsx)("i",{className:"iconfont icon-jiezhishiyan"}),onClick:function(){var e;null!==(e=c.AssistantObject.hack)&&void 0!==e&&e.can_stop||!(0,C.Rm)()?S({type:"classroomList/setActionTabs",payload:{key:"立即截止",params:T,type:2,detail:!0,selectArrs:[T.categoryId]}}):h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:"立即截止"})]}),onChange:function(e){var n;"5"!==e||null!==(n=c.AssistantObject.hack)&&void 0!==n&&n.can_exam_leaderboard||!(0,C.Rm)()?(I(e),"0"===e&&S({type:"shixunHomeworks/getWorkList",payload:T})):h.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:ie.map((function(e,n){return(0,k.jsx)(_.Z.TabPane,{tab:e.name,forceRender:e.forceRender,children:e.compontent},e.id)}))})})]}),(0,k.jsx)(Re,{}),(0,k.jsx)(Fe.Z,{courseEndTime:null==H?void 0:H.course_end_date,successCallback:function(){S({type:"shixunHomeworks/getWorkList",payload:o()({},T)})},visible:"立即截止"===c.actionTabs.key,homeworkIds:[T.categoryId],courseId:T.coursesId,isBatch:!1}),(0,k.jsx)(Ye.Z,{courseEndTime:null==H?void 0:H.course_end_date}),(0,k.jsx)(en.Z,{onOk:function(){S({type:"shixunHomeworks/getWorkList",payload:o()({},T)})}}),(0,k.jsx)(nn.Z,{onOk:function(){S({type:"shixunHomeworks/getWorkList",payload:o()({},T)})}}),(0,k.jsxs)(f.Z,{open:F,title:"规则说明",width:800,footer:null,onCancel:function(){Y(!1)},children:[(0,k.jsx)("p",{children:"一、等级规则"}),(0,k.jsx)("p",{style:{marginLeft:"10px"},children:"1. 缺陷等级"}),(0,k.jsx)("p",{style:{marginLeft:"10px"},children:(0,k.jsx)(w.Z,{dataSource:an,columns:[{title:"等级",dataIndex:"live"},{title:"缺陷评估规则",dataIndex:"gz"},{title:"漏洞评估规则",dataIndex:"ld"},{title:"代码规范评估规则",dataIndex:"gf"}],pagination:!1})}),(0,k.jsx)("p",{style:{marginLeft:"10px"},children:"注代码规范评估规则中数值来源为计算技术债务时间占开发所有代码所需要的时间的比例Technical Debt Ratio"}),(0,k.jsx)("p",{style:{marginLeft:"20px"},children:"Technical Debt Ratio = 技术债务时间 / 开发时间"}),(0,k.jsx)("p",{style:{marginLeft:"20px"},children:"技术债务时间为修复所有问题所需要的时间。"}),(0,k.jsx)("p",{children:"二、复杂度规则"}),(0,k.jsx)("p",{style:{marginLeft:"10px"},children:"根据代码路径数计算的数值,每当一个函数的控制流分叉时,复杂度计数器就会自增一。"}),(0,k.jsx)("p",{style:{marginLeft:"10px"},children:"每个程序语言的关键字对应的复杂度数据不同但每个函数的最小复杂度为1。特定语言的详细数据略"}),(0,k.jsx)("p",{children:"三、代码质量分规则"}),(0,k.jsx)("p",{style:{marginLeft:"10px"},children:"代码质量分 = 0.5*缺陷分数 + 0.3*漏洞分数 + 0.2*代码规范性分数"}),(0,k.jsx)("p",{style:{marginLeft:"10px"},children:"其中:"}),(0,k.jsx)("p",{style:{marginLeft:"10px"},children:"缺陷/漏洞/代码规范性分数计算规则为100 - 100 *((100*崩溃数 + 5*严重数 + 3*主要数 + 1*次数)/ 代码行数)"}),(0,k.jsx)("p",{style:{marginLeft:"10px"},children:"注:分数为空的代表不支持的文件格式。"})]})]})}))},79849:function(e,n,t){"use strict";var i=t(7557),o=t.n(i),a=t(85573),r=t.n(a),s=t(41498),l=t.n(s),c=t(82242),u=t.n(c),d=t(37205),p=t.n(d),m=t(79800),h=t.n(m),f=t(39647),g=t.n(f),x=t(59301),v=t(78241),_=t(8591),w=t(43418),y=t(95237),j=t(5112),b=t(94001),k=t(43604),S=t(30518),T=t(24905),Z=t(61186),N=t.n(Z),L=t(25600),M=t(97600),C=t(34601),A=t(81322),I=t(76146),P=t(22365),O=t(47253),E=t(37712),B=["classroomList","dispatch","courseEndTime"];n.Z=(0,A.connect)((function(e){return{classroomList:e.classroomList}}))((function(e){var n,t,i,a,s,c,d,m,f,Z,D,H=e.classroomList,z=e.dispatch,G=e.courseEndTime,R=g()(e,B),F=(0,A.useParams)(),Y=v.Z.useForm(),W=h()(Y,1)[0],V=(0,x.useState)(1),U=h()(V,2),q=U[0],J=U[1],Q=(0,x.useState)([]),K=h()(Q,2),X=K[0],$=K[1],ee=(0,x.useState)(0),ne=h()(ee,2),te=(ne[0],ne[1]),ie=(0,x.useState)(2e3),oe=h()(ie,2),ae=(oe[0],oe[1],(0,x.useState)(!0)),re=h()(ae,2),se=(re[0],re[1]),le=(0,x.useState)(!1),ce=h()(le,2),ue=ce[0],de=(ce[1],(0,x.useState)(!1)),pe=h()(de,2),me=pe[0],he=(pe[1],(0,x.useState)([])),fe=h()(he,2),ge=fe[0],xe=fe[1],ve=(0,x.useState)(!0),_e=h()(ve,2),we=_e[0],ye=_e[1],je=(0,x.useState)(!(null!==(n=H.actionTabs)&&void 0!==n&&null!==(n=n.selectArrsAll)&&void 0!==n&&null!==(n=n[0])&&void 0!==n&&n.send_type)),be=h()(je,2),ke=be[0],Se=be[1],Te=(0,x.useState)([0,0,0]),Ze=h()(Te,2),Ne=Ze[0],Le=Ze[1];(0,x.useEffect)((function(){if("立即发布"===H.actionTabs.key){var e,n,t,i;if(Ie(),null!==(e=H.actionTabs)&&void 0!==e&&null!==(e=e.selectArrsAll)&&void 0!==e&&null!==(e=e[0])&&void 0!==e&&e.can_publish)Le(p()(null===(t=H.actionTabs)||void 0===t||null===(t=t.selectArrsAll)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.difficult_count));else Le(p()(null===(i=H.actionTabs)||void 0===i||null===(i=i.selectArrsAll)||void 0===i||null===(i=i[0])||void 0===i?void 0:i.difficult_settings));if(Se(!(null!==(n=H.actionTabs)&&void 0!==n&&null!==(n=n.selectArrsAll)&&void 0!==n&&null!==(n=n[0])&&void 0!==n&&n.send_type)),Me(),2===H.actionTabs.type){var o,a=null===(o=H.actionTabs.selectArrsAll)||void 0===o?void 0:o[0];ye(a.unified_setting)}}}),[H.actionTabs]),(0,x.useEffect)((function(){if(ue){if(me)return;z({type:"classroomList/setActionTabs",payload:{}}),(0,M.GJ)()?(z({type:"classroomList/getClassroomTeacherCommonList",payload:u()(u()({},H.actionTabs.params),{},{type:1})}),z({type:"shixunHomeworks/getWorkList",payload:u()({},F)})):z({type:"classroomList/getClassroomCommonList",payload:u()({},H.actionTabs.params)})}}),[ue]);var Me=function(){var e=l()(o()().mark((function e(n){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return se(!0),e.next=3,(0,P.c_)(u()(u()({},F),{},{page:n||q,limit:2e4,homework_id:1===H.actionTabs.type?"":H.actionTabs.selectArrs[0]}));case 3:null==(t=e.sent)||t.course_groups.map((function(e,n){e.key=e.id,e.title=e.name,e.disabled=e.is_published})),t&&($(p()(null==t?void 0:t.course_groups)),te(null==t?void 0:t.course_groups_count),se(!1),n||W.setFieldsValue(r()(r()({},"publish_time",N()(N()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),"end_time",N()(N()(new Date((0,C.qd)("/"))).add(7,"days").format("YYYY-MM-DD HH:mm")))));case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),Ce=function(){(0,M.GJ)()?H.actionTabs.detail?(z({type:"shixunHomeworks/setActionTabs",payload:{}}),z({type:"shixunHomeworks/getWorkList",payload:u()({},F)}),z({type:"shixunHomeworks/getWorkSetting",payload:u()({},F)})):z({type:"classroomList/getClassroomTeacherCommonList",payload:u()(u()({},H.actionTabs.params),{},{type:5,category:H.actionTabs.params.categoryId})}):z({type:"classroomList/getClassroomCommonList",payload:u()({},H.actionTabs.params)})},Ae=function(){var e=l()(o()().mark((function e(){var n,t,i,a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(0,M.Rm)()||null!==(n=H.AssistantObject.hack)&&void 0!==n&&n.can_publish){e.next=4;break}return _.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能"),Be(!1),e.abrupt("return");case 4:if(!((i=u()({},W.getFieldsValue())).end_time<=i.publish_time)){e.next=9;break}return _.ZP.info("截止时间不能大于或等于发布时间"),Be(!1),e.abrupt("return");case 9:if(!((null==ge?void 0:ge.length)<=0&&!we&&X.length>0)){e.next=13;break}return _.ZP.info("发布班级不能为空"),Be(!1),e.abrupt("return");case 13:if(0!==Ne.reduce((function(e,n){return e+n}))||ke){e.next=17;break}return _.ZP.info("简单适中困难题数相加不能为0"),Be(!1),e.abrupt("return");case 17:return a={homework_ids:p()(H.actionTabs.selectArrs),group_ids:ge.length>0?ge.map((function(e){return e.id})):null===(t=H.detailCommonHomeworksList)||void 0===t?void 0:t.course_groups,end_time:N()(i.end_time).format("YYYY-MM-DD HH:mm"),publish_time:N()(i.publish_time).format("YYYY-MM-DD HH:mm"),difficult_settings:null==Ne?void 0:Ne.map((function(e){return e})),send_type:ke?"0":"1",unified_setting:!ge.length},Be(!0),e.next=21,(0,L.ZP)("/api/courses/".concat(F.coursesId,"/homework_commons/publish_with_homework_list_position.json"),{method:"post",body:u()({},a)});case 21:0===e.sent.status?(Be(!1),(0,C.L9)(["教学课堂","图文作业","立即发布"]),_.ZP.success("发布成功"),z({type:"classroomList/setActionTabs",payload:{key:"清除选择数据"}}),R.onCallback&&R.onCallback(),Ce(),"0"===localStorage.getItem("Noviceguide")||z({type:"shixunHomeworks/setActionTabs",payload:{key:"底部弹窗",type:13,text:(0,E.jsx)("div",{children:"最后,咱们给教学课堂添加一名学生~点击“添加学生”,在弹窗页面中输入并搜索学生姓名,点击“确定”就可以为您的课堂添加第一位学生啦~"})}})):Be(!1);case 23:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ie=function(){J(1),$([]),xe([])},Pe=(0,x.useState)(!1),Oe=h()(Pe,2),Ee=Oe[0],Be=Oe[1];return(0,E.jsxs)(w.Z,{width:600,confirmLoading:Ee,centered:!0,title:"发布作业",open:"立即发布"===H.actionTabs.key,okText:"发布作业",cancelText:"暂不发布",onOk:Ae,onCancel:function(){Ie(),Ce(),z({type:"classroomList/setActionTabs",payload:{}})},children:[(0,E.jsxs)("p",{className:"tc",children:["学生将立即收到作业",(0,E.jsx)("br",{}),'本操作只对"未发布"的作业有效']}),X&&(0,E.jsxs)(v.Z,{form:W,children:[(0,E.jsxs)("div",{style:{paddingLeft:0},children:[2===H.actionTabs.type&&(0,E.jsxs)(y.Z,{style:{marginBottom:"10px"},children:[(0,E.jsx)("span",{className:"mr5",children:"试题发送:"}),(0,E.jsxs)(j.ZP.Group,{value:ke,disabled:!(null!==(t=H.actionTabs)&&void 0!==t&&null!==(t=t.selectArrsAll)&&void 0!==t&&null!==(t=t[0])&&void 0!==t&&t.can_publish),onChange:function(e){Se(e.target.value)},children:[(0,E.jsx)(j.ZP,{value:!0,children:"全部固定试题"}),(0,E.jsx)(j.ZP,{className:"ml20",value:!1,children:"随机抽取"})]})]}),!ke&&(0,E.jsxs)(y.Z,{style:{marginBottom:"10px"},children:[(0,E.jsx)("span",{style:{marginRight:65}}),(0,E.jsxs)("span",{children:["简单题数 ",(0,E.jsx)(b.Z,{value:Ne[0],onChange:function(e){Ne[0]=e,Le(p()(Ne))},min:0,disabled:!(null!==(i=H.actionTabs)&&void 0!==i&&null!==(i=i.selectArrsAll)&&void 0!==i&&null!==(i=i[0])&&void 0!==i&&i.can_publish),placeholder:"最大".concat(null===(a=H.actionTabs)||void 0===a||null===(a=a.selectArrsAll)||void 0===a||null===(a=a[0])||void 0===a||null===(a=a.difficult_count)||void 0===a?void 0:a[0]),max:null===(s=H.actionTabs)||void 0===s||null===(s=s.selectArrsAll)||void 0===s||null===(s=s[0])||void 0===s||null===(s=s.difficult_count)||void 0===s?void 0:s[0],style:{width:60}})]}),(0,E.jsxs)("span",{style:{margin:"0px 40px"},children:["适中题数 ",(0,E.jsx)(b.Z,{value:Ne[1],onChange:function(e){Ne[1]=e,Le(p()(Ne))},min:0,disabled:!(null!==(c=H.actionTabs)&&void 0!==c&&null!==(c=c.selectArrsAll)&&void 0!==c&&null!==(c=c[0])&&void 0!==c&&c.can_publish),max:null===(d=H.actionTabs)||void 0===d||null===(d=d.selectArrsAll)||void 0===d||null===(d=d[0])||void 0===d||null===(d=d.difficult_count)||void 0===d?void 0:d[1],placeholder:"最大".concat(null===(m=H.actionTabs)||void 0===m||null===(m=m.selectArrsAll)||void 0===m||null===(m=m[0])||void 0===m||null===(m=m.difficult_count)||void 0===m?void 0:m[1]),style:{width:60}})]}),(0,E.jsxs)("span",{children:["困难题数 ",(0,E.jsx)(b.Z,{value:Ne[2],onChange:function(e){Ne[2]=e,Le(p()(Ne))},min:0,disabled:!(null!==(f=H.actionTabs)&&void 0!==f&&null!==(f=f.selectArrsAll)&&void 0!==f&&null!==(f=f[0])&&void 0!==f&&f.can_publish),placeholder:"最大".concat(null===(Z=H.actionTabs)||void 0===Z||null===(Z=Z.selectArrsAll)||void 0===Z||null===(Z=Z[0])||void 0===Z||null===(Z=Z.difficult_count)||void 0===Z?void 0:Z[2]),max:null===(D=H.actionTabs)||void 0===D||null===(D=D.selectArrsAll)||void 0===D||null===(D=D[0])||void 0===D||null===(D=D.difficult_count)||void 0===D?void 0:D[2],style:{width:60}})]})]}),(0,E.jsxs)(y.Z,{className:"mt30",align:"middle",children:[(0,E.jsx)(k.Z,{children:(0,E.jsx)(v.Z.Item,{name:"publish_time",label:"发布时间",children:(0,E.jsx)(S.default,{style:{width:170,marginRight:"25px"},disabledDate:function(e){return(0,O.Q8)(e,G)},disabledTime:function(e){return(0,O.d0)(e)},placeholder:"请选择发布时间",showTime:{format:"HH:mm",defaultValue:N()((0,C.U6)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1})})}),(0,E.jsx)(k.Z,{className:"ml20",children:(0,E.jsx)(v.Z.Item,{name:"end_time",label:"截止时间",children:(0,E.jsx)(S.default,{style:{width:170},placeholder:"请选择截止时间",showTime:{format:"HH:mm",defaultValue:N()((0,C.U6)(),"HH:mm")},disabledDate:function(e){return(0,O.Q8)(e,G,W.getFieldValue("publish_time"))},disabledTime:function(e){return(0,O.d0)(e,W.getFieldValue("publish_time"))},format:"YYYY-MM-DD HH:mm",allowClear:!1})})})]}),2===H.actionTabs.type&&(0,E.jsxs)(y.Z,{style:{marginBottom:"10px"},children:[(0,E.jsx)("span",{className:"mr5",children:"发布设置:"}),(0,E.jsxs)(j.ZP.Group,{value:we,onChange:function(e){ye(e.target.value),xe([])},children:[(0,E.jsx)(j.ZP,{value:!0,disabled:!H.actionTabs.manage_all_group,children:"统一发布"}),(0,E.jsx)(j.ZP,{className:"ml20",disabled:X.length<=0,value:!1,children:"分班发布"})]})]}),X.length<=0&&2===H.actionTabs.type&&(0,E.jsx)("span",{style:{marginLeft:"65px",color:"rgba(0, 0, 0, 0.25)"},children:'课堂无分班,仅支持选择“统一发布"'})]}),(1===H.actionTabs.type||!we)&&X.length>0&&(0,E.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"10px"},children:[(0,E.jsxs)("span",{style:{flex:1},children:[(0,E.jsx)(T.Z,{checked:ge.length===X.length,onChange:function(e){ge.length===X.length?xe([]):xe(X.filter((function(e){return!e.is_published})))},children:"全选"})," "]}),(0,E.jsx)("span",{style:{width:16}}),(0,E.jsxs)("span",{style:{flex:1},children:["已选择",ge.length||0,"个分班"]})]}),(1===H.actionTabs.type||!we)&&X.length>0&&(0,E.jsx)(I.Z,{data:X,selectedRowKeys:ge,setSelectedRowKeys:xe})]})]})}))},45322:function(e,n,t){"use strict";var i=t(7557),o=t.n(i),a=t(41498),r=t.n(a),s=t(79800),l=t.n(s),c=t(70236),u=t.n(c),d=t(59301),p=t(53326),m=t(78241),h=t(99313),f=t(51945),g=t(86859),x=t(81322),v=t(25600),_=t(61186),w=t.n(_),y=t(37712);p.Z.Dragger;n.Z=(0,x.connect)((function(e){return{classroomList:e.classroomList}}))((function(e){u()(e);var n=(0,x.useParams)(),t=m.Z.useForm(),i=(l()(t,1)[0],(0,d.useState)(!0)),a=l()(i,2),s=a[0],c=a[1],p=(0,d.useState)(!1),_=l()(p,2),j=_[0],b=_[1],k=(0,d.useState)({type:window.location.href.indexOf("program_homework")>-1?2:1,limit:10,page:1}),S=l()(k,2),T=S[0],Z=S[1],N=[{name:"全部",value:"",question_type:0},{name:"单选题",value:"SINGLE",question_type:0},{name:"多选题",value:"MULTIPLE",question_type:1},{name:"判断题",value:"JUDGMENT",question_type:2},{name:"填空题",value:"COMPLETION",question_type:3},{name:"简答题",value:"SUBJECTIVE",question_type:4},{name:"实训题",value:"SHIXUN",question_type:5},{name:"编程题",value:"PROGRAM",question_type:6},{name:"组合题",value:"COMBINATION",question_type:7},{name:"程序填空题",value:"BPROGRAM",question_type:8}];function L(){return M.apply(this,arguments)}function M(){return(M=r()(o()().mark((function e(){var t,i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b(!0),t=window.location.href.indexOf("exercise")>-1?"/api/exercises/".concat(null==n?void 0:n.categoryId,"/redo_logs.json"):"/api/homework_commons/".concat(null==n?void 0:n.categoryId,"/redo_logs.json"),e.next=4,(0,v.ZP)(t,{method:"get",params:T});case 4:i=e.sent,b(!1),0===(null==i?void 0:i.status)&&c(null==i?void 0:i.data);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,d.useEffect)((function(){L()}),[]);var C=[{title:"姓名",dataIndex:"user_name"},{title:"学号",dataIndex:"student_id"},{title:"班级",dataIndex:"course_group_name"},window.location.href.indexOf("exercise")>-1&&{title:"题型",dataIndex:"question_type",render:function(e,n,t){var i;return null===(i=N.find((function(n){return n.question_type===e})))||void 0===i?void 0:i.name}},window.location.href.indexOf("exercise")>-1&&{title:"试题名称",dataIndex:"question_name"},window.location.href.indexOf("exercise")>-1&&{title:"关卡名称",dataIndex:"challenge_name"},window.location.href.indexOf("exercise")<=-1&&{title:"任务名称",dataIndex:"task_name",width:"40%"},{title:"操作",dataIndex:"redo_type",render:function(e,n,t){var i;return null===(i=[{id:1,name:"打回重做"},{id:2,name:"恢复初始代码"},{id:3,name:"重置代码仓库"}].find((function(n){return n.id===e})))||void 0===i?void 0:i.name}},{title:"恢复初始代码时间",dataIndex:"created_at",render:function(e,n,t){return w()(e).format("YYYY-MM-DD HH:mm:ss")}}].filter((function(e){return!!e}));return(0,y.jsxs)("div",{style:{padding:"0px 30px",background:"#fff",paddingBottom:30},children:[(0,y.jsx)(h.Z,{destroyInactiveTabPane:!0,onChange:function(e){T.type=e,T.page=1,T.limit=10,Z(T),L()},items:[window.location.href.indexOf("program_homework")<=-1&&{key:"1",label:"打回重做",children:(0,y.jsx)(f.Z,{loading:j,columns:[{title:"姓名",dataIndex:"user_name"},{title:"学号",dataIndex:"student_id"},{title:"班级",dataIndex:"course_group_name"},{title:"打回重做时间",dataIndex:"created_at",render:function(e,n,t){return w()(e).format("YYYY-MM-DD HH:mm:ss")}},{title:"操作人",dataIndex:"operator"}],dataSource:null==s?void 0:s.list,pagination:!1})},{key:"2",label:"重置代码",children:(0,y.jsx)(f.Z,{loading:j,columns:C,dataSource:null==s?void 0:s.list,pagination:!1})}].filter((function(e){return!!e}))}),(0,y.jsx)(g.Z,{hideOnSinglePage:!0,showSizeChanger:!1,onChange:function(e,n){T.page=e,T.limit=n,Z(T),L()},current:T.page,total:s.count,pageSize:T.limit,style:{marginTop:20}})]})}))},76146:function(e,n,t){"use strict";t.d(n,{Z:function(){return _}});var i=t(7557),o=t.n(i),a=t(41498),r=t.n(a),s=t(79800),l=t.n(s),c=t(59301),u=t(92832),d=t(24905),p=t(95237),m="leftdiv___aBzsX",h="listClass___bxIEW",f="spantitle___v_Vc4",g="rightdiv___xWu4M",x=t(64461),v=t(37712),_=function(e){var n=e.data,t=(e.value,e.handleChangePage,e.setSelectedRowKeys),i=e.selectedRowKeys,a=(e.onChange,(0,c.useState)([])),s=l()(a,2),_=s[0],w=s[1],y=(0,c.useState)([]),j=l()(y,2),b=j[0],k=j[1],S=(0,c.useState)([]),T=l()(S,2),Z=T[0],N=T[1],L=(0,c.useState)(1),M=l()(L,2),C=(M[0],M[1],(0,c.useState)()),A=l()(C,2);A[0],A[1];return(0,c.useEffect)((function(){w(n),k([]),N([])}),[n]),(0,c.useEffect)((function(){t&&(k(i),N(i))}),[i]),(0,v.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,v.jsxs)("div",{className:m,children:[(0,v.jsx)(u.Z.Search,{size:"middle",onChange:function(){var e=r()(o()().mark((function e(t){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:w(n.filter((function(e){var n;return null==e||null===(n=e.name)||void 0===n?void 0:n.includes(t.target.value)})));case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),placeholder:"可输入班级名称查询"}),0===_.length&&(0,v.jsx)(x.Z,{styles:{margin:"70px auto"},customText:"暂无分班"}),(0,v.jsx)("div",{style:{height:"85%",overflow:"auto",overflowX:"hidden"},children:(0,v.jsx)(d.Z.Group,{value:b.map((function(e){return"".concat(e.id)})),onChange:function(e){t(_.filter((function(n){return e.includes("".concat(n.id))})))},style:{marginTop:"10px",flexDirection:"column"},children:_.map((function(e,n){return(0,v.jsx)(p.Z,{style:{marginTop:"10px",lineHeight:"24px",display:"flex",width:200},children:(0,v.jsx)(d.Z,{style:{display:"flex",height:"24px",alignItems:"center"},disabled:e.is_published,value:"".concat(e.id),children:(0,v.jsxs)("div",{className:h,children:[(0,v.jsx)("span",{className:f,style:{width:e.is_published?"108px":"170px"},children:e.name}),e.is_published&&(0,v.jsx)("span",{style:{width:"52px",height:"24px",background:"#B8B8B8",borderRadius:"13px",color:"white",lineHeight:"24px",textAlign:"center",display:"inline-block"},children:"已发布"})]})})},e.id)}))})})]}),(0,v.jsxs)("div",{className:g,children:[(0,v.jsx)(u.Z.Search,{onChange:function(e){N(b.filter((function(n){return n.name.includes(e.target.value)})))},size:"middle",placeholder:"可输入班级名称查询"}),0===Z.length&&(0,v.jsx)(x.Z,{styles:{margin:"70px auto"},customText:"暂未选择分班"}),Z.length>0&&(0,v.jsx)("div",{style:{marginTop:"10px",height:"85%",overflow:"hidden",position:"relative"},children:(0,v.jsx)("div",{style:{overflowX:"hidden",overflowY:"scroll",position:"absolute",left:0,top:0,right:-17,bottom:0},children:Z.map((function(e,n){return(0,v.jsxs)(p.Z,{justify:"space-between",style:{marginTop:"10px"},children:[(0,v.jsx)("div",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",marginRight:"5px",marginLeft:"5px",width:"75%"},children:e.name}),(0,v.jsx)("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAbVJREFUOE+Nk79rFUEUhb+zE4OFwUD+CyGKKQQbSaMikQQ7C1tBBIsUQaJvl2Fn/cWDpAiIYJsi7YOIaCUWFoKKRhG0sbEzEImFGnev7G6yyXsxeU5159yZb87l3hG9q2WLiBO79FIwXpLp0s6cwITnQCMWrGDM43jdBckZQ0wTMdrong2R2Bxm0/98sZ8ozdcOEm5hjOC41u9Olc9ZQKySclOVkNhljCmCzjeAJM/4FbW5p+8k5tlggTtarfKxLSM6pHq4BTiL0SboaAOIi284jeP1nti+ApMEvdoEvEPMkOpJDZi1IwzwgqDh/wSsYZwk08ca4O0Qua3zW8OV5crmHg6u22EGbQ2nIbx+1IC6rrK+cYJW9gXEVrbxGUEj5bltQGJvgBapHu0LSGwCyEh1vBsQWwd4TNCDPg6uAOcImuoFlL1dJ9WNPg5uYwwRVM3MzhJmKIpjZK6e9bj4jNNpvL4QFx9wuoDXJ1r5IlH0llTtXgcXwa4SolObnYnwKnbFcfEcdJ+gpW6AtzFynuIop/Fn053u4CA5yzjO4FV9tu0Syl2S38WiSWBgD8AfoEPQ7Fb+LwIiyhxWwe2KAAAAAElFTkSuQmCC",style:{cursor:"pointer",height:"16px",marginRight:17},onClick:function(){t(b.filter((function(n){return"".concat(n.id)!="".concat(e.id)})))}})]},e.id)}))})})]})]})}},51756:function(e,n,t){"use strict";t(59301);Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;n.Z="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxOCI+PHBhdGggZmlsbD0iI0Y3QjUwMCIgZD0iTTcgNGMzLjg5OSAwIDcgMy4xNDEgNyA3cy0zLjEwMSA3LTcgNy03LTMuMTQxLTctNyAzLjEwMS03IDctN1ptMSAzSDYuMzk1YTMuNTAxIDMuNTAxIDAgMCAxLS44NTcgMS4yNDVjLS4zMi4yOTQtLjc1Mi41NTEtMS4yOTcuNzcyTDQgOS4xMDlWMTAuOWMuNDQ4LS4xNTQuODItLjMxNSAxLjExNy0uNDgzLjIyMi0uMTI2LjQ1LS4yODIuNjg1LS40NjZsLjIzNi0uMTk0VjE1SDhWN1pNNC44MTIgMGMuMTc1IDAgLjM1LjE2LjQzOC4zMThsMS4zMTMgMi4zMDlzLTIuOC4xNi00LjQ2MyAxLjY3MkwuMDg4LjcxNkMwIC42MzYgMCAuNTU3IDAgLjQ3OCAwIC4xNTkuMjYzIDAgLjUyNSAwWm04LjY2MyAwYy4yNjMgMCAuNTI1LjIzOS41MjUuNDc4IDAgLjA4IDAgLjE1OS0uMDg4LjIzOEwxMS45IDQuMjJjLTEuNjYyLTEuNDMzLTQuNDYzLTEuNTkyLTQuNDYzLTEuNTkyTDguNzUuMzE4QzguNzUuMTYgOC45MjUgMCA5LjE4OCAwWiIvPjwvc3ZnPg=="},24132:function(e,n,t){"use strict";t(59301);Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;n.Z="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxOCI+PHBhdGggZmlsbD0iI0I5QzRDRiIgZD0iTTcgNGMzLjg5OSAwIDcgMy4xNDEgNyA3cy0zLjEwMSA3LTcgNy03LTMuMTQxLTctNyAzLjEwMS03IDctN1ptLjA1IDNjLS42NzUgMC0xLjIwMy4wOTItMS41ODQuMjc2YTIuMDU2IDIuMDU2IDAgMCAwLS44ODcuNzk0Yy0uMTguMjk2LS4zMS42OTEtLjM5NCAxLjE4NmwtLjAzOC4yNTUgMi4wMDQuMTc3Yy4wNTUtLjQ0My4xNjQtLjc1My4zMjYtLjkyOGEuODE0LjgxNCAwIDAgMSAuNjI2LS4yNjMuODEuODEgMCAwIDEgLjYxMS4yNTVjLjE2Mi4xNy4yNDMuMzc1LjI0My42MTQgMCAuMjIyLS4wODEuNDU2LS4yNDUuNzAzLS4xNjQuMjQ3LS41MzkuNjA4LTEuMTI0IDEuMDg0LS45Ni43NzYtMS42MTMgMS40NS0xLjk2MiAyLjAyYTQuMzYzIDQuMzYzIDAgMCAwLS41ODggMS41NTJMNCAxNWg2di0xLjc4MUg2Ljg3N2MuMTg0LS4xOTcuMzQzLS4zNTYuNDc5LS40NzguMTM2LS4xMjIuNDA1LS4zMzQuODA4LS42MzguNjc3LS41MjMgMS4xNDUtMS4wMDIgMS40MDEtMS40MzguMjU3LS40MzcuMzg2LS44OTUuMzg2LTEuMzc0IDAtLjQ1LS4xMTItLjg1OC0uMzM2LTEuMjJhMi4wNDMgMi4wNDMgMCAwIDAtLjkyNC0uODA4QzguMzAxIDcuMDg4IDcuNzUzIDcgNy4wNSA3Wk00LjgxMiAwYy4xNzUgMCAuMzUuMTYuNDM3LjMxOGwxLjMxMyAyLjMwOXMtMi44LjE2LTQuNDYzIDEuNjcyTC4wODguNzE2QzAgLjYzNiAwIC41NTcgMCAuNDc4IDAgLjE1OS4yNjMgMCAuNTI1IDBabTguNjYyIDBjLjI2MyAwIC41MjUuMjM5LjUyNS40NzggMCAuMDggMCAuMTU5LS4wODguMjM4TDExLjkgNC4yMmMtMS42NjItMS40MzMtNC40NjMtMS41OTItNC40NjMtMS41OTJMOC43NS4zMThDOC43NS4xNiA4LjkyNSAwIDkuMTg4IDBaIi8+PC9zdmc+"},25943:function(e,n,t){"use strict";t(59301);Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;n.Z="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxOCI+PHBhdGggZmlsbD0iI0QwOUYxOCIgZD0iTTcgNGMzLjg5OSAwIDcgMy4xNDEgNyA3cy0zLjEwMSA3LTcgNy03LTMuMTQxLTctNyAzLjEwMS03IDctN1ptLS4wNjIgM2MtLjgyNiAwLTEuNDY0LjE3Mi0xLjkxNS41MTctLjQuMzA3LS42ODYuNzMzLS44NTYgMS4yNzhsLS4wNTguMjEgMS45MDguMzY0Yy4wNTItLjM4My4xNTMtLjY1MS4zMDItLjgwNGEuNzcyLjc3MiAwIDAgMSAuNTgtLjIzYy4yMyAwIC40MTIuMDcuNTQ0LjIxMS4xMzMuMTQuMTk5LjMzLjE5OS41NjVhLjg4Ljg4IDAgMCAxLS4yNjUuNjM4Ljg5Ljg5IDAgMCAxLS42NjIuMjcgMS4zNSAxLjM1IDAgMCAxLS4xNTgtLjAxMmwtLjEwNC0uMDE1LS4xMDUgMS41MzZjLjI3OC0uMDg1LjQ5Ni0uMTI3LjY1NC0uMTI3LjI5OCAwIC41MzMuMDk5LjcwNy4yOTYuMTczLjE5Ny4yNi40NzUuMjYuODMzIDAgLjM1Mi0uMDkuNjM0LS4yNy44NDVhLjg1Mi44NTIgMCAwIDEtLjY3Ny4zMTYuODYyLjg2MiAwIDAgMS0uNjM2LS4yNWMtLjE0My0uMTQ0LS4yNTQtLjM4NC0uMzMzLS43MjNsLS4wMzYtLjE3N0w0IDEyLjgyNmMuMTMyLjQ4Mi4zMjEuODgyLjU2NyAxLjIuMjQ2LjMxOS41Ni41Ni45NDIuNzI2LjM4MS4xNjUuOTAyLjI0OCAxLjU2My4yNDguNjc3IDAgMS4yMjQtLjExMiAxLjY0LS4zMzUuNDE2LS4yMjMuNzM1LS41NDIuOTU2LS45NTUuMjIxLS40MTQuMzMyLS44NDUuMzMyLTEuMjk2IDAtLjM1OS0uMDY3LS42NjctLjItLjkyNmExLjYzMyAxLjYzMyAwIDAgMC0uNTYzLS42MjVjLS4xNDktLjA5OS0uMzYzLS4xODUtLjY0NC0uMjU5LjM0Ny0uMjA0LjYwNi0uNDQxLjc3OC0uNzEyYTEuNjYgMS42NiAwIDAgMCAuMjU3LS45MDggMS44MiAxLjgyIDAgMCAwLS42MzQtMS40MkM4LjU3MSA3LjE4OSA3Ljg4NiA3IDYuOTM4IDdaTTQuODEzIDBjLjE3NSAwIC4zNS4xNy40MzcuMzM4bDEuMzEzIDIuNDUzcy0yLjguMTctNC40NjMgMS43NzZMLjA4OC43NjFDMCAuNjc3IDAgLjU5MiAwIC41MDcgMCAuMTcuMjYzIDAgLjUyNSAwWm04LjY2MiAwYy4yNjMgMCAuNTI1LjI1NC41MjUuNTA3IDAgLjA4NSAwIC4xNy0uMDg4LjI1NEwxMS45IDQuNDgzQzEwLjIzOCAyLjk2IDcuNDM3IDIuNzkgNy40MzcgMi43OUw4Ljc1LjMzOEM4Ljc1LjE3IDguOTI1IDAgOS4xODggMFoiLz48L3N2Zz4="},92713:function(e,n){"use strict";n.Z={flex_box_center:"flex_box_center___eQ57b",flex_space_between:"flex_space_between___PVjBV",flex_box_vertical_center:"flex_box_vertical_center___ghTL_",flex_box_center_end:"flex_box_center_end___z8oKm",flex_box_column:"flex_box_column___JQV5n",title:"title___w80Ja",workListTabWrap:"workListTabWrap___YRwm7",workListTabButton:"workListTabButton___ebGCB",tables:"tables___AYvHM",checkboxgroup:"checkboxgroup___fZHgL"}}}]);