|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[85619,13488,27715],{
|
|
|
|
|
|
/***/ 60936:
|
|
|
/*!*******************************************************************************************************!*\
|
|
|
!*** ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/InboxOutlined.js + 1 modules ***!
|
|
|
\*******************************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ icons_InboxOutlined; }
|
|
|
});
|
|
|
|
|
|
// 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/InboxOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var InboxOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M885.2 446.3l-.2-.8-112.2-285.1c-5-16.1-19.9-27.2-36.8-27.2H281.2c-17 0-32.1 11.3-36.9 27.6L139.4 443l-.3.7-.2.8c-1.3 4.9-1.7 9.9-1 14.8-.1 1.6-.2 3.2-.2 4.8V830a60.9 60.9 0 0060.8 60.8h627.2c33.5 0 60.8-27.3 60.9-60.8V464.1c0-1.3 0-2.6-.1-3.7.4-4.9 0-9.6-1.3-14.1zm-295.8-43l-.3 15.7c-.8 44.9-31.8 75.1-77.1 75.1-22.1 0-41.1-7.1-54.8-20.6S436 441.2 435.6 419l-.3-15.7H229.5L309 210h399.2l81.7 193.3H589.4zm-375 76.8h157.3c24.3 57.1 76 90.8 140.4 90.8 33.7 0 65-9.4 90.3-27.2 22.2-15.6 39.5-37.4 50.7-63.6h156.5V814H214.4V480.1z" } }] }, "name": "inbox", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_InboxOutlined = (InboxOutlined);
|
|
|
|
|
|
// 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/InboxOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var InboxOutlined_InboxOutlined = function InboxOutlined(props, ref) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_InboxOutlined
|
|
|
}));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_InboxOutlined = (/*#__PURE__*/_react_17_0_2_react.forwardRef(InboxOutlined_InboxOutlined));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 8834:
|
|
|
/*!******************************************************!*\
|
|
|
!*** ./src/components/CodeBox/index.tsx + 1 modules ***!
|
|
|
\******************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// 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);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 44857:
|
|
|
/*!********************************************************!*\
|
|
|
!*** ./src/components/CutOffNow/index.tsx + 1 modules ***!
|
|
|
\********************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ CutOffNow; }
|
|
|
});
|
|
|
|
|
|
// 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/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/form/index.js + 19 modules
|
|
|
var es_form = __webpack_require__(78241);
|
|
|
// 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/modal/index.js + 16 modules
|
|
|
var modal = __webpack_require__(43418);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/date-picker/index.js + 66 modules
|
|
|
var date_picker = __webpack_require__(52409);
|
|
|
// 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/table/index.js + 85 modules
|
|
|
var table = __webpack_require__(72315);
|
|
|
// 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/_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/util.tsx
|
|
|
var util = __webpack_require__(27291);
|
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
|
|
|
var _umi_production_exports = __webpack_require__(66660);
|
|
|
;// CONCATENATED MODULE: ./src/components/CutOffNow/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var CutOffNowmodules = ({"tips":"tips___e8J4O","homeworkType":"homeworkType___ZjN2X","antdTable":"antdTable___amDdp","modalWrapper":"modalWrapper___XPojI"});
|
|
|
// EXTERNAL MODULE: ./src/service/classrooms.ts
|
|
|
var classrooms = __webpack_require__(48600);
|
|
|
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/ShixunHomeworks/Detail/components/ConfigWorks/Releasesetting.tsx
|
|
|
var Releasesetting = __webpack_require__(4647);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/components/CutOffNow/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var CuttOffNow = function CuttOffNow(_ref) {
|
|
|
var dispatch = _ref.dispatch,
|
|
|
courseEndTime = _ref.courseEndTime,
|
|
|
classroomList = _ref.classroomList,
|
|
|
_ref$successCallback = _ref.successCallback,
|
|
|
successCallback = _ref$successCallback === void 0 ? function () {} : _ref$successCallback,
|
|
|
visible = _ref.visible,
|
|
|
homeworkIds = _ref.homeworkIds,
|
|
|
courseId = _ref.courseId,
|
|
|
isBatch = _ref.isBatch,
|
|
|
shixunHomeworks = _ref.shixunHomeworks;
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
tableLoading = _useState2[0],
|
|
|
setTableLoading = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
confirmLoading = _useState4[0],
|
|
|
setConfirmLoading = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
noGroup = _useState6[0],
|
|
|
setNoGroup = _useState6[1];
|
|
|
//作业截止
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
submitCourseGroups = _useState8[0],
|
|
|
setSubmitCourseGroups = _useState8[1];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
submitCourseTableData = _useState10[0],
|
|
|
setSubmitCourseTableData = _useState10[1];
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
selectedSubmitCourseIds = _useState12[0],
|
|
|
setSelectedSubmitCourseIds = _useState12[1];
|
|
|
//补交截止
|
|
|
var _useState13 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
|
lateCourseGroups = _useState14[0],
|
|
|
setLateCourseGroups = _useState14[1];
|
|
|
var _useState15 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState16 = slicedToArray_default()(_useState15, 2),
|
|
|
lateCourseTableData = _useState16[0],
|
|
|
setLateCourseTableData = _useState16[1];
|
|
|
var _useState17 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState18 = slicedToArray_default()(_useState17, 2),
|
|
|
selectedLateCourseIds = _useState18[0],
|
|
|
setSelectedLateCourseIds = _useState18[1];
|
|
|
//批量截止
|
|
|
var _useState19 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState20 = slicedToArray_default()(_useState19, 2),
|
|
|
allCourseGroups = _useState20[0],
|
|
|
setAllCourseGroups = _useState20[1];
|
|
|
var _useState21 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState22 = slicedToArray_default()(_useState21, 2),
|
|
|
allCourseTableData = _useState22[0],
|
|
|
setAllCourseTableData = _useState22[1];
|
|
|
var _useState23 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState24 = slicedToArray_default()(_useState23, 2),
|
|
|
selectedAllCourseIds = _useState24[0],
|
|
|
setSelectedAllCourseIds = _useState24[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (visible) {
|
|
|
getData();
|
|
|
} else {
|
|
|
clear();
|
|
|
}
|
|
|
}, [visible]);
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
setTableLoading(true);
|
|
|
_context.next = 3;
|
|
|
return (0,classrooms/* getAllowEndGroups */.oR)(homeworkIds[0], {
|
|
|
course_id: courseId
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context.sent;
|
|
|
setNoGroup(res.no_group);
|
|
|
if (isBatch) {
|
|
|
setAllCourseGroups(res.all_course_groups);
|
|
|
setAllCourseTableData(res.all_course_groups);
|
|
|
} else {
|
|
|
setLateCourseGroups(res.late_course_groups);
|
|
|
setLateCourseTableData(res.late_course_groups);
|
|
|
setSubmitCourseGroups(res.submit_course_groups);
|
|
|
setSubmitCourseTableData(res.submit_course_groups);
|
|
|
}
|
|
|
setTableLoading(false);
|
|
|
form.setFieldsValue({
|
|
|
'end_time': dayjs_min_default()()
|
|
|
});
|
|
|
case 8:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function getData() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleOk = /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
var formValue, endTimeString, selectNothing, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
formValue = form.getFieldsValue();
|
|
|
endTimeString = dayjs_min_default()(formValue.end_time).format('YYYY-MM-DD HH:mm');
|
|
|
selectNothing = isBatch ? selectedAllCourseIds.length === 0 : selectedSubmitCourseIds.length === 0 && selectedLateCourseIds.length === 0;
|
|
|
if (!(selectNothing && !noGroup)) {
|
|
|
_context2.next = 6;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.warning('请选择需要操作的班级');
|
|
|
return _context2.abrupt("return");
|
|
|
case 6:
|
|
|
setConfirmLoading(true);
|
|
|
_context2.next = 9;
|
|
|
return (0,classrooms/* stopHomework */.Mc)(courseId, {
|
|
|
no_group: noGroup,
|
|
|
homework_ids: homeworkIds,
|
|
|
group_ids: isBatch ? selectedAllCourseIds : selectedSubmitCourseIds,
|
|
|
end_time: endTimeString,
|
|
|
late_group_ids: isBatch ? selectedAllCourseIds : selectedLateCourseIds
|
|
|
});
|
|
|
case 9:
|
|
|
res = _context2.sent;
|
|
|
setConfirmLoading(false);
|
|
|
if (res.status === 0) {
|
|
|
clear();
|
|
|
message/* default */.ZP.success('操作成功');
|
|
|
successCallback();
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {
|
|
|
key: '清除选择数据'
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
case 12:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function handleOk() {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var clear = function clear() {
|
|
|
setSelectedSubmitCourseIds([]);
|
|
|
setSelectedLateCourseIds([]);
|
|
|
setSubmitCourseTableData([]);
|
|
|
setLateCourseTableData([]);
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
title: "\u7ACB\u5373\u622A\u6B62",
|
|
|
className: CutOffNowmodules.modalWrapper,
|
|
|
width: isBatch || noGroup ? 520 : 760,
|
|
|
open: visible,
|
|
|
confirmLoading: confirmLoading,
|
|
|
destroyOnClose: true,
|
|
|
okText: "\u622A\u6B62",
|
|
|
cancelText: "\u53D6\u6D88",
|
|
|
onOk: function onOk() {
|
|
|
return handleOk();
|
|
|
},
|
|
|
onCancel: function onCancel() {
|
|
|
clear();
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: CutOffNowmodules.tips,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "1\u3001\u622A\u6B62\u540E\u5B66\u751F\u4E0D\u80FD\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "2\u3001\u672C\u64CD\u4F5C\u53EA\u5BF9\u201C\u63D0\u4EA4\u4E2D\u201D\u3001\u201C\u8865\u4EA4\u4E2D\u201D\u7684\u4F5C\u4E1A\u6709\u6548\u3002"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z, {
|
|
|
form: form,
|
|
|
layout: "vertical",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "end_time",
|
|
|
label: "\u622A\u6B62\u65F6\u95F4",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(date_picker["default"], {
|
|
|
style: {
|
|
|
width: '100%'
|
|
|
},
|
|
|
disabledDate: function disabledDate(current) {
|
|
|
return (0,Releasesetting/* disabledDate */.Q8)(current, courseEndTime);
|
|
|
},
|
|
|
disabledTime: function disabledTime(current) {
|
|
|
return (0,Releasesetting/* disabledTime */.d0)(current);
|
|
|
},
|
|
|
placeholder: '请选择结束时间',
|
|
|
showTime: {
|
|
|
format: 'HH:mm',
|
|
|
defaultValue: dayjs_min_default()((0,util/* HalfPastOne */.U6)(), 'HH:mm')
|
|
|
},
|
|
|
format: "YYYY-MM-DD HH:mm",
|
|
|
allowClear: false
|
|
|
})
|
|
|
})
|
|
|
}), !noGroup && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
|
children: isBatch ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
placeholder: "\u641C\u7D22\u73ED\u7EA7"
|
|
|
// suffix={<i className={`iconfont icon-sousuo9 font14 ${styles.searchIcon}`} />}
|
|
|
,
|
|
|
onChange: function onChange(e) {
|
|
|
setAllCourseTableData(allCourseGroups.filter(function (item) {
|
|
|
return item.name.indexOf(e.target.value) > -1;
|
|
|
}));
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
|
style: {
|
|
|
marginTop: '10px',
|
|
|
height: '300px',
|
|
|
overflow: 'auto'
|
|
|
},
|
|
|
className: CutOffNowmodules.antdTable,
|
|
|
rowSelection: {
|
|
|
type: 'checkbox',
|
|
|
onChange: function onChange(selectedRowKeys) {
|
|
|
setSelectedAllCourseIds(selectedRowKeys);
|
|
|
}
|
|
|
},
|
|
|
rowKey: "id",
|
|
|
pagination: false,
|
|
|
dataSource: allCourseTableData,
|
|
|
loading: tableLoading,
|
|
|
columns: [{
|
|
|
title: '班级',
|
|
|
dataIndex: 'name'
|
|
|
}]
|
|
|
})]
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
gutter: 24,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
span: 14,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: CutOffNowmodules.homeworkType,
|
|
|
children: "\u4F5C\u4E1A\u622A\u6B62"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
placeholder: "\u641C\u7D22\u73ED\u7EA7"
|
|
|
// suffix={<i className={`iconfont icon-sousuo9 font14 ${styles.searchIcon}`} />}
|
|
|
,
|
|
|
onChange: function onChange(e) {
|
|
|
setSubmitCourseTableData(submitCourseGroups.filter(function (item) {
|
|
|
return item.name.indexOf(e.target.value) > -1;
|
|
|
}));
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: CutOffNowmodules.tableWrapper,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
|
style: {
|
|
|
marginTop: '10px',
|
|
|
height: '260px',
|
|
|
overflow: 'auto'
|
|
|
},
|
|
|
className: CutOffNowmodules.antdTable,
|
|
|
rowSelection: {
|
|
|
type: 'checkbox',
|
|
|
onChange: function onChange(selectedRowKeys) {
|
|
|
setSelectedSubmitCourseIds(selectedRowKeys);
|
|
|
}
|
|
|
},
|
|
|
rowKey: "id",
|
|
|
pagination: false,
|
|
|
dataSource: submitCourseTableData,
|
|
|
loading: tableLoading,
|
|
|
columns: [{
|
|
|
title: '班级',
|
|
|
dataIndex: 'name',
|
|
|
ellipsis: true
|
|
|
}, {
|
|
|
title: '发布时间',
|
|
|
dataIndex: 'publish_time'
|
|
|
}, {
|
|
|
title: '截止时间',
|
|
|
dataIndex: 'end_time'
|
|
|
}]
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
flex: 10,
|
|
|
style: {
|
|
|
maxWidth: "280px"
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: CutOffNowmodules.homeworkType,
|
|
|
children: "\u8865\u4EA4\u622A\u6B62"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
placeholder: "\u641C\u7D22\u73ED\u7EA7",
|
|
|
onChange: function onChange(e) {
|
|
|
setLateCourseTableData(lateCourseGroups.filter(function (item) {
|
|
|
return item.name.indexOf(e.target.value) > -1;
|
|
|
}));
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: CutOffNowmodules.tableWrapper,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
|
style: {
|
|
|
marginTop: '10px',
|
|
|
height: '260px',
|
|
|
overflow: 'auto',
|
|
|
maxWidth: "280px"
|
|
|
},
|
|
|
className: CutOffNowmodules.antdTable,
|
|
|
rowSelection: {
|
|
|
type: 'checkbox',
|
|
|
onChange: function onChange(selectedRowKeys) {
|
|
|
setSelectedLateCourseIds(selectedRowKeys);
|
|
|
}
|
|
|
},
|
|
|
rowKey: "id",
|
|
|
pagination: false,
|
|
|
loading: tableLoading,
|
|
|
dataSource: lateCourseTableData,
|
|
|
columns: [{
|
|
|
title: '班级',
|
|
|
dataIndex: 'name',
|
|
|
ellipsis: true,
|
|
|
width: 120
|
|
|
}, {
|
|
|
title: '截止时间',
|
|
|
dataIndex: 'late_time'
|
|
|
}]
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var CutOffNow = ((0,_umi_production_exports.connect)(function (_ref4) {
|
|
|
var shixunHomeworks = _ref4.shixunHomeworks,
|
|
|
classroomList = _ref4.classroomList;
|
|
|
return {
|
|
|
shixunHomeworks: shixunHomeworks,
|
|
|
classroomList: classroomList
|
|
|
};
|
|
|
})(CuttOffNow));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 27715:
|
|
|
/*!**********************************************************!*\
|
|
|
!*** ./src/components/MultiUpload/index.tsx + 3 modules ***!
|
|
|
\**********************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
z: function() { return /* binding */ coverToFileList; },
|
|
|
Z: function() { return /* binding */ MultiUpload; }
|
|
|
});
|
|
|
|
|
|
// 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/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/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/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/upload/index.js + 24 modules
|
|
|
var upload = __webpack_require__(6557);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
|
|
var es_message = __webpack_require__(8591);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
|
var modal = __webpack_require__(43418);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(47015);
|
|
|
// EXTERNAL MODULE: ./src/pages/MoopCases/FormPanel/service.ts
|
|
|
var service = __webpack_require__(57417);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/components/SingleUpload/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var uploadNameSizeSeperator = ' ';
|
|
|
function bytesToSize(bytes) {
|
|
|
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
|
|
|
if (bytes == 0) return '0 Byte';
|
|
|
var i = parseInt('' + Math.floor(Math.log(bytes) / Math.log(1024)), 10);
|
|
|
return (bytes / Math.pow(1024, i)).toFixed(1) + ' ' + sizes[i];
|
|
|
}
|
|
|
/* harmony default export */ var SingleUpload = (function (_ref) {
|
|
|
var _ref$value = _ref.value,
|
|
|
value = _ref$value === void 0 ? [] : _ref$value,
|
|
|
action = _ref.action,
|
|
|
_onChange = _ref.onChange,
|
|
|
className = _ref.className,
|
|
|
_ref$maxSize = _ref.maxSize,
|
|
|
maxSize = _ref$maxSize === void 0 ? 150 : _ref$maxSize,
|
|
|
_ref$title = _ref.title,
|
|
|
title = _ref$title === void 0 ? '文件上传' : _ref$title,
|
|
|
_ref$accept = _ref.accept,
|
|
|
accept = _ref$accept === void 0 ? null : _ref$accept;
|
|
|
var uploadProps = {
|
|
|
multiple: false,
|
|
|
fileList: value,
|
|
|
accept: accept,
|
|
|
withCredentials: true,
|
|
|
beforeUpload: function beforeUpload(file) {
|
|
|
var fileSize = file.size / 1024 / 1024;
|
|
|
if (!(fileSize < maxSize)) {
|
|
|
message.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(maxSize, "MB),\u5EFA\u8BAE\u4E0A\u4F20\u5230\u767E\u5EA6\u4E91\u7B49\u5176\u5B83\u5171\u4EAB\u5DE5\u5177\u91CC\uFF0C\u7136\u540E\u518Dtxt\u6587\u6863\u91CC\u7ED9\u51FA\u94FE\u63A5\u4EE5\u53CA\u5171\u4EAB\u5BC6\u7801\u5E76\u4E0A\u4F20"));
|
|
|
return Promise.reject();
|
|
|
}
|
|
|
return true;
|
|
|
},
|
|
|
action: "".concat(ENV.API_SERVER, "/api/attachments.json"),
|
|
|
// ?debug=student&randomcode=undefined&client_key=6d57f8c3dd186c5ada392546ace9620a
|
|
|
onChange: function onChange(info) {
|
|
|
var _info$file;
|
|
|
var fileList = _toConsumableArray(info.fileList);
|
|
|
fileList = fileList.map(function (file) {
|
|
|
if (file.name.indexOf(uploadNameSizeSeperator) === -1) {
|
|
|
file.name = "".concat(file.name).concat(uploadNameSizeSeperator).concat(bytesToSize(file.size));
|
|
|
}
|
|
|
return _objectSpread({}, file);
|
|
|
});
|
|
|
if (info.file.status === 'done' && ((_info$file = info.file) === null || _info$file === void 0 || (_info$file = _info$file.response) === null || _info$file === void 0 ? void 0 : _info$file.status) === -1) {
|
|
|
var _info$file2;
|
|
|
message.error((_info$file2 = info.file) === null || _info$file2 === void 0 || (_info$file2 = _info$file2.response) === null || _info$file2 === void 0 ? void 0 : _info$file2.message);
|
|
|
_onChange([]);
|
|
|
return;
|
|
|
}
|
|
|
_onChange(fileList);
|
|
|
},
|
|
|
onRemove: function () {
|
|
|
var _onRemove = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
|
|
|
var fileSize, id, rs;
|
|
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
fileSize = file.size / 1024 / 1024;
|
|
|
if (!(file.status === 'uploading')) {
|
|
|
_context.next = 3;
|
|
|
break;
|
|
|
}
|
|
|
return _context.abrupt("return", true);
|
|
|
case 3:
|
|
|
if (fileSize < maxSize) {
|
|
|
_context.next = 7;
|
|
|
break;
|
|
|
}
|
|
|
return _context.abrupt("return", true);
|
|
|
case 7:
|
|
|
id = file.response ? file.response.id : file.uid;
|
|
|
if (!id) {
|
|
|
_context.next = 15;
|
|
|
break;
|
|
|
}
|
|
|
_context.next = 11;
|
|
|
return removeAttachment(file.response ? file.response.id : file.id);
|
|
|
case 11:
|
|
|
rs = _context.sent;
|
|
|
return _context.abrupt("return", rs);
|
|
|
case 15:
|
|
|
return _context.abrupt("return", true);
|
|
|
case 16:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
function onRemove(_x) {
|
|
|
return _onRemove.apply(this, arguments);
|
|
|
}
|
|
|
return onRemove;
|
|
|
}()
|
|
|
};
|
|
|
function onCancel(e) {
|
|
|
e.preventDefault();
|
|
|
e.stopPropagation();
|
|
|
}
|
|
|
return /*#__PURE__*/_jsx("div", {
|
|
|
className: "single-upload ".concat(className ? className : ''),
|
|
|
children: /*#__PURE__*/_jsxs(Upload, _objectSpread(_objectSpread({}, uploadProps), {}, {
|
|
|
children: [/*#__PURE__*/_jsx(Button, {
|
|
|
type: "primary",
|
|
|
title: value.length > 0 ? '每次只能上传一个资源, 删除下面资源可重新上传 ' : '',
|
|
|
disabled: value.length > 0,
|
|
|
ghost: true,
|
|
|
children: title
|
|
|
}), /*#__PURE__*/_jsxs("span", {
|
|
|
onClick: onCancel,
|
|
|
style: {
|
|
|
marginLeft: 10
|
|
|
},
|
|
|
children: ["(\u5355\u4E2A\u6587\u4EF6\u6700\u5927", maxSize, "M)", ' ']
|
|
|
})]
|
|
|
}))
|
|
|
});
|
|
|
});
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/InboxOutlined.js + 1 modules
|
|
|
var InboxOutlined = __webpack_require__(60936);
|
|
|
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js
|
|
|
var lodash = __webpack_require__(89392);
|
|
|
;// CONCATENATED MODULE: ./src/components/MultiUpload/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
;// CONCATENATED MODULE: ./src/assets/images/uploadImg.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 SvgUploadImg = function SvgUploadImg(props) {
|
|
|
return /* @__PURE__ */React.createElement("svg", __spreadValues({
|
|
|
width: 14,
|
|
|
height: 14,
|
|
|
xmlns: "http://www.w3.org/2000/svg"
|
|
|
}, props), /* @__PURE__ */React.createElement("title", null, "\u5F62\u72B6"), /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M10.354 3.5h-2.77v8.167H6.416V3.5H3.646L7 0l3.354 3.5ZM14 7h-1.167v5.833H1.167V7H0v7h14V7Z",
|
|
|
fill: "#3061D0",
|
|
|
fillRule: "nonzero"
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ var uploadImg = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEwLjM1NCAzLjVoLTIuNzd2OC4xNjdINi40MTZWMy41SDMuNjQ2TDcgMGwzLjM1NCAzLjVaTTE0IDdoLTEuMTY3djUuODMzSDEuMTY3VjdIMHY3aDE0VjdaIiBmaWxsPSIjMzA2MUQwIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=");
|
|
|
;// CONCATENATED MODULE: ./src/components/MultiUpload/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Dragger = upload/* default */.Z.Dragger;
|
|
|
function coverToFileList(data) {
|
|
|
var rs = [];
|
|
|
if (data && data.length > 0) {
|
|
|
rs = data.map(function (item) {
|
|
|
return {
|
|
|
uid: item.id,
|
|
|
id: item.id,
|
|
|
name: item.title + uploadNameSizeSeperator + item.filesize,
|
|
|
url: item.url,
|
|
|
filesize: item.filesize,
|
|
|
status: 'done',
|
|
|
response: {
|
|
|
id: item.id
|
|
|
}
|
|
|
};
|
|
|
});
|
|
|
}
|
|
|
return rs;
|
|
|
}
|
|
|
/* harmony default export */ var MultiUpload = (function (_ref) {
|
|
|
var value = _ref.value,
|
|
|
_onChange = _ref.onChange,
|
|
|
action = _ref.action,
|
|
|
data = _ref.data,
|
|
|
className = _ref.className,
|
|
|
_ref$maxSize = _ref.maxSize,
|
|
|
maxSize = _ref$maxSize === void 0 ? 150 : _ref$maxSize,
|
|
|
_ref$title = _ref.title,
|
|
|
title = _ref$title === void 0 ? '上传附件' : _ref$title,
|
|
|
_ref$showRemoveModal = _ref.showRemoveModal,
|
|
|
showRemoveModal = _ref$showRemoveModal === void 0 ? false : _ref$showRemoveModal,
|
|
|
_ref$accept = _ref.accept,
|
|
|
accept = _ref$accept === void 0 ? '' : _ref$accept,
|
|
|
additionalText = _ref.additionalText,
|
|
|
isDragger = _ref.isDragger,
|
|
|
_ref$number = _ref.number,
|
|
|
number = _ref$number === void 0 ? 1000 : _ref$number,
|
|
|
_ref$aloneClear = _ref.aloneClear,
|
|
|
aloneClear = _ref$aloneClear === void 0 ? false : _ref$aloneClear;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
disabled = _useState2[0],
|
|
|
setDisabled = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(value || []),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
fileList = _useState4[0],
|
|
|
setFileList = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(1),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
nums = _useState6[0],
|
|
|
setnums = _useState6[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (value) {
|
|
|
if (nums === 1) {
|
|
|
setFileList(toConsumableArray_default()(value));
|
|
|
}
|
|
|
setnums(2);
|
|
|
if (number === (value === null || value === void 0 ? void 0 : value.length)) {
|
|
|
setDisabled(true);
|
|
|
}
|
|
|
}
|
|
|
}, [value]);
|
|
|
var clearLastFile = function clearLastFile() {
|
|
|
setTimeout(function () {
|
|
|
fileList.pop();
|
|
|
setFileList(toConsumableArray_default()(fileList));
|
|
|
}, 500);
|
|
|
};
|
|
|
var uploadProps = {
|
|
|
multiple: true,
|
|
|
disabled: disabled,
|
|
|
accept: accept,
|
|
|
withCredentials: true,
|
|
|
fileList: fileList,
|
|
|
// fileList: fileList?.length ? fileList : value,
|
|
|
beforeUpload: function beforeUpload(file, fileArr) {
|
|
|
var fileSize = file.size / 1024 / 1024;
|
|
|
if (fileList.concat(fileArr).length > number) {
|
|
|
fileList.pop();
|
|
|
setFileList(toConsumableArray_default()(fileList));
|
|
|
es_message/* default */.ZP.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(number, "\u4E2A\u6587\u4EF6"));
|
|
|
if (aloneClear) {
|
|
|
return Promise.reject();
|
|
|
}
|
|
|
clearLastFile();
|
|
|
return false;
|
|
|
}
|
|
|
if (!(fileSize < maxSize)) {
|
|
|
es_message/* default */.ZP.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(maxSize, "MB)."));
|
|
|
if (aloneClear) {
|
|
|
return Promise.reject();
|
|
|
}
|
|
|
clearLastFile();
|
|
|
return false;
|
|
|
}
|
|
|
return true;
|
|
|
},
|
|
|
data: data,
|
|
|
action: action || "".concat(env/* default */.Z.API_SERVER, "/api/attachments.json"),
|
|
|
// ?debug=student&randomcode=undefined&client_key=6d57f8c3dd186c5ada392546ace9620a
|
|
|
onChange: function onChange(info) {
|
|
|
var _info$file;
|
|
|
if (info.file.status === "removed") {
|
|
|
fileList = info.fileList;
|
|
|
} else {
|
|
|
fileList = (0,lodash.uniqBy)([].concat(toConsumableArray_default()(info.fileList), toConsumableArray_default()(fileList)), 'uid');
|
|
|
}
|
|
|
if (info.file.status === 'done' && ((_info$file = info.file) === null || _info$file === void 0 || (_info$file = _info$file.response) === null || _info$file === void 0 ? void 0 : _info$file.status) === -1) {
|
|
|
var _info$file2;
|
|
|
es_message/* default */.ZP.error((_info$file2 = info.file) === null || _info$file2 === void 0 || (_info$file2 = _info$file2.response) === null || _info$file2 === void 0 ? void 0 : _info$file2.message);
|
|
|
return;
|
|
|
}
|
|
|
if (fileList.length >= number) setDisabled(true);else setDisabled(false);
|
|
|
setFileList(toConsumableArray_default()(fileList));
|
|
|
fileList = fileList.map(function (file) {
|
|
|
var _file$response;
|
|
|
if (file !== null && file !== void 0 && (_file$response = file.response) !== null && _file$response !== void 0 && _file$response.id) {
|
|
|
var _file$response2;
|
|
|
file.url = "/api/attachments/".concat(file === null || file === void 0 || (_file$response2 = file.response) === null || _file$response2 === void 0 ? void 0 : _file$response2.id);
|
|
|
}
|
|
|
if (file.name.indexOf(uploadNameSizeSeperator) === -1) {
|
|
|
file.name = "".concat(file.name).concat(uploadNameSizeSeperator).concat(bytesToSize(file.size));
|
|
|
}
|
|
|
return objectSpread2_default()({}, file);
|
|
|
});
|
|
|
console.log('info:', info, fileList);
|
|
|
_onChange(fileList);
|
|
|
},
|
|
|
onRemove: function () {
|
|
|
var _onRemove = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(file) {
|
|
|
var remove;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
remove = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var id, rs;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
id = file.response ? file.response.id : file.id;
|
|
|
if (!id) {
|
|
|
_context.next = 8;
|
|
|
break;
|
|
|
}
|
|
|
_context.next = 4;
|
|
|
return (0,service/* removeAttachment */.JZ)(file.response ? file.response.id : file.uid);
|
|
|
case 4:
|
|
|
rs = _context.sent;
|
|
|
return _context.abrupt("return", Promise.resolve(rs));
|
|
|
case 8:
|
|
|
return _context.abrupt("return", true);
|
|
|
case 9:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function remove() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
if (!showRemoveModal) {
|
|
|
_context3.next = 5;
|
|
|
break;
|
|
|
}
|
|
|
return _context3.abrupt("return", new Promise(function (resolve, reject) {
|
|
|
modal/* default */.Z.confirm({
|
|
|
centered: true,
|
|
|
width: 530,
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
title: '提示',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "tc font16",
|
|
|
children: "\u662F\u5426\u786E\u8BA4\u5220\u9664?"
|
|
|
}),
|
|
|
onOk: function () {
|
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
_context2.next = 2;
|
|
|
return remove();
|
|
|
case 2:
|
|
|
res = _context2.sent;
|
|
|
es_message/* default */.ZP.success('删除成功');
|
|
|
resolve(true);
|
|
|
case 5:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
function onOk() {
|
|
|
return _onOk.apply(this, arguments);
|
|
|
}
|
|
|
return onOk;
|
|
|
}(),
|
|
|
onCancel: function onCancel() {
|
|
|
return resolve(false);
|
|
|
}
|
|
|
});
|
|
|
}));
|
|
|
case 5:
|
|
|
_context3.next = 7;
|
|
|
return remove();
|
|
|
case 7:
|
|
|
return _context3.abrupt("return", _context3.sent);
|
|
|
case 8:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
function onRemove(_x) {
|
|
|
return _onRemove.apply(this, arguments);
|
|
|
}
|
|
|
return onRemove;
|
|
|
}()
|
|
|
};
|
|
|
function onCancel(e) {
|
|
|
e.preventDefault();
|
|
|
e.stopPropagation();
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "multi-upload ".concat(className ? className : ''),
|
|
|
children: [isDragger && /*#__PURE__*/(0,jsx_runtime.jsxs)(Dragger, objectSpread2_default()(objectSpread2_default()({}, uploadProps), {}, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
className: "ant-upload-drag-icon",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(InboxOutlined/* default */.Z, {})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
className: "ant-upload-text",
|
|
|
children: ["\u70B9\u51FB\u4E0A\u4F20\u56FE\u6807\uFF0C\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u4EF6\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "(\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\u4E3A", maxSize, "MB)", ' ']
|
|
|
}), additionalText]
|
|
|
})), !isDragger && /*#__PURE__*/(0,jsx_runtime.jsxs)(upload/* default */.Z, objectSpread2_default()(objectSpread2_default()({}, uploadProps), {}, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
|
|
|
disabled: disabled,
|
|
|
className: "upload_button",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
className: "aBtn_img",
|
|
|
src: uploadImg
|
|
|
}), title]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
onClick: onCancel,
|
|
|
className: "upload_text",
|
|
|
children: ["(\u5355\u4E2A\u6587\u4EF6\u6700\u5927", maxSize, "MB)", ' ']
|
|
|
})]
|
|
|
}))]
|
|
|
});
|
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 73705:
|
|
|
/*!**********************************************!*\
|
|
|
!*** ./src/components/TooltipTags/index.tsx ***!
|
|
|
\**********************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd */ 6848);
|
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var TooltipTags = function TooltipTags(_ref) {
|
|
|
var value = _ref.value,
|
|
|
_ref$visible = _ref.visible,
|
|
|
visible = _ref$visible === void 0 ? true : _ref$visible,
|
|
|
children = _ref.children;
|
|
|
var txt = {
|
|
|
未发布: "作业尚未发布",
|
|
|
未开始: "作业已发布,尚未到达开始作业时间",
|
|
|
提交中: "作业进行中,所有考生可提交作业",
|
|
|
补交中: "作业进行中,所有学生可补交作业",
|
|
|
进行中: "作业进行中,部分班级正在作业提交中/补交中",
|
|
|
已截止: "到达作业截止时间,作业已结束",
|
|
|
已结束: "课堂已结束"
|
|
|
};
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
|
|
|
children: visible ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(antd__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
|
|
|
placement: "topLeft",
|
|
|
title: txt[value],
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("span", {
|
|
|
children: children
|
|
|
})
|
|
|
}) : children
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ __webpack_exports__.Z = (TooltipTags);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 33209:
|
|
|
/*!*********************************************************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/CommonHomework/components/SearchSortController/index.tsx + 1 modules ***!
|
|
|
\*********************************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ components_SearchSortController; }
|
|
|
});
|
|
|
|
|
|
// 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/dropdown/index.js + 1 modules
|
|
|
var dropdown = __webpack_require__(38854);
|
|
|
// 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/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/CommonHomework/components/SearchSortController/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var SearchSortControllermodules = ({"searchSortControllerContainer":"searchSortControllerContainer___AAq4n","btn":"btn___bMc0x","btnSort":"btnSort___vBpNG","tips":"tips___egWVQ"});
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/CommonHomework/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,
|
|
|
onSearch = _ref.onSearch,
|
|
|
onSort = _ref.onSort,
|
|
|
onBatch = _ref.onBatch;
|
|
|
// const [SortMenuName, setSortMenuName] = useState<any>('默认排序');
|
|
|
|
|
|
var SortMenus = isAdmin ? [{
|
|
|
name: '默认排序',
|
|
|
type: 'position',
|
|
|
direction: 'desc'
|
|
|
}, {
|
|
|
name: '创建时间升序',
|
|
|
type: 'created_at',
|
|
|
direction: 'asc'
|
|
|
}, {
|
|
|
name: '创建时间降序',
|
|
|
type: 'created_at',
|
|
|
direction: 'desc'
|
|
|
}, {
|
|
|
name: '更新时间升序',
|
|
|
type: 'updated_at',
|
|
|
direction: 'asc'
|
|
|
}, {
|
|
|
name: '更新时间降序',
|
|
|
type: 'updated_at',
|
|
|
direction: 'desc'
|
|
|
}, {
|
|
|
name: '作业名称升序',
|
|
|
type: 'name_pinyin',
|
|
|
direction: 'asc'
|
|
|
}, {
|
|
|
name: '作业名称降序',
|
|
|
type: 'name_pinyin',
|
|
|
direction: 'desc'
|
|
|
}] : [{
|
|
|
name: '默认排序',
|
|
|
type: 'position',
|
|
|
direction: 'desc'
|
|
|
}, {
|
|
|
name: '按发布时间升序',
|
|
|
type: 'created_at',
|
|
|
direction: 'asc'
|
|
|
}, {
|
|
|
name: '按发布时间降序',
|
|
|
type: 'created_at',
|
|
|
direction: 'desc'
|
|
|
}, {
|
|
|
name: '按截止时间升序',
|
|
|
type: 'updated_at',
|
|
|
direction: 'asc'
|
|
|
}, {
|
|
|
name: '按截止时间降序',
|
|
|
type: 'updated_at',
|
|
|
direction: 'desc'
|
|
|
}, {
|
|
|
name: '作业名称升序',
|
|
|
type: 'name_pinyin',
|
|
|
direction: 'asc'
|
|
|
}, {
|
|
|
name: '作业名称降序',
|
|
|
type: 'name_pinyin',
|
|
|
direction: 'desc'
|
|
|
}];
|
|
|
|
|
|
/**
|
|
|
* 排序点击事件
|
|
|
*/
|
|
|
var sortClick = function sortClick(data) {
|
|
|
setSortMenuName(data.name);
|
|
|
onSort(data);
|
|
|
};
|
|
|
|
|
|
// 默认排序
|
|
|
var isDefault = SortMenuName === '默认排序';
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: SearchSortControllermodules.searchSortControllerContainer,
|
|
|
children: [/*#__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'
|
|
|
}
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_SearchSortController = (SearchSortController);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 54093:
|
|
|
/*!****************************************************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/CommonHomework/components/SortShixunPanel/index.tsx + 1 modules ***!
|
|
|
\****************************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ SortShixunPanel; }
|
|
|
});
|
|
|
|
|
|
// 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/_react-sortable-hoc@1.11.0@react-sortable-hoc/dist/react-sortable-hoc.esm.js
|
|
|
var react_sortable_hoc_esm = __webpack_require__(44589);
|
|
|
// EXTERNAL MODULE: ./node_modules/_array-move@3.0.1@array-move/index.js
|
|
|
var _array_move_3_0_1_array_move = __webpack_require__(39180);
|
|
|
var _array_move_3_0_1_array_move_default = /*#__PURE__*/__webpack_require__.n(_array_move_3_0_1_array_move);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/drawer/index.js + 9 modules
|
|
|
var drawer = __webpack_require__(43428);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/CommonHomework/components/SortShixunPanel/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/pages/Classrooms/Lists/CommonHomework/components/SortShixunPanel/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var SortableItem = (0,react_sortable_hoc_esm/* SortableElement */.W8)(function (_ref) {
|
|
|
var item = _ref.item;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("h3", {
|
|
|
children: item.task_name
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
children: [item.user_name, /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
marginLeft: '20px'
|
|
|
},
|
|
|
children: item.category
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
});
|
|
|
var SortableList = (0,react_sortable_hoc_esm/* SortableContainer */.JN)(function (_ref2) {
|
|
|
var items = _ref2.items;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("ul", {
|
|
|
className: "task-list-container",
|
|
|
children: items.map(function (value, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(SortableItem, {
|
|
|
index: index,
|
|
|
item: value
|
|
|
}, "".concat(value.task_id));
|
|
|
})
|
|
|
});
|
|
|
});
|
|
|
/* harmony default export */ var SortShixunPanel = (function (_ref3) {
|
|
|
var data = _ref3.data,
|
|
|
callback = _ref3.callback,
|
|
|
onCancel = _ref3.onCancel,
|
|
|
_ref3$visible = _ref3.visible,
|
|
|
visible = _ref3$visible === void 0 ? false : _ref3$visible;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(data),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
values = _useState2[0],
|
|
|
setValues = _useState2[1];
|
|
|
function onSave() {
|
|
|
callback(values.map(function (item) {
|
|
|
return item.task_id;
|
|
|
}));
|
|
|
}
|
|
|
function onSortEnd(info) {
|
|
|
var newIndex = info.newIndex,
|
|
|
oldIndex = info.oldIndex;
|
|
|
setValues(_array_move_3_0_1_array_move_default()(values, oldIndex, newIndex));
|
|
|
}
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
setValues(data);
|
|
|
}, [JSON.stringify(data)]);
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(drawer/* default */.Z, {
|
|
|
placement: 'bottom',
|
|
|
height: '100%',
|
|
|
closable: true,
|
|
|
onClose: onCancel,
|
|
|
style: {
|
|
|
zIndex: 9999
|
|
|
},
|
|
|
open: visible,
|
|
|
rootClassName: "sort-list-panel",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
className: "sort-list-tip",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u6E29\u99A8\u63D0\u793A\uFF1A\u8BF7\u5728\u5217\u8868\u4E2D\u957F\u6309\u9F20\u6807\u5DE6\u952E\uFF0C\u8FDB\u884C\u62D6\u653E\u6392\u5E8F\u3002\u5B8C\u6210\u6392\u5E8F\u540E\u8BF7\u70B9\u51FB\u201C\u4FDD\u5B58\u201D"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "ghost",
|
|
|
onClick: onCancel,
|
|
|
style: {
|
|
|
marginRight: 10
|
|
|
},
|
|
|
children: "\u53D6\u6D88"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
disabled: values.length === 0,
|
|
|
type: "primary",
|
|
|
onClick: onSave,
|
|
|
children: "\u4FDD\u5B58"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(SortableList, {
|
|
|
axis: "xy",
|
|
|
helperClass: "dragging-li",
|
|
|
items: values,
|
|
|
onSortEnd: onSortEnd
|
|
|
})]
|
|
|
});
|
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 67300:
|
|
|
/*!********************************************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/CommonHomework/components/TabMenu/index.tsx + 1 modules ***!
|
|
|
\********************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// 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/menu/index.js + 11 modules
|
|
|
var menu = __webpack_require__(20834);
|
|
|
// 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/tooltip/index.js + 3 modules
|
|
|
var tooltip = __webpack_require__(6848);
|
|
|
// 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/CommonHomework/components/TabMenu/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var TabMenumodules = ({"tabMenuContainer":"tabMenuContainer___xbZhu","control":"control___tg7XY","iconH":"iconH___CDXCm","selectBtn":"selectBtn___Da4jv"});
|
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
|
|
|
var _umi_production_exports = __webpack_require__(66660);
|
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
|
var authority = __webpack_require__(76107);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/CommonHomework/components/TabMenu/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var TabMenu = function TabMenu(_ref) {
|
|
|
var _classroomList$Assist;
|
|
|
var isLoading = _ref.isLoading,
|
|
|
addText = _ref.addText,
|
|
|
tabDataSource = _ref.tabDataSource,
|
|
|
isAdmin = _ref.isAdmin,
|
|
|
TooltipTitle = _ref.TooltipTitle,
|
|
|
categoryId = _ref.categoryId,
|
|
|
dropdownMenu = _ref.dropdownMenu,
|
|
|
isShowRightControl = _ref.isShowRightControl,
|
|
|
defaultSelectedKeys = _ref.defaultSelectedKeys,
|
|
|
classroomList = _ref.classroomList,
|
|
|
onTabMenuClick = _ref.onTabMenuClick,
|
|
|
onTooltipTitleClick = _ref.onTooltipTitleClick,
|
|
|
onDropdownMenuClick = _ref.onDropdownMenuClick,
|
|
|
onsetClick = _ref.onsetClick;
|
|
|
/**
|
|
|
* 渲染菜单
|
|
|
*/
|
|
|
var getDropdownMenu = function getDropdownMenu() {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z, {
|
|
|
onClick: function onClick(_ref2) {
|
|
|
var key = _ref2.key;
|
|
|
onDropdownMenuClick(key);
|
|
|
},
|
|
|
children: dropdownMenu.map(function (item) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z.Item, {
|
|
|
children: item.name
|
|
|
}, item.id);
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
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, {
|
|
|
mode: "horizontal",
|
|
|
selectedKeys: defaultSelectedKeys,
|
|
|
children: tabDataSource.map(function (item) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(menu/* default */.Z.Item, {
|
|
|
onClick: function onClick() {
|
|
|
return !isLoading ? onTabMenuClick(item) : {};
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-grey-666 ".concat(isAdmin ? 'mr20' : ''),
|
|
|
children: item.name
|
|
|
}), item.total !== undefined && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-grey-999",
|
|
|
children: item.total || 0
|
|
|
})]
|
|
|
}, item.id);
|
|
|
})
|
|
|
})
|
|
|
}), isAdmin && isShowRightControl && /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
className: "mr20 gutter-row",
|
|
|
style: {
|
|
|
display: 'flex',
|
|
|
alignItems: 'center',
|
|
|
color: '#0152d9',
|
|
|
paddingBottom: 3
|
|
|
},
|
|
|
children: [(0,authority/* isAssistant */.Rm)() && !((_classroomList$Assist = classroomList.AssistantObject.normal) !== null && _classroomList$Assist !== void 0 && _classroomList$Assist.can_create) ? '' : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-grey-666",
|
|
|
style: {
|
|
|
marginLeft: 8,
|
|
|
cursor: 'pointer',
|
|
|
marginTop: '3px'
|
|
|
},
|
|
|
onClick: onsetClick,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-shezhi6 font16 mr5"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: TabMenumodules.control,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "c-blue font16 ml20 current",
|
|
|
style: {
|
|
|
marginTop: 2
|
|
|
},
|
|
|
onClick: onTooltipTitleClick,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: TooltipTitle,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: !categoryId ? "".concat(TabMenumodules.iconH, " iconfont icon-xinjianmulu1") : "".concat(TabMenumodules.iconH, " iconfont icon-zhongmingmingmulu")
|
|
|
})
|
|
|
})
|
|
|
}), /*#__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 = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
|
var classroomList = _ref3.classroomList;
|
|
|
return {
|
|
|
classroomList: classroomList
|
|
|
};
|
|
|
})(TabMenu));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 28784:
|
|
|
/*!*********************************************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/ShixunHomeworks/components/TrfList/index.tsx + 2 modules ***!
|
|
|
\*********************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ components_TrfList; }
|
|
|
});
|
|
|
|
|
|
// 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/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/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/row/index.js
|
|
|
var row = __webpack_require__(95237);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/ShixunHomeworks/components/TrfList/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var TrfListmodules = ({"leftdiv":"leftdiv___aBzsX","listClass":"listClass___bxIEW","spantitle":"spantitle___v_Vc4","rightdiv":"rightdiv___xWu4M"});
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/ShixunHomeworks/components/TrfList/delete.png
|
|
|
var delete_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAbVJREFUOE+Nk79rFUEUhb+zE4OFwUD+CyGKKQQbSaMikQQ7C1tBBIsUQaJvl2Fn/cWDpAiIYJsi7YOIaCUWFoKKRhG0sbEzEImFGnev7G6yyXsxeU5159yZb87l3hG9q2WLiBO79FIwXpLp0s6cwITnQCMWrGDM43jdBckZQ0wTMdrong2R2Bxm0/98sZ8ozdcOEm5hjOC41u9Olc9ZQKySclOVkNhljCmCzjeAJM/4FbW5p+8k5tlggTtarfKxLSM6pHq4BTiL0SboaAOIi284jeP1nti+ApMEvdoEvEPMkOpJDZi1IwzwgqDh/wSsYZwk08ca4O0Qua3zW8OV5crmHg6u22EGbQ2nIbx+1IC6rrK+cYJW9gXEVrbxGUEj5bltQGJvgBapHu0LSGwCyEh1vBsQWwd4TNCDPg6uAOcImuoFlL1dJ9WNPg5uYwwRVM3MzhJmKIpjZK6e9bj4jNNpvL4QFx9wuoDXJ1r5IlH0llTtXgcXwa4SolObnYnwKnbFcfEcdJ+gpW6AtzFynuIop/Fn053u4CA5yzjO4FV9tu0Syl2S38WiSWBgD8AfoEPQ7Fb+LwIiyhxWwe2KAAAAAElFTkSuQmCC";
|
|
|
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
|
|
var NoData = __webpack_require__(72020);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/ShixunHomeworks/components/TrfList/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//滚动加载
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var TrfList = function TrfList(_ref) {
|
|
|
var data = _ref.data,
|
|
|
_ref$value = _ref.value,
|
|
|
value = _ref$value === void 0 ? [] : _ref$value,
|
|
|
handleChangePage = _ref.handleChangePage,
|
|
|
setSelectedRowKeys = _ref.setSelectedRowKeys,
|
|
|
selectedRowKeys = _ref.selectedRowKeys,
|
|
|
_ref$onChange = _ref.onChange,
|
|
|
onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
leftList = _useState2[0],
|
|
|
setleftList = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
rightList = _useState4[0],
|
|
|
setRightList = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
checkoutList = _useState6[0],
|
|
|
setCheckoutList = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(1),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
page = _useState8[0],
|
|
|
setpage = _useState8[1];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
sechar = _useState10[0],
|
|
|
setsechar = _useState10[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
setleftList(data);
|
|
|
setRightList([]);
|
|
|
setCheckoutList([]);
|
|
|
}, [data]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (setSelectedRowKeys) {
|
|
|
setRightList(selectedRowKeys);
|
|
|
setCheckoutList(selectedRowKeys);
|
|
|
}
|
|
|
}, [selectedRowKeys]);
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
display: 'flex',
|
|
|
justifyContent: 'space-between'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: TrfListmodules.leftdiv,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
|
|
|
size: 'middle',
|
|
|
onChange: /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(e) {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
// const res = await Fetch(`/api/common_exercises/exercise_users/student_groups.json`, { method: "get", params: {page: 1, per_page: 200,student_group:e} });
|
|
|
// if (res.status === 0) {
|
|
|
// setleftList(res?.data)
|
|
|
// setsechar(e);
|
|
|
// }
|
|
|
// if(!e){
|
|
|
// setsechar('');
|
|
|
// }
|
|
|
// setpage(1);
|
|
|
setleftList(data.filter(function (item) {
|
|
|
var _item$name;
|
|
|
return item === null || item === void 0 || (_item$name = item.name) === null || _item$name === void 0 ? void 0 : _item$name.includes(e.target.value);
|
|
|
}));
|
|
|
case 1:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function (_x) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}(),
|
|
|
placeholder: "\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"
|
|
|
}), leftList.length === 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {
|
|
|
styles: {
|
|
|
margin: '70px auto'
|
|
|
},
|
|
|
customText: '暂无分班'
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
height: '85%',
|
|
|
overflow: 'auto',
|
|
|
overflowX: 'hidden'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z.Group, {
|
|
|
value: rightList.map(function (item) {
|
|
|
return "".concat(item.id);
|
|
|
}),
|
|
|
onChange: function onChange(e) {
|
|
|
setSelectedRowKeys(leftList.filter(function (item) {
|
|
|
return e.includes("".concat(item.id));
|
|
|
}));
|
|
|
},
|
|
|
style: {
|
|
|
marginTop: '10px',
|
|
|
flexDirection: "column"
|
|
|
},
|
|
|
children: leftList.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
style: {
|
|
|
marginTop: '10px',
|
|
|
lineHeight: '24px',
|
|
|
display: 'flex',
|
|
|
width: 200
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
|
style: {
|
|
|
display: 'flex',
|
|
|
height: '24px',
|
|
|
alignItems: 'center'
|
|
|
},
|
|
|
disabled: item.is_published,
|
|
|
value: "".concat(item.id),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: TrfListmodules.listClass,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: TrfListmodules.spantitle,
|
|
|
style: {
|
|
|
width: item.is_published ? '108px' : '170px'
|
|
|
},
|
|
|
children: item.name
|
|
|
}), item.is_published && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
width: '52px',
|
|
|
height: '24px',
|
|
|
background: '#B8B8B8',
|
|
|
borderRadius: '13px',
|
|
|
color: 'white',
|
|
|
lineHeight: '24px',
|
|
|
textAlign: 'center',
|
|
|
display: 'inline-block'
|
|
|
},
|
|
|
children: "\u5DF2\u53D1\u5E03"
|
|
|
})]
|
|
|
})
|
|
|
})
|
|
|
}, item.id);
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: TrfListmodules.rightdiv,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
|
|
|
onChange: function onChange(e) {
|
|
|
setCheckoutList(rightList.filter(function (item) {
|
|
|
return item.name.includes(e.target.value);
|
|
|
}));
|
|
|
},
|
|
|
size: 'middle',
|
|
|
placeholder: "\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"
|
|
|
}), checkoutList.length === 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {
|
|
|
styles: {
|
|
|
margin: '70px auto'
|
|
|
},
|
|
|
customText: '暂未选择分班'
|
|
|
}), checkoutList.length > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
marginTop: '10px',
|
|
|
height: '85%',
|
|
|
overflow: 'hidden',
|
|
|
position: 'relative'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
overflowX: 'hidden',
|
|
|
overflowY: 'scroll',
|
|
|
position: 'absolute',
|
|
|
left: 0,
|
|
|
top: 0,
|
|
|
right: -17,
|
|
|
bottom: 0
|
|
|
},
|
|
|
children: checkoutList.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
justify: "space-between",
|
|
|
style: {
|
|
|
marginTop: '10px'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
overflow: 'hidden',
|
|
|
whiteSpace: 'nowrap',
|
|
|
textOverflow: 'ellipsis',
|
|
|
marginRight: '5px',
|
|
|
marginLeft: '5px',
|
|
|
width: '75%'
|
|
|
},
|
|
|
children: item.name
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: delete_namespaceObject,
|
|
|
style: {
|
|
|
cursor: 'pointer',
|
|
|
height: '16px',
|
|
|
marginRight: 17
|
|
|
},
|
|
|
onClick: function onClick() {
|
|
|
setSelectedRowKeys(rightList.filter(function (items) {
|
|
|
return "".concat(items.id) != "".concat(item.id);
|
|
|
}));
|
|
|
}
|
|
|
})]
|
|
|
}, item.id);
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_TrfList = (TrfList);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 57417:
|
|
|
/*!**************************************************!*\
|
|
|
!*** ./src/pages/MoopCases/FormPanel/service.ts ***!
|
|
|
\**************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ $J: function() { return /* binding */ getMoopCase; },
|
|
|
/* harmony export */ JZ: function() { return /* binding */ removeAttachment; },
|
|
|
/* harmony export */ bN: function() { return /* binding */ updateMoopCase; },
|
|
|
/* harmony export */ jP: function() { return /* binding */ addMoopCase; },
|
|
|
/* harmony export */ rO: function() { return /* binding */ getLibraryTags; }
|
|
|
/* harmony export */ });
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js */ 10574);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_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_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js */ 39343);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/utils/fetch */ 97174);
|
|
|
|
|
|
|
|
|
|
|
|
function getMoopCase(id) {
|
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_2__/* .get */ .U2)("libraries/".concat(id, ".json"));
|
|
|
}
|
|
|
function getLibraryTags() {
|
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_2__/* .get */ .U2)('library_tags.json');
|
|
|
}
|
|
|
function removeAttachment(_x) {
|
|
|
return _removeAttachment.apply(this, arguments);
|
|
|
}
|
|
|
function _removeAttachment() {
|
|
|
_removeAttachment = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _callee(id) {
|
|
|
var response;
|
|
|
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_2__/* .del */ .IV)("attachments/".concat(id, ".json"));
|
|
|
case 2:
|
|
|
response = _context.sent;
|
|
|
return _context.abrupt("return", response.status === 0);
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return _removeAttachment.apply(this, arguments);
|
|
|
}
|
|
|
function addMoopCase(params) {
|
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_2__/* .post */ .v_)("libraries.json", params);
|
|
|
}
|
|
|
function updateMoopCase(id, params) {
|
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_2__/* .put */ .gz)("libraries/".concat(id, ".json"), params);
|
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 77578:
|
|
|
/*!**********************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/_util/getRenderPropValue.js ***!
|
|
|
\**********************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* 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;
|
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 27666:
|
|
|
/*!****************************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/_util/throttleByAnimationFrame.js ***!
|
|
|
\****************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ 42371);
|
|
|
/* harmony import */ var rc_util_es_raf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rc-util/es/raf */ 90571);
|
|
|
|
|
|
|
|
|
function throttleByAnimationFrame(fn) {
|
|
|
let requestId;
|
|
|
const later = args => () => {
|
|
|
requestId = null;
|
|
|
fn.apply(void 0, (0,_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(args));
|
|
|
};
|
|
|
const throttled = function () {
|
|
|
if (requestId == null) {
|
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
|
args[_key] = arguments[_key];
|
|
|
}
|
|
|
requestId = (0,rc_util_es_raf__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(later(args));
|
|
|
}
|
|
|
};
|
|
|
throttled.cancel = () => {
|
|
|
rc_util_es_raf__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.cancel(requestId);
|
|
|
requestId = null;
|
|
|
};
|
|
|
return throttled;
|
|
|
}
|
|
|
/* harmony default export */ __webpack_exports__.Z = (throttleByAnimationFrame);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 81228:
|
|
|
/*!*********************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/affix/index.js + 2 modules ***!
|
|
|
\*********************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ affix; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/esm/classCallCheck.js
|
|
|
var classCallCheck = __webpack_require__(74809);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/esm/createClass.js
|
|
|
var createClass = __webpack_require__(57338);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/esm/inherits.js
|
|
|
var inherits = __webpack_require__(29161);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/esm/createSuper.js + 1 modules
|
|
|
var createSuper = __webpack_require__(24154);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// 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/_rc-resize-observer@1.4.0@rc-resize-observer/es/index.js + 4 modules
|
|
|
var es = __webpack_require__(28647);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.38.1@rc-util/es/omit.js
|
|
|
var omit = __webpack_require__(99468);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/throttleByAnimationFrame.js
|
|
|
var throttleByAnimationFrame = __webpack_require__(27666);
|
|
|
// 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/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/affix/style/index.js
|
|
|
|
|
|
// ============================== Shared ==============================
|
|
|
const genSharedAffixStyle = token => {
|
|
|
const {
|
|
|
componentCls
|
|
|
} = token;
|
|
|
return {
|
|
|
[componentCls]: {
|
|
|
position: 'fixed',
|
|
|
zIndex: token.zIndexPopup
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
// ============================== Export ==============================
|
|
|
/* harmony default export */ var style = ((0,genComponentStyleHook/* default */.Z)('Affix', token => {
|
|
|
const affixToken = (0,statistic/* merge */.TS)(token, {
|
|
|
zIndexPopup: token.zIndexBase + 10
|
|
|
});
|
|
|
return [genSharedAffixStyle(affixToken)];
|
|
|
}));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/affix/utils.js
|
|
|
function getTargetRect(target) {
|
|
|
return target !== window ? target.getBoundingClientRect() : {
|
|
|
top: 0,
|
|
|
bottom: window.innerHeight
|
|
|
};
|
|
|
}
|
|
|
function getFixedTop(placeholderRect, targetRect, offsetTop) {
|
|
|
if (offsetTop !== undefined && targetRect.top > placeholderRect.top - offsetTop) {
|
|
|
return offsetTop + targetRect.top;
|
|
|
}
|
|
|
return undefined;
|
|
|
}
|
|
|
function getFixedBottom(placeholderRect, targetRect, offsetBottom) {
|
|
|
if (offsetBottom !== undefined && targetRect.bottom < placeholderRect.bottom + offsetBottom) {
|
|
|
const targetBottomOffset = window.innerHeight - targetRect.bottom;
|
|
|
return offsetBottom + targetBottomOffset;
|
|
|
}
|
|
|
return undefined;
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/affix/index.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const TRIGGER_EVENTS = ['resize', 'scroll', 'touchstart', 'touchmove', 'touchend', 'pageshow', 'load'];
|
|
|
function getDefaultTarget() {
|
|
|
return typeof window !== 'undefined' ? window : null;
|
|
|
}
|
|
|
var AffixStatus;
|
|
|
(function (AffixStatus) {
|
|
|
AffixStatus[AffixStatus["None"] = 0] = "None";
|
|
|
AffixStatus[AffixStatus["Prepare"] = 1] = "Prepare";
|
|
|
})(AffixStatus || (AffixStatus = {}));
|
|
|
let InternalAffix = /*#__PURE__*/function (_React$Component) {
|
|
|
(0,inherits/* default */.Z)(InternalAffix, _React$Component);
|
|
|
var _super = (0,createSuper/* default */.Z)(InternalAffix);
|
|
|
function InternalAffix() {
|
|
|
var _this;
|
|
|
(0,classCallCheck/* default */.Z)(this, InternalAffix);
|
|
|
_this = _super.apply(this, arguments);
|
|
|
_this.state = {
|
|
|
status: AffixStatus.None,
|
|
|
lastAffix: false,
|
|
|
prevTarget: null
|
|
|
};
|
|
|
_this.placeholderNodeRef = /*#__PURE__*/(0,_react_17_0_2_react.createRef)();
|
|
|
_this.fixedNodeRef = /*#__PURE__*/(0,_react_17_0_2_react.createRef)();
|
|
|
_this.addListeners = () => {
|
|
|
const targetFunc = _this.getTargetFunc();
|
|
|
const target = targetFunc === null || targetFunc === void 0 ? void 0 : targetFunc();
|
|
|
const {
|
|
|
prevTarget
|
|
|
} = _this.state;
|
|
|
if (prevTarget !== target) {
|
|
|
TRIGGER_EVENTS.forEach(eventName => {
|
|
|
prevTarget === null || prevTarget === void 0 ? void 0 : prevTarget.removeEventListener(eventName, _this.lazyUpdatePosition);
|
|
|
target === null || target === void 0 ? void 0 : target.addEventListener(eventName, _this.lazyUpdatePosition);
|
|
|
});
|
|
|
_this.updatePosition();
|
|
|
_this.setState({
|
|
|
prevTarget: target
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
_this.removeListeners = () => {
|
|
|
if (_this.timer) {
|
|
|
clearTimeout(_this.timer);
|
|
|
_this.timer = null;
|
|
|
}
|
|
|
const {
|
|
|
prevTarget
|
|
|
} = _this.state;
|
|
|
const targetFunc = _this.getTargetFunc();
|
|
|
const newTarget = targetFunc === null || targetFunc === void 0 ? void 0 : targetFunc();
|
|
|
TRIGGER_EVENTS.forEach(eventName => {
|
|
|
newTarget === null || newTarget === void 0 ? void 0 : newTarget.removeEventListener(eventName, _this.lazyUpdatePosition);
|
|
|
prevTarget === null || prevTarget === void 0 ? void 0 : prevTarget.removeEventListener(eventName, _this.lazyUpdatePosition);
|
|
|
});
|
|
|
_this.updatePosition.cancel();
|
|
|
// https://github.com/ant-design/ant-design/issues/22683
|
|
|
_this.lazyUpdatePosition.cancel();
|
|
|
};
|
|
|
_this.getOffsetTop = () => {
|
|
|
const {
|
|
|
offsetBottom,
|
|
|
offsetTop
|
|
|
} = _this.props;
|
|
|
return offsetBottom === undefined && offsetTop === undefined ? 0 : offsetTop;
|
|
|
};
|
|
|
_this.getOffsetBottom = () => _this.props.offsetBottom;
|
|
|
// =================== Measure ===================
|
|
|
_this.measure = () => {
|
|
|
const {
|
|
|
status,
|
|
|
lastAffix
|
|
|
} = _this.state;
|
|
|
const {
|
|
|
onChange
|
|
|
} = _this.props;
|
|
|
const targetFunc = _this.getTargetFunc();
|
|
|
if (status !== AffixStatus.Prepare || !_this.fixedNodeRef.current || !_this.placeholderNodeRef.current || !targetFunc) {
|
|
|
return;
|
|
|
}
|
|
|
const offsetTop = _this.getOffsetTop();
|
|
|
const offsetBottom = _this.getOffsetBottom();
|
|
|
const targetNode = targetFunc();
|
|
|
if (targetNode) {
|
|
|
const newState = {
|
|
|
status: AffixStatus.None
|
|
|
};
|
|
|
const placeholderRect = getTargetRect(_this.placeholderNodeRef.current);
|
|
|
if (placeholderRect.top === 0 && placeholderRect.left === 0 && placeholderRect.width === 0 && placeholderRect.height === 0) {
|
|
|
return;
|
|
|
}
|
|
|
const targetRect = getTargetRect(targetNode);
|
|
|
const fixedTop = getFixedTop(placeholderRect, targetRect, offsetTop);
|
|
|
const fixedBottom = getFixedBottom(placeholderRect, targetRect, offsetBottom);
|
|
|
if (fixedTop !== undefined) {
|
|
|
newState.affixStyle = {
|
|
|
position: 'fixed',
|
|
|
top: fixedTop,
|
|
|
width: placeholderRect.width,
|
|
|
height: placeholderRect.height
|
|
|
};
|
|
|
newState.placeholderStyle = {
|
|
|
width: placeholderRect.width,
|
|
|
height: placeholderRect.height
|
|
|
};
|
|
|
} else if (fixedBottom !== undefined) {
|
|
|
newState.affixStyle = {
|
|
|
position: 'fixed',
|
|
|
bottom: fixedBottom,
|
|
|
width: placeholderRect.width,
|
|
|
height: placeholderRect.height
|
|
|
};
|
|
|
newState.placeholderStyle = {
|
|
|
width: placeholderRect.width,
|
|
|
height: placeholderRect.height
|
|
|
};
|
|
|
}
|
|
|
newState.lastAffix = !!newState.affixStyle;
|
|
|
if (onChange && lastAffix !== newState.lastAffix) {
|
|
|
onChange(newState.lastAffix);
|
|
|
}
|
|
|
_this.setState(newState);
|
|
|
}
|
|
|
};
|
|
|
_this.prepareMeasure = () => {
|
|
|
// event param is used before. Keep compatible ts define here.
|
|
|
_this.setState({
|
|
|
status: AffixStatus.Prepare,
|
|
|
affixStyle: undefined,
|
|
|
placeholderStyle: undefined
|
|
|
});
|
|
|
// Test if `updatePosition` called
|
|
|
if (false) {}
|
|
|
};
|
|
|
_this.updatePosition = (0,throttleByAnimationFrame/* default */.Z)(() => {
|
|
|
_this.prepareMeasure();
|
|
|
});
|
|
|
_this.lazyUpdatePosition = (0,throttleByAnimationFrame/* default */.Z)(() => {
|
|
|
const targetFunc = _this.getTargetFunc();
|
|
|
const {
|
|
|
affixStyle
|
|
|
} = _this.state;
|
|
|
// Check position change before measure to make Safari smooth
|
|
|
if (targetFunc && affixStyle) {
|
|
|
const offsetTop = _this.getOffsetTop();
|
|
|
const offsetBottom = _this.getOffsetBottom();
|
|
|
const targetNode = targetFunc();
|
|
|
if (targetNode && _this.placeholderNodeRef.current) {
|
|
|
const targetRect = getTargetRect(targetNode);
|
|
|
const placeholderRect = getTargetRect(_this.placeholderNodeRef.current);
|
|
|
const fixedTop = getFixedTop(placeholderRect, targetRect, offsetTop);
|
|
|
const fixedBottom = getFixedBottom(placeholderRect, targetRect, offsetBottom);
|
|
|
if (fixedTop !== undefined && affixStyle.top === fixedTop || fixedBottom !== undefined && affixStyle.bottom === fixedBottom) {
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
// Directly call prepare measure since it's already throttled.
|
|
|
_this.prepareMeasure();
|
|
|
});
|
|
|
return _this;
|
|
|
}
|
|
|
(0,createClass/* default */.Z)(InternalAffix, [{
|
|
|
key: "getTargetFunc",
|
|
|
value: function getTargetFunc() {
|
|
|
const {
|
|
|
getTargetContainer
|
|
|
} = this.context;
|
|
|
const {
|
|
|
target
|
|
|
} = this.props;
|
|
|
if (target !== undefined) {
|
|
|
return target;
|
|
|
}
|
|
|
return getTargetContainer !== null && getTargetContainer !== void 0 ? getTargetContainer : getDefaultTarget;
|
|
|
}
|
|
|
// Event handler
|
|
|
}, {
|
|
|
key: "componentDidMount",
|
|
|
value: function componentDidMount() {
|
|
|
// [Legacy] Wait for parent component ref has its value.
|
|
|
// We should use target as directly element instead of function which makes element check hard.
|
|
|
this.timer = setTimeout(this.addListeners);
|
|
|
}
|
|
|
}, {
|
|
|
key: "componentDidUpdate",
|
|
|
value: function componentDidUpdate(prevProps) {
|
|
|
this.addListeners();
|
|
|
if (prevProps.offsetTop !== this.props.offsetTop || prevProps.offsetBottom !== this.props.offsetBottom) {
|
|
|
this.updatePosition();
|
|
|
}
|
|
|
this.measure();
|
|
|
}
|
|
|
}, {
|
|
|
key: "componentWillUnmount",
|
|
|
value: function componentWillUnmount() {
|
|
|
this.removeListeners();
|
|
|
}
|
|
|
// =================== Render ===================
|
|
|
}, {
|
|
|
key: "render",
|
|
|
value: function render() {
|
|
|
const {
|
|
|
affixStyle,
|
|
|
placeholderStyle
|
|
|
} = this.state;
|
|
|
const {
|
|
|
affixPrefixCls,
|
|
|
rootClassName,
|
|
|
children
|
|
|
} = this.props;
|
|
|
const className = _classnames_2_3_2_classnames_default()(affixStyle && rootClassName, {
|
|
|
[affixPrefixCls]: !!affixStyle
|
|
|
});
|
|
|
let props = (0,omit/* default */.Z)(this.props, ['prefixCls', 'offsetTop', 'offsetBottom', 'target', 'onChange', 'affixPrefixCls', 'rootClassName']);
|
|
|
// Omit this since `onTestUpdatePosition` only works on test.
|
|
|
if (false) {}
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(es/* default */.Z, {
|
|
|
onResize: this.updatePosition
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("div", Object.assign({}, props, {
|
|
|
ref: this.placeholderNodeRef
|
|
|
}), affixStyle && /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
style: placeholderStyle,
|
|
|
"aria-hidden": "true"
|
|
|
}), /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
className: className,
|
|
|
ref: this.fixedNodeRef,
|
|
|
style: affixStyle
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(es/* default */.Z, {
|
|
|
onResize: this.updatePosition
|
|
|
}, children))));
|
|
|
}
|
|
|
}]);
|
|
|
return InternalAffix;
|
|
|
}(_react_17_0_2_react.Component);
|
|
|
InternalAffix.contextType = context/* ConfigContext */.E_;
|
|
|
const Affix = /*#__PURE__*/(0,_react_17_0_2_react.forwardRef)((props, ref) => {
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
rootClassName
|
|
|
} = props;
|
|
|
const {
|
|
|
getPrefixCls
|
|
|
} = (0,_react_17_0_2_react.useContext)(context/* ConfigContext */.E_);
|
|
|
const affixPrefixCls = getPrefixCls('affix', customizePrefixCls);
|
|
|
const [wrapSSR, hashId] = style(affixPrefixCls);
|
|
|
const AffixProps = Object.assign(Object.assign({}, props), {
|
|
|
affixPrefixCls,
|
|
|
rootClassName: _classnames_2_3_2_classnames_default()(rootClassName, hashId)
|
|
|
});
|
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement(InternalAffix, Object.assign({}, AffixProps, {
|
|
|
ref: ref
|
|
|
})));
|
|
|
});
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var affix = (Affix);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 39722:
|
|
|
/*!***************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/popover/PurePanel.js ***!
|
|
|
\***************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* 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__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* 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__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* 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']]
|
|
|
}));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 51581:
|
|
|
/*!****************************************************************************************************!*\
|
|
|
!*** ./node_modules/_react-infinite-scroller@1.2.4@react-infinite-scroller/dist/InfiniteScroll.js ***!
|
|
|
\****************************************************************************************************/
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({
|
|
|
value: true
|
|
|
}));
|
|
|
|
|
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
|
|
var _react = __webpack_require__(/*! react */ 59301);
|
|
|
|
|
|
var _react2 = _interopRequireDefault(_react);
|
|
|
|
|
|
var _propTypes = __webpack_require__(/*! prop-types */ 12708);
|
|
|
|
|
|
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
|
|
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
|
|
var InfiniteScroll = function (_Component) {
|
|
|
_inherits(InfiniteScroll, _Component);
|
|
|
|
|
|
function InfiniteScroll(props) {
|
|
|
_classCallCheck(this, InfiniteScroll);
|
|
|
|
|
|
var _this = _possibleConstructorReturn(this, (InfiniteScroll.__proto__ || Object.getPrototypeOf(InfiniteScroll)).call(this, props));
|
|
|
|
|
|
_this.scrollListener = _this.scrollListener.bind(_this);
|
|
|
_this.eventListenerOptions = _this.eventListenerOptions.bind(_this);
|
|
|
_this.mousewheelListener = _this.mousewheelListener.bind(_this);
|
|
|
return _this;
|
|
|
}
|
|
|
|
|
|
_createClass(InfiniteScroll, [{
|
|
|
key: 'componentDidMount',
|
|
|
value: function componentDidMount() {
|
|
|
this.pageLoaded = this.props.pageStart;
|
|
|
this.options = this.eventListenerOptions();
|
|
|
this.attachScrollListener();
|
|
|
}
|
|
|
}, {
|
|
|
key: 'componentDidUpdate',
|
|
|
value: function componentDidUpdate() {
|
|
|
if (this.props.isReverse && this.loadMore) {
|
|
|
var parentElement = this.getParentElement(this.scrollComponent);
|
|
|
parentElement.scrollTop = parentElement.scrollHeight - this.beforeScrollHeight + this.beforeScrollTop;
|
|
|
this.loadMore = false;
|
|
|
}
|
|
|
this.attachScrollListener();
|
|
|
}
|
|
|
}, {
|
|
|
key: 'componentWillUnmount',
|
|
|
value: function componentWillUnmount() {
|
|
|
this.detachScrollListener();
|
|
|
this.detachMousewheelListener();
|
|
|
}
|
|
|
}, {
|
|
|
key: 'isPassiveSupported',
|
|
|
value: function isPassiveSupported() {
|
|
|
var passive = false;
|
|
|
|
|
|
var testOptions = {
|
|
|
get passive() {
|
|
|
passive = true;
|
|
|
}
|
|
|
};
|
|
|
|
|
|
try {
|
|
|
document.addEventListener('test', null, testOptions);
|
|
|
document.removeEventListener('test', null, testOptions);
|
|
|
} catch (e) {
|
|
|
// ignore
|
|
|
}
|
|
|
return passive;
|
|
|
}
|
|
|
}, {
|
|
|
key: 'eventListenerOptions',
|
|
|
value: function eventListenerOptions() {
|
|
|
var options = this.props.useCapture;
|
|
|
|
|
|
if (this.isPassiveSupported()) {
|
|
|
options = {
|
|
|
useCapture: this.props.useCapture,
|
|
|
passive: true
|
|
|
};
|
|
|
}
|
|
|
return options;
|
|
|
}
|
|
|
|
|
|
// Set a defaut loader for all your `InfiniteScroll` components
|
|
|
|
|
|
}, {
|
|
|
key: 'setDefaultLoader',
|
|
|
value: function setDefaultLoader(loader) {
|
|
|
this.defaultLoader = loader;
|
|
|
}
|
|
|
}, {
|
|
|
key: 'detachMousewheelListener',
|
|
|
value: function detachMousewheelListener() {
|
|
|
var scrollEl = window;
|
|
|
if (this.props.useWindow === false) {
|
|
|
scrollEl = this.scrollComponent.parentNode;
|
|
|
}
|
|
|
|
|
|
scrollEl.removeEventListener('mousewheel', this.mousewheelListener, this.options ? this.options : this.props.useCapture);
|
|
|
}
|
|
|
}, {
|
|
|
key: 'detachScrollListener',
|
|
|
value: function detachScrollListener() {
|
|
|
var scrollEl = window;
|
|
|
if (this.props.useWindow === false) {
|
|
|
scrollEl = this.getParentElement(this.scrollComponent);
|
|
|
}
|
|
|
|
|
|
scrollEl.removeEventListener('scroll', this.scrollListener, this.options ? this.options : this.props.useCapture);
|
|
|
scrollEl.removeEventListener('resize', this.scrollListener, this.options ? this.options : this.props.useCapture);
|
|
|
}
|
|
|
}, {
|
|
|
key: 'getParentElement',
|
|
|
value: function getParentElement(el) {
|
|
|
var scrollParent = this.props.getScrollParent && this.props.getScrollParent();
|
|
|
if (scrollParent != null) {
|
|
|
return scrollParent;
|
|
|
}
|
|
|
return el && el.parentNode;
|
|
|
}
|
|
|
}, {
|
|
|
key: 'filterProps',
|
|
|
value: function filterProps(props) {
|
|
|
return props;
|
|
|
}
|
|
|
}, {
|
|
|
key: 'attachScrollListener',
|
|
|
value: function attachScrollListener() {
|
|
|
var parentElement = this.getParentElement(this.scrollComponent);
|
|
|
|
|
|
if (!this.props.hasMore || !parentElement) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var scrollEl = window;
|
|
|
if (this.props.useWindow === false) {
|
|
|
scrollEl = parentElement;
|
|
|
}
|
|
|
|
|
|
scrollEl.addEventListener('mousewheel', this.mousewheelListener, this.options ? this.options : this.props.useCapture);
|
|
|
scrollEl.addEventListener('scroll', this.scrollListener, this.options ? this.options : this.props.useCapture);
|
|
|
scrollEl.addEventListener('resize', this.scrollListener, this.options ? this.options : this.props.useCapture);
|
|
|
|
|
|
if (this.props.initialLoad) {
|
|
|
this.scrollListener();
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: 'mousewheelListener',
|
|
|
value: function mousewheelListener(e) {
|
|
|
// Prevents Chrome hangups
|
|
|
// See: https://stackoverflow.com/questions/47524205/random-high-content-download-time-in-chrome/47684257#47684257
|
|
|
if (e.deltaY === 1 && !this.isPassiveSupported()) {
|
|
|
e.preventDefault();
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: 'scrollListener',
|
|
|
value: function scrollListener() {
|
|
|
var el = this.scrollComponent;
|
|
|
var scrollEl = window;
|
|
|
var parentNode = this.getParentElement(el);
|
|
|
|
|
|
var offset = void 0;
|
|
|
if (this.props.useWindow) {
|
|
|
var doc = document.documentElement || document.body.parentNode || document.body;
|
|
|
var scrollTop = scrollEl.pageYOffset !== undefined ? scrollEl.pageYOffset : doc.scrollTop;
|
|
|
if (this.props.isReverse) {
|
|
|
offset = scrollTop;
|
|
|
} else {
|
|
|
offset = this.calculateOffset(el, scrollTop);
|
|
|
}
|
|
|
} else if (this.props.isReverse) {
|
|
|
offset = parentNode.scrollTop;
|
|
|
} else {
|
|
|
offset = el.scrollHeight - parentNode.scrollTop - parentNode.clientHeight;
|
|
|
}
|
|
|
|
|
|
// Here we make sure the element is visible as well as checking the offset
|
|
|
if (offset < Number(this.props.threshold) && el && el.offsetParent !== null) {
|
|
|
this.detachScrollListener();
|
|
|
this.beforeScrollHeight = parentNode.scrollHeight;
|
|
|
this.beforeScrollTop = parentNode.scrollTop;
|
|
|
// Call loadMore after detachScrollListener to allow for non-async loadMore functions
|
|
|
if (typeof this.props.loadMore === 'function') {
|
|
|
this.props.loadMore(this.pageLoaded += 1);
|
|
|
this.loadMore = true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: 'calculateOffset',
|
|
|
value: function calculateOffset(el, scrollTop) {
|
|
|
if (!el) {
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
return this.calculateTopPosition(el) + (el.offsetHeight - scrollTop - window.innerHeight);
|
|
|
}
|
|
|
}, {
|
|
|
key: 'calculateTopPosition',
|
|
|
value: function calculateTopPosition(el) {
|
|
|
if (!el) {
|
|
|
return 0;
|
|
|
}
|
|
|
return el.offsetTop + this.calculateTopPosition(el.offsetParent);
|
|
|
}
|
|
|
}, {
|
|
|
key: 'render',
|
|
|
value: function render() {
|
|
|
var _this2 = this;
|
|
|
|
|
|
var renderProps = this.filterProps(this.props);
|
|
|
|
|
|
var children = renderProps.children,
|
|
|
element = renderProps.element,
|
|
|
hasMore = renderProps.hasMore,
|
|
|
initialLoad = renderProps.initialLoad,
|
|
|
isReverse = renderProps.isReverse,
|
|
|
loader = renderProps.loader,
|
|
|
loadMore = renderProps.loadMore,
|
|
|
pageStart = renderProps.pageStart,
|
|
|
ref = renderProps.ref,
|
|
|
threshold = renderProps.threshold,
|
|
|
useCapture = renderProps.useCapture,
|
|
|
useWindow = renderProps.useWindow,
|
|
|
getScrollParent = renderProps.getScrollParent,
|
|
|
props = _objectWithoutProperties(renderProps, ['children', 'element', 'hasMore', 'initialLoad', 'isReverse', 'loader', 'loadMore', 'pageStart', 'ref', 'threshold', 'useCapture', 'useWindow', 'getScrollParent']);
|
|
|
|
|
|
props.ref = function (node) {
|
|
|
_this2.scrollComponent = node;
|
|
|
if (ref) {
|
|
|
ref(node);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
var childrenArray = [children];
|
|
|
if (hasMore) {
|
|
|
if (loader) {
|
|
|
isReverse ? childrenArray.unshift(loader) : childrenArray.push(loader);
|
|
|
} else if (this.defaultLoader) {
|
|
|
isReverse ? childrenArray.unshift(this.defaultLoader) : childrenArray.push(this.defaultLoader);
|
|
|
}
|
|
|
}
|
|
|
return _react2.default.createElement(element, props, childrenArray);
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
return InfiniteScroll;
|
|
|
}(_react.Component);
|
|
|
|
|
|
InfiniteScroll.propTypes = {
|
|
|
children: _propTypes2.default.node.isRequired,
|
|
|
element: _propTypes2.default.node,
|
|
|
hasMore: _propTypes2.default.bool,
|
|
|
initialLoad: _propTypes2.default.bool,
|
|
|
isReverse: _propTypes2.default.bool,
|
|
|
loader: _propTypes2.default.node,
|
|
|
loadMore: _propTypes2.default.func.isRequired,
|
|
|
pageStart: _propTypes2.default.number,
|
|
|
ref: _propTypes2.default.func,
|
|
|
getScrollParent: _propTypes2.default.func,
|
|
|
threshold: _propTypes2.default.number,
|
|
|
useCapture: _propTypes2.default.bool,
|
|
|
useWindow: _propTypes2.default.bool
|
|
|
};
|
|
|
InfiniteScroll.defaultProps = {
|
|
|
element: 'div',
|
|
|
hasMore: false,
|
|
|
initialLoad: true,
|
|
|
pageStart: 0,
|
|
|
ref: null,
|
|
|
threshold: 250,
|
|
|
useWindow: true,
|
|
|
isReverse: false,
|
|
|
useCapture: false,
|
|
|
loader: null,
|
|
|
getScrollParent: null
|
|
|
};
|
|
|
exports["default"] = InfiniteScroll;
|
|
|
module.exports = exports['default'];
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 26724:
|
|
|
/*!**************************************************************************************!*\
|
|
|
!*** ./node_modules/_react-infinite-scroller@1.2.4@react-infinite-scroller/index.js ***!
|
|
|
\**************************************************************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
module.exports = __webpack_require__(/*! ./dist/InfiniteScroll */ 51581)
|
|
|
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |