@ -1,3 +1,4 @@
"use strict" ;
( self [ "webpackChunk" ] = self [ "webpackChunk" ] || [ ] ) . push ( [ [ 60297 ] , {
/***/ 80120 :
@ -6,7 +7,6 @@
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( function ( _ _unused _webpack _module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , {
@ -300,13 +300,12 @@ var CodeDeleteModal = function CodeDeleteModal(cb, text) {
/***/ } ) ,
/***/ 40778 :
/***/ 52612 :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * . / src / pages / Classrooms / Lists / ProblemPractice / index . tsx + 2 modules * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( function ( _ _unused _webpack _module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
// ESM COMPAT FLAG
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
@ -339,10 +338,14 @@ var message = __webpack_require__(8591);
var es _button = _ _webpack _require _ _ ( 3113 ) ;
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/skeleton/index.js + 12 modules
var skeleton = _ _webpack _require _ _ ( 96865 ) ;
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules
var es _checkbox = _ _webpack _require _ _ ( 24905 ) ;
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
var tooltip = _ _webpack _require _ _ ( 6848 ) ;
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
var pagination = _ _webpack _require _ _ ( 27092 ) ;
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/affix/index.js + 2 modules
var affix = _ _webpack _require _ _ ( 81228 ) ;
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.5.1@@ant-design/icons/es/icons/PlusOutlined.js + 1 modules
var PlusOutlined = _ _webpack _require _ _ ( 26762 ) ;
// EXTERNAL MODULE: ./src/utils/fetch.ts
@ -360,7 +363,7 @@ var util = __webpack_require__(23756);
var ImagesIcon = _ _webpack _require _ _ ( 20227 ) ;
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx _runtime = _ _webpack _require _ _ ( 37712 ) ;
; // CONCATENATED MODULE: ./src/pages/Classrooms/Lists/ProblemPractice/ Guide.tsx
; // CONCATENATED MODULE: ./src/pages/Classrooms/Lists/ProblemPractice/ components/ Guide.tsx
@ -417,6 +420,8 @@ var AddOrEditExercise = __webpack_require__(61159);
var NoData = _ _webpack _require _ _ ( 72721 ) ;
// EXTERNAL MODULE: ./src/components/CodeBox/index.tsx + 1 modules
var CodeBox = _ _webpack _require _ _ ( 80120 ) ;
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/components/BottomControl/index.tsx + 1 modules
var BottomControl = _ _webpack _require _ _ ( 56625 ) ;
; // CONCATENATED MODULE: ./src/pages/Classrooms/Lists/ProblemPractice/index.tsx
@ -439,15 +444,16 @@ var CodeBox = __webpack_require__(80120);
var ProblemPractice = function ProblemPractice ( _ref ) {
var _user$userInfo4 ;
var _user$userInfo4 , _detailLeftMenus$cour ;
var classroomList = _ref . classroomList ,
loading = _ref . loading ,
user = _ref . user ,
dispatch = _ref . dispatch ;
var detailLeftMenus = classroomList . detailLeftMenus ;
var paramsFromRouter = ( 0 , _umi _production _exports . useParams ) ( ) ;
var _useState = ( 0 , _react _17 _0 _2 _react . useState ) ( function ( ) {
return {
limit : 2 0
limit : 2
} ;
} ) ,
_useState2 = slicedToArray _default ( ) ( _useState , 2 ) ,
@ -462,19 +468,27 @@ var ProblemPractice = function ProblemPractice(_ref) {
_useState6 = slicedToArray _default ( ) ( _useState5 , 2 ) ,
SortMenuName = _useState6 [ 0 ] ,
setSortMenuName = _useState6 [ 1 ] ;
var _useState7 = ( 0 , _react _17 _0 _2 _react . useState ) ( [ ] ) ,
var _useState7 = ( 0 , _react _17 _0 _2 _react . useState ) ( 0 ) ,
_useState8 = slicedToArray _default ( ) ( _useState7 , 2 ) ,
list = _useState8 [ 0 ] ,
set List = _useState8 [ 1 ] ;
var _useState9 = ( 0 , _react _17 _0 _2 _react . useState ) ( 0 ) ,
tota l = _useState8 [ 0 ] ,
set Total = _useState8 [ 1 ] ;
var _useState9 = ( 0 , _react _17 _0 _2 _react . useState ) ( false ) ,
_useState10 = slicedToArray _default ( ) ( _useState9 , 2 ) ,
total = _useState10 [ 0 ] ,
setTotal = _useState10 [ 1 ] ;
var _useState11 = ( 0 , _react _17 _0 _2 _react . useState ) ( false ) ,
_useState12 = slicedToArray _default ( ) ( _useState11 , 2 ) ,
isLoading = _useState12 [ 0 ] ,
setIsLoading = _useState12 [ 1 ] ;
isLoading = _useState10 [ 0 ] ,
setIsLoading = _useState10 [ 1 ] ;
var delBox = ( 0 , _react _17 _0 _2 _react . useRef ) ( null ) ;
var _useState11 = ( 0 , _react _17 _0 _2 _react . useState ) ( [ ] ) ,
_useState12 = slicedToArray _default ( ) ( _useState11 , 2 ) ,
selectArrs = _useState12 [ 0 ] ,
setSelectArrs = _useState12 [ 1 ] ;
var _useState13 = ( 0 , _react _17 _0 _2 _react . useState ) ( { } ) ,
_useState14 = slicedToArray _default ( ) ( _useState13 , 2 ) ,
dataInfo = _useState14 [ 0 ] ,
setDataInfo = _useState14 [ 1 ] ;
var _useState15 = ( 0 , _react _17 _0 _2 _react . useState ) ( [ ] ) ,
_useState16 = slicedToArray _default ( ) ( _useState15 , 2 ) ,
list = _useState16 [ 0 ] ,
setList = _useState16 [ 1 ] ;
var SortMenus = [ {
name : '按创建时间升序' ,
type : 'created_at' ,
@ -500,6 +514,18 @@ var ProblemPractice = function ProblemPractice(_ref) {
type : 'exercise_name' ,
direction : 'desc'
} ] ;
var actionsArr = [ {
name : '批量删除' ,
icon : /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "i" , {
className : "iconfont icon-piliangshanchu2"
} )
} ] . filter ( function ( item ) {
if ( ( 0 , authority /* isAdmin */ . GJ ) ( ) ) {
return true ;
} else {
return item . name !== '批量删除' ;
}
} ) ;
( 0 , _react _17 _0 _2 _react . useEffect ) ( function ( ) {
var _user$userInfo , _user$userInfo3 ;
if ( user !== null && user !== void 0 && ( _user$userInfo = user . userInfo ) !== null && _user$userInfo !== void 0 && _user$userInfo . login ) {
@ -510,25 +536,22 @@ var ProblemPractice = function ProblemPractice(_ref) {
params . sort _direction = localRecordValue === null || localRecordValue === void 0 ? void 0 : localRecordValue . direction ;
setSortMenuName ( localRecordValue === null || localRecordValue === void 0 ? void 0 : localRecordValue . name ) ;
}
getData( ) ;
_ getData( ) ;
} else if ( user !== null && user !== void 0 && ( _user$userInfo3 = user . userInfo ) !== null && _user$userInfo3 !== void 0 && _user$userInfo3 . username ) {
getData( ) ;
_ getData( ) ;
}
} , [ user === null || user === void 0 || ( _user$userInfo4 = user . userInfo ) === null || _user$userInfo4 === void 0 ? void 0 : _user$userInfo4 . login , location . pathname ] ) ;
// 获取练习列表
var getData = /*#__PURE__*/ function ( ) {
var _ref2 = asyncToGenerator _default ( ) ( /*#__PURE__*/ regeneratorRuntime _default ( ) ( ) . mark ( function _callee ( del ) {
var _ getData = /*#__PURE__*/ function ( ) {
var _ref2 = asyncToGenerator _default ( ) ( /*#__PURE__*/ regeneratorRuntime _default ( ) ( ) . mark ( function _callee ( ) {
var res ;
return regeneratorRuntime _default ( ) ( ) . wrap ( function _callee$ ( _context ) {
while ( 1 ) switch ( _context . prev = _context . next ) {
case 0 :
if ( del ) {
params . page = 1 ;
}
console . log ( "params" , params ) ;
setIsLoading ( true ) ;
_context . next = 5 ;
_context . next = 4 ;
return ( 0 , fetch /* default */ . ZP ) ( "/api/subject_exercises.json" , {
method : "get" ,
params : objectSpread2 _default ( ) ( {
@ -536,20 +559,21 @@ var ProblemPractice = function ProblemPractice(_ref) {
category _id : paramsFromRouter === null || paramsFromRouter === void 0 ? void 0 : paramsFromRouter . categoryId
} , params )
} ) ;
case 5 :
case 4 :
res = _context . sent ;
if ( ( res === null || res === void 0 ? void 0 : res . status ) === 0 ) {
setList ( ( res === null || res === void 0 ? void 0 : res . data ) || [ ] ) ;
setDataInfo ( res || { } ) ;
setTotal ( ( res === null || res === void 0 ? void 0 : res . total _count ) || 0 ) ;
}
setIsLoading ( false ) ;
case 8 :
case 7 :
case "end" :
return _context . stop ( ) ;
}
} , _callee ) ;
} ) ) ;
return function getData ( _x ) {
return function getData ( ) {
return _ref2 . apply ( this , arguments ) ;
} ;
} ( ) ;
@ -562,7 +586,7 @@ var ProblemPractice = function ProblemPractice(_ref) {
params . page = 1 ;
util /* localSort */ . cX . setItem ( "" . concat ( user === null || user === void 0 || ( _user$userInfo5 = user . userInfo ) === null || _user$userInfo5 === void 0 ? void 0 : _user$userInfo5 . login ) . concat ( ( 0 , authority /* isAdmin */ . GJ ) ( ) ? 'Teacher' : 'Student' ) , item , 'problemPractice' ) ;
setSortMenuName ( item . name ) ;
getData( ) ;
_ getData( ) ;
} ;
// 新建练习
@ -594,7 +618,7 @@ var ProblemPractice = function ProblemPractice(_ref) {
var pageOnChange = function pageOnChange ( page , pageSize ) {
params . page = pageSize !== params . limit ? 1 : page ;
params . limit = pageSize ;
getData( ) ;
_ getData( ) ;
} ;
// 跳转到练习统计
@ -608,7 +632,7 @@ var ProblemPractice = function ProblemPractice(_ref) {
} ;
// 删除练习
var handleDelete = function handleDelete ( item ) {
var handleDelete = function handleDelete ( arr ) {
modal /* default */ . Z . confirm ( {
width : 500 ,
icon : null ,
@ -649,14 +673,20 @@ var ProblemPractice = function ProblemPractice(_ref) {
break ;
case 4 :
_context2 . next = 6 ;
return ( 0 , fetch /* default */ . ZP ) ( "/api/subject_exercises/" . concat ( item === null || item === void 0 ? void 0 : item . id , ".json" ) , {
method : 'DELETE'
return ( 0 , fetch /* default */ . ZP ) ( "/api/subject_exercises/delete.json" , {
method : 'post' ,
body : {
course _id : paramsFromRouter . coursesId ,
subject _exercise _ids : arr
}
} ) ;
case 6 :
res = _context2 . sent ;
if ( res . status === 0 ) {
message /* default */ . ZP . success ( '删除成功' ) ;
getData ( true ) ;
setSelectArrs ( [ ] ) ;
params . page = 1 ;
_getData ( ) ;
resolve ( ) ;
}
case 8 :
@ -665,7 +695,7 @@ var ProblemPractice = function ProblemPractice(_ref) {
}
} , _callee2 ) ;
} ) ) ;
return function ( _x 2, _x3 ) {
return function ( _x , _x2 ) {
return _ref3 . apply ( this , arguments ) ;
} ;
} ( ) ) ) ;
@ -747,7 +777,7 @@ var ProblemPractice = function ProblemPractice(_ref) {
onSearch : function onSearch ( value ) {
params . keyword = value . trim ( ) ;
params . page = 1 ;
getData( ) ;
_ getData( ) ;
} ,
onSort : handleMenuChange ,
onBatch : function onBatch ( status ) {
@ -765,21 +795,43 @@ var ProblemPractice = function ProblemPractice(_ref) {
} ,
className : "mt30" ,
children : [ list . length > 0 && list . map ( function ( item ) {
return /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( jsx _runtime . Fragment , {
return /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "div" , {
children : ( 0 , authority /* isAdmin */ . GJ ) ( ) ?
/*#__PURE__*/
// 教师端
( 0 , jsx _runtime . jsxs ) ( "div" , {
className : ProblemPracticemodules . list _item ,
children : [ /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( "div" , {
children : [ /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "div" , {
className : ProblemPracticemodules . name ,
children : item === null || item === void 0 ? void 0 : item . name
style : {
display : 'flex' ,
alignItems : 'center'
} ,
children : [ ( 0 , authority /* isAdmin */ . GJ ) ( ) && /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( es _checkbox /* default */ . Z , {
checked : selectArrs . includes ( item . id ) ,
value : item . id ,
className : "mr20" ,
onClick : function onClick ( e ) {
e . stopPropagation ( ) ;
} ,
onChange : function onChange ( e ) {
if ( selectArrs . indexOf ( item . id ) > - 1 ) {
setSelectArrs ( selectArrs . filter ( function ( val ) {
return val !== item . id ;
} ) ) ;
} else {
setSelectArrs ( selectArrs . concat ( item . id ) ) ;
}
}
} ) , /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( "div" , {
className : ProblemPracticemodules . question _count ,
children : [ "\u5171 " , /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "span" , {
children : item === null || item === void 0 ? void 0 : item . question _count
} ) , " \u9053\u9898" ]
children : [ /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "div" , {
className : ProblemPracticemodules . name ,
children : item === null || item === void 0 ? void 0 : item . name
} ) , /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( "div" , {
className : ProblemPracticemodules . question _count ,
children : [ "\u5171 " , /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "span" , {
children : item === null || item === void 0 ? void 0 : item . question _count
} ) , " \u9053\u9898" ]
} ) ]
} ) ]
} ) , /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( "div" , {
className : ProblemPracticemodules . icons ,
@ -806,12 +858,12 @@ var ProblemPractice = function ProblemPractice(_ref) {
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "i" , {
className : "iconfont icon-shanchu19" ,
onClick : function onClick ( ) {
handleDelete ( item ) ;
handleDelete ( [ item === null || item === void 0 ? void 0 : item . id ] ) ;
}
} )
} ) ]
} ) ]
} , item === null || item === void 0 ? void 0 : item . id ) :
} ) :
/*#__PURE__*/
// 学生端
( 0 , jsx _runtime . jsxs ) ( "div" , {
@ -864,7 +916,7 @@ var ProblemPractice = function ProblemPractice(_ref) {
} ) ]
} ) ]
} , item === null || item === void 0 ? void 0 : item . id )
} );
} , item === null || item === void 0 ? void 0 : item . id );
} ) , /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "aside" , {
className : "tc mb50 mt20" ,
children : total > 0 && /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( pagination /* default */ . Z , {
@ -896,16 +948,112 @@ var ProblemPractice = function ProblemPractice(_ref) {
padding : '100px 0px 200px 0px'
}
} ) ) ]
} ) , selectArrs . length > 0 && ( 0 , authority /* isAdmin */ . GJ ) ( ) && /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( affix /* default */ . Z , {
offsetBottom : 0 ,
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( BottomControl /* default */ . Z , {
buttonDataSource : actionsArr ,
onButtonClick : ( /*#__PURE__*/ function ( ) {
var _ref4 = asyncToGenerator _default ( ) ( /*#__PURE__*/ regeneratorRuntime _default ( ) ( ) . mark ( function _callee5 ( item ) {
return regeneratorRuntime _default ( ) ( ) . wrap ( function _callee5$ ( _context5 ) {
while ( 1 ) switch ( _context5 . prev = _context5 . next ) {
case 0 :
if ( ( item === null || item === void 0 ? void 0 : item . name ) == '批量删除' ) {
handleDelete ( selectArrs ) ;
}
case 1 :
case "end" :
return _context5 . stop ( ) ;
}
} , _callee5 ) ;
} ) ) ;
return function ( _x3 ) {
return _ref4 . apply ( this , arguments ) ;
} ;
} ( ) ) ,
useBatchStatus : useBatchStatus ,
setSeleArr : setSelectArrs ,
catalogue : ( detailLeftMenus === null || detailLeftMenus === void 0 || ( _detailLeftMenus$cour = detailLeftMenus . course _modules ) === null || _detailLeftMenus$cour === void 0 || ( _detailLeftMenus$cour = _detailLeftMenus$cour . find ( function ( v ) {
return v . type === "subject_exercise" ;
} ) ) === null || _detailLeftMenus$cour === void 0 ? void 0 : _detailLeftMenus$cour . second _category ) || [ ] ,
addCatalogue : function addCatalogue ( e ) {
e . preventDefault ( ) ;
dispatch ( {
type : 'classroomList/setActionTabs' ,
payload : {
key : '添加目录' ,
params : params ,
selectArrs : {
category _id : dataInfo === null || dataInfo === void 0 ? void 0 : dataInfo . main _category _id ,
type : 'subject_exercise'
}
}
} ) ;
} ,
allSelect : selectArrs . length ? selectArrs . length === ( list === null || list === void 0 ? void 0 : list . length ) : false ,
setAllSelect : function setAllSelect ( e ) {
if ( e . target . checked ) {
setSelectArrs ( list === null || list === void 0 ? void 0 : list . map ( function ( v ) {
return v . id ;
} ) ) ;
} else {
setSelectArrs ( [ ] ) ;
}
} ,
selectArrs : selectArrs ,
onMenuClick : ( /*#__PURE__*/ function ( ) {
var _ref6 = asyncToGenerator _default ( ) ( /*#__PURE__*/ regeneratorRuntime _default ( ) ( ) . mark ( function _callee6 ( _ref5 ) {
var key , res ;
return regeneratorRuntime _default ( ) ( ) . wrap ( function _callee6$ ( _context6 ) {
while ( 1 ) switch ( _context6 . prev = _context6 . next ) {
case 0 :
key = _ref5 . key ;
if ( ! ( selectArrs == '' ) ) {
_context6 . next = 4 ;
break ;
}
message /* default */ . ZP . error ( '请选择你要操作的任务' ) ;
return _context6 . abrupt ( "return" , null ) ;
case 4 :
_context6 . next = 6 ;
return ( 0 , fetch /* default */ . ZP ) ( "/api/subject_exercises/move_to_category.json" , {
method : 'post' ,
body : {
course _id : paramsFromRouter . coursesId ,
subject _exercise _ids : selectArrs ,
new _category _id : key
}
} ) ;
case 6 :
res = _context6 . sent ;
if ( res . status === 0 ) {
message /* default */ . ZP . success ( '操作成功' ) ;
params . page = 1 ;
_getData ( ) ;
}
case 8 :
case "end" :
return _context6 . stop ( ) ;
}
} , _callee6 ) ;
} ) ) ;
return function ( _x4 ) {
return _ref6 . apply ( this , arguments ) ;
} ;
} ( ) )
} )
} ) , /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( AddOrEditExercise /* default */ . Z , {
getData : getData
getData : function getData ( ) {
params . page = 1 ;
_getData ( ) ;
}
} ) ]
} ) ;
} ;
/* harmony default export */ var Lists _ProblemPractice = ( ( 0 , _umi _production _exports . connect ) ( function ( _ref4 ) {
var classroomList = _ref4 . classroomList ,
loading = _ref4 . loading ,
globalSetting = _ref4 . globalSetting ,
user = _ref4 . user ;
/* harmony default export */ var Lists _ProblemPractice = ( ( 0 , _umi _production _exports . connect ) ( function ( _ref 7 ) {
var classroomList = _ref 7 . classroomList ,
loading = _ref 7 . loading ,
globalSetting = _ref 7 . globalSetting ,
user = _ref 7 . user ;
return {
classroomList : classroomList ,
globalSetting : globalSetting ,
@ -916,13 +1064,192 @@ var ProblemPractice = function ProblemPractice(_ref) {
/***/ } ) ,
/***/ 56625 :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * . / src / pages / Classrooms / Lists / components / BottomControl / index . tsx + 1 modules * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( function ( _ _unused _webpack _module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , {
Z : function ( ) { return /* binding */ components _BottomControl ; }
} ) ;
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = _ _webpack _require _ _ ( 79800 ) ;
var slicedToArray _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( slicedToArray ) ;
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react _17 _0 _2 _react = _ _webpack _require _ _ ( 59301 ) ;
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/menu/index.js + 11 modules
var es _menu = _ _webpack _require _ _ ( 20834 ) ;
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
var input = _ _webpack _require _ _ ( 73782 ) ;
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules
var es _checkbox = _ _webpack _require _ _ ( 24905 ) ;
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es _button = _ _webpack _require _ _ ( 3113 ) ;
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js + 1 modules
var dropdown = _ _webpack _require _ _ ( 38854 ) ;
; // CONCATENATED MODULE: ./src/pages/Classrooms/Lists/components/BottomControl/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var BottomControlmodules = ( { "bottomControlContainer" : "bottomControlContainer___woAeo" , "buttonWrap" : "buttonWrap___iRw4K" , "moveCategory" : "moveCategory___oiQqw" } ) ;
// EXTERNAL MODULE: ./src/utils/authority.ts
var authority = _ _webpack _require _ _ ( 74505 ) ;
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.5.1@@ant-design/icons/es/icons/DownOutlined.js + 1 modules
var DownOutlined = _ _webpack _require _ _ ( 78386 ) ;
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx _runtime = _ _webpack _require _ _ ( 37712 ) ;
; // CONCATENATED MODULE: ./src/pages/Classrooms/Lists/components/BottomControl/index.tsx
var BottomControl = function BottomControl ( _ref ) {
var buttonDataSource = _ref . buttonDataSource ,
onButtonClick = _ref . onButtonClick ,
useBatchStatus = _ref . useBatchStatus ,
allSelect = _ref . allSelect ,
setAllSelect = _ref . setAllSelect ,
selectArrs = _ref . selectArrs ,
onMenuClick = _ref . onMenuClick ,
setSeleArr = _ref . setSeleArr ,
catalogue = _ref . catalogue ,
addCatalogue = _ref . addCatalogue ;
var _useState = ( 0 , _react _17 _0 _2 _react . useState ) ( false ) ,
_useState2 = slicedToArray _default ( ) ( _useState , 2 ) ,
moveVisible = _useState2 [ 0 ] ,
setMoveVisible = _useState2 [ 1 ] ;
var _useState3 = ( 0 , _react _17 _0 _2 _react . useState ) ( '' ) ,
_useState4 = slicedToArray _default ( ) ( _useState3 , 2 ) ,
keyword = _useState4 [ 0 ] ,
setKeyword = _useState4 [ 1 ] ;
console . log ( '---' , catalogue ) ;
var menu = /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "div" , {
className : BottomControlmodules . moveCategory ,
onMouseLeave : function onMouseLeave ( e ) {
return setMoveVisible ( false ) ;
} ,
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( es _menu /* default */ . Z , {
onClick : onMenuClick ,
style : {
maxHeight : 300 ,
width : 240 ,
overflow : 'auto'
} ,
children : [ /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "li" , {
className : "ant-menu-item multi-llipsis1e ant-menu-item-only-child" ,
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( input /* default */ . Z , {
onChange : function onChange ( e ) {
setKeyword ( e . target . value ) ;
}
} )
} ) , catalogue === null || catalogue === void 0 ? void 0 : catalogue . map ( function ( item , key ) {
var _item$third _category ;
if ( keyword !== '' && item . category _name . indexOf ( keyword ) < 0 ) {
return ;
}
return /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( jsx _runtime . Fragment , {
children : [ /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( es _menu /* default */ . Z . Item , {
className : "multi-llipsis1e" ,
title : item . category _name ,
children : item . category _name
} , item . category _id ) , item === null || item === void 0 || ( _item$third _category = item . third _category ) === null || _item$third _category === void 0 ? void 0 : _item$third _category . map ( function ( val ) {
return /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( es _menu /* default */ . Z . Item , {
style : {
marginLeft : 20
} ,
className : "multi-llipsis1e" ,
title : val . category _name ,
children : val . category _name
} , val . category _id ) ;
} ) ]
} ) ;
} ) , addCatalogue && /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "li" , {
className : "ant-menu-item multi-llipsis1e ant-menu-item-only-child" ,
onClick : addCatalogue ,
children : "\u65B0\u5EFA\u5B50\u76EE\u5F55..."
} ) ]
} )
} ) ;
return /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( "div" , {
className : BottomControlmodules . bottomControlContainer ,
children : [ /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( "div" , {
children : [ /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "div" , {
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( es _checkbox /* default */ . Z , {
checked : allSelect ,
onChange : setAllSelect ,
children : [ "\u5168\u9009\u672C\u9875\uFF08" , selectArrs . length , "\uFF09" ]
} )
} ) , ( 0 , authority /* isAdmin */ . GJ ) ( ) && buttonDataSource . map ( function ( item ) {
return /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "div" , {
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( es _button /* default */ . ZP , {
type : "primary" ,
icon : item . icon ,
className : BottomControlmodules . buttonWrap ,
onClick : function onClick ( ) {
return onButtonClick ( item ) ;
} ,
children : item . name
} )
} , item . name ) ;
} ) , ( 0 , authority /* isAdmin */ . GJ ) ( ) && ( addCatalogue || catalogue ) && /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "div" , {
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( dropdown /* default */ . Z , {
open : moveVisible ,
placement : "topLeft" ,
autoAdjustOverflow : false ,
dropdownRender : function dropdownRender ( ) {
return menu ;
} ,
getPopupContainer : function getPopupContainer ( trigger ) {
return trigger . parentNode ;
} ,
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "span" , {
className : "ant-dropdown-link" ,
onMouseEnter : function onMouseEnter ( e ) {
return setMoveVisible ( true ) ;
} ,
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( es _button /* default */ . ZP , {
type : "primary" ,
className : BottomControlmodules . buttonWrap ,
icon : /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "i" , {
className : "iconfont icon-yidongmulu"
} ) ,
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( "span" , {
children : [ "\u79FB\u52A8\u5230\u76EE\u5F55 " , /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( DownOutlined /* default */ . Z , { } ) ]
} )
} )
} )
} )
} ) ]
} ) , /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "div" , {
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( es _button /* default */ . ZP , {
type : "primary" ,
ghost : true ,
onClick : function onClick ( ) {
useBatchStatus ( false ) ;
setSeleArr ( [ ] ) ;
} ,
children : "\u53D6\u6D88\u64CD\u4F5C"
} )
} ) ]
} ) ;
} ;
/* harmony default export */ var components _BottomControl = ( BottomControl ) ;
/***/ } ) ,
/***/ 94721 :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * . / src / pages / Classrooms / Lists / components / SearchSortController / index . tsx + 1 modules * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( function ( _ _unused _webpack _module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , {
@ -1025,7 +1352,6 @@ var SearchSortController = function SearchSortController(_ref) {
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( function ( _ _unused _webpack _module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , {
@ -1516,322 +1842,6 @@ switch_Switch.__ANT_SWITCH = true;
if ( false ) { }
/* harmony default export */ var es _switch = ( switch _Switch ) ;
/***/ } ) ,
/***/ 51581 :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * . / node _modules / _react - infinite - scroller @ 1.2 . 4 @ react - infinite - scroller / dist / InfiniteScroll . js * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , ( {
value : true
} ) ) ;
var _createClass = function ( ) { function defineProperties ( target , props ) { for ( var i = 0 ; i < props . length ; i ++ ) { var descriptor = props [ i ] ; descriptor . enumerable = descriptor . enumerable || false ; descriptor . configurable = true ; if ( "value" in descriptor ) descriptor . writable = true ; Object . defineProperty ( target , descriptor . key , descriptor ) ; } } return function ( Constructor , protoProps , staticProps ) { if ( protoProps ) defineProperties ( Constructor . prototype , protoProps ) ; if ( staticProps ) defineProperties ( Constructor , staticProps ) ; return Constructor ; } ; } ( ) ;
var _react = _ _webpack _require _ _ ( /*! react */ 59301 ) ;
var _react2 = _interopRequireDefault ( _react ) ;
var _propTypes = _ _webpack _require _ _ ( /*! prop-types */ 12708 ) ;
var _propTypes2 = _interopRequireDefault ( _propTypes ) ;
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
function _objectWithoutProperties ( obj , keys ) { var target = { } ; for ( var i in obj ) { if ( keys . indexOf ( i ) >= 0 ) continue ; if ( ! Object . prototype . hasOwnProperty . call ( obj , i ) ) continue ; target [ i ] = obj [ i ] ; } return target ; }
function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( "Cannot call a class as a function" ) ; } }
function _possibleConstructorReturn ( self , call ) { if ( ! self ) { throw new ReferenceError ( "this hasn't been initialised - super() hasn't been called" ) ; } return call && ( typeof call === "object" || typeof call === "function" ) ? call : self ; }
function _inherits ( subClass , superClass ) { if ( typeof superClass !== "function" && superClass !== null ) { throw new TypeError ( "Super expression must either be null or a function, not " + typeof superClass ) ; } subClass . prototype = Object . create ( superClass && superClass . prototype , { constructor : { value : subClass , enumerable : false , writable : true , configurable : true } } ) ; if ( superClass ) Object . setPrototypeOf ? Object . setPrototypeOf ( subClass , superClass ) : subClass . _ _proto _ _ = superClass ; }
var InfiniteScroll = function ( _Component ) {
_inherits ( InfiniteScroll , _Component ) ;
function InfiniteScroll ( props ) {
_classCallCheck ( this , InfiniteScroll ) ;
var _this = _possibleConstructorReturn ( this , ( InfiniteScroll . _ _proto _ _ || Object . getPrototypeOf ( InfiniteScroll ) ) . call ( this , props ) ) ;
_this . scrollListener = _this . scrollListener . bind ( _this ) ;
_this . eventListenerOptions = _this . eventListenerOptions . bind ( _this ) ;
_this . mousewheelListener = _this . mousewheelListener . bind ( _this ) ;
return _this ;
}
_createClass ( InfiniteScroll , [ {
key : 'componentDidMount' ,
value : function componentDidMount ( ) {
this . pageLoaded = this . props . pageStart ;
this . options = this . eventListenerOptions ( ) ;
this . attachScrollListener ( ) ;
}
} , {
key : 'componentDidUpdate' ,
value : function componentDidUpdate ( ) {
if ( this . props . isReverse && this . loadMore ) {
var parentElement = this . getParentElement ( this . scrollComponent ) ;
parentElement . scrollTop = parentElement . scrollHeight - this . beforeScrollHeight + this . beforeScrollTop ;
this . loadMore = false ;
}
this . attachScrollListener ( ) ;
}
} , {
key : 'componentWillUnmount' ,
value : function componentWillUnmount ( ) {
this . detachScrollListener ( ) ;
this . detachMousewheelListener ( ) ;
}
} , {
key : 'isPassiveSupported' ,
value : function isPassiveSupported ( ) {
var passive = false ;
var testOptions = {
get passive ( ) {
passive = true ;
}
} ;
try {
document . addEventListener ( 'test' , null , testOptions ) ;
document . removeEventListener ( 'test' , null , testOptions ) ;
} catch ( e ) {
// ignore
}
return passive ;
}
} , {
key : 'eventListenerOptions' ,
value : function eventListenerOptions ( ) {
var options = this . props . useCapture ;
if ( this . isPassiveSupported ( ) ) {
options = {
useCapture : this . props . useCapture ,
passive : true
} ;
}
return options ;
}
// Set a defaut loader for all your `InfiniteScroll` components
} , {
key : 'setDefaultLoader' ,
value : function setDefaultLoader ( loader ) {
this . defaultLoader = loader ;
}
} , {
key : 'detachMousewheelListener' ,
value : function detachMousewheelListener ( ) {
var scrollEl = window ;
if ( this . props . useWindow === false ) {
scrollEl = this . scrollComponent . parentNode ;
}
scrollEl . removeEventListener ( 'mousewheel' , this . mousewheelListener , this . options ? this . options : this . props . useCapture ) ;
}
} , {
key : 'detachScrollListener' ,
value : function detachScrollListener ( ) {
var scrollEl = window ;
if ( this . props . useWindow === false ) {
scrollEl = this . getParentElement ( this . scrollComponent ) ;
}
scrollEl . removeEventListener ( 'scroll' , this . scrollListener , this . options ? this . options : this . props . useCapture ) ;
scrollEl . removeEventListener ( 'resize' , this . scrollListener , this . options ? this . options : this . props . useCapture ) ;
}
} , {
key : 'getParentElement' ,
value : function getParentElement ( el ) {
var scrollParent = this . props . getScrollParent && this . props . getScrollParent ( ) ;
if ( scrollParent != null ) {
return scrollParent ;
}
return el && el . parentNode ;
}
} , {
key : 'filterProps' ,
value : function filterProps ( props ) {
return props ;
}
} , {
key : 'attachScrollListener' ,
value : function attachScrollListener ( ) {
var parentElement = this . getParentElement ( this . scrollComponent ) ;
if ( ! this . props . hasMore || ! parentElement ) {
return ;
}
var scrollEl = window ;
if ( this . props . useWindow === false ) {
scrollEl = parentElement ;
}
scrollEl . addEventListener ( 'mousewheel' , this . mousewheelListener , this . options ? this . options : this . props . useCapture ) ;
scrollEl . addEventListener ( 'scroll' , this . scrollListener , this . options ? this . options : this . props . useCapture ) ;
scrollEl . addEventListener ( 'resize' , this . scrollListener , this . options ? this . options : this . props . useCapture ) ;
if ( this . props . initialLoad ) {
this . scrollListener ( ) ;
}
}
} , {
key : 'mousewheelListener' ,
value : function mousewheelListener ( e ) {
// Prevents Chrome hangups
// See: https://stackoverflow.com/questions/47524205/random-high-content-download-time-in-chrome/47684257#47684257
if ( e . deltaY === 1 && ! this . isPassiveSupported ( ) ) {
e . preventDefault ( ) ;
}
}
} , {
key : 'scrollListener' ,
value : function scrollListener ( ) {
var el = this . scrollComponent ;
var scrollEl = window ;
var parentNode = this . getParentElement ( el ) ;
var offset = void 0 ;
if ( this . props . useWindow ) {
var doc = document . documentElement || document . body . parentNode || document . body ;
var scrollTop = scrollEl . pageYOffset !== undefined ? scrollEl . pageYOffset : doc . scrollTop ;
if ( this . props . isReverse ) {
offset = scrollTop ;
} else {
offset = this . calculateOffset ( el , scrollTop ) ;
}
} else if ( this . props . isReverse ) {
offset = parentNode . scrollTop ;
} else {
offset = el . scrollHeight - parentNode . scrollTop - parentNode . clientHeight ;
}
// Here we make sure the element is visible as well as checking the offset
if ( offset < Number ( this . props . threshold ) && el && el . offsetParent !== null ) {
this . detachScrollListener ( ) ;
this . beforeScrollHeight = parentNode . scrollHeight ;
this . beforeScrollTop = parentNode . scrollTop ;
// Call loadMore after detachScrollListener to allow for non-async loadMore functions
if ( typeof this . props . loadMore === 'function' ) {
this . props . loadMore ( this . pageLoaded += 1 ) ;
this . loadMore = true ;
}
}
}
} , {
key : 'calculateOffset' ,
value : function calculateOffset ( el , scrollTop ) {
if ( ! el ) {
return 0 ;
}
return this . calculateTopPosition ( el ) + ( el . offsetHeight - scrollTop - window . innerHeight ) ;
}
} , {
key : 'calculateTopPosition' ,
value : function calculateTopPosition ( el ) {
if ( ! el ) {
return 0 ;
}
return el . offsetTop + this . calculateTopPosition ( el . offsetParent ) ;
}
} , {
key : 'render' ,
value : function render ( ) {
var _this2 = this ;
var renderProps = this . filterProps ( this . props ) ;
var children = renderProps . children ,
element = renderProps . element ,
hasMore = renderProps . hasMore ,
initialLoad = renderProps . initialLoad ,
isReverse = renderProps . isReverse ,
loader = renderProps . loader ,
loadMore = renderProps . loadMore ,
pageStart = renderProps . pageStart ,
ref = renderProps . ref ,
threshold = renderProps . threshold ,
useCapture = renderProps . useCapture ,
useWindow = renderProps . useWindow ,
getScrollParent = renderProps . getScrollParent ,
props = _objectWithoutProperties ( renderProps , [ 'children' , 'element' , 'hasMore' , 'initialLoad' , 'isReverse' , 'loader' , 'loadMore' , 'pageStart' , 'ref' , 'threshold' , 'useCapture' , 'useWindow' , 'getScrollParent' ] ) ;
props . ref = function ( node ) {
_this2 . scrollComponent = node ;
if ( ref ) {
ref ( node ) ;
}
} ;
var childrenArray = [ children ] ;
if ( hasMore ) {
if ( loader ) {
isReverse ? childrenArray . unshift ( loader ) : childrenArray . push ( loader ) ;
} else if ( this . defaultLoader ) {
isReverse ? childrenArray . unshift ( this . defaultLoader ) : childrenArray . push ( this . defaultLoader ) ;
}
}
return _react2 . default . createElement ( element , props , childrenArray ) ;
}
} ] ) ;
return InfiniteScroll ;
} ( _react . Component ) ;
InfiniteScroll . propTypes = {
children : _propTypes2 . default . node . isRequired ,
element : _propTypes2 . default . node ,
hasMore : _propTypes2 . default . bool ,
initialLoad : _propTypes2 . default . bool ,
isReverse : _propTypes2 . default . bool ,
loader : _propTypes2 . default . node ,
loadMore : _propTypes2 . default . func . isRequired ,
pageStart : _propTypes2 . default . number ,
ref : _propTypes2 . default . func ,
getScrollParent : _propTypes2 . default . func ,
threshold : _propTypes2 . default . number ,
useCapture : _propTypes2 . default . bool ,
useWindow : _propTypes2 . default . bool
} ;
InfiniteScroll . defaultProps = {
element : 'div' ,
hasMore : false ,
initialLoad : true ,
pageStart : 0 ,
ref : null ,
threshold : 250 ,
useWindow : true ,
isReverse : false ,
useCapture : false ,
loader : null ,
getScrollParent : null
} ;
exports [ "default" ] = InfiniteScroll ;
module . exports = exports [ 'default' ] ;
/***/ } ) ,
/***/ 26724 :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * . / node _modules / _react - infinite - scroller @ 1.2 . 4 @ react - infinite - scroller / index . js * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( function ( module , _ _unused _webpack _exports , _ _webpack _require _ _ ) {
module . exports = _ _webpack _require _ _ ( /*! ./dist/InfiniteScroll */ 51581 )
/***/ } )
} ] ) ;