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.
educoder/public/react/dist/static/js/20.6b2dc7ef.chunk.js

2 lines
322 KiB

5 years ago
/*! For license information please see 20.6b2dc7ef.chunk.js.LICENSE.txt */
(this.webpackJsonph5=this.webpackJsonph5||[]).push([[20,4,6,9,13,15],{1048:function(e,t,n){"use strict";var r=n(8),o=n(7),a=n(10),i=n(9),l=n(11),s=n(0),c=n.n(s),u=n(574),p=n(802),f=n(6),d=n.n(f),h=n(49),m=n.n(h),v=function(e){function t(e){var n;return Object(r.a)(this,t),(n=Object(a.a)(this,Object(i.a)(t).call(this,e))).open=function(e){n.usingCheckBeforePost=1==e,n.homeworkstart()},n.homeworkstart=function(){var e=n.props.isPublish,t=n.props.isPublishtype,r=!0===e||1===t;n.props.checkBoxValues&&0!=n.props.checkBoxValues.length?n.fetchCourseGroups():n.props.showNotification("\u8bf7\u5148\u9009\u62e9\u8981\u7acb\u5373".concat(r?"\u53d1\u5e03":"\u622a\u6b62","\u7684\u4f5c\u4e1a"))},n.showDialog=function(e){var t=n.props.isPublish,r=n.props.isPublishtype,o="YYYY-MM-DD HH:mm",a=!0===t&&void 0===r,i=!0===t||1===r,l=m()();n.setState({modalname:i?"\u7acb\u5373\u53d1\u5e03":"\u7acb\u5373\u622a\u6b62",modaltype:0<e.length?1:2,visible:!a,OneSelftype:a,Topval:i?"\u5b66\u751f\u5c06\u7acb\u5373\u6536\u5230\u4f5c\u4e1a":"\u5b66\u751f\u5c06\u4e0d\u80fd\u518d\u63d0\u4ea4\u4f5c\u54c1",Botval:n.props.fromListPage?i?"\u672c\u64cd\u4f5c\u53ea\u5bf9\u201c\u672a\u53d1\u5e03\u201d\u7684\u4f5c\u4e1a\u6709\u6548":"\u672c\u64cd\u4f5c\u53ea\u5bf9\u201c\u63d0\u4ea4\u4e2d\u201d\u7684\u4f5c\u4e1a\u6709\u6548":"",starttime:i?"\u53d1\u5e03\u65f6\u95f4\uff1a".concat(l.format(o)):"",starttimes:i?"".concat(l.format(o)):"",endtime:i?"\u622a\u6b62\u65f6\u95f4\uff1a".concat(l.add(1,"months").add(1,"hours").minutes(0).format(o)):"",Cancelname:i?"\u6682\u4e0d\u53d1\u5e03":"\u6682\u4e0d\u622a\u6b62",Savesname:i?"\u7acb\u5373\u53d1\u5e03":"\u7acb\u5373\u622a\u6b62",Cancel:n.homeworkhide,Saves:n.homeworkstartend,typs:i?"start":"end"})},n.homeworkhide=function(){n.setState({modalname:void 0,modaltype:void 0,visible:!1,OneSelftype:!1,Topval:void 0,Topvalright:void 0,Botvalleft:void 0,Botval:void 0,starttime:void 0,endtime:void 0,Cancelname:void 0,Savesname:void 0,Cancel:void 0,Saves:void 0,StudentList_value:void 0,addname:void 0,addnametype:!1,addnametab:void 0})},n.homeworkstartend=function(e,t){if(n.usingCheckBeforePost&&n.props.checkBeforePost&&!n.props.checkBeforePost())n.homeworkhide();else{var r=n.props.isPublish,o=e;if(n.usingCheckBeforePost&&(o=n.state.course_groups.map((function(e){return e.id}))),0<n.state.course_groups.length&&n.state.course_groups.length&&(!o||o&&0==o.length))n.props.showNotification("\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u5206\u73ed");else{var a;a=e&&0===e.length?{homework_ids:n.props.checkBoxValues,end_time:"Invalid date"===t?void 0:t}:!0===n.props.islist?{homework_ids:n.props.checkBoxValues,group_ids:o,end_time:t}:{homework_ids:n.props.checkBoxValues,group_ids:o,group_end_times:t,detail:!0};var i=n.props.isPublishtype,l=!0===r||1===i,s=n.props.match.params.coursesId,c="/courses/".concat(s,"/homework_commons/").concat(l?"publish_homework":"end_homework",".json");d.a.post(c,a).then((function(e){0==e.data.status&&(n.homeworkhide(),n.props.showNotification(l?"\u7acb\u5373\u53d1\u5e03\u6210\u529f":"\u7acb\u5373\u622a\u6b62\u6210\u529f"),n.props.doWhenSuccess&&n.props.doWhenSuccess(),n.setState({visible:!1}),n.props.action&&n.props.action())})).catch((function(e){}))}}},n.fetchCourseGroups=function(){var e=n.props.isPublish,t=n.props.isPublishtype,r=!0===e||1===t,o=n.props.match.params.coursesId,a="/courses/".concat(o,"/all_course_groups.json");1==n.props.checkBoxValues.length&&(n.props.isPublish,a="/homework_commons/".concat(n.props.checkBoxValues[0],"/").concat(r?"publish_groups":"end_groups",".json")),d.a.get(a,{}).then((function(e){e&&-1!=e.data.status?(n.showDialog(e.data.course_groups),n.setState({course_groups:e.data.course_groups,starttimesend:void 0===e.data.end_time||null===e.data.end_time||""===e.data.end_time?void 0:e.data.end_time})):n.setState({visible:!1})})).catch((function(e){}))},n.state={course_groups:[],modalname:void 0,modaltype:void 0,visible:!1,Topval:void 0,Botvalleft:void 0,Botval:void 0,starttime:void 0,endtime:void 0,Cancelname:void 0,Savesname:void 0,Cancel:void 0,Saves:void 0,Topvalright:void 0},n}return