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.
607 lines
26 KiB
607 lines
26 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[91045],{
|
|
|
|
/***/ 6786:
|
|
/*!**********************************************************************************!*\
|
|
!*** ./src/pages/virtualSpaces/Lists/Knowledge/AddAndEdit/index.tsx + 5 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_AddAndEdit; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
|
|
var regeneratorRuntime = __webpack_require__(7557);
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
|
|
var asyncToGenerator = __webpack_require__(41498);
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(79800);
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectDestructuringEmpty.js
|
|
var objectDestructuringEmpty = __webpack_require__(70236);
|
|
var objectDestructuringEmpty_default = /*#__PURE__*/__webpack_require__.n(objectDestructuringEmpty);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
var fetch = __webpack_require__(49105);
|
|
;// CONCATENATED MODULE: ./src/pages/virtualSpaces/Lists/Knowledge/AddAndEdit/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var AddAndEditmodules = ({"flex_box_center":"flex_box_center___XSfK9","flex_space_between":"flex_space_between___fNQw6","flex_box_vertical_center":"flex_box_vertical_center___lE1Os","flex_box_center_end":"flex_box_center_end___IyHt0","flex_box_column":"flex_box_column___s_S14","wrap":"wrap___jhaRK","title":"title___yHGiU","tags":"tags___NT3qR","tag":"tag___PxWDv","btns":"btns___NjqzR"});
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js
|
|
var toConsumableArray = __webpack_require__(37205);
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
// 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/input/index.js + 3 modules
|
|
var input = __webpack_require__(92832);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input-number/index.js + 14 modules
|
|
var input_number = __webpack_require__(94001);
|
|
;// CONCATENATED MODULE: ./src/pages/virtualSpaces/Lists/Knowledge/AddAndEdit/components/SingleAddition/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var SingleAdditionmodules = ({"flex_box_center":"flex_box_center___yia5q","flex_space_between":"flex_space_between___WWLmb","flex_box_vertical_center":"flex_box_vertical_center___N_pbo","flex_box_center_end":"flex_box_center_end___DSwEA","flex_box_column":"flex_box_column___jCGMT","add":"add___QhmVz","row":"row___jUJhV","input":"input___rAwei","title":"title___IS6B6","list":"list___oafqL","listRow":"listRow___JbnHf","listNextRow":"listNextRow___zlQFB"});
|
|
// EXTERNAL MODULE: ./src/components/ui-customization/index.tsx + 30 modules
|
|
var ui_customization = __webpack_require__(92073);
|
|
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 10 modules
|
|
var markdown_editor = __webpack_require__(77036);
|
|
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js
|
|
var lodash = __webpack_require__(89392);
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(27876);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
|
|
var _umi_production_exports = __webpack_require__(80608);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
;// CONCATENATED MODULE: ./src/pages/virtualSpaces/Lists/Knowledge/AddAndEdit/components/SingleAddition/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Addition = function Addition(_ref) {
|
|
objectDestructuringEmpty_default()(_ref);
|
|
var query = (0,_umi_production_exports.useParams)();
|
|
var virtual_spacesId = query.virtual_spacesId,
|
|
id = query.id;
|
|
var _useState = (0,_react_17_0_2_react.useState)(''),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
name = _useState2[0],
|
|
setName = _useState2[1];
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
list = _useState4[0],
|
|
setList = _useState4[1];
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
btnLoading = _useState6[0],
|
|
setBtnLoading = _useState6[1];
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
if (id) {
|
|
getData();
|
|
}
|
|
}, [id]);
|
|
var getData = /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
var res, _res$members, _res$members2;
|
|
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/virtual_classrooms/".concat(query.virtual_spacesId, "/knowledge_systems/").concat(id, "/show_content.json"), {
|
|
method: 'get'
|
|
});
|
|
case 2:
|
|
res = _context.sent;
|
|
if ((res === null || res === void 0 ? void 0 : res.status) !== -1) {
|
|
setList(res === null || res === void 0 || (_res$members = res.members) === null || _res$members === void 0 ? void 0 : _res$members.module_content);
|
|
setName(res === null || res === void 0 || (_res$members2 = res.members) === null || _res$members2 === void 0 ? void 0 : _res$members2.module_name);
|
|
}
|
|
case 4:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function getData() {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
var handleAdd = function handleAdd() {
|
|
var param = {
|
|
knowledge_point: "",
|
|
content: "",
|
|
target: "",
|
|
class_hour: "",
|
|
lesson_plan: ""
|
|
};
|
|
setList([].concat(toConsumableArray_default()(list), [param]));
|
|
};
|
|
var handleDelete = function handleDelete(i) {
|
|
var newList = list.filter(function (e, index) {
|
|
return index !== i;
|
|
});
|
|
setList(newList);
|
|
};
|
|
var handleEdit = function handleEdit(key, i, value) {
|
|
var newList = (0,lodash.cloneDeep)(list);
|
|
newList[i][key] = value;
|
|
setList(newList);
|
|
};
|
|
var handleFinish = /*#__PURE__*/function () {
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
var url, res;
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
if (name) {
|
|
_context2.next = 3;
|
|
break;
|
|
}
|
|
message/* default */.ZP.warning('请输入模块名称');
|
|
return _context2.abrupt("return");
|
|
case 3:
|
|
if (list.length) {
|
|
_context2.next = 6;
|
|
break;
|
|
}
|
|
message/* default */.ZP.warning('请添加知识点');
|
|
return _context2.abrupt("return");
|
|
case 6:
|
|
setBtnLoading(true);
|
|
url = "/api/virtual_classrooms/".concat(query.virtual_spacesId, "/knowledge_systems/add_content.json");
|
|
if (id) {
|
|
url = "/api/virtual_classrooms/".concat(query.virtual_spacesId, "/knowledge_systems/").concat(id, "/update_content.json");
|
|
}
|
|
_context2.next = 11;
|
|
return (0,fetch/* default */.ZP)(url, {
|
|
method: id ? 'put' : 'post',
|
|
body: {
|
|
module_content: list,
|
|
module_name: name
|
|
}
|
|
});
|
|
case 11:
|
|
res = _context2.sent;
|
|
if ((res === null || res === void 0 ? void 0 : res.status) !== -1 && (res === null || res === void 0 ? void 0 : res.status) !== 403) {
|
|
message/* default */.ZP.success('操作成功');
|
|
_umi_production_exports.history.push("/".concat(util/* vtrsKey */.AS, "/").concat(query.virtual_spacesId, "/knowledge?active=desc"));
|
|
}
|
|
setBtnLoading(false);
|
|
case 14:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
return function handleFinish() {
|
|
return _ref3.apply(this, arguments);
|
|
};
|
|
}();
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
marginTop: id ? 30 : 0
|
|
},
|
|
className: SingleAdditionmodules.add,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: SingleAdditionmodules.row,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-grey-666 font14 mr20",
|
|
children: "\u6A21\u5757\u540D\u79F0"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
onChange: function onChange(e) {
|
|
return setName(e.target.value);
|
|
},
|
|
value: name,
|
|
className: SingleAdditionmodules.input
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: SingleAdditionmodules.title,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("b", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: "\u6A21\u5757\u5185\u5BB9"
|
|
})]
|
|
}), list.map(function (item, index) {
|
|
var knowledge_point = item.knowledge_point,
|
|
content = item.content,
|
|
target = item.target,
|
|
class_hour = item.class_hour,
|
|
lesson_plan = item.lesson_plan;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: SingleAdditionmodules.list,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: SingleAdditionmodules.listRow,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: "\u77E5\u8BC6\u70B9"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
onChange: function onChange(e) {
|
|
return handleEdit('knowledge_point', index, e.target.value);
|
|
},
|
|
value: knowledge_point,
|
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
className: SingleAdditionmodules.input
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: SingleAdditionmodules.listRow,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: "\u4E3B\u8981\u5185\u5BB9"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.TextArea, {
|
|
onChange: function onChange(e) {
|
|
return handleEdit('content', index, e.target.value);
|
|
},
|
|
value: content,
|
|
autoSize: {
|
|
minRows: 3,
|
|
maxRows: 6
|
|
},
|
|
className: SingleAdditionmodules.input
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: SingleAdditionmodules.listRow,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: "\u80FD\u529B\u76EE\u6807"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.TextArea, {
|
|
onChange: function onChange(e) {
|
|
return handleEdit('target', index, e.target.value);
|
|
},
|
|
value: target,
|
|
autoSize: {
|
|
minRows: 3,
|
|
maxRows: 6
|
|
},
|
|
className: SingleAdditionmodules.input
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: SingleAdditionmodules.listRow,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: "\u53C2\u8003\u5B66\u65F6"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
|
|
onChange: function onChange(e) {
|
|
return handleEdit('class_hour', index, e);
|
|
},
|
|
precision: 1,
|
|
min: 0.1,
|
|
value: class_hour,
|
|
className: SingleAdditionmodules.input
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: SingleAdditionmodules.listNextRow,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: "\u6559\u6848"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
flex: 1
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
onChange: function onChange(e) {
|
|
return handleEdit('lesson_plan', index, e);
|
|
},
|
|
defaultValue: lesson_plan,
|
|
height: 280,
|
|
values: "2222"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
onClick: function onClick() {
|
|
return handleDelete(index);
|
|
},
|
|
className: "iconfont icon-piliangshanchubeifen"
|
|
})]
|
|
})]
|
|
}, index);
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(ui_customization/* CustomButton */.op, {
|
|
onClick: handleAdd,
|
|
style: {
|
|
display: 'inline-block',
|
|
marginTop: 20
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-tianjiashitixiaojiahao font14 mr5"
|
|
}), "\u65B0\u589E\u77E5\u8BC6\u70B9"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* ConfirmAndCancel */.QD, {
|
|
confirmTitle: "\u786E\u8BA4\u53D1\u5E03",
|
|
confirmLoading: btnLoading,
|
|
confirmClick: handleFinish,
|
|
cancelClick: function cancelClick() {
|
|
_umi_production_exports.history.push("/".concat(util/* vtrsKey */.AS, "/").concat(query.virtual_spacesId, "/knowledge?active=desc"));
|
|
},
|
|
cancelTitle: "\u53D6\u6D88",
|
|
className: "mb25 mt20"
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ var SingleAddition = (Addition);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(82242);
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
// 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/row/index.js
|
|
var row = __webpack_require__(95237);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/upload/index.js
|
|
var upload = __webpack_require__(60028);
|
|
;// CONCATENATED MODULE: ./src/pages/virtualSpaces/Lists/Knowledge/AddAndEdit/components/BatchAddition/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var BatchAdditionmodules = ({"flex_box_center":"flex_box_center___MWmFU","flex_space_between":"flex_space_between___YKGNN","flex_box_vertical_center":"flex_box_vertical_center___DDTno","flex_box_center_end":"flex_box_center_end___nE28i","flex_box_column":"flex_box_column___OZbik"});
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(71681);
|
|
// EXTERNAL MODULE: ./src/components/ui-customization/reset.less?modules
|
|
var resetmodules = __webpack_require__(11806);
|
|
;// CONCATENATED MODULE: ./src/pages/virtualSpaces/Lists/Knowledge/AddAndEdit/components/BatchAddition/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var BatchAddition_Addition = function Addition(_ref) {
|
|
objectDestructuringEmpty_default()(_ref);
|
|
var query = (0,_umi_production_exports.useParams)();
|
|
var virtual_spacesId = query.virtual_spacesId;
|
|
var _useState = (0,_react_17_0_2_react.useState)([]),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
fileList = _useState2[0],
|
|
setFileList = _useState2[1];
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
btnLoading = _useState4[0],
|
|
setBtnLoading = _useState4[1];
|
|
var Draggers = {
|
|
onRemove: function onRemove() {
|
|
setFileList([]);
|
|
},
|
|
beforeUpload: function beforeUpload(file) {
|
|
var _file$name, _file$name2, _file$name3, _fileText;
|
|
var fileText = file === null || file === void 0 || (_file$name = file.name) === null || _file$name === void 0 ? void 0 : _file$name.substring(file === null || file === void 0 || (_file$name2 = file.name) === null || _file$name2 === void 0 ? void 0 : _file$name2.lastIndexOf("."), file === null || file === void 0 || (_file$name3 = file.name) === null || _file$name3 === void 0 ? void 0 : _file$name3.length);
|
|
fileText = (_fileText = fileText) === null || _fileText === void 0 ? void 0 : _fileText.toLowerCase();
|
|
if (fileText !== '.xls' && fileText !== '.xlsx') {
|
|
message/* default */.ZP.error('只能上传.xls,.xlsx格式的文档');
|
|
return Promise.reject();
|
|
}
|
|
var filelist = [];
|
|
filelist.push(file);
|
|
setFileList([].concat(filelist));
|
|
return Promise.reject();
|
|
},
|
|
fileList: fileList,
|
|
accept: ".xls,.xlsx"
|
|
};
|
|
var onFileOk = /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
var formData, url, res, _res$fail;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
if (!((fileList === null || fileList === void 0 ? void 0 : fileList.length) <= 0)) {
|
|
_context.next = 3;
|
|
break;
|
|
}
|
|
message/* default */.ZP.info('请上传文件');
|
|
return _context.abrupt("return");
|
|
case 3:
|
|
formData = new FormData();
|
|
formData.append('file', fileList[0]);
|
|
setBtnLoading(true);
|
|
url = "/api/virtual_classrooms/".concat(query.virtual_spacesId, "/knowledge_systems/batch_import.json");
|
|
_context.next = 9;
|
|
return (0,fetch/* default */.ZP)(url, {
|
|
method: 'post',
|
|
body: formData
|
|
}, true);
|
|
case 9:
|
|
res = _context.sent;
|
|
if ((res === null || res === void 0 ? void 0 : res.status) !== -1 && (res === null || res === void 0 ? void 0 : res.status) !== 403) {
|
|
modal/* default */.Z.info({
|
|
centered: true,
|
|
keyboard: false,
|
|
maskClosable: false,
|
|
okText: '确定',
|
|
icon: null,
|
|
title: '提示',
|
|
className: resetmodules/* default */.Z.CustomTipsModalCss,
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: ["\u6210\u529F", res === null || res === void 0 ? void 0 : res.success, "\u6761"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: ["\u5931\u8D25", (res === null || res === void 0 || (_res$fail = res.fail) === null || _res$fail === void 0 ? void 0 : _res$fail.length) || 0, "\u6761"]
|
|
})]
|
|
}),
|
|
onOk: function onOk() {
|
|
_umi_production_exports.history.push("/".concat(util/* vtrsKey */.AS, "/").concat(query.virtual_spacesId, "/knowledge?active=desc"));
|
|
}
|
|
});
|
|
}
|
|
setBtnLoading(false);
|
|
case 12:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function onFileOk() {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: BatchAdditionmodules.add,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
className: "mt20",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "c-grey-666 font14 mr20 pt5",
|
|
children: "\u4E0A\u4F20\u6587\u4EF6"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(upload/* default */.Z, objectSpread2_default()(objectSpread2_default()({}, Draggers), {}, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(ui_customization/* CustomButton */.op, {
|
|
style: {
|
|
borderRadius: 2
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-tianjiashitixiaojiahao font14 mr5"
|
|
}), "\u9009\u62E9\u6587\u4EF6"]
|
|
})
|
|
})), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "c-grey-666 font14 mt35",
|
|
children: "\u6CE8\u610F\uFF1A"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "c-grey-666 font14 pt5 pb5",
|
|
children: "1\u3001\u4EC5\u652F\u6301\u4E0A\u4F20.xlsx \u6216 .xls\u7C7B\u578B\u7684\u6587\u4EF6"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "c-grey-666 font14",
|
|
children: ["2\u3001\u9700\u6309\u7167\u6307\u5B9A\u6A21\u677F\u4E0A\u4F20\u6570\u636E ", /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
className: "ml5 mr5",
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
(0,util/* downLoadFile */.FH)('', (0,util/* setUrlQuery */.NY)({
|
|
url: env/* default */.Z.API_SERVER + "/api/virtual_classrooms/download_content_module_template",
|
|
query: {}
|
|
}));
|
|
case 1:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
})),
|
|
children: "\u70B9\u51FB\u4E0B\u8F7D\u6A21\u677F"
|
|
})]
|
|
})]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* ConfirmAndCancel */.QD, {
|
|
confirmTitle: "\u786E\u8BA4\u4E0A\u4F20",
|
|
confirmLoading: btnLoading,
|
|
confirmClick: onFileOk,
|
|
cancelClick: function cancelClick() {
|
|
_umi_production_exports.history.push("/".concat(util/* vtrsKey */.AS, "/").concat(query.virtual_spacesId, "/knowledge?active=desc"));
|
|
},
|
|
cancelTitle: "\u53D6\u6D88",
|
|
className: "mb25 mt20"
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ var BatchAddition = (BatchAddition_Addition);
|
|
;// CONCATENATED MODULE: ./src/pages/virtualSpaces/Lists/Knowledge/AddAndEdit/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var AddAndEdit = function AddAndEdit(_ref) {
|
|
objectDestructuringEmpty_default()(_ref);
|
|
var query = (0,_umi_production_exports.useParams)();
|
|
var _useState = (0,_react_17_0_2_react.useState)('1'),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
active = _useState2[0],
|
|
setActive = _useState2[1];
|
|
var virtual_spacesId = query.virtual_spacesId,
|
|
id = query.id;
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
status = _useState4[0],
|
|
setStatus = _useState4[1];
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
getData();
|
|
}, []);
|
|
var tags = [{
|
|
id: '1',
|
|
name: '单个新增'
|
|
}, {
|
|
id: '2',
|
|
name: '批量导入'
|
|
}];
|
|
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:
|
|
_context.next = 2;
|
|
return (0,fetch/* default */.ZP)("/api/virtual_classrooms/".concat(virtual_spacesId, "/settings_auth.json"), {
|
|
method: 'get'
|
|
});
|
|
case 2:
|
|
res = _context.sent;
|
|
if (res.status === 0) {
|
|
setStatus(true);
|
|
}
|
|
case 4:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function getData() {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
if (!status) return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {});
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: AddAndEditmodules.wrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* HeadBack */.qE, {
|
|
title: id ? '编辑知识点模块' : '新建知识点模块',
|
|
onClick: function onClick() {
|
|
return _umi_production_exports.history.push("/".concat(util/* vtrsKey */.AS, "/").concat(virtual_spacesId, "/knowledge"));
|
|
}
|
|
}), !id && /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomTags */.qp, {
|
|
titleWidth: 56,
|
|
dataSource: tags,
|
|
className: "mt25",
|
|
title: "\u65B0\u589E\u6A21\u5F0F",
|
|
value: active,
|
|
onChange: function onChange(k) {
|
|
return setActive(k);
|
|
}
|
|
}), active === '1' && /*#__PURE__*/(0,jsx_runtime.jsx)(SingleAddition, {}), active === '2' && /*#__PURE__*/(0,jsx_runtime.jsx)(BatchAddition, {})]
|
|
});
|
|
};
|
|
/* harmony default export */ var Knowledge_AddAndEdit = (AddAndEdit);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 11806:
|
|
/*!************************************************************!*\
|
|
!*** ./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","dropdownmenus":"dropdownmenus___oVzoj","popupClassNames":"popupClassNames___OcZq7","selectdown":"selectdown___mmcA8"});
|
|
|
|
/***/ })
|
|
|
|
}]); |