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.
1077 lines
51 KiB
1077 lines
51 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[1461],{
|
|
|
|
/***/ 5547:
|
|
/*!**********************************************************!*\
|
|
!*** ./src/components/QuestionEditor/index.less?modules ***!
|
|
\**********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
|
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ __webpack_exports__.Z = ({"wrap":"wrap___ilWvf","deleteIcon":"deleteIcon___JBDG8","keywordTag":"keywordTag___iieCb","questionTitleEditorWrap":"questionTitleEditorWrap___MHB5s","choiceListWrap":"choiceListWrap___jB8b1","choiceWrap":"choiceWrap___QFkTc","choiceIndex":"choiceIndex___Mr2YO","judgementIndex":"judgementIndex___fUVWK","setAnswerBtn":"setAnswerBtn___Whox5","activeAnswer":"activeAnswer___fGU6Y","activeJudgementAnswer":"activeJudgementAnswer___wJv8P","actionWrapper":"actionWrapper___ERQ7k","addIcon":"addIcon___L9TE0","inputBorder":"inputBorder___Q5tRE","placeholder":"placeholder___p9sFY","blankInputNumberWrapper":"blankInputNumberWrapper___uEHb0","addBtn":"addBtn___WR5ZI","blankIndex":"blankIndex___x9Pny","baseInputWrapper":"baseInputWrapper___eVsG7","collapseWrapper":"collapseWrapper___ZTysU","panelHeader":"panelHeader___QSN9g","open":"open___B6FU9","close":"close___QX19r","hide":"hide___mn25n"});
|
|
|
|
/***/ }),
|
|
|
|
/***/ 16800:
|
|
/*!**********************************************!*\
|
|
!*** ./src/components/AsyncButton/index.tsx ***!
|
|
\**********************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ Z: function() { return /* binding */ AsyncButton; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd */ 3113);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
|
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 AsyncButton = (_a) => {
|
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
const [btnLoading, setBtnLoading] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP, __spreadProps(__spreadValues({}, props), { loading: btnLoading, onClick: (e) => __async(void 0, null, function* () {
|
|
try {
|
|
setBtnLoading(true);
|
|
yield props.onClick(e);
|
|
setBtnLoading(false);
|
|
} catch (error) {
|
|
console.error(error);
|
|
setBtnLoading(false);
|
|
}
|
|
}) }), children);
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 92821:
|
|
/*!******************************************************!*\
|
|
!*** ./src/components/CodeBox/index.tsx + 1 modules ***!
|
|
\******************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ components_CodeBox; }
|
|
});
|
|
|
|
// UNUSED EXPORTS: CodeDeleteModal
|
|
|
|
// 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/message/index.js + 4 modules
|
|
var message = __webpack_require__(8591);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
var input = __webpack_require__(98135);
|
|
;// CONCATENATED MODULE: ./src/components/CodeBox/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var CodeBoxmodules = ({"codeBox":"codeBox___WpkVl"});
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
;// CONCATENATED MODULE: ./src/components/CodeBox/index.tsx
|
|
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());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
class CodeBox extends _react_17_0_2_react.Component {
|
|
constructor(props) {
|
|
super(props);
|
|
// 生成一个随机数
|
|
this.randomNum = (min, max) => {
|
|
return Math.floor(Math.random() * (max - min) + min);
|
|
};
|
|
this.drawPic = () => {
|
|
this.randomCode();
|
|
};
|
|
this.reloadPic = () => {
|
|
this.drawPic();
|
|
};
|
|
// 输入验证码
|
|
this.changeCode = (e) => {
|
|
console.log(e.target.value, 222);
|
|
this.setState({
|
|
value: e.target.value,
|
|
showError: false
|
|
});
|
|
};
|
|
this.onVerify = () => {
|
|
let error;
|
|
if (this.state.value.toLowerCase() !== "" && this.state.value.toLowerCase() !== this.state.code.toLowerCase()) {
|
|
error = true;
|
|
message/* default */.ZP.error("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u9A8C\u8BC1\u7801");
|
|
this.reloadPic();
|
|
} else if (this.state.value.toLowerCase() === "") {
|
|
error = true;
|
|
message/* default */.ZP.error("\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801");
|
|
} else if (this.state.value.toLowerCase() === this.state.code.toLowerCase()) {
|
|
error = false;
|
|
}
|
|
this.setState({
|
|
showError: error
|
|
});
|
|
return error;
|
|
};
|
|
this.canvas = _react_17_0_2_react.createRef();
|
|
this.state = {
|
|
value: "",
|
|
code: "",
|
|
codeLength: 4,
|
|
fontSizeMin: 20,
|
|
fontSizeMax: 22,
|
|
backgroundColorMin: 240,
|
|
backgroundColorMax: 250,
|
|
colorMin: 10,
|
|
colorMax: 20,
|
|
lineColorMin: 40,
|
|
lineColorMax: 180,
|
|
contentWidth: 96,
|
|
contentHeight: 38,
|
|
showError: false
|
|
// 默认不显示验证码的错误信息
|
|
};
|
|
}
|
|
componentDidMount() {
|
|
this.drawPic();
|
|
}
|
|
// 生成一个随机的颜色
|
|
randomColor(min, max) {
|
|
const r = this.randomNum(min, max);
|
|
const g = this.randomNum(min, max);
|
|
const b = this.randomNum(min, max);
|
|
return `rgb(${r}, ${g}, ${b})`;
|
|
}
|
|
drawText(ctx, txt, i) {
|
|
ctx.fillStyle = this.randomColor(this.state.colorMin, this.state.colorMax);
|
|
const fontSize = this.randomNum(this.state.fontSizeMin, this.state.fontSizeMax);
|
|
ctx.font = fontSize + "px SimHei";
|
|
const padding = 10;
|
|
const offset = (this.state.contentWidth - 40) / (this.state.code.length - 1);
|
|
let x = padding;
|
|
if (i > 0) {
|
|
x = padding + i * offset;
|
|
}
|
|
let y = this.randomNum(this.state.fontSizeMax, this.state.contentHeight - 5);
|
|
if (fontSize > 40) {
|
|
y = 40;
|
|
}
|
|
const deg = this.randomNum(-10, 10);
|
|
ctx.translate(x, y);
|
|
ctx.rotate(deg * Math.PI / 180);
|
|
ctx.fillText(txt, 0, 0);
|
|
ctx.rotate(-deg * Math.PI / 180);
|
|
ctx.translate(-x, -y);
|
|
}
|
|
drawLine(ctx) {
|
|
for (let i = 0; i < 1; i++) {
|
|
ctx.strokeStyle = this.randomColor(this.state.lineColorMin, this.state.lineColorMax);
|
|
ctx.beginPath();
|
|
ctx.moveTo(this.randomNum(0, this.state.contentWidth), this.randomNum(0, this.state.contentHeight));
|
|
ctx.lineTo(this.randomNum(0, this.state.contentWidth), this.randomNum(0, this.state.contentHeight));
|
|
ctx.stroke();
|
|
}
|
|
}
|
|
drawDot(ctx) {
|
|
for (let i = 0; i < 100; i++) {
|
|
ctx.fillStyle = this.randomColor(0, 255);
|
|
ctx.beginPath();
|
|
ctx.arc(this.randomNum(0, this.state.contentWidth), this.randomNum(0, this.state.contentHeight), 1, 0, 2 * Math.PI);
|
|
ctx.fill();
|
|
}
|
|
}
|
|
// 随机生成验证码
|
|
randomCode() {
|
|
let random = "";
|
|
const str = "QWERTYUPLKJHGFDSAZXCVBNMqwertyupkjhgfdsazxcvbnm1234567890";
|
|
for (let i = 0; i < this.state.codeLength; i++) {
|
|
const index = Math.floor(Math.random() * 57);
|
|
random += str[index];
|
|
}
|
|
this.setState({
|
|
code: random
|
|
}, () => {
|
|
const canvas = this.canvas.current;
|
|
const ctx = canvas.getContext("2d");
|
|
ctx.textBaseline = "bottom";
|
|
ctx.fillStyle = this.randomColor(this.state.backgroundColorMin, this.state.backgroundColorMax);
|
|
ctx.fillRect(0, 0, this.state.contentWidth, this.state.contentHeight);
|
|
for (let i = 0; i < this.state.code.length; i++) {
|
|
this.drawText(ctx, this.state.code[i], i);
|
|
}
|
|
this.drawLine(ctx);
|
|
this.drawDot(ctx);
|
|
});
|
|
}
|
|
render() {
|
|
const { className, width = 300 } = this.props;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: _classnames_2_5_1_classnames_default()(CodeBoxmodules.codeBox, className), style: { width } }, /* @__PURE__ */ _react_17_0_2_react.createElement("aside", null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"],
|
|
{
|
|
value: this.state.value,
|
|
onChange: this.changeCode,
|
|
placeholder: "\u8BF7\u8F93\u5165\u56FE\u7247\u4E2D\u7684\u9A8C\u8BC1\u7801"
|
|
}
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"canvas",
|
|
{
|
|
onClick: this.reloadPic,
|
|
ref: this.canvas,
|
|
width: "100",
|
|
height: "30"
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "current", onClick: this.reloadPic }, "\u770B\u4E0D\u6E05\uFF1F\u6362\u4E00\u5F20")));
|
|
}
|
|
}
|
|
const CodeDeleteModal = (cb, text) => {
|
|
let box;
|
|
Modal.confirm({
|
|
centered: true,
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
title: "\u63D0\u793A",
|
|
content: /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("p", null, text), /* @__PURE__ */ React.createElement(CodeBox, { ref: (el) => box = el })),
|
|
onOk: () => __async(void 0, null, function* () {
|
|
if (box.onVerify()) {
|
|
return Promise.reject();
|
|
}
|
|
cb();
|
|
})
|
|
});
|
|
};
|
|
/* harmony default export */ var components_CodeBox = (CodeBox);
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 57782:
|
|
/*!**********************************************************!*\
|
|
!*** ./src/components/QuestionEditor/MdEditorInForm.tsx ***!
|
|
\**********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ h: function() { return /* binding */ MdEditorInForm; },
|
|
/* harmony export */ x: function() { return /* binding */ RegularInput; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _components_markdown_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/markdown-editor */ 96180);
|
|
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.less?modules */ 5547);
|
|
/* harmony import */ var _components_RenderHtml__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/RenderHtml */ 16921);
|
|
/* provided dependency */ var React = __webpack_require__(/*! react */ 59301);
|
|
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;
|
|
};
|
|
|
|
|
|
|
|
const MdEditorInForm = (_a) => {
|
|
var _b = _a, { value, onChange, scrollId } = _b, props = __objRest(_b, ["value", "onChange", "scrollId"]);
|
|
return /* @__PURE__ */ React.createElement("div", { id: scrollId || "" }, /* @__PURE__ */ React.createElement(
|
|
_components_markdown_editor__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z,
|
|
__spreadProps(__spreadValues({}, props), {
|
|
defaultValue: value,
|
|
onChange: (a, b) => {
|
|
console.log("a:", a, b);
|
|
if (!!(b == null ? void 0 : b.length))
|
|
onChange(a, b);
|
|
else
|
|
onChange(a);
|
|
}
|
|
})
|
|
));
|
|
};
|
|
const RegularInput = ({ value, onChange, placeholder, height = 140, isEdit }) => {
|
|
return isEdit ? /* @__PURE__ */ React.createElement(
|
|
_components_markdown_editor__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z,
|
|
{
|
|
watch: true,
|
|
isFocus: true,
|
|
height,
|
|
placeholder,
|
|
defaultValue: value,
|
|
onChange
|
|
}
|
|
) : /* @__PURE__ */ React.createElement("div", { style: { cursor: "pointer" } }, value ? /* @__PURE__ */ React.createElement(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.inputBorder, value }) : /* @__PURE__ */ React.createElement("div", { className: `${_index_less_modules__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.inputBorder} ${_index_less_modules__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.placeholder} inputBorderError` }, placeholder));
|
|
};
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 70032:
|
|
/*!******************************************************************!*\
|
|
!*** ./src/pages/Graduations/Lists/Topics/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 */ Topics; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
;// CONCATENATED MODULE: ./src/pages/Graduations/Lists/Topics/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Topicsmodules = ({"flex_box_center":"flex_box_center___fl5m6","flex_space_between":"flex_space_between___bly3M","flex_box_vertical_center":"flex_box_vertical_center___xKfVY","flex_box_center_end":"flex_box_center_end___uQRsy","flex_box_column":"flex_box_column___V96Tv","ActvieE3":"ActvieE3___B5egy","Onerow":"Onerow___t6jyJ","body":"body___RTqwS","AddBut":"AddBut___iKjQP","FormDiv":"FormDiv___I9YYs"});
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 15 modules
|
|
var _umi_production_exports = __webpack_require__(67866);
|
|
// 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/tooltip/index.js + 3 modules
|
|
var tooltip = __webpack_require__(6848);
|
|
// 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/modal/index.js + 16 modules
|
|
var es_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/col/index.js
|
|
var col = __webpack_require__(43604);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
|
|
var table = __webpack_require__(14491);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
|
|
var pagination = __webpack_require__(53864);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
var es_button = __webpack_require__(3113);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules
|
|
var es_checkbox = __webpack_require__(24905);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
var input = __webpack_require__(98135);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/select/index.js
|
|
var es_select = __webpack_require__(57809);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/upload/index.js + 24 modules
|
|
var upload = __webpack_require__(46651);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/switch/index.js + 2 modules
|
|
var es_switch = __webpack_require__(78673);
|
|
// EXTERNAL MODULE: ./src/components/ui-customization/index.tsx + 34 modules
|
|
var ui_customization = __webpack_require__(26324);
|
|
// EXTERNAL MODULE: ./node_modules/_react-copy-to-clipboard@5.0.2@react-copy-to-clipboard/lib/index.js
|
|
var lib = __webpack_require__(56102);
|
|
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
|
var NoData = __webpack_require__(87526);
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(21873);
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(13462);
|
|
// EXTERNAL MODULE: ./src/components/CodeBox/index.tsx + 1 modules
|
|
var CodeBox = __webpack_require__(92821);
|
|
// EXTERNAL MODULE: ./src/components/QuestionEditor/MdEditorInForm.tsx
|
|
var MdEditorInForm = __webpack_require__(57782);
|
|
// EXTERNAL MODULE: ./src/service/graduations.ts
|
|
var graduations = __webpack_require__(50439);
|
|
// EXTERNAL MODULE: ./src/components/AsyncButton/index.tsx
|
|
var AsyncButton = __webpack_require__(16800);
|
|
;// CONCATENATED MODULE: ./src/pages/Graduations/Lists/Topics/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 __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 Page = ({
|
|
graduations: {
|
|
Tasks,
|
|
teachers,
|
|
students,
|
|
forTask
|
|
},
|
|
loading,
|
|
dispatch
|
|
}) => {
|
|
var _a, _b;
|
|
const params = (0,_umi_production_exports.useParams)();
|
|
const [delRows, setDelRows] = (0,_react_17_0_2_react.useState)([]);
|
|
const [notDelRows, setnotDelRows] = (0,_react_17_0_2_react.useState)([]);
|
|
const [topicModal, setTopicModal] = (0,_react_17_0_2_react.useState)(false);
|
|
const [delTopicModal, setDelTopicModal] = (0,_react_17_0_2_react.useState)(false);
|
|
const [form] = es_form["default"].useForm();
|
|
const [formValue, setFormValue] = (0,_react_17_0_2_react.useState)({});
|
|
const [rowData, setRowData] = (0,_react_17_0_2_react.useState)({});
|
|
const [fileList, setFileList] = (0,_react_17_0_2_react.useState)([]);
|
|
const [isCreate, setIsCreate] = (0,_react_17_0_2_react.useState)(false);
|
|
const box = (0,_react_17_0_2_react.useRef)(null);
|
|
const [UrlData, setUrlData] = (0,_react_17_0_2_react.useState)({
|
|
keyword: "",
|
|
page: 1,
|
|
per_page: 20,
|
|
status: null,
|
|
is_teacher: true
|
|
});
|
|
const tags = [
|
|
{ id: null, name: "\u5168\u90E8" },
|
|
{ id: 1, name: "\u8FBE\u6210\u53CC\u9009" },
|
|
{ id: 0, name: "\u672A\u8FBE\u6210\u53CC\u9009" }
|
|
];
|
|
const columns = [
|
|
{
|
|
title: "\u8BFE\u9898\u540D\u79F0",
|
|
dataIndex: "name",
|
|
ellipsis: true,
|
|
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { placement: "topLeft", title: text }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-grey-333" }, text))
|
|
},
|
|
{
|
|
title: "\u6307\u5BFC\u8001\u5E08",
|
|
width: 120,
|
|
ellipsis: true,
|
|
dataIndex: "teacher_names",
|
|
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { placement: "topLeft", title: text }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-grey-333" }, text))
|
|
},
|
|
{
|
|
title: "\u9009\u9898\u72B6\u6001",
|
|
width: 120,
|
|
dataIndex: "status",
|
|
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, text == 0 && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#E30000" } }, "\u672A\u8FBE\u6210\u53CC\u9009"), text == 1 && /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u8FBE\u6210\u53CC\u9009"))
|
|
},
|
|
{
|
|
title: "\u9080\u8BF7\u7801",
|
|
width: 132,
|
|
dataIndex: "invite_code",
|
|
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-grey-333" }, text, /* @__PURE__ */ _react_17_0_2_react.createElement(lib.CopyToClipboard, { text, onCopy: () => message/* default */.ZP.success("\u590D\u5236\u6210\u529F") }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-fuzhi8 font14", style: { color: "#165DFF", marginLeft: "8px", cursor: "pointer" } })))
|
|
},
|
|
{
|
|
title: /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u64CD\u4F5C"),
|
|
align: "right",
|
|
width: 120,
|
|
render: (text, record) => /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement(AsyncButton/* AsyncButton */.Z, { type: "link", style: { whiteSpace: "nowrap", padding: 0 }, onClick: () => __async(void 0, null, function* () {
|
|
var _a2, _b2;
|
|
setIsCreate(false);
|
|
yield handleFormData();
|
|
record.teacher_ids = (_a2 = record.teacher) == null ? void 0 : _a2.map((item) => item.id);
|
|
record.student_id = record.student_id ? Number(record.student_id) : "";
|
|
setFileList((_b2 = record == null ? void 0 : record.attachments) == null ? void 0 : _b2.map((item) => ({
|
|
uid: item == null ? void 0 : item.id,
|
|
name: (item == null ? void 0 : item.title) + " " + (item == null ? void 0 : item.filesize),
|
|
status: "done",
|
|
url: (item == null ? void 0 : item.url) || ""
|
|
})));
|
|
setFormValue(record);
|
|
setRowData(record);
|
|
form.setFieldsValue(record);
|
|
}) }, "\u7F16\u8F91"), /* @__PURE__ */ _react_17_0_2_react.createElement("a", { className: Topicsmodules.ActvieE3, type: "link", style: { padding: "0 0 0 10px", whiteSpace: "nowrap" }, onClick: () => {
|
|
if (record.status == 1) {
|
|
message/* default */.ZP.warning("\u8BE5\u8BFE\u9898\u5DF2\u88AB\u5B66\u751F\u9009\u9898\u4E0D\u80FD\u5220\u9664");
|
|
} else {
|
|
const modal = es_modal["default"].confirm({
|
|
title: "\u5220\u9664\u63D0\u793A",
|
|
icon: null,
|
|
maskClosable: true,
|
|
content: /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u786E\u5B9A\u8981\u5220\u9664\u8BFE\u9898\uFF1F\u5220\u9664\u540E\u65E0\u6CD5\u6062\u590D"),
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
onOk: () => __async(void 0, null, function* () {
|
|
const res = yield dispatch({
|
|
type: "graduations/getDelGraduationsTasks",
|
|
payload: {
|
|
id: params.id,
|
|
ids: [record.id]
|
|
}
|
|
});
|
|
if (res.status == 0) {
|
|
message/* default */.ZP.success("\u5220\u9664\u6210\u529F");
|
|
UrlData.page = 1;
|
|
setUrlData(__spreadValues({}, UrlData));
|
|
}
|
|
modal.destroy();
|
|
}),
|
|
onCancel: () => {
|
|
modal.destroy();
|
|
}
|
|
});
|
|
}
|
|
} }, "\u5220\u9664"))
|
|
}
|
|
];
|
|
const uploadProps = {
|
|
multiple: true,
|
|
// accept: ".pdf, .docx, .doc, .xlsx, .xls, .ppt, .pptx, .zip,",
|
|
withCredentials: true,
|
|
defaultFileList: fileList,
|
|
onRemove: (file) => {
|
|
setFileList(fileList.filter((item) => (file.uid || file.response.id) != item.uid));
|
|
},
|
|
beforeUpload: (file) => {
|
|
const fileSize = file.size / 1024 / 1024;
|
|
if (fileSize > 150 || fileSize == 0) {
|
|
message/* default */.ZP.error(`${file.name} \u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002${fileSize == 0 ? "\u6587\u4EF6\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A" : "\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(150MB)"}`);
|
|
return Promise.reject();
|
|
}
|
|
return true;
|
|
},
|
|
action: `${env/* default */.Z.API_SERVER}/api/attachments.json`,
|
|
onChange: (info) => {
|
|
var _a2, _b2, _c, _d, _e, _f, _g, _h;
|
|
if (info.file.status === "done") {
|
|
setFileList([...fileList, {
|
|
uid: (_b2 = (_a2 = info == null ? void 0 : info.file) == null ? void 0 : _a2.response) == null ? void 0 : _b2.id,
|
|
name: ((_d = (_c = info == null ? void 0 : info.file) == null ? void 0 : _c.response) == null ? void 0 : _d.filename) + " " + (0,util/* bytesToSize */.RD)((_f = (_e = info == null ? void 0 : info.file) == null ? void 0 : _e.response) == null ? void 0 : _f.filesize),
|
|
status: "done",
|
|
url: ((_h = (_g = info == null ? void 0 : info.file) == null ? void 0 : _g.response) == null ? void 0 : _h.url) || ""
|
|
}]);
|
|
}
|
|
}
|
|
};
|
|
const rowSelection = {
|
|
selectedRowKeys: [...delRows.map((item) => item.id), ...notDelRows.map((item) => item.id)],
|
|
onChange: (newSelectedRowKeys, selectedRows) => {
|
|
const notDelRows2 = [];
|
|
const delRows2 = [];
|
|
selectedRows.map((item) => {
|
|
if (item.status == 0) {
|
|
delRows2.push(item);
|
|
} else {
|
|
notDelRows2.push(item);
|
|
}
|
|
});
|
|
setnotDelRows(notDelRows2);
|
|
setDelRows(delRows2);
|
|
}
|
|
// columnWidth: 40,
|
|
};
|
|
const handleFormData = (isCreate2 = false) => __async(void 0, null, function* () {
|
|
var _a2, _b2;
|
|
const res = yield dispatch({
|
|
type: "graduations/getGraduationsTeachers",
|
|
payload: { id: params.id, page: 1, per_page: 2e3 }
|
|
});
|
|
dispatch({
|
|
type: "graduations/getGraduationsStudents",
|
|
payload: { id: params.id, page: 1, per_page: 2e3 }
|
|
});
|
|
dispatch({
|
|
type: "graduations/getGraduationsDetails",
|
|
payload: { id: params.id }
|
|
});
|
|
if (isCreate2) {
|
|
const teacher_ids = (_b2 = (_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.filter((item) => item == null ? void 0 : item.is_creator)) == null ? void 0 : _b2.map((item) => item.id);
|
|
form.setFieldsValue({
|
|
teacher_ids
|
|
});
|
|
setFormValue(__spreadProps(__spreadValues({}, formValue), { teacher_ids }));
|
|
}
|
|
setTopicModal(true);
|
|
});
|
|
const getData = () => __async(void 0, null, function* () {
|
|
yield dispatch({
|
|
type: "graduations/getGraduationsTasks",
|
|
payload: __spreadValues({
|
|
id: params.id
|
|
}, UrlData)
|
|
});
|
|
});
|
|
const handleFinish = (values) => __async(void 0, null, function* () {
|
|
values.attachment_ids = fileList.map((item) => item.uid);
|
|
let res;
|
|
if (isCreate) {
|
|
res = yield (0,graduations/* getCreateGraduationsTasks */.jW)(__spreadValues({
|
|
graduation_id: params.id
|
|
}, values));
|
|
} else {
|
|
res = yield (0,graduations/* getPutGraduationsTasks */.YS)(__spreadValues({
|
|
graduation_id: params.id,
|
|
id: formValue.id
|
|
}, values));
|
|
}
|
|
if (res.status == 0) {
|
|
message/* default */.ZP.success(isCreate ? "\u521B\u5EFA\u6210\u529F" : "\u66F4\u65B0\u6210\u529F");
|
|
setFormValue({});
|
|
setFileList([]);
|
|
setTopicModal(false);
|
|
form.resetFields();
|
|
yield getData();
|
|
}
|
|
});
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
setDelRows([]);
|
|
setnotDelRows([]);
|
|
getData();
|
|
}, [UrlData]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (formValue.base_project) {
|
|
domScrollTop();
|
|
}
|
|
}, [formValue == null ? void 0 : formValue.base_project]);
|
|
const domScrollTop = (num = 1e5) => {
|
|
const modalBody = document.querySelector(".ant-form-modal-body").querySelector(".ant-modal-body");
|
|
modalBody.scrollTop = num;
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: Topicsmodules.body }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
ui_customization/* CustomTabs */.YG,
|
|
{
|
|
value: "manage",
|
|
tabBarExtraContent: /* @__PURE__ */ _react_17_0_2_react.createElement(ui_customization/* CustomButton */.op, { openLoading: true, onClick: () => __async(void 0, null, function* () {
|
|
setIsCreate(true);
|
|
yield handleFormData(true);
|
|
}) }, "\u5F55\u5165\u8BFE\u9898"),
|
|
dataSource: [{ id: "manage", name: `\u8BFE\u9898\u7BA1\u7406` }],
|
|
onChange: (category) => {
|
|
console.log(category);
|
|
}
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { wrap: false, align: "middle", justify: "space-between" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
ui_customization/* CustomTags */.qp,
|
|
{
|
|
title: "\u72B6\u6001",
|
|
className: "mt20",
|
|
dataSource: tags,
|
|
titleWidth: 28,
|
|
value: UrlData.status,
|
|
onChange: (value) => {
|
|
UrlData.status = value;
|
|
UrlData.page = 1;
|
|
setUrlData(__spreadValues({}, UrlData));
|
|
}
|
|
}
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
ui_customization/* CustomInput */.t7,
|
|
{
|
|
style: { width: 329, height: "38px" },
|
|
placeholder: "\u8BF7\u8F93\u5165\u8BFE\u9898\u540D\u79F0/\u6307\u5BFC\u8001\u5E08\u8FDB\u884C\u641C\u7D22",
|
|
value: UrlData.keyword,
|
|
onChange: (value) => {
|
|
UrlData.keyword = value;
|
|
UrlData.page = 1;
|
|
setUrlData(__spreadValues({}, UrlData));
|
|
}
|
|
}
|
|
))), delRows.length + notDelRows.length > 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { wrap: false, align: "middle", justify: "space-between", style: { padding: "11px 12px", background: "#F4F7FC", marginBottom: "1px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, "\u5DF2\u9009\u62E9\xA0", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#165DFF" } }, delRows.length + notDelRows.length || 0), "\xA0\u9879"), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { style: { color: "#E30000", cursor: "pointer" }, onClick: () => {
|
|
const modal = es_modal["default"].confirm({
|
|
title: "\u5220\u9664\u63D0\u793A",
|
|
icon: null,
|
|
maskClosable: true,
|
|
content: /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u786E\u5B9A\u8981\u5220\u9664\u8BFE\u9898\uFF1F\u5220\u9664\u540E\u65E0\u6CD5\u6062\u590D"),
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
onOk: () => __async(void 0, null, function* () {
|
|
if (delRows.length > 0) {
|
|
const res = yield dispatch({
|
|
type: "graduations/getDelGraduationsTasks",
|
|
payload: {
|
|
id: params.id,
|
|
ids: delRows.map((item) => item.id)
|
|
}
|
|
});
|
|
if (res.status == 0) {
|
|
message/* default */.ZP.success("\u6279\u91CF\u5220\u9664\u6210\u529F");
|
|
}
|
|
}
|
|
if (notDelRows.length > 0) {
|
|
delRows.length == 0 && message/* default */.ZP.error("\u65E0\u6CD5\u5220\u9664");
|
|
setDelTopicModal(true);
|
|
}
|
|
setDelRows([]);
|
|
getData();
|
|
modal.destroy();
|
|
}),
|
|
onCancel: () => {
|
|
modal.destroy();
|
|
}
|
|
});
|
|
} }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-piliangshanchu3 mr5" }), "\u6279\u91CF\u5220\u9664")), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
table["default"],
|
|
{
|
|
rowKey: "id",
|
|
loading: loading.effects["graduations/getGraduationsTasks"],
|
|
style: { minHeight: 500 },
|
|
locale: {
|
|
emptyText: /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
NoData/* default */.Z,
|
|
{
|
|
customText: UrlData.status == null && UrlData.keyword == "" && UrlData.page == 1 ? "\u60A8\u5F53\u524D\u8FD8\u6CA1\u6709\u5F55\u5165\u8BFE\u9898\uFF0C\u70B9\u51FB\u5B8C\u6210\u8BFE\u9898\u5F55\u5165" : "\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!",
|
|
ButtonTwo: UrlData.status == null && UrlData.keyword == "" && UrlData.page == 1 ? /* @__PURE__ */ _react_17_0_2_react.createElement(ui_customization/* CustomButton */.op, { openLoading: true, onClick: () => __async(void 0, null, function* () {
|
|
setIsCreate(true);
|
|
yield handleFormData(true);
|
|
}) }, "\u5F55\u5165\u8BFE\u9898") : /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null)
|
|
}
|
|
)
|
|
},
|
|
rowSelection,
|
|
columns,
|
|
dataSource: Tasks.data,
|
|
pagination: false
|
|
}
|
|
), Tasks.count != 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: "mt20 mb20", wrap: false, align: "middle", justify: "space-between" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, "\u5171\xA0", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#165DFF" } }, Tasks.count || 0), "\xA0\u6761\u6570\u636E"), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
pagination/* default */.Z,
|
|
{
|
|
showSizeChanger: true,
|
|
showQuickJumper: true,
|
|
current: UrlData.page,
|
|
pageSize: UrlData.per_page,
|
|
onShowSizeChange: (current, pageSize) => {
|
|
UrlData.per_page = pageSize;
|
|
UrlData.page = 1;
|
|
setUrlData(__spreadValues({}, UrlData));
|
|
},
|
|
onChange: (value) => {
|
|
UrlData.page = value;
|
|
setUrlData(__spreadValues({}, UrlData));
|
|
},
|
|
total: Tasks.count
|
|
}
|
|
))), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_modal["default"],
|
|
{
|
|
open: delTopicModal,
|
|
title: "\u63D0\u793A",
|
|
destroyOnClose: true,
|
|
width: 1200,
|
|
footer: /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { type: "primary", onClick: () => {
|
|
setDelTopicModal(false);
|
|
setnotDelRows([]);
|
|
} }, "\u77E5\u9053\u4E86"),
|
|
onCancel: () => {
|
|
setDelTopicModal(false);
|
|
setnotDelRows([]);
|
|
}
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u4E0B\u9762", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#FA6400" } }, notDelRows.length), "\u4E2A\u8BFE\u9898\u5DF2\u88AB\u5B66\u751F\u9009\u9898\uFF0C\u4E0D\u80FD\u5220\u9664"),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mt10", style: { background: "#F6F7F9", padding: "20px 12px" } }, notDelRows.map((item, index) => /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { wrap: false, align: "middle", key: index, style: { color: "#999" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-guansuo font14" }), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Topicsmodules.Onerow, style: { marginLeft: "8px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { placement: "topLeft", title: item.name }, item.name)))))
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_modal["default"],
|
|
{
|
|
open: topicModal,
|
|
title: `${isCreate ? "\u5F55\u5165\u8BFE\u9898" : "\u7F16\u8F91\u8BFE\u9898"}`,
|
|
width: 1200,
|
|
destroyOnClose: true,
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
centered: true,
|
|
className: "ant-form-modal-body",
|
|
afterOpenChange: (open) => {
|
|
open && document.querySelector(".ant-form-modal-body").querySelector(".ant-modal-body").scrollTo(0, 0);
|
|
},
|
|
onCancel: () => {
|
|
setFormValue({});
|
|
setFileList([]);
|
|
form.resetFields();
|
|
setTopicModal(false);
|
|
},
|
|
onOk: () => {
|
|
form.submit();
|
|
}
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"],
|
|
{
|
|
onFinishFailed: (errInfo) => {
|
|
var _a2;
|
|
if (!(formValue == null ? void 0 : formValue.name) || !((_a2 = formValue == null ? void 0 : formValue.teacher_ids) == null ? void 0 : _a2.length)) {
|
|
domScrollTop(0);
|
|
return;
|
|
}
|
|
if (!(formValue == null ? void 0 : formValue.description) || (formValue == null ? void 0 : formValue.base_project) && !(formValue == null ? void 0 : formValue.graduation_stage_id)) {
|
|
domScrollTop();
|
|
}
|
|
},
|
|
form,
|
|
initialValues: {},
|
|
layout: "vertical",
|
|
className: `${Topicsmodules.FormDiv}`,
|
|
onValuesChange: (changedValues, allValues) => {
|
|
setFormValue(__spreadValues(__spreadValues({}, formValue), changedValues));
|
|
},
|
|
onFinish: (values) => __async(void 0, null, function* () {
|
|
if (!isCreate && rowData.status == 1 && values.student_id != rowData.student_id) {
|
|
es_modal["default"].confirm({
|
|
centered: true,
|
|
okText: "\u786E\u5B9A",
|
|
icon: null,
|
|
cancelText: "\u53D6\u6D88",
|
|
title: "\u53D8\u66F4\u6307\u5B9A\u5B66\u751F",
|
|
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "\u8BE5\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500\u3002\u786E\u8BA4\u53D8\u66F4\u6307\u5B9A\u5B66\u751F\uFF1F\u53D8\u66F4\u540E\u539F\u5B66\u751F\u5728\u8BE5\u8BFE\u9898\u63D0\u4EA4\u7684\u6587\u6863\u5C06\u6E05\u7A7A\u4E14\u65E0\u6CD5\u6062\u590D"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801\u540E\u786E\u8BA4\u5220\u9664"), /* @__PURE__ */ _react_17_0_2_react.createElement(CodeBox/* default */.Z, { ref: (el) => box.current = el })),
|
|
onOk: () => __async(void 0, null, function* () {
|
|
if (box.current.onVerify()) {
|
|
return Promise.reject();
|
|
}
|
|
handleFinish(values);
|
|
})
|
|
});
|
|
} else
|
|
handleFinish(values);
|
|
})
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { htmlFor: null, name: "source_is_repeat", valuePropName: "checked" }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_checkbox["default"], null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#000" } }, "\u8FD1\u4E09\u5E74\u662F\u5426\u91CD\u590D"))),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
htmlFor: null,
|
|
label: /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#5F6368" } }, "\u8BFE\u9898\u540D\u79F0"),
|
|
name: "name",
|
|
rules: [
|
|
{ required: true, message: "\u8BF7\u8F93\u5165\u8BFE\u9898\u540D\u79F0" },
|
|
{ type: "string", max: 100, message: "\u8F93\u5165\u8D85\u9650\uFF0C\u8BF7\u7F29\u51CF\u5B57\u7B26\u6570" },
|
|
{ type: "string", whitespace: true, message: "\u5185\u5BB9\u4E0D\u80FD\u5168\u4E3A\u7A7A\u683C" }
|
|
]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { showCount: true, maxLength: 100, size: "large" })
|
|
),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
htmlFor: null,
|
|
label: /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#5F6368" } }, "\u6307\u5BFC\u8001\u5E08(\u53EF\u591A\u9009)"),
|
|
name: "teacher_ids",
|
|
rules: [{ required: true, message: "\u8BF7\u9009\u62E9\u6307\u5BFC\u8001\u5E08" }]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_select["default"], { size: "large", mode: "multiple", optionFilterProp: "children", placeholder: "\u8BF7\u9009\u62E9\u6307\u5BFC\u8001\u5E08" }, (_a = teachers == null ? void 0 : teachers.data) == null ? void 0 : _a.map((item, index) => /* @__PURE__ */ _react_17_0_2_react.createElement(es_select["default"].Option, { key: index, value: item.id }, item.name)))
|
|
),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
htmlFor: null,
|
|
label: /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#5F6368" } }, "\u8BFE\u9898\u9002\u5408\u4E13\u4E1A"),
|
|
name: "major",
|
|
rules: [{ type: "string", max: 100, message: "\u8F93\u5165\u8D85\u9650\uFF0C\u8BF7\u7F29\u51CF\u5B57\u7B26\u6570" }]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { size: "large", showCount: true, maxLength: 100 })
|
|
),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { htmlFor: null, label: /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#5F6368" } }, "\u6307\u5B9A\u5B66\u751F"), name: "student_id" }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_select["default"], { size: "large", showSearch: true, allowClear: true, optionFilterProp: "children", placeholder: "\u8BF7\u9009\u62E9\u6307\u5B9A\u5B66\u751F" }, (_b = students == null ? void 0 : students.data) == null ? void 0 : _b.map((item, index) => /* @__PURE__ */ _react_17_0_2_react.createElement(es_select["default"].Option, { key: index, value: item.id }, item.name)))),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
htmlFor: null,
|
|
label: /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#5F6368" } }, "\u8BFE\u9898\u6765\u6E90"),
|
|
name: "source",
|
|
rules: [{ type: "string", max: 60, message: "\u8F93\u5165\u8D85\u9650\uFF0C\u8BF7\u7F29\u51CF\u5B57\u7B26\u6570" }]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { size: "large", showCount: true, maxLength: 60 })
|
|
),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
htmlFor: null,
|
|
label: /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#5F6368" } }, "\u8BFE\u9898\u5B66\u79D1\u65B9\u5411"),
|
|
name: "direction",
|
|
rules: [{ type: "string", max: 60, message: "\u8F93\u5165\u8D85\u9650\uFF0C\u8BF7\u7F29\u51CF\u5B57\u7B26\u6570" }]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { size: "large", showCount: true, maxLength: 60 })
|
|
),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
htmlFor: null,
|
|
label: /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#5F6368" } }, "\u8BFE\u9898\u4ECB\u7ECD"),
|
|
name: "description",
|
|
rules: [
|
|
{ required: true, message: "\u8BF7\u8F93\u5165\u8BFE\u9898\u4ECB\u7ECD" },
|
|
{ type: "string", max: 5e3, message: "\u8F93\u5165\u8D85\u9650\uFF0C\u8BF7\u7F29\u51CF\u5B57\u7B26\u6570" },
|
|
{ type: "string", whitespace: true, message: "\u5185\u5BB9\u4E0D\u80FD\u5168\u4E3A\u7A7A\u683C" }
|
|
]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(MdEditorInForm/* MdEditorInForm */.h, { placeholder: "\u8BF7\u5728\u6B64\u8F93\u5165\u5185\u5BB9\uFF0C\u6700\u591A5000\u4E2A\u5B57\u7B26", scrollId: "", watch: true, height: 140 })
|
|
),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
htmlFor: null,
|
|
name: "attachment_ids",
|
|
style: { display: "flex", alignItems: "center" },
|
|
valuePropName: "fileList",
|
|
getValueFromEvent: (e) => {
|
|
if (Array.isArray(e)) {
|
|
return e;
|
|
}
|
|
return e == null ? void 0 : e.fileList;
|
|
},
|
|
normalize: (value) => {
|
|
const uploadNameSizeSeperator = "\u3000\u3000";
|
|
let fileList2 = value.filter((item) => {
|
|
if (item.url)
|
|
return true;
|
|
const fileSize = item.size / 1024 / 1024;
|
|
if (item.name.indexOf(uploadNameSizeSeperator) === -1)
|
|
item.name = `${item.name}${uploadNameSizeSeperator}${(0,util/* bytesToSize */.RD)(item.size)}`;
|
|
if (fileSize > 150 || fileSize == 0)
|
|
return false;
|
|
return true;
|
|
});
|
|
return fileList2;
|
|
}
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(upload["default"], __spreadValues({}, uploadProps), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { style: { width: "100%" }, wrap: false, align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(ui_customization/* CustomButton */.op, { style: { borderRadius: "2px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-shangchuan3 mr5" }), "\u6587\u4EF6\u4E0A\u4F20")), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { style: { marginLeft: "16px", color: "#5F6367" }, onClick: (e) => {
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
} }, "\u4E0A\u4F20\u8BFE\u9898\u76F8\u5173\u6587\u6863\uFF0C\u5355\u4E2A\u6587\u6863\u5927\u5C0F\u4E0D\u8D85\u8FC7150M")))
|
|
),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { wrap: false, align: "middle", className: "mb20" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { htmlFor: null, name: "base_project", valuePropName: "checked", style: { marginBottom: 0 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_switch/* default */.Z, null))), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", className: "ml10", style: { color: "#000" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, "\u57FA\u4E8E\u9879\u76EE\u5B9E\u65BD"), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
tooltip/* default */.Z,
|
|
{
|
|
placement: "right",
|
|
style: { width: "500px" },
|
|
overlayStyle: { maxWidth: 600 },
|
|
title: "\u5F00\u542F\u540E\uFF0C\u5B66\u751F\u5FC5\u987B\u5728\u672C\u5E73\u53F0\u521B\u5EFA\u9879\u76EE\uFF0C\u5173\u8054\u540E\u5C06\u5E94\u7528\u4E8E\u6BD5\u8BBE\u6240\u6709\u9636\u6BB5"
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-tishixiaowenhao ml5", style: { cursor: "pointer", color: "#3061D0" } })
|
|
))),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { id: "graduationstageid" }, formValue.base_project && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { background: "#F6F7F9", padding: "12px 12px 4px 12px", width: "100%", height: 104 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#5F6367" } }, "\u5B66\u751F\u9700\u8981\u5B8C\u6210\u5173\u8054\u9879\u76EE\u7684\u9636\u6BB5"), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { wrap: false, align: "middle", className: "mt15" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { style: { width: "632px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: "graduation_stage_id",
|
|
htmlFor: null,
|
|
style: { marginBottom: 0 },
|
|
rules: [{ required: true, message: "\u8BF7\u9009\u62E9\u5173\u8054\u9879\u76EE\u7684\u9636\u6BB5" }]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_select["default"], null, forTask == null ? void 0 : forTask.map((item, index) => /* @__PURE__ */ _react_17_0_2_react.createElement(es_select["default"].Option, { key: index, value: item.id }, item.name)))
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: "ml20", style: { color: "#999", fontSize: "12px" } }, "\u9009\u62E9\u9636\u6BB5\u540E\uFF0C\u5B66\u751F\u5FC5\u987B\u5728\u5BF9\u5E94\u9636\u6BB5\u5B8C\u6210\u9879\u76EE\u5173\u8054"))))
|
|
)
|
|
));
|
|
};
|
|
/* harmony default export */ var Topics = ((0,_umi_production_exports.connect)(({
|
|
graduations,
|
|
loading
|
|
}) => ({
|
|
graduations,
|
|
loading
|
|
}))(Page));
|
|
|
|
|
|
/***/ })
|
|
|
|
}]); |