You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Shixuns__Detail__Reposit...

2516 lines
103 KiB

(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[215],{
/***/ "7ixt":
/*!**************************************************!*\
!*** ./node_modules/rc-tooltip/es/placements.js ***!
\**************************************************/
/*! exports provided: placements, default */
/*! exports used: placements */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return placements; });
var autoAdjustOverflow = {
adjustX: 1,
adjustY: 1
};
var targetOffset = [0, 0];
var placements = {
left: {
points: ['cr', 'cl'],
overflow: autoAdjustOverflow,
offset: [-4, 0],
targetOffset: targetOffset
},
right: {
points: ['cl', 'cr'],
overflow: autoAdjustOverflow,
offset: [4, 0],
targetOffset: targetOffset
},
top: {
points: ['bc', 'tc'],
overflow: autoAdjustOverflow,
offset: [0, -4],
targetOffset: targetOffset
},
bottom: {
points: ['tc', 'bc'],
overflow: autoAdjustOverflow,
offset: [0, 4],
targetOffset: targetOffset
},
topLeft: {
points: ['bl', 'tl'],
overflow: autoAdjustOverflow,
offset: [0, -4],
targetOffset: targetOffset
},
leftTop: {
points: ['tr', 'tl'],
overflow: autoAdjustOverflow,
offset: [-4, 0],
targetOffset: targetOffset
},
topRight: {
points: ['br', 'tr'],
overflow: autoAdjustOverflow,
offset: [0, -4],
targetOffset: targetOffset
},
rightTop: {
points: ['tl', 'tr'],
overflow: autoAdjustOverflow,
offset: [4, 0],
targetOffset: targetOffset
},
bottomRight: {
points: ['tr', 'br'],
overflow: autoAdjustOverflow,
offset: [0, 4],
targetOffset: targetOffset
},
rightBottom: {
points: ['bl', 'br'],
overflow: autoAdjustOverflow,
offset: [4, 0],
targetOffset: targetOffset
},
bottomLeft: {
points: ['tl', 'bl'],
overflow: autoAdjustOverflow,
offset: [0, 4],
targetOffset: targetOffset
},
leftBottom: {
points: ['br', 'bl'],
overflow: autoAdjustOverflow,
offset: [-4, 0],
targetOffset: targetOffset
}
};
/* unused harmony default export */ var _unused_webpack_default_export = (placements);
/***/ }),
/***/ "8j3D":
/*!**************************************************************************************!*\
!*** ./src/pages/Shixuns/Detail/Repository/components/SelectFilePathModal/index.tsx ***!
\**************************************************************************************/
/*! exports provided: default */
/*! exports used: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var antd_es_modal_style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! antd/es/modal/style */ "2qtc");
/* harmony import */ var antd_es_modal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/es/modal */ "kLXV");
/* harmony import */ var antd_es_input_style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd/es/input/style */ "5NDa");
/* harmony import */ var antd_es_input__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! antd/es/input */ "5rEg");
/* harmony import */ var antd_es_message_style__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd/es/message/style */ "miYZ");
/* harmony import */ var antd_es_message__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! antd/es/message */ "tsqr");
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */ "k1fw");
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator */ "9og8");
/* harmony import */ var antd_es_form_style__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! antd/es/form/style */ "y8nQ");
/* harmony import */ var antd_es_form__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! antd/es/form */ "Vl3Y");
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */ "tJVT");
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator */ "WmNS");
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_11__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react */ "cDcd");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_12__);
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! umi */ "Ty5D");
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! umi */ "9kvl");
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./index.less?modules */ "KVXO");
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_index_less_modules__WEBPACK_IMPORTED_MODULE_15__);
var SelectFilePathModal = function SelectFilePathModal(_ref) {
var shixunsDetail = _ref.shixunsDetail,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
dispatch = _ref.dispatch,
title = _ref.title,
_ref$pathList = _ref.pathList,
propsPathList = _ref$pathList === void 0 ? [] : _ref$pathList,
_ref$showInputPath = _ref.showInputPath,
showInputPath = _ref$showInputPath === void 0 ? false : _ref$showInputPath,
_ref$isMergeSelectFil = _ref.isMergeSelectFile,
isMergeSelectFile = _ref$isMergeSelectFil === void 0 ? false : _ref$isMergeSelectFil,
_ref$onFinish = _ref.onFinish,
onFinish = _ref$onFinish === void 0 ? function () {} : _ref$onFinish;
var _Form$useForm = antd_es_form__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"].useForm(),
_Form$useForm2 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_10__[/* default */ "a"])(_Form$useForm, 1),
form = _Form$useForm2[0];
var params = Object(umi__WEBPACK_IMPORTED_MODULE_13__[/* useParams */ "i"])();
var location = Object(umi__WEBPACK_IMPORTED_MODULE_13__[/* useLocation */ "h"])();
var isRepository = Object(react__WEBPACK_IMPORTED_MODULE_12__["useRef"])();
var _useState = Object(react__WEBPACK_IMPORTED_MODULE_12__["useState"])(''),
_useState2 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_10__[/* default */ "a"])(_useState, 2),
selectPath = _useState2[0],
setSelectPath = _useState2[1];
var _useState3 = Object(react__WEBPACK_IMPORTED_MODULE_12__["useState"])(''),
_useState4 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_10__[/* default */ "a"])(_useState3, 2),
originPath = _useState4[0],
setOriginPath = _useState4[1];
var _useState5 = Object(react__WEBPACK_IMPORTED_MODULE_12__["useState"])([]),
_useState6 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_10__[/* default */ "a"])(_useState5, 2),
mainPathList = _useState6[0],
setMainPathList = _useState6[1];
var _useState7 = Object(react__WEBPACK_IMPORTED_MODULE_12__["useState"])([]),
_useState8 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_10__[/* default */ "a"])(_useState7, 2),
treeList = _useState8[0],
setTreeList = _useState8[1];
Object(react__WEBPACK_IMPORTED_MODULE_12__["useEffect"])(function () {
var _location$pathname, _location$pathname$sp;
isRepository.current = ((_location$pathname = location.pathname) === null || _location$pathname === void 0 ? void 0 : (_location$pathname$sp = _location$pathname.split('/')) === null || _location$pathname$sp === void 0 ? void 0 : _location$pathname$sp[3]) === "repository";
}, []);
Object(react__WEBPACK_IMPORTED_MODULE_12__["useEffect"])(function () {
if (shixunsDetail.actionTabs.key !== 'Repository-SelectFilePath') {
return;
}
var path = propsPathList.join('/');
var arr = [];
propsPathList.map(function (item, index) {
if (index === 0) {
arr.push({
val: "根目录",
path: ""
}, {
val: "/".concat(item),
path: path
});
} else {
arr.push({
val: "/".concat(item),
path: path
});
}
});
setMainPathList(arr);
setSelectPath(path);
setOriginPath(path);
handleGetPathData(path);
}, [shixunsDetail.actionTabs.key]);
var handleGetPathData = /*#__PURE__*/function () {
var _ref2 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"])( /*#__PURE__*/_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_11___default.a.mark(function _callee(path) {
var res;
return _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_11___default.a.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return dispatch({
type: isRepository.current ? 'shixunsDetail/getRepository' : 'shixunsDetail/getSecretRepository',
payload: {
id: params.id,
path: path
}
});
case 2:
res = _context.sent;
if (res) {
setTreeList(res.trees || []);
}
case 4:
case "end":
return _context.stop();
}
}
}, _callee);
}));
return function handleGetPathData(_x) {
return _ref2.apply(this, arguments);
};
}();
var handleClickTree = function handleClickTree(item) {
var newPath = selectPath;
if (item.type === "tree") {
mainPathList.length ? mainPathList.push({
val: "/".concat(item.name),
path: item.name
}) : mainPathList.push({
val: "根目录",
path: ""
}, {
val: "/".concat(item.name),
path: item.name
});
setMainPathList(mainPathList);
newPath = selectPath ? "".concat(selectPath, "/").concat(item.name) : item.name;
setSelectPath(newPath);
}
handleGetPathData(newPath);
};
var handleClickMainPath = function handleClickMainPath(item, index) {
var currentPathList = mainPathList.filter(function (_, key) {
return key <= index;
});
setMainPathList(currentPathList); // 排除 ”根目录“,将选中的路径连接,去掉第一个字符串 “/”,获取绝对路径
var currentPath = currentPathList.filter(function (_, key) {
return key !== 0;
}).map(function (item) {
return item.val;
}).join('').substr(1);
setSelectPath(currentPath);
handleGetPathData(currentPath);
};
var handleOk = /*#__PURE__*/function () {
var _ref3 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"])( /*#__PURE__*/_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_11___default.a.mark(function _callee2() {
var values, path, res;
return _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_11___default.a.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
values = form === null || form === void 0 ? void 0 : form.getFieldsValue();
path = selectPath ? "".concat(selectPath).concat(values !== null && values !== void 0 && values.name ? "/".concat(values === null || values === void 0 ? void 0 : values.name) : '') : values === null || values === void 0 ? void 0 : values.name;
if (!isMergeSelectFile) {
_context2.next = 6;
break;
}
onFinish(path);
handleCancel();
return _context2.abrupt("return");
case 6:
if (!showInputPath) {
_context2.next = 16;
break;
}
_context2.next = 9;
return form.validateFields();
case 9:
_context2.next = 11;
return dispatch({
type: 'shixunsDetail/uploadGitFolder',
payload: Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])({}, {
id: params.id,
path: path
}), isRepository.current ? {} : {
secret_repository: true
})
});
case 11:
res = _context2.sent;
onFinish(originPath);
if (res.status === 0) {
antd_es_message__WEBPACK_IMPORTED_MODULE_5__[/* default */ "b"].info('新建成功');
}
_context2.next = 18;
break;
case 16:
onFinish(path);
antd_es_message__WEBPACK_IMPORTED_MODULE_5__[/* default */ "b"].success("选择文件目录成功");
case 18:
handleCancel();
case 19:
case "end":
return _context2.stop();
}
}
}, _callee2);
}));
return function handleOk() {
return _ref3.apply(this, arguments);
};
}();
var handleCancel = function handleCancel() {
dispatch({
type: 'shixunsDetail/setActionTabs',
payload: {}
});
form.resetFields();
};
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement(antd_es_modal__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"], {
centered: true,
title: title || "新建文件夹",
closable: false,
keyboard: false,
visible: shixunsDetail.actionTabs.key === 'Repository-SelectFilePath',
onOk: handleOk,
onCancel: handleCancel
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_15___default.a.wrap
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_15___default.a.content
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_15___default.a.mainPathWrap
}, !!(mainPathList !== null && mainPathList !== void 0 && mainPathList.length) && mainPathList.map(function (item, index) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("a", {
key: index,
onClick: function onClick() {
return handleClickMainPath(item, index);
}
}, item.val);
})), !!(treeList !== null && treeList !== void 0 && treeList.length) && treeList.map(function (item, index) {
return item.type === "tree" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("a", {
key: index,
onClick: function onClick() {
return handleClickTree(item);
}
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("i", {
className: "iconfont icon-wenjianjia ".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_15___default.a.colorBlue)
}), item.name);
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("label", {
className: "mt5"
}, "\u9009\u4E2D\u7684\u65B0\u5EFA\u6587\u4EF6\u5939\u76EE\u5F55\uFF1A"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
className: "mt5 mb5"
}, selectPath), showInputPath && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement(antd_es_form__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"], {
form: form,
scrollToFirstError: true,
className: "mt20"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement(antd_es_form__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"].Item, {
name: "name",
rules: [{
required: true,
message: '请输入名称'
}, {
whitespace: true,
message: '请勿输入空格'
}]
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement(antd_es_input__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"], {
placeholder: "\u8BF7\u8F93\u5165\u65B0\u6587\u4EF6\u5939\u540D/\u5B50\u6587\u4EF6\u5939\u540D\u3002\uFF08\u5982\uFF1Asrc/step1\uFF09"
})))));
};
/* harmony default export */ __webpack_exports__["a"] = (Object(umi__WEBPACK_IMPORTED_MODULE_14__[/* connect */ "a"])(function (_ref4) {
var shixunsDetail = _ref4.shixunsDetail,
loading = _ref4.loading,
globalSetting = _ref4.globalSetting;
return {
shixunsDetail: shixunsDetail,
globalSetting: globalSetting,
loading: loading.models.index
};
})(SelectFilePathModal));
/***/ }),
/***/ "9ZNV":
/*!**********************************************!*\
!*** ./src/components/FixedButton/index.tsx ***!
\**********************************************/
/*! exports provided: FixedButton */
/*! exports used: FixedButton */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FixedButton; });
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends */ "0Owb");
/* harmony import */ var antd_es_button_style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/es/button/style */ "+L6B");
/* harmony import */ var antd_es_button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd/es/button */ "2/Rp");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "cDcd");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./index.less?modules */ "UUDw");
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_index_less_modules__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! classnames */ "TSYQ");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_5__);
var FixedButton = function FixedButton(_ref) {
var _ref$cancelText = _ref.cancelText,
cancelText = _ref$cancelText === void 0 ? '取消' : _ref$cancelText,
_ref$okText = _ref.okText,
okText = _ref$okText === void 0 ? '确定' : _ref$okText,
_ref$loading = _ref.loading,
loading = _ref$loading === void 0 ? false : _ref$loading,
_ref$hasOkBtn = _ref.hasOkBtn,
hasOkBtn = _ref$hasOkBtn === void 0 ? true : _ref$hasOkBtn,
_ref$okButtonProps = _ref.okButtonProps,
okButtonProps = _ref$okButtonProps === void 0 ? {} : _ref$okButtonProps,
_ref$onCancel = _ref.onCancel,
onCancel = _ref$onCancel === void 0 ? function () {} : _ref$onCancel,
_ref$onOk = _ref.onOk,
onOk = _ref$onOk === void 0 ? function () {} : _ref$onOk,
_ref$className = _ref.className,
className = _ref$className === void 0 ? '' : _ref$className;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: classnames__WEBPACK_IMPORTED_MODULE_5___default()(_index_less_modules__WEBPACK_IMPORTED_MODULE_4___default.a.buttonFixed, className)
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_4___default.a.buttonWrap
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(antd_es_button__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"], {
size: "large",
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_4___default.a.button, " mr20"),
onClick: onCancel
}, cancelText), hasOkBtn && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(antd_es_button__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"], Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({
size: "large",
type: "primary",
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_4___default.a.button, " mr20"),
loading: loading,
onClick: onOk
}, okButtonProps), okText)));
};
/***/ }),
/***/ "EltS":
/*!***************************************************************************!*\
!*** ./src/pages/Shixuns/Detail/Repository/UploadFile/index.less?modules ***!
\***************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
module.exports = {"bg":"bg___1gNTl","wrap":"wrap___1HQ7F","title":"title___rglue","path":"path___1PX8G","colorBlue":"colorBlue___2CKCu"};
/***/ }),
/***/ "GfqC":
/*!********************************************************!*\
!*** ./node_modules/rc-upload/es/index.js + 6 modules ***!
\********************************************************/
/*! exports provided: default */
/*! exports used: default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with external "window.React" (<- Module is not an ECMAScript module) */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXTERNAL MODULE: external "window.React"
var external_window_React_ = __webpack_require__("cDcd");
var external_window_React_default = /*#__PURE__*/__webpack_require__.n(external_window_React_);
// EXTERNAL MODULE: ./node_modules/classnames/index.js
var classnames = __webpack_require__("TSYQ");
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
// CONCATENATED MODULE: ./node_modules/rc-upload/es/request.js
function getError(option, xhr) {
var msg = 'cannot ' + option.method + ' ' + option.action + ' ' + xhr.status + '\'';
var err = new Error(msg);
err.status = xhr.status;
err.method = option.method;
err.url = option.action;
return err;
}
function getBody(xhr) {
var text = xhr.responseText || xhr.response;
if (!text) {
return text;
}
try {
return JSON.parse(text);
} catch (e) {
return text;
}
}
// option {
// onProgress: (event: { percent: number }): void,
// onError: (event: Error, body?: Object): void,
// onSuccess: (body: Object): void,
// data: Object,
// filename: String,
// file: File,
// withCredentials: Boolean,
// action: String,
// headers: Object,
// }
function upload(option) {
// eslint-disable-next-line no-undef
var xhr = new XMLHttpRequest();
if (option.onProgress && xhr.upload) {
xhr.upload.onprogress = function progress(e) {
if (e.total > 0) {
e.percent = e.loaded / e.total * 100;
}
option.onProgress(e);
};
}
// eslint-disable-next-line no-undef
var formData = new FormData();
if (option.data) {
Object.keys(option.data).forEach(function (key) {
var value = option.data[key];
// support key-value array data
if (Array.isArray(value)) {
value.forEach(function (item) {
// { list: [ 11, 22 ] }
// formData.append('list[]', 11);
formData.append(key + '[]', item);
});
return;
}
formData.append(key, option.data[key]);
});
}
// eslint-disable-next-line no-undef
if (option.file instanceof Blob) {
formData.append(option.filename, option.file, option.file.name);
} else {
formData.append(option.filename, option.file);
}
xhr.onerror = function error(e) {
option.onError(e);
};
xhr.onload = function onload() {
// allow success when 2xx status
// see https://github.com/react-component/upload/issues/34
if (xhr.status < 200 || xhr.status >= 300) {
return option.onError(getError(option, xhr), getBody(xhr));
}
return option.onSuccess(getBody(xhr), xhr);
};
xhr.open(option.method, option.action, true);
// Has to be after `.open()`. See https://github.com/enyo/dropzone/issues/179
if (option.withCredentials && 'withCredentials' in xhr) {
xhr.withCredentials = true;
}
var headers = option.headers || {};
// when set headers['X-Requested-With'] = null , can close default XHR header
// see https://github.com/react-component/upload/issues/33
if (headers['X-Requested-With'] !== null) {
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
}
Object.keys(headers).forEach(function (h) {
if (headers[h] !== null) {
xhr.setRequestHeader(h, headers[h]);
}
});
xhr.send(formData);
return {
abort: function abort() {
xhr.abort();
}
};
}
// CONCATENATED MODULE: ./node_modules/rc-upload/es/uid.js
var now = +new Date();
var index = 0;
function uid_uid() {
return "rc-upload-" + now + "-" + ++index;
}
// CONCATENATED MODULE: ./node_modules/rc-upload/es/attr-accept.js
function endsWith(str, suffix) {
return str.indexOf(suffix, str.length - suffix.length) !== -1;
}
/* harmony default export */ var attr_accept = (function (file, acceptedFiles) {
if (file && acceptedFiles) {
var acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(',');
var fileName = file.name || '';
var mimeType = file.type || '';
var baseMimeType = mimeType.replace(/\/.*$/, '');
return acceptedFilesArray.some(function (type) {
var validType = type.trim();
if (validType.charAt(0) === '.') {
return endsWith(fileName.toLowerCase(), validType.toLowerCase());
} else if (/\/\*$/.test(validType)) {
// This is something like a image/* mime type
return baseMimeType === validType.replace(/\/.*$/, '');
}
return mimeType === validType;
});
}
return true;
});
// CONCATENATED MODULE: ./node_modules/rc-upload/es/traverseFileTree.js
function loopFiles(item, callback) {
var dirReader = item.createReader();
var fileList = [];
function sequence() {
dirReader.readEntries(function (entries) {
var entryList = Array.prototype.slice.apply(entries);
fileList = fileList.concat(entryList);
// Check if all the file has been viewed
var isFinished = !entryList.length;
if (isFinished) {
callback(fileList);
} else {
sequence();
}
});
}
sequence();
}
var traverseFileTree = function traverseFileTree(files, callback, isAccepted) {
var _traverseFileTree = function _traverseFileTree(item, path) {
path = path || '';
if (item.isFile) {
item.file(function (file) {
if (isAccepted(file)) {
// https://github.com/ant-design/ant-design/issues/16426
if (item.fullPath && !file.webkitRelativePath) {
Object.defineProperties(file, {
webkitRelativePath: {
writable: true
}
});
file.webkitRelativePath = item.fullPath.replace(/^\//, '');
Object.defineProperties(file, {
webkitRelativePath: {
writable: false
}
});
}
callback([file]);
}
});
} else if (item.isDirectory) {
loopFiles(item, function (entries) {
entries.forEach(function (entryItem) {
_traverseFileTree(entryItem, '' + path + item.name + '/');
});
});
}
};
files.forEach(function (file) {
_traverseFileTree(file.webkitGetAsEntry());
});
};
/* harmony default export */ var es_traverseFileTree = (traverseFileTree);
// CONCATENATED MODULE: ./node_modules/rc-upload/es/AjaxUploader.js
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
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; }; }();
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
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; }
/* eslint react/no-is-mounted:0,react/sort-comp:0,react/prop-types:0 */
var dataOrAriaAttributeProps = function dataOrAriaAttributeProps(props) {
return Object.keys(props).reduce(function (acc, key) {
if (key.substr(0, 5) === 'data-' || key.substr(0, 5) === 'aria-' || key === 'role') {
acc[key] = props[key];
}
return acc;
}, {});
};
var AjaxUploader_AjaxUploader = function (_Component) {
_inherits(AjaxUploader, _Component);
function AjaxUploader() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, AjaxUploader);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = AjaxUploader.__proto__ || Object.getPrototypeOf(AjaxUploader)).call.apply(_ref, [this].concat(args))), _this), _this.state = { uid: uid_uid() }, _this.reqs = {}, _this.onChange = function (e) {
var files = e.target.files;
_this.uploadFiles(files);
_this.reset();
}, _this.onClick = function (e) {
var el = _this.fileInput;
if (!el) {
return;
}
var _this$props = _this.props,
children = _this$props.children,
onClick = _this$props.onClick;
if (children && children.type === 'button') {
el.parentNode.focus();
el.parentNode.querySelector('button').blur();
}
el.click();
if (onClick) {
onClick(e);
}
}, _this.onKeyDown = function (e) {
if (e.key === 'Enter') {
_this.onClick();
}
}, _this.onFileDrop = function (e) {
var multiple = _this.props.multiple;
e.preventDefault();
if (e.type === 'dragover') {
return;
}
if (_this.props.directory) {
es_traverseFileTree(Array.prototype.slice.call(e.dataTransfer.items), _this.uploadFiles, function (_file) {
return attr_accept(_file, _this.props.accept);
});
} else {
var files = Array.prototype.slice.call(e.dataTransfer.files).filter(function (file) {
return attr_accept(file, _this.props.accept);
});
if (multiple === false) {
files = files.slice(0, 1);
}
_this.uploadFiles(files);
}
}, _this.uploadFiles = function (files) {
var postFiles = Array.prototype.slice.call(files);
postFiles.map(function (file) {
file.uid = uid_uid();
return file;
}).forEach(function (file) {
_this.upload(file, postFiles);
});
}, _this.saveFileInput = function (node) {
_this.fileInput = node;
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(AjaxUploader, [{
key: 'componentDidMount',
value: function componentDidMount() {
this._isMounted = true;
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this._isMounted = false;
this.abort();
}
}, {
key: 'upload',
value: function upload(file, fileList) {
var _this2 = this;
var props = this.props;
if (!props.beforeUpload) {
// always async in case use react state to keep fileList
return setTimeout(function () {
return _this2.post(file);
}, 0);
}
var before = props.beforeUpload(file, fileList);
if (before && before.then) {
before.then(function (processedFile) {
var processedFileType = Object.prototype.toString.call(processedFile);
if (processedFileType === '[object File]' || processedFileType === '[object Blob]') {
return _this2.post(processedFile);
}
return _this2.post(file);
})['catch'](function (e) {
// eslint-disable-next-line no-console
console.log(e);
});
} else if (before !== false) {
setTimeout(function () {
return _this2.post(file);
}, 0);
}
return undefined;
}
}, {
key: 'post',
value: function post(file) {
var _this3 = this;
if (!this._isMounted) {
return;
}
var props = this.props;
var onStart = props.onStart,
onProgress = props.onProgress,
_props$transformFile = props.transformFile,
transformFile = _props$transformFile === undefined ? function (originFile) {
return originFile;
} : _props$transformFile;
new Promise(function (resolve) {
var action = props.action;
if (typeof action === 'function') {
action = action(file);
}
return resolve(action);
}).then(function (action) {
var uid = file.uid;
var request = props.customRequest || upload;
var transform = Promise.resolve(transformFile(file)).then(function (transformedFile) {
var data = props.data;
if (typeof data === 'function') {
data = data(transformedFile);
}
return Promise.all([transformedFile, data]);
})['catch'](function (e) {
console.error(e); // eslint-disable-line no-console
});
transform.then(function (_ref2) {
var _ref3 = _slicedToArray(_ref2, 2),
transformedFile = _ref3[0],
data = _ref3[1];
var requestOption = {
action: action,
filename: props.name,
data: data,
file: transformedFile,
headers: props.headers,
withCredentials: props.withCredentials,
method: props.method || 'post',
onProgress: onProgress ? function (e) {
onProgress(e, file);
} : null,
onSuccess: function onSuccess(ret, xhr) {
delete _this3.reqs[uid];
props.onSuccess(ret, file, xhr);
},
onError: function onError(err, ret) {
delete _this3.reqs[uid];
props.onError(err, ret, file);
}
};
onStart(file);
_this3.reqs[uid] = request(requestOption);
});
});
}
}, {
key: 'reset',
value: function reset() {
this.setState({
uid: uid_uid()
});
}
}, {
key: 'abort',
value: function abort(file) {
var reqs = this.reqs;
if (file) {
var uid = file;
if (file && file.uid) {
uid = file.uid;
}
if (reqs[uid] && reqs[uid].abort) {
reqs[uid].abort();
}
delete reqs[uid];
} else {
Object.keys(reqs).forEach(function (uid) {
if (reqs[uid] && reqs[uid].abort) {
reqs[uid].abort();
}
delete reqs[uid];
});
}
}
}, {
key: 'render',
value: function render() {
var _classNames;
var _props = this.props,
Tag = _props.component,
prefixCls = _props.prefixCls,
className = _props.className,
disabled = _props.disabled,
id = _props.id,
style = _props.style,
multiple = _props.multiple,
accept = _props.accept,
children = _props.children,
directory = _props.directory,
openFileDialogOnClick = _props.openFileDialogOnClick,
onMouseEnter = _props.onMouseEnter,
onMouseLeave = _props.onMouseLeave,
otherProps = _objectWithoutProperties(_props, ['component', 'prefixCls', 'className', 'disabled', 'id', 'style', 'multiple', 'accept', 'children', 'directory', 'openFileDialogOnClick', 'onMouseEnter', 'onMouseLeave']);
var cls = classnames_default()((_classNames = {}, _defineProperty(_classNames, prefixCls, true), _defineProperty(_classNames, prefixCls + '-disabled', disabled), _defineProperty(_classNames, className, className), _classNames));
var events = disabled ? {} : {
onClick: openFileDialogOnClick ? this.onClick : function () {},
onKeyDown: openFileDialogOnClick ? this.onKeyDown : function () {},
onMouseEnter: onMouseEnter,
onMouseLeave: onMouseLeave,
onDrop: this.onFileDrop,
onDragOver: this.onFileDrop,
tabIndex: '0'
};
return external_window_React_default.a.createElement(
Tag,
_extends({}, events, {
className: cls,
role: 'button',
style: style
}),
external_window_React_default.a.createElement('input', _extends({}, dataOrAriaAttributeProps(otherProps), {
id: id,
type: 'file',
ref: this.saveFileInput,
onClick: function onClick(e) {
return e.stopPropagation();
} // https://github.com/ant-design/ant-design/issues/19948
, key: this.state.uid,
style: { display: 'none' },
accept: accept,
directory: directory ? 'directory' : null,
webkitdirectory: directory ? 'webkitdirectory' : null,
multiple: multiple,
onChange: this.onChange
})),
children
);
}
}]);
return AjaxUploader;
}(external_window_React_["Component"]);
/* harmony default export */ var es_AjaxUploader = (AjaxUploader_AjaxUploader);
// CONCATENATED MODULE: ./node_modules/rc-upload/es/Upload.js
var Upload_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var Upload_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; }; }();
function Upload_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function Upload_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 Upload_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; }
/* eslint react/prop-types:0 */
function empty() {}
var Upload_Upload = function (_Component) {
Upload_inherits(Upload, _Component);
function Upload() {
var _ref;
var _temp, _this, _ret;
Upload_classCallCheck(this, Upload);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = Upload_possibleConstructorReturn(this, (_ref = Upload.__proto__ || Object.getPrototypeOf(Upload)).call.apply(_ref, [this].concat(args))), _this), _this.saveUploader = function (node) {
_this.uploader = node;
}, _temp), Upload_possibleConstructorReturn(_this, _ret);
}
Upload_createClass(Upload, [{
key: 'abort',
value: function abort(file) {
this.uploader.abort(file);
}
}, {
key: 'render',
value: function render() {
return external_window_React_default.a.createElement(es_AjaxUploader, Upload_extends({}, this.props, { ref: this.saveUploader }));
}
}]);
return Upload;
}(external_window_React_["Component"]);
Upload_Upload.defaultProps = {
component: 'span',
prefixCls: 'rc-upload',
data: {},
headers: {},
name: 'file',
multipart: false,
onStart: empty,
onError: empty,
onSuccess: empty,
multiple: false,
beforeUpload: null,
customRequest: null,
withCredentials: false,
openFileDialogOnClick: true
};
/* harmony default export */ var es_Upload = (Upload_Upload);
// CONCATENATED MODULE: ./node_modules/rc-upload/es/index.js
// export this package's api
/* harmony default export */ var es = __webpack_exports__["a"] = (es_Upload);
/***/ }),
/***/ "Gytx":
/*!********************************************!*\
!*** ./node_modules/shallowequal/index.js ***!
\********************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
/***/ (function(module, exports) {
//
module.exports = function shallowEqual(objA, objB, compare, compareContext) {
var ret = compare ? compare.call(compareContext, objA, objB) : void 0;
if (ret !== void 0) {
return !!ret;
}
if (objA === objB) {
return true;
}
if (typeof objA !== "object" || !objA || typeof objB !== "object" || !objB) {
return false;
}
var keysA = Object.keys(objA);
var keysB = Object.keys(objB);
if (keysA.length !== keysB.length) {
return false;
}
var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
// Test for A's keys different from B.
for (var idx = 0; idx < keysA.length; idx++) {
var key = keysA[idx];
if (!bHasOwnProperty(key)) {
return false;
}
var valueA = objA[key];
var valueB = objB[key];
ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;
if (ret === false || (ret === void 0 && valueA !== valueB)) {
return false;
}
}
return true;
};
/***/ }),
/***/ "KVXO":
/*!***********************************************************************************************!*\
!*** ./src/pages/Shixuns/Detail/Repository/components/SelectFilePathModal/index.less?modules ***!
\***********************************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
module.exports = {"wrap":"wrap___1VfLE","content":"content___20B4M","mainPathWrap":"mainPathWrap___3qDeg","colorBlue":"colorBlue___2ZjUq"};
/***/ }),
/***/ "OLES":
/*!*********************************************************!*\
!*** ./node_modules/rc-tooltip/es/index.js + 2 modules ***!
\*********************************************************/
/*! exports provided: default */
/*! exports used: default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/typeof.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tooltip/es/placements.js because of ./node_modules/antd/es/tooltip/placements.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-trigger/es/index.js */
/*! ModuleConcatenation bailout: Cannot concat with external "window.React" (<- Module is not an ECMAScript module) */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
var esm_typeof = __webpack_require__("U8pU");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
var objectSpread2 = __webpack_require__("VTBJ");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
var objectWithoutProperties = __webpack_require__("Ff2n");
// EXTERNAL MODULE: external "window.React"
var external_window_React_ = __webpack_require__("cDcd");
// EXTERNAL MODULE: ./node_modules/rc-trigger/es/index.js + 5 modules
var es = __webpack_require__("uciX");
// EXTERNAL MODULE: ./node_modules/rc-tooltip/es/placements.js
var placements = __webpack_require__("7ixt");
// CONCATENATED MODULE: ./node_modules/rc-tooltip/es/Content.js
var Content_Content = function Content(props) {
var overlay = props.overlay,
prefixCls = props.prefixCls,
id = props.id,
overlayInnerStyle = props.overlayInnerStyle;
return external_window_React_["createElement"]("div", {
className: "".concat(prefixCls, "-inner"),
id: id,
role: "tooltip",
style: overlayInnerStyle
}, typeof overlay === 'function' ? overlay() : overlay);
};
/* harmony default export */ var es_Content = (Content_Content);
// CONCATENATED MODULE: ./node_modules/rc-tooltip/es/Tooltip.js
var Tooltip_Tooltip = function Tooltip(props, ref) {
var overlayClassName = props.overlayClassName,
_props$trigger = props.trigger,
trigger = _props$trigger === void 0 ? ['hover'] : _props$trigger,
_props$mouseEnterDela = props.mouseEnterDelay,
mouseEnterDelay = _props$mouseEnterDela === void 0 ? 0 : _props$mouseEnterDela,
_props$mouseLeaveDela = props.mouseLeaveDelay,
mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0.1 : _props$mouseLeaveDela,
overlayStyle = props.overlayStyle,
_props$prefixCls = props.prefixCls,
prefixCls = _props$prefixCls === void 0 ? 'rc-tooltip' : _props$prefixCls,
children = props.children,
onVisibleChange = props.onVisibleChange,
afterVisibleChange = props.afterVisibleChange,
transitionName = props.transitionName,
animation = props.animation,
_props$placement = props.placement,
placement = _props$placement === void 0 ? 'right' : _props$placement,
_props$align = props.align,
align = _props$align === void 0 ? {} : _props$align,
_props$destroyTooltip = props.destroyTooltipOnHide,
destroyTooltipOnHide = _props$destroyTooltip === void 0 ? false : _props$destroyTooltip,
defaultVisible = props.defaultVisible,
getTooltipContainer = props.getTooltipContainer,
overlayInnerStyle = props.overlayInnerStyle,
restProps = Object(objectWithoutProperties["a" /* default */])(props, ["overlayClassName", "trigger", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "prefixCls", "children", "onVisibleChange", "afterVisibleChange", "transitionName", "animation", "placement", "align", "destroyTooltipOnHide", "defaultVisible", "getTooltipContainer", "overlayInnerStyle"]);
var domRef = Object(external_window_React_["useRef"])(null);
Object(external_window_React_["useImperativeHandle"])(ref, function () {
return domRef.current;
});
var extraProps = Object(objectSpread2["a" /* default */])({}, restProps);
if ('visible' in props) {
extraProps.popupVisible = props.visible;
}
var getPopupElement = function getPopupElement() {
var _props$arrowContent = props.arrowContent,
arrowContent = _props$arrowContent === void 0 ? null : _props$arrowContent,
overlay = props.overlay,
id = props.id;
return [external_window_React_["createElement"]("div", {
className: "".concat(prefixCls, "-arrow"),
key: "arrow"
}, arrowContent), external_window_React_["createElement"](es_Content, {
key: "content",
prefixCls: prefixCls,
id: id,
overlay: overlay,
overlayInnerStyle: overlayInnerStyle
})];
};
var destroyTooltip = false;
var autoDestroy = false;
if (typeof destroyTooltipOnHide === 'boolean') {
destroyTooltip = destroyTooltipOnHide;
} else if (destroyTooltipOnHide && Object(esm_typeof["a" /* default */])(destroyTooltipOnHide) === 'object') {
var keepParent = destroyTooltipOnHide.keepParent;
destroyTooltip = keepParent === true;
autoDestroy = keepParent === false;
}
return external_window_React_["createElement"](es["a" /* default */], Object.assign({
popupClassName: overlayClassName,
prefixCls: prefixCls,
popup: getPopupElement,
action: trigger,
builtinPlacements: placements["a" /* placements */],
popupPlacement: placement,
ref: domRef,
popupAlign: align,
getPopupContainer: getTooltipContainer,
onPopupVisibleChange: onVisibleChange,
afterPopupVisibleChange: afterVisibleChange,
popupTransitionName: transitionName,
popupAnimation: animation,
defaultPopupVisible: defaultVisible,
destroyPopupOnHide: destroyTooltip,
autoDestroy: autoDestroy,
mouseLeaveDelay: mouseLeaveDelay,
popupStyle: overlayStyle,
mouseEnterDelay: mouseEnterDelay
}, extraProps), children);
};
/* harmony default export */ var es_Tooltip = (Object(external_window_React_["forwardRef"])(Tooltip_Tooltip));
// CONCATENATED MODULE: ./node_modules/rc-tooltip/es/index.js
/* harmony default export */ var rc_tooltip_es = __webpack_exports__["a"] = (es_Tooltip);
/***/ }),
/***/ "UUDw":
/*!*******************************************************!*\
!*** ./src/components/FixedButton/index.less?modules ***!
\*******************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
module.exports = {"buttonFixed":"buttonFixed___2zLVJ","button":"button___-JgFH","buttonWrap":"buttonWrap___aZhhk"};
/***/ }),
/***/ "Y1PL":
/*!**********************************************************!*\
!*** ./node_modules/rc-textarea/es/index.js + 7 modules ***!
\**********************************************************/
/*! exports provided: ResizableTextArea, default */
/*! all exports used */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/extends.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Children/toArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/findDOMNode.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/omit.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/ref.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/warning.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/shallowequal/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with external "window.React" (<- Module is not an ECMAScript module) */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, "ResizableTextArea", function() { return /* reexport */ es_ResizableTextArea; });
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__("wx14");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
var classCallCheck = __webpack_require__("1OyB");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
var createClass = __webpack_require__("vuIU");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
var inherits = __webpack_require__("Ji7U");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createSuper.js + 1 modules
var createSuper = __webpack_require__("LK+K");
// EXTERNAL MODULE: external "window.React"
var external_window_React_ = __webpack_require__("cDcd");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
var objectSpread2 = __webpack_require__("VTBJ");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
var defineProperty = __webpack_require__("rePB");
// EXTERNAL MODULE: ./node_modules/rc-util/es/Children/toArray.js
var toArray = __webpack_require__("Zm9Q");
// EXTERNAL MODULE: ./node_modules/rc-util/es/warning.js
var warning = __webpack_require__("Kwbf");
// EXTERNAL MODULE: ./node_modules/rc-util/es/ref.js
var ref = __webpack_require__("c+Xe");
// EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/findDOMNode.js
var findDOMNode = __webpack_require__("m+aA");
// EXTERNAL MODULE: ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js
var ResizeObserver_es = __webpack_require__("bdgK");
// CONCATENATED MODULE: ./node_modules/rc-textarea/node_modules/rc-resize-observer/es/utils/observerUtil.js
// =============================== Const ===============================
var elementListeners = new Map();
function observerUtil_onResize(entities) {
entities.forEach(function (entity) {
var _elementListeners$get;
var target = entity.target;
(_elementListeners$get = elementListeners.get(target)) === null || _elementListeners$get === void 0 ? void 0 : _elementListeners$get.forEach(function (listener) {
return listener(target);
});
});
} // Note: ResizeObserver polyfill not support option to measure border-box resize
var resizeObserver = new ResizeObserver_es["default"](observerUtil_onResize); // Dev env only
var _el = false ? undefined : null; // eslint-disable-line
var _rs = false ? undefined : null; // eslint-disable-line
// ============================== Observe ==============================
function observe(element, callback) {
if (!elementListeners.has(element)) {
elementListeners.set(element, new Set());
resizeObserver.observe(element);
}
elementListeners.get(element).add(callback);
}
function unobserve(element, callback) {
if (elementListeners.has(element)) {
elementListeners.get(element).delete(callback);
if (!elementListeners.get(element).size) {
resizeObserver.unobserve(element);
elementListeners.delete(element);
}
}
}
// CONCATENATED MODULE: ./node_modules/rc-textarea/node_modules/rc-resize-observer/es/SingleObserver/DomWrapper.js
/**
* Fallback to findDOMNode if origin ref do not provide any dom element
*/
var DomWrapper_DomWrapper = /*#__PURE__*/function (_React$Component) {
Object(inherits["a" /* default */])(DomWrapper, _React$Component);
var _super = Object(createSuper["a" /* default */])(DomWrapper);
function DomWrapper() {
Object(classCallCheck["a" /* default */])(this, DomWrapper);
return _super.apply(this, arguments);
}
Object(createClass["a" /* default */])(DomWrapper, [{
key: "render",
value: function render() {
return this.props.children;
}
}]);
return DomWrapper;
}(external_window_React_["Component"]);
// CONCATENATED MODULE: ./node_modules/rc-textarea/node_modules/rc-resize-observer/es/Collection.js
var CollectionContext = /*#__PURE__*/external_window_React_["createContext"](null);
/**
* Collect all the resize event from children ResizeObserver
*/
function Collection(_ref) {
var children = _ref.children,
onBatchResize = _ref.onBatchResize;
var resizeIdRef = external_window_React_["useRef"](0);
var resizeInfosRef = external_window_React_["useRef"]([]);
var onCollectionResize = external_window_React_["useContext"](CollectionContext);
var onResize = external_window_React_["useCallback"](function (size, element, data) {
resizeIdRef.current += 1;
var currentId = resizeIdRef.current;
resizeInfosRef.current.push({
size: size,
element: element,
data: data
});
Promise.resolve().then(function () {
if (currentId === resizeIdRef.current) {
onBatchResize === null || onBatchResize === void 0 ? void 0 : onBatchResize(resizeInfosRef.current);
resizeInfosRef.current = [];
}
}); // Continue bubbling if parent exist
onCollectionResize === null || onCollectionResize === void 0 ? void 0 : onCollectionResize(size, element, data);
}, [onBatchResize, onCollectionResize]);
return /*#__PURE__*/external_window_React_["createElement"](CollectionContext.Provider, {
value: onResize
}, children);
}
// CONCATENATED MODULE: ./node_modules/rc-textarea/node_modules/rc-resize-observer/es/SingleObserver/index.js
function SingleObserver(props) {
var children = props.children,
disabled = props.disabled;
var elementRef = external_window_React_["useRef"](null);
var wrapperRef = external_window_React_["useRef"](null);
var onCollectionResize = external_window_React_["useContext"](CollectionContext); // ============================= Size =============================
var sizeRef = external_window_React_["useRef"]({
width: -1,
height: -1,
offsetWidth: -1,
offsetHeight: -1
}); // ============================= Ref ==============================
var canRef = /*#__PURE__*/external_window_React_["isValidElement"](children) && Object(ref["c" /* supportRef */])(children);
var originRef = canRef ? children.ref : null;
var mergedRef = external_window_React_["useMemo"](function () {
return Object(ref["a" /* composeRef */])(originRef, elementRef);
}, [originRef, elementRef]); // =========================== Observe ============================
var propsRef = external_window_React_["useRef"](props);
propsRef.current = props; // Handler
var onInternalResize = external_window_React_["useCallback"](function (target) {
var _propsRef$current = propsRef.current,
onResize = _propsRef$current.onResize,
data = _propsRef$current.data;
var _target$getBoundingCl = target.getBoundingClientRect(),
width = _target$getBoundingCl.width,
height = _target$getBoundingCl.height;
var offsetWidth = target.offsetWidth,
offsetHeight = target.offsetHeight;
/**
* Resize observer trigger when content size changed.
* In most case we just care about element size,
* let's use `boundary` instead of `contentRect` here to avoid shaking.
*/
var fixedWidth = Math.floor(width);
var fixedHeight = Math.floor(height);
if (sizeRef.current.width !== fixedWidth || sizeRef.current.height !== fixedHeight || sizeRef.current.offsetWidth !== offsetWidth || sizeRef.current.offsetHeight !== offsetHeight) {
var size = {
width: fixedWidth,
height: fixedHeight,
offsetWidth: offsetWidth,
offsetHeight: offsetHeight
};
sizeRef.current = size; // IE is strange, right?
var mergedOffsetWidth = offsetWidth === Math.round(width) ? width : offsetWidth;
var mergedOffsetHeight = offsetHeight === Math.round(height) ? height : offsetHeight;
var sizeInfo = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, size), {}, {
offsetWidth: mergedOffsetWidth,
offsetHeight: mergedOffsetHeight
}); // Let collection know what happened
onCollectionResize === null || onCollectionResize === void 0 ? void 0 : onCollectionResize(sizeInfo, target, data);
if (onResize) {
// defer the callback but not defer to next frame
Promise.resolve().then(function () {
onResize(sizeInfo, target);
});
}
}
}, []); // Dynamic observe
external_window_React_["useEffect"](function () {
var currentElement = Object(findDOMNode["a" /* default */])(elementRef.current) || Object(findDOMNode["a" /* default */])(wrapperRef.current);
if (currentElement && !disabled) {
observe(currentElement, onInternalResize);
}
return function () {
return unobserve(currentElement, onInternalResize);
};
}, [elementRef.current, disabled]); // ============================ Render ============================
return /*#__PURE__*/external_window_React_["createElement"](DomWrapper_DomWrapper, {
ref: wrapperRef
}, canRef ? /*#__PURE__*/external_window_React_["cloneElement"](children, {
ref: mergedRef
}) : children);
}
// CONCATENATED MODULE: ./node_modules/rc-textarea/node_modules/rc-resize-observer/es/index.js
var INTERNAL_PREFIX_KEY = 'rc-observer-key';
function ResizeObserver(props) {
var children = props.children;
var childNodes = Object(toArray["a" /* default */])(children);
if (false) {}
return childNodes.map(function (child, index) {
var key = (child === null || child === void 0 ? void 0 : child.key) || "".concat(INTERNAL_PREFIX_KEY, "-").concat(index);
return /*#__PURE__*/external_window_React_["createElement"](SingleObserver, Object(esm_extends["a" /* default */])({}, props, {
key: key
}), child);
});
}
ResizeObserver.Collection = Collection;
/* harmony default export */ var es = (ResizeObserver);
// EXTERNAL MODULE: ./node_modules/rc-util/es/omit.js
var omit = __webpack_require__("bT9E");
// EXTERNAL MODULE: ./node_modules/classnames/index.js
var classnames = __webpack_require__("TSYQ");
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
// CONCATENATED MODULE: ./node_modules/rc-textarea/es/calculateNodeHeight.js
// Thanks to https://github.com/andreypopp/react-textarea-autosize/
/**
* calculateNodeHeight(uiTextNode, useCache = false)
*/
var HIDDEN_TEXTAREA_STYLE = "\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n";
var SIZING_STYLE = ['letter-spacing', 'line-height', 'padding-top', 'padding-bottom', 'font-family', 'font-weight', 'font-size', 'font-variant', 'text-rendering', 'text-transform', 'width', 'text-indent', 'padding-left', 'padding-right', 'border-width', 'box-sizing', 'word-break'];
var computedStyleCache = {};
var hiddenTextarea;
function calculateNodeStyling(node) {
var useCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
var nodeRef = node.getAttribute('id') || node.getAttribute('data-reactid') || node.getAttribute('name');
if (useCache && computedStyleCache[nodeRef]) {
return computedStyleCache[nodeRef];
}
var style = window.getComputedStyle(node);
var boxSizing = style.getPropertyValue('box-sizing') || style.getPropertyValue('-moz-box-sizing') || style.getPropertyValue('-webkit-box-sizing');
var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));
var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));
var sizingStyle = SIZING_STYLE.map(function (name) {
return "".concat(name, ":").concat(style.getPropertyValue(name));
}).join(';');
var nodeInfo = {
sizingStyle: sizingStyle,
paddingSize: paddingSize,
borderSize: borderSize,
boxSizing: boxSizing
};
if (useCache && nodeRef) {
computedStyleCache[nodeRef] = nodeInfo;
}
return nodeInfo;
}
function calculateNodeHeight(uiTextNode) {
var useCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
var minRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
var maxRows = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
if (!hiddenTextarea) {
hiddenTextarea = document.createElement('textarea');
hiddenTextarea.setAttribute('tab-index', '-1');
hiddenTextarea.setAttribute('aria-hidden', 'true');
document.body.appendChild(hiddenTextarea);
} // Fix wrap="off" issue
// https://github.com/ant-design/ant-design/issues/6577
if (uiTextNode.getAttribute('wrap')) {
hiddenTextarea.setAttribute('wrap', uiTextNode.getAttribute('wrap'));
} else {
hiddenTextarea.removeAttribute('wrap');
} // Copy all CSS properties that have an impact on the height of the content in
// the textbox
var _calculateNodeStyling = calculateNodeStyling(uiTextNode, useCache),
paddingSize = _calculateNodeStyling.paddingSize,
borderSize = _calculateNodeStyling.borderSize,
boxSizing = _calculateNodeStyling.boxSizing,
sizingStyle = _calculateNodeStyling.sizingStyle; // Need to have the overflow attribute to hide the scrollbar otherwise
// text-lines will not calculated properly as the shadow will technically be
// narrower for content
hiddenTextarea.setAttribute('style', "".concat(sizingStyle, ";").concat(HIDDEN_TEXTAREA_STYLE));
hiddenTextarea.value = uiTextNode.value || uiTextNode.placeholder || '';
var minHeight = Number.MIN_SAFE_INTEGER;
var maxHeight = Number.MAX_SAFE_INTEGER;
var height = hiddenTextarea.scrollHeight;
var overflowY;
if (boxSizing === 'border-box') {
// border-box: add border, since height = content + padding + border
height += borderSize;
} else if (boxSizing === 'content-box') {
// remove padding, since height = content
height -= paddingSize;
}
if (minRows !== null || maxRows !== null) {
// measure height of a textarea with a single row
hiddenTextarea.value = ' ';
var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
if (minRows !== null) {
minHeight = singleRowHeight * minRows;
if (boxSizing === 'border-box') {
minHeight = minHeight + paddingSize + borderSize;
}
height = Math.max(minHeight, height);
}
if (maxRows !== null) {
maxHeight = singleRowHeight * maxRows;
if (boxSizing === 'border-box') {
maxHeight = maxHeight + paddingSize + borderSize;
}
overflowY = height > maxHeight ? '' : 'hidden';
height = Math.min(maxHeight, height);
}
}
return {
height: height,
minHeight: minHeight,
maxHeight: maxHeight,
overflowY: overflowY,
resize: 'none'
};
}
// EXTERNAL MODULE: ./node_modules/shallowequal/index.js
var shallowequal = __webpack_require__("Gytx");
var shallowequal_default = /*#__PURE__*/__webpack_require__.n(shallowequal);
// CONCATENATED MODULE: ./node_modules/rc-textarea/es/ResizableTextArea.js
// eslint-disable-next-line @typescript-eslint/naming-convention
var RESIZE_STATUS;
(function (RESIZE_STATUS) {
RESIZE_STATUS[RESIZE_STATUS["NONE"] = 0] = "NONE";
RESIZE_STATUS[RESIZE_STATUS["RESIZING"] = 1] = "RESIZING";
RESIZE_STATUS[RESIZE_STATUS["RESIZED"] = 2] = "RESIZED";
})(RESIZE_STATUS || (RESIZE_STATUS = {}));
var ResizableTextArea_ResizableTextArea = /*#__PURE__*/function (_React$Component) {
Object(inherits["a" /* default */])(ResizableTextArea, _React$Component);
var _super = Object(createSuper["a" /* default */])(ResizableTextArea);
function ResizableTextArea(props) {
var _this;
Object(classCallCheck["a" /* default */])(this, ResizableTextArea);
_this = _super.call(this, props);
_this.nextFrameActionId = void 0;
_this.resizeFrameId = void 0;
_this.textArea = void 0;
_this.saveTextArea = function (textArea) {
_this.textArea = textArea;
};
_this.handleResize = function (size) {
var resizeStatus = _this.state.resizeStatus;
var _this$props = _this.props,
autoSize = _this$props.autoSize,
onResize = _this$props.onResize;
if (resizeStatus !== RESIZE_STATUS.NONE) {
return;
}
if (typeof onResize === 'function') {
onResize(size);
}
if (autoSize) {
_this.resizeOnNextFrame();
}
};
_this.resizeOnNextFrame = function () {
cancelAnimationFrame(_this.nextFrameActionId);
_this.nextFrameActionId = requestAnimationFrame(_this.resizeTextarea);
};
_this.resizeTextarea = function () {
var autoSize = _this.props.autoSize;
if (!autoSize || !_this.textArea) {
return;
}
var minRows = autoSize.minRows,
maxRows = autoSize.maxRows;
var textareaStyles = calculateNodeHeight(_this.textArea, false, minRows, maxRows);
_this.setState({
textareaStyles: textareaStyles,
resizeStatus: RESIZE_STATUS.RESIZING
}, function () {
cancelAnimationFrame(_this.resizeFrameId);
_this.resizeFrameId = requestAnimationFrame(function () {
_this.setState({
resizeStatus: RESIZE_STATUS.RESIZED
}, function () {
_this.resizeFrameId = requestAnimationFrame(function () {
_this.setState({
resizeStatus: RESIZE_STATUS.NONE
});
_this.fixFirefoxAutoScroll();
});
});
});
});
};
_this.renderTextArea = function () {
var _this$props2 = _this.props,
_this$props2$prefixCl = _this$props2.prefixCls,
prefixCls = _this$props2$prefixCl === void 0 ? 'rc-textarea' : _this$props2$prefixCl,
autoSize = _this$props2.autoSize,
onResize = _this$props2.onResize,
className = _this$props2.className,
disabled = _this$props2.disabled;
var _this$state = _this.state,
textareaStyles = _this$state.textareaStyles,
resizeStatus = _this$state.resizeStatus;
var otherProps = Object(omit["a" /* default */])(_this.props, ['prefixCls', 'onPressEnter', 'autoSize', 'defaultValue', 'onResize']);
var cls = classnames_default()(prefixCls, className, Object(defineProperty["a" /* default */])({}, "".concat(prefixCls, "-disabled"), disabled)); // Fix https://github.com/ant-design/ant-design/issues/6776
// Make sure it could be reset when using form.getFieldDecorator
if ('value' in otherProps) {
otherProps.value = otherProps.value || '';
}
var style = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, _this.props.style), textareaStyles), resizeStatus === RESIZE_STATUS.RESIZING ? // React will warning when mix `overflow` & `overflowY`.
// We need to define this separately.
{
overflowX: 'hidden',
overflowY: 'hidden'
} : null);
return /*#__PURE__*/external_window_React_["createElement"](es, {
onResize: _this.handleResize,
disabled: !(autoSize || onResize)
}, /*#__PURE__*/external_window_React_["createElement"]("textarea", Object(esm_extends["a" /* default */])({}, otherProps, {
className: cls,
style: style,
ref: _this.saveTextArea
})));
};
_this.state = {
textareaStyles: {},
resizeStatus: RESIZE_STATUS.NONE
};
return _this;
}
Object(createClass["a" /* default */])(ResizableTextArea, [{
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
// Re-render with the new content or new autoSize property then recalculate the height as required.
if (prevProps.value !== this.props.value || !shallowequal_default()(prevProps.autoSize, this.props.autoSize)) {
this.resizeTextarea();
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
cancelAnimationFrame(this.nextFrameActionId);
cancelAnimationFrame(this.resizeFrameId);
} // https://github.com/ant-design/ant-design/issues/21870
}, {
key: "fixFirefoxAutoScroll",
value: function fixFirefoxAutoScroll() {
try {
if (document.activeElement === this.textArea) {
var currentStart = this.textArea.selectionStart;
var currentEnd = this.textArea.selectionEnd;
this.textArea.setSelectionRange(currentStart, currentEnd);
}
} catch (e) {// Fix error in Chrome:
// Failed to read the 'selectionStart' property from 'HTMLInputElement'
// http://stackoverflow.com/q/21177489/3040605
}
}
}, {
key: "render",
value: function render() {
return this.renderTextArea();
}
}]);
return ResizableTextArea;
}(external_window_React_["Component"]);
/* harmony default export */ var es_ResizableTextArea = (ResizableTextArea_ResizableTextArea);
// CONCATENATED MODULE: ./node_modules/rc-textarea/es/index.js
var es_TextArea = /*#__PURE__*/function (_React$Component) {
Object(inherits["a" /* default */])(TextArea, _React$Component);
var _super = Object(createSuper["a" /* default */])(TextArea);
function TextArea(props) {
var _this;
Object(classCallCheck["a" /* default */])(this, TextArea);
_this = _super.call(this, props);
_this.resizableTextArea = void 0;
_this.focus = function () {
_this.resizableTextArea.textArea.focus();
};
_this.saveTextArea = function (resizableTextArea) {
_this.resizableTextArea = resizableTextArea;
};
_this.handleChange = function (e) {
var onChange = _this.props.onChange;
_this.setValue(e.target.value, function () {
_this.resizableTextArea.resizeTextarea();
});
if (onChange) {
onChange(e);
}
};
_this.handleKeyDown = function (e) {
var _this$props = _this.props,
onPressEnter = _this$props.onPressEnter,
onKeyDown = _this$props.onKeyDown;
if (e.keyCode === 13 && onPressEnter) {
onPressEnter(e);
}
if (onKeyDown) {
onKeyDown(e);
}
};
var value = typeof props.value === 'undefined' || props.value === null ? props.defaultValue : props.value;
_this.state = {
value: value
};
return _this;
}
Object(createClass["a" /* default */])(TextArea, [{
key: "setValue",
value: function setValue(value, callback) {
if (!('value' in this.props)) {
this.setState({
value: value
}, callback);
}
}
}, {
key: "blur",
value: function blur() {
this.resizableTextArea.textArea.blur();
}
}, {
key: "render",
value: function render() {
return /*#__PURE__*/external_window_React_["createElement"](es_ResizableTextArea, Object(esm_extends["a" /* default */])({}, this.props, {
value: this.state.value,
onKeyDown: this.handleKeyDown,
onChange: this.handleChange,
ref: this.saveTextArea
}));
}
}], [{
key: "getDerivedStateFromProps",
value: function getDerivedStateFromProps(nextProps) {
if ('value' in nextProps) {
return {
value: nextProps.value
};
}
return null;
}
}]);
return TextArea;
}(external_window_React_["Component"]);
/* harmony default export */ var rc_textarea_es = __webpack_exports__["default"] = (es_TextArea);
/***/ }),
/***/ "ZpRC":
/*!*************************************************************************!*\
!*** ./node_modules/scroll-into-view-if-needed/es/index.js + 1 modules ***!
\*************************************************************************/
/*! exports provided: default */
/*! exports used: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// CONCATENATED MODULE: ./node_modules/compute-scroll-into-view/dist/index.module.js
function t(t){return"object"==typeof t&&null!=t&&1===t.nodeType}function e(t,e){return(!e||"hidden"!==t)&&"visible"!==t&&"clip"!==t}function n(t,n){if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){var r=getComputedStyle(t,null);return e(r.overflowY,n)||e(r.overflowX,n)||function(t){var e=function(t){if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}}(t);return!!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)}(t)}return!1}function r(t,e,n,r,i,o,l,d){return o<t&&l>e||o>t&&l<e?0:o<=t&&d<=n||l>=e&&d>=n?o-t-r:l>e&&d<n||o<t&&d>n?l-e+i:0}/* harmony default export */ var index_module = (function(e,i){var o=window,l=i.scrollMode,d=i.block,u=i.inline,h=i.boundary,a=i.skipOverflowHiddenElements,c="function"==typeof h?h:function(t){return t!==h};if(!t(e))throw new TypeError("Invalid target");for(var f=document.scrollingElement||document.documentElement,s=[],p=e;t(p)&&c(p);){if((p=p.parentElement)===f){s.push(p);break}null!=p&&p===document.body&&n(p)&&!n(document.documentElement)||null!=p&&n(p,a)&&s.push(p)}for(var m=o.visualViewport?o.visualViewport.width:innerWidth,g=o.visualViewport?o.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,W=e.getBoundingClientRect(),b=W.height,H=W.width,y=W.top,E=W.right,M=W.bottom,V=W.left,x="start"===d||"nearest"===d?y:"end"===d?M:y+b/2,I="center"===u?V+H/2:"end"===u?E:V,C=[],T=0;T<s.length;T++){var k=s[T],B=k.getBoundingClientRect(),D=B.height,O=B.width,R=B.top,X=B.right,Y=B.bottom,L=B.left;if("if-needed"===l&&y>=0&&V>=0&&M<=g&&E<=m&&y>=R&&M<=Y&&V>=L&&E<=X)return C;var S=getComputedStyle(k),j=parseInt(S.borderLeftWidth,10),q=parseInt(S.borderTopWidth,10),z=parseInt(S.borderRightWidth,10),A=parseInt(S.borderBottomWidth,10),F=0,G=0,J="offsetWidth"in k?k.offsetWidth-k.clientWidth-j-z:0,K="offsetHeight"in k?k.offsetHeight-k.clientHeight-q-A:0;if(f===k)F="start"===d?x:"end"===d?x-g:"nearest"===d?r(v,v+g,g,q,A,v+x,v+x+b,b):x-g/2,G="start"===u?I:"center"===u?I-m/2:"end"===u?I-m:r(w,w+m,m,j,z,w+I,w+I+H,H),F=Math.max(0,F+v),G=Math.max(0,G+w);else{F="start"===d?x-R-q:"end"===d?x-Y+A+K:"nearest"===d?r(R,Y,D,q,A+K,x,x+b,b):x-(R+D/2)+K/2,G="start"===u?I-L-j:"center"===u?I-(L+O/2)+J/2:"end"===u?I-X+z+J:r(L,X,O,j,z+J,I,I+H,H);var N=k.scrollLeft,P=k.scrollTop;x+=P-(F=Math.max(0,Math.min(P+F,k.scrollHeight-D+K))),I+=N-(G=Math.max(0,Math.min(N+G,k.scrollWidth-O+J)))}C.push({el:k,top:F,left:G})}return C});
//# sourceMappingURL=index.module.js.map
// CONCATENATED MODULE: ./node_modules/scroll-into-view-if-needed/es/index.js
function isOptionsObject(options) {
return options === Object(options) && Object.keys(options).length !== 0;
}
function defaultBehavior(actions, behavior) {
if (behavior === void 0) {
behavior = 'auto';
}
var canSmoothScroll = ('scrollBehavior' in document.body.style);
actions.forEach(function (_ref) {
var el = _ref.el,
top = _ref.top,
left = _ref.left;
if (el.scroll && canSmoothScroll) {
el.scroll({
top: top,
left: left,
behavior: behavior
});
} else {
el.scrollTop = top;
el.scrollLeft = left;
}
});
}
function getOptions(options) {
if (options === false) {
return {
block: 'end',
inline: 'nearest'
};
}
if (isOptionsObject(options)) {
return options;
}
return {
block: 'start',
inline: 'nearest'
};
}
function scrollIntoView(target, options) {
var targetIsDetached = !target.ownerDocument.documentElement.contains(target);
if (isOptionsObject(options) && typeof options.behavior === 'function') {
return options.behavior(targetIsDetached ? [] : index_module(target, options));
}
if (targetIsDetached) {
return;
}
var computeOptions = getOptions(options);
return defaultBehavior(index_module(target, computeOptions), computeOptions.behavior);
}
/* harmony default export */ var es = __webpack_exports__["a"] = (scrollIntoView);
/***/ }),
/***/ "bT9E":
/*!*****************************************!*\
!*** ./node_modules/rc-util/es/omit.js ***!
\*****************************************/
/*! exports provided: default */
/*! exports used: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return omit; });
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ "VTBJ");
function omit(obj, fields) {
var clone = Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, obj);
if (Array.isArray(fields)) {
fields.forEach(function (key) {
delete clone[key];
});
}
return clone;
}
/***/ }),
/***/ "wXW8":
/*!******************************************************************!*\
!*** ./src/pages/Shixuns/Detail/Repository/UploadFile/index.tsx ***!
\******************************************************************/
/*! exports provided: default */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./src/.umi-production/core/routes.ts (referenced with import()) */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var antd_es_input_style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! antd/es/input/style */ "5NDa");
/* harmony import */ var antd_es_input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/es/input */ "5rEg");
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */ "k1fw");
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator */ "9og8");
/* harmony import */ var antd_es_message_style__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd/es/message/style */ "miYZ");
/* harmony import */ var antd_es_message__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! antd/es/message */ "tsqr");
/* harmony import */ var antd_es_form_style__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! antd/es/form/style */ "y8nQ");
/* harmony import */ var antd_es_form__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! antd/es/form */ "Vl3Y");
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */ "tJVT");
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties */ "PpiC");
/* harmony import */ var antd_es_upload_style__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! antd/es/upload/style */ "DZo9");
/* harmony import */ var antd_es_upload__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! antd/es/upload */ "8z0m");
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator */ "WmNS");
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_12__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! react */ "cDcd");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_13__);
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! umi */ "Ty5D");
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! umi */ "9kvl");
/* harmony import */ var _utils_env__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/utils/env */ "m3rI");
/* harmony import */ var _components_FixedButton__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/components/FixedButton */ "9ZNV");
/* harmony import */ var _components_SelectFilePathModal__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../components/SelectFilePathModal */ "8j3D");
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./index.less?modules */ "EltS");
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_index_less_modules__WEBPACK_IMPORTED_MODULE_19__);
var Dragger = antd_es_upload__WEBPACK_IMPORTED_MODULE_11__[/* default */ "a"].Dragger;
var UploadFile = function UploadFile(_ref) {
var shixunsDetail = _ref.shixunsDetail,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
user = _ref.user,
dispatch = _ref.dispatch,
props = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"])(_ref, ["shixunsDetail", "globalSetting", "loading", "user", "dispatch"]);
var location = Object(umi__WEBPACK_IMPORTED_MODULE_14__[/* useLocation */ "h"])();
var _useState = Object(react__WEBPACK_IMPORTED_MODULE_13__["useState"])({}),
_useState2 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_8__[/* default */ "a"])(_useState, 2),
formValue = _useState2[0],
setFormValue = _useState2[1];
var isRepository = Object(react__WEBPACK_IMPORTED_MODULE_13__["useRef"])();
var shixunId = Object(react__WEBPACK_IMPORTED_MODULE_13__["useRef"])();
var _Form$useForm = antd_es_form__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"].useForm(),
_Form$useForm2 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_8__[/* default */ "a"])(_Form$useForm, 1),
form = _Form$useForm2[0];
var _useState3 = Object(react__WEBPACK_IMPORTED_MODULE_13__["useState"])([]),
_useState4 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_8__[/* default */ "a"])(_useState3, 2),
fileList = _useState4[0],
setFileList = _useState4[1];
var _useState5 = Object(react__WEBPACK_IMPORTED_MODULE_13__["useState"])(),
_useState6 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_8__[/* default */ "a"])(_useState5, 2),
filePath = _useState6[0],
setFilePath = _useState6[1];
Object(react__WEBPACK_IMPORTED_MODULE_13__["useEffect"])(function () {
dispatch({
type: 'globalSetting/footerToggle',
payload: false
});
return function () {
dispatch({
type: 'globalSetting/footerToggle',
payload: true
});
};
}, []);
Object(react__WEBPACK_IMPORTED_MODULE_13__["useEffect"])(function () {
var _location$pathname, _location$pathname$sp, _location$pathname2, _location$pathname2$s;
shixunId.current = (_location$pathname = location.pathname) === null || _location$pathname === void 0 ? void 0 : (_location$pathname$sp = _location$pathname.split('/')) === null || _location$pathname$sp === void 0 ? void 0 : _location$pathname$sp[2];
isRepository.current = ((_location$pathname2 = location.pathname) === null || _location$pathname2 === void 0 ? void 0 : (_location$pathname2$s = _location$pathname2.split('/')) === null || _location$pathname2$s === void 0 ? void 0 : _location$pathname2$s[3]) === "repository";
}, []);
Object(react__WEBPACK_IMPORTED_MODULE_13__["useEffect"])(function () {
var pathArray = sessionStorage.getItem('pathArray');
if (pathArray) {
// 拼接成绝对路径
var joinPath = pathArray.split(',').join('/');
var path = joinPath.indexOf('/') === 0 ? joinPath.substr(1) : joinPath;
setFilePath(path);
}
}, []);
var handleChangeFile = function handleChangeFile(info) {
if (info.file.status === 'done' || info.file.status === "uploading") {
var _info$file$response, _info$file$response2, _info$file$response3;
setFileList(info.fileList);
if (!info.file.response) {
return;
}
if (((_info$file$response = info.file.response) === null || _info$file$response === void 0 ? void 0 : _info$file$response.status) === 0) {
antd_es_message__WEBPACK_IMPORTED_MODULE_5__[/* default */ "b"].success("上传成功!");
return;
}
setFileList(fileList.filter(function (item) {
return item.uid !== info.file.uid;
}));
((_info$file$response2 = info.file.response) === null || _info$file$response2 === void 0 ? void 0 : _info$file$response2.message) && antd_es_message__WEBPACK_IMPORTED_MODULE_5__[/* default */ "b"].info((_info$file$response3 = info.file.response) === null || _info$file$response3 === void 0 ? void 0 : _info$file$response3.message);
}
};
var handleRemoveFile = /*#__PURE__*/function () {
var _ref2 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])( /*#__PURE__*/_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_12___default.a.mark(function _callee(info) {
var res;
return _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_12___default.a.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
if (info.response) {
_context.next = 3;
break;
}
antd_es_message__WEBPACK_IMPORTED_MODULE_5__[/* default */ "b"].info("还未上传完成,无法进行删除操作!");
return _context.abrupt("return");
case 3:
if (form.getFieldValue('commitMessage')) {
_context.next = 6;
break;
}
antd_es_message__WEBPACK_IMPORTED_MODULE_5__[/* default */ "b"].info("删除文件请先填写提交信息");
return _context.abrupt("return");
case 6:
_context.next = 8;
return dispatch({
type: 'shixunsDetail/deleteGitFile',
payload: {
id: shixunId.current,
path: filePath ? "".concat(filePath, "/").concat(info.name) : info.name,
message: form.getFieldValue('commitMessage'),
secret_repository: isRepository.current ? null : true
}
});
case 8:
res = _context.sent;
if (res.status === 0) {
setFileList(fileList.filter(function (item) {
return item.uid !== info.uid;
}));
antd_es_message__WEBPACK_IMPORTED_MODULE_5__[/* default */ "b"].info("删除成功");
}
case 10:
case "end":
return _context.stop();
}
}
}, _callee);
}));
return function handleRemoveFile(_x) {
return _ref2.apply(this, arguments);
};
}();
var draggerProps = {
height: 300,
multiple: true,
withCredentials: true,
data: Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])({}, {
path: filePath || '',
message: formValue.commitMessage
}), isRepository.current ? {} : {
secret_repository: true
}),
fileList: fileList,
method: "post",
action: "".concat(_utils_env__WEBPACK_IMPORTED_MODULE_16__[/* default */ "a"].API_SERVER, "/api/shixuns/").concat(shixunId.current, "/upload_git_file.json"),
onChange: handleChangeFile,
onRemove: handleRemoveFile,
beforeUpload: function beforeUpload(file) {
if (!form.getFieldValue('commitMessage')) {
antd_es_message__WEBPACK_IMPORTED_MODULE_5__[/* default */ "b"].info("上传文件请先填写提交信息");
return false;
}
}
};
var handleFinish = function handleFinish(values) {
handleReturn();
};
var handleReturn = function handleReturn() {
var _location$pathname3, _location$pathname3$s;
umi__WEBPACK_IMPORTED_MODULE_15__[/* history */ "d"].push("/shixuns/".concat(shixunId.current, "/").concat((_location$pathname3 = location.pathname) === null || _location$pathname3 === void 0 ? void 0 : (_location$pathname3$s = _location$pathname3.split('/')) === null || _location$pathname3$s === void 0 ? void 0 : _location$pathname3$s[3]).concat(filePath ? "/master/shixun_show/".concat(filePath) : ""));
};
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_13___default.a.createElement("section", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_19___default.a.bg
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_13___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_19___default.a.wrap
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_13___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_19___default.a.title
}, "\u4E0A\u4F20\u6587\u4EF6"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_13___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_19___default.a.path
}, "\u5F53\u524D\u76EE\u5F55\uFF1A/", filePath, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_13___default.a.createElement("span", {
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_19___default.a.colorBlue, " current ml5"),
onClick: function onClick() {
dispatch({
type: 'shixunsDetail/setActionTabs',
payload: {
key: 'Repository-SelectFilePath'
}
});
}
}, "\u9009\u62E9\u6587\u4EF6\u76EE\u5F55")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_13___default.a.createElement(antd_es_form__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"], {
className: "mt10",
form: form,
scrollToFirstError: true,
layout: "vertical",
onFinish: handleFinish,
onValuesChange: function onValuesChange() {
return setFormValue(Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])({}, form.getFieldsValue()));
}
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_13___default.a.createElement(antd_es_form__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"].Item, {
label: "\u63D0\u4EA4\u4FE1\u606F\uFF1A",
name: "commitMessage",
rules: [{
required: true,
message: '请输入提交信息'
}, {
whitespace: true,
message: '请勿输入空格'
}]
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_13___default.a.createElement(antd_es_input__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"], {
placeholder: "\u5FC5\u586B\uFF0C\u63CF\u8FF0\u4E3B\u8981\u4FEE\u6539\u5185\u5BB9\uFF08\u76F8\u5F53\u4E8EGit Commit message\u7684Header\uFF09"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_13___default.a.createElement(antd_es_form__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"].Item, {
noStyle: true
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_13___default.a.createElement(_components_FixedButton__WEBPACK_IMPORTED_MODULE_17__[/* FixedButton */ "a"], {
okButtonProps: {
htmlType: "submit"
},
onCancel: handleReturn
}))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_13___default.a.createElement(Dragger, draggerProps, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_13___default.a.createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_13___default.a.createElement("i", {
className: "iconfont icon-shangchuan font50 ".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_19___default.a.colorBlue)
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_13___default.a.createElement("div", {
className: "font14 mt30"
}, "\u62D6\u62FD\u6587\u4EF6\u6216", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_13___default.a.createElement("span", {
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_19___default.a.colorBlue, " ml5")
}, "\u70B9\u51FB\u6B64\u5904\u4E0A\u4F20")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_13___default.a.createElement(_components_SelectFilePathModal__WEBPACK_IMPORTED_MODULE_18__[/* default */ "a"], {
onFinish: function onFinish(path) {
return setFilePath(path);
}
}));
};
/* harmony default export */ __webpack_exports__["default"] = (Object(umi__WEBPACK_IMPORTED_MODULE_15__[/* connect */ "a"])(function (_ref3) {
var shixunsDetail = _ref3.shixunsDetail,
loading = _ref3.loading,
globalSetting = _ref3.globalSetting,
user = _ref3.user;
return {
shixunsDetail: shixunsDetail,
globalSetting: globalSetting,
user: user,
loading: loading.models.index
};
})(UploadFile));
/***/ })
}]);