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.
4326 lines
192 KiB
4326 lines
192 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[5641,60696,56369],{
|
|
|
|
/***/ 3089:
|
|
/*!************************************************************************************!*\
|
|
!*** ./node_modules/@ant-design/icons/es/icons/MinusCircleOutlined.js + 1 modules ***!
|
|
\************************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ icons_MinusCircleOutlined; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(1413);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/MinusCircleOutlined.js
|
|
// This icon file is generated automatically.
|
|
var MinusCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z" } }, { "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }] }, "name": "minus-circle", "theme": "outlined" };
|
|
/* harmony default export */ var asn_MinusCircleOutlined = (MinusCircleOutlined);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 6 modules
|
|
var AntdIcon = __webpack_require__(7918);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/MinusCircleOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
var MinusCircleOutlined_MinusCircleOutlined = function MinusCircleOutlined(props, ref) {
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, props), {}, {
|
|
ref: ref,
|
|
icon: asn_MinusCircleOutlined
|
|
}));
|
|
};
|
|
MinusCircleOutlined_MinusCircleOutlined.displayName = 'MinusCircleOutlined';
|
|
/* harmony default export */ var icons_MinusCircleOutlined = (/*#__PURE__*/react.forwardRef(MinusCircleOutlined_MinusCircleOutlined));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 64789:
|
|
/*!***********************************************************************************!*\
|
|
!*** ./node_modules/@ant-design/icons/es/icons/PlusCircleOutlined.js + 1 modules ***!
|
|
\***********************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ icons_PlusCircleOutlined; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(1413);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/PlusCircleOutlined.js
|
|
// This icon file is generated automatically.
|
|
var PlusCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z" } }, { "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }] }, "name": "plus-circle", "theme": "outlined" };
|
|
/* harmony default export */ var asn_PlusCircleOutlined = (PlusCircleOutlined);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 6 modules
|
|
var AntdIcon = __webpack_require__(7918);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/PlusCircleOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
var PlusCircleOutlined_PlusCircleOutlined = function PlusCircleOutlined(props, ref) {
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, props), {}, {
|
|
ref: ref,
|
|
icon: asn_PlusCircleOutlined
|
|
}));
|
|
};
|
|
PlusCircleOutlined_PlusCircleOutlined.displayName = 'PlusCircleOutlined';
|
|
/* harmony default export */ var icons_PlusCircleOutlined = (/*#__PURE__*/react.forwardRef(PlusCircleOutlined_PlusCircleOutlined));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 56369:
|
|
/*!********************************************************!*\
|
|
!*** ./src/components/AddPoints/index.tsx + 2 modules ***!
|
|
\********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ AddPoints; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js
|
|
var regeneratorRuntime = __webpack_require__(17061);
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(42122);
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/toConsumableArray.js
|
|
var toConsumableArray = __webpack_require__(861);
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
|
|
var asyncToGenerator = __webpack_require__(17156);
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(27424);
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/checkbox/style/index.js + 1 modules
|
|
var style = __webpack_require__(82000);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/checkbox/index.js + 2 modules
|
|
var es_checkbox = __webpack_require__(32808);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
|
|
var _umi_production_exports = __webpack_require__(89214);
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/MinusCircleOutlined.js + 1 modules
|
|
var MinusCircleOutlined = __webpack_require__(3089);
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/PlusCircleOutlined.js + 1 modules
|
|
var PlusCircleOutlined = __webpack_require__(64789);
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
var fetch = __webpack_require__(84519);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/select/style/index.js + 1 modules
|
|
var select_style = __webpack_require__(95985);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/select/index.js
|
|
var es_select = __webpack_require__(34041);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/style/index.js + 1 modules
|
|
var form_style = __webpack_require__(75627);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/index.js + 17 modules
|
|
var es_form = __webpack_require__(51018);
|
|
;// CONCATENATED MODULE: ./src/components/AddPoints/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var AddPointsmodules = ({});
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
;// CONCATENATED MODULE: ./src/components/AddPoints/item.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var CheckboxGroup = es_checkbox/* default.Group */.Z.Group;
|
|
var ShixunsListPage = function ShixunsListPage(_ref) {
|
|
var _params$zydatas, _params$zydatas2, _params$jbdatas, _params$jbdatas2, _params$kcdatas, _params$kcdatas2, _params$zsdatas, _params$zsdatas2;
|
|
var classroomList = _ref.classroomList,
|
|
loading = _ref.loading,
|
|
user = _ref.user,
|
|
_ref$exercise_id = _ref.exercise_id,
|
|
exercise_id = _ref$exercise_id === void 0 ? null : _ref$exercise_id,
|
|
_ref$homework_common_ = _ref.homework_common_id,
|
|
homework_common_id = _ref$homework_common_ === void 0 ? null : _ref$homework_common_,
|
|
setitem = _ref.setitem,
|
|
item = _ref.item,
|
|
type = _ref.type,
|
|
rz = _ref.rz,
|
|
dispatch = _ref.dispatch;
|
|
var _useState = (0,react.useState)([]),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
datas = _useState2[0],
|
|
setdatas = _useState2[1];
|
|
var _useState3 = (0,react.useState)({
|
|
zydatas: [],
|
|
jbdatas: [],
|
|
kcdatas: [],
|
|
zsdatas: [],
|
|
page: 1,
|
|
per_page: 20
|
|
}),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
params = _useState4[0],
|
|
setparams = _useState4[1];
|
|
var param = (0,_umi_production_exports.useParams)();
|
|
var _useState5 = (0,react.useState)(false),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
isshowmodal = _useState6[0],
|
|
setisshowmodal = _useState6[1];
|
|
var _useState7 = (0,react.useState)(false),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
isloading = _useState8[0],
|
|
setisloading = _useState8[1];
|
|
var _Form$useForm = es_form/* default.useForm */.Z.useForm(),
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
form = _Form$useForm2[0];
|
|
|
|
// // console.log(params);
|
|
// useEffect(()=>{
|
|
// if(homework_common_id||exercise_id){
|
|
// getdatas();
|
|
// // getrz();
|
|
|
|
// }
|
|
// },[exercise_id,homework_common_id])
|
|
|
|
(0,react.useEffect)(function () {
|
|
if (rz) {
|
|
// getrz();
|
|
params.zydatas = rz;
|
|
setparams(objectSpread2_default()({}, params));
|
|
if (item !== null && item !== void 0 && item.ec_course_id) {
|
|
setdata();
|
|
}
|
|
}
|
|
}, [item, rz]);
|
|
function setdata() {
|
|
return _setdata.apply(this, arguments);
|
|
} //获取认证届别
|
|
function _setdata() {
|
|
_setdata = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
case 0:
|
|
console.log('----', item);
|
|
_context3.next = 3;
|
|
return getjb(item === null || item === void 0 ? void 0 : item.ec_major_school_id);
|
|
case 3:
|
|
_context3.next = 5;
|
|
return getcourse(item === null || item === void 0 ? void 0 : item.ec_year_id);
|
|
case 5:
|
|
_context3.next = 7;
|
|
return getec_points(item === null || item === void 0 ? void 0 : item.ec_course_id);
|
|
case 7:
|
|
form.setFieldsValue({
|
|
ec_course_id: item === null || item === void 0 ? void 0 : item.ec_course_id,
|
|
ec_major_school_id: item === null || item === void 0 ? void 0 : item.ec_major_school_id,
|
|
ec_point_ids: item === null || item === void 0 ? void 0 : item.ec_point_ids,
|
|
ec_year_id: item === null || item === void 0 ? void 0 : item.ec_year_id
|
|
});
|
|
case 8:
|
|
case "end":
|
|
return _context3.stop();
|
|
}
|
|
}, _callee3);
|
|
}));
|
|
return _setdata.apply(this, arguments);
|
|
}
|
|
function getjb(_x) {
|
|
return _getjb.apply(this, arguments);
|
|
} //获取关联课程
|
|
function _getjb() {
|
|
_getjb = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(key) {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
case 0:
|
|
_context4.next = 2;
|
|
return (0,fetch/* default */.ZP)("/api/ec_major_schools/".concat(key, "/ec_years/get_year_list.json"), {
|
|
method: 'get'
|
|
});
|
|
case 2:
|
|
res = _context4.sent;
|
|
params.jbdatas = res === null || res === void 0 ? void 0 : res.data;
|
|
setparams(objectSpread2_default()({}, params));
|
|
form.setFieldsValue({
|
|
ec_year_id: '',
|
|
ec_course_id: '',
|
|
ec_point_ids: []
|
|
});
|
|
case 6:
|
|
case "end":
|
|
return _context4.stop();
|
|
}
|
|
}, _callee4);
|
|
}));
|
|
return _getjb.apply(this, arguments);
|
|
}
|
|
function getcourse(_x2) {
|
|
return _getcourse.apply(this, arguments);
|
|
} //获取知识点
|
|
function _getcourse() {
|
|
_getcourse = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5(key) {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
case 0:
|
|
_context5.next = 2;
|
|
return (0,fetch/* default */.ZP)("/api/ec_years/".concat(key, "/ec_courses/get_courses.json"), {
|
|
method: 'get'
|
|
});
|
|
case 2:
|
|
res = _context5.sent;
|
|
params.kcdatas = res === null || res === void 0 ? void 0 : res.data;
|
|
setparams(objectSpread2_default()({}, params));
|
|
form.setFieldsValue({
|
|
ec_course_id: '',
|
|
ec_point_ids: []
|
|
});
|
|
case 6:
|
|
case "end":
|
|
return _context5.stop();
|
|
}
|
|
}, _callee5);
|
|
}));
|
|
return _getcourse.apply(this, arguments);
|
|
}
|
|
var getec_points = /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(record) {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
_context.next = 2;
|
|
return (0,fetch/* default */.ZP)("/api/ec_courses/".concat(record, "/ec_points.json"), {
|
|
method: 'get',
|
|
params: {
|
|
ec_course_id: record
|
|
}
|
|
});
|
|
case 2:
|
|
res = _context.sent;
|
|
params.zsdatas = res === null || res === void 0 ? void 0 : res.data;
|
|
setparams(objectSpread2_default()({}, params));
|
|
case 5:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function getec_points(_x3) {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: AddPointsmodules.from,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
form: form,
|
|
layout: "inline",
|
|
onValuesChange: function onValuesChange(value) {
|
|
console.log('----', value);
|
|
if (value.ec_major_school_id) {
|
|
params.jbdatas = [];
|
|
params.kcdatas = [];
|
|
params.zsdatas = [];
|
|
setparams(objectSpread2_default()({}, params));
|
|
getjb(value.ec_major_school_id);
|
|
}
|
|
if (value.ec_year_id) {
|
|
params.kcdatas = [];
|
|
params.zsdatas = [];
|
|
setparams(objectSpread2_default()({}, params));
|
|
getcourse(value.ec_year_id);
|
|
}
|
|
if (value.ec_course_id) {
|
|
params.zsdatas = [];
|
|
setparams(objectSpread2_default()({}, params));
|
|
getec_points(value.ec_course_id);
|
|
}
|
|
},
|
|
onFinish: /*#__PURE__*/function () {
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(value) {
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
setitem(value);
|
|
case 1:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
return function (_x4) {
|
|
return _ref3.apply(this, arguments);
|
|
};
|
|
}(),
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
label: "\u8BA4\u8BC1\u4E13\u4E1A",
|
|
name: "ec_major_school_id",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select/* default */.Z, {
|
|
style: {
|
|
width: 150
|
|
},
|
|
disabled: ((_params$zydatas = params.zydatas) === null || _params$zydatas === void 0 ? void 0 : _params$zydatas.length) <= 0,
|
|
placeholder: "\u8BF7\u9009\u62E9\u8BA4\u8BC1\u4E13\u4E1A",
|
|
children: params === null || params === void 0 ? void 0 : (_params$zydatas2 = params.zydatas) === null || _params$zydatas2 === void 0 ? void 0 : _params$zydatas2.map(function (item, index) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select/* default.Option */.Z.Option, {
|
|
value: item === null || item === void 0 ? void 0 : item.ec_major_school_id,
|
|
children: item === null || item === void 0 ? void 0 : item.name
|
|
}, index);
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
label: "\u8BA4\u8BC1\u5C4A\u522B",
|
|
name: "ec_year_id",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select/* default */.Z, {
|
|
style: {
|
|
width: 150
|
|
},
|
|
disabled: ((_params$jbdatas = params.jbdatas) === null || _params$jbdatas === void 0 ? void 0 : _params$jbdatas.length) <= 0,
|
|
placeholder: "\u8BF7\u9009\u62E9\u8BA4\u8BC1\u5C4A\u522B",
|
|
children: params === null || params === void 0 ? void 0 : (_params$jbdatas2 = params.jbdatas) === null || _params$jbdatas2 === void 0 ? void 0 : _params$jbdatas2.map(function (item, index) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select/* default.Option */.Z.Option, {
|
|
value: item === null || item === void 0 ? void 0 : item.ec_year_id,
|
|
children: item === null || item === void 0 ? void 0 : item.year
|
|
}, index);
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
label: "\u8BFE\u7A0B",
|
|
name: "ec_course_id",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select/* default */.Z, {
|
|
style: {
|
|
width: 150
|
|
},
|
|
disabled: ((_params$kcdatas = params.kcdatas) === null || _params$kcdatas === void 0 ? void 0 : _params$kcdatas.length) <= 0,
|
|
placeholder: "\u8BF7\u9009\u62E9\u8BFE\u7A0B",
|
|
children: params === null || params === void 0 ? void 0 : (_params$kcdatas2 = params.kcdatas) === null || _params$kcdatas2 === void 0 ? void 0 : _params$kcdatas2.map(function (item, index) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select/* default.Option */.Z.Option, {
|
|
value: item === null || item === void 0 ? void 0 : item.id,
|
|
children: item === null || item === void 0 ? void 0 : item.name
|
|
}, index);
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
label: "\u77E5\u8BC6\u70B9",
|
|
name: "ec_point_ids",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select/* default */.Z, {
|
|
onChange: function onChange() {
|
|
form.submit();
|
|
},
|
|
style: {
|
|
width: 150
|
|
},
|
|
mode: "multiple",
|
|
disabled: ((_params$zsdatas = params.zsdatas) === null || _params$zsdatas === void 0 ? void 0 : _params$zsdatas.length) <= 0,
|
|
placeholder: "\u8BF7\u9009\u62E9\u77E5\u8BC6\u70B9",
|
|
children: params === null || params === void 0 ? void 0 : (_params$zsdatas2 = params.zsdatas) === null || _params$zsdatas2 === void 0 ? void 0 : _params$zsdatas2.map(function (item, index) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select/* default.Option */.Z.Option, {
|
|
value: item === null || item === void 0 ? void 0 : item.id,
|
|
children: item === null || item === void 0 ? void 0 : item.name
|
|
}, index);
|
|
})
|
|
})
|
|
})]
|
|
})
|
|
});
|
|
};
|
|
/* harmony default export */ var AddPoints_item = ((0,_umi_production_exports.connect)(function (_ref4) {
|
|
var classroomList = _ref4.classroomList,
|
|
loading = _ref4.loading,
|
|
globalSetting = _ref4.globalSetting,
|
|
user = _ref4.user;
|
|
return {
|
|
classroomList: classroomList,
|
|
globalSetting: globalSetting,
|
|
loading: loading.effects,
|
|
user: user
|
|
};
|
|
})(ShixunsListPage));
|
|
;// CONCATENATED MODULE: ./src/components/AddPoints/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var AddPoints_CheckboxGroup = es_checkbox/* default.Group */.Z.Group;
|
|
var AddPoints_ShixunsListPage = function ShixunsListPage(_ref) {
|
|
var _user$userInfo2, _user$userInfo2$cours, _user$userInfo$course2;
|
|
var classroomList = _ref.classroomList,
|
|
loading = _ref.loading,
|
|
user = _ref.user,
|
|
_ref$exercise_id = _ref.exercise_id,
|
|
exercise_id = _ref$exercise_id === void 0 ? null : _ref$exercise_id,
|
|
_ref$homework_common_ = _ref.homework_common_id,
|
|
homework_common_id = _ref$homework_common_ === void 0 ? null : _ref$homework_common_,
|
|
_setitem = _ref.setitem,
|
|
type = _ref.type,
|
|
dispatch = _ref.dispatch;
|
|
var _useState = (0,react.useState)([{}]),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
datas = _useState2[0],
|
|
setdatas = _useState2[1];
|
|
var _useState3 = (0,react.useState)([]),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
rz = _useState4[0],
|
|
setrz = _useState4[1];
|
|
function getdatas() {
|
|
return _getdatas.apply(this, arguments);
|
|
}
|
|
function _getdatas() {
|
|
_getdatas = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
var _res$data;
|
|
var res, _res$data2, _res$data3, ec_point_ids;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
_context.next = 2;
|
|
return (0,fetch/* default */.ZP)("/api/ec_courses/".concat(0, "/ec_points/get_work_points.json"), {
|
|
method: 'get',
|
|
params: {
|
|
exercise_id: exercise_id,
|
|
homework_common_id: homework_common_id
|
|
}
|
|
});
|
|
case 2:
|
|
res = _context.sent;
|
|
// console.log(res?.data?.[0]);
|
|
|
|
if ((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.length) > 0) {
|
|
ec_point_ids = [];
|
|
res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.map(function (ite) {
|
|
var _ite$ec_point_ids2;
|
|
ite === null || ite === void 0 ? void 0 : (_ite$ec_point_ids2 = ite.ec_point_ids) === null || _ite$ec_point_ids2 === void 0 ? void 0 : _ite$ec_point_ids2.map(function (j) {
|
|
ec_point_ids.push(j);
|
|
});
|
|
});
|
|
_setitem(objectSpread2_default()(objectSpread2_default()({}, res === null || res === void 0 ? void 0 : (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3[0]), {}, {
|
|
ec_point_ids: ec_point_ids
|
|
}));
|
|
// setitem({...res?.data?.[0]});
|
|
setdatas(res === null || res === void 0 ? void 0 : res.data);
|
|
}
|
|
case 4:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return _getdatas.apply(this, arguments);
|
|
}
|
|
(0,react.useEffect)(function () {
|
|
var _user$userInfo, _user$userInfo$course;
|
|
if (user !== null && user !== void 0 && (_user$userInfo = user.userInfo) !== null && _user$userInfo !== void 0 && (_user$userInfo$course = _user$userInfo.course) !== null && _user$userInfo$course !== void 0 && _user$userInfo$course.course_school_id) {
|
|
getrz();
|
|
}
|
|
}, [user === null || user === void 0 ? void 0 : (_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : (_user$userInfo2$cours = _user$userInfo2.course) === null || _user$userInfo2$cours === void 0 ? void 0 : _user$userInfo2$cours.course_school_id]);
|
|
function getrz() {
|
|
return _getrz.apply(this, arguments);
|
|
}
|
|
function _getrz() {
|
|
_getrz = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
var _user$userInfo3, _user$userInfo3$cours;
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
_context2.next = 2;
|
|
return (0,fetch/* default */.ZP)("/api/schools/".concat(user === null || user === void 0 ? void 0 : (_user$userInfo3 = user.userInfo) === null || _user$userInfo3 === void 0 ? void 0 : (_user$userInfo3$cours = _user$userInfo3.course) === null || _user$userInfo3$cours === void 0 ? void 0 : _user$userInfo3$cours.course_school_id, "/ec_majors/get_major_list.json"), {
|
|
method: 'get'
|
|
});
|
|
case 2:
|
|
res = _context2.sent;
|
|
setrz(res === null || res === void 0 ? void 0 : res.data);
|
|
if (homework_common_id || exercise_id) {
|
|
getdatas();
|
|
// getrz();
|
|
}
|
|
case 5:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
return _getrz.apply(this, arguments);
|
|
}
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
display: (_user$userInfo$course2 = user.userInfo.course) !== null && _user$userInfo$course2 !== void 0 && _user$userInfo$course2.is_openengineering ? '' : 'none'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
style: {
|
|
fontSize: '16px',
|
|
fontWeight: 400
|
|
},
|
|
children: "\u5DE5\u7A0B\u8BA4\u8BC1\u8003\u6838\u77E5\u8BC6\u70B9"
|
|
}), datas === null || datas === void 0 ? void 0 : datas.map(function (item, index) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
marginBottom: '10px'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(AddPoints_item, {
|
|
rz: rz,
|
|
item: item,
|
|
type: index,
|
|
setitem: function setitem(value) {
|
|
// item=value
|
|
// console.log('---',item,datas);
|
|
datas.splice(index, 1, value);
|
|
setdatas(toConsumableArray_default()(datas));
|
|
var ec_point_ids = [];
|
|
datas === null || datas === void 0 ? void 0 : datas.map(function (ite) {
|
|
var _ite$ec_point_ids;
|
|
ite === null || ite === void 0 ? void 0 : (_ite$ec_point_ids = ite.ec_point_ids) === null || _ite$ec_point_ids === void 0 ? void 0 : _ite$ec_point_ids.map(function (j) {
|
|
ec_point_ids.push(j);
|
|
});
|
|
});
|
|
_setitem(objectSpread2_default()(objectSpread2_default()({}, value), {}, {
|
|
ec_point_ids: ec_point_ids
|
|
}));
|
|
}
|
|
}), index != 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(MinusCircleOutlined/* default */.Z, {
|
|
onClick: function onClick() {
|
|
datas.splice(index, 1);
|
|
setdatas(toConsumableArray_default()(datas));
|
|
},
|
|
style: {
|
|
marginLeft: 10,
|
|
fontSize: '20px'
|
|
}
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(PlusCircleOutlined/* default */.Z, {
|
|
onClick: function onClick() {
|
|
datas.push({});
|
|
setdatas(toConsumableArray_default()(datas));
|
|
},
|
|
style: {
|
|
marginLeft: 10,
|
|
fontSize: '20px'
|
|
}
|
|
})]
|
|
});
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ var AddPoints = ((0,_umi_production_exports.connect)(function (_ref2) {
|
|
var classroomList = _ref2.classroomList,
|
|
loading = _ref2.loading,
|
|
globalSetting = _ref2.globalSetting,
|
|
user = _ref2.user;
|
|
return {
|
|
classroomList: classroomList,
|
|
globalSetting: globalSetting,
|
|
loading: loading.effects,
|
|
user: user
|
|
};
|
|
})(AddPoints_ShixunsListPage));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 33722:
|
|
/*!*********************************************************!*\
|
|
!*** ./src/components/FormSearch/index.tsx + 1 modules ***!
|
|
\*********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ components_FormSearch; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/style/index.js + 1 modules
|
|
var style = __webpack_require__(29913);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
|
|
var es_button = __webpack_require__(71577);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/style/index.js + 1 modules
|
|
var input_style = __webpack_require__(69463);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/index.js + 5 modules
|
|
var input = __webpack_require__(75008);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/style/index.js + 1 modules
|
|
var form_style = __webpack_require__(75627);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/index.js + 17 modules
|
|
var es_form = __webpack_require__(51018);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(27424);
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./src/components/FormSearch/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var FormSearchmodules = ({"search":"search___JA0r9","btn":"btn___GGtZC"});
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
;// CONCATENATED MODULE: ./src/components/FormSearch/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var FormSearch = function FormSearch(_ref) {
|
|
var value = _ref.value,
|
|
onChange = _ref.onChange;
|
|
var _Form$useForm = es_form/* default.useForm */.Z.useForm(),
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
form = _Form$useForm2[0];
|
|
(0,react.useEffect)(function () {
|
|
if (!!value) {
|
|
form.setFieldsValue(value);
|
|
}
|
|
}, value);
|
|
var handleFinish = function handleFinish(v) {
|
|
onChange(v);
|
|
};
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: FormSearchmodules.search,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
className: FormSearchmodules.formWrap,
|
|
colon: false,
|
|
form: form,
|
|
size: "large",
|
|
layout: "inline",
|
|
onFinish: handleFinish,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
label: "\u5B9E\u8BAD\u4FE1\u606F",
|
|
name: "keyword",
|
|
initialValue: "",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
style: {
|
|
width: 280,
|
|
height: 40
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
label: "\u5B66\u6821/\u5355\u4F4D",
|
|
name: "schools",
|
|
initialValue: "",
|
|
style: {
|
|
margin: '0 40px'
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
style: {
|
|
width: 280,
|
|
height: 40
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
label: "\u521B\u5EFA\u8005",
|
|
name: "creator",
|
|
initialValue: "",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
style: {
|
|
width: 200,
|
|
height: 40
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
className: FormSearchmodules.btn,
|
|
type: "primary",
|
|
htmlType: "submit",
|
|
children: "\u641C\u7D22"
|
|
})]
|
|
})
|
|
});
|
|
};
|
|
/* harmony default export */ var components_FormSearch = (FormSearch);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 60696:
|
|
/*!***************************************************************!*\
|
|
!*** ./src/components/ReuseShixunModal/index.tsx + 1 modules ***!
|
|
\***************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ components_ReuseShixunModal; },
|
|
"P": function() { return /* binding */ useReuseModal; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/table/style/index.js + 1 modules
|
|
var style = __webpack_require__(71854);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/table/index.js + 58 modules
|
|
var table = __webpack_require__(67250);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/toConsumableArray.js
|
|
var toConsumableArray = __webpack_require__(861);
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/style/index.js + 1 modules
|
|
var input_style = __webpack_require__(69463);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/index.js + 5 modules
|
|
var input = __webpack_require__(75008);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectWithoutProperties.js
|
|
var objectWithoutProperties = __webpack_require__(70215);
|
|
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/modal/style/index.js + 1 modules
|
|
var modal_style = __webpack_require__(35611);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/modal/index.js + 7 modules
|
|
var modal = __webpack_require__(85402);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/radio/style/index.js + 1 modules
|
|
var radio_style = __webpack_require__(83822);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/radio/index.js + 4 modules
|
|
var es_radio = __webpack_require__(29924);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js
|
|
var regeneratorRuntime = __webpack_require__(17061);
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(42122);
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
|
|
var asyncToGenerator = __webpack_require__(17156);
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/style/index.js + 1 modules
|
|
var form_style = __webpack_require__(75627);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/index.js + 17 modules
|
|
var es_form = __webpack_require__(51018);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(27424);
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./src/components/ReuseShixunModal/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var ReuseShixunModalmodules = ({"brief":"brief___LOzpE","contentTitle":"contentTitle___xkdcN","content":"content___Vtri0","tips":"tips___tuAtH","antdTable":"antdTable___s8T2N","tableCell":"tableCell___kN9Fw","antdModal":"antdModal___WVBk3","orangeColor":"orangeColor___ryB2u"});
|
|
// EXTERNAL MODULE: ./src/service/shixuns.ts
|
|
var shixuns = __webpack_require__(56088);
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
;// CONCATENATED MODULE: ./src/components/ReuseShixunModal/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["isImportMultipleCourse"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var StudentInfo = function StudentInfo(_ref) {
|
|
var studentNames = _ref.studentNames,
|
|
total = _ref.total;
|
|
var Map = ['', '一', '两', '三'];
|
|
return total > 3 ? /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: ["\u8BFE\u5802\u5185\u6709", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: ReuseShixunModalmodules.orangeColor,
|
|
children: studentNames === null || studentNames === void 0 ? void 0 : studentNames.join('、')
|
|
}), "\u7B49", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: ReuseShixunModalmodules.orangeColor,
|
|
children: total
|
|
}), "\u540D\u5B66\u751F"]
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: ["\u8BFE\u5802\u5185\u6709", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: ReuseShixunModalmodules.orangeColor,
|
|
children: studentNames === null || studentNames === void 0 ? void 0 : studentNames.join('、')
|
|
}), Map[total], "\u540D\u5B66\u751F"]
|
|
});
|
|
};
|
|
|
|
//根据使用场景区分文案
|
|
var generateBrief = function generateBrief(_ref2) {
|
|
var used = _ref2.used,
|
|
copy = _ref2.copy,
|
|
canNotCopy = _ref2.canNotCopy,
|
|
studentNames = _ref2.studentNames,
|
|
studentCount = _ref2.studentCount,
|
|
inPaper = _ref2.inPaper,
|
|
_ref2$position = _ref2.position,
|
|
position = _ref2$position === void 0 ? '' : _ref2$position;
|
|
var copyStatusDescribe = function copyStatusDescribe() {
|
|
if (copy > 0 && canNotCopy > 0) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: ["\u5176\u4E2D", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: ReuseShixunModalmodules.orangeColor,
|
|
children: copy
|
|
}), "\u4E2A\u9879\u76EE\u652F\u6301\u590D\u5236\uFF0C", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: ReuseShixunModalmodules.orangeColor,
|
|
children: canNotCopy
|
|
}), "\u4E2A\u9879\u76EE\u4E0D\u652F\u6301\u590D\u5236"]
|
|
});
|
|
} else if (copy > 0 && canNotCopy === 0) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: ["\u5176\u4E2D", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: ReuseShixunModalmodules.orangeColor,
|
|
children: copy
|
|
}), "\u4E2A\u9879\u76EE\u652F\u6301\u590D\u5236"]
|
|
});
|
|
} else if (copy === 0 && canNotCopy > 0) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: ["\u5176\u4E2D", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: ReuseShixunModalmodules.orangeColor,
|
|
children: canNotCopy
|
|
}), "\u4E2A\u9879\u76EE\u4E0D\u652F\u6301\u590D\u5236"]
|
|
});
|
|
}
|
|
};
|
|
var currentPosition = position || (inPaper ? '试卷' : '课程');
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(StudentInfo, {
|
|
studentNames: studentNames,
|
|
total: studentCount
|
|
}), "\u5B66\u4E60\u8FC7", currentPosition, "\u4E2D\u7684", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: ReuseShixunModalmodules.orangeColor,
|
|
children: used
|
|
}), "\u4E2A\u9879\u76EE\uFF0C", copyStatusDescribe(), "\u3002\u8BF7\u9009\u62E9\u662F\u5426\u7EE7\u7EED\u4F7F\u7528\u548C\u662F\u5426\u590D\u5236\u4E3A\u65B0\u9879\u76EE\u53D1\u9001\u81F3\u8BFE\u5802\u4E2D\uFF1F"]
|
|
});
|
|
};
|
|
|
|
//单个实训时的情况
|
|
var ReuseSingleShixunModal = function ReuseSingleShixunModal(_ref3) {
|
|
var onCancel = _ref3.onCancel,
|
|
onOk = _ref3.onOk,
|
|
visible = _ref3.visible,
|
|
inPaper = _ref3.inPaper,
|
|
renderData = _ref3.renderData,
|
|
type = _ref3.type,
|
|
_ref3$isMultipleCours = _ref3.isMultipleCourse,
|
|
isMultipleCourse = _ref3$isMultipleCours === void 0 ? false : _ref3$isMultipleCours;
|
|
var _Form$useForm = es_form/* default.useForm */.Z.useForm(),
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
form = _Form$useForm2[0];
|
|
var _useState = (0,react.useState)(1),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
radioValue = _useState2[0],
|
|
setRadioValue = _useState2[1];
|
|
var _useState3 = (0,react.useState)(false),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
confirmLoading = _useState4[0],
|
|
setConfirmLoading = _useState4[1];
|
|
var canCopy = (0,react.useMemo)(function () {
|
|
return (renderData === null || renderData === void 0 ? void 0 : renderData.total_num) === 1 && (renderData === null || renderData === void 0 ? void 0 : renderData.can_copy_num) === 1;
|
|
}, [renderData]);
|
|
var courseDataList = (0,react.useMemo)(function () {
|
|
var _renderData$course_da;
|
|
return renderData === null || renderData === void 0 ? void 0 : (_renderData$course_da = renderData.course_data_list) === null || _renderData$course_da === void 0 ? void 0 : _renderData$course_da.filter(function (e) {
|
|
return e.is_show;
|
|
});
|
|
}, [renderData]);
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
children: canCopy ? /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
|
|
centered: true,
|
|
closable: true,
|
|
open: visible,
|
|
destroyOnClose: true,
|
|
title: "\u63D0\u793A",
|
|
className: ReuseShixunModalmodules.antdModal,
|
|
width: 682,
|
|
confirmLoading: confirmLoading,
|
|
onCancel: onCancel,
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
var data, _renderData$course_da2, param;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
setConfirmLoading(true);
|
|
data = radioValue;
|
|
if (isMultipleCourse) {
|
|
param = objectSpread2_default()({}, form.getFieldsValue());
|
|
data = renderData === null || renderData === void 0 ? void 0 : (_renderData$course_da2 = renderData.course_data_list) === null || _renderData$course_da2 === void 0 ? void 0 : _renderData$course_da2.map(function (e) {
|
|
if (param[e.id] !== undefined) {
|
|
return objectSpread2_default()(objectSpread2_default()({}, e), {}, {
|
|
is_copy: param[e.id]
|
|
});
|
|
}
|
|
return e;
|
|
});
|
|
}
|
|
_context.next = 5;
|
|
return onOk(data);
|
|
case 5:
|
|
setConfirmLoading(false);
|
|
case 6:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
})),
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: ReuseShixunModalmodules.content,
|
|
style: {
|
|
marginBottom: 20
|
|
},
|
|
children: isMultipleCourse ? '检测到以下课堂已在教学课堂中使用,请问是否复制成新的实训发送至教学课堂中?' : /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(StudentInfo, {
|
|
studentNames: renderData === null || renderData === void 0 ? void 0 : renderData.student_names,
|
|
total: renderData === null || renderData === void 0 ? void 0 : renderData.student_count
|
|
}), "\u5B66\u4E60\u8FC7\u8BE5\u5B9E\u8DF5\u9879\u76EE\u3002\u8BE5\u9879\u76EE\u652F\u6301\u590D\u5236\uFF0C\u8BF7\u9009\u62E9\u662F\u5426\u5C06\u8BE5\u9879\u76EE\u590D\u5236\u4E3A\u65B0\u9879\u76EE\u53D1\u9001\u81F3\u8BFE\u5802\u4E2D\uFF1F"]
|
|
})
|
|
}), isMultipleCourse ? /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z, {
|
|
form: form,
|
|
preserve: false,
|
|
children: courseDataList === null || courseDataList === void 0 ? void 0 : courseDataList.map(function (item) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("h3", {
|
|
className: "ml15 mb5",
|
|
children: item.name
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: item.id,
|
|
initialValue: 1,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
className: ReuseShixunModalmodules.content,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 1,
|
|
style: {
|
|
color: '#464f66'
|
|
},
|
|
children: "\u590D\u5236\u5B9E\u8BAD"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 0,
|
|
style: {
|
|
color: '#464f66'
|
|
},
|
|
children: "\u4E0D\u590D\u5236\u5B9E\u8BAD"
|
|
})]
|
|
})
|
|
})]
|
|
}, item.id);
|
|
})
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
value: radioValue,
|
|
onChange: function onChange(e) {
|
|
return setRadioValue(e.target.value);
|
|
},
|
|
className: ReuseShixunModalmodules.content,
|
|
style: {
|
|
marginBottom: 30
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 1,
|
|
style: {
|
|
color: '#464f66'
|
|
},
|
|
children: "\u590D\u5236"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 0,
|
|
style: {
|
|
color: '#464f66'
|
|
},
|
|
children: "\u4E0D\u590D\u5236"
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: ReuseShixunModalmodules.content,
|
|
style: {
|
|
marginBottom: 10
|
|
},
|
|
children: "* \u8BF4\u660E\uFF1A"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: ReuseShixunModalmodules.content,
|
|
style: {
|
|
marginBottom: 20
|
|
},
|
|
children: "1\u3001\u590D\u5236\uFF0C\u7CFB\u7EDF\u5C06\u590D\u5236\u5E76\u521B\u5EFA\u65B0\u7684\u9879\u76EE\u53D1\u9001\u5230\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u65B0\u7684\u9879\u76EE\u652F\u6301\u8FDB\u884C\u4E8C\u6B21\u7F16\u8F91\uFF0C\u7F16\u8F91\u7684\u5185\u5BB9\u4E0D\u4F1A\u540C\u6B65\u81F3\u539F\u9879\u76EE\u3002"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "".concat(ReuseShixunModalmodules.content, " ").concat(ReuseShixunModalmodules.orangeColor),
|
|
children: "2\u3001\u4E0D\u590D\u5236\uFF0C\u5F53\u524D\u9879\u76EE\u4F1A\u76F4\u63A5\u88AB\u5F15\u7528\u5230\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u5B66\u751F\u8FDB\u5165\u9879\u76EE\u6311\u6218\u65F6\u4F1A\u91CD\u7F6E\u4E4B\u524D\u7684\u6311\u6218\u8BB0\u5F55\u3002"
|
|
})]
|
|
})]
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
centered: true,
|
|
closable: true,
|
|
destroyOnClose: true,
|
|
open: visible,
|
|
confirmLoading: confirmLoading,
|
|
title: "\u63D0\u793A",
|
|
width: 682,
|
|
onCancel: onCancel,
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
var data, _renderData$course_da3, param;
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
setConfirmLoading(true);
|
|
data = 0;
|
|
if (isMultipleCourse) {
|
|
param = objectSpread2_default()({}, form.getFieldsValue());
|
|
data = renderData === null || renderData === void 0 ? void 0 : (_renderData$course_da3 = renderData.course_data_list) === null || _renderData$course_da3 === void 0 ? void 0 : _renderData$course_da3.map(function (e) {
|
|
if (param[e.id] !== undefined) {
|
|
return objectSpread2_default()(objectSpread2_default()({}, e), {}, {
|
|
is_use: param[e.id]
|
|
});
|
|
}
|
|
return e;
|
|
});
|
|
}
|
|
_context2.next = 5;
|
|
return onOk(data);
|
|
case 5:
|
|
setConfirmLoading(false);
|
|
case 6:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
})),
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: ReuseShixunModalmodules.content,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(StudentInfo, {
|
|
studentNames: renderData === null || renderData === void 0 ? void 0 : renderData.student_names,
|
|
total: renderData === null || renderData === void 0 ? void 0 : renderData.student_count
|
|
}), "\u5B66\u4E60\u8FC7\u8BE5\u5B9E\u8DF5\u9879\u76EE\u3002", isMultipleCourse ? /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
form: form,
|
|
preserve: false,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("h3", {
|
|
children: "\u5F53\u524D\u5B9E\u8BAD\u4E0D\u53EF\u590D\u5236\uFF0C\u5DF2\u7ECF\u68C0\u6D4B\u5230\u4EE5\u4E0B\u8BFE\u5802\u5B58\u5728\u8BE5\u5B9E\u8BAD\uFF0C\u540C\u4E00\u5B9E\u8BAD\u5728\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u4E92\u76F8\u5F71\u54CD\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u7EE7\u7EED\u4F7F\u7528"
|
|
}), courseDataList === null || courseDataList === void 0 ? void 0 : courseDataList.map(function (item) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("h3", {
|
|
className: "ml15 mb5",
|
|
children: item.name
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: item.id,
|
|
initialValue: 1,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
className: ReuseShixunModalmodules.content,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 1,
|
|
style: {
|
|
color: '#464f66'
|
|
},
|
|
children: "\u7EE7\u7EED\u4F7F\u7528"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 0,
|
|
style: {
|
|
color: '#464f66'
|
|
},
|
|
children: "\u4E0D\u4F7F\u7528"
|
|
})]
|
|
})
|
|
})]
|
|
}, item.id);
|
|
})]
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: ["\u8BE5\u9879\u76EE\u4E0D\u652F\u6301\u590D\u5236\uFF0C\u82E5\u786E\u8BA4\u7EE7\u7EED\u53D1\u9001\uFF0C", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: ReuseShixunModalmodules.orangeColor,
|
|
children: "\u5F53\u524D\u9879\u76EE\u4F1A\u76F4\u63A5\u88AB\u5F15\u7528\u5230\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u5B66\u751F\u8FDB\u5165\u9879\u76EE\u6311\u6218\u65F6\u4F1A\u91CD\u7F6E\u4E4B\u524D\u7684\u6311\u6218\u8BB0\u5F55"
|
|
}), "\uFF08\u5982\u679C\u4E0D\u60F3\u91CD\u7F6E\u5B66\u751F\u7684\u6311\u6218\u8BB0\u5F55\uFF0C\u5EFA\u8BAE\u53C2\u7167\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5185\u5BB9\u81EA\u884C\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u9879\u76EE\uFF0C\u6216\u8005\u5C1D\u8BD5\u8054\u7CFB\u9879\u76EE\u521B\u5EFA\u4EBA\u5F00\u653E\u672C\u9879\u76EE\u7684\u590D\u5236\u6743\u9650\uFF09\u3002"]
|
|
})]
|
|
})
|
|
})
|
|
});
|
|
};
|
|
var useReuseModal = function useReuseModal() {
|
|
var _useState5 = (0,react.useState)(false),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
modalVisible = _useState6[0],
|
|
setModalVisible = _useState6[1];
|
|
var _useState7 = (0,react.useState)(),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
renderData = _useState8[0],
|
|
setRenderData = _useState8[1];
|
|
var closeModalFn = function closeModalFn() {
|
|
return setModalVisible(false);
|
|
};
|
|
var showModal = /*#__PURE__*/function () {
|
|
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(reqParams) {
|
|
var _reqParams$isImportMu, isImportMultipleCourse, param, res, _res$course_data_list, isModalVisible;
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
case 0:
|
|
_reqParams$isImportMu = reqParams.isImportMultipleCourse, isImportMultipleCourse = _reqParams$isImportMu === void 0 ? false : _reqParams$isImportMu, param = objectWithoutProperties_default()(reqParams, _excluded);
|
|
_context3.next = 3;
|
|
return (0,shixuns/* checkShixunCopy */.Tr)(param);
|
|
case 3:
|
|
res = _context3.sent;
|
|
if (!('status' in res)) {
|
|
_context3.next = 6;
|
|
break;
|
|
}
|
|
return _context3.abrupt("return", false);
|
|
case 6:
|
|
if (!isImportMultipleCourse) {
|
|
_context3.next = 13;
|
|
break;
|
|
}
|
|
isModalVisible = res === null || res === void 0 ? void 0 : (_res$course_data_list = res.course_data_list) === null || _res$course_data_list === void 0 ? void 0 : _res$course_data_list.some(function (e) {
|
|
return e.is_show;
|
|
});
|
|
if (!isModalVisible) {
|
|
_context3.next = 12;
|
|
break;
|
|
}
|
|
setRenderData(res);
|
|
setModalVisible(true);
|
|
return _context3.abrupt("return", true);
|
|
case 12:
|
|
return _context3.abrupt("return", res.course_data_list || []);
|
|
case 13:
|
|
if (!(res.student_count === 0)) {
|
|
_context3.next = 15;
|
|
break;
|
|
}
|
|
return _context3.abrupt("return", false);
|
|
case 15:
|
|
setRenderData(res);
|
|
setModalVisible(true);
|
|
return _context3.abrupt("return", true);
|
|
case 18:
|
|
case "end":
|
|
return _context3.stop();
|
|
}
|
|
}, _callee3);
|
|
}));
|
|
return function showModal(_x) {
|
|
return _ref6.apply(this, arguments);
|
|
};
|
|
}();
|
|
return [modalVisible, closeModalFn, renderData, showModal];
|
|
};
|
|
|
|
//多个实训时的情况
|
|
var ReuseMultipleShixunModal = function ReuseMultipleShixunModal(props) {
|
|
var _Form$useForm3 = es_form/* default.useForm */.Z.useForm(),
|
|
_Form$useForm4 = slicedToArray_default()(_Form$useForm3, 1),
|
|
form = _Form$useForm4[0];
|
|
var _useState9 = (0,react.useState)(false),
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
confirmLoading = _useState10[0],
|
|
setConfirmLoading = _useState10[1];
|
|
var onCancel = props.onCancel,
|
|
onOk = props.onOk,
|
|
visible = props.visible,
|
|
_props$inPaper = props.inPaper,
|
|
inPaper = _props$inPaper === void 0 ? false : _props$inPaper,
|
|
renderData = props.renderData,
|
|
type = props.type,
|
|
_props$isMultipleCour = props.isMultipleCourse,
|
|
isMultipleCourse = _props$isMultipleCour === void 0 ? false : _props$isMultipleCour,
|
|
position = props.position;
|
|
var reproducibleShixunColumns = (0,react.useMemo)(function () {
|
|
return inPaper ? [{
|
|
title: '实践项目名称',
|
|
dataIndex: 'name',
|
|
width: 424,
|
|
align: 'center',
|
|
ellipsis: true,
|
|
className: ReuseShixunModalmodules.tableCell,
|
|
render: function render(text, record) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
href: "/shixuns/".concat(record.identifier, "/challenges"),
|
|
target: "_blank",
|
|
children: text
|
|
});
|
|
}
|
|
}, {
|
|
title: '是否复制',
|
|
dataIndex: 'is_copy',
|
|
align: 'center',
|
|
render: function render(value, record) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: ["".concat(type === 'subject' ? record.stage_shixun_id : record.shixun_course_id || record.id), 'is_copy'],
|
|
initialValue: 1,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 1,
|
|
children: "\u662F"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 0,
|
|
children: "\u5426"
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: ["".concat(type === 'subject' ? record === null || record === void 0 ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id), 'is_use'],
|
|
hidden: true,
|
|
initialValue: 1,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
type: "hidden"
|
|
})
|
|
})]
|
|
});
|
|
}
|
|
}] : [{
|
|
title: '实践项目名称',
|
|
dataIndex: 'name',
|
|
width: 424,
|
|
align: 'center',
|
|
ellipsis: true,
|
|
className: ReuseShixunModalmodules.tableCell,
|
|
render: function render(text, record) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
href: "/shixuns/".concat(record.identifier, "/challenges"),
|
|
target: "_blank",
|
|
children: text
|
|
});
|
|
}
|
|
}, {
|
|
title: '是否使用',
|
|
dataIndex: 'is_use',
|
|
align: 'center',
|
|
render: function render(value, record) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: ["".concat(type === 'subject' ? record.stage_shixun_id : record.shixun_course_id || record.id), 'is_use'],
|
|
initialValue: 1,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 1,
|
|
children: "\u662F"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 0,
|
|
children: "\u5426"
|
|
})]
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: '是否复制',
|
|
dataIndex: 'is_copy',
|
|
align: 'center',
|
|
render: function render(value, record) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: ["".concat(type === 'subject' ? record.stage_shixun_id : record.shixun_course_id || record.id), 'is_copy'],
|
|
initialValue: 1,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 1,
|
|
children: "\u662F"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 0,
|
|
children: "\u5426"
|
|
})]
|
|
})
|
|
});
|
|
}
|
|
}];
|
|
}, [inPaper]);
|
|
var irreproducibleShixunColumns = (0,react.useMemo)(function () {
|
|
return inPaper ? [{
|
|
title: '实践项目名称',
|
|
dataIndex: 'name',
|
|
width: 424,
|
|
className: ReuseShixunModalmodules.tableCell,
|
|
align: 'center',
|
|
ellipsis: true,
|
|
render: function render(value, record) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
href: "/shixuns/".concat(record.identifier, "/challenges"),
|
|
target: "_blank",
|
|
children: value
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: ["".concat(type === 'subject' ? record === null || record === void 0 ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id), 'is_copy'],
|
|
hidden: true,
|
|
initialValue: 0,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
type: "hidden"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: ["".concat(type === 'subject' ? record === null || record === void 0 ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id), 'is_use'],
|
|
hidden: true,
|
|
initialValue: 1,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
type: "hidden"
|
|
})
|
|
})]
|
|
});
|
|
}
|
|
}] : [{
|
|
title: '实践项目名称',
|
|
dataIndex: 'name',
|
|
width: 424,
|
|
className: ReuseShixunModalmodules.tableCell,
|
|
ellipsis: true,
|
|
align: 'center',
|
|
render: function render(text, record) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
href: "/shixuns/".concat(record.identifier, "/challenges"),
|
|
target: "_blank",
|
|
children: text
|
|
});
|
|
}
|
|
}, {
|
|
title: '是否使用',
|
|
dataIndex: 'is_use',
|
|
align: 'center',
|
|
render: function render(value, record) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: ["".concat(type === 'subject' ? record === null || record === void 0 ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id), 'is_use'],
|
|
initialValue: 0,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 1,
|
|
children: "\u662F"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 0,
|
|
children: "\u5426"
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: ["".concat(type === 'subject' ? record === null || record === void 0 ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id), 'is_copy'],
|
|
hidden: true,
|
|
initialValue: 0,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
type: "hidden"
|
|
})
|
|
})]
|
|
});
|
|
}
|
|
}];
|
|
}, [inPaper]);
|
|
|
|
//可以选择多个课堂的时候
|
|
if (isMultipleCourse) {
|
|
var param = {
|
|
title: '课堂名称',
|
|
ellipsis: true,
|
|
dataIndex: 'course_name',
|
|
width: 190,
|
|
align: 'center',
|
|
className: ReuseShixunModalmodules.tableCell,
|
|
render: function render(text, record) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
href: "/classrooms/".concat(record.course_id),
|
|
children: text
|
|
});
|
|
}
|
|
};
|
|
reproducibleShixunColumns = [param].concat(toConsumableArray_default()(reproducibleShixunColumns));
|
|
irreproducibleShixunColumns = [param].concat(toConsumableArray_default()(irreproducibleShixunColumns));
|
|
}
|
|
var dynamicBrief = (0,react.useMemo)(function () {
|
|
return generateBrief({
|
|
used: renderData === null || renderData === void 0 ? void 0 : renderData.repeat_shixun_num,
|
|
copy: renderData === null || renderData === void 0 ? void 0 : renderData.can_copy_num,
|
|
canNotCopy: renderData === null || renderData === void 0 ? void 0 : renderData.no_copy_num,
|
|
studentNames: renderData === null || renderData === void 0 ? void 0 : renderData.student_names,
|
|
studentCount: renderData === null || renderData === void 0 ? void 0 : renderData.student_count,
|
|
inPaper: inPaper,
|
|
position: position
|
|
});
|
|
}, [renderData, inPaper, position]);
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
title: "\u63D0\u793A",
|
|
centered: true,
|
|
open: visible,
|
|
confirmLoading: confirmLoading,
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
var formValues, ids;
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
case 0:
|
|
setConfirmLoading(true);
|
|
formValues = form.getFieldsValue();
|
|
ids = Object.keys(formValues).map(function (key) {
|
|
return {
|
|
id: parseInt(key.split('_')[0]),
|
|
course_id: parseInt(key.split('_')[1]),
|
|
is_use: formValues[key].is_use,
|
|
is_copy: formValues[key].is_copy
|
|
};
|
|
});
|
|
_context4.next = 5;
|
|
return onOk(ids);
|
|
case 5:
|
|
setConfirmLoading(false);
|
|
case 6:
|
|
case "end":
|
|
return _context4.stop();
|
|
}
|
|
}, _callee4);
|
|
})),
|
|
onCancel: onCancel,
|
|
width: 880,
|
|
okText: "\u786E\u8BA4",
|
|
className: ReuseShixunModalmodules.antdModal,
|
|
destroyOnClose: true,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
form: form,
|
|
preserve: false,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: ReuseShixunModalmodules.brief,
|
|
children: dynamicBrief
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
marginBottom: 30
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
marginBottom: 20
|
|
},
|
|
children: "* \u8BF4\u660E"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
marginBottom: 20
|
|
},
|
|
children: "1\u3001\u590D\u5236\uFF0C\u7CFB\u7EDF\u5C06\u590D\u5236\u5E76\u521B\u5EFA\u65B0\u7684\u9879\u76EE\u53D1\u9001\u5230\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u65B0\u7684\u9879\u76EE\u652F\u6301\u8FDB\u884C\u4E8C\u6B21\u7F16\u8F91\uFF0C\u7F16\u8F91\u7684\u5185\u5BB9\u4E0D\u4F1A\u540C\u6B65\u81F3\u539F\u9879\u76EE\u3002"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: ReuseShixunModalmodules.orangeColor,
|
|
children: "2\u3001\u4E0D\u590D\u5236\uFF0C\u5F53\u524D\u9879\u76EE\u4F1A\u76F4\u63A5\u88AB\u5F15\u7528\u5230\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u5B66\u751F\u8FDB\u5165\u9879\u76EE\u6311\u6218\u65F6\u4F1A\u91CD\u7F6E\u4E4B\u524D\u7684\u6311\u6218\u8BB0\u5F55\u3002"
|
|
})]
|
|
}), (renderData === null || renderData === void 0 ? void 0 : renderData.can_copy_num) > 0 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: ReuseShixunModalmodules.contentTitle,
|
|
children: "\u652F\u6301\u590D\u5236\u7684\u9879\u76EE"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
columns: reproducibleShixunColumns,
|
|
className: ReuseShixunModalmodules.antdTable,
|
|
dataSource: renderData === null || renderData === void 0 ? void 0 : renderData.can_copy_list,
|
|
rowKey: type === 'subject' ? "stage_shixun_id" : 'id',
|
|
pagination: false,
|
|
scroll: {
|
|
y: 240
|
|
},
|
|
bordered: true
|
|
})]
|
|
}), (renderData === null || renderData === void 0 ? void 0 : renderData.no_copy_num) > 0 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: ReuseShixunModalmodules.contentTitle,
|
|
children: "\u4E0D\u652F\u6301\u590D\u5236\u7684\u9879\u76EE"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
columns: irreproducibleShixunColumns,
|
|
className: ReuseShixunModalmodules.antdTable,
|
|
dataSource: renderData === null || renderData === void 0 ? void 0 : renderData.no_copy_list,
|
|
rowKey: type === 'subject' ? "stage_shixun_id" : 'id',
|
|
pagination: false,
|
|
scroll: {
|
|
y: 200
|
|
},
|
|
bordered: true
|
|
})]
|
|
}), (renderData === null || renderData === void 0 ? void 0 : renderData.no_use_list.length) > 0 && (renderData === null || renderData === void 0 ? void 0 : renderData.no_use_list.map(function (record) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: ["".concat(type === 'subject' ? record === null || record === void 0 ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id), 'is_copy'],
|
|
hidden: true,
|
|
initialValue: 0,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
type: "hidden"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: ["".concat(type === 'subject' ? record === null || record === void 0 ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id), 'is_use'],
|
|
hidden: true,
|
|
initialValue: 1,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
type: "hidden"
|
|
})
|
|
})]
|
|
}, type === 'subject' ? record.stage_shixun_id : record.shixun_course_id || record.id);
|
|
}))]
|
|
})
|
|
});
|
|
};
|
|
var ReuseShixunModal = function ReuseShixunModal(props) {
|
|
var modalType = props.modalType;
|
|
return modalType === 'multiple' ? /*#__PURE__*/(0,jsx_runtime.jsx)(ReuseMultipleShixunModal, objectSpread2_default()({}, props)) : /*#__PURE__*/(0,jsx_runtime.jsx)(ReuseSingleShixunModal, objectSpread2_default()({}, props));
|
|
};
|
|
/* harmony default export */ var components_ReuseShixunModal = (ReuseShixunModal);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 41850:
|
|
/*!*************************************************************************************************!*\
|
|
!*** ./src/pages/Classrooms/Lists/Exercise/Edit/components/DragQuestions/index.tsx + 1 modules ***!
|
|
\*************************************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ components_DragQuestions; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/modal/style/index.js + 1 modules
|
|
var style = __webpack_require__(35611);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/modal/index.js + 7 modules
|
|
var modal = __webpack_require__(85402);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(42122);
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/row/style/index.js
|
|
var row_style = __webpack_require__(13062);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/row/index.js
|
|
var row = __webpack_require__(71230);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/col/style/index.js
|
|
var col_style = __webpack_require__(89032);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/col/index.js
|
|
var col = __webpack_require__(15746);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/style/index.js + 1 modules
|
|
var button_style = __webpack_require__(29913);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
|
|
var es_button = __webpack_require__(71577);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/toConsumableArray.js
|
|
var toConsumableArray = __webpack_require__(861);
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(27424);
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
// EXTERNAL MODULE: ./node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.esm.js + 27 modules
|
|
var react_beautiful_dnd_esm = __webpack_require__(66012);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
|
|
var _umi_production_exports = __webpack_require__(89214);
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Edit/components/DragQuestions/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var DragQuestionsmodules = ({"content":"content___IPcn9"});
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Edit/components/DragQuestions/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var DragQuestions = function DragQuestions(_ref) {
|
|
var visible = _ref.visible,
|
|
onOk = _ref.onOk,
|
|
onCancel = _ref.onCancel,
|
|
data = _ref.data;
|
|
var _useState = (0,react.useState)([]),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
list = _useState2[0],
|
|
setList = _useState2[1];
|
|
var _useState3 = (0,react.useState)(false),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
loading = _useState4[0],
|
|
setLoading = _useState4[1];
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
(0,react.useEffect)(function () {
|
|
if (!visible) {
|
|
setList([]);
|
|
setLoading(false);
|
|
return;
|
|
}
|
|
setList(toConsumableArray_default()(data) || []);
|
|
}, [visible]);
|
|
var handleOk = function handleOk() {
|
|
setLoading(true);
|
|
onOk(list, function () {
|
|
setLoading(false);
|
|
});
|
|
};
|
|
var handleCancel = function handleCancel() {
|
|
onCancel();
|
|
};
|
|
|
|
//过滤函数
|
|
var reorder = function reorder(list, startIndex, endIndex) {
|
|
var result = Array.from(list);
|
|
var _result$splice = result.splice(startIndex, 1),
|
|
_result$splice2 = slicedToArray_default()(_result$splice, 1),
|
|
removed = _result$splice2[0];
|
|
result.splice(endIndex, 0, removed);
|
|
return result;
|
|
};
|
|
var handleDragEnd = function handleDragEnd(result, list) {
|
|
if (!result.destination) {
|
|
return;
|
|
}
|
|
var items = reorder(list, result.source.index, result.destination.index);
|
|
setList(items);
|
|
};
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
title: "\u9898\u578B\u6392\u5E8F",
|
|
open: visible,
|
|
centered: true,
|
|
onCancel: handleCancel,
|
|
footer: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
"float": 'left',
|
|
color: '#999',
|
|
paddingTop: 5
|
|
},
|
|
children: "\u63D0\u793A:\u53EF\u5BF9\u9898\u578B\u8FDB\u884C\u4E0A\u4E0B\u62D6\u52A8\u6392\u5E8F"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
onClick: handleCancel,
|
|
children: "\u53D6\u6D88"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
type: "primary",
|
|
loading: loading,
|
|
onClick: handleOk,
|
|
children: "\u786E\u8BA4"
|
|
})]
|
|
}),
|
|
width: "680px",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: DragQuestionsmodules.content,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
span: 12,
|
|
children: "\u5E8F\u53F7"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
span: 12,
|
|
children: "\u9898\u578B\u540D\u79F0"
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(react_beautiful_dnd_esm/* DragDropContext */.Z5, {
|
|
onDragEnd: function onDragEnd(result) {
|
|
return handleDragEnd(result, list);
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(react_beautiful_dnd_esm/* Droppable */.bK, {
|
|
droppableId: "droppable",
|
|
children: function children(provided, snapshot) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", objectSpread2_default()(objectSpread2_default()({
|
|
ref: provided.innerRef
|
|
}, provided.droppableProps), {}, {
|
|
style: {
|
|
width: '100%'
|
|
},
|
|
children: list.map(function (item, k) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(react_beautiful_dnd_esm/* Draggable */._l, {
|
|
draggableId: k.toString(),
|
|
index: k,
|
|
children: function children(provided, snapshot) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("aside", objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({
|
|
ref: provided.innerRef
|
|
}, provided.draggableProps), provided.dragHandleProps), {}, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
style: {
|
|
backgroundColor: k % 2 === 0 ? '#f5f5f5' : '#fff'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
span: 12,
|
|
children: k + 1
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
span: 12,
|
|
children: item
|
|
})]
|
|
})
|
|
})
|
|
}));
|
|
}
|
|
}, k);
|
|
})
|
|
}));
|
|
}
|
|
})
|
|
})]
|
|
})
|
|
});
|
|
};
|
|
/* harmony default export */ var components_DragQuestions = (DragQuestions);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 82278:
|
|
/*!***************************************************************************************************!*\
|
|
!*** ./src/pages/Classrooms/Lists/Exercise/Edit/components/UploadQuestions/index.tsx + 1 modules ***!
|
|
\***************************************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ components_UploadQuestions; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/modal/style/index.js + 1 modules
|
|
var style = __webpack_require__(35611);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/modal/index.js + 7 modules
|
|
var modal = __webpack_require__(85402);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/upload/style/index.js + 1 modules
|
|
var upload_style = __webpack_require__(13759);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/upload/index.js + 20 modules
|
|
var upload = __webpack_require__(7426);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/style/index.js + 1 modules
|
|
var button_style = __webpack_require__(29913);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
|
|
var es_button = __webpack_require__(71577);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(27424);
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/PlusOutlined.js
|
|
var PlusOutlined = __webpack_require__(51042);
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(59758);
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(29427);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
|
|
var _umi_production_exports = __webpack_require__(89214);
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Edit/components/UploadQuestions/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var UploadQuestionsmodules = ({"customModal":"customModal___bVzUV","content":"content___oKhZq","upload":"upload___nPxEL"});
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Edit/components/UploadQuestions/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var UploadQuestions = function UploadQuestions(_ref) {
|
|
var visible = _ref.visible,
|
|
onOk = _ref.onOk,
|
|
onCancel = _ref.onCancel;
|
|
var _useState = (0,react.useState)([]),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
fileList = _useState2[0],
|
|
setFileList = _useState2[1];
|
|
var _useState3 = (0,react.useState)(false),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
loading = _useState4[0],
|
|
setLoading = _useState4[1];
|
|
// const fileList = useRef<any>([])
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
(0,react.useEffect)(function () {
|
|
if (!visible) {
|
|
setFileList([]);
|
|
setLoading(false);
|
|
}
|
|
}, [visible]);
|
|
var handleOk = function handleOk() {
|
|
setLoading(true);
|
|
onOk(fileList, function () {
|
|
setLoading(false);
|
|
});
|
|
};
|
|
var handleCancel = function handleCancel() {
|
|
onCancel();
|
|
};
|
|
// const handleChange = (info: any) => {
|
|
// const newFileList = info?.fileList || [];
|
|
// if (newFileList.every((item: any) => item.status !== 'uploading')) {
|
|
// setLoading(false)
|
|
// } else {
|
|
// setLoading(true)
|
|
// }
|
|
// fileList.current = newFileList
|
|
// }
|
|
|
|
var down = function down() {
|
|
console.log(params, 444);
|
|
var url = "".concat(env/* default.API_SERVER */.Z.API_SERVER, "/api/courses/").concat(params.coursesId, "/exercises/down_template");
|
|
(0,util/* downLoadLink */.Nd)(null, url);
|
|
};
|
|
var handleBeforeUpload = function handleBeforeUpload(info) {
|
|
var param = {
|
|
name: info.name,
|
|
uid: info.uid,
|
|
file: info
|
|
};
|
|
setFileList([param]);
|
|
return false;
|
|
};
|
|
var handleRemove = function handleRemove() {
|
|
setFileList([]);
|
|
};
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
title: "\u6279\u91CF\u5BFC\u5165\u8BD5\u9898",
|
|
open: visible,
|
|
onOk: handleOk,
|
|
centered: true,
|
|
wrapClassName: UploadQuestionsmodules.customModal,
|
|
onCancel: handleCancel,
|
|
width: "680px",
|
|
okText: "\u786E\u8BA4",
|
|
cancelText: "\u53D6\u6D88",
|
|
confirmLoading: loading,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: UploadQuestionsmodules.content,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: "\u6B65\u9AA41\uFF1A"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
children: ["\u4E0B\u8F7D\xA0", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: "#0152d9",
|
|
cursor: 'pointer'
|
|
},
|
|
onClick: down,
|
|
children: "\u8003\u8BD5\u8BD5\u9898\u6A21\u677F"
|
|
}), ",\xA0\u6279\u91CF\u5BFC\u5165\u8BD5\u9898\u3002"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
className: "c-grey-999 mt10",
|
|
children: "\u6CE8\uFF1A\u76EE\u524D\u4EC5\u652F\u6301Excel\u683C\u5F0F\u6A21\u677F\uFF0C\u6BCF\u6B21\u6700\u591A\u5BFC\u5165300\u9898\u3002\u4E0D\u652F\u6301\u7F16\u7A0B\u9898\u548C\u5B9E\u8BAD\u9898\u5BFC\u5165"
|
|
})]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
className: "mt30",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: "\u6B65\u9AA42\uFF1A"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
|
|
style: {
|
|
flex: 1
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
children: "\u4E0A\u4F20\u586B\u5199\u597D\u7684\u8BD5\u9898\u8868"
|
|
}), visible && /*#__PURE__*/(0,jsx_runtime.jsx)(upload/* default */.Z, {
|
|
action: "".concat(env/* default.API_SERVER */.Z.API_SERVER, "/api/attachments.json")
|
|
// onChange={handleChange}
|
|
,
|
|
beforeUpload: handleBeforeUpload,
|
|
onRemove: handleRemove,
|
|
withCredentials: true,
|
|
fileList: fileList,
|
|
accept: ".xls,.xlsx",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
className: UploadQuestionsmodules.upload,
|
|
type: "primary",
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)(PlusOutlined/* default */.Z, {}),
|
|
children: "\u9009\u62E9\u6587\u4EF6"
|
|
})
|
|
})]
|
|
})]
|
|
})]
|
|
})
|
|
});
|
|
};
|
|
/* harmony default export */ var components_UploadQuestions = (UploadQuestions);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 99542:
|
|
/*!************************************************************************!*\
|
|
!*** ./src/pages/Classrooms/Lists/Exercise/Edit/index.tsx + 5 modules ***!
|
|
\************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
// ESM COMPAT FLAG
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"default": function() { return /* binding */ Edit; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/spin/style/index.js + 1 modules
|
|
var style = __webpack_require__(22536);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/spin/index.js
|
|
var spin = __webpack_require__(11382);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/style/index.js + 1 modules
|
|
var button_style = __webpack_require__(29913);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
|
|
var es_button = __webpack_require__(71577);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/radio/style/index.js + 1 modules
|
|
var radio_style = __webpack_require__(83822);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/radio/index.js + 4 modules
|
|
var es_radio = __webpack_require__(29924);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input-number/style/index.js + 1 modules
|
|
var input_number_style = __webpack_require__(25359);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input-number/index.js + 9 modules
|
|
var input_number = __webpack_require__(87799);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/style/index.js + 1 modules
|
|
var input_style = __webpack_require__(69463);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/index.js + 5 modules
|
|
var input = __webpack_require__(75008);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/cascader/style/index.js + 1 modules
|
|
var cascader_style = __webpack_require__(95847);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/cascader/index.js + 17 modules
|
|
var cascader = __webpack_require__(45239);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/row/style/index.js
|
|
var row_style = __webpack_require__(13062);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/row/index.js
|
|
var row = __webpack_require__(71230);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/col/style/index.js
|
|
var col_style = __webpack_require__(89032);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/col/index.js
|
|
var col = __webpack_require__(15746);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/breadcrumb/style/index.js + 1 modules
|
|
var breadcrumb_style = __webpack_require__(63102);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/breadcrumb/index.js + 3 modules
|
|
var breadcrumb = __webpack_require__(58492);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/message/style/index.js + 1 modules
|
|
var message_style = __webpack_require__(14934);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/message/index.js + 1 modules
|
|
var message = __webpack_require__(12461);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(42122);
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js
|
|
var regeneratorRuntime = __webpack_require__(17061);
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
|
|
var asyncToGenerator = __webpack_require__(17156);
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/toConsumableArray.js
|
|
var toConsumableArray = __webpack_require__(861);
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/style/index.js + 1 modules
|
|
var form_style = __webpack_require__(75627);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/index.js + 17 modules
|
|
var es_form = __webpack_require__(51018);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(27424);
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
|
|
var _umi_production_exports = __webpack_require__(89214);
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
var fetch = __webpack_require__(84519);
|
|
// EXTERNAL MODULE: ./node_modules/lodash/lodash.js
|
|
var lodash = __webpack_require__(96486);
|
|
// EXTERNAL MODULE: ./src/service/exercise.ts
|
|
var service_exercise = __webpack_require__(51412);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/drawer/style/index.js + 1 modules
|
|
var drawer_style = __webpack_require__(11400);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/drawer/index.js + 6 modules
|
|
var drawer = __webpack_require__(63463);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/pagination/style/index.js + 1 modules
|
|
var pagination_style = __webpack_require__(14182);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/pagination/index.js + 10 modules
|
|
var pagination = __webpack_require__(260);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/divider/style/index.js + 1 modules
|
|
var divider_style = __webpack_require__(98541);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/divider/index.js
|
|
var divider = __webpack_require__(27049);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/tooltip/style/index.js + 1 modules
|
|
var tooltip_style = __webpack_require__(38390);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/tooltip/index.js + 3 modules
|
|
var tooltip = __webpack_require__(84908);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/checkbox/style/index.js + 1 modules
|
|
var checkbox_style = __webpack_require__(82000);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/checkbox/index.js + 2 modules
|
|
var es_checkbox = __webpack_require__(32808);
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
var authority = __webpack_require__(7);
|
|
// EXTERNAL MODULE: ./src/components/FormSearch/index.tsx + 1 modules
|
|
var FormSearch = __webpack_require__(33722);
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Edit/components/SelectShixuns/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var SelectShixunsmodules = ({"flex_box_center":"flex_box_center___MTe00","flex_space_between":"flex_space_between___ks5rN","flex_box_vertical_center":"flex_box_vertical_center___jGHgJ","flex_box_center_end":"flex_box_center_end___FZXA7","flex_box_column":"flex_box_column___tkMdG","wrp":"wrp___JHBdl","drawer":"drawer___hKLNc","menu":"menu___hYC7e","actived":"actived___ydbaU","actived2":"actived2___P8ueW","listItem":"listItem___W5_Tc","info":"info___haUFD","title":"title___WVJko","titleLeft":"titleLeft___E3SlF","titleRight":"titleRight___CYLFw","search":"search___bOdx_","description":"description____rvlb","menuCourse":"menuCourse___nSeps","menut":"menut___DH9qr","actived3":"actived3___jLAMP","actived4":"actived4___ENKg1","subTag":"subTag___vbqKW"});
|
|
// EXTERNAL MODULE: ./src/utils/verifyLogin.tsx + 3 modules
|
|
var verifyLogin = __webpack_require__(72551);
|
|
// EXTERNAL MODULE: ./src/components/ReuseShixunModal/index.tsx + 1 modules
|
|
var ReuseShixunModal = __webpack_require__(60696);
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Edit/components/SelectShixuns/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Search = input/* default.Search */.Z.Search;
|
|
var shixunFilter = [{
|
|
id: 'type',
|
|
name: '来源',
|
|
children: [{
|
|
name: '全部',
|
|
id: 'all',
|
|
type: 'type'
|
|
}, {
|
|
name: '我的',
|
|
id: 'mine',
|
|
type: 'type'
|
|
}]
|
|
}];
|
|
var shixunFulter2 = [{
|
|
id: 'diff',
|
|
name: '难度',
|
|
children: [{
|
|
name: '全部',
|
|
id: '',
|
|
type: 'diff'
|
|
}, {
|
|
name: '初级',
|
|
id: 1,
|
|
type: 'diff'
|
|
}, {
|
|
name: '中级',
|
|
id: 2,
|
|
type: 'diff'
|
|
}, {
|
|
name: '中高级',
|
|
id: 3,
|
|
type: 'diff'
|
|
}, {
|
|
name: '高级',
|
|
id: 4,
|
|
type: 'diff'
|
|
}]
|
|
}];
|
|
var PublishShixun = function PublishShixun(_ref) {
|
|
var _shixunLists$shixun_l2;
|
|
var classroomList = _ref.classroomList,
|
|
shixunsList = _ref.shixunsList,
|
|
pathsList = _ref.pathsList,
|
|
loading = _ref.loading,
|
|
dispatch = _ref.dispatch,
|
|
callback = _ref.callback;
|
|
var _useState = (0,react.useState)(objectSpread2_default()({}, (0,_umi_production_exports.useParams)())),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
params = _useState2[0],
|
|
setParams = _useState2[1];
|
|
var location = (0,_umi_production_exports.useLocation)();
|
|
var actionTabs = classroomList.actionTabs;
|
|
var _Form$useForm = es_form/* default.useForm */.Z.useForm(),
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
form = _Form$useForm2[0];
|
|
var shixunLists = classroomList.shixunLists;
|
|
var _useState3 = (0,react.useState)([]),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
selectArrs = _useState4[0],
|
|
setSelectArrs = _useState4[1];
|
|
var _useState5 = (0,react.useState)([]),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
groupsData = _useState6[0],
|
|
setGroupsData = _useState6[1];
|
|
var _useState7 = (0,react.useState)(''),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
searchValue = _useState8[0],
|
|
setSearchValue = _useState8[1];
|
|
var _useState9 = (0,react.useState)({
|
|
page: 1,
|
|
type: 'all',
|
|
diff: '',
|
|
status: 'published',
|
|
order: 'desc',
|
|
limit: 20,
|
|
sort: 'myshixuns_count',
|
|
no_jupyter: 1,
|
|
keyword: '',
|
|
group_id: null
|
|
}),
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
query = _useState10[0],
|
|
setQuery = _useState10[1];
|
|
(0,react.useEffect)(function () {
|
|
if (classroomList.actionTabs.key === '选用实践项目') {
|
|
document.body.setAttribute('data-custom', 'height');
|
|
} else {
|
|
document.body.removeAttribute('data-custom');
|
|
}
|
|
return function () {
|
|
document.body.removeAttribute('data-custom');
|
|
};
|
|
}, [classroomList.actionTabs.key]);
|
|
var isVisible = classroomList.actionTabs.key === '选用实践项目';
|
|
(0,react.useEffect)(function () {
|
|
if (isVisible) {
|
|
dispatch({
|
|
type: 'classroomList/getShixunLists',
|
|
payload: objectSpread2_default()({}, query)
|
|
});
|
|
}
|
|
}, [params.categoryId, isVisible]);
|
|
(0,react.useEffect)(function () {
|
|
dispatch({
|
|
type: 'shixunsList/getMenus',
|
|
payload: {}
|
|
});
|
|
}, []);
|
|
(0,react.useEffect)(function () {
|
|
setSelectArrs([]);
|
|
}, [classroomList.actionTabs.key]);
|
|
(0,react.useEffect)(function () {
|
|
getData();
|
|
}, [params]);
|
|
var getData = /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
var result;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
_context.next = 2;
|
|
return (0,fetch/* default */.ZP)("/api/users/user_setting_groups.json", {
|
|
method: 'get',
|
|
params: {
|
|
type: 'Shixun'
|
|
}
|
|
});
|
|
case 2:
|
|
result = _context.sent;
|
|
setGroupsData([{
|
|
id: null,
|
|
name: "全部"
|
|
}, {
|
|
id: -1,
|
|
name: "未加入目录"
|
|
}].concat(toConsumableArray_default()((result === null || result === void 0 ? void 0 : result.groups) || [])));
|
|
case 4:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function getData() {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
var _useReuseModal = (0,ReuseShixunModal/* useReuseModal */.P)(),
|
|
_useReuseModal2 = slicedToArray_default()(_useReuseModal, 4),
|
|
reuseModalVisible = _useReuseModal2[0],
|
|
closeReuseModal = _useReuseModal2[1],
|
|
renderData = _useReuseModal2[2],
|
|
showReuseModal = _useReuseModal2[3];
|
|
var menuChange = function menuChange(tag_level, sub_discipline_id, discipline_id) {
|
|
query.tag_level = tag_level;
|
|
query.sub_discipline_id = sub_discipline_id;
|
|
query.discipline_id = discipline_id;
|
|
query.page = 1;
|
|
setQuery(objectSpread2_default()({}, query));
|
|
dispatch({
|
|
type: 'classroomList/getShixunLists',
|
|
payload: objectSpread2_default()({}, query)
|
|
});
|
|
};
|
|
var reuseModalCallback = /*#__PURE__*/function () {
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(isCopy) {
|
|
var _shixunLists$shixun_l, _classroomList$action;
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
callback && callback(shixunLists === null || shixunLists === void 0 ? void 0 : (_shixunLists$shixun_l = shixunLists.shixun_list) === null || _shixunLists$shixun_l === void 0 ? void 0 : _shixunLists$shixun_l.filter(function (item) {
|
|
return item.identifier === selectArrs[0];
|
|
})[0], (_classroomList$action = classroomList.actionTabs) === null || _classroomList$action === void 0 ? void 0 : _classroomList$action.editData, isCopy);
|
|
dispatch({
|
|
type: 'classroomList/setActionTabs',
|
|
payload: {}
|
|
});
|
|
closeReuseModal();
|
|
case 3:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
return function reuseModalCallback(_x) {
|
|
return _ref3.apply(this, arguments);
|
|
};
|
|
}();
|
|
if (classroomList.actionTabs.key !== '选用实践项目') return null;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(drawer/* default */.Z, {
|
|
title: "\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",
|
|
placement: 'bottom',
|
|
height: '100%',
|
|
closable: true,
|
|
onClose: function onClose() {
|
|
dispatch({
|
|
type: 'classroomList/setActionTabs',
|
|
payload: {
|
|
key: ''
|
|
}
|
|
});
|
|
},
|
|
open: isVisible ? true : false,
|
|
className: SelectShixunsmodules.drawer,
|
|
footer: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "tc",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
size: "large",
|
|
onClick: function onClick() {
|
|
dispatch({
|
|
type: 'classroomList/setActionTabs',
|
|
payload: {
|
|
key: ''
|
|
}
|
|
});
|
|
},
|
|
style: {
|
|
marginRight: 8
|
|
},
|
|
children: "\u53D6\u6D88"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
size: "large",
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
var hasUsedShixun;
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
case 0:
|
|
if (!(selectArrs.length > 1)) {
|
|
_context3.next = 4;
|
|
break;
|
|
}
|
|
message/* default.error */.ZP.error('只能选择一个实践项目');
|
|
_context3.next = 12;
|
|
break;
|
|
case 4:
|
|
if (!(selectArrs.length === 0)) {
|
|
_context3.next = 8;
|
|
break;
|
|
}
|
|
message/* default.error */.ZP.error('请选择实践项目');
|
|
_context3.next = 12;
|
|
break;
|
|
case 8:
|
|
_context3.next = 10;
|
|
return showReuseModal({
|
|
id: selectArrs[0],
|
|
course_id: params.coursesId,
|
|
type: 'shixun'
|
|
});
|
|
case 10:
|
|
hasUsedShixun = _context3.sent;
|
|
if (!hasUsedShixun) {
|
|
reuseModalCallback(0);
|
|
}
|
|
case 12:
|
|
case "end":
|
|
return _context3.stop();
|
|
}
|
|
}, _callee3);
|
|
})),
|
|
type: "primary",
|
|
children: "\u786E\u5B9A"
|
|
})]
|
|
}),
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("section", {
|
|
className: "tc",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(FormSearch/* default */.Z, {
|
|
onChange: function onChange(v) {
|
|
setQuery(objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({}, query), v), {}, {
|
|
page: 1
|
|
}));
|
|
dispatch({
|
|
type: 'classroomList/getShixunLists',
|
|
payload: objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({}, query), v), {}, {
|
|
page: 1
|
|
})
|
|
});
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
className: "edu-container",
|
|
children: [shixunFilter.map(function (v, k) {
|
|
var _v$children;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
|
|
className: SelectShixunsmodules.menu,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
children: v.name
|
|
}), v === null || v === void 0 ? void 0 : (_v$children = v.children) === null || _v$children === void 0 ? void 0 : _v$children.map(function (val, key) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
className: query[v.id] == val.id ? SelectShixunsmodules.actived : '',
|
|
onClick: function onClick() {
|
|
query[v.id] = val.id;
|
|
// query['group_id'] = null;
|
|
query.page = 1;
|
|
setQuery(objectSpread2_default()({}, query));
|
|
dispatch({
|
|
type: 'classroomList/getShixunLists',
|
|
payload: objectSpread2_default()({}, query)
|
|
});
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
children: val.name
|
|
})
|
|
}, key);
|
|
})]
|
|
}, k);
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
|
|
className: SelectShixunsmodules.menut,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
padding: '18px',
|
|
fontWeight: '600'
|
|
},
|
|
children: "\u65B9\u5411\uFF1A"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
className: !query.discipline_id ? SelectShixunsmodules.actived3 : '',
|
|
onClick: function onClick() {
|
|
menuChange(null, null, null);
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
children: "\u5168\u90E8"
|
|
})
|
|
}), shixunsList.menus && shixunsList.menus.map(function (v, k) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
className: query.discipline_id == v.id ? SelectShixunsmodules.actived3 : '',
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
onClick: function onClick() {
|
|
menuChange(1, null, v.id);
|
|
},
|
|
children: v.name
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: v.sub_repertoires.map(function (val, key) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "mt5",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: query.sub_discipline_id == val.id ? "".concat(SelectShixunsmodules.actived4, " ").concat(SelectShixunsmodules.subTag) : SelectShixunsmodules.subTag,
|
|
onClick: function onClick() {
|
|
menuChange(2, val.id, v.id);
|
|
},
|
|
children: val.name
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("ul", {
|
|
className: "mt5",
|
|
children: val.tags && val.tags.map(function (value, index) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
className: query.sub_discipline_id == value.id ? SelectShixunsmodules.actived4 : '',
|
|
onClick: function onClick() {
|
|
menuChange(3, value.id, v.id);
|
|
},
|
|
children: value.name
|
|
}, index);
|
|
})
|
|
})]
|
|
}, key);
|
|
})
|
|
})]
|
|
}, k);
|
|
})]
|
|
}), query.type === 'mine' && /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
|
|
className: SelectShixunsmodules.menu,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
children: "\u76EE\u5F55\uFF1A"
|
|
}), groupsData === null || groupsData === void 0 ? void 0 : groupsData.map(function (val, key) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
className: query['group_id'] == val.id ? SelectShixunsmodules.actived : '',
|
|
onClick: function onClick() {
|
|
query['group_id'] = val.id;
|
|
query.page = 1;
|
|
setQuery(objectSpread2_default()({}, query));
|
|
dispatch({
|
|
type: 'classroomList/getShixunLists',
|
|
payload: objectSpread2_default()({}, query)
|
|
});
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
children: val.name
|
|
})
|
|
}, val.name);
|
|
})]
|
|
}), shixunFulter2.map(function (v, k) {
|
|
var _v$children2;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
|
|
className: SelectShixunsmodules.menu,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
children: v.name
|
|
}), v === null || v === void 0 ? void 0 : (_v$children2 = v.children) === null || _v$children2 === void 0 ? void 0 : _v$children2.map(function (val, key) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
className: query[v.id] == val.id ? SelectShixunsmodules.actived : '',
|
|
onClick: function onClick() {
|
|
query[v.id] = val.id;
|
|
query.page = 1;
|
|
setQuery(objectSpread2_default()({}, query));
|
|
dispatch({
|
|
type: 'classroomList/getShixunLists',
|
|
payload: objectSpread2_default()({}, query)
|
|
});
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
children: val.name
|
|
})
|
|
}, key);
|
|
})]
|
|
}, k);
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: SelectShixunsmodules.menuCourse,
|
|
style: {
|
|
margin: '0px 15px'
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
children: ["\u5DF2\u9009", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-blue",
|
|
children: selectArrs.length
|
|
}), "\u4E2A\u5B9E\u8BAD"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
children: ["\u5171", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-blue",
|
|
children: shixunLists.shixuns_count
|
|
}), "\u4E2A\u8BFE\u7A0B"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
className: "current",
|
|
onClick: function onClick() {
|
|
query.order = query.order === 'asc' ? 'desc' : 'asc';
|
|
setQuery(objectSpread2_default()({}, query));
|
|
dispatch({
|
|
type: 'classroomList/getShixunLists',
|
|
payload: objectSpread2_default()({}, query)
|
|
});
|
|
},
|
|
children: ["\u5B66\u4E60\u4EBA\u6570", /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
className: "edu-sorter current ".concat(query.order),
|
|
children: query.order === 'asc' ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "iconfont icon-sanjiaoxing-up"
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "iconfont icon-sanjiaoxing-down"
|
|
})
|
|
})]
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default.Group */.Z.Group, {
|
|
style: {
|
|
display: 'block'
|
|
},
|
|
value: selectArrs,
|
|
onChange: function onChange(selectedValues) {
|
|
setSelectArrs(selectedValues);
|
|
},
|
|
children: shixunLists === null || shixunLists === void 0 ? void 0 : (_shixunLists$shixun_l2 = shixunLists.shixun_list) === null || _shixunLists$shixun_l2 === void 0 ? void 0 : _shixunLists$shixun_l2.map(function (v, k) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: SelectShixunsmodules.listItem,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
value: v.identifier,
|
|
disabled: v === null || v === void 0 ? void 0 : v.need_authorize
|
|
// onChange={e => {
|
|
// let key = selectArrs.indexOf(v.id);
|
|
// if (selectArrs.indexOf(v.id) > -1) {
|
|
// setSelectArrs(
|
|
// selectArrs.filter((val: string) => val !== v.id),
|
|
// );
|
|
// } else {
|
|
// setSelectArrs(selectArrs.concat(v.id));
|
|
// }
|
|
// }}
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: SelectShixunsmodules.info,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: SelectShixunsmodules.title,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: SelectShixunsmodules.titleLeft,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
to: "/shixuns/".concat(v.identifier, "/challenges"),
|
|
target: "_blank",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
className: "font16",
|
|
dangerouslySetInnerHTML: {
|
|
__html: v.title
|
|
}
|
|
})
|
|
}), (v === null || v === void 0 ? void 0 : v.need_authorize) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
onClick: function onClick() {
|
|
(0,verifyLogin/* AuthorizeModel */.rX)(false);
|
|
},
|
|
style: {
|
|
marginRight: 'auto'
|
|
},
|
|
className: "tag-style bg-pink current ml10",
|
|
children: "\u9700\u6388\u6743"
|
|
}), (0,authority/* isSuperAdmins */.Ny)() && (v === null || v === void 0 ? void 0 : v.mark_status) === 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: v === null || v === void 0 ? void 0 : v.mark_content,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
marginRight: 'auto',
|
|
background: '#2FA34F'
|
|
},
|
|
className: "tag-style current ml10",
|
|
children: "\u6B63\u5E38"
|
|
})
|
|
}), (0,authority/* isSuperAdmins */.Ny)() && (v === null || v === void 0 ? void 0 : v.mark_status) === 2 && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: v === null || v === void 0 ? void 0 : v.mark_content,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
marginRight: 'auto',
|
|
background: '#FF8C29'
|
|
},
|
|
className: "tag-style current ml10",
|
|
children: "\u9700\u5B8C\u5584"
|
|
})
|
|
}), (0,authority/* isSuperAdmins */.Ny)() && (v === null || v === void 0 ? void 0 : v.mark_status) === 3 && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: v === null || v === void 0 ? void 0 : v.mark_content,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
marginRight: 'auto',
|
|
background: '#E53333'
|
|
},
|
|
className: "tag-style current ml10",
|
|
children: "\u65E0\u6CD5\u4F7F\u7528"
|
|
})
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "flex-wrp mt10 font14 c-light-black",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: SelectShixunsmodules.description,
|
|
dangerouslySetInnerHTML: {
|
|
__html: v.description
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "flex-wrp mt15",
|
|
children: v.challenge_names.map(function (val, key) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: "mr30",
|
|
children: ["\u7B2C", key + 1, "\u5173 ", val, ' ']
|
|
}, key);
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {
|
|
dashed: true
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "c-light-black mt20",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: v.author_name
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "ml15 mr15",
|
|
children: "|"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: v.author_school_name
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "ml15 mr15",
|
|
children: "|"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
children: ["\u96BE\u5EA6\u7CFB\u6570 ", v.level]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "ml15 mr15",
|
|
children: "|"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: "\u5B66\u4E60\u4EBA\u6570 "
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: v.study_count
|
|
})]
|
|
})]
|
|
})]
|
|
}, v.identifier);
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "tc",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
|
|
defaultCurrent: 1,
|
|
current: query.page || 1,
|
|
hideOnSinglePage: true,
|
|
defaultPageSize: 20,
|
|
showQuickJumper: true,
|
|
showSizeChanger: false,
|
|
total: shixunLists === null || shixunLists === void 0 ? void 0 : shixunLists.shixuns_count,
|
|
onChange: function onChange(page) {
|
|
query.page = page;
|
|
setQuery(objectSpread2_default()({}, query));
|
|
dispatch({
|
|
type: 'classroomList/getShixunLists',
|
|
payload: objectSpread2_default()({}, query)
|
|
});
|
|
setSelectArrs([]);
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(ReuseShixunModal/* default */.Z, {
|
|
visible: reuseModalVisible,
|
|
onCancel: closeReuseModal,
|
|
onOk: reuseModalCallback,
|
|
renderData: renderData,
|
|
inPaper: true,
|
|
modalType: "single",
|
|
type: "shixun"
|
|
})]
|
|
}, 'bottom');
|
|
};
|
|
/* harmony default export */ var SelectShixuns = ((0,_umi_production_exports.connect)(function (_ref5) {
|
|
var classroomList = _ref5.classroomList,
|
|
loading = _ref5.loading,
|
|
shixunsList = _ref5.shixunsList,
|
|
pathsList = _ref5.pathsList;
|
|
return {
|
|
classroomList: classroomList,
|
|
pathsList: pathsList,
|
|
loading: loading,
|
|
shixunsList: shixunsList
|
|
};
|
|
})(PublishShixun));
|
|
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/Exercise/Edit/components/UploadQuestions/index.tsx + 1 modules
|
|
var UploadQuestions = __webpack_require__(82278);
|
|
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/Exercise/Edit/components/DragQuestions/index.tsx + 1 modules
|
|
var DragQuestions = __webpack_require__(41850);
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Edit/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Editmodules = ({"flex_box_center":"flex_box_center___tQ9kp","flex_space_between":"flex_space_between___Gua_a","flex_box_vertical_center":"flex_box_vertical_center___Ptswq","flex_box_center_end":"flex_box_center_end___OytEE","flex_box_column":"flex_box_column___Lly85","bg":"bg____mu4F","containerTitle":"containerTitle___pfhhj","containerDesc":"containerDesc___AKysy","d1":"d1___u_Jx2","name":"name___w3BI6","diff":"diff___FlyVs","time":"time___eaQ8x","d2":"d2___RxDzv","listItem":"listItem___O8UlH","info":"info___CwLzA","title":"title___hrCD_","titleLeft":"titleLeft___PlqQX","titleRight":"titleRight___IwP1i","acitons":"acitons___iLOeP","formWrap":"formWrap___GlVQo","button":"button___v4_Vu"});
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(59758);
|
|
// EXTERNAL MODULE: ./src/components/DragSubject/index.tsx + 19 modules
|
|
var DragSubject = __webpack_require__(8286);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/table/style/index.js + 1 modules
|
|
var table_style = __webpack_require__(71854);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/table/index.js + 58 modules
|
|
var table = __webpack_require__(67250);
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Edit/components/Head/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Headmodules = ({"wrap":"wrap___KOVmj","img":"img___NjhEB","table":"table___IJFj3","totalScore":"totalScore___uo3aB","people":"people___jIZMc","glassSeal":"glassSeal___HTL5m"});
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 1 modules
|
|
var RenderHtml = __webpack_require__(12768);
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(29427);
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Edit/components/Head/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Head = function Head(_ref) {
|
|
var _exercise$exerciseExp2, _exercise$exerciseExp3;
|
|
var _ref$isPreview = _ref.isPreview,
|
|
isPreview = _ref$isPreview === void 0 ? false : _ref$isPreview,
|
|
_ref$isExportBlank = _ref.isExportBlank,
|
|
isExportBlank = _ref$isExportBlank === void 0 ? false : _ref$isExportBlank,
|
|
activeTabs = _ref.activeTabs,
|
|
exercise = _ref.exercise,
|
|
globalSetting = _ref.globalSetting,
|
|
loading = _ref.loading,
|
|
user = _ref.user,
|
|
dispatch = _ref.dispatch,
|
|
setIsEdit = _ref.setIsEdit;
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
var userInfo = user.userInfo;
|
|
var _useState = (0,react.useState)(),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
headData = _useState2[0],
|
|
setHeadData = _useState2[1];
|
|
var _useState3 = (0,react.useState)(),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
tableData = _useState4[0],
|
|
setTableData = _useState4[1];
|
|
var leftheight = (0,react.useRef)(null);
|
|
var _useState5 = (0,react.useState)(21),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
leftheights = _useState6[0],
|
|
setleftheights = _useState6[1];
|
|
(0,react.useEffect)(function () {
|
|
if ((0,util/* isUnOrNull */.W)(activeTabs)) {
|
|
// getData();
|
|
} else {
|
|
// 兼容试卷预览tab 切换重新获取数据
|
|
activeTabs === "2" && getData();
|
|
}
|
|
}, [params.userId, params.coursesId, params.exerciseId, params.categoryId, activeTabs]);
|
|
(0,react.useEffect)(function () {
|
|
if (leftheight.current) {
|
|
setleftheights(leftheight.current.clientHeight);
|
|
}
|
|
}, [leftheight.current]);
|
|
(0,react.useEffect)(function () {
|
|
var _exercise$exerciseExp;
|
|
if ((_exercise$exerciseExp = exercise.exerciseExportHeadData) !== null && _exercise$exerciseExp !== void 0 && _exercise$exerciseExp.title) {
|
|
var res = exercise.exerciseExportHeadData;
|
|
setHeadData(objectSpread2_default()({}, res || {}));
|
|
var _ref2 = res || {},
|
|
table = _ref2.table;
|
|
var total_score;
|
|
var actual_total_score;
|
|
if (table !== null && table !== void 0 && table.total_singles_scores || table !== null && table !== void 0 && table.total_doubles_scores || table !== null && table !== void 0 && table.total_nulls_scores || table !== null && table !== void 0 && table.total_judges_scores || table !== null && table !== void 0 && table.total_pros_scores || table !== null && table !== void 0 && table.total_shixuns_scores || table !== null && table !== void 0 && table.total_mains_scores || table !== null && table !== void 0 && table.total_combination_scores) {
|
|
total_score = Number(table === null || table === void 0 ? void 0 : table.total_singles_scores) + Number(table === null || table === void 0 ? void 0 : table.total_doubles_scores) + Number(table === null || table === void 0 ? void 0 : table.total_nulls_scores) + Number(table === null || table === void 0 ? void 0 : table.total_judges_scores) + Number(table === null || table === void 0 ? void 0 : table.total_pros_scores) + Number(table === null || table === void 0 ? void 0 : table.total_shixuns_scores) + Number(table === null || table === void 0 ? void 0 : table.total_mains_scores) + Number(table === null || table === void 0 ? void 0 : table.total_combination_scores);
|
|
}
|
|
if (table !== null && table !== void 0 && table.singles_scores || table !== null && table !== void 0 && table.doubles_scores || table !== null && table !== void 0 && table.nulls_scores || table !== null && table !== void 0 && table.judges_scores || table !== null && table !== void 0 && table.pros_scores || table !== null && table !== void 0 && table.shixuns_scores || table !== null && table !== void 0 && table.mains_scores || table !== null && table !== void 0 && table.combination_scores) {
|
|
actual_total_score = Number(table === null || table === void 0 ? void 0 : table.singles_scores) + Number(table === null || table === void 0 ? void 0 : table.doubles_scores) + Number(table === null || table === void 0 ? void 0 : table.nulls_scores) + Number(table === null || table === void 0 ? void 0 : table.judges_scores) + Number(table === null || table === void 0 ? void 0 : table.pros_scores) + Number(table === null || table === void 0 ? void 0 : table.shixuns_scores) + Number(table === null || table === void 0 ? void 0 : table.mains_scores) + Number(table === null || table === void 0 ? void 0 : table.combination_scores);
|
|
}
|
|
var data = [{
|
|
key: '1',
|
|
name: '应得分',
|
|
singles_score: table === null || table === void 0 ? void 0 : table.total_singles_scores,
|
|
doubles_score: table === null || table === void 0 ? void 0 : table.total_doubles_scores,
|
|
nulls_score: table === null || table === void 0 ? void 0 : table.total_nulls_scores,
|
|
judges_score: table === null || table === void 0 ? void 0 : table.total_judges_scores,
|
|
pros_score: table === null || table === void 0 ? void 0 : table.total_pros_scores,
|
|
shixuns_score: table === null || table === void 0 ? void 0 : table.total_shixuns_scores,
|
|
mains_score: table === null || table === void 0 ? void 0 : table.total_mains_scores,
|
|
combinations_score: table === null || table === void 0 ? void 0 : table.total_combination_scores,
|
|
total_score: total_score
|
|
}, {
|
|
key: '2',
|
|
name: '实得分',
|
|
singles_score: table === null || table === void 0 ? void 0 : table.singles_scores,
|
|
doubles_score: table === null || table === void 0 ? void 0 : table.doubles_scores,
|
|
nulls_score: table === null || table === void 0 ? void 0 : table.nulls_scores,
|
|
judges_score: table === null || table === void 0 ? void 0 : table.judges_scores,
|
|
pros_score: table === null || table === void 0 ? void 0 : table.pros_scores,
|
|
shixuns_score: table === null || table === void 0 ? void 0 : table.shixuns_scores,
|
|
mains_score: table === null || table === void 0 ? void 0 : table.mains_scores,
|
|
combinations_score: table === null || table === void 0 ? void 0 : table.combination_scores,
|
|
total_score: actual_total_score
|
|
}, {
|
|
key: '3',
|
|
name: '评卷人'
|
|
}];
|
|
var blankData = [{
|
|
key: '1',
|
|
name: '应得分',
|
|
singles_score: table === null || table === void 0 ? void 0 : table.total_singles_scores,
|
|
doubles_score: table === null || table === void 0 ? void 0 : table.total_doubles_scores,
|
|
nulls_score: table === null || table === void 0 ? void 0 : table.total_nulls_scores,
|
|
judges_score: table === null || table === void 0 ? void 0 : table.total_judges_scores,
|
|
pros_score: table === null || table === void 0 ? void 0 : table.total_pros_scores,
|
|
shixuns_score: table === null || table === void 0 ? void 0 : table.total_shixuns_scores,
|
|
mains_score: table === null || table === void 0 ? void 0 : table.total_mains_scores,
|
|
combinations_score: table === null || table === void 0 ? void 0 : table.combination_scores,
|
|
total_score: total_score
|
|
}, {
|
|
key: '2',
|
|
name: '实得分'
|
|
}, {
|
|
key: '3',
|
|
name: '评卷人'
|
|
}];
|
|
setTableData(toConsumableArray_default()(isExportBlank ? blankData : data));
|
|
}
|
|
}, [exercise.exerciseExportHeadData]);
|
|
var getData = /*#__PURE__*/function () {
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
var query, res, _ref4, table, total_score, actual_total_score, data, blankData;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
query = {
|
|
id: params.exerciseId || params.categoryId,
|
|
identify: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.login) || null
|
|
};
|
|
_context.next = 3;
|
|
return (0,service_exercise/* getExerciseExportHeadData */.iw)(query);
|
|
case 3:
|
|
res = _context.sent;
|
|
setHeadData(res || {});
|
|
_ref4 = res || {}, table = _ref4.table;
|
|
if (table !== null && table !== void 0 && table.total_singles_scores || table !== null && table !== void 0 && table.total_doubles_scores || table !== null && table !== void 0 && table.total_nulls_scores || table !== null && table !== void 0 && table.total_judges_scores || table !== null && table !== void 0 && table.total_pros_scores || table !== null && table !== void 0 && table.total_shixuns_scores || table !== null && table !== void 0 && table.total_mains_scores || table !== null && table !== void 0 && table.total_combination_scores) {
|
|
total_score = Number(table === null || table === void 0 ? void 0 : table.total_singles_scores) + Number(table === null || table === void 0 ? void 0 : table.total_doubles_scores) + Number(table === null || table === void 0 ? void 0 : table.total_nulls_scores) + Number(table === null || table === void 0 ? void 0 : table.total_judges_scores) + Number(table === null || table === void 0 ? void 0 : table.total_pros_scores) + Number(table === null || table === void 0 ? void 0 : table.total_shixuns_scores) + Number(table === null || table === void 0 ? void 0 : table.total_mains_scores) + Number(table === null || table === void 0 ? void 0 : table.total_combination_scores);
|
|
}
|
|
if (table !== null && table !== void 0 && table.singles_scores || table !== null && table !== void 0 && table.doubles_scores || table !== null && table !== void 0 && table.nulls_scores || table !== null && table !== void 0 && table.judges_scores || table !== null && table !== void 0 && table.pros_scores || table !== null && table !== void 0 && table.shixuns_scores || table !== null && table !== void 0 && table.mains_scores || table !== null && table !== void 0 && table.combinations_score) {
|
|
actual_total_score = Number(table === null || table === void 0 ? void 0 : table.singles_scores) + Number(table === null || table === void 0 ? void 0 : table.doubles_scores) + Number(table === null || table === void 0 ? void 0 : table.nulls_scores) + Number(table === null || table === void 0 ? void 0 : table.judges_scores) + Number(table === null || table === void 0 ? void 0 : table.pros_scores) + Number(table === null || table === void 0 ? void 0 : table.shixuns_scores) + Number(table === null || table === void 0 ? void 0 : table.mains_scores) + Number(table === null || table === void 0 ? void 0 : table.combinations_score);
|
|
}
|
|
data = [{
|
|
key: '1',
|
|
name: '应得分',
|
|
singles_score: table === null || table === void 0 ? void 0 : table.total_singles_scores,
|
|
doubles_score: table === null || table === void 0 ? void 0 : table.total_doubles_scores,
|
|
nulls_score: table === null || table === void 0 ? void 0 : table.total_nulls_scores,
|
|
judges_score: table === null || table === void 0 ? void 0 : table.total_judges_scores,
|
|
pros_score: table === null || table === void 0 ? void 0 : table.total_pros_scores,
|
|
shixuns_score: table === null || table === void 0 ? void 0 : table.total_shixuns_scores,
|
|
combinations_score: table === null || table === void 0 ? void 0 : table.total_combination_scores,
|
|
mains_score: table === null || table === void 0 ? void 0 : table.total_mains_scores,
|
|
total_score: total_score
|
|
}, {
|
|
key: '2',
|
|
name: '实得分',
|
|
singles_score: table === null || table === void 0 ? void 0 : table.singles_scores,
|
|
doubles_score: table === null || table === void 0 ? void 0 : table.doubles_scores,
|
|
nulls_score: table === null || table === void 0 ? void 0 : table.nulls_scores,
|
|
judges_score: table === null || table === void 0 ? void 0 : table.judges_scores,
|
|
pros_score: table === null || table === void 0 ? void 0 : table.pros_scores,
|
|
shixuns_score: table === null || table === void 0 ? void 0 : table.shixuns_scores,
|
|
mains_score: table === null || table === void 0 ? void 0 : table.mains_scores,
|
|
combinations_score: table === null || table === void 0 ? void 0 : table.combination_scores,
|
|
total_score: actual_total_score
|
|
}, {
|
|
key: '3',
|
|
name: '评卷人'
|
|
}];
|
|
blankData = [{
|
|
key: '1',
|
|
name: '应得分'
|
|
}, {
|
|
key: '2',
|
|
name: '实得分'
|
|
}, {
|
|
key: '3',
|
|
name: '评卷人'
|
|
}];
|
|
setTableData(isExportBlank ? blankData : data);
|
|
case 11:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function getData() {
|
|
return _ref3.apply(this, arguments);
|
|
};
|
|
}();
|
|
var columns = [{
|
|
width: '10%',
|
|
title: '题型',
|
|
align: 'center',
|
|
dataIndex: 'name',
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
children: text
|
|
});
|
|
}
|
|
}, {
|
|
width: '10%',
|
|
title: '单选题',
|
|
align: 'center',
|
|
dataIndex: 'singles_score',
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
children: text === '0.0' ? 0 : text
|
|
});
|
|
}
|
|
}, {
|
|
width: '10%',
|
|
title: '多选题',
|
|
align: 'center',
|
|
dataIndex: 'doubles_score',
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
children: text === '0.0' ? 0 : text
|
|
});
|
|
}
|
|
}, {
|
|
width: '10%',
|
|
title: '填空题',
|
|
align: 'center',
|
|
dataIndex: 'nulls_score',
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
children: text === '0.0' ? 0 : text
|
|
});
|
|
}
|
|
}, {
|
|
width: '10%',
|
|
title: '判断题',
|
|
align: 'center',
|
|
dataIndex: 'judges_score',
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
children: text === '0.0' ? 0 : text
|
|
});
|
|
}
|
|
}, {
|
|
width: '10%',
|
|
title: '编程题',
|
|
align: 'center',
|
|
dataIndex: 'pros_score',
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
children: text === '0.0' ? 0 : text
|
|
});
|
|
}
|
|
}, {
|
|
width: '10%',
|
|
title: '实训题',
|
|
align: 'center',
|
|
dataIndex: 'shixuns_score',
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
children: text === '0.0' ? 0 : text
|
|
});
|
|
}
|
|
}, {
|
|
width: '10%',
|
|
title: '简答题',
|
|
align: 'center',
|
|
dataIndex: 'mains_score',
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
children: text === '0.0' ? 0 : text
|
|
});
|
|
}
|
|
}, {
|
|
width: '10%',
|
|
title: '组合题',
|
|
align: 'center',
|
|
dataIndex: 'combinations_score',
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
children: text === '0.0' ? 0 : text
|
|
});
|
|
}
|
|
}, {
|
|
width: '10%',
|
|
title: '总分',
|
|
align: 'center',
|
|
dataIndex: 'total_score',
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
children: text === '0.0' ? 0 : text
|
|
});
|
|
}
|
|
}];
|
|
var _ref5 = headData || {},
|
|
exercise_header = _ref5.exercise_header;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
className: "".concat(Headmodules.wrap, " ").concat(isPreview ? 'pl20' : '', " "),
|
|
children: [(headData === null || headData === void 0 ? void 0 : headData.photo_url) && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
className: Headmodules.img,
|
|
src: headData === null || headData === void 0 ? void 0 : headData.photo_url
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
width: '100%',
|
|
textAlign: 'end'
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
onClick: function onClick() {
|
|
return setIsEdit(true);
|
|
},
|
|
children: "\u7F16\u8F91\u8BD5\u5377"
|
|
})
|
|
}), (exercise_header === null || exercise_header === void 0 ? void 0 : exercise_header.show_title) && /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
className: "font16 tc c-grey-333",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
children: headData === null || headData === void 0 ? void 0 : headData.title
|
|
})
|
|
}), (exercise === null || exercise === void 0 ? void 0 : (_exercise$exerciseExp2 = exercise.exerciseExportHeadData) === null || _exercise$exerciseExp2 === void 0 ? void 0 : _exercise$exerciseExp2.exercise_description) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
ref: leftheight,
|
|
style: {
|
|
justifyContent: leftheights === 21 ? 'center' : 'left',
|
|
wordBreak: 'break-all',
|
|
display: 'flex',
|
|
textAlign: 'left'
|
|
},
|
|
className: "tc c-grey-333",
|
|
children: "\u8BD5\u5377\u987B\u77E5\uFF1A".concat(exercise === null || exercise === void 0 ? void 0 : (_exercise$exerciseExp3 = exercise.exerciseExportHeadData) === null || _exercise$exerciseExp3 === void 0 ? void 0 : _exercise$exerciseExp3.exercise_description)
|
|
}), (exercise_header === null || exercise_header === void 0 ? void 0 : exercise_header.show_info) && /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
className: "tc c-grey-666",
|
|
children: ["\u5171:\u3010", headData === null || headData === void 0 ? void 0 : headData.large_counts, "\u5927\u9898\u3011\u3010", headData === null || headData === void 0 ? void 0 : headData.total_count, "\u5C0F\u9898\u3011\u3010 \u6EE1\u5206", headData === null || headData === void 0 ? void 0 : headData.score, "\u5206\u3011 \u8003\u8BD5\u65F6\u95F4\uFF1A\u3010", (headData === null || headData === void 0 ? void 0 : headData.time) > -1 ? "".concat(headData === null || headData === void 0 ? void 0 : headData.time, "\u5206\u949F") : "\u4E0D\u9650", "\u3011"]
|
|
}), (exercise_header === null || exercise_header === void 0 ? void 0 : exercise_header.show_desc) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "mt10",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
className: "font16",
|
|
children: "\u8003\u8BD5\u8BF4\u660E\uFF1A"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
value: headData === null || headData === void 0 ? void 0 : headData.description
|
|
})]
|
|
}), (exercise_header === null || exercise_header === void 0 ? void 0 : exercise_header.show_table) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "mt10",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
className: Headmodules.table,
|
|
columns: columns,
|
|
dataSource: toConsumableArray_default()(tableData || []),
|
|
bordered: true,
|
|
pagination: false
|
|
})
|
|
})]
|
|
})
|
|
});
|
|
};
|
|
/* harmony default export */ var components_Head = ((0,_umi_production_exports.connect)(function (_ref6) {
|
|
var exercise = _ref6.exercise,
|
|
loading = _ref6.loading,
|
|
user = _ref6.user,
|
|
globalSetting = _ref6.globalSetting;
|
|
return {
|
|
exercise: exercise,
|
|
globalSetting: globalSetting,
|
|
user: user,
|
|
loading: loading.effects
|
|
};
|
|
})(Head));
|
|
// EXTERNAL MODULE: ./src/components/AddPoints/index.tsx + 2 modules
|
|
var AddPoints = __webpack_require__(56369);
|
|
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/Exercise/components/util.tsx
|
|
var components_util = __webpack_require__(9269);
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Edit/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ShixunsListPage = function ShixunsListPage(_ref) {
|
|
var _userInfo$course, _exercise$editData17, _exercise$editData17$, _exercise$editData18, _exercise$editData18$, _exercise$editData19, _exercise$editData19$, _exercise$editData20, _exercise$editData20$, _exercise$editData29, _exercise$editData29$, _exercise$editData30, _exercise$editData30$, _exercise$editData31, _exercise$editData31$, _exercise$editData32, _exercise$editData32$, _exercise$editData33, _exercise$editData33$;
|
|
var exercise = _ref.exercise,
|
|
globalSetting = _ref.globalSetting,
|
|
loading = _ref.loading,
|
|
user = _ref.user,
|
|
problemset = _ref.problemset,
|
|
dispatch = _ref.dispatch;
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
var userInfo = user.userInfo;
|
|
var _Form$useForm = es_form/* default.useForm */.Z.useForm(),
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
form = _Form$useForm2[0];
|
|
var _useState = (0,react.useState)([]),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
editData = _useState2[0],
|
|
setEditData = _useState2[1];
|
|
var _useState3 = (0,react.useState)(false),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
isEdit = _useState4[0],
|
|
setIsEdit = _useState4[1];
|
|
var _useState5 = (0,react.useState)(false),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
visible = _useState6[0],
|
|
setVisible = _useState6[1];
|
|
var _useState7 = (0,react.useState)(false),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
dragVisible = _useState8[0],
|
|
setDragVisible = _useState8[1];
|
|
var _useState9 = (0,react.useState)(-1),
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
editKey = _useState10[0],
|
|
_setEditKey = _useState10[1];
|
|
var childrenRef = (0,react.useRef)();
|
|
var saveEditData = (0,react.useRef)(editData);
|
|
var _useState11 = (0,react.useState)({}),
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
items = _useState12[0],
|
|
setitems = _useState12[1];
|
|
var questionType = [{
|
|
name: "单选题",
|
|
id: 0,
|
|
count: "q_singles",
|
|
score: "q_singles_scores"
|
|
}, {
|
|
name: "多选题",
|
|
id: 1,
|
|
count: "q_doubles",
|
|
score: "q_doubles_scores"
|
|
}, {
|
|
name: "判断题",
|
|
id: 2,
|
|
count: "q_judges",
|
|
score: "q_judges_scores"
|
|
}, {
|
|
name: "填空题",
|
|
id: 3,
|
|
count: "q_nulls",
|
|
score: "q_nulls_scores"
|
|
}, {
|
|
name: "简答题",
|
|
id: 4,
|
|
count: "q_mains",
|
|
score: "q_mains_scores"
|
|
}, {
|
|
name: "实训题",
|
|
id: 5,
|
|
count: "q_shixuns",
|
|
score: "q_shixuns_scores"
|
|
}, {
|
|
name: "编程题",
|
|
id: 6,
|
|
count: "q_pros",
|
|
score: "q_pros_scores"
|
|
}, {
|
|
name: "组合题",
|
|
id: 7,
|
|
count: "q_combinations",
|
|
score: "q_combinations_scores"
|
|
}];
|
|
(0,react.useEffect)(function () {
|
|
dispatch({
|
|
type: 'globalSetting/footerToggle',
|
|
payload: false
|
|
});
|
|
return function () {
|
|
dispatch({
|
|
type: 'globalSetting/footerToggle',
|
|
payload: true
|
|
});
|
|
};
|
|
}, []);
|
|
(0,react.useEffect)(function () {
|
|
var _exercise$editData, _exercise$editData10, _exercise$editData10$;
|
|
if (exercise !== null && exercise !== void 0 && (_exercise$editData = exercise.editData) !== null && _exercise$editData !== void 0 && _exercise$editData.exercise_question_types) {
|
|
var _exercise$editData2, _exercise$editData3, _exercise$editData4, _exercise$editData4$e, _exercise$editData5, _exercise$editData5$e, _exercise$editData6, _exercise$editData6$e, _exercise$editData7, _exercise$editData7$e, _exercise$editData8, _exercise$editData8$e, _exercise$editData9, _exercise$editData9$e;
|
|
setEditData((0,lodash.cloneDeep)(exercise === null || exercise === void 0 ? void 0 : (_exercise$editData2 = exercise.editData) === null || _exercise$editData2 === void 0 ? void 0 : _exercise$editData2.exercise_question_types));
|
|
saveEditData.current = (0,lodash.cloneDeep)(exercise === null || exercise === void 0 ? void 0 : (_exercise$editData3 = exercise.editData) === null || _exercise$editData3 === void 0 ? void 0 : _exercise$editData3.exercise_question_types);
|
|
var values = {
|
|
exercise_name: (_exercise$editData4 = exercise.editData) === null || _exercise$editData4 === void 0 ? void 0 : (_exercise$editData4$e = _exercise$editData4.exercise) === null || _exercise$editData4$e === void 0 ? void 0 : _exercise$editData4$e.exercise_name,
|
|
time: (_exercise$editData5 = exercise.editData) === null || _exercise$editData5 === void 0 ? void 0 : (_exercise$editData5$e = _exercise$editData5.exercise) === null || _exercise$editData5$e === void 0 ? void 0 : _exercise$editData5$e.time,
|
|
difficulty: (_exercise$editData6 = exercise.editData) === null || _exercise$editData6 === void 0 ? void 0 : (_exercise$editData6$e = _exercise$editData6.exercise) === null || _exercise$editData6$e === void 0 ? void 0 : _exercise$editData6$e.difficulty,
|
|
exercise_description: (_exercise$editData7 = exercise.editData) === null || _exercise$editData7 === void 0 ? void 0 : (_exercise$editData7$e = _exercise$editData7.exercise) === null || _exercise$editData7$e === void 0 ? void 0 : _exercise$editData7$e.exercise_description
|
|
};
|
|
if (!((_exercise$editData8 = exercise.editData) !== null && _exercise$editData8 !== void 0 && (_exercise$editData8$e = _exercise$editData8.exercise) !== null && _exercise$editData8$e !== void 0 && _exercise$editData8$e.time) || ((_exercise$editData9 = exercise.editData) === null || _exercise$editData9 === void 0 ? void 0 : (_exercise$editData9$e = _exercise$editData9.exercise) === null || _exercise$editData9$e === void 0 ? void 0 : _exercise$editData9$e.time) === -1) {
|
|
delete values.time;
|
|
}
|
|
form.setFieldsValue(values);
|
|
}
|
|
var id = (_exercise$editData10 = exercise.editData) === null || _exercise$editData10 === void 0 ? void 0 : (_exercise$editData10$ = _exercise$editData10.exercise) === null || _exercise$editData10$ === void 0 ? void 0 : _exercise$editData10$.sub_discipline_id;
|
|
id && getTagData(id);
|
|
}, [exercise.editData]);
|
|
(0,react.useEffect)(function () {
|
|
var _exercise$editData11, _exercise$editData11$;
|
|
var arr = [];
|
|
var id = (_exercise$editData11 = exercise.editData) === null || _exercise$editData11 === void 0 ? void 0 : (_exercise$editData11$ = _exercise$editData11.exercise) === null || _exercise$editData11$ === void 0 ? void 0 : _exercise$editData11$.sub_discipline_id;
|
|
problemset.courseOptions.map(function (item) {
|
|
var _item$children;
|
|
if (item.value === id) {
|
|
arr.push(id);
|
|
}
|
|
item === null || item === void 0 ? void 0 : (_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.map(function (val) {
|
|
if (val.value === id) {
|
|
arr = [item.value, val.value];
|
|
}
|
|
});
|
|
});
|
|
form.setFieldsValue({
|
|
courseid: toConsumableArray_default()(arr)
|
|
});
|
|
}, [problemset.courseOptions]);
|
|
var getTagData = /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(id) {
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
_context.next = 2;
|
|
return dispatch({
|
|
type: "exercise/getTagDiscipline",
|
|
payload: {
|
|
sub_discipline_id: id
|
|
}
|
|
});
|
|
case 2:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function getTagData(_x) {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
(0,react.useEffect)(function () {
|
|
getData();
|
|
}, [params.categoryId]);
|
|
var getData = /*#__PURE__*/function () {
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
_context2.next = 2;
|
|
return (0,components_util/* handleCheckModal */.w)(params.coursesId, params.categoryId, '', 0, 1);
|
|
case 2:
|
|
_context2.next = 4;
|
|
return dispatch({
|
|
type: "exercise/getExerciseExportHeadData",
|
|
payload: {
|
|
id: params.exerciseId || params.categoryId,
|
|
identify: params.userId || null
|
|
}
|
|
});
|
|
case 4:
|
|
_context2.next = 6;
|
|
return dispatch({
|
|
type: "exercise/editExercise",
|
|
payload: objectSpread2_default()({}, params)
|
|
});
|
|
case 6:
|
|
_context2.next = 8;
|
|
return dispatch({
|
|
type: 'problemset/getEditDisciplines',
|
|
payload: {
|
|
source: 'new_question'
|
|
}
|
|
});
|
|
case 8:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
return function getData() {
|
|
return _ref3.apply(this, arguments);
|
|
};
|
|
}();
|
|
var save = /*#__PURE__*/function () {
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
var _exercise$editData12, _exercise$editData12$;
|
|
var value;
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
case 0:
|
|
_context3.next = 2;
|
|
return form.validateFields();
|
|
case 2:
|
|
value = form.getFieldValue();
|
|
value.is_md = true;
|
|
value.exerciseId = (_exercise$editData12 = exercise.editData) === null || _exercise$editData12 === void 0 ? void 0 : (_exercise$editData12$ = _exercise$editData12.exercise) === null || _exercise$editData12$ === void 0 ? void 0 : _exercise$editData12$.id;
|
|
value.sub_discipline_id = value.courseid[value.courseid.length - 1];
|
|
setIsEdit(false);
|
|
_context3.next = 9;
|
|
return (0,service_exercise/* putExercise */.wy)(objectSpread2_default()({}, value));
|
|
case 9:
|
|
_setEditKey(-1);
|
|
dispatch({
|
|
type: "exercise/editExercise",
|
|
payload: objectSpread2_default()({}, params)
|
|
});
|
|
set_work_points(params.categoryId);
|
|
getData();
|
|
case 13:
|
|
case "end":
|
|
return _context3.stop();
|
|
}
|
|
}, _callee3);
|
|
}));
|
|
return function save() {
|
|
return _ref4.apply(this, arguments);
|
|
};
|
|
}();
|
|
function set_work_points(_x2) {
|
|
return _set_work_points.apply(this, arguments);
|
|
}
|
|
function _set_work_points() {
|
|
_set_work_points = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee9(id) {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee9$(_context9) {
|
|
while (1) switch (_context9.prev = _context9.next) {
|
|
case 0:
|
|
if (items !== null && items !== void 0 && items.ec_point_ids) {
|
|
_context9.next = 2;
|
|
break;
|
|
}
|
|
return _context9.abrupt("return");
|
|
case 2:
|
|
_context9.next = 4;
|
|
return (0,fetch/* default */.ZP)("/api/ec_courses/".concat(items === null || items === void 0 ? void 0 : items.ec_course_id, "/ec_points/set_work_points.json"), {
|
|
method: 'post',
|
|
body: objectSpread2_default()({
|
|
exercise_id: id
|
|
}, items)
|
|
});
|
|
case 4:
|
|
res = _context9.sent;
|
|
case 5:
|
|
case "end":
|
|
return _context9.stop();
|
|
}
|
|
}, _callee9);
|
|
}));
|
|
return _set_work_points.apply(this, arguments);
|
|
}
|
|
var addQuestion = /*#__PURE__*/function () {
|
|
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(type) {
|
|
var _exercise$editData13, _exercise$editData13$, _exercise$editData14, _exercise$editData14$, _p$items$p$count, p, insertParams;
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
case 0:
|
|
if (!(editKey !== -1)) {
|
|
_context4.next = 3;
|
|
break;
|
|
}
|
|
message/* default.error */.ZP.error("不能同时编辑两题");
|
|
return _context4.abrupt("return");
|
|
case 3:
|
|
if (!(type === 5)) {
|
|
_context4.next = 7;
|
|
break;
|
|
}
|
|
dispatch({
|
|
type: "classroomList/setActionTabs",
|
|
payload: {
|
|
key: "选用实践项目"
|
|
}
|
|
});
|
|
_context4.next = 22;
|
|
break;
|
|
case 7:
|
|
if (!(type === 6)) {
|
|
_context4.next = 11;
|
|
break;
|
|
}
|
|
_umi_production_exports.history.push("/problems/new?difficult=".concat((_exercise$editData13 = exercise.editData) === null || _exercise$editData13 === void 0 ? void 0 : (_exercise$editData13$ = _exercise$editData13.exercise) === null || _exercise$editData13$ === void 0 ? void 0 : _exercise$editData13$.difficulty, "&sub_discipline_id=").concat((_exercise$editData14 = exercise.editData) === null || _exercise$editData14 === void 0 ? void 0 : (_exercise$editData14$ = _exercise$editData14.exercise) === null || _exercise$editData14$ === void 0 ? void 0 : _exercise$editData14$.sub_discipline_id, "&express_id=").concat(params.categoryId, "&callback_url=").concat(location.pathname));
|
|
_context4.next = 22;
|
|
break;
|
|
case 11:
|
|
p = editData.find(function (e) {
|
|
return e.question_type === type;
|
|
});
|
|
if (p) {
|
|
_context4.next = 19;
|
|
break;
|
|
}
|
|
saveEditData.current = (0,lodash.cloneDeep)(editData);
|
|
editData.push({
|
|
name: questionType.find(function (er) {
|
|
return er.id === type;
|
|
}).name,
|
|
question_type: type,
|
|
count: 0,
|
|
score: 0,
|
|
items: [{
|
|
key: 1,
|
|
insert_id: 1,
|
|
question_type: type
|
|
}]
|
|
});
|
|
setEditData(toConsumableArray_default()(editData));
|
|
_setEditKey("".concat(type, "-", 1));
|
|
setTimeout(function () {
|
|
var _document$getElementB;
|
|
(_document$getElementB = document.getElementById("".concat(type, "-", 0))) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.scrollIntoView();
|
|
}, 0);
|
|
return _context4.abrupt("return");
|
|
case 19:
|
|
setTimeout(function () {
|
|
var _document$getElementB2;
|
|
(_document$getElementB2 = document.getElementById("".concat(type, "-").concat(p.count - 1))) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.scrollIntoView();
|
|
}, 0);
|
|
insertParams = {
|
|
key: p.count,
|
|
insert_id: (_p$items$p$count = p.items[p.count]) === null || _p$items$p$count === void 0 ? void 0 : _p$items$p$count.question_id,
|
|
question_type: type
|
|
};
|
|
_addCallback(insertParams);
|
|
case 22:
|
|
case "end":
|
|
return _context4.stop();
|
|
}
|
|
}, _callee4);
|
|
}));
|
|
return function addQuestion(_x3) {
|
|
return _ref5.apply(this, arguments);
|
|
};
|
|
}();
|
|
var _cancelAdd = function cancelAdd() {
|
|
_setEditKey(-1);
|
|
setEditData(saveEditData.current);
|
|
};
|
|
var _addCallback = function addCallback() {
|
|
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
saveEditData.current = (0,lodash.cloneDeep)(editData);
|
|
if (data.question_type === 6) {
|
|
var _exercise$editData15, _exercise$editData15$, _exercise$editData16, _exercise$editData16$;
|
|
_umi_production_exports.history.push("/problems/new?difficult=".concat((_exercise$editData15 = exercise.editData) === null || _exercise$editData15 === void 0 ? void 0 : (_exercise$editData15$ = _exercise$editData15.exercise) === null || _exercise$editData15$ === void 0 ? void 0 : _exercise$editData15$.difficulty, "&sub_discipline_id=").concat((_exercise$editData16 = exercise.editData) === null || _exercise$editData16 === void 0 ? void 0 : (_exercise$editData16$ = _exercise$editData16.exercise) === null || _exercise$editData16$ === void 0 ? void 0 : _exercise$editData16$.sub_discipline_id, "&express_id=").concat(params.categoryId, "&callback_url=").concat(location.pathname));
|
|
return false;
|
|
}
|
|
editData.map(function (item) {
|
|
if (item.question_type === data.question_type) {
|
|
var newItems = (0,lodash.cloneDeep)(item.items);
|
|
newItems.splice(data === null || data === void 0 ? void 0 : data.key, 0, objectSpread2_default()({
|
|
insert_id: data === null || data === void 0 ? void 0 : data.insert_id
|
|
}, data));
|
|
item.items = newItems;
|
|
}
|
|
return item;
|
|
});
|
|
setEditData(toConsumableArray_default()(editData));
|
|
_setEditKey("".concat(data.question_type, "-").concat(data.key + 1));
|
|
};
|
|
var editorProps = {
|
|
ref: childrenRef,
|
|
editKey: editKey,
|
|
hideAction: false,
|
|
cancelAdd: function cancelAdd() {
|
|
return _cancelAdd();
|
|
},
|
|
setEditKey: function setEditKey(key) {
|
|
return _setEditKey(key);
|
|
},
|
|
addCallback: function addCallback(data) {
|
|
return _addCallback(data);
|
|
}
|
|
};
|
|
var uploadRequest = function uploadRequest(params, url, callback, progressFunction, error) {
|
|
var formData = new FormData();
|
|
Object.keys(params).forEach(function (key) {
|
|
formData.append(key, params[key]);
|
|
});
|
|
var xhr = new window.XMLHttpRequest();
|
|
xhr.withCredentials = true;
|
|
xhr.addEventListener('load', function (res) {
|
|
var _res$target;
|
|
callback(JSON.parse(res === null || res === void 0 ? void 0 : (_res$target = res.target) === null || _res$target === void 0 ? void 0 : _res$target.response));
|
|
}, false);
|
|
xhr.addEventListener('error', function (err) {
|
|
if (error) {
|
|
error(err);
|
|
}
|
|
}, false);
|
|
xhr.upload.onprogress = function (e) {
|
|
if (progressFunction) {
|
|
progressFunction(e);
|
|
}
|
|
};
|
|
xhr.open('POST', url);
|
|
xhr.send(formData);
|
|
return xhr;
|
|
};
|
|
var handleOk = /*#__PURE__*/function () {
|
|
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5(list, cb) {
|
|
var _list$;
|
|
var newParams;
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
case 0:
|
|
if (!(list.length === 0)) {
|
|
_context5.next = 4;
|
|
break;
|
|
}
|
|
message/* default.warn */.ZP.warn('请上传文件');
|
|
cb();
|
|
return _context5.abrupt("return");
|
|
case 4:
|
|
newParams = {
|
|
id: params === null || params === void 0 ? void 0 : params.categoryId,
|
|
file: (_list$ = list[0]) === null || _list$ === void 0 ? void 0 : _list$.file
|
|
};
|
|
uploadRequest(newParams, "".concat(env/* default.API_SERVER */.Z.API_SERVER, "/api/courses/").concat(params === null || params === void 0 ? void 0 : params.coursesId, "/exercises/import_exercise.json"), function (res) {
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
var _res$fail;
|
|
var obj = {};
|
|
res === null || res === void 0 ? void 0 : (_res$fail = res.fail) === null || _res$fail === void 0 ? void 0 : _res$fail.forEach(function (e) {
|
|
var _Object$keys;
|
|
var isExist = (_Object$keys = Object.keys(obj)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.includes(e.message);
|
|
if (isExist) {
|
|
obj[e.message] = obj[e.message] + 1;
|
|
} else {
|
|
obj[e.message] = 1;
|
|
}
|
|
});
|
|
var str = "\u6210\u529F\u5BFC\u5165".concat(res === null || res === void 0 ? void 0 : res.success, "\u6761");
|
|
Object.keys(obj).forEach(function (item) {
|
|
str = str + ",".concat(item).concat(obj[item], "\u6761");
|
|
});
|
|
message/* default.success */.ZP.success(str);
|
|
setVisible(false);
|
|
getData();
|
|
}
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === -1) {
|
|
message/* default.error */.ZP.error(res === null || res === void 0 ? void 0 : res.message);
|
|
cb();
|
|
}
|
|
});
|
|
case 6:
|
|
case "end":
|
|
return _context5.stop();
|
|
}
|
|
}, _callee5);
|
|
}));
|
|
return function handleOk(_x4, _x5) {
|
|
return _ref6.apply(this, arguments);
|
|
};
|
|
}();
|
|
var handleDragOk = /*#__PURE__*/function () {
|
|
var _ref7 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6(list, cb) {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
case 0:
|
|
_context6.next = 2;
|
|
return (0,fetch/* default */.ZP)("/api/exercises/".concat(params === null || params === void 0 ? void 0 : params.categoryId, "/sort_question_type.json"), {
|
|
method: 'post',
|
|
body: {
|
|
question_type: list
|
|
}
|
|
});
|
|
case 2:
|
|
res = _context6.sent;
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
message/* default.success */.ZP.success(res === null || res === void 0 ? void 0 : res.message);
|
|
setDragVisible(false);
|
|
getData();
|
|
}
|
|
cb();
|
|
case 5:
|
|
case "end":
|
|
return _context6.stop();
|
|
}
|
|
}, _callee6);
|
|
}));
|
|
return function handleDragOk(_x6, _x7) {
|
|
return _ref7.apply(this, arguments);
|
|
};
|
|
}();
|
|
var handleIn = function handleIn() {
|
|
if (editKey !== -1) {
|
|
message/* default.error */.ZP.error("请先保存或取消当前正在编辑的问题。");
|
|
return;
|
|
}
|
|
setVisible(true);
|
|
};
|
|
var handleDragEnd = /*#__PURE__*/function () {
|
|
var _ref8 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7(list, type) {
|
|
var index, newEditData, res;
|
|
return regeneratorRuntime_default()().wrap(function _callee7$(_context7) {
|
|
while (1) switch (_context7.prev = _context7.next) {
|
|
case 0:
|
|
saveEditData.current = (0,lodash.cloneDeep)(editData);
|
|
index = editData.findIndex(function (e) {
|
|
return e.question_type === type;
|
|
});
|
|
newEditData = editData;
|
|
newEditData[index].items = list;
|
|
setEditData(toConsumableArray_default()(newEditData));
|
|
_context7.next = 7;
|
|
return (0,fetch/* default */.ZP)("/api/exercises/".concat(params === null || params === void 0 ? void 0 : params.categoryId, "/adjust_position.json"), {
|
|
method: 'post',
|
|
body: {
|
|
question_ids: list.map(function (e) {
|
|
return e === null || e === void 0 ? void 0 : e.question_id;
|
|
})
|
|
}
|
|
});
|
|
case 7:
|
|
res = _context7.sent;
|
|
if ((res === null || res === void 0 ? void 0 : res.status) !== 0) {
|
|
setEditData(saveEditData.current);
|
|
}
|
|
case 9:
|
|
case "end":
|
|
return _context7.stop();
|
|
}
|
|
}, _callee7);
|
|
}));
|
|
return function handleDragEnd(_x8, _x9) {
|
|
return _ref8.apply(this, arguments);
|
|
};
|
|
}();
|
|
var handleIniateAnswer = /*#__PURE__*/function () {
|
|
var _ref9 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee8() {
|
|
var _res$exercise;
|
|
var res, _user$userInfo;
|
|
return regeneratorRuntime_default()().wrap(function _callee8$(_context8) {
|
|
while (1) switch (_context8.prev = _context8.next) {
|
|
case 0:
|
|
_context8.next = 2;
|
|
return (0,service_exercise/* startSimulateAnswer */._F)(objectSpread2_default()(objectSpread2_default()({}, params), {}, {
|
|
is_reset: 1
|
|
}));
|
|
case 2:
|
|
res = _context8.sent;
|
|
if (res !== null && res !== void 0 && (_res$exercise = res.exercise) !== null && _res$exercise !== void 0 && _res$exercise.id) {
|
|
_umi_production_exports.history.push("/classrooms/".concat(params.coursesId, "/exercise/").concat(params.categoryId, "/").concat((_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.login, "/initate_answer"));
|
|
}
|
|
case 4:
|
|
case "end":
|
|
return _context8.stop();
|
|
}
|
|
}, _callee8);
|
|
}));
|
|
return function handleIniateAnswer() {
|
|
return _ref9.apply(this, arguments);
|
|
};
|
|
}();
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
className: "edu-container minH500",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(spin/* default */.Z, {
|
|
spinning: loading['exercise/editExercise'] || loading['exercise/getExerciseExportHeadData'],
|
|
size: "large",
|
|
style: {
|
|
position: 'fixed',
|
|
maxHeight: '100vh'
|
|
},
|
|
className: "mt30",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
className: "animated fadeIn",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
className: "mt10",
|
|
children: userInfo && /*#__PURE__*/(0,jsx_runtime.jsxs)(breadcrumb/* default */.Z, {
|
|
separator: ">",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default.Item */.Z.Item, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
to: "/classrooms/".concat(params.coursesId, "/exercise"),
|
|
children: userInfo === null || userInfo === void 0 ? void 0 : (_userInfo$course = userInfo.course) === null || _userInfo$course === void 0 ? void 0 : _userInfo$course.course_name
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default.Item */.Z.Item, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
to: "/classrooms/".concat(params.coursesId, "/exercise"),
|
|
children: "\u8BD5\u5377\u5217\u8868"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default.Item */.Z.Item, {
|
|
children: "\u7F16\u8F91\u8BD5\u5377"
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
className: [Editmodules.title, 'mt20'].join(' '),
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
style: {
|
|
width: "100%"
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
flex: "1",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
className: "font20 ml5",
|
|
children: "\u7F16\u8F91\u8BD5\u5377"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
className: "font16 c-light-black",
|
|
to: "/classrooms/".concat(params.coursesId, "/exercise"),
|
|
children: "\u8FD4\u56DE"
|
|
})
|
|
})]
|
|
})
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
className: [Editmodules.bg, 'pt30', 'pl30', 'pr30', 'pb60', 'mt20'].join(' '),
|
|
children: [!isEdit && /*#__PURE__*/(0,jsx_runtime.jsx)(components_Head, {
|
|
setIsEdit: setIsEdit,
|
|
isExportBlank: false
|
|
}), isEdit && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
layout: "vertical",
|
|
form: form,
|
|
className: Editmodules.formWrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
label: "方向&课程:",
|
|
name: "courseid",
|
|
labelCol: {
|
|
span: 5
|
|
},
|
|
wrapperCol: {
|
|
span: 5
|
|
},
|
|
rules: [{
|
|
required: true,
|
|
message: '请选择课程'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(cascader/* default */.Z, {
|
|
disabled: ((_exercise$editData17 = exercise.editData) === null || _exercise$editData17 === void 0 ? void 0 : (_exercise$editData17$ = _exercise$editData17.exercise) === null || _exercise$editData17$ === void 0 ? void 0 : _exercise$editData17$.exercise_status) !== 1,
|
|
placeholder: "\u8BF7\u9009\u62E9...",
|
|
options: problemset.courseOptions
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: "exercise_name",
|
|
label: "\u8BD5\u5377\u540D\u79F0\uFF1A",
|
|
rules: [{
|
|
required: true,
|
|
message: "请填写试卷名称"
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
maxLength: 60,
|
|
placeholder: "\u8BD5\u5377\u6807\u9898\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
display: 'flex'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: "time",
|
|
label: "\u7B54\u9898\u65F6\u957F"
|
|
// rules={[{message: "请填写考试时长" }]}
|
|
,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
|
|
min: 1,
|
|
max: 9999,
|
|
disabled: ((_exercise$editData18 = exercise.editData) === null || _exercise$editData18 === void 0 ? void 0 : (_exercise$editData18$ = _exercise$editData18.exercise) === null || _exercise$editData18$ === void 0 ? void 0 : _exercise$editData18$.exercise_status) !== 1,
|
|
style: {
|
|
width: 110
|
|
},
|
|
maxLength: 60,
|
|
placeholder: "\u8BF7\u586B\u5199\u7B54\u9898\u65F6\u957F"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
marginLeft: "10px",
|
|
width: '40px',
|
|
lineHeight: '32px',
|
|
marginTop: 23
|
|
},
|
|
children: "\u5206\u949F"
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
label: "\u96BE\u5EA6\uFF1A",
|
|
name: "difficulty",
|
|
rules: [{
|
|
required: true,
|
|
message: '请选择难度'
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
disabled: ((_exercise$editData19 = exercise.editData) === null || _exercise$editData19 === void 0 ? void 0 : (_exercise$editData19$ = _exercise$editData19.exercise) === null || _exercise$editData19$ === void 0 ? void 0 : _exercise$editData19$.exercise_status) !== 1,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Button */.ZP.Button, {
|
|
value: 1,
|
|
children: "\u7B80\u5355"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Button */.ZP.Button, {
|
|
value: 2,
|
|
children: "\u9002\u4E2D"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Button */.ZP.Button, {
|
|
value: 3,
|
|
children: "\u56F0\u96BE"
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
label: "\u8BD5\u5377\u987B\u77E5\uFF1A",
|
|
name: "exercise_description",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default.TextArea */.Z.TextArea, {
|
|
disabled: ((_exercise$editData20 = exercise.editData) === null || _exercise$editData20 === void 0 ? void 0 : (_exercise$editData20$ = _exercise$editData20.exercise) === null || _exercise$editData20$ === void 0 ? void 0 : _exercise$editData20$.exercise_status) !== 1,
|
|
maxLength: 65535,
|
|
rows: 6,
|
|
placeholder: "\u8BF7\u5728\u6B64\u8F93\u5165\u672C\u6B21\u8BD5\u5377\u7B54\u9898\u7684\u76F8\u5173\u8BF4\u660E\uFF0C\u6700\u5927\u9650\u523665535\u4E2A\u5B57\u7B26"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(AddPoints/* default */.Z, {
|
|
setitem: function setitem(e) {
|
|
return setitems(objectSpread2_default()({}, e));
|
|
},
|
|
exercise_id: params.categoryId
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default.Item */.Z.Item, {
|
|
className: "tr",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
type: "primary",
|
|
onClick: function onClick() {
|
|
save();
|
|
},
|
|
children: "\u4FDD\u5B58"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
style: {
|
|
marginLeft: 10
|
|
},
|
|
onClick: function onClick() {
|
|
var _exercise$editData21;
|
|
setIsEdit(false);
|
|
if (exercise !== null && exercise !== void 0 && (_exercise$editData21 = exercise.editData) !== null && _exercise$editData21 !== void 0 && _exercise$editData21.exercise_question_types) {
|
|
var _exercise$editData22, _exercise$editData23, _exercise$editData23$, _exercise$editData24, _exercise$editData24$, _exercise$editData25, _exercise$editData25$, _exercise$editData26, _exercise$editData26$, _exercise$editData27, _exercise$editData27$, _exercise$editData28, _exercise$editData28$;
|
|
setEditData(toConsumableArray_default()(exercise === null || exercise === void 0 ? void 0 : (_exercise$editData22 = exercise.editData) === null || _exercise$editData22 === void 0 ? void 0 : _exercise$editData22.exercise_question_types));
|
|
var values = {
|
|
exercise_name: (_exercise$editData23 = exercise.editData) === null || _exercise$editData23 === void 0 ? void 0 : (_exercise$editData23$ = _exercise$editData23.exercise) === null || _exercise$editData23$ === void 0 ? void 0 : _exercise$editData23$.exercise_name,
|
|
time: (_exercise$editData24 = exercise.editData) === null || _exercise$editData24 === void 0 ? void 0 : (_exercise$editData24$ = _exercise$editData24.exercise) === null || _exercise$editData24$ === void 0 ? void 0 : _exercise$editData24$.time,
|
|
difficulty: (_exercise$editData25 = exercise.editData) === null || _exercise$editData25 === void 0 ? void 0 : (_exercise$editData25$ = _exercise$editData25.exercise) === null || _exercise$editData25$ === void 0 ? void 0 : _exercise$editData25$.difficulty,
|
|
exercise_description: (_exercise$editData26 = exercise.editData) === null || _exercise$editData26 === void 0 ? void 0 : (_exercise$editData26$ = _exercise$editData26.exercise) === null || _exercise$editData26$ === void 0 ? void 0 : _exercise$editData26$.exercise_description
|
|
};
|
|
if (!((_exercise$editData27 = exercise.editData) !== null && _exercise$editData27 !== void 0 && (_exercise$editData27$ = _exercise$editData27.exercise) !== null && _exercise$editData27$ !== void 0 && _exercise$editData27$.time) || ((_exercise$editData28 = exercise.editData) === null || _exercise$editData28 === void 0 ? void 0 : (_exercise$editData28$ = _exercise$editData28.exercise) === null || _exercise$editData28$ === void 0 ? void 0 : _exercise$editData28$.time) === -1) {
|
|
delete values.time;
|
|
}
|
|
form.setFieldsValue(values);
|
|
}
|
|
},
|
|
children: "\u53D6\u6D88"
|
|
})]
|
|
})]
|
|
})]
|
|
}), editData != '' && /*#__PURE__*/(0,jsx_runtime.jsx)("section", {
|
|
className: [Editmodules.bg, 'pt30', 'pl20', 'pr20', 'pb20', 'mt20'].join(' '),
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(DragSubject/* default */.Z, {
|
|
data: editData,
|
|
editorProps: editorProps,
|
|
isDragDisabled: editKey !== -1,
|
|
onDragEnd: handleDragEnd,
|
|
batchScore: ["单选题", "多选题", "判断题", "填空题", "简答题", "编程题"],
|
|
reload: getData
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(SelectShixuns, {
|
|
callback: function callback(originData, data, is_copy) {
|
|
var _originData$title;
|
|
saveEditData.current = (0,lodash.cloneDeep)(editData);
|
|
var param = {
|
|
shixun: originData.challenge_names.map(function (item) {
|
|
return {
|
|
challenge_name: item,
|
|
challenge_score: 5
|
|
};
|
|
}),
|
|
shixun_name: originData === null || originData === void 0 ? void 0 : (_originData$title = originData.title) === null || _originData$title === void 0 ? void 0 : _originData$title.replace(/<.*?>/ig, ""),
|
|
shixun_id: originData.id,
|
|
question_type: 5,
|
|
edit: true,
|
|
is_copy: is_copy
|
|
};
|
|
if (data) {
|
|
editData.map(function (item) {
|
|
if (item.question_type === 5) {
|
|
var newItems = (0,lodash.cloneDeep)(item.items);
|
|
newItems.splice(data === null || data === void 0 ? void 0 : data.key, 0, param);
|
|
item.items = newItems;
|
|
}
|
|
return item;
|
|
});
|
|
_setEditKey("5-".concat(editData.key + 1));
|
|
setEditData(toConsumableArray_default()(editData));
|
|
}
|
|
if (!data) {
|
|
var p = editData.find(function (e) {
|
|
return e.question_type === 5;
|
|
});
|
|
if (!p) {
|
|
editData.push({
|
|
name: questionType.find(function (er) {
|
|
return er.id === 5;
|
|
}).name,
|
|
question_type: 5,
|
|
count: 0,
|
|
score: 0,
|
|
items: [param]
|
|
});
|
|
setEditData(toConsumableArray_default()(editData));
|
|
_setEditKey("".concat(5, "-", 1));
|
|
setTimeout(function () {
|
|
var _document$getElementB3;
|
|
(_document$getElementB3 = document.getElementById("".concat(5, "-", 0))) === null || _document$getElementB3 === void 0 ? void 0 : _document$getElementB3.scrollIntoView();
|
|
}, 0);
|
|
return;
|
|
}
|
|
setTimeout(function () {
|
|
var _document$getElementB4;
|
|
(_document$getElementB4 = document.getElementById("".concat(5, "-", p.count - 1))) === null || _document$getElementB4 === void 0 ? void 0 : _document$getElementB4.scrollIntoView();
|
|
}, 0);
|
|
p.items.push(param);
|
|
setEditData(toConsumableArray_default()(editData));
|
|
_setEditKey("".concat(5, "-", p.count));
|
|
}
|
|
}
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(UploadQuestions/* default */.Z, {
|
|
visible: visible,
|
|
onCancel: function onCancel() {
|
|
return setVisible(false);
|
|
},
|
|
onOk: handleOk
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(DragQuestions/* default */.Z, {
|
|
visible: dragVisible,
|
|
onCancel: function onCancel() {
|
|
return setDragVisible(false);
|
|
},
|
|
onOk: handleDragOk,
|
|
data: (_exercise$editData29 = exercise.editData) === null || _exercise$editData29 === void 0 ? void 0 : (_exercise$editData29$ = _exercise$editData29.exercise) === null || _exercise$editData29$ === void 0 ? void 0 : _exercise$editData29$.sort_by_qustion_type
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("section", {
|
|
style: {
|
|
display: 'flex',
|
|
width: "100%",
|
|
position: 'fixed',
|
|
bottom: 0,
|
|
height: 70,
|
|
boxShadow: 'rgb(0 0 0 / 5%) 0px -4px 4px 0px',
|
|
zIndex: 666
|
|
},
|
|
className: [Editmodules.bg, 'pt30', 'pl30', 'pr30', 'pb30', 'mt20'].join(' '),
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
width: '1200px',
|
|
margin: '0px auto',
|
|
display: 'flex',
|
|
alignItems: 'center'
|
|
},
|
|
children: [((_exercise$editData30 = exercise.editData) === null || _exercise$editData30 === void 0 ? void 0 : (_exercise$editData30$ = _exercise$editData30.exercise) === null || _exercise$editData30$ === void 0 ? void 0 : _exercise$editData30$.exercise_status) == 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
style: {
|
|
height: 30,
|
|
marginRight: 10,
|
|
width: 104
|
|
},
|
|
type: "primary",
|
|
onClick: function onClick() {
|
|
_umi_production_exports.history.push("/classrooms/".concat(params === null || params === void 0 ? void 0 : params.coursesId, "/exercise/").concat(params === null || params === void 0 ? void 0 : params.categoryId, "/preview_select"));
|
|
},
|
|
children: "\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9"
|
|
}), ((_exercise$editData31 = exercise.editData) === null || _exercise$editData31 === void 0 ? void 0 : (_exercise$editData31$ = _exercise$editData31.exercise) === null || _exercise$editData31$ === void 0 ? void 0 : _exercise$editData31$.exercise_status) == 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
style: {
|
|
height: 30,
|
|
marginRight: 27,
|
|
width: 104
|
|
},
|
|
type: "primary",
|
|
onClick: handleIn,
|
|
children: "\u6279\u91CF\u5BFC\u5165\u8BD5\u9898"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
marginRight: '27px',
|
|
height: '30px',
|
|
width: 1,
|
|
background: '#F5F5F5'
|
|
}
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
display: 'flex',
|
|
marginRight: 27
|
|
},
|
|
children: ((_exercise$editData32 = exercise.editData) === null || _exercise$editData32 === void 0 ? void 0 : (_exercise$editData32$ = _exercise$editData32.exercise) === null || _exercise$editData32$ === void 0 ? void 0 : _exercise$editData32$.exercise_status) === 1 && questionType.map(function (item) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
style: {
|
|
visibility: item.id === 7 ? 'hidden' : 'visible'
|
|
},
|
|
className: Editmodules.button,
|
|
onClick: function onClick() {
|
|
return addQuestion(item.id);
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-tianjiashitixiaojiahao mr5",
|
|
style: {
|
|
fontSize: '10px',
|
|
color: '#B1BACD'
|
|
}
|
|
}), item.name]
|
|
}, item.id);
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
marginRight: '25px',
|
|
height: '30px',
|
|
width: 1,
|
|
background: '#F5F5F5'
|
|
}
|
|
}), ((_exercise$editData33 = exercise.editData) === null || _exercise$editData33 === void 0 ? void 0 : (_exercise$editData33$ = _exercise$editData33.exercise) === null || _exercise$editData33$ === void 0 ? void 0 : _exercise$editData33$.exercise_status) === 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.Z, {
|
|
style: {
|
|
width: 96,
|
|
height: 30,
|
|
border: '1px solid #98BDF7',
|
|
color: '#145DFF'
|
|
},
|
|
className: "mr8",
|
|
onClick: function onClick() {
|
|
return setDragVisible(true);
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-tixingpaixu mr8",
|
|
style: {
|
|
fontSize: '14px',
|
|
color: '#98BDF7'
|
|
}
|
|
}), "\u9898\u578B\u6392\u5E8F"]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
style: {
|
|
width: 96,
|
|
height: 30,
|
|
border: '1px solid #98BDF7',
|
|
color: '#145DFF'
|
|
},
|
|
className: "mr8",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(_umi_production_exports.Link, {
|
|
to: "/classrooms/".concat(params === null || params === void 0 ? void 0 : params.coursesId, "/exercise/").concat(params === null || params === void 0 ? void 0 : params.categoryId, "/detail?random=false&tabs=2"),
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-yulan mr8",
|
|
style: {
|
|
fontSize: '14px',
|
|
color: '#98BDF7'
|
|
}
|
|
}), "\u9884\u89C8"]
|
|
})
|
|
}), (0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.Z, {
|
|
style: {
|
|
width: 96,
|
|
height: 30,
|
|
border: '1px solid #98BDF7',
|
|
color: '#145DFF'
|
|
},
|
|
onClick: (0,lodash.throttle)(handleIniateAnswer, 3500),
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-monikaoshi1 mr8",
|
|
style: {
|
|
fontSize: '14px',
|
|
color: '#98BDF7'
|
|
}
|
|
}), "\u6A21\u62DF\u8003\u8BD5"]
|
|
})]
|
|
})
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ var Edit = ((0,_umi_production_exports.connect)(function (_ref10) {
|
|
var exercise = _ref10.exercise,
|
|
loading = _ref10.loading,
|
|
user = _ref10.user,
|
|
problemset = _ref10.problemset,
|
|
globalSetting = _ref10.globalSetting;
|
|
return {
|
|
exercise: exercise,
|
|
globalSetting: globalSetting,
|
|
user: user,
|
|
problemset: problemset,
|
|
loading: loading.effects
|
|
};
|
|
})(ShixunsListPage));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 9269:
|
|
/*!*****************************************************************!*\
|
|
!*** ./src/pages/Classrooms/Lists/Exercise/components/util.tsx ***!
|
|
\*****************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "w": function() { return /* binding */ handleCheckModal; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js */ 17061);
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var antd_es_modal_style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/es/modal/style */ 35611);
|
|
/* harmony import */ var antd_es_modal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! antd/es/modal */ 85402);
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/asyncToGenerator.js */ 17156);
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/utils/fetch */ 84519);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ 67294);
|
|
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! umi */ 89214);
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ 85893);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var handleCheckModal = /*#__PURE__*/function () {
|
|
var _ref = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _callee(coursesId, categoryId) {
|
|
var _result;
|
|
var text,
|
|
appraise_type,
|
|
category,
|
|
res,
|
|
result,
|
|
toSkipUrl,
|
|
_args = arguments;
|
|
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
text = _args.length > 2 && _args[2] !== undefined ? _args[2] : '正在进入评阅,请稍后...';
|
|
appraise_type = _args.length > 3 && _args[3] !== undefined ? _args[3] : 1;
|
|
category = _args.length > 4 && _args[4] !== undefined ? _args[4] : 2;
|
|
appraise_type === 1 && (0,umi__WEBPACK_IMPORTED_MODULE_5__.getDvaApp)()._store.dispatch({
|
|
type: "globalSetting/setGlobalLoading",
|
|
payload: {
|
|
show: true,
|
|
text: appraise_type === 1 ? text : '正在检测中,请稍后...'
|
|
}
|
|
});
|
|
_context.next = 6;
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP)("/api/exercises/".concat(categoryId, "/user_appraise_status.json"), {
|
|
method: 'get',
|
|
params: {
|
|
appraise_type: appraise_type
|
|
}
|
|
});
|
|
case 6:
|
|
res = _context.sent;
|
|
if (!((res === null || res === void 0 ? void 0 : res.status) === -1)) {
|
|
_context.next = 11;
|
|
break;
|
|
}
|
|
(0,umi__WEBPACK_IMPORTED_MODULE_5__.getDvaApp)()._store.dispatch({
|
|
type: "globalSetting/setGlobalLoading",
|
|
payload: {
|
|
show: false
|
|
}
|
|
});
|
|
return _context.abrupt("return", Promise.reject());
|
|
case 11:
|
|
result = {
|
|
status: 0
|
|
}; //type 1:直接通过 2:跳转集中阅卷 3:已截止 4: 特殊弹框后端给提示语
|
|
if (!((res === null || res === void 0 ? void 0 : res.type) === 2)) {
|
|
_context.next = 16;
|
|
break;
|
|
}
|
|
_context.next = 15;
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP)("/api/exercises/".concat(categoryId, "/create_appraise_students.json"), {
|
|
method: 'get'
|
|
});
|
|
case 15:
|
|
result = _context.sent;
|
|
case 16:
|
|
(0,umi__WEBPACK_IMPORTED_MODULE_5__.getDvaApp)()._store.dispatch({
|
|
type: "globalSetting/setGlobalLoading",
|
|
payload: {
|
|
show: false,
|
|
text: ''
|
|
}
|
|
});
|
|
if (!(((_result = result) === null || _result === void 0 ? void 0 : _result.status) === -1)) {
|
|
_context.next = 19;
|
|
break;
|
|
}
|
|
return _context.abrupt("return", Promise.reject());
|
|
case 19:
|
|
if (!((res === null || res === void 0 ? void 0 : res.type) === 2)) {
|
|
_context.next = 24;
|
|
break;
|
|
}
|
|
toSkipUrl = function toSkipUrl() {
|
|
var _result2;
|
|
umi__WEBPACK_IMPORTED_MODULE_5__.history.replace("/classrooms/".concat(coursesId, "/exercise/").concat(categoryId, "/centralizeReview/").concat((_result2 = result) === null || _result2 === void 0 ? void 0 : _result2.login));
|
|
};
|
|
antd_es_modal__WEBPACK_IMPORTED_MODULE_7__/* ["default"].confirm */ .Z.confirm({
|
|
centered: true,
|
|
width: 470,
|
|
okText: '确定',
|
|
cancelText: '取消',
|
|
title: '提示',
|
|
keyboard: false,
|
|
onOk: toSkipUrl,
|
|
onCancel: function onCancel() {
|
|
if (category === 1) {
|
|
umi__WEBPACK_IMPORTED_MODULE_5__.history.replace("/classrooms/".concat(coursesId, "/exercise/").concat(categoryId, "/detail"));
|
|
}
|
|
},
|
|
content: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
|
|
children: ["\u60A8\u5DF2\u6210\u4E3A\u6307\u5B9A\u9605\u5377\u6559\u5E08\uFF0C\u662F\u5426\u73B0\u5728\u524D\u5F80", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("span", {
|
|
onClick: toSkipUrl,
|
|
className: "ml5 mr5 c-light-primary current",
|
|
children: "\u96C6\u4E2D\u9605\u5377"
|
|
}), "\u7EE7\u7EED\u8BC4\u9605\uFF1F"]
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
|
|
className: "c-grey-999",
|
|
children: "\uFF08\u9605\u5377\u7ED3\u675F\u540E\u6062\u590D\u5B66\u751F\u4E2A\u4EBA\u8BC4\u9605\u529F\u80FD\uFF0C\u5E76\u5C55\u793A\u5B66\u751F\u6210\u7EE9\uFF09"
|
|
})]
|
|
})
|
|
});
|
|
if (!(category !== 3)) {
|
|
_context.next = 24;
|
|
break;
|
|
}
|
|
return _context.abrupt("return", Promise.reject());
|
|
case 24:
|
|
if (!((res === null || res === void 0 ? void 0 : res.type) === 3)) {
|
|
_context.next = 28;
|
|
break;
|
|
}
|
|
antd_es_modal__WEBPACK_IMPORTED_MODULE_7__/* ["default"].info */ .Z.info({
|
|
centered: true,
|
|
width: 470,
|
|
okText: '确定',
|
|
keyboard: false,
|
|
title: '提示',
|
|
onOk: function onOk() {
|
|
if (category === 1) {
|
|
umi__WEBPACK_IMPORTED_MODULE_5__.history.replace("/classrooms/".concat(coursesId, "/exercise/").concat(categoryId, "/detail"));
|
|
}
|
|
},
|
|
content: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
|
|
children: (res === null || res === void 0 ? void 0 : res.message) || ''
|
|
})
|
|
});
|
|
if (!(category !== 3)) {
|
|
_context.next = 28;
|
|
break;
|
|
}
|
|
return _context.abrupt("return", Promise.reject());
|
|
case 28:
|
|
if (!((res === null || res === void 0 ? void 0 : res.type) === 4)) {
|
|
_context.next = 32;
|
|
break;
|
|
}
|
|
antd_es_modal__WEBPACK_IMPORTED_MODULE_7__/* ["default"].info */ .Z.info({
|
|
centered: true,
|
|
width: 470,
|
|
okText: '确定',
|
|
title: '提示',
|
|
keyboard: false,
|
|
onOk: function onOk() {
|
|
if (category === 1) {
|
|
umi__WEBPACK_IMPORTED_MODULE_5__.history.replace("/classrooms/".concat(coursesId, "/exercise/").concat(categoryId, "/detail"));
|
|
}
|
|
},
|
|
content: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
|
|
children: (res === null || res === void 0 ? void 0 : res.message) || ''
|
|
})
|
|
});
|
|
if (!(category !== 3)) {
|
|
_context.next = 32;
|
|
break;
|
|
}
|
|
return _context.abrupt("return", Promise.reject());
|
|
case 32:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function handleCheckModal(_x, _x2) {
|
|
return _ref.apply(this, arguments);
|
|
};
|
|
}();
|
|
|
|
/***/ })
|
|
|
|
}]); |