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.
701 lines
32 KiB
701 lines
32 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[60696],{
|
|
|
|
/***/ 60696:
|
|
/*!***************************************************************!*\
|
|
!*** ./src/components/ReuseShixunModal/index.tsx + 1 modules ***!
|
|
\***************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ components_ReuseShixunModal; },
|
|
"P": function() { return /* binding */ useReuseModal; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/table/style/index.js + 1 modules
|
|
var style = __webpack_require__(71854);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/table/index.js + 58 modules
|
|
var table = __webpack_require__(67250);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/toConsumableArray.js
|
|
var toConsumableArray = __webpack_require__(861);
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/style/index.js + 1 modules
|
|
var input_style = __webpack_require__(69463);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/index.js + 5 modules
|
|
var input = __webpack_require__(75008);
|
|
// 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/antd/es/radio/style/index.js + 1 modules
|
|
var radio_style = __webpack_require__(83822);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/radio/index.js + 4 modules
|
|
var es_radio = __webpack_require__(29924);
|
|
// 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/antd/es/form/style/index.js + 1 modules
|
|
var form_style = __webpack_require__(75627);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/index.js + 17 modules
|
|
var es_form = __webpack_require__(51018);
|
|
// 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);
|
|
;// CONCATENATED MODULE: ./src/components/ReuseShixunModal/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var ReuseShixunModalmodules = ({"brief":"brief___LOzpE","contentTitle":"contentTitle___xkdcN","content":"content___Vtri0","tips":"tips___tuAtH","antdTable":"antdTable___s8T2N","tableCell":"tableCell___kN9Fw","antdModal":"antdModal___WVBk3"});
|
|
// EXTERNAL MODULE: ./src/service/shixuns.ts
|
|
var shixuns = __webpack_require__(56088);
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
;// CONCATENATED MODULE: ./src/components/ReuseShixunModal/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//实训复制状态
|
|
var generateBrief = function generateBrief(_ref) {
|
|
var total = _ref.total,
|
|
used = _ref.used,
|
|
copy = _ref.copy,
|
|
canNotCopy = _ref.canNotCopy,
|
|
inPaper = _ref.inPaper;
|
|
var copyStatusDescribe = '';
|
|
if (copy > 0 && canNotCopy > 0) {
|
|
copyStatusDescribe = "\u5176\u4E2D\u6709".concat(copy, "\u4E2A\u5B9E\u8BAD\u53EF\u4EE5\u590D\u5236\uFF0C\u6709").concat(canNotCopy, "\u4E2A\u5B9E\u8BAD\u672A\u5F00\u653E\u590D\u5236");
|
|
} else if (copy > 0 && canNotCopy === 0) {
|
|
copyStatusDescribe = "\u5176\u4E2D\u6709".concat(copy, "\u4E2A\u5B9E\u8BAD\u53EF\u4EE5\u590D\u5236");
|
|
} else if (copy === 0 && canNotCopy > 0) {
|
|
copyStatusDescribe = "\u5176\u4E2D\u6709".concat(canNotCopy, "\u4E2A\u5B9E\u8BAD\u672A\u5F00\u653E\u590D\u5236");
|
|
}
|
|
return "\u5F53\u524D\u9009\u4E2D".concat(total, "\u4E2A\u5B9E\u8BAD\u4E2D\uFF0C\u6709").concat(used, "\u4E2A\u5B9E\u8BAD\u5DF2\u5728\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C").concat(copyStatusDescribe).concat(inPaper ? ',请确认是否使用试卷?' : '');
|
|
};
|
|
|
|
//根据使用场景区分文案
|
|
var generateTextContent = function generateTextContent(inPaper) {
|
|
return inPaper ? {
|
|
reproducible: '试卷中下列实训已在教学课堂中使用,请选择是否复制为新的实训发送到课堂?',
|
|
irreproducible: '试卷中下列重复使用的实训未开启复制权限,若继续使用会导致成绩相互影响'
|
|
} : {
|
|
reproducible: '当前实训已在教学课堂中使用,请选择是否继续使用和是否复制为新的实训发送到课堂?',
|
|
irreproducible: '同一实训在一个课堂中重复使用时,会导致成绩相互影响,请确认是否继续使用?'
|
|
};
|
|
};
|
|
|
|
//单个实训时的情况
|
|
var ReuseSingleShixunModal = function ReuseSingleShixunModal(_ref2) {
|
|
var onCancel = _ref2.onCancel,
|
|
onOk = _ref2.onOk,
|
|
visible = _ref2.visible,
|
|
inPaper = _ref2.inPaper,
|
|
renderData = _ref2.renderData,
|
|
type = _ref2.type,
|
|
_ref2$isMultipleCours = _ref2.isMultipleCourse,
|
|
isMultipleCourse = _ref2$isMultipleCours === void 0 ? false : _ref2$isMultipleCours;
|
|
var _Form$useForm = es_form/* default.useForm */.Z.useForm(),
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
form = _Form$useForm2[0];
|
|
var _useState = (0,react.useState)(1),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
radioValue = _useState2[0],
|
|
setRadioValue = _useState2[1];
|
|
var _useState3 = (0,react.useState)(false),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
confirmLoading = _useState4[0],
|
|
setConfirmLoading = _useState4[1];
|
|
var canCopy = (0,react.useMemo)(function () {
|
|
return (renderData === null || renderData === void 0 ? void 0 : renderData.total_num) === 1 && (renderData === null || renderData === void 0 ? void 0 : renderData.can_copy_num) === 1;
|
|
}, [renderData]);
|
|
var courseDataList = (0,react.useMemo)(function () {
|
|
var _renderData$course_da;
|
|
return renderData === null || renderData === void 0 ? void 0 : (_renderData$course_da = renderData.course_data_list) === null || _renderData$course_da === void 0 ? void 0 : _renderData$course_da.filter(function (e) {
|
|
return e.is_show;
|
|
});
|
|
}, [renderData]);
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
children: canCopy ? /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
|
|
centered: true,
|
|
closable: true,
|
|
open: visible,
|
|
destroyOnClose: true,
|
|
title: "\u63D0\u793A",
|
|
width: 600,
|
|
confirmLoading: confirmLoading,
|
|
onCancel: onCancel,
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
var data, _renderData$course_da2, param;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
setConfirmLoading(true);
|
|
data = radioValue;
|
|
if (isMultipleCourse) {
|
|
param = objectSpread2_default()({}, form.getFieldsValue());
|
|
data = renderData === null || renderData === void 0 ? void 0 : (_renderData$course_da2 = renderData.course_data_list) === null || _renderData$course_da2 === void 0 ? void 0 : _renderData$course_da2.map(function (e) {
|
|
if (param[e.id] !== undefined) {
|
|
return objectSpread2_default()(objectSpread2_default()({}, e), {}, {
|
|
is_copy: param[e.id]
|
|
});
|
|
}
|
|
return e;
|
|
});
|
|
}
|
|
_context.next = 5;
|
|
return onOk(data);
|
|
case 5:
|
|
setConfirmLoading(false);
|
|
case 6:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
})),
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: ReuseShixunModalmodules.content,
|
|
style: {
|
|
marginBottom: 20
|
|
},
|
|
children: isMultipleCourse ? '检测到以下课堂已在教学课堂中使用,请问是否复制成新的实训发送至教学课堂中?' : '当前实训已在教学课堂中使用,请问是否复制成新实训发送至教学课堂中?'
|
|
}), isMultipleCourse && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z, {
|
|
form: form,
|
|
preserve: false,
|
|
children: courseDataList === null || courseDataList === void 0 ? void 0 : courseDataList.map(function (item) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("h3", {
|
|
className: "ml15 mb5",
|
|
children: item.name
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: item.id,
|
|
initialValue: 1,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
className: ReuseShixunModalmodules.content,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 1,
|
|
style: {
|
|
color: '#464f66'
|
|
},
|
|
children: "\u590D\u5236\u5B9E\u8BAD"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 0,
|
|
style: {
|
|
color: '#464f66'
|
|
},
|
|
children: "\u4E0D\u590D\u5236\u5B9E\u8BAD"
|
|
})]
|
|
})
|
|
})]
|
|
}, item.id);
|
|
})
|
|
}), !isMultipleCourse && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
value: radioValue,
|
|
onChange: function onChange(e) {
|
|
return setRadioValue(e.target.value);
|
|
},
|
|
className: ReuseShixunModalmodules.content,
|
|
style: {
|
|
marginBottom: 30
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 1,
|
|
style: {
|
|
color: '#464f66'
|
|
},
|
|
children: "\u590D\u5236\u5B9E\u8BAD"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 0,
|
|
style: {
|
|
color: '#464f66'
|
|
},
|
|
children: "\u4E0D\u590D\u5236\u5B9E\u8BAD"
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: ReuseShixunModalmodules.content,
|
|
style: {
|
|
marginBottom: 10
|
|
},
|
|
children: "\u8BF4\u660E\uFF1A"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: ReuseShixunModalmodules.content,
|
|
children: "\u590D\u5236\u5B9E\u8BAD\uFF1A\u590D\u5236\u4E00\u4EFD\u65B0\u7684\u5B9E\u8BAD\u8FDB\u5165\u8BFE\u5802\uFF0C\u539F\u5B9E\u8BAD\u7684\u8C03\u6574\u4E0D\u4F1A\u5F71\u54CD\u5230\u590D\u5236\u7684\u5B9E\u8BAD\u4E2D\u3002"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: ReuseShixunModalmodules.content,
|
|
children: "\u4E0D\u590D\u5236\u5B9E\u8BAD\uFF1A\u540C\u4E00\u5B9E\u8BAD\u5728\u4E00\u4E2A\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD\u3002"
|
|
})]
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
centered: true,
|
|
closable: true,
|
|
destroyOnClose: true,
|
|
open: visible,
|
|
confirmLoading: confirmLoading,
|
|
title: "\u63D0\u793A",
|
|
width: 600,
|
|
onCancel: onCancel,
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
var data, _renderData$course_da3, param;
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
setConfirmLoading(true);
|
|
data = 0;
|
|
if (isMultipleCourse) {
|
|
param = objectSpread2_default()({}, form.getFieldsValue());
|
|
data = renderData === null || renderData === void 0 ? void 0 : (_renderData$course_da3 = renderData.course_data_list) === null || _renderData$course_da3 === void 0 ? void 0 : _renderData$course_da3.map(function (e) {
|
|
if (param[e.id] !== undefined) {
|
|
return objectSpread2_default()(objectSpread2_default()({}, e), {}, {
|
|
is_use: param[e.id]
|
|
});
|
|
}
|
|
return e;
|
|
});
|
|
}
|
|
_context2.next = 5;
|
|
return onOk(data);
|
|
case 5:
|
|
setConfirmLoading(false);
|
|
case 6:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
})),
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: ReuseShixunModalmodules.content,
|
|
children: [isMultipleCourse && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
form: form,
|
|
preserve: false,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("h3", {
|
|
children: "\u5F53\u524D\u5B9E\u8BAD\u4E0D\u53EF\u590D\u5236\uFF0C\u5DF2\u7ECF\u68C0\u6D4B\u5230\u4EE5\u4E0B\u8BFE\u5802\u5B58\u5728\u8BE5\u5B9E\u8BAD\uFF0C\u540C\u4E00\u5B9E\u8BAD\u5728\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u4E92\u76F8\u5F71\u54CD\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u7EE7\u7EED\u4F7F\u7528"
|
|
}), courseDataList === null || courseDataList === void 0 ? void 0 : courseDataList.map(function (item) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("h3", {
|
|
className: "ml15 mb5",
|
|
children: item.name
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: item.id,
|
|
initialValue: 1,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
className: ReuseShixunModalmodules.content,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 1,
|
|
style: {
|
|
color: '#464f66'
|
|
},
|
|
children: "\u7EE7\u7EED\u4F7F\u7528"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 0,
|
|
style: {
|
|
color: '#464f66'
|
|
},
|
|
children: "\u4E0D\u4F7F\u7528"
|
|
})]
|
|
})
|
|
})]
|
|
}, item.id);
|
|
})]
|
|
}), !isMultipleCourse && '当前实训已在教学课堂中使用,同一实训在一个课堂中重复使用时,会导致成绩相互影响,请确认是否继续使用?']
|
|
})
|
|
})
|
|
});
|
|
};
|
|
var useReuseModal = function useReuseModal() {
|
|
var _useState5 = (0,react.useState)(false),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
modalVisible = _useState6[0],
|
|
setModalVisible = _useState6[1];
|
|
var _useState7 = (0,react.useState)(),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
renderData = _useState8[0],
|
|
setRenderData = _useState8[1];
|
|
var closeModalFn = function closeModalFn() {
|
|
return setModalVisible(false);
|
|
};
|
|
var showModal = /*#__PURE__*/function () {
|
|
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(reqParams) {
|
|
var res, _res$course_data_list, isModalVisible;
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
case 0:
|
|
_context3.next = 2;
|
|
return (0,shixuns/* checkShixunCopy */.Tr)(reqParams);
|
|
case 2:
|
|
res = _context3.sent;
|
|
if (!('status' in res)) {
|
|
_context3.next = 5;
|
|
break;
|
|
}
|
|
return _context3.abrupt("return", false);
|
|
case 5:
|
|
if (!(Object.prototype.toString.call(reqParams.course_id) === '[object Array]')) {
|
|
_context3.next = 12;
|
|
break;
|
|
}
|
|
isModalVisible = res === null || res === void 0 ? void 0 : (_res$course_data_list = res.course_data_list) === null || _res$course_data_list === void 0 ? void 0 : _res$course_data_list.some(function (e) {
|
|
return e.is_show;
|
|
});
|
|
if (!isModalVisible) {
|
|
_context3.next = 11;
|
|
break;
|
|
}
|
|
setRenderData(res);
|
|
setModalVisible(true);
|
|
return _context3.abrupt("return", true);
|
|
case 11:
|
|
return _context3.abrupt("return", res.course_data_list || []);
|
|
case 12:
|
|
if (!(res.repeat_shixun_num === 0)) {
|
|
_context3.next = 14;
|
|
break;
|
|
}
|
|
return _context3.abrupt("return", false);
|
|
case 14:
|
|
setRenderData(res);
|
|
setModalVisible(true);
|
|
return _context3.abrupt("return", true);
|
|
case 17:
|
|
case "end":
|
|
return _context3.stop();
|
|
}
|
|
}, _callee3);
|
|
}));
|
|
return function showModal(_x) {
|
|
return _ref5.apply(this, arguments);
|
|
};
|
|
}();
|
|
return [modalVisible, closeModalFn, renderData, showModal];
|
|
};
|
|
|
|
//多个实训时的情况
|
|
var ReuseMultipleShixunModal = function ReuseMultipleShixunModal(props) {
|
|
var _Form$useForm3 = es_form/* default.useForm */.Z.useForm(),
|
|
_Form$useForm4 = slicedToArray_default()(_Form$useForm3, 1),
|
|
form = _Form$useForm4[0];
|
|
var _useState9 = (0,react.useState)(false),
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
confirmLoading = _useState10[0],
|
|
setConfirmLoading = _useState10[1];
|
|
var onCancel = props.onCancel,
|
|
onOk = props.onOk,
|
|
visible = props.visible,
|
|
_props$inPaper = props.inPaper,
|
|
inPaper = _props$inPaper === void 0 ? false : _props$inPaper,
|
|
renderData = props.renderData,
|
|
type = props.type,
|
|
_props$isMultipleCour = props.isMultipleCourse,
|
|
isMultipleCourse = _props$isMultipleCour === void 0 ? false : _props$isMultipleCour;
|
|
var reproducibleShixunColumns = (0,react.useMemo)(function () {
|
|
return inPaper ? [{
|
|
title: '实训名称',
|
|
dataIndex: 'name',
|
|
width: 424,
|
|
align: 'center',
|
|
ellipsis: true,
|
|
className: ReuseShixunModalmodules.tableCell
|
|
}, {
|
|
title: '是否复制',
|
|
dataIndex: 'is_copy',
|
|
align: 'center',
|
|
render: function render(value, record) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: ["".concat(type === 'subject' ? record.stage_shixun_id : record.shixun_course_id || record.id), 'is_copy'],
|
|
initialValue: 1,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 1,
|
|
children: "\u662F"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 0,
|
|
children: "\u5426"
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: ["".concat(type === 'subject' ? record === null || record === void 0 ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id), 'is_use'],
|
|
hidden: true,
|
|
initialValue: 1,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
type: "hidden"
|
|
})
|
|
})]
|
|
});
|
|
}
|
|
}] : [{
|
|
title: '实训名称',
|
|
dataIndex: 'name',
|
|
width: 424,
|
|
align: 'center',
|
|
ellipsis: true,
|
|
className: ReuseShixunModalmodules.tableCell
|
|
}, {
|
|
title: '是否使用',
|
|
dataIndex: 'is_use',
|
|
align: 'center',
|
|
render: function render(value, record) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: ["".concat(type === 'subject' ? record.stage_shixun_id : record.shixun_course_id || record.id), 'is_use'],
|
|
initialValue: 1,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 1,
|
|
children: "\u662F"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 0,
|
|
children: "\u5426"
|
|
})]
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: '是否复制',
|
|
dataIndex: 'is_copy',
|
|
align: 'center',
|
|
render: function render(value, record) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: ["".concat(type === 'subject' ? record.stage_shixun_id : record.shixun_course_id || record.id), 'is_copy'],
|
|
initialValue: 1,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 1,
|
|
children: "\u662F"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 0,
|
|
children: "\u5426"
|
|
})]
|
|
})
|
|
});
|
|
}
|
|
}];
|
|
}, [inPaper]);
|
|
var irreproducibleShixunColumns = (0,react.useMemo)(function () {
|
|
return inPaper ? [{
|
|
title: '实训名称',
|
|
dataIndex: 'name',
|
|
width: 424,
|
|
className: ReuseShixunModalmodules.tableCell,
|
|
align: 'center',
|
|
ellipsis: true,
|
|
render: function render(value, record) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: value
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: ["".concat(type === 'subject' ? record === null || record === void 0 ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id), 'is_copy'],
|
|
hidden: true,
|
|
initialValue: 0,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
type: "hidden"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: ["".concat(type === 'subject' ? record === null || record === void 0 ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id), 'is_use'],
|
|
hidden: true,
|
|
initialValue: 1,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
type: "hidden"
|
|
})
|
|
})]
|
|
});
|
|
}
|
|
}] : [{
|
|
title: '实训名称',
|
|
dataIndex: 'name',
|
|
width: 424,
|
|
className: ReuseShixunModalmodules.tableCell,
|
|
ellipsis: true,
|
|
align: 'center'
|
|
}, {
|
|
title: '是否使用',
|
|
dataIndex: 'is_use',
|
|
align: 'center',
|
|
render: function render(value, record) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: ["".concat(type === 'subject' ? record === null || record === void 0 ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id), 'is_use'],
|
|
initialValue: 0,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 1,
|
|
children: "\u662F"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: 0,
|
|
children: "\u5426"
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: ["".concat(type === 'subject' ? record === null || record === void 0 ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id), 'is_copy'],
|
|
hidden: true,
|
|
initialValue: 0,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
type: "hidden"
|
|
})
|
|
})]
|
|
});
|
|
}
|
|
}];
|
|
}, [inPaper]);
|
|
|
|
//可以选择多个课堂的时候
|
|
if (isMultipleCourse) {
|
|
var param = {
|
|
title: '课堂名称',
|
|
ellipsis: true,
|
|
dataIndex: 'course_name',
|
|
width: 190,
|
|
align: 'center',
|
|
className: ReuseShixunModalmodules.tableCell
|
|
};
|
|
reproducibleShixunColumns = [param].concat(toConsumableArray_default()(reproducibleShixunColumns));
|
|
irreproducibleShixunColumns = [param].concat(toConsumableArray_default()(irreproducibleShixunColumns));
|
|
}
|
|
var dynamicBrief = (0,react.useMemo)(function () {
|
|
return generateBrief({
|
|
total: renderData === null || renderData === void 0 ? void 0 : renderData.total_num,
|
|
used: renderData === null || renderData === void 0 ? void 0 : renderData.repeat_shixun_num,
|
|
copy: renderData === null || renderData === void 0 ? void 0 : renderData.can_copy_num,
|
|
canNotCopy: renderData === null || renderData === void 0 ? void 0 : renderData.no_copy_num,
|
|
inPaper: inPaper
|
|
});
|
|
}, [renderData, inPaper]);
|
|
var dynamicContent = (0,react.useMemo)(function () {
|
|
return generateTextContent(inPaper);
|
|
}, [inPaper]);
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
title: "\u5B9E\u8BAD\u91CD\u590D\u4F7F\u7528\u63D0\u793A",
|
|
centered: true,
|
|
open: visible,
|
|
confirmLoading: confirmLoading,
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
var formValues, ids;
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
case 0:
|
|
setConfirmLoading(true);
|
|
formValues = form.getFieldsValue();
|
|
ids = Object.keys(formValues).map(function (key) {
|
|
return {
|
|
id: parseInt(key.split('_')[0]),
|
|
course_id: parseInt(key.split('_')[1]),
|
|
is_use: formValues[key].is_use,
|
|
is_copy: formValues[key].is_copy
|
|
};
|
|
});
|
|
_context4.next = 5;
|
|
return onOk(ids);
|
|
case 5:
|
|
setConfirmLoading(false);
|
|
case 6:
|
|
case "end":
|
|
return _context4.stop();
|
|
}
|
|
}, _callee4);
|
|
})),
|
|
onCancel: onCancel,
|
|
width: 800,
|
|
okText: "\u786E\u8BA4",
|
|
className: ReuseShixunModalmodules.antdModal,
|
|
destroyOnClose: true,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
form: form,
|
|
preserve: false,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: ReuseShixunModalmodules.brief,
|
|
children: dynamicBrief
|
|
}), (renderData === null || renderData === void 0 ? void 0 : renderData.can_copy_num) > 0 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: ReuseShixunModalmodules.contentTitle,
|
|
children: "\u53EF\u590D\u5236\u5B9E\u8BAD"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: ReuseShixunModalmodules.content,
|
|
children: dynamicContent.reproducible
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: ReuseShixunModalmodules.tips,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: "\u590D\u5236\u5B9E\u8BAD\uFF1A\u590D\u5236\u4E00\u4EFD\u65B0\u7684\u5B9E\u8BAD\u8FDB\u5165\u8BFE\u5802\uFF0C\u539F\u5B9E\u8BAD\u7684\u8C03\u6574\u4E0D\u4F1A\u5F71\u54CD\u5230\u590D\u5236\u7684\u5B9E\u8BAD\u4E2D\u3002"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: "\u4E0D\u590D\u5236\u5B9E\u8BAD\uFF1A\u540C\u4E00\u5B9E\u8BAD\u5728\u4E00\u4E2A\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD\u3002"
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
columns: reproducibleShixunColumns,
|
|
className: ReuseShixunModalmodules.antdTable,
|
|
dataSource: renderData === null || renderData === void 0 ? void 0 : renderData.can_copy_list,
|
|
rowKey: type === 'subject' ? "stage_shixun_id" : 'id',
|
|
pagination: false,
|
|
scroll: {
|
|
y: 240
|
|
},
|
|
bordered: true
|
|
})]
|
|
}), (renderData === null || renderData === void 0 ? void 0 : renderData.no_copy_num) > 0 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: ReuseShixunModalmodules.contentTitle,
|
|
children: "\u4E0D\u53EF\u590D\u5236\u5B9E\u8BAD"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: ReuseShixunModalmodules.content,
|
|
children: dynamicContent.irreproducible
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
columns: irreproducibleShixunColumns,
|
|
className: ReuseShixunModalmodules.antdTable,
|
|
dataSource: renderData === null || renderData === void 0 ? void 0 : renderData.no_copy_list,
|
|
rowKey: type === 'subject' ? "stage_shixun_id" : 'id',
|
|
pagination: false,
|
|
scroll: {
|
|
y: 200
|
|
},
|
|
bordered: true
|
|
})]
|
|
}), (renderData === null || renderData === void 0 ? void 0 : renderData.no_use_list.length) > 0 && (renderData === null || renderData === void 0 ? void 0 : renderData.no_use_list.map(function (record) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: ["".concat(type === 'subject' ? record === null || record === void 0 ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id), 'is_copy'],
|
|
hidden: true,
|
|
initialValue: 0,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
type: "hidden"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: ["".concat(type === 'subject' ? record === null || record === void 0 ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id), 'is_use'],
|
|
hidden: true,
|
|
initialValue: 1,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
type: "hidden"
|
|
})
|
|
})]
|
|
}, type === 'subject' ? record.stage_shixun_id : record.shixun_course_id || record.id);
|
|
}))]
|
|
})
|
|
});
|
|
};
|
|
var ReuseShixunModal = function ReuseShixunModal(props) {
|
|
var modalType = props.modalType;
|
|
return modalType === 'multiple' ? /*#__PURE__*/(0,jsx_runtime.jsx)(ReuseMultipleShixunModal, objectSpread2_default()({}, props)) : /*#__PURE__*/(0,jsx_runtime.jsx)(ReuseSingleShixunModal, objectSpread2_default()({}, props));
|
|
};
|
|
/* harmony default export */ var components_ReuseShixunModal = (ReuseShixunModal);
|
|
|
|
/***/ })
|
|
|
|
}]); |