@ -0,0 +1,876 @@
|
||||
"use strict";
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[1617],{
|
||||
|
||||
/***/ 88077:
|
||||
/*!******************************************************!*\
|
||||
!*** ./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/input/index.js + 5 modules
|
||||
var input = __webpack_require__(1056);
|
||||
;// 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.3.2@classnames/index.js
|
||||
var _classnames_2_3_2_classnames = __webpack_require__(12124);
|
||||
var _classnames_2_3_2_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_3_2_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;
|
||||
} else if (this.state.value.toLowerCase() === "") {
|
||||
error = true;
|
||||
} 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_3_2_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"
|
||||
}
|
||||
), this.state.showError && /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, !!this.state.value ? "\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u9A8C\u8BC1\u7801" : "\u8BF7\u8F93\u5165\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);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 30713:
|
||||
/*!********************************************************!*\
|
||||
!*** ./src/components/CutOffNow/index.tsx + 1 modules ***!
|
||||
\********************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ CutOffNow; }
|
||||
});
|
||||
|
||||
// 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/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 modal = __webpack_require__(43418);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/date-picker/index.js + 66 modules
|
||||
var date_picker = __webpack_require__(52409);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
||||
var input = __webpack_require__(1056);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
|
||||
var table = __webpack_require__(72315);
|
||||
// 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/_dayjs@1.11.10@dayjs/dayjs.min.js
|
||||
var dayjs_min = __webpack_require__(9498);
|
||||
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
|
||||
// EXTERNAL MODULE: ./src/utils/util.tsx
|
||||
var util = __webpack_require__(3163);
|
||||
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 14 modules
|
||||
var _umi_production_exports = __webpack_require__(87210);
|
||||
;// CONCATENATED MODULE: ./src/components/CutOffNow/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var CutOffNowmodules = ({"tips":"tips___e8J4O","homeworkType":"homeworkType___ZjN2X","antdTable":"antdTable___amDdp","modalWrapper":"modalWrapper___XPojI"});
|
||||
// EXTERNAL MODULE: ./src/service/classrooms.ts
|
||||
var classrooms = __webpack_require__(16560);
|
||||
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/ShixunHomeworks/Detail/components/ConfigWorks/Releasesetting.tsx
|
||||
var Releasesetting = __webpack_require__(75117);
|
||||
;// CONCATENATED MODULE: ./src/components/CutOffNow/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());
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const CuttOffNow = ({
|
||||
dispatch,
|
||||
courseEndTime,
|
||||
classroomList,
|
||||
successCallback = () => {
|
||||
},
|
||||
visible,
|
||||
homeworkIds,
|
||||
courseId,
|
||||
isBatch,
|
||||
shixunHomeworks
|
||||
}) => {
|
||||
const [form] = es_form["default"].useForm();
|
||||
const [tableLoading, setTableLoading] = (0,_react_17_0_2_react.useState)(false);
|
||||
const [confirmLoading, setConfirmLoading] = (0,_react_17_0_2_react.useState)(false);
|
||||
const [noGroup, setNoGroup] = (0,_react_17_0_2_react.useState)(false);
|
||||
const [submitCourseGroups, setSubmitCourseGroups] = (0,_react_17_0_2_react.useState)([]);
|
||||
const [submitCourseTableData, setSubmitCourseTableData] = (0,_react_17_0_2_react.useState)([]);
|
||||
const [selectedSubmitCourseIds, setSelectedSubmitCourseIds] = (0,_react_17_0_2_react.useState)([]);
|
||||
const [lateCourseGroups, setLateCourseGroups] = (0,_react_17_0_2_react.useState)([]);
|
||||
const [lateCourseTableData, setLateCourseTableData] = (0,_react_17_0_2_react.useState)([]);
|
||||
const [selectedLateCourseIds, setSelectedLateCourseIds] = (0,_react_17_0_2_react.useState)([]);
|
||||
const [allCourseGroups, setAllCourseGroups] = (0,_react_17_0_2_react.useState)([]);
|
||||
const [allCourseTableData, setAllCourseTableData] = (0,_react_17_0_2_react.useState)([]);
|
||||
const [selectedAllCourseIds, setSelectedAllCourseIds] = (0,_react_17_0_2_react.useState)([]);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
if (visible) {
|
||||
getData();
|
||||
} else {
|
||||
clear();
|
||||
}
|
||||
}, [visible]);
|
||||
const getData = () => __async(void 0, null, function* () {
|
||||
setTableLoading(true);
|
||||
const res = yield (0,classrooms/* getAllowEndGroups */.oR)(homeworkIds[0], {
|
||||
course_id: courseId
|
||||
});
|
||||
setNoGroup(res.no_group);
|
||||
if (isBatch) {
|
||||
setAllCourseGroups(res.all_course_groups);
|
||||
setAllCourseTableData(res.all_course_groups);
|
||||
} else {
|
||||
setLateCourseGroups(res.late_course_groups);
|
||||
setLateCourseTableData(res.late_course_groups);
|
||||
setSubmitCourseGroups(res.submit_course_groups);
|
||||
setSubmitCourseTableData(res.submit_course_groups);
|
||||
}
|
||||
setTableLoading(false);
|
||||
form.setFieldsValue({
|
||||
"end_time": dayjs_min_default()()
|
||||
});
|
||||
});
|
||||
const handleOk = () => __async(void 0, null, function* () {
|
||||
const formValue = form.getFieldsValue();
|
||||
const endTimeString = dayjs_min_default()(formValue.end_time).format("YYYY-MM-DD HH:mm");
|
||||
const selectNothing = isBatch ? selectedAllCourseIds.length === 0 : selectedSubmitCourseIds.length === 0 && selectedLateCourseIds.length === 0;
|
||||
if (selectNothing && !noGroup) {
|
||||
message/* default */.ZP.warning("\u8BF7\u9009\u62E9\u9700\u8981\u64CD\u4F5C\u7684\u73ED\u7EA7");
|
||||
return;
|
||||
}
|
||||
setConfirmLoading(true);
|
||||
const res = yield (0,classrooms/* stopHomework */.Mc)(courseId, {
|
||||
no_group: noGroup,
|
||||
homework_ids: homeworkIds,
|
||||
group_ids: isBatch ? selectedAllCourseIds : selectedSubmitCourseIds,
|
||||
end_time: endTimeString,
|
||||
late_group_ids: isBatch ? selectedAllCourseIds : selectedLateCourseIds
|
||||
});
|
||||
setConfirmLoading(false);
|
||||
if (res.status === 0) {
|
||||
clear();
|
||||
message/* default */.ZP.success("\u64CD\u4F5C\u6210\u529F");
|
||||
successCallback();
|
||||
dispatch({
|
||||
type: "classroomList/setActionTabs",
|
||||
payload: { key: "\u6E05\u9664\u9009\u62E9\u6570\u636E" }
|
||||
});
|
||||
}
|
||||
});
|
||||
const clear = () => {
|
||||
setSelectedSubmitCourseIds([]);
|
||||
setSelectedLateCourseIds([]);
|
||||
setSubmitCourseTableData([]);
|
||||
setLateCourseTableData([]);
|
||||
};
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
modal["default"],
|
||||
{
|
||||
centered: true,
|
||||
title: "\u7ACB\u5373\u622A\u6B62",
|
||||
className: CutOffNowmodules.modalWrapper,
|
||||
width: isBatch || noGroup ? 520 : 760,
|
||||
open: visible,
|
||||
confirmLoading,
|
||||
destroyOnClose: true,
|
||||
okText: "\u622A\u6B62",
|
||||
cancelText: "\u53D6\u6D88",
|
||||
onOk: () => handleOk(),
|
||||
onCancel: () => {
|
||||
clear();
|
||||
dispatch({
|
||||
type: "classroomList/setActionTabs",
|
||||
payload: {}
|
||||
});
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: CutOffNowmodules.tips }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "1\u3001\u622A\u6B62\u540E\u5B66\u751F\u4E0D\u80FD\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "2\u3001\u672C\u64CD\u4F5C\u53EA\u5BF9\u201C\u63D0\u4EA4\u4E2D\u201D\u3001\u201C\u8865\u4EA4\u4E2D\u201D\u7684\u4F5C\u4E1A\u6709\u6548\u3002")),
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"], { form, layout: "vertical" }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { name: "end_time", label: "\u622A\u6B62\u65F6\u95F4" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
date_picker["default"],
|
||||
{
|
||||
style: { width: "100%" },
|
||||
disabledDate: (current) => (0,Releasesetting/* disabledDate */.Q8)(current, courseEndTime),
|
||||
disabledTime: (current) => (0,Releasesetting/* disabledTime */.d0)(current),
|
||||
placeholder: "\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4",
|
||||
showTime: {
|
||||
format: "HH:mm",
|
||||
defaultValue: dayjs_min_default()((0,util/* HalfPastOne */.U6)(), "HH:mm")
|
||||
},
|
||||
format: "YYYY-MM-DD HH:mm",
|
||||
allowClear: false
|
||||
}
|
||||
))),
|
||||
!noGroup && /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, isBatch ? /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
input["default"],
|
||||
{
|
||||
placeholder: "\u641C\u7D22\u73ED\u7EA7",
|
||||
onChange: (e) => {
|
||||
setAllCourseTableData(
|
||||
allCourseGroups.filter(
|
||||
(item) => item.name.indexOf(e.target.value) > -1
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
table["default"],
|
||||
{
|
||||
style: { marginTop: "10px", height: "300px", overflow: "auto" },
|
||||
className: CutOffNowmodules.antdTable,
|
||||
rowSelection: {
|
||||
type: "checkbox",
|
||||
onChange: (selectedRowKeys) => {
|
||||
setSelectedAllCourseIds(selectedRowKeys);
|
||||
}
|
||||
},
|
||||
rowKey: "id",
|
||||
pagination: false,
|
||||
dataSource: allCourseTableData,
|
||||
loading: tableLoading,
|
||||
columns: [
|
||||
{
|
||||
title: "\u73ED\u7EA7",
|
||||
dataIndex: "name"
|
||||
}
|
||||
]
|
||||
}
|
||||
)) : /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { gutter: 24 }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { span: 14 }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: CutOffNowmodules.homeworkType }, "\u4F5C\u4E1A\u622A\u6B62"), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
input["default"],
|
||||
{
|
||||
placeholder: "\u641C\u7D22\u73ED\u7EA7",
|
||||
onChange: (e) => {
|
||||
setSubmitCourseTableData(
|
||||
submitCourseGroups.filter(
|
||||
(item) => item.name.indexOf(e.target.value) > -1
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: CutOffNowmodules.tableWrapper }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
table["default"],
|
||||
{
|
||||
style: { marginTop: "10px", height: "260px", overflow: "auto" },
|
||||
className: CutOffNowmodules.antdTable,
|
||||
rowSelection: {
|
||||
type: "checkbox",
|
||||
onChange: (selectedRowKeys) => {
|
||||
setSelectedSubmitCourseIds(selectedRowKeys);
|
||||
}
|
||||
},
|
||||
rowKey: "id",
|
||||
pagination: false,
|
||||
dataSource: submitCourseTableData,
|
||||
loading: tableLoading,
|
||||
columns: [
|
||||
{
|
||||
title: "\u73ED\u7EA7",
|
||||
dataIndex: "name",
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: "\u53D1\u5E03\u65F6\u95F4",
|
||||
dataIndex: "publish_time"
|
||||
},
|
||||
{
|
||||
title: "\u622A\u6B62\u65F6\u95F4",
|
||||
dataIndex: "end_time"
|
||||
}
|
||||
]
|
||||
}
|
||||
))), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: 10, style: { maxWidth: "280px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: CutOffNowmodules.homeworkType }, "\u8865\u4EA4\u622A\u6B62"), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
input["default"],
|
||||
{
|
||||
placeholder: "\u641C\u7D22\u73ED\u7EA7",
|
||||
onChange: (e) => {
|
||||
setLateCourseTableData(
|
||||
lateCourseGroups.filter(
|
||||
(item) => item.name.indexOf(e.target.value) > -1
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: CutOffNowmodules.tableWrapper }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
table["default"],
|
||||
{
|
||||
style: { marginTop: "10px", height: "260px", overflow: "auto", maxWidth: "280px" },
|
||||
className: CutOffNowmodules.antdTable,
|
||||
rowSelection: {
|
||||
type: "checkbox",
|
||||
onChange: (selectedRowKeys) => {
|
||||
setSelectedLateCourseIds(selectedRowKeys);
|
||||
}
|
||||
},
|
||||
rowKey: "id",
|
||||
pagination: false,
|
||||
loading: tableLoading,
|
||||
dataSource: lateCourseTableData,
|
||||
columns: [
|
||||
{
|
||||
title: "\u73ED\u7EA7",
|
||||
dataIndex: "name",
|
||||
ellipsis: true,
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: "\u622A\u6B62\u65F6\u95F4",
|
||||
dataIndex: "late_time"
|
||||
}
|
||||
]
|
||||
}
|
||||
)))))
|
||||
);
|
||||
};
|
||||
/* harmony default export */ var CutOffNow = ((0,_umi_production_exports.connect)(
|
||||
({ shixunHomeworks, classroomList }) => ({
|
||||
shixunHomeworks,
|
||||
classroomList
|
||||
})
|
||||
)(CuttOffNow));
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 97282:
|
||||
/*!*****************************************!*\
|
||||
!*** ./src/components/NoData/index.tsx ***!
|
||||
\*****************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
||||
/* harmony import */ var _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/assets/images/icons/nodata.png */ 4977);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd */ 3113);
|
||||
var __defProp = Object.defineProperty;
|
||||
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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
const noData = ({
|
||||
img,
|
||||
buttonProps = {},
|
||||
styles = {},
|
||||
customText,
|
||||
ButtonText,
|
||||
ButtonClick,
|
||||
Buttonclass,
|
||||
ButtonTwo,
|
||||
imgStyles,
|
||||
loading = false
|
||||
}) => {
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
"section",
|
||||
{
|
||||
className: "tc animated fadeIn",
|
||||
style: __spreadValues(__spreadValues({}, { color: "#999", margin: "100px auto", visibility: loading ? "hidden" : "visible" }), styles)
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("img", { src: img || _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_1__, style: __spreadValues({}, imgStyles) }),
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", { className: "mt20 font14" }, customText || "\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),
|
||||
ButtonText && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .ZP, __spreadValues({ className: Buttonclass, onClick: ButtonClick }, buttonProps), ButtonText),
|
||||
ButtonTwo && ButtonTwo
|
||||
);
|
||||
};
|
||||
/* harmony default export */ __webpack_exports__.Z = (noData);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 89038:
|
||||
/*!**********************************************!*\
|
||||
!*** ./src/components/TooltipTags/index.tsx ***!
|
||||
\**********************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd */ 6848);
|
||||
|
||||
|
||||
const TooltipTags = ({
|
||||
value,
|
||||
visible = true,
|
||||
children
|
||||
}) => {
|
||||
const txt = {
|
||||
\u672A\u53D1\u5E03: "\u4F5C\u4E1A\u5C1A\u672A\u53D1\u5E03",
|
||||
\u672A\u5F00\u59CB: "\u4F5C\u4E1A\u5DF2\u53D1\u5E03\uFF0C\u5C1A\u672A\u5230\u8FBE\u5F00\u59CB\u4F5C\u4E1A\u65F6\u95F4",
|
||||
\u63D0\u4EA4\u4E2D: "\u4F5C\u4E1A\u8FDB\u884C\u4E2D\uFF0C\u6240\u6709\u8003\u751F\u53EF\u63D0\u4EA4\u4F5C\u4E1A",
|
||||
\u8865\u4EA4\u4E2D: "\u4F5C\u4E1A\u8FDB\u884C\u4E2D\uFF0C\u6240\u6709\u5B66\u751F\u53EF\u8865\u4EA4\u4F5C\u4E1A",
|
||||
\u8FDB\u884C\u4E2D: "\u4F5C\u4E1A\u8FDB\u884C\u4E2D\uFF0C\u90E8\u5206\u73ED\u7EA7\u6B63\u5728\u4F5C\u4E1A\u63D0\u4EA4\u4E2D/\u8865\u4EA4\u4E2D",
|
||||
\u5DF2\u622A\u6B62: "\u5230\u8FBE\u4F5C\u4E1A\u622A\u6B62\u65F6\u95F4\uFF0C\u4F5C\u4E1A\u5DF2\u7ED3\u675F",
|
||||
\u5DF2\u7ED3\u675F: "\u8BFE\u5802\u5DF2\u7ED3\u675F"
|
||||
};
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, visible ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, { placement: "topLeft", title: txt[value] }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", null, children)) : children);
|
||||
};
|
||||
/* harmony default export */ __webpack_exports__.Z = (TooltipTags);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 98258:
|
||||
/*!*********************************************************************************************!*\
|
||||
!*** ./src/pages/Classrooms/Lists/ShixunHomeworks/components/TrfList/index.tsx + 2 modules ***!
|
||||
\*********************************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ components_TrfList; }
|
||||
});
|
||||
|
||||
// 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/input/index.js + 5 modules
|
||||
var input = __webpack_require__(1056);
|
||||
// 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/row/index.js
|
||||
var row = __webpack_require__(95237);
|
||||
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/ShixunHomeworks/components/TrfList/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var TrfListmodules = ({"leftdiv":"leftdiv___aBzsX","listClass":"listClass___bxIEW","spantitle":"spantitle___v_Vc4","rightdiv":"rightdiv___xWu4M"});
|
||||
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/ShixunHomeworks/components/TrfList/delete.png
|
||||
var delete_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAbVJREFUOE+Nk79rFUEUhb+zE4OFwUD+CyGKKQQbSaMikQQ7C1tBBIsUQaJvl2Fn/cWDpAiIYJsi7YOIaCUWFoKKRhG0sbEzEImFGnev7G6yyXsxeU5159yZb87l3hG9q2WLiBO79FIwXpLp0s6cwITnQCMWrGDM43jdBckZQ0wTMdrong2R2Bxm0/98sZ8ozdcOEm5hjOC41u9Olc9ZQKySclOVkNhljCmCzjeAJM/4FbW5p+8k5tlggTtarfKxLSM6pHq4BTiL0SboaAOIi284jeP1nti+ApMEvdoEvEPMkOpJDZi1IwzwgqDh/wSsYZwk08ca4O0Qua3zW8OV5crmHg6u22EGbQ2nIbx+1IC6rrK+cYJW9gXEVrbxGUEj5bltQGJvgBapHu0LSGwCyEh1vBsQWwd4TNCDPg6uAOcImuoFlL1dJ9WNPg5uYwwRVM3MzhJmKIpjZK6e9bj4jNNpvL4QFx9wuoDXJ1r5IlH0llTtXgcXwa4SolObnYnwKnbFcfEcdJ+gpW6AtzFynuIop/Fn053u4CA5yzjO4FV9tu0Syl2S38WiSWBgD8AfoEPQ7Fb+LwIiyhxWwe2KAAAAAElFTkSuQmCC";
|
||||
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
||||
var NoData = __webpack_require__(97282);
|
||||
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/ShixunHomeworks/components/TrfList/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());
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const TrfList = ({
|
||||
data,
|
||||
value = [],
|
||||
handleChangePage,
|
||||
setSelectedRowKeys,
|
||||
selectedRowKeys,
|
||||
onChange = () => {
|
||||
}
|
||||
}) => {
|
||||
const [leftList, setleftList] = (0,_react_17_0_2_react.useState)([]);
|
||||
const [rightList, setRightList] = (0,_react_17_0_2_react.useState)([]);
|
||||
const [checkoutList, setCheckoutList] = (0,_react_17_0_2_react.useState)([]);
|
||||
let [page, setpage] = (0,_react_17_0_2_react.useState)(1);
|
||||
let [sechar, setsechar] = (0,_react_17_0_2_react.useState)();
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
setleftList(data);
|
||||
setRightList([]);
|
||||
setCheckoutList([]);
|
||||
}, [data]);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
if (setSelectedRowKeys) {
|
||||
setRightList(selectedRowKeys);
|
||||
setCheckoutList(selectedRowKeys);
|
||||
}
|
||||
}, [selectedRowKeys]);
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { display: "flex", justifyContent: "space-between" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: TrfListmodules.leftdiv }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
input["default"].Search,
|
||||
{
|
||||
size: "middle",
|
||||
onChange: (e) => __async(void 0, null, function* () {
|
||||
setleftList(
|
||||
data.filter((item) => {
|
||||
var _a;
|
||||
return (_a = item == null ? void 0 : item.name) == null ? void 0 : _a.includes(e.target.value);
|
||||
})
|
||||
);
|
||||
}),
|
||||
placeholder: "\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"
|
||||
}
|
||||
), leftList.length === 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(NoData/* default */.Z, { styles: { margin: "70px auto" }, customText: "\u6682\u65E0\u5206\u73ED" }), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { height: "85%", overflow: "auto", overflowX: "hidden" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_checkbox["default"].Group,
|
||||
{
|
||||
value: rightList.map((item) => `${item.id}`),
|
||||
onChange: (e) => {
|
||||
setSelectedRowKeys(
|
||||
leftList.filter((item) => e.includes(`${item.id}`))
|
||||
);
|
||||
},
|
||||
style: { marginTop: "10px", flexDirection: "column" }
|
||||
},
|
||||
leftList.map((item, index) => {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
row/* default */.Z,
|
||||
{
|
||||
key: item.id,
|
||||
style: {
|
||||
marginTop: "10px",
|
||||
lineHeight: "24px",
|
||||
display: "flex",
|
||||
width: 200
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_checkbox["default"],
|
||||
{
|
||||
style: {
|
||||
display: "flex",
|
||||
height: "24px",
|
||||
alignItems: "center"
|
||||
},
|
||||
disabled: item.is_published,
|
||||
value: `${item.id}`
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: TrfListmodules.listClass }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"span",
|
||||
{
|
||||
className: TrfListmodules.spantitle,
|
||||
style: { width: item.is_published ? "108px" : "170px" }
|
||||
},
|
||||
item.name
|
||||
), item.is_published && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"span",
|
||||
{
|
||||
style: {
|
||||
width: "52px",
|
||||
height: "24px",
|
||||
background: "#B8B8B8",
|
||||
borderRadius: "13px",
|
||||
color: "white",
|
||||
lineHeight: "24px",
|
||||
textAlign: "center",
|
||||
display: "inline-block"
|
||||
}
|
||||
},
|
||||
"\u5DF2\u53D1\u5E03"
|
||||
))
|
||||
)
|
||||
);
|
||||
})
|
||||
))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: TrfListmodules.rightdiv }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
input["default"].Search,
|
||||
{
|
||||
onChange: (e) => {
|
||||
setCheckoutList(
|
||||
rightList.filter(
|
||||
(item) => item.name.includes(e.target.value)
|
||||
)
|
||||
);
|
||||
},
|
||||
size: "middle",
|
||||
placeholder: "\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"
|
||||
}
|
||||
), checkoutList.length === 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
NoData/* default */.Z,
|
||||
{
|
||||
styles: { margin: "70px auto" },
|
||||
customText: "\u6682\u672A\u9009\u62E9\u5206\u73ED"
|
||||
}
|
||||
), checkoutList.length > 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"div",
|
||||
{
|
||||
style: {
|
||||
marginTop: "10px",
|
||||
height: "85%",
|
||||
overflow: "hidden",
|
||||
position: "relative"
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"div",
|
||||
{
|
||||
style: {
|
||||
overflowX: "hidden",
|
||||
overflowY: "scroll",
|
||||
position: "absolute",
|
||||
left: 0,
|
||||
top: 0,
|
||||
right: -17,
|
||||
bottom: 0
|
||||
}
|
||||
},
|
||||
checkoutList.map((item, index) => {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
row/* default */.Z,
|
||||
{
|
||||
justify: "space-between",
|
||||
style: { marginTop: "10px" },
|
||||
key: item.id
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"div",
|
||||
{
|
||||
style: {
|
||||
overflow: "hidden",
|
||||
whiteSpace: "nowrap",
|
||||
textOverflow: "ellipsis",
|
||||
marginRight: "5px",
|
||||
marginLeft: "5px",
|
||||
width: "75%"
|
||||
}
|
||||
},
|
||||
item.name
|
||||
),
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"img",
|
||||
{
|
||||
src: delete_namespaceObject,
|
||||
style: {
|
||||
cursor: "pointer",
|
||||
height: "16px",
|
||||
marginRight: 17
|
||||
},
|
||||
onClick: () => {
|
||||
setSelectedRowKeys(
|
||||
rightList.filter(
|
||||
(items) => `${items.id}` != `${item.id}`
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
)
|
||||
);
|
||||
})
|
||||
)
|
||||
)));
|
||||
};
|
||||
/* harmony default export */ var components_TrfList = (TrfList);
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
@ -0,0 +1,801 @@
|
||||
"use strict";
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[199],{
|
||||
|
||||
/***/ 10199:
|
||||
/*!*********************************************************!*\
|
||||
!*** ./src/components/QuestionEditor/Buttonloading.tsx ***!
|
||||
\*********************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! umi */ 87210);
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ 59301);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! antd */ 8591);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! antd */ 3113);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! antd */ 43418);
|
||||
/* harmony import */ var js_base64__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! js-base64 */ 24334);
|
||||
/* harmony import */ var js_base64__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(js_base64__WEBPACK_IMPORTED_MODULE_2__);
|
||||
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/utils/fetch */ 87101);
|
||||
/* harmony import */ var _pages_MyProblem_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/pages/MyProblem/service */ 75211);
|
||||
/* harmony import */ var _pages_MyProblem_TestCasePanel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/pages/MyProblem/TestCasePanel */ 24351);
|
||||
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! moment */ 9498);
|
||||
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_6__);
|
||||
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 ButtonLoading = ({ ButtonProps, ButtonText, form, answerKey, hackidentifier = "", items = {} }) => {
|
||||
const [isloading, setisloading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
|
||||
let [identifier, setidentifier] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("");
|
||||
const param = (0,umi__WEBPACK_IMPORTED_MODULE_0__.useParams)();
|
||||
const [modalshow, setmodalshow] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({});
|
||||
const isEdit = param.type === "edit";
|
||||
const type = window.location.href.includes("problemset") ? 1 : 2;
|
||||
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
|
||||
if (isEdit || hackidentifier) {
|
||||
setidentifier(hackidentifier || param.id);
|
||||
}
|
||||
}, [param]);
|
||||
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
|
||||
return () => {
|
||||
sessionStorage.removeItem("projectFill");
|
||||
};
|
||||
}, []);
|
||||
function onUpdateCode(re, id) {
|
||||
return __async(this, null, function* () {
|
||||
var _a;
|
||||
let code = form.getFieldValue("hack_codes");
|
||||
let stats = form.getFieldValue(answerKey);
|
||||
if (!code.code) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP.info("\u7A0B\u5E8F\u4EE3\u7801\u4E0D\u80FD\u4E3A\u7A7A\uFF01");
|
||||
return;
|
||||
}
|
||||
if (!code.language) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP.info("\u7F16\u7A0B\u8BED\u8A00\u4E0D\u80FD\u4E3A\u7A7A\uFF01");
|
||||
return;
|
||||
}
|
||||
if (stats.length > 0 && ((_a = stats.filter((item) => !item.answer_text)) == null ? void 0 : _a.length) > 0) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP.info("\u586B\u7A7A\u9879\u4E0D\u80FD\u4E3A\u7A7A\uFF01");
|
||||
return;
|
||||
}
|
||||
let codes = code.code;
|
||||
if (stats.length > 0) {
|
||||
stats == null ? void 0 : stats.map((item) => {
|
||||
if (item.multi_line) {
|
||||
codes = codes.substring(0, codes.indexOf("@\u2581\u2581@")) + item.answer_text + codes.substring(codes.indexOf("@\u2581\u2581@") + 4);
|
||||
} else {
|
||||
codes = codes.substring(0, codes.indexOf("@\u2581@")) + item.answer_text + codes.substring(codes.indexOf("@\u2581@") + 3);
|
||||
}
|
||||
});
|
||||
}
|
||||
const response = yield (0,_pages_MyProblem_service__WEBPACK_IMPORTED_MODULE_4__/* .updateCode */ .n4)(id, re ? re : { code: js_base64__WEBPACK_IMPORTED_MODULE_2__.Base64.encode(codes), language: code.language });
|
||||
return response;
|
||||
});
|
||||
}
|
||||
function onUpdateCodes(re, id) {
|
||||
return __async(this, null, function* () {
|
||||
var _a;
|
||||
let stats = items.userAnswer;
|
||||
let codes = js_base64__WEBPACK_IMPORTED_MODULE_2__.Base64.decode(items.code);
|
||||
if (stats.length > 0 && ((_a = stats.filter((item) => !item.value)) == null ? void 0 : _a.length) > 0) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP.info("\u586B\u7A7A\u9879\u4E0D\u80FD\u4E3A\u7A7A\uFF01");
|
||||
return;
|
||||
}
|
||||
if (stats.length > 0) {
|
||||
stats == null ? void 0 : stats.map((item) => {
|
||||
if (item.multi_line) {
|
||||
codes = codes.substring(0, codes.indexOf("@\u2581\u2581@")) + item.value + codes.substring(codes.indexOf("@\u2581\u2581@") + 4);
|
||||
} else {
|
||||
codes = codes.substring(0, codes.indexOf("@\u2581@")) + item.value + codes.substring(codes.indexOf("@\u2581@") + 3);
|
||||
}
|
||||
});
|
||||
}
|
||||
const response = yield (0,_pages_MyProblem_service__WEBPACK_IMPORTED_MODULE_4__/* .updateCode */ .n4)(id, re ? re : { code: js_base64__WEBPACK_IMPORTED_MODULE_2__.Base64.encode(codes), language: items.language });
|
||||
return response;
|
||||
});
|
||||
}
|
||||
function getTimeStamp() {
|
||||
return (/* @__PURE__ */ new Date()).getTime();
|
||||
}
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(antd__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .ZP, __spreadProps(__spreadValues({ loading: isloading }, ButtonProps), { onClick: () => __async(void 0, null, function* () {
|
||||
var _a, _b, _c, _d;
|
||||
if (ButtonText === "\u8FD0\u884C\u8C03\u8BD5") {
|
||||
setisloading(true);
|
||||
if (isloading) {
|
||||
return;
|
||||
}
|
||||
let res12 = yield (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP)(`/api/problems/${identifier}/start.json`, {
|
||||
method: "get"
|
||||
});
|
||||
const response2 = yield onUpdateCodes(null, res12 == null ? void 0 : res12.identifier);
|
||||
if ((response2 == null ? void 0 : response2.status) === 0) {
|
||||
const startTime = getTimeStamp();
|
||||
yield (0,_pages_MyProblem_service__WEBPACK_IMPORTED_MODULE_4__/* .sumbitCode */ .bM)(res12 == null ? void 0 : res12.identifier, {});
|
||||
function executeCode() {
|
||||
return __async(this, null, function* () {
|
||||
const { status, message: message2, data } = yield (0,_pages_MyProblem_service__WEBPACK_IMPORTED_MODULE_4__/* .getOperationResult */ .rX)(res12 == null ? void 0 : res12.identifier, "submit");
|
||||
const executeTime = getTimeStamp();
|
||||
const isTimeOut = executeTime - startTime > 6 * 1e3;
|
||||
if (status !== 0 && !isTimeOut) {
|
||||
setTimeout(executeCode, 1e3);
|
||||
}
|
||||
if (isTimeOut) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_9__["default"].error({
|
||||
centered: true,
|
||||
okText: "\u77E5\u9053\u5566",
|
||||
title: "\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"
|
||||
});
|
||||
setisloading(false);
|
||||
return;
|
||||
}
|
||||
if (status === 0) {
|
||||
setisloading(false);
|
||||
setmodalshow(data);
|
||||
if (data.status === 2) {
|
||||
setisloading(false);
|
||||
antd__WEBPACK_IMPORTED_MODULE_9__["default"].error({
|
||||
centered: true,
|
||||
okText: "\u77E5\u9053\u5566",
|
||||
title: "\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
executeCode();
|
||||
} else {
|
||||
setisloading(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
let aa = true;
|
||||
yield form.validateFields().then(() => {
|
||||
aa = false;
|
||||
}, (errInfo) => {
|
||||
var _a2, _b2, _c2;
|
||||
if (errInfo.errorFields[0].name.includes("standard_answers")) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP.error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A");
|
||||
} else {
|
||||
antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP.error(errInfo.errorFields[0].errors[0]);
|
||||
}
|
||||
if (((_a2 = errInfo.errorFields) == null ? void 0 : _a2.length) === 0) {
|
||||
aa = false;
|
||||
}
|
||||
form.scrollToField((_c2 = (_b2 = errInfo == null ? void 0 : errInfo.errorFields) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.name, { behavior: "smooth", block: "center" });
|
||||
aa = true;
|
||||
});
|
||||
if (aa) {
|
||||
return;
|
||||
}
|
||||
setisloading(true);
|
||||
if (isloading) {
|
||||
return;
|
||||
}
|
||||
let res = "";
|
||||
let formValues = form.getFieldsValue();
|
||||
if (!identifier) {
|
||||
res = yield (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP)(`/api/problems.json`, {
|
||||
method: "post",
|
||||
body: __spreadProps(__spreadValues({}, formValues), {
|
||||
hack: __spreadProps(__spreadValues({}, formValues == null ? void 0 : formValues.hack), {
|
||||
sub_discipline_id: (_b = (_a = formValues == null ? void 0 : formValues.hack) == null ? void 0 : _a.sub_discipline_id) == null ? void 0 : _b[1],
|
||||
difficult: formValues.difficulty,
|
||||
item_banks_group_id: formValues.item_banks_group_id
|
||||
}),
|
||||
hack_codes: __spreadProps(__spreadValues({}, formValues.hack_codes), {
|
||||
code: js_base64__WEBPACK_IMPORTED_MODULE_2__.Base64.encode(formValues.hack_codes.code)
|
||||
}),
|
||||
hack_sets: [__spreadValues({}, formValues.hack_sets)],
|
||||
is_blank: true
|
||||
})
|
||||
});
|
||||
identifier = res == null ? void 0 : res.identifier;
|
||||
sessionStorage.projectFill = identifier;
|
||||
setidentifier(identifier);
|
||||
} else {
|
||||
res = yield (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP)(`/api/problems/${identifier}.json`, {
|
||||
method: "put",
|
||||
body: __spreadProps(__spreadValues({}, formValues), {
|
||||
hack: __spreadProps(__spreadValues({}, formValues == null ? void 0 : formValues.hack), {
|
||||
sub_discipline_id: (_d = (_c = formValues == null ? void 0 : formValues.hack) == null ? void 0 : _c.sub_discipline_id) == null ? void 0 : _d[1],
|
||||
difficult: formValues.difficulty,
|
||||
item_banks_group_id: formValues.item_banks_group_id
|
||||
}),
|
||||
hack_codes: __spreadProps(__spreadValues({}, formValues.hack_codes), {
|
||||
code: js_base64__WEBPACK_IMPORTED_MODULE_2__.Base64.encode(formValues.hack_codes.code)
|
||||
}),
|
||||
update_hack_sets: [__spreadValues({}, formValues.hack_sets)],
|
||||
is_blank: true
|
||||
})
|
||||
});
|
||||
}
|
||||
let res1 = yield (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP)(`/api/problems/${identifier}/start.json`, {
|
||||
method: "get"
|
||||
});
|
||||
const response = yield onUpdateCode(null, res1 == null ? void 0 : res1.identifier);
|
||||
if ((response == null ? void 0 : response.status) === 0) {
|
||||
const startTime = getTimeStamp();
|
||||
yield (0,_pages_MyProblem_service__WEBPACK_IMPORTED_MODULE_4__/* .sumbitCode */ .bM)(res1 == null ? void 0 : res1.identifier, {});
|
||||
function executeCode() {
|
||||
return __async(this, null, function* () {
|
||||
const { status, message: message2, data } = yield (0,_pages_MyProblem_service__WEBPACK_IMPORTED_MODULE_4__/* .getOperationResult */ .rX)(res1 == null ? void 0 : res1.identifier, "submit");
|
||||
const executeTime = getTimeStamp();
|
||||
const isTimeOut = executeTime - startTime > (formValues.hack.time_limit + 3) * 1e3;
|
||||
if (status !== 0 && !isTimeOut) {
|
||||
setTimeout(executeCode, 1e3);
|
||||
}
|
||||
if (isTimeOut) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_9__["default"].error({
|
||||
centered: true,
|
||||
okText: "\u77E5\u9053\u5566",
|
||||
title: "\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"
|
||||
});
|
||||
setisloading(false);
|
||||
return;
|
||||
}
|
||||
if (status === 0) {
|
||||
setisloading(false);
|
||||
setmodalshow(data);
|
||||
if (data.status === 2) {
|
||||
setisloading(false);
|
||||
antd__WEBPACK_IMPORTED_MODULE_9__["default"].error({
|
||||
centered: true,
|
||||
okText: "\u77E5\u9053\u5566",
|
||||
title: "\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
executeCode();
|
||||
} else {
|
||||
setisloading(false);
|
||||
}
|
||||
}) }), ButtonText), (modalshow == null ? void 0 : modalshow.id) && modalshow.status !== 2 && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_9__["default"],
|
||||
{
|
||||
open: (modalshow == null ? void 0 : modalshow.id) && modalshow.status !== 2,
|
||||
title: "\u8FD0\u884C\u7ED3\u679C",
|
||||
width: 1100,
|
||||
footer: false,
|
||||
onOk: () => {
|
||||
setmodalshow({});
|
||||
},
|
||||
onCancel: () => {
|
||||
setmodalshow({});
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", { style: { maxHeight: 600, overflow: "auto", marginBottom: 15 } }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", { style: { marginBottom: 20, display: "flex", justifyContent: "space-between", fontSize: 14 } }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("span", { style: { color: "#666666" } }, "\u72B6\u6001"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("span", { style: { marginLeft: 12, color: modalshow.status !== 0 && "#E30000" } }, _pages_MyProblem_TestCasePanel__WEBPACK_IMPORTED_MODULE_5__/* .ExecuteDict */ .Im[modalshow.status])), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("span", { style: { color: "#666666" } }, "\u63D0\u4EA4\u65F6\u95F4"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("span", { style: { marginLeft: 12 } }, moment__WEBPACK_IMPORTED_MODULE_6___default()(modalshow.created_at).format("YYYY-MM-DD HH:mm:ss"))), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("span", { style: { color: "#666666" } }, "\u8BED\u8A00"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("span", { style: { marginLeft: 12 } }, modalshow.language)), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("span", { style: { color: "#666666" } }, "\u6267\u884C\u7528\u65F6"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("span", { style: { marginLeft: 12 } }, modalshow.execute_time, "ms"))), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(
|
||||
_pages_MyProblem_TestCasePanel__WEBPACK_IMPORTED_MODULE_5__/* .DetailCommitOut */ .Y4,
|
||||
__spreadValues({}, modalshow)
|
||||
))
|
||||
));
|
||||
};
|
||||
/* harmony default export */ __webpack_exports__.Z = (ButtonLoading);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 14147:
|
||||
/*!******************************************************!*\
|
||||
!*** ./src/components/Spinner/index.tsx + 1 modules ***!
|
||||
\******************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ Spinner; }
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
||||
var _react_17_0_2_react = __webpack_require__(59301);
|
||||
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 14 modules
|
||||
var _umi_production_exports = __webpack_require__(87210);
|
||||
;// CONCATENATED MODULE: ./src/components/Spinner/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var Spinnermodules = ({"ldsRing":"ldsRing___mpBZC","idsRingWrapper":"idsRingWrapper___Of9_n","ldsring":"ldsring___o0w2t"});
|
||||
;// CONCATENATED MODULE: ./src/components/Spinner/index.tsx
|
||||
|
||||
|
||||
|
||||
/* harmony default export */ var Spinner = (({ message, className, children, style = {} }) => {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${Spinnermodules.idsRingWrapper} ${className}` }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Spinnermodules.ldsRing }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null)), message ? /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style }, message) : null, /* @__PURE__ */ _react_17_0_2_react.createElement(_umi_production_exports.Outlet, null));
|
||||
});
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 24351:
|
||||
/*!*****************************************************************!*\
|
||||
!*** ./src/pages/MyProblem/TestCasePanel/index.tsx + 1 modules ***!
|
||||
\*****************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Y4: function() { return /* binding */ DetailCommitOut; },
|
||||
Im: function() { return /* binding */ ExecuteDict; },
|
||||
ZP: function() { return /* binding */ TestCasePanel; }
|
||||
});
|
||||
|
||||
// UNUSED EXPORTS: getCommitOut
|
||||
|
||||
// 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/input/index.js + 5 modules
|
||||
var input = __webpack_require__(1056);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
||||
var es_button = __webpack_require__(3113);
|
||||
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/DownOutlined.js + 1 modules
|
||||
var DownOutlined = __webpack_require__(42884);
|
||||
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/UpOutlined.js + 1 modules
|
||||
var UpOutlined = __webpack_require__(20114);
|
||||
// EXTERNAL MODULE: ./src/pages/MyProblem/interface.ts
|
||||
var MyProblem_interface = __webpack_require__(71984);
|
||||
// EXTERNAL MODULE: ./node_modules/_js-base64@2.6.4@js-base64/base64.js
|
||||
var base64 = __webpack_require__(24334);
|
||||
;// CONCATENATED MODULE: ./src/pages/MyProblem/TestCasePanel/index.less
|
||||
// extracted by mini-css-extract-plugin
|
||||
|
||||
// EXTERNAL MODULE: ./src/components/Spinner/index.tsx + 1 modules
|
||||
var Spinner = __webpack_require__(14147);
|
||||
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 1 modules
|
||||
var RenderHtml = __webpack_require__(12586);
|
||||
// EXTERNAL MODULE: ./src/utils/util.tsx
|
||||
var util = __webpack_require__(3163);
|
||||
// EXTERNAL MODULE: ./node_modules/_xterm@4.8.1@xterm/lib/xterm.js
|
||||
var xterm = __webpack_require__(34376);
|
||||
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
||||
var utils_fetch = __webpack_require__(87101);
|
||||
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 14 modules
|
||||
var _umi_production_exports = __webpack_require__(87210);
|
||||
;// CONCATENATED MODULE: ./src/pages/MyProblem/TestCasePanel/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 { TextArea } = input["default"];
|
||||
|
||||
|
||||
|
||||
|
||||
const initialState = {
|
||||
visible: false,
|
||||
tabIndex: "0"
|
||||
};
|
||||
const ExecuteDict = {
|
||||
[MyProblem_interface/* ExecuteStatus */.h.NOMATCH]: "\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D",
|
||||
[MyProblem_interface/* ExecuteStatus */.h.OK]: "\u8C03\u8BD5\u901A\u8FC7",
|
||||
2: "\u8C03\u8BD5\u8D85\u65F6",
|
||||
3: "\u8C03\u8BD5pod\u5931\u8D25",
|
||||
4: "\u7F16\u8BD1\u5931\u8D25",
|
||||
5: "\u6267\u884C\u5931\u8D25"
|
||||
};
|
||||
var Types = /* @__PURE__ */ ((Types2) => {
|
||||
Types2[Types2["SET_VISIBLE"] = 0] = "SET_VISIBLE";
|
||||
Types2[Types2["SET_TABINDEX"] = 1] = "SET_TABINDEX";
|
||||
return Types2;
|
||||
})(Types || {});
|
||||
function Reducer(state, action) {
|
||||
switch (action.type) {
|
||||
case 0 /* SET_VISIBLE */:
|
||||
return __spreadProps(__spreadValues({}, state), { visible: action.payload });
|
||||
case 1 /* SET_TABINDEX */:
|
||||
return __spreadProps(__spreadValues({}, state), { tabIndex: action.payload });
|
||||
default:
|
||||
throw new Error();
|
||||
}
|
||||
}
|
||||
function DetailCommitOut(debugResult) {
|
||||
const { status, error_msg, output, input, expected_output, is_file, input_file_url, output_file_url, expected_output_file_url, setMonacoValue, setData } = debugResult;
|
||||
const outputRef = (0,_react_17_0_2_react.useRef)();
|
||||
const inputRef = (0,_react_17_0_2_react.useRef)();
|
||||
const expectedOutputRef = (0,_react_17_0_2_react.useRef)();
|
||||
let rs = null;
|
||||
const mdStyle = {
|
||||
minHeight: 150,
|
||||
marginBottom: 10,
|
||||
paddingLeft: 24,
|
||||
background: "#070f19",
|
||||
color: "#fff"
|
||||
};
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
if (output && !is_file && outputRef.current) {
|
||||
const term = new xterm.Terminal({
|
||||
fontSize: 14,
|
||||
letterSpacing: 1,
|
||||
cols: 83,
|
||||
rows: 10
|
||||
});
|
||||
term.open(outputRef.current);
|
||||
const actual_output_format = (0,util/* findEndWhitespace */.pp)(base64.Base64.decode(output));
|
||||
term.write(actual_output_format);
|
||||
term.setOption("theme", {
|
||||
background: "#1e1e1e"
|
||||
});
|
||||
}
|
||||
if (input && !is_file && inputRef.current) {
|
||||
const term2 = new xterm.Terminal({
|
||||
fontSize: 14,
|
||||
letterSpacing: 1,
|
||||
cols: 83,
|
||||
rows: 10
|
||||
});
|
||||
term2.open(inputRef.current);
|
||||
term2.write((0,util/* findEndWhitespace */.pp)(input));
|
||||
term2.setOption("theme", {
|
||||
background: "#1e1e1e"
|
||||
});
|
||||
}
|
||||
if (expected_output && !is_file && expectedOutputRef.current) {
|
||||
const term3 = new xterm.Terminal({
|
||||
fontSize: 14,
|
||||
letterSpacing: 1,
|
||||
cols: 83,
|
||||
rows: 10
|
||||
});
|
||||
term3.open(expectedOutputRef.current);
|
||||
term3.write((0,util/* findEndWhitespace */.pp)(base64.Base64.decode(expected_output)));
|
||||
term3.setOption("theme", {
|
||||
background: "#1e1e1e"
|
||||
});
|
||||
}
|
||||
}, [output]);
|
||||
switch (status) {
|
||||
case MyProblem_interface/* ExecuteStatus */.h.NOMATCH:
|
||||
rs = /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "c-red" }, "\u5B9E\u9645\u8F93\u5165\uFF1A"), !is_file && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { ref: inputRef }), is_file && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: mdStyle }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"a",
|
||||
{
|
||||
style: { fontSize: "16px" },
|
||||
onClick: () => __async(this, null, function* () {
|
||||
const res = yield fetch(input_file_url, {
|
||||
method: "Get",
|
||||
headers: {
|
||||
"Content-Type": "application/octet-stream",
|
||||
"Accept": "*/*"
|
||||
}
|
||||
});
|
||||
setMonacoValue(yield res.text());
|
||||
setTimeout(() => {
|
||||
setData(input_file_url);
|
||||
}, 200);
|
||||
})
|
||||
},
|
||||
input
|
||||
)), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "c-red" }, "\u5B9E\u9645\u8F93\u51FA\uFF1A"), !is_file && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { ref: outputRef }), is_file && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: mdStyle }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"a",
|
||||
{
|
||||
style: { fontSize: "16px" },
|
||||
onClick: () => __async(this, null, function* () {
|
||||
const res = yield (0,utils_fetch/* default */.ZP)(output_file_url, {
|
||||
method: "Get",
|
||||
headers: {
|
||||
"Content-Type": "application/xml",
|
||||
"Accept": "*/*"
|
||||
}
|
||||
});
|
||||
setMonacoValue(res);
|
||||
setTimeout(() => {
|
||||
setData(output_file_url);
|
||||
}, 200);
|
||||
})
|
||||
},
|
||||
output
|
||||
)), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "c-red" }, "\u9884\u671F\u8F93\u51FA\uFF1A"), !is_file && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { ref: expectedOutputRef }), is_file && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: mdStyle }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"a",
|
||||
{
|
||||
style: { fontSize: "16px" },
|
||||
onClick: () => __async(this, null, function* () {
|
||||
const res = yield fetch(expected_output_file_url, {
|
||||
method: "Get",
|
||||
headers: {
|
||||
"Content-Type": "application/octet-stream",
|
||||
"Accept": "*/*"
|
||||
}
|
||||
});
|
||||
setMonacoValue(yield res.text());
|
||||
setTimeout(() => {
|
||||
setData(expected_output_file_url);
|
||||
}, 200);
|
||||
})
|
||||
},
|
||||
expected_output
|
||||
)));
|
||||
break;
|
||||
case MyProblem_interface/* ExecuteStatus */.h.EXECUTEFAILURE:
|
||||
rs = /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { border: "1px #F6F7F9 solid" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { width: "100%", height: 40, background: "#F6F7F9", lineHeight: "40px", color: "#666666", paddingLeft: "12px" } }, "\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"), !is_file && /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: input, style: mdStyle }), is_file && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: mdStyle }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"a",
|
||||
{
|
||||
onClick: () => (0,util/* download */.LR)(input_file_url, input)
|
||||
},
|
||||
input
|
||||
))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { border: "1px #F6F7F9 solid", marginTop: "10px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { width: "100%", height: 40, background: "#F6F7F9", lineHeight: "40px", color: "#666666", paddingLeft: "12px" } }, "\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement("pre", { className: "error", style: { color: "#E30000", padding: "0 10px" } }, base64.Base64.decode(error_msg), "111")));
|
||||
break;
|
||||
case MyProblem_interface/* ExecuteStatus */.h.COMPILEFAILURE:
|
||||
rs = /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"), !is_file && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { ref: inputRef }), is_file && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: mdStyle }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"a",
|
||||
{
|
||||
onClick: () => (0,util/* download */.LR)(input_file_url, input)
|
||||
},
|
||||
input
|
||||
)), /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement("pre", { className: "error" }, base64.Base64.decode(error_msg)));
|
||||
break;
|
||||
case MyProblem_interface/* ExecuteStatus */.h.PODFAILURE:
|
||||
rs = /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");
|
||||
break;
|
||||
case MyProblem_interface/* ExecuteStatus */.h.TIMEOUT:
|
||||
rs = /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");
|
||||
break;
|
||||
}
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, " ", rs, " ");
|
||||
}
|
||||
function getCommitOut(debugResult) {
|
||||
const { status, error_msg, execute_time, output, input, expected_output, is_file, input_file_url, output_file_url, expected_output_file_url } = debugResult;
|
||||
let rs = null;
|
||||
switch (status) {
|
||||
case MyProblem_interface/* ExecuteStatus */.h.OK:
|
||||
rs = /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "\u6267\u884C\u7528\u65F6\uFF1A", execute_time / 1e3, "\u79D2"), /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "\u6267\u884C\u7ED3\u679C\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement("pre", null, base64.Base64.decode(output)));
|
||||
break;
|
||||
case MyProblem_interface/* ExecuteStatus */.h.NOMATCH:
|
||||
rs = /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "\u8F93\u5165\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement("pre", null, input)), /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "\u8F93\u51FA\uFF1A", output && base64.Base64.decode(output)), /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "\u9884\u671F\u8F93\u51FA\uFF1A", expected_output && base64.Base64.decode(expected_output)));
|
||||
break;
|
||||
case MyProblem_interface/* ExecuteStatus */.h.EXECUTEFAILURE:
|
||||
rs = /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement("pre", null, input)), /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement("pre", { className: "error" }, base64.Base64.decode(error_msg)));
|
||||
break;
|
||||
case MyProblem_interface/* ExecuteStatus */.h.COMPILEFAILURE:
|
||||
rs = /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement("pre", null, input)), /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement("pre", { className: "error" }, base64.Base64.decode(error_msg)));
|
||||
break;
|
||||
case MyProblem_interface/* ExecuteStatus */.h.PODFAILURE:
|
||||
rs = /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");
|
||||
break;
|
||||
case MyProblem_interface/* ExecuteStatus */.h.TIMEOUT:
|
||||
rs = /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");
|
||||
break;
|
||||
}
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, " ", rs, " ");
|
||||
}
|
||||
/* harmony default export */ var TestCasePanel = (({ input, debuging, submitting, executingMessage, debugResult, onChangeInput, onDebugCode, onSubmitCode, hack, user }) => {
|
||||
const [state, dispatch] = (0,_react_17_0_2_react.useReducer)(Reducer, initialState);
|
||||
const { visible, tabIndex } = state;
|
||||
const [searchParams] = (0,_umi_production_exports.useSearchParams)();
|
||||
function onTabIndexChange(e) {
|
||||
let id = e.target.id;
|
||||
dispatch({
|
||||
type: 1 /* SET_TABINDEX */,
|
||||
payload: id
|
||||
});
|
||||
}
|
||||
function onTriggerCollapse() {
|
||||
dispatch({
|
||||
type: 0 /* SET_VISIBLE */,
|
||||
payload: !visible
|
||||
});
|
||||
}
|
||||
const executeResult = (0,_react_17_0_2_react.useMemo)(() => {
|
||||
if (debugResult) {
|
||||
const { status } = debugResult;
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, getCommitOut(debugResult));
|
||||
}
|
||||
return null;
|
||||
}, [debugResult]);
|
||||
function onDebug() {
|
||||
dispatch({
|
||||
type: 0 /* SET_VISIBLE */,
|
||||
payload: true
|
||||
});
|
||||
dispatch({
|
||||
type: 1 /* SET_TABINDEX */,
|
||||
payload: "1"
|
||||
});
|
||||
onDebugCode();
|
||||
}
|
||||
const skip = (text) => __async(void 0, null, function* () {
|
||||
let res = yield (0,utils_fetch/* default */.ZP)(`/api/problems/${text}/start.json`, {
|
||||
method: "get",
|
||||
params: {
|
||||
hack_user_id: user == null ? void 0 : user.user_id
|
||||
}
|
||||
});
|
||||
if (res) {
|
||||
window.location.href = `/myproblems/${res == null ? void 0 : res.identifier}?type=1`;
|
||||
}
|
||||
});
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "test-case-panel" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `test-case-panel-body ${visible ? "active" : ""}` }, /* @__PURE__ */ _react_17_0_2_react.createElement("ul", { className: "s-navs" }, /* @__PURE__ */ _react_17_0_2_react.createElement("li", null, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { className: tabIndex === "0" ? "active" : "", id: "0", onClick: onTabIndexChange }, "\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")), /* @__PURE__ */ _react_17_0_2_react.createElement("li", null, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { className: tabIndex === "1" ? "active" : "", id: "1", onClick: onTabIndexChange }, "\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `tab-panel-body ${tabIndex === "0" ? "" : "hide"}` }, /* @__PURE__ */ _react_17_0_2_react.createElement(TextArea, { placeholder: "\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D", value: input, onChange: onChangeInput })), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `tab-panel-body ${tabIndex === "1" ? "" : "hide"}` }, debuging ? /* @__PURE__ */ _react_17_0_2_react.createElement(Spinner/* default */.Z, { message: executingMessage }) : debugResult ? /* @__PURE__ */ _react_17_0_2_react.createElement("section", { style: { height: 200 } }, " ", executeResult, " ") : /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "tip" }, "\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D"))), /* @__PURE__ */ _react_17_0_2_react.createElement("a", { className: `btn-collapse ${visible ? "up" : ""}`, onClick: onTriggerCollapse }, visible ? /* @__PURE__ */ _react_17_0_2_react.createElement(DownOutlined/* default */.Z, null) : /* @__PURE__ */ _react_17_0_2_react.createElement(UpOutlined/* default */.Z, null)), /* @__PURE__ */ _react_17_0_2_react.createElement("footer", { className: "footer" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u63A7\u5236\u53F0"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "flex-container" }, (hack == null ? void 0 : hack.is_program) && (hack == null ? void 0 : hack.above_question) && /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { onClick: () => skip(hack == null ? void 0 : hack.above_question), id: "oj-prev", className: "btn-blue", type: "ghost" }, "\u4E0A\u4E00\u9898"), (hack == null ? void 0 : hack.is_program) && (hack == null ? void 0 : hack.under_question) && /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { onClick: () => skip(hack == null ? void 0 : hack.under_question), id: "oj-next", className: "btn-blue", type: "ghost" }, "\u4E0B\u4E00\u9898"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { className: "btn-green", type: "ghost", loading: debuging, onClick: onDebug }, "\u8C03\u8BD5\u4EE3\u7801"), searchParams.get("qtype") !== "8" && /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { type: "primary", className: "custom-ant-disabled", loading: submitting, disabled: submitting, onClick: () => {
|
||||
dispatch({
|
||||
type: 0 /* SET_VISIBLE */,
|
||||
payload: false
|
||||
});
|
||||
onSubmitCode();
|
||||
} }, "\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))));
|
||||
});
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 71984:
|
||||
/*!******************************************!*\
|
||||
!*** ./src/pages/MyProblem/interface.ts ***!
|
||||
\******************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ h: function() { return /* binding */ ExecuteStatus; }
|
||||
/* harmony export */ });
|
||||
var ExecuteStatus = /* @__PURE__ */ ((ExecuteStatus2) => {
|
||||
ExecuteStatus2[ExecuteStatus2["NOMATCH"] = -1] = "NOMATCH";
|
||||
ExecuteStatus2[ExecuteStatus2["OK"] = 0] = "OK";
|
||||
ExecuteStatus2[ExecuteStatus2["TIMEOUT"] = 2] = "TIMEOUT";
|
||||
ExecuteStatus2[ExecuteStatus2["PODFAILURE"] = 3] = "PODFAILURE";
|
||||
ExecuteStatus2[ExecuteStatus2["COMPILEFAILURE"] = 4] = "COMPILEFAILURE";
|
||||
ExecuteStatus2[ExecuteStatus2["EXECUTEFAILURE"] = 5] = "EXECUTEFAILURE";
|
||||
return ExecuteStatus2;
|
||||
})(ExecuteStatus || {});
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 75211:
|
||||
/*!****************************************!*\
|
||||
!*** ./src/pages/MyProblem/service.ts ***!
|
||||
\****************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ H7: function() { return /* binding */ resetCode; },
|
||||
/* harmony export */ MK: function() { return /* binding */ addNotes; },
|
||||
/* harmony export */ MU: function() { return /* binding */ debugCode; },
|
||||
/* harmony export */ X6: function() { return /* binding */ getRecordDetail; },
|
||||
/* harmony export */ bM: function() { return /* binding */ sumbitCode; },
|
||||
/* harmony export */ fi: function() { return /* binding */ syncCode; },
|
||||
/* harmony export */ fu: function() { return /* binding */ getProgrammingTopic; },
|
||||
/* harmony export */ n4: function() { return /* binding */ updateCode; },
|
||||
/* harmony export */ rX: function() { return /* binding */ getOperationResult; },
|
||||
/* harmony export */ vl: function() { return /* binding */ triggerPlus; },
|
||||
/* harmony export */ zO: function() { return /* binding */ getSubmitRecords; }
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var _utils_fetch_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/utils/fetch.ts */ 87101);
|
||||
var __defProp = Object.defineProperty;
|
||||
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;
|
||||
};
|
||||
|
||||
function getProgrammingTopic(id, params) {
|
||||
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_0__/* .get */ .U2)(`myproblems/${id}.json`, __spreadValues({ hidePopLogin: true }, params || {}));
|
||||
}
|
||||
function sumbitCode(id, params) {
|
||||
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`myproblems/${id}/code_submit.json`, params);
|
||||
}
|
||||
function debugCode(id, params) {
|
||||
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`myproblems/${id}/code_debug.json`, params);
|
||||
}
|
||||
function getSubmitRecords(id, params) {
|
||||
if (params.language) {
|
||||
params.language = encodeURIComponent(params.language);
|
||||
}
|
||||
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_0__/* .get */ .U2)(`myproblems/${id}/submit_records.json`, params);
|
||||
}
|
||||
function getRecordDetail(id) {
|
||||
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_0__/* .get */ .U2)(`myproblems/record_detail.json`, { id });
|
||||
}
|
||||
function getOperationResult(id, mode) {
|
||||
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_0__/* .get */ .U2)(`myproblems/${id}/result.json`, { mode });
|
||||
}
|
||||
function addNotes(id, params) {
|
||||
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`myproblems/${id}/add_notes.json`, params);
|
||||
}
|
||||
function resetCode(id) {
|
||||
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`myproblems/${id}/restore_initial_code.json`);
|
||||
}
|
||||
function syncCode(id) {
|
||||
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`myproblems/${id}/sync_code.json`);
|
||||
}
|
||||
function updateCode(id, params) {
|
||||
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`myproblems/${id}/update_code.json`, params);
|
||||
}
|
||||
function triggerPlus(id, params) {
|
||||
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`discusses/${id}/plus.json`, params);
|
||||
}
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
@ -0,0 +1,911 @@
|
||||
/*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** css ./node_modules/_css-loader@6.7.1@css-loader/dist/cjs.js??ruleSet[1].rules[5].oneOf[0].use[1]!./node_modules/_@umijs_bundler-webpack@4.0.88@@umijs/bundler-webpack/compiled/postcss-loader/index.js??ruleSet[1].rules[5].oneOf[0].use[2]!./node_modules/_@umijs_bundler-webpack@4.0.88@@umijs/bundler-webpack/compiled/less-loader/index.js??ruleSet[1].rules[5].oneOf[0].use[3]!./src/components/PreviewAll/index.less?modules ***!
|
||||
\******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
.wrp___dq7YK {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 108;
|
||||
}
|
||||
.wrp___dq7YK.bgBlack___ARIUV {
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
.wrp___dq7YK img,
|
||||
.wrp___dq7YK video {
|
||||
max-width: 100%;
|
||||
max-height: 80%;
|
||||
text-align: center;
|
||||
}
|
||||
.wrp___dq7YK iframe {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
background: #fff;
|
||||
border: none;
|
||||
}
|
||||
.monaco___VnZC3 {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.darkBlue___UprA9 * {
|
||||
font-size: 14px;
|
||||
}
|
||||
.darkBlue___UprA9 [class~='margin'],
|
||||
.darkBlue___UprA9 [class~='monaco-editor-background'] {
|
||||
background: #0a0e2d !important;
|
||||
}
|
||||
.darkBlue___UprA9 [class~='line-numbers'] {
|
||||
color: white !important;
|
||||
}
|
||||
.close___LKoWu {
|
||||
position: absolute;
|
||||
right: 40px;
|
||||
top: 40px;
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
}
|
||||
.close___LKoWu > span {
|
||||
background: #4a4a4a;
|
||||
color: #fff;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.embed___hvpEJ {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** css ./node_modules/_css-loader@6.7.1@css-loader/dist/cjs.js??ruleSet[1].rules[4].oneOf[1].use[1]!./node_modules/_@umijs_bundler-webpack@4.0.88@@umijs/bundler-webpack/compiled/postcss-loader/index.js??ruleSet[1].rules[4].oneOf[1].use[2]!./src/components/monaco-editor/index.css ***!
|
||||
\********************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
.my-monaco-editor div,
|
||||
.my-diff-editor div {
|
||||
font-size: unset;
|
||||
}
|
||||
|
||||
.my-error-line-wrp {
|
||||
width: calc(100% - 20px) !important;
|
||||
background: rgba(245, 0, 0, 0.2) !important;
|
||||
height: auto !important;
|
||||
color: rgba(245, 0, 0, 1);
|
||||
}
|
||||
|
||||
|
||||
.noCopyPaste .quick-input-widget {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.breakpoints-select {
|
||||
|
||||
background: #FF0000;
|
||||
width: 8px !important;
|
||||
height: 8px !important;
|
||||
left: 7px !important;
|
||||
top: 7px;
|
||||
border-radius: 4px;
|
||||
user-select: none;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.breakpoints-fake {
|
||||
background: rgba(255, 0, 0, 0.5);
|
||||
width: 8px !important;
|
||||
height: 8px !important;
|
||||
left: 7px !important;
|
||||
top: 7px;
|
||||
border-radius: 4px;
|
||||
user-select: none;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.highlighted-line {
|
||||
background: #4B4B18;
|
||||
}
|
||||
/*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** css ./node_modules/_css-loader@6.7.1@css-loader/dist/cjs.js??ruleSet[1].rules[5].oneOf[1].use[1]!./node_modules/_@umijs_bundler-webpack@4.0.88@@umijs/bundler-webpack/compiled/postcss-loader/index.js??ruleSet[1].rules[5].oneOf[1].use[2]!./node_modules/_@umijs_bundler-webpack@4.0.88@@umijs/bundler-webpack/compiled/less-loader/index.js??ruleSet[1].rules[5].oneOf[1].use[3]!./src/components/markdown-editor/index.less ***!
|
||||
\***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
.markdown-editor-wrapper {
|
||||
position: relative;
|
||||
}
|
||||
.markdown-editor-body {
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
width: 100%;
|
||||
height: calc(100% - 38px);
|
||||
align-items: center;
|
||||
}
|
||||
.markdown-editor-body .codemirror-container {
|
||||
flex: 1 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.markdown-editor-body .CodeMirror-wrap {
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
.markdown-editor-body .preview-container {
|
||||
flex: 1 0;
|
||||
height: 100%;
|
||||
margin: 10px 0px;
|
||||
padding: 8px 8px 50px 8px;
|
||||
background: #fff;
|
||||
overflow-y: auto;
|
||||
box-sizing: border-box;
|
||||
border-left: 1px solid #ccc;
|
||||
word-wrap: break-word;
|
||||
word-break: break-word;
|
||||
white-space: normal;
|
||||
font-size: 16px;
|
||||
}
|
||||
.markdown-editor-container {
|
||||
border: 1px solid #ccc;
|
||||
overflow: hidden;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 12px;
|
||||
font-size: 16px;
|
||||
}
|
||||
.markdown-editor-container.full-screen {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
height: 100vh !important;
|
||||
z-index: 1010;
|
||||
}
|
||||
.markdown-editor-container.full-screen .preview-container > div {
|
||||
padding-bottom: 180px !important;
|
||||
}
|
||||
.markdown-editor-container.full-screen .CodeMirror-sizer > div {
|
||||
margin-bottom: 90px;
|
||||
}
|
||||
.markdown-editor-container.on-preview .codemirror-container,
|
||||
.markdown-editor-container.on-preview .preview-container {
|
||||
width: 50%;
|
||||
}
|
||||
.mini .markdown-editor-body {
|
||||
height: calc(100% - 28px);
|
||||
}
|
||||
.flex-end {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.my-codemirror-container {
|
||||
border: 1px solid #ccc;
|
||||
width: 100%;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.markdown-tip {
|
||||
color: #cdcdcd;
|
||||
font-size: 12px;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: -28px;
|
||||
margin-bottom: 7px;
|
||||
}
|
||||
/* PADDING */
|
||||
.CodeMirror-lines {
|
||||
padding: 4px 0;
|
||||
/* Vertical padding around content */
|
||||
}
|
||||
.CodeMirror pre.CodeMirror-line,
|
||||
.CodeMirror pre.CodeMirror-line-like {
|
||||
padding: 0 4px;
|
||||
/* Horizontal padding of content */
|
||||
}
|
||||
.CodeMirror-scrollbar-filler,
|
||||
.CodeMirror-gutter-filler {
|
||||
background-color: white;
|
||||
/* The little square between H and V scrollbars */
|
||||
}
|
||||
/* GUTTER */
|
||||
.CodeMirror-gutters {
|
||||
border-right: 1px solid #ddd;
|
||||
background-color: #f7f7f7;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.CodeMirror-linenumber {
|
||||
padding: 0 3px 0 5px;
|
||||
min-width: 20px;
|
||||
text-align: right;
|
||||
color: #999;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.CodeMirror-guttermarker {
|
||||
color: black;
|
||||
}
|
||||
.CodeMirror-guttermarker-subtle {
|
||||
color: #999;
|
||||
}
|
||||
/* CURSOR */
|
||||
.CodeMirror-cursor {
|
||||
border-left: 1px solid black;
|
||||
border-right: none;
|
||||
width: 0;
|
||||
}
|
||||
/* Shown when moving in bi-directional text */
|
||||
.CodeMirror div.CodeMirror-secondarycursor {
|
||||
border-left: 1px solid silver;
|
||||
}
|
||||
.cm-fat-cursor .CodeMirror-cursor {
|
||||
width: auto;
|
||||
border: 0 !important;
|
||||
background: #7e7;
|
||||
}
|
||||
.cm-fat-cursor div.CodeMirror-cursors {
|
||||
z-index: 1;
|
||||
}
|
||||
.cm-fat-cursor-mark {
|
||||
background-color: rgba(20, 255, 20, 0.5);
|
||||
animation: blink 1.06s steps(1) infinite;
|
||||
}
|
||||
.cm-animate-fat-cursor {
|
||||
width: auto;
|
||||
border: 0;
|
||||
animation: blink 1.06s steps(1) infinite;
|
||||
background-color: #7e7;
|
||||
}
|
||||
@keyframes blink {
|
||||
50% {
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
.cm-tab {
|
||||
display: inline-block;
|
||||
text-decoration: inherit;
|
||||
}
|
||||
.CodeMirror-rulers {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: -50px;
|
||||
bottom: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.CodeMirror-ruler {
|
||||
border-left: 1px solid #ccc;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
position: absolute;
|
||||
}
|
||||
/* DEFAULT THEME */
|
||||
.cm-s-default .cm-header {
|
||||
color: blue;
|
||||
}
|
||||
.cm-s-default .cm-quote {
|
||||
color: #090;
|
||||
}
|
||||
.cm-negative {
|
||||
color: #d44;
|
||||
}
|
||||
.cm-positive {
|
||||
color: #292;
|
||||
}
|
||||
.cm-header,
|
||||
.cm-strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
.cm-em {
|
||||
font-style: italic;
|
||||
}
|
||||
.cm-link {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.cm-strikethrough {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
.cm-s-default .cm-keyword {
|
||||
color: #708;
|
||||
}
|
||||
.cm-s-default .cm-atom {
|
||||
color: #219;
|
||||
}
|
||||
.cm-s-default .cm-number {
|
||||
color: #164;
|
||||
}
|
||||
.cm-s-default .cm-def {
|
||||
color: #00f;
|
||||
}
|
||||
.cm-s-default .cm-variable-2 {
|
||||
color: #05a;
|
||||
}
|
||||
.cm-s-default .cm-variable-3,
|
||||
.cm-s-default .cm-type {
|
||||
color: #085;
|
||||
}
|
||||
.cm-s-default .cm-comment {
|
||||
color: #a50;
|
||||
}
|
||||
.cm-s-default .cm-string {
|
||||
color: #a11;
|
||||
}
|
||||
.cm-s-default .cm-string-2 {
|
||||
color: #f50;
|
||||
}
|
||||
.cm-s-default .cm-meta {
|
||||
color: #555;
|
||||
}
|
||||
.cm-s-default .cm-qualifier {
|
||||
color: #555;
|
||||
}
|
||||
.cm-s-default .cm-builtin {
|
||||
color: #30a;
|
||||
}
|
||||
.cm-s-default .cm-bracket {
|
||||
color: #997;
|
||||
}
|
||||
.cm-s-default .cm-tag {
|
||||
color: #170;
|
||||
}
|
||||
.cm-s-default .cm-attribute {
|
||||
color: #00c;
|
||||
}
|
||||
.cm-s-default .cm-hr {
|
||||
color: #999;
|
||||
}
|
||||
.cm-s-default .cm-link {
|
||||
color: #00c;
|
||||
}
|
||||
.cm-s-default .cm-error {
|
||||
color: #f00;
|
||||
}
|
||||
.cm-invalidchar {
|
||||
color: #f00;
|
||||
}
|
||||
.CodeMirror-composing {
|
||||
border-bottom: 2px solid;
|
||||
}
|
||||
/* Default styles for common addons */
|
||||
div.CodeMirror span.CodeMirror-matchingbracket {
|
||||
color: #0b0;
|
||||
}
|
||||
div.CodeMirror span.CodeMirror-nonmatchingbracket {
|
||||
color: #a22;
|
||||
}
|
||||
.CodeMirror-matchingtag {
|
||||
background: rgba(255, 150, 0, 0.3);
|
||||
}
|
||||
.CodeMirror-activeline-background {
|
||||
background: #e8f2ff;
|
||||
}
|
||||
/* STOP */
|
||||
/* The rest of this file contains styles related to the mechanics of
|
||||
the editor. You probably shouldn't touch them. */
|
||||
.CodeMirror {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: white;
|
||||
}
|
||||
.CodeMirror-scroll {
|
||||
overflow: scroll !important;
|
||||
/* Things will break if this is overridden */
|
||||
/* 50px is the magic margin used to hide the element's real scrollbars */
|
||||
/* See overflow: hidden in .CodeMirror */
|
||||
margin-bottom: -50px;
|
||||
margin-right: -50px;
|
||||
padding-bottom: 50px;
|
||||
height: 100%;
|
||||
outline: none;
|
||||
/* Prevent dragging from highlighting the element */
|
||||
position: relative;
|
||||
}
|
||||
.CodeMirror-sizer {
|
||||
position: relative;
|
||||
border-right: 50px solid transparent;
|
||||
}
|
||||
/* The fake, visible scrollbars. Used to force redraw during scrolling
|
||||
before actual scrolling happens, thus preventing shaking and
|
||||
flickering artifacts. */
|
||||
.CodeMirror-vscrollbar,
|
||||
.CodeMirror-hscrollbar,
|
||||
.CodeMirror-scrollbar-filler,
|
||||
.CodeMirror-gutter-filler {
|
||||
position: absolute;
|
||||
z-index: 6;
|
||||
display: none;
|
||||
}
|
||||
.CodeMirror-vscrollbar {
|
||||
right: 0;
|
||||
top: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.CodeMirror-hscrollbar {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
overflow-y: hidden;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
.CodeMirror-scrollbar-filler {
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
.CodeMirror-gutter-filler {
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
.CodeMirror-gutters {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
min-height: 100%;
|
||||
z-index: 3;
|
||||
}
|
||||
.CodeMirror-gutter {
|
||||
white-space: normal;
|
||||
height: 100%;
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
margin-bottom: -50px;
|
||||
}
|
||||
.CodeMirror-gutter-wrapper {
|
||||
position: absolute;
|
||||
z-index: 4;
|
||||
background: none !important;
|
||||
border: none !important;
|
||||
}
|
||||
.CodeMirror-gutter-background {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 4;
|
||||
}
|
||||
.CodeMirror-gutter-elt {
|
||||
position: absolute;
|
||||
cursor: default;
|
||||
z-index: 4;
|
||||
}
|
||||
.CodeMirror-gutter-wrapper ::selection {
|
||||
background-color: transparent;
|
||||
}
|
||||
.CodeMirror-gutter-wrapper ::-moz-selection {
|
||||
background-color: transparent;
|
||||
}
|
||||
.CodeMirror-lines {
|
||||
cursor: text;
|
||||
min-height: 1px;
|
||||
/* prevents collapsing before first draw */
|
||||
}
|
||||
.CodeMirror pre.CodeMirror-line,
|
||||
.CodeMirror pre.CodeMirror-line-like {
|
||||
/* Reset some styles that the rest of the page might have set */
|
||||
border-radius: 0;
|
||||
border-width: 0;
|
||||
background: transparent;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
margin: 0;
|
||||
white-space: pre;
|
||||
word-wrap: normal;
|
||||
line-height: inherit;
|
||||
color: inherit;
|
||||
z-index: 2;
|
||||
position: relative;
|
||||
overflow: visible;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
font-variant-ligatures: contextual;
|
||||
}
|
||||
.CodeMirror-wrap pre.CodeMirror-line,
|
||||
.CodeMirror-wrap pre.CodeMirror-line-like {
|
||||
word-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
word-break: normal;
|
||||
}
|
||||
.CodeMirror-linebackground {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 0;
|
||||
}
|
||||
.CodeMirror-linewidget {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
padding: 0.1px;
|
||||
/* Force widget margins to stay inside of the container */
|
||||
}
|
||||
.CodeMirror-rtl pre {
|
||||
direction: rtl;
|
||||
}
|
||||
.CodeMirror-code {
|
||||
outline: none;
|
||||
}
|
||||
/* Force content-box sizing for the elements where we expect it */
|
||||
.CodeMirror-scroll,
|
||||
.CodeMirror-sizer,
|
||||
.CodeMirror-gutter,
|
||||
.CodeMirror-gutters,
|
||||
.CodeMirror-linenumber {
|
||||
box-sizing: content-box;
|
||||
}
|
||||
.CodeMirror-measure {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
visibility: hidden;
|
||||
}
|
||||
.CodeMirror-cursor {
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
}
|
||||
.CodeMirror-measure pre {
|
||||
position: static;
|
||||
}
|
||||
div.CodeMirror-cursors {
|
||||
visibility: hidden;
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
}
|
||||
div.CodeMirror-dragcursors {
|
||||
visibility: visible;
|
||||
}
|
||||
.CodeMirror-focused div.CodeMirror-cursors {
|
||||
visibility: visible;
|
||||
}
|
||||
.CodeMirror-selected {
|
||||
background: #d9d9d9;
|
||||
}
|
||||
.CodeMirror-focused .CodeMirror-selected {
|
||||
background: #d7d4f0;
|
||||
}
|
||||
.CodeMirror-crosshair {
|
||||
cursor: crosshair;
|
||||
}
|
||||
.CodeMirror-line::selection,
|
||||
.CodeMirror-line > span::selection,
|
||||
.CodeMirror-line > span > span::selection {
|
||||
background: #d7d4f0;
|
||||
}
|
||||
.CodeMirror-line::-moz-selection,
|
||||
.CodeMirror-line > span::-moz-selection,
|
||||
.CodeMirror-line > span > span::-moz-selection {
|
||||
background: #d7d4f0;
|
||||
}
|
||||
.cm-searching {
|
||||
background-color: #ffa;
|
||||
background-color: rgba(255, 255, 0, 0.4);
|
||||
}
|
||||
/* Used to force a border model for a node */
|
||||
.cm-force-border {
|
||||
padding-right: 0.1px;
|
||||
}
|
||||
@media print {
|
||||
/* Hide the cursor when printing */
|
||||
.CodeMirror div.CodeMirror-cursors {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
/* See issue #2901 */
|
||||
.cm-tab-wrap-hack:after {
|
||||
content: '';
|
||||
}
|
||||
/* Help users use markselection to safely style text background */
|
||||
span.CodeMirror-selectedtext {
|
||||
background: none;
|
||||
}
|
||||
.CodeMirror-sizer {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px !important;
|
||||
}
|
||||
.CodeMirror-empty.CodeMirror-focused {
|
||||
outline: none;
|
||||
}
|
||||
.CodeMirror pre.CodeMirror-placeholder {
|
||||
color: #999;
|
||||
}
|
||||
.CodeMirror {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: white;
|
||||
word-break: break-word;
|
||||
}
|
||||
.CodeMirror pre.CodeMirror-line,
|
||||
.CodeMirror pre.CodeMirror-line-like {
|
||||
word-wrap: break-word;
|
||||
word-break: break-word;
|
||||
white-space: pre-wrap;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
/*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** css ./node_modules/_css-loader@6.7.1@css-loader/dist/cjs.js??ruleSet[1].rules[5].oneOf[1].use[1]!./node_modules/_@umijs_bundler-webpack@4.0.88@@umijs/bundler-webpack/compiled/postcss-loader/index.js??ruleSet[1].rules[5].oneOf[1].use[2]!./node_modules/_@umijs_bundler-webpack@4.0.88@@umijs/bundler-webpack/compiled/less-loader/index.js??ruleSet[1].rules[5].oneOf[1].use[3]!./src/components/markdown-editor/toolbar/index.less ***!
|
||||
\***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
.markdown-toolbar-container {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
align-items: center;
|
||||
padding: 0 5px;
|
||||
padding-right: 28px;
|
||||
margin: 0;
|
||||
position: relative;
|
||||
list-style: none;
|
||||
background: #fff;
|
||||
border-bottom: 1px solid #ccc;
|
||||
box-sizing: border-box;
|
||||
line-height: 20px;
|
||||
width: 100%;
|
||||
min-height: 30px;
|
||||
}
|
||||
.markdown-toolbar-container .fill-tip {
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
display: inline-block;
|
||||
padding: 5px;
|
||||
border: 1px solid #E99237;
|
||||
border-radius: 5px;
|
||||
box-sizing: border-box;
|
||||
line-height: 16px;
|
||||
height: auto;
|
||||
color: #A65500;
|
||||
background-color: #FFF1E2;
|
||||
position: relative;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.markdown-toolbar-container .fill-tip::before {
|
||||
content: ' ';
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-top: 6px solid transparent;
|
||||
border-bottom: 6px solid transparent;
|
||||
border-right: 6px solid #FFF1E2;
|
||||
position: absolute;
|
||||
left: -6px;
|
||||
top: 6px;
|
||||
z-index: 10;
|
||||
}
|
||||
.markdown-toolbar-container .fill-tip::after {
|
||||
content: ' ';
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-top: 6px solid transparent;
|
||||
border-bottom: 6px solid transparent;
|
||||
border-right: 6px solid #E99237;
|
||||
position: absolute;
|
||||
left: -7px;
|
||||
top: 6px;
|
||||
}
|
||||
.markdown-toolbar-container li {
|
||||
color: #666;
|
||||
padding: 0 1px;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
height: 38px;
|
||||
flex-flow: column nowrap;
|
||||
justify-content: center;
|
||||
}
|
||||
.markdown-toolbar-container a,
|
||||
.markdown-toolbar-container span {
|
||||
display: block;
|
||||
}
|
||||
.markdown-toolbar-container a {
|
||||
width: 28px;
|
||||
color: #666;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
font-size: 18px;
|
||||
}
|
||||
.markdown-toolbar-container a i {
|
||||
font-size: 18px;
|
||||
}
|
||||
.markdown-toolbar-container a i::before {
|
||||
font-size: 18px;
|
||||
}
|
||||
.markdown-toolbar-container .btn-null {
|
||||
width: auto;
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
align-items: center;
|
||||
}
|
||||
.markdown-toolbar-container .insert-blank {
|
||||
color: #E99237;
|
||||
font-size: 18px;
|
||||
}
|
||||
.markdown-toolbar-container span.v-line {
|
||||
margin: 0 5px;
|
||||
height: 65%;
|
||||
border-right: 1px solid #ccc;
|
||||
}
|
||||
.mini .markdown-toolbar-container li {
|
||||
height: 28px;
|
||||
}
|
||||
.editor-resize {
|
||||
display: block;
|
||||
width: 120px;
|
||||
height: 4px;
|
||||
left: 54%;
|
||||
margin-top: 2px;
|
||||
border-top: 1px solid #ccc;
|
||||
border-bottom: 1px solid #ccc;
|
||||
cursor: row-resize;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-transform: capitalize;
|
||||
box-sizing: border-box;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.btn-full-screen {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
}
|
||||
|
||||
/*!*****************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** css ./node_modules/_css-loader@6.7.1@css-loader/dist/cjs.js??ruleSet[1].rules[4].oneOf[1].use[1]!./node_modules/_@umijs_bundler-webpack@4.0.88@@umijs/bundler-webpack/compiled/postcss-loader/index.js??ruleSet[1].rules[4].oneOf[1].use[2]!./src/components/markdown-editor/css/iconfont.css ***!
|
||||
\*****************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
@font-face {
|
||||
font-family: "md-iconfont";
|
||||
src: url(./static/iconfont.345f94c8.eot);
|
||||
/* IE9 */
|
||||
src: url(./static/iconfont.345f94c8.eot#iefix) format('embedded-opentype'),
|
||||
/* IE6-IE8 */
|
||||
/* url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAArkAAsAAAAAFGQAAAqUAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCFTgqYEJMCATYCJANMCygABCAFhG0HgUwb5hCjooZyUthkf4mpyEh3pV0O3eNzjDeMPcxWAACWBR8hkIIUVSIBAABgBAAACrx/wAkAfPHw39iv+2bmqzZUIt1PJ5FJeCMRibbSgsVNdRP+A23z391RKZiNY99ZzVmNklbCKpCtz0WxCnCVhUtkySLj37772YjcCVNhPk1OHZFC37UprJD/0ozsDfr3lrQ9Ja2fjpzpmcEJypq3QpVe3mEqOf/v+doc8Dx9AQTUAMH8r7l6h4jEycc0pD1SorTNT/f4+MQxO0wsRBKPkEy8VKiUQkiNRAgFe/ZbMVsJqPuMwq6/O48n0DSrO+To+fNnsFBwIlDuxls5WHgSlBjXUJdXFduW9T9hiXp6QK0GftDXx6ftOkkl4yc6PnvSg9sX5F9YZK7lf7DLU+CyExnbQCFelKr/MLbwbSKbKubEL8C8+KkUXjBVS7qLlkVFb9ncJpntxd2Xna/ekiQvSGwMutYjdpgXxBuyGejDtFUlNc1R+S9PV0tPERo6BpxAVHGyfbR8yxuCF0QLoQ9eUCDzArVfFA0EogJBSEd1B1QDFQ2oCSoLUAWUClAdlA5QF5QeUAvUMoTQ49UNKkRJAAUoG6AGqLsIocNbZwgD8P5WaYiTI2ObVWDfIP8FUH4B6GfCk1BkoQkNRVUCH5pC4eygwLuuu+XmIXB2jvFmcAXLmYJqni3c1sPfw8QoEHgwJsKwODyKoOr8CI/D4QnXuLpRnSqZzvUuVSLdXrMmWVlh7pdqFWyeZ6zbaj5Ea9VLbFFqJyuBbiHz/aXdwxv1o+qp6jZLs1AoqRHINuoHKJHgGlMq1FfO6n7nwbByXhAmPX0mB8QGO11d2a6eq73I/Or36dQNtU+OwzR+ZOhIvG9PavecX/p9136p84XxwOvWiBPqlOFByvvvoYHx+0JjX16+64EsGBw0NqsGsL2dB1a3LWieWdtgu+WlDNp1MF9ltnZPtbPEY8rCiCkoSnZWNZgOJAAl+ocR4Jr4TUSwy+pyq13sImw2Fj1QBDqoHIWVps9Oe6/70Jfl40V7rnnTFmeGL+2vXqcfP4VVab9hukZcxUCnDA32Jtjd74Pq5fqv/DUTv8a31K6dFFOXnYveQGKctVFs8p4EALG+V11C2k2eplEv6t7hrB6No5sL92F7AoDl8P79bJMbOAhN9S6f7YaoS6zTe9h2X22CMIMRuZ79KYSPUz0yAEJ8rmdkLSCsDbKUZm/XaCgZ/3VkwnSMp/9a/65inE4Uu2wpyvFCFYvarGxSdRFKJeNT4ujk1MPfe6Bfa1ePW1WWCVy3bmr1ko7JRynl544qLhwru3hEfhUBCxEIWwnsFpJobe+0dMS615o7jFByxzl6MRW7yD3AFsV0zZqSm1WJkK0FPjJifKsACpFsbVi3qVmD1bvqe9PTYcIIhActzTk/QMnRVdY0Pb7j2XG36f9tN8ut1oJNWexSlW9qSnbtoj2Ard40hheK/stt/Ut2NZuOWH0LFR+pyhrW/Vxd1qxBZumxWhaUbCWixxf57PaZp/zogTpeVQvYYzYAIWZjZfY6MnRB4WtX8Aed+pB7/b920mRPncmHsN1D1a0tBKlHMLW3enfGi7YkG8vfl/elLiUsZCidC5YNWzGlcQO4+sZRlCD0gOaxhQuu5niOdslx9TOub171Par2oocFG4Lp6Efmzzdh8x4Fmt4mtuL9IqxYM+Ww9DDlA5vzL9RB+0Cnf5QfkjxvFh0Ku4SFzC9xSN7TGR9dDnc77NLX2BcsxR5+++YIORTi+PXrvnhD6AZxIVtIpBJbJBafL5XKCMLFsbeeYvQwsW3yr18PRB2SDrRQvBH+Gz0sYA7hLhRtkTDn2PMl/Hr3WF2tQ427l4pUI6p77tAqMvhyjeI2X55BNI96ULb6taXwatu97E+KgDtTZr3ZmPRlSMDqgBUpYRjf7nxyxUYLPcLf8/goevBIapk4t6AXcyBfkRW7zEmZM4DBml3Hd+uXLkxnC0og1FvPgqhH9w7Gx2ZVG8NnzHROmMuTfZTxxiU6r9tenVmYoC7PjMYMbn3ciwIq5X7d0luk6eUBmmkpD2OVcT2khWWhUf48X6daKAACJ1QMnKGijbLmjgGJxOJh0etlsihEQZaLWeHhcZ6Qpy0BYgwnlkfHRS83RuUx2vVrddavPzeL2UjMzhXIDzlv4wpngWYETXAQTxzbwZMJtotbI/6nGtXvUt3DfgUhXHdJfxXbgTlYk5iXtCboggWuk4QGQUuap1DGQ/jL3SjM/aGRVn4x+57YwSaYl5hUwYGyXTNRJMgLqHcRVSEtRXJrUenECVrthIm6Jp2hybBzZ2Aqn3sjR1ahzc4WBlZBr5CqspB5g+tCFuVky4pKrUXy50ylRVZ5UbYD6mIPbNY0aXJyIC5QevaqkXue2+Zznuqd5U7qWmd1OOQ8+RUaLa7V4JoKxtQYP37AP8Rq6O/2GaPk0/XjPIKEsI4FkYN50bGZeSPH5cUkxF6MrBzA8OErS+uGfeN0hu/al9DB82E3DBQkDkyExEAkSDxZtF88KSIowojtR4cW2h9YHkRrg4URLh63c1sgZtDws9MLKG2UcSnTz+OlSxDDszwVkDJP0QvX6GjwSWYVeVOG9O6N6FjZWYBGzmKp8rw8KlFR4XTdw8Ko2tvAmLrB6NJ5rIHXVsx509enr2J52LGDiBwKRLrSeRWD721sVqUYVNuXzAvODPp3at2cYY3DJeb8udMPDz4sqDhlkW94SGlunIZ/WOLLCpszsK7GPypJL5XLpfokwCEtvfpI0RGZ7G7RXZJkVY8dOzjgPMvBkh/W9cPNQuGEic+XLYO4jMPr1ik7mxf//sz0Vl+z2QNLwPGr2MaIq/iQZ3iiyFLysoJUx7hBvXVEhWRhQai0ksJtOOvSxyixBtNubwhcuzfC9qpSrsxhzHqYBeeFYRT5EADZ7n9sNLGWuoapWKMrCDaWYcjB6BPgRuweJZFFgSKxcBGMACAn+o0NB8ueN2FS1vKAnbLu5AIskPURO4ahfGPhPAwn/wJKQY+T/5dtjuLHy0DTIUFI9i7LQeme1K11/JRvDPZ/nIy7ezlLKI38Sxry5QADiqsRsC+BVIhB/sre0mOiiPIUaT1TnSEkGd8MBOVpgfzfKyqZI+rKVDg7oSkGsR/RDd2vn56kFu/G6IkDkpoZkNUto8VyG1S07ICqul3QtCV355aRQcaiNLBpAgOhbxtIuv7hWWXZiRdYOkDF1DusCscZNJ3EzT5bVl+uHggkgxb7q/AKs5HJvDLLf4E9RkkH6Wm1P6DiMYuubr8FL5CBytignOyW2QhDmMQzWwdiRNETHkBx7ZDf75rG3DasFabByiECJDYCa0Kja/SeFJSZ6dkq8PlfgHUUSRTT7Cv6H0AKP3chUriIFOgLmVM125aqg51YW0MOCkNo2QQli845KkAUuUgYoF7qACisps+R3dvpceiuNS1Z10+n5U9afC3yrUdT5ChRiWrUoh6Nv2UXakcnutGL/sHh0THarSOfwxzy5D2yhYlCDTPPMno12WPU894rPhJMk8/HskLSQFX0hScxi8EgpWmfvDlm5UFAe56y3EcYl2MawxWWGrMqURY3m3qsoNjS+AhVRfGDAQAAAA==') format('woff2'), */
|
||||
url(./static/iconfont.deef216b.woff) format('woff'),
|
||||
url(./static/iconfont.42606faf.ttf) format('truetype'),
|
||||
/* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
|
||||
url(./static/iconfont.504b881c.svg#iconfont) format('svg');
|
||||
/* iOS 4.1- */
|
||||
}
|
||||
|
||||
.md-iconfont {
|
||||
font-family: "md-iconfont" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-uniE900:before {
|
||||
content: "\e900";
|
||||
font-size: 14px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.icon-shrink:before {
|
||||
content: "\e728";
|
||||
}
|
||||
|
||||
.icon-enlarge:before {
|
||||
content: "\e623";
|
||||
}
|
||||
|
||||
.icon-code:before {
|
||||
content: "\e602";
|
||||
}
|
||||
|
||||
.icon-italic:before {
|
||||
content: "\e718";
|
||||
}
|
||||
|
||||
.icon-bold:before {
|
||||
content: "\e644";
|
||||
}
|
||||
|
||||
.icon-picture:before {
|
||||
content: "\e606";
|
||||
}
|
||||
|
||||
.icon-minus:before {
|
||||
content: "\e62c";
|
||||
}
|
||||
|
||||
.icon-order-list:before {
|
||||
content: "\e655";
|
||||
}
|
||||
|
||||
.icon-link:before {
|
||||
content: "\e7d4";
|
||||
}
|
||||
|
||||
.icon-formula:before {
|
||||
content: "\e633";
|
||||
}
|
||||
|
||||
.icon-unorder-list:before {
|
||||
content: "\e668";
|
||||
}
|
||||
|
||||
.icon-edit:before {
|
||||
content: "\e603";
|
||||
}
|
||||
|
||||
.icon-table:before {
|
||||
content: "\e7db";
|
||||
}
|
||||
|
||||
.icon-sum:before {
|
||||
content: "\e667";
|
||||
}
|
||||
|
||||
.icon-eye:before {
|
||||
content: "\e69f";
|
||||
}
|
||||
|
||||
.icon-eye-slash:before {
|
||||
content: "\e601";
|
||||
}
|
||||
|
||||
.icon-eraser:before {
|
||||
content: "\e8cd";
|
||||
}
|
||||
|
||||
.icon-file-code:before {
|
||||
content: "\e9ec";
|
||||
}
|
||||
/*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** css ./node_modules/_css-loader@6.7.1@css-loader/dist/cjs.js??ruleSet[1].rules[5].oneOf[1].use[1]!./node_modules/_@umijs_bundler-webpack@4.0.88@@umijs/bundler-webpack/compiled/postcss-loader/index.js??ruleSet[1].rules[5].oneOf[1].use[2]!./node_modules/_@umijs_bundler-webpack@4.0.88@@umijs/bundler-webpack/compiled/less-loader/index.js??ruleSet[1].rules[5].oneOf[1].use[3]!./src/components/markdown-editor/upload-image/index.less ***!
|
||||
\****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
.upload-button {
|
||||
width: 106px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
font-size: 12px;
|
||||
display: block;
|
||||
position: relative;
|
||||
color: #0152d9;
|
||||
}
|
||||
.upload-button input {
|
||||
opacity: 0;
|
||||
width: 160px;
|
||||
height: 32px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
/*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** css ./node_modules/_css-loader@6.7.1@css-loader/dist/cjs.js??ruleSet[1].rules[5].oneOf[0].use[1]!./node_modules/_@umijs_bundler-webpack@4.0.88@@umijs/bundler-webpack/compiled/postcss-loader/index.js??ruleSet[1].rules[5].oneOf[0].use[2]!./node_modules/_@umijs_bundler-webpack@4.0.88@@umijs/bundler-webpack/compiled/less-loader/index.js??ruleSet[1].rules[5].oneOf[0].use[3]!./src/components/ImageDimensions/index.less?modules ***!
|
||||
\***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
.imageDimensions___a7crR {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: start;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 4;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
padding-top: 60px;
|
||||
}
|
||||
.imageDimensions___a7crR .img___Kroat {
|
||||
visibility: hidden;
|
||||
max-width: 80%;
|
||||
min-width: 500px;
|
||||
}
|
||||
.imageDimensions___a7crR.fullWidth___c492T .img___Kroat {
|
||||
max-width: 100%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** css ./node_modules/_css-loader@6.7.1@css-loader/dist/cjs.js??ruleSet[1].rules[5].oneOf[0].use[1]!./node_modules/_@umijs_bundler-webpack@4.0.88@@umijs/bundler-webpack/compiled/postcss-loader/index.js??ruleSet[1].rules[5].oneOf[0].use[2]!./node_modules/_@umijs_bundler-webpack@4.0.88@@umijs/bundler-webpack/compiled/less-loader/index.js??ruleSet[1].rules[5].oneOf[0].use[3]!./src/components/markdown-editor/flow-chart/index.less?modules ***!
|
||||
\**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
.myPaletteDiv___Xjz2I {
|
||||
position: relative;
|
||||
left: -15px;
|
||||
width: 320px;
|
||||
}
|
||||
.myPaletteDiv___Xjz2I canvas {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
@ -0,0 +1,675 @@
|
||||
"use strict";
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[2586],{
|
||||
|
||||
/***/ 97282:
|
||||
/*!*****************************************!*\
|
||||
!*** ./src/components/NoData/index.tsx ***!
|
||||
\*****************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
||||
/* harmony import */ var _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/assets/images/icons/nodata.png */ 4977);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd */ 3113);
|
||||
var __defProp = Object.defineProperty;
|
||||
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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
const noData = ({
|
||||
img,
|
||||
buttonProps = {},
|
||||
styles = {},
|
||||
customText,
|
||||
ButtonText,
|
||||
ButtonClick,
|
||||
Buttonclass,
|
||||
ButtonTwo,
|
||||
imgStyles,
|
||||
loading = false
|
||||
}) => {
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
"section",
|
||||
{
|
||||
className: "tc animated fadeIn",
|
||||
style: __spreadValues(__spreadValues({}, { color: "#999", margin: "100px auto", visibility: loading ? "hidden" : "visible" }), styles)
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("img", { src: img || _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_1__, style: __spreadValues({}, imgStyles) }),
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", { className: "mt20 font14" }, customText || "\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),
|
||||
ButtonText && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .ZP, __spreadValues({ className: Buttonclass, onClick: ButtonClick }, buttonProps), ButtonText),
|
||||
ButtonTwo && ButtonTwo
|
||||
);
|
||||
};
|
||||
/* harmony default export */ __webpack_exports__.Z = (noData);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 11778:
|
||||
/*!*********************************************************!*\
|
||||
!*** ./src/components/PreviewAll/index.tsx + 1 modules ***!
|
||||
\*********************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ PreviewAll; }
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
||||
var _react_17_0_2_react = __webpack_require__(59301);
|
||||
;// CONCATENATED MODULE: ./src/components/PreviewAll/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var PreviewAllmodules = ({"wrp":"wrp___dq7YK","bgBlack":"bgBlack___ARIUV","monaco":"monaco___VnZC3","darkBlue":"darkBlue___UprA9","close":"close___LKoWu","embed":"embed___hvpEJ"});
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
||||
var es_button = __webpack_require__(3113);
|
||||
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/ArrowDownOutlined.js + 1 modules
|
||||
var ArrowDownOutlined = __webpack_require__(98915);
|
||||
// EXTERNAL MODULE: ./src/components/monaco-editor/index.jsx + 4 modules
|
||||
var monaco_editor = __webpack_require__(1699);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
||||
var tooltip = __webpack_require__(6848);
|
||||
// EXTERNAL MODULE: ./src/utils/util.tsx
|
||||
var util = __webpack_require__(3163);
|
||||
// EXTERNAL MODULE: ./src/service/exercise.ts
|
||||
var exercise = __webpack_require__(40610);
|
||||
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
||||
var NoData = __webpack_require__(97282);
|
||||
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
||||
var env = __webpack_require__(64741);
|
||||
;// CONCATENATED MODULE: ./src/components/PreviewAll/index.tsx
|
||||
var __defProp = Object.defineProperty;
|
||||
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 __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());
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* harmony default export */ var PreviewAll = (({ editOffice = "view", data, theme, type, filename, monacoEditor, className, style, close, onClose, hasMask, disabledDownload, onImgDimensions, showNodata }) => {
|
||||
const [src, setSrc] = (0,_react_17_0_2_react.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt");
|
||||
const [token, setToken] = (0,_react_17_0_2_react.useState)("");
|
||||
const [officeData, setOfficeData] = (0,_react_17_0_2_react.useState)();
|
||||
const officePath = window.ENV === "build" ? "/react/build" : "";
|
||||
const apiServer = location.host.startsWith("localhost") ? env/* default */.Z.PROXY_SERVER : env/* default */.Z.API_SERVER;
|
||||
const unit = 1024 * 1024;
|
||||
const maxSize = 10 * unit;
|
||||
const closeRef = (0,_react_17_0_2_react.useRef)();
|
||||
if ((data == null ? void 0 : data.startsWith("/api")) && type !== "txt") {
|
||||
data = env/* default */.Z.API_SERVER + data;
|
||||
}
|
||||
const getFileExtension = (url) => {
|
||||
const filename2 = url.substring(url.lastIndexOf("/") + 1);
|
||||
const extension = filename2.split(".").pop();
|
||||
return extension;
|
||||
};
|
||||
if (filename)
|
||||
monacoEditor.filename = filename;
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
var _a, _b;
|
||||
const cookies = (_b = (_a = document.cookie) == null ? void 0 : _a.replace(/\s/g, "")) == null ? void 0 : _b.split(";");
|
||||
cookies == null ? void 0 : cookies.map((item) => {
|
||||
let i = item.split("=");
|
||||
if (i[0] === "_educoder_session") {
|
||||
setToken(i[1]);
|
||||
}
|
||||
});
|
||||
}, []);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
if (type === "office") {
|
||||
if (data.indexOf("bigfilescdn.") > -1) {
|
||||
setOfficeData({
|
||||
url: data,
|
||||
fileType: getFileExtension(data),
|
||||
model: data.indexOf("model=edit") ? "edit" : "view"
|
||||
});
|
||||
} else {
|
||||
getData();
|
||||
}
|
||||
}
|
||||
}, [type, data]);
|
||||
const getData = () => __async(void 0, null, function* () {
|
||||
console.log("data:", data);
|
||||
let _url = data;
|
||||
if (!data.startsWith("http")) {
|
||||
_url = location.origin + _url;
|
||||
}
|
||||
let _id = new URL(_url).pathname.split("/").pop();
|
||||
const res = yield (0,exercise/* setEcsAttachment */.gJ)({ attachment_id: _id });
|
||||
res.url = apiServer + res.url;
|
||||
setOfficeData(res);
|
||||
});
|
||||
const handleClick = () => {
|
||||
if (data.startsWith("http") || data.startsWith("blob:")) {
|
||||
handleDown();
|
||||
return;
|
||||
}
|
||||
(0,util/* downloadFile */.Sv)(filename || "educoder", data, filename);
|
||||
};
|
||||
const handleDown = () => {
|
||||
(0,util/* downLoadLink */.Nd)(filename || "educoder", decodeURIComponent(data));
|
||||
};
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: __spreadValues({}, style || {}), className: `${hasMask && PreviewAllmodules.bgBlack} ${!!type ? PreviewAllmodules.wrp : "hide"}` }, close && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: PreviewAllmodules.close, ref: closeRef }, !!onImgDimensions && /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8", getPopupContainer: () => closeRef.current }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { onClick: () => {
|
||||
onClose();
|
||||
onImgDimensions();
|
||||
} }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "icon-yulanpizhu" }))), !disabledDownload && /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6", getPopupContainer: () => closeRef.current }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { onClick: handleDown }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "icon-quxiaozhiding" }))), /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u5173\u95ED", getPopupContainer: () => closeRef.current }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "", onClick: onClose }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "icon-guanbi1" })))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${PreviewAllmodules[className]} ${className} ${PreviewAllmodules.monaco} ${type === "txt" ? "show" : "hide"}` }, type === "txt" && /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
monaco_editor/* default */.ZP,
|
||||
__spreadValues({}, monacoEditor)
|
||||
))), type === "audio" && /* @__PURE__ */ _react_17_0_2_react.createElement("audio", { src: `${(data == null ? void 0 : data.indexOf("http://")) > -1 || (data == null ? void 0 : data.indexOf("https://")) > -1 ? "" : "data:audio/mp3;base64,"}${data}`, autoPlay: true }), type === "video" && /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, (data == null ? void 0 : data.indexOf("http")) > -1 ? /* @__PURE__ */ _react_17_0_2_react.createElement("video", { controls: true, src: `${data}`, autoPlay: true }) : /* @__PURE__ */ _react_17_0_2_react.createElement("video", { controls: true, src: `data:video/mp4;base64,${data}`, autoPlay: true })), type === "office" && officeData && /* @__PURE__ */ _react_17_0_2_react.createElement("iframe", { src: `${officePath}/office.html?key=${officeData.key}&url=${btoa(officeData.url)}&callbackUrl=${apiServer + officeData.callbackUrl}&fileType=${officeData.fileType}&title=${officeData.title}&model=${editOffice}&officeServer=${env/* default */.Z.ONLYOFFICE}&disabledDownload=${!!disabledDownload}` }), type === "html" && /* @__PURE__ */ _react_17_0_2_react.createElement("iframe", { src: data + "&disposition=inline" }), type === "pdf" && /* @__PURE__ */ _react_17_0_2_react.createElement("iframe", { src: `${officePath}/js/pdfview/index.html?url=${data}&disabledDownload=${!!disabledDownload}` }), type === "image" && /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: `${(data == null ? void 0 : data.indexOf("http://")) > -1 || (data == null ? void 0 : data.indexOf("https://")) > -1 ? "" : "data:image/png;base64,"}${data}` }), (type === "other" || type === "download") && /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, showNodata ? /* @__PURE__ */ _react_17_0_2_react.createElement(NoData/* default */.Z, { customText: "\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B", ButtonTwo: /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { icon: /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-xiazai4 font14" }), type: "primary", size: "middle", onClick: handleClick }, "\u4E0B\u8F7D") }) : /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { type: "primary", size: "middle", onClick: handleClick }, /* @__PURE__ */ _react_17_0_2_react.createElement(ArrowDownOutlined/* default */.Z, null), "\u70B9\u51FB\u4E0B\u8F7D")));
|
||||
});
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 12586:
|
||||
/*!*********************************************************!*\
|
||||
!*** ./src/components/RenderHtml/index.tsx + 1 modules ***!
|
||||
\*********************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ RenderHtml; }
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
||||
var _react_17_0_2_react = __webpack_require__(59301);
|
||||
// EXTERNAL MODULE: ./node_modules/_katex@0.11.1@katex/dist/katex.min.css
|
||||
var katex_min = __webpack_require__(88633);
|
||||
// EXTERNAL MODULE: ./node_modules/_marked@2.0.7@marked/lib/marked.js
|
||||
var marked = __webpack_require__(32834);
|
||||
var marked_default = /*#__PURE__*/__webpack_require__.n(marked);
|
||||
// EXTERNAL MODULE: ./node_modules/_marked@2.0.7@marked/src/helpers.js
|
||||
var helpers = __webpack_require__(11690);
|
||||
;// CONCATENATED MODULE: ./src/utils/marked.ts
|
||||
|
||||
|
||||
function indentCodeCompensation(raw, text) {
|
||||
const matchIndentToCode = raw.match(/^(\s+)(?:```)/);
|
||||
if (matchIndentToCode === null) {
|
||||
return text;
|
||||
}
|
||||
const indentToCode = matchIndentToCode[1];
|
||||
return text.split("\n").map((node) => {
|
||||
const matchIndentInNode = node.match(/^\s+/);
|
||||
if (matchIndentInNode === null) {
|
||||
return node;
|
||||
}
|
||||
const [indentInNode] = matchIndentInNode;
|
||||
if (indentInNode.length >= indentToCode.length) {
|
||||
return node.slice(indentToCode.length);
|
||||
}
|
||||
return node;
|
||||
}).join("\n");
|
||||
}
|
||||
let toc = [];
|
||||
let ctx = ["<ul>"];
|
||||
const renderer = new (marked_default()).Renderer();
|
||||
const headingRegex = /^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;
|
||||
function cleanToc() {
|
||||
toc.length = 0;
|
||||
ctx = ["<ul>"];
|
||||
}
|
||||
const lines = {
|
||||
overflow: "hidden",
|
||||
WebkitBoxOrient: "vertical",
|
||||
display: "-webkit-box",
|
||||
WebkitLineClamp: 2
|
||||
};
|
||||
function buildToc(coll, k, level, ctx2) {
|
||||
if (k >= coll.length || coll[k].level <= level) {
|
||||
return k;
|
||||
}
|
||||
var node = coll[k];
|
||||
ctx2.push("<li><a href='#" + node.anchor + "'>" + node.text + "</a>");
|
||||
k++;
|
||||
var childCtx = [];
|
||||
k = buildToc(coll, k, node.level, childCtx);
|
||||
if (childCtx.length > 0) {
|
||||
ctx2.push("<ul>");
|
||||
childCtx.forEach(function(idm) {
|
||||
ctx2.push(idm);
|
||||
});
|
||||
ctx2.push("</ul>");
|
||||
}
|
||||
ctx2.push("</li>");
|
||||
k = buildToc(coll, k, level, ctx2);
|
||||
return k;
|
||||
}
|
||||
function getTocContent() {
|
||||
buildToc(toc, 0, 0, ctx);
|
||||
ctx.push("</ul>");
|
||||
return ctx.join("");
|
||||
}
|
||||
const tokenizer = {
|
||||
heading(src) {
|
||||
const cap = headingRegex.exec(src);
|
||||
if (cap) {
|
||||
return {
|
||||
type: "heading",
|
||||
raw: cap[0],
|
||||
depth: cap[1].length,
|
||||
text: cap[2]
|
||||
};
|
||||
}
|
||||
},
|
||||
fences(src) {
|
||||
const cap = this.rules.block.fences.exec(src);
|
||||
if (cap) {
|
||||
const raw = cap[0];
|
||||
let text = indentCodeCompensation(raw, cap[3] || "");
|
||||
const lang = cap[2] ? cap[2].trim() : cap[2];
|
||||
if (["latex", "katex", "math"].indexOf(lang) >= 0) {
|
||||
const id = next_id();
|
||||
const expression = text;
|
||||
text = id;
|
||||
math_expressions[id] = { type: "block", expression };
|
||||
}
|
||||
return {
|
||||
type: "code",
|
||||
raw,
|
||||
lang,
|
||||
text
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
const latexRegex = /(?:\${2})([^\n`]+?)(?:\${2})/gi;
|
||||
let katex_count = 0;
|
||||
const next_id = () => `__special_katext_id_${katex_count++}__`;
|
||||
let math_expressions = {};
|
||||
function getMathExpressions() {
|
||||
return math_expressions;
|
||||
}
|
||||
function resetMathExpressions() {
|
||||
katex_count = 0;
|
||||
math_expressions = {};
|
||||
}
|
||||
function replace_math_with_ids(text) {
|
||||
text = text.replace(latexRegex, (_match, expression) => {
|
||||
const id = next_id();
|
||||
math_expressions[id] = { type: "inline", expression };
|
||||
return id;
|
||||
});
|
||||
return text;
|
||||
}
|
||||
const original_listitem = renderer.listitem;
|
||||
renderer.listitem = function(text) {
|
||||
return original_listitem(replace_math_with_ids(text));
|
||||
};
|
||||
const original_paragraph = renderer.paragraph;
|
||||
renderer.paragraph = function(text) {
|
||||
return original_paragraph(replace_math_with_ids(text));
|
||||
};
|
||||
const original_tablecell = renderer.tablecell;
|
||||
renderer.tablecell = function(content, flags) {
|
||||
return original_tablecell(replace_math_with_ids(content), flags);
|
||||
};
|
||||
renderer.code = function(code, infostring, escaped) {
|
||||
const lang = (infostring || "").match(/\S*/)[0];
|
||||
if (!lang) {
|
||||
return '<pre class="prettyprint linenums"><code>' + (escaped ? code : (0,helpers.escape)(code, true)) + "</code></pre>";
|
||||
}
|
||||
if (["latex", "katex", "math"].indexOf(lang) >= 0) {
|
||||
return `<p class='editormd-tex'>${code}</p>`;
|
||||
} else {
|
||||
return `<pre class="prettyprint linenums"><code class="language-${infostring}">${escaped ? code : (0,helpers.escape)(code, true)}</code></pre>
|
||||
`;
|
||||
}
|
||||
};
|
||||
renderer.heading = function(text, level, raw) {
|
||||
let anchor = this.options.headerPrefix + raw.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g, "-");
|
||||
toc.push({
|
||||
anchor,
|
||||
level,
|
||||
text
|
||||
});
|
||||
return "<h" + level + ' id="' + anchor + '">' + text + "</h" + level + ">";
|
||||
};
|
||||
marked_default().setOptions({
|
||||
silent: true,
|
||||
gfm: true,
|
||||
pedantic: false
|
||||
});
|
||||
marked_default().use({ tokenizer, renderer });
|
||||
/* harmony default export */ var utils_marked = ((marked_default()));
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_code-prettify@0.1.0@code-prettify/src/prettify.js
|
||||
var prettify = __webpack_require__(64018);
|
||||
// EXTERNAL MODULE: ./node_modules/_hls.js@1.4.12@hls.js/dist/hls.mjs
|
||||
var dist_hls = __webpack_require__(36775);
|
||||
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
||||
var env = __webpack_require__(64741);
|
||||
// EXTERNAL MODULE: ./node_modules/_katex@0.11.1@katex/dist/katex.js
|
||||
var katex = __webpack_require__(15342);
|
||||
// EXTERNAL MODULE: ./node_modules/_uuid@8.3.0@uuid/dist/esm-browser/v4.js + 4 modules
|
||||
var v4 = __webpack_require__(1012);
|
||||
// EXTERNAL MODULE: ./src/components/PreviewAll/index.tsx + 1 modules
|
||||
var PreviewAll = __webpack_require__(11778);
|
||||
;// CONCATENATED MODULE: ./src/components/RenderHtml/index.tsx
|
||||
var __defProp = Object.defineProperty;
|
||||
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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const ADD_MULTI = "@\u2581\u2581@";
|
||||
const ADD_SINGLE = "@\u2581@";
|
||||
const preRegex = /<pre[^>]*>/g;
|
||||
function _unescape(str) {
|
||||
let div = document.createElement("div");
|
||||
div.innerHTML = str;
|
||||
return div.childNodes.length === 0 ? "" : div.childNodes[0].nodeValue;
|
||||
}
|
||||
/* harmony default export */ var RenderHtml = (({
|
||||
value = "",
|
||||
className,
|
||||
showTextOnly,
|
||||
showLines,
|
||||
style = {},
|
||||
stylesPrev = {},
|
||||
highlightKeywords,
|
||||
showProgramFill,
|
||||
isProgramFill,
|
||||
disabledFill = false,
|
||||
programFillValue,
|
||||
onFillChange = (value2) => {
|
||||
},
|
||||
onFillBlur = () => {
|
||||
}
|
||||
}) => {
|
||||
let str = String(value);
|
||||
const [data, setData] = (0,_react_17_0_2_react.useState)("");
|
||||
const [type, setType] = (0,_react_17_0_2_react.useState)("office");
|
||||
const [projectValue, setProjectValue] = (0,_react_17_0_2_react.useState)([]);
|
||||
const classNamesRef = (0,_react_17_0_2_react.useRef)("a" + (0,v4/* default */.Z)());
|
||||
const formObj = {};
|
||||
const createInput = (a, num) => {
|
||||
const input = document.createElement(a === ADD_SINGLE ? "input" : "textarea");
|
||||
input.style.width = "100%";
|
||||
input.style.height = a === ADD_SINGLE ? "40px" : "151px";
|
||||
input.rows = 5;
|
||||
input.spellcheck = false;
|
||||
input.name = "edu-program-fill";
|
||||
input.placeholder = "\u8BF7\u8F93\u5165";
|
||||
input.dataset.id = num;
|
||||
const key = Object.keys(formObj).length;
|
||||
formObj[key] = input;
|
||||
return `<span class="edu-program-fill-wrap ${a === ADD_SINGLE ? "" : "show"}" style="width:${a === ADD_SINGLE ? "200px" : "100%"}"><span>${input.outerHTML}<span class="edu-program-fill-score"></span></span></span>`;
|
||||
};
|
||||
const formatMD = (rs) => {
|
||||
return rs.replace(/<style.*?>([\s\S]+?)<\/style>/gim, function(_, css) {
|
||||
let _css = css.replace(/(\n|\r)/g, "").split("}");
|
||||
let arr = [];
|
||||
_css.map((item) => {
|
||||
if (item != "") {
|
||||
arr.push(`.${classNamesRef.current} ${item}`);
|
||||
}
|
||||
});
|
||||
return `<style>${arr.join("}")}</style>`;
|
||||
});
|
||||
};
|
||||
const html = (0,_react_17_0_2_react.useMemo)(() => {
|
||||
try {
|
||||
const reg = /\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g;
|
||||
const reg2 = /\"\/api\/attachments\/|\"\/attachments\/download\//g;
|
||||
const reg3 = /\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;
|
||||
str = str.replace(reg, "(" + env/* default */.Z.API_SERVER + "/api/attachments/").replace(reg2, '"' + env/* default */.Z.API_SERVER + "/api/attachments/").replace(reg3, '"' + env/* default */.Z.API_SERVER + "/files/uploads/").replaceAll("http://video.educoder", "https://video.educoder").replaceAll("http://www.educoder.net/api", "https://data.educoder.net/api").replaceAll("https://www.educoder.net/api", "https://data.educoder.net/api").replace(/\r\n/g, "\n");
|
||||
} catch (e) {
|
||||
}
|
||||
;
|
||||
if (showProgramFill) {
|
||||
let num = -1;
|
||||
str = str.replaceAll("<", "<").replaceAll(">", ">").replace(/(@▁▁@|@▁@)/g, function(a, b, c) {
|
||||
++num;
|
||||
return createInput(a, num);
|
||||
});
|
||||
return `<pre style="background:#fff;padding:4px">${formatMD(str || "")}</pre>`;
|
||||
}
|
||||
let rs = utils_marked(str);
|
||||
rs = formatMD(rs);
|
||||
const math_expressions = getMathExpressions();
|
||||
if (str.match(/\[TOC\]/)) {
|
||||
rs = rs.replace("<p>[TOC]</p>", getTocContent());
|
||||
cleanToc();
|
||||
}
|
||||
rs = rs.replace(/(__special_katext_id_\d+__)/g, (_match, capture) => {
|
||||
const { type: type2, expression } = math_expressions[capture];
|
||||
return (0,katex.renderToString)(_unescape(expression) || "", {
|
||||
displayMode: type2 === "block",
|
||||
throwOnError: false,
|
||||
output: "html"
|
||||
});
|
||||
});
|
||||
rs = rs.replace(/▁/g, "\u2581\u2581\u2581");
|
||||
resetMathExpressions();
|
||||
const dom = document.createElement("div");
|
||||
dom.innerHTML = rs;
|
||||
if (highlightKeywords) {
|
||||
const escapedKeywords = highlightKeywords.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||
findKeyword(dom, escapedKeywords);
|
||||
return dom.innerHTML;
|
||||
}
|
||||
if (showTextOnly) {
|
||||
return dom.innerText;
|
||||
}
|
||||
setTimeout(() => onLoad(), 500);
|
||||
return dom.innerHTML;
|
||||
}, [str, highlightKeywords]);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
if (el.current) {
|
||||
const inputs = el.current.querySelectorAll(["input", "textarea"]);
|
||||
inputs.forEach((input) => {
|
||||
input.oninput = onInput;
|
||||
input.onblur = onBlur;
|
||||
});
|
||||
}
|
||||
}, [projectValue]);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
var _a, _b, _c;
|
||||
if (!!(programFillValue == null ? void 0 : programFillValue.length)) {
|
||||
const scoreDom = el.current.querySelectorAll(".edu-program-fill-score");
|
||||
const dom = el.current.querySelectorAll('[name="edu-program-fill"]');
|
||||
for (const [k, i] of dom.entries()) {
|
||||
i.value = (_a = programFillValue[k]) == null ? void 0 : _a.value;
|
||||
if (programFillValue[k].type === "warning") {
|
||||
i.className = "program-fill-warning";
|
||||
} else if (programFillValue[k].type === "success") {
|
||||
i.className = "program-fill-success";
|
||||
} else {
|
||||
i.className = "";
|
||||
}
|
||||
}
|
||||
for (const [k, i] of scoreDom.entries()) {
|
||||
i.innerHTML = ((_b = programFillValue[k]) == null ? void 0 : _b.score) ? `${(_c = programFillValue[k]) == null ? void 0 : _c.score}\u5206` : "";
|
||||
}
|
||||
setProjectValue(programFillValue);
|
||||
}
|
||||
}, [programFillValue]);
|
||||
const onInput = (e) => {
|
||||
projectValue[e.target.dataset.id] = projectValue[e.target.dataset.id] || {};
|
||||
projectValue[e.target.dataset.id]["value"] = e.target.value;
|
||||
setProjectValue([...projectValue]);
|
||||
onFillChange(projectValue, e.target.dataset.id);
|
||||
};
|
||||
const onBlur = (e) => {
|
||||
projectValue[e.target.dataset.id] = projectValue[e.target.dataset.id] || {};
|
||||
projectValue[e.target.dataset.id]["value"] = e.target.value;
|
||||
setProjectValue([...projectValue]);
|
||||
onFillBlur(projectValue, e.target.dataset.id);
|
||||
};
|
||||
function findKeyword(node, keyword) {
|
||||
return node.childNodes.forEach((childNode) => {
|
||||
var _a;
|
||||
if (childNode.childNodes.length > 0) {
|
||||
findKeyword(childNode, keyword);
|
||||
} else if (childNode.nodeName !== "IMG") {
|
||||
if (childNode.innerHTML) {
|
||||
childNode.innerHTML = (_a = childNode.innerHTML) == null ? void 0 : _a.replace(new RegExp(keyword, "gi"), '<span style="color:#0152d9;background-color:#1890ff33">$&</span>');
|
||||
} else {
|
||||
const dom = document.createElement("span");
|
||||
dom.innerHTML = childNode.textContent.replace(new RegExp(keyword, "gi"), '<span style="color:#0152d9;background-color:#1890ff33">$&</span>');
|
||||
childNode.replaceWith(dom);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
const el = (0,_react_17_0_2_react.useRef)();
|
||||
lines["WebkitLineClamp"] = showLines;
|
||||
if (showLines) {
|
||||
style = __spreadValues(__spreadValues({}, style), lines);
|
||||
}
|
||||
function onAncherHandler(e) {
|
||||
let target = e.target;
|
||||
if (target.tagName.toUpperCase() === "A") {
|
||||
let ancher = target.getAttribute("href");
|
||||
if (ancher.indexOf("office") > -1) {
|
||||
e.preventDefault();
|
||||
setData(ancher);
|
||||
setType("office");
|
||||
} else if (ancher.indexOf("application/pdf") > -1) {
|
||||
e.preventDefault();
|
||||
setData(ancher);
|
||||
setType("pdf");
|
||||
} else if (ancher.indexOf("text/html") > -1) {
|
||||
e.preventDefault();
|
||||
setData(ancher);
|
||||
setType("html");
|
||||
} else if (ancher.startsWith("#")) {
|
||||
e.preventDefault();
|
||||
let viewEl = document.getElementById(ancher.replace("#", ""));
|
||||
if (viewEl) {
|
||||
viewEl.scrollIntoView(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const onLoad = () => {
|
||||
var _a;
|
||||
const videoElement = (_a = el.current) == null ? void 0 : _a.querySelectorAll("video");
|
||||
videoElement == null ? void 0 : videoElement.forEach((item) => {
|
||||
item.oncontextmenu = () => {
|
||||
return false;
|
||||
};
|
||||
if (item.src.indexOf(".m3u8") > -1) {
|
||||
if (item.canPlayType("application/vnd.apple.mpegurl")) {
|
||||
} else if (dist_hls/* default */.Z.isSupported()) {
|
||||
var hls = new dist_hls/* default */.Z();
|
||||
hls.loadSource(item.src);
|
||||
hls.attachMedia(item);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
if (el.current && html) {
|
||||
if (html.match(preRegex)) {
|
||||
window.PR.prettyPrint();
|
||||
}
|
||||
}
|
||||
if (el.current) {
|
||||
el.current.addEventListener("click", onAncherHandler);
|
||||
return () => {
|
||||
var _a;
|
||||
(_a = el.current) == null ? void 0 : _a.removeEventListener("click", onAncherHandler);
|
||||
resetMathExpressions();
|
||||
cleanToc();
|
||||
};
|
||||
}
|
||||
}, [html, el.current, onAncherHandler]);
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, showTextOnly && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { ref: el }, html), !showTextOnly && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"div",
|
||||
{
|
||||
ref: el,
|
||||
style: __spreadValues({}, style),
|
||||
className: `${className ? className : ""} ${disabledFill ? "disabled-fill" : ""} markdown-body ${classNamesRef.current}`,
|
||||
dangerouslySetInnerHTML: { __html: html }
|
||||
}
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
PreviewAll/* default */.Z,
|
||||
{
|
||||
close: true,
|
||||
data,
|
||||
type: !!(data == null ? void 0 : data.length) ? type : "",
|
||||
style: __spreadValues({}, stylesPrev),
|
||||
onClose: () => setData("")
|
||||
}
|
||||
));
|
||||
});
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
@ -0,0 +1,693 @@
|
||||
"use strict";
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[2740],{
|
||||
|
||||
/***/ 29296:
|
||||
/*!***************************************************************!*\
|
||||
!*** ./src/components/FileDownloadList/index.tsx + 1 modules ***!
|
||||
\***************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ components_FileDownloadList; }
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
||||
var _react_17_0_2_react = __webpack_require__(59301);
|
||||
;// CONCATENATED MODULE: ./src/components/FileDownloadList/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var FileDownloadListmodules = ({"flex_box_center":"flex_box_center___A3pzf","flex_space_between":"flex_space_between___JBoa5","flex_box_vertical_center":"flex_box_vertical_center___MJuIO","flex_box_center_end":"flex_box_center_end___OcjUA","flex_box_column":"flex_box_column___zSH4A","list":"list___KhJas","middle":"middle___IjlYi","row":"row___GGtIx","title":"title___o_xqf","size":"size___OVRoL","download":"download___ZLcIH","preview":"preview___gi0kI","annotation":"annotation___KVSwj"});
|
||||
// EXTERNAL MODULE: ./node_modules/_classnames@2.3.2@classnames/index.js
|
||||
var _classnames_2_3_2_classnames = __webpack_require__(12124);
|
||||
var _classnames_2_3_2_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_3_2_classnames);
|
||||
// EXTERNAL MODULE: ./src/components/PreviewAll/index.tsx + 1 modules
|
||||
var PreviewAll = __webpack_require__(11778);
|
||||
// EXTERNAL MODULE: ./src/components/ImageDimensions/index.tsx + 1 modules
|
||||
var ImageDimensions = __webpack_require__(37704);
|
||||
// EXTERNAL MODULE: ./src/utils/util.tsx
|
||||
var util = __webpack_require__(3163);
|
||||
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
||||
var env = __webpack_require__(64741);
|
||||
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
||||
var fetch = __webpack_require__(87101);
|
||||
// EXTERNAL MODULE: ./src/utils/authority.ts
|
||||
var utils_authority = __webpack_require__(55830);
|
||||
;// CONCATENATED MODULE: ./src/components/FileDownloadList/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());
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const FileDownloadList = ({
|
||||
className,
|
||||
style,
|
||||
dataSource = [],
|
||||
authority = false,
|
||||
callback,
|
||||
showDimensions = true
|
||||
}) => {
|
||||
const [data, setData] = (0,_react_17_0_2_react.useState)({ content: "", type: "" });
|
||||
const [openData, setOpenData] = (0,_react_17_0_2_react.useState)({});
|
||||
const [isedit, setisedit] = (0,_react_17_0_2_react.useState)(false);
|
||||
const [dimensions, setDimensions] = (0,_react_17_0_2_react.useState)({
|
||||
title: "",
|
||||
visible: false,
|
||||
src: "",
|
||||
snapshotData: {}
|
||||
});
|
||||
const monacoValueRef = (0,_react_17_0_2_react.useRef)();
|
||||
const handleClick = (item) => __async(void 0, null, function* () {
|
||||
setOpenData(item);
|
||||
if (item.file_type === "txt") {
|
||||
const res = yield (0,fetch/* default */.ZP)(item.url, {
|
||||
method: "get",
|
||||
headers: {
|
||||
"Content-Type": "application/xml"
|
||||
}
|
||||
});
|
||||
monacoValueRef.current = res;
|
||||
}
|
||||
setData({
|
||||
type: item.file_type,
|
||||
content: env/* default */.Z.API_SERVER + item.url
|
||||
});
|
||||
});
|
||||
const handleAnnotation = (item) => {
|
||||
var _a;
|
||||
setDimensions({
|
||||
visible: true,
|
||||
src: env/* default */.Z.API_SERVER + item.url,
|
||||
id: item.id,
|
||||
title: item.title,
|
||||
snapshotData: (_a = item == null ? void 0 : item.subitem) == null ? void 0 : _a.settings
|
||||
});
|
||||
};
|
||||
const handleCheckAnnotation = (item) => __async(void 0, null, function* () {
|
||||
var _a;
|
||||
setData({
|
||||
type: item.file_type,
|
||||
content: env/* default */.Z.API_SERVER + ((_a = item == null ? void 0 : item.subitem) == null ? void 0 : _a.url)
|
||||
});
|
||||
});
|
||||
const handleOk = () => {
|
||||
callback();
|
||||
setDimensions({ visible: false });
|
||||
};
|
||||
if (!(dataSource == null ? void 0 : dataSource.length)) {
|
||||
return null;
|
||||
}
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: _classnames_2_3_2_classnames_default()(FileDownloadListmodules.list, className), style }, dataSource.map((item, index) => {
|
||||
var _a, _b, _c;
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { key: index, className: FileDownloadListmodules.row }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"div",
|
||||
{
|
||||
className: FileDownloadListmodules.title,
|
||||
onClick: () => handleClick(item)
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-fujian1" }),
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("span", { title: item.title }, item.title)
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: FileDownloadListmodules.size }, item.filesize), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"div",
|
||||
{
|
||||
className: FileDownloadListmodules.download,
|
||||
onClick: () => {
|
||||
var _a2;
|
||||
(0,util/* downLoadLink */.Nd)("", `${env/* default */.Z.API_SERVER}${(_a2 = item.url) == null ? void 0 : _a2.replace("disposition=inline", "")}`);
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-xiazai4" }),
|
||||
"\u4E0B\u8F7D"
|
||||
), !["other", "download"].includes(item == null ? void 0 : item.file_type) && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"div",
|
||||
{
|
||||
className: FileDownloadListmodules.preview,
|
||||
onClick: () => handleClick(item)
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-yulan" }),
|
||||
"\u9884\u89C8"
|
||||
), ["image"].includes(item == null ? void 0 : item.file_type) && showDimensions && (authority ? /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"div",
|
||||
{
|
||||
className: FileDownloadListmodules.annotation,
|
||||
onClick: () => handleAnnotation(item)
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-pizhu" }),
|
||||
((_a = item.subitem) == null ? void 0 : _a.id) ? "\u4FEE\u6539\u6279\u6CE8" : "\u6279\u6CE8"
|
||||
) : ((_b = item.subitem) == null ? void 0 : _b.id) && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"div",
|
||||
{
|
||||
className: FileDownloadListmodules.annotation,
|
||||
onClick: () => handleCheckAnnotation(item)
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-chakanlaoshipizhu1" }),
|
||||
"\u67E5\u770B\u8001\u5E08\u6279\u6CE8"
|
||||
)), ["image"].includes(item == null ? void 0 : item.file_type) && ((_c = item.subitem) == null ? void 0 : _c.id) && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"div",
|
||||
{
|
||||
className: FileDownloadListmodules.download,
|
||||
style: { marginLeft: 20 },
|
||||
onClick: () => {
|
||||
var _a2, _b2;
|
||||
(0,util/* downLoadLink */.Nd)("", `${env/* default */.Z.API_SERVER}${(_b2 = (_a2 = item == null ? void 0 : item.subitem) == null ? void 0 : _a2.url) == null ? void 0 : _b2.replace("disposition=inline", "")}`);
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-xiazai4" }),
|
||||
"\u4E0B\u8F7D\u6279\u6CE8\u6587\u4EF6"
|
||||
), ["office"].includes(item == null ? void 0 : item.file_type) && (0,utils_authority/* isAdmins */.eB)() && ["xlsx", "docx", "pptx"].includes(item == null ? void 0 : item.file_sub) && showDimensions && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"div",
|
||||
{
|
||||
className: FileDownloadListmodules.annotation,
|
||||
onClick: () => {
|
||||
setisedit(true);
|
||||
handleClick(item);
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-pizhu" }),
|
||||
item.is_edit ? "\u4FEE\u6539\u6279\u6CE8" : "\u6279\u6CE8"
|
||||
), item.is_edit && (0,utils_authority/* isStudent */.dE)() && showDimensions && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"div",
|
||||
{
|
||||
className: FileDownloadListmodules.annotation,
|
||||
onClick: () => {
|
||||
handleClick(item);
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-sousuo7" }),
|
||||
"\u67E5\u770B\u8001\u5E08\u6279\u6CE8"
|
||||
));
|
||||
})), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
PreviewAll/* default */.Z,
|
||||
{
|
||||
close: true,
|
||||
data: data == null ? void 0 : data.content,
|
||||
type: data == null ? void 0 : data.type,
|
||||
hasMask: true,
|
||||
editOffice: isedit ? "edit" : "view",
|
||||
monacoEditor: {
|
||||
value: monacoValueRef.current,
|
||||
language: "txt",
|
||||
onChange: () => {
|
||||
},
|
||||
options: {
|
||||
readOnly: true,
|
||||
fontSize: 14,
|
||||
minimap: {
|
||||
enabled: false
|
||||
}
|
||||
}
|
||||
},
|
||||
onImgDimensions: authority && showDimensions && data.type === "image" ? () => handleAnnotation(openData) : null,
|
||||
onClose: () => {
|
||||
callback();
|
||||
setisedit(false);
|
||||
setData({ content: "", type: "" });
|
||||
}
|
||||
}
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
ImageDimensions/* default */.Z,
|
||||
{
|
||||
onOk: handleOk,
|
||||
onClose: () => setDimensions({ visible: false }),
|
||||
data: dimensions
|
||||
}
|
||||
));
|
||||
};
|
||||
/* harmony default export */ var components_FileDownloadList = (FileDownloadList);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 45982:
|
||||
/*!**********************************************************!*\
|
||||
!*** ./src/components/MultiUpload/index.tsx + 3 modules ***!
|
||||
\**********************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
z: function() { return /* binding */ coverToFileList; },
|
||||
Z: function() { return /* binding */ MultiUpload; }
|
||||
});
|
||||
|
||||
// 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/upload/index.js + 24 modules
|
||||
var upload = __webpack_require__(6557);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
||||
var es_message = __webpack_require__(8591);
|
||||
// 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/button/index.js
|
||||
var es_button = __webpack_require__(3113);
|
||||
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
||||
var env = __webpack_require__(64741);
|
||||
// EXTERNAL MODULE: ./src/pages/MoopCases/FormPanel/service.ts
|
||||
var service = __webpack_require__(18578);
|
||||
;// CONCATENATED MODULE: ./src/components/SingleUpload/index.tsx
|
||||
var __defProp = Object.defineProperty;
|
||||
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 __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 uploadNameSizeSeperator = "\u3000\u3000";
|
||||
function bytesToSize(bytes) {
|
||||
var sizes = ["Bytes", "KB", "MB", "GB", "TB"];
|
||||
if (bytes == 0)
|
||||
return "0 Byte";
|
||||
var i = parseInt("" + Math.floor(Math.log(bytes) / Math.log(1024)), 10);
|
||||
return (bytes / Math.pow(1024, i)).toFixed(1) + " " + sizes[i];
|
||||
}
|
||||
/* harmony default export */ var SingleUpload = (({
|
||||
value = [],
|
||||
action,
|
||||
onChange,
|
||||
className,
|
||||
maxSize = 150,
|
||||
title = "\u6587\u4EF6\u4E0A\u4F20",
|
||||
accept = null
|
||||
}) => {
|
||||
const uploadProps = {
|
||||
multiple: false,
|
||||
fileList: value,
|
||||
accept,
|
||||
withCredentials: true,
|
||||
beforeUpload: (file) => {
|
||||
const fileSize = file.size / 1024 / 1024;
|
||||
if (!(fileSize < maxSize)) {
|
||||
message.error(`\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(${maxSize}MB),\u5EFA\u8BAE\u4E0A\u4F20\u5230\u767E\u5EA6\u4E91\u7B49\u5176\u5B83\u5171\u4EAB\u5DE5\u5177\u91CC\uFF0C\u7136\u540E\u518Dtxt\u6587\u6863\u91CC\u7ED9\u51FA\u94FE\u63A5\u4EE5\u53CA\u5171\u4EAB\u5BC6\u7801\u5E76\u4E0A\u4F20`);
|
||||
return Promise.reject();
|
||||
}
|
||||
return true;
|
||||
},
|
||||
action: `${ENV.API_SERVER}/api/attachments.json`,
|
||||
// ?debug=student&randomcode=undefined&client_key=6d57f8c3dd186c5ada392546ace9620a
|
||||
onChange(info) {
|
||||
var _a, _b, _c, _d;
|
||||
let fileList = [...info.fileList];
|
||||
fileList = fileList.map((file) => {
|
||||
if (file.name.indexOf(uploadNameSizeSeperator) === -1) {
|
||||
file.name = `${file.name}${uploadNameSizeSeperator}${bytesToSize(
|
||||
file.size
|
||||
)}`;
|
||||
}
|
||||
return __spreadValues({}, file);
|
||||
});
|
||||
if (info.file.status === "done" && ((_b = (_a = info.file) == null ? void 0 : _a.response) == null ? void 0 : _b.status) === -1) {
|
||||
message.error((_d = (_c = info.file) == null ? void 0 : _c.response) == null ? void 0 : _d.message);
|
||||
onChange([]);
|
||||
return;
|
||||
}
|
||||
onChange(fileList);
|
||||
},
|
||||
onRemove: (file) => __async(void 0, null, function* () {
|
||||
const fileSize = file.size / 1024 / 1024;
|
||||
if (file.status === "uploading") {
|
||||
return true;
|
||||
}
|
||||
if (!(fileSize < maxSize)) {
|
||||
return true;
|
||||
} else {
|
||||
let id = file.response ? file.response.id : file.uid;
|
||||
if (id) {
|
||||
let rs = yield removeAttachment(
|
||||
file.response ? file.response.id : file.id
|
||||
);
|
||||
return rs;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
function onCancel(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
return /* @__PURE__ */ React.createElement("div", { className: `single-upload ${className ? className : ""}` }, /* @__PURE__ */ React.createElement(Upload, __spreadValues({}, uploadProps), /* @__PURE__ */ React.createElement(
|
||||
Button,
|
||||
{
|
||||
type: "primary",
|
||||
title: value.length > 0 ? "\u6BCF\u6B21\u53EA\u80FD\u4E0A\u4F20\u4E00\u4E2A\u8D44\u6E90\uFF0C \u5220\u9664\u4E0B\u9762\u8D44\u6E90\u53EF\u91CD\u65B0\u4E0A\u4F20 " : "",
|
||||
disabled: value.length > 0,
|
||||
ghost: true
|
||||
},
|
||||
title
|
||||
), /* @__PURE__ */ React.createElement("span", { onClick: onCancel, style: { marginLeft: 10 } }, "(\u5355\u4E2A\u6587\u4EF6\u6700\u5927", maxSize, "M)", " ")));
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/InboxOutlined.js + 1 modules
|
||||
var InboxOutlined = __webpack_require__(60936);
|
||||
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js
|
||||
var lodash = __webpack_require__(89392);
|
||||
;// CONCATENATED MODULE: ./src/components/MultiUpload/index.less
|
||||
// extracted by mini-css-extract-plugin
|
||||
|
||||
;// CONCATENATED MODULE: ./src/assets/images/uploadImg.svg
|
||||
var uploadImg_defProp = Object.defineProperty;
|
||||
var uploadImg_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
||||
var uploadImg_hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var uploadImg_propIsEnum = Object.prototype.propertyIsEnumerable;
|
||||
var uploadImg_defNormalProp = (obj, key, value) => key in obj ? uploadImg_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
||||
var uploadImg_spreadValues = (a, b) => {
|
||||
for (var prop in b || (b = {}))
|
||||
if (uploadImg_hasOwnProp.call(b, prop))
|
||||
uploadImg_defNormalProp(a, prop, b[prop]);
|
||||
if (uploadImg_getOwnPropSymbols)
|
||||
for (var prop of uploadImg_getOwnPropSymbols(b)) {
|
||||
if (uploadImg_propIsEnum.call(b, prop))
|
||||
uploadImg_defNormalProp(a, prop, b[prop]);
|
||||
}
|
||||
return a;
|
||||
};
|
||||
|
||||
const SvgUploadImg = (props) => /* @__PURE__ */ React.createElement("svg", uploadImg_spreadValues({ width: 14, height: 14, xmlns: "http://www.w3.org/2000/svg" }, props), /* @__PURE__ */ React.createElement("title", null, "\u5F62\u72B6"), /* @__PURE__ */ React.createElement("path", { d: "M10.354 3.5h-2.77v8.167H6.416V3.5H3.646L7 0l3.354 3.5ZM14 7h-1.167v5.833H1.167V7H0v7h14V7Z", fill: "#3061D0", fillRule: "nonzero" }));
|
||||
|
||||
/* harmony default export */ var uploadImg = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEwLjM1NCAzLjVoLTIuNzd2OC4xNjdINi40MTZWMy41SDMuNjQ2TDcgMGwzLjM1NCAzLjVaTTE0IDdoLTEuMTY3djUuODMzSDEuMTY3VjdIMHY3aDE0VjdaIiBmaWxsPSIjMzA2MUQwIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=");
|
||||
|
||||
;// CONCATENATED MODULE: ./src/components/MultiUpload/index.tsx
|
||||
var MultiUpload_defProp = Object.defineProperty;
|
||||
var MultiUpload_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
||||
var MultiUpload_hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var MultiUpload_propIsEnum = Object.prototype.propertyIsEnumerable;
|
||||
var MultiUpload_defNormalProp = (obj, key, value) => key in obj ? MultiUpload_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
||||
var MultiUpload_spreadValues = (a, b) => {
|
||||
for (var prop in b || (b = {}))
|
||||
if (MultiUpload_hasOwnProp.call(b, prop))
|
||||
MultiUpload_defNormalProp(a, prop, b[prop]);
|
||||
if (MultiUpload_getOwnPropSymbols)
|
||||
for (var prop of MultiUpload_getOwnPropSymbols(b)) {
|
||||
if (MultiUpload_propIsEnum.call(b, prop))
|
||||
MultiUpload_defNormalProp(a, prop, b[prop]);
|
||||
}
|
||||
return a;
|
||||
};
|
||||
var MultiUpload_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 { Dragger } = upload["default"];
|
||||
function coverToFileList(data) {
|
||||
let rs = [];
|
||||
if (data && data.length > 0) {
|
||||
rs = data.map((item) => {
|
||||
return {
|
||||
uid: item.id,
|
||||
id: item.id,
|
||||
name: item.title + uploadNameSizeSeperator + item.filesize,
|
||||
url: item.url,
|
||||
filesize: item.filesize,
|
||||
status: "done",
|
||||
response: { id: item.id }
|
||||
};
|
||||
});
|
||||
}
|
||||
return rs;
|
||||
}
|
||||
/* harmony default export */ var MultiUpload = (({
|
||||
value,
|
||||
onChange,
|
||||
action,
|
||||
data,
|
||||
className,
|
||||
maxSize = 150,
|
||||
title = "\u4E0A\u4F20\u9644\u4EF6",
|
||||
showRemoveModal = false,
|
||||
accept = "",
|
||||
additionalText,
|
||||
isDragger,
|
||||
number = 1e3,
|
||||
aloneClear = false
|
||||
}) => {
|
||||
const [disabled, setDisabled] = (0,_react_17_0_2_react.useState)(false);
|
||||
let [fileList, setFileList] = (0,_react_17_0_2_react.useState)(value || []);
|
||||
let [nums, setnums] = (0,_react_17_0_2_react.useState)(1);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
if (value) {
|
||||
if (nums === 1) {
|
||||
setFileList([...value]);
|
||||
}
|
||||
setnums(2);
|
||||
if (number === (value == null ? void 0 : value.length)) {
|
||||
setDisabled(true);
|
||||
}
|
||||
}
|
||||
}, [value]);
|
||||
const clearLastFile = () => {
|
||||
setTimeout(() => {
|
||||
fileList.pop();
|
||||
setFileList([...fileList]);
|
||||
}, 500);
|
||||
};
|
||||
const uploadProps = {
|
||||
multiple: true,
|
||||
disabled,
|
||||
accept,
|
||||
withCredentials: true,
|
||||
fileList,
|
||||
// fileList: fileList?.length ? fileList : value,
|
||||
beforeUpload: (file, fileArr) => {
|
||||
const fileSize = file.size / 1024 / 1024;
|
||||
if (fileList.concat(fileArr).length > number) {
|
||||
fileList.pop();
|
||||
setFileList([...fileList]);
|
||||
es_message/* default */.ZP.error(`\u6700\u591A\u53EA\u80FD\u4E0A\u4F20${number}\u4E2A\u6587\u4EF6`);
|
||||
if (aloneClear) {
|
||||
return Promise.reject();
|
||||
}
|
||||
clearLastFile();
|
||||
return false;
|
||||
}
|
||||
if (!(fileSize < maxSize)) {
|
||||
es_message/* default */.ZP.error(`\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(${maxSize}MB).`);
|
||||
if (aloneClear) {
|
||||
return Promise.reject();
|
||||
}
|
||||
clearLastFile();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
data,
|
||||
action: action || `${env/* default */.Z.API_SERVER}/api/attachments.json`,
|
||||
// ?debug=student&randomcode=undefined&client_key=6d57f8c3dd186c5ada392546ace9620a
|
||||
onChange(info) {
|
||||
var _a, _b, _c, _d;
|
||||
if (info.file.status === "removed") {
|
||||
fileList = info.fileList;
|
||||
} else {
|
||||
fileList = (0,lodash.uniqBy)([...info.fileList, ...fileList], "uid");
|
||||
}
|
||||
if (info.file.status === "done" && ((_b = (_a = info.file) == null ? void 0 : _a.response) == null ? void 0 : _b.status) === -1) {
|
||||
es_message/* default */.ZP.error((_d = (_c = info.file) == null ? void 0 : _c.response) == null ? void 0 : _d.message);
|
||||
return;
|
||||
}
|
||||
if (fileList.length >= number)
|
||||
setDisabled(true);
|
||||
else
|
||||
setDisabled(false);
|
||||
setFileList([...fileList]);
|
||||
fileList = fileList.map((file) => {
|
||||
var _a2, _b2;
|
||||
if ((_a2 = file == null ? void 0 : file.response) == null ? void 0 : _a2.id) {
|
||||
file.url = `/api/attachments/${(_b2 = file == null ? void 0 : file.response) == null ? void 0 : _b2.id}`;
|
||||
}
|
||||
if (file.name.indexOf(uploadNameSizeSeperator) === -1) {
|
||||
file.name = `${file.name}${uploadNameSizeSeperator}${bytesToSize(
|
||||
file.size
|
||||
)}`;
|
||||
}
|
||||
return MultiUpload_spreadValues({}, file);
|
||||
});
|
||||
console.log("info:", info, fileList);
|
||||
onChange(fileList);
|
||||
},
|
||||
onRemove: (file) => MultiUpload_async(void 0, null, function* () {
|
||||
const remove = () => MultiUpload_async(void 0, null, function* () {
|
||||
let id = file.response ? file.response.id : file.id;
|
||||
if (id) {
|
||||
let rs = yield (0,service/* removeAttachment */.JZ)(
|
||||
file.response ? file.response.id : file.uid
|
||||
);
|
||||
return Promise.resolve(rs);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (showRemoveModal) {
|
||||
return new Promise((resolve, reject) => {
|
||||
modal["default"].confirm({
|
||||
centered: true,
|
||||
width: 530,
|
||||
okText: "\u786E\u5B9A",
|
||||
cancelText: "\u53D6\u6D88",
|
||||
title: "\u63D0\u793A",
|
||||
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "tc font16" }, "\u662F\u5426\u786E\u8BA4\u5220\u9664?"),
|
||||
onOk: () => MultiUpload_async(void 0, null, function* () {
|
||||
const res = yield remove();
|
||||
es_message/* default */.ZP.success("\u5220\u9664\u6210\u529F");
|
||||
resolve(true);
|
||||
}),
|
||||
onCancel: () => {
|
||||
return resolve(false);
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
return yield remove();
|
||||
}
|
||||
})
|
||||
};
|
||||
function onCancel(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `multi-upload ${className ? className : ""}` }, isDragger && /* @__PURE__ */ _react_17_0_2_react.createElement(Dragger, MultiUpload_spreadValues({}, uploadProps), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "ant-upload-drag-icon" }, /* @__PURE__ */ _react_17_0_2_react.createElement(InboxOutlined/* default */.Z, null)), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "ant-upload-text" }, "\u70B9\u51FB\u4E0A\u4F20\u56FE\u6807\uFF0C\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u4EF6\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64", /* @__PURE__ */ _react_17_0_2_react.createElement("br", null), "(\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\u4E3A", maxSize, "MB)", " "), additionalText), !isDragger && /* @__PURE__ */ _react_17_0_2_react.createElement(upload["default"], MultiUpload_spreadValues({}, uploadProps), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { disabled, className: "upload_button" }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { className: "aBtn_img", src: uploadImg }), title), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { onClick: onCancel, className: "upload_text" }, "(\u5355\u4E2A\u6587\u4EF6\u6700\u5927", maxSize, "MB)", " ")));
|
||||
});
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 18578:
|
||||
/*!**************************************************!*\
|
||||
!*** ./src/pages/MoopCases/FormPanel/service.ts ***!
|
||||
\**************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ $J: function() { return /* binding */ getMoopCase; },
|
||||
/* harmony export */ JZ: function() { return /* binding */ removeAttachment; },
|
||||
/* harmony export */ bN: function() { return /* binding */ updateMoopCase; },
|
||||
/* harmony export */ jP: function() { return /* binding */ addMoopCase; },
|
||||
/* harmony export */ rO: function() { return /* binding */ getLibraryTags; }
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/utils/fetch */ 87101);
|
||||
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());
|
||||
});
|
||||
};
|
||||
|
||||
function getMoopCase(id) {
|
||||
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .get */ .U2)(`libraries/${id}.json`);
|
||||
}
|
||||
function getLibraryTags() {
|
||||
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .get */ .U2)("library_tags.json");
|
||||
}
|
||||
function removeAttachment(id) {
|
||||
return __async(this, null, function* () {
|
||||
const response = yield (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .del */ .IV)(`attachments/${id}.json`);
|
||||
return response.status === 0;
|
||||
});
|
||||
}
|
||||
function addMoopCase(params) {
|
||||
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`libraries.json`, params);
|
||||
}
|
||||
function updateMoopCase(id, params) {
|
||||
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .put */ .gz)(`libraries/${id}.json`, params);
|
||||
}
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
@ -0,0 +1,651 @@
|
||||
"use strict";
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[2791],{
|
||||
|
||||
/***/ 37559:
|
||||
/*!***********************************************************************!*\
|
||||
!*** ./src/pages/Classrooms/Lists/Exercise/Export/index.less?modules ***!
|
||||
\***********************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
||||
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ __webpack_exports__.Z = ({"flex_box_center":"flex_box_center___GW1u0","flex_space_between":"flex_space_between___XhK9z","flex_box_vertical_center":"flex_box_vertical_center___NKIbp","flex_box_center_end":"flex_box_center_end___V3qhT","flex_box_column":"flex_box_column___b4G29","bg":"bg___exMJB","paginationWrapper":"paginationWrapper___ROsRI","totalText":"totalText___PGE6D","num":"num___jLrBF","title":"title___yiXeD","questionIcons":"questionIcons___v75Tz","green":"green___HRGef","orange":"orange___tdW4E","greenTip":"greenTip___f2SpQ","redTip":"redTip___jc8UE","orangeTip":"orangeTip___VMO_s","flexRow":"flexRow___Jshv2","simpleWrap":"simpleWrap___ul6oi","divider":"divider___Of_8z","modal":"modal___oAD7F","programTitle":"programTitle___ybswa","simpleBg":"simpleBg___yLrQy","exportBtn":"exportBtn___x5fcE","export_type_modal":"export_type_modal___hmW4i","export_type_modal_con":"export_type_modal_con___R2S3f","type_item":"type_item___NsmrH","img_warp":"img_warp___LUfHa","img_warp_active":"img_warp_active____uL7y"});
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 79548:
|
||||
/*!*********************************************************************************!*\
|
||||
!*** ./src/pages/Classrooms/Lists/Exercise/Review/component/index.less?modules ***!
|
||||
\*********************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
||||
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ __webpack_exports__.Z = ({"flex_box_center":"flex_box_center___VAUts","flex_space_between":"flex_space_between___gx5ZV","flex_box_vertical_center":"flex_box_vertical_center___HV_tL","flex_box_center_end":"flex_box_center_end___fVsIw","flex_box_column":"flex_box_column___F5DHk","shixunWrp":"shixunWrp___pinaF","s":"s___mtpV4","fillComment":"fillComment___WEgkI","commentContent":"commentContent___v_Ebo","commentText":"commentText___fyDle","simpleWrap":"simpleWrap___uwIie","fillBg":"fillBg___iyMsm","simpleBg":"simpleBg___UqElF","lookCode":"lookCode___xKifS"});
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 75517:
|
||||
/*!***********************************************************************!*\
|
||||
!*** ./src/pages/Classrooms/Lists/Exercise/Review/index.less?modules ***!
|
||||
\***********************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
||||
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ __webpack_exports__.Z = ({"flex_box_center":"flex_box_center___D6Qly","flex_space_between":"flex_space_between___ZA98O","flex_box_vertical_center":"flex_box_vertical_center___aST6E","flex_box_center_end":"flex_box_center_end___kJ_eQ","flex_box_column":"flex_box_column___ZOkyZ","bg":"bg___rbSyL","circularBlue":"circularBlue___qvnla","circularRed":"circularRed___jo0FU","circularOrange":"circularOrange___GteY7","circularGreen":"circularGreen___PW_tz","circularGrey":"circularGrey___Nt7Wc","title":"title___Volf5","questionIcons":"questionIcons___MIxzq","grey":"grey___XquYB","green":"green___sjsXt","blue":"blue___Jwa9H","orange":"orange___cGfa7","red":"red___NensB","greenTip":"greenTip___lDmky","redTip":"redTip___Yp9nM","cccTip":"cccTip___Uzudc","orangeTip":"orangeTip___gA104","flexRow":"flexRow___GsOMs","simpleWrap":"simpleWrap___jppmP","userPhoto":"userPhoto___LUsoO","CCCIcons":"CCCIcons___STbxr","buttonFixed":"buttonFixed___aUnd3","progress":"progress___w_inO","typeTitle":"typeTitle___i1hJu","answerResult":"answerResult___kLknn","questionsInfo":"questionsInfo___spnx1","leftBar":"leftBar___AjrjB","greenBg":"greenBg___nlTOV","blueBg":"blueBg___nYACT","redBg":"redBg___WTgtT","orangeBg":"orangeBg___mMAXu","greyBg":"greyBg___eAdgQ","commentText":"commentText___smAVm","full":"full____Rgkm","answerInfo":"answerInfo___iSSvg","listType":"listType___fUHyn","userInfo":"userInfo___sc77e","userImg":"userImg___mL2tk","userInfoTitle":"userInfoTitle___U2d5B","userInfoValue":"userInfoValue___DBOCD","status":"status___yZSrO","result":"result___TOeTF","evaluate":"evaluate___CJGFj","analysis":"analysis___NuY61","userInfoModel":"userInfoModel___jHeA_","width":"width___UtVF4","Title":"Title___BfkeS","Value":"Value___sj9SB","userInfoModelbody":"userInfoModelbody___nQNbP","answerError":"answerError___kJTJu","export_type_modal":"export_type_modal___UwY7W","export_type_modal_con":"export_type_modal_con___iD92j","type_item":"type_item___hBzOc","img_warp":"img_warp___ijcxd","img_warp_active":"img_warp_active___VUIa8","scoreByBlankRadio":"scoreByBlankRadio___Z7ZDy"});
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 60344:
|
||||
/*!***************************************************************************************************!*\
|
||||
!*** ./src/pages/Classrooms/Lists/Exercise/Review/component/AnswerComments/index.tsx + 1 modules ***!
|
||||
\***************************************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ component_AnswerComments; }
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
||||
var _react_17_0_2_react = __webpack_require__(59301);
|
||||
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Review/component/AnswerComments/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var AnswerCommentsmodules = ({"flex_box_center":"flex_box_center___hzSR8","flex_space_between":"flex_space_between___Mscip","flex_box_vertical_center":"flex_box_vertical_center___Uckau","flex_box_center_end":"flex_box_center_end___Kw1tf","flex_box_column":"flex_box_column___udgQE","comments":"comments___He0El","line":"line___P3zVB"});
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
|
||||
var row = __webpack_require__(95237);
|
||||
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
||||
var env = __webpack_require__(64741);
|
||||
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.10@dayjs/dayjs.min.js
|
||||
var dayjs_min = __webpack_require__(9498);
|
||||
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
|
||||
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Review/component/AnswerComments/index.tsx
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const AnswerComments = ({
|
||||
list,
|
||||
hideScore = false,
|
||||
newuserCommentVisible
|
||||
}) => {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, list == null ? void 0 : list.map((v) => {
|
||||
var _a, _b, _c, _d;
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mt20 mb20" }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", key: (_a = v == null ? void 0 : v.user) == null ? void 0 : _a.user_id }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: env/* default */.Z.API_SERVER + "/images/" + ((_b = v == null ? void 0 : v.user) == null ? void 0 : _b.image_url), width: "40", style: { borderRadius: 40 } }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "ml10 font16" }, (_c = v == null ? void 0 : v.user) == null ? void 0 : _c.name)), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AnswerCommentsmodules.comments }, (_d = v == null ? void 0 : v.comments) == null ? void 0 : _d.map((e, i) => {
|
||||
var _a2, _b2, _c2, _d2, _e;
|
||||
if (newuserCommentVisible && e.question_type !== 5) {
|
||||
if (i === 0) {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { key: ((_a2 = v == null ? void 0 : v.user) == null ? void 0 : _a2.user_id) + "-" + i }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", justify: "space-between" }, !!e.shixun_chanllge_position && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { flexShrink: 0, marginRight: 10 } }, "\u7B2C", e.shixun_chanllge_position, "\u5173"), !hideScore && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { flex: 1 } }, "\u539F\u59CB\u5F97\u5206", e == null ? void 0 : e.origin_score, "\u5206\uFF0C\u4FEE\u6B63\u4E3A", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-light-primary" }, e == null ? void 0 : e.score), "\u5206"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { flexShrink: 0 } }, dayjs_min_default()(e.updated_at).format("YYYY-MM-DD HH:mm"))), !!e.comment && /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u8BC4\u8BED\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-light-primary" }, e.comment)), ((_b2 = v == null ? void 0 : v.comments) == null ? void 0 : _b2.length) - 1 > i && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AnswerCommentsmodules.line }));
|
||||
}
|
||||
} else {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { key: ((_c2 = v == null ? void 0 : v.user) == null ? void 0 : _c2.user_id) + "-" + i }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", justify: "space-between" }, !!e.shixun_chanllge_position && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { flexShrink: 0, marginRight: 10 } }, "\u7B2C", e.shixun_chanllge_position, "\u5173"), !hideScore && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { flex: 1 } }, "\u539F\u59CB\u5F97\u5206", e == null ? void 0 : e.origin_score, "\u5206\uFF0C\u4FEE\u6B63\u4E3A", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-light-primary" }, e == null ? void 0 : e.score), "\u5206"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { flexShrink: 0 } }, dayjs_min_default()(e.updated_at).format("YYYY-MM-DD HH:mm"))), !!e.comment && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "flex-wrp" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u8BC4\u8BED\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-light-primary flex1", dangerouslySetInnerHTML: { __html: ((_d2 = e.comment) == null ? void 0 : _d2.replace(/\n/g, "<br/>")) || "" } })), ((_e = v == null ? void 0 : v.comments) == null ? void 0 : _e.length) - 1 > i && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AnswerCommentsmodules.line }));
|
||||
}
|
||||
})));
|
||||
}));
|
||||
};
|
||||
/* harmony default export */ var component_AnswerComments = (AnswerComments);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 52182:
|
||||
/*!***********************************************************************!*\
|
||||
!*** ./src/pages/Classrooms/Lists/Exercise/Review/component/Fill.tsx ***!
|
||||
\***********************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
||||
/* harmony import */ var _components_RenderHtml__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/RenderHtml */ 12586);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ 1056);
|
||||
/* harmony import */ var _SeeAnswer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SeeAnswer */ 92313);
|
||||
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./index.less?modules */ 79548);
|
||||
var __defProp = Object.defineProperty;
|
||||
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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const { TextArea } = antd__WEBPACK_IMPORTED_MODULE_4__["default"];
|
||||
const Fill = ({
|
||||
item,
|
||||
answerData,
|
||||
changeScoreData,
|
||||
textValue,
|
||||
textOnChange = () => {
|
||||
},
|
||||
seeAnswerVisible = true
|
||||
}) => {
|
||||
var _a;
|
||||
const [userAnswer, setUserAnswer] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
|
||||
const [showEdit, setShowEdit] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
||||
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
||||
if (changeScoreData == null ? void 0 : changeScoreData[item.q_position]) {
|
||||
!showEdit && setShowEdit(true);
|
||||
} else {
|
||||
showEdit && setShowEdit(false);
|
||||
}
|
||||
}, [changeScoreData == null ? void 0 : changeScoreData[item == null ? void 0 : item.q_position]]);
|
||||
(_a = item == null ? void 0 : item.standard_answer) == null ? void 0 : _a.map((jtem) => {
|
||||
jtem.used = false;
|
||||
});
|
||||
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
||||
var _a2;
|
||||
console.log("item=====", item, answerData, changeScoreData, "#37AD83;");
|
||||
const data = [];
|
||||
for (let i = 0; i < (item == null ? void 0 : item.multi_count); i++) {
|
||||
const param = ((_a2 = item == null ? void 0 : item.user_answer) == null ? void 0 : _a2.find((e) => e.choice_id === i + 1)) || {
|
||||
choice_id: i + 1,
|
||||
answer_text: ""
|
||||
};
|
||||
data.push(__spreadValues({}, param));
|
||||
}
|
||||
setUserAnswer(data);
|
||||
}, [item == null ? void 0 : item.user_answer]);
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.fillBg }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("aside", { className: "font14 c-light-primary mb5" }, "\u5B66\u751F\u7B54\u9898"), userAnswer == null ? void 0 : userAnswer.map((answer, index) => {
|
||||
var _a2, _b, _c, _d;
|
||||
let isRight = false;
|
||||
if (item.is_ordered) {
|
||||
isRight = (_c = (_b = (_a2 = item == null ? void 0 : item.standard_answer) == null ? void 0 : _a2[index]) == null ? void 0 : _b.answer_text) == null ? void 0 : _c.some((subItem) => {
|
||||
var _a3;
|
||||
return (subItem == null ? void 0 : subItem.trim()) == ((_a3 = answer == null ? void 0 : answer.answer_text) == null ? void 0 : _a3.trim());
|
||||
});
|
||||
} else {
|
||||
isRight = (_d = item == null ? void 0 : item.standard_answer) == null ? void 0 : _d.some((jtem) => {
|
||||
if (!(jtem == null ? void 0 : jtem.used)) {
|
||||
if (jtem.answer_text.some((subItem) => {
|
||||
var _a3;
|
||||
return (subItem == null ? void 0 : subItem.trim()) == ((_a3 = answer.answer_text) == null ? void 0 : _a3.trim());
|
||||
})) {
|
||||
jtem.used = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", null, "\u7B54\u6848(\u586B\u7A7A", index + 1, "):"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", null, item.question_type == 3 ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { style: { color: isRight ? "#37AD83" : "#E30000" } }, answer == null ? void 0 : answer.answer_text) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, { value: answer == null ? void 0 : answer.answer_text })));
|
||||
}), seeAnswerVisible && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(_SeeAnswer__WEBPACK_IMPORTED_MODULE_2__/* .SeeAnswer */ .u, { data: item }));
|
||||
};
|
||||
/* harmony default export */ __webpack_exports__.Z = (Fill);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 90458:
|
||||
/*!**************************************************************************!*\
|
||||
!*** ./src/pages/Classrooms/Lists/Exercise/Review/component/Program.tsx ***!
|
||||
\**************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
||||
/* harmony import */ var _components_RenderHtml__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/RenderHtml */ 12586);
|
||||
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! moment */ 9498);
|
||||
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_2__);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! antd */ 72315);
|
||||
/* harmony import */ var _components_monaco_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/monaco-editor */ 1699);
|
||||
/* harmony import */ var js_base64__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! js-base64 */ 24334);
|
||||
/* harmony import */ var js_base64__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(js_base64__WEBPACK_IMPORTED_MODULE_4__);
|
||||
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../index.less?modules */ 75517);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const Program = ({
|
||||
item,
|
||||
answerData,
|
||||
autoHeight
|
||||
}) => {
|
||||
var _a, _b, _c, _d, _e;
|
||||
const [data, setData] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
|
||||
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
||||
var _a2, _b2;
|
||||
if (((_a2 = item == null ? void 0 : item.evaluate_codes) == null ? void 0 : _a2.length) > 0) {
|
||||
setData((_b2 = item == null ? void 0 : item.evaluate_codes) == null ? void 0 : _b2.map((code, index) => {
|
||||
return {
|
||||
key: index + 1,
|
||||
error_msg: (code == null ? void 0 : code.error_msg) ? js_base64__WEBPACK_IMPORTED_MODULE_4__.Base64.decode(code == null ? void 0 : code.error_msg) : "",
|
||||
created_at: code.created_at
|
||||
};
|
||||
}));
|
||||
} else {
|
||||
setData([{ key: "--", error_msg: "--" }]);
|
||||
}
|
||||
}, [item == null ? void 0 : item.evaluate_codes]);
|
||||
const columns = [{
|
||||
title: "\u8BC4\u6D4B\u5E8F\u53F7",
|
||||
dataIndex: "key",
|
||||
width: "127px",
|
||||
key: "key",
|
||||
align: "center",
|
||||
render: (text, record) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", null, record.key)
|
||||
}, {
|
||||
title: "\u8BC4\u6D4B\u65F6\u95F4",
|
||||
dataIndex: "created_at",
|
||||
key: "created_at",
|
||||
align: "center",
|
||||
width: 200,
|
||||
render: (text, record) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", null, record.created_at ? moment__WEBPACK_IMPORTED_MODULE_2___default()(record.created_at).format("YYYY-MM-DD HH:mm") : "--")
|
||||
}, {
|
||||
title: "\u8BC4\u6D4B\u7ED3\u679C",
|
||||
dataIndex: "error_msg",
|
||||
key: "error_msg",
|
||||
align: "center",
|
||||
render: (text, record) => {
|
||||
var _a2;
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", null, record.error_msg ? ((_a2 = record.error_msg) == null ? void 0 : _a2.length) > 1e3 ? record.error_msg.substring(0, 1e3) + "..." : record.error_msg : "--");
|
||||
}
|
||||
}];
|
||||
const options = {
|
||||
selectOnLineNumbers: true,
|
||||
readOnly: true,
|
||||
minimap: {
|
||||
enabled: false
|
||||
},
|
||||
scrollBeyondLastLine: false
|
||||
};
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "mt15 mb15" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, { value: item == null ? void 0 : item.description })), (!!((_a = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _a.student_commit_status) && ((_b = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _b.student_commit_status) !== 0 || !!((_c = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _c.user_exercise_status) && ((_d = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _d.user_exercise_status) !== 0) && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_6__["default"],
|
||||
{
|
||||
className: "mt5",
|
||||
bordered: true,
|
||||
dataSource: data,
|
||||
columns,
|
||||
pagination: false
|
||||
}
|
||||
), !!((_e = item == null ? void 0 : item.user_answer) == null ? void 0 : _e.length) && (item == null ? void 0 : item.passed_code) && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("aside", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.shixunWrp }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("h3", null, "\u7B2C\u4E00\u6B21\u8BC4\u6D4B\u901A\u8FC7\u7684\u4EE3\u7801\uFF08\u672A\u901A\u5173\u5219\u4E3A\u6700\u540E\u4E00\u6B21\u63D0\u4EA4\u8BC4\u6D4B\u7684\u4EE3\u7801\uFF09"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
_components_monaco_editor__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP,
|
||||
{
|
||||
style: { border: "1px solid #ccc" },
|
||||
height: 300,
|
||||
language: "python",
|
||||
theme: "vs-light",
|
||||
value: (item == null ? void 0 : item.passed_code) ? js_base64__WEBPACK_IMPORTED_MODULE_4__.Base64.decode(item == null ? void 0 : item.passed_code) : "",
|
||||
autoHeight,
|
||||
options
|
||||
}
|
||||
)));
|
||||
};
|
||||
/* harmony default export */ __webpack_exports__.Z = (Program);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 92313:
|
||||
/*!****************************************************************************!*\
|
||||
!*** ./src/pages/Classrooms/Lists/Exercise/Review/component/SeeAnswer.tsx ***!
|
||||
\****************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ u: function() { return /* binding */ SeeAnswer; }
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd */ 95237);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! antd */ 43604);
|
||||
/* harmony import */ var _components_RenderHtml__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/RenderHtml */ 12586);
|
||||
|
||||
|
||||
|
||||
const SeeAnswer = ({ data }) => {
|
||||
const [show, setShow] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
||||
const renderDom = () => {
|
||||
var _a, _b, _c;
|
||||
switch (data.question_type) {
|
||||
case 3:
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("aside", { className: "mt20" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { style: { cursor: "pointer" }, className: "font14 c-blue current", onClick: () => {
|
||||
setShow(!show);
|
||||
} }, show ? "\u9690\u85CF\u53C2\u8003\u7B54\u6848" : "\u67E5\u770B\u53C2\u8003\u7B54\u6848"), show && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", null, (_a = data == null ? void 0 : data.standard_answer) == null ? void 0 : _a.map(function(item, key) {
|
||||
var _a2;
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, { style: { alignItems: "baseline" }, className: "mr20" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, { flex: "50px" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: "mt10" }, "\u586B\u7A7A", item.choice_id, ":")), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, { flex: 1 }, (_a2 = item == null ? void 0 : item.answer_text) == null ? void 0 : _a2.map(function(val, key2) {
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", null, val);
|
||||
})));
|
||||
})));
|
||||
break;
|
||||
case 8:
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("aside", { className: "mt20" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { style: { cursor: "pointer" }, className: "font14 c-blue current", onClick: () => {
|
||||
setShow(!show);
|
||||
} }, show ? "\u9690\u85CF\u53C2\u8003\u7B54\u6848" : "\u67E5\u770B\u53C2\u8003\u7B54\u6848"), show && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", null, (_b = data == null ? void 0 : data.standard_answer) == null ? void 0 : _b.map(function(item, key) {
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, { style: { alignItems: "baseline" }, className: "mr20" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, { flex: "50px" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: "mt10" }, "\u586B\u7A7A", item.choice_id, ":")), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, { flex: 1 }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", null, item == null ? void 0 : item.answer_text)));
|
||||
})));
|
||||
break;
|
||||
case 4:
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("aside", { className: "mt20" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { style: { cursor: "pointer" }, className: "font14 c-blue current", onClick: () => {
|
||||
setShow(!show);
|
||||
} }, show ? "\u9690\u85CF\u53C2\u8003\u7B54\u6848" : "\u67E5\u770B\u53C2\u8003\u7B54\u6848"), show && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, { value: (_c = data == null ? void 0 : data.standard_answer) == null ? void 0 : _c.join(" ") })));
|
||||
break;
|
||||
}
|
||||
};
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("section", null, renderDom());
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 81952:
|
||||
/*!*************************************************************************!*\
|
||||
!*** ./src/pages/Classrooms/Lists/Exercise/Review/component/Shixun.tsx ***!
|
||||
\*************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
||||
/* harmony import */ var _components_RenderHtml__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/RenderHtml */ 12586);
|
||||
/* harmony import */ var _utils_authority__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/utils/authority */ 55830);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! antd */ 6848);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! antd */ 85731);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! antd */ 8591);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! antd */ 72315);
|
||||
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! moment */ 9498);
|
||||
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_3__);
|
||||
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! umi */ 87210);
|
||||
/* harmony import */ var _components_monaco_editor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/monaco-editor */ 1699);
|
||||
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./index.less?modules */ 79548);
|
||||
var __defProp = Object.defineProperty;
|
||||
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 __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 Shixun = ({
|
||||
item,
|
||||
answerData,
|
||||
hasChangeScore = true,
|
||||
autoHeight,
|
||||
saveChangeScore = () => {
|
||||
}
|
||||
}) => {
|
||||
var _a, _b, _c;
|
||||
const [data, setData] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
|
||||
const [challengeData, setChallengeData] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
|
||||
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
||||
var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
||||
if (!((_a2 = item == null ? void 0 : item.shixun_details) == null ? void 0 : _a2.length)) {
|
||||
return;
|
||||
}
|
||||
let shixun = [];
|
||||
let challenge = [];
|
||||
for (let i = 0; i < ((_b2 = item == null ? void 0 : item.shixun_details) == null ? void 0 : _b2.length); i++) {
|
||||
for (let j = 0; j < (item == null ? void 0 : item.shixun_details[i].stage_list.length); j++) {
|
||||
let shixunItem = item == null ? void 0 : item.shixun_details[i].stage_list[j];
|
||||
shixun.push(__spreadValues(__spreadValues({}, shixunItem), {
|
||||
operation: (_f = (_e = (_d = (_c2 = item == null ? void 0 : item.shixun_details) == null ? void 0 : _c2[i]) == null ? void 0 : _d.shixun_detail) == null ? void 0 : _e[0]) == null ? void 0 : _f.game_identifier,
|
||||
shixun_challenge_id: (_g = item == null ? void 0 : item.shixun_details[i]) == null ? void 0 : _g.shixun_challenge_id
|
||||
}));
|
||||
}
|
||||
if ((_i = (_h = item == null ? void 0 : item.shixun_details) == null ? void 0 : _h[i]) == null ? void 0 : _i.shixun_detail) {
|
||||
challenge.push((_l = (_k = (_j = item == null ? void 0 : item.shixun_details) == null ? void 0 : _j[i]) == null ? void 0 : _k.shixun_detail) == null ? void 0 : _l[0]);
|
||||
}
|
||||
}
|
||||
setChallengeData(challenge);
|
||||
setData([...shixun]);
|
||||
}, [item == null ? void 0 : item.shixun_details]);
|
||||
const columns = [
|
||||
{
|
||||
title: "\u5173\u5361",
|
||||
dataIndex: "position",
|
||||
key: "position",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "\u4EFB\u52A1\u540D\u79F0",
|
||||
dataIndex: "name",
|
||||
key: "name",
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
width: 260,
|
||||
render: (name) => {
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, { title: name }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
"span",
|
||||
{
|
||||
className: "overflowHidden1",
|
||||
style: { maxWidth: "400px" },
|
||||
title: name && name.length > 25 ? name : ""
|
||||
},
|
||||
name
|
||||
));
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "\u8BC4\u6D4B\u6B21\u6570",
|
||||
dataIndex: "evaluate_count",
|
||||
key: "evaluate_count",
|
||||
align: "center",
|
||||
render: (testCount, item2) => {
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", null, item2.evaluate_count ? item2.evaluate_count : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: "color-grey-9" }, "--"));
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "\u5B8C\u6210\u65F6\u95F4",
|
||||
key: "finished_time",
|
||||
dataIndex: "finished_time",
|
||||
align: "center",
|
||||
render: (endTime, item2) => {
|
||||
let timeOver = false;
|
||||
if (item2.finished_time && (answerData == null ? void 0 : answerData.exercise) && (answerData == null ? void 0 : answerData.exercise_answer_user)) {
|
||||
if ((answerData == null ? void 0 : answerData.exercise.time) === -1) {
|
||||
timeOver = moment__WEBPACK_IMPORTED_MODULE_3___default()(answerData == null ? void 0 : answerData.exercise.end_time).isBefore(item2.finished_time);
|
||||
} else {
|
||||
timeOver = moment__WEBPACK_IMPORTED_MODULE_3___default()(answerData == null ? void 0 : answerData.exercise_answer_user.start_at).add(answerData == null ? void 0 : answerData.exercise.time, "m").isBefore(item2.finished_time);
|
||||
}
|
||||
}
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", null, item2.finished_time || /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: "c-grey-999" }, "--"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: "c-orange-ff9 " }, timeOver ? "\uFF08\u5DF2\u8D85\u65F6\uFF09" : ""));
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "\u8017\u65F6",
|
||||
dataIndex: "time_consuming",
|
||||
key: "time_consuming",
|
||||
align: "center",
|
||||
render: (time, item2) => {
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", null, item2.time_consuming || /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: "color-grey-9" }, "--"));
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "\u67E5\u770B\u7B54\u6848",
|
||||
dataIndex: "view_answer",
|
||||
key: "view_answer",
|
||||
align: "center",
|
||||
render: (exp, item2) => {
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", null, item2.view_answer ? "\u5DF2\u67E5\u770B" : "\u672A\u67E5\u770B");
|
||||
}
|
||||
},
|
||||
// {
|
||||
// title: "经验值",
|
||||
// dataIndex: "experience",
|
||||
// key: "experience",
|
||||
// align: 'center',
|
||||
// render: (exp: any, item: any) => {
|
||||
// return (
|
||||
// <span>
|
||||
// <span className="c-green">{item.myself_experience}</span>/
|
||||
// {item.experience}
|
||||
// </span>
|
||||
// );
|
||||
// },
|
||||
// },
|
||||
{
|
||||
title: "\u5F97\u5206/\u6EE1\u5206",
|
||||
dataIndex: "user_score",
|
||||
key: "user_score",
|
||||
align: "center",
|
||||
render: (exp, item2) => {
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: "c-orange" }, item2.user_score), "/", item2.game_score);
|
||||
}
|
||||
},
|
||||
hasChangeScore && {
|
||||
title: "\u8C03\u5206",
|
||||
dataIndex: "user_score",
|
||||
key: "user_score",
|
||||
align: "center",
|
||||
render: (value, data2, index) => {
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, { min: 0, max: Number(data2.game_score), defaultValue: value, onBlur: (e) => __async(void 0, null, function* () {
|
||||
if (e.target.value != value) {
|
||||
const res = yield saveChangeScore(__spreadValues(__spreadValues({}, item), { shixun_challenge_id: data2.shixun_challenge_id, shixunScore: e.target.value }));
|
||||
console.log("res: ", res);
|
||||
if (res == null ? void 0 : res.question_comments) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .ZP.success("\u5DF2\u4FEE\u6539\u5F53\u524D\u8BC4\u5206");
|
||||
}
|
||||
}
|
||||
}) });
|
||||
}
|
||||
}
|
||||
].filter((x) => !!x);
|
||||
const outputColumns = [{
|
||||
title: "\u8BC4\u6D4B\u6B21\u6570",
|
||||
dataIndex: "key",
|
||||
width: "127px",
|
||||
key: "key",
|
||||
align: "center",
|
||||
render: (text, record) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", null, record.key)
|
||||
}, {
|
||||
title: "\u8BE6\u7EC6\u4FE1\u606F",
|
||||
dataIndex: "error_msg",
|
||||
key: "error_msg",
|
||||
align: "center",
|
||||
render: (text, record) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", null, record.error_msg ? record.error_msg : "--")
|
||||
}, {
|
||||
title: "\u8BC4\u6D4B\u65F6\u95F4",
|
||||
dataIndex: "updated_at",
|
||||
key: "updated_at",
|
||||
align: "center",
|
||||
width: 200,
|
||||
render: (text, record) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", null, record.updated_at ? record.updated_at : "--")
|
||||
}];
|
||||
const options = {
|
||||
selectOnLineNumbers: true,
|
||||
readOnly: true,
|
||||
minimap: {
|
||||
enabled: false
|
||||
},
|
||||
scrollBeyondLastLine: false
|
||||
};
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (((_a = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _a.student_commit_status) !== 0 || ((_b = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _b.user_exercise_status) !== 0) && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "mt15" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", { className: "font16 c-grey-666" }, "\u9636\u6BB5\u6210\u7EE9"), !!(data == null ? void 0 : data.length) && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_10__["default"],
|
||||
{
|
||||
columns,
|
||||
dataSource: data,
|
||||
pagination: false
|
||||
}
|
||||
)), !!(challengeData == null ? void 0 : challengeData.length) && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", { className: "font16 c-grey-666 mt10" }, "\u5B9E\u8BAD\u8BE6\u60C5"), challengeData == null ? void 0 : challengeData.map((chanllenge, index) => {
|
||||
var _a2;
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "mt5" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: "font16 mr15" }, " \u7B2C", chanllenge.position, "\u5173"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(umi__WEBPACK_IMPORTED_MODULE_4__.Link, { className: "current c-black font16", to: `/tasks/${chanllenge.game_identifier}` }, chanllenge.name)), !!((_a2 = chanllenge == null ? void 0 : chanllenge.outputs) == null ? void 0 : _a2.length) && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_10__["default"],
|
||||
{
|
||||
bordered: true,
|
||||
dataSource: chanllenge.outputs.map((out) => ({ key: out.position, error_msg: out.output_detail, updated_at: out.updated_at })),
|
||||
columns: outputColumns,
|
||||
pagination: false
|
||||
}
|
||||
), (chanllenge == null ? void 0 : chanllenge.st) === 0 && chanllenge.passed_code && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.shixunWrp }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("h2", null, "\u6700\u540E\u4E00\u6B21\u901A\u5173\u7684\u4EE3\u7801\uFF08\u672A\u901A\u5173\u5219\u4E3A\u6700\u540E\u4E00\u6B21\u63D0\u4EA4\u8BC4\u6D4B\u7684\u4EE3\u7801\uFF09", /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: "c-light-black" }, chanllenge.path)), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
_components_monaco_editor__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .ZP,
|
||||
{
|
||||
height: 300,
|
||||
autoHeight,
|
||||
language: "python",
|
||||
theme: "default",
|
||||
value: chanllenge.passed_code,
|
||||
options
|
||||
}
|
||||
)));
|
||||
})), (0,_utils_authority__WEBPACK_IMPORTED_MODULE_2__/* .isStudent */ .dE)() && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
_components_RenderHtml__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z,
|
||||
{
|
||||
className: "c-grey-999 mt20 mb20",
|
||||
value: item == null ? void 0 : item.question_title
|
||||
}
|
||||
), (_c = item == null ? void 0 : item.shixun) == null ? void 0 : _c.map((shixun, index) => {
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", { className: "font16 c-grey-666 mb5" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: "mr20" }, "\u7B2C", shixun == null ? void 0 : shixun.challenge_position, "\u5173 ", shixun == null ? void 0 : shixun.challenge_name), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", null, shixun == null ? void 0 : shixun.challenge_score, "\u5206"));
|
||||
}), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "mb15" }));
|
||||
};
|
||||
/* harmony default export */ __webpack_exports__.Z = (Shixun);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 61999:
|
||||
/*!***************************!*\
|
||||
!*** ./src/utils/enum.ts ***!
|
||||
\***************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ c: function() { return /* binding */ QuestionType; }
|
||||
/* harmony export */ });
|
||||
/* unused harmony export PageType */
|
||||
var PageType = /* @__PURE__ */ ((PageType2) => {
|
||||
PageType2["FirstPage"] = "firstPage";
|
||||
PageType2["PrevPage"] = "prevPage";
|
||||
PageType2["NextPage"] = "nextPage";
|
||||
return PageType2;
|
||||
})(PageType || {});
|
||||
var QuestionType = /* @__PURE__ */ ((QuestionType2) => {
|
||||
QuestionType2[QuestionType2["Single"] = 0] = "Single";
|
||||
QuestionType2[QuestionType2["Multiple"] = 1] = "Multiple";
|
||||
QuestionType2[QuestionType2["Judge"] = 2] = "Judge";
|
||||
QuestionType2[QuestionType2["Fill"] = 3] = "Fill";
|
||||
QuestionType2[QuestionType2["Subjective"] = 4] = "Subjective";
|
||||
QuestionType2[QuestionType2["Shixun"] = 5] = "Shixun";
|
||||
QuestionType2[QuestionType2["Program"] = 6] = "Program";
|
||||
QuestionType2[QuestionType2["Combine"] = 7] = "Combine";
|
||||
return QuestionType2;
|
||||
})(QuestionType || {});
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
@ -0,0 +1,530 @@
|
||||
"use strict";
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[2809],{
|
||||
|
||||
/***/ 89257:
|
||||
/*!******************************************************************************!*\
|
||||
!*** ./src/pages/Classrooms/Lists/ProgramHomework/Detail/index.less?modules ***!
|
||||
\******************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
||||
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ __webpack_exports__.Z = ({"flex_box_center":"flex_box_center___eQ57b","flex_space_between":"flex_space_between___PVjBV","flex_box_vertical_center":"flex_box_vertical_center___ghTL_","flex_box_center_end":"flex_box_center_end___z8oKm","flex_box_column":"flex_box_column___JQV5n","title":"title___w80Ja","workListTabWrap":"workListTabWrap___YRwm7","workListTabButton":"workListTabButton___ebGCB","tables":"tables___AYvHM","checkboxgroup":"checkboxgroup___fZHgL"});
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 94360:
|
||||
/*!*******************************************!*\
|
||||
!*** ./src/assets/images/question/b1.svg ***!
|
||||
\*******************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* unused harmony export ReactComponent */
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
||||
var __defProp = Object.defineProperty;
|
||||
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;
|
||||
};
|
||||
|
||||
const SvgB1 = (props) => /* @__PURE__ */ React.createElement("svg", __spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: 14, height: 18 }, props), /* @__PURE__ */ React.createElement("path", { fill: "#F7B500", d: "M7 4c3.899 0 7 3.141 7 7s-3.101 7-7 7-7-3.141-7-7 3.101-7 7-7Zm1 3H6.395a3.501 3.501 0 0 1-.857 1.245c-.32.294-.752.551-1.297.772L4 9.109V10.9c.448-.154.82-.315 1.117-.483.222-.126.45-.282.685-.466l.236-.194V15H8V7ZM4.812 0c.175 0 .35.16.438.318l1.313 2.309s-2.8.16-4.463 1.672L.088.716C0 .636 0 .557 0 .478 0 .159.263 0 .525 0Zm8.663 0c.263 0 .525.239.525.478 0 .08 0 .159-.088.238L11.9 4.22c-1.662-1.433-4.463-1.592-4.463-1.592L8.75.318C8.75.16 8.925 0 9.188 0Z" }));
|
||||
|
||||
/* harmony default export */ __webpack_exports__.Z = ("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxOCI+PHBhdGggZmlsbD0iI0Y3QjUwMCIgZD0iTTcgNGMzLjg5OSAwIDcgMy4xNDEgNyA3cy0zLjEwMSA3LTcgNy03LTMuMTQxLTctNyAzLjEwMS03IDctN1ptMSAzSDYuMzk1YTMuNTAxIDMuNTAxIDAgMCAxLS44NTcgMS4yNDVjLS4zMi4yOTQtLjc1Mi41NTEtMS4yOTcuNzcyTDQgOS4xMDlWMTAuOWMuNDQ4LS4xNTQuODItLjMxNSAxLjExNy0uNDgzLjIyMi0uMTI2LjQ1LS4yODIuNjg1LS40NjZsLjIzNi0uMTk0VjE1SDhWN1pNNC44MTIgMGMuMTc1IDAgLjM1LjE2LjQzOC4zMThsMS4zMTMgMi4zMDlzLTIuOC4xNi00LjQ2MyAxLjY3MkwuMDg4LjcxNkMwIC42MzYgMCAuNTU3IDAgLjQ3OCAwIC4xNTkuMjYzIDAgLjUyNSAwWm04LjY2MyAwYy4yNjMgMCAuNTI1LjIzOS41MjUuNDc4IDAgLjA4IDAgLjE1OS0uMDg4LjIzOEwxMS45IDQuMjJjLTEuNjYyLTEuNDMzLTQuNDYzLTEuNTkyLTQuNDYzLTEuNTkyTDguNzUuMzE4QzguNzUuMTYgOC45MjUgMCA5LjE4OCAwWiIvPjwvc3ZnPg==");
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 25448:
|
||||
/*!*******************************************!*\
|
||||
!*** ./src/assets/images/question/b2.svg ***!
|
||||
\*******************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* unused harmony export ReactComponent */
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
||||
var __defProp = Object.defineProperty;
|
||||
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;
|
||||
};
|
||||
|
||||
const SvgB2 = (props) => /* @__PURE__ */ React.createElement("svg", __spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: 14, height: 18 }, props), /* @__PURE__ */ React.createElement("path", { fill: "#B9C4CF", d: "M7 4c3.899 0 7 3.141 7 7s-3.101 7-7 7-7-3.141-7-7 3.101-7 7-7Zm.05 3c-.675 0-1.203.092-1.584.276a2.056 2.056 0 0 0-.887.794c-.18.296-.31.691-.394 1.186l-.038.255 2.004.177c.055-.443.164-.753.326-.928a.814.814 0 0 1 .626-.263.81.81 0 0 1 .611.255c.162.17.243.375.243.614 0 .222-.081.456-.245.703-.164.247-.539.608-1.124 1.084-.96.776-1.613 1.45-1.962 2.02a4.363 4.363 0 0 0-.588 1.552L4 15h6v-1.781H6.877c.184-.197.343-.356.479-.478.136-.122.405-.334.808-.638.677-.523 1.145-1.002 1.401-1.438.257-.437.386-.895.386-1.374 0-.45-.112-.858-.336-1.22a2.043 2.043 0 0 0-.924-.808C8.301 7.088 7.753 7 7.05 7ZM4.812 0c.175 0 .35.16.437.318l1.313 2.309s-2.8.16-4.463 1.672L.088.716C0 .636 0 .557 0 .478 0 .159.263 0 .525 0Zm8.662 0c.263 0 .525.239.525.478 0 .08 0 .159-.088.238L11.9 4.22c-1.662-1.433-4.463-1.592-4.463-1.592L8.75.318C8.75.16 8.925 0 9.188 0Z" }));
|
||||
|
||||
/* harmony default export */ __webpack_exports__.Z = ("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxOCI+PHBhdGggZmlsbD0iI0I5QzRDRiIgZD0iTTcgNGMzLjg5OSAwIDcgMy4xNDEgNyA3cy0zLjEwMSA3LTcgNy03LTMuMTQxLTctNyAzLjEwMS03IDctN1ptLjA1IDNjLS42NzUgMC0xLjIwMy4wOTItMS41ODQuMjc2YTIuMDU2IDIuMDU2IDAgMCAwLS44ODcuNzk0Yy0uMTguMjk2LS4zMS42OTEtLjM5NCAxLjE4NmwtLjAzOC4yNTUgMi4wMDQuMTc3Yy4wNTUtLjQ0My4xNjQtLjc1My4zMjYtLjkyOGEuODE0LjgxNCAwIDAgMSAuNjI2LS4yNjMuODEuODEgMCAwIDEgLjYxMS4yNTVjLjE2Mi4xNy4yNDMuMzc1LjI0My42MTQgMCAuMjIyLS4wODEuNDU2LS4yNDUuNzAzLS4xNjQuMjQ3LS41MzkuNjA4LTEuMTI0IDEuMDg0LS45Ni43NzYtMS42MTMgMS40NS0xLjk2MiAyLjAyYTQuMzYzIDQuMzYzIDAgMCAwLS41ODggMS41NTJMNCAxNWg2di0xLjc4MUg2Ljg3N2MuMTg0LS4xOTcuMzQzLS4zNTYuNDc5LS40NzguMTM2LS4xMjIuNDA1LS4zMzQuODA4LS42MzguNjc3LS41MjMgMS4xNDUtMS4wMDIgMS40MDEtMS40MzguMjU3LS40MzcuMzg2LS44OTUuMzg2LTEuMzc0IDAtLjQ1LS4xMTItLjg1OC0uMzM2LTEuMjJhMi4wNDMgMi4wNDMgMCAwIDAtLjkyNC0uODA4QzguMzAxIDcuMDg4IDcuNzUzIDcgNy4wNSA3Wk00LjgxMiAwYy4xNzUgMCAuMzUuMTYuNDM3LjMxOGwxLjMxMyAyLjMwOXMtMi44LjE2LTQuNDYzIDEuNjcyTC4wODguNzE2QzAgLjYzNiAwIC41NTcgMCAuNDc4IDAgLjE1OS4yNjMgMCAuNTI1IDBabTguNjYyIDBjLjI2MyAwIC41MjUuMjM5LjUyNS40NzggMCAuMDggMCAuMTU5LS4wODguMjM4TDExLjkgNC4yMmMtMS42NjItMS40MzMtNC40NjMtMS41OTItNC40NjMtMS41OTJMOC43NS4zMThDOC43NS4xNiA4LjkyNSAwIDkuMTg4IDBaIi8+PC9zdmc+");
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 32371:
|
||||
/*!*******************************************!*\
|
||||
!*** ./src/assets/images/question/b3.svg ***!
|
||||
\*******************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* unused harmony export ReactComponent */
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
||||
var __defProp = Object.defineProperty;
|
||||
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;
|
||||
};
|
||||
|
||||
const SvgB3 = (props) => /* @__PURE__ */ React.createElement("svg", __spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: 14, height: 18 }, props), /* @__PURE__ */ React.createElement("path", { fill: "#D09F18", d: "M7 4c3.899 0 7 3.141 7 7s-3.101 7-7 7-7-3.141-7-7 3.101-7 7-7Zm-.062 3c-.826 0-1.464.172-1.915.517-.4.307-.686.733-.856 1.278l-.058.21 1.908.364c.052-.383.153-.651.302-.804a.772.772 0 0 1 .58-.23c.23 0 .412.07.544.211.133.14.199.33.199.565a.88.88 0 0 1-.265.638.89.89 0 0 1-.662.27 1.35 1.35 0 0 1-.158-.012l-.104-.015-.105 1.536c.278-.085.496-.127.654-.127.298 0 .533.099.707.296.173.197.26.475.26.833 0 .352-.09.634-.27.845a.852.852 0 0 1-.677.316.862.862 0 0 1-.636-.25c-.143-.144-.254-.384-.333-.723l-.036-.177L4 12.826c.132.482.321.882.567 1.2.246.319.56.56.942.726.381.165.902.248 1.563.248.677 0 1.224-.112 1.64-.335.416-.223.735-.542.956-.955.221-.414.332-.845.332-1.296 0-.359-.067-.667-.2-.926a1.633 1.633 0 0 0-.563-.625c-.149-.099-.363-.185-.644-.259.347-.204.606-.441.778-.712a1.66 1.66 0 0 0 .257-.908 1.82 1.82 0 0 0-.634-1.42C8.571 7.189 7.886 7 6.938 7ZM4.813 0c.175 0 .35.17.437.338l1.313 2.453s-2.8.17-4.463 1.776L.088.761C0 .677 0 .592 0 .507 0 .17.263 0 .525 0Zm8.662 0c.263 0 .525.254.525.507 0 .085 0 .17-.088.254L11.9 4.483C10.238 2.96 7.437 2.79 7.437 2.79L8.75.338C8.75.17 8.925 0 9.188 0Z" }));
|
||||
|
||||
/* harmony default export */ __webpack_exports__.Z = ("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxOCI+PHBhdGggZmlsbD0iI0QwOUYxOCIgZD0iTTcgNGMzLjg5OSAwIDcgMy4xNDEgNyA3cy0zLjEwMSA3LTcgNy03LTMuMTQxLTctNyAzLjEwMS03IDctN1ptLS4wNjIgM2MtLjgyNiAwLTEuNDY0LjE3Mi0xLjkxNS41MTctLjQuMzA3LS42ODYuNzMzLS44NTYgMS4yNzhsLS4wNTguMjEgMS45MDguMzY0Yy4wNTItLjM4My4xNTMtLjY1MS4zMDItLjgwNGEuNzcyLjc3MiAwIDAgMSAuNTgtLjIzYy4yMyAwIC40MTIuMDcuNTQ0LjIxMS4xMzMuMTQuMTk5LjMzLjE5OS41NjVhLjg4Ljg4IDAgMCAxLS4yNjUuNjM4Ljg5Ljg5IDAgMCAxLS42NjIuMjcgMS4zNSAxLjM1IDAgMCAxLS4xNTgtLjAxMmwtLjEwNC0uMDE1LS4xMDUgMS41MzZjLjI3OC0uMDg1LjQ5Ni0uMTI3LjY1NC0uMTI3LjI5OCAwIC41MzMuMDk5LjcwNy4yOTYuMTczLjE5Ny4yNi40NzUuMjYuODMzIDAgLjM1Mi0uMDkuNjM0LS4yNy44NDVhLjg1Mi44NTIgMCAwIDEtLjY3Ny4zMTYuODYyLjg2MiAwIDAgMS0uNjM2LS4yNWMtLjE0My0uMTQ0LS4yNTQtLjM4NC0uMzMzLS43MjNsLS4wMzYtLjE3N0w0IDEyLjgyNmMuMTMyLjQ4Mi4zMjEuODgyLjU2NyAxLjIuMjQ2LjMxOS41Ni41Ni45NDIuNzI2LjM4MS4xNjUuOTAyLjI0OCAxLjU2My4yNDguNjc3IDAgMS4yMjQtLjExMiAxLjY0LS4zMzUuNDE2LS4yMjMuNzM1LS41NDIuOTU2LS45NTUuMjIxLS40MTQuMzMyLS44NDUuMzMyLTEuMjk2IDAtLjM1OS0uMDY3LS42NjctLjItLjkyNmExLjYzMyAxLjYzMyAwIDAgMC0uNTYzLS42MjVjLS4xNDktLjA5OS0uMzYzLS4xODUtLjY0NC0uMjU5LjM0Ny0uMjA0LjYwNi0uNDQxLjc3OC0uNzEyYTEuNjYgMS42NiAwIDAgMCAuMjU3LS45MDggMS44MiAxLjgyIDAgMCAwLS42MzQtMS40MkM4LjU3MSA3LjE4OSA3Ljg4NiA3IDYuOTM4IDdaTTQuODEzIDBjLjE3NSAwIC4zNS4xNy40MzcuMzM4bDEuMzEzIDIuNDUzcy0yLjguMTctNC40NjMgMS43NzZMLjA4OC43NjFDMCAuNjc3IDAgLjU5MiAwIC41MDcgMCAuMTcuMjYzIDAgLjUyNSAwWm04LjY2MiAwYy4yNjMgMCAuNTI1LjI1NC41MjUuNTA3IDAgLjA4NSAwIC4xNy0uMDg4LjI1NEwxMS45IDQuNDgzQzEwLjIzOCAyLjk2IDcuNDM3IDIuNzkgNy40MzcgMi43OUw4Ljc1LjMzOEM4Ljc1LjE3IDguOTI1IDAgOS4xODggMFoiLz48L3N2Zz4=");
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 69193:
|
||||
/*!*****************************!*\
|
||||
!*** ./src/utils/export.ts ***!
|
||||
\*****************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ AD: function() { return /* binding */ ExportCollegeStudentsInfo; },
|
||||
/* harmony export */ D9: function() { return /* binding */ ExportStudentanalysis; },
|
||||
/* harmony export */ IM: function() { return /* binding */ get_ecs_attachment; },
|
||||
/* harmony export */ Iy: function() { return /* binding */ ExportCourseWorkListScores; },
|
||||
/* harmony export */ KM: function() { return /* binding */ getmember_works; },
|
||||
/* harmony export */ Ne: function() { return /* binding */ getec_training_objectives; },
|
||||
/* harmony export */ ON: function() { return /* binding */ exportPaperlibraryPaper; },
|
||||
/* harmony export */ Uj: function() { return /* binding */ exportTaskPass; },
|
||||
/* harmony export */ VY: function() { return /* binding */ getrank_list; },
|
||||
/* harmony export */ YO: function() { return /* binding */ exportCommitResultWord; },
|
||||
/* harmony export */ YX: function() { return /* binding */ exportClassroomsPaper; },
|
||||
/* harmony export */ Zn: function() { return /* binding */ ExportCourseInfo; },
|
||||
/* harmony export */ _g: function() { return /* binding */ exportMoocrecord; },
|
||||
/* harmony export */ _k: function() { return /* binding */ getDownFile; },
|
||||
/* harmony export */ c6: function() { return /* binding */ ExportVideoStudy; },
|
||||
/* harmony export */ cr: function() { return /* binding */ ExportCourseActScore; },
|
||||
/* harmony export */ eV: function() { return /* binding */ ExportCourseStudentsInfo; },
|
||||
/* harmony export */ fi: function() { return /* binding */ ExportCourseMemberScores; },
|
||||
/* harmony export */ gh: function() { return /* binding */ ExportAttendance; },
|
||||
/* harmony export */ hS: function() { return /* binding */ getec_courses; },
|
||||
/* harmony export */ iA: function() { return /* binding */ ExportCourseAndOther; },
|
||||
/* harmony export */ j6: function() { return /* binding */ ExportCourseTotalScore; },
|
||||
/* harmony export */ je: function() { return /* binding */ ExportExerciseStudentScores; },
|
||||
/* harmony export */ kS: function() { return /* binding */ getquestion_rank_list; },
|
||||
/* harmony export */ o6: function() { return /* binding */ ExportVideoStudent; },
|
||||
/* harmony export */ pO: function() { return /* binding */ exportUserExerciseDetail; },
|
||||
/* harmony export */ rQ: function() { return /* binding */ ExportProblemset; },
|
||||
/* harmony export */ sA: function() { return /* binding */ ExportPollsScores; },
|
||||
/* harmony export */ xm: function() { return /* binding */ getecyears; },
|
||||
/* harmony export */ xo: function() { return /* binding */ getec_graduation_requirements; },
|
||||
/* harmony export */ y8: function() { return /* binding */ Exportcompetitions; }
|
||||
/* harmony export */ });
|
||||
/* unused harmony export ExportCourseWorkListAppendix */
|
||||
/* harmony import */ var _service_classrooms__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/service/classrooms */ 16560);
|
||||
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! umi */ 87210);
|
||||
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ 3163);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ 8591);
|
||||
/* harmony import */ var _env__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./env */ 64741);
|
||||
var __defProp = Object.defineProperty;
|
||||
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 __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 showLoading = () => {
|
||||
(0,umi__WEBPACK_IMPORTED_MODULE_1__.getDvaApp)()._store.dispatch({
|
||||
type: "globalSetting/setGlobalLoading",
|
||||
payload: { show: true, text: "\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..." }
|
||||
});
|
||||
};
|
||||
const hideLoading = () => {
|
||||
(0,umi__WEBPACK_IMPORTED_MODULE_1__.getDvaApp)()._store.dispatch({
|
||||
type: "globalSetting/setGlobalLoading",
|
||||
payload: { show: false, text: "" }
|
||||
});
|
||||
};
|
||||
const ExportCourseInfo = (params) => __async(void 0, null, function* () {
|
||||
showLoading();
|
||||
const res = yield (0,_service_classrooms__WEBPACK_IMPORTED_MODULE_0__/* .exportCourseInfo */ .YR)(__spreadValues({}, params));
|
||||
if (res.status === 0)
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFileIframe */ .QH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/courses/${params.coursesId}/export_couser_info.json`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
hideLoading();
|
||||
});
|
||||
const ExportCourseActScore = (params) => __async(void 0, null, function* () {
|
||||
const res = yield (0,_service_classrooms__WEBPACK_IMPORTED_MODULE_0__/* .exportCourseActScore */ .yS)(__spreadValues({}, params));
|
||||
if (res.status === 0) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F");
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(
|
||||
`/classrooms/${params.coursesId}/exportlist/course_member_act_score`
|
||||
);
|
||||
} else if (res.status === -2) {
|
||||
return res;
|
||||
} else if (res.status === -3) {
|
||||
(0,umi__WEBPACK_IMPORTED_MODULE_1__.getDvaApp)()._store.dispatch({
|
||||
type: "classroomList/setActionTabs",
|
||||
payload: { key: "\u5BFC\u51FA\u63D0\u9192" }
|
||||
});
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(
|
||||
`/classrooms/${params.coursesId}/exportlist/course_member_act_score`
|
||||
);
|
||||
}
|
||||
});
|
||||
const ExportCourseMemberScores = (params) => __async(void 0, null, function* () {
|
||||
const res = yield (0,_service_classrooms__WEBPACK_IMPORTED_MODULE_0__/* .exportCourseMemberScores */ .W0)(__spreadValues({}, params));
|
||||
if (res.status === 0) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F");
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(
|
||||
`/classrooms/${params.coursesId}/exportlist/course_total_score`
|
||||
);
|
||||
} else if (res.status === -2) {
|
||||
return res;
|
||||
} else if (res.status === -3) {
|
||||
(0,umi__WEBPACK_IMPORTED_MODULE_1__.getDvaApp)()._store.dispatch({
|
||||
type: "classroomList/setActionTabs",
|
||||
payload: { key: "\u5BFC\u51FA\u63D0\u9192" }
|
||||
});
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(
|
||||
`/classrooms/${params.coursesId}/exportlist/course_total_score`
|
||||
);
|
||||
}
|
||||
});
|
||||
const ExportCourseAndOther = (params) => __async(void 0, null, function* () {
|
||||
const res = yield (0,_service_classrooms__WEBPACK_IMPORTED_MODULE_0__/* .exportCourseAndOther */ .Nl)(__spreadValues({}, params));
|
||||
if (res.status === 0) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F");
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(
|
||||
`/classrooms/${params.coursesId}/exportlist/course_total_exercise_and_other`
|
||||
);
|
||||
} else if (res.status === -2) {
|
||||
return res;
|
||||
} else if (res.status === -3) {
|
||||
(0,umi__WEBPACK_IMPORTED_MODULE_1__.getDvaApp)()._store.dispatch({
|
||||
type: "classroomList/setActionTabs",
|
||||
payload: { key: "\u5BFC\u51FA\u63D0\u9192" }
|
||||
});
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(
|
||||
`/classrooms/${params.coursesId}/exportlist/course_total_exercise_and_other`
|
||||
);
|
||||
}
|
||||
});
|
||||
const exportMoocrecord = (params) => __async(void 0, null, function* () {
|
||||
const res = yield (0,_service_classrooms__WEBPACK_IMPORTED_MODULE_0__/* .exportMoocrecords */ .td)(__spreadValues({}, params));
|
||||
if (res.status === 0) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F");
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(
|
||||
`/classrooms/${params.coursesId}/exportlist/course_total_exercise_and_other`
|
||||
);
|
||||
} else if (res.status === -2) {
|
||||
return res;
|
||||
} else if (res.status === -3) {
|
||||
(0,umi__WEBPACK_IMPORTED_MODULE_1__.getDvaApp)()._store.dispatch({
|
||||
type: "classroomList/setActionTabs",
|
||||
payload: { key: "\u5BFC\u51FA\u63D0\u9192" }
|
||||
});
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(
|
||||
`/classrooms/${params.coursesId}/exportlist/course_total_exercise_and_other`
|
||||
);
|
||||
}
|
||||
});
|
||||
const ExportCourseTotalScore = (params) => __async(void 0, null, function* () {
|
||||
const res = yield (0,_service_classrooms__WEBPACK_IMPORTED_MODULE_0__/* .exportCourseTotalScore */ .QX)(__spreadValues({}, params));
|
||||
if (res.status === 0) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F");
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(
|
||||
`/classrooms/${params.coursesId}/exportlist/course_total_homework`
|
||||
);
|
||||
} else if (res.status === -2) {
|
||||
return res;
|
||||
} else if (res.status === -3) {
|
||||
(0,umi__WEBPACK_IMPORTED_MODULE_1__.getDvaApp)()._store.dispatch({
|
||||
type: "classroomList/setActionTabs",
|
||||
payload: { key: "\u5BFC\u51FA\u63D0\u9192" }
|
||||
});
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(
|
||||
`/classrooms/${params.coursesId}/exportlist/course_total_homework`
|
||||
);
|
||||
}
|
||||
});
|
||||
const ExportCourseWorkListScores = (params, type) => __async(void 0, null, function* () {
|
||||
const res = yield (0,_service_classrooms__WEBPACK_IMPORTED_MODULE_0__/* .exportCourseWorkListScores */ .aP)(__spreadValues({}, params));
|
||||
if (res.status === 0) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F");
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(`/classrooms/${params.coursesId}/exportlist/${type}`);
|
||||
} else if (res.status === -3) {
|
||||
(0,umi__WEBPACK_IMPORTED_MODULE_1__.getDvaApp)()._store.dispatch({
|
||||
type: "classroomList/setActionTabs",
|
||||
payload: { key: "\u5BFC\u51FA\u63D0\u9192" }
|
||||
});
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(`/classrooms/${params.coursesId}/exportlist/${type}`);
|
||||
}
|
||||
});
|
||||
const ExportCourseWorkListAppendix = (params) => __async(void 0, null, function* () {
|
||||
showLoading();
|
||||
const res = yield exportCourseWorkListAppendix(__spreadValues({}, params));
|
||||
if (res.status === 0)
|
||||
yield downLoadFileIframe(
|
||||
"",
|
||||
setUrlQuery({
|
||||
url: ENV.API_SERVER + `/api/homework_commons/${params.categoryId}/works_list.zip`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
hideLoading();
|
||||
});
|
||||
const ExportPollsScores = (params) => __async(void 0, null, function* () {
|
||||
showLoading();
|
||||
const res = yield (0,_service_classrooms__WEBPACK_IMPORTED_MODULE_0__/* .exportPollsScores */ .MJ)(__spreadValues({}, params));
|
||||
if (res.status === 0)
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFileIframe */ .QH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/polls/${params.categoryId}/commit_result.xlsx`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
hideLoading();
|
||||
});
|
||||
const ExportAttendance = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/courses/${params.coursesId}/attendances/export_xlsx_data.xlsx`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const ExportVideoStudent = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/courses/${params.coursesId}/video_study_statics.xlsx`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const ExportVideoStudy = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/courses/${params.coursesId}/export_video_study.xlsx`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const ExportCourseStudentsInfo = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/courses/${params.coursesId}/export_course_students_info.xlsx`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const ExportCollegeStudentsInfo = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/school_manages/students.xlsx`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const ExportProblemset = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/item_banks/export.xlsx`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const Exportcompetitions = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/competitions/region_reports.xlsx`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const ExportExerciseStudentScores = (params) => __async(void 0, null, function* () {
|
||||
const res = yield (0,_service_classrooms__WEBPACK_IMPORTED_MODULE_0__/* .exportExerciseStudentScores */ .Uy)(__spreadValues({}, params));
|
||||
if (res.status === 0) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F");
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(`/classrooms/${params.coursesId}/exportlist/exercise_score`);
|
||||
} else if (res.status === -3) {
|
||||
(0,umi__WEBPACK_IMPORTED_MODULE_1__.getDvaApp)()._store.dispatch({
|
||||
type: "classroomList/setActionTabs",
|
||||
payload: { key: "\u5BFC\u51FA\u63D0\u9192" }
|
||||
});
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(`/classrooms/${params.coursesId}/exportlist/exercise_score`);
|
||||
}
|
||||
});
|
||||
const getDownFile = (params) => __async(void 0, null, function* () {
|
||||
console.log("----------", "\u8C03\u7528\u4E0B\u8F7D");
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/export_records/${params.id}.xlsx`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const getecyears = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/ec_major_schools/0/ec_years.xlsx`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const ExportStudentanalysis = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/courses/${params == null ? void 0 : params.coursesId}/${params.menuKey}_statistic.xlsx?${params.checkedList.map((item) => `course_group_id[]=${item}`).join("&")}`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const getec_training_objectives = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)("", (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({ url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/ec_years/${params == null ? void 0 : params.ec_year_id}/ec_training_objectives.xlsx`, query: params }));
|
||||
});
|
||||
const get_ecs_attachment = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(params == null ? void 0 : params.name, (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({ url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/attachments/get_ecs_attachment.docx`, query: params }));
|
||||
});
|
||||
const getec_courses = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)("", (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({ url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/ec_years/${params == null ? void 0 : params.ec_year_id}/ec_courses.xlsx`, query: params }));
|
||||
});
|
||||
const getec_graduation_requirements = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)("", (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({ url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/ec_years/${params == null ? void 0 : params.ec_year_id}/ec_graduation_requirements.xlsx`, query: params }));
|
||||
});
|
||||
const getrank_list = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)("", (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({ url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/courses/rank_list.xlsx`, query: params }));
|
||||
});
|
||||
const getquestion_rank_list = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)("", (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({ url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/courses/question_rank_list.xlsx`, query: params }));
|
||||
});
|
||||
const exportPaperlibraryPaper = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/examination_banks/${params.id}.json`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const exportClassroomsPaper = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/exercises/${params.categoryId}.json`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const exportCommitResultWord = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/polls/${params == null ? void 0 : params.id}/commit_result.json`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const exportTaskPass = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/paths/get_task_pass.json`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const exportUserExerciseDetail = (params, title) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
title || "",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/exercises/${params == null ? void 0 : params.exercise_id}/user_exercise_detail.json`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const getmember_works = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)("", (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({ url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/competitions/${params == null ? void 0 : params.identifier}/competition_commit_records/member_works.xlsx`, query: params }));
|
||||
});
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
@ -0,0 +1,634 @@
|
||||
"use strict";
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[3033],{
|
||||
|
||||
/***/ 72231:
|
||||
/*!**************************************************************************!*\
|
||||
!*** ./src/pages/Graduations/components/HeadTitle/index.tsx + 1 modules ***!
|
||||
\**************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ components_HeadTitle; }
|
||||
});
|
||||
|
||||
// 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/components/HeadTitle/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var HeadTitlemodules = ({"flex_box_center":"flex_box_center___oGGi8","flex_space_between":"flex_space_between___e1At5","flex_box_vertical_center":"flex_box_vertical_center___K1Nl5","flex_box_center_end":"flex_box_center_end___IP1rf","flex_box_column":"flex_box_column____nxPW","title":"title___Ynb7w","time":"time___dxFRB"});
|
||||
// EXTERNAL MODULE: ./node_modules/_classnames@2.3.2@classnames/index.js
|
||||
var _classnames_2_3_2_classnames = __webpack_require__(12124);
|
||||
var _classnames_2_3_2_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_3_2_classnames);
|
||||
// EXTERNAL MODULE: ./src/pages/Graduations/components/Tags/index.tsx + 1 modules
|
||||
var Tags = __webpack_require__(74250);
|
||||
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.10@dayjs/dayjs.min.js
|
||||
var dayjs_min = __webpack_require__(9498);
|
||||
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
|
||||
;// CONCATENATED MODULE: ./src/pages/Graduations/components/HeadTitle/index.tsx
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const HeadTitle = ({
|
||||
className,
|
||||
status,
|
||||
style = {},
|
||||
startAt,
|
||||
endAt,
|
||||
title
|
||||
}) => {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: _classnames_2_3_2_classnames_default()(HeadTitlemodules.title, className), style }, /* @__PURE__ */ _react_17_0_2_react.createElement("b", null, title), /* @__PURE__ */ _react_17_0_2_react.createElement(Tags/* default */.Z, { className: "ml10", status }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: HeadTitlemodules.time }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u5F00\u542F\u65F6\u95F4", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "ml10" }, startAt ? dayjs_min_default()(startAt).format("YYYY-MM-DD HH:mm") : "--")), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "ml30" }, "\u622A\u6B62\u65F6\u95F4", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "ml10" }, endAt ? dayjs_min_default()(endAt).format("YYYY-MM-DD HH:mm") : "--"))));
|
||||
};
|
||||
/* harmony default export */ var components_HeadTitle = (HeadTitle);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 2611:
|
||||
/*!*****************************************************************************!*\
|
||||
!*** ./src/pages/Graduations/components/SettingModal/index.tsx + 1 modules ***!
|
||||
\*****************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ components_SettingModal; }
|
||||
});
|
||||
|
||||
// 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/upload/index.js + 24 modules
|
||||
var upload = __webpack_require__(6557);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
||||
var modal = __webpack_require__(43418);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
|
||||
var row = __webpack_require__(95237);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/date-picker/index.js + 66 modules
|
||||
var date_picker = __webpack_require__(52409);
|
||||
;// CONCATENATED MODULE: ./src/pages/Graduations/components/SettingModal/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var SettingModalmodules = ({"flex_box_center":"flex_box_center___cQ5Sl","flex_space_between":"flex_space_between___BU1Wl","flex_box_vertical_center":"flex_box_vertical_center___jBfz4","flex_box_center_end":"flex_box_center_end___mFYce","flex_box_column":"flex_box_column___jBfuW","wrap":"wrap___npJKs","label":"label___mSlLf"});
|
||||
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
||||
var env = __webpack_require__(64741);
|
||||
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 14 modules
|
||||
var _umi_production_exports = __webpack_require__(87210);
|
||||
// EXTERNAL MODULE: ./src/components/ui-customization/index.tsx + 34 modules
|
||||
var ui_customization = __webpack_require__(94477);
|
||||
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
||||
var fetch = __webpack_require__(87101);
|
||||
// EXTERNAL MODULE: ./src/utils/util.tsx
|
||||
var util = __webpack_require__(3163);
|
||||
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 14 modules
|
||||
var markdown_editor = __webpack_require__(20103);
|
||||
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.10@dayjs/dayjs.min.js
|
||||
var dayjs_min = __webpack_require__(9498);
|
||||
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
|
||||
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/ShixunHomeworks/Detail/components/ConfigWorks/Releasesetting.tsx
|
||||
var Releasesetting = __webpack_require__(75117);
|
||||
;// CONCATENATED MODULE: ./src/pages/Graduations/components/SettingModal/index.tsx
|
||||
var __defProp = Object.defineProperty;
|
||||
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 __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 SettingModal = ({
|
||||
visible,
|
||||
data,
|
||||
onClose = () => {
|
||||
},
|
||||
onSuccess = () => {
|
||||
}
|
||||
}) => {
|
||||
const [fileList, setFileList] = (0,_react_17_0_2_react.useState)([]);
|
||||
const [startAt, setStartAt] = (0,_react_17_0_2_react.useState)("");
|
||||
const [endAt, setEndAt] = (0,_react_17_0_2_react.useState)("");
|
||||
const [description, setDescription] = (0,_react_17_0_2_react.useState)("");
|
||||
const [btnLoading, setBtnLoading] = (0,_react_17_0_2_react.useState)(false);
|
||||
const query = (0,_umi_production_exports.useParams)();
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
var _a;
|
||||
if (visible) {
|
||||
setDescription((data == null ? void 0 : data.description) || "");
|
||||
setStartAt((data == null ? void 0 : data.start_at) || "");
|
||||
setEndAt((data == null ? void 0 : data.end_at) || "");
|
||||
setFileList(((_a = data == null ? void 0 : data.attachments) == null ? void 0 : _a.map((e) => ({
|
||||
name: e.name || e.title,
|
||||
status: "done",
|
||||
response: {
|
||||
id: e.id
|
||||
}
|
||||
}))) || []);
|
||||
}
|
||||
}, [visible]);
|
||||
const uploadProps = {
|
||||
multiple: true,
|
||||
withCredentials: true,
|
||||
fileList,
|
||||
beforeUpload: (file) => {
|
||||
const fileSize = file.size / 1024 / 1024;
|
||||
if (fileSize > 150) {
|
||||
message/* default */.ZP.error(`\u300A${file.name}\u300B\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(150M)`);
|
||||
return upload["default"].LIST_IGNORE;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
action: `${env/* default */.Z.API_SERVER}/api/attachments.json`,
|
||||
onChange(info) {
|
||||
setFileList((0,util/* dealUploadChange */.uD)(info));
|
||||
}
|
||||
};
|
||||
const handleOk = () => __async(void 0, null, function* () {
|
||||
if (!startAt || !endAt) {
|
||||
message/* default */.ZP.warning(`\u8BF7\u9009\u62E9${timeName}`);
|
||||
return;
|
||||
}
|
||||
setBtnLoading(true);
|
||||
console.log(fileList, "fileList");
|
||||
const res = yield (0,fetch/* default */.ZP)(`/api/graduations/${query.id}/graduation_stages/${data.id}.json`, {
|
||||
method: "put",
|
||||
body: {
|
||||
start_at: startAt,
|
||||
end_at: endAt,
|
||||
description,
|
||||
attachment_ids: fileList.map((e) => {
|
||||
var _a;
|
||||
return (_a = e == null ? void 0 : e.response) == null ? void 0 : _a.id;
|
||||
})
|
||||
}
|
||||
});
|
||||
if ((res == null ? void 0 : res.status) === 0) {
|
||||
message/* default */.ZP.success("\u4FDD\u5B58\u8BBE\u7F6E\u6210\u529F");
|
||||
(0,_umi_production_exports.getDvaApp)()._store.dispatch({
|
||||
type: "graduations/getGraduationsDetails",
|
||||
payload: { id: query == null ? void 0 : query.id }
|
||||
});
|
||||
onSuccess();
|
||||
return;
|
||||
}
|
||||
setBtnLoading(false);
|
||||
});
|
||||
console.log(data, "data");
|
||||
const jsonItem = [
|
||||
{
|
||||
name: "\u5B66\u751F\u9009\u9898",
|
||||
key: "student_selection",
|
||||
timeName: "\u5B66\u751F\u9009\u9898\u8D77\u6B62\u65F6\u95F4",
|
||||
width: 460,
|
||||
text: "\u5728\u6B64\u65F6\u95F4\u5185\uFF0C\u5B66\u751F\u53EF\u81EA\u52A9\u64CD\u4F5C\u9009\u9898\u548C\u66F4\u6539\u9009\u9898"
|
||||
},
|
||||
{
|
||||
name: "\u4EFB\u52A1\u4E66",
|
||||
key: "tasks",
|
||||
width: 460,
|
||||
timeName: "\u4EFB\u52A1\u4E66\u8D77\u6B62\u65F6\u95F4",
|
||||
text: ""
|
||||
},
|
||||
{
|
||||
name: "\u5F00\u9898\u62A5\u544A",
|
||||
key: "opening_report",
|
||||
width: 1146,
|
||||
timeName: "\u5B66\u751F\u63D0\u4EA4\u5F00\u9898\u62A5\u544A\u8D77\u6B62\u65F6\u95F4",
|
||||
text: "\u5728\u8BE5\u9636\u6BB5\u5185\u6216\u8005\u8001\u5E08\u8BC4\u9605\u901A\u8FC7\u4E4B\u524D\uFF0C\u5B66\u751F\u53EF\u4EE5\u81EA\u7531\u63D0\u4EA4\u6587\u6863\uFF0C\u4E00\u65E6\u8FC7\u4E86\u622A\u6B62\u65F6\u95F4\uFF0C\u5219\u9700\u8981\u7BA1\u7406\u5458\u6388\u6743\u8865\u4EA4"
|
||||
},
|
||||
{
|
||||
name: "\u4E2D\u671F\u68C0\u67E5",
|
||||
key: "midterm_report",
|
||||
width: 1146,
|
||||
timeName: "\u5B66\u751F\u63D0\u4EA4\u4E2D\u671F\u68C0\u67E5\u8D77\u6B62\u65F6\u95F4",
|
||||
text: "\u5728\u8BE5\u9636\u6BB5\u5185\u6216\u8005\u8001\u5E08\u8BC4\u9605\u901A\u8FC7\u4E4B\u524D\uFF0C\u5B66\u751F\u53EF\u4EE5\u81EA\u7531\u63D0\u4EA4\u6587\u6863\uFF0C\u4E00\u65E6\u8FC7\u4E86\u622A\u6B62\u65F6\u95F4\uFF0C\u5219\u9700\u8981\u7BA1\u7406\u5458\u6388\u6743\u8865\u4EA4"
|
||||
},
|
||||
{
|
||||
name: "\u6BD5\u4E1A\u8BBA\u6587",
|
||||
key: "thesis",
|
||||
width: 1146,
|
||||
timeName: "\u5B66\u751F\u63D0\u4EA4\u6BD5\u4E1A\u8BBA\u6587\u8D77\u6B62\u65F6\u95F4",
|
||||
text: "\u5728\u8BE5\u9636\u6BB5\u5185\u6216\u8005\u8001\u5E08\u8BC4\u9605\u901A\u8FC7\u4E4B\u524D\uFF0C\u5B66\u751F\u53EF\u4EE5\u81EA\u7531\u63D0\u4EA4\u6587\u6863\uFF0C\u4E00\u65E6\u8FC7\u4E86\u622A\u6B62\u65F6\u95F4\uFF0C\u5219\u9700\u8981\u7BA1\u7406\u5458\u6388\u6743\u8865\u4EA4"
|
||||
},
|
||||
{
|
||||
name: "\u6BD5\u4E1A\u7B54\u8FA9",
|
||||
key: "final_defense",
|
||||
width: 1146,
|
||||
timeName: "\u5B66\u751F\u63D0\u4EA4\u6BD5\u4E1A\u7B54\u8FA9\u8D77\u6B62\u65F6\u95F4",
|
||||
text: "\u5728\u8BE5\u9636\u6BB5\u5185\u6216\u8005\u8001\u5E08\u8BC4\u9605\u901A\u8FC7\u4E4B\u524D\uFF0C\u5B66\u751F\u53EF\u4EE5\u81EA\u7531\u63D0\u4EA4\u6587\u6863\uFF0C\u4E00\u65E6\u8FC7\u4E86\u622A\u6B62\u65F6\u95F4\uFF0C\u5219\u9700\u8981\u7BA1\u7406\u5458\u6388\u6743\u8865\u4EA4"
|
||||
},
|
||||
{
|
||||
name: "\u8BBA\u6587\u5B9A\u7A3F",
|
||||
key: "final_thesis",
|
||||
width: 1146,
|
||||
timeName: "\u5B66\u751F\u63D0\u4EA4\u8BBA\u6587\u5B9A\u7A3F\u8D77\u6B62\u65F6\u95F4",
|
||||
text: "\u5728\u8BE5\u9636\u6BB5\u5185\u6216\u8005\u8001\u5E08\u8BC4\u9605\u901A\u8FC7\u4E4B\u524D\uFF0C\u5B66\u751F\u53EF\u4EE5\u81EA\u7531\u63D0\u4EA4\u6587\u6863\uFF0C\u4E00\u65E6\u8FC7\u4E86\u622A\u6B62\u65F6\u95F4\uFF0C\u5219\u9700\u8981\u7BA1\u7406\u5458\u6388\u6743\u8865\u4EA4"
|
||||
},
|
||||
{
|
||||
name: "\u5F52\u6863",
|
||||
key: "archives",
|
||||
width: 1146,
|
||||
timeName: "\u5B66\u751F\u63D0\u4EA4\u5F52\u6863\u8D77\u6B62\u65F6\u95F4",
|
||||
text: "\u5728\u8BE5\u9636\u6BB5\u5185\u6216\u8005\u8001\u5E08\u8BC4\u9605\u901A\u8FC7\u4E4B\u524D\uFF0C\u5B66\u751F\u53EF\u4EE5\u81EA\u7531\u63D0\u4EA4\u6587\u6863\uFF0C\u4E00\u65E6\u8FC7\u4E86\u622A\u6B62\u65F6\u95F4\uFF0C\u5219\u9700\u8981\u7BA1\u7406\u5458\u6388\u6743\u8865\u4EA4"
|
||||
}
|
||||
];
|
||||
const stageItem = ["opening_report", "midterm_report", "thesis", "final_defense", "final_thesis", "archives"];
|
||||
const disabled = fileList.some((e) => !(e == null ? void 0 : e.response));
|
||||
const { timeName, text, width, key } = (jsonItem == null ? void 0 : jsonItem.find((e) => e.key === (data == null ? void 0 : data.clazz))) || {};
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
modal["default"],
|
||||
{
|
||||
centered: true,
|
||||
destroyOnClose: true,
|
||||
confirmLoading: btnLoading,
|
||||
okButtonProps: {
|
||||
disabled
|
||||
},
|
||||
onCancel: onClose,
|
||||
onOk: handleOk,
|
||||
open: visible,
|
||||
title: `${data.name}\u8BBE\u7F6E`,
|
||||
width,
|
||||
afterClose: () => {
|
||||
setFileList([]);
|
||||
setStartAt("");
|
||||
setDescription("");
|
||||
setEndAt("");
|
||||
setBtnLoading(false);
|
||||
},
|
||||
okText: "\u4FDD\u5B58\u8BBE\u7F6E",
|
||||
cancelText: "\u53D6\u6D88"
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: SettingModalmodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: SettingModalmodules.label }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "*"), timeName), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", className: stageItem.includes(key) ? "mb20" : "" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
date_picker["default"],
|
||||
{
|
||||
format: "YYYY-MM-DD HH:mm",
|
||||
value: startAt ? dayjs_min_default()(startAt) : "",
|
||||
disabledDate: (current) => (0,Releasesetting/* disabledDate */.Q8)(current, "", data == null ? void 0 : data.disabled_time),
|
||||
disabledTime: (current) => (0,Releasesetting/* disabledTime */.d0)(current, data == null ? void 0 : data.disabled_time),
|
||||
showTime: { format: "HH:mm" },
|
||||
onChange: (v, f) => {
|
||||
setStartAt(f);
|
||||
}
|
||||
}
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "ml10 mr10" }, "\u81F3"), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
date_picker["default"],
|
||||
{
|
||||
format: "YYYY-MM-DD HH:mm",
|
||||
value: endAt ? dayjs_min_default()(endAt) : "",
|
||||
disabledDate: (current) => (0,Releasesetting/* disabledDate */.Q8)(current, "", data == null ? void 0 : data.disabled_time),
|
||||
disabledTime: (current) => (0,Releasesetting/* disabledTime */.d0)(current, data == null ? void 0 : data.disabled_time),
|
||||
showTime: { format: "HH:mm" },
|
||||
onChange: (v, f) => {
|
||||
setEndAt(f);
|
||||
}
|
||||
}
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: `${key === "student_selection" ? "mt10" : "ml10"} font14`, style: { color: "#9096A3" } }, text)), stageItem.includes(key) && /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: SettingModalmodules.label }, "\u9636\u6BB5\u63CF\u8FF0"), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
markdown_editor/* default */.Z,
|
||||
{
|
||||
height: 140,
|
||||
defaultValue: description,
|
||||
onChange: (v) => {
|
||||
setDescription(v);
|
||||
}
|
||||
}
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement(upload["default"], __spreadValues({}, uploadProps), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", className: "mt10" }, /* @__PURE__ */ _react_17_0_2_react.createElement(ui_customization/* CustomButton */.op, { style: { borderRadius: 2 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "icon-shangchuan3 mr5" }), "\u4E0A\u4F20\u6587\u6863"), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"div",
|
||||
{
|
||||
className: "ml10 font14",
|
||||
style: { color: "#5F6367" },
|
||||
onClick: (e) => {
|
||||
e.stopPropagation();
|
||||
}
|
||||
},
|
||||
"\u4E0A\u4F20\u6B64\u9636\u6BB5\u7684\u6587\u6863\u6A21\u7248\u3001\u6279\u9605\u8981\u6C42\u7B49\u6587\u6863\uFF0C\u5355\u4E2A\u6587\u6863\u5927\u5C0F\u4E0D\u8D85\u8FC7150M"
|
||||
)))))
|
||||
);
|
||||
};
|
||||
/* harmony default export */ var components_SettingModal = (SettingModal);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 74250:
|
||||
/*!*********************************************************************!*\
|
||||
!*** ./src/pages/Graduations/components/Tags/index.tsx + 1 modules ***!
|
||||
\*********************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ components_Tags; }
|
||||
});
|
||||
|
||||
// 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/components/Tags/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var Tagsmodules = ({"flex_box_center":"flex_box_center___Sswcw","flex_space_between":"flex_space_between___nBexI","flex_box_vertical_center":"flex_box_vertical_center___sPXvb","flex_box_center_end":"flex_box_center_end___c6nca","flex_box_column":"flex_box_column___Bq_gi","tag":"tag___NEywM"});
|
||||
// EXTERNAL MODULE: ./node_modules/_classnames@2.3.2@classnames/index.js
|
||||
var _classnames_2_3_2_classnames = __webpack_require__(12124);
|
||||
var _classnames_2_3_2_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_3_2_classnames);
|
||||
;// CONCATENATED MODULE: ./src/pages/Graduations/components/Tags/index.tsx
|
||||
|
||||
|
||||
|
||||
const Tags = ({
|
||||
className,
|
||||
status
|
||||
}) => {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, status === 0 && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: _classnames_2_3_2_classnames_default()(Tagsmodules.tag, className) }, "\u672A\u5F00\u59CB"), status === 1 && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: _classnames_2_3_2_classnames_default()(Tagsmodules.tag, className), style: { background: "#19CB70" } }, "\u8FDB\u884C\u4E2D"), status === 2 && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: _classnames_2_3_2_classnames_default()(Tagsmodules.tag, className), style: { background: "#EE5D5D" } }, "\u5DF2\u7ED3\u675F"));
|
||||
};
|
||||
/* harmony default export */ var components_Tags = (Tags);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 73033:
|
||||
/*!******************************************************************************!*\
|
||||
!*** ./src/pages/Graduations/components/TeacherModule/index.tsx + 1 modules ***!
|
||||
\******************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ TeacherModule; }
|
||||
});
|
||||
|
||||
// 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/components/TeacherModule/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var TeacherModulemodules = ({"flex_box_center":"flex_box_center___Q4rC9","flex_space_between":"flex_space_between___pzGZc","flex_box_vertical_center":"flex_box_vertical_center___DhNf8","flex_box_center_end":"flex_box_center_end___ALRjT","flex_box_column":"flex_box_column___p6z9Y","wrap":"wrap____H2XH"});
|
||||
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 14 modules
|
||||
var _umi_production_exports = __webpack_require__(87210);
|
||||
// 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/table/index.js + 85 modules
|
||||
var table = __webpack_require__(72315);
|
||||
// EXTERNAL MODULE: ./src/components/ui-customization/index.tsx + 34 modules
|
||||
var ui_customization = __webpack_require__(94477);
|
||||
// EXTERNAL MODULE: ./src/pages/Graduations/components/HeadTitle/index.tsx + 1 modules
|
||||
var HeadTitle = __webpack_require__(72231);
|
||||
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
||||
var fetch = __webpack_require__(87101);
|
||||
// EXTERNAL MODULE: ./src/pages/Graduations/components/SettingModal/index.tsx + 1 modules
|
||||
var SettingModal = __webpack_require__(2611);
|
||||
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
||||
var NoData = __webpack_require__(97282);
|
||||
// EXTERNAL MODULE: ./src/utils/util.tsx
|
||||
var util = __webpack_require__(3163);
|
||||
;// CONCATENATED MODULE: ./src/pages/Graduations/components/TeacherModule/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,
|
||||
dispatch,
|
||||
tags,
|
||||
tagsTitle,
|
||||
tagsTitleWidth,
|
||||
placeholder,
|
||||
columns,
|
||||
updateKey,
|
||||
inputWidth = 214
|
||||
}) => {
|
||||
var _a, _b, _c;
|
||||
const urlParams = (0,_umi_production_exports.useParams)();
|
||||
const [searchParams] = (0,_umi_production_exports.useSearchParams)();
|
||||
const [loading, setLoading] = (0,_react_17_0_2_react.useState)(false);
|
||||
const [total, setTotal] = (0,_react_17_0_2_react.useState)(0);
|
||||
const [list, setList] = (0,_react_17_0_2_react.useState)([]);
|
||||
const [settingVisible, setSettingVisible] = (0,_react_17_0_2_react.useState)(false);
|
||||
const { menus } = graduations;
|
||||
const tabKey = (_a = location.pathname.split("/")) == null ? void 0 : _a[3];
|
||||
const tabParams = menus.find((e) => e.clazz === tabKey) || {};
|
||||
const tabIndex = menus.find((e) => e.clazz === tabKey) || 1;
|
||||
const getUrlState = (searchParams == null ? void 0 : searchParams.get("state")) ? Number(searchParams == null ? void 0 : searchParams.get("state")) : "";
|
||||
const [params, setParams] = (0,_react_17_0_2_react.useState)({
|
||||
keyword: "",
|
||||
status: getUrlState,
|
||||
page: 1,
|
||||
limit: 20
|
||||
});
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
if (tabParams == null ? void 0 : tabParams.id) {
|
||||
getList(params);
|
||||
}
|
||||
}, [tabParams == null ? void 0 : tabParams.id, updateKey]);
|
||||
const getList = (record) => __async(void 0, null, function* () {
|
||||
setLoading(true);
|
||||
const res = yield (0,fetch/* default */.ZP)(`/api/graduations/${urlParams.id}/graduation_stages/${tabParams == null ? void 0 : tabParams.id}.json`, {
|
||||
method: "get",
|
||||
params: record
|
||||
});
|
||||
if (res.status === 0) {
|
||||
setList((res == null ? void 0 : res.data) || []);
|
||||
setTotal(res == null ? void 0 : res.total_count);
|
||||
}
|
||||
setLoading(false);
|
||||
});
|
||||
const handleChangeStatus = (status) => {
|
||||
params.status = status;
|
||||
params.page = 1;
|
||||
setParams(params);
|
||||
getList(params);
|
||||
};
|
||||
const handleSearch = (v) => {
|
||||
params.keyword = v;
|
||||
params.page = 1;
|
||||
setParams(params);
|
||||
getList(params);
|
||||
};
|
||||
const handlePagination = (page, pageSize) => {
|
||||
params.page = page;
|
||||
params.limit = pageSize;
|
||||
setParams(params);
|
||||
getList(params);
|
||||
};
|
||||
const jsonItem = [{
|
||||
name: "\u4EFB\u52A1\u4E66",
|
||||
key: "tasks",
|
||||
notStartText: "\u5F53\u524D\u9636\u6BB5\u8FD8\u672A\u5F00\u542F"
|
||||
}, {
|
||||
name: "\u5F00\u9898\u62A5\u544A",
|
||||
key: "opening_report",
|
||||
notStartText: "\u5F53\u524D\u9636\u6BB5\u8FD8\u672A\u5F00\u542F"
|
||||
}, {
|
||||
name: "\u4E2D\u671F\u68C0\u67E5",
|
||||
key: "midterm_report",
|
||||
notStartText: "\u5F53\u524D\u9636\u6BB5\u8FD8\u672A\u5F00\u542F"
|
||||
}, {
|
||||
name: "\u6BD5\u4E1A\u8BBA\u6587",
|
||||
key: "thesis",
|
||||
notStartText: "\u5F53\u524D\u9636\u6BB5\u8FD8\u672A\u5F00\u542F"
|
||||
}, {
|
||||
name: "\u6BD5\u4E1A\u7B54\u8FA9",
|
||||
key: "final_defense",
|
||||
notStartText: "\u5F53\u524D\u9636\u6BB5\u8FD8\u672A\u5F00\u542F"
|
||||
}, {
|
||||
name: "\u8BBA\u6587\u5B9A\u7A3F",
|
||||
key: "final_thesis",
|
||||
notStartText: "\u5F53\u524D\u9636\u6BB5\u8FD8\u672A\u5F00\u542F"
|
||||
}];
|
||||
const notStartText = (_b = jsonItem == null ? void 0 : jsonItem.find((e) => e.key === (tabParams == null ? void 0 : tabParams.clazz))) == null ? void 0 : _b.notStartText;
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: TeacherModulemodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
HeadTitle/* default */.Z,
|
||||
{
|
||||
title: tabParams == null ? void 0 : tabParams.name,
|
||||
className: "mb10",
|
||||
status: tabParams == null ? void 0 : tabParams.status,
|
||||
startAt: tabParams == null ? void 0 : tabParams.start_at,
|
||||
endAt: tabParams == null ? void 0 : tabParams.end_at
|
||||
}
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", justify: "end", style: { height: 66 } }, !!(tabParams == null ? void 0 : tabParams.status) && /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", style: { flex: 1 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
ui_customization/* CustomTags */.qp,
|
||||
{
|
||||
title: tagsTitle,
|
||||
value: params.status,
|
||||
onChange: handleChangeStatus,
|
||||
dataSource: tags,
|
||||
className: "mt20",
|
||||
titleWidth: tagsTitleWidth
|
||||
}
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
ui_customization/* CustomInput */.t7,
|
||||
{
|
||||
style: { width: inputWidth, marginLeft: "auto" },
|
||||
placeholder,
|
||||
value: params.keyword,
|
||||
onChange: handleSearch
|
||||
}
|
||||
)), (0,util/* timeContrast */.QB)(tabParams == null ? void 0 : tabParams.next_start_at) && /* @__PURE__ */ _react_17_0_2_react.createElement(ui_customization/* CustomButton */.op, { style: { marginLeft: 15 }, onClick: () => setSettingVisible(true) }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-anquanshezhi font14 mr5" }), tabParams == null ? void 0 : tabParams.name, "\u8BBE\u7F6E")), (tabParams == null ? void 0 : tabParams.status) === 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(NoData/* default */.Z, { customText: notStartText }), !!(tabParams == null ? void 0 : tabParams.status) && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
table["default"],
|
||||
{
|
||||
columns,
|
||||
dataSource: list,
|
||||
loading,
|
||||
rowKey: "id",
|
||||
locale: { emptyText: /* @__PURE__ */ _react_17_0_2_react.createElement(NoData/* default */.Z, null) },
|
||||
pagination: {
|
||||
current: params.page,
|
||||
hideOnSinglePage: !total,
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
pageSize: params.limit,
|
||||
pageSizeOptions: ["10", "20", "50", "100", "200"],
|
||||
total,
|
||||
size: "default",
|
||||
showTotal: util/* showTotal */.rU,
|
||||
onChange: handlePagination
|
||||
}
|
||||
}
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
SettingModal/* default */.Z,
|
||||
{
|
||||
visible: settingVisible,
|
||||
data: __spreadProps(__spreadValues({}, tabParams), { disabled_time: (_c = menus == null ? void 0 : menus[tabIndex - 1]) == null ? void 0 : _c.end_at }),
|
||||
onClose: () => setSettingVisible(false),
|
||||
onSuccess: () => {
|
||||
setSettingVisible(false);
|
||||
}
|
||||
}
|
||||
));
|
||||
};
|
||||
/* harmony default export */ var TeacherModule = ((0,_umi_production_exports.connect)(({
|
||||
graduations
|
||||
}) => ({
|
||||
graduations
|
||||
}))(Page));
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
@ -0,0 +1,745 @@
|
||||
"use strict";
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[3041],{
|
||||
|
||||
/***/ 53041:
|
||||
/*!*********************************************************!*\
|
||||
!*** ./src/components/Video/Play/index.jsx + 1 modules ***!
|
||||
\*********************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ Play; }
|
||||
});
|
||||
|
||||
// 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/dropdown/index.js + 1 modules
|
||||
var dropdown = __webpack_require__(38854);
|
||||
// EXTERNAL MODULE: ./node_modules/_flv.js@1.5.0@flv.js/src/flv.js + 38 modules
|
||||
var flv = __webpack_require__(6545);
|
||||
// EXTERNAL MODULE: ./node_modules/_hls.js@1.4.12@hls.js/dist/hls.mjs
|
||||
var dist_hls = __webpack_require__(36775);
|
||||
// EXTERNAL MODULE: ./src/utils/authority.ts
|
||||
var authority = __webpack_require__(55830);
|
||||
// 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/utils/fullscreen.ts
|
||||
var fullscreen = __webpack_require__(98563);
|
||||
;// CONCATENATED MODULE: ./src/components/Video/Play/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var Playmodules = ({"watermark":"watermark___hNYlv","videovideo":"videovideo___ovOkV","animate__loop":"animate__loop___mvL6s","upDown":"upDown___SlgHv","container":"container___g1WYG","video-container":"video-container___XPkWR","video-controls":"video-controls___to0Zq","hide":"hide___NA3DV","video-progress":"video-progress___gqHsd","seek":"seek___iZHBm","seek-tooltip":"seek-tooltip___uWyXx","bottom-controls":"bottom-controls___uoIBm","left-controls":"left-controls___mBEx4","right-controls":"right-controls___e9L6r","rateOverlay":"rateOverlay___HHBWe","controlText":"controlText___M_BWR","volume-controls":"volume-controls___fa3mE","fullscreen-button":"fullscreen-button___ur0es","fullscreen-button1":"fullscreen-button1___rfaXm","pip-button":"pip-button___GFO8W","playback-animation":"playback-animation___ndURq","volume":"volume___OTmpP","hidden":"hidden___o7GkT"});
|
||||
;// CONCATENATED MODULE: ./src/components/Video/Play/index.jsx
|
||||
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());
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function formatTime(timeInSeconds) {
|
||||
if (isNaN(timeInSeconds)) {
|
||||
return {
|
||||
minutes: "00",
|
||||
seconds: "00"
|
||||
};
|
||||
}
|
||||
const result = new Date(timeInSeconds * 1e3).toISOString().substr(11, 8);
|
||||
return {
|
||||
hour: result.substr(0, 2),
|
||||
minutes: result.substr(3, 2),
|
||||
seconds: result.substr(6, 2)
|
||||
};
|
||||
}
|
||||
Object.defineProperty(HTMLMediaElement.prototype, "playing", {
|
||||
get: function() {
|
||||
return !!(this.currentTime > 0 && !this.paused && !this.ended && this.readyState > 2);
|
||||
}
|
||||
});
|
||||
function compareNumbers(a, b) {
|
||||
return a - b;
|
||||
}
|
||||
function getTotalEffectTime(pos) {
|
||||
pos.sort(compareNumbers);
|
||||
let sum = 0;
|
||||
for (let i = 0; i < pos.length - 1; i++) {
|
||||
let v = Math.abs(pos[i + 1] - pos[i]);
|
||||
if (v < 21) {
|
||||
sum += v;
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
const regex = /(android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini)/i;
|
||||
/* harmony default export */ var Play = ((0,_react_17_0_2_react.forwardRef)(
|
||||
({
|
||||
allow_skip,
|
||||
src,
|
||||
toLog,
|
||||
videoId,
|
||||
logWatchHistory,
|
||||
courseId = null,
|
||||
startTime,
|
||||
handlePause = () => {
|
||||
},
|
||||
handlePlay = () => {
|
||||
},
|
||||
handlePlayEnded = () => {
|
||||
},
|
||||
autoPlay = false,
|
||||
onPlayEnded = () => {
|
||||
}
|
||||
// videoSpeed = 1,
|
||||
}, ref) => {
|
||||
var _a;
|
||||
src = src == null ? void 0 : src.replace("http://", "https://");
|
||||
const suf = (_a = src == null ? void 0 : src.split(".")) == null ? void 0 : _a.pop();
|
||||
const isFlv = suf === "flv";
|
||||
const el = (0,_react_17_0_2_react.useRef)();
|
||||
const watermarkRef = (0,_react_17_0_2_react.useRef)();
|
||||
const warpEl = (0,_react_17_0_2_react.useRef)();
|
||||
const pauseIcon = (0,_react_17_0_2_react.useRef)();
|
||||
const playIcon = (0,_react_17_0_2_react.useRef)();
|
||||
const seekEl = (0,_react_17_0_2_react.useRef)();
|
||||
const progressBarEl = (0,_react_17_0_2_react.useRef)();
|
||||
const durationEl = (0,_react_17_0_2_react.useRef)();
|
||||
const timeElapsedEl = (0,_react_17_0_2_react.useRef)();
|
||||
const seekTooltipEl = (0,_react_17_0_2_react.useRef)();
|
||||
const noMuteVolEl = (0,_react_17_0_2_react.useRef)();
|
||||
const highVolEl = (0,_react_17_0_2_react.useRef)();
|
||||
const lowVolEl = (0,_react_17_0_2_react.useRef)();
|
||||
const volumeEl = (0,_react_17_0_2_react.useRef)();
|
||||
const deviceMatch = navigator.userAgent.toLowerCase().match(regex);
|
||||
const device = deviceMatch ? deviceMatch[0] : "pc";
|
||||
const firstOnPlayFlag = (0,_react_17_0_2_react.useRef)(false);
|
||||
const user = (0,authority/* userInfo */.eY)();
|
||||
let totalDuration = 0;
|
||||
let sumTimePlayed = 0;
|
||||
let lastUpdatedTime = 0;
|
||||
let logId = null;
|
||||
let initLog = false;
|
||||
let timeTick = 20;
|
||||
let logCount = 1;
|
||||
let isLoging = false;
|
||||
let isSeeking = false;
|
||||
let pos = [];
|
||||
(0,_react_17_0_2_react.useImperativeHandle)(ref, () => ({
|
||||
getLastUpdatedTime: () => el.current.currentTime,
|
||||
getDuration: () => el.current.duration
|
||||
}));
|
||||
message/* default */.ZP.config({
|
||||
maxCount: 1,
|
||||
getContainer: () => warpEl.current
|
||||
});
|
||||
const log = (0,_react_17_0_2_react.useCallback)(
|
||||
(callback, isEnd = false) => {
|
||||
let params = {
|
||||
point: el.current.currentTime
|
||||
};
|
||||
if (logId) {
|
||||
params["log_id"] = logId;
|
||||
params["watch_duration"] = getTotalEffectTime(pos);
|
||||
params["total_duration"] = sumTimePlayed;
|
||||
} else {
|
||||
if (courseId) {
|
||||
params["video_id"] = parseInt(videoId, 10);
|
||||
params["course_id"] = courseId;
|
||||
} else {
|
||||
params["video_id"] = videoId;
|
||||
}
|
||||
params["duration"] = totalDuration;
|
||||
params["device"] = device;
|
||||
}
|
||||
if (isEnd) {
|
||||
params["ed"] = "1";
|
||||
}
|
||||
function getLogId() {
|
||||
return __async(this, null, function* () {
|
||||
isLoging = true;
|
||||
let id = yield logWatchHistory == null ? void 0 : logWatchHistory(params);
|
||||
logId = id;
|
||||
isLoging = false;
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
}
|
||||
getLogId();
|
||||
},
|
||||
[videoId, courseId]
|
||||
);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
if (el.current) {
|
||||
pauseIcon.current.style.display = "none";
|
||||
playIcon.current.style.display = "block";
|
||||
}
|
||||
message/* default */.ZP.destroy();
|
||||
let player = null;
|
||||
if (flv/* default */.Z.isSupported && isFlv && src && (src == null ? void 0 : src.indexOf(".m3u8")) < 0) {
|
||||
player = flv/* default */.Z.createPlayer({
|
||||
type: "flv",
|
||||
volume: 0.8,
|
||||
cors: true,
|
||||
url: src,
|
||||
muted: false
|
||||
});
|
||||
if (el.current) {
|
||||
player.attachMediaElement(el.current);
|
||||
player.load();
|
||||
}
|
||||
} else {
|
||||
el.current.setAttribute("src", src);
|
||||
}
|
||||
updateVolumeIcon();
|
||||
return () => {
|
||||
if (player) {
|
||||
player.unload();
|
||||
player.pause();
|
||||
player.destroy();
|
||||
player = null;
|
||||
}
|
||||
};
|
||||
}, [el, isFlv, src]);
|
||||
function playIconStatus() {
|
||||
if (el.current.paused) {
|
||||
pauseIcon.current.style.display = "none";
|
||||
playIcon.current.style.display = "block";
|
||||
} else {
|
||||
pauseIcon.current.style.display = "block";
|
||||
playIcon.current.style.display = "none";
|
||||
}
|
||||
}
|
||||
function updateVolumeIcon() {
|
||||
noMuteVolEl.current.style.display = "none";
|
||||
lowVolEl.current.style.display = "none";
|
||||
highVolEl.current.style.display = "none";
|
||||
if (el.current.muted || el.current.volume === 0) {
|
||||
noMuteVolEl.current.style.display = "block";
|
||||
} else if (el.current.volume > 0 && el.current.volume <= 0.5) {
|
||||
lowVolEl.current.style.display = "block";
|
||||
} else {
|
||||
highVolEl.current.style.display = "block";
|
||||
}
|
||||
}
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
const playButton = document.getElementById("play");
|
||||
const playbackIcons = document.querySelectorAll(".playback-icons use");
|
||||
function onPlay() {
|
||||
handlePlay();
|
||||
if (startTime && !firstOnPlayFlag.current) {
|
||||
el.current.currentTime = startTime;
|
||||
}
|
||||
firstOnPlayFlag.current = true;
|
||||
pos.push(el.current.currentTime);
|
||||
if (!initLog) {
|
||||
initLog = true;
|
||||
if (toLog) {
|
||||
log();
|
||||
}
|
||||
}
|
||||
}
|
||||
function onEnded() {
|
||||
return __async(this, null, function* () {
|
||||
playIconStatus();
|
||||
pos.push(el.current.currentTime);
|
||||
if (toLog) {
|
||||
log(() => {
|
||||
logId = null;
|
||||
lastUpdatedTime = 0;
|
||||
initLog = false;
|
||||
isLoging = false;
|
||||
isSeeking = false;
|
||||
pos = [];
|
||||
sumTimePlayed = 0;
|
||||
logCount = 1;
|
||||
}, true);
|
||||
}
|
||||
onPlayEnded();
|
||||
});
|
||||
}
|
||||
function updateProgress() {
|
||||
seekEl.current.value = Math.round(el.current.currentTime);
|
||||
progressBarEl.current.value = Math.round(el.current.currentTime);
|
||||
}
|
||||
function updateTimeElapsed() {
|
||||
const time = formatTime(Math.round(el.current.currentTime));
|
||||
timeElapsedEl.current.innerText = `${time.hour > 0 ? time.hour + ":" : ""}${time.minutes}:${time.seconds}`;
|
||||
timeElapsedEl.current.setAttribute(
|
||||
"datetime",
|
||||
`${time.hour > 0 ? " " + time.hour + " " : ""}${time.minutes}m ${time.seconds}s`
|
||||
);
|
||||
}
|
||||
function initializeVideo() {
|
||||
const videoDuration = Math.round(el.current.duration);
|
||||
seekEl.current.setAttribute("max", videoDuration);
|
||||
progressBarEl.current.setAttribute("max", videoDuration);
|
||||
const time = formatTime(videoDuration);
|
||||
durationEl.current.innerText = `${time.hour > 0 ? time.hour + ":" : ""}${time.minutes}:${time.seconds}`;
|
||||
durationEl.current.setAttribute(
|
||||
"datetime",
|
||||
`${time.hour > 0 ? " " + time.hour + " " : ""}${time.minutes}m ${time.seconds}s`
|
||||
);
|
||||
}
|
||||
function onTimeupdate() {
|
||||
try {
|
||||
const videoDuration = Math.round(el.current.duration);
|
||||
seekEl.current.setAttribute("max", videoDuration);
|
||||
progressBarEl.current.setAttribute("max", videoDuration);
|
||||
const time = formatTime(videoDuration);
|
||||
durationEl.current.innerText = `${time.hour > 0 ? time.hour + ":" : ""}${time.minutes}:${time.seconds}`;
|
||||
durationEl.current.setAttribute(
|
||||
"datetime",
|
||||
`${time.hour > 0 ? " " + time.hour + " " : ""}${time.minutes}m ${time.seconds}s`
|
||||
);
|
||||
updateProgress();
|
||||
updateTimeElapsed();
|
||||
const {
|
||||
width,
|
||||
height,
|
||||
x,
|
||||
y
|
||||
} = watermarkRef.current.getBoundingClientRect();
|
||||
if (x < 0 || y < 0 || !width) {
|
||||
return;
|
||||
}
|
||||
if (!isSeeking) {
|
||||
let newTime = el.current.currentTime;
|
||||
let timeDiff = newTime - lastUpdatedTime;
|
||||
if (Math.abs(timeDiff) < 10) {
|
||||
sumTimePlayed += Math.abs(timeDiff);
|
||||
lastUpdatedTime = newTime;
|
||||
if (!isLoging) {
|
||||
if (sumTimePlayed - logCount * timeTick >= 0) {
|
||||
logCount++;
|
||||
pos.push(lastUpdatedTime);
|
||||
if (toLog) {
|
||||
log();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
lastUpdatedTime = newTime;
|
||||
if (toLog) {
|
||||
log();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
function onSeeking() {
|
||||
isSeeking = true;
|
||||
}
|
||||
function onSeeked() {
|
||||
if (el.current.playing) {
|
||||
pos.push(el.current.currentTime, lastUpdatedTime);
|
||||
}
|
||||
lastUpdatedTime = el.current.currentTime;
|
||||
isSeeking = false;
|
||||
}
|
||||
function onCanPlay() {
|
||||
totalDuration = el.current.duration;
|
||||
if (totalDuration <= 20) {
|
||||
timeTick = totalDuration / 3;
|
||||
}
|
||||
el.current.addEventListener("play", onPlay);
|
||||
}
|
||||
function onFullscreenchange(e) {
|
||||
e.preventDefault();
|
||||
if ((0,fullscreen/* IsFull */.vp)()) {
|
||||
el.current.style.width = "100%";
|
||||
el.current.style.height = "100%";
|
||||
} else {
|
||||
el.current.style.cssText = "";
|
||||
}
|
||||
}
|
||||
function onPause() {
|
||||
handlePause();
|
||||
}
|
||||
function skipAhead(event) {
|
||||
if (!allow_skip) {
|
||||
message/* default */.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");
|
||||
return;
|
||||
}
|
||||
const skipTo = event.target.dataset.seek ? event.target.dataset.seek : event.target.value;
|
||||
el.current.currentTime = skipTo;
|
||||
progressBarEl.current.value = skipTo;
|
||||
seekEl.current.value = skipTo;
|
||||
}
|
||||
function updateSeekTooltip(event) {
|
||||
const skipTo = Math.round(
|
||||
event.offsetX / event.target.clientWidth * parseInt(event.target.getAttribute("max"), 10)
|
||||
);
|
||||
seekEl.current.setAttribute("data-seek", skipTo);
|
||||
const t = formatTime(skipTo);
|
||||
seekTooltipEl.current.textContent = `${t.hour > 0 ? t.hour + ":" : ""}${t.minutes}:${t.seconds}`;
|
||||
const rect = el.current.getBoundingClientRect();
|
||||
seekTooltipEl.current.style.left = `${event.pageX - rect.left}px`;
|
||||
}
|
||||
function handleKeyDown(e) {
|
||||
switch (e.code) {
|
||||
case "Space":
|
||||
e.preventDefault();
|
||||
togglePlay();
|
||||
break;
|
||||
case "ArrowRight":
|
||||
e.preventDefault();
|
||||
if (!allow_skip) {
|
||||
message/* default */.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");
|
||||
break;
|
||||
}
|
||||
if (el.current.currentTime >= el.current.duration) {
|
||||
break;
|
||||
}
|
||||
el.current.currentTime = parseInt(el.current.currentTime) + 5;
|
||||
updateProgress();
|
||||
break;
|
||||
case "ArrowLeft":
|
||||
e.preventDefault();
|
||||
if (!allow_skip) {
|
||||
message/* default */.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");
|
||||
break;
|
||||
}
|
||||
if (el.current.currentTime === 0) {
|
||||
break;
|
||||
}
|
||||
el.current.currentTime = parseInt(el.current.currentTime) - 5;
|
||||
updateProgress();
|
||||
break;
|
||||
case "ArrowUp":
|
||||
e.preventDefault();
|
||||
if (el.current.volume < 1) {
|
||||
el.current.volume = (parseInt(el.current.volume * 10) + 1) / 10;
|
||||
}
|
||||
break;
|
||||
case "ArrowDown":
|
||||
e.preventDefault();
|
||||
if (el.current.volume > 0) {
|
||||
el.current.volume = (parseInt(el.current.volume * 10) - 1) / 10;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
warpEl.current.addEventListener((0,fullscreen/* fullscreenChange */.gH)(), onFullscreenchange);
|
||||
el.current.addEventListener("canplay", onCanPlay);
|
||||
el.current.addEventListener("ended", onEnded);
|
||||
el.current.addEventListener("seeking", onSeeking);
|
||||
el.current.addEventListener("seeked", onSeeked);
|
||||
el.current.addEventListener("loadedmetadata", initializeVideo);
|
||||
seekEl.current.addEventListener("mousemove", updateSeekTooltip);
|
||||
seekEl.current.addEventListener("input", skipAhead);
|
||||
el.current.addEventListener("timeupdate", onTimeupdate);
|
||||
el.current.addEventListener("pause", onPause);
|
||||
el.current.addEventListener("volumechange", updateVolumeIcon);
|
||||
document.addEventListener("keydown", handleKeyDown);
|
||||
return () => {
|
||||
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
||||
(_a2 = el.current) == null ? void 0 : _a2.removeEventListener("canplay", onCanPlay);
|
||||
(_b = el.current) == null ? void 0 : _b.removeEventListener("play", onPlay);
|
||||
(_c = el.current) == null ? void 0 : _c.removeEventListener("ended", onEnded);
|
||||
(_d = el.current) == null ? void 0 : _d.removeEventListener("seeking", onSeeking);
|
||||
(_e = el.current) == null ? void 0 : _e.removeEventListener("seeked", onSeeked);
|
||||
(_f = seekEl.current) == null ? void 0 : _f.removeEventListener("mousemove", updateSeekTooltip);
|
||||
(_g = seekEl.current) == null ? void 0 : _g.removeEventListener("input", skipAhead);
|
||||
(_h = el.current) == null ? void 0 : _h.removeEventListener("timeupdate", onTimeupdate);
|
||||
(_i = el.current) == null ? void 0 : _i.removeEventListener("pause", onPause);
|
||||
(_j = el.current) == null ? void 0 : _j.removeEventListener("loadedmetadata", initializeVideo);
|
||||
(_k = el.current) == null ? void 0 : _k.removeEventListener("volumechange", updateVolumeIcon);
|
||||
document.removeEventListener("keydown", handleKeyDown);
|
||||
if ((_l = el.current) == null ? void 0 : _l.playing) {
|
||||
pos.push(lastUpdatedTime, el.current.currentTime);
|
||||
if (toLog) {
|
||||
log();
|
||||
}
|
||||
}
|
||||
};
|
||||
}, [el, src]);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
el.current.onended = () => {
|
||||
handlePlayEnded(el);
|
||||
};
|
||||
el.current.oncontextmenu = () => {
|
||||
return false;
|
||||
};
|
||||
if ((src == null ? void 0 : src.indexOf(".m3u8")) > -1) {
|
||||
if (el.current.canPlayType("application/vnd.apple.mpegurl")) {
|
||||
el.current.src = src;
|
||||
} else if (dist_hls/* default */.Z.isSupported()) {
|
||||
var hls = new dist_hls/* default */.Z();
|
||||
hls.loadSource(src);
|
||||
hls.attachMedia(el.current);
|
||||
}
|
||||
}
|
||||
}, [src]);
|
||||
const [videoSpeed, setVideoSpeed] = (0,_react_17_0_2_react.useState)(1);
|
||||
const togglePlay = () => {
|
||||
if (el.current.paused || el.current.ended) {
|
||||
el.current.play();
|
||||
} else {
|
||||
el.current.pause();
|
||||
}
|
||||
playIconStatus();
|
||||
};
|
||||
function toggleMute() {
|
||||
el.current.muted = !el.current.muted;
|
||||
if (el.current.muted) {
|
||||
volumeEl.current.setAttribute("data-volume", volume.value);
|
||||
volumeEl.current.value = 0;
|
||||
} else {
|
||||
volumeEl.current.value = volumeEl.current.dataset.volume;
|
||||
}
|
||||
}
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { position: "relative" }, ref: warpEl }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"div",
|
||||
{
|
||||
ref: watermarkRef,
|
||||
className: `${Playmodules.watermark} animated_alternate animate__animated_10s animate__infinite animate__stepstart ${Playmodules.animate__loop}`
|
||||
},
|
||||
user ? user.login : " "
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Playmodules["container"] }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Playmodules["video-container"], id: "video-container" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"div",
|
||||
{
|
||||
className: Playmodules["playback-animation"],
|
||||
id: "playback-animation"
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("svg", { className: Playmodules["playback-icons"] }, /* @__PURE__ */ _react_17_0_2_react.createElement("use", { className: "hidden", href: "#play-icon" }), /* @__PURE__ */ _react_17_0_2_react.createElement("use", { href: "#pause" }))
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"video",
|
||||
{
|
||||
className: Playmodules["video"],
|
||||
id: "video",
|
||||
preload: "auto",
|
||||
disablePictureInPicture: true,
|
||||
ref: el,
|
||||
autoPlay
|
||||
}
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${Playmodules["video-controls"]} `, id: "video-controls" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Playmodules["bottom-controls"] }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Playmodules["left-controls"] }, /* @__PURE__ */ _react_17_0_2_react.createElement("button", { "data-title": "\u64AD\u653E/\u6682\u505C", id: "play", onClick: togglePlay }, /* @__PURE__ */ _react_17_0_2_react.createElement("svg", { className: Playmodules["playback-icons"] }, /* @__PURE__ */ _react_17_0_2_react.createElement("use", { ref: playIcon, href: "#play-icon" }), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"use",
|
||||
{
|
||||
ref: pauseIcon,
|
||||
style: { display: "none" },
|
||||
href: "#pause"
|
||||
}
|
||||
))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Playmodules["time"] }, /* @__PURE__ */ _react_17_0_2_react.createElement("time", { id: "time-elapsed", ref: timeElapsedEl }, "00:00"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, " / "), /* @__PURE__ */ _react_17_0_2_react.createElement("time", { id: "duration", ref: durationEl }, "00:00"))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Playmodules["right-controls"] }, allow_skip && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
dropdown/* default */.Z,
|
||||
{
|
||||
placement: "top",
|
||||
overlayClassName: Playmodules["rateOverlay"],
|
||||
getPopupContainer: (trigger) => trigger.parentNode,
|
||||
menu: {
|
||||
items: [
|
||||
{
|
||||
key: "1",
|
||||
label: /* @__PURE__ */ _react_17_0_2_react.createElement("span", { onClick: () => {
|
||||
setVideoSpeed(1);
|
||||
el.current.playbackRate = 1;
|
||||
} }, "1.0x")
|
||||
},
|
||||
{
|
||||
key: "2",
|
||||
label: /* @__PURE__ */ _react_17_0_2_react.createElement("span", { onClick: () => {
|
||||
setVideoSpeed(1.5);
|
||||
el.current.playbackRate = 1.5;
|
||||
} }, "1.5x")
|
||||
},
|
||||
{
|
||||
key: "3",
|
||||
label: /* @__PURE__ */ _react_17_0_2_react.createElement("span", { onClick: () => {
|
||||
setVideoSpeed(2);
|
||||
el.current.playbackRate = 2;
|
||||
} }, "2.0x")
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${Playmodules["controlText"]} mr5` }, "\u500D\u901F")
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
lib.CopyToClipboard,
|
||||
{
|
||||
text: src,
|
||||
onCopy: () => message/* default */.ZP.success("\u590D\u5236\u6210\u529F")
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("button", { "data-title": "\u590D\u5236\u94FE\u63A5" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"i",
|
||||
{
|
||||
className: `icon-lianjie2 iconfont`,
|
||||
style: { fontSize: "12px", color: "white" }
|
||||
}
|
||||
))
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Playmodules["volume-controls"] }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"button",
|
||||
{
|
||||
"data-title": "\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",
|
||||
className: Playmodules["volume-button"],
|
||||
id: "volume-button",
|
||||
onClick: toggleMute
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"i",
|
||||
{
|
||||
ref: noMuteVolEl,
|
||||
className: `icon-a-bianzu8 iconfont`,
|
||||
style: { fontSize: "14px", color: "white" }
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"i",
|
||||
{
|
||||
ref: lowVolEl,
|
||||
className: `icon-shengyinkaibeifen iconfont`,
|
||||
style: { fontSize: "14px", color: "white" }
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"i",
|
||||
{
|
||||
ref: highVolEl,
|
||||
className: `icon-shengyinkai iconfont`,
|
||||
style: { fontSize: "14px", color: "white" }
|
||||
}
|
||||
)
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"input",
|
||||
{
|
||||
className: Playmodules["volume"],
|
||||
id: "volume",
|
||||
value: "1",
|
||||
"data-mute": "0.5",
|
||||
type: "range",
|
||||
max: "1",
|
||||
min: "0",
|
||||
step: "0.01",
|
||||
ref: volumeEl,
|
||||
style: { display: "none" },
|
||||
onClick: updateVolumeIcon
|
||||
}
|
||||
)), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"button",
|
||||
{
|
||||
"data-title": "\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",
|
||||
className: Playmodules["fullscreen-button"],
|
||||
onClick: () => {
|
||||
if ((0,fullscreen/* IsFull */.vp)()) {
|
||||
(0,fullscreen/* exitFull */.BU)();
|
||||
} else {
|
||||
(0,fullscreen/* requestFullScreen */.Dj)(warpEl.current);
|
||||
}
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"i",
|
||||
{
|
||||
className: `icon-fangda1 iconfont`,
|
||||
style: { fontSize: "12px", color: "white" }
|
||||
}
|
||||
)
|
||||
))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Playmodules["video-progress"] }, /* @__PURE__ */ _react_17_0_2_react.createElement("progress", { ref: progressBarEl, value: "0", min: "0" }), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"input",
|
||||
{
|
||||
className: Playmodules.seek,
|
||||
ref: seekEl,
|
||||
value: "0",
|
||||
min: "0",
|
||||
type: "range",
|
||||
step: "1"
|
||||
}
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"div",
|
||||
{
|
||||
className: Playmodules["seek-tooltip"],
|
||||
ref: seekTooltipEl,
|
||||
id: "seek-tooltip"
|
||||
},
|
||||
"00:00"
|
||||
))))), /* @__PURE__ */ _react_17_0_2_react.createElement("svg", { style: { display: "none" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("defs", null, /* @__PURE__ */ _react_17_0_2_react.createElement("symbol", { id: "pause", viewBox: "0 0 24 24" }, /* @__PURE__ */ _react_17_0_2_react.createElement("path", { d: "M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z" })), /* @__PURE__ */ _react_17_0_2_react.createElement("symbol", { id: "play-icon", viewBox: "0 0 24 24" }, /* @__PURE__ */ _react_17_0_2_react.createElement("path", { d: "M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z" })), /* @__PURE__ */ _react_17_0_2_react.createElement("symbol", { id: "volume-high", viewBox: "0 0 24 24" }, /* @__PURE__ */ _react_17_0_2_react.createElement("path", { d: "M14.016 3.234q3.047 0.656 5.016 3.117t1.969 5.648-1.969 5.648-5.016 3.117v-2.063q2.203-0.656 3.586-2.484t1.383-4.219-1.383-4.219-3.586-2.484v-2.063zM16.5 12q0 2.813-2.484 4.031v-8.063q1.031 0.516 1.758 1.688t0.727 2.344zM3 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6z" })), /* @__PURE__ */ _react_17_0_2_react.createElement("symbol", { id: "volume-low", viewBox: "0 0 24 24" }, /* @__PURE__ */ _react_17_0_2_react.createElement("path", { d: "M5.016 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6zM18.516 12q0 2.766-2.531 4.031v-8.063q1.031 0.516 1.781 1.711t0.75 2.32z" })), /* @__PURE__ */ _react_17_0_2_react.createElement("symbol", { id: "volume-mute", viewBox: "0 0 24 24" }, /* @__PURE__ */ _react_17_0_2_react.createElement("path", { d: "M12 3.984v4.219l-2.109-2.109zM4.266 3l16.734 16.734-1.266 1.266-2.063-2.063q-1.547 1.313-3.656 1.828v-2.063q1.172-0.328 2.25-1.172l-4.266-4.266v6.75l-5.016-5.016h-3.984v-6h4.734l-4.734-4.734zM18.984 12q0-2.391-1.383-4.219t-3.586-2.484v-2.063q3.047 0.656 5.016 3.117t1.969 5.648q0 2.203-1.031 4.172l-1.5-1.547q0.516-1.266 0.516-2.625zM16.5 12q0 0.422-0.047 0.609l-2.438-2.438v-2.203q1.031 0.516 1.758 1.688t0.727 2.344z" })), /* @__PURE__ */ _react_17_0_2_react.createElement("symbol", { id: "fullscreen", viewBox: "0 0 24 24" }, /* @__PURE__ */ _react_17_0_2_react.createElement("path", { d: "M14.016 5.016h4.969v4.969h-1.969v-3h-3v-1.969zM17.016 17.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 9.984v-4.969h4.969v1.969h-3v3h-1.969zM6.984 14.016v3h3v1.969h-4.969v-4.969h1.969z" })), /* @__PURE__ */ _react_17_0_2_react.createElement("symbol", { id: "fullscreen-exit", viewBox: "0 0 24 24" }, /* @__PURE__ */ _react_17_0_2_react.createElement("path", { d: "M15.984 8.016h3v1.969h-4.969v-4.969h1.969v3zM14.016 18.984v-4.969h4.969v1.969h-3v3h-1.969zM8.016 8.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 15.984v-1.969h4.969v4.969h-1.969v-3h-3z" })), /* @__PURE__ */ _react_17_0_2_react.createElement("symbol", { id: "pip", viewBox: "0 0 24 24" }, /* @__PURE__ */ _react_17_0_2_react.createElement("path", { d: "M21 19.031v-14.063h-18v14.063h18zM23.016 18.984q0 0.797-0.609 1.406t-1.406 0.609h-18q-0.797 0-1.406-0.609t-0.609-1.406v-14.016q0-0.797 0.609-1.383t1.406-0.586h18q0.797 0 1.406 0.586t0.609 1.383v14.016zM18.984 11.016v6h-7.969v-6h7.969z" })))));
|
||||
}
|
||||
));
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 98563:
|
||||
/*!*********************************!*\
|
||||
!*** ./src/utils/fullscreen.ts ***!
|
||||
\*********************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ BU: function() { return /* binding */ exitFull; },
|
||||
/* harmony export */ Dj: function() { return /* binding */ requestFullScreen; },
|
||||
/* harmony export */ gH: function() { return /* binding */ fullscreenChange; },
|
||||
/* harmony export */ vp: function() { return /* binding */ IsFull; }
|
||||
/* harmony export */ });
|
||||
function requestFullScreen(element) {
|
||||
try {
|
||||
if (element.mozRequestFullScreen) {
|
||||
element.mozRequestFullScreen();
|
||||
} else if (element.webkitRequestFullScreen) {
|
||||
element.webkitRequestFullScreen();
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e, ":e");
|
||||
}
|
||||
}
|
||||
function exitFull() {
|
||||
if (window.top.document.webkitExitFullscreen) {
|
||||
window.top.document.webkitExitFullscreen();
|
||||
} else if (document.exitFullscreen) {
|
||||
window.top.document.exitFullscreen();
|
||||
} else if (document.msExitFullscreen) {
|
||||
window.top.document.msExitFullscreen();
|
||||
} else if (document.mozCancelFullScreen) {
|
||||
window.top.document.mozCancelFullScreen();
|
||||
}
|
||||
}
|
||||
const fullscreenChange = () => {
|
||||
if (document.webkitExitFullscreen) {
|
||||
return "webkitfullscreenchange";
|
||||
} else if (document.exitFullscreen) {
|
||||
return "fullscreenchange";
|
||||
} else if (document.msExitFullscreen) {
|
||||
return "msfullscreenchange";
|
||||
} else if (document.mozCancelFullScreen) {
|
||||
return "mozfullscreenchange";
|
||||
}
|
||||
};
|
||||
function IsFull() {
|
||||
var fullscreenElement = window.top.document.fullscreenElement || window.top.document.mozFullscreenElement || window.top.document.webkitFullscreenElement;
|
||||
var fullscreenEnabled = document.fullscreenEnabled || document.mozFullscreenEnabled || document.webkitFullscreenEnabled;
|
||||
console.log("fullscreenElement", fullscreenElement);
|
||||
if (fullscreenElement == null) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
@ -0,0 +1,898 @@
|
||||
"use strict";
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[3381],{
|
||||
|
||||
/***/ 81086:
|
||||
/*!**********************************************************!*\
|
||||
!*** ./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","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","blankWrapper":"blankWrapper___nC45e","blankInput":"blankInput___pEHsx","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"});
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 55339:
|
||||
/*!****************************************************!*\
|
||||
!*** ./src/components/tpi-code-setting/index.less ***!
|
||||
\****************************************************/
|
||||
/***/ (function() {
|
||||
|
||||
// extracted by mini-css-extract-plugin
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 52453:
|
||||
/*!********************************************************!*\
|
||||
!*** ./src/components/Knowledge/index.tsx + 1 modules ***!
|
||||
\********************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
N: function() { return /* binding */ Knowledge; }
|
||||
});
|
||||
|
||||
// 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/select/index.js
|
||||
var es_select = __webpack_require__(57809);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
||||
var modal = __webpack_require__(43418);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
|
||||
var row = __webpack_require__(95237);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
|
||||
var col = __webpack_require__(43604);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
||||
var input = __webpack_require__(1056);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
||||
var message = __webpack_require__(8591);
|
||||
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
||||
var fetch = __webpack_require__(87101);
|
||||
;// CONCATENATED MODULE: ./src/components/Knowledge/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var Knowledgemodules = ({"wrap":"wrap___F7E3F","selectWrapper":"selectWrapper____kESB","tips":"tips___aHjQY","linkBtn":"linkBtn___uggVr","mainText":"mainText____S1I0"});
|
||||
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/ExclamationCircleOutlined.js + 1 modules
|
||||
var ExclamationCircleOutlined = __webpack_require__(80045);
|
||||
;// CONCATENATED MODULE: ./src/components/Knowledge/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());
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const { Option } = es_select["default"];
|
||||
const Knowledge = ({
|
||||
subId,
|
||||
value,
|
||||
selectvalues,
|
||||
disabled,
|
||||
knowledgeOptions = [],
|
||||
onChange = () => {
|
||||
},
|
||||
onAddKnowledgeFinish = () => {
|
||||
}
|
||||
}) => {
|
||||
const addValue = (0,_react_17_0_2_react.useRef)();
|
||||
const [values, setValues] = (0,_react_17_0_2_react.useState)([]);
|
||||
value = value || [];
|
||||
const handleChange = (e, valuesmap) => {
|
||||
if (e) {
|
||||
setValues([valuesmap.key]);
|
||||
onChange([valuesmap.key]);
|
||||
} else {
|
||||
setValues([]);
|
||||
onChange([]);
|
||||
}
|
||||
};
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
if ((selectvalues == null ? void 0 : selectvalues.length) > 0) {
|
||||
setValues([...selectvalues]);
|
||||
onChange([...selectvalues]);
|
||||
}
|
||||
}, [knowledgeOptions]);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
if ((value == null ? void 0 : value.length) > 0) {
|
||||
onChange([...value]);
|
||||
}
|
||||
}, [knowledgeOptions]);
|
||||
const handleAdd = (e) => {
|
||||
e.preventDefault();
|
||||
addValue.current = "";
|
||||
modal["default"].confirm({
|
||||
centered: true,
|
||||
width: 640,
|
||||
okText: "\u786E\u5B9A",
|
||||
cancelText: "\u53D6\u6D88",
|
||||
icon: null,
|
||||
title: "\u65B0\u5EFA\u77E5\u8BC6\u70B9",
|
||||
className: "custom-modal-divider",
|
||||
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "font14" }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: "mb20" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(ExclamationCircleOutlined/* default */.Z, { style: { color: "#FF8C29" } })), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: `ml10 ${Knowledgemodules.mainText}` }, "\u65B0\u5EFA\u7684\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u5E73\u53F0\u5BA1\u6838\u5217\u5165\u516C\u5F00\u77E5\u8BC6\u70B9\u540E\uFF0C\u5BF9\u6240\u6709\u7528\u6237\u53EF\u89C1\u3002", /* @__PURE__ */ _react_17_0_2_react.createElement("br", null), "\u5E73\u53F0\u6709\u6743\u5220\u9664\u4E0D\u5408\u9002\u7684\u77E5\u8BC6\u70B9\uFF0C\u8BF7\u8BA4\u771F\u586B\u5199\u77E5\u8BC6\u70B9\u540D\u79F0\u3002")), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
input["default"],
|
||||
{
|
||||
maxLength: 20,
|
||||
size: "middle",
|
||||
showCount: true,
|
||||
placeholder: "\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0",
|
||||
defaultValue: addValue.current,
|
||||
onChange: (e2) => {
|
||||
addValue.current = e2.target.value;
|
||||
}
|
||||
}
|
||||
)),
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => __async(void 0, null, function* () {
|
||||
if (!addValue.current) {
|
||||
message/* default */.ZP.warning("\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0");
|
||||
return reject();
|
||||
}
|
||||
if (addValue.current.length > 20) {
|
||||
message/* default */.ZP.warning("\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC720\u5B57\u7684\u77E5\u8BC6\u70B9\u540D\u79F0");
|
||||
return reject();
|
||||
}
|
||||
const res = yield (0,fetch/* default */.ZP)(
|
||||
`/api/tag_disciplines.json`,
|
||||
{
|
||||
method: "post",
|
||||
body: {
|
||||
name: addValue.current,
|
||||
sub_discipline_id: subId
|
||||
}
|
||||
}
|
||||
);
|
||||
if ((res == null ? void 0 : res.status) === 0) {
|
||||
onAddKnowledgeFinish({ id: res.tag_discipline_id, name: addValue.current, type: "personal" });
|
||||
let value2 = [];
|
||||
value2.push(res.tag_discipline_id);
|
||||
onChange([...value2]);
|
||||
setValues([res.tag_discipline_id]);
|
||||
onChange([...value2]);
|
||||
}
|
||||
return resolve();
|
||||
}));
|
||||
}
|
||||
});
|
||||
};
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { wrap: false, align: "middle", className: Knowledgemodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_select["default"],
|
||||
{
|
||||
disabled: !subId || disabled,
|
||||
className: Knowledgemodules.selectWrapper,
|
||||
placeholder: "\u8BF7\u9009\u62E9\u77E5\u8BC6\u70B9",
|
||||
onChange: handleChange,
|
||||
style: {
|
||||
width: 490
|
||||
},
|
||||
showSearch: true,
|
||||
allowClear: true,
|
||||
value: knowledgeOptions == null ? void 0 : knowledgeOptions.filter((item) => (values == null ? void 0 : values.includes(item == null ? void 0 : item.id)) || (values == null ? void 0 : values.includes((item == null ? void 0 : item.id) + ""))).map((item) => item.name)
|
||||
},
|
||||
knowledgeOptions == null ? void 0 : knowledgeOptions.map((item) => /* @__PURE__ */ _react_17_0_2_react.createElement(Option, { key: item.id, value: item.name }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { display: "flex", justifyContent: "space-between" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis" } }, item.name), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, item.type === "personal" ? "\uFF08\u81EA\u7528\uFF09" : ""))))
|
||||
)), subId && /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: "ml20" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Knowledgemodules.tips }, "\u6CA1\u6709\u5408\u9002\u7684\u77E5\u8BC6\u70B9\uFF1F"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Knowledgemodules.linkBtn, onClick: handleAdd }, "\u65B0\u5EFA\u77E5\u8BC6\u70B9")));
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 20252:
|
||||
/*!**********************************************************!*\
|
||||
!*** ./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 */ 20103);
|
||||
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.less?modules */ 81086);
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 59301);
|
||||
/* harmony import */ var _components_RenderHtml__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/RenderHtml */ 12586);
|
||||
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__WEBPACK_IMPORTED_MODULE_2__.createElement("div", { id: scrollId || "" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_2__.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__WEBPACK_IMPORTED_MODULE_2__.createElement(
|
||||
_components_markdown_editor__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z,
|
||||
{
|
||||
watch: true,
|
||||
isFocus: true,
|
||||
height,
|
||||
placeholder,
|
||||
defaultValue: value,
|
||||
onChange
|
||||
}
|
||||
) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_2__.createElement("div", { style: { cursor: "pointer" } }, value ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_2__.createElement(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.inputBorder, value }) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_2__.createElement("div", { className: `${_index_less_modules__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.inputBorder} ${_index_less_modules__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z.placeholder}` }, placeholder));
|
||||
};
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 38836:
|
||||
/*!*********************************************************!*\
|
||||
!*** ./src/components/tpi-code-setting/CodeSetting.tsx ***!
|
||||
\*********************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
||||
/* harmony import */ var _index_less__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.less */ 55339);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd */ 57809);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! antd */ 78673);
|
||||
|
||||
|
||||
|
||||
const Option = antd__WEBPACK_IMPORTED_MODULE_2__["default"].Option;
|
||||
/* harmony default export */ __webpack_exports__.Z = (({
|
||||
isTheoretical,
|
||||
onFontSizeChange,
|
||||
cmFontSize,
|
||||
cmCodeMode,
|
||||
autoFormat,
|
||||
onCodeModeChange,
|
||||
onTabToSpace,
|
||||
onAutoFormat,
|
||||
formatDocument,
|
||||
className = "",
|
||||
tabToSpace,
|
||||
children
|
||||
}) => {
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: `tpi-code-setting ${className}` }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("h3", null, "\u4EE3\u7801\u683C\u5F0F"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("section", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "file-item" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("b", null, "\u663E\u793A\u6A21\u5F0F"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_2__["default"],
|
||||
{
|
||||
bordered: false,
|
||||
size: "small",
|
||||
value: cmCodeMode,
|
||||
onChange: onCodeModeChange
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Option, { value: "vs" }, "\u767D\u8272\u80CC\u666F"),
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Option, { value: "vs-dark" }, "\u9ED1\u8272\u80CC\u666F")
|
||||
)), !isTheoretical && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "file-item" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("b", null, "\u5B57\u4F53\u5927\u5C0F"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_2__["default"],
|
||||
{
|
||||
bordered: false,
|
||||
size: "small",
|
||||
value: cmFontSize,
|
||||
onChange: onFontSizeChange
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Option, { value: 12 }, "12px"),
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Option, { value: 14 }, "14px"),
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Option, { value: 16 }, "16px"),
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Option, { value: 18 }, "18px"),
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Option, { value: 20 }, "20px"),
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Option, { value: 22 }, "22px")
|
||||
)), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "file-item" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("b", null, "Tab\u8F6C\u6362"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, { checked: tabToSpace, onChange: onTabToSpace })), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "file-item", onClick: formatDocument }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("b", { style: { cursor: "pointer" } }, "\u683C\u5F0F\u5316\u4EE3\u7801")))), !isTheoretical && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("h3", null, "\u5FEB\u6377\u952E"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("section", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "file-item" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("b", null, "\u4FDD\u5B58\u4EE3\u7801"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", null, "Ctrl + S")), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "file-item" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("b", null, "\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", null, "F1 / Alt + F1")), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "file-item" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("b", null, "\u5DE6\u53F3\u7F29\u8FDB"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", null, "Ctrl + ]/[")), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "file-item" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("b", null, "\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", null, "Ctrl + Shift + \\")), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "file-item" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("b", null, "\u8F6C\u5230\u884C\u9996"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", null, "Home")), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "file-item" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("b", null, "\u8F6C\u5230\u884C\u5C3E"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", null, "End"))), children));
|
||||
});
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 81137:
|
||||
/*!*******************************************************************!*\
|
||||
!*** ./src/pages/Problems/OjForm/CodePanel/index.tsx + 1 modules ***!
|
||||
\*******************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ CodePanel; }
|
||||
});
|
||||
|
||||
// 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/drawer/index.js + 9 modules
|
||||
var drawer = __webpack_require__(43428);
|
||||
// EXTERNAL MODULE: ./src/components/monaco-editor/index.jsx + 4 modules
|
||||
var monaco_editor = __webpack_require__(1699);
|
||||
// EXTERNAL MODULE: ./src/components/tpi-code-setting/CodeSetting.tsx
|
||||
var CodeSetting = __webpack_require__(38836);
|
||||
// EXTERNAL MODULE: ./src/components/modal.tsx
|
||||
var modal = __webpack_require__(69210);
|
||||
// EXTERNAL MODULE: ./src/utils/urlTool.ts
|
||||
var urlTool = __webpack_require__(65746);
|
||||
;// CONCATENATED MODULE: ./src/pages/Problems/OjForm/CodePanel/index.less
|
||||
// extracted by mini-css-extract-plugin
|
||||
|
||||
;// CONCATENATED MODULE: ./src/pages/Problems/OjForm/CodePanel/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));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const initialState = {
|
||||
theme: (0,urlTool/* fromStore */.G)("cmCodeMode", "vs-dark"),
|
||||
fontSize: (0,urlTool/* fromStore */.G)("cmFontSize", 14),
|
||||
showEditorSetting: false,
|
||||
tabToSpace: (0,urlTool/* fromStore */.G)("cmTabToSpace", true)
|
||||
};
|
||||
var Types = /* @__PURE__ */ ((Types2) => {
|
||||
Types2[Types2["set_font_size"] = 0] = "set_font_size";
|
||||
Types2[Types2["set_theme"] = 1] = "set_theme";
|
||||
Types2[Types2["on_tab_to_space"] = 2] = "on_tab_to_space";
|
||||
Types2[Types2["set_show_editor_setting"] = 3] = "set_show_editor_setting";
|
||||
return Types2;
|
||||
})(Types || {});
|
||||
function reducer(state, action) {
|
||||
switch (action.type) {
|
||||
case 3 /* set_show_editor_setting */:
|
||||
return __spreadProps(__spreadValues({}, state), { showEditorSetting: action.payload });
|
||||
case 1 /* set_theme */:
|
||||
return __spreadProps(__spreadValues({}, state), { theme: action.payload });
|
||||
case 0 /* set_font_size */:
|
||||
return __spreadProps(__spreadValues({}, state), { fontSize: action.payload });
|
||||
case 2 /* on_tab_to_space */:
|
||||
return __spreadProps(__spreadValues({}, state), { tabToSpace: action.payload });
|
||||
default:
|
||||
throw new Error();
|
||||
}
|
||||
}
|
||||
/* harmony default export */ var CodePanel = (({ isLoading, value, onChange, language, onUpdateCode, ActionBarRender = (onShowCodeSetting) => {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(DefaultActionBar, { onShowCodeSetting });
|
||||
} }) => {
|
||||
const [state, dispatch] = (0,_react_17_0_2_react.useReducer)(reducer, initialState);
|
||||
const { theme, fontSize, showEditorSetting, tabToSpace } = state;
|
||||
const timeRef = (0,_react_17_0_2_react.useRef)();
|
||||
const valueRef = (0,_react_17_0_2_react.useRef)();
|
||||
const codeSettingOption = {
|
||||
onFontSizeChange: (val) => {
|
||||
dispatch({
|
||||
type: 0 /* set_font_size */,
|
||||
payload: val
|
||||
});
|
||||
(0,urlTool/* toStore */.t)("cmFontSize", val);
|
||||
},
|
||||
tabToSpace,
|
||||
cmFontSize: fontSize,
|
||||
className: "oj",
|
||||
cmCodeMode: theme,
|
||||
onTabToSpace: (checked) => {
|
||||
dispatch({
|
||||
type: 2 /* on_tab_to_space */,
|
||||
payload: checked
|
||||
});
|
||||
(0,urlTool/* toStore */.t)("cmTabToSpace", checked);
|
||||
},
|
||||
onCodeModeChange: (val) => {
|
||||
dispatch({
|
||||
type: 1 /* set_theme */,
|
||||
payload: val
|
||||
});
|
||||
(0,urlTool/* toStore */.t)("cmCodeMode", val);
|
||||
}
|
||||
};
|
||||
function onHideCodeSetting() {
|
||||
dispatch({
|
||||
type: 3 /* set_show_editor_setting */,
|
||||
payload: false
|
||||
});
|
||||
}
|
||||
function onShowCodeSetting() {
|
||||
dispatch({
|
||||
type: 3 /* set_show_editor_setting */,
|
||||
payload: true
|
||||
});
|
||||
}
|
||||
const editorOption = {
|
||||
value,
|
||||
language,
|
||||
// onChange,
|
||||
theme,
|
||||
height: "calc(100% - 56px)",
|
||||
options: {
|
||||
fontSize,
|
||||
insertSpaces: tabToSpace
|
||||
},
|
||||
onChange: (value2) => {
|
||||
onChange(value2);
|
||||
valueRef.current = value2;
|
||||
clearTimeout(timeRef.current);
|
||||
timeRef.current = setTimeout(() => {
|
||||
onUpdateCode(valueRef.current);
|
||||
}, 1e4);
|
||||
},
|
||||
onEditBlur: (value2) => {
|
||||
if (!!valueRef.current)
|
||||
onUpdateCode(valueRef.current);
|
||||
}
|
||||
};
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "code-panel-container" }, ActionBarRender(onShowCodeSetting), !isLoading && /* @__PURE__ */ _react_17_0_2_react.createElement(monaco_editor/* default */.ZP, __spreadValues({}, editorOption))), /* @__PURE__ */ _react_17_0_2_react.createElement(modal/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
drawer/* default */.Z,
|
||||
{
|
||||
rootClassName: "oj",
|
||||
title: null,
|
||||
placement: "right",
|
||||
closable: false,
|
||||
open: showEditorSetting,
|
||||
onClose: onHideCodeSetting
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(CodeSetting/* default */.Z, __spreadValues({}, codeSettingOption))
|
||||
)));
|
||||
});
|
||||
function DefaultActionBar({ onShowCodeSetting }) {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "action-bar" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"), /* @__PURE__ */ _react_17_0_2_react.createElement("a", { onClick: onShowCodeSetting }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-shezhi" })));
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 12443:
|
||||
/*!**************************************************************************!*\
|
||||
!*** ./src/pages/Problems/OjForm/CodeProgramPanel/index.tsx + 1 modules ***!
|
||||
\**************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ CodeProgramPanel; }
|
||||
});
|
||||
|
||||
// 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/drawer/index.js + 9 modules
|
||||
var drawer = __webpack_require__(43428);
|
||||
// EXTERNAL MODULE: ./src/components/monaco-editor/index.jsx + 4 modules
|
||||
var monaco_editor = __webpack_require__(1699);
|
||||
// EXTERNAL MODULE: ./src/components/tpi-code-setting/CodeSetting.tsx
|
||||
var CodeSetting = __webpack_require__(38836);
|
||||
// EXTERNAL MODULE: ./src/components/modal.tsx
|
||||
var modal = __webpack_require__(69210);
|
||||
// EXTERNAL MODULE: ./src/utils/urlTool.ts
|
||||
var urlTool = __webpack_require__(65746);
|
||||
;// CONCATENATED MODULE: ./src/pages/Problems/OjForm/CodeProgramPanel/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var CodeProgramPanelmodules = ({"code-panel-container":"code-panel-container___RFtv_","action-oj-bar":"action-oj-bar___ByFmZ","active":"active___s9gT5"});
|
||||
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js
|
||||
var lodash = __webpack_require__(89392);
|
||||
;// CONCATENATED MODULE: ./src/pages/Problems/OjForm/CodeProgramPanel/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));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const initialState = {
|
||||
theme: (0,urlTool/* fromStore */.G)("cmCodeMode", "vs-dark"),
|
||||
fontSize: (0,urlTool/* fromStore */.G)("cmFontSize", 14),
|
||||
showEditorSetting: false,
|
||||
tabToSpace: (0,urlTool/* fromStore */.G)("cmTabToSpace", true)
|
||||
};
|
||||
var Types = /* @__PURE__ */ ((Types2) => {
|
||||
Types2[Types2["set_font_size"] = 0] = "set_font_size";
|
||||
Types2[Types2["set_theme"] = 1] = "set_theme";
|
||||
Types2[Types2["on_tab_to_space"] = 2] = "on_tab_to_space";
|
||||
Types2[Types2["set_show_editor_setting"] = 3] = "set_show_editor_setting";
|
||||
return Types2;
|
||||
})(Types || {});
|
||||
function reducer(state, action) {
|
||||
switch (action.type) {
|
||||
case 3 /* set_show_editor_setting */:
|
||||
return __spreadProps(__spreadValues({}, state), { showEditorSetting: action.payload });
|
||||
case 1 /* set_theme */:
|
||||
return __spreadProps(__spreadValues({}, state), { theme: action.payload });
|
||||
case 0 /* set_font_size */:
|
||||
return __spreadProps(__spreadValues({}, state), { fontSize: action.payload });
|
||||
case 2 /* on_tab_to_space */:
|
||||
return __spreadProps(__spreadValues({}, state), { tabToSpace: action.payload });
|
||||
default:
|
||||
throw new Error();
|
||||
}
|
||||
}
|
||||
/* harmony default export */ var CodeProgramPanel = (({ isLoading, value = [], onChange }) => {
|
||||
var _a;
|
||||
const [state, dispatch] = (0,_react_17_0_2_react.useReducer)(reducer, initialState);
|
||||
const { theme, fontSize, showEditorSetting, tabToSpace } = state;
|
||||
const [language, setLanguage] = (0,_react_17_0_2_react.useState)("c");
|
||||
const saveLanguageItems = (0,_react_17_0_2_react.useRef)([]);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
if (!!(value == null ? void 0 : value.length)) {
|
||||
saveLanguageItems.current = (0,lodash.cloneDeep)(value);
|
||||
}
|
||||
}, [value]);
|
||||
const codeSettingOption = {
|
||||
onFontSizeChange: (val) => {
|
||||
dispatch({
|
||||
type: 0 /* set_font_size */,
|
||||
payload: val
|
||||
});
|
||||
(0,urlTool/* toStore */.t)("cmFontSize", val);
|
||||
},
|
||||
tabToSpace,
|
||||
cmFontSize: fontSize,
|
||||
className: "oj",
|
||||
cmCodeMode: theme,
|
||||
onTabToSpace: (checked) => {
|
||||
dispatch({
|
||||
type: 2 /* on_tab_to_space */,
|
||||
payload: checked
|
||||
});
|
||||
(0,urlTool/* toStore */.t)("cmTabToSpace", checked);
|
||||
},
|
||||
onCodeModeChange: (val) => {
|
||||
dispatch({
|
||||
type: 1 /* set_theme */,
|
||||
payload: val
|
||||
});
|
||||
(0,urlTool/* toStore */.t)("cmCodeMode", val);
|
||||
}
|
||||
};
|
||||
function onHideCodeSetting() {
|
||||
dispatch({
|
||||
type: 3 /* set_show_editor_setting */,
|
||||
payload: false
|
||||
});
|
||||
}
|
||||
function onShowCodeSetting() {
|
||||
dispatch({
|
||||
type: 3 /* set_show_editor_setting */,
|
||||
payload: true
|
||||
});
|
||||
}
|
||||
function onCodeChange(v) {
|
||||
var _a2;
|
||||
const item = (_a2 = saveLanguageItems.current) == null ? void 0 : _a2.map((e) => {
|
||||
if (e.language === language) {
|
||||
e.code = v;
|
||||
return e;
|
||||
}
|
||||
return e;
|
||||
});
|
||||
saveLanguageItems.current = (0,lodash.cloneDeep)(item);
|
||||
onChange(item);
|
||||
}
|
||||
const editorOption = {
|
||||
key: language,
|
||||
value: (_a = value == null ? void 0 : value.find((e) => e.language === language)) == null ? void 0 : _a.code,
|
||||
language,
|
||||
onChange: onCodeChange,
|
||||
theme,
|
||||
height: "calc(100% - 56px)",
|
||||
options: {
|
||||
fontSize,
|
||||
insertSpaces: tabToSpace
|
||||
}
|
||||
};
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: CodeProgramPanelmodules["code-panel-container"] }, /* @__PURE__ */ _react_17_0_2_react.createElement(DefaultActionBar, { languageItems: value, onLanguage: (v) => setLanguage(v), language, onShowCodeSetting }), !isLoading && /* @__PURE__ */ _react_17_0_2_react.createElement(monaco_editor/* default */.ZP, __spreadValues({}, editorOption))), /* @__PURE__ */ _react_17_0_2_react.createElement(modal/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
drawer/* default */.Z,
|
||||
{
|
||||
rootClassName: "oj",
|
||||
title: null,
|
||||
placement: "right",
|
||||
closable: false,
|
||||
open: showEditorSetting,
|
||||
onClose: onHideCodeSetting
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(CodeSetting/* default */.Z, __spreadValues({}, codeSettingOption))
|
||||
)));
|
||||
});
|
||||
function DefaultActionBar({ languageItems, language, onShowCodeSetting, onLanguage }) {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: CodeProgramPanelmodules["action-oj-bar"] }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"), languageItems == null ? void 0 : languageItems.map((e) => {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: language === (e == null ? void 0 : e.language) ? CodeProgramPanelmodules.active : "", onClick: () => onLanguage(e == null ? void 0 : e.language), key: e == null ? void 0 : e.language }, e == null ? void 0 : e.language);
|
||||
}), /* @__PURE__ */ _react_17_0_2_react.createElement("a", { onClick: onShowCodeSetting }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-shezhi" })));
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 30469:
|
||||
/*!**********************************************!*\
|
||||
!*** ./src/pages/Problems/OjForm/service.ts ***!
|
||||
\**********************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ GM: function() { return /* binding */ updateExerciseQuestion; },
|
||||
/* harmony export */ MK: function() { return /* binding */ addExerciseQuestion; },
|
||||
/* harmony export */ PR: function() { return /* binding */ getUser; },
|
||||
/* harmony export */ ZS: function() { return /* binding */ cancelPublishProgrammingTopic; },
|
||||
/* harmony export */ d1: function() { return /* binding */ getDisciplines; },
|
||||
/* harmony export */ fu: function() { return /* binding */ getProgrammingTopic; },
|
||||
/* harmony export */ j2: function() { return /* binding */ publishProgrammingTopic; },
|
||||
/* harmony export */ l_: function() { return /* binding */ updateProgrammingTopic; },
|
||||
/* harmony export */ uE: function() { return /* binding */ startChallenge; },
|
||||
/* harmony export */ zQ: function() { return /* binding */ addProgrammingTopic; }
|
||||
/* harmony export */ });
|
||||
/* unused harmony export addTag */
|
||||
/* harmony import */ var _utils_fetch_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/utils/fetch.ts */ 87101);
|
||||
|
||||
function getUser() {
|
||||
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_0__/* .get */ .U2)("problems/new.json");
|
||||
}
|
||||
function getDisciplines(source = "question") {
|
||||
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_0__/* .get */ .U2)(`disciplines.json`, { source });
|
||||
}
|
||||
function getProgrammingTopic(id) {
|
||||
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_0__/* .get */ .U2)(`problems/${id}/edit.json`);
|
||||
}
|
||||
function updateProgrammingTopic(id, params) {
|
||||
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_0__/* .put */ .gz)(`problems/${id}.json`, params);
|
||||
}
|
||||
function addProgrammingTopic(params) {
|
||||
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`problems.json`, params);
|
||||
}
|
||||
function addExerciseQuestion(exerciseId, params) {
|
||||
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`exercises/${exerciseId}/exercise_questions.json`, params);
|
||||
}
|
||||
function updateExerciseQuestion(id, params) {
|
||||
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_0__/* .put */ .gz)(`exercise_questions/${id}.json`, params);
|
||||
}
|
||||
function publishProgrammingTopic(id) {
|
||||
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`problems/${id}/publish.json`);
|
||||
}
|
||||
function cancelPublishProgrammingTopic(id) {
|
||||
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`problems/${id}/cancel_publish.json`);
|
||||
}
|
||||
function startChallenge(id) {
|
||||
return (0,_utils_fetch_ts__WEBPACK_IMPORTED_MODULE_0__/* .get */ .U2)(`problems/${id}/start.json`);
|
||||
}
|
||||
function addTag(sub_discipline_id, name) {
|
||||
return post(`tag_disciplines.json`, {
|
||||
name,
|
||||
sub_discipline_id
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 66013:
|
||||
/*!********************************************!*\
|
||||
!*** ./src/pages/Problems/OjForm/util.tsx ***!
|
||||
\********************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ D0: function() { return /* binding */ getDisciplineOptions; },
|
||||
/* harmony export */ R8: function() { return /* binding */ Keys; },
|
||||
/* harmony export */ jw: function() { return /* binding */ getSelectOptions; },
|
||||
/* harmony export */ y3: function() { return /* binding */ getDisciplineIds; }
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd */ 57809);
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
||||
|
||||
|
||||
const { Option } = antd__WEBPACK_IMPORTED_MODULE_1__["default"];
|
||||
var Keys = /* @__PURE__ */ ((Keys2) => {
|
||||
Keys2[Keys2["language"] = 0] = "language";
|
||||
Keys2[Keys2["difficult"] = 1] = "difficult";
|
||||
Keys2[Keys2["category"] = 2] = "category";
|
||||
Keys2[Keys2["openOrNot"] = 3] = "openOrNot";
|
||||
return Keys2;
|
||||
})(Keys || {});
|
||||
const Options = {
|
||||
[0 /* language */]: [
|
||||
{ title: "C", key: "C" },
|
||||
{ title: "C++", key: "C++" },
|
||||
{ title: "Python", key: "Python" },
|
||||
{ title: "Java", key: "Java" },
|
||||
{ title: "JavaScript", key: "JavaScript" },
|
||||
{ title: "Ruby", key: "Ruby" }
|
||||
],
|
||||
[1 /* difficult */]: [
|
||||
{ title: "\u7B80\u5355", key: 1 },
|
||||
{ title: "\u4E2D\u7B49", key: 2 },
|
||||
{ title: "\u56F0\u96BE", key: 3 }
|
||||
],
|
||||
[2 /* category */]: [
|
||||
{ title: "\u7A0B\u5E8F\u8BBE\u8BA1", key: 1 },
|
||||
{ title: "\u7B97\u6CD5", key: 2 }
|
||||
],
|
||||
[3 /* openOrNot */]: [
|
||||
{ title: "\u516C\u5F00", key: 1 },
|
||||
{ title: "\u79C1\u6709", key: 0 }
|
||||
]
|
||||
};
|
||||
function getSelectOptions(name) {
|
||||
return Options[name].map((item) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Option, { key: item.title, value: item.key }, " ", item.title, " "));
|
||||
}
|
||||
function getDisciplineOptions(data, result) {
|
||||
data.map((value) => {
|
||||
const { id, name, sub_disciplines } = value;
|
||||
let item = {
|
||||
value: id,
|
||||
label: name
|
||||
};
|
||||
result.push(item);
|
||||
if (sub_disciplines && sub_disciplines.length > 0) {
|
||||
item.children = [];
|
||||
getDisciplineOptions(sub_disciplines, item.children);
|
||||
}
|
||||
});
|
||||
}
|
||||
function getDisciplineIds(data, sub_disciplines_id) {
|
||||
var _a;
|
||||
let rs = [];
|
||||
for (let index = 0; index < data.length; index++) {
|
||||
const value = data[index];
|
||||
if (((_a = value.sub_disciplines) == null ? void 0 : _a.length) > 0) {
|
||||
rs[0] = value.id;
|
||||
for (let j = 0; j < value.sub_disciplines.length; j++) {
|
||||
const item = value.sub_disciplines[j];
|
||||
if (item.id === sub_disciplines_id) {
|
||||
rs[1] = item.id;
|
||||
return [rs, item.tag_disciplines || item.sub_disciplines || []];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return [rs, []];
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 61999:
|
||||
/*!***************************!*\
|
||||
!*** ./src/utils/enum.ts ***!
|
||||
\***************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ c: function() { return /* binding */ QuestionType; }
|
||||
/* harmony export */ });
|
||||
/* unused harmony export PageType */
|
||||
var PageType = /* @__PURE__ */ ((PageType2) => {
|
||||
PageType2["FirstPage"] = "firstPage";
|
||||
PageType2["PrevPage"] = "prevPage";
|
||||
PageType2["NextPage"] = "nextPage";
|
||||
return PageType2;
|
||||
})(PageType || {});
|
||||
var QuestionType = /* @__PURE__ */ ((QuestionType2) => {
|
||||
QuestionType2[QuestionType2["Single"] = 0] = "Single";
|
||||
QuestionType2[QuestionType2["Multiple"] = 1] = "Multiple";
|
||||
QuestionType2[QuestionType2["Judge"] = 2] = "Judge";
|
||||
QuestionType2[QuestionType2["Fill"] = 3] = "Fill";
|
||||
QuestionType2[QuestionType2["Subjective"] = 4] = "Subjective";
|
||||
QuestionType2[QuestionType2["Shixun"] = 5] = "Shixun";
|
||||
QuestionType2[QuestionType2["Program"] = 6] = "Program";
|
||||
QuestionType2[QuestionType2["Combine"] = 7] = "Combine";
|
||||
return QuestionType2;
|
||||
})(QuestionType || {});
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 65746:
|
||||
/*!******************************!*\
|
||||
!*** ./src/utils/urlTool.ts ***!
|
||||
\******************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ G: function() { return /* binding */ fromStore; },
|
||||
/* harmony export */ t: function() { return /* binding */ toStore; }
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var store__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! store */ 7062);
|
||||
/* harmony import */ var store__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(store__WEBPACK_IMPORTED_MODULE_0__);
|
||||
const isDev = (/* unused pure expression or super */ null && ("production" === "development"));
|
||||
|
||||
function toStore(key, val) {
|
||||
let _config = store__WEBPACK_IMPORTED_MODULE_0___default().get("__ec");
|
||||
if (!_config)
|
||||
_config = {};
|
||||
_config[key] = val;
|
||||
store__WEBPACK_IMPORTED_MODULE_0___default().set("__ec", _config);
|
||||
}
|
||||
function fromStore(key, defaultVal) {
|
||||
let _config = store__WEBPACK_IMPORTED_MODULE_0___default().get("__ec");
|
||||
if (!_config)
|
||||
return defaultVal;
|
||||
return _config[key] === void 0 ? defaultVal : _config[key];
|
||||
}
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
@ -0,0 +1,679 @@
|
||||
"use strict";
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[3640],{
|
||||
|
||||
/***/ 47508:
|
||||
/*!********************************************************************************!*\
|
||||
!*** ./src/pages/Classrooms/Lists/CommonHomework/components/AfterAppendix.tsx ***!
|
||||
\********************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ 78241);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! antd */ 43418);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! antd */ 1056);
|
||||
/* harmony import */ var _service_shixunHomeworks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/service/shixunHomeworks */ 13597);
|
||||
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! umi */ 87210);
|
||||
/* harmony import */ var _components_MultiUpload__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/MultiUpload */ 45982);
|
||||
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 PublishShixun = ({ classroomList, loading, dispatch }) => {
|
||||
const params = (0,umi__WEBPACK_IMPORTED_MODULE_2__.useParams)();
|
||||
const [form] = antd__WEBPACK_IMPORTED_MODULE_4__["default"].useForm();
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_5__["default"],
|
||||
{
|
||||
centered: true,
|
||||
title: "\u8865\u4EA4\u9644\u4EF6",
|
||||
open: classroomList.actionTabs.key === "\u8865\u4EA4\u9644\u4EF6" ? true : false,
|
||||
bodyStyle: { minHeight: 200 },
|
||||
onOk: () => __async(void 0, null, function* () {
|
||||
var _a;
|
||||
yield form.validateFields();
|
||||
const formValue = __spreadValues({}, form.getFieldValue());
|
||||
const { selectArrs } = classroomList.actionTabs;
|
||||
formValue.attachment_ids = (_a = formValue.attachment_ids) == null ? void 0 : _a.map((item) => item.response.id);
|
||||
const res = yield (0,_service_shixunHomeworks__WEBPACK_IMPORTED_MODULE_1__/* .reviseAttachment */ .mz)(__spreadProps(__spreadValues({}, formValue), { homeworkId: selectArrs.work_id }));
|
||||
if (res.status === 0) {
|
||||
form.resetFields();
|
||||
dispatch({
|
||||
type: "classroomList/setActionTabs",
|
||||
payload: {}
|
||||
});
|
||||
}
|
||||
}),
|
||||
onCancel: () => {
|
||||
form.resetFields();
|
||||
dispatch({
|
||||
type: "classroomList/setActionTabs",
|
||||
payload: {}
|
||||
});
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_4__["default"],
|
||||
{
|
||||
form,
|
||||
initialValues: {}
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_4__["default"].Item,
|
||||
{
|
||||
name: "attachment_ids",
|
||||
rules: [{ required: true, message: "\u8BF7\u4E0A\u4F20\u9644\u4EF6" }]
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_MultiUpload__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, null)
|
||||
),
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_4__["default"].Item, { name: "description" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_6__["default"].TextArea, { placeholder: "\u8BF7\u5728\u6B64\u8F93\u5165\u8865\u4EA4\u9644\u4EF6\u7684\u539F\u56E0\uFF0C\u6700\u5927\u9650\u5236100\u4E2A\u5B57\u7B26", rows: 7 }))
|
||||
)
|
||||
);
|
||||
};
|
||||
/* harmony default export */ __webpack_exports__.Z = ((0,umi__WEBPACK_IMPORTED_MODULE_2__.connect)(
|
||||
({
|
||||
classroomList,
|
||||
loading
|
||||
}) => ({
|
||||
classroomList,
|
||||
loading
|
||||
})
|
||||
)(PublishShixun));
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 98484:
|
||||
/*!**************************************************************************!*\
|
||||
!*** ./src/pages/Classrooms/Lists/CommonHomework/components/Publish.tsx ***!
|
||||
\**************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! antd */ 78241);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! antd */ 8591);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! antd */ 43418);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! antd */ 95237);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! antd */ 43604);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! antd */ 52409);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! antd */ 5112);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! antd */ 24905);
|
||||
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! moment */ 9498);
|
||||
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_1__);
|
||||
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/utils/fetch */ 87101);
|
||||
/* harmony import */ var _utils_authority__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/utils/authority */ 55830);
|
||||
/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/utils/util */ 3163);
|
||||
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! umi */ 87210);
|
||||
/* harmony import */ var _ShixunHomeworks_components_TrfList__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../ShixunHomeworks/components/TrfList */ 98258);
|
||||
/* harmony import */ var _service_classrooms__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/service/classrooms */ 16560);
|
||||
/* harmony import */ var _pages_Classrooms_Lists_ShixunHomeworks_Detail_components_ConfigWorks_Releasesetting__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/pages/Classrooms/Lists/ShixunHomeworks/Detail/components/ConfigWorks/Releasesetting */ 75117);
|
||||
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 PublishShixun = (_a) => {
|
||||
var _b = _a, {
|
||||
classroomList,
|
||||
dispatch,
|
||||
courseEndTime
|
||||
} = _b, props = __objRest(_b, [
|
||||
"classroomList",
|
||||
"dispatch",
|
||||
"courseEndTime"
|
||||
]);
|
||||
const params = (0,umi__WEBPACK_IMPORTED_MODULE_5__.useParams)();
|
||||
const [form] = antd__WEBPACK_IMPORTED_MODULE_9__["default"].useForm();
|
||||
const [page, setPage] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(1);
|
||||
const [list, setList] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
|
||||
const [count, setCount] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0);
|
||||
const [limit, setLimit] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(2e3);
|
||||
const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true);
|
||||
const [cancelState, setCancelState] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
||||
const [btnLoading, setBtnLoading] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
||||
const [targetKeys, settargetKeys] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
|
||||
const [radiovalue, setradiovalue] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true);
|
||||
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
||||
if (classroomList.actionTabs.key === "\u7ACB\u5373\u53D1\u5E03") {
|
||||
clear();
|
||||
getData();
|
||||
if (classroomList.actionTabs.type === 2) {
|
||||
const selectItem = classroomList.actionTabs.selectArrsAll[0];
|
||||
setradiovalue(selectItem.unified_setting);
|
||||
}
|
||||
}
|
||||
}, [classroomList.actionTabs]);
|
||||
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
||||
if (cancelState) {
|
||||
if (btnLoading)
|
||||
return;
|
||||
dispatch({
|
||||
type: "classroomList/setActionTabs",
|
||||
payload: {}
|
||||
});
|
||||
if ((0,_utils_authority__WEBPACK_IMPORTED_MODULE_3__/* .isAdmin */ .GJ)()) {
|
||||
dispatch({
|
||||
type: "classroomList/getClassroomTeacherCommonList",
|
||||
payload: __spreadProps(__spreadValues({}, classroomList.actionTabs.params), { type: 1 })
|
||||
});
|
||||
} else {
|
||||
dispatch({
|
||||
type: "classroomList/getClassroomCommonList",
|
||||
payload: __spreadValues({}, classroomList.actionTabs.params)
|
||||
});
|
||||
}
|
||||
}
|
||||
}, [cancelState]);
|
||||
const getData = (nextPage) => __async(void 0, null, function* () {
|
||||
setLoading(true);
|
||||
const res = yield (0,_service_classrooms__WEBPACK_IMPORTED_MODULE_7__/* .getAllCourseGroup */ .c_)(__spreadProps(__spreadValues({}, params), {
|
||||
page: nextPage ? nextPage : page,
|
||||
limit: 2e4,
|
||||
homework_id: classroomList.actionTabs.type === 1 ? "" : classroomList.actionTabs.selectArrs[0]
|
||||
}));
|
||||
res == null ? void 0 : res.course_groups.map((item, index) => {
|
||||
item.key = item.id;
|
||||
item.title = item.name;
|
||||
item.disabled = item.is_published;
|
||||
});
|
||||
if (res) {
|
||||
setList([...res == null ? void 0 : res.course_groups]);
|
||||
setCount(res == null ? void 0 : res.course_groups_count);
|
||||
setLoading(false);
|
||||
if (!nextPage) {
|
||||
form.setFieldsValue({
|
||||
["publish_time"]: moment__WEBPACK_IMPORTED_MODULE_1___default()(
|
||||
moment__WEBPACK_IMPORTED_MODULE_1___default()(/* @__PURE__ */ new Date()).add(0, "days").format("YYYY-MM-DD HH:mm")
|
||||
),
|
||||
["end_time"]: moment__WEBPACK_IMPORTED_MODULE_1___default()(
|
||||
moment__WEBPACK_IMPORTED_MODULE_1___default()(new Date((0,_utils_util__WEBPACK_IMPORTED_MODULE_4__/* .DayHalfPastOne */ .qd)("/"))).add(7, "days").format("YYYY-MM-DD HH:mm")
|
||||
)
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
const onLoadMore = (nextPage) => {
|
||||
setPage(nextPage);
|
||||
getData(nextPage);
|
||||
};
|
||||
const onRefresh = () => {
|
||||
if ((0,_utils_authority__WEBPACK_IMPORTED_MODULE_3__/* .isAdmin */ .GJ)()) {
|
||||
if (classroomList.actionTabs.detail) {
|
||||
dispatch({
|
||||
type: "shixunHomeworks/setActionTabs",
|
||||
payload: {}
|
||||
});
|
||||
dispatch({
|
||||
type: "shixunHomeworks/getWorkList",
|
||||
payload: __spreadValues({}, params)
|
||||
});
|
||||
dispatch({
|
||||
type: "shixunHomeworks/getWorkSetting",
|
||||
payload: __spreadValues({}, params)
|
||||
});
|
||||
} else {
|
||||
dispatch({
|
||||
type: "classroomList/getClassroomTeacherCommonList",
|
||||
payload: __spreadProps(__spreadValues({}, classroomList.actionTabs.params), { type: 1 })
|
||||
});
|
||||
}
|
||||
} else {
|
||||
dispatch({
|
||||
type: "classroomList/getClassroomCommonList",
|
||||
payload: __spreadValues({}, classroomList.actionTabs.params)
|
||||
});
|
||||
}
|
||||
};
|
||||
const handleOk = () => __async(void 0, null, function* () {
|
||||
var _a2, _b2;
|
||||
if ((0,_utils_authority__WEBPACK_IMPORTED_MODULE_3__/* .isAssistant */ .Rm)() && !((_a2 = classroomList.AssistantObject.normal) == null ? void 0 : _a2.can_publish)) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .ZP.warning("\u60A8\u672A\u83B7\u53D6\u6B64\u6743\u9650\uFF0C\u9700\u5411\u7BA1\u7406\u5458\u7533\u8BF7\u6743\u9650\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD");
|
||||
setisLoading(false);
|
||||
return;
|
||||
}
|
||||
const formValue = __spreadValues({}, form.getFieldsValue());
|
||||
if (formValue.end_time <= formValue.publish_time) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .ZP.info("\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u5927\u4E8E\u6216\u7B49\u4E8E\u53D1\u5E03\u65F6\u95F4");
|
||||
setisLoading(false);
|
||||
return;
|
||||
}
|
||||
if ((targetKeys == null ? void 0 : targetKeys.length) <= 0 && !radiovalue && list.length > 0) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .ZP.info("\u53D1\u5E03\u73ED\u7EA7\u4E0D\u80FD\u4E3A\u7A7A");
|
||||
setisLoading(false);
|
||||
return;
|
||||
}
|
||||
let bodys = {
|
||||
homework_ids: [...classroomList.actionTabs.selectArrs],
|
||||
group_ids: targetKeys.length > 0 ? targetKeys.map((item) => item.id) : (_b2 = classroomList.detailCommonHomeworksList) == null ? void 0 : _b2.course_groups,
|
||||
end_time: moment__WEBPACK_IMPORTED_MODULE_1___default()(formValue.end_time).format("YYYY-MM-DD HH:mm"),
|
||||
publish_time: moment__WEBPACK_IMPORTED_MODULE_1___default()(formValue.publish_time).format("YYYY-MM-DD HH:mm"),
|
||||
unified_setting: !targetKeys.length
|
||||
};
|
||||
setisLoading(true);
|
||||
const res = yield (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .ZP)(
|
||||
`/api/courses/${params.coursesId}/homework_commons/publish_with_homework_list_position.json`,
|
||||
{
|
||||
method: "post",
|
||||
body: __spreadValues({}, bodys)
|
||||
}
|
||||
);
|
||||
if (res.status === 0) {
|
||||
setisLoading(false);
|
||||
(0,_utils_util__WEBPACK_IMPORTED_MODULE_4__/* .trackEvent */ .L9)(["\u6559\u5B66\u8BFE\u5802", "\u56FE\u6587\u4F5C\u4E1A", "\u7ACB\u5373\u53D1\u5E03"]);
|
||||
antd__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .ZP.success("\u53D1\u5E03\u6210\u529F");
|
||||
dispatch({
|
||||
type: "classroomList/setActionTabs",
|
||||
payload: { key: "\u6E05\u9664\u9009\u62E9\u6570\u636E" }
|
||||
});
|
||||
props.onCallback && props.onCallback();
|
||||
onRefresh();
|
||||
if (localStorage.getItem("Noviceguide") === "0") {
|
||||
} else {
|
||||
dispatch({
|
||||
type: "shixunHomeworks/setActionTabs",
|
||||
payload: {
|
||||
key: "\u5E95\u90E8\u5F39\u7A97",
|
||||
type: 13,
|
||||
text: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", null, "\u6700\u540E\uFF0C\u54B1\u4EEC\u7ED9\u6559\u5B66\u8BFE\u5802\u6DFB\u52A0\u4E00\u540D\u5B66\u751F~\u70B9\u51FB\u201C\u6DFB\u52A0\u5B66\u751F\u201D\uFF0C\u5728\u5F39\u7A97\u9875\u9762\u4E2D\u8F93\u5165\u5E76\u641C\u7D22\u5B66\u751F\u59D3\u540D\uFF0C\u70B9\u51FB\u201C\u786E\u5B9A\u201D\u5C31\u53EF\u4EE5\u4E3A\u60A8\u7684\u8BFE\u5802\u6DFB\u52A0\u7B2C\u4E00\u4F4D\u5B66\u751F\u5566~")
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
setisLoading(false);
|
||||
}
|
||||
});
|
||||
const clear = () => {
|
||||
setPage(1);
|
||||
setList([]);
|
||||
settargetKeys([]);
|
||||
};
|
||||
const { detailCommonHomeworksList } = classroomList;
|
||||
const hasMore = count > page * limit;
|
||||
const [isLoading, setisLoading] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_11__["default"],
|
||||
{
|
||||
width: 600,
|
||||
centered: true,
|
||||
confirmLoading: isLoading,
|
||||
title: "\u53D1\u5E03\u4F5C\u4E1A",
|
||||
open: classroomList.actionTabs.key === "\u7ACB\u5373\u53D1\u5E03" ? true : false,
|
||||
okText: "\u53D1\u5E03\u4F5C\u4E1A",
|
||||
cancelText: "\u6682\u4E0D\u53D1\u5E03",
|
||||
onOk: handleOk,
|
||||
onCancel: () => {
|
||||
clear();
|
||||
onRefresh();
|
||||
dispatch({
|
||||
type: "classroomList/setActionTabs",
|
||||
payload: {}
|
||||
});
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", { className: "tc" }, "\u5B66\u751F\u5C06\u7ACB\u5373\u6536\u5230\u4F5C\u4E1A", /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("br", null), '\u672C\u64CD\u4F5C\u53EA\u5BF9"\u672A\u53D1\u5E03"\u7684\u4F5C\u4E1A\u6709\u6548'),
|
||||
list && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_9__["default"], { form }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { style: { paddingLeft: 0 } }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, { className: "mt30", align: "middle" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_9__["default"].Item, { name: "publish_time", label: "\u53D1\u5E03\u65F6\u95F4" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_14__["default"],
|
||||
{
|
||||
style: { width: 170, marginRight: "25px" },
|
||||
disabledDate: (current) => (0,_pages_Classrooms_Lists_ShixunHomeworks_Detail_components_ConfigWorks_Releasesetting__WEBPACK_IMPORTED_MODULE_8__/* .disabledDate */ .Q8)(current, courseEndTime),
|
||||
disabledTime: (current) => (0,_pages_Classrooms_Lists_ShixunHomeworks_Detail_components_ConfigWorks_Releasesetting__WEBPACK_IMPORTED_MODULE_8__/* .disabledTime */ .d0)(current),
|
||||
placeholder: "\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",
|
||||
showTime: {
|
||||
format: "HH:mm",
|
||||
defaultValue: moment__WEBPACK_IMPORTED_MODULE_1___default()((0,_utils_util__WEBPACK_IMPORTED_MODULE_4__/* .HalfPastOne */ .U6)(), "HH:mm")
|
||||
},
|
||||
format: "YYYY-MM-DD HH:mm",
|
||||
allowClear: false
|
||||
}
|
||||
))), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z, { className: "ml20" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_9__["default"].Item, { name: "end_time", label: "\u622A\u6B62\u65F6\u95F4" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_14__["default"],
|
||||
{
|
||||
style: { width: 170 },
|
||||
placeholder: "\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",
|
||||
showTime: {
|
||||
format: "HH:mm",
|
||||
defaultValue: moment__WEBPACK_IMPORTED_MODULE_1___default()((0,_utils_util__WEBPACK_IMPORTED_MODULE_4__/* .HalfPastOne */ .U6)(), "HH:mm")
|
||||
},
|
||||
disabledDate: (current) => (0,_pages_Classrooms_Lists_ShixunHomeworks_Detail_components_ConfigWorks_Releasesetting__WEBPACK_IMPORTED_MODULE_8__/* .disabledDate */ .Q8)(current, courseEndTime, form.getFieldValue("publish_time")),
|
||||
disabledTime: (current) => (0,_pages_Classrooms_Lists_ShixunHomeworks_Detail_components_ConfigWorks_Releasesetting__WEBPACK_IMPORTED_MODULE_8__/* .disabledTime */ .d0)(current, form.getFieldValue("publish_time")),
|
||||
format: "YYYY-MM-DD HH:mm",
|
||||
allowClear: false
|
||||
}
|
||||
)))), classroomList.actionTabs.type === 2 && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, { style: { marginBottom: "10px" } }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: "mr5" }, "\u53D1\u5E03\u8BBE\u7F6E:"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"].Group */ .ZP.Group,
|
||||
{
|
||||
value: radiovalue,
|
||||
onChange: (e) => {
|
||||
setradiovalue(e.target.value);
|
||||
settargetKeys([]);
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .ZP, { value: true, disabled: !classroomList.actionTabs.manage_all_group }, "\u7EDF\u4E00\u53D1\u5E03"),
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .ZP,
|
||||
{
|
||||
className: "ml20",
|
||||
disabled: list.length <= 0,
|
||||
value: false
|
||||
},
|
||||
"\u5206\u73ED\u53D1\u5E03"
|
||||
)
|
||||
)), list.length <= 0 && classroomList.actionTabs.type === 2 && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
"span",
|
||||
{
|
||||
style: { marginLeft: "65px", color: "rgba(0, 0, 0, 0.25)" }
|
||||
},
|
||||
'\u8BFE\u5802\u65E0\u5206\u73ED\uFF0C\u4EC5\u652F\u6301\u9009\u62E9\u201C\u7EDF\u4E00\u53D1\u5E03"'
|
||||
)), (classroomList.actionTabs.type === 1 || !radiovalue) && list.length > 0 && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
"div",
|
||||
{
|
||||
style: {
|
||||
display: "flex",
|
||||
justifyContent: "space-between",
|
||||
marginBottom: "10px"
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { style: { flex: 1 } }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_16__["default"],
|
||||
{
|
||||
checked: targetKeys.length === list.length,
|
||||
onChange: (e) => {
|
||||
if (targetKeys.length === list.length) {
|
||||
settargetKeys([]);
|
||||
} else {
|
||||
settargetKeys(list.filter((item) => !item.is_published));
|
||||
}
|
||||
}
|
||||
},
|
||||
"\u5168\u9009"
|
||||
)),
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { style: { width: 16 } }),
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { style: { flex: 1 } }, "\u5DF2\u9009\u62E9", targetKeys.length || 0, "\u4E2A\u5206\u73ED")
|
||||
), (classroomList.actionTabs.type === 1 || !radiovalue) && list.length > 0 && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
_ShixunHomeworks_components_TrfList__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z,
|
||||
{
|
||||
data: list,
|
||||
selectedRowKeys: targetKeys,
|
||||
setSelectedRowKeys: settargetKeys
|
||||
}
|
||||
))
|
||||
);
|
||||
};
|
||||
/* harmony default export */ __webpack_exports__.Z = ((0,umi__WEBPACK_IMPORTED_MODULE_5__.connect)(
|
||||
({ classroomList }) => ({
|
||||
classroomList
|
||||
})
|
||||
)(PublishShixun));
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 20071:
|
||||
/*!**********************************!*\
|
||||
!*** ./src/utils/shixunExec.tsx ***!
|
||||
\**********************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ _: function() { return /* binding */ checkShixunInClassroom; }
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var _service_shixuns__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/service/shixuns */ 86151);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! antd */ 43418);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ 8591);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! antd */ 72315);
|
||||
/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/utils/util */ 3163);
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 59301);
|
||||
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 handleStartGame = (_0) => __async(void 0, [_0], function* ({ is_jupyter, is_jupyter_lab, shixunId, homework_common_id, courseId }) {
|
||||
if (is_jupyter || is_jupyter_lab) {
|
||||
const res = yield (0,_service_shixuns__WEBPACK_IMPORTED_MODULE_0__/* .execJupyter */ .BK)({
|
||||
id: shixunId
|
||||
});
|
||||
if (res == null ? void 0 : res.identifier) {
|
||||
(0,_utils_util__WEBPACK_IMPORTED_MODULE_1__/* .openNewWindow */ .xg)(`/tasks/${res.identifier}/jupyter?homework_common_id=${homework_common_id}`);
|
||||
}
|
||||
return;
|
||||
}
|
||||
const execRes = yield (0,_service_shixuns__WEBPACK_IMPORTED_MODULE_0__/* .execShixun */ .Ir)({
|
||||
id: shixunId,
|
||||
homework_common_id
|
||||
});
|
||||
if (execRes == null ? void 0 : execRes.game_identifier) {
|
||||
(0,_utils_util__WEBPACK_IMPORTED_MODULE_1__/* .openNewWindow */ .xg)(`/tasks/${courseId}/${homework_common_id}/${execRes.game_identifier}`);
|
||||
return;
|
||||
}
|
||||
if ((execRes == null ? void 0 : execRes.status) === 2) {
|
||||
handleResetGame(execRes == null ? void 0 : execRes.message, homework_common_id, courseId);
|
||||
} else if ((execRes == null ? void 0 : execRes.status) === 3) {
|
||||
handleInBeta(execRes == null ? void 0 : execRes.message);
|
||||
} else if ((execRes == null ? void 0 : execRes.status) == -3) {
|
||||
(0,_utils_util__WEBPACK_IMPORTED_MODULE_1__/* .bindPhone */ .eF)();
|
||||
}
|
||||
});
|
||||
const handleResetGame = (url, homework_common_id, courseId) => {
|
||||
url = (url == null ? void 0 : url.includes(".json")) ? url : `${url}.json`;
|
||||
antd__WEBPACK_IMPORTED_MODULE_3__["default"].confirm({
|
||||
centered: true,
|
||||
title: "\u63D0\u793A",
|
||||
okText: "\u786E\u5B9A",
|
||||
cancelText: "\u53D6\u6D88",
|
||||
content: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_2__.createElement("div", { className: "tc font16" }, " \u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),
|
||||
onOk: () => __async(void 0, null, function* () {
|
||||
const res = yield (0,_service_shixuns__WEBPACK_IMPORTED_MODULE_0__/* .resetMyGame */ .$Q)({ url });
|
||||
if (!res) {
|
||||
return;
|
||||
}
|
||||
antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8DF5\u9879\u76EE\uFF01");
|
||||
const execRes = yield (0,_service_shixuns__WEBPACK_IMPORTED_MODULE_0__/* .execShixun */ .Ir)({ id: res.shixun_identifier, homework_common_id });
|
||||
if (execRes == null ? void 0 : execRes.game_identifier) {
|
||||
(0,_utils_util__WEBPACK_IMPORTED_MODULE_1__/* .openNewWindow */ .xg)(`/tasks/${courseId}/${homework_common_id}/${execRes.game_identifier}`);
|
||||
return;
|
||||
}
|
||||
if ((execRes == null ? void 0 : execRes.status) === 2) {
|
||||
handleResetGame(execRes == null ? void 0 : execRes.message, homework_common_id, courseId);
|
||||
} else if ((execRes == null ? void 0 : execRes.status) === 3) {
|
||||
handleInBeta(execRes == null ? void 0 : execRes.message);
|
||||
}
|
||||
})
|
||||
});
|
||||
};
|
||||
const handleInBeta = (message2) => {
|
||||
antd__WEBPACK_IMPORTED_MODULE_3__["default"].confirm({
|
||||
centered: true,
|
||||
title: "\u63D0\u793A",
|
||||
okText: "\u786E\u5B9A",
|
||||
cancelText: "\u53D6\u6D88",
|
||||
content: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_2__.createElement("div", { className: "tc font16" }, " \u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E", message2, "\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")
|
||||
});
|
||||
};
|
||||
const checkShixunInClassroom = (_0, _1) => __async(void 0, [_0, _1], function* (shixunId, { is_jupyter, is_jupyter_lab }) {
|
||||
const res = yield (0,_service_shixuns__WEBPACK_IMPORTED_MODULE_0__/* .getProgressHomeworks */ .WT)(shixunId);
|
||||
if (res.length > 1) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_3__["default"].info({
|
||||
icon: null,
|
||||
closable: true,
|
||||
maskClosable: true,
|
||||
centered: true,
|
||||
width: 820,
|
||||
okButtonProps: { style: { display: "none" } },
|
||||
title: "\u63D0\u793A",
|
||||
content: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_2__.createElement("div", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_2__.createElement("div", null, "\u4F60\u5F53\u524D\u6709", res.length, "\u4E2A\u8FDB\u884C\u4E2D\u7684\u5B9E\u8BAD\u4F5C\u4E1A\u4F7F\u7528\u8BE5\u5B9E\u8DF5\u9879\u76EE\uFF0C\u8BF7\u5728\u4E0B\u65B9\u70B9\u51FB\u5B9E\u8BAD\u4F5C\u4E1A\u540D\u79F0\u8FDB\u5165\u5B9E\u8BAD\u6311\u6218\u9875\u9762\uFF1A"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_2__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_5__["default"],
|
||||
{
|
||||
pagination: false,
|
||||
columns: [
|
||||
{
|
||||
title: "\u8BFE\u5802\u540D\u79F0",
|
||||
dataIndex: "course_name",
|
||||
ellipsis: true,
|
||||
width: 180,
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "\u4F5C\u4E1A\u540D\u79F0",
|
||||
dataIndex: "name",
|
||||
ellipsis: true,
|
||||
width: 240,
|
||||
align: "center",
|
||||
render(text, record) {
|
||||
const { course_identifier, id } = record || {};
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_2__.createElement("a", { target: "_blank", href: `/classrooms/${course_identifier}/shixun_homework/${id}/detail` }, text);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "\u4F5C\u4E1A\u622A\u6B62\u65F6\u95F4",
|
||||
dataIndex: "end_time",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "\u64CD\u4F5C",
|
||||
align: "center",
|
||||
render(text, record) {
|
||||
const { course_identifier, id, shixun_identifier } = record;
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_2__.createElement("div", { style: {
|
||||
cursor: "pointer",
|
||||
color: "#165dff"
|
||||
}, onClick: () => {
|
||||
handleStartGame({ is_jupyter, is_jupyter_lab, shixunId: shixun_identifier, homework_common_id: id, courseId: course_identifier });
|
||||
} }, "\u524D\u5F80\u6311\u6218");
|
||||
}
|
||||
}
|
||||
],
|
||||
dataSource: res,
|
||||
rowKey: "id"
|
||||
}
|
||||
))
|
||||
});
|
||||
return true;
|
||||
}
|
||||
if (res.length === 1) {
|
||||
const { shixun_identifier, id, course_identifier } = res[0];
|
||||
handleStartGame({ is_jupyter, is_jupyter_lab, shixunId: shixun_identifier, homework_common_id: id, courseId: course_identifier });
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
/* harmony default export */ __webpack_exports__.Z = (handleStartGame);
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
@ -0,0 +1,4 @@
|
||||
/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** css ./node_modules/_css-loader@6.7.1@css-loader/dist/cjs.js??ruleSet[1].rules[5].oneOf[0].use[1]!./node_modules/_@umijs_bundler-webpack@4.0.88@@umijs/bundler-webpack/compiled/postcss-loader/index.js??ruleSet[1].rules[5].oneOf[0].use[2]!./node_modules/_@umijs_bundler-webpack@4.0.88@@umijs/bundler-webpack/compiled/less-loader/index.js??ruleSet[1].rules[5].oneOf[0].use[3]!./src/components/AddPoints/index.less?modules ***!
|
||||
\*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
|
||||
@ -0,0 +1,892 @@
|
||||
"use strict";
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[4589],{
|
||||
|
||||
/***/ 64124:
|
||||
/*!************************************************************!*\
|
||||
!*** ./src/components/image-preview/index.tsx + 1 modules ***!
|
||||
\************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ image_preview; }
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
||||
var _react_17_0_2_react = __webpack_require__(59301);
|
||||
;// CONCATENATED MODULE: ./src/components/image-preview/index.less
|
||||
// extracted by mini-css-extract-plugin
|
||||
|
||||
// EXTERNAL MODULE: ./src/components/mediator.js
|
||||
var mediator = __webpack_require__(7694);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/image/index.js + 26 modules
|
||||
var es_image = __webpack_require__(89536);
|
||||
;// CONCATENATED MODULE: ./src/components/image-preview/index.tsx
|
||||
|
||||
|
||||
|
||||
|
||||
/* harmony default export */ var image_preview = (() => {
|
||||
const [url, setUrl] = (0,_react_17_0_2_react.useState)("");
|
||||
const [deg, setDeg] = (0,_react_17_0_2_react.useState)(0);
|
||||
let [width, setwidth] = (0,_react_17_0_2_react.useState)();
|
||||
let [height, setheight] = (0,_react_17_0_2_react.useState)();
|
||||
const [down, setdown] = (0,_react_17_0_2_react.useState)(false);
|
||||
const saveUrl = (0,_react_17_0_2_react.useRef)("");
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
const unSub = mediator/* default */.Z.subscribe("preview-image", (value) => {
|
||||
setUrl(value);
|
||||
console.log(imgref.current);
|
||||
document.body.style.overflow = "hidden";
|
||||
});
|
||||
return unSub;
|
||||
}, []);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
document.addEventListener("keydown", onViewEscClose);
|
||||
return () => {
|
||||
document.removeEventListener("keydown", onViewEscClose);
|
||||
};
|
||||
}, []);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
saveUrl.current = url;
|
||||
}, [url]);
|
||||
function onViewEscClose(e) {
|
||||
if (e.keyCode == 27 && saveUrl.current) {
|
||||
onClose();
|
||||
}
|
||||
}
|
||||
function onClose() {
|
||||
document.body.style.overflow = "auto";
|
||||
setwidth(void 0);
|
||||
setheight(void 0);
|
||||
setDeg(0);
|
||||
setUrl("");
|
||||
}
|
||||
function onRotate() {
|
||||
setDeg(deg + 90);
|
||||
}
|
||||
function big() {
|
||||
width = imgref.current.width * 1.1;
|
||||
height = imgref.current.height * 1.1;
|
||||
setheight(height);
|
||||
setwidth(width);
|
||||
}
|
||||
function small() {
|
||||
width = imgref.current.width / 1.1;
|
||||
height = imgref.current.height / 1.1;
|
||||
setheight(height);
|
||||
setwidth(width);
|
||||
}
|
||||
const maskRef = (0,_react_17_0_2_react.useRef)();
|
||||
const previewWrapperRef = (0,_react_17_0_2_react.useRef)();
|
||||
const imgref = (0,_react_17_0_2_react.useRef)();
|
||||
const handleMaskClick = (e) => {
|
||||
if (e.nativeEvent.target === maskRef.current || e.nativeEvent.target === previewWrapperRef.current) {
|
||||
onClose();
|
||||
}
|
||||
};
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, !url ? null : /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"div",
|
||||
null,
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "preview-wrp-group", ref: previewWrapperRef }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_image/* default */.Z,
|
||||
{
|
||||
className: "image-preview",
|
||||
src: url,
|
||||
style: { display: "none" },
|
||||
preview: {
|
||||
visible: true,
|
||||
src: url,
|
||||
movable: false,
|
||||
onVisibleChange: (value) => {
|
||||
setUrl("");
|
||||
}
|
||||
},
|
||||
alt: "\u9884\u89C8\u5927\u56FE"
|
||||
}
|
||||
))
|
||||
));
|
||||
});
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 87284:
|
||||
/*!***************************************************************************************************!*\
|
||||
!*** ./src/pages/Classrooms/Lists/Exercise/Export/components/ExportSetting/index.tsx + 3 modules ***!
|
||||
\***************************************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ components_ExportSetting; }
|
||||
});
|
||||
|
||||
// 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/input/index.js + 5 modules
|
||||
var input = __webpack_require__(1056);
|
||||
// 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 modal = __webpack_require__(43418);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/spin/index.js + 1 modules
|
||||
var spin = __webpack_require__(71418);
|
||||
// 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/upload/index.js + 24 modules
|
||||
var upload = __webpack_require__(6557);
|
||||
// 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-number/index.js + 14 modules
|
||||
var input_number = __webpack_require__(85731);
|
||||
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/PlusOutlined.js + 1 modules
|
||||
var PlusOutlined = __webpack_require__(378);
|
||||
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Export/components/ExportSetting/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var ExportSettingmodules = ({"modalWrapper":"modalWrapper___rWDvO","exportSettingWrapper":"exportSettingWrapper___pCClH","imgPreviewPart":"imgPreviewPart___PCv0Y","tips":"tips___EVeBl","pottedLine":"pottedLine___AaY68","text":"text___ho3u_"});
|
||||
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 14 modules
|
||||
var _umi_production_exports = __webpack_require__(87210);
|
||||
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
||||
var fetch = __webpack_require__(87101);
|
||||
// EXTERNAL MODULE: ./src/components/ImagesIcon/index.ts + 32 modules
|
||||
var ImagesIcon = __webpack_require__(43021);
|
||||
// EXTERNAL MODULE: ./src/components/mediator.js
|
||||
var mediator = __webpack_require__(7694);
|
||||
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
||||
var env = __webpack_require__(64741);
|
||||
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 14 modules
|
||||
var markdown_editor = __webpack_require__(20103);
|
||||
// EXTERNAL MODULE: ./src/components/image-preview/index.tsx + 1 modules
|
||||
var image_preview = __webpack_require__(64124);
|
||||
;// CONCATENATED MODULE: ./src/assets/images/classrooms/halfDottedLine.png
|
||||
var halfDottedLine_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAAECAYAAADLcnBRAAAAAXNSR0IArs4c6QAAAcNJREFUSEvtlT1oFFEURs+dndmAqGBAMCAoKAqChT+lYGER6xQLlsGdXWMQFETbtREhjQgmuxmLdJIEi1SxCdjYRpCQbkEhoihioYjMneyVCDtMCuG+fqedc9437775ZoTRNZrAaAL/nYDs3bFZTmjB0dA5Jbt8kRfseD2b4YgOOOXlh1wCv6XHttezFWq6wQUvX+WSa7yTBrte19qcUzjg5cs9RfRlgR9ez5oc1xrHvHyZE/NNnvPR69kdDmvOGS9f5gh/pMtWiJe3uRzCl1kTvJcOude1Gc7qgENevswxPvwrSN6kB7RCF5CIuWSRB16vSGkMjGUvX3LCZj3jkteze4zrT757+X0FSRgPeXHzJpsQXsYoohEvsup9Rk2ZM+O+lx9ykdCLM255PU2ZNOO1l6+cUb+ecdrrWYdYd1Avv++MxjgZUnpNeWPG1dCsCJrDgsyKcD10AYFXccaS19MWVzAeevkK108y7no9u83BQnnp5atcnHBD5vnldTXlKYT/FanxJOny1ptTtJm2AVNefsgZrNcz5r2etbhYGI+8fCXncz3zf2StQ1R8Yi00Z4+Pa9yULl+9rqY8Bs57+ZKLePYXdsiA6BdYLZkAAAAASUVORK5CYII=";
|
||||
;// CONCATENATED MODULE: ./src/assets/images/classrooms/dottedLine.png
|
||||
var dottedLine_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAn4AAAAECAYAAAAQ9jLuAAAAAXNSR0IArs4c6QAABLVJREFUaEPtmVuIVVUYgL+1z17H0S6kliWaJdlVS7pQBHajoLAMKpjo8hKdfc7MiNmoaA8Fx4IIjMzIuZx9sijLrkRGGURQdHkJjSy7G2bqWHaTKbO99pw/ztRs9rz9ax58qHPeDnzf+tf6/7XWXmtvQ+vXykArA60MtDLQykArA60MtDLwv8iAaY5SFnKCSznGd8R2iL2mzi6tJ51MdA1O0vIjnIUDpp/PtJ48T8G9xdlaPs/Zy/nItDOkdaXCGQ4maPlsTAHbTS+/aj0pMd0VOE7LZ3FC9pm1fKf1ZBFHuoRTtHwWx3DQ9PGpj5dUOM+Hz2JNZaupkmhd6eRU1+AILZ/FEXaYGj9pPSkz1RmmafncXPjF9PKt1pNlHOYGOV3L59aRM/187ONJmXOcIfBxmqydwDazmj+1nnQxyw1xlJbPxtTG92YNP2g96WCKE2Zo+SxOgd9MD99oPanS5gaYo+Vzc65hamzx8aTCXAfWxxmuUYEvTA+/az0pMdMVmKzlszFZ9phH2dP8P+Y6G3aaPn7Uxj5kde5mvDvAbG2//tN1FnabGgPaXMhCJruUmVo+t18Oml6+1HpSpegGOEvL5znbx2ZjEK0rHcxxQpuWz82Hr02N/VpPysxwhilaPovz75lt+OCXlOgHyr6NmIBVtsZyrZdGtDeE57R8xhm2FGPO1XrSzSQ3yM9aflShLZN8DmRJaXiT9j5kBgHtYY0XtH10EatEWKblR7jA0B/GdGg9F3GlCG9o+VyNthdjZmk9qRK6XTgtP6pG4zjR5zDrIt4W4RLfWAGUwjqPaT0XcbcI92n5XO42FGNu1nquwoUyxAdafoQzsM/W/TYLF/GHyBguNpa5ppet2j66EhsFFmj5jAtYUqyxWuslZe6gwRotn8vd67bO1VpPImY78bsINds2hr9s7PfgcCUGBP9LoQm4yNZ4TzumpMRTwK1aPstdwEpbo9r87yJeFeEa3zaA7mKdh7VeErEY0fNZXw2v2Vjfv+EHfcon2n7l5tNBW2e8j+dK7BU41scZnlMh82wf72u9JGI9wi1aPjemqq2zUuulFW5rDLFOy+dq9K6NuVjrSRfHu4SdWj7P2emM83nJkER8hXCyb6zAMD+M2aT10hI9DejU8rncPWRjlo4c/BYaw1XejcBLYcwTWs+VmYewQsvnuO025k6tJ10cnjo2aPk8F1pu8rkFu2h4c/F+i0mBB3wWY3ORSIPrfccksKkY06P1mm94UtEv3pF2BQaKsf7yIFWCdDevaPs1qkYFbve5/buI+4EzvWMFPGL7eVPrpRVulIb/gxF4x8Y8qI0jZU5LhVVaPlej/cXYr38u4kVgnG+ssMAi08cOrdc8NAMXaPlsIxPqYV0/j9IKC6Shn6e5/nxoY+7V9q95I0+FtVo+xzkb+63zJOJJAxN9Y4UBK3y+pLiIJcBlvnGM8ExY/2c/dmXuQTjfuw2Iw5iNWi+NuFYg0vKHvM5CYuvc4NO/MdfZstz08Lk2liuzFOFSLZ+tRXg6jHlW67mIK4DFWj7HbbMxd2k9KXN0Kjyu5Uc9a6ZxnamSat00ok/w/+ojQrVYZ7M2TlKm0wjztXyuRi+HMev+Bu2qoBRawxtVAAAAAElFTkSuQmCC";
|
||||
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Export/components/ExportSetting/index.tsx
|
||||
var __defProp = Object.defineProperty;
|
||||
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 __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 { TextArea } = input["default"];
|
||||
const ExportSetting = ({ exercise, loading, dispatch }) => {
|
||||
var _a;
|
||||
const { workSetting } = exercise;
|
||||
const params = (0,_umi_production_exports.useParams)();
|
||||
params.category = params.categoryId || params.exerciseId;
|
||||
params.categoryId = params.categoryId || params.exerciseId;
|
||||
const [disabled, setDisabled] = (0,_react_17_0_2_react.useState)(false);
|
||||
const [pageLoading, setPageLoading] = (0,_react_17_0_2_react.useState)(false);
|
||||
let [data, setData] = (0,_react_17_0_2_react.useState)({
|
||||
file_list: [],
|
||||
attachment_id: "",
|
||||
//卷头左角标附件id
|
||||
show_title: false,
|
||||
//展示试卷标题
|
||||
show_body: false,
|
||||
//展示考试内容
|
||||
show_info: false,
|
||||
//展示题量、分值、考试时长
|
||||
show_table: false,
|
||||
//展示得分、评分表格
|
||||
show_user: false,
|
||||
//密封线区域设置姓名
|
||||
show_no: false,
|
||||
//密封线区域设置学号
|
||||
show_group: false,
|
||||
//密封线区域设置专业班级
|
||||
show_phone: false,
|
||||
//密封线区域设置手机号
|
||||
show_school_name: false,
|
||||
//密封区域设置学校/单位
|
||||
export_page_num: 40,
|
||||
//每页导出最大试题数
|
||||
show_desc: false,
|
||||
//考试说明选择框
|
||||
description: ""
|
||||
// 考试说明内容
|
||||
});
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
setDefaultData();
|
||||
}, [workSetting]);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
dispatch({
|
||||
type: "exercise/getWorkSetting",
|
||||
payload: __spreadValues({}, params)
|
||||
});
|
||||
}, []);
|
||||
const setDefaultData = () => {
|
||||
var _a2, _b, _c, _d;
|
||||
const res = JSON.parse(JSON.stringify(workSetting));
|
||||
Object.keys(data).forEach((item) => {
|
||||
var _a3;
|
||||
data[item] = (_a3 = res == null ? void 0 : res["exercise_header"]) == null ? void 0 : _a3[item];
|
||||
});
|
||||
data.file_list = ((_a2 = res == null ? void 0 : res["exercise_header"]) == null ? void 0 : _a2.attachment_id) ? [{ uid: (_b = res == null ? void 0 : res["exercise_header"]) == null ? void 0 : _b.attachment_id, id: (_c = res == null ? void 0 : res["exercise_header"]) == null ? void 0 : _c.attachment_id, url: (_d = res == null ? void 0 : res["exercise_header"]) == null ? void 0 : _d.photo_url }] : [];
|
||||
setData(data);
|
||||
};
|
||||
const handleSubmit = () => {
|
||||
var _a2, _b, _c;
|
||||
const bodyData = JSON.parse(JSON.stringify(data));
|
||||
bodyData.categoryId = params.categoryId;
|
||||
bodyData.attachment_id = ((_c = (_b = (_a2 = bodyData.file_list) == null ? void 0 : _a2[0]) == null ? void 0 : _b.response) == null ? void 0 : _c.id) || null;
|
||||
handleUpdate(bodyData);
|
||||
};
|
||||
const handleUpdate = (bodyData) => __async(void 0, null, function* () {
|
||||
setPageLoading(true);
|
||||
const res = yield (0,fetch/* default */.ZP)(`/api/exercises/${params == null ? void 0 : params.categoryId}/foramt_settings.json`, {
|
||||
method: "post",
|
||||
body: bodyData
|
||||
});
|
||||
if (res.status === 0) {
|
||||
message/* default */.ZP.success("\u66F4\u65B0\u6210\u529F");
|
||||
dispatch({
|
||||
type: "exercise/getCommonHeader",
|
||||
payload: __spreadValues({}, params)
|
||||
});
|
||||
dispatch({
|
||||
type: "exercise/getWorkSetting",
|
||||
payload: __spreadValues({}, params)
|
||||
});
|
||||
dispatch({
|
||||
type: "exercise/getExerciseExportHeadData",
|
||||
payload: {
|
||||
id: params.exerciseId || params.categoryId,
|
||||
identify: params.userId || null
|
||||
}
|
||||
});
|
||||
setPageLoading(false);
|
||||
}
|
||||
});
|
||||
const uploadProps = {
|
||||
disabled,
|
||||
multiple: false,
|
||||
listType: "picture-card",
|
||||
onPreview: (file) => {
|
||||
mediator/* default */.Z.publish("preview-image", file.thumbUrl || file.url);
|
||||
},
|
||||
withCredentials: true,
|
||||
fileList: data.file_list,
|
||||
beforeUpload: (file) => {
|
||||
const fileSize = file.size / 1024;
|
||||
if (fileSize > 200) {
|
||||
message/* default */.ZP.error(`\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(200KB),\u5EFA\u8BAE\u4E0A\u4F20\u5230\u767E\u5EA6\u4E91\u7B49\u5176\u5B83\u5171\u4EAB\u5DE5\u5177\u91CC\uFF0C\u7136\u540E\u518Dtxt\u6587\u6863\u91CC\u7ED9\u51FA\u94FE\u63A5\u4EE5\u53CA\u5171\u4EAB\u5BC6\u7801\u5E76\u4E0A\u4F20`);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
action: `${env/* default */.Z.API_SERVER}/api/attachments.json`,
|
||||
onChange(info) {
|
||||
let fileList = info.fileList.filter((file) => !!file.status);
|
||||
data.file_list = fileList;
|
||||
setData(Object.assign({}, data));
|
||||
},
|
||||
onRemove: (file) => __async(void 0, null, function* () {
|
||||
data.file_list = [];
|
||||
setData(Object.assign({}, data));
|
||||
return true;
|
||||
})
|
||||
};
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
modal["default"],
|
||||
{
|
||||
title: "\u5BFC\u51FA\u8BBE\u7F6E",
|
||||
className: ExportSettingmodules.modalWrapper,
|
||||
width: 900,
|
||||
centered: true,
|
||||
open: exercise.actionTabs.key === "exportSetting",
|
||||
onOk: () => handleSubmit(),
|
||||
onCancel: () => {
|
||||
setDefaultData();
|
||||
dispatch({
|
||||
type: "exercise/setActionTabs",
|
||||
payload: {}
|
||||
});
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: ExportSettingmodules.exportSettingWrapper }, /* @__PURE__ */ _react_17_0_2_react.createElement(spin/* default */.Z, { spinning: loading["exercise/getWorkSetting"] || pageLoading }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { wrap: false, justify: "space-between" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u5377\u5934\u5DE6\u89D2\u6807"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: ExportSettingmodules.tips }, "\u56FE\u7247\u5EFA\u8BAE\u5C3A\u5BF8\uFF1A700px*500px\uFF0C\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC7200k")), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mt15" }, /* @__PURE__ */ _react_17_0_2_react.createElement(upload["default"], __spreadValues({}, uploadProps), !((_a = data.file_list) == null ? void 0 : _a.length) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(PlusOutlined/* default */.Z, null), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { marginTop: 8 } }, "\u4E0A\u4F20")))), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { span: 24, className: "mt15" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_checkbox["default"],
|
||||
{
|
||||
checked: data.show_title,
|
||||
disabled,
|
||||
onChange: (e) => {
|
||||
data.show_title = e.target.checked;
|
||||
setData(Object.assign({}, data));
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u5C55\u793A\u8BD5\u5377\u6807\u9898")
|
||||
)), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { span: 24, className: "mt15" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_checkbox["default"],
|
||||
{
|
||||
checked: data.show_body,
|
||||
disabled,
|
||||
onChange: (e) => {
|
||||
data.show_body = e.target.checked;
|
||||
setData(Object.assign({}, data));
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u5C55\u793A\u8003\u8BD5\u5185\u5BB9\uFF08\u5373\u672C\u8BD5\u5377\u6240\u5C5E\u8BFE\u7A0B\u540D\u79F0\uFF09")
|
||||
)), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { span: 24, className: "mt15" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_checkbox["default"],
|
||||
{
|
||||
checked: data.show_info,
|
||||
disabled,
|
||||
onChange: (e) => {
|
||||
data.show_info = e.target.checked;
|
||||
setData(Object.assign({}, data));
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u5C55\u793A\u9898\u91CF\u3001\u5206\u503C\u3001\u8003\u8BD5\u65F6\u957F")
|
||||
)), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { span: 24, className: "mt15" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_checkbox["default"],
|
||||
{
|
||||
checked: data.show_table,
|
||||
disabled,
|
||||
onChange: (e) => {
|
||||
data.show_table = e.target.checked;
|
||||
setData(Object.assign({}, data));
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u5C55\u793A\u5F97\u5206\u3001\u8BC4\u5206\u8868\u683C")
|
||||
)), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", className: `mt20 ${ExportSettingmodules.pottedLine}` }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: halfDottedLine_namespaceObject, alt: "" })), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: ExportSettingmodules.text }, "\u5BC6\u5C01\u7EBF\u533A\u57DF\u8BBE\u7F6E"), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: halfDottedLine_namespaceObject, alt: "" }))), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: "mt15", justify: "center", style: { width: 320 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_checkbox["default"],
|
||||
{
|
||||
className: "pl8",
|
||||
checked: data.show_user,
|
||||
disabled,
|
||||
onChange: (e) => {
|
||||
data.show_user = e.target.checked;
|
||||
setData(Object.assign({}, data));
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u59D3\u540D")
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_checkbox["default"],
|
||||
{
|
||||
checked: data.show_no,
|
||||
disabled,
|
||||
onChange: (e) => {
|
||||
data.show_no = e.target.checked;
|
||||
setData(Object.assign({}, data));
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u5B66\u53F7")
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_checkbox["default"],
|
||||
{
|
||||
checked: data.show_group,
|
||||
disabled,
|
||||
onChange: (e) => {
|
||||
data.show_group = e.target.checked;
|
||||
setData(Object.assign({}, data));
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u4E13\u4E1A\u73ED\u7EA7")
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_checkbox["default"],
|
||||
{
|
||||
checked: data.show_school_name,
|
||||
disabled,
|
||||
onChange: (e) => {
|
||||
data.show_school_name = e.target.checked;
|
||||
setData(Object.assign({}, data));
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u5B66\u6821/\u5355\u4F4D")
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_checkbox["default"],
|
||||
{
|
||||
checked: data.show_phone,
|
||||
disabled,
|
||||
onChange: (e) => {
|
||||
data.show_phone = e.target.checked;
|
||||
setData(Object.assign({}, data));
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u624B\u673A\u53F7")
|
||||
)), /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: dottedLine_namespaceObject, alt: "", className: "mt15", style: { width: 320 } }), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { span: 24, className: "mt15" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u6BCF\u9875\u5BFC\u51FA\u6700\u5927\u8BD5\u9898\u6570\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement(input_number/* default */.Z, { size: "middle", min: 1, value: !data.export_page_num ? 40 : data.export_page_num, onChange: (value) => {
|
||||
data.export_page_num = value;
|
||||
setData(__spreadValues({}, data));
|
||||
} }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "ml10" }, "\u9898")), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: "mt15" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_checkbox["default"],
|
||||
{
|
||||
checked: data.show_desc,
|
||||
disabled,
|
||||
onChange: (e) => {
|
||||
data.show_desc = e.target.checked;
|
||||
setData(Object.assign({}, data));
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u8003\u8BD5\u8BF4\u660E")
|
||||
)), data.show_desc && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"div",
|
||||
{ className: "mt15" },
|
||||
// disabled ?
|
||||
// <TextArea style={{ height: 150, width: 550 }} disabled value={data.description} /> :
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
markdown_editor/* default */.Z,
|
||||
{
|
||||
width: 550,
|
||||
height: 100,
|
||||
defaultValue: data.description,
|
||||
id: "exercise-detail-config-exam-description-id",
|
||||
onChange: (value) => {
|
||||
data.description = value;
|
||||
setData(Object.assign({}, data));
|
||||
}
|
||||
}
|
||||
)
|
||||
)), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: ExportSettingmodules.imgPreviewPart }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "pb10" }, "\u793A\u4F8B\u56FE\u7247\u9884\u89C8\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: ImagesIcon/* exportExerciseTemplate */.qz })))), /* @__PURE__ */ _react_17_0_2_react.createElement(image_preview/* default */.Z, null))
|
||||
);
|
||||
};
|
||||
/* harmony default export */ var components_ExportSetting = ((0,_umi_production_exports.connect)(
|
||||
({
|
||||
exercise,
|
||||
loading,
|
||||
globalSetting
|
||||
}) => ({
|
||||
exercise,
|
||||
loading: loading.effects,
|
||||
globalSetting
|
||||
})
|
||||
)(ExportSetting));
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 34589:
|
||||
/*!******************************************************************************************!*\
|
||||
!*** ./src/pages/Classrooms/Lists/Exercise/Export/components/Head/index.tsx + 1 modules ***!
|
||||
\******************************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ components_Head; }
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
||||
var _react_17_0_2_react = __webpack_require__(59301);
|
||||
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 14 modules
|
||||
var _umi_production_exports = __webpack_require__(87210);
|
||||
// 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/button/index.js
|
||||
var es_button = __webpack_require__(3113);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
|
||||
var table = __webpack_require__(72315);
|
||||
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/SettingOutlined.js + 1 modules
|
||||
var SettingOutlined = __webpack_require__(15470);
|
||||
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Export/components/Head/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var Headmodules = ({"wrap":"wrap___SSpd0","img":"img___nbd2O","table":"table___fcP71","totalScore":"totalScore___YxSMe","people":"people___bf9pK","glassSeal":"glassSeal___dYhKO","paperHeader":"paperHeader___gYUbq","exportBtn":"exportBtn___nyRYQ"});
|
||||
// EXTERNAL MODULE: ./src/service/exercise.ts
|
||||
var service_exercise = __webpack_require__(40610);
|
||||
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 1 modules
|
||||
var RenderHtml = __webpack_require__(12586);
|
||||
// EXTERNAL MODULE: ./src/utils/util.tsx
|
||||
var util = __webpack_require__(3163);
|
||||
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/Exercise/Export/components/ExportSetting/index.tsx + 3 modules
|
||||
var ExportSetting = __webpack_require__(87284);
|
||||
// EXTERNAL MODULE: ./src/utils/constant.ts
|
||||
var constant = __webpack_require__(65359);
|
||||
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Export/components/Head/index.tsx
|
||||
var __defProp = Object.defineProperty;
|
||||
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 __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 Head = ({
|
||||
isPreview = false,
|
||||
isExportBlank = false,
|
||||
activeTabs,
|
||||
exercise,
|
||||
globalSetting,
|
||||
loading,
|
||||
user,
|
||||
dispatch,
|
||||
showExportBtn = false
|
||||
}) => {
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
||||
const params = (0,_umi_production_exports.useParams)();
|
||||
const { userInfo } = user;
|
||||
const [headData, setHeadData] = (0,_react_17_0_2_react.useState)();
|
||||
const [tableData, setTableData] = (0,_react_17_0_2_react.useState)();
|
||||
let leftheight = (0,_react_17_0_2_react.useRef)(null);
|
||||
const [leftheights, setleftheights] = (0,_react_17_0_2_react.useState)(21);
|
||||
const [questionName, setQuestionName] = (0,_react_17_0_2_react.useState)([]);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
!(() => __async(void 0, null, function* () {
|
||||
const questionName2 = yield (0,service_exercise/* getQuestionTypeAlias */.cV)({
|
||||
id: params.exerciseId || params.categoryId
|
||||
});
|
||||
questionName2.status == 0 && setQuestionName(questionName2.data);
|
||||
}))();
|
||||
if ((0,util/* isUnOrNull */.W)(activeTabs)) {
|
||||
} else {
|
||||
activeTabs === "2" && getData();
|
||||
}
|
||||
}, [params.userId, params.coursesId, params.exerciseId, params.categoryId, activeTabs]);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
if (leftheight.current) {
|
||||
setleftheights(leftheight.current.clientHeight);
|
||||
}
|
||||
}, [leftheight.current]);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
var _a2;
|
||||
if ((_a2 = exercise.exerciseExportHeadData) == null ? void 0 : _a2.title) {
|
||||
const res = exercise.exerciseExportHeadData;
|
||||
setHeadData(__spreadValues({}, res || {}));
|
||||
const { table } = res || {};
|
||||
let total_score;
|
||||
let actual_total_score;
|
||||
if ((table == null ? void 0 : table.total_singles_scores) || (table == null ? void 0 : table.total_doubles_scores) || (table == null ? void 0 : table.total_nulls_scores) || (table == null ? void 0 : table.total_judges_scores) || (table == null ? void 0 : table.total_pros_scores) || (table == null ? void 0 : table.total_shixuns_scores) || (table == null ? void 0 : table.total_mains_scores) || (table == null ? void 0 : table.total_combination_scores) || (table == null ? void 0 : table.total_bpros_scores)) {
|
||||
total_score = Number(table == null ? void 0 : table.total_singles_scores) + Number(table == null ? void 0 : table.total_doubles_scores) + Number(table == null ? void 0 : table.total_nulls_scores) + Number(table == null ? void 0 : table.total_judges_scores) + Number(table == null ? void 0 : table.total_bpros_scores) + Number(table == null ? void 0 : table.total_pros_scores) + Number(table == null ? void 0 : table.total_shixuns_scores) + Number(table == null ? void 0 : table.total_mains_scores) + Number(table == null ? void 0 : table.total_combination_scores);
|
||||
}
|
||||
if ((table == null ? void 0 : table.singles_scores) || (table == null ? void 0 : table.doubles_scores) || (table == null ? void 0 : table.nulls_scores) || (table == null ? void 0 : table.judges_scores) || (table == null ? void 0 : table.pros_scores) || (table == null ? void 0 : table.bpros_scores) || (table == null ? void 0 : table.shixuns_scores) || (table == null ? void 0 : table.mains_scores) || (table == null ? void 0 : table.combination_scores)) {
|
||||
actual_total_score = Number(table == null ? void 0 : table.singles_scores) + Number(table == null ? void 0 : table.doubles_scores) + Number(table == null ? void 0 : table.nulls_scores) + Number(table == null ? void 0 : table.judges_scores) + Number(table == null ? void 0 : table.pros_scores) + Number(table == null ? void 0 : table.bpros_scores) + Number(table == null ? void 0 : table.shixuns_scores) + Number(table == null ? void 0 : table.mains_scores) + Number(table == null ? void 0 : table.combination_scores);
|
||||
}
|
||||
const data = [
|
||||
{
|
||||
key: "1",
|
||||
name: "\u5E94\u5F97\u5206",
|
||||
singles_score: (table == null ? void 0 : table.total_singles_scores) || 0,
|
||||
doubles_score: (table == null ? void 0 : table.total_doubles_scores) || 0,
|
||||
nulls_score: (table == null ? void 0 : table.total_nulls_scores) || 0,
|
||||
judges_score: (table == null ? void 0 : table.total_judges_scores) || 0,
|
||||
pros_score: (table == null ? void 0 : table.total_pros_scores) || 0,
|
||||
bpros_score: (table == null ? void 0 : table.total_bpros_scores) || 0,
|
||||
shixuns_score: (table == null ? void 0 : table.total_shixuns_scores) || 0,
|
||||
mains_score: (table == null ? void 0 : table.total_mains_scores) || 0,
|
||||
total_combination_scores: (table == null ? void 0 : table.total_combination_scores) || 0,
|
||||
total_score: total_score || 0
|
||||
},
|
||||
{
|
||||
key: "2",
|
||||
name: "\u5B9E\u5F97\u5206",
|
||||
singles_score: (table == null ? void 0 : table.singles_scores) || 0,
|
||||
doubles_score: (table == null ? void 0 : table.doubles_scores) || 0,
|
||||
nulls_score: (table == null ? void 0 : table.nulls_scores) || 0,
|
||||
judges_score: (table == null ? void 0 : table.judges_scores) || 0,
|
||||
pros_score: (table == null ? void 0 : table.pros_scores) || 0,
|
||||
bpros_score: (table == null ? void 0 : table.bpros_scores) || 0,
|
||||
shixuns_score: (table == null ? void 0 : table.shixuns_scores) || 0,
|
||||
mains_score: (table == null ? void 0 : table.mains_scores) || 0,
|
||||
total_combination_scores: (table == null ? void 0 : table.combination_scores) || 0,
|
||||
total_score: actual_total_score || 0
|
||||
},
|
||||
{
|
||||
key: "3",
|
||||
name: "\u8BC4\u5377\u4EBA"
|
||||
}
|
||||
];
|
||||
const blankData = [
|
||||
{
|
||||
key: "1",
|
||||
name: "\u5E94\u5F97\u5206",
|
||||
singles_score: (table == null ? void 0 : table.total_singles_scores) || 0,
|
||||
doubles_score: (table == null ? void 0 : table.total_doubles_scores) || 0,
|
||||
nulls_score: (table == null ? void 0 : table.total_nulls_scores) || 0,
|
||||
judges_score: (table == null ? void 0 : table.total_judges_scores) || 0,
|
||||
pros_score: (table == null ? void 0 : table.total_pros_scores) || 0,
|
||||
bpros_score: (table == null ? void 0 : table.total_bpros_scores) || 0,
|
||||
shixuns_score: (table == null ? void 0 : table.total_shixuns_scores) || 0,
|
||||
mains_score: (table == null ? void 0 : table.total_mains_scores) || 0,
|
||||
total_combination_scores: (table == null ? void 0 : table.total_combination_scores) || 0,
|
||||
total_score: total_score || 0
|
||||
},
|
||||
{
|
||||
key: "2",
|
||||
name: "\u5B9E\u5F97\u5206"
|
||||
},
|
||||
{
|
||||
key: "3",
|
||||
name: "\u8BC4\u5377\u4EBA"
|
||||
}
|
||||
];
|
||||
setTableData([...isExportBlank ? blankData : data]);
|
||||
}
|
||||
}, [exercise.exerciseExportHeadData]);
|
||||
const getData = () => __async(void 0, null, function* () {
|
||||
const query = {
|
||||
id: params.exerciseId || params.categoryId,
|
||||
identify: (userInfo == null ? void 0 : userInfo.login) || null
|
||||
};
|
||||
const res = yield (0,service_exercise/* getExerciseExportHeadData */.iw)(query);
|
||||
setHeadData(res || {});
|
||||
const { table } = res || {};
|
||||
let total_score;
|
||||
let actual_total_score;
|
||||
if ((table == null ? void 0 : table.total_singles_scores) || (table == null ? void 0 : table.total_doubles_scores) || (table == null ? void 0 : table.total_nulls_scores) || (table == null ? void 0 : table.total_judges_scores) || (table == null ? void 0 : table.total_pros_scores) || (table == null ? void 0 : table.total_bpros_scores) || (table == null ? void 0 : table.total_shixuns_scores) || (table == null ? void 0 : table.total_mains_scores) || (table == null ? void 0 : table.total_combination_scores)) {
|
||||
total_score = Number(table == null ? void 0 : table.total_singles_scores) + Number(table == null ? void 0 : table.total_doubles_scores) + Number(table == null ? void 0 : table.total_nulls_scores) + Number(table == null ? void 0 : table.total_bpros_scores) + Number(table == null ? void 0 : table.total_judges_scores) + Number(table == null ? void 0 : table.total_pros_scores) + Number(table == null ? void 0 : table.total_shixuns_scores) + Number(table == null ? void 0 : table.total_mains_scores) + Number(table == null ? void 0 : table.total_combination_scores);
|
||||
}
|
||||
if ((table == null ? void 0 : table.singles_scores) || (table == null ? void 0 : table.doubles_scores) || (table == null ? void 0 : table.nulls_scores) || (table == null ? void 0 : table.judges_scores) || (table == null ? void 0 : table.pros_scores) || (table == null ? void 0 : table.bpros_scores) || (table == null ? void 0 : table.shixuns_scores) || (table == null ? void 0 : table.mains_scores) || (table == null ? void 0 : table.combination_scores)) {
|
||||
actual_total_score = Number(table == null ? void 0 : table.singles_scores) + Number(table == null ? void 0 : table.doubles_scores) + Number(table == null ? void 0 : table.bpros_scores) + Number(table == null ? void 0 : table.nulls_scores) + Number(table == null ? void 0 : table.judges_scores) + Number(table == null ? void 0 : table.pros_scores) + Number(table == null ? void 0 : table.shixuns_scores) + Number(table == null ? void 0 : table.mains_scores) + Number(table == null ? void 0 : table.combination_scores);
|
||||
}
|
||||
const data = [
|
||||
{
|
||||
key: "1",
|
||||
name: "\u5E94\u5F97\u5206",
|
||||
singles_score: (table == null ? void 0 : table.total_singles_scores) || 0,
|
||||
doubles_score: (table == null ? void 0 : table.total_doubles_scores) || 0,
|
||||
nulls_score: (table == null ? void 0 : table.total_nulls_scores) || 0,
|
||||
judges_score: (table == null ? void 0 : table.total_judges_scores) || 0,
|
||||
pros_score: (table == null ? void 0 : table.total_pros_scores) || 0,
|
||||
bpros_score: (table == null ? void 0 : table.total_bpros_scores) || 0,
|
||||
shixuns_score: (table == null ? void 0 : table.total_shixuns_scores) || 0,
|
||||
mains_score: (table == null ? void 0 : table.total_mains_scores) || 0,
|
||||
total_combination_scores: (table == null ? void 0 : table.total_combination_scores) || 0,
|
||||
total_score: total_score || 0
|
||||
},
|
||||
{
|
||||
key: "2",
|
||||
name: "\u5B9E\u5F97\u5206",
|
||||
singles_score: (table == null ? void 0 : table.singles_scores) || 0,
|
||||
doubles_score: (table == null ? void 0 : table.doubles_scores) || 0,
|
||||
nulls_score: (table == null ? void 0 : table.nulls_scores) || 0,
|
||||
judges_score: (table == null ? void 0 : table.judges_scores) || 0,
|
||||
pros_score: (table == null ? void 0 : table.pros_scores) || 0,
|
||||
bpros_score: (table == null ? void 0 : table.bpros_scores) || 0,
|
||||
shixuns_score: (table == null ? void 0 : table.shixuns_scores) || 0,
|
||||
mains_score: (table == null ? void 0 : table.mains_scores) || 0,
|
||||
total_combination_scores: (table == null ? void 0 : table.combination_scores) || 0,
|
||||
total_score: actual_total_score || 0
|
||||
},
|
||||
{
|
||||
key: "3",
|
||||
name: "\u8BC4\u5377\u4EBA"
|
||||
}
|
||||
];
|
||||
const blankData = [
|
||||
{
|
||||
key: "1",
|
||||
name: "\u5E94\u5F97\u5206"
|
||||
},
|
||||
{
|
||||
key: "2",
|
||||
name: "\u5B9E\u5F97\u5206"
|
||||
},
|
||||
{
|
||||
key: "3",
|
||||
name: "\u8BC4\u5377\u4EBA"
|
||||
}
|
||||
];
|
||||
setTableData(isExportBlank ? blankData : data);
|
||||
});
|
||||
const columns = [
|
||||
{
|
||||
width: "10%",
|
||||
title: "\u9898\u578B",
|
||||
align: "center",
|
||||
dataIndex: "name",
|
||||
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("a", null, text)
|
||||
},
|
||||
{
|
||||
// width: '10%',
|
||||
title: ((_a = questionName == null ? void 0 : questionName.find((item) => item.value == constant/* QUESTIONTYPE */.f[0].nameType)) == null ? void 0 : _a.name) || "\u5355\u9009\u9898",
|
||||
align: "center",
|
||||
// ellipsis: true,
|
||||
dataIndex: "singles_score",
|
||||
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("a", null, text === "0.0" ? 0 : text)
|
||||
},
|
||||
{
|
||||
// width: '10%',
|
||||
title: ((_b = questionName == null ? void 0 : questionName.find((item) => item.value == constant/* QUESTIONTYPE */.f[1].nameType)) == null ? void 0 : _b.name) || "\u591A\u9009\u9898",
|
||||
align: "center",
|
||||
// ellipsis: true,
|
||||
dataIndex: "doubles_score",
|
||||
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("a", null, text === "0.0" ? 0 : text)
|
||||
},
|
||||
{
|
||||
// width: '10%',
|
||||
title: ((_c = questionName == null ? void 0 : questionName.find((item) => item.value == constant/* QUESTIONTYPE */.f[3].nameType)) == null ? void 0 : _c.name) || "\u586B\u7A7A\u9898",
|
||||
align: "center",
|
||||
// ellipsis: true,
|
||||
dataIndex: "nulls_score",
|
||||
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("a", null, text === "0.0" ? 0 : text)
|
||||
},
|
||||
{
|
||||
// width: '10%',
|
||||
title: ((_d = questionName == null ? void 0 : questionName.find((item) => item.value == constant/* QUESTIONTYPE */.f[2].nameType)) == null ? void 0 : _d.name) || "\u5224\u65AD\u9898",
|
||||
align: "center",
|
||||
// ellipsis: true,
|
||||
dataIndex: "judges_score",
|
||||
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("a", null, text === "0.0" ? 0 : text)
|
||||
},
|
||||
{
|
||||
// width: '10%',
|
||||
title: ((_e = questionName == null ? void 0 : questionName.find((item) => item.value == constant/* QUESTIONTYPE */.f[6].nameType)) == null ? void 0 : _e.name) || "\u7F16\u7A0B\u9898",
|
||||
align: "center",
|
||||
// ellipsis: true,
|
||||
dataIndex: "pros_score",
|
||||
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("a", null, text === "0.0" ? 0 : text)
|
||||
},
|
||||
{
|
||||
// width: '10%',
|
||||
title: ((_f = questionName == null ? void 0 : questionName.find((item) => item.value == constant/* QUESTIONTYPE */.f[5].nameType)) == null ? void 0 : _f.name) || "\u5B9E\u8BAD\u9898",
|
||||
align: "center",
|
||||
// ellipsis: true,
|
||||
dataIndex: "shixuns_score",
|
||||
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("a", null, text === "0.0" ? 0 : text)
|
||||
},
|
||||
{
|
||||
// width: '10%',
|
||||
title: ((_g = questionName == null ? void 0 : questionName.find((item) => item.value == constant/* QUESTIONTYPE */.f[4].nameType)) == null ? void 0 : _g.name) || "\u7B80\u7B54\u9898",
|
||||
align: "center",
|
||||
// ellipsis: true,
|
||||
dataIndex: "mains_score",
|
||||
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("a", null, text === "0.0" ? 0 : text)
|
||||
},
|
||||
{
|
||||
// width: '10%',
|
||||
title: ((_h = questionName == null ? void 0 : questionName.find((item) => item.value == constant/* QUESTIONTYPE */.f[7].nameType)) == null ? void 0 : _h.name) || "\u7EC4\u5408\u9898",
|
||||
align: "center",
|
||||
// ellipsis: true,
|
||||
dataIndex: "total_combination_scores",
|
||||
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("a", null, text === "0.0" ? 0 : text)
|
||||
},
|
||||
{
|
||||
// width: '10%',
|
||||
title: ((_i = questionName == null ? void 0 : questionName.find((item) => item.value == constant/* QUESTIONTYPE */.f[8].nameType)) == null ? void 0 : _i.name) || "\u7A0B\u5E8F\u586B\u7A7A\u9898",
|
||||
align: "center",
|
||||
// ellipsis: true,
|
||||
dataIndex: "bpros_score",
|
||||
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("a", null, text === "0.0" ? 0 : text)
|
||||
},
|
||||
{
|
||||
width: "10%",
|
||||
title: "\u603B\u5206",
|
||||
align: "center",
|
||||
dataIndex: "total_score",
|
||||
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement("a", null, text === "0.0" ? 0 : text == null ? void 0 : text.toFixed(1))
|
||||
}
|
||||
];
|
||||
const { exercise_header } = headData || {};
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, ((exercise_header == null ? void 0 : exercise_header.show_user) || (exercise_header == null ? void 0 : exercise_header.show_no) || (exercise_header == null ? void 0 : exercise_header.show_group)) && /* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: Headmodules.glassSeal }, (exercise_header == null ? void 0 : exercise_header.show_user) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u59D3\u540D\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, headData == null ? void 0 : headData.user)), (exercise_header == null ? void 0 : exercise_header.show_no) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u5B66\u53F7\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, headData == null ? void 0 : headData.student_id)), (exercise_header == null ? void 0 : exercise_header.show_group) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u4E13\u4E1A\u73ED\u7EA7\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, headData == null ? void 0 : headData.group_name)), (exercise_header == null ? void 0 : exercise_header.show_school_name) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u5B66\u6821/\u5355\u4F4D\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, headData == null ? void 0 : headData.school_name)), (exercise_header == null ? void 0 : exercise_header.show_phone) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u624B\u673A\u53F7\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, headData == null ? void 0 : headData.phone))), /* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: `${Headmodules.wrap} ${isPreview ? "pl20" : ""} ` }, (headData == null ? void 0 : headData.photo_url) && /* @__PURE__ */ _react_17_0_2_react.createElement("img", { className: Headmodules.img, src: headData == null ? void 0 : headData.photo_url }), (exercise_header == null ? void 0 : exercise_header.show_title) && /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: Headmodules.paperHeader, justify: "center" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, headData == null ? void 0 : headData.title), showExportBtn && /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { icon: /* @__PURE__ */ _react_17_0_2_react.createElement(SettingOutlined/* default */.Z, null), className: Headmodules.exportBtn, onClick: () => {
|
||||
dispatch({
|
||||
type: "exercise/setActionTabs",
|
||||
payload: {
|
||||
key: "exportSetting"
|
||||
}
|
||||
});
|
||||
} }, "\u5BFC\u51FA\u8BBE\u7F6E")), (exercise_header == null ? void 0 : exercise_header.show_body) && (((_j = exercise == null ? void 0 : exercise.exerciseExportHeadData) == null ? void 0 : _j.exercise_description) || ((_k = exercise == null ? void 0 : exercise.commonHeader) == null ? void 0 : _k.exercise_description)) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { ref: leftheight, style: { justifyContent: leftheights === 21 ? "center" : "left", wordBreak: "break-all", display: "flex", textAlign: "left" }, className: "tc c-grey-333" }, `\u8BD5\u5377\u987B\u77E5\uFF1A${((_l = exercise == null ? void 0 : exercise.exerciseExportHeadData) == null ? void 0 : _l.exercise_description) || ((_m = exercise == null ? void 0 : exercise.commonHeader) == null ? void 0 : _m.exercise_description)}`), (exercise_header == null ? void 0 : exercise_header.show_info) && /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "tc c-grey-666" }, "\u5171:\u3010", headData == null ? void 0 : headData.large_counts, "\u5927\u9898\u3011\u3010", headData == null ? void 0 : headData.total_count, "\u5C0F\u9898\u3011\u3010 \u6EE1\u5206", headData == null ? void 0 : headData.score, "\u5206\u3011 \u8003\u8BD5\u65F6\u95F4\uFF1A\u3010", (headData == null ? void 0 : headData.time) > -1 ? `${headData == null ? void 0 : headData.time}\u5206\u949F` : `\u4E0D\u9650`, "\u3011"), (exercise_header == null ? void 0 : exercise_header.show_desc) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mt10" }, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "font16" }, "\u8003\u8BD5\u8BF4\u660E\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: headData == null ? void 0 : headData.description })), (exercise_header == null ? void 0 : exercise_header.show_table) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mt10" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
table["default"],
|
||||
{
|
||||
className: Headmodules.table,
|
||||
columns,
|
||||
dataSource: [...tableData || []],
|
||||
bordered: true,
|
||||
pagination: false
|
||||
}
|
||||
)), ((_n = exercise == null ? void 0 : exercise.exerciseExportHeadData) == null ? void 0 : _n.analysis) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { justifyContent: "left", wordBreak: "break-all", display: "flex", textAlign: "left", marginTop: "10px" }, className: "tc c-grey-333" }, `\u8003\u8BD5\u8BC4\u4EF7\uFF1A${(_o = exercise == null ? void 0 : exercise.exerciseExportHeadData) == null ? void 0 : _o.analysis}`)), /* @__PURE__ */ _react_17_0_2_react.createElement(ExportSetting/* default */.Z, null));
|
||||
};
|
||||
/* harmony default export */ var components_Head = ((0,_umi_production_exports.connect)(
|
||||
({
|
||||
exercise,
|
||||
loading,
|
||||
user,
|
||||
globalSetting
|
||||
}) => ({
|
||||
exercise,
|
||||
globalSetting,
|
||||
user,
|
||||
loading: loading.effects
|
||||
})
|
||||
)(Head));
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
@ -0,0 +1,717 @@
|
||||
"use strict";
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[5677],{
|
||||
|
||||
/***/ 45982:
|
||||
/*!**********************************************************!*\
|
||||
!*** ./src/components/MultiUpload/index.tsx + 3 modules ***!
|
||||
\**********************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
z: function() { return /* binding */ coverToFileList; },
|
||||
Z: function() { return /* binding */ MultiUpload; }
|
||||
});
|
||||
|
||||
// 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/upload/index.js + 24 modules
|
||||
var upload = __webpack_require__(6557);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
||||
var es_message = __webpack_require__(8591);
|
||||
// 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/button/index.js
|
||||
var es_button = __webpack_require__(3113);
|
||||
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
||||
var env = __webpack_require__(64741);
|
||||
// EXTERNAL MODULE: ./src/pages/MoopCases/FormPanel/service.ts
|
||||
var service = __webpack_require__(18578);
|
||||
;// CONCATENATED MODULE: ./src/components/SingleUpload/index.tsx
|
||||
var __defProp = Object.defineProperty;
|
||||
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 __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 uploadNameSizeSeperator = "\u3000\u3000";
|
||||
function bytesToSize(bytes) {
|
||||
var sizes = ["Bytes", "KB", "MB", "GB", "TB"];
|
||||
if (bytes == 0)
|
||||
return "0 Byte";
|
||||
var i = parseInt("" + Math.floor(Math.log(bytes) / Math.log(1024)), 10);
|
||||
return (bytes / Math.pow(1024, i)).toFixed(1) + " " + sizes[i];
|
||||
}
|
||||
/* harmony default export */ var SingleUpload = (({
|
||||
value = [],
|
||||
action,
|
||||
onChange,
|
||||
className,
|
||||
maxSize = 150,
|
||||
title = "\u6587\u4EF6\u4E0A\u4F20",
|
||||
accept = null
|
||||
}) => {
|
||||
const uploadProps = {
|
||||
multiple: false,
|
||||
fileList: value,
|
||||
accept,
|
||||
withCredentials: true,
|
||||
beforeUpload: (file) => {
|
||||
const fileSize = file.size / 1024 / 1024;
|
||||
if (!(fileSize < maxSize)) {
|
||||
message.error(`\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(${maxSize}MB),\u5EFA\u8BAE\u4E0A\u4F20\u5230\u767E\u5EA6\u4E91\u7B49\u5176\u5B83\u5171\u4EAB\u5DE5\u5177\u91CC\uFF0C\u7136\u540E\u518Dtxt\u6587\u6863\u91CC\u7ED9\u51FA\u94FE\u63A5\u4EE5\u53CA\u5171\u4EAB\u5BC6\u7801\u5E76\u4E0A\u4F20`);
|
||||
return Promise.reject();
|
||||
}
|
||||
return true;
|
||||
},
|
||||
action: `${ENV.API_SERVER}/api/attachments.json`,
|
||||
// ?debug=student&randomcode=undefined&client_key=6d57f8c3dd186c5ada392546ace9620a
|
||||
onChange(info) {
|
||||
var _a, _b, _c, _d;
|
||||
let fileList = [...info.fileList];
|
||||
fileList = fileList.map((file) => {
|
||||
if (file.name.indexOf(uploadNameSizeSeperator) === -1) {
|
||||
file.name = `${file.name}${uploadNameSizeSeperator}${bytesToSize(
|
||||
file.size
|
||||
)}`;
|
||||
}
|
||||
return __spreadValues({}, file);
|
||||
});
|
||||
if (info.file.status === "done" && ((_b = (_a = info.file) == null ? void 0 : _a.response) == null ? void 0 : _b.status) === -1) {
|
||||
message.error((_d = (_c = info.file) == null ? void 0 : _c.response) == null ? void 0 : _d.message);
|
||||
onChange([]);
|
||||
return;
|
||||
}
|
||||
onChange(fileList);
|
||||
},
|
||||
onRemove: (file) => __async(void 0, null, function* () {
|
||||
const fileSize = file.size / 1024 / 1024;
|
||||
if (file.status === "uploading") {
|
||||
return true;
|
||||
}
|
||||
if (!(fileSize < maxSize)) {
|
||||
return true;
|
||||
} else {
|
||||
let id = file.response ? file.response.id : file.uid;
|
||||
if (id) {
|
||||
let rs = yield removeAttachment(
|
||||
file.response ? file.response.id : file.id
|
||||
);
|
||||
return rs;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
function onCancel(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
return /* @__PURE__ */ React.createElement("div", { className: `single-upload ${className ? className : ""}` }, /* @__PURE__ */ React.createElement(Upload, __spreadValues({}, uploadProps), /* @__PURE__ */ React.createElement(
|
||||
Button,
|
||||
{
|
||||
type: "primary",
|
||||
title: value.length > 0 ? "\u6BCF\u6B21\u53EA\u80FD\u4E0A\u4F20\u4E00\u4E2A\u8D44\u6E90\uFF0C \u5220\u9664\u4E0B\u9762\u8D44\u6E90\u53EF\u91CD\u65B0\u4E0A\u4F20 " : "",
|
||||
disabled: value.length > 0,
|
||||
ghost: true
|
||||
},
|
||||
title
|
||||
), /* @__PURE__ */ React.createElement("span", { onClick: onCancel, style: { marginLeft: 10 } }, "(\u5355\u4E2A\u6587\u4EF6\u6700\u5927", maxSize, "M)", " ")));
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/InboxOutlined.js + 1 modules
|
||||
var InboxOutlined = __webpack_require__(60936);
|
||||
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js
|
||||
var lodash = __webpack_require__(89392);
|
||||
;// CONCATENATED MODULE: ./src/components/MultiUpload/index.less
|
||||
// extracted by mini-css-extract-plugin
|
||||
|
||||
;// CONCATENATED MODULE: ./src/assets/images/uploadImg.svg
|
||||
var uploadImg_defProp = Object.defineProperty;
|
||||
var uploadImg_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
||||
var uploadImg_hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var uploadImg_propIsEnum = Object.prototype.propertyIsEnumerable;
|
||||
var uploadImg_defNormalProp = (obj, key, value) => key in obj ? uploadImg_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
||||
var uploadImg_spreadValues = (a, b) => {
|
||||
for (var prop in b || (b = {}))
|
||||
if (uploadImg_hasOwnProp.call(b, prop))
|
||||
uploadImg_defNormalProp(a, prop, b[prop]);
|
||||
if (uploadImg_getOwnPropSymbols)
|
||||
for (var prop of uploadImg_getOwnPropSymbols(b)) {
|
||||
if (uploadImg_propIsEnum.call(b, prop))
|
||||
uploadImg_defNormalProp(a, prop, b[prop]);
|
||||
}
|
||||
return a;
|
||||
};
|
||||
|
||||
const SvgUploadImg = (props) => /* @__PURE__ */ React.createElement("svg", uploadImg_spreadValues({ width: 14, height: 14, xmlns: "http://www.w3.org/2000/svg" }, props), /* @__PURE__ */ React.createElement("title", null, "\u5F62\u72B6"), /* @__PURE__ */ React.createElement("path", { d: "M10.354 3.5h-2.77v8.167H6.416V3.5H3.646L7 0l3.354 3.5ZM14 7h-1.167v5.833H1.167V7H0v7h14V7Z", fill: "#3061D0", fillRule: "nonzero" }));
|
||||
|
||||
/* harmony default export */ var uploadImg = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEwLjM1NCAzLjVoLTIuNzd2OC4xNjdINi40MTZWMy41SDMuNjQ2TDcgMGwzLjM1NCAzLjVaTTE0IDdoLTEuMTY3djUuODMzSDEuMTY3VjdIMHY3aDE0VjdaIiBmaWxsPSIjMzA2MUQwIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=");
|
||||
|
||||
;// CONCATENATED MODULE: ./src/components/MultiUpload/index.tsx
|
||||
var MultiUpload_defProp = Object.defineProperty;
|
||||
var MultiUpload_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
||||
var MultiUpload_hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var MultiUpload_propIsEnum = Object.prototype.propertyIsEnumerable;
|
||||
var MultiUpload_defNormalProp = (obj, key, value) => key in obj ? MultiUpload_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
||||
var MultiUpload_spreadValues = (a, b) => {
|
||||
for (var prop in b || (b = {}))
|
||||
if (MultiUpload_hasOwnProp.call(b, prop))
|
||||
MultiUpload_defNormalProp(a, prop, b[prop]);
|
||||
if (MultiUpload_getOwnPropSymbols)
|
||||
for (var prop of MultiUpload_getOwnPropSymbols(b)) {
|
||||
if (MultiUpload_propIsEnum.call(b, prop))
|
||||
MultiUpload_defNormalProp(a, prop, b[prop]);
|
||||
}
|
||||
return a;
|
||||
};
|
||||
var MultiUpload_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 { Dragger } = upload["default"];
|
||||
function coverToFileList(data) {
|
||||
let rs = [];
|
||||
if (data && data.length > 0) {
|
||||
rs = data.map((item) => {
|
||||
return {
|
||||
uid: item.id,
|
||||
id: item.id,
|
||||
name: item.title + uploadNameSizeSeperator + item.filesize,
|
||||
url: item.url,
|
||||
filesize: item.filesize,
|
||||
status: "done",
|
||||
response: { id: item.id }
|
||||
};
|
||||
});
|
||||
}
|
||||
return rs;
|
||||
}
|
||||
/* harmony default export */ var MultiUpload = (({
|
||||
value,
|
||||
onChange,
|
||||
action,
|
||||
data,
|
||||
className,
|
||||
maxSize = 150,
|
||||
title = "\u4E0A\u4F20\u9644\u4EF6",
|
||||
showRemoveModal = false,
|
||||
accept = "",
|
||||
additionalText,
|
||||
isDragger,
|
||||
number = 1e3,
|
||||
aloneClear = false
|
||||
}) => {
|
||||
const [disabled, setDisabled] = (0,_react_17_0_2_react.useState)(false);
|
||||
let [fileList, setFileList] = (0,_react_17_0_2_react.useState)(value || []);
|
||||
let [nums, setnums] = (0,_react_17_0_2_react.useState)(1);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
if (value) {
|
||||
if (nums === 1) {
|
||||
setFileList([...value]);
|
||||
}
|
||||
setnums(2);
|
||||
if (number === (value == null ? void 0 : value.length)) {
|
||||
setDisabled(true);
|
||||
}
|
||||
}
|
||||
}, [value]);
|
||||
const clearLastFile = () => {
|
||||
setTimeout(() => {
|
||||
fileList.pop();
|
||||
setFileList([...fileList]);
|
||||
}, 500);
|
||||
};
|
||||
const uploadProps = {
|
||||
multiple: true,
|
||||
disabled,
|
||||
accept,
|
||||
withCredentials: true,
|
||||
fileList,
|
||||
// fileList: fileList?.length ? fileList : value,
|
||||
beforeUpload: (file, fileArr) => {
|
||||
const fileSize = file.size / 1024 / 1024;
|
||||
if (fileList.concat(fileArr).length > number) {
|
||||
fileList.pop();
|
||||
setFileList([...fileList]);
|
||||
es_message/* default */.ZP.error(`\u6700\u591A\u53EA\u80FD\u4E0A\u4F20${number}\u4E2A\u6587\u4EF6`);
|
||||
if (aloneClear) {
|
||||
return Promise.reject();
|
||||
}
|
||||
clearLastFile();
|
||||
return false;
|
||||
}
|
||||
if (!(fileSize < maxSize)) {
|
||||
es_message/* default */.ZP.error(`\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(${maxSize}MB).`);
|
||||
if (aloneClear) {
|
||||
return Promise.reject();
|
||||
}
|
||||
clearLastFile();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
data,
|
||||
action: action || `${env/* default */.Z.API_SERVER}/api/attachments.json`,
|
||||
// ?debug=student&randomcode=undefined&client_key=6d57f8c3dd186c5ada392546ace9620a
|
||||
onChange(info) {
|
||||
var _a, _b, _c, _d;
|
||||
if (info.file.status === "removed") {
|
||||
fileList = info.fileList;
|
||||
} else {
|
||||
fileList = (0,lodash.uniqBy)([...info.fileList, ...fileList], "uid");
|
||||
}
|
||||
if (info.file.status === "done" && ((_b = (_a = info.file) == null ? void 0 : _a.response) == null ? void 0 : _b.status) === -1) {
|
||||
es_message/* default */.ZP.error((_d = (_c = info.file) == null ? void 0 : _c.response) == null ? void 0 : _d.message);
|
||||
return;
|
||||
}
|
||||
if (fileList.length >= number)
|
||||
setDisabled(true);
|
||||
else
|
||||
setDisabled(false);
|
||||
setFileList([...fileList]);
|
||||
fileList = fileList.map((file) => {
|
||||
var _a2, _b2;
|
||||
if ((_a2 = file == null ? void 0 : file.response) == null ? void 0 : _a2.id) {
|
||||
file.url = `/api/attachments/${(_b2 = file == null ? void 0 : file.response) == null ? void 0 : _b2.id}`;
|
||||
}
|
||||
if (file.name.indexOf(uploadNameSizeSeperator) === -1) {
|
||||
file.name = `${file.name}${uploadNameSizeSeperator}${bytesToSize(
|
||||
file.size
|
||||
)}`;
|
||||
}
|
||||
return MultiUpload_spreadValues({}, file);
|
||||
});
|
||||
console.log("info:", info, fileList);
|
||||
onChange(fileList);
|
||||
},
|
||||
onRemove: (file) => MultiUpload_async(void 0, null, function* () {
|
||||
const remove = () => MultiUpload_async(void 0, null, function* () {
|
||||
let id = file.response ? file.response.id : file.id;
|
||||
if (id) {
|
||||
let rs = yield (0,service/* removeAttachment */.JZ)(
|
||||
file.response ? file.response.id : file.uid
|
||||
);
|
||||
return Promise.resolve(rs);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (showRemoveModal) {
|
||||
return new Promise((resolve, reject) => {
|
||||
modal["default"].confirm({
|
||||
centered: true,
|
||||
width: 530,
|
||||
okText: "\u786E\u5B9A",
|
||||
cancelText: "\u53D6\u6D88",
|
||||
title: "\u63D0\u793A",
|
||||
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "tc font16" }, "\u662F\u5426\u786E\u8BA4\u5220\u9664?"),
|
||||
onOk: () => MultiUpload_async(void 0, null, function* () {
|
||||
const res = yield remove();
|
||||
es_message/* default */.ZP.success("\u5220\u9664\u6210\u529F");
|
||||
resolve(true);
|
||||
}),
|
||||
onCancel: () => {
|
||||
return resolve(false);
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
return yield remove();
|
||||
}
|
||||
})
|
||||
};
|
||||
function onCancel(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `multi-upload ${className ? className : ""}` }, isDragger && /* @__PURE__ */ _react_17_0_2_react.createElement(Dragger, MultiUpload_spreadValues({}, uploadProps), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "ant-upload-drag-icon" }, /* @__PURE__ */ _react_17_0_2_react.createElement(InboxOutlined/* default */.Z, null)), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "ant-upload-text" }, "\u70B9\u51FB\u4E0A\u4F20\u56FE\u6807\uFF0C\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u4EF6\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64", /* @__PURE__ */ _react_17_0_2_react.createElement("br", null), "(\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\u4E3A", maxSize, "MB)", " "), additionalText), !isDragger && /* @__PURE__ */ _react_17_0_2_react.createElement(upload["default"], MultiUpload_spreadValues({}, uploadProps), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { disabled, className: "upload_button" }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { className: "aBtn_img", src: uploadImg }), title), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { onClick: onCancel, className: "upload_text" }, "(\u5355\u4E2A\u6587\u4EF6\u6700\u5927", maxSize, "MB)", " ")));
|
||||
});
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 85935:
|
||||
/*!*********************************************************************************************************!*\
|
||||
!*** ./src/pages/Classrooms/Lists/CommonHomework/components/SearchSortController/index.tsx + 1 modules ***!
|
||||
\*********************************************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ components_SearchSortController; }
|
||||
});
|
||||
|
||||
// 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/dropdown/index.js + 1 modules
|
||||
var dropdown = __webpack_require__(38854);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/menu/index.js + 11 modules
|
||||
var menu = __webpack_require__(20834);
|
||||
// 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/input/index.js + 5 modules
|
||||
var input = __webpack_require__(1056);
|
||||
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/CommonHomework/components/SearchSortController/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var SearchSortControllermodules = ({"searchSortControllerContainer":"searchSortControllerContainer___AAq4n","btn":"btn___bMc0x","btnSort":"btnSort___vBpNG","tips":"tips___egWVQ"});
|
||||
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/CommonHomework/components/SearchSortController/index.tsx
|
||||
|
||||
|
||||
|
||||
const SearchSortController = ({
|
||||
isAdmin,
|
||||
dataSource,
|
||||
batchStatus,
|
||||
SortMenuName,
|
||||
setSortMenuName,
|
||||
onSearch,
|
||||
onSort,
|
||||
onBatch
|
||||
}) => {
|
||||
const SortMenus = isAdmin ? [
|
||||
{ name: "\u9ED8\u8BA4\u6392\u5E8F", type: "position", direction: "desc" },
|
||||
{ name: "\u521B\u5EFA\u65F6\u95F4\u5347\u5E8F", type: "created_at", direction: "asc" },
|
||||
{ name: "\u521B\u5EFA\u65F6\u95F4\u964D\u5E8F", type: "created_at", direction: "desc" },
|
||||
{ name: "\u66F4\u65B0\u65F6\u95F4\u5347\u5E8F", type: "updated_at", direction: "asc" },
|
||||
{ name: "\u66F4\u65B0\u65F6\u95F4\u964D\u5E8F", type: "updated_at", direction: "desc" },
|
||||
{ name: "\u4F5C\u4E1A\u540D\u79F0\u5347\u5E8F", type: "name_pinyin", direction: "asc" },
|
||||
{ name: "\u4F5C\u4E1A\u540D\u79F0\u964D\u5E8F", type: "name_pinyin", direction: "desc" }
|
||||
] : [
|
||||
{ name: "\u9ED8\u8BA4\u6392\u5E8F", type: "position", direction: "desc" },
|
||||
{ name: "\u6309\u53D1\u5E03\u65F6\u95F4\u5347\u5E8F", type: "created_at", direction: "asc" },
|
||||
{ name: "\u6309\u53D1\u5E03\u65F6\u95F4\u964D\u5E8F", type: "created_at", direction: "desc" },
|
||||
{ name: "\u6309\u622A\u6B62\u65F6\u95F4\u5347\u5E8F", type: "updated_at", direction: "asc" },
|
||||
{ name: "\u6309\u622A\u6B62\u65F6\u95F4\u964D\u5E8F", type: "updated_at", direction: "desc" },
|
||||
{ name: "\u4F5C\u4E1A\u540D\u79F0\u5347\u5E8F", type: "name_pinyin", direction: "asc" },
|
||||
{ name: "\u4F5C\u4E1A\u540D\u79F0\u964D\u5E8F", type: "name_pinyin", direction: "desc" }
|
||||
];
|
||||
const sortClick = (data) => {
|
||||
setSortMenuName(data.name);
|
||||
onSort(data);
|
||||
};
|
||||
const isDefault = SortMenuName === "\u9ED8\u8BA4\u6392\u5E8F";
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: SearchSortControllermodules.searchSortControllerContainer }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
dropdown/* default */.Z,
|
||||
{
|
||||
dropdownRender: () => /* @__PURE__ */ _react_17_0_2_react.createElement(menu["default"], { selectedKeys: [SortMenuName] }, SortMenus.map((item) => {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(menu["default"].Item, { key: item.name, onClick: () => sortClick(item) }, item.name);
|
||||
}))
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"span",
|
||||
{
|
||||
className: `${SearchSortControllermodules.btn} ${isDefault ? SearchSortControllermodules.btnSort : ""}`
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-paixu font14 mr5" }),
|
||||
SortMenuName
|
||||
))
|
||||
)), isDefault && /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u4F18\u5148\u6309\u7167\u8C03\u6574\u6392\u5E8F\u7ED3\u679C\u5C55\u793A\uFF0C\u672A\u8BBE\u7F6E\u6392\u5E8F\u65F6\uFF0C\u6309\u7167\u521B\u5EFA\u65F6\u95F4\u964D\u5E8F\u6392\u5217" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: SearchSortControllermodules.tips }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-a-wenhaobeifen2" }))), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
input["default"].Search,
|
||||
{
|
||||
allowClear: true,
|
||||
placeholder: "\u8BF7\u8F93\u5165\u540D\u79F0\u8FDB\u884C\u641C\u7D22",
|
||||
onSearch,
|
||||
style: { width: 220, marginLeft: "auto" }
|
||||
}
|
||||
));
|
||||
};
|
||||
/* harmony default export */ var components_SearchSortController = (SearchSortController);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 33227:
|
||||
/*!****************************************************************************************************!*\
|
||||
!*** ./src/pages/Classrooms/Lists/CommonHomework/components/SortShixunPanel/index.tsx + 1 modules ***!
|
||||
\****************************************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ SortShixunPanel; }
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
||||
var _react_17_0_2_react = __webpack_require__(59301);
|
||||
// EXTERNAL MODULE: ./node_modules/_react-sortable-hoc@1.11.0@react-sortable-hoc/dist/react-sortable-hoc.esm.js
|
||||
var react_sortable_hoc_esm = __webpack_require__(44589);
|
||||
// EXTERNAL MODULE: ./node_modules/_array-move@3.0.1@array-move/index.js
|
||||
var _array_move_3_0_1_array_move = __webpack_require__(39180);
|
||||
var _array_move_3_0_1_array_move_default = /*#__PURE__*/__webpack_require__.n(_array_move_3_0_1_array_move);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/drawer/index.js + 9 modules
|
||||
var drawer = __webpack_require__(43428);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
||||
var es_button = __webpack_require__(3113);
|
||||
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/CommonHomework/components/SortShixunPanel/index.less
|
||||
// extracted by mini-css-extract-plugin
|
||||
|
||||
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/CommonHomework/components/SortShixunPanel/index.tsx
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const SortableItem = (0,react_sortable_hoc_esm/* SortableElement */.W8)(({ item }) => /* @__PURE__ */ _react_17_0_2_react.createElement("li", null, /* @__PURE__ */ _react_17_0_2_react.createElement("h3", null, item.task_name), /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, item.user_name, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { marginLeft: "20px" } }, item.category))));
|
||||
const SortableList = (0,react_sortable_hoc_esm/* SortableContainer */.JN)(({ items }) => {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("ul", { className: "task-list-container" }, items.map((value, index) => /* @__PURE__ */ _react_17_0_2_react.createElement(SortableItem, { key: `${value.task_id}`, index, item: value })));
|
||||
});
|
||||
/* harmony default export */ var SortShixunPanel = (({ data, callback, onCancel, visible = false }) => {
|
||||
const [values, setValues] = (0,_react_17_0_2_react.useState)(data);
|
||||
function onSave() {
|
||||
callback(values.map((item) => item.task_id));
|
||||
}
|
||||
function onSortEnd(info) {
|
||||
const { newIndex, oldIndex } = info;
|
||||
setValues(_array_move_3_0_1_array_move_default()(values, oldIndex, newIndex));
|
||||
}
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
setValues(data);
|
||||
}, [JSON.stringify(data)]);
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
drawer/* default */.Z,
|
||||
{
|
||||
placement: "bottom",
|
||||
height: "100%",
|
||||
closable: true,
|
||||
onClose: onCancel,
|
||||
style: { zIndex: 9999 },
|
||||
open: visible,
|
||||
rootClassName: "sort-list-panel"
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "sort-list-tip" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u6E29\u99A8\u63D0\u793A\uFF1A\u8BF7\u5728\u5217\u8868\u4E2D\u957F\u6309\u9F20\u6807\u5DE6\u952E\uFF0C\u8FDB\u884C\u62D6\u653E\u6392\u5E8F\u3002\u5B8C\u6210\u6392\u5E8F\u540E\u8BF7\u70B9\u51FB\u201C\u4FDD\u5B58\u201D"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { type: "ghost", onClick: onCancel, style: { marginRight: 10 } }, "\u53D6\u6D88"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { disabled: values.length === 0, type: "primary", onClick: onSave }, "\u4FDD\u5B58")),
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
SortableList,
|
||||
{
|
||||
axis: "xy",
|
||||
helperClass: "dragging-li",
|
||||
items: values,
|
||||
onSortEnd
|
||||
}
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 97611:
|
||||
/*!********************************************************************************************!*\
|
||||
!*** ./src/pages/Classrooms/Lists/CommonHomework/components/TabMenu/index.tsx + 1 modules ***!
|
||||
\********************************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ components_TabMenu; }
|
||||
});
|
||||
|
||||
// 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/menu/index.js + 11 modules
|
||||
var menu = __webpack_require__(20834);
|
||||
// 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/tooltip/index.js + 3 modules
|
||||
var tooltip = __webpack_require__(6848);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js + 1 modules
|
||||
var dropdown = __webpack_require__(38854);
|
||||
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/CommonHomework/components/TabMenu/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var TabMenumodules = ({"tabMenuContainer":"tabMenuContainer___xbZhu","control":"control___tg7XY","iconH":"iconH___CDXCm","selectBtn":"selectBtn___Da4jv"});
|
||||
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 14 modules
|
||||
var _umi_production_exports = __webpack_require__(87210);
|
||||
// EXTERNAL MODULE: ./src/utils/authority.ts
|
||||
var authority = __webpack_require__(55830);
|
||||
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/CommonHomework/components/TabMenu/index.tsx
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const TabMenu = ({
|
||||
isLoading,
|
||||
addText,
|
||||
tabDataSource,
|
||||
isAdmin,
|
||||
TooltipTitle,
|
||||
categoryId,
|
||||
dropdownMenu,
|
||||
isShowRightControl,
|
||||
defaultSelectedKeys,
|
||||
classroomList,
|
||||
onTabMenuClick,
|
||||
onTooltipTitleClick,
|
||||
onDropdownMenuClick,
|
||||
onsetClick
|
||||
}) => {
|
||||
var _a;
|
||||
const getDropdownMenu = () => {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(menu["default"], { onClick: ({ key }) => {
|
||||
onDropdownMenuClick(key);
|
||||
} }, dropdownMenu.map((item) => /* @__PURE__ */ _react_17_0_2_react.createElement(menu["default"].Item, { key: item.id }, item.name)));
|
||||
};
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: TabMenumodules.tabMenuContainer }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: "1" }, /* @__PURE__ */ _react_17_0_2_react.createElement(menu["default"], { mode: "horizontal", selectedKeys: defaultSelectedKeys }, tabDataSource.map((item) => /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
menu["default"].Item,
|
||||
{
|
||||
key: item.id,
|
||||
onClick: () => !isLoading ? onTabMenuClick(item) : {}
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: `c-grey-666 ${isAdmin ? "mr20" : ""}` }, item.name),
|
||||
item.total !== void 0 && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-grey-999" }, item.total || 0)
|
||||
)))), isAdmin && isShowRightControl && /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: "mr20 gutter-row", style: { display: "flex", alignItems: "center", color: "#0152d9", paddingBottom: 3 } }, (0,authority/* isAssistant */.Rm)() && !((_a = classroomList.AssistantObject.normal) == null ? void 0 : _a.can_create) ? "" : /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"span",
|
||||
{
|
||||
className: "c-grey-666",
|
||||
style: { marginLeft: 8, cursor: "pointer", marginTop: "3px" },
|
||||
onClick: onsetClick
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-shezhi6 font16 mr5" })
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: TabMenumodules.control }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"div",
|
||||
{
|
||||
className: "c-blue font16 ml20 current",
|
||||
style: { marginTop: 2 },
|
||||
onClick: onTooltipTitleClick
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: TooltipTitle }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"span",
|
||||
{
|
||||
className: !categoryId ? `${TabMenumodules.iconH} iconfont icon-xinjianmulu1` : `${TabMenumodules.iconH} iconfont icon-zhongmingmingmulu`
|
||||
}
|
||||
))
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement(dropdown/* default */.Z, { className: "ml10", dropdownRender: getDropdownMenu }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: TabMenumodules.selectBtn }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-tianjiadaohang" })), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, addText ? addText : "\u65B0\u5EFA\u4F5C\u4E1A")))))));
|
||||
};
|
||||
/* harmony default export */ var components_TabMenu = ((0,_umi_production_exports.connect)(({
|
||||
classroomList
|
||||
}) => ({
|
||||
classroomList
|
||||
}))(TabMenu));
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 18578:
|
||||
/*!**************************************************!*\
|
||||
!*** ./src/pages/MoopCases/FormPanel/service.ts ***!
|
||||
\**************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ $J: function() { return /* binding */ getMoopCase; },
|
||||
/* harmony export */ JZ: function() { return /* binding */ removeAttachment; },
|
||||
/* harmony export */ bN: function() { return /* binding */ updateMoopCase; },
|
||||
/* harmony export */ jP: function() { return /* binding */ addMoopCase; },
|
||||
/* harmony export */ rO: function() { return /* binding */ getLibraryTags; }
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/utils/fetch */ 87101);
|
||||
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());
|
||||
});
|
||||
};
|
||||
|
||||
function getMoopCase(id) {
|
||||
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .get */ .U2)(`libraries/${id}.json`);
|
||||
}
|
||||
function getLibraryTags() {
|
||||
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .get */ .U2)("library_tags.json");
|
||||
}
|
||||
function removeAttachment(id) {
|
||||
return __async(this, null, function* () {
|
||||
const response = yield (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .del */ .IV)(`attachments/${id}.json`);
|
||||
return response.status === 0;
|
||||
});
|
||||
}
|
||||
function addMoopCase(params) {
|
||||
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`libraries.json`, params);
|
||||
}
|
||||
function updateMoopCase(id, params) {
|
||||
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .put */ .gz)(`libraries/${id}.json`, params);
|
||||
}
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
@ -0,0 +1,698 @@
|
||||
"use strict";
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[5861],{
|
||||
|
||||
/***/ 2573:
|
||||
/*!****************************************************************!*\
|
||||
!*** ./src/components/SelectEnvironment/index.tsx + 1 modules ***!
|
||||
\****************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ components_SelectEnvironment; }
|
||||
});
|
||||
|
||||
// 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/tooltip/index.js + 3 modules
|
||||
var tooltip = __webpack_require__(6848);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
||||
var input = __webpack_require__(1056);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/spin/index.js + 1 modules
|
||||
var spin = __webpack_require__(71418);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/empty/index.js + 3 modules
|
||||
var empty = __webpack_require__(64165);
|
||||
// EXTERNAL MODULE: ./node_modules/_classnames@2.3.2@classnames/index.js
|
||||
var _classnames_2_3_2_classnames = __webpack_require__(12124);
|
||||
var _classnames_2_3_2_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_3_2_classnames);
|
||||
;// CONCATENATED MODULE: ./src/components/SelectEnvironment/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var SelectEnvironmentmodules = ({"selectEnvironment":"selectEnvironment___LegvW","search":"search___ZMwsK","searchListWrap":"searchListWrap___iUv9S","searchList":"searchList___T1FBi","name":"name___t0Y2b","tag":"tag___ooWkq","searchListActive":"searchListActive___ahElk","spin":"spin___x2xMT","common":"common___ZhJvk","title":"title___p4_7m","tags":"tags___2fYZM","tagActive":"tagActive___tb54k","wrap":"wrap___I9ZtF","allList":"allList___h31KX","item":"item___PwiKQ","itemActive":"itemActive___JCEc6","line":"line___Qn6mz","apply":"apply___EhZKq","p1":"p1___LxfGu","p2":"p2___jiQhJ","list":"list___n7Ydz","items":"items___OB8qz","darklySelectEnvironment":"darklySelectEnvironment___K__cy"});
|
||||
// EXTERNAL MODULE: ./src/assets/images/noEnvData.png
|
||||
var noEnvData = __webpack_require__(36723);
|
||||
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
||||
var fetch = __webpack_require__(87101);
|
||||
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js
|
||||
var lodash = __webpack_require__(89392);
|
||||
;// CONCATENATED MODULE: ./src/components/SelectEnvironment/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 SelectEnvironment = ({
|
||||
className,
|
||||
dispatch,
|
||||
skin = "white",
|
||||
value = null,
|
||||
loading = false,
|
||||
data = [],
|
||||
otherData = [],
|
||||
tags = [],
|
||||
onChange = () => {
|
||||
},
|
||||
onSearchWord = () => {
|
||||
},
|
||||
shixun_type,
|
||||
extraContent,
|
||||
tab_type,
|
||||
is_create_mirror,
|
||||
hiddenCreateOnline
|
||||
}) => {
|
||||
const [inputValue, setInputValue] = (0,_react_17_0_2_react.useState)("");
|
||||
const [visible, setVisible] = (0,_react_17_0_2_react.useState)(false);
|
||||
const [options, setOptions] = (0,_react_17_0_2_react.useState)([]);
|
||||
const [listActiveIndex, setListActiveIndex] = (0,_react_17_0_2_react.useState)(0);
|
||||
const timer = (0,_react_17_0_2_react.useRef)(null);
|
||||
const quId = (0,_react_17_0_2_react.useRef)(String(Math.floor(Math.random() * 1e6))).current;
|
||||
const inputRef = (0,_react_17_0_2_react.useRef)();
|
||||
const timerSearch = (0,_react_17_0_2_react.useRef)(null);
|
||||
const endCount = (0,_react_17_0_2_react.useRef)(0);
|
||||
const optionsSave = (0,_react_17_0_2_react.useRef)([]);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
window.addEventListener("keydown", handleKeyDown);
|
||||
return () => {
|
||||
window.removeEventListener("keydown", handleKeyDown);
|
||||
};
|
||||
}, [inputValue, visible, options]);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
setOptions([]);
|
||||
}, [tab_type]);
|
||||
const handleKeyDown = (e) => {
|
||||
if (!visible || e.keyCode !== 40 && e.keyCode !== 38) {
|
||||
return;
|
||||
}
|
||||
let activeIndex = 0;
|
||||
if (e.keyCode === 40 && visible) {
|
||||
if (listActiveIndex < options.length - 1) {
|
||||
activeIndex = listActiveIndex + 1;
|
||||
} else {
|
||||
activeIndex = 0;
|
||||
}
|
||||
console.log("\u4E0B");
|
||||
searchFuc(activeIndex, "down");
|
||||
}
|
||||
if (e.keyCode === 38 && visible) {
|
||||
if (listActiveIndex === 0) {
|
||||
activeIndex = options.length - 1;
|
||||
} else {
|
||||
activeIndex = listActiveIndex - 1;
|
||||
}
|
||||
searchFuc(activeIndex, "up");
|
||||
}
|
||||
setListActiveIndex(activeIndex);
|
||||
optionsInit(inputValue, activeIndex, true);
|
||||
};
|
||||
const heightLight = (string, keyword) => {
|
||||
const regTrim = (s) => {
|
||||
var imp = /[\^\.\\\|\(\)\*\+\-\$\[\]\?]/g;
|
||||
var imp_c = {};
|
||||
imp_c["^"] = "\\^";
|
||||
imp_c["."] = "\\.";
|
||||
imp_c["\\"] = "\\\\";
|
||||
imp_c["|"] = "\\|";
|
||||
imp_c["("] = "\\(";
|
||||
imp_c[")"] = "\\)";
|
||||
imp_c["*"] = "\\*";
|
||||
imp_c["+"] = "\\+";
|
||||
imp_c["-"] = "\\-";
|
||||
imp_c["$"] = "$";
|
||||
imp_c["["] = "\\[";
|
||||
imp_c["]"] = "\\]";
|
||||
imp_c["?"] = "\\?";
|
||||
s = s.replace(imp, function(o) {
|
||||
return imp_c[o];
|
||||
});
|
||||
return s;
|
||||
};
|
||||
var reg = new RegExp(regTrim(keyword), "gi");
|
||||
string = string.replace(reg, function(txt) {
|
||||
return "<span style='color:#0152d9;'>" + txt + "</span>";
|
||||
});
|
||||
return string;
|
||||
};
|
||||
const optionsInit = (searchText, activeList, move) => __async(void 0, null, function* () {
|
||||
let count = endCount.current + 1;
|
||||
endCount.current = count;
|
||||
const listDom = (list) => {
|
||||
const newItems = list == null ? void 0 : list.map((er, index) => {
|
||||
const { id, name } = er;
|
||||
const param = __spreadProps(__spreadValues({}, er), {
|
||||
label: /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"ul",
|
||||
{
|
||||
id: `search-${quId}-${index}`,
|
||||
onClick: () => onSelect(id, param),
|
||||
className: index === activeList ? SelectEnvironmentmodules.searchListActive : SelectEnvironmentmodules.searchList
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("li", { className: SelectEnvironmentmodules.name, dangerouslySetInnerHTML: { __html: heightLight(name, searchText) } }),
|
||||
er.private && /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u8BE5\u955C\u50CF\u9762\u5411\u6307\u5B9A\u7528\u6237\u5F00\u653E" }, /* @__PURE__ */ _react_17_0_2_react.createElement("li", { className: SelectEnvironmentmodules.tag, style: { color: "#FF9D18", border: "1px solid #FFCF8D", fontSize: 10 } }, "\u9650\u5B9A")),
|
||||
er.is_base && /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u4EC5\u63D0\u4F9B\u4E00\u4E2A\u57FA\u672C\u7684\u64CD\u4F5C\u7CFB\u7EDF\u73AF\u5883" }, /* @__PURE__ */ _react_17_0_2_react.createElement("li", { className: SelectEnvironmentmodules.tag, style: { color: "#165DFF", border: "1px solid #BACFFE", fontSize: 10 } }, "\u57FA\u7840"))
|
||||
)
|
||||
});
|
||||
return param;
|
||||
});
|
||||
return newItems;
|
||||
};
|
||||
if (move) {
|
||||
const newItems = listDom(optionsSave.current);
|
||||
setOptions(newItems);
|
||||
return;
|
||||
}
|
||||
clearTimeout(timerSearch.current);
|
||||
timerSearch.current = setTimeout(() => __async(void 0, null, function* () {
|
||||
var _a, _b;
|
||||
const params = {
|
||||
keywords: encodeURIComponent(searchText || ""),
|
||||
page: 1,
|
||||
limit: 1e5,
|
||||
tab_type
|
||||
};
|
||||
shixun_type ? params["shixun_type"] = shixun_type : "";
|
||||
const res = yield (0,fetch/* default */.ZP)(`/api/shixuns/search_image.json`, {
|
||||
method: "get",
|
||||
params: __spreadProps(__spreadValues({}, params), { is_create_mirror })
|
||||
});
|
||||
if ((res == null ? void 0 : res.status) === 0) {
|
||||
const newItems = listDom(((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.mirrors) || []);
|
||||
if (count === endCount.current) {
|
||||
setOptions(newItems);
|
||||
optionsSave.current = (0,lodash.cloneDeep)(((_b = res == null ? void 0 : res.data) == null ? void 0 : _b.mirrors) || []);
|
||||
}
|
||||
}
|
||||
}), 300);
|
||||
});
|
||||
const scrollFuc = (id) => {
|
||||
const itemDom = document.getElementById(`scroll-${quId}-${id}`);
|
||||
if (!itemDom)
|
||||
return;
|
||||
const wrapDom = document.getElementById(`scroll-${quId}`);
|
||||
wrapDom.scrollTo(0, itemDom.offsetTop);
|
||||
};
|
||||
const searchFuc = (index, direction) => {
|
||||
const itemDom = document.getElementById(`search-${quId}-${index}`);
|
||||
if (!itemDom)
|
||||
return;
|
||||
const wrapDom = document.getElementById(`search-${quId}`);
|
||||
const isClient = itemDom.offsetTop - wrapDom.scrollTop > 0 && itemDom.offsetTop - wrapDom.scrollTop < wrapDom.clientHeight;
|
||||
if (isClient)
|
||||
return;
|
||||
if (direction === "down") {
|
||||
wrapDom.scrollTo(0, itemDom.offsetTop - wrapDom.clientHeight + itemDom.clientHeight);
|
||||
} else {
|
||||
wrapDom.scrollTo(0, itemDom.offsetTop);
|
||||
}
|
||||
};
|
||||
const onSearch = (searchText) => {
|
||||
optionsInit(searchText, 0);
|
||||
};
|
||||
const handlePressEnter = (v) => {
|
||||
var _a;
|
||||
if (!options.length)
|
||||
return;
|
||||
const realId = (_a = options == null ? void 0 : options[listActiveIndex]) == null ? void 0 : _a.id;
|
||||
onChange(realId);
|
||||
setOptions([]);
|
||||
setListActiveIndex(0);
|
||||
scrollFuc(realId);
|
||||
inputRef.current.blur();
|
||||
};
|
||||
const onSelect = (id, option) => {
|
||||
onChange(id);
|
||||
setOptions([]);
|
||||
setListActiveIndex(0);
|
||||
scrollFuc(id);
|
||||
};
|
||||
const clear = () => {
|
||||
setOptions([]);
|
||||
setInputValue("");
|
||||
onSearchWord("");
|
||||
};
|
||||
const activeClear = (id) => {
|
||||
onChange(id);
|
||||
setOptions([]);
|
||||
};
|
||||
const renderIcon = () => {
|
||||
if (inputValue === "") {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("i", { style: { pointerEvents: "none" }, className: "iconfont icon-sousuo2 c-grey-c" });
|
||||
}
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("i", { onClick: (e) => {
|
||||
e.stopPropagation();
|
||||
clear();
|
||||
}, className: "iconfont icon-shanchu4 c-grey-c" });
|
||||
};
|
||||
const handleApply = () => {
|
||||
dispatch({
|
||||
type: "newShixuns/setActionTabs",
|
||||
payload: { key: "NewShixuns-Apply" }
|
||||
});
|
||||
};
|
||||
const CreateImg = () => {
|
||||
dispatch({
|
||||
type: "newShixuns/setActionTabs",
|
||||
payload: { key: "Create-Environment" }
|
||||
});
|
||||
};
|
||||
const onBlur = () => {
|
||||
timer.current = setTimeout(() => {
|
||||
setVisible(false);
|
||||
setListActiveIndex(0);
|
||||
}, 200);
|
||||
};
|
||||
const isEmpty = !(data == null ? void 0 : data.length) && !(otherData == null ? void 0 : otherData.length);
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: _classnames_2_3_2_classnames_default()(skin === "night" ? SelectEnvironmentmodules.darklySelectEnvironment : SelectEnvironmentmodules.selectEnvironment, className) }, extraContent && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { marginTop: 20, marginLeft: 20 } }, extraContent), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: SelectEnvironmentmodules.search }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
input["default"],
|
||||
{
|
||||
suffix: renderIcon(),
|
||||
bordered: false,
|
||||
ref: inputRef,
|
||||
value: inputValue,
|
||||
onKeyDown: (e) => {
|
||||
if (e.keyCode === 40 || e.keyCode === 38 || e.keyCode === 13) {
|
||||
e.preventDefault();
|
||||
}
|
||||
},
|
||||
size: "middle",
|
||||
onFocus: () => {
|
||||
clearTimeout(timer.current);
|
||||
if (inputValue) {
|
||||
onSearch(inputValue);
|
||||
}
|
||||
setVisible(true);
|
||||
},
|
||||
onBlur,
|
||||
onChange: (e) => {
|
||||
setInputValue(e.target.value);
|
||||
if (e.target.value) {
|
||||
onSearch(e.target.value);
|
||||
}
|
||||
onSearchWord(e.target.value);
|
||||
},
|
||||
placeholder: "\u641C\u7D22\u60A8\u9700\u8981\u7684\u5B9E\u9A8C\u73AF\u5883",
|
||||
onPressEnter: handlePressEnter
|
||||
}
|
||||
), visible && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { id: `search-${quId}`, className: SelectEnvironmentmodules.searchListWrap }, options.map((e, i) => /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, { key: i }, " ", e.label)))), loading ? /* @__PURE__ */ _react_17_0_2_react.createElement(spin/* default */.Z, { className: SelectEnvironmentmodules.spin }) : /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, !!tags.length && /* @__PURE__ */ _react_17_0_2_react.createElement("aside", { className: SelectEnvironmentmodules.common }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: SelectEnvironmentmodules.title }, "\u63A8\u8350\u73AF\u5883:"), /* @__PURE__ */ _react_17_0_2_react.createElement("ul", { className: SelectEnvironmentmodules.tags }, tags.map((e, i) => /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"li",
|
||||
{
|
||||
key: i,
|
||||
onClick: () => activeClear(e.id),
|
||||
className: value === e.id ? `${SelectEnvironmentmodules.tag} ${SelectEnvironmentmodules.tagActive}` : SelectEnvironmentmodules.tag
|
||||
},
|
||||
e.name
|
||||
)))), isEmpty && /* @__PURE__ */ _react_17_0_2_react.createElement(empty/* default */.Z, { style: { margin: "60px 0" }, image: noEnvData, description: /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-grey-999" }, "\u6682\u65E0\u5B9E\u9A8C\u73AF\u5883") }), /* @__PURE__ */ _react_17_0_2_react.createElement("aside", { className: SelectEnvironmentmodules.wrap, id: `scroll-${quId}` }, data.map((item, i) => {
|
||||
var _a;
|
||||
return !!((_a = item == null ? void 0 : item.image) == null ? void 0 : _a.length) ? /* @__PURE__ */ _react_17_0_2_react.createElement(List, { key: i, data: item, id: value, handleClick: (id) => activeClear(id) }) : null;
|
||||
}), /* @__PURE__ */ _react_17_0_2_react.createElement("ul", { className: SelectEnvironmentmodules.allList }, otherData.map((item) => /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"li",
|
||||
{
|
||||
key: `key-${item.id}`,
|
||||
id: `scroll-${quId}-${item.id}`,
|
||||
className: item.id === value ? `${SelectEnvironmentmodules.item} ${SelectEnvironmentmodules.itemActive}` : SelectEnvironmentmodules.item,
|
||||
onClick: () => onChange(item.id)
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: SelectEnvironmentmodules.name }, item.name),
|
||||
item.private && /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u8BE5\u955C\u50CF\u9762\u5411\u6307\u5B9A\u7528\u6237\u5F00\u653E" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: SelectEnvironmentmodules.tag, style: { color: "#FF9D18", border: "1px solid #FFCF8D", fontSize: 10 } }, "\u9650\u5B9A")),
|
||||
item.is_base && /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u4EC5\u63D0\u4F9B\u4E00\u4E2A\u57FA\u672C\u7684\u64CD\u4F5C\u7CFB\u7EDF\u73AF\u5883" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: SelectEnvironmentmodules.tag, style: { color: "#165DFF", border: "1px solid #BACFFE", fontSize: 10 } }, "\u57FA\u7840"))
|
||||
))))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: SelectEnvironmentmodules.apply }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: SelectEnvironmentmodules.p1 }, "\u6CA1\u6709\u5B9E\u9A8C\u73AF\u5883\uFF1F"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: SelectEnvironmentmodules.p2, onClick: handleApply }, " \u7533\u8BF7\u65B0\u5EFA"), !hiddenCreateOnline && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: SelectEnvironmentmodules.p2, onClick: CreateImg }, " \u5728\u7EBF\u521B\u5EFA")));
|
||||
};
|
||||
const List = ({
|
||||
data,
|
||||
id,
|
||||
handleClick
|
||||
}) => {
|
||||
const [drop, setDrop] = (0,_react_17_0_2_react.useState)(true);
|
||||
const { name, image } = data;
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: SelectEnvironmentmodules.list }, /* @__PURE__ */ _react_17_0_2_react.createElement("header", { onClick: () => setDrop(!drop) }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: SelectEnvironmentmodules.title }, name), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"i",
|
||||
{
|
||||
style: { transition: "0.5s", transform: drop ? "rotate(0deg)" : "rotate(180deg)" },
|
||||
className: "iconfont icon-shangjiantou c-grey-999"
|
||||
}
|
||||
)), /* @__PURE__ */ _react_17_0_2_react.createElement("ul", { className: SelectEnvironmentmodules.items, style: { height: drop ? "auto" : 0 } }, image.map((item) => /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"li",
|
||||
{
|
||||
key: item.id,
|
||||
className: item.id === id ? `${SelectEnvironmentmodules.item} ${SelectEnvironmentmodules.itemActive}` : SelectEnvironmentmodules.item,
|
||||
onClick: () => handleClick(item.id)
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: SelectEnvironmentmodules.name }, item.name),
|
||||
item.private && /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u8BE5\u955C\u50CF\u9762\u5411\u6307\u5B9A\u7528\u6237\u5F00\u653E" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: SelectEnvironmentmodules.tag, style: { color: "#FF9D18", border: "1px solid #FFCF8D", fontSize: 10 } }, "\u9650\u5B9A")),
|
||||
item.is_base && /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u4EC5\u63D0\u4F9B\u4E00\u4E2A\u57FA\u672C\u7684\u64CD\u4F5C\u7CFB\u7EDF\u73AF\u5883" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: SelectEnvironmentmodules.tag, style: { color: "#165DFF", border: "1px solid #BACFFE", fontSize: 10 } }, "\u57FA\u7840"))
|
||||
)), /* @__PURE__ */ _react_17_0_2_react.createElement("li", { className: SelectEnvironmentmodules.line })));
|
||||
};
|
||||
/* harmony default export */ var components_SelectEnvironment = (SelectEnvironment);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 14606:
|
||||
/*!***************************************************************************!*\
|
||||
!*** ./src/pages/Shixuns/New/components/ApplyModal/index.tsx + 1 modules ***!
|
||||
\***************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ components_ApplyModal; }
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
||||
var _react_17_0_2_react = __webpack_require__(59301);
|
||||
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 14 modules
|
||||
var _umi_production_exports = __webpack_require__(87210);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
||||
var input = __webpack_require__(1056);
|
||||
// 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/message/index.js + 4 modules
|
||||
var message = __webpack_require__(8591);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/upload/index.js + 24 modules
|
||||
var upload = __webpack_require__(6557);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
||||
var es_button = __webpack_require__(3113);
|
||||
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
||||
var env = __webpack_require__(64741);
|
||||
// EXTERNAL MODULE: ./src/assets/images/qrCode.png
|
||||
var qrCode = __webpack_require__(55351);
|
||||
;// CONCATENATED MODULE: ./src/pages/Shixuns/New/components/ApplyModal/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var ApplyModalmodules = ({"flexRow":"flexRow___JBN3B","flexColumn":"flexColumn___zXgFj","formWrap":"formWrap___aNgan","upload":"upload___yGdLQ","color0152d9":"color0152d9___zzEpS","colorCCC":"colorCCC___k4Dxq","footerWrap":"footerWrap___WrUZd","qrCode":"qrCode___GPwSg","a1":"a1___R6etl","code":"code___fCL_L","group":"group___n7tgy","groupNumber":"groupNumber___tw7hA","a2":"a2___GGjDE"});
|
||||
;// CONCATENATED MODULE: ./src/pages/Shixuns/New/components/ApplyModal/index.tsx
|
||||
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
||||
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 TextArea = input["default"].TextArea;
|
||||
const ApplyModal = (_a) => {
|
||||
var _b = _a, {
|
||||
newShixuns,
|
||||
globalSetting,
|
||||
loading,
|
||||
dispatch
|
||||
} = _b, props = __objRest(_b, [
|
||||
"newShixuns",
|
||||
"globalSetting",
|
||||
"loading",
|
||||
"dispatch"
|
||||
]);
|
||||
const [form] = es_form["default"].useForm();
|
||||
const [fileList, setFileList] = (0,_react_17_0_2_react.useState)([]);
|
||||
const handleFileChange = (info) => {
|
||||
const statusList = ["uploading", "done", "removed"];
|
||||
if (statusList.includes(info.file.status)) {
|
||||
setFileList(info.fileList);
|
||||
}
|
||||
};
|
||||
const handleFileRemove = (file) => {
|
||||
var _a2;
|
||||
if (!file.percent || file.percent == 100) {
|
||||
const id = (_a2 = file.response) == null ? void 0 : _a2.id;
|
||||
modal["default"].confirm({
|
||||
centered: true,
|
||||
title: "\u786E\u5B9A\u8981\u5220\u9664\u8FD9\u4E2A\u9644\u4EF6\u5417?",
|
||||
okText: "\u786E\u5B9A",
|
||||
cancelText: "\u53D6\u6D88",
|
||||
onOk: () => __async(void 0, null, function* () {
|
||||
const res = yield dispatch({
|
||||
type: "newShixuns/deleteAttachment",
|
||||
payload: { id }
|
||||
});
|
||||
res && setFileList(fileList.filter((item) => {
|
||||
var _a3;
|
||||
return ((_a3 = item.response) == null ? void 0 : _a3.id) !== id;
|
||||
}));
|
||||
})
|
||||
});
|
||||
return false;
|
||||
}
|
||||
};
|
||||
const handleFileBeforeUpload = (file) => {
|
||||
if (fileList.length) {
|
||||
return false;
|
||||
}
|
||||
const is150M = file.size / 1024 / 1024 > 50;
|
||||
if (is150M) {
|
||||
message/* default */.ZP.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E50MB");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
const handleFinish = (values) => __async(void 0, null, function* () {
|
||||
var _a2, _b2;
|
||||
const { language, env: runtime, mode: run_method, code } = values || {};
|
||||
const res = yield dispatch({
|
||||
type: "newShixuns/applyShixunMirror",
|
||||
payload: {
|
||||
language,
|
||||
runtime,
|
||||
run_method,
|
||||
attachment_id: (_b2 = (_a2 = fileList == null ? void 0 : fileList[0]) == null ? void 0 : _a2.response) == null ? void 0 : _b2.id
|
||||
}
|
||||
});
|
||||
dispatch({
|
||||
type: "newShixuns/setActionTabs",
|
||||
payload: {}
|
||||
});
|
||||
if (res) {
|
||||
message/* default */.ZP.success("\u65B0\u5EFA\u7533\u8BF7\u5DF2\u63D0\u4EA4\uFF0C\u8BF7\u7B49\u5F85\u7BA1\u7406\u5458\u5BA1\u6838\u3002");
|
||||
}
|
||||
});
|
||||
const handleAfterClose = () => {
|
||||
form.resetFields();
|
||||
setFileList([]);
|
||||
};
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
modal["default"],
|
||||
{
|
||||
centered: true,
|
||||
keyboard: false,
|
||||
closable: false,
|
||||
destroyOnClose: true,
|
||||
open: newShixuns.actionTabs.key === "NewShixuns-Apply",
|
||||
title: "\u7533\u8BF7\u65B0\u5EFA",
|
||||
width: "1000px",
|
||||
footer: null,
|
||||
afterClose: handleAfterClose
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: ApplyModalmodules.qrCode }, /* @__PURE__ */ _react_17_0_2_react.createElement("aside", { className: ApplyModalmodules.a1 }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ApplyModalmodules.code }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { width: 120, height: 120, src: qrCode, alt: "\u4E8C\u7EF4\u7801" })), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ApplyModalmodules.group }, "\u5B9E\u9A8C\u73AF\u5883\u7533\u8BF7QQ\u7FA4"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ApplyModalmodules.groupNumber }, "\u7FA4\u53F7\uFF1A740157011")), /* @__PURE__ */ _react_17_0_2_react.createElement("aside", { className: ApplyModalmodules.a2 }, "\u5C0A\u656C\u7684\u8001\u5E08/\u540C\u5B66\u60A8\u597D\uFF0C", /* @__PURE__ */ _react_17_0_2_react.createElement("br", null), "\u5982\u679C\u60A8\u60F3\u65B0\u5EFA\u5B9E\u9A8C\u73AF\u5883\uFF0C\u53EF\u4EE5\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801\u8FDB\u7FA4\uFF0C\u76F4\u63A5\u5411\u6211\u4EEC\u7684\u5DE5\u4F5C\u4EBA\u5458\u7533\u8BF7\u54E6~ \u4E5F\u53EF\u4EE5\u63D0\u4EA4\u4E0B\u9762\u7684\u8868\u5355\u7533\u8BF7\uFF0C\u6211\u4EEC\u7684\u5DE5\u4F5C\u4EBA\u5458\u6536\u5230\u7533\u8BF7\u4FE1\u606F\u5C06\u4F1A\u7B2C\u4E00\u65F6\u95F4\u8054\u7CFB\u60A8\uFF01")),
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_form["default"],
|
||||
{
|
||||
className: ApplyModalmodules.formWrap,
|
||||
form,
|
||||
labelCol: { span: 4 },
|
||||
wrapperCol: { span: 20 },
|
||||
onFinish: handleFinish
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u8BED\u8A00\uFF1A", name: "language", rules: [{ required: true, message: "\u8BF7\u586B\u5199\u8BE5\u955C\u50CF\u8BED\u8A00" }] }, /* @__PURE__ */ _react_17_0_2_react.createElement(TextArea, { placeholder: "\u8BF7\u586B\u5199\u8BE5\u955C\u50CF\u662F\u57FA\u4E8E\u4EC0\u4E48\u8BED\u8A00\uFF1A\u793A\u4F8B\uFF1APython", rows: 4 })),
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u7CFB\u7EDF\u73AF\u5883\uFF1A", name: "env", rules: [{ required: true, message: "\u8BF7\u586B\u5199\u8BE5\u955C\u50CF\u8BED\u8A00\u7CFB\u7EDF\u73AF\u5883" }] }, /* @__PURE__ */ _react_17_0_2_react.createElement(TextArea, { placeholder: "\u8BF7\u586B\u5199\u8BE5\u955C\u50CF\u662F\u57FA\u4E8E\u4EC0\u4E48linux\u7CFB\u7EDF\u73AF\u5883,\u4EE3\u7801\u8FD0\u884C\u73AF\u5883", rows: 4 })),
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u6D4B\u8BD5\u4EE3\u7801\u8FD0\u884C\u65B9\u5F0F\uFF1A", name: "mode", rules: [{ required: true, message: "\u8BF7\u586B\u5199\u8BE5\u955C\u50CF\u6D4B\u8BD5\u4EE3\u7801\u8FD0\u884C\u65B9\u5F0F" }] }, /* @__PURE__ */ _react_17_0_2_react.createElement(TextArea, { placeholder: "\u8BF7\u586B\u5199\u8BE5\u955C\u50CF\u4E2D\u6D4B\u8BD5\u4EE3\u7801\u8FD0\u884C\u65B9\u5F0F", rows: 4 })),
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u6D4B\u8BD5\u4EE3\u7801\uFF1A", name: "code", rules: [{ required: true, message: "\u8BF7\u4E0A\u4F20\u9644\u4EF6" }] }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ApplyModalmodules.upload }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
upload["default"],
|
||||
{
|
||||
fileList,
|
||||
action: `${env/* default */.Z.API_SERVER}/api/attachments.json?client_key=6d57f8c3dd186c5ada392546ace9620a`,
|
||||
onChange: handleFileChange,
|
||||
onRemove: handleFileRemove,
|
||||
beforeUpload: handleFileBeforeUpload,
|
||||
withCredentials: true
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: `${ApplyModalmodules.color0152d9} current` }, "\u4E0A\u4F20\u9644\u4EF6"),
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: `${ApplyModalmodules.colorCCC} ml10` }, "(\u5355\u4E2A\u6587\u4EF650M\u4EE5\u5185)")
|
||||
))),
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ApplyModalmodules.footerWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_button/* default */.ZP,
|
||||
{
|
||||
className: "mr5",
|
||||
size: "middle",
|
||||
onClick: () => {
|
||||
dispatch({
|
||||
type: "newShixuns/setActionTabs",
|
||||
payload: {}
|
||||
});
|
||||
}
|
||||
},
|
||||
"\u53D6\u6D88"
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { size: "middle", type: "primary", htmlType: "submit", loading: loading["newShixuns/applyShixunMirror"] }, "\u4FDD\u5B58")))
|
||||
)
|
||||
);
|
||||
};
|
||||
/* harmony default export */ var components_ApplyModal = ((0,_umi_production_exports.connect)(
|
||||
({
|
||||
newShixuns,
|
||||
loading,
|
||||
globalSetting
|
||||
}) => ({
|
||||
newShixuns,
|
||||
globalSetting,
|
||||
loading: loading.effects
|
||||
})
|
||||
)(ApplyModal));
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 92381:
|
||||
/*!**********************************************************************!*\
|
||||
!*** ./src/pages/Shixuns/New/components/CreateEnvironment/index.tsx ***!
|
||||
\**********************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
||||
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! umi */ 87210);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! antd */ 43418);
|
||||
/* harmony import */ var _assets_images_qrCode_png__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/assets/images/qrCode.png */ 55351);
|
||||
|
||||
|
||||
|
||||
|
||||
const CreateEnvironment = ({
|
||||
newShixuns,
|
||||
dispatch,
|
||||
user
|
||||
}) => {
|
||||
var _a;
|
||||
const [isCreateModel, setIsCreateModel] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
||||
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
||||
if (newShixuns.actionTabs.key === "Create-Environment") {
|
||||
createImg();
|
||||
}
|
||||
}, [(_a = newShixuns == null ? void 0 : newShixuns.actionTabs) == null ? void 0 : _a.key]);
|
||||
const cancelImg = () => {
|
||||
dispatch({
|
||||
type: "newShixuns/setActionTabs",
|
||||
payload: {}
|
||||
});
|
||||
};
|
||||
const createImg = () => {
|
||||
var _a2, _b, _c, _d;
|
||||
cancelImg();
|
||||
if (((_a2 = user.userInfo) == null ? void 0 : _a2.mirror_marker_status) === 0) {
|
||||
setIsCreateModel(true);
|
||||
} else if (((_b = user.userInfo) == null ? void 0 : _b.mirror_marker_status) === 1) {
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(`/users/${(_c = user.userInfo) == null ? void 0 : _c.login}/experiment-img/add`);
|
||||
} else if (((_d = user.userInfo) == null ? void 0 : _d.mirror_marker_status) === 2) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_3__["default"].confirm({
|
||||
title: "\u60A8\u4ECA\u65E5\u5DF2\u8FBE\u5230\u7533\u8BF7\u4E0A\u9650\uFF0C\u662F\u5426\u8DF3\u8F6C\u81F3\u4E91\u4E3B\u673A\u5217\u8868\uFF1F",
|
||||
content: "\u63D0\u793A\uFF1A\u6BCF\u5929\u6700\u591A\u5141\u8BB8\u7533\u8BF7\u4E00\u53F0\u4E91\u4E3B\u673A",
|
||||
okText: "\u8DF3\u8F6C",
|
||||
cancelText: "\u53D6\u6D88",
|
||||
onOk() {
|
||||
var _a3;
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(`/users/${(_a3 = user.userInfo) == null ? void 0 : _a3.login}/experiment-img`);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_3__["default"],
|
||||
{
|
||||
title: "\u52A0\u5165qq\u7FA4\u63D0\u793A",
|
||||
open: isCreateModel,
|
||||
footer: null,
|
||||
onCancel: () => {
|
||||
setIsCreateModel(false);
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { style: { textAlign: "center" } }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("br", null), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("img", { width: 120, height: 120, style: { marginTop: "20px" }, src: _assets_images_qrCode_png__WEBPACK_IMPORTED_MODULE_2__, alt: "\u4E8C\u7EF4\u7801" })),
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("img", null)
|
||||
);
|
||||
};
|
||||
/* harmony default export */ __webpack_exports__.Z = ((0,umi__WEBPACK_IMPORTED_MODULE_1__.connect)(
|
||||
({
|
||||
newShixuns,
|
||||
user,
|
||||
globalSetting
|
||||
}) => ({
|
||||
newShixuns,
|
||||
globalSetting,
|
||||
user
|
||||
})
|
||||
)(CreateEnvironment));
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
@ -0,0 +1,794 @@
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[607],{
|
||||
|
||||
/***/ 6064:
|
||||
/*!*********************************************!*\
|
||||
!*** ./src/components/UploadFile/index.tsx ***!
|
||||
\*********************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ cT: function() { return /* binding */ uploadFile; },
|
||||
/* harmony export */ pe: function() { return /* binding */ decrypt; }
|
||||
/* harmony export */ });
|
||||
/* unused harmony exports reNameFile, UploadFile */
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ 6557);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! antd */ 8591);
|
||||
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/utils/fetch */ 87101);
|
||||
/* harmony import */ var crypto_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! crypto-js */ 28209);
|
||||
/* harmony import */ var crypto_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(crypto_js__WEBPACK_IMPORTED_MODULE_2__);
|
||||
/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! uuid */ 1012);
|
||||
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! umi */ 87210);
|
||||
/* harmony import */ var ali_oss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ali-oss */ 47257);
|
||||
/* harmony import */ var ali_oss__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(ali_oss__WEBPACK_IMPORTED_MODULE_5__);
|
||||
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 { Dragger } = antd__WEBPACK_IMPORTED_MODULE_4__["default"];
|
||||
|
||||
const decrypt = (word) => {
|
||||
const ENC_KEY = "bf3c199c2470cb477d907b1e0917c17b";
|
||||
const IV = "5183666c72eec9e4";
|
||||
var key = crypto_js__WEBPACK_IMPORTED_MODULE_2___default().enc.Utf8.parse(ENC_KEY);
|
||||
let iv = crypto_js__WEBPACK_IMPORTED_MODULE_2___default().enc.Utf8.parse(IV);
|
||||
var decrypt2 = crypto_js__WEBPACK_IMPORTED_MODULE_2___default().AES.decrypt(word, key, {
|
||||
iv,
|
||||
mode: (crypto_js__WEBPACK_IMPORTED_MODULE_2___default().mode).CBC
|
||||
// padding: CryptoJS.pad.ZeroPadding
|
||||
});
|
||||
return decrypt2.toString((crypto_js__WEBPACK_IMPORTED_MODULE_2___default().enc).Utf8);
|
||||
};
|
||||
let tempCheckpoint;
|
||||
const reNameFile = (_0) => __async(void 0, [_0], function* ({ identifier, oldFilename, newFilename }) {
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
const res = yield Fetch("/api/buckets/get_upload_token_for_big_files.json", { method: "get" });
|
||||
res.data = JSON.parse(decrypt(res.data));
|
||||
const client = new OSS({
|
||||
endpoint: (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.end_point,
|
||||
region: (_b = res == null ? void 0 : res.data) == null ? void 0 : _b.region,
|
||||
accessKeyId: (_c = res == null ? void 0 : res.data) == null ? void 0 : _c.access_key_id,
|
||||
accessKeySecret: (_d = res == null ? void 0 : res.data) == null ? void 0 : _d.access_key_secret,
|
||||
bucket: (_e = res == null ? void 0 : res.data) == null ? void 0 : _e.bucket,
|
||||
stsToken: (_f = res == null ? void 0 : res.data) == null ? void 0 : _f.security_token
|
||||
});
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log(11111, `${identifier}/${oldFilename}`, `${identifier}/${newFilename}`, res.data);
|
||||
client.copy(`/${identifier}/${oldFilename}`, `/${identifier}/${newFilename}`).then((r) => {
|
||||
console.log("\u62F7\u8D1D\u6210\u529F", r);
|
||||
}).catch((e) => {
|
||||
console.log(e);
|
||||
});
|
||||
});
|
||||
});
|
||||
const uploadFile = (file, obj, config) => __async(void 0, null, function* () {
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
obj.file_name = file.name;
|
||||
const res = yield (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP)("/api/buckets/get_upload_token.json", { method: "get" });
|
||||
console.log("decrypt(res.data):", decrypt(res.data));
|
||||
res.data = JSON.parse(decrypt(res.data));
|
||||
const namearrs = file.name.split(".");
|
||||
namearrs.pop();
|
||||
const name = obj.realFileName ? namearrs.join("") : (0,uuid__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)();
|
||||
const client = new (ali_oss__WEBPACK_IMPORTED_MODULE_5___default())({
|
||||
endpoint: (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.end_point,
|
||||
region: (_b = res == null ? void 0 : res.data) == null ? void 0 : _b.region,
|
||||
accessKeyId: (_c = res == null ? void 0 : res.data) == null ? void 0 : _c.access_key_id,
|
||||
accessKeySecret: (_d = res == null ? void 0 : res.data) == null ? void 0 : _d.access_key_secret,
|
||||
bucket: (_e = res == null ? void 0 : res.data) == null ? void 0 : _e.bucket,
|
||||
stsToken: (_f = res == null ? void 0 : res.data) == null ? void 0 : _f.security_token
|
||||
});
|
||||
return new Promise((resolve, reject) => {
|
||||
var _a2;
|
||||
client.multipartUpload(`${name}`, new Blob([file], { type: file.type }), __spreadProps(__spreadValues({
|
||||
timeout: 200 * 1e3,
|
||||
partSize: 102400
|
||||
}, config), {
|
||||
callback: {
|
||||
url: (_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.callback_url,
|
||||
host: res == null ? void 0 : res.data.bucket_host,
|
||||
body: "bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&" + (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_1__/* .parseParams */ .rz)(obj)
|
||||
// body: 'bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&login=' + obj.login + '&container_id=' + obj.container_id + '&container_type='+obj.container_type,
|
||||
}
|
||||
})).then(function(result) {
|
||||
var _a3;
|
||||
file.response = (_a3 = result.data) == null ? void 0 : _a3.data;
|
||||
resolve(result == null ? void 0 : result.data);
|
||||
}).catch(function(err) {
|
||||
reject(err);
|
||||
console.log("err:", err);
|
||||
});
|
||||
});
|
||||
});
|
||||
const UploadFile = (_a) => {
|
||||
var _b = _a, { user, cancelUpload } = _b, props = __objRest(_b, ["user", "cancelUpload"]);
|
||||
const [fileList, setFileList] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
|
||||
let [client, setClient] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
|
||||
const _props = {
|
||||
onRemove: (e) => {
|
||||
setFileList([...fileList.filter((item) => item.name !== e.name)]);
|
||||
props.onChange(fileList.filter((item) => item.name !== e.name));
|
||||
},
|
||||
disabled: props.disabled,
|
||||
multiple: true,
|
||||
fileList: fileList == null ? void 0 : fileList.map((item) => item.file),
|
||||
customRequest: () => {
|
||||
},
|
||||
beforeUpload: (file) => __async(void 0, null, function* () {
|
||||
let fileSize = props.maxSize || 1024 * 1024 * 1024 * 1;
|
||||
if (!!fileList.filter((item) => item.name === file.name).length) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP.info(`${file.name}\u5DF2\u5B58\u5728\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9`);
|
||||
return;
|
||||
}
|
||||
if ((file == null ? void 0 : file.size) > fileSize) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP.info(`\u6587\u4EF6\u8D85\u8FC7${fileSize / 1024 / 1024 / 1024}GB\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42`);
|
||||
return false;
|
||||
}
|
||||
fileList.push({ name: file.name, file });
|
||||
setFileList([...fileList]);
|
||||
props.onChange(fileList);
|
||||
return false;
|
||||
})
|
||||
};
|
||||
const _uploadFiles = (file, obj) => __async(void 0, null, function* () {
|
||||
var _a2, _b2, _c, _d, _e, _f;
|
||||
obj.file_name = file.name;
|
||||
const name = file.name;
|
||||
const res = yield (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP)("/api/buckets/get_upload_token_for_big_files.json", { method: "get" });
|
||||
res.data = JSON.parse(decrypt(res.data));
|
||||
if ((res == null ? void 0 : res.status) !== 0) {
|
||||
fileList[fileList.findIndex((item) => item.name === name)]["status"] = "error";
|
||||
fileList[fileList.findIndex((item) => item.name === name)]["file"]["status"] = "error";
|
||||
props.onChange(fileList);
|
||||
antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP.warning("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u5C1D\u8BD5");
|
||||
return;
|
||||
}
|
||||
client = new (ali_oss__WEBPACK_IMPORTED_MODULE_5___default())({
|
||||
endpoint: (_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.end_point,
|
||||
region: (_b2 = res == null ? void 0 : res.data) == null ? void 0 : _b2.region,
|
||||
accessKeyId: (_c = res == null ? void 0 : res.data) == null ? void 0 : _c.access_key_id,
|
||||
accessKeySecret: (_d = res == null ? void 0 : res.data) == null ? void 0 : _d.access_key_secret,
|
||||
bucket: (_e = res == null ? void 0 : res.data) == null ? void 0 : _e.bucket,
|
||||
stsToken: (_f = res == null ? void 0 : res.data) == null ? void 0 : _f.security_token
|
||||
});
|
||||
console.log(file, "file");
|
||||
setClient(client);
|
||||
const namearrs = file.name.split(".");
|
||||
namearrs.pop();
|
||||
const filename = obj.realFileName ? namearrs.join(".") : (0,uuid__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)();
|
||||
return new Promise((resolve, reject) => {
|
||||
var _a3;
|
||||
try {
|
||||
client.multipartUpload(`${props.identifier}/${filename}${name.indexOf(".") > -1 ? "." + name.split(".").pop() : ""}`, new Blob([file.file], { type: file.file.type }), {
|
||||
timeout: 3600 * 1e3,
|
||||
partSize: 1002400,
|
||||
progress: (p, checkpoint, res2) => {
|
||||
try {
|
||||
console.log("\u8FDB\u5EA6", p, checkpoint, res2);
|
||||
const index = fileList.findIndex((item) => item.name === name);
|
||||
fileList[index]["file"]["percent"] = p * 100;
|
||||
fileList[index].tempCheckpoint = checkpoint;
|
||||
setFileList([...fileList]);
|
||||
} catch (e) {
|
||||
}
|
||||
},
|
||||
checkpoint: fileList[fileList.findIndex((item) => item.name === name)].tempCheckpoint,
|
||||
callback: {
|
||||
customValue: {
|
||||
id: name + ""
|
||||
},
|
||||
url: (_a3 = res == null ? void 0 : res.data) == null ? void 0 : _a3.callback_url,
|
||||
host: res == null ? void 0 : res.data.bucket_host,
|
||||
body: "bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&" + (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_1__/* .parseParams */ .rz)(obj)
|
||||
}
|
||||
}).then(function(result) {
|
||||
var _a4, _b3, _c2;
|
||||
const index = fileList.findIndex((item) => item.name === name);
|
||||
let status = "done";
|
||||
if (((_a4 = result.data) == null ? void 0 : _a4.status) === 0) {
|
||||
file.response = (_b3 = result.data) == null ? void 0 : _b3.data;
|
||||
const index2 = fileList.findIndex((item) => item.name === name);
|
||||
fileList[index2]["status"] = "done";
|
||||
fileList[index2]["file"]["status"] = "done";
|
||||
} else {
|
||||
antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP.warning((_c2 = result.data) == null ? void 0 : _c2.message);
|
||||
status = "error";
|
||||
}
|
||||
fileList[index]["status"] = status;
|
||||
fileList[index]["file"]["status"] = status;
|
||||
props.onChange(fileList);
|
||||
resolve(result == null ? void 0 : result.data);
|
||||
}).catch(function(err) {
|
||||
fileList[fileList.findIndex((item) => item.name === name)]["status"] = "error";
|
||||
fileList[fileList.findIndex((item) => item.name === name)]["file"]["status"] = "error";
|
||||
antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP.warning("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u5C1D\u8BD5");
|
||||
setFileList([...fileList]);
|
||||
props.onChange(fileList);
|
||||
reject(err);
|
||||
console.log("err:", err);
|
||||
});
|
||||
} catch (e) {
|
||||
}
|
||||
});
|
||||
});
|
||||
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
||||
if (fileList.every((item) => item === "done" || item === "error")) {
|
||||
props.onComplete(fileList);
|
||||
}
|
||||
}, [fileList]);
|
||||
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
||||
if (cancelUpload) {
|
||||
client == null ? void 0 : client.cancel();
|
||||
}
|
||||
}, [cancelUpload]);
|
||||
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
||||
if (props.uploading)
|
||||
fileList.map((item) => __async(void 0, null, function* () {
|
||||
var _a2;
|
||||
if ((!item.status || item.status === "error") && !cancelUpload) {
|
||||
item.status = "uploading";
|
||||
item.file.status = "uploading";
|
||||
const res = yield _uploadFiles(item, {
|
||||
login: (_a2 = user == null ? void 0 : user.userInfo) == null ? void 0 : _a2.login,
|
||||
container_type: props.container_type,
|
||||
container_id: props.container_id,
|
||||
description: props.description,
|
||||
realFileName: props.realFileName
|
||||
});
|
||||
}
|
||||
}));
|
||||
}, [props.uploading]);
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
Dragger,
|
||||
__spreadProps(__spreadValues({}, _props), {
|
||||
height: props.height,
|
||||
className: props.className
|
||||
}),
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", { className: "ant-upload-hint" }, props.text || "\u62D6\u62FD\u6587\u4EF6\u6216\u8005\u70B9\u51FB\u4E0A\u4F20")
|
||||
);
|
||||
};
|
||||
/* harmony default export */ __webpack_exports__.ZP = ((0,umi__WEBPACK_IMPORTED_MODULE_3__.connect)(
|
||||
({
|
||||
loading,
|
||||
globalSetting,
|
||||
user
|
||||
}) => ({
|
||||
globalSetting,
|
||||
loading: loading.models.competitions,
|
||||
user
|
||||
})
|
||||
)(UploadFile));
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 78827:
|
||||
/*!*****************************************************************************************!*\
|
||||
!*** ./src/pages/Shixuns/Edit/body/Dataset/components/UploadFile/index.tsx + 1 modules ***!
|
||||
\*****************************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ components_UploadFile; }
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
||||
var _react_17_0_2_react = __webpack_require__(59301);
|
||||
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
||||
var env = __webpack_require__(64741);
|
||||
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
||||
var fetch = __webpack_require__(87101);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/upload/index.js + 24 modules
|
||||
var upload = __webpack_require__(6557);
|
||||
// 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/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 modal = __webpack_require__(43418);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
||||
var input = __webpack_require__(1056);
|
||||
;// CONCATENATED MODULE: ./src/pages/Shixuns/Edit/body/Dataset/components/UploadFile/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var UploadFilemodules = ({"wrap":"wrap___EmsVa","colorBlue":"colorBlue___XqtfP","repeatedName":"repeatedName___yMQsm"});
|
||||
// EXTERNAL MODULE: ./src/components/UploadFile/index.tsx
|
||||
var UploadFile = __webpack_require__(6064);
|
||||
// EXTERNAL MODULE: ./src/utils/util.tsx
|
||||
var util = __webpack_require__(3163);
|
||||
;// CONCATENATED MODULE: ./src/pages/Shixuns/Edit/body/Dataset/components/UploadFile/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 { Dragger } = upload["default"];
|
||||
const UploadFile_UploadFile = ({
|
||||
dispatch,
|
||||
id,
|
||||
onClose,
|
||||
onOK,
|
||||
visible,
|
||||
wrapClassName,
|
||||
local,
|
||||
containerId,
|
||||
rootIdentifier
|
||||
}) => {
|
||||
var _a;
|
||||
const [formValue, setFormValue] = (0,_react_17_0_2_react.useState)({});
|
||||
const [repeatedName, setRepeatedName] = (0,_react_17_0_2_react.useState)([]);
|
||||
const [xhrItems, setXhrItems] = (0,_react_17_0_2_react.useState)([]);
|
||||
const [disabled, setDisabled] = (0,_react_17_0_2_react.useState)(0);
|
||||
const [cancelUpload, setCancelUpload] = (0,_react_17_0_2_react.useState)(false);
|
||||
const [btnLoading, setBtnLoading] = (0,_react_17_0_2_react.useState)(false);
|
||||
const [form] = es_form["default"].useForm();
|
||||
const [fileList, setFileList] = (0,_react_17_0_2_react.useState)([]);
|
||||
const savedFileList = (0,_react_17_0_2_react.useRef)([]);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
if (visible) {
|
||||
form.resetFields();
|
||||
setFileList([]);
|
||||
setXhrItems([]);
|
||||
setRepeatedName([]);
|
||||
setDisabled(0);
|
||||
setBtnLoading(false);
|
||||
setCancelUpload(false);
|
||||
}
|
||||
}, [visible]);
|
||||
const handleChangeFile = (info) => {
|
||||
var _a2, _b, _c;
|
||||
if (info.file.status === "done" || info.file.status === "uploading") {
|
||||
setFileList(info.fileList);
|
||||
if (!info.file.response) {
|
||||
return;
|
||||
}
|
||||
if ((_a2 = info.file.response) == null ? void 0 : _a2.id) {
|
||||
message/* default */.ZP.success("\u4E0A\u4F20\u6210\u529F\uFF01");
|
||||
return;
|
||||
}
|
||||
setFileList(fileList.filter((item) => item.uid !== info.file.uid));
|
||||
((_b = info.file.response) == null ? void 0 : _b.message) && message/* default */.ZP.info((_c = info.file.response) == null ? void 0 : _c.message);
|
||||
}
|
||||
};
|
||||
const handleRemoveFile = (info) => __async(void 0, null, function* () {
|
||||
var _a2;
|
||||
if (!disabled) {
|
||||
const newFileList = fileList.filter((item) => item.uid !== info.uid);
|
||||
setFileList(newFileList);
|
||||
savedFileList.current = [...newFileList];
|
||||
setRepeatedName(repeatedName.filter((item) => item !== info.name));
|
||||
message/* default */.ZP.info("\u5220\u9664\u6210\u529F");
|
||||
if (!newFileList.length) {
|
||||
form.setFieldsValue({ file: void 0 });
|
||||
form.validateFields();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!info.response) {
|
||||
message/* default */.ZP.info("\u8FD8\u672A\u4E0A\u4F20\u5B8C\u6210\uFF0C\u65E0\u6CD5\u8FDB\u884C\u5220\u9664\u64CD\u4F5C\uFF01");
|
||||
return;
|
||||
}
|
||||
const res = yield (0,fetch/* default */.ZP)(`/api/shixuns/${id}/destroy_data_sets.json`, {
|
||||
method: "Delete",
|
||||
body: { id: [(_a2 = info == null ? void 0 : info.response) == null ? void 0 : _a2.id] }
|
||||
});
|
||||
if (res.status === 0) {
|
||||
setFileList(fileList.filter((item) => item.uid !== info.uid));
|
||||
message/* default */.ZP.info("\u5220\u9664\u6210\u529F");
|
||||
}
|
||||
});
|
||||
const handleBeforeUpload = (info) => {
|
||||
if (fileList == null ? void 0 : fileList.some((e) => e.name === info.name)) {
|
||||
message/* default */.ZP.info(`${info.name}\u6587\u4EF6\u5DF2\u5B58\u5728`);
|
||||
return false;
|
||||
}
|
||||
if (info.size / 1024 / 1024 > 500) {
|
||||
message/* default */.ZP.info("\u6587\u4EF6\u8D85\u8FC7500M\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42");
|
||||
return false;
|
||||
}
|
||||
const param = { name: info.name, uid: info.uid, file: info, percent: 0 };
|
||||
fileList.push(param);
|
||||
savedFileList.current = [...fileList];
|
||||
setFileList([...fileList]);
|
||||
return false;
|
||||
};
|
||||
const draggerProps = {
|
||||
height: 300,
|
||||
multiple: true,
|
||||
disabled: disabled > 0,
|
||||
withCredentials: true,
|
||||
fileList,
|
||||
action: `${env/* default */.Z.API_SERVER}/api/attachments.json`,
|
||||
onChange: handleChangeFile,
|
||||
onRemove: handleRemoveFile,
|
||||
beforeUpload: handleBeforeUpload
|
||||
};
|
||||
const uploadRequest = (params, url, callback2, progressFunction, error2) => {
|
||||
const formData = new FormData();
|
||||
Object.keys(params).forEach((key) => {
|
||||
formData.append(key, params[key]);
|
||||
});
|
||||
const xhr = new window.XMLHttpRequest();
|
||||
xhr.withCredentials = true;
|
||||
xhr.addEventListener(
|
||||
"load",
|
||||
function(res) {
|
||||
var _a2;
|
||||
callback2(JSON.parse((_a2 = res == null ? void 0 : res.target) == null ? void 0 : _a2.response));
|
||||
},
|
||||
false
|
||||
);
|
||||
xhr.addEventListener(
|
||||
"error",
|
||||
function(err) {
|
||||
if (error2) {
|
||||
error2(err);
|
||||
}
|
||||
},
|
||||
false
|
||||
);
|
||||
xhr.upload.onprogress = (e) => {
|
||||
if (progressFunction) {
|
||||
progressFunction(e);
|
||||
}
|
||||
};
|
||||
xhr.open("POST", url);
|
||||
xhr.send(formData);
|
||||
return xhr;
|
||||
};
|
||||
const getProgress = (event, item) => {
|
||||
if (event.lengthComputable) {
|
||||
const percent = Math.floor(event.loaded / event.total * 100);
|
||||
const param = __spreadProps(__spreadValues({}, item), { percent, status: percent === 100 ? "done" : "uploading" });
|
||||
console.log(savedFileList.current, 333);
|
||||
savedFileList.current = savedFileList.current.map((e) => e.uid === item.uid ? param : e);
|
||||
setFileList(savedFileList.current);
|
||||
}
|
||||
};
|
||||
const error = (res, item) => {
|
||||
const param = __spreadProps(__spreadValues({}, item), { status: "error" });
|
||||
message/* default */.ZP.warning("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u5C1D\u8BD5");
|
||||
savedFileList.current = savedFileList.current.map((e) => e.uid === item.uid ? param : e);
|
||||
if (savedFileList.current.every((e) => e.status === "done" || e.status === "error")) {
|
||||
setBtnLoading(false);
|
||||
setDisabled(2);
|
||||
}
|
||||
setFileList(savedFileList.current);
|
||||
};
|
||||
const callback = (res, item) => {
|
||||
let param = __spreadProps(__spreadValues({}, item), { status: "done" });
|
||||
if (res.status === 0) {
|
||||
} else {
|
||||
param = __spreadProps(__spreadValues({}, item), { status: "error" });
|
||||
message/* default */.ZP.error("\u4E0A\u4F20\u5931\u8D25!");
|
||||
}
|
||||
savedFileList.current = savedFileList.current.map((e) => e.uid === item.uid ? param : e);
|
||||
if (savedFileList.current.every((e) => e.status === "done")) {
|
||||
message/* default */.ZP.success("\u4E0A\u4F20\u5B8C\u6210!");
|
||||
cancelEnd(true);
|
||||
return;
|
||||
}
|
||||
if (savedFileList.current.every((e) => e.status === "done" || e.status === "error")) {
|
||||
setBtnLoading(false);
|
||||
setDisabled(2);
|
||||
}
|
||||
setFileList(savedFileList.current);
|
||||
};
|
||||
const isOnLine = () => {
|
||||
let netStatus = true;
|
||||
if (window.navigator.onLine == true) {
|
||||
netStatus = true;
|
||||
} else {
|
||||
netStatus = false;
|
||||
}
|
||||
;
|
||||
return netStatus;
|
||||
};
|
||||
const handleFinish = (values) => __async(void 0, null, function* () {
|
||||
setBtnLoading(true);
|
||||
if (disabled === 3) {
|
||||
setDisabled(2);
|
||||
return;
|
||||
}
|
||||
if (disabled === 2 || disabled === 1) {
|
||||
onUploadAgain();
|
||||
return;
|
||||
}
|
||||
const { commitMessage = "", fileOss = [] } = values || {};
|
||||
const filesItems = local ? fileList : fileOss;
|
||||
const names = filesItems.map((e) => e.name);
|
||||
if (names.filter((item) => item.indexOf("\u3001") != -1 || item.indexOf(" ") != -1).length > 0) {
|
||||
message/* default */.ZP.info("\u6570\u636E\u96C6\u540D\u79F0\u7981\u6B62\u6709\u7A7A\u683C\u4E0E\u3001");
|
||||
setBtnLoading(false);
|
||||
return;
|
||||
}
|
||||
const res = yield (0,fetch/* default */.ZP)(`/api/shixuns/${id}/check_data_sets`, {
|
||||
method: "post",
|
||||
body: {
|
||||
files_name: names
|
||||
}
|
||||
});
|
||||
if (res.status === -3) {
|
||||
setRepeatedName(res == null ? void 0 : res.exist_files);
|
||||
setBtnLoading(false);
|
||||
return;
|
||||
}
|
||||
if (JSON.stringify(res) === "{}") {
|
||||
setBtnLoading(false);
|
||||
message/* default */.ZP.error("\u7F51\u7EDC\u5DF2\u65AD\u5F00,\u8BF7\u7A0D\u540E\u91CD\u8BD5!");
|
||||
return;
|
||||
}
|
||||
if (res.status === 0) {
|
||||
fileList.forEach((item) => {
|
||||
const xhr = uploadRequest(
|
||||
{
|
||||
file: item.file,
|
||||
description: commitMessage
|
||||
},
|
||||
`${env/* default */.Z.API_SERVER}/api/shixuns/${id}/upload_data_sets.json`,
|
||||
(e) => callback(e, item),
|
||||
(e) => getProgress(e, item),
|
||||
(e) => error(e, item)
|
||||
);
|
||||
xhrItems.push(xhr);
|
||||
});
|
||||
setDisabled(1);
|
||||
}
|
||||
});
|
||||
const onUploadAgain = () => {
|
||||
const { commitMessage = "" } = __spreadValues({}, form.getFieldsValue()) || {};
|
||||
const errorFileList = savedFileList.current.filter((item) => item.status === "error");
|
||||
const t = savedFileList.current.map((e) => __spreadProps(__spreadValues({}, e), { status: e.status === "error" ? "uploading" : e.status }));
|
||||
setFileList(t);
|
||||
errorFileList.forEach((item) => {
|
||||
const xhr = uploadRequest(
|
||||
{
|
||||
file: item.file,
|
||||
description: commitMessage
|
||||
},
|
||||
`${env/* default */.Z.API_SERVER}/api/shixuns/${id}/upload_data_sets.json`,
|
||||
(e) => callback(e, item),
|
||||
(e) => getProgress(e, item),
|
||||
(e) => error(e, item)
|
||||
);
|
||||
xhrItems.push(xhr);
|
||||
});
|
||||
};
|
||||
const handleValuesChange = (changedValues) => {
|
||||
var _a2, _b;
|
||||
console.log(changedValues, "changedValues");
|
||||
if ("fileOss" in changedValues) {
|
||||
if ((changedValues == null ? void 0 : changedValues.fileOss.every((e) => e.status === "done")) && ((_a2 = changedValues == null ? void 0 : changedValues.fileOss) == null ? void 0 : _a2.length)) {
|
||||
message/* default */.ZP.success("\u4E0A\u4F20\u5B8C\u6210!");
|
||||
cancelEnd(true);
|
||||
return;
|
||||
}
|
||||
if ((changedValues == null ? void 0 : changedValues.fileOss.every((e) => e.status === "done" || e.status === "error")) && ((_b = changedValues == null ? void 0 : changedValues.fileOss) == null ? void 0 : _b.length)) {
|
||||
setDisabled(3);
|
||||
setBtnLoading(false);
|
||||
return;
|
||||
}
|
||||
setRepeatedName(repeatedName.filter((item) => {
|
||||
var _a3;
|
||||
return (_a3 = changedValues == null ? void 0 : changedValues.fileOss) == null ? void 0 : _a3.some((e) => e.name === item);
|
||||
}));
|
||||
}
|
||||
setFormValue(__spreadValues({}, form.getFieldsValue()));
|
||||
};
|
||||
const cancelEnd = (bool) => {
|
||||
if (!bool) {
|
||||
setCancelUpload(true);
|
||||
xhrItems.forEach((e) => {
|
||||
e.abort();
|
||||
});
|
||||
}
|
||||
onOK();
|
||||
onClose();
|
||||
};
|
||||
const handleCancel = () => {
|
||||
const { fileOss = [] } = __spreadValues({}, form.getFieldsValue()) || {};
|
||||
const fileListItems = fileList == null ? void 0 : fileList.every((e) => e.status === "done");
|
||||
const ossItems = fileOss == null ? void 0 : fileOss.every((e) => e.status === "done");
|
||||
if (!fileListItems || !ossItems) {
|
||||
modal["default"].confirm({
|
||||
title: "\u5173\u95ED\u5F39\u6846\u63D0\u793A",
|
||||
content: "\u6709\u6587\u4EF6\u672A\u4E0A\u4F20,\u662F\u5426\u786E\u5B9A\u79BB\u5F00\uFF1F",
|
||||
okText: "\u79BB\u5F00",
|
||||
cancelText: "\u53D6\u6D88",
|
||||
onOk: () => {
|
||||
cancelEnd();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
cancelEnd();
|
||||
};
|
||||
const returnDom = () => {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: `iconfont icon-shangchuan font50 ${UploadFilemodules.colorBlue}` })), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `font14 mt30` }, "\u62D6\u62FD\u6587\u4EF6\u6216", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: `${UploadFilemodules.colorBlue} ml5` }, "\u70B9\u51FB\u6B64\u5904\u4E0A\u4F20")));
|
||||
};
|
||||
const handleComplete = (item) => {
|
||||
console.log(item, 444);
|
||||
};
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
modal["default"],
|
||||
{
|
||||
open: visible,
|
||||
onOk: () => {
|
||||
(0,util/* trackEvent */.L9)(["\u5B9E\u8DF5\u9879\u76EE", "\u8BBE\u7F6E", "\u6570\u636E\u96C6", "\u4E0A\u4F20\u6587\u4EF6"]);
|
||||
form.submit();
|
||||
},
|
||||
centered: true,
|
||||
okText: disabled === 0 ? "\u786E\u5B9A" : disabled === 1 ? "\u4E0A\u4F20\u4E2D" : "\u91CD\u65B0\u4E0A\u4F20",
|
||||
okButtonProps: { loading: btnLoading },
|
||||
onCancel: handleCancel,
|
||||
width: "1000px",
|
||||
title: "\u4E0A\u4F20\u6587\u4EF6"
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: UploadFilemodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_form["default"],
|
||||
{
|
||||
className: "mt10",
|
||||
form,
|
||||
scrollToFirstError: true,
|
||||
layout: "vertical",
|
||||
onFinish: handleFinish,
|
||||
onValuesChange: handleValuesChange
|
||||
},
|
||||
local ? /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u9009\u62E9\u6587\u4EF6 ", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-light-black" }, "(\u5355\u4E2A\u6587\u4EF6\u4E0D\u8D85\u8FC7500M)")), name: "file", rules: [
|
||||
{ required: true, message: "\u8BF7\u9009\u62E9\u6587\u4EF6" }
|
||||
] }, /* @__PURE__ */ _react_17_0_2_react.createElement(Dragger, __spreadValues({}, draggerProps), " ", returnDom())) : /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u9009\u62E9\u6587\u4EF6 ", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-light-black" }, "(\u5355\u4E2A\u6587\u4EF6\u4E0D\u8D85\u8FC7100GB)")), name: "fileOss", rules: [
|
||||
{ required: true, message: "\u8BF7\u9009\u62E9\u6587\u4EF6" }
|
||||
] }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
UploadFile/* default */.ZP,
|
||||
{
|
||||
identifier: rootIdentifier,
|
||||
cancelUpload,
|
||||
container_type: "Shixun",
|
||||
container_id: containerId,
|
||||
uploading: disabled < 3 ? disabled : 0,
|
||||
disabled: disabled > 0,
|
||||
height: 300,
|
||||
maxSize: 100 * 1024 * 1024 * 1024,
|
||||
description: formValue.commitMessage || "",
|
||||
text: returnDom(),
|
||||
onComplete: handleComplete,
|
||||
realFileName: true
|
||||
}
|
||||
)),
|
||||
!!repeatedName.length && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: UploadFilemodules.repeatedName }, repeatedName.join("\u3001"), "\u5DF2\u5B58\u5728,\u8BF7\u5220\u9664\u540E\u518D\u4E0A\u4F20"),
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_form["default"].Item,
|
||||
{
|
||||
name: "commitMessage",
|
||||
label: "\u5907\u6CE8:",
|
||||
rules: [
|
||||
{ whitespace: true, message: "\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C" }
|
||||
]
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
input["default"],
|
||||
{
|
||||
bordered: false,
|
||||
disabled: disabled > 0,
|
||||
maxLength: 100,
|
||||
suffix: `${((_a = formValue.commitMessage) == null ? void 0 : _a.length) || 0}/100`,
|
||||
placeholder: "\u8BF7\u586B\u5199\u5907\u6CE8\u4FE1\u606F"
|
||||
}
|
||||
)
|
||||
)
|
||||
))
|
||||
);
|
||||
};
|
||||
/* harmony default export */ var components_UploadFile = (UploadFile_UploadFile);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3828:
|
||||
/*!************************!*\
|
||||
!*** crypto (ignored) ***!
|
||||
\************************/
|
||||
/***/ (function() {
|
||||
|
||||
/* (ignored) */
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
@ -0,0 +1,646 @@
|
||||
"use strict";
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[6124],{
|
||||
|
||||
/***/ 28748:
|
||||
/*!*********************************************************!*\
|
||||
!*** ./src/components/ManageHead/index.tsx + 1 modules ***!
|
||||
\*********************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ components_ManageHead; }
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
||||
var _react_17_0_2_react = __webpack_require__(59301);
|
||||
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 14 modules
|
||||
var _umi_production_exports = __webpack_require__(87210);
|
||||
;// CONCATENATED MODULE: ./src/components/ManageHead/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var ManageHeadmodules = ({"ManageHead":"ManageHead___OlGnQ","tabs":"tabs____UQeJ","title":"title___VM9am","active":"active___XkbXs"});
|
||||
// EXTERNAL MODULE: ./src/utils/authority.ts
|
||||
var authority = __webpack_require__(55830);
|
||||
;// CONCATENATED MODULE: ./src/components/ManageHead/index.tsx
|
||||
|
||||
|
||||
|
||||
|
||||
const ManageHead = ({
|
||||
children,
|
||||
active
|
||||
}) => {
|
||||
const params = (0,_umi_production_exports.useParams)();
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ManageHeadmodules.ManageHead }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ManageHeadmodules.tabs }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: () => _umi_production_exports.history.push(`/classrooms/${params.coursesId}/teachers`), className: `${ManageHeadmodules.title} ${active === 1 ? ManageHeadmodules.active : ""}` }, "\u6559\u5E08\u5217\u8868"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: () => _umi_production_exports.history.push(`/classrooms/${params.coursesId}/students`), className: `${ManageHeadmodules.title} ${active === 2 ? ManageHeadmodules.active : ""}` }, "\u5B66\u751F\u5217\u8868"), (0,authority/* isAdminOrCreatorOrOperation */.Rb)() ? /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: () => _umi_production_exports.history.push(`/classrooms/${params.coursesId}/assistant`), className: `${ManageHeadmodules.title} ${active === 3 ? ManageHeadmodules.active : ""}` }, "\u52A9\u6559\u6743\u9650") : /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null)), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, children));
|
||||
};
|
||||
/* harmony default export */ var components_ManageHead = (ManageHead);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 69685:
|
||||
/*!************************************************************************!*\
|
||||
!*** ./src/pages/Classrooms/Lists/Teachers/components/ChangeAdmin.tsx ***!
|
||||
\************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ 78241);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! antd */ 43418);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! antd */ 8591);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! antd */ 71418);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! antd */ 5112);
|
||||
/* harmony import */ var _service_teacher__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/service/teacher */ 16007);
|
||||
/* harmony import */ var react_infinite_scroller__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-infinite-scroller */ 26724);
|
||||
/* harmony import */ var react_infinite_scroller__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_infinite_scroller__WEBPACK_IMPORTED_MODULE_2__);
|
||||
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! umi */ 87210);
|
||||
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 EditAttendance = ({
|
||||
teachers,
|
||||
loading,
|
||||
dispatch
|
||||
}) => {
|
||||
const params = (0,umi__WEBPACK_IMPORTED_MODULE_3__.useParams)();
|
||||
const [data, setData] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
|
||||
const [isLoading, setIsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
||||
const [hasMore, setHasMore] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true);
|
||||
params["id"] = params["coursesId"];
|
||||
params["course_id"] = params["coursesId"];
|
||||
params["limit"] = 20;
|
||||
params["page"] = 1;
|
||||
const getData = () => __async(void 0, null, function* () {
|
||||
setIsLoading(true);
|
||||
const res = yield (0,_service_teacher__WEBPACK_IMPORTED_MODULE_1__/* .getList */ .gp)(__spreadValues({}, params));
|
||||
if (res == null ? void 0 : res.teacher_list) {
|
||||
params["page"]++;
|
||||
setData([...data, ...res.teacher_list]);
|
||||
if (res.teacher_list.length !== params["limit"])
|
||||
setHasMore(false);
|
||||
}
|
||||
setIsLoading(false);
|
||||
});
|
||||
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
||||
if (teachers.actionTabs.key === "\u66F4\u6362\u7BA1\u7406\u5458") {
|
||||
params["page"] = 1;
|
||||
setData([]);
|
||||
getData();
|
||||
}
|
||||
}, [teachers.actionTabs.key]);
|
||||
const [form] = antd__WEBPACK_IMPORTED_MODULE_4__["default"].useForm();
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_5__["default"],
|
||||
{
|
||||
centered: true,
|
||||
title: "\u66F4\u6362\u7BA1\u7406\u5458",
|
||||
open: teachers.actionTabs.key === "\u66F4\u6362\u7BA1\u7406\u5458" ? true : false,
|
||||
okText: "\u786E\u5B9A",
|
||||
cancelText: "\u53D6\u6D88",
|
||||
bodyStyle: { minHeight: 200 },
|
||||
onOk: () => __async(void 0, null, function* () {
|
||||
const formValue = form.getFieldValue();
|
||||
if (formValue.course_member_id) {
|
||||
const selectValue = formValue.course_member_id.split(",");
|
||||
const res = yield (0,_service_teacher__WEBPACK_IMPORTED_MODULE_1__/* .changeCourseAdmin */ .rM)(
|
||||
__spreadProps(__spreadValues({}, params), {
|
||||
user_id: selectValue[1],
|
||||
course_member_id: selectValue[0]
|
||||
})
|
||||
);
|
||||
if (res.status === 0) {
|
||||
setData([]);
|
||||
antd__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .ZP.success("\u4FEE\u6539\u6210\u529F");
|
||||
dispatch({
|
||||
type: "user/getUserInfo",
|
||||
payload: __spreadValues({}, params)
|
||||
});
|
||||
dispatch({
|
||||
type: "teachers/getList",
|
||||
payload: __spreadValues({}, params)
|
||||
});
|
||||
dispatch({
|
||||
type: "classroomList/getClassroomTopBanner",
|
||||
payload: { id: params.coursesId }
|
||||
});
|
||||
dispatch({
|
||||
type: "teachers/setActionTabs",
|
||||
payload: {}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
antd__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .ZP.error("\u8BF7\u9009\u62E9\u7BA1\u7406\u5458");
|
||||
}
|
||||
}),
|
||||
onCancel: () => {
|
||||
setData([]);
|
||||
dispatch({
|
||||
type: "teachers/setActionTabs",
|
||||
payload: {}
|
||||
});
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", { className: "tc" }, "\u9009\u62E9\u7684\u6210\u5458\u5C06\u4F1A\u6210\u4E3A\u65B0\u7684\u7BA1\u7406\u5458", /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("br", null), "\u60A8\u5C06\u4E0D\u518D\u62E5\u6709\u7BA1\u7406\u5458\u7684\u6743\u9650\uFF0C\u4F46\u60A8\u4ECD\u662F\u6559\u5E08\u56E2\u961F\u7684\u4E00\u5458"),
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_4__["default"],
|
||||
{
|
||||
form
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { style: { background: "#F4FAFF", padding: 20 } }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { style: { maxHeight: 200, overflow: "auto" } }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
(react_infinite_scroller__WEBPACK_IMPORTED_MODULE_2___default()),
|
||||
{
|
||||
initialLoad: false,
|
||||
pageStart: 0,
|
||||
loadMore: () => getData(),
|
||||
hasMore: !isLoading && hasMore,
|
||||
useWindow: false
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, { spinning: isLoading }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_4__["default"].Item,
|
||||
{
|
||||
name: "course_member_id",
|
||||
style: { marginBottom: 0 }
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_8__/* ["default"].Group */ .ZP.Group, null, data == null ? void 0 : data.map(function(item, key) {
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .ZP, { value: item.course_member_id + "," + item.user_id }, item.name));
|
||||
}))
|
||||
))
|
||||
)))
|
||||
)
|
||||
);
|
||||
};
|
||||
/* harmony default export */ __webpack_exports__.Z = ((0,umi__WEBPACK_IMPORTED_MODULE_3__.connect)(
|
||||
({
|
||||
teachers,
|
||||
loading
|
||||
}) => ({
|
||||
teachers,
|
||||
loading
|
||||
})
|
||||
)(EditAttendance));
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 69193:
|
||||
/*!*****************************!*\
|
||||
!*** ./src/utils/export.ts ***!
|
||||
\*****************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ AD: function() { return /* binding */ ExportCollegeStudentsInfo; },
|
||||
/* harmony export */ D9: function() { return /* binding */ ExportStudentanalysis; },
|
||||
/* harmony export */ IM: function() { return /* binding */ get_ecs_attachment; },
|
||||
/* harmony export */ Iy: function() { return /* binding */ ExportCourseWorkListScores; },
|
||||
/* harmony export */ KM: function() { return /* binding */ getmember_works; },
|
||||
/* harmony export */ Ne: function() { return /* binding */ getec_training_objectives; },
|
||||
/* harmony export */ ON: function() { return /* binding */ exportPaperlibraryPaper; },
|
||||
/* harmony export */ Uj: function() { return /* binding */ exportTaskPass; },
|
||||
/* harmony export */ VY: function() { return /* binding */ getrank_list; },
|
||||
/* harmony export */ YO: function() { return /* binding */ exportCommitResultWord; },
|
||||
/* harmony export */ YX: function() { return /* binding */ exportClassroomsPaper; },
|
||||
/* harmony export */ Zn: function() { return /* binding */ ExportCourseInfo; },
|
||||
/* harmony export */ _g: function() { return /* binding */ exportMoocrecord; },
|
||||
/* harmony export */ _k: function() { return /* binding */ getDownFile; },
|
||||
/* harmony export */ c6: function() { return /* binding */ ExportVideoStudy; },
|
||||
/* harmony export */ cr: function() { return /* binding */ ExportCourseActScore; },
|
||||
/* harmony export */ eV: function() { return /* binding */ ExportCourseStudentsInfo; },
|
||||
/* harmony export */ fi: function() { return /* binding */ ExportCourseMemberScores; },
|
||||
/* harmony export */ gh: function() { return /* binding */ ExportAttendance; },
|
||||
/* harmony export */ hS: function() { return /* binding */ getec_courses; },
|
||||
/* harmony export */ iA: function() { return /* binding */ ExportCourseAndOther; },
|
||||
/* harmony export */ j6: function() { return /* binding */ ExportCourseTotalScore; },
|
||||
/* harmony export */ je: function() { return /* binding */ ExportExerciseStudentScores; },
|
||||
/* harmony export */ kS: function() { return /* binding */ getquestion_rank_list; },
|
||||
/* harmony export */ o6: function() { return /* binding */ ExportVideoStudent; },
|
||||
/* harmony export */ pO: function() { return /* binding */ exportUserExerciseDetail; },
|
||||
/* harmony export */ rQ: function() { return /* binding */ ExportProblemset; },
|
||||
/* harmony export */ sA: function() { return /* binding */ ExportPollsScores; },
|
||||
/* harmony export */ xm: function() { return /* binding */ getecyears; },
|
||||
/* harmony export */ xo: function() { return /* binding */ getec_graduation_requirements; },
|
||||
/* harmony export */ y8: function() { return /* binding */ Exportcompetitions; }
|
||||
/* harmony export */ });
|
||||
/* unused harmony export ExportCourseWorkListAppendix */
|
||||
/* harmony import */ var _service_classrooms__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/service/classrooms */ 16560);
|
||||
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! umi */ 87210);
|
||||
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ 3163);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ 8591);
|
||||
/* harmony import */ var _env__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./env */ 64741);
|
||||
var __defProp = Object.defineProperty;
|
||||
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 __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 showLoading = () => {
|
||||
(0,umi__WEBPACK_IMPORTED_MODULE_1__.getDvaApp)()._store.dispatch({
|
||||
type: "globalSetting/setGlobalLoading",
|
||||
payload: { show: true, text: "\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..." }
|
||||
});
|
||||
};
|
||||
const hideLoading = () => {
|
||||
(0,umi__WEBPACK_IMPORTED_MODULE_1__.getDvaApp)()._store.dispatch({
|
||||
type: "globalSetting/setGlobalLoading",
|
||||
payload: { show: false, text: "" }
|
||||
});
|
||||
};
|
||||
const ExportCourseInfo = (params) => __async(void 0, null, function* () {
|
||||
showLoading();
|
||||
const res = yield (0,_service_classrooms__WEBPACK_IMPORTED_MODULE_0__/* .exportCourseInfo */ .YR)(__spreadValues({}, params));
|
||||
if (res.status === 0)
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFileIframe */ .QH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/courses/${params.coursesId}/export_couser_info.json`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
hideLoading();
|
||||
});
|
||||
const ExportCourseActScore = (params) => __async(void 0, null, function* () {
|
||||
const res = yield (0,_service_classrooms__WEBPACK_IMPORTED_MODULE_0__/* .exportCourseActScore */ .yS)(__spreadValues({}, params));
|
||||
if (res.status === 0) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F");
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(
|
||||
`/classrooms/${params.coursesId}/exportlist/course_member_act_score`
|
||||
);
|
||||
} else if (res.status === -2) {
|
||||
return res;
|
||||
} else if (res.status === -3) {
|
||||
(0,umi__WEBPACK_IMPORTED_MODULE_1__.getDvaApp)()._store.dispatch({
|
||||
type: "classroomList/setActionTabs",
|
||||
payload: { key: "\u5BFC\u51FA\u63D0\u9192" }
|
||||
});
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(
|
||||
`/classrooms/${params.coursesId}/exportlist/course_member_act_score`
|
||||
);
|
||||
}
|
||||
});
|
||||
const ExportCourseMemberScores = (params) => __async(void 0, null, function* () {
|
||||
const res = yield (0,_service_classrooms__WEBPACK_IMPORTED_MODULE_0__/* .exportCourseMemberScores */ .W0)(__spreadValues({}, params));
|
||||
if (res.status === 0) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F");
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(
|
||||
`/classrooms/${params.coursesId}/exportlist/course_total_score`
|
||||
);
|
||||
} else if (res.status === -2) {
|
||||
return res;
|
||||
} else if (res.status === -3) {
|
||||
(0,umi__WEBPACK_IMPORTED_MODULE_1__.getDvaApp)()._store.dispatch({
|
||||
type: "classroomList/setActionTabs",
|
||||
payload: { key: "\u5BFC\u51FA\u63D0\u9192" }
|
||||
});
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(
|
||||
`/classrooms/${params.coursesId}/exportlist/course_total_score`
|
||||
);
|
||||
}
|
||||
});
|
||||
const ExportCourseAndOther = (params) => __async(void 0, null, function* () {
|
||||
const res = yield (0,_service_classrooms__WEBPACK_IMPORTED_MODULE_0__/* .exportCourseAndOther */ .Nl)(__spreadValues({}, params));
|
||||
if (res.status === 0) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F");
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(
|
||||
`/classrooms/${params.coursesId}/exportlist/course_total_exercise_and_other`
|
||||
);
|
||||
} else if (res.status === -2) {
|
||||
return res;
|
||||
} else if (res.status === -3) {
|
||||
(0,umi__WEBPACK_IMPORTED_MODULE_1__.getDvaApp)()._store.dispatch({
|
||||
type: "classroomList/setActionTabs",
|
||||
payload: { key: "\u5BFC\u51FA\u63D0\u9192" }
|
||||
});
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(
|
||||
`/classrooms/${params.coursesId}/exportlist/course_total_exercise_and_other`
|
||||
);
|
||||
}
|
||||
});
|
||||
const exportMoocrecord = (params) => __async(void 0, null, function* () {
|
||||
const res = yield (0,_service_classrooms__WEBPACK_IMPORTED_MODULE_0__/* .exportMoocrecords */ .td)(__spreadValues({}, params));
|
||||
if (res.status === 0) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F");
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(
|
||||
`/classrooms/${params.coursesId}/exportlist/course_total_exercise_and_other`
|
||||
);
|
||||
} else if (res.status === -2) {
|
||||
return res;
|
||||
} else if (res.status === -3) {
|
||||
(0,umi__WEBPACK_IMPORTED_MODULE_1__.getDvaApp)()._store.dispatch({
|
||||
type: "classroomList/setActionTabs",
|
||||
payload: { key: "\u5BFC\u51FA\u63D0\u9192" }
|
||||
});
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(
|
||||
`/classrooms/${params.coursesId}/exportlist/course_total_exercise_and_other`
|
||||
);
|
||||
}
|
||||
});
|
||||
const ExportCourseTotalScore = (params) => __async(void 0, null, function* () {
|
||||
const res = yield (0,_service_classrooms__WEBPACK_IMPORTED_MODULE_0__/* .exportCourseTotalScore */ .QX)(__spreadValues({}, params));
|
||||
if (res.status === 0) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F");
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(
|
||||
`/classrooms/${params.coursesId}/exportlist/course_total_homework`
|
||||
);
|
||||
} else if (res.status === -2) {
|
||||
return res;
|
||||
} else if (res.status === -3) {
|
||||
(0,umi__WEBPACK_IMPORTED_MODULE_1__.getDvaApp)()._store.dispatch({
|
||||
type: "classroomList/setActionTabs",
|
||||
payload: { key: "\u5BFC\u51FA\u63D0\u9192" }
|
||||
});
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(
|
||||
`/classrooms/${params.coursesId}/exportlist/course_total_homework`
|
||||
);
|
||||
}
|
||||
});
|
||||
const ExportCourseWorkListScores = (params, type) => __async(void 0, null, function* () {
|
||||
const res = yield (0,_service_classrooms__WEBPACK_IMPORTED_MODULE_0__/* .exportCourseWorkListScores */ .aP)(__spreadValues({}, params));
|
||||
if (res.status === 0) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F");
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(`/classrooms/${params.coursesId}/exportlist/${type}`);
|
||||
} else if (res.status === -3) {
|
||||
(0,umi__WEBPACK_IMPORTED_MODULE_1__.getDvaApp)()._store.dispatch({
|
||||
type: "classroomList/setActionTabs",
|
||||
payload: { key: "\u5BFC\u51FA\u63D0\u9192" }
|
||||
});
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(`/classrooms/${params.coursesId}/exportlist/${type}`);
|
||||
}
|
||||
});
|
||||
const ExportCourseWorkListAppendix = (params) => __async(void 0, null, function* () {
|
||||
showLoading();
|
||||
const res = yield exportCourseWorkListAppendix(__spreadValues({}, params));
|
||||
if (res.status === 0)
|
||||
yield downLoadFileIframe(
|
||||
"",
|
||||
setUrlQuery({
|
||||
url: ENV.API_SERVER + `/api/homework_commons/${params.categoryId}/works_list.zip`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
hideLoading();
|
||||
});
|
||||
const ExportPollsScores = (params) => __async(void 0, null, function* () {
|
||||
showLoading();
|
||||
const res = yield (0,_service_classrooms__WEBPACK_IMPORTED_MODULE_0__/* .exportPollsScores */ .MJ)(__spreadValues({}, params));
|
||||
if (res.status === 0)
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFileIframe */ .QH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/polls/${params.categoryId}/commit_result.xlsx`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
hideLoading();
|
||||
});
|
||||
const ExportAttendance = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/courses/${params.coursesId}/attendances/export_xlsx_data.xlsx`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const ExportVideoStudent = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/courses/${params.coursesId}/video_study_statics.xlsx`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const ExportVideoStudy = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/courses/${params.coursesId}/export_video_study.xlsx`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const ExportCourseStudentsInfo = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/courses/${params.coursesId}/export_course_students_info.xlsx`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const ExportCollegeStudentsInfo = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/school_manages/students.xlsx`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const ExportProblemset = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/item_banks/export.xlsx`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const Exportcompetitions = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/competitions/region_reports.xlsx`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const ExportExerciseStudentScores = (params) => __async(void 0, null, function* () {
|
||||
const res = yield (0,_service_classrooms__WEBPACK_IMPORTED_MODULE_0__/* .exportExerciseStudentScores */ .Uy)(__spreadValues({}, params));
|
||||
if (res.status === 0) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F");
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(`/classrooms/${params.coursesId}/exportlist/exercise_score`);
|
||||
} else if (res.status === -3) {
|
||||
(0,umi__WEBPACK_IMPORTED_MODULE_1__.getDvaApp)()._store.dispatch({
|
||||
type: "classroomList/setActionTabs",
|
||||
payload: { key: "\u5BFC\u51FA\u63D0\u9192" }
|
||||
});
|
||||
umi__WEBPACK_IMPORTED_MODULE_1__.history.push(`/classrooms/${params.coursesId}/exportlist/exercise_score`);
|
||||
}
|
||||
});
|
||||
const getDownFile = (params) => __async(void 0, null, function* () {
|
||||
console.log("----------", "\u8C03\u7528\u4E0B\u8F7D");
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/export_records/${params.id}.xlsx`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const getecyears = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/ec_major_schools/0/ec_years.xlsx`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const ExportStudentanalysis = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/courses/${params == null ? void 0 : params.coursesId}/${params.menuKey}_statistic.xlsx?${params.checkedList.map((item) => `course_group_id[]=${item}`).join("&")}`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const getec_training_objectives = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)("", (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({ url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/ec_years/${params == null ? void 0 : params.ec_year_id}/ec_training_objectives.xlsx`, query: params }));
|
||||
});
|
||||
const get_ecs_attachment = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(params == null ? void 0 : params.name, (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({ url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/attachments/get_ecs_attachment.docx`, query: params }));
|
||||
});
|
||||
const getec_courses = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)("", (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({ url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/ec_years/${params == null ? void 0 : params.ec_year_id}/ec_courses.xlsx`, query: params }));
|
||||
});
|
||||
const getec_graduation_requirements = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)("", (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({ url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/ec_years/${params == null ? void 0 : params.ec_year_id}/ec_graduation_requirements.xlsx`, query: params }));
|
||||
});
|
||||
const getrank_list = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)("", (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({ url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/courses/rank_list.xlsx`, query: params }));
|
||||
});
|
||||
const getquestion_rank_list = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)("", (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({ url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/courses/question_rank_list.xlsx`, query: params }));
|
||||
});
|
||||
const exportPaperlibraryPaper = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/examination_banks/${params.id}.json`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const exportClassroomsPaper = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/exercises/${params.categoryId}.json`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const exportCommitResultWord = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/polls/${params == null ? void 0 : params.id}/commit_result.json`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const exportTaskPass = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
"",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/paths/get_task_pass.json`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const exportUserExerciseDetail = (params, title) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)(
|
||||
title || "",
|
||||
(0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({
|
||||
url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/exercises/${params == null ? void 0 : params.exercise_id}/user_exercise_detail.json`,
|
||||
query: params
|
||||
})
|
||||
);
|
||||
});
|
||||
const getmember_works = (params) => __async(void 0, null, function* () {
|
||||
yield (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .downLoadFile */ .FH)("", (0,_util__WEBPACK_IMPORTED_MODULE_2__/* .setUrlQuery */ .NY)({ url: _env__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.API_SERVER + `/api/competitions/${params == null ? void 0 : params.identifier}/competition_commit_records/member_works.xlsx`, query: params }));
|
||||
});
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
@ -0,0 +1,800 @@
|
||||
"use strict";
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[6398],{
|
||||
|
||||
/***/ 96398:
|
||||
/*!*************************************************************!*\
|
||||
!*** ./src/components/QuestionEditor/index.tsx + 4 modules ***!
|
||||
\*************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
tc: function() { return /* reexport */ BProgramEditor/* BProgramEditor */.t; },
|
||||
uh: function() { return /* reexport */ ChoiceQuestionEditor/* ChoiceQuestionEditor */.u; },
|
||||
rL: function() { return /* reexport */ CombinationQuestionEditor; },
|
||||
u8: function() { return /* reexport */ CompletionQuestionEditor/* CompletionQuestionEditor */.u; },
|
||||
ZZ: function() { return /* reexport */ JudgmentQuestionEditor/* JudgmentQuestionEditor */.Z; },
|
||||
Wk: function() { return /* reexport */ SubjectiveQuestionEditor/* SubjectiveQuestionEditor */.W; }
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./src/components/QuestionEditor/ChoiceQuestionEditor.tsx
|
||||
var ChoiceQuestionEditor = __webpack_require__(3477);
|
||||
// EXTERNAL MODULE: ./src/components/QuestionEditor/JudgmentQuestionEditor.tsx
|
||||
var JudgmentQuestionEditor = __webpack_require__(59086);
|
||||
// EXTERNAL MODULE: ./src/components/QuestionEditor/CompletionQuestionEditor.tsx
|
||||
var CompletionQuestionEditor = __webpack_require__(73004);
|
||||
// EXTERNAL MODULE: ./src/components/QuestionEditor/SubjectiveQuestionEditor.tsx
|
||||
var SubjectiveQuestionEditor = __webpack_require__(4950);
|
||||
// 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/collapse/index.js + 8 modules
|
||||
var collapse = __webpack_require__(74997);
|
||||
// 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/row/index.js
|
||||
var row = __webpack_require__(95237);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input-number/index.js + 14 modules
|
||||
var input_number = __webpack_require__(85731);
|
||||
// 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/dropdown/index.js + 1 modules
|
||||
var dropdown = __webpack_require__(38854);
|
||||
// EXTERNAL MODULE: ./src/components/QuestionEditor/index.less?modules
|
||||
var QuestionEditormodules = __webpack_require__(81086);
|
||||
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/MinusCircleOutlined.js + 1 modules
|
||||
var MinusCircleOutlined = __webpack_require__(87306);
|
||||
// EXTERNAL MODULE: ./src/components/QuestionEditor/MdEditorInForm.tsx
|
||||
var MdEditorInForm = __webpack_require__(20252);
|
||||
// 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/col/index.js
|
||||
var col = __webpack_require__(43604);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
||||
var input = __webpack_require__(1056);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/switch/index.js + 2 modules
|
||||
var es_switch = __webpack_require__(78673);
|
||||
;// CONCATENATED MODULE: ./src/components/QuestionEditor/CombinationCompletionQuestionEditor.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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const BlankEditor = ({ value, onChange }) => {
|
||||
const handleDelete = (index) => {
|
||||
modal["default"].confirm({
|
||||
centered: true,
|
||||
okText: "\u786E\u5B9A",
|
||||
cancelText: "\u53D6\u6D88",
|
||||
title: "\u63D0\u793A",
|
||||
content: "\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",
|
||||
className: QuestionEditormodules/* default */.Z.modal,
|
||||
onOk: () => {
|
||||
const valueCopy = [...value];
|
||||
valueCopy.splice(index, 1);
|
||||
onChange(valueCopy);
|
||||
}
|
||||
});
|
||||
};
|
||||
const handleAdd = () => {
|
||||
const valueCopy = [...value];
|
||||
valueCopy.push("");
|
||||
onChange(valueCopy);
|
||||
};
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", className: "ml20", gutter: [40, 20] }, value == null ? void 0 : value.map((v, index) => {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { key: `${v}_${index}`, className: QuestionEditormodules/* default */.Z.blankWrapper }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
input["default"],
|
||||
{
|
||||
className: QuestionEditormodules/* default */.Z.blankInput,
|
||||
defaultValue: v,
|
||||
maxLength: 1e3,
|
||||
onBlur: (e) => {
|
||||
const valueCopy = [...value];
|
||||
const inputTrimValue = e.target.value.trim();
|
||||
valueCopy[index] = inputTrimValue;
|
||||
onChange(valueCopy);
|
||||
}
|
||||
}
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u5220\u9664" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
MinusCircleOutlined/* default */.Z,
|
||||
{
|
||||
className: QuestionEditormodules/* default */.Z.deleteIcon,
|
||||
style: { marginLeft: 15, visibility: index > 0 ? "visible" : "hidden" },
|
||||
onClick: () => handleDelete(index)
|
||||
}
|
||||
)));
|
||||
}), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${QuestionEditormodules/* default */.Z.addBtn}`, onClick: () => {
|
||||
handleAdd();
|
||||
} }, "\u65B0\u589E\u7B54\u6848")));
|
||||
};
|
||||
const ReversedSwitch = ({ value = true, onChange }) => {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_switch/* default */.Z,
|
||||
{
|
||||
checked: !value,
|
||||
onChange: (checked) => {
|
||||
onChange(!checked);
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
const NULL_CH = "\u2581";
|
||||
const CombinationCompletionQuestionEditor_CompletionQuestionEditor = ({
|
||||
questionTitlePlaceholder,
|
||||
form,
|
||||
scoreByBlank = false,
|
||||
answerKey,
|
||||
titleKey = "name",
|
||||
analysisKey = "analysis",
|
||||
isOrdered = "is_ordered"
|
||||
}) => {
|
||||
var _a, _b;
|
||||
const [editAnalysis, setEditAnalysis] = (0,_react_17_0_2_react.useState)(false);
|
||||
const getChCountBeforeCursor = (cm, cursor) => {
|
||||
const currentLine = cursor.line;
|
||||
let placeholderCountBefore = 0;
|
||||
for (let _line = 0; _line < currentLine; _line++) {
|
||||
placeholderCountBefore += cm.getLine(_line).split(NULL_CH).length - 1;
|
||||
}
|
||||
const currentLineStringBeforeCursor = cm.getLine(currentLine).substring(0, cursor.ch);
|
||||
placeholderCountBefore += currentLineStringBeforeCursor.split(NULL_CH).length - 1;
|
||||
return placeholderCountBefore;
|
||||
};
|
||||
const onCMBeforeChange = (cm, change, addBlank2, removeBlank2) => {
|
||||
const rangeText = cm.getRange(change.from, change.to);
|
||||
let newBlankNum = 0;
|
||||
change.text.forEach((item) => {
|
||||
newBlankNum += item.split(NULL_CH).length - 1;
|
||||
});
|
||||
if (change.origin === "setValue") {
|
||||
return;
|
||||
}
|
||||
if (rangeText && rangeText.indexOf(NULL_CH) !== -1) {
|
||||
const placeholderCountInRange = rangeText.split(NULL_CH).length - 1;
|
||||
const placeholderCountBefore = getChCountBeforeCursor(
|
||||
cm,
|
||||
change.from
|
||||
);
|
||||
console.log(
|
||||
`\u5220\u9664${placeholderCountInRange}\u4E2A\uFF0C \u524D\u9762\u6709${placeholderCountBefore}\u4E2A\uFF0C\u65B0\u589E${newBlankNum}\u4E2A`
|
||||
);
|
||||
if (placeholderCountInRange > 1) {
|
||||
const indexArray = Array.from({ length: placeholderCountInRange }, (item, index) => placeholderCountBefore + index);
|
||||
removeBlank2(indexArray);
|
||||
} else {
|
||||
removeBlank2(placeholderCountBefore);
|
||||
}
|
||||
} else if (newBlankNum > 0) {
|
||||
const placeholderCountBefore = getChCountBeforeCursor(
|
||||
cm,
|
||||
change.from
|
||||
);
|
||||
console.log(
|
||||
`\u65B0\u589E${newBlankNum}\u4E2A\uFF0C\u4E4B\u524D\u6709${placeholderCountBefore}\u4E2A`
|
||||
);
|
||||
addBlank2(newBlankNum, placeholderCountBefore);
|
||||
}
|
||||
};
|
||||
const rewritePosition = () => {
|
||||
const preAnswerData = form.getFieldValue(["sub_item_banks", ...answerKey]);
|
||||
form.setFieldValue(
|
||||
["sub_item_banks", ...answerKey],
|
||||
preAnswerData == null ? void 0 : preAnswerData.map((item, index) => __spreadProps(__spreadValues({}, item), { position: index + 1 }))
|
||||
);
|
||||
};
|
||||
const addFnRef = (0,_react_17_0_2_react.useRef)();
|
||||
const addBlank = (addNum, insertIndex) => {
|
||||
for (let i = 0; i < addNum; i++) {
|
||||
addFnRef.current({ position: null, answer_text: [""] }, insertIndex + i);
|
||||
}
|
||||
rewritePosition();
|
||||
};
|
||||
const removeFnRef = (0,_react_17_0_2_react.useRef)();
|
||||
const removeBlank = (deleteIndex) => {
|
||||
removeFnRef.current(deleteIndex);
|
||||
rewritePosition();
|
||||
};
|
||||
const standardAnswersValue = (_b = (_a = form.getFieldValue("sub_item_banks")) == null ? void 0 : _a[answerKey == null ? void 0 : answerKey[0]]) == null ? void 0 : _b[answerKey == null ? void 0 : answerKey[1]];
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: QuestionEditormodules/* default */.Z.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: QuestionEditormodules/* default */.Z.questionTitleEditorWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u9898\u5E72", name: titleKey, labelCol: { span: 24 }, rules: [{ required: true }] }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
MdEditorInForm/* MdEditorInForm */.h,
|
||||
{
|
||||
scrollId: "name",
|
||||
watch: true,
|
||||
height: 140,
|
||||
placeholder: questionTitlePlaceholder,
|
||||
showNullButton: true,
|
||||
onCMBeforeChange: (cm, change) => {
|
||||
onCMBeforeChange(cm, change, addBlank, removeBlank);
|
||||
}
|
||||
}
|
||||
))), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_form["default"].List,
|
||||
{
|
||||
name: answerKey,
|
||||
rules: [{
|
||||
validator(rule, values) {
|
||||
if ((values == null ? void 0 : values.length) === 0) {
|
||||
return Promise.reject(new Error("\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"));
|
||||
}
|
||||
for (const item of values) {
|
||||
const { answer_text } = item || {};
|
||||
if (answer_text == null ? void 0 : answer_text.some((text) => (text == null ? void 0 : text.length) === 0)) {
|
||||
return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"));
|
||||
}
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
}]
|
||||
},
|
||||
(fields, { add, remove }, { errors }) => {
|
||||
addFnRef.current = add;
|
||||
removeFnRef.current = remove;
|
||||
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, { label: "\u7B54\u6848\u9009\u9879", required: true, labelCol: { span: 24 } }), fields.map((_a2, index) => {
|
||||
var _b2 = _a2, { key, name } = _b2, restField = __objRest(_b2, ["key", "name"]);
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: `mb20`, key, align: "middle", wrap: false }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: "0 0 auto", className: `${QuestionEditormodules/* default */.Z.blankIndex}` }, "\u586B\u7A7A\u9879", index + 1), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: 1 }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "top", justify: "space-between", wrap: false }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, __spreadProps(__spreadValues({}, restField), { name: [name, "answer_text"], noStyle: true }), /* @__PURE__ */ _react_17_0_2_react.createElement(BlankEditor, null))), scoreByBlank && /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: "224px" }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, __spreadProps(__spreadValues({}, restField), { name: [name, "score"], label: "\u5206\u503C", rules: [{ required: true }], className: QuestionEditormodules/* default */.Z.blankInputNumberWrapper }), /* @__PURE__ */ _react_17_0_2_react.createElement(input_number/* default */.Z, { className: QuestionEditormodules/* default */.Z.blankInput, min: 0.1, max: 100, precision: 1, style: { width: "100%" }, placeholder: "\u6309\u7A7A\u7ED9\u5206\u8BF7\u8F93\u5165\u5206\u503C" })))), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, __spreadProps(__spreadValues({}, restField), { name: [name, "position"], noStyle: true }), /* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { type: "hidden" }))));
|
||||
}));
|
||||
}
|
||||
), (standardAnswersValue == null ? void 0 : standardAnswersValue.length) > 1 && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
row/* default */.Z,
|
||||
{
|
||||
align: "middle",
|
||||
className: (standardAnswersValue == null ? void 0 : standardAnswersValue.length) > 1 ? "mb30" : `${QuestionEditormodules/* default */.Z.hide}`
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { name: isOrdered }, /* @__PURE__ */ _react_17_0_2_react.createElement(ReversedSwitch, null)),
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: "ml10" }, "\u5141\u8BB8\u5B66\u751F\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u4E0E\u6807\u51C6\u7B54\u6848\u7684\u987A\u5E8F\u4E0D\u4E00\u81F4")
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: () => setEditAnalysis(true) }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { name: analysisKey, label: "\u9898\u76EE\u89E3\u6790", labelCol: { span: 24 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(MdEditorInForm/* RegularInput */.x, { placeholder: "\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09", isEdit: editAnalysis }))));
|
||||
};
|
||||
|
||||
|
||||
;// CONCATENATED MODULE: ./src/components/QuestionEditor/CombinationJudgmentQuestionEditor.tsx
|
||||
var CombinationJudgmentQuestionEditor_defProp = Object.defineProperty;
|
||||
var CombinationJudgmentQuestionEditor_defProps = Object.defineProperties;
|
||||
var CombinationJudgmentQuestionEditor_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
||||
var CombinationJudgmentQuestionEditor_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
||||
var CombinationJudgmentQuestionEditor_hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var CombinationJudgmentQuestionEditor_propIsEnum = Object.prototype.propertyIsEnumerable;
|
||||
var CombinationJudgmentQuestionEditor_defNormalProp = (obj, key, value) => key in obj ? CombinationJudgmentQuestionEditor_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
||||
var CombinationJudgmentQuestionEditor_spreadValues = (a, b) => {
|
||||
for (var prop in b || (b = {}))
|
||||
if (CombinationJudgmentQuestionEditor_hasOwnProp.call(b, prop))
|
||||
CombinationJudgmentQuestionEditor_defNormalProp(a, prop, b[prop]);
|
||||
if (CombinationJudgmentQuestionEditor_getOwnPropSymbols)
|
||||
for (var prop of CombinationJudgmentQuestionEditor_getOwnPropSymbols(b)) {
|
||||
if (CombinationJudgmentQuestionEditor_propIsEnum.call(b, prop))
|
||||
CombinationJudgmentQuestionEditor_defNormalProp(a, prop, b[prop]);
|
||||
}
|
||||
return a;
|
||||
};
|
||||
var CombinationJudgmentQuestionEditor_spreadProps = (a, b) => CombinationJudgmentQuestionEditor_defProps(a, CombinationJudgmentQuestionEditor_getOwnPropDescs(b));
|
||||
var CombinationJudgmentQuestionEditor_objRest = (source, exclude) => {
|
||||
var target = {};
|
||||
for (var prop in source)
|
||||
if (CombinationJudgmentQuestionEditor_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
||||
target[prop] = source[prop];
|
||||
if (source != null && CombinationJudgmentQuestionEditor_getOwnPropSymbols)
|
||||
for (var prop of CombinationJudgmentQuestionEditor_getOwnPropSymbols(source)) {
|
||||
if (exclude.indexOf(prop) < 0 && CombinationJudgmentQuestionEditor_propIsEnum.call(source, prop))
|
||||
target[prop] = source[prop];
|
||||
}
|
||||
return target;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
const tagMap = {
|
||||
["\u6B63\u786E"]: "T",
|
||||
["\u9519\u8BEF"]: "F"
|
||||
};
|
||||
const JudgmentQuestionItem = ({ value, onChange, form, choiceKey }) => {
|
||||
const isActiveAnswer = (value == null ? void 0 : value.is_answer) === 1;
|
||||
const judgementText = value == null ? void 0 : value.choice_text;
|
||||
const setActiveAnswer = () => {
|
||||
var _a;
|
||||
const formListValue = (_a = form == null ? void 0 : form.getFieldValue(["sub_item_banks", ...choiceKey])) == null ? void 0 : _a.map((choice) => ({ choice_text: choice.choice_text, is_answer: 0 }));
|
||||
form == null ? void 0 : form.setFieldValue(["sub_item_banks", ...choiceKey], formListValue);
|
||||
onChange(CombinationJudgmentQuestionEditor_spreadProps(CombinationJudgmentQuestionEditor_spreadValues({}, value), { is_answer: 1 }));
|
||||
};
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: QuestionEditormodules/* default */.Z.choiceWrap, align: "middle", wrap: false }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { onClick: setActiveAnswer, className: `${QuestionEditormodules/* default */.Z.choiceIndex} ${QuestionEditormodules/* default */.Z.judgementIndex} ${isActiveAnswer ? QuestionEditormodules/* default */.Z.activeAnswer : ""}` }, tagMap[judgementText]), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: 1, className: `${QuestionEditormodules/* default */.Z.editorWrap} ml15` }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${QuestionEditormodules/* default */.Z.inputBorder} ${QuestionEditormodules/* default */.Z.placeholder} ${isActiveAnswer ? QuestionEditormodules/* default */.Z.activeJudgementAnswer : ""}` }, judgementText)), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
col/* default */.Z,
|
||||
{
|
||||
flex: "0 0 auto",
|
||||
className: "ml15"
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"div",
|
||||
{
|
||||
onClick: setActiveAnswer,
|
||||
className: `${QuestionEditormodules/* default */.Z.setAnswerBtn} ${isActiveAnswer ? QuestionEditormodules/* default */.Z.activeAnswer : ""}`
|
||||
},
|
||||
isActiveAnswer ? "\u6B63\u786E\u7B54\u6848" : "\u8BBE\u4E3A\u7B54\u6848"
|
||||
)
|
||||
));
|
||||
};
|
||||
const CombinationJudgmentQuestionEditor_JudgmentQuestionEditor = ({
|
||||
questionTitlePlaceholder,
|
||||
choiceKey = "choices",
|
||||
form,
|
||||
titleKey = "name",
|
||||
analysisKey = "analysis"
|
||||
}) => {
|
||||
const [editAnalysis, setEditAnalysis] = (0,_react_17_0_2_react.useState)(false);
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: QuestionEditormodules/* default */.Z.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: QuestionEditormodules/* default */.Z.questionTitleEditorWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u9898\u5E72", name: titleKey, labelCol: { span: 24 }, rules: [{ required: true }] }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
MdEditorInForm/* MdEditorInForm */.h,
|
||||
{
|
||||
scrollId: "name",
|
||||
watch: true,
|
||||
height: 140,
|
||||
placeholder: questionTitlePlaceholder
|
||||
}
|
||||
))), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u7B54\u6848\u9009\u9879", required: true, labelCol: { span: 24 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_form["default"].List,
|
||||
{
|
||||
name: choiceKey,
|
||||
rules: [{
|
||||
validator(rule, values) {
|
||||
const hasAnswer = values.some((option) => (option == null ? void 0 : option.is_answer) === 1);
|
||||
if (hasAnswer) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
return Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"));
|
||||
}
|
||||
}]
|
||||
},
|
||||
(fields) => /* @__PURE__ */ _react_17_0_2_react.createElement("div", { id: "choices" }, fields.map((_a) => {
|
||||
var _b = _a, { key, name } = _b, restField = CombinationJudgmentQuestionEditor_objRest(_b, ["key", "name"]);
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, CombinationJudgmentQuestionEditor_spreadProps(CombinationJudgmentQuestionEditor_spreadValues({}, restField), { key, name, noStyle: true }), /* @__PURE__ */ _react_17_0_2_react.createElement(JudgmentQuestionItem, { form, choiceKey }));
|
||||
}))
|
||||
)), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: () => setEditAnalysis(true) }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { name: analysisKey, label: "\u9898\u76EE\u89E3\u6790", labelCol: { span: 24 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(MdEditorInForm/* RegularInput */.x, { placeholder: "\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09", isEdit: editAnalysis }))));
|
||||
};
|
||||
|
||||
|
||||
// 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/tag/index.js + 5 modules
|
||||
var tag = __webpack_require__(12563);
|
||||
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 14 modules
|
||||
var markdown_editor = __webpack_require__(20103);
|
||||
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/QuestionCircleOutlined.js + 1 modules
|
||||
var QuestionCircleOutlined = __webpack_require__(98815);
|
||||
;// CONCATENATED MODULE: ./src/components/QuestionEditor/CombinationSubjectiveQuestionEditor.tsx
|
||||
var CombinationSubjectiveQuestionEditor_defProp = Object.defineProperty;
|
||||
var CombinationSubjectiveQuestionEditor_defProps = Object.defineProperties;
|
||||
var CombinationSubjectiveQuestionEditor_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
||||
var CombinationSubjectiveQuestionEditor_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
||||
var CombinationSubjectiveQuestionEditor_hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var CombinationSubjectiveQuestionEditor_propIsEnum = Object.prototype.propertyIsEnumerable;
|
||||
var CombinationSubjectiveQuestionEditor_defNormalProp = (obj, key, value) => key in obj ? CombinationSubjectiveQuestionEditor_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
||||
var CombinationSubjectiveQuestionEditor_spreadValues = (a, b) => {
|
||||
for (var prop in b || (b = {}))
|
||||
if (CombinationSubjectiveQuestionEditor_hasOwnProp.call(b, prop))
|
||||
CombinationSubjectiveQuestionEditor_defNormalProp(a, prop, b[prop]);
|
||||
if (CombinationSubjectiveQuestionEditor_getOwnPropSymbols)
|
||||
for (var prop of CombinationSubjectiveQuestionEditor_getOwnPropSymbols(b)) {
|
||||
if (CombinationSubjectiveQuestionEditor_propIsEnum.call(b, prop))
|
||||
CombinationSubjectiveQuestionEditor_defNormalProp(a, prop, b[prop]);
|
||||
}
|
||||
return a;
|
||||
};
|
||||
var CombinationSubjectiveQuestionEditor_spreadProps = (a, b) => CombinationSubjectiveQuestionEditor_defProps(a, CombinationSubjectiveQuestionEditor_getOwnPropDescs(b));
|
||||
var CombinationSubjectiveQuestionEditor_objRest = (source, exclude) => {
|
||||
var target = {};
|
||||
for (var prop in source)
|
||||
if (CombinationSubjectiveQuestionEditor_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
||||
target[prop] = source[prop];
|
||||
if (source != null && CombinationSubjectiveQuestionEditor_getOwnPropSymbols)
|
||||
for (var prop of CombinationSubjectiveQuestionEditor_getOwnPropSymbols(source)) {
|
||||
if (exclude.indexOf(prop) < 0 && CombinationSubjectiveQuestionEditor_propIsEnum.call(source, prop))
|
||||
target[prop] = source[prop];
|
||||
}
|
||||
return target;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const AnswerTextFormItem = (_a) => {
|
||||
var _b = _a, { value, onChange } = _b, props = CombinationSubjectiveQuestionEditor_objRest(_b, ["value", "onChange"]);
|
||||
const handleChange = (v) => {
|
||||
onChange([v]);
|
||||
};
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
markdown_editor/* default */.Z,
|
||||
CombinationSubjectiveQuestionEditor_spreadProps(CombinationSubjectiveQuestionEditor_spreadValues({}, props), {
|
||||
defaultValue: value == null ? void 0 : value[0],
|
||||
onChange: handleChange
|
||||
})
|
||||
);
|
||||
};
|
||||
const test = (str) => {
|
||||
if (!str) {
|
||||
return false;
|
||||
}
|
||||
let containSpecial = new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~\uFF01@#\uFFE5\u2026\u2026&*\uFF08\uFF09\u2014\u3010\u3011\u2018\uFF1B\uFF1A\u201D\u201C\u3002\uFF0C\u3001\uFF1F\u300C\u300D\u300E\u300F_\\+\\-\xB7%\u300A\u300B]|[\\\\/]");
|
||||
if (str === "|") {
|
||||
message/* default */.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
const KeywordTag = ({ value = [], onClose }) => {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(tag["default"], { closable: true, onClose, className: QuestionEditormodules/* default */.Z.keywordTag }, /* @__PURE__ */ _react_17_0_2_react.createElement("pre", { style: { margin: "0px", whiteSpace: "pre-wrap" } }, value.join(" \u6216 ")));
|
||||
};
|
||||
const CombinationSubjectiveQuestionEditor_SubjectiveQuestionEditor = ({
|
||||
questionTitlePlaceholder,
|
||||
form,
|
||||
showKeywords,
|
||||
isMustKeyWords = showKeywords,
|
||||
titleKey = "name",
|
||||
analysisKey = "analysis",
|
||||
answerTexts = "answer_texts",
|
||||
keywords = "keywords",
|
||||
useKeywords = "use_keywords",
|
||||
indexs
|
||||
}) => {
|
||||
const [editAnalysis, setEditAnalysis] = (0,_react_17_0_2_react.useState)(false);
|
||||
const [keywordsInput, setKeywordsInput] = (0,_react_17_0_2_react.useState)("");
|
||||
const [useKeywordsValue, setuseKeywordsValue] = (0,_react_17_0_2_react.useState)(false);
|
||||
const questionScore = es_form["default"].useWatch("question_score", form);
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: QuestionEditormodules/* default */.Z.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: QuestionEditormodules/* default */.Z.questionTitleEditorWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u9898\u5E72", name: titleKey, labelCol: { span: 24 }, rules: [{ required: true }] }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
MdEditorInForm/* MdEditorInForm */.h,
|
||||
{
|
||||
scrollId: "name",
|
||||
watch: true,
|
||||
height: 140,
|
||||
placeholder: questionTitlePlaceholder
|
||||
}
|
||||
))), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u53C2\u8003\u7B54\u6848", name: answerTexts, labelCol: { span: 24 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
AnswerTextFormItem,
|
||||
{
|
||||
watch: true,
|
||||
height: 140,
|
||||
placeholder: "\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09"
|
||||
}
|
||||
)), showKeywords && !isMustKeyWords && /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { hidden: true, name: useKeywords, valuePropName: "checked" }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_switch/* default */.Z, { defaultChecked: true })), showKeywords && isMustKeyWords && /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", className: "mb30" }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { name: useKeywords, valuePropName: "checked" }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_switch/* default */.Z, { onChange: () => {
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
console.log(form.getFieldsValue());
|
||||
setuseKeywordsValue((_c = (_b = (_a = form.getFieldsValue()) == null ? void 0 : _a.sub_item_banks) == null ? void 0 : _b[indexs]) == null ? void 0 : _c.use_keywords);
|
||||
console.log((_f = (_e = (_d = form.getFieldsValue()) == null ? void 0 : _d.sub_item_banks) == null ? void 0 : _e[indexs]) == null ? void 0 : _f.use_keywords);
|
||||
console.log(useKeywordsValue);
|
||||
} })), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: "ml10" }, "\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
tooltip/* default */.Z,
|
||||
{
|
||||
placement: "right",
|
||||
title: "\u9009\u4E2D\u540E\uFF0C\u9700\u8981\u8BBE\u7F6E\u6BCF\u4E2A\u5173\u952E\u8BCD\u7684\u5206\u503C\uFF0C\u7CFB\u7EDF\u4F1A\u6839\u636E\u8BBE\u7F6E\u7684\u5173\u952E\u8BCD\u8FDB\u884C\u81EA\u52A8\u5224\u5206\uFF1B \u6240\u6709\u5173\u952E\u8BCD\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u5C0F\u9898\u5206\u503C\u3002"
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(QuestionCircleOutlined/* default */.Z, { style: { color: "#3061D0", marginLeft: 6, cursor: "pointer" } })
|
||||
))), (useKeywordsValue || !isMustKeyWords) && /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].List, { name: keywords, rules: [{
|
||||
validator(rule, values) {
|
||||
if (!isMustKeyWords) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
if (!(values == null ? void 0 : values.length)) {
|
||||
return Promise.reject(new Error("\u8BF7\u8F93\u5165\u5173\u952E\u8BCD"));
|
||||
}
|
||||
const keywordsScoreSum = values == null ? void 0 : values.reduce((pre, cur) => pre + cur.score, 0);
|
||||
if (keywordsScoreSum > parseFloat(questionScore)) {
|
||||
return Promise.reject(new Error("\u6240\u6709\u5173\u952E\u8BCD\u7684\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u8BE5\u5C0F\u9898\u7684\u5206\u503C"));
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
}] }, (fields, { add, remove }) => /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${QuestionEditormodules/* default */.Z.title} mb10` }, !isMustKeyWords ? /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#9096A3" } }, "\u5224\u5206\u5173\u952E\u8BCD") : "\u5173\u952E\u8BCD"), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", className: "font14 mb30" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: 1 }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
input["default"],
|
||||
{
|
||||
value: keywordsInput,
|
||||
onChange: (e) => {
|
||||
setKeywordsInput(e.target.value);
|
||||
},
|
||||
maxLength: 50,
|
||||
allowClear: true,
|
||||
onPressEnter: (e) => {
|
||||
var _a, _b, _c, _d;
|
||||
const v = `${(_a = e.target) == null ? void 0 : _a.value}`;
|
||||
const keywordArr = (_c = (_b = v == null ? void 0 : v.split("|")) == null ? void 0 : _b.filter((k) => !!k)) == null ? void 0 : _c.map((item) => item == null ? void 0 : item.trim());
|
||||
const currentKeywordsValue = form.getFieldValue(["sub_item_banks", ...keywords]);
|
||||
const existKeywords = ((_d = currentKeywordsValue == null ? void 0 : currentKeywordsValue.map((item) => item == null ? void 0 : item.keyword)) == null ? void 0 : _d.flat()) || [];
|
||||
for (const word of keywordArr) {
|
||||
if (existKeywords.includes(word)) {
|
||||
message/* default */.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (test(v)) {
|
||||
add({ keyword: keywordArr, score: 1 });
|
||||
setKeywordsInput("");
|
||||
}
|
||||
},
|
||||
className: QuestionEditormodules/* default */.Z.inputBorder,
|
||||
placeholder: "\u652F\u6301\u8BBE\u7F6E\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u8BF7\u7528\u201C|\u201D\u5206\u9694\u5F00"
|
||||
}
|
||||
)), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: "148px", style: { textAlign: "right", color: "#9096A3" } }, "\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")), fields.map((_a) => {
|
||||
var _b = _a, { key, name } = _b, restField = CombinationSubjectiveQuestionEditor_objRest(_b, ["key", "name"]);
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { key, className: "mb20", style: { marginRight: 148 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: 1 }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", justify: "space-between" }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, CombinationSubjectiveQuestionEditor_spreadProps(CombinationSubjectiveQuestionEditor_spreadValues({}, restField), { name: [name, "keyword"] }), /* @__PURE__ */ _react_17_0_2_react.createElement(KeywordTag, { onClose: () => remove(name) })), isMustKeyWords && /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, CombinationSubjectiveQuestionEditor_spreadProps(CombinationSubjectiveQuestionEditor_spreadValues({}, restField), { name: [name, "score"], label: "\u5206\u503C", rules: [{ required: true }], className: QuestionEditormodules/* default */.Z.blankInputNumberWrapper }), /* @__PURE__ */ _react_17_0_2_react.createElement(input_number/* default */.Z, { className: QuestionEditormodules/* default */.Z.blankInput, min: 0.1, max: 100, precision: 1, style: { width: "100%" }, placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570" })))));
|
||||
}))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: () => setEditAnalysis(true) }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { name: analysisKey, label: "\u9898\u76EE\u89E3\u6790", labelCol: { span: 24 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(MdEditorInForm/* RegularInput */.x, { placeholder: "\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09", isEdit: editAnalysis }))));
|
||||
};
|
||||
|
||||
|
||||
;// CONCATENATED MODULE: ./src/components/QuestionEditor/CombinationQuestionEditor.tsx
|
||||
var CombinationQuestionEditor_defProp = Object.defineProperty;
|
||||
var CombinationQuestionEditor_defProps = Object.defineProperties;
|
||||
var CombinationQuestionEditor_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
||||
var CombinationQuestionEditor_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
||||
var CombinationQuestionEditor_hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var CombinationQuestionEditor_propIsEnum = Object.prototype.propertyIsEnumerable;
|
||||
var CombinationQuestionEditor_defNormalProp = (obj, key, value) => key in obj ? CombinationQuestionEditor_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
||||
var CombinationQuestionEditor_spreadValues = (a, b) => {
|
||||
for (var prop in b || (b = {}))
|
||||
if (CombinationQuestionEditor_hasOwnProp.call(b, prop))
|
||||
CombinationQuestionEditor_defNormalProp(a, prop, b[prop]);
|
||||
if (CombinationQuestionEditor_getOwnPropSymbols)
|
||||
for (var prop of CombinationQuestionEditor_getOwnPropSymbols(b)) {
|
||||
if (CombinationQuestionEditor_propIsEnum.call(b, prop))
|
||||
CombinationQuestionEditor_defNormalProp(a, prop, b[prop]);
|
||||
}
|
||||
return a;
|
||||
};
|
||||
var CombinationQuestionEditor_spreadProps = (a, b) => CombinationQuestionEditor_defProps(a, CombinationQuestionEditor_getOwnPropDescs(b));
|
||||
var CombinationQuestionEditor_objRest = (source, exclude) => {
|
||||
var target = {};
|
||||
for (var prop in source)
|
||||
if (CombinationQuestionEditor_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
||||
target[prop] = source[prop];
|
||||
if (source != null && CombinationQuestionEditor_getOwnPropSymbols)
|
||||
for (var prop of CombinationQuestionEditor_getOwnPropSymbols(source)) {
|
||||
if (exclude.indexOf(prop) < 0 && CombinationQuestionEditor_propIsEnum.call(source, prop))
|
||||
target[prop] = source[prop];
|
||||
}
|
||||
return target;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const { Panel } = collapse["default"];
|
||||
const CombinationQuestionEditor = ({
|
||||
questionTitlePlaceholder,
|
||||
choiceKey,
|
||||
form,
|
||||
withScore
|
||||
}) => {
|
||||
const [activeKey, setActiveKey] = (0,_react_17_0_2_react.useState)([]);
|
||||
const handleCollapseChange = (keys) => {
|
||||
setActiveKey(keys);
|
||||
};
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: QuestionEditormodules/* default */.Z.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: QuestionEditormodules/* default */.Z.questionTitleEditorWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u9898\u5E72", name: "name", labelCol: { span: 24 }, rules: [{ required: true }] }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
MdEditorInForm/* MdEditorInForm */.h,
|
||||
{
|
||||
scrollId: "name",
|
||||
watch: true,
|
||||
height: 140,
|
||||
placeholder: questionTitlePlaceholder
|
||||
}
|
||||
))), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u5C0F\u9898", required: true, labelCol: { span: 24 } }), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].List, { name: "sub_item_banks", rules: [{
|
||||
validator(rule, values) {
|
||||
if (!values) {
|
||||
return Promise.reject(new Error("\u8BF7\u6DFB\u52A0\u5C0F\u9898"));
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
}] }, (fields, { add, remove }) => {
|
||||
const item_list = form.getFieldValue("sub_item_banks");
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
collapse["default"],
|
||||
{
|
||||
className: fields.length > 0 ? QuestionEditormodules/* default */.Z.collapseWrapper : "",
|
||||
bordered: false,
|
||||
activeKey,
|
||||
onChange: handleCollapseChange,
|
||||
expandIcon: ({ isActive }) => /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: `iconfont icon-weizhankai ${isActive ? QuestionEditormodules/* default */.Z.open : QuestionEditormodules/* default */.Z.close}`, style: { fontSize: 14, transition: "all .2s" } })
|
||||
},
|
||||
fields.map((_a, index) => {
|
||||
var _b = _a, { key, name } = _b, restField = CombinationQuestionEditor_objRest(_b, ["key", "name"]);
|
||||
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j;
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
Panel,
|
||||
{
|
||||
className: QuestionEditormodules/* default */.Z.panel,
|
||||
forceRender: true,
|
||||
header: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: QuestionEditormodules/* default */.Z.panelHeader }, "\u7B2C", index + 1, "\u5C0F\u9898", /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\uFF08", ((_a2 = item_list == null ? void 0 : item_list[name]) == null ? void 0 : _a2.item_type) == "SINGLE" ? "\u5355\u9009\u9898" : ((_b2 = item_list == null ? void 0 : item_list[name]) == null ? void 0 : _b2.item_type) == "MULTIPLE" ? "\u591A\u9009\u9898" : ((_c = item_list == null ? void 0 : item_list[name]) == null ? void 0 : _c.item_type) == "COMPLETION" ? "\u586B\u7A7A\u9898" : ((_d = item_list == null ? void 0 : item_list[name]) == null ? void 0 : _d.item_type) == "JUDGMENT" ? "\u5224\u65AD\u9898" : "\u7B80\u7B54\u9898", "\uFF09")),
|
||||
key: name,
|
||||
extra: /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", onClick: (e) => e.stopPropagation() }, withScore && /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, CombinationQuestionEditor_spreadProps(CombinationQuestionEditor_spreadValues({}, restField), { rules: [{ required: true, message: "\u8BF7\u8F93\u5165\u5C0F\u9898\u5206\u503C" }], label: "\u5206\u503C", name: [name, "question_score"], className: QuestionEditormodules/* default */.Z.blankInputNumberWrapper }), /* @__PURE__ */ _react_17_0_2_react.createElement(input_number/* default */.Z, { className: QuestionEditormodules/* default */.Z.blankInput, placeholder: "\u8BF7\u8F93\u5165\u5F53\u524D\u5C0F\u9898\u5206\u6570", min: 0.1, precision: 1, max: 100, style: { width: 150 } })), /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u5220\u9664" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
MinusCircleOutlined/* default */.Z,
|
||||
{
|
||||
className: `${QuestionEditormodules/* default */.Z.deleteIcon} ml40`,
|
||||
onClick: () => remove(name)
|
||||
}
|
||||
)))
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_form["default"].Item,
|
||||
CombinationQuestionEditor_spreadProps(CombinationQuestionEditor_spreadValues({}, restField), {
|
||||
name
|
||||
}),
|
||||
(((_e = item_list == null ? void 0 : item_list[name]) == null ? void 0 : _e.item_type) == "SINGLE" || ((_f = item_list == null ? void 0 : item_list[name]) == null ? void 0 : _f.item_type) == "MULTIPLE") && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
ChoiceQuestionEditor/* ChoiceQuestionEditor */.u,
|
||||
{
|
||||
questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u9009\u62E9\u9898\u9898\u5E72\u5185\u5BB9",
|
||||
allowChangeMode: ((_g = item_list == null ? void 0 : item_list[name]) == null ? void 0 : _g.item_type) == "MULTIPLE" ? true : false,
|
||||
form,
|
||||
choiceKey: [name, "choices"],
|
||||
titleKey: [name, "name"],
|
||||
analysisKey: [name, "analysis"],
|
||||
choiceOptionsPath: ["sub_item_banks", name, "choices"],
|
||||
choiceTextKey: "choice_text",
|
||||
answerKey: "is_answer"
|
||||
}
|
||||
),
|
||||
((_h = item_list == null ? void 0 : item_list[name]) == null ? void 0 : _h.item_type) == "COMPLETION" && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
CombinationCompletionQuestionEditor_CompletionQuestionEditor,
|
||||
{
|
||||
form,
|
||||
questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",
|
||||
scoreByBlank: false,
|
||||
titleKey: [name, "name"],
|
||||
analysisKey: [name, "analysis"],
|
||||
isOrdered: [name, "is_ordered"],
|
||||
answerKey: [name, "standard_answers"]
|
||||
}
|
||||
),
|
||||
((_i = item_list == null ? void 0 : item_list[name]) == null ? void 0 : _i.item_type) == "JUDGMENT" && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
CombinationJudgmentQuestionEditor_JudgmentQuestionEditor,
|
||||
{
|
||||
form,
|
||||
questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u5224\u65AD\u9898\u9898\u5E72\u5185\u5BB9",
|
||||
titleKey: [name, "name"],
|
||||
analysisKey: [name, "analysis"],
|
||||
choiceKey: [name, "choices"]
|
||||
}
|
||||
),
|
||||
((_j = item_list == null ? void 0 : item_list[name]) == null ? void 0 : _j.item_type) == "SUBJECTIVE" && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
CombinationSubjectiveQuestionEditor_SubjectiveQuestionEditor,
|
||||
{
|
||||
showKeywords: true,
|
||||
isMustKeyWords: false,
|
||||
form,
|
||||
titleKey: [name, "name"],
|
||||
analysisKey: [name, "analysis"],
|
||||
answerTexts: [name, "answer_texts"],
|
||||
useKeywords: [name, "use_keywords"],
|
||||
keywords: [name, "keywords"],
|
||||
indexs: name,
|
||||
questionTitlePlaceholder: "\u8BF7\u7F16\u8F91\u7B80\u7B54\u9898\u9898\u5E72\u5185\u5BB9"
|
||||
}
|
||||
)
|
||||
)
|
||||
);
|
||||
})
|
||||
), fields.length < 20 && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
dropdown/* default */.Z,
|
||||
{
|
||||
menu: {
|
||||
items: [
|
||||
{
|
||||
label: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: () => {
|
||||
add({
|
||||
name: "",
|
||||
choices: Array.from({ length: 4 }, () => ({ choice_text: "", is_answer: 0 })),
|
||||
analysis: "",
|
||||
item_type: "SINGLE"
|
||||
});
|
||||
setActiveKey([fields == null ? void 0 : fields.length, ...activeKey]);
|
||||
} }, "\u5355\u9009\u9898"),
|
||||
key: "1",
|
||||
show: true
|
||||
},
|
||||
{
|
||||
label: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: () => {
|
||||
add({
|
||||
name: "",
|
||||
choices: Array.from({ length: 4 }, () => ({ choice_text: "", is_answer: 0 })),
|
||||
analysis: "",
|
||||
item_type: "MULTIPLE"
|
||||
});
|
||||
setActiveKey([fields == null ? void 0 : fields.length, ...activeKey]);
|
||||
} }, "\u591A\u9009\u9898"),
|
||||
key: "2",
|
||||
show: true
|
||||
},
|
||||
{
|
||||
label: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: () => {
|
||||
add({
|
||||
name: "",
|
||||
choices: [{ choice_text: "\u6B63\u786E", is_answer: 0 }, { choice_text: "\u9519\u8BEF", is_answer: 0 }],
|
||||
analysis: "",
|
||||
item_type: "JUDGMENT"
|
||||
});
|
||||
setActiveKey([fields == null ? void 0 : fields.length, ...activeKey]);
|
||||
} }, "\u5224\u65AD\u9898"),
|
||||
key: "3",
|
||||
show: true
|
||||
},
|
||||
{
|
||||
label: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: () => {
|
||||
add({
|
||||
name: "",
|
||||
analysis: "",
|
||||
is_ordered: true,
|
||||
standard_answers: [],
|
||||
item_type: "COMPLETION"
|
||||
});
|
||||
setActiveKey([fields == null ? void 0 : fields.length, ...activeKey]);
|
||||
} }, "\u586B\u7A7A\u9898"),
|
||||
key: "4",
|
||||
show: true
|
||||
},
|
||||
{
|
||||
label: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: () => {
|
||||
add({
|
||||
name: "",
|
||||
answer_texts: [],
|
||||
keywords: [],
|
||||
use_keywords: true,
|
||||
analysis: "",
|
||||
item_type: "SUBJECTIVE"
|
||||
});
|
||||
setActiveKey([fields == null ? void 0 : fields.length, ...activeKey]);
|
||||
} }, "\u7B80\u7B54\u9898"),
|
||||
key: "5",
|
||||
show: true
|
||||
}
|
||||
].filter((item) => item.show).map((item) => ({ label: item.label, key: item.key }))
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${QuestionEditormodules/* default */.Z.addBtn}` }, "\u6DFB\u52A0\u5C0F\u9898")
|
||||
));
|
||||
}));
|
||||
};
|
||||
|
||||
|
||||
// EXTERNAL MODULE: ./src/components/QuestionEditor/BProgramEditor.tsx
|
||||
var BProgramEditor = __webpack_require__(7152);
|
||||
;// CONCATENATED MODULE: ./src/components/QuestionEditor/index.tsx
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
@ -0,0 +1,511 @@
|
||||
"use strict";
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[6892],{
|
||||
|
||||
/***/ 26892:
|
||||
/*!***************************************************************!*\
|
||||
!*** ./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__(1056);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
|
||||
var table = __webpack_require__(72315);
|
||||
;// 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__(86151);
|
||||
;// 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"]);
|
||||
const res = 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);
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
@ -0,0 +1,268 @@
|
||||
"use strict";
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[7206],{
|
||||
|
||||
/***/ 97206:
|
||||
/*!*************************************************************************!*\
|
||||
!*** ./src/pages/Shixuns/Detail/components/Right/index.tsx + 4 modules ***!
|
||||
\*************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ components_Right; }
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
||||
var _react_17_0_2_react = __webpack_require__(59301);
|
||||
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 14 modules
|
||||
var _umi_production_exports = __webpack_require__(87210);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/progress/index.js + 13 modules
|
||||
var progress = __webpack_require__(93948);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
||||
var tooltip = __webpack_require__(6848);
|
||||
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/components/Right/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var Rightmodules = ({"flex_box_center":"flex_box_center___PT9hL","flex_space_between":"flex_space_between___n2Hu5","flex_box_vertical_center":"flex_box_vertical_center___dwn6D","flex_box_center_end":"flex_box_center_end___TwHBO","flex_box_column":"flex_box_column___eAUqU","rightWrap":"rightWrap___Y_2WO","learnWrap":"learnWrap___mca1k","learnTopWrap":"learnTopWrap___cn6Tj","courseWrap":"courseWrap___N3Z6X","pathWrap":"pathWrap___QSdXs","pathImg":"pathImg___VjPqu","pathContentItem":"pathContentItem___sxOSQ","pathContentWrap":"pathContentWrap___WttwX","pathContentName":"pathContentName___evsEv","pathContent":"pathContent___fz4ds","pathContentCount":"pathContentCount___Jlv3G","recommandTrainingWrap":"recommandTrainingWrap___F1gpg","recommandContent":"recommandContent___JZYAA","recommandLevel":"recommandLevel___McDUw","color0152d9":"color0152d9___JWNjt","color999":"color999___npg2L","color888":"color888___l_1AP","color333":"color333___ec_mY","iconDeleteColor":"iconDeleteColor___aZjDG","iconMoveColor":"iconMoveColor___z4k0w","iconEditColor":"iconEditColor___wxNTY","skillWrap":"skillWrap___j6j3B","skillTopWrap":"skillTopWrap___kIJbE","time":"time___dTwAe","titleImg":"titleImg___I8kT9"});
|
||||
;// CONCATENATED MODULE: ./src/assets/images/icons/learn.svg
|
||||
var __defProp = Object.defineProperty;
|
||||
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;
|
||||
};
|
||||
|
||||
const SvgLearn = (props) => /* @__PURE__ */ React.createElement("svg", __spreadValues({ width: 22, height: 22, xmlns: "http://www.w3.org/2000/svg" }, props), /* @__PURE__ */ React.createElement("title", null, "\u5B66\u4E60\u8FDB\u5EA6"), /* @__PURE__ */ React.createElement("g", { fill: "none", fillRule: "evenodd" }, /* @__PURE__ */ React.createElement("path", { d: "M10 2c.02 0 .03.75.032 1.839l.03 8.16H9.19l-3.932 6.005h.98L10.062 12H20c0 5.523-4.477 10-10 10S0 17.523 0 12 4.477 2 10 2Zm-.348 12.938c-.463 0-.834.147-1.113.443-.279.295-.418.693-.418 1.193 0 .453.13.819.39 1.096.261.277.606.416 1.036.416.458 0 .827-.148 1.105-.443.279-.296.418-.691.418-1.186 0-.482-.124-.855-.373-1.121-.248-.266-.597-.399-1.045-.399Zm-.039.71c.185 0 .333.074.444.221.11.147.166.358.166.631 0 .583-.209.875-.625.875-.414 0-.621-.281-.621-.844 0-.588.212-.883.636-.883Zm-3.715-3.78c-.468 0-.84.148-1.115.446-.275.299-.412.695-.412 1.19 0 .453.13.818.389 1.094.259.276.605.414 1.037.414.46 0 .83-.147 1.105-.442.276-.294.414-.686.414-1.175 0-.477-.124-.85-.373-1.122-.248-.27-.597-.406-1.045-.406Zm-.023.71c.401 0 .602.283.602.848 0 .583-.21.875-.63.875-.41 0-.617-.28-.617-.84 0-.589.215-.883.645-.883Z", fill: "#1890FF" }), /* @__PURE__ */ React.createElement("path", { d: "M11 0c5.982 0 10.848 4.774 10.997 10.72L22 11h-3.667c0-3.974-3.16-7.21-7.105-7.33L11 3.667V0Z", fill: "#B6D0FC", fillRule: "nonzero" })));
|
||||
|
||||
/* harmony default export */ var learn = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMTAgMmMuMDIgMCAuMDMuNzUuMDMyIDEuODM5bC4wMyA4LjE2SDkuMTlsLTMuOTMyIDYuMDA1aC45OEwxMC4wNjIgMTJIMjBjMCA1LjUyMy00LjQ3NyAxMC0xMCAxMFMwIDE3LjUyMyAwIDEyIDQuNDc3IDIgMTAgMlptLS4zNDggMTIuOTM4Yy0uNDYzIDAtLjgzNC4xNDctMS4xMTMuNDQzLS4yNzkuMjk1LS40MTguNjkzLS40MTggMS4xOTMgMCAuNDUzLjEzLjgxOS4zOSAxLjA5Ni4yNjEuMjc3LjYwNi40MTYgMS4wMzYuNDE2LjQ1OCAwIC44MjctLjE0OCAxLjEwNS0uNDQzLjI3OS0uMjk2LjQxOC0uNjkxLjQxOC0xLjE4NiAwLS40ODItLjEyNC0uODU1LS4zNzMtMS4xMjEtLjI0OC0uMjY2LS41OTctLjM5OS0xLjA0NS0uMzk5Wm0tLjAzOS43MWMuMTg1IDAgLjMzMy4wNzQuNDQ0LjIyMS4xMS4xNDcuMTY2LjM1OC4xNjYuNjMxIDAgLjU4My0uMjA5Ljg3NS0uNjI1Ljg3NS0uNDE0IDAtLjYyMS0uMjgxLS42MjEtLjg0NCAwLS41ODguMjEyLS44ODMuNjM2LS44ODNabS0zLjcxNS0zLjc4Yy0uNDY4IDAtLjg0LjE0OC0xLjExNS40NDYtLjI3NS4yOTktLjQxMi42OTUtLjQxMiAxLjE5IDAgLjQ1My4xMy44MTguMzg5IDEuMDk0LjI1OS4yNzYuNjA1LjQxNCAxLjAzNy40MTQuNDYgMCAuODMtLjE0NyAxLjEwNS0uNDQyLjI3Ni0uMjk0LjQxNC0uNjg2LjQxNC0xLjE3NSAwLS40NzctLjEyNC0uODUtLjM3My0xLjEyMi0uMjQ4LS4yNy0uNTk3LS40MDYtMS4wNDUtLjQwNlptLS4wMjMuNzFjLjQwMSAwIC42MDIuMjgzLjYwMi44NDggMCAuNTgzLS4yMS44NzUtLjYzLjg3NS0uNDEgMC0uNjE3LS4yOC0uNjE3LS44NCAwLS41ODkuMjE1LS44ODMuNjQ1LS44ODNaIiBmaWxsPSIjMTg5MEZGIi8+PHBhdGggZD0iTTExIDBjNS45ODIgMCAxMC44NDggNC43NzQgMTAuOTk3IDEwLjcyTDIyIDExaC0zLjY2N2MwLTMuOTc0LTMuMTYtNy4yMS03LjEwNS03LjMzTDExIDMuNjY3VjBaIiBmaWxsPSIjQjZEMEZDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+");
|
||||
|
||||
;// CONCATENATED MODULE: ./src/assets/images/icons/course.svg
|
||||
var course_defProp = Object.defineProperty;
|
||||
var course_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
||||
var course_hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var course_propIsEnum = Object.prototype.propertyIsEnumerable;
|
||||
var course_defNormalProp = (obj, key, value) => key in obj ? course_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
||||
var course_spreadValues = (a, b) => {
|
||||
for (var prop in b || (b = {}))
|
||||
if (course_hasOwnProp.call(b, prop))
|
||||
course_defNormalProp(a, prop, b[prop]);
|
||||
if (course_getOwnPropSymbols)
|
||||
for (var prop of course_getOwnPropSymbols(b)) {
|
||||
if (course_propIsEnum.call(b, prop))
|
||||
course_defNormalProp(a, prop, b[prop]);
|
||||
}
|
||||
return a;
|
||||
};
|
||||
|
||||
const SvgCourse = (props) => /* @__PURE__ */ React.createElement("svg", course_spreadValues({ width: 22, height: 20, xmlns: "http://www.w3.org/2000/svg" }, props), /* @__PURE__ */ React.createElement("title", null, "\u6240\u5C5E\u8BFE\u7A0B"), /* @__PURE__ */ React.createElement("g", { fillRule: "nonzero", fill: "none" }, /* @__PURE__ */ React.createElement("path", { d: "M1.248.026h2.495c.833 0 1.249.415 1.249 1.243v17.39c0 .829-.416 1.243-1.249 1.243H1.248C.416 19.902 0 19.488 0 18.66V1.27C0 .44.416.025 1.248.025ZM7.488.026h2.496c.832 0 1.248.415 1.248 1.243v17.39c0 .829-.416 1.243-1.248 1.243H7.488c-.832 0-1.248-.414-1.248-1.242V1.27c0-.83.416-1.244 1.248-1.244Z", fill: "#5091FF" }), /* @__PURE__ */ React.createElement("path", { d: "m13.404.688 2.412-.646c.32-.085.66-.04.947.124.287.165.496.437.582.755l4.522 16.8a1.242 1.242 0 0 1-.883 1.52l-2.411.644a1.249 1.249 0 0 1-1.528-.879L12.522 2.208a1.238 1.238 0 0 1 .124-.943c.166-.285.439-.494.758-.579v.002Z", fill: "#B6D0FC" })));
|
||||
|
||||
/* harmony default export */ var course = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbC1ydWxlPSJub256ZXJvIiBmaWxsPSJub25lIj48cGF0aCBkPSJNMS4yNDguMDI2aDIuNDk1Yy44MzMgMCAxLjI0OS40MTUgMS4yNDkgMS4yNDN2MTcuMzljMCAuODI5LS40MTYgMS4yNDMtMS4yNDkgMS4yNDNIMS4yNDhDLjQxNiAxOS45MDIgMCAxOS40ODggMCAxOC42NlYxLjI3QzAgLjQ0LjQxNi4wMjUgMS4yNDguMDI1Wk03LjQ4OC4wMjZoMi40OTZjLjgzMiAwIDEuMjQ4LjQxNSAxLjI0OCAxLjI0M3YxNy4zOWMwIC44MjktLjQxNiAxLjI0My0xLjI0OCAxLjI0M0g3LjQ4OGMtLjgzMiAwLTEuMjQ4LS40MTQtMS4yNDgtMS4yNDJWMS4yN2MwLS44My40MTYtMS4yNDQgMS4yNDgtMS4yNDRaIiBmaWxsPSIjNTA5MUZGIi8+PHBhdGggZD0ibTEzLjQwNC42ODggMi40MTItLjY0NmMuMzItLjA4NS42Ni0uMDQuOTQ3LjEyNC4yODcuMTY1LjQ5Ni40MzcuNTgyLjc1NWw0LjUyMiAxNi44YTEuMjQyIDEuMjQyIDAgMCAxLS44ODMgMS41MmwtMi40MTEuNjQ0YTEuMjQ5IDEuMjQ5IDAgMCAxLTEuNTI4LS44NzlMMTIuNTIyIDIuMjA4YTEuMjM4IDEuMjM4IDAgMCAxIC4xMjQtLjk0M2MuMTY2LS4yODUuNDM5LS40OTQuNzU4LS41Nzl2LjAwMloiIGZpbGw9IiNCNkQwRkMiLz48L2c+PC9zdmc+");
|
||||
|
||||
;// CONCATENATED MODULE: ./src/assets/images/icons/star.svg
|
||||
var star_defProp = Object.defineProperty;
|
||||
var star_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
||||
var star_hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var star_propIsEnum = Object.prototype.propertyIsEnumerable;
|
||||
var star_defNormalProp = (obj, key, value) => key in obj ? star_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
||||
var star_spreadValues = (a, b) => {
|
||||
for (var prop in b || (b = {}))
|
||||
if (star_hasOwnProp.call(b, prop))
|
||||
star_defNormalProp(a, prop, b[prop]);
|
||||
if (star_getOwnPropSymbols)
|
||||
for (var prop of star_getOwnPropSymbols(b)) {
|
||||
if (star_propIsEnum.call(b, prop))
|
||||
star_defNormalProp(a, prop, b[prop]);
|
||||
}
|
||||
return a;
|
||||
};
|
||||
|
||||
const SvgStar = (props) => /* @__PURE__ */ React.createElement("svg", star_spreadValues({ width: 22, height: 22, xmlns: "http://www.w3.org/2000/svg" }, props), /* @__PURE__ */ React.createElement("title", null, "\u63A8\u8350\u5B9E\u8BAD"), /* @__PURE__ */ React.createElement("g", { fillRule: "nonzero", fill: "none" }, /* @__PURE__ */ React.createElement("path", { d: "M15.503 21.896a2.067 2.067 0 0 1-.87-.201 451.987 451.987 0 0 1-4.376-2.11c-1.466.69-2.931 1.384-4.396 2.08-.674.299-1.33.26-1.816-.096-.458-.335-.685-.912-.624-1.579.173-1.56.465-3.693.574-4.485a188.029 188.029 0 0 1-3.587-3.922 1.5 1.5 0 0 1-.3-1.51c.213-.574.76-.982 1.472-1.086l4.655-.853A512.95 512.95 0 0 1 8.787 3.73c.717-1.344 1.426-1.344 1.8-1.209.407.134.792.531 1.177 1.223.829 1.433 2.08 3.642 2.504 4.391l4.61.858c.678.1 1.218.507 1.428 1.084a1.507 1.507 0 0 1-.286 1.504 192.808 192.808 0 0 1-3.556 3.944c.104.788.388 2.927.573 4.479.071.685-.152 1.269-.616 1.609a1.55 1.55 0 0 1-.916.284h-.002Z", fill: "#5091FF" }), /* @__PURE__ */ React.createElement("path", { d: "M21.706 4.462a.557.557 0 0 1-.247.073c-.45.03-1.122.067-1.397.08l-.778 1.2c-.122.18-.29.265-.464.24-.163-.02-.306-.14-.39-.329a60.81 60.81 0 0 1-.529-1.278 53.009 53.009 0 0 1-1.476-.518.475.475 0 0 1-.3-.36.533.533 0 0 1 .2-.505l1.025-.91c-.011-.516-.02-1.032-.028-1.548-.024-.463.15-.568.264-.585.121-.026.275.024.474.151.419.262 1.06.667 1.277.804l1.27-.448a.49.49 0 0 1 .515.08c.124.11.183.28.155.441-.09.526-.186 1.052-.29 1.574.145.194.536.722.814 1.11.12.172.152.36.088.518a.435.435 0 0 1-.185.21h.002ZM2.859 5.83a.287.287 0 0 1-.093-.091 62.17 62.17 0 0 1-.382-.603 49.99 49.99 0 0 0-.7-.045c-.106-.01-.185-.063-.218-.146a.276.276 0 0 1 .04-.255c.14-.197.334-.46.407-.557a28.397 28.397 0 0 1-.149-.786.243.243 0 0 1 .076-.223.25.25 0 0 1 .264-.037l.64.228c.108-.068.431-.27.644-.398.19-.128.278-.075.314-.03.04.047.059.128.054.25l-.019.768.506.453a.258.258 0 0 1 .095.249.238.238 0 0 1-.147.178c-.245.092-.49.18-.736.265-.047.113-.171.42-.264.64-.044.095-.115.159-.197.168a.208.208 0 0 1-.135-.028Z", fill: "#B6D0FC" })));
|
||||
|
||||
/* harmony default export */ var star = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbC1ydWxlPSJub256ZXJvIiBmaWxsPSJub25lIj48cGF0aCBkPSJNMTUuNTAzIDIxLjg5NmEyLjA2NyAyLjA2NyAwIDAgMS0uODctLjIwMSA0NTEuOTg3IDQ1MS45ODcgMCAwIDEtNC4zNzYtMi4xMWMtMS40NjYuNjktMi45MzEgMS4zODQtNC4zOTYgMi4wOC0uNjc0LjI5OS0xLjMzLjI2LTEuODE2LS4wOTYtLjQ1OC0uMzM1LS42ODUtLjkxMi0uNjI0LTEuNTc5LjE3My0xLjU2LjQ2NS0zLjY5My41NzQtNC40ODVhMTg4LjAyOSAxODguMDI5IDAgMCAxLTMuNTg3LTMuOTIyIDEuNSAxLjUgMCAwIDEtLjMtMS41MWMuMjEzLS41NzQuNzYtLjk4MiAxLjQ3Mi0xLjA4Nmw0LjY1NS0uODUzQTUxMi45NSA1MTIuOTUgMCAwIDEgOC43ODcgMy43M2MuNzE3LTEuMzQ0IDEuNDI2LTEuMzQ0IDEuOC0xLjIwOS40MDcuMTM0Ljc5Mi41MzEgMS4xNzcgMS4yMjMuODI5IDEuNDMzIDIuMDggMy42NDIgMi41MDQgNC4zOTFsNC42MS44NThjLjY3OC4xIDEuMjE4LjUwNyAxLjQyOCAxLjA4NGExLjUwNyAxLjUwNyAwIDAgMS0uMjg2IDEuNTA0IDE5Mi44MDggMTkyLjgwOCAwIDAgMS0zLjU1NiAzLjk0NGMuMTA0Ljc4OC4zODggMi45MjcuNTczIDQuNDc5LjA3MS42ODUtLjE1MiAxLjI2OS0uNjE2IDEuNjA5YTEuNTUgMS41NSAwIDAgMS0uOTE2LjI4NGgtLjAwMloiIGZpbGw9IiM1MDkxRkYiLz48cGF0aCBkPSJNMjEuNzA2IDQuNDYyYS41NTcuNTU3IDAgMCAxLS4yNDcuMDczYy0uNDUuMDMtMS4xMjIuMDY3LTEuMzk3LjA4bC0uNzc4IDEuMmMtLjEyMi4xOC0uMjkuMjY1LS40NjQuMjQtLjE2My0uMDItLjMwNi0uMTQtLjM5LS4zMjlhNjAuODEgNjAuODEgMCAwIDEtLjUyOS0xLjI3OCA1My4wMDkgNTMuMDA5IDAgMCAxLTEuNDc2LS41MTguNDc1LjQ3NSAwIDAgMS0uMy0uMzYuNTMzLjUzMyAwIDAgMSAuMi0uNTA1bDEuMDI1LS45MWMtLjAxMS0uNTE2LS4wMi0xLjAzMi0uMDI4LTEuNTQ4LS4wMjQtLjQ2My4xNS0uNTY4LjI2NC0uNTg1LjEyMS0uMDI2LjI3NS4wMjQuNDc0LjE1MS40MTkuMjYyIDEuMDYuNjY3IDEuMjc3LjgwNGwxLjI3LS40NDhhLjQ5LjQ5IDAgMCAxIC41MTUuMDhjLjEyNC4xMS4xODMuMjguMTU1LjQ0MS0uMDkuNTI2LS4xODYgMS4wNTItLjI5IDEuNTc0LjE0NS4xOTQuNTM2LjcyMi44MTQgMS4xMS4xMi4xNzIuMTUyLjM2LjA4OC41MThhLjQzNS40MzUgMCAwIDEtLjE4NS4yMWguMDAyWk0yLjg1OSA1LjgzYS4yODcuMjg3IDAgMCAxLS4wOTMtLjA5MSA2Mi4xNyA2Mi4xNyAwIDAgMS0uMzgyLS42MDMgNDkuOTkgNDkuOTkgMCAwIDAtLjctLjA0NWMtLjEwNi0uMDEtLjE4NS0uMDYzLS4yMTgtLjE0NmEuMjc2LjI3NiAwIDAgMSAuMDQtLjI1NWMuMTQtLjE5Ny4zMzQtLjQ2LjQwNy0uNTU3YTI4LjM5NyAyOC4zOTcgMCAwIDEtLjE0OS0uNzg2LjI0My4yNDMgMCAwIDEgLjA3Ni0uMjIzLjI1LjI1IDAgMCAxIC4yNjQtLjAzN2wuNjQuMjI4Yy4xMDgtLjA2OC40MzEtLjI3LjY0NC0uMzk4LjE5LS4xMjguMjc4LS4wNzUuMzE0LS4wMy4wNC4wNDcuMDU5LjEyOC4wNTQuMjVsLS4wMTkuNzY4LjUwNi40NTNhLjI1OC4yNTggMCAwIDEgLjA5NS4yNDkuMjM4LjIzOCAwIDAgMS0uMTQ3LjE3OGMtLjI0NS4wOTItLjQ5LjE4LS43MzYuMjY1LS4wNDcuMTEzLS4xNzEuNDItLjI2NC42NC0uMDQ0LjA5NS0uMTE1LjE1OS0uMTk3LjE2OGEuMjA4LjIwOCAwIDAgMS0uMTM1LS4wMjhaIiBmaWxsPSIjQjZEMEZDIi8+PC9nPjwvc3ZnPg==");
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_echarts-for-react@2.0.16@echarts-for-react/lib/index.js
|
||||
var lib = __webpack_require__(42441);
|
||||
// EXTERNAL MODULE: ./src/components/ImagesIcon/index.ts + 32 modules
|
||||
var ImagesIcon = __webpack_require__(43021);
|
||||
// EXTERNAL MODULE: ./node_modules/_echarts-wordcloud@1.1.3@echarts-wordcloud/index.js
|
||||
var _echarts_wordcloud_1_1_3_echarts_wordcloud = __webpack_require__(56047);
|
||||
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/components/Right/index.tsx
|
||||
var Right_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
||||
var Right_hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var Right_propIsEnum = Object.prototype.propertyIsEnumerable;
|
||||
var __objRest = (source, exclude) => {
|
||||
var target = {};
|
||||
for (var prop in source)
|
||||
if (Right_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
||||
target[prop] = source[prop];
|
||||
if (source != null && Right_getOwnPropSymbols)
|
||||
for (var prop of Right_getOwnPropSymbols(source)) {
|
||||
if (exclude.indexOf(prop) < 0 && Right_propIsEnum.call(source, prop))
|
||||
target[prop] = source[prop];
|
||||
}
|
||||
return target;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const Right = (_a) => {
|
||||
var _b = _a, {
|
||||
shixunsDetail,
|
||||
user,
|
||||
globalSetting,
|
||||
loading,
|
||||
dispatch
|
||||
} = _b, props = __objRest(_b, [
|
||||
"shixunsDetail",
|
||||
"user",
|
||||
"globalSetting",
|
||||
"loading",
|
||||
"dispatch"
|
||||
]);
|
||||
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
||||
const [showExpandAll, setShowExpandAll] = (0,_react_17_0_2_react.useState)(true);
|
||||
const getOption = () => {
|
||||
var _a3, _b3;
|
||||
let maskImage = new Image();
|
||||
maskImage.src = ImagesIcon/* hbIcon */.yt;
|
||||
let wordData = ((_b3 = (_a3 = shixunsDetail == null ? void 0 : shixunsDetail.rightData) == null ? void 0 : _a3.tags) == null ? void 0 : _b3.map((item, key) => {
|
||||
return { name: item.tag_name, value: key };
|
||||
})) || [];
|
||||
let option = {
|
||||
backgroundColor: "#fff",
|
||||
tooltip: {
|
||||
pointFormat: "{series.name}</b>"
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: "wordCloud",
|
||||
sizeRange: [10, 30],
|
||||
rotationRange: [-90, 90],
|
||||
rotationStep: 45,
|
||||
gridSize: 2,
|
||||
shape: "pentagon",
|
||||
//circle pentagon
|
||||
maskImage,
|
||||
// 呈现形状图片, 可选
|
||||
textStyle: {
|
||||
normal: {
|
||||
color: function() {
|
||||
return "rgb(" + Math.round(Math.random() * 255) + ", " + Math.round(Math.random() * 255) + ", " + Math.round(Math.random() * 255) + ")";
|
||||
}
|
||||
}
|
||||
},
|
||||
// Folllowing left/top/width/height/right/bottom are used for positioning the word cloud
|
||||
// Default to be put in the center and has 75% x 80% size.
|
||||
left: "center",
|
||||
top: "center",
|
||||
right: null,
|
||||
bottom: null,
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
data: wordData
|
||||
}
|
||||
]
|
||||
};
|
||||
return option;
|
||||
};
|
||||
console.log("----", shixunsDetail);
|
||||
const progressPercent = ((_a2 = shixunsDetail.rightData) == null ? void 0 : _a2.complete_count) ? Number((_b2 = shixunsDetail.rightData) == null ? void 0 : _b2.complete_count) / Number((_c = shixunsDetail.rightData) == null ? void 0 : _c.challenge_count) * 100 : 0;
|
||||
return shixunsDetail.rightData ? /* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: Rightmodules.rightWrap }, !((_d = shixunsDetail.detail) == null ? void 0 : _d.is_jupyter) && ((_f = (_e = shixunsDetail.detail) == null ? void 0 : _e.task_operation) == null ? void 0 : _f[2]) && ((_g = user == null ? void 0 : user.userInfo) == null ? void 0 : _g.login) && !!((_h = shixunsDetail.rightData) == null ? void 0 : _h.complete_count) && ((_i = shixunsDetail.rightData) == null ? void 0 : _i.complete_count) > 0 && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Rightmodules.learnWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Rightmodules.learnTopWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { className: Rightmodules.titleImg, src: learn, alt: "" }), "\u5B66\u4E60\u8FDB\u5EA6"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: `${Rightmodules.color888} font14` }, "\u5DF2\u5B8C\u6210 ", ((_j = shixunsDetail.rightData) == null ? void 0 : _j.complete_count) || 0, " \u5173 / \u5171", ((_k = shixunsDetail.rightData) == null ? void 0 : _k.challenge_count) || 0, " \u5173"))), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
progress/* default */.Z,
|
||||
{
|
||||
percent: progressPercent,
|
||||
showInfo: false,
|
||||
status: "active",
|
||||
strokeColor: { "0%": "#29BD8B", "100%": "#29BD8B" }
|
||||
}
|
||||
)), !!((_m = (_l = shixunsDetail.rightData) == null ? void 0 : _l.paths) == null ? void 0 : _m.length) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Rightmodules.courseWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "mb20 font16" }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { className: Rightmodules.titleImg, src: course, alt: "" }), "\u6240\u5C5E\u8BFE\u7A0B"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, (_n = shixunsDetail.rightData) == null ? void 0 : _n.paths.map((item, key) => {
|
||||
if (key > 2) {
|
||||
return null;
|
||||
}
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Rightmodules.pathWrap, key: item.id }, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: `/paths/${item.id}`, target: "_blank" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"img",
|
||||
{
|
||||
alt: "\u5B9E\u8BAD",
|
||||
src: `${item.image_url}`,
|
||||
className: Rightmodules.pathImg
|
||||
}
|
||||
)), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Rightmodules.pathContentWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"a",
|
||||
{
|
||||
href: `/paths/${item.id}`,
|
||||
target: "_blank",
|
||||
className: Rightmodules.pathContentName
|
||||
},
|
||||
item.name
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: Rightmodules.pathContent }, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { placement: "bottom", title: "\u7AE0\u8282" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Rightmodules.pathContentCount }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-shixun mr3" }), item.stages_count)), /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { placement: "bottom", title: "\u5B66\u4E60\u4EBA\u6570" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Rightmodules.pathContentCount }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-chengyuan mr3" }), item.members_count)))));
|
||||
}))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null), !!((_p = (_o = shixunsDetail.rightData) == null ? void 0 : _o.recommands) == null ? void 0 : _p.length) && user.userInfo.main_site && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Rightmodules.recommandTrainingWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "mb20 font16" }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { className: Rightmodules.titleImg, src: star, alt: "" }), ((_r = (_q = shixunsDetail == null ? void 0 : shixunsDetail.detail) == null ? void 0 : _q.disciplines) == null ? void 0 : _r.length) > 0 ? "\u76F8\u5173\u63A8\u8350" : "\u70ED\u95E8\u63A8\u8350"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, (_s = shixunsDetail.rightData) == null ? void 0 : _s.recommands.map((item, key) => {
|
||||
if (key > 2) {
|
||||
return null;
|
||||
}
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Rightmodules.pathContentItem, key }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"a",
|
||||
{
|
||||
href: `/shixuns/${item.identifier}/challenges`,
|
||||
target: "_blank"
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: `${item.pic}`, className: Rightmodules.pathImg })
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Rightmodules.pathContentWrap, style: { marginBottom: -4 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { placement: "bottom", title: item.name }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"a",
|
||||
{
|
||||
href: `/shixuns/${item.identifier}/challenges`,
|
||||
target: "_blank",
|
||||
className: Rightmodules.pathContentName
|
||||
},
|
||||
item.name
|
||||
)), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"p",
|
||||
{
|
||||
className: `${Rightmodules.pathContent} ${Rightmodules.recommandContent}`
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("span", null, item.stu_num, " \u4EBA\u5B66\u4E60"),
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Rightmodules.recommandLevel }, item.level)
|
||||
)));
|
||||
}))), ((_u = (_t = shixunsDetail.rightData) == null ? void 0 : _t.tags) == null ? void 0 : _u.length) > 0 && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Rightmodules.skillWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: `${Rightmodules.skillTopWrap} font16 mb20` }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u6280\u80FD\u6807\u7B7E", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "ml5 c-grey-c" }, (_w = (_v = shixunsDetail.rightData) == null ? void 0 : _v.tags) == null ? void 0 : _w.length))), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
lib/* default */.Z,
|
||||
{
|
||||
option: getOption(),
|
||||
style: { height: 370 },
|
||||
opts: { renderer: "svg" }
|
||||
}
|
||||
))) : null;
|
||||
};
|
||||
/* harmony default export */ var components_Right = ((0,_umi_production_exports.connect)(
|
||||
({
|
||||
shixunsDetail,
|
||||
user,
|
||||
loading,
|
||||
globalSetting
|
||||
}) => ({
|
||||
shixunsDetail,
|
||||
user,
|
||||
globalSetting,
|
||||
loading: loading.models.index
|
||||
})
|
||||
)(Right));
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
@ -0,0 +1,847 @@
|
||||
"use strict";
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[7270],{
|
||||
|
||||
/***/ 79197:
|
||||
/*!*********************************************!*\
|
||||
!*** ./src/pages/tasks/vnc-view/index.less ***!
|
||||
\*********************************************/
|
||||
/***/ (function() {
|
||||
|
||||
// extracted by mini-css-extract-plugin
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 13013:
|
||||
/*!******************************************************************!*\
|
||||
!*** ./src/pages/tasks/vnc-view/vnc-panel/index.tsx + 2 modules ***!
|
||||
\******************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ vnc_panel; }
|
||||
});
|
||||
|
||||
// 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/modal/index.js + 16 modules
|
||||
var modal = __webpack_require__(43418);
|
||||
// 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/progress/index.js + 13 modules
|
||||
var progress = __webpack_require__(93948);
|
||||
// EXTERNAL MODULE: ./src/components/Spinner/index.tsx + 1 modules
|
||||
var Spinner = __webpack_require__(14147);
|
||||
// EXTERNAL MODULE: ./node_modules/_resize-observer-polyfill@1.5.1@resize-observer-polyfill/dist/ResizeObserver.es.js
|
||||
var ResizeObserver_es = __webpack_require__(76374);
|
||||
// EXTERNAL MODULE: ./src/components/modal.tsx
|
||||
var components_modal = __webpack_require__(69210);
|
||||
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 14 modules
|
||||
var _umi_production_exports = __webpack_require__(87210);
|
||||
// EXTERNAL MODULE: ./src/utils/util.tsx
|
||||
var util = __webpack_require__(3163);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
||||
var input = __webpack_require__(1056);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
||||
var es_button = __webpack_require__(3113);
|
||||
;// CONCATENATED MODULE: ./src/pages/tasks/vnc-view/clipboard-box/index.less
|
||||
// extracted by mini-css-extract-plugin
|
||||
|
||||
;// CONCATENATED MODULE: ./src/pages/tasks/vnc-view/clipboard-box/index.tsx
|
||||
|
||||
|
||||
|
||||
const TextArea = input["default"].TextArea;
|
||||
/* harmony default export */ var clipboard_box = (({ onCancel, onSave, content }) => {
|
||||
const [value, setValue] = (0,_react_17_0_2_react.useState)(content);
|
||||
function onChangeValue(e) {
|
||||
setValue(e.target.value);
|
||||
}
|
||||
function onSaveContent() {
|
||||
onSave(value);
|
||||
}
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
setValue(content);
|
||||
}, [content]);
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "clipboard-box" }, /* @__PURE__ */ _react_17_0_2_react.createElement("h3", null, "\u5B9E\u9A8C\u73AF\u5883\u526A\u5207\u677F\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement(TextArea, { value, onChange: onChangeValue, className: "clipboard" }), /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, " ", /* @__PURE__ */ _react_17_0_2_react.createElement("b", null, " 1.\u4ECE\u5916\u90E8\u590D\u5236\u5185\u5BB9\u5230\u5B9E\u9A8C\u73AF\u5883\u5185\uFF1A "), " \u7C98\u8D34\u5185\u5BB9\u5230\u4E0A\u9762\u6587\u672C\u6846\uFF0C\u70B9\u51FB\u4FDD\u5B58\uFF0C\u7136\u540E\u5728\u5B9E\u9A8C\u73AF\u5883\u4E2D\u8FDB\u884C\u7C98\u8D34\u3002 "), /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, " ", /* @__PURE__ */ _react_17_0_2_react.createElement("b", null, " 2.\u83B7\u53D6\u5B9E\u9A8C\u73AF\u5883\u4E2D\u7684\u5185\u5BB9\uFF1A "), " \u8BF7\u5148\u5728\u73AF\u5883\u4E2D\u590D\u5236\u5185\u5BB9\uFF0C\u590D\u5236\u52A8\u4F5C\u5B8C\u6210\u540E\u5185\u5BB9\u4F1A\u663E\u793A\u5728\u4E0A\u9762\u6587\u672C\u6846\uFF0C\u7136\u540E\u5728\u4E0A\u9762\u6587\u672C\u6846\u4E2D\u518D\u6B21\u590D\u5236\u3002 "), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "btn-action-container" }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { type: "ghost", onClick: onCancel, style: { marginRight: 10 } }, "\u53D6\u6D88"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { type: "primary", onClick: onSaveContent }, "\u4FDD\u5B58")));
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./src/utils/fullscreen.ts
|
||||
var fullscreen = __webpack_require__(98563);
|
||||
// EXTERNAL MODULE: ./src/pages/tasks/service/index.js
|
||||
var service = __webpack_require__(36070);
|
||||
// EXTERNAL MODULE: ./node_modules/_novncrfb@1.2.1@novncrfb/lib/rfb.js
|
||||
var rfb = __webpack_require__(62013);
|
||||
// EXTERNAL MODULE: ./src/components/mediator.js
|
||||
var mediator = __webpack_require__(7694);
|
||||
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
||||
var fetch = __webpack_require__(87101);
|
||||
;// CONCATENATED MODULE: ./src/pages/tasks/vnc-view/vnc-panel/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());
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function unicodeUnEscape(str) {
|
||||
return str.replace(/\\u([\dA-Za-z]{4})/g, function(_, m1) {
|
||||
return String.fromCharCode(parseInt("0x" + m1));
|
||||
});
|
||||
}
|
||||
function getJsonFromUrl(url) {
|
||||
if (!url)
|
||||
url = window.location.search;
|
||||
let query = url.substr(1);
|
||||
let result = {};
|
||||
query.split("&").forEach(function(part) {
|
||||
let item = part.split("=");
|
||||
result[item[0]] = decodeURIComponent(item[1]);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
const initialState = {
|
||||
loading: true,
|
||||
isLarge: false,
|
||||
showClipBoardBox: false,
|
||||
transferContent: "",
|
||||
mes: "\u5B9E\u9A8C\u73AF\u5883\u51C6\u5907\u4E2D"
|
||||
};
|
||||
var Types = /* @__PURE__ */ ((Types2) => {
|
||||
Types2[Types2["SET_LOADING"] = 0] = "SET_LOADING";
|
||||
Types2[Types2["SET_IS_LARGE"] = 1] = "SET_IS_LARGE";
|
||||
Types2[Types2["SET_MES"] = 2] = "SET_MES";
|
||||
Types2[Types2["SET_STATE"] = 3] = "SET_STATE";
|
||||
Types2[Types2["SHOW_CLIPBOARD_BOX"] = 4] = "SHOW_CLIPBOARD_BOX";
|
||||
Types2[Types2["SET_TRANSFER_CONTENT"] = 5] = "SET_TRANSFER_CONTENT";
|
||||
Types2[Types2["UPDATE_ALL"] = 6] = "UPDATE_ALL";
|
||||
return Types2;
|
||||
})(Types || {});
|
||||
function reducer(state, action) {
|
||||
switch (action.type) {
|
||||
case 0 /* SET_LOADING */:
|
||||
return __spreadProps(__spreadValues({}, state), { loading: action.payload });
|
||||
case 1 /* SET_IS_LARGE */:
|
||||
return __spreadValues({}, __spreadProps(__spreadValues({}, state), { isLarge: action.payload }));
|
||||
case 2 /* SET_MES */:
|
||||
return __spreadProps(__spreadValues({}, state), { mes: action.payload });
|
||||
case 3 /* SET_STATE */:
|
||||
return __spreadValues(__spreadValues({}, state), action.payload);
|
||||
case 5 /* SET_TRANSFER_CONTENT */:
|
||||
return __spreadProps(__spreadValues({}, state), { transferContent: action.payload });
|
||||
case 4 /* SHOW_CLIPBOARD_BOX */:
|
||||
return __spreadProps(__spreadValues({}, state), { showClipBoardBox: action.payload });
|
||||
case 6 /* UPDATE_ALL */:
|
||||
return __spreadValues({ loading: state.loading }, action.payload);
|
||||
default:
|
||||
throw new Error();
|
||||
}
|
||||
}
|
||||
/* harmony default export */ var vnc_panel = (({
|
||||
vnc_url,
|
||||
window_vnc_url,
|
||||
linux_vnc,
|
||||
virtual_machine,
|
||||
taskData,
|
||||
shixun_environment_id,
|
||||
tab_type,
|
||||
instance_startup_type,
|
||||
//1VNC 2RDP
|
||||
index_tab,
|
||||
tpi_type
|
||||
}) => {
|
||||
const el = (0,_react_17_0_2_react.useRef)();
|
||||
const guacaRef = (0,_react_17_0_2_react.useRef)();
|
||||
const rfbRef = (0,_react_17_0_2_react.useRef)();
|
||||
const roRef = (0,_react_17_0_2_react.useRef)();
|
||||
const iframeRef = (0,_react_17_0_2_react.useRef)();
|
||||
const passwordRef = (0,_react_17_0_2_react.useRef)();
|
||||
const socketUrlRef = (0,_react_17_0_2_react.useRef)();
|
||||
const reConnectRef = (0,_react_17_0_2_react.useRef)();
|
||||
const [state, dispatch] = (0,_react_17_0_2_react.useReducer)(reducer, initialState);
|
||||
const [linkNum, setLinkNum] = (0,_react_17_0_2_react.useState)(0);
|
||||
const { mes, loading, showClipBoardBox, isLarge, transferContent } = state;
|
||||
const heartbeatTimerRef = (0,_react_17_0_2_react.useRef)();
|
||||
const loadingRef = (0,_react_17_0_2_react.useRef)();
|
||||
let [percent, setPercent] = (0,_react_17_0_2_react.useState)(0);
|
||||
let timeout = (0,_react_17_0_2_react.useRef)();
|
||||
const params = (0,_umi_production_exports.useParams)();
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
return () => {
|
||||
var _a, _b;
|
||||
(_b = (_a = guacaRef.current) == null ? void 0 : _a.disconnect) == null ? void 0 : _b.call(_a);
|
||||
clearTimeout(reConnectRef.current);
|
||||
clearInterval(heartbeatTimerRef.current);
|
||||
};
|
||||
}, []);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
loadingRef.current = state.loading;
|
||||
}, [state.loading]);
|
||||
const fullChange = () => {
|
||||
var _a;
|
||||
if (instance_startup_type === 2) {
|
||||
setTimeout(() => {
|
||||
doResize();
|
||||
}, 1500);
|
||||
} else if (((_a = rfbRef == null ? void 0 : rfbRef.current) == null ? void 0 : _a.resizeSession) !== void 0) {
|
||||
if ((0,fullscreen/* IsFull */.vp)()) {
|
||||
rfbRef.current.resizeSession = true;
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
rfbRef.current.resizeSession = false;
|
||||
}, 900);
|
||||
}
|
||||
}
|
||||
};
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
document.addEventListener((0,fullscreen/* fullscreenChange */.gH)(), fullChange);
|
||||
return () => {
|
||||
document.removeEventListener((0,fullscreen/* fullscreenChange */.gH)(), fullChange);
|
||||
};
|
||||
}, []);
|
||||
function onCancelClipboardBox() {
|
||||
dispatch({
|
||||
type: 4 /* SHOW_CLIPBOARD_BOX */,
|
||||
payload: false
|
||||
});
|
||||
}
|
||||
function onResizeSet() {
|
||||
dispatch({
|
||||
type: 1 /* SET_IS_LARGE */,
|
||||
payload: !isLarge
|
||||
});
|
||||
}
|
||||
function onLayout(rfb) {
|
||||
if (el.current) {
|
||||
roRef.current = new ResizeObserver_es/* default */.Z((entries) => {
|
||||
for (let entry of entries) {
|
||||
if (instance_startup_type === 2) {
|
||||
doResize();
|
||||
}
|
||||
if (entry.target.offsetHeight > 0 || entry.target.offsetWidth > 0) {
|
||||
rfb.scaleViewport = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
roRef.current.observe(el.current);
|
||||
}
|
||||
return roRef.current;
|
||||
}
|
||||
const getWindowVnc = () => __async(void 0, null, function* () {
|
||||
var _a, _b, _c, _d, _e, _f, _g;
|
||||
const res = yield (0,service/* startInit */.sA)((_a = taskData.myshixun) == null ? void 0 : _a.identifier, __spreadProps(__spreadValues({}, params), {
|
||||
taskId: params.taskId,
|
||||
shixun_environment_id,
|
||||
tab_type
|
||||
}));
|
||||
if (!!((_c = (_b = res == null ? void 0 : res.data) == null ? void 0 : _b.data_list) == null ? void 0 : _c.length)) {
|
||||
mediator/* default */.Z.publish("pod-restrict-data", {
|
||||
identifier: (_d = res == null ? void 0 : res.data) == null ? void 0 : _d.identifier,
|
||||
data_list: (_e = res == null ? void 0 : res.data) == null ? void 0 : _e.data_list
|
||||
});
|
||||
return Promise.reject();
|
||||
}
|
||||
if ((res == null ? void 0 : res.status) === -3) {
|
||||
return new Promise((resolve, reject) => __async(void 0, null, function* () {
|
||||
modal["default"].confirm({
|
||||
content: "\u68C0\u6D4B\u5230\u60A8\u5DF2\u7ECF\u5F00\u542F\u4E86\u5176\u4ED6\u5B9E\u9A8C\u73AF\u5883\uFF0C\u8BF7\u5148\u5173\u95ED\u73AF\u5883\u540E\uFF0C\u518D\u8FDE\u63A5",
|
||||
okText: "\u7ACB\u5373\u5173\u95ED",
|
||||
cancelText: "\u7A0D\u540E\u5173\u95ED",
|
||||
onOk: () => __async(void 0, null, function* () {
|
||||
clearTimeout(timeout.current);
|
||||
setPercent(0);
|
||||
yield (0,service/* closeWindowsVnc */.fA)(params.taskId, res == null ? void 0 : res.message);
|
||||
setLinkNum(linkNum + 1);
|
||||
return;
|
||||
})
|
||||
});
|
||||
}));
|
||||
}
|
||||
if ((res == null ? void 0 : res.status) === -1) {
|
||||
throw new String(res == null ? void 0 : res.message);
|
||||
}
|
||||
if ((res == null ? void 0 : res.status) === 0) {
|
||||
if (virtual_machine) {
|
||||
(0,util/* setCookie */.d8)("PVEAuthCookie", (_g = (_f = res == null ? void 0 : res.data) == null ? void 0 : _f.cookie_options) == null ? void 0 : _g.cookies_value, 1);
|
||||
(0,util/* setCookie */.d8)("PVELangCookie", "zh_CN", 1);
|
||||
}
|
||||
mediator/* default */.Z.publish("update-windows-time", res == null ? void 0 : res.data);
|
||||
mediator/* default */.Z.publish("send-tabs-result-data", __spreadProps(__spreadValues({}, res == null ? void 0 : res.data), { index_tab }));
|
||||
return res;
|
||||
}
|
||||
});
|
||||
function onConnect() {
|
||||
setPercent(100);
|
||||
clearTimeout(timeout.current);
|
||||
setTimeout(() => {
|
||||
rfbRef.current.resizeSession = false;
|
||||
dispatch({
|
||||
type: 0 /* SET_LOADING */,
|
||||
payload: false
|
||||
});
|
||||
}, 1300);
|
||||
clearTimeout(heartbeatTimerRef.current);
|
||||
}
|
||||
const toConnect = () => {
|
||||
rfbRef.current = new rfb/* default */.Z(el.current, socketUrlRef.current, {
|
||||
credentials: { password: passwordRef.current },
|
||||
wsProtocols: ["binary"],
|
||||
// resize: "scale",
|
||||
show_dot: true
|
||||
});
|
||||
rfbRef.current.removeEventListener("disconnect", onDisconnect);
|
||||
rfbRef.current.removeEventListener("connect", onConnect);
|
||||
rfbRef.current.removeEventListener("clipboard", onClipboardReceive);
|
||||
window.rfbs2 = rfbRef.current;
|
||||
roRef.current = onLayout(rfbRef.current);
|
||||
rfbRef.current.viewOnly = params.view_only || false;
|
||||
rfbRef.current.scaleViewport = params.scale || true;
|
||||
rfbRef.current.showDotCursor = true;
|
||||
rfbRef.current.resizeSession = true;
|
||||
rfbRef.current.addEventListener("disconnect", onDisconnect);
|
||||
rfbRef.current.addEventListener("connect", onConnect);
|
||||
rfbRef.current.addEventListener("clipboard", onClipboardReceive);
|
||||
};
|
||||
function onClipboardReceive(e) {
|
||||
const rs = unicodeUnEscape(e.detail.text);
|
||||
dispatch({
|
||||
type: 5 /* SET_TRANSFER_CONTENT */,
|
||||
payload: rs
|
||||
});
|
||||
}
|
||||
function onDisconnect() {
|
||||
if (window_vnc_url) {
|
||||
dispatch({
|
||||
type: 0 /* SET_LOADING */,
|
||||
payload: true
|
||||
});
|
||||
setLinkNum(linkNum + 1);
|
||||
} else {
|
||||
clearTimeout(reConnectRef.current);
|
||||
if (loadingRef.current)
|
||||
return;
|
||||
reConnectRef.current = setTimeout(() => {
|
||||
setLinkNum(linkNum + 1);
|
||||
}, 6e3);
|
||||
}
|
||||
setTimeout(() => {
|
||||
var _a, _b;
|
||||
(_b = (_a = rfbRef.current) == null ? void 0 : _a.connect) == null ? void 0 : _b.call(_a);
|
||||
}, 3e3);
|
||||
}
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
mediator/* default */.Z.subscribe(`reset-linux-windows-vnc-${index_tab}`, () => {
|
||||
setLinkNum(linkNum + 1);
|
||||
});
|
||||
if ((window_vnc_url || vnc_url || linux_vnc || virtual_machine) && el.current) {
|
||||
clearTimeout(timeout.current);
|
||||
if (instance_startup_type === 2) {
|
||||
doResize();
|
||||
}
|
||||
new Promise(() => __async(void 0, null, function* () {
|
||||
var _a, _b, _c, _d, _e;
|
||||
const params2 = getJsonFromUrl();
|
||||
let res = yield getWindowVnc();
|
||||
if (linux_vnc || virtual_machine) {
|
||||
const character = ((_b = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.link_url) == null ? void 0 : _b.includes("?")) ? "&" : "?";
|
||||
iframeRef.current.src = ((_c = res == null ? void 0 : res.data) == null ? void 0 : _c.link_url) + character + "time=" + Date.now();
|
||||
dispatch({
|
||||
type: 0 /* SET_LOADING */,
|
||||
payload: false
|
||||
});
|
||||
return;
|
||||
} else if (window_vnc_url) {
|
||||
passwordRef.current = "Edu123";
|
||||
socketUrlRef.current = decodeURIComponent((_d = res == null ? void 0 : res.data) == null ? void 0 : _d.link_url);
|
||||
} else {
|
||||
const urlParser = new URL(decodeURIComponent((_e = res == null ? void 0 : res.data) == null ? void 0 : _e.link_url));
|
||||
const { protocol, searchParams, host } = urlParser;
|
||||
passwordRef.current = searchParams.get("password");
|
||||
socketUrlRef.current = `${protocol === "https:" ? "wss" : "ws"}://${host}/${params2.path || "websockify"}`;
|
||||
}
|
||||
if (instance_startup_type === 2) {
|
||||
setTimeout(() => {
|
||||
var _a2;
|
||||
onLayout();
|
||||
iframeRef.current.style.cssText = iframeRef.current.style.cssText + "width:1920px;height:1080px;position:initial";
|
||||
iframeRef.current.src = `/rdp.html?tpiId=${(_a2 = taskData == null ? void 0 : taskData.myshixun) == null ? void 0 : _a2.id}&envId=${shixun_environment_id}&tpiType=${tpi_type}`;
|
||||
dispatch({
|
||||
type: 0 /* SET_LOADING */,
|
||||
payload: false
|
||||
});
|
||||
}, 5e3);
|
||||
return;
|
||||
}
|
||||
toConnect();
|
||||
}));
|
||||
const unsub = mediator/* default */.Z.subscribe(`vnc-reset-${index_tab}`, (text) => {
|
||||
if (text === "\u53D6\u6D88") {
|
||||
dispatch({
|
||||
type: 0 /* SET_LOADING */,
|
||||
payload: false
|
||||
});
|
||||
return;
|
||||
}
|
||||
setPercent(0);
|
||||
dispatch({
|
||||
type: 3 /* SET_STATE */,
|
||||
payload: {
|
||||
loading: true,
|
||||
mes: text || "\u5B9E\u9A8C\u73AF\u5883\u91CD\u7F6E\u4E2D"
|
||||
}
|
||||
});
|
||||
});
|
||||
const unsub2 = mediator/* default */.Z.subscribe(`send-ctrl-alt-delete-${index_tab}`, () => {
|
||||
var _a;
|
||||
(_a = rfbRef.current) == null ? void 0 : _a.sendCtrlAltDel();
|
||||
message/* default */.ZP.success("\u53D1\u9001\u6210\u529F");
|
||||
});
|
||||
const unSub3 = mediator/* default */.Z.subscribe(`show-clipboard-box-${index_tab}`, () => {
|
||||
dispatch({
|
||||
type: 4 /* SHOW_CLIPBOARD_BOX */,
|
||||
payload: true
|
||||
});
|
||||
});
|
||||
setPercent(0);
|
||||
return () => {
|
||||
var _a, _b, _c, _d;
|
||||
(_a = rfbRef.current) == null ? void 0 : _a.removeEventListener("disconnect", onDisconnect);
|
||||
(_b = rfbRef.current) == null ? void 0 : _b.removeEventListener("connect", onConnect);
|
||||
(_c = rfbRef.current) == null ? void 0 : _c.removeEventListener("clipboard", onClipboardReceive);
|
||||
unsub();
|
||||
unsub2();
|
||||
unSub3();
|
||||
el.current && ((_d = roRef.current) == null ? void 0 : _d.unobserve(el.current));
|
||||
};
|
||||
}
|
||||
}, [vnc_url, window_vnc_url, linux_vnc, linkNum, shixun_environment_id, tab_type]);
|
||||
function sendRFBMessage() {
|
||||
var _a, _b;
|
||||
(_b = (_a = rfbRef.current) == null ? void 0 : _a.sendKey) == null ? void 0 : _b.call(_a, 135);
|
||||
}
|
||||
function clipboardSend(content) {
|
||||
return __async(this, null, function* () {
|
||||
var _a;
|
||||
if (vnc_url) {
|
||||
const s = content;
|
||||
const res = yield (0,fetch/* default */.ZP)(`/api/tasks/${params.taskId}/vnc_paste.json`, {
|
||||
method: "post",
|
||||
body: {
|
||||
content: Base64.encode(s),
|
||||
shixun_environment_id
|
||||
}
|
||||
});
|
||||
if ((res == null ? void 0 : res.status) === 0) {
|
||||
dispatch({
|
||||
type: 5 /* SET_TRANSFER_CONTENT */,
|
||||
payload: content
|
||||
});
|
||||
message/* default */.ZP.success("\u4FDD\u5B58\u6210\u529F\uFF01\u4F60\u53EF\u4EE5\u5728\u5B9E\u9A8C\u73AF\u5883\u4E2D\u7C98\u8D34\u8BE5\u5185\u5BB9");
|
||||
onCancelClipboardBox();
|
||||
}
|
||||
} else {
|
||||
(_a = rfbRef.current) == null ? void 0 : _a.clipboardPasteFrom(content);
|
||||
dispatch({
|
||||
type: 5 /* SET_TRANSFER_CONTENT */,
|
||||
payload: content
|
||||
});
|
||||
message/* default */.ZP.success("\u4FDD\u5B58\u6210\u529F\uFF01\u4F60\u53EF\u4EE5\u5728\u5B9E\u9A8C\u73AF\u5883\u4E2D\u7C98\u8D34\u8BE5\u5185\u5BB9");
|
||||
onCancelClipboardBox();
|
||||
}
|
||||
});
|
||||
}
|
||||
function doResize() {
|
||||
var scale, origin;
|
||||
scale = Math.min(
|
||||
document.getElementById("task-right-panel").clientWidth / 1920,
|
||||
document.getElementById("task-right-panel").clientHeight / 1260
|
||||
);
|
||||
iframeRef.current.parentElement.className = "wh1080p";
|
||||
iframeRef.current.parentElement.style.cssText = `transform:scale(${scale});transform-origin:center center`;
|
||||
el.current.style.cssText = "translate(-50%, -50%) scale(" + scale + ")";
|
||||
}
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
if (percent == 0) {
|
||||
clearTimeout(timeout.current);
|
||||
increase();
|
||||
}
|
||||
}, [percent]);
|
||||
const increase = () => {
|
||||
if (percent > 99) {
|
||||
percent = 99;
|
||||
} else {
|
||||
percent = percent + 1;
|
||||
timeout.current = setTimeout(() => {
|
||||
increase();
|
||||
}, 1500);
|
||||
}
|
||||
if (percent < 100)
|
||||
setPercent(percent);
|
||||
};
|
||||
const showIframe = (0,_react_17_0_2_react.useMemo)(() => {
|
||||
if (loading) {
|
||||
return "none";
|
||||
}
|
||||
if (linux_vnc || virtual_machine || window_vnc_url && instance_startup_type === 2) {
|
||||
return "block";
|
||||
} else {
|
||||
return "none";
|
||||
}
|
||||
}, [linux_vnc, loading, virtual_machine, window_vnc_url]);
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, isLarge && /* @__PURE__ */ _react_17_0_2_react.createElement("a", { className: "btn-vnc-resize", onClick: onResizeSet }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: `iconfont icon-tuichuquanping` })), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { width: "100%", height: "100%", overflow: "hidden", position: "absolute", display: showIframe === "block" ? "flex" : "none", alignItems: "center", justifyContent: "center", zIndex: 6 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("iframe", { style: { position: isLarge ? "fixed" : "absolute", left: 0, top: isLarge ? 40 : 0, width: "100%", height: `calc(100% - ${isLarge ? "100px" : "0px"})` }, frameBorder: "0", ref: iframeRef, allowFullScreen: true }))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { position: isLarge ? "fixed" : "absolute", left: 0, top: isLarge ? 40 : 0, zIndex: 5, width: "100%", height: `calc(100% - ${isLarge ? "100px" : "0px"})` }, className: `${window_vnc_url ? "vnc-panel-wrapper-windows" : "vnc-panel-wrapper"} ${isLarge ? "full-screen" : ""}` }, loading ? /* @__PURE__ */ _react_17_0_2_react.createElement(Spinner/* default */.Z, { message: mes, style: { color: "#0152d9" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "tc", style: { width: 500, margin: "0 auto", color: "#FFF" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(progress/* default */.Z, { percent, format: (p) => /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-white" }, p, "%") }))) : null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { ref: el, className: `vnc-panel ${loading ? "hidden zIndexf1" : "animated fadeIn"}` })), /* @__PURE__ */ _react_17_0_2_react.createElement(components_modal/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
modal["default"],
|
||||
{
|
||||
title: "\u590D\u5236\u7C98\u8D34",
|
||||
centered: true,
|
||||
maskClosable: false,
|
||||
open: showClipBoardBox,
|
||||
onCancel: onCancelClipboardBox,
|
||||
footer: null
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(clipboard_box, { onCancel: onCancelClipboardBox, onSave: clipboardSend, content: transferContent })
|
||||
)));
|
||||
});
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 68514:
|
||||
/*!***********************************************************!*\
|
||||
!*** ./src/pages/tasks/xterm-panel/index.jsx + 1 modules ***!
|
||||
\***********************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ xterm_panel; }
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
||||
var _react_17_0_2_react = __webpack_require__(59301);
|
||||
// EXTERNAL MODULE: ./node_modules/_js-base64@2.6.4@js-base64/base64.js
|
||||
var base64 = __webpack_require__(24334);
|
||||
// EXTERNAL MODULE: ./node_modules/_xterm@4.8.1@xterm/lib/xterm.js
|
||||
var xterm = __webpack_require__(34376);
|
||||
// EXTERNAL MODULE: ./node_modules/_xterm@4.8.1@xterm/css/xterm.css
|
||||
var css_xterm = __webpack_require__(15670);
|
||||
;// CONCATENATED MODULE: ./src/pages/tasks/xterm-panel/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var xterm_panelmodules = ({"xterm-panel":"xterm-panel___XA0p9"});
|
||||
// EXTERNAL MODULE: ./src/components/mediator.js
|
||||
var mediator = __webpack_require__(7694);
|
||||
// EXTERNAL MODULE: ./node_modules/_resize-observer-polyfill@1.5.1@resize-observer-polyfill/dist/ResizeObserver.es.js
|
||||
var ResizeObserver_es = __webpack_require__(76374);
|
||||
// EXTERNAL MODULE: ./src/pages/tasks/service/index.js
|
||||
var service = __webpack_require__(36070);
|
||||
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 14 modules
|
||||
var _umi_production_exports = __webpack_require__(87210);
|
||||
// EXTERNAL MODULE: ./src/utils/util.tsx
|
||||
var util = __webpack_require__(3163);
|
||||
;// CONCATENATED MODULE: ./src/pages/tasks/xterm-panel/index.jsx
|
||||
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 TimeTicket = 3e4;
|
||||
/* harmony default export */ var xterm_panel = (({ itemData = {}, game, myshixun }) => {
|
||||
const params = (0,_umi_production_exports.useParams)();
|
||||
const [term, setTerm] = (0,_react_17_0_2_react.useState)(null);
|
||||
const [sshConfigData, setSshConfigData] = (0,_react_17_0_2_react.useState)({});
|
||||
const { link_url, password, port } = sshConfigData;
|
||||
const el = (0,_react_17_0_2_react.useRef)();
|
||||
const socket = (0,_react_17_0_2_react.useRef)();
|
||||
const isFirstConnected = (0,_react_17_0_2_react.useRef)(false);
|
||||
const urlParamsAll = (0,util/* getJsonFromUrl */.oP)();
|
||||
const {
|
||||
shixun_environment_id,
|
||||
position,
|
||||
tab_type,
|
||||
index_tab
|
||||
} = itemData;
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
getInitData();
|
||||
}, []);
|
||||
function getColsAndRows(width, height, term2) {
|
||||
let w = term2._core._renderService.dimensions.actualCellWidth || 9.5;
|
||||
let h = term2._core._renderService.dimensions.actualCellHeight || 18;
|
||||
const rows = Math.floor(height / h);
|
||||
const cols = Math.floor(width / w);
|
||||
return [cols, rows];
|
||||
}
|
||||
function onLayout(term2, el2) {
|
||||
const ro = new ResizeObserver_es/* default */.Z((entries) => {
|
||||
for (let entry of entries) {
|
||||
if (entry.target.offsetHeight > 0 || entry.target.offsetWidth > 0) {
|
||||
const [cols, rows] = getColsAndRows(
|
||||
entry.target.offsetWidth,
|
||||
entry.target.offsetHeight,
|
||||
term2
|
||||
);
|
||||
console.log("cols, rows", cols, rows);
|
||||
mediator/* default */.Z.publish(`ssh-xterm-resize-${index_tab}`, {
|
||||
columns: cols,
|
||||
rows,
|
||||
width: entry.target.offsetWidth,
|
||||
height: entry.target.offsetHeight
|
||||
});
|
||||
term2.resize(cols, rows);
|
||||
const data1 = base64.Base64.decode("IA==");
|
||||
const data = base64.Base64.decode("CBtbSw==");
|
||||
term2.write(data1);
|
||||
term2.write(data);
|
||||
}
|
||||
}
|
||||
});
|
||||
ro.observe(el2);
|
||||
return ro;
|
||||
}
|
||||
function getInitData() {
|
||||
return __async(this, null, function* () {
|
||||
var _a, _b, _c, _d;
|
||||
const response = yield (0,service/* startInit */.sA)(myshixun == null ? void 0 : myshixun.identifier, __spreadValues({
|
||||
shixun_environment_id,
|
||||
tab_type,
|
||||
game_id: game.id
|
||||
}, urlParamsAll));
|
||||
if (!!((_b = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data_list) == null ? void 0 : _b.length)) {
|
||||
mediator/* default */.Z.publish("pod-restrict-data", {
|
||||
identifier: (_c = response == null ? void 0 : response.data) == null ? void 0 : _c.identifier,
|
||||
data_list: (_d = response == null ? void 0 : response.data) == null ? void 0 : _d.data_list
|
||||
});
|
||||
return;
|
||||
}
|
||||
if ((response == null ? void 0 : response.status) === -3) {
|
||||
return new Promise((resolve, reject) => __async(this, null, function* () {
|
||||
Modal.confirm({
|
||||
content: "\u68C0\u6D4B\u5230\u60A8\u5DF2\u7ECF\u5F00\u542F\u4E86\u5176\u4ED6\u5B9E\u9A8C\u73AF\u5883\uFF0C\u8BF7\u5148\u5173\u95ED\u73AF\u5883\u540E\uFF0C\u518D\u8FDE\u63A5",
|
||||
okText: "\u7ACB\u5373\u5173\u95ED",
|
||||
cancelText: "\u7A0D\u540E\u5173\u95ED",
|
||||
onOk: () => __async(this, null, function* () {
|
||||
yield closeWindowsVnc(params.taskId, response == null ? void 0 : response.message);
|
||||
init();
|
||||
return;
|
||||
})
|
||||
});
|
||||
}));
|
||||
}
|
||||
if ((response == null ? void 0 : response.status) === 0) {
|
||||
mediator/* default */.Z.publish("update-windows-time", response == null ? void 0 : response.data);
|
||||
mediator/* default */.Z.publish("send-tabs-result-data", __spreadProps(__spreadValues({}, response == null ? void 0 : response.data), { index_tab }));
|
||||
setSshConfigData(response.data);
|
||||
setTimeout(() => mediator/* default */.Z.publish(`create-socket-${index_tab}`), 300);
|
||||
}
|
||||
});
|
||||
}
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
if (el.current && link_url) {
|
||||
const term2 = new xterm.Terminal({ fontSize: 16, rendererType: "dom" });
|
||||
term2.open(el.current);
|
||||
term2.onData((data) => {
|
||||
if (socket.current) {
|
||||
if (socket.current.readyState === 1) {
|
||||
socket.current.send(JSON.stringify({ tp: "client", data }));
|
||||
}
|
||||
}
|
||||
});
|
||||
term2.write("Connecting...");
|
||||
setTerm(term2);
|
||||
const ro = onLayout(term2, el.current);
|
||||
return () => {
|
||||
term2.dispose();
|
||||
el.current && (ro == null ? void 0 : ro.unobserve(el.current));
|
||||
};
|
||||
}
|
||||
}, [link_url, el.current]);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
if (term && link_url) {
|
||||
let createSocket = function() {
|
||||
const socketInstance = new WebSocket(link_url);
|
||||
socket.current = socketInstance;
|
||||
socketInstance.onopen = () => {
|
||||
let container = term.element.parentElement;
|
||||
if (container) {
|
||||
let width = container.offsetWidth;
|
||||
let height = container.offsetHeight;
|
||||
console.log("init", {
|
||||
tp: "init",
|
||||
data: __spreadProps(__spreadValues({}, sshConfigData), {
|
||||
secret: password,
|
||||
width,
|
||||
height,
|
||||
rows: term.rows,
|
||||
columns: term.cols
|
||||
})
|
||||
});
|
||||
socketInstance.send(
|
||||
JSON.stringify({
|
||||
tp: "init",
|
||||
data: __spreadProps(__spreadValues({}, sshConfigData), {
|
||||
secret: password,
|
||||
width,
|
||||
height,
|
||||
rows: term.rows,
|
||||
columns: term.cols
|
||||
})
|
||||
})
|
||||
);
|
||||
}
|
||||
term.focus();
|
||||
};
|
||||
socketInstance.onerror = (error) => {
|
||||
console.log(
|
||||
"------in socket error----",
|
||||
error,
|
||||
socketInstance,
|
||||
link_url
|
||||
);
|
||||
};
|
||||
socketInstance.onmessage = (event) => {
|
||||
if (!isFirstConnected.current) {
|
||||
term.write("\r");
|
||||
setTimeout(() => {
|
||||
}, 1e3);
|
||||
}
|
||||
isFirstConnected.current = true;
|
||||
console.log("event:", event);
|
||||
const data = base64.Base64.decode(event.data.toString());
|
||||
let w = term._core._renderService.dimensions.actualCellWidth || 9.5;
|
||||
console.log("data:", data, w, term);
|
||||
term.write(data);
|
||||
};
|
||||
const tid = setInterval(() => {
|
||||
var _a;
|
||||
if (socket.current) {
|
||||
(_a = socket.current) == null ? void 0 : _a.send(JSON.stringify({ tp: "h" }));
|
||||
}
|
||||
}, TimeTicket);
|
||||
socketInstance.onclose = (evt) => {
|
||||
if (tid) {
|
||||
clearInterval(tid);
|
||||
}
|
||||
console.log(tid, "tid", index_tab);
|
||||
term.write("\r\nconnection closed");
|
||||
setTimeout(() => {
|
||||
createSocket();
|
||||
}, 10 * 1e3);
|
||||
};
|
||||
};
|
||||
const unSubCreate = mediator/* default */.Z.subscribe(`create-socket-${index_tab}`, () => {
|
||||
createSocket();
|
||||
});
|
||||
const unSubResize = mediator/* default */.Z.subscribe(`ssh-xterm-resize-${index_tab}`, (option) => {
|
||||
if (socket.current && socket.current.readyState === 1) {
|
||||
socket.current.send(
|
||||
JSON.stringify({ tp: "resize", data: __spreadValues({}, option) })
|
||||
);
|
||||
}
|
||||
});
|
||||
return () => {
|
||||
unSubCreate();
|
||||
unSubResize();
|
||||
if (socket.current) {
|
||||
socket.current.close();
|
||||
isFirstConnected.current = false;
|
||||
}
|
||||
};
|
||||
}
|
||||
}, [term, link_url, port]);
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { ref: el, className: xterm_panelmodules["xterm-panel"] }, !link_url ? /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { color: "#fff" } }, "\u6B63\u5728\u8FDE\u63A5\u547D\u4EE4\u884C\u670D\u52A1...") : null);
|
||||
});
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
@ -0,0 +1,617 @@
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[794],{
|
||||
|
||||
/***/ 59349:
|
||||
/*!***********************************************************!*\
|
||||
!*** ./src/components/CaptureVideo/index.tsx + 1 modules ***!
|
||||
\***********************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ components_CaptureVideo; }
|
||||
});
|
||||
|
||||
// UNUSED EXPORTS: CaptureVideo
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
||||
var _react_17_0_2_react = __webpack_require__(59301);
|
||||
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 14 modules
|
||||
var _umi_production_exports = __webpack_require__(87210);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
||||
var message = __webpack_require__(8591);
|
||||
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
||||
var fetch = __webpack_require__(87101);
|
||||
// EXTERNAL MODULE: ./node_modules/_uuid@8.3.0@uuid/dist/esm-browser/v4.js + 4 modules
|
||||
var v4 = __webpack_require__(1012);
|
||||
// EXTERNAL MODULE: ./src/components/UploadFile/index.tsx
|
||||
var UploadFile = __webpack_require__(6064);
|
||||
// EXTERNAL MODULE: ./node_modules/_ali-oss@6.18.1@ali-oss/dist/aliyun-oss-sdk.js
|
||||
var aliyun_oss_sdk = __webpack_require__(47257);
|
||||
var aliyun_oss_sdk_default = /*#__PURE__*/__webpack_require__.n(aliyun_oss_sdk);
|
||||
;// CONCATENATED MODULE: ./src/components/CaptureVideo/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var CaptureVideomodules = ({"flex_box_center":"flex_box_center___kVqBh","flex_space_between":"flex_space_between___FMnNq","flex_box_vertical_center":"flex_box_vertical_center___meESe","flex_box_center_end":"flex_box_center_end___KFpOb","flex_box_column":"flex_box_column___GHIK9","video":"video___nn_cD"});
|
||||
// EXTERNAL MODULE: ./src/service/video.ts
|
||||
var service_video = __webpack_require__(85513);
|
||||
;// CONCATENATED MODULE: ./src/components/CaptureVideo/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());
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const dataURLtoFile = function dataURLtoFile2(dataurl, filename) {
|
||||
const arr = dataurl.split(",");
|
||||
const mime = arr[0].match(/:(.*?);/)[1];
|
||||
const bstr = atob(arr[1]);
|
||||
let n = bstr.length;
|
||||
const u8arr = new Uint8Array(n);
|
||||
while (n--) {
|
||||
u8arr[n] = bstr.charCodeAt(n);
|
||||
}
|
||||
return new Blob([u8arr], { type: mime });
|
||||
};
|
||||
const CaptureVideo = (0,_react_17_0_2_react.forwardRef)(({ time, number, supportCamera, take_photo, isExercise = true, update, onUserMediaLoaded }, ref) => {
|
||||
const video = (0,_react_17_0_2_react.useRef)();
|
||||
const canvas = (0,_react_17_0_2_react.useRef)();
|
||||
const params = (0,_umi_production_exports.useParams)();
|
||||
let [phoneStep, setPhoneStep] = (0,_react_17_0_2_react.useState)([]);
|
||||
let [status, setStatus] = (0,_react_17_0_2_react.useState)(0);
|
||||
const [src, setSrc] = (0,_react_17_0_2_react.useState)("");
|
||||
let [interval, setInter] = (0,_react_17_0_2_react.useState)();
|
||||
const [isPause, setIsPause] = (0,_react_17_0_2_react.useState)(0);
|
||||
const uploadImgFile = (title, imgUrl) => __async(void 0, null, function* () {
|
||||
return (0,fetch/* default */.ZP)("/api/attachments.json", {
|
||||
method: "POST",
|
||||
body: {
|
||||
file_type: "base64",
|
||||
original_filename: title,
|
||||
file: imgUrl
|
||||
}
|
||||
});
|
||||
});
|
||||
const takePhotoAndUpload = (base64Res) => __async(void 0, null, function* () {
|
||||
const timeStamp = (/* @__PURE__ */ new Date()).valueOf();
|
||||
if (base64Res) {
|
||||
const res = yield uploadImgFile(`\u7167\u7247${timeStamp}`, base64Res);
|
||||
if (!res.status) {
|
||||
yield (0,service_video/* savePhoto */.Ju)({
|
||||
container_id: params.categoryId,
|
||||
container_type: "Exercise",
|
||||
attachment_id: res == null ? void 0 : res.id
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
checkMediaDevices();
|
||||
return () => {
|
||||
handleStop();
|
||||
clearTimer();
|
||||
};
|
||||
}, []);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
if (status === 2 && time && number > 0) {
|
||||
calcPhoto();
|
||||
setIsPause(1);
|
||||
}
|
||||
}, [time]);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
if (isPause === 0)
|
||||
return;
|
||||
if (isPause === 2) {
|
||||
clearInterval(interval);
|
||||
} else {
|
||||
let n = 0;
|
||||
let id = setInterval(() => {
|
||||
if (phoneStep.includes(n)) {
|
||||
handlePhoto();
|
||||
}
|
||||
n++;
|
||||
}, 1e3);
|
||||
setInter(id);
|
||||
}
|
||||
return () => clearInterval(interval);
|
||||
}, [isPause]);
|
||||
(0,_react_17_0_2_react.useImperativeHandle)(ref, () => ({
|
||||
handlePhoto,
|
||||
handleTakePhoto
|
||||
}));
|
||||
const clearTimer = () => {
|
||||
setIsPause(2);
|
||||
};
|
||||
const calcPhoto = () => {
|
||||
const step = time / number;
|
||||
const arr = [];
|
||||
function getRndInteger(min, max) {
|
||||
return parseInt(Math.floor(Math.random() * (max - min + 1)) + min);
|
||||
}
|
||||
new Array(number).fill(0).map((item, key) => {
|
||||
if (take_photo) {
|
||||
arr.push(getRndInteger(step * key, step * (key + 1)));
|
||||
} else {
|
||||
if (key == 0) {
|
||||
arr.push(0);
|
||||
} else {
|
||||
arr.push(getRndInteger(step * key, step * (key + 1)));
|
||||
}
|
||||
}
|
||||
});
|
||||
phoneStep = arr;
|
||||
setPhoneStep([...arr]);
|
||||
console.log(arr);
|
||||
};
|
||||
const checkMediaDevices = () => {
|
||||
if (navigator.mediaDevices === void 0) {
|
||||
navigator.mediaDevices = {};
|
||||
}
|
||||
if (navigator.mediaDevices.getUserMedia === void 0) {
|
||||
navigator.mediaDevices.getUserMedia = function(constraints) {
|
||||
const getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
|
||||
if (!getUserMedia) {
|
||||
return Promise.reject(new Error("getUserMedia is not implemented in this browser"));
|
||||
}
|
||||
return new Promise(function(resolve, reject) {
|
||||
getUserMedia.call(navigator, constraints, resolve, reject);
|
||||
});
|
||||
};
|
||||
}
|
||||
navigator.mediaDevices.getUserMedia({ video: { width: 640, height: 480 } }).then(function(stream) {
|
||||
streamRef.current = stream;
|
||||
supportCamera && supportCamera(2);
|
||||
setStatus(2);
|
||||
if ("srcObject" in video.current) {
|
||||
video.current.srcObject = stream;
|
||||
} else {
|
||||
video.current.src = window.URL.createObjectURL(stream);
|
||||
}
|
||||
video.current.onloadedmetadata = function(e) {
|
||||
video.current.play();
|
||||
if (onUserMediaLoaded) {
|
||||
onUserMediaLoaded();
|
||||
}
|
||||
};
|
||||
video.current.addEventListener("ended", function() {
|
||||
console.log("\u64AD\u653E\u7ED3\u675F");
|
||||
clearTimer();
|
||||
if (isExercise) {
|
||||
message/* default */.ZP.error({
|
||||
content: "\u60A8\u5DF2\u7ECF\u5173\u95ED\u4E86\u6444\u50CF\u5934\uFF0C\u8BF7\u572810\u79D2\u949F\u5185\u6062\u590D\u6444\u50CF\u5934\uFF0C\u5426\u5219\u5C06\u63A8\u51FA\u8003\u8BD5",
|
||||
duration: 10,
|
||||
key: 9998
|
||||
});
|
||||
}
|
||||
}, false);
|
||||
}).catch(function(err) {
|
||||
setStatus(1);
|
||||
supportCamera && supportCamera(1);
|
||||
if (err.message === "Permission denied" || err.name === "NotAllowedError") {
|
||||
message/* default */.ZP.error("\u60A8\u5DF2\u62D2\u7EDD\u4E86\u83B7\u53D6\u6444\u50CF\u5934");
|
||||
} else {
|
||||
message/* default */.ZP.error("\u6444\u50CF\u5934\u83B7\u53D6\u5931\u8D25\uFF0C\u6216\u60A8\u5DF2\u62D2\u7EDD\u4E86\u83B7\u53D6\u6444\u50CF\u5934");
|
||||
}
|
||||
console.log("errname: " + err.name);
|
||||
console.log("err: " + err.message);
|
||||
});
|
||||
};
|
||||
const handlePhoto = () => {
|
||||
try {
|
||||
canvas.current.width = video.current.videoWidth;
|
||||
canvas.current.height = video.current.videoHeight;
|
||||
const context = canvas.current.getContext("2d");
|
||||
context.drawImage(video.current, 0, 0, canvas.current.width, canvas.current.height);
|
||||
setSrc(canvas.current.toDataURL("image/png"));
|
||||
takePhotoAndUpload(canvas.current.toDataURL("image/png"));
|
||||
uploadFile(canvas.current.toDataURL("image/png"));
|
||||
} catch (e) {
|
||||
}
|
||||
};
|
||||
const handleTakePhoto = () => {
|
||||
try {
|
||||
canvas.current.width = video.current.videoWidth;
|
||||
canvas.current.height = video.current.videoHeight;
|
||||
const context = canvas.current.getContext("2d");
|
||||
context.drawImage(video.current, 0, 0, canvas.current.width, canvas.current.height);
|
||||
return canvas.current.toDataURL("image/png");
|
||||
} catch (e) {
|
||||
}
|
||||
};
|
||||
const streamRef = (0,_react_17_0_2_react.useRef)();
|
||||
const handleStop = () => {
|
||||
try {
|
||||
const stream = streamRef.current;
|
||||
const tracks = stream.getTracks();
|
||||
tracks.forEach(function(track) {
|
||||
track.stop();
|
||||
});
|
||||
video.current.srcObject = null;
|
||||
} catch (e) {
|
||||
}
|
||||
};
|
||||
const uploadFile = (file) => __async(void 0, null, function* () {
|
||||
var _a, _b, _c, _d, _e, _f, _g;
|
||||
const res = yield (0,fetch/* default */.ZP)("/api/buckets/get_upload_token.json", { method: "get" });
|
||||
res.data = JSON.parse((0,UploadFile/* decrypt */.pe)(res.data));
|
||||
const name = (0,v4/* default */.Z)();
|
||||
const client = new (aliyun_oss_sdk_default())({
|
||||
endpoint: (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.end_point,
|
||||
region: (_b = res == null ? void 0 : res.data) == null ? void 0 : _b.region,
|
||||
accessKeyId: (_c = res == null ? void 0 : res.data) == null ? void 0 : _c.access_key_id,
|
||||
accessKeySecret: (_d = res == null ? void 0 : res.data) == null ? void 0 : _d.access_key_secret,
|
||||
bucket: (_e = res == null ? void 0 : res.data) == null ? void 0 : _e.bucket,
|
||||
stsToken: (_f = res == null ? void 0 : res.data) == null ? void 0 : _f.security_token
|
||||
});
|
||||
const imgfile = dataURLtoFile(file, name);
|
||||
client.multipartUpload(`${name}.png`, imgfile, {
|
||||
timeout: 10 * 1e3,
|
||||
partSize: 10485760,
|
||||
callback: {
|
||||
url: (_g = res == null ? void 0 : res.data) == null ? void 0 : _g.callback_url,
|
||||
host: res == null ? void 0 : res.data.bucket_host,
|
||||
body: "bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&login=" + params.login + "&container_id=" + params.categoryId + "&container_type=Exercise"
|
||||
}
|
||||
}).then(function(result) {
|
||||
console.log("result:", result);
|
||||
}).catch(function(err) {
|
||||
console.log("err:", err);
|
||||
});
|
||||
});
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, status !== 3 && /* @__PURE__ */ _react_17_0_2_react.createElement("aside", { className: CaptureVideomodules.video, id: "screenshot" }, status === 0 && /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u6B63\u5728\u5F00\u542F\u6444\u50CF\u5934..."), status === 1 && /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u6444\u50CF\u5934\u5F00\u542F\u5931\u8D25"), status === 2 && /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("video", { width: "288", ref: video, autoPlay: true }), /* @__PURE__ */ _react_17_0_2_react.createElement("canvas", { style: { display: "none" }, ref: canvas }))));
|
||||
});
|
||||
/* harmony default export */ var components_CaptureVideo = (CaptureVideo);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 6064:
|
||||
/*!*********************************************!*\
|
||||
!*** ./src/components/UploadFile/index.tsx ***!
|
||||
\*********************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ cT: function() { return /* binding */ uploadFile; },
|
||||
/* harmony export */ pe: function() { return /* binding */ decrypt; }
|
||||
/* harmony export */ });
|
||||
/* unused harmony exports reNameFile, UploadFile */
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ 6557);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! antd */ 8591);
|
||||
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/utils/fetch */ 87101);
|
||||
/* harmony import */ var crypto_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! crypto-js */ 28209);
|
||||
/* harmony import */ var crypto_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(crypto_js__WEBPACK_IMPORTED_MODULE_2__);
|
||||
/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! uuid */ 1012);
|
||||
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! umi */ 87210);
|
||||
/* harmony import */ var ali_oss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ali-oss */ 47257);
|
||||
/* harmony import */ var ali_oss__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(ali_oss__WEBPACK_IMPORTED_MODULE_5__);
|
||||
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 { Dragger } = antd__WEBPACK_IMPORTED_MODULE_4__["default"];
|
||||
|
||||
const decrypt = (word) => {
|
||||
const ENC_KEY = "bf3c199c2470cb477d907b1e0917c17b";
|
||||
const IV = "5183666c72eec9e4";
|
||||
var key = crypto_js__WEBPACK_IMPORTED_MODULE_2___default().enc.Utf8.parse(ENC_KEY);
|
||||
let iv = crypto_js__WEBPACK_IMPORTED_MODULE_2___default().enc.Utf8.parse(IV);
|
||||
var decrypt2 = crypto_js__WEBPACK_IMPORTED_MODULE_2___default().AES.decrypt(word, key, {
|
||||
iv,
|
||||
mode: (crypto_js__WEBPACK_IMPORTED_MODULE_2___default().mode).CBC
|
||||
// padding: CryptoJS.pad.ZeroPadding
|
||||
});
|
||||
return decrypt2.toString((crypto_js__WEBPACK_IMPORTED_MODULE_2___default().enc).Utf8);
|
||||
};
|
||||
let tempCheckpoint;
|
||||
const reNameFile = (_0) => __async(void 0, [_0], function* ({ identifier, oldFilename, newFilename }) {
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
const res = yield Fetch("/api/buckets/get_upload_token_for_big_files.json", { method: "get" });
|
||||
res.data = JSON.parse(decrypt(res.data));
|
||||
const client = new OSS({
|
||||
endpoint: (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.end_point,
|
||||
region: (_b = res == null ? void 0 : res.data) == null ? void 0 : _b.region,
|
||||
accessKeyId: (_c = res == null ? void 0 : res.data) == null ? void 0 : _c.access_key_id,
|
||||
accessKeySecret: (_d = res == null ? void 0 : res.data) == null ? void 0 : _d.access_key_secret,
|
||||
bucket: (_e = res == null ? void 0 : res.data) == null ? void 0 : _e.bucket,
|
||||
stsToken: (_f = res == null ? void 0 : res.data) == null ? void 0 : _f.security_token
|
||||
});
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log(11111, `${identifier}/${oldFilename}`, `${identifier}/${newFilename}`, res.data);
|
||||
client.copy(`/${identifier}/${oldFilename}`, `/${identifier}/${newFilename}`).then((r) => {
|
||||
console.log("\u62F7\u8D1D\u6210\u529F", r);
|
||||
}).catch((e) => {
|
||||
console.log(e);
|
||||
});
|
||||
});
|
||||
});
|
||||
const uploadFile = (file, obj, config) => __async(void 0, null, function* () {
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
obj.file_name = file.name;
|
||||
const res = yield (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP)("/api/buckets/get_upload_token.json", { method: "get" });
|
||||
console.log("decrypt(res.data):", decrypt(res.data));
|
||||
res.data = JSON.parse(decrypt(res.data));
|
||||
const namearrs = file.name.split(".");
|
||||
namearrs.pop();
|
||||
const name = obj.realFileName ? namearrs.join("") : (0,uuid__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)();
|
||||
const client = new (ali_oss__WEBPACK_IMPORTED_MODULE_5___default())({
|
||||
endpoint: (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.end_point,
|
||||
region: (_b = res == null ? void 0 : res.data) == null ? void 0 : _b.region,
|
||||
accessKeyId: (_c = res == null ? void 0 : res.data) == null ? void 0 : _c.access_key_id,
|
||||
accessKeySecret: (_d = res == null ? void 0 : res.data) == null ? void 0 : _d.access_key_secret,
|
||||
bucket: (_e = res == null ? void 0 : res.data) == null ? void 0 : _e.bucket,
|
||||
stsToken: (_f = res == null ? void 0 : res.data) == null ? void 0 : _f.security_token
|
||||
});
|
||||
return new Promise((resolve, reject) => {
|
||||
var _a2;
|
||||
client.multipartUpload(`${name}`, new Blob([file], { type: file.type }), __spreadProps(__spreadValues({
|
||||
timeout: 200 * 1e3,
|
||||
partSize: 102400
|
||||
}, config), {
|
||||
callback: {
|
||||
url: (_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.callback_url,
|
||||
host: res == null ? void 0 : res.data.bucket_host,
|
||||
body: "bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&" + (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_1__/* .parseParams */ .rz)(obj)
|
||||
// body: 'bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&login=' + obj.login + '&container_id=' + obj.container_id + '&container_type='+obj.container_type,
|
||||
}
|
||||
})).then(function(result) {
|
||||
var _a3;
|
||||
file.response = (_a3 = result.data) == null ? void 0 : _a3.data;
|
||||
resolve(result == null ? void 0 : result.data);
|
||||
}).catch(function(err) {
|
||||
reject(err);
|
||||
console.log("err:", err);
|
||||
});
|
||||
});
|
||||
});
|
||||
const UploadFile = (_a) => {
|
||||
var _b = _a, { user, cancelUpload } = _b, props = __objRest(_b, ["user", "cancelUpload"]);
|
||||
const [fileList, setFileList] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
|
||||
let [client, setClient] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
|
||||
const _props = {
|
||||
onRemove: (e) => {
|
||||
setFileList([...fileList.filter((item) => item.name !== e.name)]);
|
||||
props.onChange(fileList.filter((item) => item.name !== e.name));
|
||||
},
|
||||
disabled: props.disabled,
|
||||
multiple: true,
|
||||
fileList: fileList == null ? void 0 : fileList.map((item) => item.file),
|
||||
customRequest: () => {
|
||||
},
|
||||
beforeUpload: (file) => __async(void 0, null, function* () {
|
||||
let fileSize = props.maxSize || 1024 * 1024 * 1024 * 1;
|
||||
if (!!fileList.filter((item) => item.name === file.name).length) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP.info(`${file.name}\u5DF2\u5B58\u5728\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9`);
|
||||
return;
|
||||
}
|
||||
if ((file == null ? void 0 : file.size) > fileSize) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP.info(`\u6587\u4EF6\u8D85\u8FC7${fileSize / 1024 / 1024 / 1024}GB\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42`);
|
||||
return false;
|
||||
}
|
||||
fileList.push({ name: file.name, file });
|
||||
setFileList([...fileList]);
|
||||
props.onChange(fileList);
|
||||
return false;
|
||||
})
|
||||
};
|
||||
const _uploadFiles = (file, obj) => __async(void 0, null, function* () {
|
||||
var _a2, _b2, _c, _d, _e, _f;
|
||||
obj.file_name = file.name;
|
||||
const name = file.name;
|
||||
const res = yield (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP)("/api/buckets/get_upload_token_for_big_files.json", { method: "get" });
|
||||
res.data = JSON.parse(decrypt(res.data));
|
||||
if ((res == null ? void 0 : res.status) !== 0) {
|
||||
fileList[fileList.findIndex((item) => item.name === name)]["status"] = "error";
|
||||
fileList[fileList.findIndex((item) => item.name === name)]["file"]["status"] = "error";
|
||||
props.onChange(fileList);
|
||||
antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP.warning("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u5C1D\u8BD5");
|
||||
return;
|
||||
}
|
||||
client = new (ali_oss__WEBPACK_IMPORTED_MODULE_5___default())({
|
||||
endpoint: (_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.end_point,
|
||||
region: (_b2 = res == null ? void 0 : res.data) == null ? void 0 : _b2.region,
|
||||
accessKeyId: (_c = res == null ? void 0 : res.data) == null ? void 0 : _c.access_key_id,
|
||||
accessKeySecret: (_d = res == null ? void 0 : res.data) == null ? void 0 : _d.access_key_secret,
|
||||
bucket: (_e = res == null ? void 0 : res.data) == null ? void 0 : _e.bucket,
|
||||
stsToken: (_f = res == null ? void 0 : res.data) == null ? void 0 : _f.security_token
|
||||
});
|
||||
console.log(file, "file");
|
||||
setClient(client);
|
||||
const namearrs = file.name.split(".");
|
||||
namearrs.pop();
|
||||
const filename = obj.realFileName ? namearrs.join(".") : (0,uuid__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)();
|
||||
return new Promise((resolve, reject) => {
|
||||
var _a3;
|
||||
try {
|
||||
client.multipartUpload(`${props.identifier}/${filename}${name.indexOf(".") > -1 ? "." + name.split(".").pop() : ""}`, new Blob([file.file], { type: file.file.type }), {
|
||||
timeout: 3600 * 1e3,
|
||||
partSize: 1002400,
|
||||
progress: (p, checkpoint, res2) => {
|
||||
try {
|
||||
console.log("\u8FDB\u5EA6", p, checkpoint, res2);
|
||||
const index = fileList.findIndex((item) => item.name === name);
|
||||
fileList[index]["file"]["percent"] = p * 100;
|
||||
fileList[index].tempCheckpoint = checkpoint;
|
||||
setFileList([...fileList]);
|
||||
} catch (e) {
|
||||
}
|
||||
},
|
||||
checkpoint: fileList[fileList.findIndex((item) => item.name === name)].tempCheckpoint,
|
||||
callback: {
|
||||
customValue: {
|
||||
id: name + ""
|
||||
},
|
||||
url: (_a3 = res == null ? void 0 : res.data) == null ? void 0 : _a3.callback_url,
|
||||
host: res == null ? void 0 : res.data.bucket_host,
|
||||
body: "bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&" + (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_1__/* .parseParams */ .rz)(obj)
|
||||
}
|
||||
}).then(function(result) {
|
||||
var _a4, _b3, _c2;
|
||||
const index = fileList.findIndex((item) => item.name === name);
|
||||
let status = "done";
|
||||
if (((_a4 = result.data) == null ? void 0 : _a4.status) === 0) {
|
||||
file.response = (_b3 = result.data) == null ? void 0 : _b3.data;
|
||||
const index2 = fileList.findIndex((item) => item.name === name);
|
||||
fileList[index2]["status"] = "done";
|
||||
fileList[index2]["file"]["status"] = "done";
|
||||
} else {
|
||||
antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP.warning((_c2 = result.data) == null ? void 0 : _c2.message);
|
||||
status = "error";
|
||||
}
|
||||
fileList[index]["status"] = status;
|
||||
fileList[index]["file"]["status"] = status;
|
||||
props.onChange(fileList);
|
||||
resolve(result == null ? void 0 : result.data);
|
||||
}).catch(function(err) {
|
||||
fileList[fileList.findIndex((item) => item.name === name)]["status"] = "error";
|
||||
fileList[fileList.findIndex((item) => item.name === name)]["file"]["status"] = "error";
|
||||
antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP.warning("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u5C1D\u8BD5");
|
||||
setFileList([...fileList]);
|
||||
props.onChange(fileList);
|
||||
reject(err);
|
||||
console.log("err:", err);
|
||||
});
|
||||
} catch (e) {
|
||||
}
|
||||
});
|
||||
});
|
||||
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
||||
if (fileList.every((item) => item === "done" || item === "error")) {
|
||||
props.onComplete(fileList);
|
||||
}
|
||||
}, [fileList]);
|
||||
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
||||
if (cancelUpload) {
|
||||
client == null ? void 0 : client.cancel();
|
||||
}
|
||||
}, [cancelUpload]);
|
||||
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
||||
if (props.uploading)
|
||||
fileList.map((item) => __async(void 0, null, function* () {
|
||||
var _a2;
|
||||
if ((!item.status || item.status === "error") && !cancelUpload) {
|
||||
item.status = "uploading";
|
||||
item.file.status = "uploading";
|
||||
const res = yield _uploadFiles(item, {
|
||||
login: (_a2 = user == null ? void 0 : user.userInfo) == null ? void 0 : _a2.login,
|
||||
container_type: props.container_type,
|
||||
container_id: props.container_id,
|
||||
description: props.description,
|
||||
realFileName: props.realFileName
|
||||
});
|
||||
}
|
||||
}));
|
||||
}, [props.uploading]);
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
Dragger,
|
||||
__spreadProps(__spreadValues({}, _props), {
|
||||
height: props.height,
|
||||
className: props.className
|
||||
}),
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", { className: "ant-upload-hint" }, props.text || "\u62D6\u62FD\u6587\u4EF6\u6216\u8005\u70B9\u51FB\u4E0A\u4F20")
|
||||
);
|
||||
};
|
||||
/* harmony default export */ __webpack_exports__.ZP = ((0,umi__WEBPACK_IMPORTED_MODULE_3__.connect)(
|
||||
({
|
||||
loading,
|
||||
globalSetting,
|
||||
user
|
||||
}) => ({
|
||||
globalSetting,
|
||||
loading: loading.models.competitions,
|
||||
user
|
||||
})
|
||||
)(UploadFile));
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3828:
|
||||
/*!************************!*\
|
||||
!*** crypto (ignored) ***!
|
||||
\************************/
|
||||
/***/ (function() {
|
||||
|
||||
/* (ignored) */
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
@ -0,0 +1,567 @@
|
||||
"use strict";
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[8372],{
|
||||
|
||||
/***/ 97282:
|
||||
/*!*****************************************!*\
|
||||
!*** ./src/components/NoData/index.tsx ***!
|
||||
\*****************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
||||
/* harmony import */ var _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/assets/images/icons/nodata.png */ 4977);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd */ 3113);
|
||||
var __defProp = Object.defineProperty;
|
||||
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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
const noData = ({
|
||||
img,
|
||||
buttonProps = {},
|
||||
styles = {},
|
||||
customText,
|
||||
ButtonText,
|
||||
ButtonClick,
|
||||
Buttonclass,
|
||||
ButtonTwo,
|
||||
imgStyles,
|
||||
loading = false
|
||||
}) => {
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
"section",
|
||||
{
|
||||
className: "tc animated fadeIn",
|
||||
style: __spreadValues(__spreadValues({}, { color: "#999", margin: "100px auto", visibility: loading ? "hidden" : "visible" }), styles)
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("img", { src: img || _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_1__, style: __spreadValues({}, imgStyles) }),
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", { className: "mt20 font14" }, customText || "\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),
|
||||
ButtonText && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .ZP, __spreadValues({ className: Buttonclass, onClick: ButtonClick }, buttonProps), ButtonText),
|
||||
ButtonTwo && ButtonTwo
|
||||
);
|
||||
};
|
||||
/* harmony default export */ __webpack_exports__.Z = (noData);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 78372:
|
||||
/*!*************************************************************!*\
|
||||
!*** ./src/pages/Classrooms/ExamList/index.tsx + 5 modules ***!
|
||||
\*************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
"default": function() { return /* binding */ ExamList; }
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
||||
var _react_17_0_2_react = __webpack_require__(59301);
|
||||
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 14 modules
|
||||
var _umi_production_exports = __webpack_require__(87210);
|
||||
// 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/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/skeleton/index.js + 12 modules
|
||||
var skeleton = __webpack_require__(59981);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
|
||||
var pagination = __webpack_require__(41867);
|
||||
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
||||
var NoData = __webpack_require__(97282);
|
||||
;// CONCATENATED MODULE: ./src/pages/Classrooms/ExamList/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var ExamListmodules = ({"flex_box_center":"flex_box_center___k6E7Z","flex_space_between":"flex_space_between___oW8nd","flex_box_vertical_center":"flex_box_vertical_center___hKiel","flex_box_center_end":"flex_box_center_end___bWBYz","flex_box_column":"flex_box_column___PI5IU","bg":"bg___pNQux","containerTitle":"containerTitle___yNJpi","containerDesc":"containerDesc___i_svy","menus":"menus___o7OFa","listItem":"listItem___z1ETv","info":"info___Ki3Js","title":"title___pwlJ7","titleLeft":"titleLeft___zGhmc","titleRight":"titleRight___e7Ghq","acitons":"acitons___teF7U","move":"move___SbOmH","hideHeadCheckbox":"hideHeadCheckbox___sAsoB","moveCategory":"moveCategory___QzsCK","tabSearch":"tabSearch____pHQT","warpModal":"warpModal___oxvp3","modalColumn":"modalColumn___RMpgc","modalRow":"modalRow___vjqMa","sup":"sup___nGUBA"});
|
||||
// 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/tooltip/index.js + 3 modules
|
||||
var tooltip = __webpack_require__(6848);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules
|
||||
var es_checkbox = __webpack_require__(24905);
|
||||
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
||||
var fetch = __webpack_require__(87101);
|
||||
;// CONCATENATED MODULE: ./src/pages/Classrooms/ExamList/components/List/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var Listmodules = ({"flex_box_center":"flex_box_center___ait_r","flex_space_between":"flex_space_between___rFCZt","flex_box_vertical_center":"flex_box_vertical_center___Se_r1","flex_box_center_end":"flex_box_center_end___zrmDd","flex_box_column":"flex_box_column___p4QYF","bg":"bg___K7jhB","containerTitle":"containerTitle___jYThs","containerDesc":"containerDesc___n3gfb","tablestyle":"tablestyle___OUTg8","listItem":"listItem___ye5vB","info":"info___Z1Jmz","title":"title___Pq4sD","titleLeft":"titleLeft___nUs7_","titleRight":"titleRight___nhuLW","acitons":"acitons___mwr_3","moveCategory":"moveCategory___ADEes","name":"name___hjh5r","categoryName":"categoryName___HTKzg","schedule":"schedule___Dli0r","fnSign":"fnSign___RB8GU","spanSize":"spanSize___yDHwD","classromediv":"classromediv___a26Uj","glow":"glow___IPF2B","popover":"popover___W5sXq","dot":"dot___MB2Pk"});
|
||||
;// CONCATENATED MODULE: ./src/pages/Classrooms/ExamList/components/List/img/ping1.svg
|
||||
var __defProp = Object.defineProperty;
|
||||
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;
|
||||
};
|
||||
|
||||
const SvgPing1 = (props) => /* @__PURE__ */ React.createElement("svg", __spreadValues({ width: 22, height: 22, xmlns: "http://www.w3.org/2000/svg" }, props), /* @__PURE__ */ React.createElement("title", null, "\u7F16\u7EC4 5\u5907\u4EFD 2"), /* @__PURE__ */ React.createElement("g", { fill: "none", fillRule: "evenodd" }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h22v22H0z" }), /* @__PURE__ */ React.createElement("g", { fill: "#979797", fillRule: "nonzero" }, /* @__PURE__ */ React.createElement("path", { d: "M10.422 5.818h.8v10.4h-.8z" }), /* @__PURE__ */ React.createElement("path", { d: "M10.743 17.018a.49.49 0 0 1-.38-.197c-.38-.541-1.21-.91-1.993-.91H3.697a.485.485 0 0 1-.475-.493V4.883c0-.173.071-.32.166-.443.214-.222.522-.222.736-.222h4.104c1.139 0 2.301.64 2.823 1.576.143.221.071.541-.166.664a.438.438 0 0 1-.64-.172C9.889 5.67 9.01 5.178 8.228 5.178H4.171v9.723h4.2c1.067 0 2.182.517 2.751 1.28a.493.493 0 0 1-.095.69c-.094.098-.19.147-.284.147Z" }), /* @__PURE__ */ React.createElement("path", { d: "M11.006 17.018a.469.469 0 0 1-.294-.098.483.483 0 0 1-.098-.69c.588-.763 1.714-1.28 2.84-1.28h3.99V5.203h-3.868c-.857 0-1.885.492-2.252 1.107-.147.222-.44.32-.66.173-.22-.148-.319-.443-.172-.665.612-1.034 2.056-1.6 3.084-1.6h4.234c.098 0 .294 0 .44.148.172.172.172.37.172.468v10.584c0 .271-.22.492-.49.492H13.43c-.808 0-1.64.37-2.056.911a.43.43 0 0 1-.367.197Z" }))));
|
||||
|
||||
/* harmony default export */ var ping1 = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMCAwaDIydjIySDB6Ii8+PGcgZmlsbD0iIzk3OTc5NyIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNMTAuNDIyIDUuODE4aC44djEwLjRoLS44eiIvPjxwYXRoIGQ9Ik0xMC43NDMgMTcuMDE4YS40OS40OSAwIDAgMS0uMzgtLjE5N2MtLjM4LS41NDEtMS4yMS0uOTEtMS45OTMtLjkxSDMuNjk3YS40ODUuNDg1IDAgMCAxLS40NzUtLjQ5M1Y0Ljg4M2MwLS4xNzMuMDcxLS4zMi4xNjYtLjQ0My4yMTQtLjIyMi41MjItLjIyMi43MzYtLjIyMmg0LjEwNGMxLjEzOSAwIDIuMzAxLjY0IDIuODIzIDEuNTc2LjE0My4yMjEuMDcxLjU0MS0uMTY2LjY2NGEuNDM4LjQzOCAwIDAgMS0uNjQtLjE3MkM5Ljg4OSA1LjY3IDkuMDEgNS4xNzggOC4yMjggNS4xNzhINC4xNzF2OS43MjNoNC4yYzEuMDY3IDAgMi4xODIuNTE3IDIuNzUxIDEuMjhhLjQ5My40OTMgMCAwIDEtLjA5NS42OWMtLjA5NC4wOTgtLjE5LjE0Ny0uMjg0LjE0N1oiLz48cGF0aCBkPSJNMTEuMDA2IDE3LjAxOGEuNDY5LjQ2OSAwIDAgMS0uMjk0LS4wOTguNDgzLjQ4MyAwIDAgMS0uMDk4LS42OWMuNTg4LS43NjMgMS43MTQtMS4yOCAyLjg0LTEuMjhoMy45OVY1LjIwM2gtMy44NjhjLS44NTcgMC0xLjg4NS40OTItMi4yNTIgMS4xMDctLjE0Ny4yMjItLjQ0LjMyLS42Ni4xNzMtLjIyLS4xNDgtLjMxOS0uNDQzLS4xNzItLjY2NS42MTItMS4wMzQgMi4wNTYtMS42IDMuMDg0LTEuNmg0LjIzNGMuMDk4IDAgLjI5NCAwIC40NC4xNDguMTcyLjE3Mi4xNzIuMzcuMTcyLjQ2OHYxMC41ODRjMCAuMjcxLS4yMi40OTItLjQ5LjQ5MkgxMy40M2MtLjgwOCAwLTEuNjQuMzctMi4wNTYuOTExYS40My40MyAwIDAgMS0uMzY3LjE5N1oiLz48L2c+PC9nPjwvc3ZnPg==");
|
||||
|
||||
;// CONCATENATED MODULE: ./src/pages/Classrooms/ExamList/components/List/img/ping2.svg
|
||||
var ping2_defProp = Object.defineProperty;
|
||||
var ping2_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
||||
var ping2_hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var ping2_propIsEnum = Object.prototype.propertyIsEnumerable;
|
||||
var ping2_defNormalProp = (obj, key, value) => key in obj ? ping2_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
||||
var ping2_spreadValues = (a, b) => {
|
||||
for (var prop in b || (b = {}))
|
||||
if (ping2_hasOwnProp.call(b, prop))
|
||||
ping2_defNormalProp(a, prop, b[prop]);
|
||||
if (ping2_getOwnPropSymbols)
|
||||
for (var prop of ping2_getOwnPropSymbols(b)) {
|
||||
if (ping2_propIsEnum.call(b, prop))
|
||||
ping2_defNormalProp(a, prop, b[prop]);
|
||||
}
|
||||
return a;
|
||||
};
|
||||
|
||||
const SvgPing2 = (props) => /* @__PURE__ */ React.createElement("svg", ping2_spreadValues({ width: 22, height: 22, xmlns: "http://www.w3.org/2000/svg" }, props), /* @__PURE__ */ React.createElement("title", null, "\u7F16\u7EC4 5\u5907\u4EFD"), /* @__PURE__ */ React.createElement("g", { fill: "none", fillRule: "evenodd" }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h22v22H0z" }), /* @__PURE__ */ React.createElement("g", { fillRule: "nonzero" }, /* @__PURE__ */ React.createElement("path", { fill: "#229BFF", d: "M10.422 5.818h.8v10.4h-.8z" }), /* @__PURE__ */ React.createElement("path", { d: "M10.743 17.018a.49.49 0 0 1-.38-.197c-.38-.541-1.21-.91-1.993-.91H3.697a.485.485 0 0 1-.475-.493V4.883c0-.173.071-.32.166-.443.214-.222.522-.222.736-.222h4.104c1.139 0 2.301.64 2.823 1.576.143.221.071.541-.166.664a.438.438 0 0 1-.64-.172C9.889 5.67 9.01 5.178 8.228 5.178H4.171v9.723h4.2c1.067 0 2.182.517 2.751 1.28a.493.493 0 0 1-.095.69c-.094.098-.19.147-.284.147Z", fill: "#0152d9" }), /* @__PURE__ */ React.createElement("path", { d: "M11.006 17.018a.469.469 0 0 1-.294-.098.483.483 0 0 1-.098-.69c.588-.763 1.714-1.28 2.84-1.28h3.99V5.203h-3.868c-.857 0-1.885.492-2.252 1.107-.147.222-.44.32-.66.173-.22-.148-.319-.443-.172-.665.612-1.034 2.056-1.6 3.084-1.6h4.234c.098 0 .294 0 .44.148.172.172.172.37.172.468v10.584c0 .271-.22.492-.49.492H13.43c-.808 0-1.64.37-2.056.911a.43.43 0 0 1-.367.197Z", fill: "#0152d9" }))));
|
||||
|
||||
/* harmony default export */ var ping2 = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMCAwaDIydjIySDB6Ii8+PGcgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBmaWxsPSIjMjI5QkZGIiBkPSJNMTAuNDIyIDUuODE4aC44djEwLjRoLS44eiIvPjxwYXRoIGQ9Ik0xMC43NDMgMTcuMDE4YS40OS40OSAwIDAgMS0uMzgtLjE5N2MtLjM4LS41NDEtMS4yMS0uOTEtMS45OTMtLjkxSDMuNjk3YS40ODUuNDg1IDAgMCAxLS40NzUtLjQ5M1Y0Ljg4M2MwLS4xNzMuMDcxLS4zMi4xNjYtLjQ0My4yMTQtLjIyMi41MjItLjIyMi43MzYtLjIyMmg0LjEwNGMxLjEzOSAwIDIuMzAxLjY0IDIuODIzIDEuNTc2LjE0My4yMjEuMDcxLjU0MS0uMTY2LjY2NGEuNDM4LjQzOCAwIDAgMS0uNjQtLjE3MkM5Ljg4OSA1LjY3IDkuMDEgNS4xNzggOC4yMjggNS4xNzhINC4xNzF2OS43MjNoNC4yYzEuMDY3IDAgMi4xODIuNTE3IDIuNzUxIDEuMjhhLjQ5My40OTMgMCAwIDEtLjA5NS42OWMtLjA5NC4wOTgtLjE5LjE0Ny0uMjg0LjE0N1oiIGZpbGw9IiMwMTUyZDkiLz48cGF0aCBkPSJNMTEuMDA2IDE3LjAxOGEuNDY5LjQ2OSAwIDAgMS0uMjk0LS4wOTguNDgzLjQ4MyAwIDAgMS0uMDk4LS42OWMuNTg4LS43NjMgMS43MTQtMS4yOCAyLjg0LTEuMjhoMy45OVY1LjIwM2gtMy44NjhjLS44NTcgMC0xLjg4NS40OTItMi4yNTIgMS4xMDctLjE0Ny4yMjItLjQ0LjMyLS42Ni4xNzMtLjIyLS4xNDgtLjMxOS0uNDQzLS4xNzItLjY2NS42MTItMS4wMzQgMi4wNTYtMS42IDMuMDg0LTEuNmg0LjIzNGMuMDk4IDAgLjI5NCAwIC40NC4xNDguMTcyLjE3Mi4xNzIuMzcuMTcyLjQ2OHYxMC41ODRjMCAuMjcxLS4yMi40OTItLjQ5LjQ5MkgxMy40M2MtLjgwOCAwLTEuNjQuMzctMi4wNTYuOTExYS40My40MyAwIDAgMS0uMzY3LjE5N1oiIGZpbGw9IiMwMTUyZDkiLz48L2c+PC9nPjwvc3ZnPg==");
|
||||
|
||||
// EXTERNAL MODULE: ./src/utils/authority.ts
|
||||
var authority = __webpack_require__(55830);
|
||||
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.10@dayjs/dayjs.min.js
|
||||
var dayjs_min = __webpack_require__(9498);
|
||||
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
|
||||
;// CONCATENATED MODULE: ./src/pages/Classrooms/ExamList/components/List/index.tsx
|
||||
var List_defProp = Object.defineProperty;
|
||||
var __defProps = Object.defineProperties;
|
||||
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
||||
var List_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
||||
var List_hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var List_propIsEnum = Object.prototype.propertyIsEnumerable;
|
||||
var List_defNormalProp = (obj, key, value) => key in obj ? List_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
||||
var List_spreadValues = (a, b) => {
|
||||
for (var prop in b || (b = {}))
|
||||
if (List_hasOwnProp.call(b, prop))
|
||||
List_defNormalProp(a, prop, b[prop]);
|
||||
if (List_getOwnPropSymbols)
|
||||
for (var prop of List_getOwnPropSymbols(b)) {
|
||||
if (List_propIsEnum.call(b, prop))
|
||||
List_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 List = ({
|
||||
v,
|
||||
k,
|
||||
match,
|
||||
selectArrs,
|
||||
setSelectArrs,
|
||||
dispatch,
|
||||
params
|
||||
}) => {
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
const [lists, setlists] = (0,_react_17_0_2_react.useState)([]);
|
||||
const [isshow, setisshow] = (0,_react_17_0_2_react.useState)(false);
|
||||
const format = "YYYY-MM-DD";
|
||||
const endTime = dayjs_min_default()("2020-11-15", format);
|
||||
function getlist() {
|
||||
return __async(this, null, function* () {
|
||||
console.log(params, 222);
|
||||
let res = yield (0,fetch/* default */.ZP)(`/api/courses/${params == null ? void 0 : params.coursesId}/exercises/group_use_list.json`, {
|
||||
method: "get",
|
||||
params: __spreadProps(List_spreadValues({}, params), {
|
||||
id: v.id
|
||||
})
|
||||
});
|
||||
setlists((res == null ? void 0 : res.groups) || []);
|
||||
});
|
||||
}
|
||||
const modalText = () => modal["default"].info({
|
||||
title: "\u9898\u5E93\u6539\u7248\u544A\u77E5",
|
||||
content: /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, "EduCoder\u5DF2\u5347\u7EA7\u9898\u5E93\u529F\u80FD\uFF0C\u6240\u6709\u8BD5\u9898\u5747\u9700\u5339\u914D\u77E5\u8BC6\u70B9\u3002 \u5F53\u524D\u8BD5\u5377\u6240\u6D89\u53CA\u8BD5\u9898\u5747\u672A\u5339\u914D\u77E5\u8BC6\u70B9\uFF0C\u65E0\u6CD5\u968F\u673A\u62BD\u53D6\uFF0C\u5DF2\u4E0D\u80FD\u6709\u6548\u4F7F\u7528\u3002\u8BF7\u5728\u8BD5\u5377\u5E93\u91CD\u65B0\u7EC4\u5377\u540E\u4F7F\u7528\u3002 \u7531\u6B64\u5E26\u6765\u7684\u4E0D\u4FBF\uFF0C\u656C\u8BF7\u8C05\u89E3\uFF01")
|
||||
});
|
||||
const enterExam = (v2) => {
|
||||
var _a2;
|
||||
window.location.href = `/classrooms/${v2.course_identifier}/exercisenotice/${v2.id}/users/${(_a2 = (0,authority/* userInfo */.eY)()) == null ? void 0 : _a2.login}`;
|
||||
};
|
||||
const columns = [
|
||||
{
|
||||
title: "\u73ED\u7EA7",
|
||||
dataIndex: "name",
|
||||
key: "name"
|
||||
},
|
||||
{
|
||||
title: "\u8003\u8BD5\u72B6\u6001",
|
||||
dataIndex: "exercise_status",
|
||||
key: "exercise_status",
|
||||
width: 100,
|
||||
filters: [
|
||||
{
|
||||
text: "\u672A\u5F00\u59CB",
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
text: "\u8003\u8BD5\u4E2D",
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
text: "\u5DF2\u7ED3\u675F",
|
||||
value: 3
|
||||
}
|
||||
],
|
||||
onFilter: (value, record) => {
|
||||
return record.exercise_status === value;
|
||||
},
|
||||
render: (k2, r) => {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, k2 === 1 && /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: Listmodules.dot, style: { background: "#C3C3C3" } }), "\u672A\u5F00\u59CB"), k2 === 2 && /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: Listmodules.dot, style: { background: "#4EACFF" } }), "\u8003\u8BD5\u4E2D"), k2 === 3 && /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: Listmodules.dot, style: { background: "#FC2D6B" } }), "\u5DF2\u7ED3\u675F"));
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "\u5F00\u59CB\u65F6\u95F4",
|
||||
dataIndex: "publish_time",
|
||||
key: "publish_time",
|
||||
sorter: true,
|
||||
width: 170,
|
||||
showSorterTooltip: false,
|
||||
sortOrder: params.order_by === "publish_time" ? params.sort_direction === "desc" ? "descend" : "ascend" : null
|
||||
},
|
||||
{
|
||||
title: "\u7ED3\u675F\u65F6\u95F4",
|
||||
dataIndex: "end_time",
|
||||
key: "end_time",
|
||||
sorter: true,
|
||||
width: 170,
|
||||
showSorterTooltip: false,
|
||||
sortOrder: params.order_by === "end_time" ? params.sort_direction === "desc" ? "descend" : "ascend" : null
|
||||
},
|
||||
{
|
||||
title: "\u63D0\u4EA4\u4EBA\u6570",
|
||||
dataIndex: "exercise_answer",
|
||||
key: "exercise_answer",
|
||||
align: "center",
|
||||
width: 80,
|
||||
render: (k2, r) => {
|
||||
return r.exercise_status === 1 ? "-" : /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, k2, "/", r.exercise_users);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "\u5F85\u8BC4\u9605\u8BD5\u5377",
|
||||
dataIndex: "unreview_count",
|
||||
key: "unreview_count",
|
||||
align: "center",
|
||||
width: 90,
|
||||
render: (k2, r) => {
|
||||
return r.exercise_status === 1 ? "-" : /* @__PURE__ */ _react_17_0_2_react.createElement(_umi_production_exports.Link, { to: `/classrooms/${params == null ? void 0 : params.coursesId}/exercise/${v == null ? void 0 : v.id}/detail?random=false&exercise_group_id=${r.course_group_id}` }, k2);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "\u64CD\u4F5C",
|
||||
dataIndex: "action",
|
||||
align: "center",
|
||||
key: "action",
|
||||
width: 60,
|
||||
render: (k2, r) => {
|
||||
return r.exercise_status === 1 ? /* @__PURE__ */ _react_17_0_2_react.createElement("img", { style: { cursor: "not-allowed" }, src: ping1 }) : /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u8BC4\u9605" }, /* @__PURE__ */ _react_17_0_2_react.createElement(_umi_production_exports.Link, { to: `/classrooms/${params == null ? void 0 : params.coursesId}/exercise/${v == null ? void 0 : v.id}/detail?random=false&exercise_group_id=${r.course_group_id}` }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: ping2 })));
|
||||
}
|
||||
}
|
||||
];
|
||||
const renderTips = (v2) => {
|
||||
if (v2 == null ? void 0 : v2.includes("\u672A\u5F00\u59CB")) {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { backgroundColor: "#B8B8B8" }, className: "tag-style mr10" }, "\u672A\u5F00\u59CB");
|
||||
}
|
||||
if (v2 == null ? void 0 : v2.includes("\u8003\u8BD5\u4E2D")) {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { backgroundColor: "#007AFF" }, className: "tag-style mr10" }, "\u8003\u8BD5\u4E2D");
|
||||
}
|
||||
if (v2 == null ? void 0 : v2.includes("\u5DF2\u7ED3\u675F")) {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { backgroundColor: "#FC2D6B" }, className: "tag-style mr10" }, "\u5DF2\u7ED3\u675F");
|
||||
}
|
||||
};
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"div",
|
||||
{
|
||||
className: Listmodules.listItem,
|
||||
key: k,
|
||||
onClick: () => {
|
||||
enterExam(v);
|
||||
}
|
||||
},
|
||||
(0,authority/* isAdmin */.GJ)() && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_checkbox["default"],
|
||||
{
|
||||
checked: selectArrs.includes(v.id),
|
||||
value: v.id,
|
||||
onClick: (e) => {
|
||||
e.stopPropagation();
|
||||
},
|
||||
onChange: (e) => {
|
||||
let key = selectArrs.indexOf(v.id);
|
||||
if (selectArrs.indexOf(v.id) > -1) {
|
||||
setSelectArrs(
|
||||
selectArrs.filter(
|
||||
(val) => val !== v.id
|
||||
)
|
||||
);
|
||||
} else {
|
||||
setSelectArrs(selectArrs.concat(v.id));
|
||||
}
|
||||
}
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Listmodules.info }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Listmodules.title }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Listmodules.titleLeft, style: { marginRight: "15px" } }, renderTips(v == null ? void 0 : v.exercise_tips), /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: v.exercise_name }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: `${Listmodules.name}`, style: { maxWidth: ((_a = v == null ? void 0 : v.exercise_tips) == null ? void 0 : _a.includes("\u5DF2\u5F00\u542F\u9632\u4F5C\u5F0A")) ? 400 : 498 } }, v.exercise_name)), !v.is_public && (0,authority/* isAdmin */.GJ)() && /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u79C1\u6709\u5C5E\u6027\uFF0C\u975E\u8BFE\u5802\u6210\u5458\u4E0D\u80FD\u8BBF\u95EE" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "iconfont icon-suo1 ml10 mr10 c-light-black font12" })), ((_b = v == null ? void 0 : v.exercise_tips) == null ? void 0 : _b.includes("\u5DF2\u5F00\u542F\u9632\u4F5C\u5F0A")) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { flexShrink: 0 }, className: "tag-style-fzb iconfont icon-fangzuobi ml10" }, "\u5DF2\u5F00\u542F\u9632\u4F5C\u5F0A"), ((_c = v == null ? void 0 : v.exercise_tips) == null ? void 0 : _c.includes("\u5DF2\u7ED3\u675F")) && ((_d = v == null ? void 0 : v.exercise_tips) == null ? void 0 : _d.includes("\u672A\u63D0\u4EA4")) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { flexShrink: 0, backgroundColor: "#B8B8B8" }, className: "tag-style ml10" }, "\u672A\u63D0\u4EA4")), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"div",
|
||||
{ className: Listmodules.titleRight, onClick: (e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
} },
|
||||
(0,authority/* isAdmin */.GJ)() && v.assistant_auth && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { onClick: (e) => {
|
||||
e.stopPropagation();
|
||||
const startTime = dayjs_min_default()(v.created_at, format);
|
||||
const diff3 = dayjs_min_default()(endTime).diff(dayjs_min_default()(startTime), "days");
|
||||
if (diff3 > 0 && (v == null ? void 0 : v.is_random)) {
|
||||
modalText();
|
||||
} else if (v == null ? void 0 : v.is_random) {
|
||||
_umi_production_exports.history.push(`/classrooms/${v.course_id}/exercise/${v.id}/random/preview?random=${v.is_random}`);
|
||||
} else {
|
||||
_umi_production_exports.history.push(`/classrooms/${v.course_id}/exercise/${v.id}/detail?random=${v.is_random}&tabs=2`);
|
||||
}
|
||||
} }, "\u9884\u89C8"),
|
||||
(0,authority/* isAdminOrStudent */.RV)() && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
"span",
|
||||
{
|
||||
onClick: () => {
|
||||
_umi_production_exports.history.push(`/classrooms/${v.course_id}/exercise/${v.id}/detail?random=${v.is_random}`);
|
||||
}
|
||||
},
|
||||
"\u8BE6\u60C5"
|
||||
),
|
||||
// isStudent() &&
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, v.current_status === 0 && v.exercise_status > 1 && !((_e = v.exercise_tips) == null ? void 0 : _e.includes("\u5DF2\u7ED3\u675F")) && /* @__PURE__ */ _react_17_0_2_react.createElement("a", { onClick: (e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
enterExam(v);
|
||||
}, href: `` }, "\u7EE7\u7EED\u8003\u8BD5"), v.current_status === 1 && v.exercise_status > 1 && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "mr20", style: { color: "#0152d9", marginRight: "5px" }, onClick: (e) => {
|
||||
var _a2;
|
||||
window.location.href = `/classrooms/${v.course_id}/exercise/${v.id}/users/${(_a2 = (0,authority/* userInfo */.eY)()) == null ? void 0 : _a2.login}?check=true`;
|
||||
} }, "\u67E5\u770B\u8BD5\u5377"), v.current_status === 2 && v.exercise_status > 1 && !((_f = v.exercise_tips) == null ? void 0 : _f.includes("\u5DF2\u7ED3\u675F")) && /* @__PURE__ */ _react_17_0_2_react.createElement("a", { onClick: (e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
enterExam(v);
|
||||
}, href: `` }, "\u5F00\u59CB\u8003\u8BD5"))
|
||||
)), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { display: "flex" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-grey-999 mr20" }, "\u521B\u5EFA\u8005\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-blue" }, v.username)), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-grey-999 mr20" }, "\u6240\u5C5E\u8BFE\u5802\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-blue" }, v.course_name)), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "ml30 c-grey-999 mr20" }, "\u8003\u8BD5\u65F6\u957F\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-blue" }, v.time === null || v.time === -1 ? "\u4E0D\u9650" : `${v.time}\u5206\u949F`)), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "ml15 c-grey-999" }, "\u8003\u8BD5\u65F6\u95F4\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-blue" }, dayjs_min_default()(v == null ? void 0 : v.published_time).format("YYYY-MM-DD HH:mm")), " \u81F3 ", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-blue" }, dayjs_min_default()(v == null ? void 0 : v.end_time).format("YYYY-MM-DD HH:mm")))))
|
||||
);
|
||||
};
|
||||
/* harmony default export */ var components_List = (List);
|
||||
|
||||
;// CONCATENATED MODULE: ./src/pages/Classrooms/ExamList/index.tsx
|
||||
var ExamList_defProp = Object.defineProperty;
|
||||
var ExamList_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
||||
var ExamList_hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var ExamList_propIsEnum = Object.prototype.propertyIsEnumerable;
|
||||
var ExamList_defNormalProp = (obj, key, value) => key in obj ? ExamList_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
||||
var ExamList_spreadValues = (a, b) => {
|
||||
for (var prop in b || (b = {}))
|
||||
if (ExamList_hasOwnProp.call(b, prop))
|
||||
ExamList_defNormalProp(a, prop, b[prop]);
|
||||
if (ExamList_getOwnPropSymbols)
|
||||
for (var prop of ExamList_getOwnPropSymbols(b)) {
|
||||
if (ExamList_propIsEnum.call(b, prop))
|
||||
ExamList_defNormalProp(a, prop, b[prop]);
|
||||
}
|
||||
return a;
|
||||
};
|
||||
var __objRest = (source, exclude) => {
|
||||
var target = {};
|
||||
for (var prop in source)
|
||||
if (ExamList_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
||||
target[prop] = source[prop];
|
||||
if (source != null && ExamList_getOwnPropSymbols)
|
||||
for (var prop of ExamList_getOwnPropSymbols(source)) {
|
||||
if (exclude.indexOf(prop) < 0 && ExamList_propIsEnum.call(source, prop))
|
||||
target[prop] = source[prop];
|
||||
}
|
||||
return target;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const { Option } = es_select["default"];
|
||||
const ShixunsListPage = (_a) => {
|
||||
var _b = _a, {
|
||||
classroomList,
|
||||
globalSetting,
|
||||
exercise,
|
||||
loading,
|
||||
dispatch,
|
||||
match
|
||||
} = _b, props = __objRest(_b, [
|
||||
"classroomList",
|
||||
"globalSetting",
|
||||
"exercise",
|
||||
"loading",
|
||||
"dispatch",
|
||||
"match"
|
||||
]);
|
||||
var _a2, _b2, _c, _d, _e;
|
||||
const [params, setParams] = (0,_react_17_0_2_react.useState)(ExamList_spreadValues({}, (0,_umi_production_exports.useParams)()));
|
||||
const location = (0,_umi_production_exports.useLocation)();
|
||||
const { detailExerciseList, detailTopBanner, detailLeftMenus } = classroomList;
|
||||
const [selectArrs, setSelectArrs] = (0,_react_17_0_2_react.useState)([]);
|
||||
const [moveVisible, setMoveVisible] = (0,_react_17_0_2_react.useState)(false);
|
||||
const [querys, setQuerys] = (0,_react_17_0_2_react.useState)({
|
||||
page: 1,
|
||||
course_id: ""
|
||||
});
|
||||
params["id"] = params["coursesId"];
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
getData();
|
||||
dispatch({
|
||||
type: "globalSetting/footerToggle",
|
||||
payload: false
|
||||
});
|
||||
dispatch({
|
||||
type: "globalSetting/onlyShowBackTopToggle",
|
||||
payload: true
|
||||
});
|
||||
}, [querys]);
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
setSelectArrs([]);
|
||||
}, [detailExerciseList]);
|
||||
const getData = () => {
|
||||
document.body.scrollIntoView();
|
||||
dispatch({
|
||||
type: "exercise/getUserExercise",
|
||||
payload: querys
|
||||
});
|
||||
};
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: "minH500 minW1200" }, /* @__PURE__ */ _react_17_0_2_react.createElement("aside", { className: `${ExamListmodules.acitons} w100` }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: "w100" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: "1" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "font20 blod" }, "\u8003\u8BD5\u5217\u8868")), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u6309\u8BFE\u5802\u540D\u79F0\u641C\u7D22\u8BD5\u5377\u8003\u8BD5\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_select["default"],
|
||||
{
|
||||
className: "ml20",
|
||||
size: "large",
|
||||
style: { width: 300 },
|
||||
placeholder: "\u5168\u90E8",
|
||||
onChange: (value) => {
|
||||
querys.course_id = value;
|
||||
querys.page = 1;
|
||||
setQuerys(ExamList_spreadValues({}, querys));
|
||||
}
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(Option, { value: "" }, "\u5168\u90E8"),
|
||||
(_b2 = (_a2 = exercise == null ? void 0 : exercise.userExerciseList) == null ? void 0 : _a2.courses) == null ? void 0 : _b2.map((item, key) => {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(Option, { value: item.id }, item.name);
|
||||
})
|
||||
))))), ((_c = exercise == null ? void 0 : exercise.userExerciseList) == null ? void 0 : _c.exercises_count) === 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(NoData/* default */.Z, null), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
skeleton/* default */.Z,
|
||||
{
|
||||
loading: loading["exercise/getUserExercise"],
|
||||
active: true,
|
||||
avatar: { size: 40 },
|
||||
paragraph: { rows: 5 },
|
||||
className: "mt30"
|
||||
},
|
||||
((_d = exercise == null ? void 0 : exercise.userExerciseList) == null ? void 0 : _d.exercises) && ((_e = exercise == null ? void 0 : exercise.userExerciseList) == null ? void 0 : _e.exercises.map(function(v, k) {
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
components_List,
|
||||
{
|
||||
v,
|
||||
k,
|
||||
match,
|
||||
selectArrs,
|
||||
setSelectArrs,
|
||||
dispatch,
|
||||
params
|
||||
}
|
||||
);
|
||||
})),
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("aside", { className: "tc mb50 mt30" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
pagination/* default */.Z,
|
||||
{
|
||||
showTotal: (total) => {
|
||||
var _a3;
|
||||
return `\u5171 ${(_a3 = exercise == null ? void 0 : exercise.userExerciseList) == null ? void 0 : _a3.exercises_count} \u6761`;
|
||||
},
|
||||
hideOnSinglePage: true,
|
||||
showSizeChanger: false,
|
||||
onChange: (page) => {
|
||||
querys.page = page;
|
||||
setQuerys(ExamList_spreadValues({}, querys));
|
||||
},
|
||||
defaultPageSize: 20,
|
||||
defaultCurrent: querys.page,
|
||||
current: querys.page || 1,
|
||||
total: exercise == null ? void 0 : exercise.userExerciseList.exercises_count
|
||||
}
|
||||
))
|
||||
));
|
||||
};
|
||||
/* harmony default export */ var ExamList = ((0,_umi_production_exports.connect)(
|
||||
({
|
||||
classroomList,
|
||||
loading,
|
||||
globalSetting,
|
||||
exercise
|
||||
}) => ({
|
||||
classroomList,
|
||||
globalSetting,
|
||||
loading: loading.effects,
|
||||
exercise
|
||||
})
|
||||
)(ShixunsListPage));
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
@ -0,0 +1,696 @@
|
||||
"use strict";
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[8556],{
|
||||
|
||||
/***/ 2731:
|
||||
/*!***********************************************************************!*\
|
||||
!*** ./src/pages/Account/Certification/components/index.less?modules ***!
|
||||
\***********************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
||||
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ __webpack_exports__.Z = ({"modal":"modal___AR21E","colorBlue":"colorBlue___b0CCE","formWrap":"formWrap___OyO5X","flexRow":"flexRow___wW7jP","flexColumn":"flexColumn___BCgnC","example":"example___ZutfX","exampleImg":"exampleImg___kx2Sr","colorOrange":"colorOrange___Vxey1","uploader":"uploader___XWuRm","uploadImg":"uploadImg___K7STh","imageTip":"imageTip___E92I3","uploadTipIcon":"uploadTipIcon___T9xzR","uploadTip":"uploadTip___q47UY","color05101a":"color05101a___QWF70","viewLargerImg":"viewLargerImg___fGLAh","footerWrap":"footerWrap___ko3aN","note":"note___ks3DM","schoolHintWrap":"schoolHintWrap___nges7","colorCDCDCD":"colorCDCDCD___KQtws","color0152d9":"color0152d9___fTD_v","tips":"tips___NZ2ux"});
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 8556:
|
||||
/*!******************************************************************************!*\
|
||||
!*** ./src/pages/Account/Certification/components/ProfessionalAuthModal.tsx ***!
|
||||
\******************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
||||
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! umi */ 87210);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! antd */ 57809);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! antd */ 6557);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! antd */ 78241);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! antd */ 8591);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! antd */ 43418);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! antd */ 71418);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! antd */ 95237);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! antd */ 43604);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! antd */ 1056);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! antd */ 6848);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! antd */ 88522);
|
||||
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! antd */ 3113);
|
||||
/* harmony import */ var _components_AppplySchoolModal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../components/AppplySchoolModal */ 29261);
|
||||
/* harmony import */ var _components_AppplyDepartmentModal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppplyDepartmentModal */ 38683);
|
||||
/* harmony import */ var _utils_env__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/utils/env */ 64741);
|
||||
/* harmony import */ var _assets_images_account_job_png__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/assets/images/account/job.png */ 51941);
|
||||
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./index.less?modules */ 2731);
|
||||
/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/utils/util */ 3163);
|
||||
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 Option = antd__WEBPACK_IMPORTED_MODULE_8__["default"].Option;
|
||||
const Dragger = antd__WEBPACK_IMPORTED_MODULE_9__["default"].Dragger;
|
||||
const ProfessionalAuthModal = (_a) => {
|
||||
var _b = _a, {
|
||||
user,
|
||||
account,
|
||||
globalSetting,
|
||||
loading,
|
||||
dispatch
|
||||
} = _b, props = __objRest(_b, [
|
||||
"user",
|
||||
"account",
|
||||
"globalSetting",
|
||||
"loading",
|
||||
"dispatch"
|
||||
]);
|
||||
var _a2, _b2, _c;
|
||||
const [form] = antd__WEBPACK_IMPORTED_MODULE_10__["default"].useForm();
|
||||
const [formValue, setFormValue] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({});
|
||||
const [schoolList, setSchoolList] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
|
||||
const [filterSchoolList, setFilterSchoolList] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
|
||||
const [departmentList, setDepartmentList] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
|
||||
const [filterDepartmentList, setFilterDepartmentList] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
|
||||
const [image, setImage] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
|
||||
const [fileId, setFileId] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
|
||||
const [isLoading, setIsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
|
||||
const [visibleAppplySchool, setVisibleAppplySchool] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
|
||||
const [visibleAppplyDepartment, setVisibleAppplyDepartment] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
|
||||
;
|
||||
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
||||
getSchoolOption();
|
||||
}, []);
|
||||
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
||||
var _a3;
|
||||
if (!((_a3 = account.basicInfo) == null ? void 0 : _a3.school_id)) {
|
||||
return;
|
||||
}
|
||||
(() => __async(void 0, null, function* () {
|
||||
var _a4;
|
||||
const res = yield getDepartmentOption((_a4 = account.basicInfo) == null ? void 0 : _a4.school_id);
|
||||
setDepartmentList(res == null ? void 0 : res.departments);
|
||||
}))();
|
||||
}, [(_a2 = account.basicInfo) == null ? void 0 : _a2.school_id]);
|
||||
const getSchoolOption = () => __async(void 0, null, function* () {
|
||||
const res = yield dispatch({
|
||||
type: "account/getSchoolOption"
|
||||
});
|
||||
setSchoolList(res == null ? void 0 : res.schools);
|
||||
});
|
||||
const getDepartmentOption = (schoolId) => {
|
||||
return dispatch({
|
||||
type: "account/getDepartmentOption",
|
||||
payload: { id: schoolId }
|
||||
});
|
||||
};
|
||||
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
||||
if (!account.basicInfo) {
|
||||
return;
|
||||
}
|
||||
const { basicInfo } = account;
|
||||
const formData = {
|
||||
identity: basicInfo.identity,
|
||||
school: basicInfo.school_name,
|
||||
department: basicInfo.department_name,
|
||||
studentNo: basicInfo.student_id,
|
||||
jobTitle: basicInfo.identity == "teacher" ? basicInfo.technical_title : "\u6559\u6388",
|
||||
manager: basicInfo.identity == "professional" ? basicInfo.technical_title : "\u4F01\u4E1A\u7BA1\u7406\u8005",
|
||||
code_type: 2
|
||||
};
|
||||
form.setFieldsValue(formData);
|
||||
setFormValue(formData);
|
||||
}, [account.basicInfo]);
|
||||
const handleApplySchool = () => {
|
||||
setVisibleAppplySchool(true);
|
||||
};
|
||||
const handleApplyDepartment = () => {
|
||||
if (!schoolList.find((item) => item.name === formValue.school)) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .ZP.info("\u8BF7\u5148\u9009\u62E9\u6B63\u786E\u7684\u5355\u4F4D\u6216\u8005\u5B66\u6821\uFF01");
|
||||
return;
|
||||
}
|
||||
setVisibleAppplyDepartment(true);
|
||||
};
|
||||
const handleValuesChange = (changedValues) => {
|
||||
setFormValue(__spreadValues({}, form.getFieldsValue()));
|
||||
if ("identity" in changedValues) {
|
||||
setFormValue(__spreadProps(__spreadValues({}, form.getFieldsValue()), { code_type: 2 }));
|
||||
}
|
||||
if ("school" in changedValues) {
|
||||
setFilterSchoolList(schoolList.filter((item) => item.name.includes(changedValues.school)));
|
||||
const findSchoolId = (schoolList.find((item) => item.name === changedValues.school) || {}).id;
|
||||
if (findSchoolId) {
|
||||
handleSetDepartment(changedValues.school);
|
||||
} else {
|
||||
form.setFieldsValue({ department: "" });
|
||||
setFormValue(__spreadValues(__spreadValues({}, formValue), { school: changedValues.school, department: "" }));
|
||||
}
|
||||
}
|
||||
};
|
||||
const handleSetDepartment = (school, departmentName) => __async(void 0, null, function* () {
|
||||
var _a3, _b3, _c2;
|
||||
const findSchoolId = (_a3 = schoolList.find((item) => item.name === school)) == null ? void 0 : _a3.id;
|
||||
const res = (yield getDepartmentOption(findSchoolId)) || {};
|
||||
setDepartmentList(res == null ? void 0 : res.departments);
|
||||
const name = departmentName || ((_c2 = (_b3 = res == null ? void 0 : res.departments) == null ? void 0 : _b3[0]) == null ? void 0 : _c2.name);
|
||||
form.setFieldsValue({ department: name });
|
||||
setFormValue(__spreadValues(__spreadValues({}, formValue), { school, department: name }));
|
||||
});
|
||||
const handleSchoolSuccess = (schoolName) => __async(void 0, null, function* () {
|
||||
yield getSchoolOption();
|
||||
form.setFieldsValue({ school: schoolName, department: "" });
|
||||
setFormValue(__spreadValues(__spreadValues({}, formValue), { school: schoolName, department: "" }));
|
||||
});
|
||||
const handleUploadChange = (info) => {
|
||||
var _a3;
|
||||
if (info.file.status === "uploading") {
|
||||
setIsLoading(true);
|
||||
return;
|
||||
}
|
||||
if (info.file.status === "done") {
|
||||
console.log(info.file, info.file.response);
|
||||
setFileId((_a3 = info.file.response) == null ? void 0 : _a3.id);
|
||||
(0,_utils_util__WEBPACK_IMPORTED_MODULE_7__/* .getBase64 */ .y3)(info.file.originFileObj, (base64Img) => {
|
||||
setImage(base64Img);
|
||||
setIsLoading(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
const handleFinish = (values) => __async(void 0, null, function* () {
|
||||
var _a3, _b3, _c2, _d, _e;
|
||||
const { school, department, identity, studentNo, jobTitle, manager, code_type, code } = values || {};
|
||||
if (!image) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .ZP.info("\u8BF7\u5148\u4E0A\u4F20\u7167\u7247\uFF01");
|
||||
return;
|
||||
}
|
||||
const school_id = (_a3 = schoolList.find((item) => item.name === school)) == null ? void 0 : _a3.id;
|
||||
const department_id = (_b3 = departmentList.find((item) => item.name === department)) == null ? void 0 : _b3.id;
|
||||
let extra;
|
||||
if (identity === "student") {
|
||||
extra = studentNo;
|
||||
} else if (identity === "teacher") {
|
||||
extra = jobTitle;
|
||||
} else {
|
||||
extra = manager;
|
||||
}
|
||||
if (!school_id) {
|
||||
const modal = antd__WEBPACK_IMPORTED_MODULE_12__["default"].confirm({
|
||||
icon: null,
|
||||
width: 600,
|
||||
centered: true,
|
||||
okText: "\u65B0\u589E",
|
||||
cancelText: "\u53D6\u6D88",
|
||||
title: "\u63D0\u793A",
|
||||
content: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", null, "\u7CFB\u7EDF\u672A\u627E\u5230\u60A8\u586B\u5199\u7684\u5B66\u6821/\u5355\u4F4D\uFF0C\u662F\u5426\u7533\u8BF7\u65B0\u589E\u8BE5\u5355\u4F4D\uFF1F")),
|
||||
onOk: handleApplySchool,
|
||||
onCancel: () => {
|
||||
modal.destroy();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!!department && !department_id) {
|
||||
const modal = antd__WEBPACK_IMPORTED_MODULE_12__["default"].confirm({
|
||||
icon: null,
|
||||
width: 600,
|
||||
centered: true,
|
||||
okText: "\u65B0\u589E",
|
||||
cancelText: "\u53D6\u6D88",
|
||||
title: "\u63D0\u793A",
|
||||
content: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", null, "\u7CFB\u7EDF\u672A\u627E\u5230\u60A8\u586B\u5199\u7684\u9662\u7CFB/\u90E8\u95E8\uFF0C\u662F\u5426\u7533\u8BF7\u65B0\u589E\u8BE5\u90E8\u95E8\uFF1F")),
|
||||
onOk: handleApplyDepartment,
|
||||
onCancel: () => {
|
||||
modal.destroy();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
const res = yield dispatch({
|
||||
type: "account/applyProfessionalAuth",
|
||||
payload: {
|
||||
id: ((_c2 = account.basicInfo) == null ? void 0 : _c2.id) || ((_d = user.userInfo) == null ? void 0 : _d.login),
|
||||
school_id,
|
||||
department_id,
|
||||
identity,
|
||||
extra,
|
||||
code,
|
||||
code_type,
|
||||
attachment_ids: [fileId]
|
||||
}
|
||||
});
|
||||
handleClose();
|
||||
if ((res == null ? void 0 : res.status) === 0) {
|
||||
if (code) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .ZP.info("\u804C\u4E1A\u8BA4\u8BC1\u5BA1\u6838\u901A\u8FC7");
|
||||
} else {
|
||||
antd__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .ZP.info("\u7533\u8BF7\u5DF2\u63D0\u4EA4\uFF0C\u8BF7\u7B49\u5F85\u5BA1\u6838\uFF01");
|
||||
}
|
||||
setImage("");
|
||||
dispatch({
|
||||
type: "account/getBasicInfo",
|
||||
payload: { login: (_e = user.userInfo) == null ? void 0 : _e.login }
|
||||
});
|
||||
}
|
||||
});
|
||||
const handleClose = () => {
|
||||
form.setFieldValue("code", "");
|
||||
dispatch({
|
||||
type: "account/setActionTabs",
|
||||
payload: {}
|
||||
});
|
||||
};
|
||||
const uploadProps = {
|
||||
data: { type: "professional" },
|
||||
multiple: true,
|
||||
withCredentials: true,
|
||||
showUploadList: false,
|
||||
action: `${_utils_env__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z.API_SERVER}/api/attachments.json`,
|
||||
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.uploader,
|
||||
onChange: handleUploadChange,
|
||||
beforeUpload: (file) => {
|
||||
const isJpgOrPng = file.type === "image/jpeg" || file.type === "image/png" || file.type === "image/jpg" || file.type === "image/bmp";
|
||||
if (!isJpgOrPng) {
|
||||
antd__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .ZP.info("\u8BF7\u4E0A\u4F20\u6B63\u786E\u6587\u4EF6\u683C\u5F0F");
|
||||
}
|
||||
return isJpgOrPng;
|
||||
}
|
||||
};
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_12__["default"],
|
||||
{
|
||||
centered: true,
|
||||
keyboard: false,
|
||||
closable: false,
|
||||
destroyOnClose: true,
|
||||
forceRender: true,
|
||||
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.modal,
|
||||
open: account.actionTabs.key === "Account-ProfessionalAuth",
|
||||
title: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("i", { className: `iconfont icon-zhiyerenzheng font18 mr5 ${_index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.colorBlue}` }), "\u804C\u4E1A\u8BA4\u8BC1"),
|
||||
width: "660px",
|
||||
footer: null
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z, { spinning: !!isLoading }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_10__["default"],
|
||||
{
|
||||
form,
|
||||
layout: "horizontal",
|
||||
size: "large",
|
||||
scrollToFirstError: true,
|
||||
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.formWrap,
|
||||
onValuesChange: handleValuesChange,
|
||||
onFinish: handleFinish
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, { gutter: [10, 0] }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, { flex: "300px" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_10__["default"].Item,
|
||||
{
|
||||
label: "\u804C\u4E1A",
|
||||
name: "identity",
|
||||
rules: [{ required: true, message: "\u8BF7\u5148\u9009\u62E9\u804C\u4E1A" }]
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_8__["default"], null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Option, { value: "teacher" }, "\u6559\u5E08"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Option, { value: "student" }, "\u5B66\u751F"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Option, { value: "professional" }, "\u4E13\u4E1A\u4EBA\u58EB"))
|
||||
)), formValue.identity === "student" && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, { flex: 1 }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_10__["default"].Item,
|
||||
{
|
||||
initialValue: formValue.studentNo,
|
||||
name: "studentNo",
|
||||
rules: [{ required: true, message: "\u8BF7\u5148\u8F93\u5165\u5B66\u53F7" }]
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_16__["default"], { type: "text", placeholder: "\u8BF7\u8F93\u5165\u5B66\u53F7" })
|
||||
)), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, { flex: 0 }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.tooltipWrapper }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_17__/* ["default"] */ .Z, { title: "\u5355\u4F4D\u7BA1\u7406\u5458\u53EF\u7BA1\u7406\u5DF2\u901A\u8FC7\u804C\u4E1A\u8BA4\u8BC1\u7684\u5B66\u751F\u8D26\u53F7\u4FE1\u606F\uFF08\u5305\u542B\u521D\u59CB\u5316\u5BC6\u7801\uFF09" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.tips }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("i", { className: "iconfont icon-a-wenhaobeifen2" })))))), formValue.identity === "teacher" && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, { flex: 1 }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_10__["default"].Item,
|
||||
{
|
||||
initialValue: formValue.jobTitle,
|
||||
name: "jobTitle",
|
||||
rules: [{ required: true, message: "\u8BF7\u5148\u9009\u62E9\u804C\u79F0" }]
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_8__["default"], null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Option, { value: "\u6559\u6388" }, "\u6559\u6388"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Option, { value: "\u526F\u6559\u6388" }, "\u526F\u6559\u6388"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Option, { value: "\u8BB2\u5E08" }, "\u8BB2\u5E08"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Option, { value: "\u52A9\u6559" }, "\u52A9\u6559"))
|
||||
)), formValue.identity === "professional" && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, { flex: 1 }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_10__["default"].Item,
|
||||
{
|
||||
initialValue: formValue.manager,
|
||||
name: "manager",
|
||||
rules: [{ required: true, message: "\u8BF7\u5148\u9009\u62E9\u804C\u79F0" }]
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_8__["default"], null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Option, { value: "\u4F01\u4E1A\u7BA1\u7406\u8005" }, "\u4F01\u4E1A\u7BA1\u7406\u8005"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Option, { value: "\u90E8\u95E8\u7BA1\u7406\u8005" }, "\u90E8\u95E8\u7BA1\u7406\u8005"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Option, { value: "\u9AD8\u7EA7\u5DE5\u7A0B\u5E08" }, "\u9AD8\u7EA7\u5DE5\u7A0B\u5E08"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Option, { value: "\u5DE5\u7A0B\u5E08" }, "\u5DE5\u7A0B\u5E08"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Option, { value: "\u52A9\u7406\u5DE5\u7A0B\u5E08" }, "\u52A9\u7406\u5DE5\u7A0B\u5E08"))
|
||||
))),
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_10__["default"].Item,
|
||||
{
|
||||
label: "\u5B66\u6821/\u5355\u4F4D",
|
||||
name: "school",
|
||||
extra: formValue.school && !(schoolList == null ? void 0 : schoolList.find((item) => item.name === formValue.school)) && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.schoolHintWrap }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.colorCDCDCD }, "\u672A\u627E\u5230\u5305\u542B\u201C", formValue.school, "\u201D\u7684\u9AD8\u6821\uFF0C"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: `${_index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.color0152d9} current`, onClick: handleApplySchool }, "\u7533\u8BF7\u65B0\u589E")),
|
||||
rules: [{ required: true, message: "\u8BF7\u5148\u9009\u62E9\u5B66\u6821/\u5355\u4F4D" }]
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_18__/* ["default"] */ .Z, { showSearch: true, options: filterSchoolList == null ? void 0 : filterSchoolList.map((item) => ({ value: item.name })) })
|
||||
),
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_10__["default"].Item,
|
||||
{
|
||||
label: "\u9662\u7CFB/\u90E8\u95E8",
|
||||
name: "department",
|
||||
extra: formValue.department && !(departmentList == null ? void 0 : departmentList.find((item) => item.name === formValue.department)) && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.schoolHintWrap }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.colorCDCDCD }, formValue.department ? `\u672A\u627E\u5230\u5305\u542B\u201C${formValue.department}\u201D\u7684\u9AD8\u6821\uFF0C` : "\u672A\u627E\u5230\u9662\u7CFB\uFF0C"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: `${_index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.color0152d9} current`, onClick: handleApplyDepartment }, "\u7533\u8BF7\u65B0\u589E")),
|
||||
rules: [{ required: true, message: "\u8BF7\u5148\u9009\u62E9\u9662\u7CFB/\u90E8\u95E8" }]
|
||||
},
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_18__/* ["default"] */ .Z, { showSearch: true, onChange: (value) => setFilterDepartmentList(departmentList.filter((item) => item.name.includes(value))) }, filterDepartmentList.map((item, key) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Option, { key, value: item.name }, item.name)))
|
||||
),
|
||||
formValue.identity === "student" && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, { gutter: [10, 0], wrap: false }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, { flex: "240px" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_10__["default"].Item, { label: "\u9A8C\u8BC1\u7801", name: "code_type", initialValue: 2 }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_8__["default"], null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Option, { value: 2 }, "\u624B\u673A\u53F7"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(Option, { value: 1 }, "\u9080\u8BF7\u7801")))), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, { flex: 1 }, formValue.code_type === 1 ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_10__["default"].Item, { name: "code" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_16__["default"], { type: "text", placeholder: "\u8BF7\u8F93\u5165\u5DF2\u52A0\u5165\u7684\u6559\u5B66\u8BFE\u5802\u7684\u9080\u8BF7\u7801", maxLength: 10 })) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_10__["default"].Item, { name: "code" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_16__["default"], { type: "text", placeholder: "\u8BF7\u8F93\u5165\u5DF2\u52A0\u5165\u7684\u6559\u5B66\u8BFE\u5802\u4E2D\u6559\u5E08\u7684\u624B\u673A\u53F7\u540E\u516D\u4F4D", maxLength: 10 }))), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_17__/* ["default"] */ .Z, { title: "\u5F53\u524D\u8D26\u53F7\u7533\u8BF7\u8BA4\u8BC1\u7684\u5355\u4F4D\u4E0E\u5DF2\u52A0\u5165\u7684\u6559\u5B66\u8BFE\u5802\u6240\u5C5E\u5355\u4F4D\u9700\u76F8\u540C" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, { style: { paddingTop: "10px" } }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("i", { className: "iconfont icon-a-wenhaobeifen2 primary-hover font14", style: { cursor: "pointer" } })))),
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_10__["default"].Item, { label: "\u804C\u4E1A\u8BC1\u4E0A\u4F20", required: true }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.flexRow }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: `${_index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.flexColumn} ${_index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.example}` }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.exampleImg }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("img", { src: _assets_images_account_job_png__WEBPACK_IMPORTED_MODULE_5__ })), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: "tc" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", null, "\u793A\u4F8B\u56FE\u7247"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", { className: `${_index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.colorOrange} font12` }, "\uFF08png/jpg/bmp\u683C\u5F0F\uFF0C\u4E0D\u8D85\u8FC72MB\uFF09"))), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.flexColumn }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
Dragger,
|
||||
__spreadProps(__spreadValues({}, uploadProps), {
|
||||
accept: ".png,.jpg,.bmp,.jpeg"
|
||||
}),
|
||||
image ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("img", { src: image, className: _index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.uploadImg }) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.imageTip }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("i", { className: `iconfont icon-cuban2shangchuanyunduan ${_index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.uploadTipIcon}` })), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.uploadTip }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("a", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.color05101a }, "\u70B9\u51FB\u6216\u62D6\u62FD\u4E0A\u4F20\u56FE\u7247")))
|
||||
), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: "tc" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.viewLargerImg }, "\u67E5\u770B\u5927\u56FE"))))),
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.footerWrap }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_10__["default"].Item, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
antd__WEBPACK_IMPORTED_MODULE_19__/* ["default"] */ .ZP,
|
||||
{
|
||||
className: "mr5",
|
||||
size: "middle",
|
||||
onClick: handleClose
|
||||
},
|
||||
"\u53D6\u6D88"
|
||||
), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_19__/* ["default"] */ .ZP, { size: "middle", type: "primary", htmlType: "submit", loading: loading["account/applyProfessionalAuth"] }, "\u63D0\u4EA4"))),
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z.note }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", null, "\u8BA4\u8BC1\u987B\u77E5\uFF1A"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", null, "1.\u6839\u636E\u804C\u4E1A\u4E0A\u4F20\u76F8\u5E94\u7684\u8BC1\u4EF6\u7167\uFF1A\u6559\u5E08\uFF08\u6559\u5E08\u8BC1\uFF09\uFF0C\u4E13\u4E1A\u4EBA\u58EB\uFF08\u5458\u5DE5\u8BC1\uFF09\u3001\u5B66\u751F\uFF08\u5B66\u751F\u8BC1\uFF09\uFF0C\u8BF7\u786E\u4FDD\u8BC1\u4EF6\u7167\u5185\u5BB9\u5B8C\u6574\u5E76\u4E14\u6E05\u6670\u53EF\u89C1\uFF0C\u4E25\u7981PS\uFF1B"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", null, "2.\u6211\u4EEC\u5C06\u5728\u4F60\u63D0\u4EA4\u804C\u4E1A\u8BC1\u4FE1\u606F\u540E\u768424\u5C0F\u65F6\uFF08\u4E0D\u5305\u542B\u8282\u5047\u65E5\uFF09\u5185\u5B8C\u6210\u5BA1\u6838\uFF0C\u5BA1\u6838\u7ED3\u679C\u5C06\u4F1A\u4EE5\u7CFB\u7EDF\u6D88\u606F\u7684\u5F62\u5F0F\u53D1\u9001\u7ED9\u4F60\uFF1B"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", null, "3.\u804C\u4E1A\u8BA4\u8BC1\u5BA1\u6838\u5B8C\u6210\u540E\uFF0C\u65E0\u6CD5\u5220\u9664\uFF0C\u8BF7\u8C28\u614E\u586B\u5199\uFF1B\u804C\u4E1A\u53D8\u66F4\u8BF7\u9009\u62E9\u91CD\u65B0\u8BA4\u8BC1\uFF1B"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", null, "4.\u804C\u4E1A\u8BA4\u8BC1\u5BA1\u6838\u5B8C\u6210\u540E\uFF0C\u7CFB\u7EDF\u5C06\u81EA\u52A8\u53D1\u653E500\u4E2A\u91D1\u5E01\u4F5C\u4E3A\u5956\u52B1\uFF1B"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", null, "5.\u6211\u4EEC\u4F1A\u786E\u4FDD\u4F60\u6240\u63D0\u4F9B\u7684\u4FE1\u606F\u5747\u5904\u4E8E\u4E25\u683C\u7684\u4FDD\u5BC6\u72B6\u6001\uFF0C\u4E0D\u4F1A\u6CC4\u9732\uFF1B"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", null, "6.\u5982\u5B58\u5728\u6076\u610F\u4E71\u586B\u5199\u59D3\u540D\uFF0C\u5B66\u53F7\uFF0C\u53CA\u4E0A\u4F20\u4E0E\u804C\u4E1A\u8BC1\u4EF6\u65E0\u5173\u56FE\u7247\u8005\uFF0C\u4E00\u7ECF\u53D1\u73B0\u5C06\u51BB\u7ED3", !((_b2 = globalSetting == null ? void 0 : globalSetting.setting) == null ? void 0 : _b2.is_local) && "EduCoder", "\u8D26\u53F7\u3002"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", null, "7.\u975E\u8001\u5E08\u8EAB\u4EFD\u63D0\u4EA4\u804C\u4E1A\u8BA4\u8BC1\u540E\u7CFB\u7EDF\u4F1A\u81EA\u52A8\u5C06\u72B6\u6001\u6539\u4E3A\u5DF2\u8BA4\u8BC1\uFF0C\u4F60\u5C06\u53EF\u4EE5\u4F53\u9A8C\u5E73\u53F0\u9700\u8981\u804C\u4E1A\u8BA4\u8BC1\u7684\u529F\u80FD\uFF1B\u5982\u679C\u5728\u8BA4\u8BC1\u540E\u7684\u4F7F\u7528\u8FC7\u7A0B\u4E2D\u672A\u901A\u8FC7\u5BA1\u6838\uFF0C\u4F60\u5C06\u4E0D\u80FD\u7EE7\u7EED\u4F53\u9A8C\u9700\u8981\u8BA4\u8BC1\u7684\u529F\u80FD\u3002"))
|
||||
)),
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
_components_AppplySchoolModal__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z,
|
||||
{
|
||||
visible: visibleAppplySchool,
|
||||
onClose: () => setVisibleAppplySchool(false),
|
||||
schoolName: formValue.school,
|
||||
onSuccess: handleSchoolSuccess
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
||||
_components_AppplyDepartmentModal__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z,
|
||||
{
|
||||
visible: visibleAppplyDepartment,
|
||||
onClose: () => setVisibleAppplyDepartment(false),
|
||||
schoolId: (_c = schoolList.find((item) => item.name === formValue.school)) == null ? void 0 : _c.id,
|
||||
schoolName: formValue.school,
|
||||
departmentName: formValue.department,
|
||||
onSuccess: (departmentName) => handleSetDepartment(formValue.school, departmentName)
|
||||
}
|
||||
)
|
||||
);
|
||||
};
|
||||
/* harmony default export */ __webpack_exports__.Z = ((0,umi__WEBPACK_IMPORTED_MODULE_1__.connect)(
|
||||
({
|
||||
user,
|
||||
account,
|
||||
loading,
|
||||
globalSetting
|
||||
}) => ({
|
||||
user,
|
||||
account,
|
||||
globalSetting,
|
||||
loading: loading.effects
|
||||
})
|
||||
)(ProfessionalAuthModal));
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 29261:
|
||||
/*!******************************************************************************!*\
|
||||
!*** ./src/pages/Account/components/AppplySchoolModal/index.tsx + 1 modules ***!
|
||||
\******************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ components_AppplySchoolModal; }
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
||||
var _react_17_0_2_react = __webpack_require__(59301);
|
||||
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 14 modules
|
||||
var _umi_production_exports = __webpack_require__(87210);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
||||
var input = __webpack_require__(1056);
|
||||
// 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 es_modal = __webpack_require__(43418);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
|
||||
var table = __webpack_require__(72315);
|
||||
// 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/cascader/index.js + 18 modules
|
||||
var cascader = __webpack_require__(19842);
|
||||
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
||||
var es_button = __webpack_require__(3113);
|
||||
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/CheckCircleFilled.js + 1 modules
|
||||
var CheckCircleFilled = __webpack_require__(95934);
|
||||
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/CloseCircleFilled.js + 1 modules
|
||||
var CloseCircleFilled = __webpack_require__(48796);
|
||||
// EXTERNAL MODULE: ./src/utils/cityData.ts
|
||||
var cityData = __webpack_require__(66750);
|
||||
;// CONCATENATED MODULE: ./src/pages/Account/components/AppplySchoolModal/index.less?modules
|
||||
// extracted by mini-css-extract-plugin
|
||||
/* harmony default export */ var AppplySchoolModalmodules = ({"flexRow":"flexRow___qRWfN","flexColumn":"flexColumn___qUHfF","formWrap":"formWrap___kSgvX","example":"example___D0a_H","footerWrap":"footerWrap___kTeYf"});
|
||||
;// CONCATENATED MODULE: ./src/pages/Account/components/AppplySchoolModal/index.tsx
|
||||
var __defProp = Object.defineProperty;
|
||||
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 __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 filter = (inputValue, path) => {
|
||||
return path.some((option) => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1);
|
||||
};
|
||||
const TextArea = input["default"].TextArea;
|
||||
const AppplySchoolModal = (_a) => {
|
||||
var _b = _a, {
|
||||
account,
|
||||
globalSetting,
|
||||
loading,
|
||||
dispatch,
|
||||
schoolName,
|
||||
visible,
|
||||
onClose = () => {
|
||||
},
|
||||
onSuccess = () => {
|
||||
}
|
||||
} = _b, props = __objRest(_b, [
|
||||
"account",
|
||||
"globalSetting",
|
||||
"loading",
|
||||
"dispatch",
|
||||
"schoolName",
|
||||
"visible",
|
||||
"onClose",
|
||||
"onSuccess"
|
||||
]);
|
||||
const [form] = es_form["default"].useForm();
|
||||
(0,_react_17_0_2_react.useEffect)(() => {
|
||||
form.setFieldsValue({ name: schoolName });
|
||||
}, [schoolName]);
|
||||
const handleFinish = (values) => __async(void 0, null, function* () {
|
||||
const { name, city = [], address, remarks } = values || {};
|
||||
const res = yield dispatch({
|
||||
type: "account/appplySchool",
|
||||
payload: {
|
||||
name,
|
||||
province: city[0],
|
||||
city: city[1],
|
||||
address,
|
||||
remarks
|
||||
}
|
||||
});
|
||||
if ((res == null ? void 0 : res.status) == 2) {
|
||||
const modal = es_modal["default"].confirm({
|
||||
icon: null,
|
||||
width: 600,
|
||||
centered: true,
|
||||
okText: "\u786E\u5B9A",
|
||||
cancelText: "\u53D6\u6D88",
|
||||
title: "\u63D0\u793A",
|
||||
content: /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "\u7CFB\u7EDF\u68C0\u6D4B\u5230\u60A8\u7533\u8BF7\u65B0\u589E\u7684\u5355\u4F4D\u5DF2\u5B58\u5728\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u4E3A\u8BE5\u5355\u4F4D\uFF1F"), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
table["default"],
|
||||
{
|
||||
columns: [{ title: "\u5B66\u6821/\u5355\u4F4D", dataIndex: "name" }, { title: "\u7528\u6237\u6570", width: 150, dataIndex: "users_count" }],
|
||||
dataSource: [__spreadValues({}, res)],
|
||||
pagination: false
|
||||
}
|
||||
)),
|
||||
onOk: () => __async(void 0, null, function* () {
|
||||
yield onSuccess(name);
|
||||
modal.destroy();
|
||||
onClose();
|
||||
}),
|
||||
onCancel: () => {
|
||||
modal.destroy();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
onClose();
|
||||
if (res.status == 0) {
|
||||
message/* default */.ZP.success("\u65B0\u589E\u5B66\u6821/\u5355\u4F4D\u6210\u529F\uFF01");
|
||||
onSuccess(name);
|
||||
}
|
||||
});
|
||||
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_modal["default"],
|
||||
{
|
||||
centered: true,
|
||||
keyboard: false,
|
||||
closable: false,
|
||||
destroyOnClose: true,
|
||||
open: visible,
|
||||
title: "\u7533\u8BF7\u6DFB\u52A0\u5355\u4F4D\u540D\u79F0",
|
||||
width: "600px",
|
||||
footer: null
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_form["default"],
|
||||
{
|
||||
className: AppplySchoolModalmodules.formWrap,
|
||||
form,
|
||||
labelCol: { span: 4 },
|
||||
wrapperCol: { span: 20 },
|
||||
onFinish: handleFinish
|
||||
},
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u5355\u4F4D\u5168\u79F0\uFF1A", name: "name", rules: [{ required: true, message: "\u8BF7\u8F93\u5165\u5B66\u6821\u6216\u5DE5\u4F5C\u5355\u4F4D" }] }, /* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { placeholder: "\u5B66\u6821\u6216\u5DE5\u4F5C\u5355\u4F4D" })),
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${AppplySchoolModalmodules.flexRow} ${AppplySchoolModalmodules.example}` }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u793A\u4F8B\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AppplySchoolModalmodules.flexColumn }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(CheckCircleFilled/* default */.Z, { style: { color: "rgb(82, 196, 26)" } }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: `font14 ml5` }, "\u6B63\u786E\u793A\u4F8B\uFF1A\u6570\u636E\u7ED3\u6784")), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(CloseCircleFilled/* default */.Z, { style: { color: "red" } }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: `font14 ml5` }, "\u9519\u8BEF\u793A\u4F8B\uFF1A\u6570\u636E\u7ED3\u67842019\u6625")))),
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u5730\u533A\uFF1A", name: "city" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
cascader/* default */.Z,
|
||||
{
|
||||
allowClear: true,
|
||||
size: "middle",
|
||||
options: cityData/* CityData */.P,
|
||||
placeholder: "\u8BF7\u9009\u62E9\u6240\u5728\u5730",
|
||||
showSearch: { matchInputWidth: true, filter }
|
||||
}
|
||||
)),
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u8BE6\u7EC6\u5730\u5740\uFF1A", name: "address" }, /* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { placeholder: "\u8BF7\u586B\u5199\u5B8C\u6574\u7684\u5730\u5740\u4FE1\u606F" })),
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u8BF4\u660E\uFF1A", name: "remarks" }, /* @__PURE__ */ _react_17_0_2_react.createElement(TextArea, { placeholder: "\u518D\u6B21\u8BF4\u660E\u7279\u522B\u60C5\u51B5\uFF08\u9009\u586B\uFF09" })),
|
||||
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AppplySchoolModalmodules.footerWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
||||
es_button/* default */.ZP,
|
||||
{
|
||||
className: "mr5",
|
||||
size: "middle",
|
||||
onClick: () => {
|
||||
onClose();
|
||||
}
|
||||
},
|
||||
"\u53D6\u6D88"
|
||||
), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { size: "middle", type: "primary", htmlType: "submit", loading: loading["account/appplySchool"] }, "\u4FDD\u5B58")))
|
||||
)
|
||||
);
|
||||
};
|
||||
/* harmony default export */ var components_AppplySchoolModal = ((0,_umi_production_exports.connect)(
|
||||
({
|
||||
account,
|
||||
loading,
|
||||
globalSetting
|
||||
}) => ({
|
||||
account,
|
||||
globalSetting,
|
||||
loading: loading.effects
|
||||
})
|
||||
)(AppplySchoolModal));
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[9333],{
|
||||
|
||||
/***/ 39333:
|
||||
/*!*************************************************!*\
|
||||
!*** ./src/.umi-production/core/EmptyRoute.tsx ***!
|
||||
\*************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ "default": function() { return /* binding */ EmptyRoute; }
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
||||
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! umi */ 87210);
|
||||
|
||||
|
||||
function EmptyRoute() {
|
||||
const context = (0,umi__WEBPACK_IMPORTED_MODULE_1__.useOutletContext)();
|
||||
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(umi__WEBPACK_IMPORTED_MODULE_1__.Outlet, { context });
|
||||
}
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
@ -0,0 +1,539 @@
|
||||
/* Logo 字体 */
|
||||
@font-face {
|
||||
font-family: "iconfont logo";
|
||||
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
|
||||
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
|
||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
|
||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
|
||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
|
||||
}
|
||||
|
||||
.logo {
|
||||
font-family: "iconfont logo";
|
||||
font-size: 160px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
/* tabs */
|
||||
.nav-tabs {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.nav-tabs .nav-more {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 42px;
|
||||
line-height: 42px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
#tabs {
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
#tabs li {
|
||||
cursor: pointer;
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
border-bottom: 2px solid transparent;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
margin-bottom: -1px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
|
||||
#tabs .active {
|
||||
border-bottom-color: #f00;
|
||||
color: #222;
|
||||
}
|
||||
|
||||
.tab-container .content {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* 页面布局 */
|
||||
.main {
|
||||
padding: 30px 100px;
|
||||
width: 960px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.main .logo {
|
||||
color: #333;
|
||||
text-align: left;
|
||||
margin-bottom: 30px;
|
||||
line-height: 1;
|
||||
height: 110px;
|
||||
margin-top: -50px;
|
||||
overflow: hidden;
|
||||
*zoom: 1;
|
||||
}
|
||||
|
||||
.main .logo a {
|
||||
font-size: 160px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.helps {
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
.helps pre {
|
||||
padding: 20px;
|
||||
margin: 10px 0;
|
||||
border: solid 1px #e7e1cd;
|
||||
background-color: #fffdef;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.icon_lists {
|
||||
width: 100% !important;
|
||||
overflow: hidden;
|
||||
*zoom: 1;
|
||||
}
|
||||
|
||||
.icon_lists li {
|
||||
width: 100px;
|
||||
margin-bottom: 10px;
|
||||
margin-right: 20px;
|
||||
text-align: center;
|
||||
list-style: none !important;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.icon_lists li .code-name {
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.icon_lists .icon {
|
||||
display: block;
|
||||
height: 100px;
|
||||
line-height: 100px;
|
||||
font-size: 42px;
|
||||
margin: 10px auto;
|
||||
color: #333;
|
||||
-webkit-transition: font-size 0.25s linear, width 0.25s linear;
|
||||
-moz-transition: font-size 0.25s linear, width 0.25s linear;
|
||||
transition: font-size 0.25s linear, width 0.25s linear;
|
||||
}
|
||||
|
||||
.icon_lists .icon:hover {
|
||||
font-size: 100px;
|
||||
}
|
||||
|
||||
.icon_lists .svg-icon {
|
||||
/* 通过设置 font-size 来改变图标大小 */
|
||||
width: 1em;
|
||||
/* 图标和文字相邻时,垂直对齐 */
|
||||
vertical-align: -0.15em;
|
||||
/* 通过设置 color 来改变 SVG 的颜色/fill */
|
||||
fill: currentColor;
|
||||
/* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
|
||||
normalize.css 中也包含这行 */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.icon_lists li .name,
|
||||
.icon_lists li .code-name {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/* markdown 样式 */
|
||||
.markdown {
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.highlight {
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.markdown img {
|
||||
vertical-align: middle;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.markdown h1 {
|
||||
color: #404040;
|
||||
font-weight: 500;
|
||||
line-height: 40px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.markdown h2,
|
||||
.markdown h3,
|
||||
.markdown h4,
|
||||
.markdown h5,
|
||||
.markdown h6 {
|
||||
color: #404040;
|
||||
margin: 1.6em 0 0.6em 0;
|
||||
font-weight: 500;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.markdown h1 {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.markdown h2 {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.markdown h3 {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.markdown h4 {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.markdown h5 {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.markdown h6 {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.markdown hr {
|
||||
height: 1px;
|
||||
border: 0;
|
||||
background: #e9e9e9;
|
||||
margin: 16px 0;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.markdown p {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.markdown>p,
|
||||
.markdown>blockquote,
|
||||
.markdown>.highlight,
|
||||
.markdown>ol,
|
||||
.markdown>ul {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.markdown ul>li {
|
||||
list-style: circle;
|
||||
}
|
||||
|
||||
.markdown>ul li,
|
||||
.markdown blockquote ul>li {
|
||||
margin-left: 20px;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
.markdown>ul li p,
|
||||
.markdown>ol li p {
|
||||
margin: 0.6em 0;
|
||||
}
|
||||
|
||||
.markdown ol>li {
|
||||
list-style: decimal;
|
||||
}
|
||||
|
||||
.markdown>ol li,
|
||||
.markdown blockquote ol>li {
|
||||
margin-left: 20px;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
.markdown code {
|
||||
margin: 0 3px;
|
||||
padding: 0 5px;
|
||||
background: #eee;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.markdown strong,
|
||||
.markdown b {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.markdown>table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0px;
|
||||
empty-cells: show;
|
||||
border: 1px solid #e9e9e9;
|
||||
width: 95%;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.markdown>table th {
|
||||
white-space: nowrap;
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.markdown>table th,
|
||||
.markdown>table td {
|
||||
border: 1px solid #e9e9e9;
|
||||
padding: 8px 16px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.markdown>table th {
|
||||
background: #F7F7F7;
|
||||
}
|
||||
|
||||
.markdown blockquote {
|
||||
font-size: 90%;
|
||||
color: #999;
|
||||
border-left: 4px solid #e9e9e9;
|
||||
padding-left: 0.8em;
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.markdown blockquote p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.markdown .anchor {
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.markdown .waiting {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.markdown h1:hover .anchor,
|
||||
.markdown h2:hover .anchor,
|
||||
.markdown h3:hover .anchor,
|
||||
.markdown h4:hover .anchor,
|
||||
.markdown h5:hover .anchor,
|
||||
.markdown h6:hover .anchor {
|
||||
opacity: 1;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.markdown>br,
|
||||
.markdown>p>br {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
|
||||
.hljs {
|
||||
display: block;
|
||||
background: white;
|
||||
padding: 0.5em;
|
||||
color: #333333;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-meta {
|
||||
color: #969896;
|
||||
}
|
||||
|
||||
.hljs-string,
|
||||
.hljs-variable,
|
||||
.hljs-template-variable,
|
||||
.hljs-strong,
|
||||
.hljs-emphasis,
|
||||
.hljs-quote {
|
||||
color: #df5000;
|
||||
}
|
||||
|
||||
.hljs-keyword,
|
||||
.hljs-selector-tag,
|
||||
.hljs-type {
|
||||
color: #a71d5d;
|
||||
}
|
||||
|
||||
.hljs-literal,
|
||||
.hljs-symbol,
|
||||
.hljs-bullet,
|
||||
.hljs-attribute {
|
||||
color: #0086b3;
|
||||
}
|
||||
|
||||
.hljs-section,
|
||||
.hljs-name {
|
||||
color: #63a35c;
|
||||
}
|
||||
|
||||
.hljs-tag {
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.hljs-title,
|
||||
.hljs-attr,
|
||||
.hljs-selector-id,
|
||||
.hljs-selector-class,
|
||||
.hljs-selector-attr,
|
||||
.hljs-selector-pseudo {
|
||||
color: #795da3;
|
||||
}
|
||||
|
||||
.hljs-addition {
|
||||
color: #55a532;
|
||||
background-color: #eaffea;
|
||||
}
|
||||
|
||||
.hljs-deletion {
|
||||
color: #bd2c00;
|
||||
background-color: #ffecec;
|
||||
}
|
||||
|
||||
.hljs-link {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* 代码高亮 */
|
||||
/* PrismJS 1.15.0
|
||||
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
|
||||
/**
|
||||
* prism.js default theme for JavaScript, CSS and HTML
|
||||
* Based on dabblet (http://dabblet.com)
|
||||
* @author Lea Verou
|
||||
*/
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
color: black;
|
||||
background: none;
|
||||
text-shadow: 0 1px white;
|
||||
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
||||
text-align: left;
|
||||
white-space: pre;
|
||||
word-spacing: normal;
|
||||
word-break: normal;
|
||||
word-wrap: normal;
|
||||
line-height: 1.5;
|
||||
|
||||
-moz-tab-size: 4;
|
||||
-o-tab-size: 4;
|
||||
tab-size: 4;
|
||||
|
||||
-webkit-hyphens: none;
|
||||
-moz-hyphens: none;
|
||||
-ms-hyphens: none;
|
||||
hyphens: none;
|
||||
}
|
||||
|
||||
pre[class*="language-"]::-moz-selection,
|
||||
pre[class*="language-"] ::-moz-selection,
|
||||
code[class*="language-"]::-moz-selection,
|
||||
code[class*="language-"] ::-moz-selection {
|
||||
text-shadow: none;
|
||||
background: #b3d4fc;
|
||||
}
|
||||
|
||||
pre[class*="language-"]::selection,
|
||||
pre[class*="language-"] ::selection,
|
||||
code[class*="language-"]::selection,
|
||||
code[class*="language-"] ::selection {
|
||||
text-shadow: none;
|
||||
background: #b3d4fc;
|
||||
}
|
||||
|
||||
@media print {
|
||||
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
text-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Code blocks */
|
||||
pre[class*="language-"] {
|
||||
padding: 1em;
|
||||
margin: .5em 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
:not(pre)>code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
background: #f5f2f0;
|
||||
}
|
||||
|
||||
/* Inline code */
|
||||
:not(pre)>code[class*="language-"] {
|
||||
padding: .1em;
|
||||
border-radius: .3em;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.token.comment,
|
||||
.token.prolog,
|
||||
.token.doctype,
|
||||
.token.cdata {
|
||||
color: slategray;
|
||||
}
|
||||
|
||||
.token.punctuation {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.namespace {
|
||||
opacity: .7;
|
||||
}
|
||||
|
||||
.token.property,
|
||||
.token.tag,
|
||||
.token.boolean,
|
||||
.token.number,
|
||||
.token.constant,
|
||||
.token.symbol,
|
||||
.token.deleted {
|
||||
color: #905;
|
||||
}
|
||||
|
||||
.token.selector,
|
||||
.token.attr-name,
|
||||
.token.string,
|
||||
.token.char,
|
||||
.token.builtin,
|
||||
.token.inserted {
|
||||
color: #690;
|
||||
}
|
||||
|
||||
.token.operator,
|
||||
.token.entity,
|
||||
.token.url,
|
||||
.language-css .token.string,
|
||||
.style .token.string {
|
||||
color: #9a6e3a;
|
||||
background: hsla(0, 0%, 100%, .5);
|
||||
}
|
||||
|
||||
.token.atrule,
|
||||
.token.attr-value,
|
||||
.token.keyword {
|
||||
color: #07a;
|
||||
}
|
||||
|
||||
.token.function,
|
||||
.token.class-name {
|
||||
color: #DD4A68;
|
||||
}
|
||||
|
||||
.token.regex,
|
||||
.token.important,
|
||||
.token.variable {
|
||||
color: #e90;
|
||||
}
|
||||
|
||||
.token.important,
|
||||
.token.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.token.italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.token.entity {
|
||||
cursor: help;
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 4268538 */
|
||||
src: url('iconfont.woff2?t=1695807712922') format('woff2'),
|
||||
url('iconfont.woff?t=1695807712922') format('woff'),
|
||||
url('iconfont.ttf?t=1695807712922') format('truetype');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-family: "iconfont" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-weishezhi:before {
|
||||
content: "\eb7d";
|
||||
}
|
||||
|
||||
.icon-yiwancheng6:before {
|
||||
content: "\ebeb";
|
||||
}
|
||||
|
||||
.icon-xianchangqueren:before {
|
||||
content: "\ebe1";
|
||||
}
|
||||
|
||||
.icon-a-302:before {
|
||||
content: "\ebe5";
|
||||
}
|
||||
|
||||
.icon-shiyongaed:before {
|
||||
content: "\ebe7";
|
||||
}
|
||||
|
||||
.icon-panduanhujiu:before {
|
||||
content: "\ebe6";
|
||||
}
|
||||
|
||||
.icon-shangbianxiantiao:before {
|
||||
content: "\ebe9";
|
||||
}
|
||||
|
||||
.icon-xiebianjiantou:before {
|
||||
content: "\ebe8";
|
||||
}
|
||||
|
||||
@ -0,0 +1,65 @@
|
||||
{
|
||||
"id": "4268538",
|
||||
"name": "新的",
|
||||
"font_family": "iconfont",
|
||||
"css_prefix_text": "icon-",
|
||||
"description": "",
|
||||
"glyphs": [
|
||||
{
|
||||
"icon_id": "36340001",
|
||||
"name": "未设置",
|
||||
"font_class": "weishezhi",
|
||||
"unicode": "eb7d",
|
||||
"unicode_decimal": 60285
|
||||
},
|
||||
{
|
||||
"icon_id": "37534363",
|
||||
"name": "已完成",
|
||||
"font_class": "yiwancheng6",
|
||||
"unicode": "ebeb",
|
||||
"unicode_decimal": 60395
|
||||
},
|
||||
{
|
||||
"icon_id": "37515253",
|
||||
"name": "现场确认",
|
||||
"font_class": "xianchangqueren",
|
||||
"unicode": "ebe1",
|
||||
"unicode_decimal": 60385
|
||||
},
|
||||
{
|
||||
"icon_id": "37516649",
|
||||
"name": "30:2",
|
||||
"font_class": "a-302",
|
||||
"unicode": "ebe5",
|
||||
"unicode_decimal": 60389
|
||||
},
|
||||
{
|
||||
"icon_id": "37516792",
|
||||
"name": "使用aed",
|
||||
"font_class": "shiyongaed",
|
||||
"unicode": "ebe7",
|
||||
"unicode_decimal": 60391
|
||||
},
|
||||
{
|
||||
"icon_id": "37516797",
|
||||
"name": "判断呼救",
|
||||
"font_class": "panduanhujiu",
|
||||
"unicode": "ebe6",
|
||||
"unicode_decimal": 60390
|
||||
},
|
||||
{
|
||||
"icon_id": "37516808",
|
||||
"name": "上边线条",
|
||||
"font_class": "shangbianxiantiao",
|
||||
"unicode": "ebe9",
|
||||
"unicode_decimal": 60393
|
||||
},
|
||||
{
|
||||
"icon_id": "37516809",
|
||||
"name": "斜边箭头",
|
||||
"font_class": "xiebianjiantou",
|
||||
"unicode": "ebe8",
|
||||
"unicode_decimal": 60392
|
||||
}
|
||||
]
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
@ -0,0 +1,251 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>心脏救助过程</title>
|
||||
<link rel="stylesheet" href="./iconfont/iconfont.css">
|
||||
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
|
||||
|
||||
<style>
|
||||
html,body{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.process_wrap {
|
||||
max-width: 393px;
|
||||
max-height: 410px;
|
||||
overflow: auto hidden;
|
||||
scrollbar-width: none; /* Firefox */
|
||||
-ms-overflow-style: none; /* IE 10+ */
|
||||
}
|
||||
|
||||
.process_wrap::-webkit-scrollbar {
|
||||
display:none !important;
|
||||
width:0;
|
||||
height:0 !important;
|
||||
color:transparent;
|
||||
}
|
||||
|
||||
.process_title {
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
margin-top: 20px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.step {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 20px 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.step p {
|
||||
color: #999;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.step .mask {
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 50%;
|
||||
background-color: rgba(0, 0, 0, 0.4)
|
||||
}
|
||||
|
||||
.hovericon {
|
||||
border-radius: 50%;
|
||||
box-shadow: 0px 10px 10px 0px rgb(209, 232, 243);
|
||||
}
|
||||
|
||||
.icon {
|
||||
display: inline-block;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
.wancheng {
|
||||
position: absolute;
|
||||
width: 32px;
|
||||
z-index: 999;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-top: -50px;
|
||||
margin-left: -16px;
|
||||
}
|
||||
|
||||
#line1,
|
||||
#line2 {
|
||||
width: 112px;
|
||||
margin: 10px;
|
||||
margin-top: -60px;
|
||||
color: rgb(235, 238, 240);
|
||||
}
|
||||
|
||||
.hoverline-ver {
|
||||
color: rgb(176, 184, 200);
|
||||
}
|
||||
|
||||
#line_slant {
|
||||
width: 112px;
|
||||
/* margin:0 auto; */
|
||||
margin-left:140px;
|
||||
color: rgb(235, 238, 240);
|
||||
transform: translate(-8px, -80px);
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.colorBlue {
|
||||
color: #3061D0 !important;
|
||||
}
|
||||
|
||||
.disabled {
|
||||
cursor:not-allowed !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="process_wrap">
|
||||
<div class="process_title">救助过程</div>
|
||||
<div>
|
||||
<div class="step">
|
||||
<div id="xianchangqueren" style="position:relative;" key="1">
|
||||
<img src="./images/finish.png" class="wancheng hidden">
|
||||
<span class="mask"></span>
|
||||
<img src="./images/xianchangqueren.png" width='80' class="icon">
|
||||
<p>第一步<br />现场安全</p>
|
||||
</div>
|
||||
<div id="line1">
|
||||
<i class="iconfont icon-shangbianxiantiao line-ver"></i>
|
||||
</div>
|
||||
<div id="panduanhujiu" style="position:relative;" key="2">
|
||||
<img src="./images/finish.png" class="wancheng hidden">
|
||||
<span class="mask"></span>
|
||||
<img src="./images/panduanhujiu.png" width='80' class="icon">
|
||||
<p>第二步<br />判断呼救</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="line_slant">
|
||||
<i class="iconfont icon-xiebianjiantou line-ver" style="font-size:88px"></i>
|
||||
</div>
|
||||
<div class="step" style="transform: translateY(-93px);">
|
||||
<div id="xinzangfusu" style="position:relative;" key="3">
|
||||
<img src="./images/finish.png" class="wancheng hidden">
|
||||
<span class="mask"></span>
|
||||
<img src="./images/xinzangfusu.png" width="80" class="icon">
|
||||
<p>第三步<br />心脏复苏</p>
|
||||
</div>
|
||||
<div id="line2">
|
||||
<i class="iconfont icon-shangbianxiantiao line-ver"></i>
|
||||
</div>
|
||||
<div id="shiyongaed" style="position:relative;" key="4">
|
||||
<img src="./images/finish.png" class="wancheng hidden">
|
||||
<span class="mask"></span>
|
||||
<img src="./images/shiyongaed.png" width="80" class="icon">
|
||||
<p>第四步<br />使用AED</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
let elems = document.querySelectorAll('div[key]');
|
||||
|
||||
const getIdentifier = () => {
|
||||
// const url = window.location.href;
|
||||
// let identifier = url.substr(url.lastIndexOf('/') + 1);
|
||||
// if (identifier.indexOf('?') !== -1) {
|
||||
// identifier = identifier.substr(0, identifier.indexOf('?'))
|
||||
// }
|
||||
return window.top.location.pathname.split("/").pop();
|
||||
}
|
||||
|
||||
const handleElements = () => {
|
||||
for (let i = 0; i < elems?.length; i++) {
|
||||
const el = elems[i];
|
||||
const key = el.getAttribute("key")
|
||||
data?.map(item => {
|
||||
if (key == item?.position) {
|
||||
|
||||
if(data?.[item?.position - 2]?.status == 2 || item?.status == 2 || item?.position == 1){
|
||||
if(data?.[item?.position - 2]?.status == 2 && item?.status != 2){ //防止绑定两次相同的点击事件
|
||||
el.addEventListener("click", function () {
|
||||
window.top.location.href = `https://educoder.net/tasks/${item?.identifier}`
|
||||
})
|
||||
}
|
||||
el.style.cursor="pointer";
|
||||
el.addEventListener("mouseover",function(){
|
||||
el.getElementsByClassName("mask")[0].classList.add("hidden")
|
||||
el.getElementsByTagName('p')[0].classList.add("colorBlue")
|
||||
el.getElementsByClassName("icon")[0].classList.add("hovericon")
|
||||
})
|
||||
el.addEventListener("mouseout",function(){
|
||||
if(getIdentifier() != item?.identifier){
|
||||
el.getElementsByClassName("mask")[0].classList.remove("hidden")
|
||||
el.getElementsByTagName('p')[0].classList.remove("colorBlue")
|
||||
}
|
||||
el.getElementsByClassName("icon")[0].classList.remove("hovericon")
|
||||
})
|
||||
}
|
||||
else {
|
||||
el.getElementsByTagName('span')[0].classList.add("disabled")
|
||||
el.getElementsByTagName('span')[0].setAttribute("title","需通过前置步骤才能进入")
|
||||
el.getElementsByTagName('p')[0].classList.add("disabled")
|
||||
el.getElementsByTagName('p')[0].setAttribute("title","需通过前置步骤才能进入")
|
||||
}
|
||||
|
||||
if(getIdentifier() == item?.identifier && data?.[item?.position - 2]?.status == 2){
|
||||
if(item?.position == 2){
|
||||
document.getElementById("line1")?.getElementsByClassName("line-ver")[0].classList.add("hoverline-ver")
|
||||
}
|
||||
if(item?.position == 3){
|
||||
document.getElementById("line_slant")?.getElementsByClassName("line-ver")[0].classList.add("hoverline-ver")
|
||||
}
|
||||
if(item?.position == 4){
|
||||
document.getElementById("line2")?.getElementsByClassName("line-ver")[0].classList.add("hoverline-ver")
|
||||
}
|
||||
}
|
||||
if (item?.finished_time) {
|
||||
el.addEventListener("click", function () {
|
||||
window.top.location.href = `https://educoder.net/tasks/${item?.identifier}`
|
||||
})
|
||||
el.style.cursor="pointer";
|
||||
const wanchengIcon = el.getElementsByClassName("wancheng")[0]
|
||||
wanchengIcon.classList.remove("hidden")
|
||||
}
|
||||
if (getIdentifier() == item?.identifier) {
|
||||
const mask = el.getElementsByClassName("mask")[0]
|
||||
mask.classList.add("hidden")
|
||||
const desc = el.getElementsByTagName('p')[0]
|
||||
desc.classList.add("colorBlue")
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
const getData=()=>{
|
||||
const id = JSON.parse(sessionStorage.tasksData).myshixun.identifier
|
||||
axios.get("https://data.educoder.net/api/myshixuns/"+ id +"/challenges.json", {
|
||||
withCredentials: true
|
||||
}).then(function (res) {
|
||||
data = res?.data || []
|
||||
handleElements()
|
||||
})
|
||||
}
|
||||
|
||||
let data = [];
|
||||
getData();
|
||||
// window.addEventListener('message', getData, false);
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -0,0 +1,26 @@
|
||||
<script>
|
||||
function setCookie(cname, cvalue, exdays) {
|
||||
// exdays = exdays || 30;
|
||||
var d = new Date();
|
||||
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);
|
||||
var expires = 'expires=' + d.toUTCString();
|
||||
document.cookie =
|
||||
cname +
|
||||
'=' +
|
||||
cvalue +
|
||||
'; ' +
|
||||
expires +
|
||||
';domain='+( document.domain.replace("www.",""))+';path=/;SameSite=None;secure';
|
||||
}
|
||||
|
||||
window.addEventListener("message",
|
||||
function (e) {
|
||||
if (e.data.type === "cookie") {
|
||||
var cookies = e.data.data.split(";")
|
||||
cookies.map(function (item) {
|
||||
var i = item.split("=");
|
||||
setCookie(i[0],i[1],30)
|
||||
})
|
||||
}
|
||||
}, false);
|
||||
</script>
|
||||
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 92 KiB |
|
After Width: | Height: | Size: 94 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 5.3 KiB |