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__Classrooms__Lists__Commo...

5053 lines
235 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([[52338,88314,72286],{
/***/ 51811:
/*!*********************************!*\
!*** ./src/pages/tasks/util.js ***!
\*********************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Ax: function() { return /* binding */ processTreeData; },
/* harmony export */ Ds: function() { return /* binding */ debounce; },
/* harmony export */ KI: function() { return /* binding */ apiPref; },
/* harmony export */ SI: function() { return /* binding */ getTreeData; },
/* harmony export */ f1: function() { return /* binding */ isCompileOk; }
/* harmony export */ });
/* unused harmony export isProd */
/* harmony import */ var _utils_env__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/utils/env */ 67871);
function isCompileOk(rs) {
var flag = true;
if (rs.length > 0) {
for (var i = 0; i < rs.length; i++) {
if (rs[i].compile_success == 0 || !rs[i].compile_success) {
flag = false;
break;
}
}
} else {
flag = false;
}
return flag;
}
function getTreeData(data) {
var parentKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
var result = [];
for (var i = 0; i < data.length; i++) {
var item = data[i];
var key = parentKey ? "".concat(parentKey, "/").concat(item.name) : "".concat(item.name);
result.push({
title: item.name,
isLeaf: item.type === 'tree' ? false : true,
key: key
});
}
return result;
}
function processTreeData(repos, key, newData) {
for (var i = 0; i < repos.length; i++) {
var item = repos[i];
if (item.key === key) {
item.children = newData;
break;
}
if (item.children) {
processTreeData(item.children, key, newData);
}
}
return repos;
}
function debounce(func, wait, immediate) {
var timeout;
return function () {
var context = this,
args = arguments;
var later = function later() {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) func.apply(context, args);
};
}
var isProd = true;
var apiPref = _utils_env__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.API_SERVER;
// export const isProd =
// window.location.href.indexOf('test-') > 0 ||
// window.location.href.indexOf('localhost') > 0
// ? false
// : true;
// export const apiPref = isProd
// ? 'https://www.educoder.net'
// : 'https://test-newweb.educoder.net';
/***/ }),
/***/ 76478:
/*!***************************************************************!*\
!*** ./src/components/FileDownloadList/index.tsx + 3 modules ***!
\***************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ components_FileDownloadList; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(10574);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(39343);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(11006);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
;// CONCATENATED MODULE: ./src/components/FileDownloadList/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var FileDownloadListmodules = ({"flex_box_center":"flex_box_center___A3pzf","flex_space_between":"flex_space_between___JBoa5","flex_box_vertical_center":"flex_box_vertical_center___MJuIO","flex_box_center_end":"flex_box_center_end___OcjUA","flex_box_column":"flex_box_column___zSH4A","list":"list___KhJas","middle":"middle___IjlYi","row":"row___GGtIx","title":"title___o_xqf","size":"size___OVRoL","download":"download___ZLcIH","preview":"preview___gi0kI","annotation":"annotation___KVSwj"});
// EXTERNAL MODULE: ./node_modules/_classnames@2.3.3@classnames/index.js
var _classnames_2_3_3_classnames = __webpack_require__(66641);
var _classnames_2_3_3_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_3_3_classnames);
// EXTERNAL MODULE: ./src/components/PreviewAll/index.tsx + 1 modules
var PreviewAll = __webpack_require__(78075);
;// CONCATENATED MODULE: ./src/components/ImageDimensions/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var ImageDimensionsmodules = ({"imageDimensions":"imageDimensions___a7crR","img":"img___Kroat"});
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/spin/index.js + 1 modules
var spin = __webpack_require__(71418);
// EXTERNAL MODULE: ./node_modules/_markerjs3@2.29.1@markerjs3/markerjs2.esm.js
var markerjs2_esm = __webpack_require__(2859);
// EXTERNAL MODULE: ./src/utils/fetch.ts
var fetch = __webpack_require__(15830);
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(85578);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/components/ImageDimensions/index.tsx
var ImageDimensions = function ImageDimensions(_ref) {
var data = _ref.data,
className = _ref.className,
_ref$style = _ref.style,
style = _ref$style === void 0 ? {} : _ref$style,
onClose = _ref.onClose,
onOk = _ref.onOk;
var imgRef = (0,_react_17_0_2_react.useRef)(null);
var markerArea = (0,_react_17_0_2_react.useRef)(null);
var _useState = (0,_react_17_0_2_react.useState)(false),
_useState2 = slicedToArray_default()(_useState, 2),
loading = _useState2[0],
setLoading = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)('正在加载中'),
_useState4 = slicedToArray_default()(_useState3, 2),
loadingText = _useState4[0],
setLoadingText = _useState4[1];
(0,_react_17_0_2_react.useEffect)(function () {
if (data !== null && data !== void 0 && data.visible) {
document.body.setAttribute('data-custom', 'height');
} else {
document.body.removeAttribute('data-custom');
}
if (data !== null && data !== void 0 && data.src) {
getImg();
}
}, [data === null || data === void 0 ? void 0 : data.visible]);
var getImg = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
setLoading(true);
setLoadingText('正在加载中');
_context.next = 4;
return (0,util/* toDataUrl */.ZJ)(data === null || data === void 0 ? void 0 : data.src);
case 4:
res = _context.sent;
imgRef.current.src = "";
imgRef.current.src = res;
imgRef.current.onload = function () {
initMarkerjs();
};
setLoading(false);
setLoadingText('');
case 10:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getImg() {
return _ref2.apply(this, arguments);
};
}();
var onSave = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(event) {
var res, result;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
setLoading(true);
setLoadingText('正在保存中');
_context2.next = 4;
return (0,fetch/* default */.ZP)('/api/attachments.json', {
method: 'post',
body: {
file_type: 'base64',
original_filename: data.title,
file: event.dataUrl
}
});
case 4:
res = _context2.sent;
if (!(res !== null && res !== void 0 && res.id)) {
_context2.next = 10;
break;
}
_context2.next = 8;
return (0,fetch/* default */.ZP)("/api/attachments/".concat(data.id, "/add_subitem.json"), {
method: 'post',
body: {
subitem_id: res === null || res === void 0 ? void 0 : res.id,
settings: JSON.stringify(event.state)
}
});
case 8:
result = _context2.sent;
if (result.status === 0) {
onOk();
}
case 10:
setLoading(false);
setLoadingText('');
case 12:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function onSave(_x) {
return _ref3.apply(this, arguments);
};
}();
var dealDom = function dealDom() {
// 删除标签
// 找到href为"https://markerjs.com/"的a标签
var targetLink = document.querySelector('a[href="https://markerjs.com/"]');
if (targetLink && targetLink.parentNode) {
targetLink.parentNode.style.display = 'none';
}
// 设置title
var item = [{
name: '[data-action="select"]',
title: '选择'
}, {
name: '[data-action="delete"]',
title: '删除元素'
}, {
name: '[data-action="undo"]',
title: '撤销'
}, {
name: '[data-type-name="FrameMarker"]',
title: '矩形'
}, {
name: '[data-type-name="FreehandMarker"]',
title: '画线'
}, {
name: '[data-type-name="ArrowMarker"]',
title: '箭头'
}, {
name: '[data-type-name="TextMarker"]',
title: '文本'
}, {
name: '[data-type-name="EllipseMarker"]',
title: '椭圆'
}, {
name: '[data-type-name="HighlightMarker"]',
title: '方块'
}, {
name: '[data-type-name="CalloutMarker"]',
title: '注释'
}, {
name: '[data-action="render"]',
title: '保存'
}, {
name: '[data-action="close"]',
title: '退出'
}];
item.forEach(function (e) {
var targetElement = document.querySelector(e.name);
if (targetElement) {
targetElement.setAttribute('title', e.title);
}
});
};
var initMarkerjs = function initMarkerjs() {
markerArea.current = new markerjs2_esm/* MarkerArea */.hP(imgRef.current);
markerArea.current.addEventListener('render', onSave);
markerArea.current.addEventListener('beforeclose', onClose);
markerArea.current.show();
console.log(markerArea.current, '22222');
if (data !== null && data !== void 0 && data.snapshotData) {
markerArea.current.restoreState(data.snapshotData);
}
setTimeout(function () {
dealDom();
}, 300);
};
return /*#__PURE__*/(0,jsx_runtime.jsx)(_react_17_0_2_react.Fragment, {
children: (data === null || data === void 0 ? void 0 : data.visible) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: _classnames_2_3_3_classnames_default()(ImageDimensionsmodules.imageDimensions, className),
style: style,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(spin/* default */.Z, {
spinning: loading,
tip: loadingText,
style: {
position: 'absolute'
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
className: ImageDimensionsmodules.img,
ref: imgRef
// crossOrigin='anonymous'
// src={data?.src}
})]
})
});
};
/* harmony default export */ var components_ImageDimensions = (ImageDimensions);
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(67871);
// EXTERNAL MODULE: ./src/utils/authority.ts
var utils_authority = __webpack_require__(58696);
;// CONCATENATED MODULE: ./src/components/FileDownloadList/index.tsx
var FileDownloadList = function FileDownloadList(_ref) {
var className = _ref.className,
style = _ref.style,
_ref$dataSource = _ref.dataSource,
dataSource = _ref$dataSource === void 0 ? [] : _ref$dataSource,
_ref$authority = _ref.authority,
authority = _ref$authority === void 0 ? false : _ref$authority,
callback = _ref.callback,
_ref$showDimensions = _ref.showDimensions,
showDimensions = _ref$showDimensions === void 0 ? true : _ref$showDimensions;
var _useState = (0,_react_17_0_2_react.useState)({
content: "",
type: ""
}),
_useState2 = slicedToArray_default()(_useState, 2),
data = _useState2[0],
setData = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)({}),
_useState4 = slicedToArray_default()(_useState3, 2),
openData = _useState4[0],
setOpenData = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(false),
_useState6 = slicedToArray_default()(_useState5, 2),
isedit = _useState6[0],
setisedit = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)({
title: '',
visible: false,
src: '',
snapshotData: {}
}),
_useState8 = slicedToArray_default()(_useState7, 2),
dimensions = _useState8[0],
setDimensions = _useState8[1];
var monacoValueRef = (0,_react_17_0_2_react.useRef)();
var handleClick = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(item) {
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
setOpenData(item);
if (!(item.file_type === "txt")) {
_context.next = 6;
break;
}
_context.next = 4;
return (0,fetch/* default */.ZP)(item.url, {
method: "get",
headers: {
"Content-Type": "application/xml"
}
});
case 4:
res = _context.sent;
monacoValueRef.current = res;
case 6:
setData({
type: item.file_type,
content: env/* default */.Z.API_SERVER + item.url
});
case 7:
case "end":
return _context.stop();
}
}, _callee);
}));
return function handleClick(_x) {
return _ref2.apply(this, arguments);
};
}();
var handleAnnotation = function handleAnnotation(item) {
var _item$subitem;
setDimensions({
visible: true,
src: env/* default */.Z.API_SERVER + item.url,
id: item.id,
title: item.title,
snapshotData: item === null || item === void 0 || (_item$subitem = item.subitem) === null || _item$subitem === void 0 ? void 0 : _item$subitem.settings
});
};
var handleCheckAnnotation = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(item) {
var _item$subitem2;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
setData({
type: item.file_type,
content: env/* default */.Z.API_SERVER + (item === null || item === void 0 || (_item$subitem2 = item.subitem) === null || _item$subitem2 === void 0 ? void 0 : _item$subitem2.url)
});
case 1:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function handleCheckAnnotation(_x2) {
return _ref3.apply(this, arguments);
};
}();
var handleOk = function handleOk() {
callback();
setDimensions({
visible: false
});
};
if (!(dataSource !== null && dataSource !== void 0 && dataSource.length)) {
return null;
}
return /*#__PURE__*/(0,jsx_runtime.jsxs)(_react_17_0_2_react.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: _classnames_2_3_3_classnames_default()(FileDownloadListmodules.list, className),
style: style,
children: dataSource.map(function (item, index) {
var _item$subitem3, _item$subitem4, _item$subitem5;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: FileDownloadListmodules.row,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: FileDownloadListmodules.title,
onClick: function onClick() {
return handleClick(item);
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-fujian1"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
title: item.title,
children: item.title
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: FileDownloadListmodules.size,
children: item.filesize
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: FileDownloadListmodules.download,
onClick: function onClick() {
var _item$url;
(0,util/* downLoadLink */.Nd)('', "".concat(env/* default */.Z.API_SERVER).concat((_item$url = item.url) === null || _item$url === void 0 ? void 0 : _item$url.replace('disposition=inline', '')));
// downLoadLink('', `${ENV.API_SERVER}${item.url?.replace('disposition=inline', '')}`)
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-xiazai4"
}), "\u4E0B\u8F7D"]
}), !['other', 'download'].includes(item === null || item === void 0 ? void 0 : item.file_type) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: FileDownloadListmodules.preview,
onClick: function onClick() {
return handleClick(item);
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-yulan"
}), "\u9884\u89C8"]
}), ['image'].includes(item === null || item === void 0 ? void 0 : item.file_type) && showDimensions && (authority ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: FileDownloadListmodules.annotation,
onClick: function onClick() {
return handleAnnotation(item);
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-pizhu"
}), (_item$subitem3 = item.subitem) !== null && _item$subitem3 !== void 0 && _item$subitem3.id ? '修改批注' : '批注']
}) : ((_item$subitem4 = item.subitem) === null || _item$subitem4 === void 0 ? void 0 : _item$subitem4.id) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: FileDownloadListmodules.annotation,
onClick: function onClick() {
return handleCheckAnnotation(item);
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-chakanlaoshipizhu1"
}), "\u67E5\u770B\u8001\u5E08\u6279\u6CE8"]
})), ['image'].includes(item === null || item === void 0 ? void 0 : item.file_type) && ((_item$subitem5 = item.subitem) === null || _item$subitem5 === void 0 ? void 0 : _item$subitem5.id) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: FileDownloadListmodules.download,
style: {
marginLeft: 20
},
onClick: function onClick() {
var _item$subitem6;
(0,util/* downLoadLink */.Nd)('', "".concat(env/* default */.Z.API_SERVER).concat(item === null || item === void 0 || (_item$subitem6 = item.subitem) === null || _item$subitem6 === void 0 || (_item$subitem6 = _item$subitem6.url) === null || _item$subitem6 === void 0 ? void 0 : _item$subitem6.replace('disposition=inline', '')));
// downLoadLink('', `${ENV.API_SERVER}${item.url?.replace('disposition=inline', '')}`)
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-xiazai4"
}), "\u4E0B\u8F7D\u6279\u6CE8\u6587\u4EF6"]
}), ['office'].includes(item === null || item === void 0 ? void 0 : item.file_type) && (0,utils_authority/* isAdmins */.eB)() && ["xlsx", "docx", "pptx"].includes(item === null || item === void 0 ? void 0 : item.file_sub) && showDimensions && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: FileDownloadListmodules.annotation,
onClick: function onClick() {
setisedit(true);
handleClick(item);
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-pizhu"
}), item.is_edit ? '修改批注' : '批注']
}), item.is_edit && (0,utils_authority/* isStudent */.dE)() && showDimensions && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: FileDownloadListmodules.annotation,
onClick: function onClick() {
// setisedit(true)
handleClick(item);
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-sousuo7"
}), '查看老师批注']
})]
}, index);
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(PreviewAll/* default */.Z, {
close: true,
data: data === null || data === void 0 ? void 0 : data.content,
type: data === null || data === void 0 ? void 0 : data.type,
hasMask: true,
editOffice: isedit ? 'edit' : 'view',
monacoEditor: {
value: monacoValueRef.current,
language: "txt",
onChange: function onChange() {},
options: {
readOnly: true,
fontSize: 14,
minimap: {
enabled: false
}
}
},
onImgDimensions: authority && showDimensions && data.type === 'image' ? function () {
return handleAnnotation(openData);
} : null,
onClose: function onClose() {
callback();
setisedit(false);
setData({
content: "",
type: ""
});
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)(components_ImageDimensions, {
onOk: handleOk,
onClose: function onClose() {
return setDimensions({
visible: false
});
},
data: dimensions
})]
});
};
/* harmony default export */ var components_FileDownloadList = (FileDownloadList);
/***/ }),
/***/ 72286:
/*!**********************************************************!*\
!*** ./src/components/MultiUpload/index.tsx + 3 modules ***!
\**********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
z: function() { return /* binding */ coverToFileList; },
Z: function() { return /* binding */ MultiUpload; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(10574);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(39343);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(26801);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/toConsumableArray.js
var toConsumableArray = __webpack_require__(93923);
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(11006);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/upload/index.js + 24 modules
var upload = __webpack_require__(48826);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
var es_message = __webpack_require__(8591);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
var modal = __webpack_require__(43418);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es_button = __webpack_require__(3113);
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(67871);
// EXTERNAL MODULE: ./src/pages/MoopCases/FormPanel/service.ts
var service = __webpack_require__(68074);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/components/SingleUpload/index.tsx
var uploadNameSizeSeperator = '  ';
function bytesToSize(bytes) {
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
if (bytes == 0) return '0 Byte';
var i = parseInt('' + Math.floor(Math.log(bytes) / Math.log(1024)), 10);
return (bytes / Math.pow(1024, i)).toFixed(1) + ' ' + sizes[i];
}
/* harmony default export */ var SingleUpload = (function (_ref) {
var _ref$value = _ref.value,
value = _ref$value === void 0 ? [] : _ref$value,
action = _ref.action,
_onChange = _ref.onChange,
className = _ref.className,
_ref$maxSize = _ref.maxSize,
maxSize = _ref$maxSize === void 0 ? 150 : _ref$maxSize,
_ref$title = _ref.title,
title = _ref$title === void 0 ? '文件上传' : _ref$title,
_ref$accept = _ref.accept,
accept = _ref$accept === void 0 ? null : _ref$accept;
var uploadProps = {
multiple: false,
fileList: value,
accept: accept,
withCredentials: true,
beforeUpload: function beforeUpload(file) {
var fileSize = file.size / 1024 / 1024;
if (!(fileSize < maxSize)) {
message.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(maxSize, "MB),\u5EFA\u8BAE\u4E0A\u4F20\u5230\u767E\u5EA6\u4E91\u7B49\u5176\u5B83\u5171\u4EAB\u5DE5\u5177\u91CC\uFF0C\u7136\u540E\u518Dtxt\u6587\u6863\u91CC\u7ED9\u51FA\u94FE\u63A5\u4EE5\u53CA\u5171\u4EAB\u5BC6\u7801\u5E76\u4E0A\u4F20"));
return Promise.reject();
}
return true;
},
action: "".concat(ENV.API_SERVER, "/api/attachments.json"),
// ?debug=student&randomcode=undefined&client_key=6d57f8c3dd186c5ada392546ace9620a
onChange: function onChange(info) {
var _info$file;
var fileList = _toConsumableArray(info.fileList);
fileList = fileList.map(function (file) {
if (file.name.indexOf(uploadNameSizeSeperator) === -1) {
file.name = "".concat(file.name).concat(uploadNameSizeSeperator).concat(bytesToSize(file.size));
}
return _objectSpread({}, file);
});
if (info.file.status === 'done' && ((_info$file = info.file) === null || _info$file === void 0 || (_info$file = _info$file.response) === null || _info$file === void 0 ? void 0 : _info$file.status) === -1) {
var _info$file2;
message.error((_info$file2 = info.file) === null || _info$file2 === void 0 || (_info$file2 = _info$file2.response) === null || _info$file2 === void 0 ? void 0 : _info$file2.message);
_onChange([]);
return;
}
_onChange(fileList);
},
onRemove: function () {
var _onRemove = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
var fileSize, id, rs;
return _regeneratorRuntime().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
fileSize = file.size / 1024 / 1024;
if (!(file.status === 'uploading')) {
_context.next = 3;
break;
}
return _context.abrupt("return", true);
case 3:
if (fileSize < maxSize) {
_context.next = 7;
break;
}
return _context.abrupt("return", true);
case 7:
id = file.response ? file.response.id : file.uid;
if (!id) {
_context.next = 15;
break;
}
_context.next = 11;
return removeAttachment(file.response ? file.response.id : file.id);
case 11:
rs = _context.sent;
return _context.abrupt("return", rs);
case 15:
return _context.abrupt("return", true);
case 16:
case "end":
return _context.stop();
}
}, _callee);
}));
function onRemove(_x) {
return _onRemove.apply(this, arguments);
}
return onRemove;
}()
};
function onCancel(e) {
e.preventDefault();
e.stopPropagation();
}
return /*#__PURE__*/_jsx("div", {
className: "single-upload ".concat(className ? className : ''),
children: /*#__PURE__*/_jsxs(Upload, _objectSpread(_objectSpread({}, uploadProps), {}, {
children: [/*#__PURE__*/_jsx(Button, {
type: "primary",
title: value.length > 0 ? '每次只能上传一个资源, 删除下面资源可重新上传 ' : '',
disabled: value.length > 0,
ghost: true,
children: title
}), /*#__PURE__*/_jsxs("span", {
onClick: onCancel,
style: {
marginLeft: 10
},
children: ["(\u5355\u4E2A\u6587\u4EF6\u6700\u5927", maxSize, "M)", ' ']
})]
}))
});
});
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/InboxOutlined.js + 1 modules
var InboxOutlined = __webpack_require__(60936);
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js
var lodash = __webpack_require__(89392);
;// CONCATENATED MODULE: ./src/components/MultiUpload/index.less
// extracted by mini-css-extract-plugin
;// CONCATENATED MODULE: ./src/assets/images/uploadImg.svg
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
var __defProp = Object.defineProperty;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = function __defNormalProp(obj, key, value) {
return key in obj ? __defProp(obj, key, {
enumerable: true,
configurable: true,
writable: true,
value: value
}) : obj[key] = value;
};
var __spreadValues = function __spreadValues(a, b) {
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols) {
var _iterator = _createForOfIteratorHelper(__getOwnPropSymbols(b)),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var prop = _step.value;
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
}
return a;
};
var SvgUploadImg = function SvgUploadImg(props) {
return /* @__PURE__ */React.createElement("svg", __spreadValues({
width: 14,
height: 14,
xmlns: "http://www.w3.org/2000/svg"
}, props), /* @__PURE__ */React.createElement("title", null, "\u5F62\u72B6"), /* @__PURE__ */React.createElement("path", {
d: "M10.354 3.5h-2.77v8.167H6.416V3.5H3.646L7 0l3.354 3.5ZM14 7h-1.167v5.833H1.167V7H0v7h14V7Z",
fill: "#3061D0",
fillRule: "nonzero"
}));
};
/* harmony default export */ var uploadImg = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEwLjM1NCAzLjVoLTIuNzd2OC4xNjdINi40MTZWMy41SDMuNjQ2TDcgMGwzLjM1NCAzLjVaTTE0IDdoLTEuMTY3djUuODMzSDEuMTY3VjdIMHY3aDE0VjdaIiBmaWxsPSIjMzA2MUQwIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=");
;// CONCATENATED MODULE: ./src/components/MultiUpload/index.tsx
var Dragger = upload/* default */.Z.Dragger;
function coverToFileList(data) {
var rs = [];
if (data && data.length > 0) {
rs = data.map(function (item) {
return {
uid: item.id,
id: item.id,
name: item.title + uploadNameSizeSeperator + item.filesize,
url: item.url,
filesize: item.filesize,
status: 'done',
response: {
id: item.id
}
};
});
}
return rs;
}
/* harmony default export */ var MultiUpload = (function (_ref) {
var value = _ref.value,
_onChange = _ref.onChange,
action = _ref.action,
data = _ref.data,
className = _ref.className,
_ref$maxSize = _ref.maxSize,
maxSize = _ref$maxSize === void 0 ? 150 : _ref$maxSize,
_ref$title = _ref.title,
title = _ref$title === void 0 ? '上传附件' : _ref$title,
_ref$showRemoveModal = _ref.showRemoveModal,
showRemoveModal = _ref$showRemoveModal === void 0 ? false : _ref$showRemoveModal,
_ref$accept = _ref.accept,
accept = _ref$accept === void 0 ? '' : _ref$accept,
additionalText = _ref.additionalText,
isDragger = _ref.isDragger,
_ref$number = _ref.number,
number = _ref$number === void 0 ? 1000 : _ref$number,
_ref$aloneClear = _ref.aloneClear,
aloneClear = _ref$aloneClear === void 0 ? false : _ref$aloneClear;
var _useState = (0,_react_17_0_2_react.useState)(false),
_useState2 = slicedToArray_default()(_useState, 2),
disabled = _useState2[0],
setDisabled = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(value || []),
_useState4 = slicedToArray_default()(_useState3, 2),
fileList = _useState4[0],
setFileList = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(1),
_useState6 = slicedToArray_default()(_useState5, 2),
nums = _useState6[0],
setnums = _useState6[1];
(0,_react_17_0_2_react.useEffect)(function () {
if (value) {
if (nums === 1) {
setFileList(toConsumableArray_default()(value));
}
setnums(2);
if (number === (value === null || value === void 0 ? void 0 : value.length)) {
setDisabled(true);
}
}
}, [value]);
var clearLastFile = function clearLastFile() {
setTimeout(function () {
fileList.pop();
setFileList(toConsumableArray_default()(fileList));
}, 500);
};
var uploadProps = {
multiple: true,
disabled: disabled,
accept: accept,
withCredentials: true,
fileList: fileList,
// fileList: fileList?.length ? fileList : value,
beforeUpload: function beforeUpload(file, fileArr) {
var fileSize = file.size / 1024 / 1024;
if (fileList.concat(fileArr).length > number) {
fileList.pop();
setFileList(toConsumableArray_default()(fileList));
es_message/* default */.ZP.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(number, "\u4E2A\u6587\u4EF6"));
if (aloneClear) {
return Promise.reject();
}
clearLastFile();
return false;
}
if (!(fileSize < maxSize)) {
es_message/* default */.ZP.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(maxSize, "MB)."));
if (aloneClear) {
return Promise.reject();
}
clearLastFile();
return false;
}
return true;
},
data: data,
action: action || "".concat(env/* default */.Z.API_SERVER, "/api/attachments.json"),
// ?debug=student&randomcode=undefined&client_key=6d57f8c3dd186c5ada392546ace9620a
onChange: function onChange(info) {
var _info$file;
if (info.file.status === "removed") {
fileList = info.fileList;
} else {
fileList = (0,lodash.uniqBy)([].concat(toConsumableArray_default()(info.fileList), toConsumableArray_default()(fileList)), 'uid');
}
if (info.file.status === 'done' && ((_info$file = info.file) === null || _info$file === void 0 || (_info$file = _info$file.response) === null || _info$file === void 0 ? void 0 : _info$file.status) === -1) {
var _info$file2;
es_message/* default */.ZP.error((_info$file2 = info.file) === null || _info$file2 === void 0 || (_info$file2 = _info$file2.response) === null || _info$file2 === void 0 ? void 0 : _info$file2.message);
return;
}
if (fileList.length >= number) setDisabled(true);else setDisabled(false);
setFileList(toConsumableArray_default()(fileList));
fileList = fileList.map(function (file) {
var _file$response;
if (file !== null && file !== void 0 && (_file$response = file.response) !== null && _file$response !== void 0 && _file$response.id) {
var _file$response2;
file.url = "/api/attachments/".concat(file === null || file === void 0 || (_file$response2 = file.response) === null || _file$response2 === void 0 ? void 0 : _file$response2.id);
}
if (file.name.indexOf(uploadNameSizeSeperator) === -1) {
file.name = "".concat(file.name).concat(uploadNameSizeSeperator).concat(bytesToSize(file.size));
}
return objectSpread2_default()({}, file);
});
console.log('info:', info, fileList);
_onChange(fileList);
},
onRemove: function () {
var _onRemove = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(file) {
var remove;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
remove = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var id, rs;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
id = file.response ? file.response.id : file.id;
if (!id) {
_context.next = 8;
break;
}
_context.next = 4;
return (0,service/* removeAttachment */.JZ)(file.response ? file.response.id : file.uid);
case 4:
rs = _context.sent;
return _context.abrupt("return", Promise.resolve(rs));
case 8:
return _context.abrupt("return", true);
case 9:
case "end":
return _context.stop();
}
}, _callee);
}));
return function remove() {
return _ref2.apply(this, arguments);
};
}();
if (!showRemoveModal) {
_context3.next = 5;
break;
}
return _context3.abrupt("return", new Promise(function (resolve, reject) {
modal/* default */.Z.confirm({
centered: true,
width: 530,
okText: '确定',
cancelText: '取消',
title: '提示',
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "tc font16",
children: "\u662F\u5426\u786E\u8BA4\u5220\u9664?"
}),
onOk: function () {
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
var res;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return remove();
case 2:
res = _context2.sent;
es_message/* default */.ZP.success('删除成功');
resolve(true);
case 5:
case "end":
return _context2.stop();
}
}, _callee2);
}));
function onOk() {
return _onOk.apply(this, arguments);
}
return onOk;
}(),
onCancel: function onCancel() {
return resolve(false);
}
});
}));
case 5:
_context3.next = 7;
return remove();
case 7:
return _context3.abrupt("return", _context3.sent);
case 8:
case "end":
return _context3.stop();
}
}, _callee3);
}));
function onRemove(_x) {
return _onRemove.apply(this, arguments);
}
return onRemove;
}()
};
function onCancel(e) {
e.preventDefault();
e.stopPropagation();
}
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "multi-upload ".concat(className ? className : ''),
children: [isDragger && /*#__PURE__*/(0,jsx_runtime.jsxs)(Dragger, objectSpread2_default()(objectSpread2_default()({}, uploadProps), {}, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: "ant-upload-drag-icon",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(InboxOutlined/* default */.Z, {})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: "ant-upload-text",
children: ["\u70B9\u51FB\u4E0A\u4F20\u56FE\u6807\uFF0C\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u4EF6\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "(\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\u4E3A", maxSize, "MB)", ' ']
}), additionalText]
})), !isDragger && /*#__PURE__*/(0,jsx_runtime.jsxs)(upload/* default */.Z, objectSpread2_default()(objectSpread2_default()({}, uploadProps), {}, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
disabled: disabled,
className: "upload_button",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
className: "aBtn_img",
src: uploadImg
}), title]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
onClick: onCancel,
className: "upload_text",
children: ["(\u5355\u4E2A\u6587\u4EF6\u6700\u5927", maxSize, "MB)", ' ']
})]
}))]
});
});
/***/ }),
/***/ 61173:
/*!************************************************************!*\
!*** ./src/components/image-preview/index.tsx + 1 modules ***!
\************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ image_preview; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(11006);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
;// CONCATENATED MODULE: ./src/components/image-preview/index.less
// extracted by mini-css-extract-plugin
// EXTERNAL MODULE: ./src/components/mediator.js
var mediator = __webpack_require__(89472);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es_button = __webpack_require__(3113);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/ReloadOutlined.js + 1 modules
var ReloadOutlined = __webpack_require__(91671);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/DownloadOutlined.js + 1 modules
var DownloadOutlined = __webpack_require__(66549);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/CloseOutlined.js + 1 modules
var CloseOutlined = __webpack_require__(99174);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/components/image-preview/index.tsx
/* harmony default export */ var image_preview = (function () {
var _useState = (0,_react_17_0_2_react.useState)(''),
_useState2 = slicedToArray_default()(_useState, 2),
url = _useState2[0],
setUrl = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(0),
_useState4 = slicedToArray_default()(_useState3, 2),
deg = _useState4[0],
setDeg = _useState4[1];
var saveUrl = (0,_react_17_0_2_react.useRef)('');
(0,_react_17_0_2_react.useEffect)(function () {
var unSub = mediator/* default */.Z.subscribe('preview-image', function (value) {
setUrl(value);
// window.document.body
// document.body.style.height='100%'
document.body.style.overflow = 'hidden';
});
return unSub;
}, []);
(0,_react_17_0_2_react.useEffect)(function () {
document.addEventListener('keydown', onViewEscClose);
return function () {
document.removeEventListener('keydown', onViewEscClose);
};
}, []);
(0,_react_17_0_2_react.useEffect)(function () {
saveUrl.current = url;
}, [url]);
function onViewEscClose(e) {
if (e.keyCode == 27 && saveUrl.current) {
onClose();
}
}
// https://data.educoder.net/api/attachments/1571649
function onClose() {
// document.body.style.height='100%'
document.body.style.overflow = 'auto';
setUrl('');
}
function onRotate() {
setDeg(deg + 90);
}
var maskRef = (0,_react_17_0_2_react.useRef)();
var previewWrapperRef = (0,_react_17_0_2_react.useRef)();
var handleMaskClick = function handleMaskClick(e) {
if (e.nativeEvent.target === maskRef.current || e.nativeEvent.target === previewWrapperRef.current) {
onClose();
}
};
return /*#__PURE__*/(0,jsx_runtime.jsx)(_react_17_0_2_react.Fragment, {
children: !url ? null : /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "image-preview-container",
ref: maskRef,
onClick: handleMaskClick,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "button-group",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
onClick: onRotate,
children: ["\u65CB\u8F6C", /*#__PURE__*/(0,jsx_runtime.jsx)(ReloadOutlined/* default */.Z, {})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
href: url,
children: ["\u4E0B\u8F7D", /*#__PURE__*/(0,jsx_runtime.jsx)(DownloadOutlined/* default */.Z, {})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
onClick: onClose,
children: ["\u5173\u95ED", /*#__PURE__*/(0,jsx_runtime.jsx)(CloseOutlined/* default */.Z, {})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "preview-wrp-group",
ref: previewWrapperRef,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
className: "image-preview",
src: url,
alt: "\u9884\u89C8\u5927\u56FE",
style: {
transform: "rotate(".concat(deg, "deg)")
}
})
})]
})
});
});
/***/ }),
/***/ 74921:
/*!*************************************************************!*\
!*** ./src/components/markdown-editor/code-block/index.tsx ***!
\*************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ h: function() { return /* binding */ MyCodeMirror; }
/* harmony export */ });
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js */ 26801);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js */ 11006);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! antd */ 57809);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! antd */ 78241);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! antd */ 3113);
/* harmony import */ var codemirror__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! codemirror */ 89780);
/* harmony import */ var codemirror__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(codemirror__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var codemirror_lib_codemirror_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! codemirror/lib/codemirror.css */ 83164);
/* harmony import */ var codemirror_theme_blackboard_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! codemirror/theme/blackboard.css */ 45215);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
var Option = antd__WEBPACK_IMPORTED_MODULE_7__["default"].Option;
//https://github.com/codemirror/CodeMirror/issues/4838
var formItemLayout = {
labelCol: {
span: 4
},
wrapperCol: {
span: 20
}
};
var LanguageDesc = {
asp: ['ASP', 'vbscript'],
actionscript: ['ActionScript(3.0)/Flash/Flex', 'clike'],
bash: ['Bash/Bat', 'shell'],
css: ['CSS', 'css'],
c: ['C', 'clike'],
cpp: ['C++', 'clike'],
csharp: ['C#', 'clike'],
coffeescript: ['CoffeeScript', 'coffeescript'],
d: ['D', 'd'],
dart: ['Dart', 'dart'],
delphi: ['Delphi/Pascal', 'pascal'],
erlang: ['Erlang', 'erlang'],
go: ['Golang', 'go'],
groovy: ['Groovy', 'groovy'],
html: ['HTML', 'text/html'],
java: ['Java', 'clike'],
json: ['JSON', 'text/json'],
javascript: ['Javascript', 'javascript'],
lua: ['Lua', 'lua'],
less: ['LESS', 'css'],
markdown: ['Markdown', 'gfm'],
'objective-c': ['Objective-C', 'clike'],
php: ['PHP', 'php'],
perl: ['Perl', 'perl'],
python: ['Python', 'python'],
r: ['R', 'r'],
rst: ['reStructedText', 'rst'],
ruby: ['Ruby', 'ruby'],
sql: ['SQL', 'sql'],
sass: ['SASS/SCSS', 'sass'],
shell: ['Shell', 'shell'],
scala: ['Scala', 'clike'],
swift: ['Swift', 'clike'],
vb: ['VB/VBScript', 'vb'],
xml: ['XML', 'text/xml'],
yaml: ['YAML', 'yaml']
};
/* harmony default export */ __webpack_exports__.Z = (function (_ref) {
var callback = _ref.callback,
onCancel = _ref.onCancel;
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)('python'),
_useState2 = _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1___default()(_useState, 2),
mode = _useState2[0],
setMode = _useState2[1];
function onSetMode(value) {
setMode(LanguageDesc[value][1]);
}
function onSubmit(values) {
callback(values);
}
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, formItemLayout), {}, {
className: "code-block-panel",
initialValues: {
language: 'python',
content: ''
},
onFinish: onSubmit,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(antd__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.Item, {
label: "\u4EE3\u7801\u8BED\u8A00",
name: "language",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(antd__WEBPACK_IMPORTED_MODULE_7__["default"], {
getPopupContainer: function getPopupContainer(trigger) {
return trigger.parentNode;
},
onChange: onSetMode,
children: Object.keys(LanguageDesc).map(function (item) {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(Option, {
value: item,
children: LanguageDesc[item][0]
}, item);
})
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(antd__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.Item, {
label: "\u4EE3\u7801\u5185\u5BB9",
name: "content",
rules: [{
required: true,
message: '请输入代码内容'
}],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(MyCodeMirror, {
mode: mode
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
className: "flex-container flex-end",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(antd__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .ZP, {
type: "primary",
htmlType: "submit",
style: {
marginRight: 10
},
children: "\u786E\u5B9A"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(antd__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .ZP, {
type: "ghost",
onClick: onCancel,
children: "\u53D6\u6D88"
})]
})]
}));
});
function MyCodeMirror(_ref2) {
var value = _ref2.value,
onChange = _ref2.onChange,
mode = _ref2.mode,
_ref2$options = _ref2.options,
options = _ref2$options === void 0 ? {} : _ref2$options;
var el = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)();
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(),
_useState4 = _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1___default()(_useState3, 2),
cm = _useState4[0],
setCm = _useState4[1];
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
if (cm) {
var onChangeHandler = function onChangeHandler(cm) {
var content = cm.getValue();
onChange && onChange(content);
};
cm.on('change', onChangeHandler);
return function () {
cm.off('change', onChangeHandler);
};
}
}, [cm, onChange]);
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
if (cm) {
cm.setOption('mode', mode);
}
}, [cm, mode]);
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
if (cm) {
if (value !== cm.getValue() || value === '') {
setTimeout(function () {
cm.setValue(value || '');
}, 300);
}
}
}, [cm, value]);
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
if (el.current && !cm) {
var instance = codemirror__WEBPACK_IMPORTED_MODULE_3___default().fromTextArea(el.current, _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({
mode: mode,
lineNumbers: true,
lineWrapping: true,
autoCloseBrackets: true,
tabSize: 4,
autofocus: true,
autoCloseTags: true,
matchBrackets: true,
styleActiveLine: true
}, options));
setCm(instance);
}
}, [el.current, cm]);
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
className: "my-codemirror-container",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("textarea", {
ref: el
})
});
}
/***/ }),
/***/ 22387:
/*!***************************************************************!*\
!*** ./src/components/markdown-editor/index.tsx + 10 modules ***!
\***************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ markdown_editor; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/createForOfIteratorHelper.js
var createForOfIteratorHelper = __webpack_require__(98190);
var createForOfIteratorHelper_default = /*#__PURE__*/__webpack_require__.n(createForOfIteratorHelper);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(10574);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(39343);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(11006);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/defineProperty.js
var defineProperty = __webpack_require__(22060);
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./node_modules/_codemirror@5.58.2@codemirror/lib/codemirror.js
var codemirror = __webpack_require__(89780);
var codemirror_default = /*#__PURE__*/__webpack_require__.n(codemirror);
// EXTERNAL MODULE: ./node_modules/_resize-observer-polyfill@1.5.1@resize-observer-polyfill/dist/ResizeObserver.es.js
var ResizeObserver_es = __webpack_require__(76374);
// EXTERNAL MODULE: ./node_modules/_codemirror@5.58.2@codemirror/lib/codemirror.css
var lib_codemirror = __webpack_require__(83164);
// EXTERNAL MODULE: ./node_modules/_codemirror@5.58.2@codemirror/addon/edit/closetag.js
var closetag = __webpack_require__(6313);
// EXTERNAL MODULE: ./node_modules/_codemirror@5.58.2@codemirror/addon/edit/closebrackets.js
var closebrackets = __webpack_require__(25717);
// EXTERNAL MODULE: ./node_modules/_codemirror@5.58.2@codemirror/addon/display/placeholder.js
var placeholder = __webpack_require__(99498);
// EXTERNAL MODULE: ./node_modules/_codemirror@5.58.2@codemirror/mode/markdown/markdown.js
var markdown = __webpack_require__(25419);
// EXTERNAL MODULE: ./node_modules/_codemirror@5.58.2@codemirror/mode/stex/stex.js
var stex = __webpack_require__(67549);
;// CONCATENATED MODULE: ./src/components/markdown-editor/index.less
// extracted by mini-css-extract-plugin
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 1 modules
var RenderHtml = __webpack_require__(80416);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/components/RenderHtml/stex.tsx
// const latexjs = require('latex-l.js/dist/latex.js');
// import "latex-l.js/dist/css/base.css"
/* harmony default export */ var RenderHtml_stex = (function (_ref) {
var _ref$value = _ref.value,
value = _ref$value === void 0 ? '' : _ref$value,
className = _ref.className,
showTextOnly = _ref.showTextOnly,
showLines = _ref.showLines,
_ref$style = _ref.style,
style = _ref$style === void 0 ? {} : _ref$style;
var html = (0,_react_17_0_2_react.useMemo)(function () {
// try {
// const latex = value || 'This is some text';
// let generator = new latexjs.default.HtmlGenerator({ hyphenate: true })
// let doc = latexjs.default.parse(latex, { generator: generator }).htmlDocument()
// return doc.body.innerHTML
// }catch(e){
// console.log("e:",e)
// return "错误的latex语法请检查"
// }
return "";
}, [value]);
return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
dangerouslySetInnerHTML: {
__html: html
}
})
});
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(26801);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
;// CONCATENATED MODULE: ./src/components/markdown-editor/toolbar/index.less
// extracted by mini-css-extract-plugin
;// CONCATENATED MODULE: ./src/components/markdown-editor/css/iconfont.css
// extracted by mini-css-extract-plugin
;// CONCATENATED MODULE: ./src/components/markdown-editor/toolbar/index.tsx
var DEFAULTICONS = [{
title: '粗体',
icon: 'icon-bold',
actionName: 'bold'
}, {
title: '斜体',
icon: 'icon-italic',
actionName: 'italic'
}, '|', {
title: '无序列表',
icon: 'icon-unorder-list',
actionName: 'list-ul'
}, {
title: '有序列表',
icon: 'icon-order-list',
actionName: 'list-ol'
}, '|', {
title: '行内代码',
icon: 'icon-code',
actionName: 'code'
}, {
title: '代码块(多语言风格)',
icon: 'icon-file-code',
actionName: 'code-block'
}, {
title: '链接',
icon: 'icon-link',
actionName: 'link'
}, '|', {
title: '行内公式',
icon: 'icon-sum',
actionName: 'inline-latex'
}, {
title: '多行公式',
icon: 'icon-formula',
actionName: 'latex'
}, '|', {
title: '添加图片',
icon: 'icon-picture',
actionName: 'upload-image'
}, {
title: '表格',
icon: 'icon-table',
actionName: 'add-table'
}, '|', {
title: '换行',
icon: 'icon-minus',
actionName: 'line-break'
}, {
title: '清空',
icon: 'icon-eraser',
actionName: 'eraser'
}];
function AButton(_ref) {
var onActionCallback = _ref.onActionCallback,
title = _ref.title,
icon = _ref.icon,
actionName = _ref.actionName,
_ref$className = _ref.className,
className = _ref$className === void 0 ? '' : _ref$className,
children = _ref.children;
function onAction() {
onActionCallback(actionName);
}
return /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
title: title,
className: className,
onClick: onAction,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "md-iconfont ".concat(icon)
}), children]
});
}
/* harmony default export */ var toolbar = (function (_ref2) {
var watch = _ref2.watch,
showNullButton = _ref2.showNullButton,
showNullProgramButton = _ref2.showNullProgramButton,
onActionCallback = _ref2.onActionCallback,
fullScreen = _ref2.fullScreen,
insertTemp = _ref2.insertTemp,
hidetoolBar = _ref2.hidetoolBar;
var icons = [].concat(DEFAULTICONS, [{
title: "".concat(watch ? '关闭实时预览' : '开启实时预览'),
icon: "".concat(watch ? 'icon-eye-slash' : 'icon-eye'),
actionName: 'trigger-watch'
}]);
return /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
className: "markdown-toolbar-container",
children: [!hidetoolBar && icons.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
children: item.actionName ? /*#__PURE__*/(0,jsx_runtime.jsx)(AButton, objectSpread2_default()(objectSpread2_default()({}, item), {}, {
onActionCallback: onActionCallback
})) : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "v-line"
})
}, index);
}), showNullButton ? /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(AButton, {
icon: "icon-edit insert-blank",
className: "btn-null",
title: "\u589E\u52A0\u586B\u7A7A",
actionName: "add-null-ch",
onActionCallback: onActionCallback,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "fill-tip",
children: "\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"
})
})
}) : null, showNullProgramButton ? /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("li", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(AButton, {
icon: "icon-edit insert-blank",
className: "btn-null",
title: "\u589E\u52A0\u586B\u7A7A",
actionName: "add-signal",
onActionCallback: onActionCallback,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "fill-tip",
children: "\u6DFB\u52A0\u5355\u884C\u586B\u7A7A\u9879"
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(AButton, {
icon: "icon-uniE900 insert-blank",
className: "btn-null",
title: "\u589E\u52A0\u586B\u7A7A",
actionName: "add-multiple",
onActionCallback: onActionCallback,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "fill-tip",
children: "\u6DFB\u52A0\u591A\u884C\u586B\u7A7A\u9879"
})
})
})]
}) : null, insertTemp && /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(AButton, {
icon: "icon-edit",
className: "btn-null",
title: "\u63D2\u5165\u6A21\u677F",
actionName: "inster-template-".concat(insertTemp),
onActionCallback: onActionCallback,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "fill-tip",
children: "\u63D2\u5165\u6A21\u677F"
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
className: "btn-full-screen",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(AButton, {
icon: "".concat(fullScreen ? 'icon-shrink' : 'icon-enlarge'),
title: fullScreen ? '关闭全屏' : '开启全屏',
actionName: "trigger-full-screen",
onActionCallback: onActionCallback
})
})]
});
});
// EXTERNAL MODULE: ./src/components/modal.tsx
var modal = __webpack_require__(90463);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
var es_form = __webpack_require__(78241);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
var input = __webpack_require__(1056);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es_button = __webpack_require__(3113);
;// CONCATENATED MODULE: ./src/components/markdown-editor/link/index.tsx
var formItemLayout = {
labelCol: {
span: 4
},
wrapperCol: {
span: 20
}
};
/* harmony default export */ var markdown_editor_link = (function (_ref) {
var callback = _ref.callback,
onCancel = _ref.onCancel;
function onSubmit(values) {
callback(values);
}
return /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, objectSpread2_default()(objectSpread2_default()({}, formItemLayout), {}, {
initialValues: {
link: 'http://',
title: ''
},
className: "link-panel",
onFinish: onSubmit,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u94FE\u63A5\u5730\u5740",
name: "link",
rules: [{
required: true,
message: '请输入链接地址'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u94FE\u63A5\u6807\u9898",
name: "title",
rules: [{
required: true,
message: '请输入链接标题'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "flex-container flex-end",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
htmlType: "submit",
style: {
marginRight: 10
},
children: "\u786E\u5B9A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "ghost",
onClick: onCancel,
children: "\u53D6\u6D88"
})]
})]
}));
});
// EXTERNAL MODULE: ./src/components/markdown-editor/code-block/index.tsx
var code_block = __webpack_require__(74921);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
var message = __webpack_require__(8591);
;// CONCATENATED MODULE: ./src/components/markdown-editor/upload-image/index.less
// extracted by mini-css-extract-plugin
// EXTERNAL MODULE: ./src/pages/tasks/util.js
var util = __webpack_require__(51811);
;// CONCATENATED MODULE: ./src/components/markdown-editor/upload-image/index.tsx
var useForm = es_form/* default */.Z.useForm;
var style = {
width: 280,
marginRight: 10
};
var upload_image_formItemLayout = {
labelCol: {
span: 5
},
wrapperCol: {
span: 19
}
};
/* harmony default export */ var upload_image = (function (_ref) {
var callback = _ref.callback,
onCancel = _ref.onCancel;
var _useForm = useForm(),
_useForm2 = slicedToArray_default()(_useForm, 1),
form = _useForm2[0];
var nameRef = (0,_react_17_0_2_react.useRef)();
function onSubmit(values) {
callback(objectSpread2_default()(objectSpread2_default()({}, values), {}, {
name: nameRef.current
}));
}
function onAddUrl(data, file) {
if (data.status === -1) {
message/* default */.ZP.error(data.message);
return;
}
form.setFieldsValue({
src: "/api/attachments/".concat(data.id),
type: file.type
});
}
function onFileChange(e) {
var file = e.target.files[0];
nameRef.current = file.name;
uploadImage(file, onAddUrl);
}
return /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, objectSpread2_default()(objectSpread2_default()({
form: form
}, upload_image_formItemLayout), {}, {
className: "upload-image-panel",
onFinish: onSubmit,
style: {
width: 470,
overflow: "hidden"
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u56FE\u7247\u5730\u5740",
required: true,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "flex-container",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
noStyle: true,
name: "src",
rules: [{
required: true,
message: '请输入文件地址'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
style: style
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(UploadButton, {
onFileChange: onFileChange
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u56FE\u7247\u63CF\u8FF0",
name: "alt"
// rules={[{ required: true, message: '请输入图片描述' }]}
,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
style: {
width: 264
}
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z.Item, {
style: {
textAlign: "right"
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
htmlType: "submit",
style: {
marginRight: 10
},
children: "\u786E\u5B9A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "default",
onClick: onCancel,
children: "\u53D6\u6D88"
})]
})]
}));
});
function UploadButton(_ref2) {
var onFileChange = _ref2.onFileChange;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("label", {
className: "upload-button",
style: {
cursor: "pointer"
},
children: ["\u672C\u5730\u4E0A\u4F20", /*#__PURE__*/(0,jsx_runtime.jsx)("input", {
type: "file",
onChange: onFileChange
})]
});
}
function uploadImage(file, callback) {
if (!file) {
throw new String('没有文件');
return;
}
var formData = new FormData();
formData.append('editormd-image-file', file);
formData.append('file_param_name', 'editormd-image-file');
formData.append('byxhr', 'true');
var xhr = new window.XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('load', function (response) {
callback(JSON.parse(response.target.responseText), file);
}, false);
xhr.addEventListener('error', function (error) {
console.error(error);
}, false);
xhr.open('POST', "".concat(util/* apiPref */.KI, "/api/attachments.json"));
xhr.send(formData);
}
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/radio/index.js + 5 modules
var es_radio = __webpack_require__(5112);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input-number/index.js + 14 modules
var input_number = __webpack_require__(85731);
;// CONCATENATED MODULE: ./src/components/markdown-editor/add-table-panel/index.tsx
var RadioGroup = es_radio/* default.Group */.ZP.Group;
var add_table_panel_style = {
margin: '0 8px'
};
/* harmony default export */ var add_table_panel = (function (_ref) {
var callback = _ref.callback,
onCancel = _ref.onCancel;
function onSubmit(values) {
callback(values);
}
return /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
className: "add-table-panel",
initialValues: {
row: 3,
col: 2,
align: 'default'
},
onFinish: onSubmit,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "flex-container",
style: {
alignItems: "baseline"
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: add_table_panel_style,
children: "\u5355\u5143\u683C\u6570\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: add_table_panel_style,
children: "\u884C\u6570"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "row",
rules: [{
required: true,
message: '请输入行数'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: add_table_panel_style,
children: "\u5217\u6570"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "col",
rules: [{
required: true,
message: '请输入列数'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "flex-container",
style: {
marginTop: 12,
alignItems: "baseline"
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: add_table_panel_style,
children: "\u5BF9\u9F50\u65B9\u5F0F\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "align",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(RadioGroup, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
value: "default",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "fa fa-align-justify"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
value: "left",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "fa fa-align-left"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
value: "center",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "fa fa-align-center"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
value: "right",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "fa fa-align-right"
})
})]
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "flex-container flex-end",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
htmlType: "submit",
style: {
marginRight: 10
},
children: "\u786E\u5B9A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "ghost",
onClick: onCancel,
children: "\u53D6\u6D88"
})]
})]
});
});
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(67871);
// EXTERNAL MODULE: ./src/utils/fetch.ts
var fetch = __webpack_require__(15830);
// EXTERNAL MODULE: ./node_modules/_uuid@8.3.0@uuid/dist/esm-browser/v4.js + 4 modules
var v4 = __webpack_require__(1012);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
var es_modal = __webpack_require__(43418);
;// CONCATENATED MODULE: ./src/components/markdown-editor/constant.ts
var LINK = 'link';
var UPLOAD_IMAGE = 'upload-image';
var CODE_BLOCK = 'code-block';
var ADD_TABLE = 'add-table';
var HRLINE = '------------';
var ALIGNSIGN = {
"default": HRLINE,
left: ":".concat(HRLINE),
center: ":".concat(HRLINE, ":"),
right: "".concat(HRLINE, ":")
};
// EXTERNAL MODULE: ./src/components/useInterval.tsx
var useInterval = __webpack_require__(86219);
;// CONCATENATED MODULE: ./src/components/markdown-editor/index.tsx
var _DEFAULTKEYMAP, _TitleDesc;
function noop() {}
var pending = 0;
var StorageTimeTicket = 10000;
var NULL_CH = '▁';
var ADD_MULTI = '@▁▁@';
var ADD_SINGLE = '@▁@';
var TEMP1 = '\n**模板标题**\n模板正文内容可输入文本内容和粘贴图片等操作'; //课程须知模板
function processSize(size) {
return !/^\d+$/.test(size) ? size : "".concat(size, "px");
}
var isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0;
var key = isMac ? 'Cmd' : 'Ctrl';
var officeSix = ["pptm", "pptx", "ppt", "pot", "pps", "ppa", "potx", "ppsx", "ppam", "pptm", "potm", "ppsm", "doc", "docx", "dot", "dotx", "docm", "dotm", "xls", "xlsx", "csv", "xlt", "xla", "xltx", "xlsm", "xltm", "xlam", "xlsb"];
var DEFAULTKEYMAP = (_DEFAULTKEYMAP = {}, defineProperty_default()(_DEFAULTKEYMAP, key + '-B', 'bold'), defineProperty_default()(_DEFAULTKEYMAP, key + '-I', 'italic'), _DEFAULTKEYMAP);
var TitleDesc = (_TitleDesc = {}, defineProperty_default()(_TitleDesc, LINK, '添加链接'), defineProperty_default()(_TitleDesc, CODE_BLOCK, '添加代码块'), defineProperty_default()(_TitleDesc, UPLOAD_IMAGE, '添加文件'), defineProperty_default()(_TitleDesc, ADD_TABLE, '添加表格'), _TitleDesc);
//https://codemirror.net/demo
//The height can be set through CSS (by giving the .CodeMirror class a height property), or by calling the cm's setSize method.
/* harmony default export */ var markdown_editor = (function (_ref) {
var _ref$defaultValue = _ref.defaultValue,
defaultValue = _ref$defaultValue === void 0 ? '' : _ref$defaultValue,
onChange = _ref.onChange,
_ref$width = _ref.width,
width = _ref$width === void 0 ? '100%' : _ref$width,
_ref$height = _ref.height,
height = _ref$height === void 0 ? 400 : _ref$height,
_ref$miniToolbar = _ref.miniToolbar,
miniToolbar = _ref$miniToolbar === void 0 ? false : _ref$miniToolbar,
_ref$isFocus = _ref.isFocus,
isFocus = _ref$isFocus === void 0 ? false : _ref$isFocus,
watch = _ref.watch,
insertTemp = _ref.insertTemp,
_ref$mode = _ref.mode,
mode = _ref$mode === void 0 ? "markdown" : _ref$mode,
_ref$id = _ref.id,
id = _ref$id === void 0 ? 'markdown-editor-id' : _ref$id,
_ref$showResizeBar = _ref.showResizeBar,
showResizeBar = _ref$showResizeBar === void 0 ? false : _ref$showResizeBar,
_ref$noStorage = _ref.noStorage,
noStorage = _ref$noStorage === void 0 ? false : _ref$noStorage,
_ref$showNullButton = _ref.showNullButton,
showNullButton = _ref$showNullButton === void 0 ? false : _ref$showNullButton,
_ref$showNullProgramB = _ref.showNullProgramButton,
showNullProgramButton = _ref$showNullProgramB === void 0 ? false : _ref$showNullProgramB,
_ref$hidetoolBar = _ref.hidetoolBar,
hidetoolBar = _ref$hidetoolBar === void 0 ? false : _ref$hidetoolBar,
_ref$fullScreen = _ref.fullScreen,
fullScreen = _ref$fullScreen === void 0 ? false : _ref$fullScreen,
onBlur = _ref.onBlur,
onCMBeforeChange = _ref.onCMBeforeChange,
onFullScreen = _ref.onFullScreen,
_ref$className = _ref.className,
className = _ref$className === void 0 ? '' : _ref$className,
_ref$disablePaste = _ref.disablePaste,
disablePaste = _ref$disablePaste === void 0 ? false : _ref$disablePaste,
_ref$disabled = _ref.disabled,
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
_ref$disabledFill = _ref.disabledFill,
disabledFill = _ref$disabledFill === void 0 ? false : _ref$disabledFill,
_ref$placeholder = _ref.placeholder,
placeholder = _ref$placeholder === void 0 ? '' : _ref$placeholder,
_ref$values = _ref.values,
values = _ref$values === void 0 ? '' : _ref$values;
var _useState = (0,_react_17_0_2_react.useState)(null),
_useState2 = slicedToArray_default()(_useState, 2),
cm = _useState2[0],
setCm = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(defaultValue),
_useState4 = slicedToArray_default()(_useState3, 2),
value = _useState4[0],
setValue = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(watch),
_useState6 = slicedToArray_default()(_useState5, 2),
preview = _useState6[0],
setPreview = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)(fullScreen),
_useState8 = slicedToArray_default()(_useState7, 2),
isFull = _useState8[0],
setIsFull = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)(''),
_useState10 = slicedToArray_default()(_useState9, 2),
action = _useState10[0],
setAction = _useState10[1];
var _useState11 = (0,_react_17_0_2_react.useState)(0),
_useState12 = slicedToArray_default()(_useState11, 2),
lastedUpdateTime = _useState12[0],
setLastedUpdateTime = _useState12[1];
var _useState13 = (0,_react_17_0_2_react.useState)(height),
_useState14 = slicedToArray_default()(_useState13, 2),
h = _useState14[0],
setH = _useState14[1];
var _useState15 = (0,_react_17_0_2_react.useState)(false),
_useState16 = slicedToArray_default()(_useState15, 2),
tip = _useState16[0],
setTip = _useState16[1];
var uuidRef = (0,_react_17_0_2_react.useRef)((0,v4/* default */.Z)());
var openPhoneRef = (0,_react_17_0_2_react.useRef)(false);
var timer = (0,_react_17_0_2_react.useRef)();
var cmEl = (0,_react_17_0_2_react.useRef)();
var containerEl = (0,_react_17_0_2_react.useRef)();
var resizeBarEl = (0,_react_17_0_2_react.useRef)();
var previewEl = (0,_react_17_0_2_react.useRef)();
var checkFiles = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var _res$attachments;
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return (0,fetch/* default */.ZP)("/api/attachments/distinct_hash_val.json", {
method: "post",
body: {
hash_val: uuidRef.current
}
});
case 2:
res = _context.sent;
if (!!(res !== null && res !== void 0 && (_res$attachments = res.attachments) !== null && _res$attachments !== void 0 && _res$attachments.length)) {
console.log("cm:", cm, cmEl);
res.attachments.map(function (item) {
if (item.content_type.indexOf("image") > -1) {
cm.replaceSelection("![,](/api/attachments/".concat(item.id, "?type=").concat(item.content_type, ")"));
} else if (item.content_type.indexOf("video") > -1) {
cm.replaceSelection("<video width=\"100%\" controls src=\"".concat(env/* default */.Z.API_SERVER, "/api/attachments/").concat(data.id, "\"></video>"));
} else if (item.content_type.indexOf("pdf") > -1) {
cm.replaceSelection("<a href=\"".concat(env/* default */.Z.API_SERVER, "/api/attachments/").concat(item.id, "?type=").concat(item.content_type, "&disposition=inline\" target=\"_blank\">").concat(item.name, "</a>"));
} else {
cm.replaceSelection("[".concat(item.name, "](").concat(env/* default */.Z.API_SERVER, "/api/attachments/").concat(item.id, "?type=").concat(item.content_type, ")"));
}
});
}
case 4:
case "end":
return _context.stop();
}
}, _callee);
}));
return function checkFiles() {
return _ref2.apply(this, arguments);
};
}();
// useEffect(() => {
// setValue(defaultValue)
// cm?.setValue(defaultValue)
// },[])
(0,_react_17_0_2_react.useEffect)(function () {
var scrollTop = window.scrollY || window.pageYOffset;
setValue(values);
cm === null || cm === void 0 || cm.setValue(values);
window.scrollTo(0, scrollTop);
}, [values]);
(0,_react_17_0_2_react.useEffect)(function () {
onFullScreen === null || onFullScreen === void 0 || onFullScreen(isFull);
}, [isFull]);
(0,_react_17_0_2_react.useEffect)(function () {
if (cmEl.current) {
var onPaste = function onPaste(_, e) {
if (disablePaste) {
e.preventDefault();
return;
}
var clipboardData = e.clipboardData;
if (clipboardData) {
var types = clipboardData.types.toString();
var items = clipboardData.items;
if (types === 'Files' || clipboardData.types.indexOf("Files") > -1) {
e.preventDefault();
if (mode == "stex") return;
try {
var _items$;
var item = items[1];
if (((_items$ = items[0]) === null || _items$ === void 0 ? void 0 : _items$.kind) === 'file') {
item = items[0];
}
var file = item.getAsFile();
var fileSix = file.name.split(".").pop();
// console.log("item:", item, file, item?.type?.match(/^video\//i))
uploadImage(file, function (data) {
if (data.id) {
var _file$type, _file$type2, _file$type3;
if ((file === null || file === void 0 || (_file$type = file.type) === null || _file$type === void 0 ? void 0 : _file$type.indexOf("image")) > -1) {
instance.replaceSelection("![,](/api/attachments/".concat(data.id, "?type=").concat(data.content_type, ")"));
} else if ((file === null || file === void 0 || (_file$type2 = file.type) === null || _file$type2 === void 0 ? void 0 : _file$type2.indexOf("video")) > -1) {
instance.replaceSelection("<video width=\"100%\" controls src=\"".concat(env/* default */.Z.API_SERVER, "/api/attachments/").concat(data.id, "\"></video>"));
} else if ((file === null || file === void 0 || (_file$type3 = file.type) === null || _file$type3 === void 0 ? void 0 : _file$type3.indexOf("pdf")) > -1) {
instance.replaceSelection("<a href=\"".concat(env/* default */.Z.API_SERVER, "/api/attachments/").concat(data.id, "?type=").concat(file.type, "&disposition=inline\" target=\"_blank\">").concat(file.name, "</a>"));
} else if (officeSix.includes(fileSix)) {
instance.replaceSelection("<a href=\"".concat(env/* default */.Z.API_SERVER, "/api/attachments/").concat(data.id, "?type=office&disposition=inline\" target=\"_blank\">").concat(file.name, "</a>"));
} else {
instance.replaceSelection("[".concat(file.name, "](").concat(env/* default */.Z.API_SERVER, "/api/attachments/").concat(data.id, "?type=").concat(data.content_type, ")"));
}
} else {
if ((data === null || data === void 0 ? void 0 : data.status) === 401) document.location.href = '/user/login';
}
});
} catch (e) {
message/* default */.ZP.warning("请使用chrome浏览器粘贴");
}
return true;
} else {
//toMarkdown ?
// let html = clipboardData.getData('text/html')
return true;
}
}
return true;
};
var instance = codemirror_default().fromTextArea(cmEl.current, {
mode: mode,
// inputStyle: 'contenteditable',
lineNumbers: miniToolbar ? false : true,
lineWrapping: true,
value: defaultValue,
autoCloseTags: showNullProgramButton ? false : true,
autoCloseBrackets: true
});
instance.on("keyup", function (cm, event) {
if (event.keyCode === 8) {
if (cm.getValue() == "") {
instance.setOption("placeholder", placeholder);
} else {
instance.setOption("placeholder", null);
}
}
});
instance.on("keydown", function (cm, event) {
if (event.keyCode === 8) {
var pos = deleteAtSymbol(cm);
if (pos) {
event.preventDefault();
}
}
});
isFocus && instance.focus();
instance.on('paste', onPaste);
instance.on('dragleave', function (data, e) {
containerEl.current.classList.remove("mouse-hover-md");
});
instance.on('dragover', function (data, e) {
containerEl.current.classList.add("mouse-hover-md");
});
instance.on('drop', function (data, e) {
containerEl.current.classList.add("mouse-hover-md");
// var file;
var files;
// Check if files were dropped
files = e.dataTransfer.files;
if (files.length > 0) {
e.preventDefault();
e.stopPropagation();
// file = files[0];
// alert('File: ' + file.name);
// return false;
var _loop = function _loop() {
var file = files[i];
var fileSix = file.name.split(".").pop();
uploadImage(file, function (data) {
if (data.id) {
var _file$type4, _file$type5, _file$type6;
if ((file === null || file === void 0 || (_file$type4 = file.type) === null || _file$type4 === void 0 ? void 0 : _file$type4.indexOf("image")) > -1) {
instance.replaceSelection("![,](/api/attachments/".concat(data.id, "?type=").concat(data.content_type, ")"));
} else if ((file === null || file === void 0 || (_file$type5 = file.type) === null || _file$type5 === void 0 ? void 0 : _file$type5.indexOf("video")) > -1) {
instance.replaceSelection("<video width=\"100%\" controls src=\"".concat(env/* default */.Z.API_SERVER, "/api/attachments/").concat(data.id, "\"></video>"));
} else if ((file === null || file === void 0 || (_file$type6 = file.type) === null || _file$type6 === void 0 ? void 0 : _file$type6.indexOf("pdf")) > -1) {
instance.replaceSelection("<a href=\"".concat(env/* default */.Z.API_SERVER, "/api/attachments/").concat(data.id, "?type=").concat(file.type, "&disposition=inline\" target=\"_blank\">").concat(file.name, "</a>"));
} else if (officeSix.includes(fileSix)) {
instance.replaceSelection("<a href=\"".concat(env/* default */.Z.API_SERVER, "/api/attachments/").concat(data.id, "?type=office&disposition=inline\" target=\"_blank\">").concat(file.name, "</a>"));
} else {
instance.replaceSelection("[".concat(file.name, "](").concat(env/* default */.Z.API_SERVER, "/api/attachments/").concat(data.id, "?type=").concat(data.content_type, ")"));
}
} else {
if ((data === null || data === void 0 ? void 0 : data.status) === 401) document.location.href = '/user/login';
}
});
};
for (var i = 0; i < files.length; i++) {
_loop();
}
// files.map((file:any) => {
// })
}
});
if (disabled) {
instance.on("beforeChange", function (instances, change) {
if (change.origin === "paste" || change.origin === "+input") {
change.cancel();
}
});
}
setCm(instance);
return function () {
instance.off('paste', onPaste);
};
}
}, []);
var resizeEditorBodyHeight = (0,_react_17_0_2_react.useCallback)(function () {
if (containerEl.current) {
try {
// let toolH = containerEl.current.getElementsByClassName('markdown-toolbar-container')[0].offsetHeight
// let mdBody = containerEl.current.getElementsByClassName('markdown-editor-body')[0]
// if (!isFull) {
// mdBody.style.height = `${h - toolH}px`
// } else {
// mdBody.style.height = `calc(100vh - ${toolH}px)`
// }
} catch (error) {
console.log(error, '---- to set md editor body height');
}
}
}, [h, containerEl, isFull]);
(0,_react_17_0_2_react.useEffect)(function () {
function onLayout() {
var ro = new ResizeObserver_es/* default */.Z(function (entries) {
var _iterator = createForOfIteratorHelper_default()(entries),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var entry = _step.value;
if (entry.target.offsetHeight > 0 || entry.target.offsetWidth > 0) {
resizeEditorBodyHeight();
cm.setSize('100%', '100%');
cm.refresh();
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
});
ro.observe(cmEl.current.parentElement);
return ro;
}
if (cm) {
var ro = onLayout();
return function () {
var _cmEl$current, _cmEl$current2;
if ((_cmEl$current = cmEl.current) !== null && _cmEl$current !== void 0 && _cmEl$current.parentElement) ro.unobserve((_cmEl$current2 = cmEl.current) === null || _cmEl$current2 === void 0 ? void 0 : _cmEl$current2.parentElement);
};
}
}, [cm, resizeEditorBodyHeight]);
//keymap
(0,_react_17_0_2_react.useEffect)(function () {
if (cm) {
var keymap = [];
var _loop2 = function _loop2() {
var _Object$entries$_i = slicedToArray_default()(_Object$entries[_i], 2),
k = _Object$entries$_i[0],
value = _Object$entries$_i[1];
var map = defineProperty_default()({}, k, function () {
onActionCallback(value);
});
keymap.push(map);
cm.addKeyMap(map);
};
for (var _i = 0, _Object$entries = Object.entries(DEFAULTKEYMAP); _i < _Object$entries.length; _i++) {
_loop2();
}
timer.current = setInterval(function () {
if (openPhoneRef.current) {
checkFiles();
}
}, 4000);
return function () {
clearInterval(timer.current);
for (var _i2 = 0, _keymap = keymap; _i2 < _keymap.length; _i2++) {
var m = _keymap[_i2];
cm.removeKeyMap(m);
}
};
}
}, [cm]);
(0,_react_17_0_2_react.useEffect)(function () {
if (fullScreen !== isFull) {
setIsFull(fullScreen);
}
}, [fullScreen]);
(0,useInterval/* default */.Z)(function () {
if (!noStorage && lastedUpdateTime > 0) {
var currentTime = new Date().getTime();
var lastedValue = window.sessionStorage.getItem(id);
if (currentTime >= lastedUpdateTime + StorageTimeTicket && (!lastedValue || lastedValue !== value)) {
window.sessionStorage.setItem(id, value);
setTip(true);
}
}
}, StorageTimeTicket);
(0,_react_17_0_2_react.useEffect)(function () {
setPreview(watch);
}, [cm, watch]);
(0,_react_17_0_2_react.useEffect)(function () {
if (cm) {
isFocus && cm.focus();
}
}, [cm, isFocus]);
(0,_react_17_0_2_react.useEffect)(function () {
if (preview && cm) {
var syncScroll = function syncScroll(e) {
var target = e.target;
if (previewEl.current) {
var ratio = target.scrollTop / target.scrollHeight;
previewEl.current.scrollTop = previewEl.current.scrollHeight * ratio;
}
};
var scrollEl = cm.getScrollerElement();
scrollEl.addEventListener('scroll', syncScroll);
return function () {
scrollEl.removeEventListener('scroll', syncScroll);
};
}
}, [cm, preview]);
(0,_react_17_0_2_react.useEffect)(function () {
if (cm && onCMBeforeChange) {
var onChangeHandler = function onChangeHandler(cm, change) {
onCMBeforeChange(cm, change);
};
cm.on('beforeChange', onChangeHandler);
return function () {
cm.off('beforeChange', onChangeHandler);
};
}
}, [cm, onCMBeforeChange]);
(0,_react_17_0_2_react.useEffect)(function () {
if (cm && onBlur) {
var onBlurHandler = function onBlurHandler() {
onBlur(cm.getValue());
};
cm.on('blur', onBlurHandler);
return function () {
cm.off('blur', onBlurHandler);
};
}
}, [cm, onBlur]);
function deleteAtSymbol(cm, change) {
var doc = cm.getDoc();
var cursor = doc.getCursor();
var line = doc.getLine(cursor.line);
var ch = line.charAt(cursor.ch - 1);
var p1 = line.lastIndexOf("@▁@", cursor.ch);
var p2 = line.lastIndexOf("@▁▁@", cursor.ch);
var posStart = p1 > p2 ? p1 : p2;
var n = p1 > p2 ? 3 : 4;
if (ADD_MULTI.indexOf(ch) === -1) return null;
console.log("change1:", change, cm, line, cursor, posStart, p1, p2, ch);
if (posStart >= 0 && cursor.ch - posStart < 5) {
var posEnd = posStart + n;
doc.replaceRange("", {
line: cursor.line,
ch: posStart
}, {
line: cursor.line,
ch: posEnd
});
return {
line: cursor.line,
ch: posEnd
};
}
return null;
}
(0,_react_17_0_2_react.useEffect)(function () {
if (cm) {
var onChangeHandler = function onChangeHandler(cm, change) {
var content = cm.getValue();
setValue(content);
setLastedUpdateTime(new Date().getTime());
cm.getScrollerElement().dispatchEvent(new CustomEvent('scroll'));
if (onChange) {
if (showNullProgramButton) {
onChange(content, formatProgramFill(content));
} else {
onChange(content);
}
}
};
cm.on('change', onChangeHandler);
return function () {
cm.off('change', onChangeHandler);
};
}
}, [cm, onChange]);
(0,_react_17_0_2_react.useEffect)(function () {
if (cm) {
// isFocus && cm.focus()
if (defaultValue === null || defaultValue === undefined) {
cm.setValue('');
setValue('');
} else {
var scrollTop = window.scrollY || window.pageYOffset;
if (defaultValue !== cm.getValue()) {
cm.setValue(defaultValue);
setValue(defaultValue);
cm.setCursor(disabled ? 1 : cm.lineCount(), 0);
window.scrollTo(0, scrollTop);
}
}
}
}, [cm, defaultValue]);
var onActionCallback = (0,_react_17_0_2_react.useCallback)(function (actionName) {
var cursor = cm.getCursor();
var selection = cm.getSelection();
var selectionText = selection.split('\n');
switch (actionName) {
case 'bold':
cm.replaceSelection('**' + selection + '**');
if (selection === '') {
cm.setCursor(cursor.line, cursor.ch + 2);
}
return cm.focus();
case 'italic':
cm.replaceSelection('*' + selection + '*');
if (selection === '') {
cm.setCursor(cursor.line, cursor.ch + 1);
}
return cm.focus();
case 'code':
cm.replaceSelection('`' + selection + '`');
if (selection === '') {
cm.setCursor(cursor.line, cursor.ch + 1);
}
return cm.focus();
case 'inline-latex':
cm.replaceSelection('`$$' + selection + '$$`');
if (selection === '') {
cm.setCursor(cursor.line, cursor.ch + 3);
}
return cm.focus();
case 'latex':
cm.replaceSelection("```latex\n" + selection + "\n```");
cm.setCursor(cursor.line + 1, selection.length + 1);
return cm.focus();
case 'line-break':
cm.replaceSelection('<br/>\n');
return cm.focus();
case 'list-ul':
if (selection === '') {
cm.replaceSelection('- ' + selection);
} else {
cm.replaceSelection(selectionText.map(function (item) {
return item === '' ? '' : "- ".concat(item);
}).join('\n'));
}
return cm.focus();
case 'list-ol':
if (selection === '') {
cm.replaceSelection('1. ' + selection);
} else {
cm.replaceSelection(selectionText.map(function (item, index) {
return item === '' ? '' : "".concat(index + 1, ". ").concat(item);
}).join('\n'));
}
return cm.focus();
case 'add-null-ch':
if (selection === '') {
cm.setCursor(cursor.line, cursor.ch);
}
cm.replaceSelection(NULL_CH);
return cm.focus();
case 'add-signal':
if (selection === '') {
cm.setCursor(cursor.line, cursor.ch);
}
cm.replaceSelection(ADD_SINGLE);
return cm.focus();
case 'add-multiple':
if (selection === '') {
cm.setCursor(cursor.line, cursor.ch);
}
cm.replaceSelection(ADD_MULTI);
return cm.focus();
case 'inster-template-1':
if (selection === '') {
cm.setCursor(cursor.line, cursor.ch);
}
cm.replaceSelection(TEMP1);
return cm.focus();
case 'eraser':
cm.setValue('');
return cm.focus();
case 'trigger-watch':
setPreview(!preview);
return cm.focus();
case 'trigger-full-screen':
setIsFull(!isFull);
return cm.focus();
case LINK:
setAction(LINK);
return;
case CODE_BLOCK:
setAction(CODE_BLOCK);
return;
case UPLOAD_IMAGE:
setAction(UPLOAD_IMAGE);
return;
case ADD_TABLE:
setAction(ADD_TABLE);
return;
default:
throw new Error();
}
}, [cm, preview, isFull]);
var ExecutePluginAction = (0,_react_17_0_2_react.useCallback)(function (values) {
setAction('');
switch (action) {
case LINK:
var title = values.title,
link = values.link;
cm.replaceSelection("[".concat(title, "](").concat(link, ")"));
return cm.focus();
case CODE_BLOCK:
var language = values.language,
content = values.content;
cm.replaceSelection(['```' + language, content, '```'].join('\n'));
return cm.focus();
case UPLOAD_IMAGE:
var src = values.src,
alt = values.alt;
if (alt) {
cm.replaceSelection("![ ".concat(alt, " ]( ").concat(src, " \"").concat(alt, "\" )"));
} else {
cm.replaceSelection("![,](".concat(src, ")"));
}
return cm.focus();
case ADD_TABLE:
var row = values.row,
col = values.col,
align = values.align;
var table = '\n';
for (var r = 0; r < row; r++) {
var rows = [];
var heads = [];
for (var c = 0; c < col; c++) {
if (r === 1) {
heads.push(ALIGNSIGN[align]);
}
rows.push(' ');
}
if (r === 1) {
table += "| ".concat(heads.join(' | '), " |\n");
}
table += "| ".concat(rows.join(col === 1 ? '' : ' | '), " |\n");
}
cm.replaceSelection(table + '\n');
return cm.focus();
default:
throw new Error();
}
}, [cm, action]);
var PluginEl = (0,_react_17_0_2_react.useMemo)(function () {
switch (action) {
case LINK:
return /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor_link, {
callback: ExecutePluginAction,
onCancel: onCancel
});
case CODE_BLOCK:
return /*#__PURE__*/(0,jsx_runtime.jsx)(code_block/* default */.Z, {
callback: ExecutePluginAction,
onCancel: onCancel
});
case UPLOAD_IMAGE:
return /*#__PURE__*/(0,jsx_runtime.jsx)(upload_image, {
callback: ExecutePluginAction,
onCancel: onCancel
});
case ADD_TABLE:
return /*#__PURE__*/(0,jsx_runtime.jsx)(add_table_panel, {
callback: ExecutePluginAction,
onCancel: onCancel
});
default:
return null;
}
}, [action]);
function onCancel() {
setAction('');
}
(0,_react_17_0_2_react.useEffect)(function () {
if (resizeBarEl.current) {
var onMouseDown = function onMouseDown(e) {
dragging = true;
startY = e.pageY;
};
var onMouseUp = function onMouseUp() {
dragging = false;
};
var onMouseMove = function onMouseMove(e) {
if (dragging) {
var delta = e.pageY - startY;
if (delta < 0) {
delta = 0;
}
if (delta > 300) {
delta = 300;
}
var resizeH = height + delta + 'px';
setH(resizeH);
}
};
var resizeBar = resizeBarEl.current;
var dragging = false;
var startY = 0;
resizeBar.addEventListener('mousedown', onMouseDown);
document.addEventListener('mousemove', onMouseMove);
document.addEventListener('mouseup', onMouseUp);
return function () {
resizeBar.removeEventListener('mousedown', onMouseDown);
document.removeEventListener('mousemove', onMouseMove);
document.removeEventListener('mouseup', onMouseUp);
};
}
}, [cm, resizeBarEl]);
(0,_react_17_0_2_react.useEffect)(function () {
setH(height);
}, [height]);
var fixedWidth = processSize(width);
var fixedHeight = processSize(h);
var style = {
width: fixedWidth,
height: fixedHeight
};
var saveTime = (0,_react_17_0_2_react.useMemo)(function () {
if (lastedUpdateTime) {
var d = new Date(lastedUpdateTime);
var _h = d.getHours();
var m = d.getMinutes();
var s = d.getSeconds();
_h = _h < 10 ? '0' + _h : _h;
m = m < 10 ? '0' + m : m;
s = s < 10 ? '0' + s : s;
return "".concat(_h, ":").concat(m, ":").concat(s);
}
return 0;
}, [lastedUpdateTime]);
var formatProgramFill = function formatProgramFill(str) {
var arr = [];
if (showNullProgramButton) {
var num = -1;
str = str.replace(/(@▁▁@|@▁@)/g, function (a, b, c) {
arr.push({
multiLine: !(a === ADD_SINGLE)
});
});
}
return arr;
};
function onCancelStorage() {
window.sessionStorage.removeItem(id);
setTip(false);
setLastedUpdateTime(0);
}
function onReset() {
setTip(false);
setLastedUpdateTime(0);
cm.setValue(window.sessionStorage.getItem(id));
}
function setValues(a, b) {
var content = cm.getValue();
content = content.replace(a, b);
setValue(content);
cm === null || cm === void 0 || cm.setValue(content);
}
return /*#__PURE__*/(0,jsx_runtime.jsxs)(_react_17_0_2_react.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "markdown-editor-wrapper",
ref: containerEl,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "markdown-editor-container ".concat(className, " ").concat(preview ? 'on-preview' : '', " ").concat(miniToolbar ? 'mini' : '', " ").concat(isFull ? 'full-screen' : ''),
style: style,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(toolbar, {
insertTemp: insertTemp,
watch: preview,
fullScreen: isFull,
showNullButton: showNullButton,
showNullProgramButton: showNullProgramButton,
onActionCallback: onActionCallback,
hidetoolBar: hidetoolBar,
uuid: uuidRef.current,
setOpenPhones: function setOpenPhones() {
openPhoneRef.current = true;
}
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "markdown-editor-body",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "codemirror-container",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("textarea", {
ref: cmEl,
placeholder: placeholder
})
}), preview ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
ref: previewEl,
className: "preview-container",
children: [mode === "stex" && /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml_stex, {
value: value
}), mode !== "stex" && /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
disabledFill: disabledFill,
showProgramFill: showNullProgramButton,
value: value
})]
}) : null]
})]
})
}), showResizeBar ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
ref: resizeBarEl,
className: "editor-resize"
}) : null, /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
children: TitleDesc[action] ? /*#__PURE__*/(0,jsx_runtime.jsx)(es_modal/* default */.Z, {
centered: true,
title: TitleDesc[action],
open: true,
onCancel: onCancel,
footer: null,
className: "markdown-popup-form",
children: PluginEl
}) : null
})]
});
});
/***/ }),
/***/ 90463:
/*!**********************************!*\
!*** ./src/components/modal.tsx ***!
\**********************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Z: function() { return /* binding */ Dialog; }
/* harmony export */ });
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_classCallCheck_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/classCallCheck.js */ 94312);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_classCallCheck_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_classCallCheck_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createClass_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/createClass.js */ 24127);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createClass_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createClass_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_inherits_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/inherits.js */ 93242);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_inherits_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_inherits_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createSuper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/createSuper.js */ 10564);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createSuper_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createSuper_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-dom */ 4676);
var Dialog = /*#__PURE__*/function (_React$Component) {
_root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_inherits_js__WEBPACK_IMPORTED_MODULE_2___default()(Dialog, _React$Component);
var _super = _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createSuper_js__WEBPACK_IMPORTED_MODULE_3___default()(Dialog);
function Dialog(props) {
var _this;
_root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_classCallCheck_js__WEBPACK_IMPORTED_MODULE_0___default()(this, Dialog);
_this = _super.call(this, props);
var doc = window.document;
_this.node = doc.createElement('div');
doc.body.appendChild(_this.node);
return _this;
}
_root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_createClass_js__WEBPACK_IMPORTED_MODULE_1___default()(Dialog, [{
key: "render",
value: function render() {
var children = this.props.children;
return /*#__PURE__*/(0,react_dom__WEBPACK_IMPORTED_MODULE_5__.createPortal)(children, this.node);
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
window.document.body.removeChild(this.node);
}
}]);
return Dialog;
}(react__WEBPACK_IMPORTED_MODULE_4__.Component);
/***/ }),
/***/ 86219:
/*!****************************************!*\
!*** ./src/components/useInterval.tsx ***!
\****************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Z: function() { return /* binding */ useInterval; }
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
function useInterval(callback, delay) {
var savedCallback = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
// 保存新回调
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
savedCallback.current = callback;
});
// 建立 interval
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
function tick() {
savedCallback.current();
}
if (delay !== null) {
var id = setInterval(tick, delay);
return function () {
return clearInterval(id);
};
}
}, [delay]);
}
/***/ }),
/***/ 33446:
/*!********************************************************************************!*\
!*** ./src/pages/Classrooms/Lists/CommonHomework/Review/index.tsx + 3 modules ***!
\********************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"default": function() { return /* binding */ Review; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(10574);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(39343);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(26801);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(11006);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
var _umi_production_exports = __webpack_require__(22211);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
var es_modal = __webpack_require__(43418);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
var es_form = __webpack_require__(78241);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
var message = __webpack_require__(8591);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/index.js + 6 modules
var breadcrumb = __webpack_require__(66104);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
var row = __webpack_require__(95237);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
var col = __webpack_require__(43604);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/spin/index.js + 1 modules
var spin = __webpack_require__(71418);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/divider/index.js + 1 modules
var divider = __webpack_require__(28103);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es_button = __webpack_require__(3113);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input-number/index.js + 14 modules
var input_number = __webpack_require__(85731);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
var tooltip = __webpack_require__(6848);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/ArrowLeftOutlined.js + 1 modules
var ArrowLeftOutlined = __webpack_require__(68742);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/DeleteOutlined.js + 1 modules
var DeleteOutlined = __webpack_require__(47966);
// EXTERNAL MODULE: ./src/components/image-preview/index.tsx + 1 modules
var image_preview = __webpack_require__(61173);
// EXTERNAL MODULE: ./src/utils/fetch.ts
var fetch = __webpack_require__(15830);
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 10 modules
var markdown_editor = __webpack_require__(22387);
// EXTERNAL MODULE: ./src/components/mediator.js
var mediator = __webpack_require__(89472);
// EXTERNAL MODULE: ./src/components/PreviewAll/index.tsx + 1 modules
var PreviewAll = __webpack_require__(78075);
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.10@dayjs/dayjs.min.js
var dayjs_min = __webpack_require__(9498);
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(67871);
// EXTERNAL MODULE: ./src/components/FileDownloadList/index.tsx + 3 modules
var FileDownloadList = __webpack_require__(76478);
// EXTERNAL MODULE: ./src/service/shixunHomeworks.ts
var service_shixunHomeworks = __webpack_require__(36554);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
var input = __webpack_require__(1056);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/CommonHomework/Review/components/ChangeScore.tsx
var DelShixun = function DelShixun(_ref) {
var shixunHomeworks = _ref.shixunHomeworks,
dispatch = _ref.dispatch;
var params = (0,_umi_production_exports.useParams)();
var _useState = (0,_react_17_0_2_react.useState)(true),
_useState2 = slicedToArray_default()(_useState, 2),
coverAll = _useState2[0],
setCoverAll = _useState2[1];
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_modal/* default */.Z, {
centered: true,
title: "\u8C03\u5206",
open: shixunHomeworks.actionTabs.key === '调分' ? true : false,
okText: "\u786E\u5B9A",
cancelText: "\u53D6\u6D88",
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var formValue, res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return form.validateFields();
case 2:
formValue = form.getFieldsValue();
_context.next = 5;
return (0,fetch/* default */.ZP)("/api/student_works/".concat(shixunHomeworks.actionTabs.id, "/adjust_score.json"), {
method: 'post',
body: objectSpread2_default()({}, formValue)
});
case 5:
res = _context.sent;
if (res.status === 0) {
message/* default */.ZP.success('评阅成功');
form.resetFields();
dispatch({
type: 'shixunHomeworks/setActionTabs',
payload: {}
});
dispatch({
type: "shixunHomeworks/getStudentWorkCommon",
payload: objectSpread2_default()({}, params)
});
}
case 7:
case "end":
return _context.stop();
}
}, _callee);
})),
onCancel: function onCancel() {
dispatch({
type: 'shixunHomeworks/setActionTabs',
payload: {}
});
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: "tc",
children: "\u8BE5\u5B66\u751F\u7684\u6700\u7EC8\u6210\u7EE9\u5C06\u4E0D\u4F1A\u6309\u7167\u8BC4\u5206\u89C4\u5219\u8FDB\u884C\u8BA1\u7B97"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
form: form,
layout: "horizontal",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
alignItems: 'baseline'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u6210\u7EE9",
name: "score",
rules: [{
required: true,
message: '请输入!'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
min: 0,
placeholder: "\u8BF7\u586B\u5199\u5206\u6570"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml10",
children: "\u5206"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "comment",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.TextArea, {
placeholder: "\u8BF7\u586B\u5199\u60A8\u5BF9\u4F5C\u54C1\u8C03\u5206\u7684\u539F\u56E0",
rows: 8
})
})
})]
})]
})
});
};
/* harmony default export */ var ChangeScore = ((0,_umi_production_exports.connect)(function (_ref3) {
var shixunHomeworks = _ref3.shixunHomeworks;
return {
shixunHomeworks: shixunHomeworks
};
})(DelShixun));
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/CommonHomework/Review/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var Reviewmodules = ({"flex_box_center":"flex_box_center___tMwax","flex_space_between":"flex_space_between___8GJsg","flex_box_vertical_center":"flex_box_vertical_center___IFELt","flex_box_center_end":"flex_box_center_end___IrFRG","flex_box_column":"flex_box_column___s0LgG","bg":"bg___sFhaA","title":"title___bk4oD","replyList":"replyList___bjk6g","nav-tab":"nav-tab___uLRSr","buttonFixed":"buttonFixed___twN45","exitComment":"exitComment___rlGpw","nextComment":"nextComment___NmNBo","modal":"modal___tWPO8","MdEditor":"MdEditor___AAxeb"});
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 1 modules
var RenderHtml = __webpack_require__(80416);
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js
var lodash = __webpack_require__(89392);
// EXTERNAL MODULE: ./src/components/MultiUpload/index.tsx + 3 modules
var MultiUpload = __webpack_require__(72286);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/CommonHomework/Review/components/AfterAppendix.tsx
var PublishShixun = function PublishShixun(_ref) {
var classroomList = _ref.classroomList,
loading = _ref.loading,
dispatch = _ref.dispatch;
var params = (0,_umi_production_exports.useParams)();
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_modal/* default */.Z, {
centered: true,
title: "\u8865\u4EA4\u9644\u4EF6",
open: classroomList.actionTabs.key === '补交附件' ? true : false,
bodyStyle: {
minHeight: 200
},
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var _formValue$attachment;
var formValue, selectArrs, res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return form.validateFields();
case 2:
formValue = objectSpread2_default()({}, form.getFieldValue());
selectArrs = classroomList.actionTabs.selectArrs;
formValue.attachment_ids = (_formValue$attachment = formValue.attachment_ids) === null || _formValue$attachment === void 0 ? void 0 : _formValue$attachment.map(function (item) {
return item.response.id;
});
_context.next = 7;
return (0,service_shixunHomeworks/* reviseAttachment */.mz)(objectSpread2_default()(objectSpread2_default()({}, formValue), {}, {
homeworkId: selectArrs.work_id
}));
case 7:
res = _context.sent;
if (res.status === 0) {
form.resetFields();
dispatch({
type: "shixunHomeworks/getStudentWorkSupplyDetail",
payload: objectSpread2_default()({}, classroomList.actionTabs.params)
});
dispatch({
type: 'classroomList/setActionTabs',
payload: {}
});
}
case 9:
case "end":
return _context.stop();
}
}, _callee);
})),
onCancel: function onCancel() {
form.resetFields();
dispatch({
type: 'classroomList/setActionTabs',
payload: {}
});
},
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
form: form,
initialValues: {},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "attachment_ids",
rules: [{
required: true,
message: "请上传附件"
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(MultiUpload/* default */.Z, {})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "description",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.TextArea, {
placeholder: "\u8BF7\u5728\u6B64\u8F93\u5165\u8865\u4EA4\u9644\u4EF6\u7684\u539F\u56E0\uFF0C\u6700\u5927\u9650\u5236100\u4E2A\u5B57\u7B26",
rows: 7
})
})]
})
});
};
/* harmony default export */ var AfterAppendix = ((0,_umi_production_exports.connect)(function (_ref3) {
var classroomList = _ref3.classroomList,
loading = _ref3.loading;
return {
classroomList: classroomList,
loading: loading
};
})(PublishShixun));
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(85578);
// EXTERNAL MODULE: ./src/utils/authority.ts
var authority = __webpack_require__(58696);
// EXTERNAL MODULE: ./src/components/ImagesIcon/index.ts + 32 modules
var ImagesIcon = __webpack_require__(60638);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/CommonHomework/Review/index.tsx
var ExeriseReview = function ExeriseReview(_ref) {
var _studentWorkDetail$ca, _studentWorkDetail$ca2, _userInfo$course, _studentWorkDetail$ca3, _studentWorkDetail$ca4, _studentWorkDetail$ca5, _studentWorkDetail$ho, _studentWorkDetail$no, _studentWorkDetail$co, _studentWorkDetail$ho2, _studentWorkDetail$ho3, _studentWorkDetail$ho4, _studentWorkDetail$ho5, _studentWorkDetail$ho6, _studentWorkDetail$ho7, _studentWorkDetail$ho8, _studentWorkCommon$co, _studentWorkCommon$co2, _studentWorkCommon$hi, _studentWorkCommon$hi2;
var shixunHomeworks = _ref.shixunHomeworks,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
user = _ref.user,
dispatch = _ref.dispatch;
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
searchParams = _useSearchParams2[0];
var params = (0,_umi_production_exports.useParams)();
var boxWrap = (0,_react_17_0_2_react.useRef)();
var userInfo = user.userInfo;
var studentWorkDetail = shixunHomeworks.studentWorkDetail,
studentWorkCommon = shixunHomeworks.studentWorkCommon,
studentWorkSupplyDetail = shixunHomeworks.studentWorkSupplyDetail,
workList = shixunHomeworks.workList;
var _useState = (0,_react_17_0_2_react.useState)(''),
_useState2 = slicedToArray_default()(_useState, 2),
value = _useState2[0],
setValue = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)({
show: false,
type: 0,
active: null
}),
_useState4 = slicedToArray_default()(_useState3, 2),
showApply = _useState4[0],
setShowApply = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)({
show: false,
type: 0,
active: null
}),
_useState6 = slicedToArray_default()(_useState5, 2),
showApplys = _useState6[0],
setShowApplys = _useState6[1];
var _Modal$useModal = es_modal/* default */.Z.useModal(),
_Modal$useModal2 = slicedToArray_default()(_Modal$useModal, 2),
modal = _Modal$useModal2[0],
contextHolder = _Modal$useModal2[1];
var _useState7 = (0,_react_17_0_2_react.useState)({
last: false
}),
_useState8 = slicedToArray_default()(_useState7, 2),
nextComment = _useState8[0],
setNextComment = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)({
last: false
}),
_useState10 = slicedToArray_default()(_useState9, 2),
Previous = _useState10[0],
setPrevious = _useState10[1];
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var _useState11 = (0,_react_17_0_2_react.useState)(false),
_useState12 = slicedToArray_default()(_useState11, 2),
isshow = _useState12[0],
setisshow = _useState12[1];
var _useState13 = (0,_react_17_0_2_react.useState)(''),
_useState14 = slicedToArray_default()(_useState13, 2),
comment = _useState14[0],
setcomment = _useState14[1];
var _useState15 = (0,_react_17_0_2_react.useState)({
content: "",
type: ""
}),
_useState16 = slicedToArray_default()(_useState15, 2),
data = _useState16[0],
setData = _useState16[1];
var monacoValueRef = (0,_react_17_0_2_react.useRef)();
var location = (0,_umi_production_exports.useLocation)();
var getData = function getData() {
dispatch({
type: 'shixunHomeworks/getStudentWorkCommon',
payload: objectSpread2_default()({}, params)
});
};
(0,_react_17_0_2_react.useEffect)(function () {
dispatch({
type: 'shixunHomeworks/getStudentWorkDetail',
payload: objectSpread2_default()({}, params)
});
dispatch({
type: 'shixunHomeworks/getStudentWorkSupplyDetail',
payload: objectSpread2_default()({}, params)
});
getData();
getDatas();
boxWrap.current.onclick = function (e) {
if (e.target.nodeName === 'IMG' && e.target.alt !== '') {
mediator/* default */.Z.publish('preview-image', e.target.src);
}
};
}, [params.categoryId, params.userId]);
function getDatas() {
return _getDatas.apply(this, arguments);
}
function _getDatas() {
_getDatas = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee16() {
var _res$all_student_work, _res$all_student_work2;
var paylaod, data, res, key, _res$all_student_work3, _res$all_student_work4;
return regeneratorRuntime_default()().wrap(function _callee16$(_context16) {
while (1) switch (_context16.prev = _context16.next) {
case 0:
paylaod = JSON.parse(sessionStorage['all_student_works_params'] || '{}');
data = {};
if (searchParams.get("ids")) {
data.course_group = searchParams.get("ids").split(',');
}
_context16.next = 5;
return dispatch({
type: 'shixunHomeworks/getAllStudentWorks',
payload: objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({}, params), paylaod), data)
});
case 5:
res = _context16.sent;
// setSpinning(false);
key = (_res$all_student_work = res['all_student_works']) === null || _res$all_student_work === void 0 ? void 0 : _res$all_student_work.map(function (item) {
return String(item.student_work_id);
}).indexOf(params.userId);
if (key === ((_res$all_student_work2 = res['all_student_works']) === null || _res$all_student_work2 === void 0 ? void 0 : _res$all_student_work2.length) - 1) {
setNextComment({
last: true
});
} else {
setNextComment((_res$all_student_work3 = res['all_student_works']) === null || _res$all_student_work3 === void 0 ? void 0 : _res$all_student_work3[key + 1]);
}
if (key === 0) {
setPrevious({
last: true
});
} else {
setPrevious((_res$all_student_work4 = res['all_student_works']) === null || _res$all_student_work4 === void 0 ? void 0 : _res$all_student_work4[key - 1]);
}
case 9:
case "end":
return _context16.stop();
}
}, _callee16);
}));
return _getDatas.apply(this, arguments);
}
(0,_react_17_0_2_react.useEffect)(function () {
dispatch({
type: 'globalSetting/footerToggle',
payload: false
});
return function () {
dispatch({
type: 'globalSetting/footerToggle',
payload: true
});
};
}, []);
// console.log(params, 'params')
var handleDelete = function handleDelete(d) {
modal.confirm({
title: '是否确认删除?',
onOk: function () {
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return dispatch({
type: 'shixunHomeworks/deleteReply',
payload: {
object_id: d.id,
object_type: 'journals_for_message'
}
});
case 2:
res = _context.sent;
if (res.status === 0) {
message/* default */.ZP.success('删除成功');
getData();
}
case 4:
case "end":
return _context.stop();
}
}, _callee);
}));
function onOk() {
return _onOk.apply(this, arguments);
}
return onOk;
}()
});
};
var handleDeleteScore = function handleDeleteScore(d) {
modal.confirm({
title: '是否确认删除?',
onOk: function () {
var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
var res;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return (0,service_shixunHomeworks/* delStudentWorkScore */.QC)({
score_id: d.comment_id,
userId: params.userId
});
case 2:
res = _context2.sent;
if (res.status === 0) {
message/* default */.ZP.success('删除成功');
getData();
}
case 4:
case "end":
return _context2.stop();
}
}, _callee2);
}));
function onOk() {
return _onOk2.apply(this, arguments);
}
return onOk;
}()
});
};
var handleSave = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(value) {
var _value$attachment_ids;
var res;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
value.attachment_ids = (_value$attachment_ids = value.attachment_ids) === null || _value$attachment_ids === void 0 ? void 0 : _value$attachment_ids.map(function (val) {
var _val$response;
return val === null || val === void 0 || (_val$response = val.response) === null || _val$response === void 0 ? void 0 : _val$response.id;
});
_context3.next = 3;
return (0,service_shixunHomeworks/* addStudentWorkScore */.yy)(objectSpread2_default()(objectSpread2_default()({}, value), {}, {
userId: params.userId
}));
case 3:
res = _context3.sent;
if (res.status === 0) {
form.resetFields();
message/* default */.ZP.success('提交成功');
getData();
}
case 5:
case "end":
return _context3.stop();
}
}, _callee3);
}));
return function handleSave(_x) {
return _ref2.apply(this, arguments);
};
}();
var handleNextAppraise = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(type) {
var _form$getFieldsValue, comment, score, attachment_ids, boolScore;
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
_form$getFieldsValue = form.getFieldsValue(), comment = _form$getFieldsValue.comment, score = _form$getFieldsValue.score, attachment_ids = _form$getFieldsValue.attachment_ids;
boolScore = !(0,lodash.isNil)(score);
if (!(comment || boolScore || attachment_ids)) {
_context4.next = 5;
break;
}
es_modal/* default */.Z.confirm({
centered: true,
okText: '离开',
cancelText: '取消',
title: '离开此页提示',
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "tc",
children: '系统可能不会保存您所做的更改'
}),
onOk: function onOk() {
// history.push(`/classrooms/${course_id}/students`);
form.resetFields();
if (type === 'last') {
_umi_production_exports.history.push(searchParams.get("ids") ? "/classrooms/".concat(params === null || params === void 0 ? void 0 : params.coursesId, "/common_homework/").concat(params === null || params === void 0 ? void 0 : params.categoryId, "/review/").concat(Previous === null || Previous === void 0 ? void 0 : Previous.student_work_id, "?ids=").concat(searchParams.get("ids")) : "/classrooms/".concat(params === null || params === void 0 ? void 0 : params.coursesId, "/common_homework/").concat(params === null || params === void 0 ? void 0 : params.categoryId, "/review/").concat(Previous === null || Previous === void 0 ? void 0 : Previous.student_work_id));
} else if (type === 'read') {
_umi_production_exports.history.push(searchParams.get("ids") ? "/classrooms/".concat(params === null || params === void 0 ? void 0 : params.coursesId, "/common_homework/").concat(params === null || params === void 0 ? void 0 : params.categoryId, "/review/").concat(nextComment === null || nextComment === void 0 ? void 0 : nextComment.student_work_id, "?ids=").concat(searchParams.get("ids")) : "/classrooms/".concat(params === null || params === void 0 ? void 0 : params.coursesId, "/common_homework/").concat(params === null || params === void 0 ? void 0 : params.categoryId, "/review/").concat(nextComment === null || nextComment === void 0 ? void 0 : nextComment.student_work_id));
} else {
_umi_production_exports.history.push("/classrooms/".concat(params.coursesId, "/common_homework/").concat(params.categoryId, "/detail"));
}
}
});
return _context4.abrupt("return");
case 5:
if (type === 'last') {
_umi_production_exports.history.push(searchParams.get("ids") ? "/classrooms/".concat(params === null || params === void 0 ? void 0 : params.coursesId, "/common_homework/").concat(params === null || params === void 0 ? void 0 : params.categoryId, "/review/").concat(Previous === null || Previous === void 0 ? void 0 : Previous.student_work_id, "?ids=").concat(searchParams.get("ids")) : "/classrooms/".concat(params === null || params === void 0 ? void 0 : params.coursesId, "/common_homework/").concat(params === null || params === void 0 ? void 0 : params.categoryId, "/review/").concat(Previous === null || Previous === void 0 ? void 0 : Previous.student_work_id));
} else if (type === 'read') {
_umi_production_exports.history.push(searchParams.get("ids") ? "/classrooms/".concat(params === null || params === void 0 ? void 0 : params.coursesId, "/common_homework/").concat(params === null || params === void 0 ? void 0 : params.categoryId, "/review/").concat(nextComment === null || nextComment === void 0 ? void 0 : nextComment.student_work_id, "?ids=").concat(searchParams.get("ids")) : "/classrooms/".concat(params === null || params === void 0 ? void 0 : params.coursesId, "/common_homework/").concat(params === null || params === void 0 ? void 0 : params.categoryId, "/review/").concat(nextComment === null || nextComment === void 0 ? void 0 : nextComment.student_work_id));
} else {
_umi_production_exports.history.push("/classrooms/".concat(params.coursesId, "/common_homework/").concat(params.categoryId, "/detail"));
}
// if (comment && boolScore) {
// const res = await addStudentWorkScore({
// ...form.getFieldsValue(),
// userId: params.userId
// })
// if (res.status === -1) return;
// if (!comment && boolScore) {
// form.setFields([{
// name: 'comment',
// errors: ['请填写评语'],
// }])
// return;
// }
// }
// history.push(`/classrooms/${params?.coursesId}/common_homework/${params?.categoryId}/review/${studentWorkDetail?.next_work_id}`)
case 6:
case "end":
return _context4.stop();
}
}, _callee4);
}));
return function handleNextAppraise(_x2) {
return _ref3.apply(this, arguments);
};
}();
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: "edu-container",
ref: boxWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: "animated fadeIn",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
className: "mt10",
children: userInfo && /*#__PURE__*/(0,jsx_runtime.jsxs)(breadcrumb/* default */.Z, {
separator: ">",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default */.Z.Item, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
to: "/classrooms/".concat(params.coursesId, "/common_homework/").concat(!!(studentWorkDetail !== null && studentWorkDetail !== void 0 && (_studentWorkDetail$ca = studentWorkDetail.category) !== null && _studentWorkDetail$ca !== void 0 && _studentWorkDetail$ca.main) ? '' : studentWorkDetail === null || studentWorkDetail === void 0 || (_studentWorkDetail$ca2 = studentWorkDetail.category) === null || _studentWorkDetail$ca2 === void 0 ? void 0 : _studentWorkDetail$ca2.category_id),
children: userInfo === null || userInfo === void 0 || (_userInfo$course = userInfo.course) === null || _userInfo$course === void 0 ? void 0 : _userInfo$course.course_name
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default */.Z.Item, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
to: "/classrooms/".concat(params.coursesId, "/common_homework/").concat(!!(studentWorkDetail !== null && studentWorkDetail !== void 0 && (_studentWorkDetail$ca3 = studentWorkDetail.category) !== null && _studentWorkDetail$ca3 !== void 0 && _studentWorkDetail$ca3.main) ? '' : studentWorkDetail === null || studentWorkDetail === void 0 || (_studentWorkDetail$ca4 = studentWorkDetail.category) === null || _studentWorkDetail$ca4 === void 0 ? void 0 : _studentWorkDetail$ca4.category_id),
children: studentWorkDetail === null || studentWorkDetail === void 0 || (_studentWorkDetail$ca5 = studentWorkDetail.category) === null || _studentWorkDetail$ca5 === void 0 ? void 0 : _studentWorkDetail$ca5.category_name
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default */.Z.Item, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
to: "/classrooms/".concat(params.coursesId, "/common_homework/").concat(params.categoryId, "/detail"),
children: "\u4F5C\u4E1A\u8BE6\u60C5"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default */.Z.Item, {
children: studentWorkDetail === null || studentWorkDetail === void 0 ? void 0 : studentWorkDetail.author_name
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
className: [Reviewmodules.title, 'mt20'].join(' '),
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
style: {
width: '100%'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: "1",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
to: "/classrooms/".concat(params.coursesId, "/common_homework"),
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ArrowLeftOutlined/* default */.Z, {
className: "font16 c-black"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
className: "font20 ml5",
children: studentWorkDetail === null || studentWorkDetail === void 0 ? void 0 : studentWorkDetail.homework_name
}), /*#__PURE__*/(0,jsx_runtime.jsx)(util/* StatusClassroomsTags */.VV, {
status: studentWorkDetail === null || studentWorkDetail === void 0 ? void 0 : studentWorkDetail.homework_status
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: (0,authority/* isStudent */.dE)() && (studentWorkDetail === null || studentWorkDetail === void 0 || (_studentWorkDetail$ho = studentWorkDetail.homework_status) === null || _studentWorkDetail$ho === void 0 ? void 0 : _studentWorkDetail$ho.includes('补交中')) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
onClick: function onClick() {
dispatch({
type: 'classroomList/setActionTabs',
payload: {
key: '补交附件',
params: params,
selectArrs: {
homework_id: params.commonHomeworkId,
work_id: params.userId
}
}
});
},
className: "c-blue current font14",
children: "\u8865\u4EA4\u9644\u4EF6"
})
})]
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("ul", {
className: Reviewmodules['nav-tab'],
children: /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
className: "active",
children: "\u4F5C\u4E1A\u8BE6\u60C5"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("section", {
className: [Reviewmodules.bg, 'pt30', 'pl30', 'pr30', 'pb30'].join(' '),
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(spin/* default */.Z, {
spinning: loading['shixunHomeworks/getStudentWorkDetail'] || loading['shixunHomeworks/getStudentWorkSupplyDetail'],
children: [(studentWorkDetail === null || studentWorkDetail === void 0 ? void 0 : studentWorkDetail.description) && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "font16",
children: ["\u5185\u5BB9", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#FA6400',
fontSize: 14
},
children: "\uFF08\u5F53\u524D\u652F\u6301\u6279\u6CE8\u7684\u6587\u6863\u7C7B\u578B\uFF1A.docx\u3001.xlsx\u3001.pptx\uFF09"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "mt20",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: (studentWorkDetail === null || studentWorkDetail === void 0 ? void 0 : studentWorkDetail.description) || '暂无~'
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(FileDownloadList/* default */.Z, {
authority: (0,authority/* isAdmin */.GJ)(),
callback: function callback() {
dispatch({
type: 'shixunHomeworks/getStudentWorkDetail',
payload: objectSpread2_default()({}, params)
});
},
dataSource: studentWorkDetail === null || studentWorkDetail === void 0 ? void 0 : studentWorkDetail.attachments
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: "tr",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: " c-light-black",
children: dayjs_min_default()(studentWorkDetail.commit_time).format('YYYY-MM-DD HH:mm')
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml10",
children: studentWorkDetail.commit_user_name
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml10 c-light-black",
children: "\u63D0\u4EA4"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml30 c-light-black",
children: dayjs_min_default()(studentWorkDetail.update_time).format('YYYY-MM-DD HH:mm')
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml10",
children: studentWorkDetail.update_user_name
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml10 c-light-black",
children: "\u66F4\u65B0"
})]
})]
}), (studentWorkDetail === null || studentWorkDetail === void 0 ? void 0 : studentWorkDetail.redo_description) && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "font16",
children: "\u91CD\u505A\u8BB0\u5F55"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "pl30 mt20",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: (studentWorkDetail === null || studentWorkDetail === void 0 ? void 0 : studentWorkDetail.redo_description) || '暂无~'
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(FileDownloadList/* default */.Z, {
authority: (0,authority/* isAdmin */.GJ)(),
callback: function callback() {
dispatch({
type: 'shixunHomeworks/getStudentWorkDetail',
payload: objectSpread2_default()({}, params)
});
},
dataSource: studentWorkDetail === null || studentWorkDetail === void 0 ? void 0 : studentWorkDetail.redo_attachments
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: "tr",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: " c-light-black",
children: dayjs_min_default()(studentWorkDetail.redo_commit_time).format('YYYY-MM-DD HH:mm')
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml10",
children: studentWorkDetail.commit_user_name
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml10 c-light-black",
children: "\u63D0\u4EA4"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml30 c-light-black",
children: dayjs_min_default()(studentWorkDetail.redo_update_time).format('YYYY-MM-DD HH:mm')
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml10",
children: studentWorkDetail.update_user_name
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml10 c-light-black",
children: "\u66F4\u65B0"
})]
})]
}), (studentWorkSupplyDetail === null || studentWorkSupplyDetail === void 0 ? void 0 : studentWorkSupplyDetail.revise_reason) && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "font16",
children: "\u8865\u4EA4\u5185\u5BB9"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "pl30 mt20",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: (studentWorkSupplyDetail === null || studentWorkSupplyDetail === void 0 ? void 0 : studentWorkSupplyDetail.revise_reason) || '暂无~'
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(FileDownloadList/* default */.Z, {
authority: (0,authority/* isAdmin */.GJ)(),
callback: function callback() {
dispatch({
type: 'shixunHomeworks/getStudentWorkSupplyDetail',
payload: objectSpread2_default()({}, params)
});
},
dataSource: studentWorkSupplyDetail === null || studentWorkSupplyDetail === void 0 ? void 0 : studentWorkSupplyDetail.revise_attachments
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: "tr",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml30 c-light-black",
children: dayjs_min_default()(studentWorkSupplyDetail.atta_update_time).format('YYYY-MM-DD HH:mm')
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml10",
children: studentWorkSupplyDetail.atta_update_user
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml10 c-light-black",
children: "\u66F4\u65B0"
})]
})]
})]
})
}), (studentWorkDetail === null || studentWorkDetail === void 0 ? void 0 : studentWorkDetail.anonymous_comment) && (0,authority/* isAdminOrTeacher */.G5)() && /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: [Reviewmodules.bg, 'mt30', 'pt30', 'pl30', 'pr30', 'pb30'].join(' '),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
children: "\u533F\u8BC4\u5B66\u751F"
}), !!(studentWorkDetail !== null && studentWorkDetail !== void 0 && (_studentWorkDetail$no = studentWorkDetail.no_commented_user_names) !== null && _studentWorkDetail$no !== void 0 && _studentWorkDetail$no.length) && /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
children: ["\u672A\u5B8C\u6210\u533F\u8BC4\uFF1A", studentWorkDetail.no_commented_user_names.join('、')]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u5DF2\u5B8C\u6210\u533F\u8BC4\uFF1A", (_studentWorkDetail$co = studentWorkDetail.commented_user_names) === null || _studentWorkDetail$co === void 0 ? void 0 : _studentWorkDetail$co.join('、')]
})]
}), ((0,authority/* isAdminOrStudent */.RV)() || (studentWorkDetail === null || studentWorkDetail === void 0 || (_studentWorkDetail$ho2 = studentWorkDetail.homework_status) === null || _studentWorkDetail$ho2 === void 0 ? void 0 : _studentWorkDetail$ho2.includes('匿评中'))) && /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: [Reviewmodules.replyList, 'bg-white'].join(' '),
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
gutter: [10, 20],
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: 1
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
style: {
lineHeight: '40px'
},
children: (0,authority/* isAdmin */.GJ)() && (studentWorkCommon === null || studentWorkCommon === void 0 ? void 0 : studentWorkCommon.ultimate) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font-16 c-blue current",
onClick: function onClick() {
dispatch({
type: 'shixunHomeworks/setActionTabs',
payload: {
key: '调分',
selectArrs: studentWorkDetail,
id: params.userId,
params: params
}
});
},
children: "\u8C03\u5206"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: (0,authority/* isAdminOrTeacher */.G5)() && ((studentWorkDetail === null || studentWorkDetail === void 0 || (_studentWorkDetail$ho3 = studentWorkDetail.homework_status) === null || _studentWorkDetail$ho3 === void 0 ? void 0 : _studentWorkDetail$ho3.includes('提交中')) || (studentWorkDetail === null || studentWorkDetail === void 0 || (_studentWorkDetail$ho4 = studentWorkDetail.homework_status) === null || _studentWorkDetail$ho4 === void 0 ? void 0 : _studentWorkDetail$ho4.includes('补交中')) || (studentWorkDetail === null || studentWorkDetail === void 0 || (_studentWorkDetail$ho5 = studentWorkDetail.homework_status) === null || _studentWorkDetail$ho5 === void 0 ? void 0 : _studentWorkDetail$ho5.includes('进行中'))) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
style: {
width: '124px',
height: '40px'
},
type: "primary",
onClick: function onClick() {
return setisshow(true);
},
children: "\u6253\u56DE\u91CD\u505A"
})
})]
}), !studentWorkCommon.is_author && !(studentWorkCommon !== null && studentWorkCommon !== void 0 && studentWorkCommon.ultimate) && ((0,authority/* isAdmin */.GJ)() || (studentWorkDetail === null || studentWorkDetail === void 0 || (_studentWorkDetail$ho6 = studentWorkDetail.homework_status) === null || _studentWorkDetail$ho6 === void 0 ? void 0 : _studentWorkDetail$ho6.includes('匿评中'))) && /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
layout: "vertical",
form: form,
onFinish: function onFinish(value) {
return handleSave(value);
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u8BC4\u8BED",
name: "comment",
rules: [{
required: true,
message: '请输入评语'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
placeholder: "\u8BF7\u8F93\u5165\u8BC4\u8BED",
defaultValue: "",
height: 250
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "attachment_ids",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(MultiUpload/* default */.Z, {})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "mt10",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "1",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
justify: "start",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
noStyle: true,
name: "score",
rules: [{
required: (0,authority/* isAdmin */.GJ)() ? false : true,
message: '请填写分数'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
step: 0.1,
min: 0,
style: {
width: 100
},
size: 'middle',
placeholder: "\u8BF7\u586B\u5199\u5206\u6570"
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml5 mr20",
children: "\u5206"
})
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {})]
})
}), (0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1",
name: "hidden_comment",
style: {
marginTop: 10
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
placeholder: "\u8BF7\u8F93\u5165\u8BC4\u8BED",
defaultValue: "",
height: 250
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
className: "".concat(Reviewmodules.buttonFixed),
children: /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
className: "edu-container",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "1",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "default",
onClick: function onClick() {
return handleNextAppraise('list');
},
children: "\u8FD4\u56DE\u5217\u8868"
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: "1",
className: "tr",
children: [!(0,authority/* isStudent */.dE)() && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "default",
onClick: function onClick() {
return handleNextAppraise('last');
},
disabled: Previous === null || Previous === void 0 ? void 0 : Previous.last,
children: "\u4E0A\u4E00\u4E2A"
}), !(0,authority/* isStudent */.dE)() && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "default",
disabled: nextComment === null || nextComment === void 0 ? void 0 : nextComment.last,
style: {
marginLeft: '20px',
marginRight: '20px'
},
onClick: function onClick() {
return handleNextAppraise('read');
}
// disabled={nextComment?.last}
,
children: "\u4E0B\u4E00\u4E2A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
htmlType: "submit",
type: "primary",
children: "\u63D0\u4EA4\u8BC4\u9605"
})]
})]
})
})
})]
})
})]
}), ((0,authority/* isAdminOrStudent */.RV)() || (studentWorkDetail === null || studentWorkDetail === void 0 || (_studentWorkDetail$ho7 = studentWorkDetail.homework_status) === null || _studentWorkDetail$ho7 === void 0 ? void 0 : _studentWorkDetail$ho7.includes('匿评中')) || (studentWorkDetail === null || studentWorkDetail === void 0 || (_studentWorkDetail$ho8 = studentWorkDetail.homework_status) === null || _studentWorkDetail$ho8 === void 0 ? void 0 : _studentWorkDetail$ho8.includes('申诉中'))) && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: [Reviewmodules.replyList, 'bg-white'].join(' '),
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
style: {
color: '#000000',
fontWeight: 500
},
children: ["\u70B9\u8BC4\u5185\u5BB9\uFF08", studentWorkCommon === null || studentWorkCommon === void 0 || (_studentWorkCommon$co = studentWorkCommon.comment_scores) === null || _studentWorkCommon$co === void 0 ? void 0 : _studentWorkCommon$co.length, "\uFF09"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {}), studentWorkCommon === null || studentWorkCommon === void 0 || (_studentWorkCommon$co2 = studentWorkCommon.comment_scores) === null || _studentWorkCommon$co2 === void 0 ? void 0 : _studentWorkCommon$co2.map(function (v, k) {
var _v$attachments, _v$appeal_info, _v$appeal_info2, _v$appeal_info3, _v$appeal_info4, _v$appeal_info5;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
gutter: [12, 12],
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: "40px",
children: [(v === null || v === void 0 ? void 0 : v.user_image_url) === '--' && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
className: Reviewmodules.headpic,
width: "40",
src: ImagesIcon/* anonyIcon */.xp
}), (v === null || v === void 0 ? void 0 : v.user_image_url) !== '--' && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
className: Reviewmodules.headpic,
width: "40",
src: "".concat(env/* default */.Z.IMG_SERVER, "/images/").concat(v === null || v === void 0 ? void 0 : v.user_image_url)
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: "1",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 24,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: 1,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-light-black",
children: v === null || v === void 0 ? void 0 : v.user_name
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-light-black ml10",
children: dayjs_min_default()(v === null || v === void 0 ? void 0 : v.comment_time).format('YYYY-MM-DD HH:mm')
}), v.score !== null && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "ml30 c-orange",
children: [v.score, "\u5206"]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: k === 0 ? /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [v["delete"] && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-blue current",
onClick: function onClick() {
handleDeleteScore(v);
},
children: "\u5220\u9664"
}), v.can_appeal && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-blue current",
onClick: function onClick() {
setShowApply({
show: true,
type: 1,
active: k
});
},
children: "\u7533\u8BC9"
}), v.can_reply && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-blue current ml10",
onClick: function onClick() {
return setShowApply({
show: true,
type: 0,
active: k
});
},
children: "\u56DE\u590D"
}), !v.can_reply && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-light-black ml10",
children: "\u5931\u6548"
})]
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [v["delete"] && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-blue current",
onClick: function onClick() {
handleDeleteScore(v);
},
children: "\u5220\u9664"
}), v.can_appeal && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-blue current",
onClick: function onClick() {
setShowApply({
show: true,
type: 1,
active: k
});
},
children: "\u7533\u8BC9"
}), v.can_reply && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-blue current ml10",
onClick: function onClick() {
return setShowApply({
show: true,
type: 0,
active: k
});
},
children: "\u56DE\u590D"
}), !v.can_reply && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-light-black ml10",
children: "\u5931\u6548"
})]
})
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
span: 24,
children: [v.content && /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: v.content
}), !v.content && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-light-black",
children: "\u6682\u672A\u5199\u8BC4\u8BED"
}), v === null || v === void 0 || (_v$attachments = v.attachments) === null || _v$attachments === void 0 ? void 0 : _v$attachments.map(function (item, key) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
href: "".concat(env/* default */.Z.API_SERVER).concat(item.url),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "iconfont icon-fujian c-green font14"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml10 c-black",
children: item.title
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-light-black ml20 font12",
children: item.filesize
})]
})
}, key);
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "w100",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: [Reviewmodules.comment, 'w100'].join(' '),
children: [v.appeal_info && v.appeal_info != '' && /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 24,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: "50px",
children: [(v === null || v === void 0 || (_v$appeal_info = v.appeal_info) === null || _v$appeal_info === void 0 ? void 0 : _v$appeal_info.user_image_url) === '--' && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
className: Reviewmodules.headpic,
width: "40",
src: ImagesIcon/* anonyIcon */.xp
}), (v === null || v === void 0 || (_v$appeal_info2 = v.appeal_info) === null || _v$appeal_info2 === void 0 ? void 0 : _v$appeal_info2.user_image_url) !== '--' && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
className: Reviewmodules.headpic,
width: "40",
src: "".concat(env/* default */.Z.IMG_SERVER, "/images/").concat(v === null || v === void 0 || (_v$appeal_info3 = v.appeal_info) === null || _v$appeal_info3 === void 0 ? void 0 : _v$appeal_info3.user_image_url)
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: "1",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: "1",
children: [v === null || v === void 0 || (_v$appeal_info4 = v.appeal_info) === null || _v$appeal_info4 === void 0 ? void 0 : _v$appeal_info4.user_name, /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-light-black ml10",
children: dayjs_min_default()(v === null || v === void 0 || (_v$appeal_info5 = v.appeal_info) === null || _v$appeal_info5 === void 0 ? void 0 : _v$appeal_info5.time).format('YYYY-MM-DD HH:mm')
}), (v === null || v === void 0 ? void 0 : v.appeal_status) === 1 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "tag-style bg-blue ml10",
children: "\u7533\u8BC9\u4E2D"
}), (v === null || v === void 0 ? void 0 : v.appeal_status) === 2 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "tag-style bg-grey-ede c-light-black ml10",
children: "\u7533\u8BC9\u5DF2\u64A4\u9500"
}), (v === null || v === void 0 ? void 0 : v.appeal_status) === 3 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "tag-style bg-blue ml10",
children: "\u7533\u8BC9\u6210\u529F"
}), (v === null || v === void 0 ? void 0 : v.appeal_status) === 4 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "tag-style bg-grey-ede c-light-black ml10",
children: "\u7533\u8BC9\u88AB\u62D2\u7EDD"
}), (v === null || v === void 0 ? void 0 : v.appeal_status) === 5 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "tag-style bg-grey-ede c-light-black ml10",
children: "\u7533\u8BC9\u5931\u8D25"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
children: [(v === null || v === void 0 ? void 0 : v.appeal_status) === 1 && v.can_appeal && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
onClick: function onClick() {
es_modal/* default */.Z.confirm({
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u64A4\u9500\u7533\u8BC9\u540E\uFF0C\u65E0\u6CD5\u518D\u5BF9\u672C\u8BC4\u9605\u8BB0\u5F55\u8FDB\u884C\u7533\u8BC9", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u662F\u5426\u786E\u8BA4\u64A4\u9500\u7533\u8BC9"]
}),
onOk: function () {
var _onOk3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
while (1) switch (_context5.prev = _context5.next) {
case 0:
getData();
case 1:
case "end":
return _context5.stop();
}
}, _callee5);
}));
function onOk() {
return _onOk3.apply(this, arguments);
}
return onOk;
}()
});
},
className: "c-blue current",
children: "\u64A4\u9500\u7533\u8BC9"
}), (v === null || v === void 0 ? void 0 : v.appeal_status) === 1 && (0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
onClick: function onClick() {
es_modal/* default */.Z.confirm({
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u6B64\u533F\u8BC4\u6210\u7EE9\u5C06\u88AB\u5E9F\u5F03\uFF0C\u8BC4\u9605\u4EBA\u7684\u4F5C\u54C1\u5C06\u88AB\u8FDD\u89C4\u6263\u5206", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u662F\u5426\u786E\u8BA4\u63A5\u53D7\u7533\u8BC9"]
}),
onOk: function () {
var _onOk4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6() {
var res;
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
while (1) switch (_context6.prev = _context6.next) {
case 0:
_context6.next = 2;
return (0,fetch/* default */.ZP)("/api/student_works/".concat(params.userId, "/deal_appeal_score.json"), {
method: 'post',
body: {
score_id: v.score_id,
status: 3
}
});
case 2:
res = _context6.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
getData();
}
case 4:
case "end":
return _context6.stop();
}
}, _callee6);
}));
function onOk() {
return _onOk4.apply(this, arguments);
}
return onOk;
}()
});
},
className: "c-red current",
children: "\u63A5\u53D7\u7533\u8BC9"
}), (v === null || v === void 0 ? void 0 : v.appeal_status) === 1 && (0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
onClick: function onClick() {
es_modal/* default */.Z.confirm({
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u6B64\u533F\u8BC4\u6210\u7EE9\u5C06\u88AB\u8BA4\u4E3A\u5408\u7406", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u662F\u5426\u786E\u8BA4\u62D2\u7EDD\u7533\u8BC9"]
}),
onOk: function () {
var _onOk5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7() {
var res;
return regeneratorRuntime_default()().wrap(function _callee7$(_context7) {
while (1) switch (_context7.prev = _context7.next) {
case 0:
_context7.next = 2;
return (0,fetch/* default */.ZP)("/api/student_works/".concat(params.userId, "/deal_appeal_score.json"), {
method: 'post',
body: {
score_id: v.score_id,
status: 4
}
});
case 2:
res = _context7.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
getData();
}
case 4:
case "end":
return _context7.stop();
}
}, _callee7);
}));
function onOk() {
return _onOk5.apply(this, arguments);
}
return onOk;
}()
});
},
className: "c-light-black current ml10",
children: "\u62D2\u7EDD\u7533\u8BC9"
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: v === null || v === void 0 ? void 0 : v.appeal_info.content
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {})]
})
})
})
}), v.journals.map(function (val, key) {
var _val$user_info, _val$user_info2, _val$user_info3, _val$user_info4;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 24,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: "50px",
children: [(val === null || val === void 0 || (_val$user_info = val.user_info) === null || _val$user_info === void 0 ? void 0 : _val$user_info.user_image_url) === '--' && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
className: Reviewmodules.headpic,
width: "40",
src: ImagesIcon/* anonyIcon */.xp
}), (val === null || val === void 0 || (_val$user_info2 = val.user_info) === null || _val$user_info2 === void 0 ? void 0 : _val$user_info2.user_image_url) !== '--' && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
className: Reviewmodules.headpic,
width: "40",
src: "".concat(env/* default */.Z.IMG_SERVER, "/images/").concat(val === null || val === void 0 || (_val$user_info3 = val.user_info) === null || _val$user_info3 === void 0 ? void 0 : _val$user_info3.user_image_url)
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: "1",
children: [val === null || val === void 0 || (_val$user_info4 = val.user_info) === null || _val$user_info4 === void 0 ? void 0 : _val$user_info4.user_name, /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-light-black ml10",
children: dayjs_min_default()(val === null || val === void 0 ? void 0 : val.time).format('YYYY-MM-DD HH:mm')
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: val.content
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: (val === null || val === void 0 ? void 0 : val.can_delete) && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u5220\u9664",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(DeleteOutlined/* default */.Z, {
className: "current c-light-black",
onClick: function onClick() {
handleDelete(val);
}
})
})
})]
})
})
}, key), key !== v.journals.length - 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {})]
}, key);
})]
})]
})]
}), showApply.show && k === showApply.active && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: ['bg-white'].join(' '),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
onChange: function onChange(v) {
setValue(v);
},
height: 150,
isFocus: true,
watch: true
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
span: 24,
className: "tr",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "default",
size: 'middle',
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee8() {
return regeneratorRuntime_default()().wrap(function _callee8$(_context8) {
while (1) switch (_context8.prev = _context8.next) {
case 0:
setShowApply({
show: false,
type: 0,
active: k
});
case 1:
case "end":
return _context8.stop();
}
}, _callee8);
})),
children: "\u53D6\u6D88"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
size: 'middle',
className: "ml20",
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee9() {
var res;
return regeneratorRuntime_default()().wrap(function _callee9$(_context9) {
while (1) switch (_context9.prev = _context9.next) {
case 0:
if (!(value === '')) {
_context9.next = 4;
break;
}
message/* default */.ZP.error('请输入内容');
_context9.next = 14;
break;
case 4:
if (!(showApply.type === 0)) {
_context9.next = 10;
break;
}
_context9.next = 7;
return (0,service_shixunHomeworks/* addStudentWorkScoreCommit */.qP)({
comment: value,
userId: params.userId,
score_id: v.score_id
});
case 7:
res = _context9.sent;
_context9.next = 13;
break;
case 10:
_context9.next = 12;
return (0,service_shixunHomeworks/* appealAnonymousScore */.R$)({
comment: value,
score_id: v.score_id,
userId: params.userId
});
case 12:
res = _context9.sent;
case 13:
if (res.status === 0) {
message/* default */.ZP.success('操作成功');
setShowApply({
show: false,
type: 0,
active: k
});
getData();
}
case 14:
case "end":
return _context9.stop();
}
}, _callee9);
})),
children: showApply.type === 0 ? '回复' : '申诉'
})]
})
})]
})]
})]
}, k), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {})]
}, k);
})]
}), (0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: [Reviewmodules.replyList, 'bg-white'].join(' '),
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
style: {
color: '#000000',
fontWeight: 500
},
children: ["\u70B9\u8BC4\u5185\u5BB9-\u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1\uFF08", studentWorkCommon === null || studentWorkCommon === void 0 || (_studentWorkCommon$hi = studentWorkCommon.hidden_comment_scores) === null || _studentWorkCommon$hi === void 0 ? void 0 : _studentWorkCommon$hi.length, "\uFF09"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {}), studentWorkCommon === null || studentWorkCommon === void 0 || (_studentWorkCommon$hi2 = studentWorkCommon.hidden_comment_scores) === null || _studentWorkCommon$hi2 === void 0 ? void 0 : _studentWorkCommon$hi2.map(function (v, k) {
var _v$attachments2, _v$appeal_info6, _v$appeal_info7, _v$appeal_info8, _v$appeal_info9, _v$appeal_info10;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
gutter: [12, 12],
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: "40px",
children: [(v === null || v === void 0 ? void 0 : v.user_image_url) === '--' && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
className: Reviewmodules.headpic,
width: "40",
src: ImagesIcon/* anonyIcon */.xp
}), (v === null || v === void 0 ? void 0 : v.user_image_url) !== '--' && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
className: Reviewmodules.headpic,
width: "40",
src: "".concat(env/* default */.Z.IMG_SERVER, "/images/").concat(v === null || v === void 0 ? void 0 : v.user_image_url)
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: "1",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 24,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: 1,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-light-black",
children: v === null || v === void 0 ? void 0 : v.user_name
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-light-black ml10",
children: dayjs_min_default()(v === null || v === void 0 ? void 0 : v.comment_time).format('YYYY-MM-DD HH:mm')
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: k === 0 ? /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [v["delete"] && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-blue current",
onClick: function onClick() {
handleDeleteScore(v);
},
children: "\u5220\u9664"
}), v.can_appeal && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-blue current",
onClick: function onClick() {
setShowApplys({
show: true,
type: 1,
active: k
});
},
children: "\u7533\u8BC9"
}), v.can_reply && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-blue current ml10",
onClick: function onClick() {
return setShowApplys({
show: true,
type: 0,
active: k
});
},
children: "\u56DE\u590D"
})]
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [v["delete"] && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-blue current",
onClick: function onClick() {
handleDeleteScore(v);
},
children: "\u5220\u9664"
}), v.can_appeal && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-blue current",
onClick: function onClick() {
setShowApplys({
show: true,
type: 1,
active: k
});
},
children: "\u7533\u8BC9"
}), v.can_reply && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-blue current ml10",
onClick: function onClick() {
return setShowApplys({
show: true,
type: 0,
active: k
});
},
children: "\u56DE\u590D"
}), !v.can_reply && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-light-black ml10",
children: "\u5931\u6548"
})]
})
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
span: 24,
children: [v.hidden_comment && /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: v.hidden_comment
}), !v.hidden_comment && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-light-black",
children: "\u6682\u672A\u5199\u8BC4\u8BED"
}), v === null || v === void 0 || (_v$attachments2 = v.attachments) === null || _v$attachments2 === void 0 ? void 0 : _v$attachments2.map(function (item, key) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
href: "".concat(env/* default */.Z.API_SERVER).concat(item.url),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "iconfont icon-fujian c-green font14"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml10 c-black",
children: item.title
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-light-black ml20 font12",
children: item.filesize
})]
})
}, key);
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "w100",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: [Reviewmodules.comment, 'w100'].join(' '),
children: [v.appeal_info && v.appeal_info != '' && /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 24,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: "50px",
children: [(v === null || v === void 0 || (_v$appeal_info6 = v.appeal_info) === null || _v$appeal_info6 === void 0 ? void 0 : _v$appeal_info6.user_image_url) === '--' && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
className: Reviewmodules.headpic,
width: "40",
src: ImagesIcon/* anonyIcon */.xp
}), (v === null || v === void 0 || (_v$appeal_info7 = v.appeal_info) === null || _v$appeal_info7 === void 0 ? void 0 : _v$appeal_info7.user_image_url) !== '--' && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
className: Reviewmodules.headpic,
width: "40",
src: "".concat(env/* default */.Z.IMG_SERVER, "/images/").concat(v === null || v === void 0 || (_v$appeal_info8 = v.appeal_info) === null || _v$appeal_info8 === void 0 ? void 0 : _v$appeal_info8.user_image_url)
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: "1",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: "1",
children: [v === null || v === void 0 || (_v$appeal_info9 = v.appeal_info) === null || _v$appeal_info9 === void 0 ? void 0 : _v$appeal_info9.user_name, /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-light-black ml10",
children: dayjs_min_default()(v === null || v === void 0 || (_v$appeal_info10 = v.appeal_info) === null || _v$appeal_info10 === void 0 ? void 0 : _v$appeal_info10.time).format('YYYY-MM-DD HH:mm')
}), (v === null || v === void 0 ? void 0 : v.appeal_status) === 1 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "tag-style bg-blue ml10",
children: "\u7533\u8BC9\u4E2D"
}), (v === null || v === void 0 ? void 0 : v.appeal_status) === 2 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "tag-style bg-grey-ede c-light-black ml10",
children: "\u7533\u8BC9\u5DF2\u64A4\u9500"
}), (v === null || v === void 0 ? void 0 : v.appeal_status) === 3 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "tag-style bg-blue ml10",
children: "\u7533\u8BC9\u6210\u529F"
}), (v === null || v === void 0 ? void 0 : v.appeal_status) === 4 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "tag-style bg-grey-ede c-light-black ml10",
children: "\u7533\u8BC9\u88AB\u62D2\u7EDD"
}), (v === null || v === void 0 ? void 0 : v.appeal_status) === 5 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "tag-style bg-grey-ede c-light-black ml10",
children: "\u7533\u8BC9\u5931\u8D25"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
children: [(v === null || v === void 0 ? void 0 : v.appeal_status) === 1 && v.can_appeal && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
onClick: function onClick() {
es_modal/* default */.Z.confirm({
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u64A4\u9500\u7533\u8BC9\u540E\uFF0C\u65E0\u6CD5\u518D\u5BF9\u672C\u8BC4\u9605\u8BB0\u5F55\u8FDB\u884C\u7533\u8BC9", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u662F\u5426\u786E\u8BA4\u64A4\u9500\u7533\u8BC9"]
}),
onOk: function () {
var _onOk6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee10() {
return regeneratorRuntime_default()().wrap(function _callee10$(_context10) {
while (1) switch (_context10.prev = _context10.next) {
case 0:
getData();
case 1:
case "end":
return _context10.stop();
}
}, _callee10);
}));
function onOk() {
return _onOk6.apply(this, arguments);
}
return onOk;
}()
});
},
className: "c-blue current",
children: "\u64A4\u9500\u7533\u8BC9"
}), (v === null || v === void 0 ? void 0 : v.appeal_status) === 1 && (0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
onClick: function onClick() {
es_modal/* default */.Z.confirm({
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u6B64\u533F\u8BC4\u6210\u7EE9\u5C06\u88AB\u5E9F\u5F03\uFF0C\u8BC4\u9605\u4EBA\u7684\u4F5C\u54C1\u5C06\u88AB\u8FDD\u89C4\u6263\u5206", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u662F\u5426\u786E\u8BA4\u63A5\u53D7\u7533\u8BC9"]
}),
onOk: function () {
var _onOk7 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee11() {
var res;
return regeneratorRuntime_default()().wrap(function _callee11$(_context11) {
while (1) switch (_context11.prev = _context11.next) {
case 0:
_context11.next = 2;
return (0,fetch/* default */.ZP)("/api/student_works/".concat(params.userId, "/deal_appeal_score.json"), {
method: 'post',
body: {
score_id: v.score_id,
status: 3
}
});
case 2:
res = _context11.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
getData();
}
case 4:
case "end":
return _context11.stop();
}
}, _callee11);
}));
function onOk() {
return _onOk7.apply(this, arguments);
}
return onOk;
}()
});
},
className: "c-red current",
children: "\u63A5\u53D7\u7533\u8BC9"
}), (v === null || v === void 0 ? void 0 : v.appeal_status) === 1 && (0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
onClick: function onClick() {
es_modal/* default */.Z.confirm({
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u6B64\u533F\u8BC4\u6210\u7EE9\u5C06\u88AB\u8BA4\u4E3A\u5408\u7406", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u662F\u5426\u786E\u8BA4\u62D2\u7EDD\u7533\u8BC9"]
}),
onOk: function () {
var _onOk8 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee12() {
var res;
return regeneratorRuntime_default()().wrap(function _callee12$(_context12) {
while (1) switch (_context12.prev = _context12.next) {
case 0:
_context12.next = 2;
return (0,fetch/* default */.ZP)("/api/student_works/".concat(params.userId, "/deal_appeal_score.json"), {
method: 'post',
body: {
score_id: v.score_id,
status: 4
}
});
case 2:
res = _context12.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
getData();
}
case 4:
case "end":
return _context12.stop();
}
}, _callee12);
}));
function onOk() {
return _onOk8.apply(this, arguments);
}
return onOk;
}()
});
},
className: "c-light-black current ml10",
children: "\u62D2\u7EDD\u7533\u8BC9"
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: v === null || v === void 0 ? void 0 : v.appeal_info.content
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {})]
})
})
})
}), v.journals.map(function (val, key) {
var _val$user_info5, _val$user_info6, _val$user_info7, _val$user_info8;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 24,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: "50px",
children: [(val === null || val === void 0 || (_val$user_info5 = val.user_info) === null || _val$user_info5 === void 0 ? void 0 : _val$user_info5.user_image_url) === '--' && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
className: Reviewmodules.headpic,
width: "40",
src: ImagesIcon/* anonyIcon */.xp
}), (val === null || val === void 0 || (_val$user_info6 = val.user_info) === null || _val$user_info6 === void 0 ? void 0 : _val$user_info6.user_image_url) !== '--' && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
className: Reviewmodules.headpic,
width: "40",
src: "".concat(env/* default */.Z.IMG_SERVER, "/images/").concat(val === null || val === void 0 || (_val$user_info7 = val.user_info) === null || _val$user_info7 === void 0 ? void 0 : _val$user_info7.user_image_url)
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: "1",
children: [val === null || val === void 0 || (_val$user_info8 = val.user_info) === null || _val$user_info8 === void 0 ? void 0 : _val$user_info8.user_name, /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-light-black ml10",
children: dayjs_min_default()(val === null || val === void 0 ? void 0 : val.time).format('YYYY-MM-DD HH:mm')
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: val.hidden_comment
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: (val === null || val === void 0 ? void 0 : val.can_delete) && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u5220\u9664",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(DeleteOutlined/* default */.Z, {
className: "current c-light-black",
onClick: function onClick() {
handleDelete(val);
}
})
})
})]
})
})
}, key), key !== v.journals.length - 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {})]
}, key);
})]
})]
})]
}), showApplys.show && k === showApplys.active && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: ['bg-white'].join(' '),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
onChange: function onChange(v) {
setValue(v);
},
height: 150,
isFocus: true,
watch: true
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
span: 24,
className: "tr",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "default",
size: 'middle',
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee13() {
return regeneratorRuntime_default()().wrap(function _callee13$(_context13) {
while (1) switch (_context13.prev = _context13.next) {
case 0:
setShowApplys({
show: false,
type: 0,
active: k
});
case 1:
case "end":
return _context13.stop();
}
}, _callee13);
})),
children: "\u53D6\u6D88"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
size: 'middle',
className: "ml20",
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee14() {
var res;
return regeneratorRuntime_default()().wrap(function _callee14$(_context14) {
while (1) switch (_context14.prev = _context14.next) {
case 0:
if (!(value === '')) {
_context14.next = 4;
break;
}
message/* default */.ZP.error('请输入内容');
_context14.next = 14;
break;
case 4:
if (!(showApplys.type === 0)) {
_context14.next = 10;
break;
}
_context14.next = 7;
return (0,service_shixunHomeworks/* addStudentWorkScoreCommit */.qP)({
hidden_comment: value,
userId: params.userId,
score_id: v.score_id
});
case 7:
res = _context14.sent;
_context14.next = 13;
break;
case 10:
_context14.next = 12;
return (0,service_shixunHomeworks/* appealAnonymousScore */.R$)({
comment: value,
score_id: v.score_id,
userId: params.userId
});
case 12:
res = _context14.sent;
case 13:
if (res.status === 0) {
message/* default */.ZP.success('操作成功');
setShowApplys({
show: false,
type: 0,
active: k
});
getData();
}
case 14:
case "end":
return _context14.stop();
}
}, _callee14);
})),
children: showApplys.type === 0 ? '回复' : '申诉'
})]
})
})]
})]
})]
}, k), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {})]
}, k);
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(ChangeScore, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(AfterAppendix, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(image_preview/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_modal/* default */.Z, {
title: "\u786E\u8BA4\u6253\u56DE\u91CD\u505A",
open: isshow,
destroyOnClose: true,
forceRender: true,
onCancel: function onCancel() {
setisshow(false);
},
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee15() {
var res;
return regeneratorRuntime_default()().wrap(function _callee15$(_context15) {
while (1) switch (_context15.prev = _context15.next) {
case 0:
if (comment) {
_context15.next = 3;
break;
}
message/* default */.ZP.info('评语不能为空');
return _context15.abrupt("return");
case 3:
_context15.next = 5;
return (0,fetch/* default */.ZP)("/api/student_works/".concat(params.userId, "/redo_modal.json"), {
method: 'post',
body: {
comment: comment,
id: params.userId
}
});
case 5:
res = _context15.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
message/* default */.ZP.info('打回重做成功');
setisshow(false);
getData();
}
case 7:
case "end":
return _context15.stop();
}
}, _callee15);
})),
width: 700,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
padding: '32px'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: ["\u786E\u8BA4\u5C06", studentWorkDetail === null || studentWorkDetail === void 0 ? void 0 : studentWorkDetail.author_name, "\u7684\u4F5C\u4E1A\u6253\u56DE\u91CD\u505A\u5417"]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
marginTop: '20px'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("label", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
marginRight: '5px',
color: 'red'
},
children: "*"
}), "\u8BC4\u8BED\uFF1A"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
className: Reviewmodules.MdEditor,
onChange: function onChange(e) {
return setcomment(e);
},
defaultValue: "",
height: 250
})]
})]
})
}), contextHolder, /*#__PURE__*/(0,jsx_runtime.jsx)(PreviewAll/* default */.Z, {
close: true,
data: data === null || data === void 0 ? void 0 : data.content,
type: data === null || data === void 0 ? void 0 : data.type,
hasMask: true
// style={{...stylesPrev}}
,
monacoEditor: {
value: monacoValueRef.current,
language: "txt",
onChange: function onChange() {},
options: {
readOnly: true,
fontSize: 14,
minimap: {
enabled: false
}
}
},
onClose: function onClose() {
return setData({
content: "",
type: ""
});
}
})]
});
};
/* harmony default export */ var Review = ((0,_umi_production_exports.connect)(function (_ref9) {
var shixunHomeworks = _ref9.shixunHomeworks,
loading = _ref9.loading,
user = _ref9.user,
globalSetting = _ref9.globalSetting;
return {
shixunHomeworks: shixunHomeworks,
globalSetting: globalSetting,
user: user,
loading: loading.effects
};
})(ExeriseReview));
/***/ }),
/***/ 68074:
/*!**************************************************!*\
!*** ./src/pages/MoopCases/FormPanel/service.ts ***!
\**************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ $J: function() { return /* binding */ getMoopCase; },
/* harmony export */ JZ: function() { return /* binding */ removeAttachment; },
/* harmony export */ bN: function() { return /* binding */ updateMoopCase; },
/* harmony export */ jP: function() { return /* binding */ addMoopCase; },
/* harmony export */ rO: function() { return /* binding */ getLibraryTags; }
/* harmony export */ });
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js */ 10574);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js */ 39343);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/utils/fetch */ 15830);
function getMoopCase(id) {
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_2__/* .get */ .U2)("libraries/".concat(id, ".json"));
}
function getLibraryTags() {
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_2__/* .get */ .U2)('library_tags.json');
}
function removeAttachment(_x) {
return _removeAttachment.apply(this, arguments);
}
function _removeAttachment() {
_removeAttachment = _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _callee(id) {
var response;
return _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_2__/* .del */ .IV)("attachments/".concat(id, ".json"));
case 2:
response = _context.sent;
return _context.abrupt("return", response.status === 0);
case 4:
case "end":
return _context.stop();
}
}, _callee);
}));
return _removeAttachment.apply(this, arguments);
}
function addMoopCase(params) {
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_2__/* .post */ .v_)("libraries.json", params);
}
function updateMoopCase(id, params) {
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_2__/* .put */ .gz)("libraries/".concat(id, ".json"), params);
}
/***/ })
}]);