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.
458 lines
20 KiB
458 lines
20 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[38447],{
|
|
|
|
/***/ 47447:
|
|
/*!***********************************************************************!*\
|
|
!*** ./src/pages/virtualSpaces/Lists/Knowledge/index.tsx + 1 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 */ Knowledge; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/spin/style/index.js + 1 modules
|
|
var style = __webpack_require__(22536);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/spin/index.js
|
|
var spin = __webpack_require__(11382);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/row/style/index.js
|
|
var row_style = __webpack_require__(13062);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/row/index.js
|
|
var row = __webpack_require__(71230);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/modal/style/index.js + 1 modules
|
|
var modal_style = __webpack_require__(35611);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/modal/index.js + 7 modules
|
|
var modal = __webpack_require__(85402);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js
|
|
var regeneratorRuntime = __webpack_require__(17061);
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(42122);
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
|
|
var asyncToGenerator = __webpack_require__(17156);
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(27424);
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
|
|
var _umi_production_exports = __webpack_require__(89214);
|
|
;// CONCATENATED MODULE: ./src/pages/virtualSpaces/Lists/Knowledge/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Knowledgemodules = ({"flex_box_center":"flex_box_center___JKPl3","flex_space_between":"flex_space_between___QuVBb","flex_box_vertical_center":"flex_box_vertical_center___Ksaxh","flex_box_center_end":"flex_box_center_end___nIhjx","flex_box_column":"flex_box_column___NAJ16","wrap":"wrap___NZWPs","content":"content___OLcvS","name":"name____Thh2","list":"list___F7fxl","head":"head___ffJpn","models":"models___kudCc","btns":"btns___CQDPq","rowsHead":"rowsHead___oC1SU","time":"time___r7Qed","rowsBody":"rowsBody___ZNF9c"});
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
var fetch = __webpack_require__(84519);
|
|
// EXTERNAL MODULE: ./src/components/ui-customization/index.tsx + 33 modules
|
|
var ui_customization = __webpack_require__(85343);
|
|
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 10 modules
|
|
var markdown_editor = __webpack_require__(55373);
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 1 modules
|
|
var RenderHtml = __webpack_require__(12768);
|
|
// EXTERNAL MODULE: ./src/components/ui-customization/reset.less?modules
|
|
var resetmodules = __webpack_require__(39132);
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
var authority = __webpack_require__(7);
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(29427);
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
;// CONCATENATED MODULE: ./src/pages/virtualSpaces/Lists/Knowledge/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Page = function Page(_ref) {
|
|
var _data$subject_modules;
|
|
var globalSetting = _ref.globalSetting,
|
|
dispatch = _ref.dispatch,
|
|
virtualSpaces = _ref.virtualSpaces;
|
|
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
|
|
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
|
|
searchParams = _useSearchParams2[0];
|
|
var _useState = (0,react.useState)(true),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
loading = _useState2[0],
|
|
setLoading = _useState2[1];
|
|
var _useState3 = (0,react.useState)(false),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
btnLoading = _useState4[0],
|
|
setBtnLoading = _useState4[1];
|
|
var _useState5 = (0,react.useState)(false),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
edit = _useState6[0],
|
|
setEdit = _useState6[1];
|
|
var _useState7 = (0,react.useState)({}),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
data = _useState8[0],
|
|
setData = _useState8[1];
|
|
var _useState9 = (0,react.useState)(''),
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
description = _useState10[0],
|
|
setDescription = _useState10[1];
|
|
var _useState11 = (0,react.useState)((searchParams === null || searchParams === void 0 ? void 0 : searchParams.get("active")) || 'position_and_target'),
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
active = _useState12[0],
|
|
setActive = _useState12[1];
|
|
var virtualSpacesDetails = virtualSpaces.virtualSpacesDetails;
|
|
var query = (0,_umi_production_exports.useParams)();
|
|
var permission = (virtualSpacesDetails === null || virtualSpacesDetails === void 0 ? void 0 : virtualSpacesDetails.is_member) || (0,authority/* isSuperAdmins */.Ny)();
|
|
(0,react.useEffect)(function () {
|
|
getData();
|
|
}, [active]);
|
|
var getData = /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
setLoading(true);
|
|
_context.next = 3;
|
|
return (0,fetch/* default */.ZP)("/api/virtual_classrooms/".concat(query.virtual_spacesId, "/knowledge_systems/show.json"), {
|
|
method: 'get',
|
|
params: {
|
|
column: active
|
|
}
|
|
});
|
|
case 3:
|
|
res = _context.sent;
|
|
if ((res === null || res === void 0 ? void 0 : res.status) !== -1) {
|
|
setData(objectSpread2_default()({}, res));
|
|
setDescription((res === null || res === void 0 ? void 0 : res[active]) || '');
|
|
}
|
|
setLoading(false);
|
|
case 6:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function getData() {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
var tabs = [{
|
|
id: 'position_and_target',
|
|
name: '课程定位与目标'
|
|
}, {
|
|
id: 'desc',
|
|
name: '课程知识点'
|
|
}, {
|
|
id: 'knowledge_graph',
|
|
name: '知识图谱'
|
|
}];
|
|
var handleEdit = /*#__PURE__*/function () {
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
var body, res;
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
setBtnLoading(true);
|
|
body = {};
|
|
body[active] = description;
|
|
_context2.next = 5;
|
|
return (0,fetch/* default */.ZP)("/api/virtual_classrooms/".concat(query.virtual_spacesId, "/knowledge_systems/edit.json"), {
|
|
method: 'put',
|
|
body: body
|
|
});
|
|
case 5:
|
|
res = _context2.sent;
|
|
if ((res === null || res === void 0 ? void 0 : res.status) !== -1) {
|
|
getData();
|
|
setEdit(false);
|
|
}
|
|
setBtnLoading(false);
|
|
case 8:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
return function handleEdit() {
|
|
return _ref3.apply(this, arguments);
|
|
};
|
|
}();
|
|
var handleDelete = function handleDelete(id, name) {
|
|
modal/* default.confirm */.Z.confirm({
|
|
title: '提示',
|
|
okText: '确定删除',
|
|
okButtonProps: {
|
|
danger: true
|
|
},
|
|
icon: false,
|
|
className: resetmodules/* default.CustomTipsModalCss */.Z.CustomTipsModalCss,
|
|
cancelText: '取消',
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: ["\u786E\u8BA4\u5220\u9664 ", name, " \u5417\uFF1F"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "mt10",
|
|
children: "\u5220\u9664\u540E\uFF0C\u5C06\u65E0\u6CD5\u6062\u590D\uFF0C\u8BF7\u8C28\u614E\u64CD\u4F5C"
|
|
})]
|
|
}),
|
|
onOk: function () {
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
case 0:
|
|
_context3.next = 2;
|
|
return (0,fetch/* default */.ZP)("/api/virtual_classrooms/".concat(query.virtual_spacesId, "/knowledge_systems/").concat(id, "/del_content.json"), {
|
|
method: 'delete'
|
|
});
|
|
case 2:
|
|
res = _context3.sent;
|
|
if ((res === null || res === void 0 ? void 0 : res.status) !== -1) {
|
|
getData();
|
|
}
|
|
case 4:
|
|
case "end":
|
|
return _context3.stop();
|
|
}
|
|
}, _callee3);
|
|
}));
|
|
function onOk() {
|
|
return _onOk.apply(this, arguments);
|
|
}
|
|
return onOk;
|
|
}()
|
|
});
|
|
};
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
className: Knowledgemodules.wrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomTabs */.YG, {
|
|
value: active,
|
|
onChange: function onChange(k) {
|
|
if (k === active) {
|
|
return;
|
|
}
|
|
setActive(k);
|
|
setEdit(false);
|
|
},
|
|
tabBarExtraContent: permission && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: [active === 'position_and_target' && /*#__PURE__*/(0,jsx_runtime.jsxs)(ui_customization/* CustomButton */.op, {
|
|
onClick: function onClick() {
|
|
return setEdit(true);
|
|
},
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-bianji7 font14 mr5"
|
|
}), "\u7F16\u8F91"]
|
|
}), active === 'desc' && /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
align: "middle",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(ui_customization/* CustomButton */.op, {
|
|
onClick: function onClick() {
|
|
return setEdit(true);
|
|
},
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-bianji7 font14 mr5"
|
|
}), "\u7F16\u8F91\u8BF4\u660E"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(ui_customization/* CustomButton */.op, {
|
|
onClick: function onClick() {
|
|
_umi_production_exports.history.push("/".concat(util/* vtrsKey */.AS, "/").concat(query.virtual_spacesId, "/knowledge/add"));
|
|
},
|
|
className: "ml20",
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-tianjiashitixiaojiahao font14 mr5"
|
|
}), "\u65B0\u589E\u77E5\u8BC6\u70B9\u6A21\u5757"]
|
|
})]
|
|
}), active === 'knowledge_graph' && /*#__PURE__*/(0,jsx_runtime.jsxs)(ui_customization/* CustomButton */.op, {
|
|
onClick: function onClick() {
|
|
return setEdit(true);
|
|
},
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-bianji7 font14 mr5"
|
|
}), "\u7F16\u8F91\u77E5\u8BC6\u56FE\u8C31"]
|
|
})]
|
|
}),
|
|
dataSource: tabs
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(spin/* default */.Z, {
|
|
spinning: loading,
|
|
children: [active !== 'desc' && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "mt20",
|
|
children: edit ? /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
onChange: function onChange(v) {
|
|
return setDescription(v);
|
|
},
|
|
watch: true,
|
|
defaultValue: description
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* ConfirmAndCancel */.QD, {
|
|
confirmTitle: "\u4FDD\u5B58",
|
|
confirmLoading: btnLoading,
|
|
confirmClick: handleEdit,
|
|
cancelClick: function cancelClick() {
|
|
setEdit(false);
|
|
setDescription(data[active] || '');
|
|
},
|
|
cancelTitle: "\u53D6\u6D88",
|
|
className: "mb25"
|
|
})]
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
value: description
|
|
})
|
|
}), active === 'desc' && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Knowledgemodules.content,
|
|
children: [!!description && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Knowledgemodules.name,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
children: "\u8BF4\u660E"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
value: description
|
|
})]
|
|
}), data === null || data === void 0 ? void 0 : (_data$subject_modules = data.subject_modules) === null || _data$subject_modules === void 0 ? void 0 : _data$subject_modules.map(function (item) {
|
|
var _item$members = item.members,
|
|
module_content = _item$members.module_content,
|
|
module_name = _item$members.module_name,
|
|
subject_module_id = _item$members.subject_module_id;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Knowledgemodules.list,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Knowledgemodules.head,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Knowledgemodules.models,
|
|
children: module_name
|
|
}), permission && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Knowledgemodules.btns,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
onClick: function onClick() {
|
|
return _umi_production_exports.history.push("/".concat(util/* vtrsKey */.AS, "/").concat(query.virtual_spacesId, "/knowledge/").concat(subject_module_id, "/edit"));
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: "primary-hover",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-bianji7 font14 mr5"
|
|
}), "\u7F16\u8F91"]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
onClick: function onClick() {
|
|
return handleDelete(subject_module_id, module_name);
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: "delete-hover",
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-piliangshanchubeifen font14 mr5"
|
|
}), "\u5220\u9664"]
|
|
})
|
|
})]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Knowledgemodules.rowsHead,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: "\u77E5\u8BC6\u70B9"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: "\u4E3B\u8981\u5185\u5BB9"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: "\u80FD\u529B\u76EE\u6807"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Knowledgemodules.time,
|
|
children: "\u5B66\u65F6"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
marginRight: 0
|
|
},
|
|
children: "\u6559\u6848"
|
|
})]
|
|
}), module_content === null || module_content === void 0 ? void 0 : module_content.map(function (e, i) {
|
|
var knowledge_point = e.knowledge_point,
|
|
content = e.content,
|
|
target = e.target,
|
|
class_hour = e.class_hour,
|
|
lesson_plan = e.lesson_plan;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Knowledgemodules.rowsBody,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: knowledge_point
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("pre", {
|
|
children: content
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("pre", {
|
|
children: target
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Knowledgemodules.time,
|
|
children: class_hour
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
marginRight: 0
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
value: lesson_plan
|
|
})
|
|
})]
|
|
}, i);
|
|
})]
|
|
}, subject_module_id);
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
|
|
title: '编辑说明',
|
|
destroyOnClose: true,
|
|
open: active === 'desc' && edit,
|
|
onOk: handleEdit,
|
|
centered: true,
|
|
onCancel: function onCancel() {
|
|
setEdit(false);
|
|
setDescription(data[active] || '');
|
|
},
|
|
confirmLoading: btnLoading,
|
|
width: 686,
|
|
okText: '确认',
|
|
cancelText: "\u53D6\u6D88",
|
|
wrapClassName: resetmodules/* default.CustomCss */.Z.CustomCss,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: "\u8BF4\u660E\uFF1A"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
onChange: function onChange(v) {
|
|
return setDescription(v);
|
|
},
|
|
watch: true,
|
|
defaultValue: description
|
|
})]
|
|
})]
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ var Knowledge = ((0,_umi_production_exports.connect)(function (_ref4) {
|
|
var virtualSpaces = _ref4.virtualSpaces,
|
|
globalSetting = _ref4.globalSetting;
|
|
return {
|
|
globalSetting: globalSetting,
|
|
virtualSpaces: virtualSpaces
|
|
};
|
|
})(Page));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 39132:
|
|
/*!************************************************************!*\
|
|
!*** ./src/components/ui-customization/reset.less?modules ***!
|
|
\************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
|
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ __webpack_exports__["Z"] = ({"flex_box_center":"flex_box_center___vG4eV","flex_space_between":"flex_space_between___qVVxe","flex_box_vertical_center":"flex_box_vertical_center___P8Z8s","flex_box_center_end":"flex_box_center_end___VMme3","flex_box_column":"flex_box_column___VMHwm","CustomCss":"CustomCss___fWNtn","CustomTipsModalCss":"CustomTipsModalCss___MmFkT","dropdownmenus":"dropdownmenus___oVzoj","popupClassNames":"popupClassNames___OcZq7","selectdown":"selectdown___mmcA8"});
|
|
|
|
/***/ })
|
|
|
|
}]); |