|
|
|
|
@ -58,6 +58,263 @@ var noData = function noData(_ref) {
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 19480:
|
|
|
|
|
/*!*********************************************************!*\
|
|
|
|
|
!*** ./src/components/PreviewAll/index.tsx + 1 modules ***!
|
|
|
|
|
\*********************************************************/
|
|
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
|
|
Z: function() { return /* binding */ PreviewAll; }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 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/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/PreviewAll/index.less?modules
|
|
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
/* harmony default export */ var PreviewAllmodules = ({"wrp":"wrp___dq7YK","bgBlack":"bgBlack___ARIUV","monaco":"monaco___VnZC3","darkBlue":"darkBlue___UprA9","close":"close___LKoWu","embed":"embed___hvpEJ"});
|
|
|
|
|
// 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/ArrowDownOutlined.js + 1 modules
|
|
|
|
|
var ArrowDownOutlined = __webpack_require__(98915);
|
|
|
|
|
// EXTERNAL MODULE: ./src/components/monaco-editor/index.jsx + 3 modules
|
|
|
|
|
var monaco_editor = __webpack_require__(76329);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
|
|
|
var tooltip = __webpack_require__(6848);
|
|
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
|
|
var util = __webpack_require__(22739);
|
|
|
|
|
// EXTERNAL MODULE: ./src/service/exercise.ts
|
|
|
|
|
var exercise = __webpack_require__(35367);
|
|
|
|
|
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
|
|
|
|
var NoData = __webpack_require__(73208);
|
|
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
|
|
var env = __webpack_require__(78130);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
|
|
;// CONCATENATED MODULE: ./src/components/PreviewAll/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var PreviewAll = (function (_ref) {
|
|
|
|
|
var _data, _data2, _data3, _data4, _data5, _data6, _data7;
|
|
|
|
|
var _ref$editOffice = _ref.editOffice,
|
|
|
|
|
editOffice = _ref$editOffice === void 0 ? 'view' : _ref$editOffice,
|
|
|
|
|
data = _ref.data,
|
|
|
|
|
theme = _ref.theme,
|
|
|
|
|
type = _ref.type,
|
|
|
|
|
filename = _ref.filename,
|
|
|
|
|
monacoEditor = _ref.monacoEditor,
|
|
|
|
|
className = _ref.className,
|
|
|
|
|
style = _ref.style,
|
|
|
|
|
close = _ref.close,
|
|
|
|
|
onClose = _ref.onClose,
|
|
|
|
|
hasMask = _ref.hasMask,
|
|
|
|
|
disabledDownload = _ref.disabledDownload,
|
|
|
|
|
onImgDimensions = _ref.onImgDimensions,
|
|
|
|
|
showNodata = _ref.showNodata;
|
|
|
|
|
var _useState = (0,_react_17_0_2_react.useState)('https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt'),
|
|
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
|
|
src = _useState2[0],
|
|
|
|
|
setSrc = _useState2[1];
|
|
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(""),
|
|
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
|
|
token = _useState4[0],
|
|
|
|
|
setToken = _useState4[1];
|
|
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(),
|
|
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
|
|
officeData = _useState6[0],
|
|
|
|
|
setOfficeData = _useState6[1];
|
|
|
|
|
var officePath = window.ENV === "build" ? "/react/build" : "";
|
|
|
|
|
var apiServer = location.host.startsWith("localhost") ? env/* default */.Z.PROXY_SERVER : env/* default */.Z.API_SERVER;
|
|
|
|
|
// let size;
|
|
|
|
|
console.log("disabledDownload---", disabledDownload);
|
|
|
|
|
var unit = 1024 * 1024;
|
|
|
|
|
var maxSize = 10 * unit;
|
|
|
|
|
var closeRef = (0,_react_17_0_2_react.useRef)();
|
|
|
|
|
if ((_data = data) !== null && _data !== void 0 && _data.startsWith("/api") && type !== "txt") {
|
|
|
|
|
data = env/* default */.Z.API_SERVER + data;
|
|
|
|
|
}
|
|
|
|
|
// if (type === "office") {
|
|
|
|
|
// size = parseUrl(data).filesize
|
|
|
|
|
// if (size > maxSize) {
|
|
|
|
|
// type = "other"
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
if (filename) monacoEditor.filename = filename;
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
|
|
var _document$cookie;
|
|
|
|
|
var cookies = (_document$cookie = document.cookie) === null || _document$cookie === void 0 || (_document$cookie = _document$cookie.replace(/\s/g, "")) === null || _document$cookie === void 0 ? void 0 : _document$cookie.split(";");
|
|
|
|
|
cookies === null || cookies === void 0 || cookies.map(function (item) {
|
|
|
|
|
var i = item.split("=");
|
|
|
|
|
if (i[0] === '_educoder_session') {
|
|
|
|
|
setToken(i[1]);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}, []);
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
|
|
if (type === "office") getData();
|
|
|
|
|
}, [type, data]);
|
|
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
|
|
var _url, _id, res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
console.log("data:", data);
|
|
|
|
|
_url = data;
|
|
|
|
|
if (!data.startsWith("http")) {
|
|
|
|
|
_url = location.origin + _url;
|
|
|
|
|
}
|
|
|
|
|
_id = new URL(_url).pathname.split("/").pop();
|
|
|
|
|
_context.next = 6;
|
|
|
|
|
return (0,exercise/* setEcsAttachment */.gJ)({
|
|
|
|
|
attachment_id: _id
|
|
|
|
|
});
|
|
|
|
|
case 6:
|
|
|
|
|
res = _context.sent;
|
|
|
|
|
setOfficeData(res);
|
|
|
|
|
case 8:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee);
|
|
|
|
|
}));
|
|
|
|
|
return function getData() {
|
|
|
|
|
return _ref2.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
var handleClick = function handleClick() {
|
|
|
|
|
if (data.startsWith("http") || data.startsWith('blob:')) {
|
|
|
|
|
handleDown();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
(0,util/* downloadFile */.Sv)(filename || 'educoder', data, filename);
|
|
|
|
|
};
|
|
|
|
|
var handleDown = function handleDown() {
|
|
|
|
|
(0,util/* downLoadLink */.Nd)(filename || 'educoder', decodeURIComponent(data));
|
|
|
|
|
};
|
|
|
|
|
console.log(data, 'data');
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
style: objectSpread2_default()({}, style || {}),
|
|
|
|
|
className: "".concat(hasMask && PreviewAllmodules.bgBlack, " ").concat(!!type ? PreviewAllmodules.wrp : "hide"),
|
|
|
|
|
children: [close && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: PreviewAllmodules.close,
|
|
|
|
|
ref: closeRef,
|
|
|
|
|
children: [!!onImgDimensions && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
|
|
title: "\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",
|
|
|
|
|
getPopupContainer: function getPopupContainer() {
|
|
|
|
|
return closeRef.current;
|
|
|
|
|
},
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
onClose();
|
|
|
|
|
onImgDimensions();
|
|
|
|
|
},
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
|
|
className: "icon-yulanpizhu"
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}), !disabledDownload && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
|
|
title: "\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",
|
|
|
|
|
getPopupContainer: function getPopupContainer() {
|
|
|
|
|
return closeRef.current;
|
|
|
|
|
},
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
|
|
onClick: handleDown,
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
|
|
className: "icon-quxiaozhiding"
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
|
|
title: "\u5173\u95ED",
|
|
|
|
|
getPopupContainer: function getPopupContainer() {
|
|
|
|
|
return closeRef.current;
|
|
|
|
|
},
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
|
|
className: "",
|
|
|
|
|
onClick: onClose,
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
|
|
className: "icon-guanbi1"
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})]
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
className: "".concat(PreviewAllmodules[className], " ").concat(className, " ").concat(PreviewAllmodules.monaco, " ").concat(type === "txt" ? "show" : "hide"),
|
|
|
|
|
children: type === "txt" && /*#__PURE__*/(0,jsx_runtime.jsx)(monaco_editor/* default */.ZP, objectSpread2_default()({}, monacoEditor))
|
|
|
|
|
}), type === "audio" && /*#__PURE__*/(0,jsx_runtime.jsx)("audio", {
|
|
|
|
|
src: ((_data2 = data) === null || _data2 === void 0 ? void 0 : _data2.indexOf("http")) > -1 || (_data3 = data) !== null && _data3 !== void 0 && _data3.startsWith("/api") ? data : "data:image/png;base64,".concat(data),
|
|
|
|
|
autoPlay: true
|
|
|
|
|
}), type === "video" && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
|
|
|
children: ((_data4 = data) === null || _data4 === void 0 ? void 0 : _data4.indexOf("http")) > -1 || (_data5 = data) !== null && _data5 !== void 0 && _data5.startsWith("/api") ? /*#__PURE__*/(0,jsx_runtime.jsx)("video", {
|
|
|
|
|
controls: true,
|
|
|
|
|
src: "".concat(data),
|
|
|
|
|
autoPlay: true
|
|
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("video", {
|
|
|
|
|
controls: true,
|
|
|
|
|
src: "data:video/mp4;base64,".concat(data),
|
|
|
|
|
autoPlay: true
|
|
|
|
|
})
|
|
|
|
|
}), type === 'office' && officeData && /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
|
|
|
|
|
src: "".concat(officePath, "/office.html?key=").concat(officeData.key, "&url=").concat(apiServer + officeData.url, "&callbackUrl=").concat(apiServer + officeData.callbackUrl, "&fileType=").concat(officeData.fileType, "&title=").concat(officeData.title, "&model=").concat(editOffice, "&officeServer=").concat(env/* default */.Z.ONLYOFFICE, "&disabledDownload=").concat(!!disabledDownload)
|
|
|
|
|
}), type === 'html' && /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
|
|
|
|
|
src: data + '&disposition=inline'
|
|
|
|
|
}), type === 'pdf' && /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
|
|
|
|
|
src: "".concat(officePath, "/js/pdfview/index.html?url=").concat(data, "&disabledDownload=").concat(!!disabledDownload)
|
|
|
|
|
}) //<embed className={styles.embed + "#toolbar=0"} src={data} />
|
|
|
|
|
, type === "image" && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
|
|
src: ((_data6 = data) === null || _data6 === void 0 ? void 0 : _data6.indexOf("http")) > -1 || (_data7 = data) !== null && _data7 !== void 0 && _data7.startsWith("/api") ? data : "data:image/png;base64,".concat(data)
|
|
|
|
|
}), (type === "other" || type === "download") && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
|
|
|
children: showNodata ? /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {
|
|
|
|
|
customText: "\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",
|
|
|
|
|
ButtonTwo: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
|
|
className: "iconfont icon-xiazai4 font14"
|
|
|
|
|
}),
|
|
|
|
|
type: "primary",
|
|
|
|
|
size: 'middle',
|
|
|
|
|
onClick: handleClick,
|
|
|
|
|
children: "\u4E0B\u8F7D"
|
|
|
|
|
})
|
|
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
|
|
|
|
|
type: "primary",
|
|
|
|
|
size: 'middle',
|
|
|
|
|
onClick: handleClick,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ArrowDownOutlined/* default */.Z, {}), "\u70B9\u51FB\u4E0B\u8F7D"]
|
|
|
|
|
})
|
|
|
|
|
})]
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 4929:
|
|
|
|
|
/*!******************************************************!*\
|
|
|
|
|
!*** ./src/components/WangEditor/WangEditorForm.tsx ***!
|
|
|
|
|
@ -454,6 +711,10 @@ var env = __webpack_require__(78130);
|
|
|
|
|
var util = __webpack_require__(22739);
|
|
|
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
|
|
|
var fetch = __webpack_require__(91506);
|
|
|
|
|
// EXTERNAL MODULE: ./src/components/PreviewAll/index.tsx + 1 modules
|
|
|
|
|
var PreviewAll = __webpack_require__(19480);
|
|
|
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
|
|
|
var authority = __webpack_require__(13186);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/CoreCurriculum/Lists/Knowledge/index.tsx
|
|
|
|
|
@ -476,6 +737,8 @@ var _excluded = ["key", "name"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Page = function Page(_ref) {
|
|
|
|
|
var _KnowledgeModules$mod2, _KnowledgePoints$char, _KnowledgePointInfo$a, _KnowledgePointInfo$a2, _KnowledgeModules$mod3;
|
|
|
|
|
var coreCurriculum = _ref.coreCurriculum,
|
|
|
|
|
@ -506,6 +769,14 @@ var Page = function Page(_ref) {
|
|
|
|
|
isEdit = _useState4[0],
|
|
|
|
|
setIsEdit = _useState4[1];
|
|
|
|
|
var itemActive = (0,_react_17_0_2_react.useRef)(null);
|
|
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)({
|
|
|
|
|
content: "",
|
|
|
|
|
type: ""
|
|
|
|
|
}),
|
|
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
|
|
data = _useState6[0],
|
|
|
|
|
setData = _useState6[1];
|
|
|
|
|
var monacoValueRef = (0,_react_17_0_2_react.useRef)();
|
|
|
|
|
var uploadProps = {
|
|
|
|
|
// accept: ".pdf, .docx, .doc, .xlsx, .xls, .ppt, .pptx, .zip,.jpg,.png",
|
|
|
|
|
beforeUpload: function beforeUpload(file) {
|
|
|
|
|
@ -554,6 +825,52 @@ var Page = function Page(_ref) {
|
|
|
|
|
return Promise.reject();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
var getOpenFile = /*#__PURE__*/function () {
|
|
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(id) {
|
|
|
|
|
var result, res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context2.next = 2;
|
|
|
|
|
return (0,fetch/* default */.ZP)("/api/attachments/".concat(id, "/detail.json"), {
|
|
|
|
|
method: 'get'
|
|
|
|
|
});
|
|
|
|
|
case 2:
|
|
|
|
|
result = _context2.sent;
|
|
|
|
|
if (!((result === null || result === void 0 ? void 0 : result.status) !== -1)) {
|
|
|
|
|
_context2.next = 10;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (!(result.file_type === "txt")) {
|
|
|
|
|
_context2.next = 9;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
_context2.next = 7;
|
|
|
|
|
return (0,fetch/* default */.ZP)(result.url, {
|
|
|
|
|
method: "get",
|
|
|
|
|
headers: {
|
|
|
|
|
"Content-Type": "application/xml"
|
|
|
|
|
},
|
|
|
|
|
credentials: 'omit'
|
|
|
|
|
});
|
|
|
|
|
case 7:
|
|
|
|
|
res = _context2.sent;
|
|
|
|
|
monacoValueRef.current = res;
|
|
|
|
|
case 9:
|
|
|
|
|
setData({
|
|
|
|
|
type: result.file_type,
|
|
|
|
|
content: result.url + "&nocredentials=true"
|
|
|
|
|
});
|
|
|
|
|
case 10:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context2.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee2);
|
|
|
|
|
}));
|
|
|
|
|
return function getOpenFile(_x2) {
|
|
|
|
|
return _ref2.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
var closeOrOpenModal = function closeOrOpenModal() {
|
|
|
|
|
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
|
|
|
dispatch({
|
|
|
|
|
@ -603,13 +920,13 @@ var Page = function Page(_ref) {
|
|
|
|
|
console.log(pieceDeg, picARad, -picARad, pieceDeg === 0, picARad);
|
|
|
|
|
};
|
|
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
|
|
var _res$data;
|
|
|
|
|
var res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context2.next = 2;
|
|
|
|
|
_context3.next = 2;
|
|
|
|
|
return dispatch({
|
|
|
|
|
type: 'coreCurriculum/getKnowledgeCharts',
|
|
|
|
|
payload: {
|
|
|
|
|
@ -617,16 +934,16 @@ var Page = function Page(_ref) {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
case 2:
|
|
|
|
|
res = _context2.sent;
|
|
|
|
|
res = _context3.sent;
|
|
|
|
|
getKnowledgeChartsPoint(res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 || (_res$data = _res$data.module_names) === null || _res$data === void 0 ? void 0 : _res$data[0].id);
|
|
|
|
|
case 4:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context2.stop();
|
|
|
|
|
return _context3.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee2);
|
|
|
|
|
}, _callee3);
|
|
|
|
|
}));
|
|
|
|
|
return function getData() {
|
|
|
|
|
return _ref2.apply(this, arguments);
|
|
|
|
|
return _ref3.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
var getKnowledgeChartsPoint = function getKnowledgeChartsPoint() {
|
|
|
|
|
@ -756,17 +1073,17 @@ var Page = function Page(_ref) {
|
|
|
|
|
okText: "确定删除",
|
|
|
|
|
cancelText: "取消",
|
|
|
|
|
onOk: function () {
|
|
|
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
|
|
|
var res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context3.next = 2;
|
|
|
|
|
_context4.next = 2;
|
|
|
|
|
return (0,fetch/* default */.ZP)("/api/core_subjects/".concat(params === null || params === void 0 ? void 0 : params.coreId, "/core_subject_knowledge_charts/").concat(KnowledgePoints.id, ".json"), {
|
|
|
|
|
method: 'delete'
|
|
|
|
|
});
|
|
|
|
|
case 2:
|
|
|
|
|
res = _context3.sent;
|
|
|
|
|
res = _context4.sent;
|
|
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
|
|
|
message/* default */.ZP.success("删除成功");
|
|
|
|
|
getData();
|
|
|
|
|
@ -774,9 +1091,9 @@ var Page = function Page(_ref) {
|
|
|
|
|
}
|
|
|
|
|
case 4:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context3.stop();
|
|
|
|
|
return _context4.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee3);
|
|
|
|
|
}, _callee4);
|
|
|
|
|
}));
|
|
|
|
|
function onOk() {
|
|
|
|
|
return _onOk.apply(this, arguments);
|
|
|
|
|
@ -859,12 +1176,12 @@ var Page = function Page(_ref) {
|
|
|
|
|
okText: "确定删除",
|
|
|
|
|
cancelText: "取消",
|
|
|
|
|
onOk: function () {
|
|
|
|
|
var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
|
|
|
var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
|
|
|
|
|
var res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context4.next = 2;
|
|
|
|
|
_context5.next = 2;
|
|
|
|
|
return (0,fetch/* default */.ZP)("/api/core_subjects/".concat(params.coreId, "/core_subject_knowledge_charts/del_chart_knowledge.json"), {
|
|
|
|
|
method: 'delete',
|
|
|
|
|
body: {
|
|
|
|
|
@ -872,7 +1189,7 @@ var Page = function Page(_ref) {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
case 2:
|
|
|
|
|
res = _context4.sent;
|
|
|
|
|
res = _context5.sent;
|
|
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
|
|
|
message/* default */.ZP.success("删除成功");
|
|
|
|
|
getKnowledgeChartsPoint();
|
|
|
|
|
@ -880,9 +1197,9 @@ var Page = function Page(_ref) {
|
|
|
|
|
}
|
|
|
|
|
case 4:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context4.stop();
|
|
|
|
|
return _context5.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee4);
|
|
|
|
|
}, _callee5);
|
|
|
|
|
}));
|
|
|
|
|
function onOk() {
|
|
|
|
|
return _onOk2.apply(this, arguments);
|
|
|
|
|
@ -987,14 +1304,14 @@ var Page = function Page(_ref) {
|
|
|
|
|
size: "large",
|
|
|
|
|
initialValues: {},
|
|
|
|
|
onFinish: /*#__PURE__*/function () {
|
|
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5(ValueAll) {
|
|
|
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6(ValueAll) {
|
|
|
|
|
var _ValueAll$module_name;
|
|
|
|
|
var res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
|
|
|
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
console.log(ValueAll);
|
|
|
|
|
_context5.next = 3;
|
|
|
|
|
_context6.next = 3;
|
|
|
|
|
return dispatch({
|
|
|
|
|
type: "coreCurriculum/postKnowledgeCharts",
|
|
|
|
|
payload: {
|
|
|
|
|
@ -1007,7 +1324,7 @@ var Page = function Page(_ref) {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
case 3:
|
|
|
|
|
res = _context5.sent;
|
|
|
|
|
res = _context6.sent;
|
|
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
|
|
|
message/* default */.ZP.success(isEdit ? "修改成功" : "新增成功");
|
|
|
|
|
closeOrOpenModal();
|
|
|
|
|
@ -1015,25 +1332,25 @@ var Page = function Page(_ref) {
|
|
|
|
|
}
|
|
|
|
|
case 5:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context5.stop();
|
|
|
|
|
return _context6.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee5);
|
|
|
|
|
}, _callee6);
|
|
|
|
|
}));
|
|
|
|
|
return function (_x2) {
|
|
|
|
|
return _ref3.apply(this, arguments);
|
|
|
|
|
return function (_x3) {
|
|
|
|
|
return _ref4.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}(),
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.List, {
|
|
|
|
|
name: "module_names",
|
|
|
|
|
children: function children(fields, _ref4) {
|
|
|
|
|
var add = _ref4.add,
|
|
|
|
|
remove = _ref4.remove,
|
|
|
|
|
move = _ref4.move;
|
|
|
|
|
children: function children(fields, _ref5) {
|
|
|
|
|
var add = _ref5.add,
|
|
|
|
|
remove = _ref5.remove,
|
|
|
|
|
move = _ref5.move;
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
|
|
|
children: fields.map(function (_ref5, index) {
|
|
|
|
|
var key = _ref5.key,
|
|
|
|
|
name = _ref5.name,
|
|
|
|
|
restField = objectWithoutProperties_default()(_ref5, _excluded);
|
|
|
|
|
children: fields.map(function (_ref6, index) {
|
|
|
|
|
var key = _ref6.key,
|
|
|
|
|
name = _ref6.name,
|
|
|
|
|
restField = objectWithoutProperties_default()(_ref6, _excluded);
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
|
|
gutter: 20,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, objectSpread2_default()(objectSpread2_default()({}, restField), {}, {
|
|
|
|
|
@ -1139,18 +1456,18 @@ var Page = function Page(_ref) {
|
|
|
|
|
size: "large",
|
|
|
|
|
initialValues: {},
|
|
|
|
|
onFinish: /*#__PURE__*/function () {
|
|
|
|
|
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6(ValueAll) {
|
|
|
|
|
var _ref7 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7(ValueAll) {
|
|
|
|
|
var _ValueAll$attachment_;
|
|
|
|
|
var res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
|
|
|
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee7$(_context7) {
|
|
|
|
|
while (1) switch (_context7.prev = _context7.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
console.log(ValueAll);
|
|
|
|
|
ValueAll.attachment_ids = ((_ValueAll$attachment_ = ValueAll.attachment_ids) === null || _ValueAll$attachment_ === void 0 ? void 0 : _ValueAll$attachment_.map(function (item) {
|
|
|
|
|
var _item$response;
|
|
|
|
|
return item === null || item === void 0 || (_item$response = item.response) === null || _item$response === void 0 ? void 0 : _item$response.id;
|
|
|
|
|
})) || [];
|
|
|
|
|
_context6.next = 4;
|
|
|
|
|
_context7.next = 4;
|
|
|
|
|
return dispatch({
|
|
|
|
|
type: isEdit ? "coreCurriculum/putKnowledgeChartsPoint" : "coreCurriculum/postKnowledgeChartsPoint",
|
|
|
|
|
payload: objectSpread2_default()(objectSpread2_default()({}, ValueAll), {}, {
|
|
|
|
|
@ -1158,7 +1475,7 @@ var Page = function Page(_ref) {
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
case 4:
|
|
|
|
|
res = _context6.sent;
|
|
|
|
|
res = _context7.sent;
|
|
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
|
|
|
message/* default */.ZP.success(isEdit ? "修改成功" : "新增成功");
|
|
|
|
|
closeOrOpenModal();
|
|
|
|
|
@ -1166,12 +1483,12 @@ var Page = function Page(_ref) {
|
|
|
|
|
}
|
|
|
|
|
case 6:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context6.stop();
|
|
|
|
|
return _context7.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee6);
|
|
|
|
|
}, _callee7);
|
|
|
|
|
}));
|
|
|
|
|
return function (_x3) {
|
|
|
|
|
return _ref6.apply(this, arguments);
|
|
|
|
|
return function (_x4) {
|
|
|
|
|
return _ref7.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}(),
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
@ -1276,21 +1593,21 @@ var Page = function Page(_ref) {
|
|
|
|
|
size: "large",
|
|
|
|
|
initialValues: {},
|
|
|
|
|
onFinish: /*#__PURE__*/function () {
|
|
|
|
|
var _ref7 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7(ValueAll) {
|
|
|
|
|
var _ref8 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee8(ValueAll) {
|
|
|
|
|
var _ValueAll$file;
|
|
|
|
|
var formData, res, _res$data2, _res$data3, _res$data4, modal;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee7$(_context7) {
|
|
|
|
|
while (1) switch (_context7.prev = _context7.next) {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee8$(_context8) {
|
|
|
|
|
while (1) switch (_context8.prev = _context8.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
formData = new FormData();
|
|
|
|
|
formData.append('file', ValueAll === null || ValueAll === void 0 || (_ValueAll$file = ValueAll.file) === null || _ValueAll$file === void 0 || (_ValueAll$file = _ValueAll$file[0]) === null || _ValueAll$file === void 0 ? void 0 : _ValueAll$file.originFileObj);
|
|
|
|
|
_context7.next = 4;
|
|
|
|
|
_context8.next = 4;
|
|
|
|
|
return (0,fetch/* default */.ZP)("/api/core_subjects/".concat(params === null || params === void 0 ? void 0 : params.coreId, "/core_subject_knowledge_charts/batch_import.json"), {
|
|
|
|
|
method: 'post',
|
|
|
|
|
body: formData
|
|
|
|
|
}, true);
|
|
|
|
|
case 4:
|
|
|
|
|
res = _context7.sent;
|
|
|
|
|
res = _context8.sent;
|
|
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
|
|
|
modal = es_modal/* default */.Z.confirm({
|
|
|
|
|
title: "上传结果",
|
|
|
|
|
@ -1328,12 +1645,12 @@ var Page = function Page(_ref) {
|
|
|
|
|
}
|
|
|
|
|
case 6:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context7.stop();
|
|
|
|
|
return _context8.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee7);
|
|
|
|
|
}, _callee8);
|
|
|
|
|
}));
|
|
|
|
|
return function (_x4) {
|
|
|
|
|
return _ref7.apply(this, arguments);
|
|
|
|
|
return function (_x5) {
|
|
|
|
|
return _ref8.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}(),
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
@ -1380,14 +1697,37 @@ var Page = function Page(_ref) {
|
|
|
|
|
})]
|
|
|
|
|
})]
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(PreviewAll/* default */.Z, {
|
|
|
|
|
data: data === null || data === void 0 ? void 0 : data.content,
|
|
|
|
|
type: data === null || data === void 0 ? void 0 : data.type,
|
|
|
|
|
disabledDownload: !(0,authority/* isLogin */.bg)(),
|
|
|
|
|
close: true,
|
|
|
|
|
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 Knowledge = ((0,_umi_production_exports.connect)(function (_ref8) {
|
|
|
|
|
var coreCurriculum = _ref8.coreCurriculum,
|
|
|
|
|
user = _ref8.user,
|
|
|
|
|
loading = _ref8.loading;
|
|
|
|
|
/* harmony default export */ var Knowledge = ((0,_umi_production_exports.connect)(function (_ref9) {
|
|
|
|
|
var coreCurriculum = _ref9.coreCurriculum,
|
|
|
|
|
user = _ref9.user,
|
|
|
|
|
loading = _ref9.loading;
|
|
|
|
|
return {
|
|
|
|
|
coreCurriculum: coreCurriculum,
|
|
|
|
|
user: user,
|
|
|
|
|
|