|
|
"use strict";
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[45825],{
|
|
|
|
|
|
/***/ 80045:
|
|
|
/*!*******************************************************************************************************************!*\
|
|
|
!*** ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/ExclamationCircleOutlined.js + 1 modules ***!
|
|
|
\*******************************************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ icons_ExclamationCircleOutlined; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(26508);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.3.1@@ant-design/icons-svg/es/asn/ExclamationCircleOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var ExclamationCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "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" } }, { "tag": "path", "attrs": { "d": "M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z" } }] }, "name": "exclamation-circle", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_ExclamationCircleOutlined = (ExclamationCircleOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
|
var AntdIcon = __webpack_require__(91851);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/ExclamationCircleOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ExclamationCircleOutlined_ExclamationCircleOutlined = function ExclamationCircleOutlined(props, ref) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_ExclamationCircleOutlined
|
|
|
}));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_ExclamationCircleOutlined = (/*#__PURE__*/_react_17_0_2_react.forwardRef(ExclamationCircleOutlined_ExclamationCircleOutlined));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 61588:
|
|
|
/*!******************************************************!*\
|
|
|
!*** ./src/components/CodeBox/index.tsx + 1 modules ***!
|
|
|
\******************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ components_CodeBox; }
|
|
|
});
|
|
|
|
|
|
// UNUSED EXPORTS: CodeDeleteModal
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
var regeneratorRuntime = __webpack_require__(10574);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__(39343);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/classCallCheck.js
|
|
|
var classCallCheck = __webpack_require__(94312);
|
|
|
var classCallCheck_default = /*#__PURE__*/__webpack_require__.n(classCallCheck);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/createClass.js
|
|
|
var createClass = __webpack_require__(24127);
|
|
|
var createClass_default = /*#__PURE__*/__webpack_require__.n(createClass);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/assertThisInitialized.js
|
|
|
var assertThisInitialized = __webpack_require__(1300);
|
|
|
var assertThisInitialized_default = /*#__PURE__*/__webpack_require__.n(assertThisInitialized);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/inherits.js
|
|
|
var inherits = __webpack_require__(93242);
|
|
|
var inherits_default = /*#__PURE__*/__webpack_require__.n(inherits);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/createSuper.js
|
|
|
var createSuper = __webpack_require__(10564);
|
|
|
var createSuper_default = /*#__PURE__*/__webpack_require__.n(createSuper);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/defineProperty.js
|
|
|
var defineProperty = __webpack_require__(22060);
|
|
|
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
|
var input = __webpack_require__(1056);
|
|
|
;// CONCATENATED MODULE: ./src/components/CodeBox/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var CodeBoxmodules = ({"codeBox":"codeBox___WpkVl"});
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.3.2@classnames/index.js
|
|
|
var _classnames_2_3_2_classnames = __webpack_require__(12124);
|
|
|
var _classnames_2_3_2_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_3_2_classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/components/CodeBox/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// class定义组件,建议用函数取组件实例,比如 ref={el => box = el}
|
|
|
// onVerify方法校验验证码是否有误
|
|
|
var CodeBox = /*#__PURE__*/function (_Component) {
|
|
|
inherits_default()(CodeBox, _Component);
|
|
|
var _super = createSuper_default()(CodeBox);
|
|
|
function CodeBox(props) {
|
|
|
var _this;
|
|
|
classCallCheck_default()(this, CodeBox);
|
|
|
_this = _super.call(this, props);
|
|
|
defineProperty_default()(assertThisInitialized_default()(_this), "canvas", void 0);
|
|
|
// 生成一个随机数
|
|
|
defineProperty_default()(assertThisInitialized_default()(_this), "randomNum", function (min, max) {
|
|
|
return Math.floor(Math.random() * (max - min) + min);
|
|
|
});
|
|
|
defineProperty_default()(assertThisInitialized_default()(_this), "drawPic", function () {
|
|
|
_this.randomCode();
|
|
|
});
|
|
|
defineProperty_default()(assertThisInitialized_default()(_this), "reloadPic", function () {
|
|
|
_this.drawPic();
|
|
|
});
|
|
|
// 输入验证码
|
|
|
defineProperty_default()(assertThisInitialized_default()(_this), "changeCode", function (e) {
|
|
|
console.log(e.target.value, 222);
|
|
|
_this.setState({
|
|
|
value: e.target.value,
|
|
|
showError: false
|
|
|
});
|
|
|
});
|
|
|
defineProperty_default()(assertThisInitialized_default()(_this), "onVerify", function () {
|
|
|
var error;
|
|
|
if (_this.state.value.toLowerCase() !== '' && _this.state.value.toLowerCase() !== _this.state.code.toLowerCase()) {
|
|
|
error = true;
|
|
|
} else if (_this.state.value.toLowerCase() === '') {
|
|
|
error = true;
|
|
|
} else if (_this.state.value.toLowerCase() === _this.state.code.toLowerCase()) {
|
|
|
error = false;
|
|
|
}
|
|
|
_this.setState({
|
|
|
showError: error
|
|
|
});
|
|
|
return error;
|
|
|
});
|
|
|
_this.canvas = /*#__PURE__*/_react_17_0_2_react.createRef();
|
|
|
_this.state = {
|
|
|
value: '',
|
|
|
code: '',
|
|
|
codeLength: 4,
|
|
|
fontSizeMin: 20,
|
|
|
fontSizeMax: 22,
|
|
|
backgroundColorMin: 240,
|
|
|
backgroundColorMax: 250,
|
|
|
colorMin: 10,
|
|
|
colorMax: 20,
|
|
|
lineColorMin: 40,
|
|
|
lineColorMax: 180,
|
|
|
contentWidth: 96,
|
|
|
contentHeight: 38,
|
|
|
showError: false // 默认不显示验证码的错误信息
|
|
|
};
|
|
|
return _this;
|
|
|
}
|
|
|
createClass_default()(CodeBox, [{
|
|
|
key: "componentDidMount",
|
|
|
value: function componentDidMount() {
|
|
|
this.drawPic();
|
|
|
}
|
|
|
}, {
|
|
|
key: "randomColor",
|
|
|
value:
|
|
|
// 生成一个随机的颜色
|
|
|
function randomColor(min, max) {
|
|
|
var r = this.randomNum(min, max);
|
|
|
var g = this.randomNum(min, max);
|
|
|
var b = this.randomNum(min, max);
|
|
|
return "rgb(".concat(r, ", ").concat(g, ", ").concat(b, ")");
|
|
|
}
|
|
|
}, {
|
|
|
key: "drawText",
|
|
|
value: function drawText(ctx, txt, i) {
|
|
|
ctx.fillStyle = this.randomColor(this.state.colorMin, this.state.colorMax);
|
|
|
var fontSize = this.randomNum(this.state.fontSizeMin, this.state.fontSizeMax);
|
|
|
ctx.font = fontSize + 'px SimHei';
|
|
|
var padding = 10;
|
|
|
var offset = (this.state.contentWidth - 40) / (this.state.code.length - 1);
|
|
|
var x = padding;
|
|
|
if (i > 0) {
|
|
|
x = padding + i * offset;
|
|
|
}
|
|
|
var y = this.randomNum(this.state.fontSizeMax, this.state.contentHeight - 5);
|
|
|
if (fontSize > 40) {
|
|
|
y = 40;
|
|
|
}
|
|
|
var deg = this.randomNum(-10, 10);
|
|
|
// 修改坐标原点和旋转角度
|
|
|
ctx.translate(x, y);
|
|
|
ctx.rotate(deg * Math.PI / 180);
|
|
|
ctx.fillText(txt, 0, 0);
|
|
|
// 恢复坐标原点和旋转角度
|
|
|
ctx.rotate(-deg * Math.PI / 180);
|
|
|
ctx.translate(-x, -y);
|
|
|
}
|
|
|
}, {
|
|
|
key: "drawLine",
|
|
|
value: function drawLine(ctx) {
|
|
|
// 绘制干扰线
|
|
|
for (var i = 0; i < 1; i++) {
|
|
|
ctx.strokeStyle = this.randomColor(this.state.lineColorMin, this.state.lineColorMax);
|
|
|
ctx.beginPath();
|
|
|
ctx.moveTo(this.randomNum(0, this.state.contentWidth), this.randomNum(0, this.state.contentHeight));
|
|
|
ctx.lineTo(this.randomNum(0, this.state.contentWidth), this.randomNum(0, this.state.contentHeight));
|
|
|
ctx.stroke();
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: "drawDot",
|
|
|
value: function drawDot(ctx) {
|
|
|
// 绘制干扰点
|
|
|
for (var i = 0; i < 100; i++) {
|
|
|
ctx.fillStyle = this.randomColor(0, 255);
|
|
|
ctx.beginPath();
|
|
|
ctx.arc(this.randomNum(0, this.state.contentWidth), this.randomNum(0, this.state.contentHeight), 1, 0, 2 * Math.PI);
|
|
|
ctx.fill();
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: "randomCode",
|
|
|
value:
|
|
|
// 随机生成验证码
|
|
|
function randomCode() {
|
|
|
var _this2 = this;
|
|
|
var random = '';
|
|
|
// 去掉了I l i o O,可自行添加
|
|
|
var str = 'QWERTYUPLKJHGFDSAZXCVBNMqwertyupkjhgfdsazxcvbnm1234567890';
|
|
|
for (var i = 0; i < this.state.codeLength; i++) {
|
|
|
var index = Math.floor(Math.random() * 57);
|
|
|
random += str[index];
|
|
|
}
|
|
|
this.setState({
|
|
|
code: random
|
|
|
}, function () {
|
|
|
var canvas = _this2.canvas.current;
|
|
|
var ctx = canvas.getContext('2d');
|
|
|
ctx.textBaseline = 'bottom';
|
|
|
// 绘制背景
|
|
|
ctx.fillStyle = _this2.randomColor(_this2.state.backgroundColorMin, _this2.state.backgroundColorMax);
|
|
|
ctx.fillRect(0, 0, _this2.state.contentWidth, _this2.state.contentHeight);
|
|
|
// 绘制文字
|
|
|
for (var _i = 0; _i < _this2.state.code.length; _i++) {
|
|
|
_this2.drawText(ctx, _this2.state.code[_i], _i);
|
|
|
}
|
|
|
_this2.drawLine(ctx);
|
|
|
_this2.drawDot(ctx);
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
key: "render",
|
|
|
value: function render() {
|
|
|
var _this$props = this.props,
|
|
|
className = _this$props.className,
|
|
|
_this$props$width = _this$props.width,
|
|
|
width = _this$props$width === void 0 ? 300 : _this$props$width;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: _classnames_2_3_2_classnames_default()(CodeBoxmodules.codeBox, className),
|
|
|
style: {
|
|
|
width: width
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
value: this.state.value,
|
|
|
onChange: this.changeCode,
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u56FE\u7247\u4E2D\u7684\u9A8C\u8BC1\u7801"
|
|
|
}), this.state.showError && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: !!this.state.value ? '请输入正确的验证码' : '请输入验证码'
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("canvas", {
|
|
|
onClick: this.reloadPic,
|
|
|
ref: this.canvas,
|
|
|
width: "100",
|
|
|
height: "30"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "current",
|
|
|
onClick: this.reloadPic,
|
|
|
children: "\u770B\u4E0D\u6E05\uFF1F\u6362\u4E00\u5F20"
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
}]);
|
|
|
return CodeBox;
|
|
|
}(_react_17_0_2_react.Component);
|
|
|
var CodeDeleteModal = function CodeDeleteModal(cb, text) {
|
|
|
var box;
|
|
|
Modal.confirm({
|
|
|
centered: true,
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
title: '提示',
|
|
|
content: /*#__PURE__*/_jsxs("div", {
|
|
|
children: [/*#__PURE__*/_jsx("p", {
|
|
|
children: text
|
|
|
}), /*#__PURE__*/_jsx(CodeBox, {
|
|
|
ref: function ref(el) {
|
|
|
return box = el;
|
|
|
}
|
|
|
})]
|
|
|
}),
|
|
|
onOk: function () {
|
|
|
var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
if (!box.onVerify()) {
|
|
|
_context.next = 2;
|
|
|
break;
|
|
|
}
|
|
|
return _context.abrupt("return", Promise.reject());
|
|
|
case 2:
|
|
|
cb();
|
|
|
case 3:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
function onOk() {
|
|
|
return _onOk.apply(this, arguments);
|
|
|
}
|
|
|
return onOk;
|
|
|
}()
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_CodeBox = (CodeBox);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 31917:
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./src/components/NoData/index.tsx ***!
|
|
|
\*****************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js */ 26801);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ 59301);
|
|
|
/* harmony import */ var _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/assets/images/icons/nodata.png */ 4977);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ 3113);
|
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var noData = function noData(_ref) {
|
|
|
var img = _ref.img,
|
|
|
_ref$buttonProps = _ref.buttonProps,
|
|
|
buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
|
|
|
_ref$styles = _ref.styles,
|
|
|
styles = _ref$styles === void 0 ? {} : _ref$styles,
|
|
|
customText = _ref.customText,
|
|
|
ButtonText = _ref.ButtonText,
|
|
|
ButtonClick = _ref.ButtonClick,
|
|
|
Buttonclass = _ref.Buttonclass,
|
|
|
ButtonTwo = _ref.ButtonTwo,
|
|
|
imgStyles = _ref.imgStyles,
|
|
|
_ref$loading = _ref.loading,
|
|
|
loading = _ref$loading === void 0 ? false : _ref$loading;
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("section", {
|
|
|
className: "tc animated fadeIn",
|
|
|
style: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, {
|
|
|
color: '#999',
|
|
|
margin: '100px auto',
|
|
|
visibility: loading ? 'hidden' : 'visible'
|
|
|
}), styles),
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("img", {
|
|
|
src: img || _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_2__,
|
|
|
style: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, imgStyles)
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p", {
|
|
|
className: "mt20 font14",
|
|
|
children: customText || '暂时还没有相关数据哦!'
|
|
|
}), ButtonText && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({
|
|
|
className: Buttonclass,
|
|
|
onClick: ButtonClick
|
|
|
}, buttonProps), {}, {
|
|
|
children: ButtonText
|
|
|
})), ButtonTwo && ButtonTwo]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ __webpack_exports__.Z = (noData);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 22572:
|
|
|
/*!*******************************************************!*\
|
|
|
!*** ./src/components/ResTable/index.tsx + 2 modules ***!
|
|
|
\*******************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ components_ResTable; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/toConsumableArray.js
|
|
|
var toConsumableArray = __webpack_require__(93923);
|
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(26801);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(11006);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectWithoutProperties.js
|
|
|
var objectWithoutProperties = __webpack_require__(27161);
|
|
|
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react-resizable@1.11.0@react-resizable/index.js
|
|
|
var _react_resizable_1_11_0_react_resizable = __webpack_require__(9221);
|
|
|
;// CONCATENATED MODULE: ./src/components/ResTable/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/components/ResTable/resizable.tsx
|
|
|
|
|
|
|
|
|
var _excluded = ["onResize", "width"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ResizeableTitle = function ResizeableTitle(_ref) {
|
|
|
var onResize = _ref.onResize,
|
|
|
width = _ref.width,
|
|
|
restProps = objectWithoutProperties_default()(_ref, _excluded);
|
|
|
if (!width) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("th", objectSpread2_default()({}, restProps));
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(_react_resizable_1_11_0_react_resizable.Resizable, {
|
|
|
width: width,
|
|
|
height: 0,
|
|
|
handle: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "react-resizable-handle",
|
|
|
onClick: function onClick(e) {
|
|
|
e.stopPropagation();
|
|
|
}
|
|
|
}),
|
|
|
onResize: onResize,
|
|
|
draggableOpts: {
|
|
|
enableUserSelectHack: false
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("th", objectSpread2_default()({}, restProps))
|
|
|
});
|
|
|
};
|
|
|
var tableComponent = {
|
|
|
header: {
|
|
|
cell: ResizeableTitle
|
|
|
}
|
|
|
};
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
|
|
|
var table = __webpack_require__(72315);
|
|
|
;// CONCATENATED MODULE: ./src/components/ResTable/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ResTable_excluded = ["pagination", "resColumns", "dataSource", "onRow"];
|
|
|
/*
|
|
|
* @Author: z-l
|
|
|
* @Date: 2020-11-06 18:10:59
|
|
|
* @LastEditTime: 2020-11-09 15:06:34
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
* @Description: 可拖拽表头 table
|
|
|
* @FilePath: /ppte5yg23/src/components/ResTable/index.tsx
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @description: 可拖拽表头
|
|
|
* @param {*}
|
|
|
* pagination: 分页信息
|
|
|
dataSource: 展示数据
|
|
|
resColumns: 表头
|
|
|
rowSelection?: 可选 多选 单选配置
|
|
|
hideSelectAll?: antd-version@4.3.0 可用 隐藏全选
|
|
|
className?: 自定义样式名称
|
|
|
* @return {*}
|
|
|
*/
|
|
|
var ResTable = function ResTable(_ref) {
|
|
|
var pagination = _ref.pagination,
|
|
|
resColumns = _ref.resColumns,
|
|
|
dataSource = _ref.dataSource,
|
|
|
onRow = _ref.onRow,
|
|
|
restProps = objectWithoutProperties_default()(_ref, ResTable_excluded);
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
isLoading = _useState2[0],
|
|
|
setIsLoading = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([{}]),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
Columns = _useState4[0],
|
|
|
setColumns = _useState4[1];
|
|
|
var modelStatusRef = (0,_react_17_0_2_react.useRef)(null);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
var column = resColumns;
|
|
|
column = column.map(function (col, index) {
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, col), {}, {
|
|
|
onHeaderCell: function onHeaderCell(item) {
|
|
|
return {
|
|
|
width: item.width,
|
|
|
onResize: handleResize(index)
|
|
|
};
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
setColumns(column);
|
|
|
}, []);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
// 每次 更新 把值 复制给 modelStatusRef
|
|
|
modelStatusRef.current = Columns;
|
|
|
}, [Columns]); // 依赖的值 等modelStatus 改变了 才出发里面的值
|
|
|
var handleResize = function handleResize(index) {
|
|
|
return function (e, _ref2) {
|
|
|
var size = _ref2.size;
|
|
|
//console.log(modelStatusRef.current)
|
|
|
// console.log(size);
|
|
|
var nextColumns = toConsumableArray_default()(modelStatusRef.current);
|
|
|
nextColumns[index] = objectSpread2_default()(objectSpread2_default()({}, nextColumns[index]), {}, {
|
|
|
width: size.width
|
|
|
});
|
|
|
setColumns(nextColumns);
|
|
|
// console.log(Columns, nextColumns);
|
|
|
};
|
|
|
};
|
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, objectSpread2_default()(objectSpread2_default()({
|
|
|
bordered: true,
|
|
|
components: tableComponent,
|
|
|
columns: Columns,
|
|
|
dataSource: dataSource,
|
|
|
pagination: pagination,
|
|
|
loading: isLoading,
|
|
|
onRow: onRow
|
|
|
}, restProps), {}, {
|
|
|
rowKey: function rowKey(record) {
|
|
|
return record.key || record.id;
|
|
|
}
|
|
|
}))
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_ResTable = (ResTable);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 75002:
|
|
|
/*!*******************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/Exercise/index.tsx + 8 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 */ Exercise; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
var regeneratorRuntime = __webpack_require__(10574);
|
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/toConsumableArray.js
|
|
|
var toConsumableArray = __webpack_require__(93923);
|
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__(39343);
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(26801);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(11006);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectWithoutProperties.js
|
|
|
var objectWithoutProperties = __webpack_require__(27161);
|
|
|
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
|
|
|
var _umi_production_exports = __webpack_require__(7181);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
|
var es_modal = __webpack_require__(43418);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/menu/index.js + 11 modules
|
|
|
var menu = __webpack_require__(20834);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
|
|
var message = __webpack_require__(8591);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/skeleton/index.js + 12 modules
|
|
|
var skeleton = __webpack_require__(59981);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
|
|
|
var pagination = __webpack_require__(41867);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/affix/index.js + 2 modules
|
|
|
var affix = __webpack_require__(81228);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.10@dayjs/dayjs.min.js
|
|
|
var dayjs_min = __webpack_require__(9498);
|
|
|
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
|
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
|
var authority = __webpack_require__(71633);
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
var util = __webpack_require__(87885);
|
|
|
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
|
|
var NoData = __webpack_require__(31917);
|
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
|
var fetch = __webpack_require__(4781);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tabs/index.js + 24 modules
|
|
|
var tabs = __webpack_require__(99313);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
|
|
|
var es_form = __webpack_require__(78241);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input-number/index.js + 14 modules
|
|
|
var input_number = __webpack_require__(85731);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/select/index.js
|
|
|
var es_select = __webpack_require__(57809);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
|
var input = __webpack_require__(1056);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react-infinite-scroller@1.2.4@react-infinite-scroller/index.js
|
|
|
var _react_infinite_scroller_1_2_4_react_infinite_scroller = __webpack_require__(26724);
|
|
|
var _react_infinite_scroller_1_2_4_react_infinite_scroller_default = /*#__PURE__*/__webpack_require__.n(_react_infinite_scroller_1_2_4_react_infinite_scroller);
|
|
|
// EXTERNAL MODULE: ./src/components/ResTable/index.tsx + 2 modules
|
|
|
var ResTable = __webpack_require__(22572);
|
|
|
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/Exercise/index.less?modules
|
|
|
var Exercisemodules = __webpack_require__(3450);
|
|
|
// EXTERNAL MODULE: ./src/utils/verifyLogin.tsx + 2 modules
|
|
|
var verifyLogin = __webpack_require__(39090);
|
|
|
// EXTERNAL MODULE: ./src/components/ReuseShixunModal/index.tsx + 1 modules
|
|
|
var ReuseShixunModal = __webpack_require__(40598);
|
|
|
// EXTERNAL MODULE: ./src/service/global.ts
|
|
|
var global = __webpack_require__(80395);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/components/SelectExercise.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var TabPane = tabs/* default */.Z.TabPane;
|
|
|
var CuttOffNowShixun = function CuttOffNowShixun(_ref) {
|
|
|
var _teachGroupData$group;
|
|
|
var classroomList = _ref.classroomList,
|
|
|
exercise = _ref.exercise,
|
|
|
loading = _ref.loading,
|
|
|
dispatch = _ref.dispatch;
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
var location = (0,_umi_production_exports.useLocation)();
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var brankList = exercise.brankList;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(true),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
hasMore = _useState2[0],
|
|
|
setHasMore = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
btnLoading = _useState4[0],
|
|
|
setBtnLoading = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)("myself"),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
tabKey = _useState6[0],
|
|
|
setTabKey = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
tabData = _useState8[0],
|
|
|
setTabData = _useState8[1];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
teachGroupData = _useState10[0],
|
|
|
setTeachGroupData = _useState10[1];
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(),
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
isTeacher = _useState12[0],
|
|
|
setIsTeacher = _useState12[1]; //是否为已认证老师
|
|
|
var _useState13 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
|
groupIdsInitialValues = _useState14[0],
|
|
|
setGroupIdsInitialValues = _useState14[1];
|
|
|
var scroll = (0,_react_17_0_2_react.useRef)(null);
|
|
|
var _useState15 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState16 = slicedToArray_default()(_useState15, 2),
|
|
|
isTips = _useState16[0],
|
|
|
setisTips = _useState16[1];
|
|
|
var _useState17 = (0,_react_17_0_2_react.useState)(''),
|
|
|
_useState18 = slicedToArray_default()(_useState17, 2),
|
|
|
DetailUrl = _useState18[0],
|
|
|
setDetailUrl = _useState18[1]; //跳转 试卷设置页面
|
|
|
var _useState19 = (0,_react_17_0_2_react.useState)(""),
|
|
|
_useState20 = slicedToArray_default()(_useState19, 2),
|
|
|
EditUrl = _useState20[0],
|
|
|
setEditUrl = _useState20[1]; //跳转 试卷编辑页面
|
|
|
var columns = [{
|
|
|
title: "试卷名称",
|
|
|
dataIndex: "name",
|
|
|
width: 150,
|
|
|
ellipsis: true,
|
|
|
align: 'left'
|
|
|
}, {
|
|
|
title: "知识点",
|
|
|
dataIndex: "course_list_name",
|
|
|
width: 150,
|
|
|
ellipsis: true,
|
|
|
align: 'left'
|
|
|
}, {
|
|
|
title: "类型",
|
|
|
dataIndex: "is_random",
|
|
|
width: 90,
|
|
|
align: 'left',
|
|
|
render: function render(v) {
|
|
|
return v ? '随机组卷' : '人工组卷';
|
|
|
}
|
|
|
}, {
|
|
|
title: "更新时间",
|
|
|
dataIndex: "updated_at",
|
|
|
width: 150,
|
|
|
align: 'left'
|
|
|
}, {
|
|
|
title: "试题数",
|
|
|
dataIndex: "item_num",
|
|
|
width: 60,
|
|
|
align: 'center'
|
|
|
}, {
|
|
|
title: "总分",
|
|
|
dataIndex: "total_score",
|
|
|
width: 60,
|
|
|
align: 'center'
|
|
|
}, {
|
|
|
title: "操作",
|
|
|
dataIndex: "is_random",
|
|
|
width: 60,
|
|
|
align: 'center',
|
|
|
render: function render(v, r) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: v ? "/randompaper/detail/".concat(r.id) : "/paperlibrary/see/".concat(r.id, "?defaultActiveKey=1"),
|
|
|
target: "_blank>",
|
|
|
children: "\u9884\u89C8"
|
|
|
});
|
|
|
}
|
|
|
}];
|
|
|
var _useState21 = (0,_react_17_0_2_react.useState)({
|
|
|
page: 0,
|
|
|
limit: 20,
|
|
|
group_id: null,
|
|
|
object_type: 'examination_bank',
|
|
|
search: '',
|
|
|
filter: 'myself'
|
|
|
}),
|
|
|
_useState22 = slicedToArray_default()(_useState21, 2),
|
|
|
query = _useState22[0],
|
|
|
setQuery = _useState22[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (exercise.actionTabs.key === '试卷选用') {
|
|
|
getData();
|
|
|
setGroupIdsInitialValues([]);
|
|
|
getTeachGroupData();
|
|
|
}
|
|
|
}, [exercise.actionTabs.key]);
|
|
|
var getTeachGroupData = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return dispatch({
|
|
|
type: 'paperlibrary/getTeachGroupData'
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context.sent;
|
|
|
setTeachGroupData(res);
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function getTeachGroupData() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var parser = function parser(v) {
|
|
|
var num = parseInt(v);
|
|
|
return isNaN(num) ? '' : num;
|
|
|
};
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
var _res$object_list, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
if (!hasMore) {
|
|
|
_context2.next = 11;
|
|
|
break;
|
|
|
}
|
|
|
++query.page;
|
|
|
setHasMore(false);
|
|
|
_context2.next = 5;
|
|
|
return dispatch({
|
|
|
type: 'exercise/getBrankList',
|
|
|
payload: objectSpread2_default()({}, query)
|
|
|
});
|
|
|
case 5:
|
|
|
res = _context2.sent;
|
|
|
tabData = res !== null && res !== void 0 && res.object_list ? toConsumableArray_default()(tabData.concat(res === null || res === void 0 ? void 0 : res.object_list)) : tabData;
|
|
|
setIsTeacher(res.is_teacher);
|
|
|
if (((_res$object_list = res.object_list) === null || _res$object_list === void 0 ? void 0 : _res$object_list.length) < query.limit) {
|
|
|
setHasMore(false);
|
|
|
} else {
|
|
|
setHasMore(true);
|
|
|
}
|
|
|
;
|
|
|
setTabData(toConsumableArray_default()(tabData));
|
|
|
case 11:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function getData() {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleChangeTeachGroup = function handleChangeTeachGroup(id) {
|
|
|
scroll.current.scrollTop = 0;
|
|
|
tabData = [];
|
|
|
query.page = 0;
|
|
|
query.group_id = id;
|
|
|
hasMore = true;
|
|
|
setGroupIdsInitialValues([]);
|
|
|
setQuery(objectSpread2_default()({}, query));
|
|
|
getData();
|
|
|
};
|
|
|
var rowSelection = {
|
|
|
selectedRowKeys: groupIdsInitialValues,
|
|
|
onChange: function onChange(e) {
|
|
|
setGroupIdsInitialValues(e);
|
|
|
},
|
|
|
type: "radio"
|
|
|
};
|
|
|
var onCancel = function onCancel() {
|
|
|
var param = {
|
|
|
page: 0,
|
|
|
limit: 20,
|
|
|
group_id: null,
|
|
|
object_type: 'examination_bank',
|
|
|
search: '',
|
|
|
filter: 'myself'
|
|
|
};
|
|
|
setQuery(objectSpread2_default()({}, param));
|
|
|
setTabData([]);
|
|
|
setHasMore(true);
|
|
|
setTabKey('myself');
|
|
|
dispatch({
|
|
|
type: 'exercise/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
setBtnLoading(false);
|
|
|
};
|
|
|
var _useReuseModal = (0,ReuseShixunModal/* useReuseModal */.P)(),
|
|
|
_useReuseModal2 = slicedToArray_default()(_useReuseModal, 4),
|
|
|
reuseModalVisible = _useReuseModal2[0],
|
|
|
closeReuseModal = _useReuseModal2[1],
|
|
|
renderData = _useReuseModal2[2],
|
|
|
showReuseModal = _useReuseModal2[3];
|
|
|
var reuseModalCallback = /*#__PURE__*/function () {
|
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(shixunList) {
|
|
|
var is_random, shixunsInfo, res, name, modal;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
case 0:
|
|
|
// let need_authorize = false;
|
|
|
is_random = false;
|
|
|
tabData.forEach(function (e) {
|
|
|
// if (groupIdsInitialValues.includes(e.id) && e.need_authorize) {
|
|
|
// need_authorize = e.need_authorize;
|
|
|
// }
|
|
|
if (groupIdsInitialValues.includes(e.id)) {
|
|
|
is_random = e.is_random;
|
|
|
}
|
|
|
});
|
|
|
shixunsInfo = shixunList.map(function (item) {
|
|
|
return {
|
|
|
shixun_id: item.id,
|
|
|
is_use: item.is_use,
|
|
|
is_copy: item.is_copy
|
|
|
};
|
|
|
});
|
|
|
if (is_random) {
|
|
|
_context4.next = 9;
|
|
|
break;
|
|
|
}
|
|
|
_context4.next = 6;
|
|
|
return dispatch({
|
|
|
type: 'exercise/saveBanks',
|
|
|
payload: {
|
|
|
course_id: params.coursesId,
|
|
|
object_type: "examination_bank",
|
|
|
bank_id: groupIdsInitialValues,
|
|
|
shixuns_info: shixunsInfo
|
|
|
// categoryId: params.categoryId
|
|
|
}
|
|
|
});
|
|
|
case 6:
|
|
|
res = _context4.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
// console.log(res, "-----------res");
|
|
|
(0,util/* trackEvent */.L9)(['教学课堂', '试卷', '试卷选用']);
|
|
|
dispatch({
|
|
|
type: 'classroomList/getClassroomExercisesList',
|
|
|
payload: objectSpread2_default()({}, exercise.actionTabs.params)
|
|
|
});
|
|
|
// console.log(`classrooms/${res.course_identifier}/exercise/${res.exercise_id}/detail?random=${res.is_random}`);
|
|
|
setDetailUrl("/classrooms/".concat(params.coursesId, "/exercise/").concat(res.exercise_id, "/detail?random=").concat(res.is_random, "&tabs=3"));
|
|
|
setEditUrl("/classrooms/".concat(params.coursesId, "/exercise/add/").concat(res.exercise_id, "?random=").concat(res.is_random, "&type=2"));
|
|
|
setisTips(true);
|
|
|
message/* default */.ZP.success('生成试卷成功');
|
|
|
closeReuseModal();
|
|
|
onCancel();
|
|
|
}
|
|
|
return _context4.abrupt("return");
|
|
|
case 9:
|
|
|
dispatch({
|
|
|
type: 'exercise/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
closeReuseModal();
|
|
|
name = 1;
|
|
|
modal = es_modal/* default */.Z.confirm({
|
|
|
icon: null,
|
|
|
className: 'custom-modal-divider',
|
|
|
centered: true,
|
|
|
width: 500,
|
|
|
maskClosable: false,
|
|
|
keyboard: false,
|
|
|
cancelButtonProps: {
|
|
|
disabled: false
|
|
|
},
|
|
|
title: '配置出卷数量',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Exercisemodules/* default */.Z.modalColumn,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Exercisemodules/* default */.Z.modalRow,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("sup", {
|
|
|
className: Exercisemodules/* default */.Z.sup,
|
|
|
children: "*"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
flexShrink: 0
|
|
|
},
|
|
|
children: "\u968F\u673A\u51FA\u5377\u6570\u91CF\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
|
|
|
parser: parser,
|
|
|
style: {
|
|
|
width: 120
|
|
|
},
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u8BD5\u5377\u6570\u91CF",
|
|
|
min: 1,
|
|
|
defaultValue: name,
|
|
|
onChange: function onChange(e) {
|
|
|
name = e;
|
|
|
var dom = document.getElementById('model_error');
|
|
|
if (name < 1 || name > 50) {
|
|
|
dom.style.display = 'block';
|
|
|
} else {
|
|
|
dom.style.display = 'none';
|
|
|
}
|
|
|
}
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
display: 'none',
|
|
|
marginLeft: 106
|
|
|
},
|
|
|
id: "model_error",
|
|
|
className: "c-red",
|
|
|
children: "\u8BF7\u8F93\u51651-50\u4E4B\u95F4\u7684\u6574\u6570"
|
|
|
})]
|
|
|
}),
|
|
|
okText: '确认',
|
|
|
cancelText: '取消',
|
|
|
onCancel: onCancel,
|
|
|
onOk: function () {
|
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
var dom, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
if (!(name < 1 || name > 50)) {
|
|
|
_context3.next = 4;
|
|
|
break;
|
|
|
}
|
|
|
dom = document.getElementById('model_error');
|
|
|
dom.style.display = 'block';
|
|
|
return _context3.abrupt("return", Promise.reject());
|
|
|
case 4:
|
|
|
modal.update({
|
|
|
cancelButtonProps: {
|
|
|
disabled: true
|
|
|
}
|
|
|
});
|
|
|
_context3.next = 7;
|
|
|
return dispatch({
|
|
|
type: 'exercise/saveBanks',
|
|
|
payload: {
|
|
|
course_id: params.coursesId,
|
|
|
object_type: "examination_bank",
|
|
|
bank_id: groupIdsInitialValues,
|
|
|
shixuns_info: shixunsInfo,
|
|
|
// categoryId: params.categoryId,
|
|
|
num: name
|
|
|
}
|
|
|
});
|
|
|
case 7:
|
|
|
res = _context3.sent;
|
|
|
modal.update({
|
|
|
cancelButtonProps: {
|
|
|
disabled: false
|
|
|
}
|
|
|
});
|
|
|
if (res && res.status === 0) {
|
|
|
(0,util/* trackEvent */.L9)(['教学课堂', '试卷', '试卷选用']);
|
|
|
es_modal/* default */.Z.destroyAll();
|
|
|
dispatch({
|
|
|
type: 'classroomList/getClassroomExercisesList',
|
|
|
payload: objectSpread2_default()({}, exercise.actionTabs.params)
|
|
|
});
|
|
|
onCancel();
|
|
|
closeReuseModal();
|
|
|
message/* default */.ZP.success('生成试卷成功');
|
|
|
} else {
|
|
|
onCancel();
|
|
|
closeReuseModal();
|
|
|
}
|
|
|
case 10:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
function onOk() {
|
|
|
return _onOk.apply(this, arguments);
|
|
|
}
|
|
|
return onOk;
|
|
|
}()
|
|
|
});
|
|
|
case 13:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee4);
|
|
|
}));
|
|
|
return function reuseModalCallback(_x) {
|
|
|
return _ref4.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
width: 980,
|
|
|
title: "\u9009\u62E9\u8BD5\u5377",
|
|
|
maskClosable: false,
|
|
|
destroyOnClose: true,
|
|
|
open: exercise.actionTabs.key === '试卷选用',
|
|
|
okText: "\u786E\u5B9A",
|
|
|
cancelText: "\u53D6\u6D88",
|
|
|
confirmLoading: btnLoading,
|
|
|
bodyStyle: {
|
|
|
minHeight: 200
|
|
|
},
|
|
|
wrapClassName: Exercisemodules/* default */.Z.warpModal,
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
|
|
|
var _classroomList$detail;
|
|
|
var need_authorize, is_random, hasUsedShixun;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
case 0:
|
|
|
if (groupIdsInitialValues.length) {
|
|
|
_context5.next = 3;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.error('请选择试卷');
|
|
|
return _context5.abrupt("return");
|
|
|
case 3:
|
|
|
setBtnLoading(true);
|
|
|
need_authorize = false;
|
|
|
is_random = false;
|
|
|
tabData.forEach(function (e) {
|
|
|
if (groupIdsInitialValues.includes(e.id) && e.need_authorize) {
|
|
|
need_authorize = e.need_authorize;
|
|
|
}
|
|
|
if (groupIdsInitialValues.includes(e.id)) {
|
|
|
is_random = e.is_random;
|
|
|
}
|
|
|
});
|
|
|
if (!need_authorize) {
|
|
|
_context5.next = 10;
|
|
|
break;
|
|
|
}
|
|
|
(0,verifyLogin/* AuthorizeModel */.rX)(false, '该试卷中包含实训需授权后才可使用。 您可以在QQ服务群向管理员申请,获得继续操作的权限。');
|
|
|
return _context5.abrupt("return");
|
|
|
case 10:
|
|
|
_context5.next = 12;
|
|
|
return showReuseModal({
|
|
|
id: "".concat(groupIdsInitialValues[0]),
|
|
|
course_id: (_classroomList$detail = classroomList.detailTopBanner) === null || _classroomList$detail === void 0 ? void 0 : _classroomList$detail.course_id,
|
|
|
type: 'examination_bank'
|
|
|
});
|
|
|
case 12:
|
|
|
hasUsedShixun = _context5.sent;
|
|
|
if (!hasUsedShixun) {
|
|
|
// 没有实训的学生
|
|
|
reuseModalCallback([]);
|
|
|
}
|
|
|
setBtnLoading(false);
|
|
|
case 15:
|
|
|
case "end":
|
|
|
return _context5.stop();
|
|
|
}
|
|
|
}, _callee5);
|
|
|
})),
|
|
|
onCancel: onCancel,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(tabs/* default */.Z, {
|
|
|
activeKey: tabKey,
|
|
|
onTabClick: /*#__PURE__*/function () {
|
|
|
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6(key) {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
|
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
|
case 0:
|
|
|
scroll.current.scrollTop = 0;
|
|
|
tabData = [];
|
|
|
if (tabKey !== key) {
|
|
|
setGroupIdsInitialValues([]);
|
|
|
}
|
|
|
setTabKey(key);
|
|
|
query.page = 0;
|
|
|
query.filter = key;
|
|
|
query.group_id = null;
|
|
|
hasMore = true;
|
|
|
getData();
|
|
|
case 9:
|
|
|
case "end":
|
|
|
return _context6.stop();
|
|
|
}
|
|
|
}, _callee6);
|
|
|
}));
|
|
|
return function (_x2) {
|
|
|
return _ref6.apply(this, arguments);
|
|
|
};
|
|
|
}(),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(TabPane, {
|
|
|
tab: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u6211\u7684\u8BD5\u5377\u5E93"
|
|
|
})
|
|
|
}, "myself"), /*#__PURE__*/(0,jsx_runtime.jsx)(TabPane, {
|
|
|
tab: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u6559\u7814\u5171\u4EAB"
|
|
|
})
|
|
|
}, "teacher"), /*#__PURE__*/(0,jsx_runtime.jsx)(TabPane, {
|
|
|
tab: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u516C\u5171\u8BD5\u5377\u5E93"
|
|
|
})
|
|
|
}, "public")]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Exercisemodules/* default */.Z.tabSearch,
|
|
|
children: [tabKey === "teacher" && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
|
|
|
value: query.group_id,
|
|
|
onChange: handleChangeTeachGroup,
|
|
|
size: 'middle',
|
|
|
style: {
|
|
|
width: 200,
|
|
|
marginRight: 30
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
value: null,
|
|
|
children: "\u5168\u90E8\u6559\u7814\u56E2\u961F"
|
|
|
}), teachGroupData === null || teachGroupData === void 0 || (_teachGroupData$group = teachGroupData.groups) === null || _teachGroupData$group === void 0 ? void 0 : _teachGroupData$group.map(function (e) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
value: e === null || e === void 0 ? void 0 : e.group_id,
|
|
|
children: e === null || e === void 0 ? void 0 : e.name
|
|
|
}, e === null || e === void 0 ? void 0 : e.group_id);
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0\u8FDB\u884C\u641C\u7D22",
|
|
|
value: query.search,
|
|
|
onChange: function onChange(e) {
|
|
|
query.search = e.target.value;
|
|
|
setQuery(objectSpread2_default()({}, query));
|
|
|
},
|
|
|
onSearch: function onSearch(value) {
|
|
|
scroll.current.scrollTop = 0;
|
|
|
tabData = [];
|
|
|
query.page = 0;
|
|
|
hasMore = true;
|
|
|
setGroupIdsInitialValues([]);
|
|
|
if (value) {
|
|
|
(0,global/* addSearchRecord */.tk)({
|
|
|
name: value,
|
|
|
copywriting: value,
|
|
|
position: 'Exercise'
|
|
|
});
|
|
|
}
|
|
|
getData();
|
|
|
}
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
ref: scroll,
|
|
|
style: {
|
|
|
maxHeight: 350,
|
|
|
overflowY: 'auto',
|
|
|
overflowX: 'hidden',
|
|
|
marginTop: 10,
|
|
|
paddingBottom: 20
|
|
|
},
|
|
|
children: [!isTeacher && tabKey === 'public' && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
display: 'flex',
|
|
|
flexDirection: 'column',
|
|
|
paddingTop: '30px',
|
|
|
alignItems: 'center',
|
|
|
justifyContent: 'center'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u901A\u8FC7\u804C\u4E1A\u8BA4\u8BC1\u7684\u6559\u5E08\u624D\u80FD\u8BBF\u95EE\u516C\u5171\u8BFE\u7A0B\u8D44\u6E90\u5E93"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
style: {
|
|
|
cursor: 'pointer',
|
|
|
background: '#ff6800',
|
|
|
height: '30px',
|
|
|
textAlign: 'center',
|
|
|
marginTop: '5px',
|
|
|
padding: '5px 0px',
|
|
|
color: '#fff',
|
|
|
width: '80px'
|
|
|
},
|
|
|
onClick: function onClick() {
|
|
|
window.open("/account/certification");
|
|
|
},
|
|
|
children: "\u7ACB\u5373\u8BA4\u8BC1"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)((_react_infinite_scroller_1_2_4_react_infinite_scroller_default()), {
|
|
|
initialLoad: false,
|
|
|
pageStart: 0,
|
|
|
loadMore: function loadMore() {
|
|
|
getData();
|
|
|
},
|
|
|
hasMore: hasMore,
|
|
|
useWindow: false,
|
|
|
children: exercise.actionTabs.key === '试卷选用' && isTeacher && /*#__PURE__*/(0,jsx_runtime.jsx)(ResTable/* default */.Z, {
|
|
|
className: Exercisemodules/* default */.Z.hideHeadCheckbox,
|
|
|
pagination: false,
|
|
|
hideSelectAll: true // antd-version 4.3.0
|
|
|
,
|
|
|
dataSource: tabData,
|
|
|
onRow: function onRow(record) {
|
|
|
return {
|
|
|
onClick: function onClick() {
|
|
|
setGroupIdsInitialValues([record === null || record === void 0 ? void 0 : record.id]);
|
|
|
} // 点击行
|
|
|
};
|
|
|
},
|
|
|
|
|
|
resColumns: columns,
|
|
|
rowSelection: rowSelection
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_modal/* default */.Z, {
|
|
|
title: "\u63D0\u793A",
|
|
|
open: isTips,
|
|
|
confirmLoading: false //确定按钮loading
|
|
|
,
|
|
|
centered: true,
|
|
|
okText: "\u8BBE\u7F6E\u89C4\u5219",
|
|
|
cancelText: "\u4FEE\u6539\u8BD5\u5377",
|
|
|
footer: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
onClick: function onClick() {
|
|
|
setisTips(false); //修改试卷跳转
|
|
|
_umi_production_exports.history.push(EditUrl);
|
|
|
},
|
|
|
children: "\u4FEE\u6539\u8BD5\u5377"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
onClick: function onClick() {
|
|
|
_umi_production_exports.history.push(DetailUrl); //跳转到试卷,规则设置页面
|
|
|
setisTips(false);
|
|
|
},
|
|
|
children: "\u8BBE\u7F6E\u89C4\u5219"
|
|
|
})]
|
|
|
}),
|
|
|
onCancel: function onCancel() {
|
|
|
setisTips(false); //修改试卷跳转
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: "\u8BD5\u5377\u521B\u5EFA\u5B8C\u6210\uFF01\u76EE\u524D\u5904\u4E8E\u672A\u53D1\u5E03\u72B6\u6001\uFF0C\u662F\u5426\u8BBE\u7F6E\u8003\u8BD5\u89C4\u5219\uFF1F"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(ReuseShixunModal/* default */.Z, {
|
|
|
inPaper: true,
|
|
|
visible: reuseModalVisible,
|
|
|
onCancel: closeReuseModal,
|
|
|
onOk: reuseModalCallback,
|
|
|
renderData: renderData,
|
|
|
modalType: "multiple",
|
|
|
type: "examination_bank"
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var SelectExercise = ((0,_umi_production_exports.connect)(function (_ref7) {
|
|
|
var exercise = _ref7.exercise,
|
|
|
loading = _ref7.loading,
|
|
|
classroomList = _ref7.classroomList;
|
|
|
return {
|
|
|
exercise: exercise,
|
|
|
loading: loading,
|
|
|
classroomList: classroomList
|
|
|
};
|
|
|
})(CuttOffNowShixun));
|
|
|
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/Exercise/components/Publish.tsx
|
|
|
var Publish = __webpack_require__(47828);
|
|
|
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/Exercise/components/CutOffNow.tsx
|
|
|
var CutOffNow = __webpack_require__(58101);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/components/SetPublic.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var SetPublic = function SetPublic(_ref) {
|
|
|
var exercise = _ref.exercise,
|
|
|
dispatch = _ref.dispatch;
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
title: "\u63D0\u793A",
|
|
|
open: exercise.actionTabs.key === '设为公开' ? true : false,
|
|
|
okText: "\u786E\u5B9A",
|
|
|
cancelText: "\u53D6\u6D88",
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return (0,fetch/* default */.ZP)("/api/courses/".concat(params.coursesId, "/exercises/set_public.json"), {
|
|
|
method: 'post',
|
|
|
body: {
|
|
|
check_ids: toConsumableArray_default()(exercise.actionTabs.selectArrs)
|
|
|
}
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context.sent;
|
|
|
if (res.status === 0) {
|
|
|
(0,util/* trackEvent */.L9)(['教学课堂', '试卷', '设为公开']);
|
|
|
message/* default */.ZP.success('操作成功');
|
|
|
dispatch({
|
|
|
type: 'exercise/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'classroomList/getClassroomExercisesList',
|
|
|
payload: objectSpread2_default()({}, exercise.actionTabs.params)
|
|
|
});
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
})),
|
|
|
onCancel: function onCancel() {
|
|
|
dispatch({
|
|
|
type: 'exercise/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
children: ["\u8BBE\u4E3A\u516C\u5F00\u540E\uFF0C\u975E\u8BFE\u5802\u6210\u5458\u4E5F\u53EF\u4EE5\u8BBF\u95EE\u67E5\u770B", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u662F\u5426\u786E\u8BA4\u8BBE\u4E3A\u516C\u5F00\uFF1F"]
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_SetPublic = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
|
var exercise = _ref3.exercise;
|
|
|
return {
|
|
|
exercise: exercise
|
|
|
};
|
|
|
})(SetPublic));
|
|
|
// EXTERNAL MODULE: ./src/components/CodeBox/index.tsx + 1 modules
|
|
|
var CodeBox = __webpack_require__(61588);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/components/DelShixuns.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["exercise", "dispatch", "user"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var DelShixun = function DelShixun(_ref) {
|
|
|
var _exercise$actionTabs2, _exercise$actionTabs3;
|
|
|
var exercise = _ref.exercise,
|
|
|
dispatch = _ref.dispatch,
|
|
|
user = _ref.user,
|
|
|
props = objectWithoutProperties_default()(_ref, _excluded);
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
confirmLoading = _useState2[0],
|
|
|
setConfirmLoading = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
visible = _useState4[0],
|
|
|
setVisible = _useState4[1];
|
|
|
var delBox = (0,_react_17_0_2_react.useRef)(null);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (exercise.actionTabs.key === '批量删除') {
|
|
|
var _exercise$actionTabs;
|
|
|
if ((0,authority/* isSuperAdmin */.j5)()) {
|
|
|
setVisible(true);
|
|
|
return;
|
|
|
}
|
|
|
var selectNum = {
|
|
|
hasNum: 0,
|
|
|
noHasNum: 0
|
|
|
};
|
|
|
exercise === null || exercise === void 0 || (_exercise$actionTabs = exercise.actionTabs) === null || _exercise$actionTabs === void 0 || (_exercise$actionTabs = _exercise$actionTabs.selectArrsAll) === null || _exercise$actionTabs === void 0 || _exercise$actionTabs.map(function (item) {
|
|
|
var _user$userInfo;
|
|
|
if (item.author_login === ((_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.login)) {
|
|
|
++selectNum.hasNum;
|
|
|
} else {
|
|
|
++selectNum.noHasNum;
|
|
|
}
|
|
|
});
|
|
|
if (selectNum.noHasNum > 0) {
|
|
|
es_modal/* default */.Z.info({
|
|
|
title: "权限提示",
|
|
|
className: "custom-modal-divider ",
|
|
|
icon: null,
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["\u5F53\u524D\u9009\u4E2D\u8D44\u6E90\u4E2D\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-blue",
|
|
|
children: selectNum.hasNum
|
|
|
}), "\u4E2A\u7531\u60A8\u672C\u4EBA\u53D1\u5E03\uFF0C", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-red",
|
|
|
children: selectNum.noHasNum
|
|
|
}), " \u4E2A\u7531\u5176\u4ED6\u8001\u5E08\u53D1\u5E03\u3002", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u8BFE\u5802\u5185\u53EA\u80FD\u5220\u9664\u672C\u4EBA\u53D1\u5E03\u7684\u8D44\u6E90\uFF0C\u8BF7\u53D6\u6D88\u9009\u4E2D\u5176\u4ED6\u8001\u5E08\u53D1\u5E03\u7684\u8D44\u6E90\u3002"]
|
|
|
}),
|
|
|
onOk: function onOk() {
|
|
|
cancel();
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
setVisible(true);
|
|
|
}
|
|
|
} else {
|
|
|
setVisible(false);
|
|
|
}
|
|
|
}, [exercise.actionTabs.key]);
|
|
|
var cancel = function cancel() {
|
|
|
dispatch({
|
|
|
type: 'exercise/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
title: "\u63D0\u793A",
|
|
|
open: visible,
|
|
|
okText: "\u786E\u5B9A",
|
|
|
cancelText: "\u53D6\u6D88",
|
|
|
confirmLoading: confirmLoading,
|
|
|
destroyOnClose: true,
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var _delBox$current;
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
if (!((_delBox$current = delBox.current) !== null && _delBox$current !== void 0 && _delBox$current.onVerify())) {
|
|
|
_context.next = 2;
|
|
|
break;
|
|
|
}
|
|
|
return _context.abrupt("return");
|
|
|
case 2:
|
|
|
setConfirmLoading(true);
|
|
|
_context.next = 5;
|
|
|
return (0,fetch/* default */.ZP)("/api/courses/".concat(params.coursesId, "/exercises/destroys.json"), {
|
|
|
method: 'post',
|
|
|
body: {
|
|
|
check_ids: toConsumableArray_default()(exercise.actionTabs.selectArrs)
|
|
|
}
|
|
|
});
|
|
|
case 5:
|
|
|
res = _context.sent;
|
|
|
setConfirmLoading(false);
|
|
|
if (res.status === 0) {
|
|
|
(0,util/* trackEvent */.L9)(['教学课堂', '试卷', '删除']);
|
|
|
message/* default */.ZP.success('删除成功');
|
|
|
dispatch({
|
|
|
type: 'exercise/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'classroomList/getClassroomExercisesList',
|
|
|
payload: objectSpread2_default()({}, exercise.actionTabs.params)
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'classroomList/getClassroomLeftMenus',
|
|
|
payload: objectSpread2_default()({}, exercise.actionTabs.params)
|
|
|
});
|
|
|
}
|
|
|
case 8:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
})),
|
|
|
onCancel: function onCancel() {
|
|
|
dispatch({
|
|
|
type: 'exercise/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
},
|
|
|
children: !(exercise !== null && exercise !== void 0 && (_exercise$actionTabs2 = exercise.actionTabs) !== null && _exercise$actionTabs2 !== void 0 && _exercise$actionTabs2.status) || !['未开始'].includes(exercise === null || exercise === void 0 || (_exercise$actionTabs3 = exercise.actionTabs) === null || _exercise$actionTabs3 === void 0 ? void 0 : _exercise$actionTabs3.status) ? /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
style: {
|
|
|
color: '#DD0000'
|
|
|
},
|
|
|
children: "\u5220\u9664\u8003\u8BD5\u5219\u4F1A\u6E05\u9664\u5B66\u751F\u6240\u6709\u7684\u7B54\u9898\u6570\u636E\uFF0C\u4E14\u6570\u636E\u4E0D\u53EF\u6062\u590D\uFF0C\u5982\u786E\u5B9A\u5220\u9664\uFF0C\u8BF7\u8F93\u5165\u4E0B\u65B9\u9A8C\u8BC1\u7801"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(CodeBox/* default */.Z, {
|
|
|
ref: function ref(el) {
|
|
|
return delBox.current = el;
|
|
|
}
|
|
|
})]
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: "\u5220\u9664\u8BD5\u5377\u4F1A\u540C\u6B65\u5220\u9664\u8BD5\u5377\u4E2D\u7684\u6240\u6709\u8003\u8BD5\uFF0C\u786E\u8BA4\u662F\u5426\u5220\u9664\uFF1F"
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var DelShixuns = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
|
var exercise = _ref3.exercise,
|
|
|
user = _ref3.user;
|
|
|
return {
|
|
|
exercise: exercise,
|
|
|
user: user
|
|
|
};
|
|
|
})(DelShixun));
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/components/JoinBanks.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var JoinBanks_excluded = ["exercise", "dispatch"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var JoinBanks_DelShixun = function DelShixun(_ref) {
|
|
|
var exercise = _ref.exercise,
|
|
|
dispatch = _ref.dispatch,
|
|
|
props = objectWithoutProperties_default()(_ref, JoinBanks_excluded);
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
params['id'] = params['coursesId'];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (exercise.actionTabs.key === '加入试卷库') {
|
|
|
new Promise( /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return (0,fetch/* default */.ZP)("/api/courses/".concat(params.id, "/exercises/join_examination_banks.json"), {
|
|
|
method: 'post',
|
|
|
body: {
|
|
|
check_ids: toConsumableArray_default()(exercise.actionTabs.selectArrs)
|
|
|
}
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context.sent;
|
|
|
if (res.status === 0) {
|
|
|
(0,util/* trackEvent */.L9)(['教学课堂', '试卷', '加入试卷库']);
|
|
|
message/* default */.ZP.success('已加入个人试卷库,试题同步加入至个人题库');
|
|
|
}
|
|
|
dispatch({
|
|
|
type: 'exercise/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
case 5:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
})));
|
|
|
}
|
|
|
}, [exercise.actionTabs.key]);
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {});
|
|
|
};
|
|
|
/* harmony default export */ var JoinBanks = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
|
var exercise = _ref3.exercise;
|
|
|
return {
|
|
|
exercise: exercise
|
|
|
};
|
|
|
})(JoinBanks_DelShixun));
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
|
var tooltip = __webpack_require__(6848);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules
|
|
|
var es_checkbox = __webpack_require__(24905);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/popover/index.js
|
|
|
var popover = __webpack_require__(60324);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
|
|
|
var table = __webpack_require__(72315);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/components/List/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var Listmodules = ({"flex_box_center":"flex_box_center___VejG5","flex_space_between":"flex_space_between___RwAiX","flex_box_vertical_center":"flex_box_vertical_center___N5QNs","flex_box_center_end":"flex_box_center_end___SUMZc","flex_box_column":"flex_box_column___ombQA","bg":"bg___i74VI","containerTitle":"containerTitle___eAbbs","containerDesc":"containerDesc___WeE4m","tablestyle":"tablestyle___uKNiL","listItem":"listItem___aJrbL","info":"info___X9HlC","title":"title___ZDroC","titleLeft":"titleLeft___JzNZc","titleRight":"titleRight___RP0gb","acitons":"acitons___iqFGc","moveCategory":"moveCategory___Rihfv","name":"name___LdzGg","categoryName":"categoryName___Tz45n","schedule":"schedule___a20T3","fnSign":"fnSign___gsn3j","spanSize":"spanSize___jht3F","classromediv":"classromediv___T7h_f","glow":"glow___LU7dg","popover":"popover___Qeg0P","dot":"dot___c9Vwj"});
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/components/List/img/ping1.svg
|
|
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
|
var __defProp = Object.defineProperty;
|
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var __defNormalProp = function __defNormalProp(obj, key, value) {
|
|
|
return key in obj ? __defProp(obj, key, {
|
|
|
enumerable: true,
|
|
|
configurable: true,
|
|
|
writable: true,
|
|
|
value: value
|
|
|
}) : obj[key] = value;
|
|
|
};
|
|
|
var __spreadValues = function __spreadValues(a, b) {
|
|
|
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
|
if (__getOwnPropSymbols) {
|
|
|
var _iterator = _createForOfIteratorHelper(__getOwnPropSymbols(b)),
|
|
|
_step;
|
|
|
try {
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
var prop = _step.value;
|
|
|
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
|
|
|
var SvgPing1 = function SvgPing1(props) {
|
|
|
return /* @__PURE__ */React.createElement("svg", __spreadValues({
|
|
|
width: 22,
|
|
|
height: 22,
|
|
|
xmlns: "http://www.w3.org/2000/svg"
|
|
|
}, props), /* @__PURE__ */React.createElement("title", null, "\u7F16\u7EC4 5\u5907\u4EFD 2"), /* @__PURE__ */React.createElement("g", {
|
|
|
fill: "none",
|
|
|
fillRule: "evenodd"
|
|
|
}, /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M0 0h22v22H0z"
|
|
|
}), /* @__PURE__ */React.createElement("g", {
|
|
|
fill: "#979797",
|
|
|
fillRule: "nonzero"
|
|
|
}, /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M10.422 5.818h.8v10.4h-.8z"
|
|
|
}), /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M10.743 17.018a.49.49 0 0 1-.38-.197c-.38-.541-1.21-.91-1.993-.91H3.697a.485.485 0 0 1-.475-.493V4.883c0-.173.071-.32.166-.443.214-.222.522-.222.736-.222h4.104c1.139 0 2.301.64 2.823 1.576.143.221.071.541-.166.664a.438.438 0 0 1-.64-.172C9.889 5.67 9.01 5.178 8.228 5.178H4.171v9.723h4.2c1.067 0 2.182.517 2.751 1.28a.493.493 0 0 1-.095.69c-.094.098-.19.147-.284.147Z"
|
|
|
}), /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M11.006 17.018a.469.469 0 0 1-.294-.098.483.483 0 0 1-.098-.69c.588-.763 1.714-1.28 2.84-1.28h3.99V5.203h-3.868c-.857 0-1.885.492-2.252 1.107-.147.222-.44.32-.66.173-.22-.148-.319-.443-.172-.665.612-1.034 2.056-1.6 3.084-1.6h4.234c.098 0 .294 0 .44.148.172.172.172.37.172.468v10.584c0 .271-.22.492-.49.492H13.43c-.808 0-1.64.37-2.056.911a.43.43 0 0 1-.367.197Z"
|
|
|
}))));
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ var ping1 = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMCAwaDIydjIySDB6Ii8+PGcgZmlsbD0iIzk3OTc5NyIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNMTAuNDIyIDUuODE4aC44djEwLjRoLS44eiIvPjxwYXRoIGQ9Ik0xMC43NDMgMTcuMDE4YS40OS40OSAwIDAgMS0uMzgtLjE5N2MtLjM4LS41NDEtMS4yMS0uOTEtMS45OTMtLjkxSDMuNjk3YS40ODUuNDg1IDAgMCAxLS40NzUtLjQ5M1Y0Ljg4M2MwLS4xNzMuMDcxLS4zMi4xNjYtLjQ0My4yMTQtLjIyMi41MjItLjIyMi43MzYtLjIyMmg0LjEwNGMxLjEzOSAwIDIuMzAxLjY0IDIuODIzIDEuNTc2LjE0My4yMjEuMDcxLjU0MS0uMTY2LjY2NGEuNDM4LjQzOCAwIDAgMS0uNjQtLjE3MkM5Ljg4OSA1LjY3IDkuMDEgNS4xNzggOC4yMjggNS4xNzhINC4xNzF2OS43MjNoNC4yYzEuMDY3IDAgMi4xODIuNTE3IDIuNzUxIDEuMjhhLjQ5My40OTMgMCAwIDEtLjA5NS42OWMtLjA5NC4wOTgtLjE5LjE0Ny0uMjg0LjE0N1oiLz48cGF0aCBkPSJNMTEuMDA2IDE3LjAxOGEuNDY5LjQ2OSAwIDAgMS0uMjk0LS4wOTguNDgzLjQ4MyAwIDAgMS0uMDk4LS42OWMuNTg4LS43NjMgMS43MTQtMS4yOCAyLjg0LTEuMjhoMy45OVY1LjIwM2gtMy44NjhjLS44NTcgMC0xLjg4NS40OTItMi4yNTIgMS4xMDctLjE0Ny4yMjItLjQ0LjMyLS42Ni4xNzMtLjIyLS4xNDgtLjMxOS0uNDQzLS4xNzItLjY2NS42MTItMS4wMzQgMi4wNTYtMS42IDMuMDg0LTEuNmg0LjIzNGMuMDk4IDAgLjI5NCAwIC40NC4xNDguMTcyLjE3Mi4xNzIuMzcuMTcyLjQ2OHYxMC41ODRjMCAuMjcxLS4yMi40OTItLjQ5LjQ5MkgxMy40M2MtLjgwOCAwLTEuNjQuMzctMi4wNTYuOTExYS40My40MyAwIDAgMS0uMzY3LjE5N1oiLz48L2c+PC9nPjwvc3ZnPg==");
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/components/List/img/ping2.svg
|
|
|
function ping2_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = ping2_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
|
function ping2_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return ping2_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ping2_arrayLikeToArray(o, minLen); }
|
|
|
function ping2_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
|
var ping2_defProp = Object.defineProperty;
|
|
|
var ping2_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var ping2_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var ping2_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var ping2_defNormalProp = function __defNormalProp(obj, key, value) {
|
|
|
return key in obj ? ping2_defProp(obj, key, {
|
|
|
enumerable: true,
|
|
|
configurable: true,
|
|
|
writable: true,
|
|
|
value: value
|
|
|
}) : obj[key] = value;
|
|
|
};
|
|
|
var ping2_spreadValues = function __spreadValues(a, b) {
|
|
|
for (var prop in b || (b = {})) if (ping2_hasOwnProp.call(b, prop)) ping2_defNormalProp(a, prop, b[prop]);
|
|
|
if (ping2_getOwnPropSymbols) {
|
|
|
var _iterator = ping2_createForOfIteratorHelper(ping2_getOwnPropSymbols(b)),
|
|
|
_step;
|
|
|
try {
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
var prop = _step.value;
|
|
|
if (ping2_propIsEnum.call(b, prop)) ping2_defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
|
|
|
var SvgPing2 = function SvgPing2(props) {
|
|
|
return /* @__PURE__ */React.createElement("svg", ping2_spreadValues({
|
|
|
width: 22,
|
|
|
height: 22,
|
|
|
xmlns: "http://www.w3.org/2000/svg"
|
|
|
}, props), /* @__PURE__ */React.createElement("title", null, "\u7F16\u7EC4 5\u5907\u4EFD"), /* @__PURE__ */React.createElement("g", {
|
|
|
fill: "none",
|
|
|
fillRule: "evenodd"
|
|
|
}, /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M0 0h22v22H0z"
|
|
|
}), /* @__PURE__ */React.createElement("g", {
|
|
|
fillRule: "nonzero"
|
|
|
}, /* @__PURE__ */React.createElement("path", {
|
|
|
fill: "#229BFF",
|
|
|
d: "M10.422 5.818h.8v10.4h-.8z"
|
|
|
}), /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M10.743 17.018a.49.49 0 0 1-.38-.197c-.38-.541-1.21-.91-1.993-.91H3.697a.485.485 0 0 1-.475-.493V4.883c0-.173.071-.32.166-.443.214-.222.522-.222.736-.222h4.104c1.139 0 2.301.64 2.823 1.576.143.221.071.541-.166.664a.438.438 0 0 1-.64-.172C9.889 5.67 9.01 5.178 8.228 5.178H4.171v9.723h4.2c1.067 0 2.182.517 2.751 1.28a.493.493 0 0 1-.095.69c-.094.098-.19.147-.284.147Z",
|
|
|
fill: "#0152d9"
|
|
|
}), /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M11.006 17.018a.469.469 0 0 1-.294-.098.483.483 0 0 1-.098-.69c.588-.763 1.714-1.28 2.84-1.28h3.99V5.203h-3.868c-.857 0-1.885.492-2.252 1.107-.147.222-.44.32-.66.173-.22-.148-.319-.443-.172-.665.612-1.034 2.056-1.6 3.084-1.6h4.234c.098 0 .294 0 .44.148.172.172.172.37.172.468v10.584c0 .271-.22.492-.49.492H13.43c-.808 0-1.64.37-2.056.911a.43.43 0 0 1-.367.197Z",
|
|
|
fill: "#0152d9"
|
|
|
}))));
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ var ping2 = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMCAwaDIydjIySDB6Ii8+PGcgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBmaWxsPSIjMjI5QkZGIiBkPSJNMTAuNDIyIDUuODE4aC44djEwLjRoLS44eiIvPjxwYXRoIGQ9Ik0xMC43NDMgMTcuMDE4YS40OS40OSAwIDAgMS0uMzgtLjE5N2MtLjM4LS41NDEtMS4yMS0uOTEtMS45OTMtLjkxSDMuNjk3YS40ODUuNDg1IDAgMCAxLS40NzUtLjQ5M1Y0Ljg4M2MwLS4xNzMuMDcxLS4zMi4xNjYtLjQ0My4yMTQtLjIyMi41MjItLjIyMi43MzYtLjIyMmg0LjEwNGMxLjEzOSAwIDIuMzAxLjY0IDIuODIzIDEuNTc2LjE0My4yMjEuMDcxLjU0MS0uMTY2LjY2NGEuNDM4LjQzOCAwIDAgMS0uNjQtLjE3MkM5Ljg4OSA1LjY3IDkuMDEgNS4xNzggOC4yMjggNS4xNzhINC4xNzF2OS43MjNoNC4yYzEuMDY3IDAgMi4xODIuNTE3IDIuNzUxIDEuMjhhLjQ5My40OTMgMCAwIDEtLjA5NS42OWMtLjA5NC4wOTgtLjE5LjE0Ny0uMjg0LjE0N1oiIGZpbGw9IiMwMTUyZDkiLz48cGF0aCBkPSJNMTEuMDA2IDE3LjAxOGEuNDY5LjQ2OSAwIDAgMS0uMjk0LS4wOTguNDgzLjQ4MyAwIDAgMS0uMDk4LS42OWMuNTg4LS43NjMgMS43MTQtMS4yOCAyLjg0LTEuMjhoMy45OVY1LjIwM2gtMy44NjhjLS44NTcgMC0xLjg4NS40OTItMi4yNTIgMS4xMDctLjE0Ny4yMjItLjQ0LjMyLS42Ni4xNzMtLjIyLS4xNDgtLjMxOS0uNDQzLS4xNzItLjY2NS42MTItMS4wMzQgMi4wNTYtMS42IDMuMDg0LTEuNmg0LjIzNGMuMDk4IDAgLjI5NCAwIC40NC4xNDguMTcyLjE3Mi4xNzIuMzcuMTcyLjQ2OHYxMC41ODRjMCAuMjcxLS4yMi40OTItLjQ5LjQ5MkgxMy40M2MtLjgwOCAwLTEuNjQuMzctMi4wNTYuOTExYS40My40MyAwIDAgMS0uMzY3LjE5N1oiIGZpbGw9IiMwMTUyZDkiLz48L2c+PC9nPjwvc3ZnPg==");
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/UpOutlined.js + 1 modules
|
|
|
var UpOutlined = __webpack_require__(20114);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/DownOutlined.js + 1 modules
|
|
|
var DownOutlined = __webpack_require__(42884);
|
|
|
// EXTERNAL MODULE: ./src/components/TipsButton/index.tsx + 1 modules
|
|
|
var TipsButton = __webpack_require__(50989);
|
|
|
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/Exercise/components/util.tsx
|
|
|
var components_util = __webpack_require__(37780);
|
|
|
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/Exercise/components/Unlock.tsx
|
|
|
var Unlock = __webpack_require__(96042);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/components/List/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var List = function List(_ref) {
|
|
|
var _v$exercise_tips, _v$exercise_tips2, _v$exercise_tips3, _classroomList$Assist3, _v$exercise_tips5, _v$exercise_tips6, _v$exercise_tips7, _v$exercise_tips8, _v$exercise_tips9, _v$group_status, _v$group_status2, _v$group_status3, _v$exercise_tips10, _v$exercise_tips11;
|
|
|
var v = _ref.v,
|
|
|
k = _ref.k,
|
|
|
match = _ref.match,
|
|
|
selectArrs = _ref.selectArrs,
|
|
|
setSelectArrs = _ref.setSelectArrs,
|
|
|
dispatch = _ref.dispatch,
|
|
|
params = _ref.params,
|
|
|
classroomList = _ref.classroomList,
|
|
|
batchStatus = _ref.batchStatus,
|
|
|
manageAllGroup = _ref.manageAllGroup;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
lists = _useState2[0],
|
|
|
setlists = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
isshow = _useState4[0],
|
|
|
setisshow = _useState4[1];
|
|
|
var currentEnterExamRef = (0,_react_17_0_2_react.useRef)();
|
|
|
// 是否为集中阅卷:
|
|
|
var concentrate = false;
|
|
|
var format = 'YYYY-MM-DD';
|
|
|
var endTime = dayjs_min_default()('2020-11-15', format);
|
|
|
function getlist() {
|
|
|
return _getlist.apply(this, arguments);
|
|
|
}
|
|
|
function _getlist() {
|
|
|
_getlist = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee7$(_context7) {
|
|
|
while (1) switch (_context7.prev = _context7.next) {
|
|
|
case 0:
|
|
|
console.log(params, 222);
|
|
|
_context7.next = 3;
|
|
|
return (0,fetch/* default */.ZP)("/api/courses/".concat(params === null || params === void 0 ? void 0 : params.coursesId, "/exercises/group_use_list.json"), {
|
|
|
method: 'get',
|
|
|
params: objectSpread2_default()(objectSpread2_default()({}, params), {}, {
|
|
|
id: v.id
|
|
|
})
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context7.sent;
|
|
|
setlists((res === null || res === void 0 ? void 0 : res.groups) || []);
|
|
|
case 5:
|
|
|
case "end":
|
|
|
return _context7.stop();
|
|
|
}
|
|
|
}, _callee7);
|
|
|
}));
|
|
|
return _getlist.apply(this, arguments);
|
|
|
}
|
|
|
var modalText = function modalText() {
|
|
|
return es_modal/* default */.Z.info({
|
|
|
title: '题库改版告知',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
|
children: "EduCoder\u5DF2\u5347\u7EA7\u9898\u5E93\u529F\u80FD\uFF0C\u6240\u6709\u8BD5\u9898\u5747\u9700\u5339\u914D\u77E5\u8BC6\u70B9\u3002 \u5F53\u524D\u8BD5\u5377\u6240\u6D89\u53CA\u8BD5\u9898\u5747\u672A\u5339\u914D\u77E5\u8BC6\u70B9\uFF0C\u65E0\u6CD5\u968F\u673A\u62BD\u53D6\uFF0C\u5DF2\u4E0D\u80FD\u6709\u6548\u4F7F\u7528\u3002\u8BF7\u5728\u8BD5\u5377\u5E93\u91CD\u65B0\u7EC4\u5377\u540E\u4F7F\u7528\u3002 \u7531\u6B64\u5E26\u6765\u7684\u4E0D\u4FBF\uFF0C\u656C\u8BF7\u8C05\u89E3\uFF01"
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
{
|
|
|
// console.log(v, "vvvvv");
|
|
|
// console.log(v?.appraise_label, "是否有集中阅卷");
|
|
|
|
|
|
if (v !== null && v !== void 0 && v.appraise_label) {
|
|
|
//判断如果有集中阅卷
|
|
|
concentrate = true;
|
|
|
}
|
|
|
}
|
|
|
var enterExam = function enterExam(v) {
|
|
|
var _userInfo;
|
|
|
var notFirstTime = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
|
_umi_production_exports.history.push("/classrooms/".concat(params.coursesId, "/exercisenotice/").concat(v.id, "/users/").concat((_userInfo = (0,authority/* userInfo */.eY)()) === null || _userInfo === void 0 ? void 0 : _userInfo.login));
|
|
|
// currentEnterExamRef.current = v;
|
|
|
// startExercise({
|
|
|
// inner_ip: v.inner_ip,
|
|
|
// public_ip: v.public_ip,
|
|
|
// open_camera: v.open_camera,
|
|
|
// ip_limit: v.ip_limit,
|
|
|
// ip_bind: v.ip_bind,
|
|
|
// exercise_tips: v.exercise_tips,
|
|
|
// exerciseId: v.id,
|
|
|
// screen_open: v.screen_open,
|
|
|
// screen_num: v.screen_num,
|
|
|
// screen_sec: v.screen_sec,
|
|
|
// coursesId: params.coursesId,
|
|
|
// login: userInfo()?.login,
|
|
|
// history: history,
|
|
|
// identity_verify: v.identity_verify,
|
|
|
// open_phone_video_recording: v.open_phone_video_recording,
|
|
|
// current_status: v.current_status,
|
|
|
// exercise_user_id: v.exercise_user_id,
|
|
|
// unlockClose: true
|
|
|
// })
|
|
|
};
|
|
|
|
|
|
var columns = [{
|
|
|
title: '班级',
|
|
|
dataIndex: 'name',
|
|
|
key: 'name'
|
|
|
}, {
|
|
|
title: '考试状态',
|
|
|
dataIndex: 'exercise_status',
|
|
|
key: 'exercise_status',
|
|
|
width: 100,
|
|
|
filters: [{
|
|
|
text: '未开始',
|
|
|
value: 1
|
|
|
}, {
|
|
|
text: '考试中',
|
|
|
value: 2
|
|
|
}, {
|
|
|
text: '已结束',
|
|
|
value: 3
|
|
|
}],
|
|
|
onFilter: function onFilter(value, record) {
|
|
|
return record.exercise_status === value;
|
|
|
},
|
|
|
render: function render(k, r) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [k === 1 && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: Listmodules.dot,
|
|
|
style: {
|
|
|
background: '#C3C3C3'
|
|
|
}
|
|
|
}), "\u672A\u5F00\u59CB"]
|
|
|
}), k === 2 && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: Listmodules.dot,
|
|
|
style: {
|
|
|
background: '#4EACFF'
|
|
|
}
|
|
|
}), "\u8003\u8BD5\u4E2D"]
|
|
|
}), k === 3 && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: Listmodules.dot,
|
|
|
style: {
|
|
|
background: '#FC2D6B'
|
|
|
}
|
|
|
}), "\u5DF2\u7ED3\u675F"]
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '开始时间',
|
|
|
dataIndex: 'publish_time',
|
|
|
key: 'publish_time',
|
|
|
sorter: true,
|
|
|
width: 170,
|
|
|
showSorterTooltip: false,
|
|
|
sortOrder: params.order_by === "publish_time" ? params.sort_direction === "desc" ? "descend" : "ascend" : null
|
|
|
}, {
|
|
|
title: '结束时间',
|
|
|
dataIndex: 'end_time',
|
|
|
key: 'end_time',
|
|
|
sorter: true,
|
|
|
width: 170,
|
|
|
showSorterTooltip: false,
|
|
|
sortOrder: params.order_by === "end_time" ? params.sort_direction === "desc" ? "descend" : "ascend" : null
|
|
|
}, {
|
|
|
title: '提交人数',
|
|
|
dataIndex: 'exercise_answer',
|
|
|
key: 'exercise_answer',
|
|
|
align: 'center',
|
|
|
width: 80,
|
|
|
render: function render(k, r) {
|
|
|
return r.exercise_status === 1 ? '-' : /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: [k, "/", r.exercise_users]
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '待评阅试卷',
|
|
|
dataIndex: 'unreview_count',
|
|
|
key: 'unreview_count',
|
|
|
align: 'center',
|
|
|
width: 90,
|
|
|
render: function render(k, r) {
|
|
|
return r.exercise_status === 1 ? '-' : k === 0 ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
cursor: 'no-drop',
|
|
|
color: "#999999"
|
|
|
},
|
|
|
children: k
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
onClick: function onClick() {
|
|
|
return (0,util/* openNewWindow */.xg)("/classrooms/".concat(params === null || params === void 0 ? void 0 : params.coursesId, "/exercise/").concat(v === null || v === void 0 ? void 0 : v.id, "/detail?random=false&exercise_group_id=").concat(r.course_group_id));
|
|
|
},
|
|
|
children: k
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '操作',
|
|
|
dataIndex: 'action',
|
|
|
align: 'center',
|
|
|
key: 'action',
|
|
|
width: 60,
|
|
|
render: function render(k, r) {
|
|
|
return r.exercise_status === 1 ? /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
style: {
|
|
|
cursor: 'not-allowed'
|
|
|
},
|
|
|
src: ping1
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u8BC4\u9605",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
onClick: function onClick() {
|
|
|
return (0,util/* openNewWindow */.xg)("/classrooms/".concat(params === null || params === void 0 ? void 0 : params.coursesId, "/exercise/").concat(v === null || v === void 0 ? void 0 : v.id, "/detail?random=false&exercise_group_id=").concat(r.course_group_id));
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: ping2
|
|
|
})
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
}];
|
|
|
var renderTips = function renderTips(v) {
|
|
|
// console.log(v, "zhuangtai");
|
|
|
|
|
|
if (concentrate) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
backgroundColor: '#f59a23'
|
|
|
},
|
|
|
className: "tag-style mr10",
|
|
|
children: "\u96C6\u4E2D\u9605\u5377"
|
|
|
});
|
|
|
} else {
|
|
|
/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
backgroundColor: '#FC2D6B'
|
|
|
},
|
|
|
className: "tag-style mr10",
|
|
|
children: "\u5DF2\u7ED3\u675F"
|
|
|
});
|
|
|
}
|
|
|
if (v !== null && v !== void 0 && v.includes('未开始')) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
backgroundColor: '#B8B8B8'
|
|
|
},
|
|
|
className: "tag-style mr10",
|
|
|
children: "\u672A\u5F00\u59CB"
|
|
|
});
|
|
|
}
|
|
|
if (v !== null && v !== void 0 && v.includes('考试中')) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
backgroundColor: '#007AFF'
|
|
|
},
|
|
|
className: "tag-style mr10",
|
|
|
children: "\u8003\u8BD5\u4E2D"
|
|
|
});
|
|
|
}
|
|
|
if (v !== null && v !== void 0 && v.includes('已结束')) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
backgroundColor: '#FC2D6B'
|
|
|
},
|
|
|
className: "tag-style mr10",
|
|
|
children: "\u5DF2\u7ED3\u675F"
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Listmodules.listItem,
|
|
|
onClick: function onClick() {
|
|
|
(0,util/* openNewWindow */.xg)("/classrooms/".concat(params.coursesId, "/exercise/").concat(v.id, "/detail?random=").concat(v.is_random));
|
|
|
},
|
|
|
children: [(0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
|
checked: selectArrs.includes(v.id),
|
|
|
value: v.id,
|
|
|
className: "mr20",
|
|
|
onClick: function onClick(e) {
|
|
|
e.stopPropagation();
|
|
|
},
|
|
|
onChange: function onChange(e) {
|
|
|
var key = selectArrs.indexOf(v.id);
|
|
|
if (selectArrs.indexOf(v.id) > -1) {
|
|
|
setSelectArrs(selectArrs.filter(function (val) {
|
|
|
return val !== v.id;
|
|
|
}));
|
|
|
} else {
|
|
|
setSelectArrs(selectArrs.concat(v.id));
|
|
|
}
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Listmodules.info,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Listmodules.title,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Listmodules.titleLeft,
|
|
|
style: {
|
|
|
marginRight: 15
|
|
|
},
|
|
|
children: [renderTips(v === null || v === void 0 ? void 0 : v.exercise_tips), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: v.exercise_name,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: Listmodules.name,
|
|
|
children: v.exercise_name
|
|
|
})
|
|
|
}), !v.is_public && (0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u79C1\u6709\u5C5E\u6027\uFF0C\u975E\u8BFE\u5802\u6210\u5458\u4E0D\u80FD\u8BBF\u95EE",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "iconfont icon-suo1 ml10 mr10 c-light-black font12"
|
|
|
})
|
|
|
}), (v === null || v === void 0 || (_v$exercise_tips = v.exercise_tips) === null || _v$exercise_tips === void 0 ? void 0 : _v$exercise_tips.includes('已开启防作弊')) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
flexShrink: 0,
|
|
|
marginLeft: 20,
|
|
|
display: 'flex'
|
|
|
},
|
|
|
className: "tag-style-fzb iconfont icon-fangzuobi",
|
|
|
children: "\u5DF2\u5F00\u542F\u9632\u4F5C\u5F0A"
|
|
|
}), (v === null || v === void 0 || (_v$exercise_tips2 = v.exercise_tips) === null || _v$exercise_tips2 === void 0 ? void 0 : _v$exercise_tips2.includes('已结束')) && (v === null || v === void 0 || (_v$exercise_tips3 = v.exercise_tips) === null || _v$exercise_tips3 === void 0 ? void 0 : _v$exercise_tips3.includes('未提交')) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
flexShrink: 0,
|
|
|
backgroundColor: '#B8B8B8'
|
|
|
},
|
|
|
className: "tag-style ml10",
|
|
|
children: "\u672A\u63D0\u4EA4"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Listmodules.titleRight,
|
|
|
onClick: function onClick(e) {
|
|
|
e.stopPropagation();
|
|
|
e.preventDefault();
|
|
|
},
|
|
|
children: [(v === null || v === void 0 ? void 0 : v.appraise_setting) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
dispatch({
|
|
|
type: "globalSetting/setGlobalLoading",
|
|
|
payload: {
|
|
|
show: true,
|
|
|
text: '正在进入评阅,请稍后...'
|
|
|
}
|
|
|
});
|
|
|
_context.next = 3;
|
|
|
return (0,fetch/* default */.ZP)("/api/exercises/".concat(v.id, "/create_appraise_students.json"), {
|
|
|
method: 'get'
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context.sent;
|
|
|
dispatch({
|
|
|
type: "globalSetting/setGlobalLoading",
|
|
|
payload: {
|
|
|
show: false,
|
|
|
text: ''
|
|
|
}
|
|
|
});
|
|
|
(0,util/* openNewWindow */.xg)("/classrooms/".concat(params === null || params === void 0 ? void 0 : params.coursesId, "/exercise/").concat(v.id, "/centralizeReview/").concat(res === null || res === void 0 ? void 0 : res.login));
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
})),
|
|
|
children: "\u96C6\u4E2D\u9605\u5377"
|
|
|
}),
|
|
|
// 判断 是否具有发布权限 isAssistant isAdmin
|
|
|
(0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsx)(TipsButton/* default */.Z, {
|
|
|
tips: v === null || v === void 0 ? void 0 : v.open_appraise,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
onClick: function onClick() {
|
|
|
var _classroomList$Assist;
|
|
|
if ((0,authority/* isAssistant */.Rm)() && !(classroomList !== null && classroomList !== void 0 && (_classroomList$Assist = classroomList.AssistantObject) !== null && _classroomList$Assist !== void 0 && (_classroomList$Assist = _classroomList$Assist.exercise) !== null && _classroomList$Assist !== void 0 && _classroomList$Assist.can_publish)) {
|
|
|
message/* default */.ZP.warning('您未获取此权限,需向管理员申请权限才能使用此功能');
|
|
|
return;
|
|
|
}
|
|
|
if ((v === null || v === void 0 ? void 0 : v.exercise_question_count) === 0) {
|
|
|
message/* default */.ZP.warning('试卷内没有试题不允许发布考试');
|
|
|
return;
|
|
|
}
|
|
|
dispatch({
|
|
|
type: 'exercise/setActionTabs',
|
|
|
payload: {
|
|
|
key: '批量发布',
|
|
|
selectArrs: [v.id],
|
|
|
unified_setting: v.unified_setting,
|
|
|
params: params,
|
|
|
disabled: v.exercise_status !== 1,
|
|
|
type: 2,
|
|
|
manage_all_group: manageAllGroup
|
|
|
}
|
|
|
});
|
|
|
// if ((isAssistant() && classroomList?.AssistantObject?.exercise?.can_publish) || isAdminOrAuthor()) {//超管、课堂管理员、老师、作者
|
|
|
// dispatch({
|
|
|
// type: 'exercise/setActionTabs',
|
|
|
// payload: {
|
|
|
// key: '批量发布',
|
|
|
// selectArrs: [v.id],
|
|
|
// unified_setting: v.unified_setting,
|
|
|
// params: params,
|
|
|
// disabled: v.exercise_status !== 1,
|
|
|
// type: 2,
|
|
|
// },
|
|
|
// })
|
|
|
// } else {
|
|
|
|
|
|
// }
|
|
|
},
|
|
|
children: "\u53D1\u5E03"
|
|
|
})
|
|
|
}), (0,authority/* isAdmin */.GJ)() && !(0,util/* isKepuKehuan */._m)() && v.assistant_auth &&
|
|
|
/*#__PURE__*/
|
|
|
// 判断是否可以预览
|
|
|
(0,jsx_runtime.jsx)("span", {
|
|
|
onClick: function onClick(e) {
|
|
|
var _classroomList$Assist2;
|
|
|
e.stopPropagation();
|
|
|
if ((0,authority/* isAssistant */.Rm)() && !(classroomList !== null && classroomList !== void 0 && (_classroomList$Assist2 = classroomList.AssistantObject) !== null && _classroomList$Assist2 !== void 0 && (_classroomList$Assist2 = _classroomList$Assist2.exercise) !== null && _classroomList$Assist2 !== void 0 && _classroomList$Assist2.can_preview)) {
|
|
|
//超管、课堂管理员、老师、作者
|
|
|
message/* default */.ZP.warning('您未获取此权限,需向管理员申请权限才能使用此功能');
|
|
|
return;
|
|
|
}
|
|
|
var startTime = dayjs_min_default()(v.created_at, format);
|
|
|
var diff3 = dayjs_min_default()(endTime).diff(dayjs_min_default()(startTime), 'days');
|
|
|
if (diff3 > 0 && v !== null && v !== void 0 && v.is_random) {
|
|
|
modalText();
|
|
|
} else if (v !== null && v !== void 0 && v.is_random) {
|
|
|
(0,util/* openNewWindow */.xg)("/classrooms/".concat(params.coursesId, "/exercise/").concat(v.id, "/random/preview?random=").concat(v.is_random));
|
|
|
} else {
|
|
|
(0,util/* openNewWindow */.xg)("/classrooms/".concat(params.coursesId, "/exercise/").concat(v.id, "/detail?random=").concat(v.is_random, "&tabs=2"));
|
|
|
}
|
|
|
},
|
|
|
children: "\u9884\u89C8"
|
|
|
}), (0,authority/* isAdminOrStudent */.RV)() && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
onClick: function onClick() {
|
|
|
(0,util/* openNewWindow */.xg)("/classrooms/".concat(params.coursesId, "/exercise/").concat(v.id, "/detail?random=").concat(v.is_random));
|
|
|
},
|
|
|
children: "\u8BE6\u60C5"
|
|
|
}), (0,authority/* isAdmin */.GJ)() && !(0,util/* isKepuKehuan */._m)() && /*#__PURE__*/(0,jsx_runtime.jsx)(popover/* default */.Z, {
|
|
|
placement: "bottom",
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Listmodules.popover,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
onClick: /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(e) {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
(0,util/* openNewWindow */.xg)("/classrooms/".concat(params.coursesId, "/exercise/").concat(v.id, "/detail?random=").concat(v.is_random, "&tabs=3"));
|
|
|
case 1:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function (_x) {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}(),
|
|
|
children: "\u89C4\u5219\u8BBE\u7F6E"
|
|
|
}), (0,authority/* isAdmin */.GJ)() && v.is_random && v.assistant_auth && /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
onClick: function onClick(e) {
|
|
|
e.stopPropagation();
|
|
|
var startTime = dayjs_min_default()(v.created_at, format);
|
|
|
var diff3 = dayjs_min_default()(endTime).diff(dayjs_min_default()(startTime), 'days');
|
|
|
if (diff3 > 0 && v !== null && v !== void 0 && v.is_random) {
|
|
|
modalText();
|
|
|
} else {
|
|
|
(0,util/* openNewWindow */.xg)("/classrooms/".concat(params.coursesId, "/exercise/").concat(v.id, "/random/edit?type=settings"));
|
|
|
}
|
|
|
},
|
|
|
children: "\u7F16\u8F91\u8003\u8BD5"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
onClick: /*#__PURE__*/function () {
|
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(e) {
|
|
|
var _v$exercise_tips4;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
dispatch({
|
|
|
type: 'exercise/setActionTabs',
|
|
|
payload: {
|
|
|
key: '批量删除',
|
|
|
selectArrs: [v.id],
|
|
|
selectArrsAll: [v],
|
|
|
params: params,
|
|
|
status: v === null || v === void 0 || (_v$exercise_tips4 = v.exercise_tips) === null || _v$exercise_tips4 === void 0 ? void 0 : _v$exercise_tips4[0]
|
|
|
}
|
|
|
});
|
|
|
case 1:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
return function (_x2) {
|
|
|
return _ref4.apply(this, arguments);
|
|
|
};
|
|
|
}(),
|
|
|
children: "\u5220\u9664\u8BD5\u5377"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
onClick: function onClick() {
|
|
|
dispatch({
|
|
|
type: 'exercise/setActionTabs',
|
|
|
payload: {
|
|
|
key: '单个加入试卷库',
|
|
|
selectArrs: [v.id],
|
|
|
params: params
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
children: "\u52A0\u5165\u8BD5\u5377\u5E93"
|
|
|
}),
|
|
|
// 判断 是否具有结束考试权限
|
|
|
((0,authority/* isAdmin */.GJ)() || (classroomList === null || classroomList === void 0 || (_classroomList$Assist3 = classroomList.AssistantObject) === null || _classroomList$Assist3 === void 0 || (_classroomList$Assist3 = _classroomList$Assist3.exercise) === null || _classroomList$Assist3 === void 0 ? void 0 : _classroomList$Assist3.can_stop)) && /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
onClick: /*#__PURE__*/function () {
|
|
|
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(e) {
|
|
|
var _classroomList$Assist4;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
case 0:
|
|
|
if (!((0,authority/* isAssistant */.Rm)() && !(classroomList !== null && classroomList !== void 0 && (_classroomList$Assist4 = classroomList.AssistantObject) !== null && _classroomList$Assist4 !== void 0 && (_classroomList$Assist4 = _classroomList$Assist4.exercise) !== null && _classroomList$Assist4 !== void 0 && _classroomList$Assist4.can_stop))) {
|
|
|
_context4.next = 3;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.warning('您未获取此权限,需向管理员申请权限才能使用此功能');
|
|
|
return _context4.abrupt("return");
|
|
|
case 3:
|
|
|
dispatch({
|
|
|
type: 'exercise/setActionTabs',
|
|
|
payload: {
|
|
|
key: '批量结束',
|
|
|
selectArrs: [v.id],
|
|
|
params: params,
|
|
|
unified_setting: v.unified_setting
|
|
|
}
|
|
|
});
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee4);
|
|
|
}));
|
|
|
return function (_x3) {
|
|
|
return _ref5.apply(this, arguments);
|
|
|
};
|
|
|
}(),
|
|
|
children: "\u7ED3\u675F\u8003\u8BD5"
|
|
|
})]
|
|
|
}),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
onClick: function onClick(e) {
|
|
|
return e.stopPropagation();
|
|
|
},
|
|
|
children: "\u66F4\u591A"
|
|
|
})
|
|
|
}), (0,authority/* isStudent */.dE)() && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [!!v.off_limits && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u9650\u5236".concat(v === null || v === void 0 ? void 0 : v.max_last_time, "\u7981\u6B62\u8FDB\u5165\u8003\u8BD5"),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("b", {
|
|
|
className: "font16 c-grey-999",
|
|
|
children: "\u5DF2\u7981\u6B62\u8FDB\u5165\u7B54\u9898"
|
|
|
})
|
|
|
}), !v.off_limits && v.current_status === 0 && v.exercise_status > 1 && !((_v$exercise_tips5 = v.exercise_tips) !== null && _v$exercise_tips5 !== void 0 && _v$exercise_tips5.includes('已结束')) && /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
onClick: function onClick(e) {
|
|
|
e.stopPropagation();
|
|
|
e.preventDefault();
|
|
|
enterExam(v, true);
|
|
|
},
|
|
|
href: "",
|
|
|
children: "\u7EE7\u7EED\u8003\u8BD5"
|
|
|
}), !v.off_limits && v.current_status === 1 && v.exercise_status > 1 && document.domain != "kepukehuan.educoder.net" && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: "#0152d9"
|
|
|
},
|
|
|
onClick: /*#__PURE__*/function () {
|
|
|
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5(e) {
|
|
|
var _userInfo2;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
case 0:
|
|
|
e.stopPropagation();
|
|
|
if (v !== null && v !== void 0 && v.answered_open) {
|
|
|
_context5.next = 4;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info('老师已设置本试卷在交卷后不可查看');
|
|
|
return _context5.abrupt("return");
|
|
|
case 4:
|
|
|
_context5.next = 6;
|
|
|
return (0,components_util/* handleCheckModal */.w)(params.coursesId, v.id, '正在进入查看,请稍后...');
|
|
|
case 6:
|
|
|
(0,util/* openNewWindow */.xg)("/classrooms/".concat(params.coursesId, "/exercise/").concat(v.id, "/users/").concat((_userInfo2 = (0,authority/* userInfo */.eY)()) === null || _userInfo2 === void 0 ? void 0 : _userInfo2.login, "?check=true"));
|
|
|
case 7:
|
|
|
case "end":
|
|
|
return _context5.stop();
|
|
|
}
|
|
|
}, _callee5);
|
|
|
}));
|
|
|
return function (_x4) {
|
|
|
return _ref6.apply(this, arguments);
|
|
|
};
|
|
|
}(),
|
|
|
children: "\u67E5\u770B\u8003\u8BD5"
|
|
|
}), !v.off_limits && v.current_status === 2 && v.exercise_status > 1 && !((_v$exercise_tips6 = v.exercise_tips) !== null && _v$exercise_tips6 !== void 0 && _v$exercise_tips6.includes('已结束')) && /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
style: {
|
|
|
color: (v === null || v === void 0 ? void 0 : v.is_redo) === 1 && 'red'
|
|
|
},
|
|
|
onClick: function onClick(e) {
|
|
|
e.stopPropagation();
|
|
|
e.preventDefault();
|
|
|
enterExam(v);
|
|
|
},
|
|
|
href: "",
|
|
|
children: (v === null || v === void 0 ? void 0 : v.is_redo) === 0 ? "开始考试" : '重新考试'
|
|
|
})]
|
|
|
})]
|
|
|
})]
|
|
|
}), (0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
style: {
|
|
|
display: 'flex'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-grey-666",
|
|
|
children: v.author
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "ml30 c-grey-666",
|
|
|
children: ["\u521B\u5EFA\u65F6\u95F4\uFF1A", dayjs_min_default()(v.created_at).format('YYYY-MM-DD HH:mm:ss')]
|
|
|
}), (v === null || v === void 0 || (_v$exercise_tips7 = v.exercise_tips) === null || _v$exercise_tips7 === void 0 ? void 0 : _v$exercise_tips7.includes('未开始')) && v.publish_time && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "ml30 c-grey-666",
|
|
|
children: ["\u5F00\u59CB\u65F6\u95F4\uFF1A", dayjs_min_default()(v.publish_time).format('YYYY-MM-DD HH:mm:ss')]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "ml30 c-grey-666",
|
|
|
children: ["\u7B54\u9898\u65F6\u957F\uFF1A", v.time === null ? '不限' : "".concat(v.time, "\u5206\u949F")]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "ml30 c-grey-666",
|
|
|
children: ["\u7C7B\u578B\uFF1A", v.is_random ? '随机组卷' : '人工组卷']
|
|
|
}), !(v !== null && v !== void 0 && (_v$exercise_tips8 = v.exercise_tips) !== null && _v$exercise_tips8 !== void 0 && _v$exercise_tips8.includes('未开始')) && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
style: {
|
|
|
marginLeft: 'auto',
|
|
|
paddingRight: '20px',
|
|
|
textAlign: 'end',
|
|
|
color: '#888888'
|
|
|
},
|
|
|
onClick: /*#__PURE__*/function () {
|
|
|
var _ref7 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6(e) {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
|
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
|
case 0:
|
|
|
e.stopPropagation();
|
|
|
e.preventDefault();
|
|
|
if (!isshow) {
|
|
|
getlist();
|
|
|
}
|
|
|
setisshow(!isshow);
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context6.stop();
|
|
|
}
|
|
|
}, _callee6);
|
|
|
}));
|
|
|
return function (_x5) {
|
|
|
return _ref7.apply(this, arguments);
|
|
|
};
|
|
|
}(),
|
|
|
children: [isshow ? '收起' : '展开', isshow ? /*#__PURE__*/(0,jsx_runtime.jsx)(UpOutlined/* default */.Z, {
|
|
|
style: {
|
|
|
color: '#888888'
|
|
|
}
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(DownOutlined/* default */.Z, {
|
|
|
style: {
|
|
|
color: '#888888'
|
|
|
}
|
|
|
})]
|
|
|
})]
|
|
|
}), (0,authority/* isStudent */.dE)() && /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
style: {
|
|
|
display: 'flex'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-grey-333",
|
|
|
children: v.author
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "ml30 c-grey-999 mr20",
|
|
|
children: ["\u7B54\u9898\u65F6\u957F\uFF1A", v.time === null ? '不限' : "".concat(v.time, "\u5206\u949F")]
|
|
|
}), !!(v !== null && v !== void 0 && v.exercise_left_time) && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "ml15 c-grey-999",
|
|
|
children: ["\u8003\u8BD5\u5269\u4F59\u65F6\u95F4\uFF1A", v === null || v === void 0 ? void 0 : v.exercise_left_time]
|
|
|
})]
|
|
|
}), (0,authority/* isAdmin */.GJ)() && !(v !== null && v !== void 0 && (_v$exercise_tips9 = v.exercise_tips) !== null && _v$exercise_tips9 !== void 0 && _v$exercise_tips9.includes('未开始')) && /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
letterSpacing: 2
|
|
|
},
|
|
|
className: "c-grey-333 mr15",
|
|
|
children: "\u73ED\u7EA7\u4F7F\u7528\u60C5\u51B5\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "c-grey-333 mr20",
|
|
|
children: ["\u672A\u5F00\u59CB", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: v === null || v === void 0 || (_v$group_status = v.group_status) === null || _v$group_status === void 0 ? void 0 : _v$group_status[0]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "c-grey-333 mr20",
|
|
|
children: ["\u8003\u8BD5\u4E2D ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#4EACFF'
|
|
|
},
|
|
|
children: v === null || v === void 0 || (_v$group_status2 = v.group_status) === null || _v$group_status2 === void 0 ? void 0 : _v$group_status2[1]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "c-grey-333",
|
|
|
children: ["\u5DF2\u7ED3\u675F ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#FC2D6B'
|
|
|
},
|
|
|
children: v === null || v === void 0 || (_v$group_status3 = v.group_status) === null || _v$group_status3 === void 0 ? void 0 : _v$group_status3[2]
|
|
|
})]
|
|
|
})]
|
|
|
}), (0,authority/* isAdmin */.GJ)() && !(v !== null && v !== void 0 && (_v$exercise_tips10 = v.exercise_tips) !== null && _v$exercise_tips10 !== void 0 && _v$exercise_tips10.includes('未开始')) && isshow && lists.length > 5 && /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
|
scroll: {
|
|
|
y: 240
|
|
|
},
|
|
|
pagination: false,
|
|
|
dataSource: lists,
|
|
|
onRow: function onRow(e) {
|
|
|
return {
|
|
|
onClick: function onClick(e) {
|
|
|
e.stopPropagation();
|
|
|
e.preventDefault();
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
onHeaderRow: function onHeaderRow(columns, index) {
|
|
|
return {
|
|
|
onClick: function onClick(e) {
|
|
|
e.stopPropagation();
|
|
|
e.preventDefault();
|
|
|
} // 点击表头行
|
|
|
};
|
|
|
},
|
|
|
|
|
|
rowKey: 'course_group_id',
|
|
|
style: {
|
|
|
marginTop: '10px'
|
|
|
},
|
|
|
onChange: function onChange(a, b, c) {
|
|
|
if (c.field) params.order_by = c.field;
|
|
|
if (!c.order) params['sort_direction'] = 'asc';
|
|
|
if (c.order === 'ascend') params['sort_direction'] = 'asc';
|
|
|
if (c.order === 'descend') params['sort_direction'] = 'desc';
|
|
|
if (!c.order) params['sort_direction'] = 'asc';
|
|
|
getlist();
|
|
|
},
|
|
|
columns: columns
|
|
|
}), (0,authority/* isAdmin */.GJ)() && !(v !== null && v !== void 0 && (_v$exercise_tips11 = v.exercise_tips) !== null && _v$exercise_tips11 !== void 0 && _v$exercise_tips11.includes('未开始')) && isshow && lists.length < 6 && lists.length > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
|
rowKey: 'course_group_id',
|
|
|
pagination: false,
|
|
|
onRow: function onRow(e) {
|
|
|
return {
|
|
|
onClick: function onClick(e) {
|
|
|
e.stopPropagation();
|
|
|
e.preventDefault();
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
onHeaderRow: function onHeaderRow(columns, index) {
|
|
|
return {
|
|
|
onClick: function onClick(e) {
|
|
|
e.stopPropagation();
|
|
|
e.preventDefault();
|
|
|
} // 点击表头行
|
|
|
};
|
|
|
},
|
|
|
|
|
|
dataSource: lists,
|
|
|
style: {
|
|
|
marginTop: '10px'
|
|
|
},
|
|
|
onChange: function onChange(a, b, c) {
|
|
|
if (c.field) params.order_by = c.field;
|
|
|
if (!c.order) params['sort_direction'] = 'asc';
|
|
|
if (c.order === 'ascend') params['sort_direction'] = 'asc';
|
|
|
if (c.order === 'descend') params['sort_direction'] = 'desc';
|
|
|
if (!c.order) params['sort_direction'] = 'asc';
|
|
|
getlist();
|
|
|
},
|
|
|
columns: columns
|
|
|
}), (v === null || v === void 0 ? void 0 : v.total) !== undefined && /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-grey-333 mr15",
|
|
|
children: "\u96C6\u4E2D\u9605\u5377\u603B\u8FDB\u5EA6\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "c-grey-333 mr20",
|
|
|
children: ["\u603B\u8BC4\u6570", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: v === null || v === void 0 ? void 0 : v.total
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "c-grey-333 mr20",
|
|
|
children: ["\u5DF2\u8BC4\u9605 ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#4EACFF'
|
|
|
},
|
|
|
children: v === null || v === void 0 ? void 0 : v.finish_total
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "c-grey-333",
|
|
|
children: ["\u5F85\u8BC4\u9605 ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#FC2D6B'
|
|
|
},
|
|
|
children: v === null || v === void 0 ? void 0 : v.unfinished_total
|
|
|
})]
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Unlock/* default */.Z, {
|
|
|
closable: true,
|
|
|
successCb: function successCb() {
|
|
|
return enterExam(currentEnterExamRef.current);
|
|
|
}
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_List = ((0,_umi_production_exports.connect)(function (_ref8) {
|
|
|
var classroomList = _ref8.classroomList;
|
|
|
return {
|
|
|
classroomList: classroomList
|
|
|
};
|
|
|
})(List));
|
|
|
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/components/TabMenu/index.tsx + 1 modules
|
|
|
var TabMenu = __webpack_require__(79512);
|
|
|
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/components/SearchSortController/index.tsx + 1 modules
|
|
|
var SearchSortController = __webpack_require__(61529);
|
|
|
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/components/BottomControl/index.tsx + 1 modules
|
|
|
var BottomControl = __webpack_require__(57752);
|
|
|
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/Exercise/components/Addpaperlibrary.tsx
|
|
|
var Addpaperlibrary = __webpack_require__(23065);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/ExclamationCircleOutlined.js + 1 modules
|
|
|
var ExclamationCircleOutlined = __webpack_require__(80045);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Exercise_excluded = ["user", "classroomList", "globalSetting", "loading", "dispatch", "match"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ShixunsListPage = function ShixunsListPage(_ref) {
|
|
|
var _user$userInfo4, _detailExerciseList$e, _detailExerciseList$e2, _detailExerciseList$e3, _detailExerciseList$e4, _detailExerciseList$e5, _detailExerciseList$e9, _detailExerciseList$e10, _detailLeftMenus$cour, _detailExerciseList$e12;
|
|
|
var user = _ref.user,
|
|
|
classroomList = _ref.classroomList,
|
|
|
globalSetting = _ref.globalSetting,
|
|
|
loading = _ref.loading,
|
|
|
dispatch = _ref.dispatch,
|
|
|
match = _ref.match,
|
|
|
props = objectWithoutProperties_default()(_ref, Exercise_excluded);
|
|
|
var paramsFromRouter = (0,_umi_production_exports.useParams)();
|
|
|
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
|
|
|
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
|
|
|
searchParams = _useSearchParams2[0];
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(function () {
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, paramsFromRouter), {}, {
|
|
|
limit: 20
|
|
|
});
|
|
|
}),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
params = _useState2[0],
|
|
|
setParams = _useState2[1];
|
|
|
var location = (0,_umi_production_exports.useLocation)();
|
|
|
var detailExerciseList = classroomList.detailExerciseList,
|
|
|
detailTopBanner = classroomList.detailTopBanner,
|
|
|
detailLeftMenus = classroomList.detailLeftMenus;
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
selectArrs = _useState4[0],
|
|
|
setSelectArrs = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
moveVisible = _useState6[0],
|
|
|
setMoveVisible = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
cover_exercises = _useState8[0],
|
|
|
setcover_exercises = _useState8[1];
|
|
|
// 批量显隐状态
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
batchStatus = _useState10[0],
|
|
|
useBatchStatus = _useState10[1];
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)('按创建时间降序'),
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
SortMenuName = _useState12[0],
|
|
|
setSortMenuName = _useState12[1];
|
|
|
var SortMenus = [{
|
|
|
name: '按创建时间升序',
|
|
|
type: 'created_at',
|
|
|
direction: 'asc'
|
|
|
}, {
|
|
|
name: '按创建时间降序',
|
|
|
type: 'created_at',
|
|
|
direction: 'desc'
|
|
|
}, {
|
|
|
name: '按考试时长升序',
|
|
|
type: 'time',
|
|
|
direction: 'asc'
|
|
|
}, {
|
|
|
name: '按考试时长降序',
|
|
|
type: 'time',
|
|
|
direction: 'desc'
|
|
|
}, {
|
|
|
name: '按试卷名称升序',
|
|
|
type: 'exercise_name',
|
|
|
direction: 'asc'
|
|
|
}, {
|
|
|
name: '按试卷名称降序',
|
|
|
type: 'exercise_name',
|
|
|
direction: 'desc'
|
|
|
}];
|
|
|
params.type = searchParams.get("tabs") === 'all' ? '' : searchParams.get("tabs") || '';
|
|
|
params['id'] = params['coursesId'];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
var _user$userInfo, _user$userInfo3;
|
|
|
if (user !== null && user !== void 0 && (_user$userInfo = user.userInfo) !== null && _user$userInfo !== void 0 && _user$userInfo.login) {
|
|
|
if ((0,authority/* isAdmin */.GJ)()) {
|
|
|
var _user$userInfo2;
|
|
|
var localRecordValue = util/* localSort */.cX.getItem("".concat(user === null || user === void 0 || (_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.login, "Teacher"), 'Exercise');
|
|
|
if (localRecordValue) {
|
|
|
params.sort_by = localRecordValue === null || localRecordValue === void 0 ? void 0 : localRecordValue.type;
|
|
|
params.sort_direction = localRecordValue === null || localRecordValue === void 0 ? void 0 : localRecordValue.direction;
|
|
|
setSortMenuName(localRecordValue === null || localRecordValue === void 0 ? void 0 : localRecordValue.name);
|
|
|
}
|
|
|
}
|
|
|
dispatch({
|
|
|
type: 'classroomList/getClassroomExercisesList',
|
|
|
payload: objectSpread2_default()(objectSpread2_default()({}, params), paramsFromRouter)
|
|
|
});
|
|
|
} else if (user !== null && user !== void 0 && (_user$userInfo3 = user.userInfo) !== null && _user$userInfo3 !== void 0 && _user$userInfo3.username) {
|
|
|
dispatch({
|
|
|
type: 'classroomList/getClassroomExercisesList',
|
|
|
payload: objectSpread2_default()(objectSpread2_default()({}, params), paramsFromRouter)
|
|
|
});
|
|
|
}
|
|
|
setMoveVisible(false);
|
|
|
}, [user === null || user === void 0 || (_user$userInfo4 = user.userInfo) === null || _user$userInfo4 === void 0 ? void 0 : _user$userInfo4.login, location.pathname]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (classroomList.actionTabs.key === '目录重命名成功') {
|
|
|
dispatch({
|
|
|
type: 'classroomList/getClassroomExercisesList',
|
|
|
payload: objectSpread2_default()(objectSpread2_default()({}, params), paramsFromRouter)
|
|
|
});
|
|
|
}
|
|
|
}, [classroomList.actionTabs.key]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
setSelectArrs([]);
|
|
|
}, [detailExerciseList]);
|
|
|
var onShowSizeChange = function onShowSizeChange(current, pageSize) {
|
|
|
setSelectArrs([]);
|
|
|
params.page = current;
|
|
|
params.limit = pageSize;
|
|
|
dispatch({
|
|
|
type: 'classroomList/getClassroomExercisesList',
|
|
|
payload: objectSpread2_default()(objectSpread2_default()({}, params), paramsFromRouter)
|
|
|
});
|
|
|
};
|
|
|
var onMenuSelect = function onMenuSelect(v) {
|
|
|
params.type = v.key === 'all' ? '' : v.key;
|
|
|
params.page = 1;
|
|
|
_umi_production_exports.history.replace("".concat(location.pathname, "?tabs=").concat(v.key));
|
|
|
useBatchStatus(false);
|
|
|
dispatch({
|
|
|
type: 'classroomList/getClassroomExercisesList',
|
|
|
payload: objectSpread2_default()(objectSpread2_default()({}, params), paramsFromRouter)
|
|
|
});
|
|
|
};
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (searchParams.get("tabs") === 'all') {
|
|
|
params.type = '';
|
|
|
params.page = 1;
|
|
|
// setParams({...params})
|
|
|
}
|
|
|
}, [searchParams.get("tabs")]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
dispatch({
|
|
|
type: "classroomList/getAssistantPermissions",
|
|
|
payload: {
|
|
|
course_id: params.coursesId
|
|
|
}
|
|
|
});
|
|
|
if (sessionStorage.getItem("illegalEntry")) {
|
|
|
sessionStorage.removeItem("illegalEntry");
|
|
|
es_modal/* default */.Z.info({
|
|
|
title: "提示",
|
|
|
centered: true,
|
|
|
width: 600,
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["\u5728\u7EBF\u8003\u8BD5\u7981\u6B62\u4F7F\u7528\u94FE\u63A5\u76F4\u63A5\u8BBF\u95EE\u7B54\u9898\u9875\u9762\uFF0C\u8BF7\u4F7F\u7528\u4E0B\u9762\u4E24\u79CD\u6B63\u5E38\u65B9\u5F0F\u8FDB\u5165\u8003\u8BD5\u7B54\u9898\u9875\u9762\u3002", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "1\u3001\u5728", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-red blod",
|
|
|
children: "\u8003\u8BD5\u5217\u8868"
|
|
|
}), "\u9875\u9762\u4E2D\uFF0C\u70B9\u51FB\u201C", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-blue blod",
|
|
|
children: "\u5F00\u59CB\u8003\u8BD5"
|
|
|
}), "\u201D\u6216\u201C", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-blue blod",
|
|
|
children: "\u7EE7\u7EED\u8003\u8BD5"
|
|
|
}), "\u201D\u6309\u94AE\u8FDB\u5165\u8003\u8BD5\u7B54\u9898\u9875\u9762\u3002", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "2\u3001\u5728", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-red blod",
|
|
|
children: "\u8003\u8BD5\u8BE6\u60C5"
|
|
|
}), "\u9875\u9762\u4E2D\uFF0C\u70B9\u51FB\u201C", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-blue blod",
|
|
|
children: "\u5F00\u59CB\u8003\u8BD5"
|
|
|
}), "\u201D\u6216\u201C", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-blue blod",
|
|
|
children: "\u7EE7\u7EED\u8003\u8BD5"
|
|
|
}), "\u201D\u6309\u94AE\u8FDB\u5165\u8003\u8BD5\u7B54\u9898\u9875\u9762\u3002"]
|
|
|
}),
|
|
|
okText: "知道了"
|
|
|
});
|
|
|
}
|
|
|
}, []);
|
|
|
var Menus = [{
|
|
|
name: '全部',
|
|
|
id: 'all',
|
|
|
total: (_detailExerciseList$e = detailExerciseList.exercises_counts) === null || _detailExerciseList$e === void 0 ? void 0 : _detailExerciseList$e.exercises_total_counts
|
|
|
}, {
|
|
|
name: '未开始',
|
|
|
id: 1,
|
|
|
total: (_detailExerciseList$e2 = detailExerciseList.exercises_counts) === null || _detailExerciseList$e2 === void 0 ? void 0 : _detailExerciseList$e2.unstart_counts
|
|
|
}, {
|
|
|
name: '考试中',
|
|
|
id: 2,
|
|
|
total: (_detailExerciseList$e3 = detailExerciseList.exercises_counts) === null || _detailExerciseList$e3 === void 0 ? void 0 : _detailExerciseList$e3.publish_counts
|
|
|
}, {
|
|
|
name: '集中阅卷',
|
|
|
id: 4,
|
|
|
total: (_detailExerciseList$e4 = detailExerciseList.exercises_counts) === null || _detailExerciseList$e4 === void 0 ? void 0 : _detailExerciseList$e4.appraise_exercise_count
|
|
|
},
|
|
|
//新增集中阅卷tab
|
|
|
{
|
|
|
name: '已结束',
|
|
|
id: 3,
|
|
|
total: (_detailExerciseList$e5 = detailExerciseList.exercises_counts) === null || _detailExerciseList$e5 === void 0 ? void 0 : _detailExerciseList$e5.end_counts
|
|
|
}];
|
|
|
if (!(0,authority/* isAdmin */.GJ)()) Menus.splice(1, 1);
|
|
|
var actionsArr = [{
|
|
|
name: '批量发布',
|
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-fabu5"
|
|
|
})
|
|
|
}, {
|
|
|
name: '批量结束',
|
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-piliangjiezhi2"
|
|
|
})
|
|
|
}, {
|
|
|
name: '批量删除',
|
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-piliangshanchu2"
|
|
|
})
|
|
|
}, {
|
|
|
name: '设为公开',
|
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-sheweigongkai2"
|
|
|
})
|
|
|
}, {
|
|
|
name: '加入试卷库',
|
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-piliangjiaru font14"
|
|
|
})
|
|
|
}].filter(function (item) {
|
|
|
if ((0,authority/* isAdmin */.GJ)()) {
|
|
|
return true;
|
|
|
} else {
|
|
|
return item.name !== '批量删除';
|
|
|
}
|
|
|
}).filter(function (item) {
|
|
|
if (detailTopBanner.is_public) {
|
|
|
return true;
|
|
|
} else {
|
|
|
return item.name !== '设为公开';
|
|
|
}
|
|
|
});
|
|
|
var modalText = function modalText() {
|
|
|
return es_modal/* default */.Z.info({
|
|
|
title: '题库改版告知',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
|
children: "EduCoder\u5DF2\u5347\u7EA7\u9898\u5E93\u529F\u80FD\uFF0C\u6240\u6709\u8BD5\u9898\u5747\u9700\u5339\u914D\u77E5\u8BC6\u70B9\u3002 \u5F53\u524D\u8BD5\u5377\u6240\u6D89\u53CA\u8BD5\u9898\u5747\u672A\u5339\u914D\u77E5\u8BC6\u70B9\uFF0C\u65E0\u6CD5\u968F\u673A\u62BD\u53D6\uFF0C\u5DF2\u4E0D\u80FD\u6709\u6548\u4F7F\u7528\u3002\u8BF7\u5728\u8BD5\u5377\u5E93\u91CD\u65B0\u7EC4\u5377\u540E\u4F7F\u7528\u3002 \u7531\u6B64\u5E26\u6765\u7684\u4E0D\u4FBF\uFF0C\u656C\u8BF7\u8C05\u89E3\uFF01"
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
var format = 'YYYY-MM-DD';
|
|
|
var endTime = dayjs_min_default()('2020-11-15', format);
|
|
|
var handleMenuChange = function handleMenuChange(item) {
|
|
|
params.sort_by = item.type;
|
|
|
params.sort_direction = item.direction;
|
|
|
if ((0,authority/* isAdmin */.GJ)()) {
|
|
|
var _user$userInfo5;
|
|
|
util/* localSort */.cX.setItem("".concat(user === null || user === void 0 || (_user$userInfo5 = user.userInfo) === null || _user$userInfo5 === void 0 ? void 0 : _user$userInfo5.login, "Teacher"), item, 'Exercise');
|
|
|
}
|
|
|
params.page = 1;
|
|
|
dispatch({
|
|
|
type: 'classroomList/getClassroomExercisesList',
|
|
|
payload: objectSpread2_default()({}, params)
|
|
|
});
|
|
|
setSortMenuName(item.name);
|
|
|
};
|
|
|
var getDropdownMenu = function getDropdownMenu() {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(menu/* default */.Z, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z.Item, {
|
|
|
onClick: function onClick() {
|
|
|
var _classroomList$Assist;
|
|
|
{/* 判断是否可以创建试卷 */}
|
|
|
if ((0,authority/* isAssistant */.Rm)() && !(classroomList !== null && classroomList !== void 0 && (_classroomList$Assist = classroomList.AssistantObject) !== null && _classroomList$Assist !== void 0 && (_classroomList$Assist = _classroomList$Assist.exercise) !== null && _classroomList$Assist !== void 0 && _classroomList$Assist.can_create)) {
|
|
|
message/* default */.ZP.warning('您未获取此权限,需向管理员申请权限才能使用此功能');
|
|
|
return;
|
|
|
}
|
|
|
dispatch({
|
|
|
type: 'exercise/setActionTabs',
|
|
|
payload: {
|
|
|
key: '试卷选用',
|
|
|
params: params
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
children: "\u5FEB\u901F\u9009\u62E9\u8BD5\u5377"
|
|
|
}, 1), /*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z.Item, {
|
|
|
onClick: function onClick() {
|
|
|
var _classroomList$Assist2;
|
|
|
{/* 判断是否可以创建试卷 */}
|
|
|
if ((0,authority/* isAssistant */.Rm)() && !(classroomList !== null && classroomList !== void 0 && (_classroomList$Assist2 = classroomList.AssistantObject) !== null && _classroomList$Assist2 !== void 0 && (_classroomList$Assist2 = _classroomList$Assist2.exercise) !== null && _classroomList$Assist2 !== void 0 && _classroomList$Assist2.can_create)) {
|
|
|
message/* default */.ZP.warning('您未获取此权限,需向管理员申请权限才能使用此功能');
|
|
|
return;
|
|
|
}
|
|
|
_umi_production_exports.history.push("/classrooms/".concat(params.coursesId, "/exercise/add"));
|
|
|
},
|
|
|
children: "\u521B\u5EFA\u65B0\u8BD5\u5377"
|
|
|
}, 2)]
|
|
|
});
|
|
|
};
|
|
|
var handleBottomControlClick = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(item) {
|
|
|
var _detailExerciseList$e6;
|
|
|
var val, randomArr, txt, _detailExerciseList$e8, _classroomList$Assist3, _detailExerciseList$e7, _name, bool, name, publish, _res$cover_exercises, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
val = item.name;
|
|
|
randomArr = [];
|
|
|
(_detailExerciseList$e6 = detailExerciseList.exercises) === null || _detailExerciseList$e6 === void 0 || _detailExerciseList$e6.map(function (v) {
|
|
|
if (selectArrs.includes(v.id) && v.is_random) {
|
|
|
var startTime = dayjs_min_default()(v.created_at, format);
|
|
|
var diff3 = dayjs_min_default()(endTime).diff(dayjs_min_default()(startTime), 'days');
|
|
|
if (diff3 > 0 && v !== null && v !== void 0 && v.is_random) {
|
|
|
randomArr.push(v);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
if (!(selectArrs == '')) {
|
|
|
_context.next = 9;
|
|
|
break;
|
|
|
}
|
|
|
txt = '请选择你要操作的任务';
|
|
|
if (val === '加入试卷库') txt = '请选择要加入试卷库的试卷';
|
|
|
message/* default */.ZP.error(txt);
|
|
|
_context.next = 39;
|
|
|
break;
|
|
|
case 9:
|
|
|
if (!randomArr.length) {
|
|
|
_context.next = 13;
|
|
|
break;
|
|
|
}
|
|
|
modalText();
|
|
|
_context.next = 39;
|
|
|
break;
|
|
|
case 13:
|
|
|
if (!(val === '批量发布')) {
|
|
|
_context.next = 31;
|
|
|
break;
|
|
|
}
|
|
|
if (!((0,authority/* isAssistant */.Rm)() && !(classroomList !== null && classroomList !== void 0 && (_classroomList$Assist3 = classroomList.AssistantObject) !== null && _classroomList$Assist3 !== void 0 && (_classroomList$Assist3 = _classroomList$Assist3.exercise) !== null && _classroomList$Assist3 !== void 0 && _classroomList$Assist3.can_publish))) {
|
|
|
_context.next = 17;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.warning('您未获取此权限,需向管理员申请权限才能使用此功能');
|
|
|
return _context.abrupt("return");
|
|
|
case 17:
|
|
|
// console.log('---', detailExerciseList);
|
|
|
bool = false;
|
|
|
detailExerciseList.exercises.forEach(function (e) {
|
|
|
if (selectArrs.includes(e.id) && e.total_num === 0 && e.is_random) {
|
|
|
bool = true;
|
|
|
}
|
|
|
});
|
|
|
name = (_detailExerciseList$e7 = detailExerciseList.exercises.filter(function (item) {
|
|
|
return selectArrs.includes(item === null || item === void 0 ? void 0 : item.id);
|
|
|
}).filter(function (item) {
|
|
|
return (item === null || item === void 0 ? void 0 : item.exercise_question_count) === 0;
|
|
|
})) === null || _detailExerciseList$e7 === void 0 || (_detailExerciseList$e7 = _detailExerciseList$e7[0]) === null || _detailExerciseList$e7 === void 0 ? void 0 : _detailExerciseList$e7.exercise_name;
|
|
|
if (!(((_name = name) === null || _name === void 0 ? void 0 : _name.length) > 0)) {
|
|
|
_context.next = 23;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.warning("".concat(name, "\u8BD5\u5377\u5185\u6CA1\u6709\u8BD5\u9898\u4E0D\u5141\u8BB8\u53D1\u5E03\u8003\u8BD5"));
|
|
|
return _context.abrupt("return");
|
|
|
case 23:
|
|
|
if (!bool) {
|
|
|
_context.next = 26;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.warning('随机试卷还未在该课堂生成试卷,请点击编辑去设置出卷数量吧。');
|
|
|
return _context.abrupt("return");
|
|
|
case 26:
|
|
|
publish = false;
|
|
|
detailExerciseList.exercises.forEach(function (e) {
|
|
|
if (selectArrs.includes(e.id) && e.exercise_status !== 1) {
|
|
|
publish = true;
|
|
|
}
|
|
|
});
|
|
|
if (!publish) {
|
|
|
_context.next = 31;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.warning('试卷已发布考试不可批量发布。');
|
|
|
return _context.abrupt("return");
|
|
|
case 31:
|
|
|
if (!(val === '加入试卷库')) {
|
|
|
_context.next = 38;
|
|
|
break;
|
|
|
}
|
|
|
_context.next = 34;
|
|
|
return (0,fetch/* default */.ZP)("/api/courses/".concat(params.id, "/exercises/check_exercise_cover.json"), {
|
|
|
method: 'post',
|
|
|
body: {
|
|
|
check_ids: toConsumableArray_default()(selectArrs)
|
|
|
}
|
|
|
});
|
|
|
case 34:
|
|
|
res = _context.sent;
|
|
|
if (!((res === null || res === void 0 || (_res$cover_exercises = res.cover_exercises) === null || _res$cover_exercises === void 0 ? void 0 : _res$cover_exercises.length) > 0)) {
|
|
|
_context.next = 38;
|
|
|
break;
|
|
|
}
|
|
|
setcover_exercises(res === null || res === void 0 ? void 0 : res.cover_exercises);
|
|
|
return _context.abrupt("return");
|
|
|
case 38:
|
|
|
dispatch({
|
|
|
type: 'exercise/setActionTabs',
|
|
|
payload: {
|
|
|
key: val,
|
|
|
selectArrs: selectArrs,
|
|
|
selectArrsAll: (_detailExerciseList$e8 = detailExerciseList.exercises) === null || _detailExerciseList$e8 === void 0 ? void 0 : _detailExerciseList$e8.filter(function (item) {
|
|
|
return selectArrs.includes(item.id);
|
|
|
}),
|
|
|
params: params,
|
|
|
type: 1
|
|
|
}
|
|
|
});
|
|
|
case 39:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function handleBottomControlClick(_x) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
|
className: "minH500",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(TabMenu/* default */.Z, {
|
|
|
isLoading: loading['classroomList/getClassroomExercisesList'],
|
|
|
tabDataSource: Menus,
|
|
|
isAdmin: (0,authority/* isAdmin */.GJ)(),
|
|
|
getDropdownMenu: getDropdownMenu,
|
|
|
onTabMenuClick: onMenuSelect,
|
|
|
defaultSelectedKeys: [params.type || 'all']
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(SearchSortController/* default */.Z, {
|
|
|
dataSource: detailExerciseList.exercises || [],
|
|
|
isAdmin: (0,authority/* isAdmin */.GJ)(),
|
|
|
batchStatus: batchStatus,
|
|
|
SortMenuName: SortMenuName,
|
|
|
setSortMenuName: setSortMenuName,
|
|
|
SortMenus: SortMenus,
|
|
|
onSearch: function onSearch(value) {
|
|
|
params.search = value;
|
|
|
params.page = 1;
|
|
|
dispatch({
|
|
|
type: 'classroomList/getClassroomExercisesList',
|
|
|
payload: objectSpread2_default()({}, params)
|
|
|
});
|
|
|
},
|
|
|
onSort: handleMenuChange,
|
|
|
onBatch: function onBatch(status) {
|
|
|
return useBatchStatus(status);
|
|
|
}
|
|
|
}), detailExerciseList.exercises_counts && ((_detailExerciseList$e9 = detailExerciseList.exercises_counts) === null || _detailExerciseList$e9 === void 0 ? void 0 : _detailExerciseList$e9.exercises_all_counts) === 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsxs)(skeleton/* default */.Z, {
|
|
|
loading: loading['classroomList/getClassroomExercisesList'],
|
|
|
active: true,
|
|
|
avatar: {
|
|
|
size: 40
|
|
|
},
|
|
|
paragraph: {
|
|
|
rows: 5
|
|
|
},
|
|
|
className: "mt30",
|
|
|
children: [detailExerciseList.exercises && detailExerciseList.exercises.map(function (v, k) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(components_List, {
|
|
|
v: v,
|
|
|
k: k,
|
|
|
match: match,
|
|
|
batchStatus: batchStatus,
|
|
|
selectArrs: selectArrs,
|
|
|
setSelectArrs: setSelectArrs,
|
|
|
dispatch: dispatch,
|
|
|
params: params,
|
|
|
manageAllGroup: detailExerciseList.manage_all_group
|
|
|
}, k);
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
className: "tc mb50 mt30",
|
|
|
children: ((_detailExerciseList$e10 = detailExerciseList.exercises_counts) === null || _detailExerciseList$e10 === void 0 ? void 0 : _detailExerciseList$e10.exercises_all_counts) > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
|
|
|
showTotal: function showTotal(total) {
|
|
|
var _detailExerciseList$e11;
|
|
|
return "\u5171 ".concat(detailExerciseList === null || detailExerciseList === void 0 || (_detailExerciseList$e11 = detailExerciseList.exercises_counts) === null || _detailExerciseList$e11 === void 0 ? void 0 : _detailExerciseList$e11.exercises_all_counts, " \u6761");
|
|
|
}
|
|
|
// hideOnSinglePage
|
|
|
,
|
|
|
showSizeChanger: true,
|
|
|
onChange: onShowSizeChange,
|
|
|
defaultCurrent: params.page,
|
|
|
current: params.page || 1,
|
|
|
pageSize: params.limit || 20,
|
|
|
total: detailExerciseList.exercises_counts && detailExerciseList.exercises_counts.exercises_all_counts
|
|
|
})
|
|
|
})]
|
|
|
}), selectArrs.length > 0 && (0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsx)(affix/* default */.Z, {
|
|
|
offsetBottom: 0,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(BottomControl/* default */.Z, {
|
|
|
buttonDataSource: actionsArr,
|
|
|
onButtonClick: handleBottomControlClick,
|
|
|
useBatchStatus: useBatchStatus,
|
|
|
setSeleArr: setSelectArrs,
|
|
|
catalogue: (detailLeftMenus === null || detailLeftMenus === void 0 || (_detailLeftMenus$cour = detailLeftMenus.course_modules) === null || _detailLeftMenus$cour === void 0 || (_detailLeftMenus$cour = _detailLeftMenus$cour.find(function (v) {
|
|
|
return v.type === "exercise";
|
|
|
})) === null || _detailLeftMenus$cour === void 0 ? void 0 : _detailLeftMenus$cour.second_category) || [],
|
|
|
addCatalogue: function addCatalogue(e) {
|
|
|
e.preventDefault();
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {
|
|
|
key: '添加目录',
|
|
|
params: params,
|
|
|
selectArrs: {
|
|
|
category_id: detailExerciseList === null || detailExerciseList === void 0 ? void 0 : detailExerciseList.main_category_id,
|
|
|
type: 'exercise'
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
allSelect: selectArrs.length ? selectArrs.length === ((_detailExerciseList$e12 = detailExerciseList.exercises) === null || _detailExerciseList$e12 === void 0 ? void 0 : _detailExerciseList$e12.length) : false,
|
|
|
setAllSelect: function setAllSelect(e) {
|
|
|
if (e.target.checked) {
|
|
|
var _detailExerciseList$e13;
|
|
|
setSelectArrs(detailExerciseList === null || detailExerciseList === void 0 || (_detailExerciseList$e13 = detailExerciseList.exercises) === null || _detailExerciseList$e13 === void 0 ? void 0 : _detailExerciseList$e13.map(function (v) {
|
|
|
return v.id;
|
|
|
}));
|
|
|
} else {
|
|
|
setSelectArrs([]);
|
|
|
}
|
|
|
},
|
|
|
selectArrs: selectArrs,
|
|
|
onMenuClick: /*#__PURE__*/function () {
|
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(_ref3) {
|
|
|
var key, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
key = _ref3.key;
|
|
|
if (!(selectArrs == '')) {
|
|
|
_context2.next = 4;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.error('请选择你要操作的任务');
|
|
|
return _context2.abrupt("return", null);
|
|
|
case 4:
|
|
|
_context2.next = 6;
|
|
|
return (0,fetch/* default */.ZP)("/api/courses/".concat(params.id, "/exercises/move_to_category.json"), {
|
|
|
method: 'post',
|
|
|
body: {
|
|
|
exercise_ids: selectArrs,
|
|
|
new_category_id: key
|
|
|
}
|
|
|
});
|
|
|
case 6:
|
|
|
res = _context2.sent;
|
|
|
if (res.status === 0) {
|
|
|
message/* default */.ZP.success('操作成功');
|
|
|
dispatch({
|
|
|
type: 'classroomList/getClassroomExercisesList',
|
|
|
payload: objectSpread2_default()({}, paramsFromRouter)
|
|
|
});
|
|
|
}
|
|
|
case 8:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function (_x2) {
|
|
|
return _ref4.apply(this, arguments);
|
|
|
};
|
|
|
}()
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Publish/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(CutOffNow/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(DelShixuns, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(components_SetPublic, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(SelectExercise, {
|
|
|
cb: function cb() {
|
|
|
return setSelectArrs([]);
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(JoinBanks, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(Unlock/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_modal/* default */.Z, {
|
|
|
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ExclamationCircleOutlined/* default */.Z, {
|
|
|
style: {
|
|
|
color: '#faad14',
|
|
|
fontSize: '18px'
|
|
|
}
|
|
|
}), " \u52A0\u5165\u8BD5\u5377\u5E93\u63D0\u793A"]
|
|
|
}),
|
|
|
open: cover_exercises.length > 0,
|
|
|
footer: false,
|
|
|
onCancel: function onCancel() {
|
|
|
setcover_exercises([]);
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
height: 300,
|
|
|
overflow: 'auto'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["\u6709", cover_exercises === null || cover_exercises === void 0 ? void 0 : cover_exercises.length, "\u5F20\u8BD5\u5377\u5728\u8BD5\u5377\u5E93\u91CD\u590D\uFF0C\u662F\u5426\u9700\u8981\u8986\u76D6\u539F\u6765\u7684\u8BD5\u5377\uFF1F"]
|
|
|
}), cover_exercises === null || cover_exercises === void 0 ? void 0 : cover_exercises.map(function (item) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
marginTop: 25
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["\u8BD5\u5377\uFF1A", item === null || item === void 0 ? void 0 : item.origin_exercise_nam]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["\u539F\u8BD5\u5377\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "/paperlibrary/see/".concat(item === null || item === void 0 ? void 0 : item.examination_bank_id, "?defaultActiveKey=0"),
|
|
|
target: "_blank",
|
|
|
children: item === null || item === void 0 ? void 0 : item.examination_bank_name
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
textAlign: 'end'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
style: {
|
|
|
height: 30
|
|
|
},
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
_context3.next = 2;
|
|
|
return (0,fetch/* default */.ZP)("/api/courses/".concat(params.id, "/exercises/join_examination_banks.json"), {
|
|
|
method: 'post',
|
|
|
body: {
|
|
|
check_ids: toConsumableArray_default()(selectArrs),
|
|
|
update: 1
|
|
|
}
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context3.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
message/* default */.ZP.info('覆盖成功');
|
|
|
setcover_exercises([]);
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
})),
|
|
|
children: "\u8986\u76D6\u539F\u6765\u7684\u8BD5\u5377"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
|
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/courses/".concat(params.id, "/exercises/join_examination_banks.json"), {
|
|
|
method: 'post',
|
|
|
body: {
|
|
|
check_ids: toConsumableArray_default()(selectArrs)
|
|
|
}
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context4.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
message/* default */.ZP.info('形成成功');
|
|
|
setcover_exercises([]);
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee4);
|
|
|
})),
|
|
|
style: {
|
|
|
marginLeft: 10,
|
|
|
height: 30
|
|
|
},
|
|
|
children: "\u5F62\u6210\u65B0\u8BD5\u5377"
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Addpaperlibrary/* default */.Z, {})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var Exercise = ((0,_umi_production_exports.connect)(function (_ref7) {
|
|
|
var user = _ref7.user,
|
|
|
classroomList = _ref7.classroomList,
|
|
|
loading = _ref7.loading,
|
|
|
globalSetting = _ref7.globalSetting;
|
|
|
return {
|
|
|
user: user,
|
|
|
classroomList: classroomList,
|
|
|
globalSetting: globalSetting,
|
|
|
loading: loading.effects
|
|
|
};
|
|
|
})(ShixunsListPage));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 57752:
|
|
|
/*!***********************************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/components/BottomControl/index.tsx + 1 modules ***!
|
|
|
\***********************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ components_BottomControl; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(11006);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/menu/index.js + 11 modules
|
|
|
var es_menu = __webpack_require__(20834);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
|
var input = __webpack_require__(1056);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules
|
|
|
var es_checkbox = __webpack_require__(24905);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js + 1 modules
|
|
|
var dropdown = __webpack_require__(38854);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/components/BottomControl/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var BottomControlmodules = ({"bottomControlContainer":"bottomControlContainer___woAeo","buttonWrap":"buttonWrap___iRw4K","moveCategory":"moveCategory___oiQqw"});
|
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
|
var authority = __webpack_require__(71633);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/DownOutlined.js + 1 modules
|
|
|
var DownOutlined = __webpack_require__(42884);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/components/BottomControl/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var BottomControl = function BottomControl(_ref) {
|
|
|
var buttonDataSource = _ref.buttonDataSource,
|
|
|
onButtonClick = _ref.onButtonClick,
|
|
|
useBatchStatus = _ref.useBatchStatus,
|
|
|
allSelect = _ref.allSelect,
|
|
|
setAllSelect = _ref.setAllSelect,
|
|
|
selectArrs = _ref.selectArrs,
|
|
|
onMenuClick = _ref.onMenuClick,
|
|
|
setSeleArr = _ref.setSeleArr,
|
|
|
catalogue = _ref.catalogue,
|
|
|
addCatalogue = _ref.addCatalogue;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
moveVisible = _useState2[0],
|
|
|
setMoveVisible = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(''),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
keyword = _useState4[0],
|
|
|
setKeyword = _useState4[1];
|
|
|
console.log('---', catalogue);
|
|
|
var menu = /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: BottomControlmodules.moveCategory,
|
|
|
onMouseLeave: function onMouseLeave(e) {
|
|
|
return setMoveVisible(false);
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_menu/* default */.Z, {
|
|
|
onClick: onMenuClick,
|
|
|
style: {
|
|
|
maxHeight: 300,
|
|
|
width: 240,
|
|
|
overflow: 'auto'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
|
className: "ant-menu-item multi-llipsis1e ant-menu-item-only-child",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
onChange: function onChange(e) {
|
|
|
setKeyword(e.target.value);
|
|
|
}
|
|
|
})
|
|
|
}), catalogue === null || catalogue === void 0 ? void 0 : catalogue.map(function (item, key) {
|
|
|
var _item$third_category;
|
|
|
if (keyword !== '' && item.category_name.indexOf(keyword) < 0) {
|
|
|
return;
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_menu/* default */.Z.Item, {
|
|
|
className: "multi-llipsis1e",
|
|
|
children: item.category_name
|
|
|
}, item.category_id), item === null || item === void 0 || (_item$third_category = item.third_category) === null || _item$third_category === void 0 ? void 0 : _item$third_category.map(function (val) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_menu/* default */.Z.Item, {
|
|
|
style: {
|
|
|
marginLeft: 20
|
|
|
},
|
|
|
className: "multi-llipsis1e",
|
|
|
children: val.category_name
|
|
|
}, val.category_id);
|
|
|
})]
|
|
|
});
|
|
|
}), addCatalogue && /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
|
className: "ant-menu-item multi-llipsis1e ant-menu-item-only-child",
|
|
|
onClick: addCatalogue,
|
|
|
children: "\u65B0\u5EFA\u5B50\u76EE\u5F55..."
|
|
|
})]
|
|
|
})
|
|
|
});
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: BottomControlmodules.bottomControlContainer,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_checkbox/* default */.Z, {
|
|
|
checked: allSelect,
|
|
|
onChange: setAllSelect,
|
|
|
children: ["\u5168\u9009\u672C\u9875\uFF08", selectArrs.length, "\uFF09"]
|
|
|
})
|
|
|
}), (0,authority/* isAdmin */.GJ)() && buttonDataSource.map(function (item) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
icon: item.icon,
|
|
|
className: BottomControlmodules.buttonWrap,
|
|
|
onClick: function onClick() {
|
|
|
return onButtonClick(item);
|
|
|
},
|
|
|
children: item.name
|
|
|
})
|
|
|
}, item.name);
|
|
|
}), (0,authority/* isAdmin */.GJ)() && (addCatalogue || catalogue) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(dropdown/* default */.Z, {
|
|
|
open: moveVisible,
|
|
|
placement: "topLeft",
|
|
|
autoAdjustOverflow: false,
|
|
|
dropdownRender: function dropdownRender() {
|
|
|
return menu;
|
|
|
},
|
|
|
getPopupContainer: function getPopupContainer(trigger) {
|
|
|
return trigger.parentNode;
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "ant-dropdown-link",
|
|
|
onMouseEnter: function onMouseEnter(e) {
|
|
|
return setMoveVisible(true);
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
className: BottomControlmodules.buttonWrap,
|
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-yidongmulu"
|
|
|
}),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: ["\u79FB\u52A8\u5230\u76EE\u5F55 ", /*#__PURE__*/(0,jsx_runtime.jsx)(DownOutlined/* default */.Z, {})]
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
ghost: true,
|
|
|
onClick: function onClick() {
|
|
|
useBatchStatus(false);
|
|
|
setSeleArr([]);
|
|
|
},
|
|
|
children: "\u53D6\u6D88\u64CD\u4F5C"
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_BottomControl = (BottomControl);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 61529:
|
|
|
/*!******************************************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/components/SearchSortController/index.tsx + 1 modules ***!
|
|
|
\******************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ components_SearchSortController; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
var regeneratorRuntime = __webpack_require__(10574);
|
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/toConsumableArray.js
|
|
|
var toConsumableArray = __webpack_require__(93923);
|
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__(39343);
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(11006);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/menu/index.js + 11 modules
|
|
|
var menu = __webpack_require__(20834);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules
|
|
|
var es_checkbox = __webpack_require__(24905);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js + 1 modules
|
|
|
var dropdown = __webpack_require__(38854);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
|
var tooltip = __webpack_require__(6848);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
|
var input = __webpack_require__(1056);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/components/SearchSortController/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var SearchSortControllermodules = ({"searchSortControllerContainer":"searchSortControllerContainer___Xca1m","btn":"btn___sNJPX","btnSort":"btnSort___Fx9OM","tips":"tips___LrmpR"});
|
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
|
var authority = __webpack_require__(71633);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/UpOutlined.js + 1 modules
|
|
|
var UpOutlined = __webpack_require__(20114);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/DownOutlined.js + 1 modules
|
|
|
var DownOutlined = __webpack_require__(42884);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react-infinite-scroller@1.2.4@react-infinite-scroller/index.js
|
|
|
var _react_infinite_scroller_1_2_4_react_infinite_scroller = __webpack_require__(26724);
|
|
|
var _react_infinite_scroller_1_2_4_react_infinite_scroller_default = /*#__PURE__*/__webpack_require__.n(_react_infinite_scroller_1_2_4_react_infinite_scroller);
|
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
|
|
|
var _umi_production_exports = __webpack_require__(7181);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/components/SearchSortController/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var SearchSortController = function SearchSortController(_ref) {
|
|
|
var isAdmin = _ref.isAdmin,
|
|
|
dataSource = _ref.dataSource,
|
|
|
batchStatus = _ref.batchStatus,
|
|
|
SortMenuName = _ref.SortMenuName,
|
|
|
setSortMenuName = _ref.setSortMenuName,
|
|
|
detailCourseGroupsList = _ref.detailCourseGroupsList,
|
|
|
onSearch = _ref.onSearch,
|
|
|
onBoard = _ref.onBoard,
|
|
|
onSort = _ref.onSort,
|
|
|
isboard = _ref.isboard,
|
|
|
dispatch = _ref.dispatch,
|
|
|
onBatch = _ref.onBatch,
|
|
|
SortMenus = _ref.SortMenus;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
submenuVisible = _useState2[0],
|
|
|
setSubmenuVisible = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
selectArrs = _useState4[0],
|
|
|
setSelectArrs = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(true),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
hasMore = _useState6[0],
|
|
|
setHasmore = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
tableData = _useState8[0],
|
|
|
setTableData = _useState8[1];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(1),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
page = _useState10[0],
|
|
|
setPage = _useState10[1];
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
isLoading = _useState12[0],
|
|
|
setIsLoading = _useState12[1];
|
|
|
var paramsFromRouter = (0,_umi_production_exports.useParams)();
|
|
|
/**
|
|
|
* 排序点击事件
|
|
|
*/
|
|
|
var sortClick = function sortClick(data) {
|
|
|
setSortMenuName(data.name);
|
|
|
onSort(data);
|
|
|
};
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (isboard) {
|
|
|
handleInfiniteOnLoad();
|
|
|
}
|
|
|
}, [isboard]);
|
|
|
var handleInfiniteOnLoad = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var _res$course_groups, res, items;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
if (!(hasMore && !isLoading)) {
|
|
|
_context.next = 10;
|
|
|
break;
|
|
|
}
|
|
|
setIsLoading(true);
|
|
|
setPage(page + 1);
|
|
|
_context.next = 5;
|
|
|
return dispatch({
|
|
|
type: 'classroomList/getCourseGroupsList',
|
|
|
payload: {
|
|
|
page: page,
|
|
|
id: paramsFromRouter.coursesId,
|
|
|
limit: 20,
|
|
|
nonenavigate: true
|
|
|
}
|
|
|
});
|
|
|
case 5:
|
|
|
res = _context.sent;
|
|
|
items = toConsumableArray_default()((res === null || res === void 0 ? void 0 : res.course_groups) || []);
|
|
|
if ((res === null || res === void 0 || (_res$course_groups = res.course_groups) === null || _res$course_groups === void 0 ? void 0 : _res$course_groups.length) < 20) {
|
|
|
setHasmore(false);
|
|
|
items.push({
|
|
|
id: 0,
|
|
|
name: '未分班'
|
|
|
});
|
|
|
}
|
|
|
setIsLoading(false);
|
|
|
setTableData([].concat(toConsumableArray_default()(tableData), toConsumableArray_default()(items)));
|
|
|
case 10:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function handleInfiniteOnLoad() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var submenu = /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
|
className: SearchSortControllermodules.dropmenu,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
maxHeight: 200,
|
|
|
overflow: 'auto'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)((_react_infinite_scroller_1_2_4_react_infinite_scroller_default()), {
|
|
|
initialLoad: false,
|
|
|
pageStart: 1,
|
|
|
threshold: 20,
|
|
|
loadMore: function loadMore(page) {
|
|
|
handleInfiniteOnLoad();
|
|
|
},
|
|
|
hasMore: hasMore,
|
|
|
useWindow: false,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z, {
|
|
|
style: {
|
|
|
width: 240,
|
|
|
zIndex: 10
|
|
|
},
|
|
|
children: (detailCourseGroupsList === null || detailCourseGroupsList === void 0 ? void 0 : detailCourseGroupsList.group_count) > 0 && (tableData === null || tableData === void 0 ? void 0 : tableData.filter(function (item) {
|
|
|
return item.edit_auth || item.name === '未分班';
|
|
|
}).map(function (item, key) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z.Item, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
|
checked: selectArrs.includes(item.id),
|
|
|
value: item.id,
|
|
|
onChange: function onChange(e) {
|
|
|
var key = selectArrs.indexOf(item.id);
|
|
|
if (selectArrs.indexOf(item.id) > -1) {
|
|
|
setSelectArrs(selectArrs.filter(function (val) {
|
|
|
return val !== item.id;
|
|
|
}));
|
|
|
} else {
|
|
|
setSelectArrs(selectArrs.concat(item.id));
|
|
|
}
|
|
|
},
|
|
|
children: item.name
|
|
|
})
|
|
|
}, item.id);
|
|
|
}))
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
style: {
|
|
|
background: "#fff"
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "link",
|
|
|
onClick: function onClick() {
|
|
|
// if (selectArrs == '') {
|
|
|
// message.error('请选择你要操作的任务');
|
|
|
// return null;
|
|
|
// }
|
|
|
onBoard(selectArrs);
|
|
|
// params.group_ids = selectArrs;
|
|
|
// params.page = 1;
|
|
|
// setparams({ ...params })
|
|
|
},
|
|
|
children: "\u786E\u5B9A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "link",
|
|
|
onClick: function onClick() {
|
|
|
setSelectArrs([]);
|
|
|
},
|
|
|
children: "\u91CD\u7F6E"
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
// 默认排序
|
|
|
var isDefault = SortMenuName === '默认排序';
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: SearchSortControllermodules.searchSortControllerContainer,
|
|
|
children: [!!(SortMenus !== null && SortMenus !== void 0 && SortMenus.length) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(dropdown/* default */.Z, {
|
|
|
dropdownRender: function dropdownRender() {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z, {
|
|
|
selectedKeys: [SortMenuName],
|
|
|
children: SortMenus.map(function (item) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z.Item, {
|
|
|
onClick: function onClick() {
|
|
|
return sortClick(item);
|
|
|
},
|
|
|
children: item.name
|
|
|
}, item.name);
|
|
|
})
|
|
|
});
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "".concat(SearchSortControllermodules.btn, " ").concat(isDefault ? SearchSortControllermodules.btnSort : ''),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-paixu font14 mr5"
|
|
|
}), SortMenuName]
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
}), isDefault && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u4F18\u5148\u6309\u7167\u8C03\u6574\u6392\u5E8F\u7ED3\u679C\u5C55\u793A\uFF0C\u672A\u8BBE\u7F6E\u6392\u5E8F\u65F6\uFF0C\u6309\u7167\u521B\u5EFA\u65F6\u95F4\u964D\u5E8F\u6392\u5217",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: SearchSortControllermodules.tips,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-a-wenhaobeifen2"
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
|
|
|
allowClear: true,
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u540D\u79F0\u8FDB\u884C\u641C\u7D22",
|
|
|
onSearch: onSearch,
|
|
|
style: {
|
|
|
width: 220,
|
|
|
marginLeft: 'auto',
|
|
|
marginRight: 10
|
|
|
}
|
|
|
}), (0,authority/* isAdmins */.eB)() && isboard && /*#__PURE__*/(0,jsx_runtime.jsx)(dropdown/* default */.Z, {
|
|
|
dropdownRender: function dropdownRender() {
|
|
|
return submenu;
|
|
|
},
|
|
|
open: submenuVisible,
|
|
|
onOpenChange: function onOpenChange(flag) {
|
|
|
setSubmenuVisible(flag);
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
|
|
|
children: ["\u5206\u73ED", submenuVisible ? /*#__PURE__*/(0,jsx_runtime.jsx)(UpOutlined/* default */.Z, {
|
|
|
style: {
|
|
|
marginLeft: 6
|
|
|
}
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(DownOutlined/* default */.Z, {
|
|
|
style: {
|
|
|
marginLeft: 6
|
|
|
}
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_SearchSortController = (SearchSortController);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 79512:
|
|
|
/*!*****************************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/components/TabMenu/index.tsx + 1 modules ***!
|
|
|
\*****************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ components_TabMenu; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
|
|
|
var row = __webpack_require__(95237);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
|
|
|
var col = __webpack_require__(43604);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/menu/index.js + 11 modules
|
|
|
var menu = __webpack_require__(20834);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js + 1 modules
|
|
|
var dropdown = __webpack_require__(38854);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/components/TabMenu/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var TabMenumodules = ({"tabMenuContainer":"tabMenuContainer___uf5IP","control":"control___GheLs","iconH":"iconH___Wzw_r","selectBtn":"selectBtn___mfEnI"});
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/components/TabMenu/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var TabMenu = function TabMenu(_ref) {
|
|
|
var isLoading = _ref.isLoading,
|
|
|
addText = _ref.addText,
|
|
|
tabDataSource = _ref.tabDataSource,
|
|
|
isAdmin = _ref.isAdmin,
|
|
|
defaultSelectedKeys = _ref.defaultSelectedKeys,
|
|
|
onTabMenuClick = _ref.onTabMenuClick,
|
|
|
getDropdownMenu = _ref.getDropdownMenu,
|
|
|
showControlButton = _ref.showControlButton,
|
|
|
buttonText = _ref.buttonText,
|
|
|
_ref$buttonIcon = _ref.buttonIcon,
|
|
|
buttonIcon = _ref$buttonIcon === void 0 ? 'icon-tianjiadaohang' : _ref$buttonIcon,
|
|
|
extraNode = _ref.extraNode,
|
|
|
_ref$onButtonClick = _ref.onButtonClick,
|
|
|
onButtonClick = _ref$onButtonClick === void 0 ? function () {} : _ref$onButtonClick;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: TabMenumodules.tabMenuContainer,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: "1",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z, {
|
|
|
onSelect: function onSelect(v) {
|
|
|
return !isLoading ? onTabMenuClick(v) : {};
|
|
|
},
|
|
|
mode: "horizontal",
|
|
|
selectedKeys: defaultSelectedKeys,
|
|
|
children: tabDataSource.map(function (item) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(menu/* default */.Z.Item, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-grey-666",
|
|
|
children: item.name
|
|
|
}), item.total !== undefined && isAdmin && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-grey-999 ml20",
|
|
|
children: item.total || 0
|
|
|
})]
|
|
|
}, typeof item.index === 'number' ? item.index : item.id);
|
|
|
})
|
|
|
})
|
|
|
}), isAdmin && /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
className: "mr20",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: TabMenumodules.control,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: TabMenumodules.extra,
|
|
|
children: extraNode
|
|
|
}), showControlButton && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
onClick: onButtonClick,
|
|
|
style: {
|
|
|
cursor: 'pointer'
|
|
|
},
|
|
|
className: TabMenumodules.selectBtn,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont ".concat(buttonIcon)
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: buttonText
|
|
|
})]
|
|
|
}), !!getDropdownMenu && /*#__PURE__*/(0,jsx_runtime.jsx)(dropdown/* default */.Z, {
|
|
|
className: "ml10",
|
|
|
dropdownRender: getDropdownMenu,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: TabMenumodules.selectBtn,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-tianjiadaohang"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: addText ? addText : '创建试卷'
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_TabMenu = (TabMenu);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 1719:
|
|
|
/*!********************************************!*\
|
|
|
!*** ./src/assets/images/paper/jinshi.svg ***!
|
|
|
\********************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* unused harmony export ReactComponent */
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
|
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
|
var __defProp = Object.defineProperty;
|
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var __defNormalProp = function __defNormalProp(obj, key, value) {
|
|
|
return key in obj ? __defProp(obj, key, {
|
|
|
enumerable: true,
|
|
|
configurable: true,
|
|
|
writable: true,
|
|
|
value: value
|
|
|
}) : obj[key] = value;
|
|
|
};
|
|
|
var __spreadValues = function __spreadValues(a, b) {
|
|
|
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
|
if (__getOwnPropSymbols) {
|
|
|
var _iterator = _createForOfIteratorHelper(__getOwnPropSymbols(b)),
|
|
|
_step;
|
|
|
try {
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
var prop = _step.value;
|
|
|
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
|
|
|
var SvgJinshi = function SvgJinshi(props) {
|
|
|
return /* @__PURE__ */React.createElement("svg", __spreadValues({
|
|
|
width: 14,
|
|
|
height: 14,
|
|
|
xmlns: "http://www.w3.org/2000/svg"
|
|
|
}, props), /* @__PURE__ */React.createElement("title", null, "\u7F16\u7EC4 18"), /* @__PURE__ */React.createElement("g", {
|
|
|
fill: "none",
|
|
|
fillRule: "evenodd"
|
|
|
}, /* @__PURE__ */React.createElement("circle", {
|
|
|
fill: "#FCB041",
|
|
|
cx: 7,
|
|
|
cy: 7,
|
|
|
r: 7
|
|
|
}), /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M7.531 9.638a.616.616 0 1 1-1.231 0v-.02a.616.616 0 1 1 1.231 0v.02Zm0-2.25a.616.616 0 1 1-1.231 0V4.117a.616.616 0 1 1 1.231 0v3.273Z",
|
|
|
fill: "#FFF",
|
|
|
fillRule: "nonzero"
|
|
|
})));
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__.Z = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiNGQ0IwNDEiIGN4PSI3IiBjeT0iNyIgcj0iNyIvPjxwYXRoIGQ9Ik03LjUzMSA5LjYzOGEuNjE2LjYxNiAwIDEgMS0xLjIzMSAwdi0uMDJhLjYxNi42MTYgMCAxIDEgMS4yMzEgMHYuMDJabTAtMi4yNWEuNjE2LjYxNiAwIDEgMS0xLjIzMSAwVjQuMTE3YS42MTYuNjE2IDAgMSAxIDEuMjMxIDB2My4yNzNaIiBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+");
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 3450:
|
|
|
/*!****************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/Exercise/index.less?modules ***!
|
|
|
\****************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
|
|
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ __webpack_exports__.Z = ({"flex_box_center":"flex_box_center___iyIe6","flex_space_between":"flex_space_between___g2WjG","flex_box_vertical_center":"flex_box_vertical_center___Tde0v","flex_box_center_end":"flex_box_center_end___W1D5W","flex_box_column":"flex_box_column___ZiFvs","bg":"bg___T2R2s","containerTitle":"containerTitle___yARn_","containerDesc":"containerDesc___fKSYF","menus":"menus___e8wtg","listItem":"listItem___s7xhg","info":"info___Hx2bW","title":"title___W7a1R","titleLeft":"titleLeft___C5r0w","titleRight":"titleRight___g5GZv","acitons":"acitons___H0RU0","move":"move___qYkSy","hideHeadCheckbox":"hideHeadCheckbox___Hq5gw","moveCategory":"moveCategory___bZSGQ","tabSearch":"tabSearch___NaKI4","warpModal":"warpModal___HLUgh","modalColumn":"modalColumn___F7R5w","modalRow":"modalRow___L6ghw","sup":"sup___VGKXV"});
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 77578:
|
|
|
/*!**********************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/_util/getRenderPropValue.js ***!
|
|
|
\**********************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ Z: function() { return /* binding */ getRenderPropValue; }
|
|
|
/* harmony export */ });
|
|
|
const getRenderPropValue = propValue => {
|
|
|
if (!propValue) {
|
|
|
return null;
|
|
|
}
|
|
|
if (typeof propValue === 'function') {
|
|
|
return propValue();
|
|
|
}
|
|
|
return propValue;
|
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 39722:
|
|
|
/*!***************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/popover/PurePanel.js ***!
|
|
|
\***************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* unused harmony exports getOverlay, RawPurePanel */
|
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ 12124);
|
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var rc_tooltip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rc-tooltip */ 55477);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 59301);
|
|
|
/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../config-provider */ 36355);
|
|
|
/* harmony import */ var _util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../_util/getRenderPropValue */ 77578);
|
|
|
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./style */ 17356);
|
|
|
"use client";
|
|
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getOverlay = (prefixCls, title, content) => {
|
|
|
if (!title && !content) return undefined;
|
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(react__WEBPACK_IMPORTED_MODULE_2__.Fragment, null, title && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("div", {
|
|
|
className: `${prefixCls}-title`
|
|
|
}, (0,_util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_3__/* .getRenderPropValue */ .Z)(title)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("div", {
|
|
|
className: `${prefixCls}-inner-content`
|
|
|
}, (0,_util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_3__/* .getRenderPropValue */ .Z)(content)));
|
|
|
};
|
|
|
const RawPurePanel = props => {
|
|
|
const {
|
|
|
hashId,
|
|
|
prefixCls,
|
|
|
className,
|
|
|
style,
|
|
|
placement = 'top',
|
|
|
title,
|
|
|
content,
|
|
|
children
|
|
|
} = props;
|
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("div", {
|
|
|
className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(hashId, prefixCls, `${prefixCls}-pure`, `${prefixCls}-placement-${placement}`, className),
|
|
|
style: style
|
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("div", {
|
|
|
className: `${prefixCls}-arrow`
|
|
|
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(rc_tooltip__WEBPACK_IMPORTED_MODULE_1__/* .Popup */ .G, Object.assign({}, props, {
|
|
|
className: hashId,
|
|
|
prefixCls: prefixCls
|
|
|
}), children || getOverlay(prefixCls, title, content)));
|
|
|
};
|
|
|
const PurePanel = props => {
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls
|
|
|
} = props,
|
|
|
restProps = __rest(props, ["prefixCls"]);
|
|
|
const {
|
|
|
getPrefixCls
|
|
|
} = react__WEBPACK_IMPORTED_MODULE_2__.useContext(_config_provider__WEBPACK_IMPORTED_MODULE_4__/* .ConfigContext */ .E_);
|
|
|
const prefixCls = getPrefixCls('popover', customizePrefixCls);
|
|
|
const [wrapSSR, hashId] = (0,_style__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)(prefixCls);
|
|
|
return wrapSSR( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(RawPurePanel, Object.assign({}, restProps, {
|
|
|
prefixCls: prefixCls,
|
|
|
hashId: hashId
|
|
|
})));
|
|
|
};
|
|
|
/* harmony default export */ __webpack_exports__.ZP = (PurePanel);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 60324:
|
|
|
/*!***********************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/popover/index.js ***!
|
|
|
\***********************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ 12124);
|
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ 59301);
|
|
|
/* harmony import */ var _util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../_util/getRenderPropValue */ 77578);
|
|
|
/* harmony import */ var _util_motion__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../_util/motion */ 62892);
|
|
|
/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../config-provider */ 36355);
|
|
|
/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../tooltip */ 6848);
|
|
|
/* harmony import */ var _PurePanel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./PurePanel */ 39722);
|
|
|
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./style */ 17356);
|
|
|
"use client";
|
|
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// CSSINJS
|
|
|
|
|
|
const Overlay = _ref => {
|
|
|
let {
|
|
|
title,
|
|
|
content,
|
|
|
prefixCls
|
|
|
} = _ref;
|
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, title && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", {
|
|
|
className: `${prefixCls}-title`
|
|
|
}, (0,_util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_2__/* .getRenderPropValue */ .Z)(title)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", {
|
|
|
className: `${prefixCls}-inner-content`
|
|
|
}, (0,_util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_2__/* .getRenderPropValue */ .Z)(content)));
|
|
|
};
|
|
|
const Popover = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.forwardRef((props, ref) => {
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
title,
|
|
|
content,
|
|
|
overlayClassName,
|
|
|
placement = 'top',
|
|
|
trigger = 'hover',
|
|
|
mouseEnterDelay = 0.1,
|
|
|
mouseLeaveDelay = 0.1,
|
|
|
overlayStyle = {}
|
|
|
} = props,
|
|
|
otherProps = __rest(props, ["prefixCls", "title", "content", "overlayClassName", "placement", "trigger", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle"]);
|
|
|
const {
|
|
|
getPrefixCls
|
|
|
} = react__WEBPACK_IMPORTED_MODULE_1__.useContext(_config_provider__WEBPACK_IMPORTED_MODULE_3__/* .ConfigContext */ .E_);
|
|
|
const prefixCls = getPrefixCls('popover', customizePrefixCls);
|
|
|
const [wrapSSR, hashId] = (0,_style__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(prefixCls);
|
|
|
const rootPrefixCls = getPrefixCls();
|
|
|
const overlayCls = classnames__WEBPACK_IMPORTED_MODULE_0___default()(overlayClassName, hashId);
|
|
|
return wrapSSR( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement(_tooltip__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, Object.assign({
|
|
|
placement: placement,
|
|
|
trigger: trigger,
|
|
|
mouseEnterDelay: mouseEnterDelay,
|
|
|
mouseLeaveDelay: mouseLeaveDelay,
|
|
|
overlayStyle: overlayStyle
|
|
|
}, otherProps, {
|
|
|
prefixCls: prefixCls,
|
|
|
overlayClassName: overlayCls,
|
|
|
ref: ref,
|
|
|
overlay: title || content ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement(Overlay, {
|
|
|
prefixCls: prefixCls,
|
|
|
title: title,
|
|
|
content: content
|
|
|
}) : null,
|
|
|
transitionName: (0,_util_motion__WEBPACK_IMPORTED_MODULE_6__/* .getTransitionName */ .m)(rootPrefixCls, 'zoom-big', otherProps.transitionName),
|
|
|
"data-popover-inject": true
|
|
|
})));
|
|
|
});
|
|
|
if (false) {}
|
|
|
Popover._InternalPanelDoNotUseOrYouWillBeFired = _PurePanel__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP;
|
|
|
/* harmony default export */ __webpack_exports__.Z = (Popover);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 17356:
|
|
|
/*!*****************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/popover/style/index.js ***!
|
|
|
\*****************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../style */ 17313);
|
|
|
/* harmony import */ var _style_motion__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../style/motion */ 29878);
|
|
|
/* harmony import */ var _style_placementArrow__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style/placementArrow */ 19447);
|
|
|
/* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ 33166);
|
|
|
/* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ 83116);
|
|
|
/* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/internal */ 37613);
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const genBaseStyle = token => {
|
|
|
const {
|
|
|
componentCls,
|
|
|
popoverColor,
|
|
|
minWidth,
|
|
|
fontWeightStrong,
|
|
|
popoverPadding,
|
|
|
boxShadowSecondary,
|
|
|
colorTextHeading,
|
|
|
borderRadiusLG: borderRadius,
|
|
|
zIndexPopup,
|
|
|
marginXS,
|
|
|
colorBgElevated,
|
|
|
popoverBg
|
|
|
} = token;
|
|
|
return [{
|
|
|
[componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_0__/* .resetComponent */ .Wf)(token)), {
|
|
|
position: 'absolute',
|
|
|
top: 0,
|
|
|
// use `left` to fix https://github.com/ant-design/ant-design/issues/39195
|
|
|
left: {
|
|
|
_skip_check_: true,
|
|
|
value: 0
|
|
|
},
|
|
|
zIndex: zIndexPopup,
|
|
|
fontWeight: 'normal',
|
|
|
whiteSpace: 'normal',
|
|
|
textAlign: 'start',
|
|
|
cursor: 'auto',
|
|
|
userSelect: 'text',
|
|
|
transformOrigin: `var(--arrow-x, 50%) var(--arrow-y, 50%)`,
|
|
|
'--antd-arrow-background-color': colorBgElevated,
|
|
|
'&-rtl': {
|
|
|
direction: 'rtl'
|
|
|
},
|
|
|
'&-hidden': {
|
|
|
display: 'none'
|
|
|
},
|
|
|
[`${componentCls}-content`]: {
|
|
|
position: 'relative'
|
|
|
},
|
|
|
[`${componentCls}-inner`]: {
|
|
|
backgroundColor: popoverBg,
|
|
|
backgroundClip: 'padding-box',
|
|
|
borderRadius,
|
|
|
boxShadow: boxShadowSecondary,
|
|
|
padding: popoverPadding
|
|
|
},
|
|
|
[`${componentCls}-title`]: {
|
|
|
minWidth,
|
|
|
marginBottom: marginXS,
|
|
|
color: colorTextHeading,
|
|
|
fontWeight: fontWeightStrong
|
|
|
},
|
|
|
[`${componentCls}-inner-content`]: {
|
|
|
color: popoverColor
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
// Arrow Style
|
|
|
(0,_style_placementArrow__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP)(token, {
|
|
|
colorBg: 'var(--antd-arrow-background-color)'
|
|
|
}),
|
|
|
// Pure Render
|
|
|
{
|
|
|
[`${componentCls}-pure`]: {
|
|
|
position: 'relative',
|
|
|
maxWidth: 'none',
|
|
|
margin: token.sizePopupArrow,
|
|
|
display: 'inline-block',
|
|
|
[`${componentCls}-content`]: {
|
|
|
display: 'inline-block'
|
|
|
}
|
|
|
}
|
|
|
}];
|
|
|
};
|
|
|
const genColorStyle = token => {
|
|
|
const {
|
|
|
componentCls
|
|
|
} = token;
|
|
|
return {
|
|
|
[componentCls]: _theme_internal__WEBPACK_IMPORTED_MODULE_2__/* .PresetColors */ .i.map(colorKey => {
|
|
|
const lightColor = token[`${colorKey}6`];
|
|
|
return {
|
|
|
[`&${componentCls}-${colorKey}`]: {
|
|
|
'--antd-arrow-background-color': lightColor,
|
|
|
[`${componentCls}-inner`]: {
|
|
|
backgroundColor: lightColor
|
|
|
},
|
|
|
[`${componentCls}-arrow`]: {
|
|
|
background: 'transparent'
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
})
|
|
|
};
|
|
|
};
|
|
|
const genWireframeStyle = token => {
|
|
|
const {
|
|
|
componentCls,
|
|
|
lineWidth,
|
|
|
lineType,
|
|
|
colorSplit,
|
|
|
paddingSM,
|
|
|
controlHeight,
|
|
|
fontSize,
|
|
|
lineHeight,
|
|
|
padding
|
|
|
} = token;
|
|
|
const titlePaddingBlockDist = controlHeight - Math.round(fontSize * lineHeight);
|
|
|
const popoverTitlePaddingBlockTop = titlePaddingBlockDist / 2;
|
|
|
const popoverTitlePaddingBlockBottom = titlePaddingBlockDist / 2 - lineWidth;
|
|
|
const popoverPaddingHorizontal = padding;
|
|
|
return {
|
|
|
[componentCls]: {
|
|
|
[`${componentCls}-inner`]: {
|
|
|
padding: 0
|
|
|
},
|
|
|
[`${componentCls}-title`]: {
|
|
|
margin: 0,
|
|
|
padding: `${popoverTitlePaddingBlockTop}px ${popoverPaddingHorizontal}px ${popoverTitlePaddingBlockBottom}px`,
|
|
|
borderBottom: `${lineWidth}px ${lineType} ${colorSplit}`
|
|
|
},
|
|
|
[`${componentCls}-inner-content`]: {
|
|
|
padding: `${paddingSM}px ${popoverPaddingHorizontal}px`
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
/* harmony default export */ __webpack_exports__.Z = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)('Popover', token => {
|
|
|
const {
|
|
|
colorBgElevated,
|
|
|
colorText,
|
|
|
wireframe
|
|
|
} = token;
|
|
|
const popoverToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_4__/* .merge */ .TS)(token, {
|
|
|
popoverPadding: 12,
|
|
|
popoverBg: colorBgElevated,
|
|
|
popoverColor: colorText
|
|
|
});
|
|
|
return [genBaseStyle(popoverToken), genColorStyle(popoverToken), wireframe && genWireframeStyle(popoverToken), (0,_style_motion__WEBPACK_IMPORTED_MODULE_5__/* .initZoomMotion */ ._y)(popoverToken, 'zoom-big')];
|
|
|
}, token => ({
|
|
|
width: 177,
|
|
|
minWidth: 177,
|
|
|
zIndexPopup: token.zIndexPopupBase + 30
|
|
|
}), {
|
|
|
resetStyle: false,
|
|
|
deprecatedTokens: [['width', 'minWidth']]
|
|
|
}));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 31797:
|
|
|
/*!*************************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/statistic/index.js + 5 modules ***!
|
|
|
\*************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ es_statistic; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/hooks/useForceUpdate.js
|
|
|
var useForceUpdate = __webpack_require__(56762);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/reactNode.js
|
|
|
var reactNode = __webpack_require__(92343);
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.3.2@classnames/index.js
|
|
|
var _classnames_2_3_2_classnames = __webpack_require__(12124);
|
|
|
var _classnames_2_3_2_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_3_2_classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
|
var context = __webpack_require__(36355);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/skeleton/index.js + 12 modules
|
|
|
var skeleton = __webpack_require__(59981);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/Number.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
const StatisticNumber = props => {
|
|
|
const {
|
|
|
value,
|
|
|
formatter,
|
|
|
precision,
|
|
|
decimalSeparator,
|
|
|
groupSeparator = '',
|
|
|
prefixCls
|
|
|
} = props;
|
|
|
let valueNode;
|
|
|
if (typeof formatter === 'function') {
|
|
|
// Customize formatter
|
|
|
valueNode = formatter(value);
|
|
|
} else {
|
|
|
// Internal formatter
|
|
|
const val = String(value);
|
|
|
const cells = val.match(/^(-?)(\d*)(\.(\d+))?$/);
|
|
|
// Process if illegal number
|
|
|
if (!cells || val === '-') {
|
|
|
valueNode = val;
|
|
|
} else {
|
|
|
const negative = cells[1];
|
|
|
let int = cells[2] || '0';
|
|
|
let decimal = cells[4] || '';
|
|
|
int = int.replace(/\B(?=(\d{3})+(?!\d))/g, groupSeparator);
|
|
|
if (typeof precision === 'number') {
|
|
|
decimal = decimal.padEnd(precision, '0').slice(0, precision > 0 ? precision : 0);
|
|
|
}
|
|
|
if (decimal) {
|
|
|
decimal = `${decimalSeparator}${decimal}`;
|
|
|
}
|
|
|
valueNode = [/*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
key: "int",
|
|
|
className: `${prefixCls}-content-value-int`
|
|
|
}, negative, int), decimal && /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
key: "decimal",
|
|
|
className: `${prefixCls}-content-value-decimal`
|
|
|
}, decimal)];
|
|
|
}
|
|
|
}
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
className: `${prefixCls}-content-value`
|
|
|
}, valueNode);
|
|
|
};
|
|
|
/* harmony default export */ var statistic_Number = (StatisticNumber);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/style/index.js
|
|
|
var style = __webpack_require__(17313);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/genComponentStyleHook.js
|
|
|
var genComponentStyleHook = __webpack_require__(83116);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/statistic.js
|
|
|
var statistic = __webpack_require__(37613);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/style/index.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
const genStatisticStyle = token => {
|
|
|
const {
|
|
|
componentCls,
|
|
|
marginXXS,
|
|
|
padding,
|
|
|
colorTextDescription,
|
|
|
titleFontSize,
|
|
|
colorTextHeading,
|
|
|
contentFontSize,
|
|
|
fontFamily
|
|
|
} = token;
|
|
|
return {
|
|
|
[`${componentCls}`]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
|
[`${componentCls}-title`]: {
|
|
|
marginBottom: marginXXS,
|
|
|
color: colorTextDescription,
|
|
|
fontSize: titleFontSize
|
|
|
},
|
|
|
[`${componentCls}-skeleton`]: {
|
|
|
paddingTop: padding
|
|
|
},
|
|
|
[`${componentCls}-content`]: {
|
|
|
color: colorTextHeading,
|
|
|
fontSize: contentFontSize,
|
|
|
fontFamily,
|
|
|
[`${componentCls}-content-value`]: {
|
|
|
display: 'inline-block',
|
|
|
direction: 'ltr'
|
|
|
},
|
|
|
[`${componentCls}-content-prefix, ${componentCls}-content-suffix`]: {
|
|
|
display: 'inline-block'
|
|
|
},
|
|
|
[`${componentCls}-content-prefix`]: {
|
|
|
marginInlineEnd: marginXXS
|
|
|
},
|
|
|
[`${componentCls}-content-suffix`]: {
|
|
|
marginInlineStart: marginXXS
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
};
|
|
|
};
|
|
|
// ============================== Export ==============================
|
|
|
/* harmony default export */ var statistic_style = ((0,genComponentStyleHook/* default */.Z)('Statistic', token => {
|
|
|
const statisticToken = (0,statistic/* merge */.TS)(token, {});
|
|
|
return [genStatisticStyle(statisticToken)];
|
|
|
}, token => {
|
|
|
const {
|
|
|
fontSizeHeading3,
|
|
|
fontSize
|
|
|
} = token;
|
|
|
return {
|
|
|
titleFontSize: fontSize,
|
|
|
contentFontSize: fontSizeHeading3
|
|
|
};
|
|
|
}));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/Statistic.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Statistic = props => {
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
className,
|
|
|
rootClassName,
|
|
|
style,
|
|
|
valueStyle,
|
|
|
value = 0,
|
|
|
title,
|
|
|
valueRender,
|
|
|
prefix,
|
|
|
suffix,
|
|
|
loading = false,
|
|
|
onMouseEnter,
|
|
|
onMouseLeave,
|
|
|
decimalSeparator = '.',
|
|
|
groupSeparator = ','
|
|
|
} = props;
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
direction,
|
|
|
statistic
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
const prefixCls = getPrefixCls('statistic', customizePrefixCls);
|
|
|
const [wrapSSR, hashId] = statistic_style(prefixCls);
|
|
|
const valueNode = /*#__PURE__*/_react_17_0_2_react.createElement(statistic_Number, Object.assign({
|
|
|
decimalSeparator: decimalSeparator,
|
|
|
groupSeparator: groupSeparator,
|
|
|
prefixCls: prefixCls
|
|
|
}, props, {
|
|
|
value: value
|
|
|
}));
|
|
|
const cls = _classnames_2_3_2_classnames_default()(prefixCls, {
|
|
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
|
}, statistic === null || statistic === void 0 ? void 0 : statistic.className, className, rootClassName, hashId);
|
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
className: cls,
|
|
|
style: Object.assign(Object.assign({}, statistic === null || statistic === void 0 ? void 0 : statistic.style), style),
|
|
|
onMouseEnter: onMouseEnter,
|
|
|
onMouseLeave: onMouseLeave
|
|
|
}, title && /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
className: `${prefixCls}-title`
|
|
|
}, title), /*#__PURE__*/_react_17_0_2_react.createElement(skeleton/* default */.Z, {
|
|
|
paragraph: false,
|
|
|
loading: loading,
|
|
|
className: `${prefixCls}-skeleton`
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
style: valueStyle,
|
|
|
className: `${prefixCls}-content`
|
|
|
}, prefix && /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
className: `${prefixCls}-content-prefix`
|
|
|
}, prefix), valueRender ? valueRender(valueNode) : valueNode, suffix && /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
className: `${prefixCls}-content-suffix`
|
|
|
}, suffix)))));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var statistic_Statistic = (Statistic);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/utils.js
|
|
|
// Countdown
|
|
|
const timeUnits = [['Y', 1000 * 60 * 60 * 24 * 365], ['M', 1000 * 60 * 60 * 24 * 30], ['D', 1000 * 60 * 60 * 24], ['H', 1000 * 60 * 60], ['m', 1000 * 60], ['s', 1000], ['S', 1] // million seconds
|
|
|
];
|
|
|
|
|
|
function formatTimeStr(duration, format) {
|
|
|
let leftDuration = duration;
|
|
|
const escapeRegex = /\[[^\]]*]/g;
|
|
|
const keepList = (format.match(escapeRegex) || []).map(str => str.slice(1, -1));
|
|
|
const templateText = format.replace(escapeRegex, '[]');
|
|
|
const replacedText = timeUnits.reduce((current, _ref) => {
|
|
|
let [name, unit] = _ref;
|
|
|
if (current.includes(name)) {
|
|
|
const value = Math.floor(leftDuration / unit);
|
|
|
leftDuration -= value * unit;
|
|
|
return current.replace(new RegExp(`${name}+`, 'g'), match => {
|
|
|
const len = match.length;
|
|
|
return value.toString().padStart(len, '0');
|
|
|
});
|
|
|
}
|
|
|
return current;
|
|
|
}, templateText);
|
|
|
let index = 0;
|
|
|
return replacedText.replace(escapeRegex, () => {
|
|
|
const match = keepList[index];
|
|
|
index += 1;
|
|
|
return match;
|
|
|
});
|
|
|
}
|
|
|
function formatCountdown(value, config) {
|
|
|
const {
|
|
|
format = ''
|
|
|
} = config;
|
|
|
const target = new Date(value).getTime();
|
|
|
const current = Date.now();
|
|
|
const diff = Math.max(target - current, 0);
|
|
|
return formatTimeStr(diff, format);
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/Countdown.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const REFRESH_INTERVAL = 1000 / 30;
|
|
|
function getTime(value) {
|
|
|
return new Date(value).getTime();
|
|
|
}
|
|
|
const Countdown = props => {
|
|
|
const {
|
|
|
value,
|
|
|
format = 'HH:mm:ss',
|
|
|
onChange,
|
|
|
onFinish
|
|
|
} = props;
|
|
|
const forceUpdate = (0,useForceUpdate/* default */.Z)();
|
|
|
const countdown = _react_17_0_2_react.useRef(null);
|
|
|
const stopTimer = () => {
|
|
|
onFinish === null || onFinish === void 0 ? void 0 : onFinish();
|
|
|
if (countdown.current) {
|
|
|
clearInterval(countdown.current);
|
|
|
countdown.current = null;
|
|
|
}
|
|
|
};
|
|
|
const syncTimer = () => {
|
|
|
const timestamp = getTime(value);
|
|
|
if (timestamp >= Date.now()) {
|
|
|
countdown.current = setInterval(() => {
|
|
|
forceUpdate();
|
|
|
onChange === null || onChange === void 0 ? void 0 : onChange(timestamp - Date.now());
|
|
|
if (timestamp < Date.now()) {
|
|
|
stopTimer();
|
|
|
}
|
|
|
}, REFRESH_INTERVAL);
|
|
|
}
|
|
|
};
|
|
|
_react_17_0_2_react.useEffect(() => {
|
|
|
syncTimer();
|
|
|
return () => {
|
|
|
if (countdown.current) {
|
|
|
clearInterval(countdown.current);
|
|
|
countdown.current = null;
|
|
|
}
|
|
|
};
|
|
|
}, [value]);
|
|
|
const formatter = (formatValue, config) => formatCountdown(formatValue, Object.assign(Object.assign({}, config), {
|
|
|
format
|
|
|
}));
|
|
|
const valueRender = node => (0,reactNode/* cloneElement */.Tm)(node, {
|
|
|
title: undefined
|
|
|
});
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(statistic_Statistic, Object.assign({}, props, {
|
|
|
valueRender: valueRender,
|
|
|
formatter: formatter
|
|
|
}));
|
|
|
};
|
|
|
/* harmony default export */ var statistic_Countdown = (/*#__PURE__*/_react_17_0_2_react.memo(Countdown));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/index.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
statistic_Statistic.Countdown = statistic_Countdown;
|
|
|
/* harmony default export */ var es_statistic = (statistic_Statistic);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 80010:
|
|
|
/*!*********************************************************************************!*\
|
|
|
!*** ./node_modules/_react-resizable@1.11.0@react-resizable/build/Resizable.js ***!
|
|
|
\*********************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
exports.__esModule = true;
|
|
|
exports["default"] = void 0;
|
|
|
|
|
|
var _react = _interopRequireDefault(__webpack_require__(/*! react */ 59301));
|
|
|
|
|
|
var _reactDraggable = __webpack_require__(/*! react-draggable */ 12911);
|
|
|
|
|
|
var _utils = __webpack_require__(/*! ./utils */ 73638);
|
|
|
|
|
|
var _propTypes = __webpack_require__(/*! ./propTypes */ 6217);
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
|
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
|
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
|
|
|
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
|
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
|
|
|
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
|
|
|
|
var Resizable = /*#__PURE__*/function (_React$Component) {
|
|
|
_inheritsLoose(Resizable, _React$Component);
|
|
|
|
|
|
function Resizable() {
|
|
|
var _this;
|
|
|
|
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
|
args[_key] = arguments[_key];
|
|
|
}
|
|
|
|
|
|
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
|
|
|
|
_defineProperty(_assertThisInitialized(_this), "state", undefined);
|
|
|
|
|
|
_defineProperty(_assertThisInitialized(_this), "lastHandleRect", null);
|
|
|
|
|
|
_defineProperty(_assertThisInitialized(_this), "slack", null);
|
|
|
|
|
|
return _this;
|
|
|
}
|
|
|
|
|
|
var _proto = Resizable.prototype;
|
|
|
|
|
|
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
|
this.resetData();
|
|
|
};
|
|
|
|
|
|
_proto.lockAspectRatio = function lockAspectRatio(width, height, aspectRatio) {
|
|
|
height = width / aspectRatio;
|
|
|
width = height * aspectRatio;
|
|
|
return [width, height];
|
|
|
};
|
|
|
|
|
|
_proto.resetData = function resetData() {
|
|
|
this.lastHandleRect = this.slack = null;
|
|
|
} // Clamp width and height within provided constraints
|
|
|
;
|
|
|
|
|
|
_proto.runConstraints = function runConstraints(width, height) {
|
|
|
var _ref = [this.props.minConstraints, this.props.maxConstraints],
|
|
|
min = _ref[0],
|
|
|
max = _ref[1];
|
|
|
if (!min && !max) return [width, height]; // If constraining to min and max, we need to also fit width and height to aspect ratio.
|
|
|
|
|
|
if (this.props.lockAspectRatio) {
|
|
|
var resizingHorizontally = height === this.props.height;
|
|
|
|
|
|
if (resizingHorizontally) {
|
|
|
var ratio = this.props.width / this.props.height;
|
|
|
height = width / ratio;
|
|
|
width = height * ratio;
|
|
|
} else {
|
|
|
// Take into account vertical resize with N/S handles on locked aspect
|
|
|
// ratio. Calculate the change height-first, instead of width-first
|
|
|
var _ratio = this.props.height / this.props.width;
|
|
|
|
|
|
width = height / _ratio;
|
|
|
height = width * _ratio;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var oldW = width,
|
|
|
oldH = height; // Add slack to the values used to calculate bound position. This will ensure that if
|
|
|
// we start removing slack, the element won't react to it right away until it's been
|
|
|
// completely removed.
|
|
|
|
|
|
var _ref2 = this.slack || [0, 0],
|
|
|
slackW = _ref2[0],
|
|
|
slackH = _ref2[1];
|
|
|
|
|
|
width += slackW;
|
|
|
height += slackH;
|
|
|
|
|
|
if (min) {
|
|
|
width = Math.max(min[0], width);
|
|
|
height = Math.max(min[1], height);
|
|
|
}
|
|
|
|
|
|
if (max) {
|
|
|
width = Math.min(max[0], width);
|
|
|
height = Math.min(max[1], height);
|
|
|
} // If the width or height changed, we must have introduced some slack. Record it for the next iteration.
|
|
|
|
|
|
|
|
|
this.slack = [slackW + (oldW - width), slackH + (oldH - height)];
|
|
|
return [width, height];
|
|
|
}
|
|
|
/**
|
|
|
* Wrapper around drag events to provide more useful data.
|
|
|
*
|
|
|
* @param {String} handlerName Handler name to wrap.
|
|
|
* @return {Function} Handler function.
|
|
|
*/
|
|
|
;
|
|
|
|
|
|
_proto.resizeHandler = function resizeHandler(handlerName, axis) {
|
|
|
var _this2 = this;
|
|
|
|
|
|
return function (e, _ref3) {
|
|
|
var node = _ref3.node,
|
|
|
deltaX = _ref3.deltaX,
|
|
|
deltaY = _ref3.deltaY;
|
|
|
// Reset data in case it was left over somehow (should not be possible)
|
|
|
if (handlerName === 'onResizeStart') _this2.resetData(); // Axis restrictions
|
|
|
|
|
|
var canDragX = (_this2.props.axis === 'both' || _this2.props.axis === 'x') && axis !== 'n' && axis !== 's';
|
|
|
var canDragY = (_this2.props.axis === 'both' || _this2.props.axis === 'y') && axis !== 'e' && axis !== 'w'; // No dragging possible.
|
|
|
|
|
|
if (!canDragX && !canDragY) return; // Decompose axis for later use
|
|
|
|
|
|
var axisV = axis[0];
|
|
|
var axisH = axis[axis.length - 1]; // intentionally not axis[1], so that this catches axis === 'w' for example
|
|
|
// Track the element being dragged to account for changes in position.
|
|
|
// If a handle's position is changed between callbacks, we need to factor this in to the next callback.
|
|
|
// Failure to do so will cause the element to "skip" when resized upwards or leftwards.
|
|
|
|
|
|
var handleRect = node.getBoundingClientRect();
|
|
|
|
|
|
if (_this2.lastHandleRect != null) {
|
|
|
// If the handle has repositioned on either axis since last render,
|
|
|
// we need to increase our callback values by this much.
|
|
|
// Only checking 'n', 'w' since resizing by 's', 'w' won't affect the overall position on page,
|
|
|
if (axisH === 'w') {
|
|
|
var deltaLeftSinceLast = handleRect.left - _this2.lastHandleRect.left;
|
|
|
deltaX += deltaLeftSinceLast;
|
|
|
}
|
|
|
|
|
|
if (axisV === 'n') {
|
|
|
var deltaTopSinceLast = handleRect.top - _this2.lastHandleRect.top;
|
|
|
deltaY += deltaTopSinceLast;
|
|
|
}
|
|
|
} // Storage of last rect so we know how much it has really moved.
|
|
|
|
|
|
|
|
|
_this2.lastHandleRect = handleRect; // Reverse delta if using top or left drag handles.
|
|
|
|
|
|
if (axisH === 'w') deltaX = -deltaX;
|
|
|
if (axisV === 'n') deltaY = -deltaY; // Update w/h by the deltas. Also factor in transformScale.
|
|
|
|
|
|
var width = _this2.props.width + (canDragX ? deltaX / _this2.props.transformScale : 0);
|
|
|
var height = _this2.props.height + (canDragY ? deltaY / _this2.props.transformScale : 0); // Run user-provided constraints.
|
|
|
|
|
|
var _this2$runConstraints = _this2.runConstraints(width, height);
|
|
|
|
|
|
width = _this2$runConstraints[0];
|
|
|
height = _this2$runConstraints[1];
|
|
|
var dimensionsChanged = width !== _this2.props.width || height !== _this2.props.height; // Call user-supplied callback if present.
|
|
|
|
|
|
var cb = typeof _this2.props[handlerName] === 'function' ? _this2.props[handlerName] : null; // Don't call 'onResize' if dimensions haven't changed.
|
|
|
|
|
|
var shouldSkipCb = handlerName === 'onResize' && !dimensionsChanged;
|
|
|
|
|
|
if (cb && !shouldSkipCb) {
|
|
|
if (typeof e.persist === 'function') e.persist();
|
|
|
cb(e, {
|
|
|
node: node,
|
|
|
size: {
|
|
|
width: width,
|
|
|
height: height
|
|
|
},
|
|
|
handle: axis
|
|
|
});
|
|
|
} // Reset internal data
|
|
|
|
|
|
|
|
|
if (handlerName === 'onResizeStop') _this2.resetData();
|
|
|
};
|
|
|
};
|
|
|
|
|
|
_proto.renderResizeHandle = function renderResizeHandle(resizeHandleAxis) {
|
|
|
var handle = this.props.handle;
|
|
|
|
|
|
if (handle) {
|
|
|
if (typeof handle === 'function') {
|
|
|
return handle(resizeHandleAxis);
|
|
|
}
|
|
|
|
|
|
return handle;
|
|
|
}
|
|
|
|
|
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
|
className: "react-resizable-handle react-resizable-handle-" + resizeHandleAxis
|
|
|
});
|
|
|
};
|
|
|
|
|
|
_proto.render = function render() {
|
|
|
var _this3 = this;
|
|
|
|
|
|
// Pass along only props not meant for the `<Resizable>`.`
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
var _this$props = this.props,
|
|
|
children = _this$props.children,
|
|
|
className = _this$props.className,
|
|
|
draggableOpts = _this$props.draggableOpts,
|
|
|
width = _this$props.width,
|
|
|
height = _this$props.height,
|
|
|
handle = _this$props.handle,
|
|
|
handleSize = _this$props.handleSize,
|
|
|
lockAspectRatio = _this$props.lockAspectRatio,
|
|
|
axis = _this$props.axis,
|
|
|
minConstraints = _this$props.minConstraints,
|
|
|
maxConstraints = _this$props.maxConstraints,
|
|
|
onResize = _this$props.onResize,
|
|
|
onResizeStop = _this$props.onResizeStop,
|
|
|
onResizeStart = _this$props.onResizeStart,
|
|
|
resizeHandles = _this$props.resizeHandles,
|
|
|
transformScale = _this$props.transformScale,
|
|
|
p = _objectWithoutPropertiesLoose(_this$props, ["children", "className", "draggableOpts", "width", "height", "handle", "handleSize", "lockAspectRatio", "axis", "minConstraints", "maxConstraints", "onResize", "onResizeStop", "onResizeStart", "resizeHandles", "transformScale"]); // What we're doing here is getting the child of this element, and cloning it with this element's props.
|
|
|
// We are then defining its children as:
|
|
|
// Its original children (resizable's child's children), and
|
|
|
// One or more draggable handles.
|
|
|
|
|
|
|
|
|
return (0, _utils.cloneElement)(children, _objectSpread(_objectSpread({}, p), {}, {
|
|
|
className: (className ? className + " " : '') + "react-resizable",
|
|
|
children: [].concat(children.props.children, resizeHandles.map(function (handleAxis) {
|
|
|
return /*#__PURE__*/_react.default.createElement(_reactDraggable.DraggableCore, _extends({}, draggableOpts, {
|
|
|
key: "resizableHandle-" + handleAxis,
|
|
|
onStop: _this3.resizeHandler('onResizeStop', handleAxis),
|
|
|
onStart: _this3.resizeHandler('onResizeStart', handleAxis),
|
|
|
onDrag: _this3.resizeHandler('onResize', handleAxis)
|
|
|
}), _this3.renderResizeHandle(handleAxis));
|
|
|
}))
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
return Resizable;
|
|
|
}(_react.default.Component);
|
|
|
|
|
|
exports["default"] = Resizable;
|
|
|
|
|
|
_defineProperty(Resizable, "propTypes", _propTypes.resizableProps);
|
|
|
|
|
|
_defineProperty(Resizable, "defaultProps", {
|
|
|
handleSize: [20, 20],
|
|
|
lockAspectRatio: false,
|
|
|
axis: 'both',
|
|
|
minConstraints: [20, 20],
|
|
|
maxConstraints: [Infinity, Infinity],
|
|
|
resizeHandles: ['se'],
|
|
|
transformScale: 1
|
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 60842:
|
|
|
/*!************************************************************************************!*\
|
|
|
!*** ./node_modules/_react-resizable@1.11.0@react-resizable/build/ResizableBox.js ***!
|
|
|
\************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
|
|
|
|
var __webpack_unused_export__;
|
|
|
|
|
|
|
|
|
__webpack_unused_export__ = true;
|
|
|
exports["default"] = void 0;
|
|
|
|
|
|
var React = _interopRequireWildcard(__webpack_require__(/*! react */ 59301));
|
|
|
|
|
|
var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ 12708));
|
|
|
|
|
|
var _Resizable = _interopRequireDefault(__webpack_require__(/*! ./Resizable */ 80010));
|
|
|
|
|
|
var _propTypes2 = __webpack_require__(/*! ./propTypes */ 6217);
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
|
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
|
|
|
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
|
|
|
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
|
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
|
|
|
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
|
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
|
|
|
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
|
|
|
|
var ResizableBox = /*#__PURE__*/function (_React$Component) {
|
|
|
_inheritsLoose(ResizableBox, _React$Component);
|
|
|
|
|
|
function ResizableBox() {
|
|
|
var _this;
|
|
|
|
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
|
args[_key] = arguments[_key];
|
|
|
}
|
|
|
|
|
|
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
|
|
|
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
|
width: _this.props.width,
|
|
|
height: _this.props.height,
|
|
|
propsWidth: _this.props.width,
|
|
|
propsHeight: _this.props.height
|
|
|
});
|
|
|
|
|
|
_defineProperty(_assertThisInitialized(_this), "onResize", function (e, data) {
|
|
|
var size = data.size;
|
|
|
|
|
|
if (_this.props.onResize) {
|
|
|
e.persist && e.persist();
|
|
|
|
|
|
_this.setState(size, function () {
|
|
|
return _this.props.onResize && _this.props.onResize(e, data);
|
|
|
});
|
|
|
} else {
|
|
|
_this.setState(size);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
return _this;
|
|
|
}
|
|
|
|
|
|
ResizableBox.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
|
|
|
// If parent changes height/width, set that in our state.
|
|
|
if (state.propsWidth !== props.width || state.propsHeight !== props.height) {
|
|
|
return {
|
|
|
width: props.width,
|
|
|
height: props.height,
|
|
|
propsWidth: props.width,
|
|
|
propsHeight: props.height
|
|
|
};
|
|
|
}
|
|
|
|
|
|
return null;
|
|
|
};
|
|
|
|
|
|
var _proto = ResizableBox.prototype;
|
|
|
|
|
|
_proto.render = function render() {
|
|
|
// Basic wrapper around a Resizable instance.
|
|
|
// If you use Resizable directly, you are responsible for updating the child component
|
|
|
// with a new width and height.
|
|
|
var _this$props = this.props,
|
|
|
handle = _this$props.handle,
|
|
|
handleSize = _this$props.handleSize,
|
|
|
onResize = _this$props.onResize,
|
|
|
onResizeStart = _this$props.onResizeStart,
|
|
|
onResizeStop = _this$props.onResizeStop,
|
|
|
draggableOpts = _this$props.draggableOpts,
|
|
|
minConstraints = _this$props.minConstraints,
|
|
|
maxConstraints = _this$props.maxConstraints,
|
|
|
lockAspectRatio = _this$props.lockAspectRatio,
|
|
|
axis = _this$props.axis,
|
|
|
width = _this$props.width,
|
|
|
height = _this$props.height,
|
|
|
resizeHandles = _this$props.resizeHandles,
|
|
|
style = _this$props.style,
|
|
|
transformScale = _this$props.transformScale,
|
|
|
props = _objectWithoutPropertiesLoose(_this$props, ["handle", "handleSize", "onResize", "onResizeStart", "onResizeStop", "draggableOpts", "minConstraints", "maxConstraints", "lockAspectRatio", "axis", "width", "height", "resizeHandles", "style", "transformScale"]);
|
|
|
|
|
|
return /*#__PURE__*/React.createElement(_Resizable.default, {
|
|
|
axis: axis,
|
|
|
draggableOpts: draggableOpts,
|
|
|
handle: handle,
|
|
|
handleSize: handleSize,
|
|
|
height: this.state.height,
|
|
|
lockAspectRatio: lockAspectRatio,
|
|
|
maxConstraints: maxConstraints,
|
|
|
minConstraints: minConstraints,
|
|
|
onResizeStart: onResizeStart,
|
|
|
onResize: this.onResize,
|
|
|
onResizeStop: onResizeStop,
|
|
|
resizeHandles: resizeHandles,
|
|
|
transformScale: transformScale,
|
|
|
width: this.state.width
|
|
|
}, /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
|
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
|
width: this.state.width + 'px',
|
|
|
height: this.state.height + 'px'
|
|
|
})
|
|
|
})));
|
|
|
};
|
|
|
|
|
|
return ResizableBox;
|
|
|
}(React.Component);
|
|
|
|
|
|
exports["default"] = ResizableBox;
|
|
|
|
|
|
_defineProperty(ResizableBox, "propTypes", _objectSpread(_objectSpread({}, _propTypes2.resizableProps), {}, {
|
|
|
children: _propTypes.default.element
|
|
|
}));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 6217:
|
|
|
/*!*********************************************************************************!*\
|
|
|
!*** ./node_modules/_react-resizable@1.11.0@react-resizable/build/propTypes.js ***!
|
|
|
\*********************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
exports.__esModule = true;
|
|
|
exports.resizableProps = void 0;
|
|
|
|
|
|
var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ 12708));
|
|
|
|
|
|
var _reactDraggable = __webpack_require__(/*! react-draggable */ 12911);
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
|
|
var resizableProps = {
|
|
|
/*
|
|
|
* Restricts resizing to a particular axis (default: 'both')
|
|
|
* 'both' - allows resizing by width or height
|
|
|
* 'x' - only allows the width to be changed
|
|
|
* 'y' - only allows the height to be changed
|
|
|
* 'none' - disables resizing altogether
|
|
|
* */
|
|
|
axis: _propTypes.default.oneOf(['both', 'x', 'y', 'none']),
|
|
|
className: _propTypes.default.string,
|
|
|
|
|
|
/*
|
|
|
* Require that one and only one child be present.
|
|
|
* */
|
|
|
children: _propTypes.default.element.isRequired,
|
|
|
|
|
|
/*
|
|
|
* These will be passed wholesale to react-draggable's DraggableCore
|
|
|
* */
|
|
|
draggableOpts: _propTypes.default.shape({
|
|
|
allowAnyClick: _propTypes.default.bool,
|
|
|
cancel: _propTypes.default.string,
|
|
|
children: _propTypes.default.node,
|
|
|
disabled: _propTypes.default.bool,
|
|
|
enableUserSelectHack: _propTypes.default.bool,
|
|
|
offsetParent: _propTypes.default.node,
|
|
|
grid: _propTypes.default.arrayOf(_propTypes.default.number),
|
|
|
handle: _propTypes.default.string,
|
|
|
nodeRef: _propTypes.default.object,
|
|
|
onStart: _propTypes.default.func,
|
|
|
onDrag: _propTypes.default.func,
|
|
|
onStop: _propTypes.default.func,
|
|
|
onMouseDown: _propTypes.default.func,
|
|
|
scale: _propTypes.default.number
|
|
|
}),
|
|
|
|
|
|
/*
|
|
|
* Initial height
|
|
|
* */
|
|
|
height: _propTypes.default.number.isRequired,
|
|
|
|
|
|
/*
|
|
|
* Customize cursor resize handle
|
|
|
* */
|
|
|
handle: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
|
|
|
|
|
/*
|
|
|
* If you change this, be sure to update your css
|
|
|
* */
|
|
|
handleSize: _propTypes.default.arrayOf(_propTypes.default.number),
|
|
|
lockAspectRatio: _propTypes.default.bool,
|
|
|
|
|
|
/*
|
|
|
* Max X & Y measure
|
|
|
* */
|
|
|
maxConstraints: _propTypes.default.arrayOf(_propTypes.default.number),
|
|
|
|
|
|
/*
|
|
|
* Min X & Y measure
|
|
|
* */
|
|
|
minConstraints: _propTypes.default.arrayOf(_propTypes.default.number),
|
|
|
|
|
|
/*
|
|
|
* Called on stop resize event
|
|
|
* */
|
|
|
onResizeStop: _propTypes.default.func,
|
|
|
|
|
|
/*
|
|
|
* Called on start resize event
|
|
|
* */
|
|
|
onResizeStart: _propTypes.default.func,
|
|
|
|
|
|
/*
|
|
|
* Called on resize event
|
|
|
* */
|
|
|
onResize: _propTypes.default.func,
|
|
|
|
|
|
/*
|
|
|
* Defines which resize handles should be rendered (default: 'se')
|
|
|
* 's' - South handle (bottom-center)
|
|
|
* 'w' - West handle (left-center)
|
|
|
* 'e' - East handle (right-center)
|
|
|
* 'n' - North handle (top-center)
|
|
|
* 'sw' - Southwest handle (bottom-left)
|
|
|
* 'nw' - Northwest handle (top-left)
|
|
|
* 'se' - Southeast handle (bottom-right)
|
|
|
* 'ne' - Northeast handle (top-center)
|
|
|
* */
|
|
|
resizeHandles: _propTypes.default.arrayOf(_propTypes.default.oneOf(['s', 'w', 'e', 'n', 'sw', 'nw', 'se', 'ne'])),
|
|
|
|
|
|
/*
|
|
|
* If `transform: scale(n)` is set on the parent, this should be set to `n`.
|
|
|
* */
|
|
|
transformScale: _propTypes.default.number,
|
|
|
|
|
|
/*
|
|
|
* Initial width
|
|
|
*/
|
|
|
width: _propTypes.default.number.isRequired
|
|
|
};
|
|
|
exports.resizableProps = resizableProps;
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 73638:
|
|
|
/*!*****************************************************************************!*\
|
|
|
!*** ./node_modules/_react-resizable@1.11.0@react-resizable/build/utils.js ***!
|
|
|
\*****************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
exports.__esModule = true;
|
|
|
exports.cloneElement = cloneElement;
|
|
|
|
|
|
var _react = _interopRequireDefault(__webpack_require__(/*! react */ 59301));
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
|
|
|
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
|
|
|
|
// React.addons.cloneWithProps look-alike that merges style & className.
|
|
|
function cloneElement(element, props) {
|
|
|
if (props.style && element.props.style) {
|
|
|
props.style = _objectSpread(_objectSpread({}, element.props.style), props.style);
|
|
|
}
|
|
|
|
|
|
if (props.className && element.props.className) {
|
|
|
props.className = element.props.className + " " + props.className;
|
|
|
}
|
|
|
|
|
|
return /*#__PURE__*/_react.default.cloneElement(element, props);
|
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 9221:
|
|
|
/*!***********************************************************************!*\
|
|
|
!*** ./node_modules/_react-resizable@1.11.0@react-resizable/index.js ***!
|
|
|
\***********************************************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
module.exports = function() {
|
|
|
throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable");
|
|
|
};
|
|
|
|
|
|
module.exports.Resizable = __webpack_require__(/*! ./build/Resizable */ 80010)["default"];
|
|
|
module.exports.ResizableBox = __webpack_require__(/*! ./build/ResizableBox */ 60842)["default"];
|
|
|
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |