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.
512 lines
30 KiB
512 lines
30 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[7816],{
|
|
|
|
/***/ 7816:
|
|
/*!***************************************************************!*\
|
|
!*** ./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/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
|
|
var es_form = __webpack_require__(78241);
|
|
// 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/radio/index.js + 5 modules
|
|
var es_radio = __webpack_require__(5112);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
var input = __webpack_require__(20008);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
|
|
var table = __webpack_require__(86383);
|
|
;// 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","orangeColor":"orangeColor___ryB2u"});
|
|
// EXTERNAL MODULE: ./src/service/shixuns.ts
|
|
var shixuns = __webpack_require__(58215);
|
|
;// CONCATENATED MODULE: ./src/components/ReuseShixunModal/index.tsx
|
|
var __defProp = Object.defineProperty;
|
|
var __defProps = Object.defineProperties;
|
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
var __objRest = (source, exclude) => {
|
|
var target = {};
|
|
for (var prop in source)
|
|
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
target[prop] = source[prop];
|
|
if (source != null && __getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(source)) {
|
|
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
target[prop] = source[prop];
|
|
}
|
|
return target;
|
|
};
|
|
var __async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
const StudentInfo = ({ studentNames, total }) => {
|
|
const Map = ["", "\u4E00", "\u4E24", "\u4E09"];
|
|
return total > 3 ? /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, "\u8BFE\u5802\u5185\u6709", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: ReuseShixunModalmodules.orangeColor }, studentNames == null ? void 0 : studentNames.join("\u3001")), "\u7B49", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: ReuseShixunModalmodules.orangeColor }, total), "\u540D\u5B66\u751F") : /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, "\u8BFE\u5802\u5185\u6709", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: ReuseShixunModalmodules.orangeColor }, studentNames == null ? void 0 : studentNames.join("\u3001")), Map[total], "\u540D\u5B66\u751F");
|
|
};
|
|
const generateBrief = ({
|
|
used,
|
|
copy,
|
|
canNotCopy,
|
|
studentNames,
|
|
studentCount,
|
|
inPaper,
|
|
is_random = false,
|
|
position = ""
|
|
}) => {
|
|
const copyStatusDescribe = () => {
|
|
if (copy > 0 && canNotCopy > 0) {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, "\u5176\u4E2D", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: ReuseShixunModalmodules.orangeColor }, copy), "\u4E2A\u9879\u76EE\u652F\u6301\u590D\u5236\uFF0C", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: ReuseShixunModalmodules.orangeColor }, canNotCopy), "\u4E2A\u9879\u76EE\u4E0D\u652F\u6301\u590D\u5236");
|
|
} else if (copy > 0 && canNotCopy === 0) {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, "\u5176\u4E2D", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: ReuseShixunModalmodules.orangeColor }, copy), "\u4E2A\u9879\u76EE\u652F\u6301\u590D\u5236");
|
|
} else if (copy === 0 && canNotCopy > 0) {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, "\u5176\u4E2D", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: ReuseShixunModalmodules.orangeColor }, canNotCopy), "\u4E2A\u9879\u76EE\u4E0D\u652F\u6301\u590D\u5236");
|
|
}
|
|
};
|
|
const currentPosition = position || (inPaper ? "\u8BD5\u5377" : "\u8BFE\u7A0B");
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, /* @__PURE__ */ _react_17_0_2_react.createElement(StudentInfo, { studentNames, total: studentCount }), "\u5B66\u4E60\u8FC7", currentPosition, "\u4E2D\u7684", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: ReuseShixunModalmodules.orangeColor }, used), "\u4E2A\u9879\u76EE\uFF0C", copyStatusDescribe(), "\u3002\u8BF7\u9009\u62E9", is_random ? "" : "\u662F\u5426\u7EE7\u7EED\u4F7F\u7528\u548C", "\u662F\u5426\u590D\u5236\u4E3A\u65B0\u9879\u76EE\u53D1\u9001\u81F3\u8BFE\u5802\u4E2D\uFF1F");
|
|
};
|
|
const ReuseSingleShixunModal = ({
|
|
onCancel,
|
|
onOk,
|
|
visible,
|
|
inPaper,
|
|
renderData,
|
|
type,
|
|
isMultipleCourse = false
|
|
}) => {
|
|
const [form] = es_form["default"].useForm();
|
|
const [radioValue, setRadioValue] = (0,_react_17_0_2_react.useState)(1);
|
|
const [confirmLoading, setConfirmLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
const canCopy = (0,_react_17_0_2_react.useMemo)(
|
|
() => (renderData == null ? void 0 : renderData.total_num) === 1 && (renderData == null ? void 0 : renderData.can_copy_num) === 1,
|
|
[renderData]
|
|
);
|
|
const courseDataList = (0,_react_17_0_2_react.useMemo)(
|
|
() => {
|
|
var _a;
|
|
return (_a = renderData == null ? void 0 : renderData.course_data_list) == null ? void 0 : _a.filter((e) => e.is_show);
|
|
},
|
|
[renderData]
|
|
);
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, canCopy ? /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
modal["default"],
|
|
{
|
|
centered: true,
|
|
closable: true,
|
|
open: visible,
|
|
destroyOnClose: true,
|
|
title: "\u63D0\u793A",
|
|
className: ReuseShixunModalmodules.antdModal,
|
|
width: 682,
|
|
confirmLoading,
|
|
onCancel,
|
|
onOk: () => __async(void 0, null, function* () {
|
|
var _a;
|
|
setConfirmLoading(true);
|
|
let data = radioValue;
|
|
if (isMultipleCourse) {
|
|
const param = __spreadValues({}, form.getFieldsValue());
|
|
data = (_a = renderData == null ? void 0 : renderData.course_data_list) == null ? void 0 : _a.map((e) => {
|
|
if (param[e.id] !== void 0) {
|
|
return __spreadProps(__spreadValues({}, e), {
|
|
is_copy: param[e.id]
|
|
});
|
|
}
|
|
return e;
|
|
});
|
|
}
|
|
yield onOk(data);
|
|
setConfirmLoading(false);
|
|
})
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ReuseShixunModalmodules.content, style: { marginBottom: 20 } }, isMultipleCourse ? "\u68C0\u6D4B\u5230\u4EE5\u4E0B\u8BFE\u5802\u5DF2\u5728\u6559\u5B66\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u8BF7\u95EE\u662F\u5426\u590D\u5236\u6210\u65B0\u7684\u5B9E\u8BAD\u53D1\u9001\u81F3\u6559\u5B66\u8BFE\u5802\u4E2D?" : /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement(StudentInfo, { studentNames: renderData == null ? void 0 : renderData.student_names, total: renderData == null ? void 0 : renderData.student_count }), "\u5B66\u4E60\u8FC7\u8BE5\u5B9E\u8DF5\u9879\u76EE\u3002\u8BE5\u9879\u76EE\u652F\u6301\u590D\u5236\uFF0C\u8BF7\u9009\u62E9\u662F\u5426\u5C06\u8BE5\u9879\u76EE\u590D\u5236\u4E3A\u65B0\u9879\u76EE\u53D1\u9001\u81F3\u8BFE\u5802\u4E2D\uFF1F")),
|
|
isMultipleCourse ? /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"], { form, preserve: false }, courseDataList == null ? void 0 : courseDataList.map((item) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, { key: item.id }, /* @__PURE__ */ _react_17_0_2_react.createElement("h3", { className: "ml15 mb5" }, item.name), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: item.id,
|
|
initialValue: 1
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default.Group */.ZP.Group, { className: ReuseShixunModalmodules.content }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default */.ZP, { value: 1, style: { color: "#464f66" } }, "\u590D\u5236\u5B9E\u8BAD"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default */.ZP, { value: 0, style: { color: "#464f66" } }, "\u4E0D\u590D\u5236\u5B9E\u8BAD"))
|
|
));
|
|
})) : /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_radio/* default.Group */.ZP.Group,
|
|
{
|
|
value: radioValue,
|
|
onChange: (e) => setRadioValue(e.target.value),
|
|
className: ReuseShixunModalmodules.content,
|
|
style: { marginBottom: 30 }
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default */.ZP, { value: 1, style: { color: "#464f66" } }, "\u590D\u5236"),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default */.ZP, { value: 0, style: { color: "#464f66" } }, "\u4E0D\u590D\u5236")
|
|
),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ReuseShixunModalmodules.content, style: { marginBottom: 10 } }, "* \u8BF4\u660E\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ReuseShixunModalmodules.content, style: { marginBottom: 20 } }, "1\u3001\u590D\u5236\uFF1A\u7CFB\u7EDF\u5C06\u590D\u5236\u5E76\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u9879\u76EE\u53D1\u9001\u5230\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF08\u4E0D\u4F1A\u590D\u5236\u5B66\u751F\u7684\u6311\u6218\u8BB0\u5F55\uFF09\uFF0C\u65B0\u7684\u9879\u76EE\u652F\u6301\u8FDB\u884C\u7F16\u8F91\u5E76\u4E0E\u539F\u9879\u76EE\u4FE1\u606F\u4E92\u4E0D\u5F71\u54CD\u3002"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${ReuseShixunModalmodules.content} ${ReuseShixunModalmodules.orangeColor}` }, "2\u3001\u4E0D\u590D\u5236\uFF1A\u5F53\u524D\u9879\u76EE\u4F1A\u88AB\u76F4\u63A5\u53D1\u9001\u5230\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u6311\u6218\u8FC7\u8BE5\u9879\u76EE\u7684\u5B66\u751F\u518D\u6B21\u8FDB\u5165\u9879\u76EE\u5F00\u542F\u6311\u6218\u65F6\uFF0C\u4F1A\u6E05\u7A7A\u4E4B\u524D\u7684\u6311\u6218\u8BB0\u5F55\u3002"))
|
|
) : /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
modal["default"],
|
|
{
|
|
centered: true,
|
|
closable: true,
|
|
destroyOnClose: true,
|
|
open: visible,
|
|
confirmLoading,
|
|
title: "\u63D0\u793A",
|
|
width: 682,
|
|
onCancel,
|
|
onOk: () => __async(void 0, null, function* () {
|
|
var _a;
|
|
setConfirmLoading(true);
|
|
let data = 0;
|
|
if (isMultipleCourse) {
|
|
const param = __spreadValues({}, form.getFieldsValue());
|
|
data = (_a = renderData == null ? void 0 : renderData.course_data_list) == null ? void 0 : _a.map((e) => {
|
|
if (param[e.id] !== void 0) {
|
|
return __spreadProps(__spreadValues({}, e), {
|
|
is_use: param[e.id]
|
|
});
|
|
}
|
|
return e;
|
|
});
|
|
}
|
|
yield onOk(data);
|
|
setConfirmLoading(false);
|
|
})
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ReuseShixunModalmodules.content }, /* @__PURE__ */ _react_17_0_2_react.createElement(StudentInfo, { studentNames: renderData == null ? void 0 : renderData.student_names, total: renderData == null ? void 0 : renderData.student_count }), "\u5B66\u4E60\u8FC7\u8BE5\u5B9E\u8DF5\u9879\u76EE\u3002", isMultipleCourse ? /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"], { form, preserve: false }, /* @__PURE__ */ _react_17_0_2_react.createElement("h3", null, "\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 ? void 0 : courseDataList.map((item) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, { key: item.id }, /* @__PURE__ */ _react_17_0_2_react.createElement("h3", { className: "ml15 mb5" }, item.name), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: item.id,
|
|
initialValue: 1
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default.Group */.ZP.Group, { className: ReuseShixunModalmodules.content }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default */.ZP, { value: 1, style: { color: "#464f66" } }, "\u7EE7\u7EED\u4F7F\u7528"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default */.ZP, { value: 0, style: { color: "#464f66" } }, "\u4E0D\u4F7F\u7528"))
|
|
));
|
|
})) : /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u8BE5\u9879\u76EE\u4E0D\u652F\u6301\u590D\u5236\uFF0C\u82E5\u786E\u8BA4\u7EE7\u7EED\u53D1\u9001\uFF0C", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: ReuseShixunModalmodules.orangeColor }, "\u5F53\u524D\u9879\u76EE\u4F1A\u88AB\u76F4\u63A5\u53D1\u9001\u5230\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u6311\u6218\u8FC7\u8BE5\u9879\u76EE\u7684\u5B66\u751F\u518D\u6B21\u8FDB\u5165\u9879\u76EE\u5F00\u542F\u6311\u6218\u65F6\uFF0C\u4F1A\u6E05\u7A7A\u4E4B\u524D\u7684\u6311\u6218\u8BB0\u5F55\u3002"), "\uFF08\u5982\u679C\u4E0D\u60F3\u6E05\u7A7A\u5B66\u751F\u4E4B\u524D\u7684\u6311\u6218\u8BB0\u5F55\uFF0C\u5EFA\u8BAE\u53C2\u7167\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u5185\u5BB9\u81EA\u884C\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u9879\u76EE\uFF0C\u6216\u8005\u5C1D\u8BD5\u8054\u7CFB\u9879\u76EE\u521B\u5EFA\u4EBA\u5F00\u653E\u672C\u9879\u76EE\u7684\u590D\u5236\u6743\u9650\uFF09\u3002"))
|
|
));
|
|
};
|
|
const useReuseModal = function() {
|
|
const [modalVisible, setModalVisible] = (0,_react_17_0_2_react.useState)(false);
|
|
const [renderData, setRenderData] = (0,_react_17_0_2_react.useState)();
|
|
const closeModalFn = () => setModalVisible(false);
|
|
const showModal = (reqParams) => __async(this, null, function* () {
|
|
var _b;
|
|
const _a = reqParams, { isImportMultipleCourse = false } = _a, param = __objRest(_a, ["isImportMultipleCourse"]);
|
|
console.log(reqParams);
|
|
const res = (reqParams == null ? void 0 : reqParams.result) || (yield (0,shixuns/* checkShixunCopy */.Tr)(param));
|
|
if ("status" in res) {
|
|
return false;
|
|
}
|
|
if (isImportMultipleCourse) {
|
|
const isModalVisible = (_b = res == null ? void 0 : res.course_data_list) == null ? void 0 : _b.some((e) => e.is_show);
|
|
if (isModalVisible) {
|
|
setRenderData(res);
|
|
setModalVisible(true);
|
|
return true;
|
|
}
|
|
return res.course_data_list || [];
|
|
}
|
|
if (res.student_count === 0) {
|
|
return false;
|
|
}
|
|
setRenderData(res);
|
|
setModalVisible(true);
|
|
return true;
|
|
});
|
|
return [modalVisible, closeModalFn, renderData, showModal];
|
|
};
|
|
const ReuseMultipleShixunModal = (props) => {
|
|
const [form] = es_form["default"].useForm();
|
|
const [confirmLoading, setConfirmLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
const { onCancel, onOk, visible, inPaper = false, renderData, type, isMultipleCourse = false, position } = props;
|
|
let reproducibleShixunColumns = (0,_react_17_0_2_react.useMemo)(() => inPaper ? [
|
|
{
|
|
title: "\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0",
|
|
dataIndex: "name",
|
|
width: 424,
|
|
align: "center",
|
|
ellipsis: true,
|
|
className: ReuseShixunModalmodules.tableCell,
|
|
render(text, record) {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: `/shixuns/${record.identifier}/challenges`, target: "_blank" }, text);
|
|
}
|
|
},
|
|
{
|
|
title: "\u662F\u5426\u590D\u5236",
|
|
dataIndex: "is_copy",
|
|
align: "center",
|
|
render: (value, record) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: [`${type === "subject" ? record.stage_shixun_id : record.shixun_course_id || record.id}`, "is_copy"],
|
|
initialValue: 1
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default.Group */.ZP.Group, null, /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default */.ZP, { value: 1 }, "\u662F"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default */.ZP, { value: 0 }, "\u5426"))
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: [`${type === "subject" ? record == null ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id}`, "is_use"],
|
|
hidden: true,
|
|
initialValue: 1
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { type: "hidden" })
|
|
));
|
|
}
|
|
}
|
|
] : [
|
|
{
|
|
title: "\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0",
|
|
dataIndex: "name",
|
|
width: 424,
|
|
align: "center",
|
|
ellipsis: true,
|
|
className: ReuseShixunModalmodules.tableCell,
|
|
render(text, record) {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: `/shixuns/${record.identifier}/challenges`, target: "_blank" }, text);
|
|
}
|
|
},
|
|
{
|
|
title: "\u662F\u5426\u4F7F\u7528",
|
|
dataIndex: "is_use",
|
|
align: "center",
|
|
render: (value, record) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: [`${type === "subject" ? record.stage_shixun_id : record.shixun_course_id || record.id}`, "is_use"],
|
|
initialValue: 1
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default.Group */.ZP.Group, null, /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default */.ZP, { value: 1 }, "\u662F"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default */.ZP, { value: 0 }, "\u5426"))
|
|
);
|
|
}
|
|
},
|
|
{
|
|
title: "\u662F\u5426\u590D\u5236",
|
|
dataIndex: "is_copy",
|
|
align: "center",
|
|
render: (value, record) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: [`${type === "subject" ? record.stage_shixun_id : record.shixun_course_id || record.id}`, "is_copy"],
|
|
initialValue: 1
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default.Group */.ZP.Group, null, /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default */.ZP, { value: 1 }, "\u662F"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default */.ZP, { value: 0 }, "\u5426"))
|
|
);
|
|
}
|
|
}
|
|
], [inPaper]);
|
|
let irreproducibleShixunColumns = (0,_react_17_0_2_react.useMemo)(
|
|
() => inPaper ? [
|
|
{
|
|
title: "\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0",
|
|
dataIndex: "name",
|
|
width: 424,
|
|
className: ReuseShixunModalmodules.tableCell,
|
|
align: "center",
|
|
ellipsis: true,
|
|
render: (value, record) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: `/shixuns/${record.identifier}/challenges`, target: "_blank" }, value), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: [`${type === "subject" ? record == null ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id}`, "is_copy"],
|
|
hidden: true,
|
|
initialValue: 0
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { type: "hidden" })
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: [`${type === "subject" ? record == null ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id}`, "is_use"],
|
|
hidden: true,
|
|
initialValue: 1
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { type: "hidden" })
|
|
));
|
|
}
|
|
}
|
|
] : [
|
|
{
|
|
title: "\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0",
|
|
dataIndex: "name",
|
|
width: 424,
|
|
className: ReuseShixunModalmodules.tableCell,
|
|
ellipsis: true,
|
|
align: "center",
|
|
render: (text, record) => /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: `/shixuns/${record.identifier}/challenges`, target: "_blank" }, text)
|
|
},
|
|
{
|
|
title: "\u662F\u5426\u4F7F\u7528",
|
|
dataIndex: "is_use",
|
|
align: "center",
|
|
render: (value, record) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: [`${type === "subject" ? record == null ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id}`, "is_use"],
|
|
initialValue: 0
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default.Group */.ZP.Group, null, /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default */.ZP, { value: 1 }, "\u662F"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default */.ZP, { value: 0 }, "\u5426"))
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: [`${type === "subject" ? record == null ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id}`, "is_copy"],
|
|
hidden: true,
|
|
initialValue: 0
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { type: "hidden" })
|
|
));
|
|
}
|
|
}
|
|
],
|
|
[inPaper]
|
|
);
|
|
if (isMultipleCourse) {
|
|
const param = {
|
|
title: "\u8BFE\u5802\u540D\u79F0",
|
|
ellipsis: true,
|
|
dataIndex: "course_name",
|
|
width: 190,
|
|
align: "center",
|
|
className: ReuseShixunModalmodules.tableCell,
|
|
render: (text, record) => /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: `/classrooms/${record.course_id}` }, text)
|
|
};
|
|
reproducibleShixunColumns = [param, ...reproducibleShixunColumns];
|
|
irreproducibleShixunColumns = [param, ...irreproducibleShixunColumns];
|
|
}
|
|
const dynamicBrief = (0,_react_17_0_2_react.useMemo)(
|
|
() => generateBrief({
|
|
used: renderData == null ? void 0 : renderData.repeat_shixun_num,
|
|
copy: renderData == null ? void 0 : renderData.can_copy_num,
|
|
canNotCopy: renderData == null ? void 0 : renderData.no_copy_num,
|
|
studentNames: renderData == null ? void 0 : renderData.student_names,
|
|
studentCount: renderData == null ? void 0 : renderData.student_count,
|
|
is_random: renderData == null ? void 0 : renderData.is_random,
|
|
inPaper,
|
|
position
|
|
}),
|
|
[renderData, inPaper, position]
|
|
);
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
modal["default"],
|
|
{
|
|
title: "\u63D0\u793A",
|
|
centered: true,
|
|
open: visible,
|
|
confirmLoading,
|
|
onOk: () => __async(void 0, null, function* () {
|
|
setConfirmLoading(true);
|
|
const formValues = form.getFieldsValue();
|
|
const ids = Object.keys(formValues).map((key) => ({
|
|
id: parseInt(key.split("_")[0]),
|
|
course_id: parseInt(key.split("_")[1]),
|
|
is_use: formValues[key].is_use,
|
|
is_copy: formValues[key].is_copy
|
|
}));
|
|
yield onOk(ids);
|
|
setConfirmLoading(false);
|
|
}),
|
|
onCancel,
|
|
width: 880,
|
|
okText: "\u786E\u8BA4",
|
|
className: ReuseShixunModalmodules.antdModal,
|
|
destroyOnClose: true
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"], { form, preserve: false }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ReuseShixunModalmodules.brief }, dynamicBrief), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { marginBottom: 30 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { marginBottom: 20 } }, "* \u8BF4\u660E"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { marginBottom: 20 } }, "1\u3001\u590D\u5236\uFF1A\u7CFB\u7EDF\u5C06\u590D\u5236\u5E76\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u9879\u76EE\u53D1\u9001\u5230\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF08\u4E0D\u4F1A\u590D\u5236\u5B66\u751F\u7684\u6311\u6218\u8BB0\u5F55\uFF09\uFF0C\u65B0\u7684\u9879\u76EE\u652F\u6301\u8FDB\u884C\u7F16\u8F91\u5E76\u4E0E\u539F\u9879\u76EE\u4FE1\u606F\u4E92\u4E0D\u5F71\u54CD\u3002"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ReuseShixunModalmodules.orangeColor }, "2\u3001\u4E0D\u590D\u5236\uFF1A\u5F53\u524D\u9879\u76EE\u4F1A\u88AB\u76F4\u63A5\u53D1\u9001\u5230\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u6311\u6218\u8FC7\u8BE5\u9879\u76EE\u7684\u5B66\u751F\u518D\u6B21\u8FDB\u5165\u9879\u76EE\u5F00\u542F\u6311\u6218\u65F6\uFF0C\u4F1A\u6E05\u7A7A\u4E4B\u524D\u7684\u6311\u6218\u8BB0\u5F55\u3002")), (renderData == null ? void 0 : renderData.can_copy_num) > 0 && /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ReuseShixunModalmodules.contentTitle }, "\u652F\u6301\u590D\u5236\u7684\u9879\u76EE"), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
table["default"],
|
|
{
|
|
columns: reproducibleShixunColumns,
|
|
className: ReuseShixunModalmodules.antdTable,
|
|
dataSource: renderData == null ? void 0 : renderData.can_copy_list,
|
|
rowKey: type === "subject" ? "stage_shixun_id" : "id",
|
|
pagination: false,
|
|
scroll: { y: 240 },
|
|
bordered: true
|
|
}
|
|
)), (renderData == null ? void 0 : renderData.no_copy_num) > 0 && /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ReuseShixunModalmodules.contentTitle }, "\u4E0D\u652F\u6301\u590D\u5236\u7684\u9879\u76EE"), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
table["default"],
|
|
{
|
|
columns: irreproducibleShixunColumns,
|
|
className: ReuseShixunModalmodules.antdTable,
|
|
dataSource: renderData == null ? void 0 : renderData.no_copy_list,
|
|
rowKey: type === "subject" ? "stage_shixun_id" : "id",
|
|
pagination: false,
|
|
scroll: { y: 200 },
|
|
bordered: true
|
|
}
|
|
)), (renderData == null ? void 0 : renderData.no_use_list.length) > 0 && (renderData == null ? void 0 : renderData.no_use_list.map((record) => /* @__PURE__ */ _react_17_0_2_react.createElement("div", { key: type === "subject" ? record.stage_shixun_id : record.shixun_course_id || record.id }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: [`${type === "subject" ? record == null ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id}`, "is_copy"],
|
|
hidden: true,
|
|
initialValue: 0
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { type: "hidden" })
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: [`${type === "subject" ? record == null ? void 0 : record.stage_shixun_id : record.shixun_course_id || record.id}`, "is_use"],
|
|
hidden: true,
|
|
initialValue: 1
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { type: "hidden" })
|
|
)))))
|
|
);
|
|
};
|
|
const ReuseShixunModal = (props) => {
|
|
const { modalType } = props;
|
|
return modalType === "multiple" ? /* @__PURE__ */ _react_17_0_2_react.createElement(ReuseMultipleShixunModal, __spreadValues({}, props)) : /* @__PURE__ */ _react_17_0_2_react.createElement(ReuseSingleShixunModal, __spreadValues({}, props));
|
|
};
|
|
/* harmony default export */ var components_ReuseShixunModal = (ReuseShixunModal);
|
|
|
|
|
|
/***/ })
|
|
|
|
}]); |