|
|
"use strict";
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[26615],{
|
|
|
|
|
|
/***/ 55668:
|
|
|
/*!**************************************************************************!*\
|
|
|
!*** ./src/components/EcListItems/Problemset/Card/index.tsx + 1 modules ***!
|
|
|
\**************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ Problemset_Card; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(79800);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/_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/radio/index.js + 5 modules
|
|
|
var es_radio = __webpack_require__(5112);
|
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx
|
|
|
var RenderHtml = __webpack_require__(96030);
|
|
|
;// CONCATENATED MODULE: ./src/components/EcListItems/Problemset/Card/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var Cardmodules = ({"flexRow":"flexRow____Sm4b","flexColumn":"flexColumn___mQNZs","action":"action___QUVEn","setScore":"setScore___yZ0Yb","delete":"delete___e4taL","content":"content___jR4Y6","titleWrap":"titleWrap___zsXYY","titleNumber":"titleNumber___p60vi","score":"score___DbCHw","titleHtml":"titleHtml___FALbj","answerWrap":"answerWrap___uPjYq","answer":"answer___pfiPk","answerText":"answerText___K3TNr"});
|
|
|
// EXTERNAL MODULE: ./node_modules/_js-base64@2.6.4@js-base64/base64.js
|
|
|
var base64 = __webpack_require__(24334);
|
|
|
// EXTERNAL MODULE: ./src/components/MathsLatexKeybords/index.tsx
|
|
|
var MathsLatexKeybords = __webpack_require__(65591);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/components/EcListItems/Problemset/Card/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// import Item from '@/pages/Forums/Index/components/Item';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var tagDotList = ['A.', 'B.', 'C.', 'D.', 'E.', 'F.', 'G.', 'H.', 'I.', 'J.', 'K.', 'L.', 'M.', 'N.', 'O.', 'P.', 'Q.', 'R.', 'S.', 'T.', 'U.', 'V.', 'W.', 'X.', 'Y.', 'Z.'];
|
|
|
var Card = function Card(_ref) {
|
|
|
var _data$program_attr3;
|
|
|
var index = _ref.index,
|
|
|
typeName = _ref.typeName,
|
|
|
type = _ref.type,
|
|
|
_ref$data = _ref.data,
|
|
|
data = _ref$data === void 0 ? {} : _ref$data,
|
|
|
inMouseId = _ref.inMouseId,
|
|
|
isshow = _ref.isshow,
|
|
|
_ref$onSetScore = _ref.onSetScore,
|
|
|
onSetScore = _ref$onSetScore === void 0 ? function () {} : _ref$onSetScore,
|
|
|
_ref$onDelete = _ref.onDelete,
|
|
|
onDelete = _ref$onDelete === void 0 ? function () {} : _ref$onDelete,
|
|
|
_ref$onMouseEnter = _ref.onMouseEnter,
|
|
|
_onMouseEnter = _ref$onMouseEnter === void 0 ? function () {} : _ref$onMouseEnter,
|
|
|
_ref$showAnswer = _ref.showAnswer,
|
|
|
showAnswer = _ref$showAnswer === void 0 ? false : _ref$showAnswer;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
isopen = _useState2[0],
|
|
|
setisopen = _useState2[1];
|
|
|
var renderSingleOrMultiple = function renderSingleOrMultiple() {
|
|
|
var _data$choices;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Cardmodules.answerWrap,
|
|
|
children: [data === null || data === void 0 || (_data$choices = data.choices) === null || _data$choices === void 0 ? void 0 : _data$choices.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "".concat(Cardmodules.flexRow, " mt15"),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
lineHeight: '24px',
|
|
|
flexShrink: 0
|
|
|
},
|
|
|
children: tagDotList[index]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(Cardmodules.answer, " ml5"),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: item === null || item === void 0 ? void 0 : item.choice_text
|
|
|
})
|
|
|
})]
|
|
|
}, index);
|
|
|
}), showAnswer && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "mt10 ".concat(Cardmodules.answerText),
|
|
|
children: ["\u53C2\u8003\u7B54\u6848\uFF1A", data === null || data === void 0 ? void 0 : data.standard_answer_show]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
var renderJudgment = function renderJudgment() {
|
|
|
var _data$choices2;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Cardmodules.answerWrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(Cardmodules.flexRow, " mt15"),
|
|
|
children: data === null || data === void 0 || (_data$choices2 = data.choices) === null || _data$choices2 === void 0 ? void 0 : _data$choices2.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
disabled: true,
|
|
|
children: item === null || item === void 0 ? void 0 : item.choice_text
|
|
|
}, index);
|
|
|
})
|
|
|
}), showAnswer && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "mt10 ".concat(Cardmodules.answerText),
|
|
|
children: ["\u53C2\u8003\u7B54\u6848\uFF1A", data === null || data === void 0 ? void 0 : data.standard_answer_show]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
var renderProgram = function renderProgram() {
|
|
|
var _data$program_attr;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Cardmodules.answerWrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(Cardmodules.flexRow, " mt15"),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: data === null || data === void 0 || (_data$program_attr = data.program_attr) === null || _data$program_attr === void 0 ? void 0 : _data$program_attr.description
|
|
|
})
|
|
|
}), showAnswer && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "mt15",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u53C2\u8003\u7B54\u6848\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: (data === null || data === void 0 ? void 0 : data.answer_text) || ''
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
var renderCompletion = function renderCompletion() {
|
|
|
var _data$standard_answer;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Cardmodules.answerWrap,
|
|
|
children: showAnswer && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(Cardmodules.flexColumn, " mt15"),
|
|
|
children: data === null || data === void 0 || (_data$standard_answer = data.standard_answer) === null || _data$standard_answer === void 0 ? void 0 : _data$standard_answer.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: (item === null || item === void 0 ? void 0 : item.model) === 1 ? /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: "\u53C2\u8003\u7B54\u6848\uFF08\u586B\u7A7A".concat(item.position, "\uFF09\uFF1A").concat(item.answer_text.join("、")),
|
|
|
className: Cardmodules.answerText
|
|
|
}, index) : /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
style: {
|
|
|
display: 'inline-flex',
|
|
|
alignItems: 'center',
|
|
|
marginBottom: 5
|
|
|
},
|
|
|
children: ["\u53C2\u8003\u7B54\u6848\uFF08\u586B\u7A7A ", item.position, "\uFF09\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)(MathsLatexKeybords/* default */.Z, {
|
|
|
disabled: true,
|
|
|
width: "180px",
|
|
|
value: item.answer_text.join("、")
|
|
|
})]
|
|
|
})
|
|
|
});
|
|
|
})
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
var renderSubjective = function renderSubjective() {
|
|
|
var _data$answer_texts;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Cardmodules.answerWrap,
|
|
|
children: showAnswer && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "mt15",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u53C2\u8003\u7B54\u6848\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: data === null || data === void 0 || (_data$answer_texts = data.answer_texts) === null || _data$answer_texts === void 0 ? void 0 : _data$answer_texts[0]
|
|
|
})]
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
var renderBProgram = function renderBProgram() {
|
|
|
var _data$program_attr2, _data$standard_answer2;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Cardmodules.answerWrap,
|
|
|
style: {
|
|
|
marginTop: 10
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
showProgramFill: true,
|
|
|
disabledFill: true,
|
|
|
value: base64.Base64.decode(data === null || data === void 0 || (_data$program_attr2 = data.program_attr) === null || _data$program_attr2 === void 0 ? void 0 : _data$program_attr2.code)
|
|
|
}), showAnswer && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(Cardmodules.flexColumn, " mt15"),
|
|
|
children: data === null || data === void 0 || (_data$standard_answer2 = data.standard_answer) === null || _data$standard_answer2 === void 0 ? void 0 : _data$standard_answer2.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: "\u53C2\u8003\u7B54\u6848\uFF08\u586B\u7A7A".concat(item.position, "\uFF09\uFF1A").concat(item.answer_text)
|
|
|
}, index);
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
var renderShixun = function renderShixun() {
|
|
|
var _data$shixun;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Cardmodules.answerWrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "mt10",
|
|
|
children: "\u5173\u5361"
|
|
|
}), data === null || data === void 0 || (_data$shixun = data.shixun) === null || _data$shixun === void 0 ? void 0 : _data$shixun.map(function (item, index) {
|
|
|
var _item$challenge_answe, _item$challenge_answe2;
|
|
|
// <div className="mt10 font14" key={index}>{index + 1}. {item?.challenge_name}</div>
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "mt10 font14",
|
|
|
children: ["\u7B2C", index + 1, "\u5173 ", item === null || item === void 0 ? void 0 : item.challenge_name, " \uFF08", item.challenge_score, "\uFF09"]
|
|
|
}, index), showAnswer && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Cardmodules.answerText,
|
|
|
children: ["\u53C2\u8003\u7B54\u6848\uFF1A", ((_item$challenge_answe = item.challenge_answers) === null || _item$challenge_answe === void 0 ? void 0 : _item$challenge_answe.length) === 0 ? '暂无' : '']
|
|
|
}), (_item$challenge_answe2 = item.challenge_answers) === null || _item$challenge_answe2 === void 0 ? void 0 : _item$challenge_answe2.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "mt15",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["\u7EA7\u522B", index + 1, "\uFF1A", item.name]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: (item === null || item === void 0 ? void 0 : item.contents) || '',
|
|
|
className: Cardmodules.answerText
|
|
|
})]
|
|
|
});
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
var renderCombination = function renderCombination() {
|
|
|
var _data$sub_questions;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Cardmodules.answerWrap,
|
|
|
style: {
|
|
|
display: isopen && 'none'
|
|
|
},
|
|
|
children: data === null || data === void 0 || (_data$sub_questions = data.sub_questions) === null || _data$sub_questions === void 0 ? void 0 : _data$sub_questions.map(function (e, i) {
|
|
|
var _e$choices;
|
|
|
var str = "<span style=\"margin-right: 10px\">".concat(index + 1, ".").concat(i + 1, "</span><span>\uFF08\u5355\u9009\u9898\uFF09</span><span class=\"c-grey-999\">\uFF08").concat(e.score, "\u5206\uFF09</span>");
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(_react_17_0_2_react.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Cardmodules.titleWrap,
|
|
|
style: {
|
|
|
marginTop: 16
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
className: Cardmodules.titleHtml,
|
|
|
value: str + e.name
|
|
|
})
|
|
|
}), e === null || e === void 0 || (_e$choices = e.choices) === null || _e$choices === void 0 ? void 0 : _e$choices.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "".concat(Cardmodules.flexRow, " mt15"),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
lineHeight: '24px',
|
|
|
flexShrink: 0
|
|
|
},
|
|
|
children: tagDotList[index]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(Cardmodules.answer, " ml5"),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: item === null || item === void 0 ? void 0 : item.choice_text
|
|
|
})
|
|
|
})]
|
|
|
}, index);
|
|
|
}), showAnswer && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "mt10 ".concat(Cardmodules.answerText),
|
|
|
children: ["\u53C2\u8003\u7B54\u6848\uFF1A", e === null || e === void 0 ? void 0 : e.standard_answer_show]
|
|
|
})]
|
|
|
}, e === null || e === void 0 ? void 0 : e.id);
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
var renderAnswer = function renderAnswer() {
|
|
|
var mapping = {
|
|
|
'SINGLE': renderSingleOrMultiple,
|
|
|
'MULTIPLE': renderSingleOrMultiple,
|
|
|
'JUDGMENT': renderJudgment,
|
|
|
'PROGRAM': renderProgram,
|
|
|
'COMPLETION': renderCompletion,
|
|
|
'SUBJECTIVE': renderSubjective,
|
|
|
'PRACTICAL': renderShixun,
|
|
|
'COMBINATION': renderCombination,
|
|
|
'BPROGRAM': renderBProgram
|
|
|
};
|
|
|
return mapping[type] ? mapping[type]() : null;
|
|
|
};
|
|
|
var getDomString = function getDomString(data, i) {
|
|
|
var _data$sub_questions2;
|
|
|
var str = "<span style=\"margin-right: -10px\">".concat(i + 1, "\u3001</span><span class=\"c-grey-999\">\uFF08").concat((data === null || data === void 0 ? void 0 : data.item_type) === "combination" ? "\u5171".concat(data === null || data === void 0 || (_data$sub_questions2 = data.sub_questions) === null || _data$sub_questions2 === void 0 ? void 0 : _data$sub_questions2.length, "\u5C0F\u9898\uFF0C") : '').concat(data.score, "\u5206\uFF09</span> ");
|
|
|
return str;
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
onMouseEnter: function onMouseEnter() {
|
|
|
return _onMouseEnter(data.id);
|
|
|
},
|
|
|
children: [inMouseId === data.id && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Cardmodules.action,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Cardmodules.setScore,
|
|
|
onClick: function onClick() {
|
|
|
return onSetScore(data.id, typeName, data === null || data === void 0 ? void 0 : data.shixun, data.score, data);
|
|
|
},
|
|
|
children: "\u8BBE\u7F6E\u5F97\u5206"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Cardmodules["delete"],
|
|
|
onClick: function onClick() {
|
|
|
return onDelete(data.id);
|
|
|
},
|
|
|
children: "\u5220\u9664"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Cardmodules.content,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Cardmodules.titleWrap,
|
|
|
style: {
|
|
|
justifyContent: 'space-between'
|
|
|
},
|
|
|
children: [(data === null || data === void 0 ? void 0 : data.item_type) === "bprogram" ? /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
className: Cardmodules.titleHtml,
|
|
|
value: getDomString(data, index) + (data === null || data === void 0 || (_data$program_attr3 = data.program_attr) === null || _data$program_attr3 === void 0 ? void 0 : _data$program_attr3.description)
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
className: Cardmodules.titleHtml,
|
|
|
value: getDomString(data, index) + ((data === null || data === void 0 ? void 0 : data.item_type) === "combination" ? "\uFF08\u9898\u5E72\uFF09" : '') + (data.name || (data === null || data === void 0 ? void 0 : data.shixun_name))
|
|
|
}), (data === null || data === void 0 ? void 0 : data.item_type) === "combination" && !isshow && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
onClick: function onClick(e) {
|
|
|
setisopen(!isopen);
|
|
|
},
|
|
|
style: {
|
|
|
textAlign: 'end',
|
|
|
flexShrink: 0
|
|
|
},
|
|
|
children: isopen ? '展开' : '收起'
|
|
|
})]
|
|
|
}), renderAnswer()]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var Problemset_Card = (Card);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 90588:
|
|
|
/*!**********************************************************!*\
|
|
|
!*** ./src/components/FixedButton/index.tsx + 1 modules ***!
|
|
|
\**********************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
t: function() { return /* binding */ FixedButton; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(82242);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
// EXTERNAL MODULE: ./node_modules/_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/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
;// CONCATENATED MODULE: ./src/components/FixedButton/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var FixedButtonmodules = ({"buttonFixed":"buttonFixed___vyq30","button":"button___hxmYv","buttonWrap":"buttonWrap___uK8dl"});
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/components/FixedButton/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var FixedButton = function FixedButton(_ref) {
|
|
|
var _ref$cancelText = _ref.cancelText,
|
|
|
cancelText = _ref$cancelText === void 0 ? '取消' : _ref$cancelText,
|
|
|
_ref$okText = _ref.okText,
|
|
|
okText = _ref$okText === void 0 ? '确定' : _ref$okText,
|
|
|
_ref$loading = _ref.loading,
|
|
|
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
|
_ref$hasOkBtn = _ref.hasOkBtn,
|
|
|
hasOkBtn = _ref$hasOkBtn === void 0 ? true : _ref$hasOkBtn,
|
|
|
_ref$hasCancelBtn = _ref.hasCancelBtn,
|
|
|
hasCancelBtn = _ref$hasCancelBtn === void 0 ? true : _ref$hasCancelBtn,
|
|
|
_ref$okButtonProps = _ref.okButtonProps,
|
|
|
okButtonProps = _ref$okButtonProps === void 0 ? {} : _ref$okButtonProps,
|
|
|
_ref$onCancel = _ref.onCancel,
|
|
|
onCancel = _ref$onCancel === void 0 ? function () {} : _ref$onCancel,
|
|
|
_ref$onOk = _ref.onOk,
|
|
|
onOk = _ref$onOk === void 0 ? function () {} : _ref$onOk,
|
|
|
_ref$className = _ref.className,
|
|
|
className = _ref$className === void 0 ? '' : _ref$className;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: _classnames_2_5_1_classnames_default()(FixedButtonmodules.buttonFixed, className),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: FixedButtonmodules.buttonWrap,
|
|
|
children: [hasCancelBtn && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
size: "middle",
|
|
|
className: "".concat(FixedButtonmodules.button, " mr20")
|
|
|
// 点击取消的返回
|
|
|
,
|
|
|
onClick: onCancel,
|
|
|
children: cancelText
|
|
|
}), hasOkBtn && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, objectSpread2_default()(objectSpread2_default()({
|
|
|
size: 'middle',
|
|
|
type: "primary",
|
|
|
className: "".concat(FixedButtonmodules.button, " mr20"),
|
|
|
loading: loading,
|
|
|
onClick: onOk
|
|
|
}, okButtonProps), {}, {
|
|
|
children: okText
|
|
|
}))]
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 65591:
|
|
|
/*!*****************************************************!*\
|
|
|
!*** ./src/components/MathsLatexKeybords/index.tsx ***!
|
|
|
\*****************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test2_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js */ 79800);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test2_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test2_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ 59301);
|
|
|
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index.less?modules */ 36625);
|
|
|
/* harmony import */ var mathlatex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! mathlatex */ 48136);
|
|
|
/* harmony import */ var _keybords__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./keybords */ 81107);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! antd */ 43418);
|
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var MathsLatex = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function (_ref, ref) {
|
|
|
var callback = _ref.callback,
|
|
|
width = _ref.width,
|
|
|
onChange = _ref.onChange,
|
|
|
disabled = _ref.disabled,
|
|
|
readOnly = _ref.readOnly,
|
|
|
_ref$type = _ref.type,
|
|
|
type = _ref$type === void 0 ? "" : _ref$type,
|
|
|
_ref$value = _ref.value,
|
|
|
value = _ref$value === void 0 ? "" : _ref$value,
|
|
|
_ref$style = _ref.style,
|
|
|
style = _ref$style === void 0 ? {} : _ref$style;
|
|
|
var GraphicsRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)();
|
|
|
var KeybordsRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)();
|
|
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0),
|
|
|
_useState2 = _root_workspace_ppte5yg23_local_v9_test2_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0___default()(_useState, 2),
|
|
|
styleLeft = _useState2[0],
|
|
|
setStyleLeft = _useState2[1];
|
|
|
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0),
|
|
|
_useState4 = _root_workspace_ppte5yg23_local_v9_test2_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0___default()(_useState3, 2),
|
|
|
styleTop = _useState4[0],
|
|
|
setStyleTop = _useState4[1];
|
|
|
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
|
|
|
_useState6 = _root_workspace_ppte5yg23_local_v9_test2_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0___default()(_useState5, 2),
|
|
|
showLatex = _useState6[0],
|
|
|
setShowLatex = _useState6[1];
|
|
|
var getData = function getData() {
|
|
|
var dom = document.createElement("div");
|
|
|
dom.innerHTML = GraphicsRef.current.getValue();
|
|
|
var str = dom.innerText;
|
|
|
callback && callback(str);
|
|
|
return str;
|
|
|
};
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_1__.useImperativeHandle)(ref, function () {
|
|
|
return {
|
|
|
getData: getData
|
|
|
};
|
|
|
});
|
|
|
var onTitleMouseDown = function onTitleMouseDown(e) {
|
|
|
e.preventDefault();
|
|
|
var startPosX = e.clientX - styleLeft;
|
|
|
var startPosY = e.clientY - styleTop;
|
|
|
|
|
|
// 鼠标移动时,移动弹窗
|
|
|
document.body.onmousemove = function (e) {
|
|
|
// 获取鼠标移动的距离
|
|
|
var left = e.clientX - startPosX;
|
|
|
var top = e.clientY - startPosY;
|
|
|
|
|
|
// 获取弹窗dom元素,并计算弹窗的宽高
|
|
|
var modal = document.getElementsByClassName('ant-modal')[0];
|
|
|
var maxWidth = window.innerWidth - modal.offsetWidth;
|
|
|
var maxHeight = window.innerHeight - modal.offsetHeight;
|
|
|
|
|
|
// 判断移动的距离是否在弹窗内,如果不在弹窗内,则移动到弹窗内
|
|
|
left = Math.max(0, Math.min(left, maxWidth));
|
|
|
top = Math.max(0, Math.min(top, maxHeight));
|
|
|
|
|
|
// 移动弹窗
|
|
|
if (inWindow(e.clientX, e.clientY, startPosX, startPosY)) {
|
|
|
setStyleLeft(left);
|
|
|
setStyleTop(top);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
// 鼠标放开时去掉移动事件
|
|
|
document.body.onmouseup = function () {
|
|
|
document.body.onmousemove = null;
|
|
|
};
|
|
|
};
|
|
|
|
|
|
// 判断鼠标是否在拖拽范围内
|
|
|
var inWindow = function inWindow(left, top, startPosX, startPosY) {
|
|
|
var H = document.body.clientHeight;
|
|
|
var W = document.body.clientWidth;
|
|
|
if (left < 20 && startPosX > left || left > W - 20 && startPosX < left || top < 20 && startPosY > top || top > H - 20 && startPosY < top) {
|
|
|
document.body.onmousemove = null;
|
|
|
document.body.onmouseup = null;
|
|
|
return false;
|
|
|
}
|
|
|
return true;
|
|
|
};
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
|
|
|
if (showLatex) {
|
|
|
setTimeout(function () {
|
|
|
var modal = document.getElementsByClassName('ant-modal')[0];
|
|
|
var centerX = window.innerWidth / 2 - modal.offsetWidth / 2; // 弹窗宽度的一半
|
|
|
var centerY = window.innerHeight / 2 - modal.offsetHeight / 2; // 弹窗高度的一半
|
|
|
setStyleLeft(centerX);
|
|
|
setStyleTop(centerY);
|
|
|
}, 0); // 将操作推迟到下一个事件循环中以确保Modal已渲染完成
|
|
|
}
|
|
|
}, [showLatex]);
|
|
|
var showInput = function showInput() {
|
|
|
if (disabled || readOnly) return;
|
|
|
setShowLatex(true);
|
|
|
};
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
|
|
|
style: style,
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
|
|
|
style: {
|
|
|
width: width || "100%",
|
|
|
position: 'relative'
|
|
|
},
|
|
|
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.mathFillWrap, " ").concat(disabled || readOnly ? 'cursorDefault' : ''),
|
|
|
onClick: function onClick() {
|
|
|
return showInput();
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("math-field", {
|
|
|
disabled: disabled,
|
|
|
locale: "zh_cn",
|
|
|
"class": "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.mathField, " ").concat(type),
|
|
|
readOnly: readOnly,
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u516C\u5F0F",
|
|
|
ref: GraphicsRef,
|
|
|
style: {
|
|
|
width: "100%",
|
|
|
fontSize: value ? 18 : 14
|
|
|
},
|
|
|
value: value || ""
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(antd__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
|
|
|
maskClosable: false,
|
|
|
centered: true,
|
|
|
width: 860,
|
|
|
style: {
|
|
|
position: 'absolute',
|
|
|
left: styleLeft,
|
|
|
top: styleTop
|
|
|
},
|
|
|
title: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
|
|
|
style: {
|
|
|
cursor: 'move'
|
|
|
},
|
|
|
onMouseDown: onTitleMouseDown,
|
|
|
children: "\u8F93\u5165\u516C\u5F0F"
|
|
|
}),
|
|
|
open: showLatex,
|
|
|
onOk: function onOk() {
|
|
|
var val = KeybordsRef.current.getData();
|
|
|
GraphicsRef.current.setValue(val);
|
|
|
onChange(val);
|
|
|
setShowLatex(false);
|
|
|
},
|
|
|
onCancel: function onCancel() {
|
|
|
setShowLatex(false);
|
|
|
},
|
|
|
destroyOnClose: true,
|
|
|
className: "markdown-popup-form",
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_keybords__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
|
|
|
value: value,
|
|
|
ref: KeybordsRef,
|
|
|
onChange: onChange,
|
|
|
showSaveButton: false
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
});
|
|
|
/* harmony default export */ __webpack_exports__.Z = (MathsLatex);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 81107:
|
|
|
/*!********************************************************!*\
|
|
|
!*** ./src/components/MathsLatexKeybords/keybords.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_5__ = __webpack_require__(/*! antd */ 95237);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! antd */ 43604);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! antd */ 99313);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! antd */ 3113);
|
|
|
/* harmony import */ var _components_RenderHtml__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/RenderHtml */ 96030);
|
|
|
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index.less?modules */ 36625);
|
|
|
/* harmony import */ var mathlatex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! mathlatex */ 48136);
|
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var MathsLatex = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (_ref, ref) {
|
|
|
var callback = _ref.callback,
|
|
|
showSaveButton = _ref.showSaveButton,
|
|
|
_ref$value = _ref.value,
|
|
|
value = _ref$value === void 0 ? "" : _ref$value;
|
|
|
var GraphicsRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
|
|
|
var datas = [{
|
|
|
name: "分数得分",
|
|
|
value: "\\frac{x}{y}",
|
|
|
children: [{
|
|
|
name: "分数 Fractions",
|
|
|
data: [{
|
|
|
value: "\\frac{a}{b}"
|
|
|
}, {
|
|
|
value: "x\\tfrac{x}{a} "
|
|
|
}, {
|
|
|
value: "\\mathrm{d}t"
|
|
|
}, {
|
|
|
value: "\\partial t"
|
|
|
}, {
|
|
|
value: "\\frac{\\partial y}{\\partial x}"
|
|
|
}, {
|
|
|
value: "\\nabla\\psi"
|
|
|
}, {
|
|
|
value: "\\frac{\\partial^2}{\\partial x_1\\partial x_2}y"
|
|
|
}, {
|
|
|
value: "\\cfrac{1}{a + \\cfrac{7}{b + \\cfrac{2}{9}}} = c"
|
|
|
}]
|
|
|
}, {
|
|
|
name: "导数 Derivative",
|
|
|
data: [{
|
|
|
value: "\\dot{a} "
|
|
|
}, {
|
|
|
value: "\\ddot{a}"
|
|
|
}, {
|
|
|
"value": "{f}^{\\prime}"
|
|
|
}, {
|
|
|
"value": "{f}^{\\prime\\prime}"
|
|
|
}, {
|
|
|
"value": "{f}^{(n)}"
|
|
|
}]
|
|
|
}, {
|
|
|
name: "模算术 Modular arithmetic",
|
|
|
data: [{
|
|
|
value: "a \\bmod b"
|
|
|
}, {
|
|
|
value: "a \\equiv b \\pmod{m} "
|
|
|
}, {
|
|
|
value: "\\gcd(m, n) "
|
|
|
}, {
|
|
|
value: "\\operatorname{lcm}(m, n) "
|
|
|
}]
|
|
|
}]
|
|
|
}, {
|
|
|
name: "根式角标",
|
|
|
value: "\\sqrt{x}",
|
|
|
children: [{
|
|
|
name: "根式 Radicals",
|
|
|
data: [{
|
|
|
value: "\\sqrt{x}"
|
|
|
}, {
|
|
|
value: "\\sqrt[y]{x}"
|
|
|
}]
|
|
|
}, {
|
|
|
name: "上下标 Sub&Super",
|
|
|
data: [{
|
|
|
value: "x^{a}"
|
|
|
}, {
|
|
|
value: "x_{a}"
|
|
|
}, {
|
|
|
value: "x_{a}^{b} "
|
|
|
}, {
|
|
|
value: "_{a}^{b} x"
|
|
|
}, {
|
|
|
value: "x_{a}^{b} "
|
|
|
}]
|
|
|
}, {
|
|
|
name: "重音符及其他 Accents and Others",
|
|
|
//
|
|
|
data: [{
|
|
|
value: "\\hat{a} "
|
|
|
}, {
|
|
|
value: "\\sqrt[y]{x}"
|
|
|
}, {
|
|
|
value: "\\check{} "
|
|
|
}, {
|
|
|
value: "\\grave{a} "
|
|
|
}, {
|
|
|
value: "\\acute{a}"
|
|
|
}, {
|
|
|
value: "\\tilde{a}"
|
|
|
}, {
|
|
|
value: "\\breve{a}"
|
|
|
}, {
|
|
|
value: "\\bar{a}"
|
|
|
}, {
|
|
|
value: "\\vec{a}"
|
|
|
}, {
|
|
|
value: "\\not{a}"
|
|
|
}, {
|
|
|
value: "\\widetilde{abc}"
|
|
|
}, {
|
|
|
value: "\\widehat{abc}"
|
|
|
}, {
|
|
|
value: "\\overleftarrow{abc} "
|
|
|
}, {
|
|
|
value: "\\overrightarrow{abc}"
|
|
|
}, {
|
|
|
value: "\\overline{abc}"
|
|
|
}, {
|
|
|
value: "\\underline{abc}"
|
|
|
}, {
|
|
|
value: "\\overbrace{abc}"
|
|
|
}, {
|
|
|
value: "\\underbrace{abc}"
|
|
|
}, {
|
|
|
value: "\\overset{a}{abc}"
|
|
|
}, {
|
|
|
value: "\\underset{a}{abc} \\stackrel\\frown{ab}"
|
|
|
}, {
|
|
|
value: "\\overline{ab} "
|
|
|
}, {
|
|
|
value: "\\overleftrightarrow{ab}"
|
|
|
}, {
|
|
|
value: "\\overset{a}{\\leftarrow}"
|
|
|
}, {
|
|
|
value: "\\overset{a}{\\rightarrow}"
|
|
|
}, {
|
|
|
value: "\\xleftarrow[abc]{a}"
|
|
|
}, {
|
|
|
value: "\\xrightarrow[abc]{a} "
|
|
|
}]
|
|
|
}]
|
|
|
}, {
|
|
|
name: "极限对数",
|
|
|
value: "\\lim_{x \\to 0}",
|
|
|
children: [{
|
|
|
name: "极限 Limits",
|
|
|
data: [{
|
|
|
value: "\\lim a"
|
|
|
}, {
|
|
|
value: "\\lim_{x \\to 0}"
|
|
|
}, {
|
|
|
value: "\\lim_{x \\to \\infty}"
|
|
|
}, {
|
|
|
value: "\\max_b{a}"
|
|
|
}, {
|
|
|
value: "\\min_a{b}"
|
|
|
}]
|
|
|
}, {
|
|
|
name: "对数指数 Logarithms and exponentials",
|
|
|
data: [{
|
|
|
value: "\\log_{a}{b}"
|
|
|
}, {
|
|
|
value: "\\lg_{a}{b}"
|
|
|
}, {
|
|
|
value: "\\ln_{a}{b}"
|
|
|
}, {
|
|
|
value: "\\exp a"
|
|
|
}]
|
|
|
}, {
|
|
|
name: "界限 Bounds",
|
|
|
data: [{
|
|
|
value: "\\min x"
|
|
|
}, {
|
|
|
value: "\\sup t"
|
|
|
}, {
|
|
|
value: "\\inf s"
|
|
|
}, {
|
|
|
value: "\\lim u"
|
|
|
}, {
|
|
|
value: "\\limsup w"
|
|
|
}, {
|
|
|
value: "\\dim p"
|
|
|
}, {
|
|
|
value: "\\ker\\phi "
|
|
|
}]
|
|
|
}]
|
|
|
}, {
|
|
|
name: "三角函数",
|
|
|
value: "\\sin a",
|
|
|
children: [{
|
|
|
name: "三角函数 Trigonometric functions",
|
|
|
data: [{
|
|
|
value: "\\sin a"
|
|
|
}, {
|
|
|
value: "\\cos a"
|
|
|
}, {
|
|
|
value: "\\tan a"
|
|
|
}, {
|
|
|
value: "\\cot a "
|
|
|
}, {
|
|
|
value: "\\sec a "
|
|
|
}, {
|
|
|
value: "\\csc a "
|
|
|
}]
|
|
|
}, {
|
|
|
name: "反三角函数 Inverse trigonometric functions",
|
|
|
data: [{
|
|
|
value: "\\sin^{-1}"
|
|
|
}, {
|
|
|
value: "\\cos^{-1}"
|
|
|
}, {
|
|
|
value: "\\tan^{-1}"
|
|
|
}, {
|
|
|
value: "\\cot^{-1}"
|
|
|
}, {
|
|
|
value: "\\sec^{-1}"
|
|
|
}, {
|
|
|
value: "\\csc^{-1}"
|
|
|
}, {
|
|
|
value: "\\arcsin a"
|
|
|
}, {
|
|
|
value: "\\arccos a"
|
|
|
}, {
|
|
|
value: "\\arctan a"
|
|
|
}, {
|
|
|
value: "\\operatorname{arccot} a"
|
|
|
}, {
|
|
|
value: "\\operatorname{arcsec} a"
|
|
|
}, {
|
|
|
value: "\\operatorname{arccsc} a"
|
|
|
}]
|
|
|
}, {
|
|
|
name: "双曲函数 Hyperblic functions",
|
|
|
data: [{
|
|
|
value: "\\sinh a"
|
|
|
}, {
|
|
|
value: "\\cosh a"
|
|
|
}, {
|
|
|
value: "\\tanh a"
|
|
|
}, {
|
|
|
value: "\\coth a"
|
|
|
}, {
|
|
|
value: "\\operatorname{sech} a"
|
|
|
}, {
|
|
|
value: "\\operatorname{csch} a"
|
|
|
}]
|
|
|
}, {
|
|
|
name: "反双曲函数 Inverse hyperbolic functions",
|
|
|
data: [{
|
|
|
value: "\\sinh^{-1}"
|
|
|
}, {
|
|
|
value: "a\\cosh^{-1} a"
|
|
|
}, {
|
|
|
value: "\\tanh^{-1} a"
|
|
|
}, {
|
|
|
value: "\\coth^{-1} a"
|
|
|
}, {
|
|
|
value: "\\operatorname{sech}^{-1} a"
|
|
|
}, {
|
|
|
value: "\\operatorname{csch}^{-1} a"
|
|
|
}]
|
|
|
}]
|
|
|
}, {
|
|
|
name: "积分运算",
|
|
|
value: "\\int_{a}^{b}",
|
|
|
children: [{
|
|
|
name: "积分 Integral",
|
|
|
data: [{
|
|
|
value: "\\int"
|
|
|
}, {
|
|
|
value: "\\int_{a}^{b}"
|
|
|
}, {
|
|
|
value: "\\int\\limits_{a}^{b}"
|
|
|
}]
|
|
|
}, {
|
|
|
name: "双重积分 Double integral",
|
|
|
data: [{
|
|
|
value: "\\iint"
|
|
|
}, {
|
|
|
value: "\\iint_{a}^{b} "
|
|
|
}, {
|
|
|
value: "\\iint\\limits_{a}^{b} "
|
|
|
}]
|
|
|
}, {
|
|
|
name: "三重积分 Triple integral",
|
|
|
data: [{
|
|
|
value: "\\iiint"
|
|
|
}, {
|
|
|
value: "\\iiint_{a}^{b}"
|
|
|
}, {
|
|
|
value: "\\iiint\\limits_{a}^{b} "
|
|
|
}]
|
|
|
}, {
|
|
|
name: "曲线积分 Closed line or path integral",
|
|
|
data: [{
|
|
|
value: "\\oint"
|
|
|
}, {
|
|
|
value: "\\oint_{a}^{b} "
|
|
|
}]
|
|
|
}]
|
|
|
}, {
|
|
|
name: "大型运算",
|
|
|
value: "\\sum_{a}^{b}",
|
|
|
children: [{
|
|
|
name: "求和 Summation",
|
|
|
data: [{
|
|
|
value: "\\sum"
|
|
|
}, {
|
|
|
value: "\\sum_{a}^{b}"
|
|
|
}, {
|
|
|
value: "{\\textstyle \\sum_{a}^{b}} "
|
|
|
}]
|
|
|
}, {
|
|
|
name: "乘积余积 Product and coproduct",
|
|
|
data: [{
|
|
|
value: "\\prod"
|
|
|
}, {
|
|
|
value: "\\prod_{a}^{b}"
|
|
|
}, {
|
|
|
value: "{\\textstyle \\prod_{a}^{b}}"
|
|
|
}, {
|
|
|
value: "\\coprod"
|
|
|
}, {
|
|
|
value: "\\coprod_{a}^{b}"
|
|
|
}, {
|
|
|
value: "{\\textstyle \\coprod_{a}^{b}} "
|
|
|
}]
|
|
|
}, {
|
|
|
name: "并集交集 Union and intersection",
|
|
|
data: [{
|
|
|
value: "\\bigcup"
|
|
|
}, {
|
|
|
value: "\\bigcup_{a}^{b}"
|
|
|
}, {
|
|
|
value: "{\\textstyle \\bigcup_{a}^{b}}"
|
|
|
}, {
|
|
|
value: "\\bigcap"
|
|
|
}, {
|
|
|
value: "\\bigcap_{a}^{b}"
|
|
|
}]
|
|
|
}, {
|
|
|
name: "析取合取 Disjunction and conjunction",
|
|
|
data: [{
|
|
|
"value": "\\bigvee"
|
|
|
}, {
|
|
|
"value": "\\bigvee_{a}^{b}"
|
|
|
}, {
|
|
|
"value": "\\bigwedge"
|
|
|
}, {
|
|
|
"value": "\\bigwedge_{a}^{b}"
|
|
|
}]
|
|
|
}]
|
|
|
}, {
|
|
|
name: "括号取整",
|
|
|
value: "\\left [ \\left ( \\right ) \\right ] ",
|
|
|
children: [{
|
|
|
name: "括号 Brackets",
|
|
|
data: [{
|
|
|
"value": "\\left ( \\right )"
|
|
|
}, {
|
|
|
"value": "\\left [ \\right ]"
|
|
|
}, {
|
|
|
"value": "\\left \\langle \\right \\rangle "
|
|
|
}, {
|
|
|
"value": "\\left | \\right | "
|
|
|
}, {
|
|
|
"value": "\\left \\lfloor \\right \\rfloor "
|
|
|
}, {
|
|
|
"value": "\\left \\lceil \\right \\rceil "
|
|
|
}]
|
|
|
}]
|
|
|
}];
|
|
|
var datasLatex = [{
|
|
|
name: "代数",
|
|
|
value: "\\sqrt{a^2+b^2}",
|
|
|
children: [{
|
|
|
data: [{
|
|
|
value: "\\left(x-1\\right)\\left(x+3\\right) "
|
|
|
}, {
|
|
|
value: "\\sqrt{a^2+b^2}"
|
|
|
}, {
|
|
|
value: "\\left ( \\frac{a}{b}\\right )^{n}= \\frac{a^{n}}{b^{n}}"
|
|
|
}, {
|
|
|
"value": "\\frac{a}{b}\\pm \\frac{c}{d}= \\frac{ad \\pm bc}{bd} "
|
|
|
}, {
|
|
|
"value": "\\frac{x^{2}}{a^{2}}-\\frac{y^{2}}{b^{2}}=1 "
|
|
|
}, {
|
|
|
"value": "\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0 "
|
|
|
}, {
|
|
|
"value": "\\sqrt[n]{a^{n}}=\\left ( \\sqrt[n]{a}\\right )^{n} "
|
|
|
}, {
|
|
|
"value": "x ={-b \\pm \\sqrt{b^2-4ac}\\over 2a} "
|
|
|
}, {
|
|
|
"value": "y-y_{1}=k \\left( x-x_{1}\\right) "
|
|
|
}, {
|
|
|
"value": "\\left\\{\\begin{matrix} \r\n x=a + r\\text{cos}\\theta \\ \r\n y=b + r\\text{sin}\\theta \r\n\\end{matrix}\\right. "
|
|
|
}, {
|
|
|
value: "\\begin{array}{l} \r\n \\text{对于方程形如:}x^{3}-1=0 \\ \r\n \\text{设}\\text{:}\\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r\n x_{1}=1,x_{2}= \\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r\n x_{3}= \\omega ^{2}=\\frac{-1-\\sqrt{3}i}{2} \r\n\\end{array} "
|
|
|
}, {
|
|
|
value: "\\begin{array}{l} \r\n a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r\n \\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r\n \\left\\{\\begin{matrix} \r\n \\Delta \\gt 0\\text{方程有两个不相等的实根} \\ \r\n \\Delta = 0\\text{方程有两个相等的实根} \\ \r\n \\Delta \\lt 0\\text{方程无实根} \r\n\\end{matrix}\\right. \r\n\\end{array} "
|
|
|
}, {
|
|
|
value: "\\begin{array}{l} \r\n a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r\n \\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r\n \\mathop{{x}}\\nolimits_{{1,2}}=\\frac{{-b \\pm \r\n \\sqrt{{\\mathop{{b}}\\nolimits^{{2}}-4ac}}}}{{2a}} \\ \r\n \\mathop{{x}}\\nolimits_{{1}}+\\mathop{{x}}\\nolimits_{{2}}=-\\frac{{b}}{{a}} \\ \r\n \\mathop{{x}}\\nolimits_{{1}}\\mathop{{x}}\\nolimits_{{2}}=\\frac{{c}}{{a}} \r\n\\end{array} "
|
|
|
}]
|
|
|
}]
|
|
|
}, {
|
|
|
name: "几何",
|
|
|
value: "\\Delta A B C ",
|
|
|
children: [{
|
|
|
data: [{
|
|
|
"value": "\\Delta A B C "
|
|
|
}, {
|
|
|
"value": "a \\parallel c,b \\parallel c \\Rightarrow a \\parallel b "
|
|
|
}, {
|
|
|
"value": "l \\perp \\beta ,l \\subset \\alpha \\Rightarrow \\alpha \\perp \\beta"
|
|
|
}, {
|
|
|
"value": "\\left.\\begin{matrix} \r\n a \\perp \\alpha \\ \r\n b \\perp \\alpha \r\n\\end{matrix}\\right\\}\\Rightarrow a \\parallel b"
|
|
|
}, {
|
|
|
"value": "P \\in \\alpha ,P \\in \\beta , \\alpha \\cap \\beta =l \\Rightarrow P \\in l "
|
|
|
}, {
|
|
|
"value": "\\alpha \\perp \\beta , \\alpha \\cap \\beta =l,a \\subset \\alpha ,a \\perp l \r\n \\Rightarrow a \\perp \\beta "
|
|
|
}, {
|
|
|
"value": "\\left.\\begin{matrix} \r\n a \\subset \\beta ,b \\subset \\beta ,a \\cap b=P \\ \r\n a \\parallel \\partial ,b \\parallel \\partial \r\n\\end{matrix}\\right\\}\\Rightarrow \\beta \\parallel \\alpha "
|
|
|
}, {
|
|
|
"value": "\\alpha \\parallel \\beta , \\gamma \\cap \\alpha =a, \\gamma \\cap \\beta =b \\Rightarrow a \\parallel b "
|
|
|
}, {
|
|
|
"value": "A \\in l,B \\in l,A \\in \\alpha ,B \\in \\alpha \\Rightarrow l \\subset \\alpha "
|
|
|
}, {
|
|
|
"value": "\\left.\\begin{matrix} \r\n m \\subset \\alpha ,n \\subset \\alpha ,m \\cap n=P \\ \r\n a \\perp m,a \\perp n \r\n\\end{matrix}\\right\\}\\Rightarrow a \\perp \\alpha "
|
|
|
}, {
|
|
|
"value": "\\begin{array}{c} \r\n \\text{直角三角形中,直角边长a,b,斜边边长c} \\ \r\n a^{2}+b^{2}=c^{2} \r\n\\end{array}"
|
|
|
}]
|
|
|
}]
|
|
|
}, {
|
|
|
name: "不等式",
|
|
|
value: "a > b",
|
|
|
children: [{
|
|
|
data: [{
|
|
|
"value": "a > b,b > c \\Rightarrow a > c "
|
|
|
}, {
|
|
|
"value": "a > b,c > d \\Rightarrow a+c > b+d "
|
|
|
}, {
|
|
|
"value": "a > b > 0,c > d > 0 \\Rightarrow ac bd "
|
|
|
}, {
|
|
|
"value": "\\begin{array}{c} \r\n a \\gt b,c \\gt 0 \\Rightarrow ac \\gt bc \\ \r\n a \\gt b,c \\lt 0 \\Rightarrow ac \\lt bc \r\n\\end{array}"
|
|
|
}, {
|
|
|
"value": "\\left | a-b \\right | \\geqslant \\left | a \\right | -\\left | b \\right | "
|
|
|
}, {
|
|
|
"value": "-\\left | a \\right |\\leq a\\leqslant \\left | a \\right | "
|
|
|
}, {
|
|
|
"value": "\\left | a \\right |\\leqslant b \\Rightarrow -b \\leqslant a \\leqslant \\left | b \\right | "
|
|
|
}, {
|
|
|
"value": "\\left | a+b \\right | \\leqslant \\left | a \\right | + \\left | b \\right | "
|
|
|
}, {
|
|
|
"value": "\\begin{array}{c} \r\n a \\gt b \\gt 0,n \\in N^{\\ast},n \\gt 1 \\ \r\n \\Rightarrow a^{n}\\gt b^{n}, \\sqrt[n]{a}\\gt \\sqrt[n]{b} \r\n\\end{array}"
|
|
|
}, {
|
|
|
"value": "\\left( \\sum_{k=1}^n a_k b_k \\right)^{\\!\\!2}\\leq \r\n\\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right) "
|
|
|
}, {
|
|
|
"value": "\\begin{array}{c} \r\n a,b \\in R^{+} \\ \r\n \\Rightarrow \\frac{a+b}{{2}}\\ge \\sqrt{ab} \\ \r\n \\left( \\text{当且仅当}a=b\\text{时取“}=\\text{”号}\\right) \r\n\\end{array}"
|
|
|
}, {
|
|
|
"value": "\\begin{array}{c} \r\n a,b \\in R \\ \r\n \\Rightarrow a^{2}+b^{2}\\gt 2ab \\ \r\n \\left( \\text{当且仅当}a=b\\text{时取“}=\\text{”号}\\right) \r\n\\end{array}"
|
|
|
}, {
|
|
|
"value": "\\begin{array}{c} \r\n H_{n}=\\frac{n}{\\sum \\limits_{i=1}^{n}\\frac{1}{x_{i}}}= \\frac{n}{\\frac{1}{x_{1}}+ \\frac{1}{x_{2}}+ \\cdots + \\frac{1}{x_{n}}} \\ G_{n}=\\sqrt[n]{\\prod \\limits_{i=1}^{n}x_{i}}= \\sqrt[n]{x_{1}x_{2}\\cdots x_{n}} \\ A_{n}=\\frac{1}{n}\\sum \\limits_{i=1}^{n}x_{i}=\\frac{x_{1}+ x_{2}+ \\cdots + x_{n}}{n} \\ Q_{n}=\\sqrt{\\sum \\limits_{i=1}^{n}x_{i}^{2}}= \\sqrt{\\frac{x_{1}^{2}+ x_{2}^{2}+ \\cdots + x_{n}^{2}}{n}} \\ H_{n}\\leq G_{n}\\leq A_{n}\\leq Q_{n} \r\n\\end{array}"
|
|
|
}]
|
|
|
}]
|
|
|
}, {
|
|
|
name: "积分",
|
|
|
value: "\\frac{\\mathrm{d}\\partial}{\\partial x}",
|
|
|
children: [{
|
|
|
data: [{
|
|
|
"value": "\\frac{\\mathrm{d}}{\\mathrm{d}x}x^n=nx^{n-1} "
|
|
|
}, {
|
|
|
"value": "\\frac{\\mathrm{d}}{\\mathrm{d}x}e^{ax}=a\\,e^{ax} "
|
|
|
}, {
|
|
|
"value": "\\frac{\\mathrm{d}}{\\mathrm{d}x}\\ln(x)=\\frac{1}{x} "
|
|
|
}, {
|
|
|
"value": "\\frac{\\mathrm{d}}{\\mathrm{d}x}\\sin x=\\cos x "
|
|
|
}, {
|
|
|
"value": "\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cos x=-\\sin x "
|
|
|
}, {
|
|
|
"value": "\\int k\\mathrm{d}x = kx+C "
|
|
|
}, {
|
|
|
"value": "\\frac{\\mathrm{d}}{\\mathrm{d}x}\\tan x=\\sec^2 x "
|
|
|
}, {
|
|
|
"value": "\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cot x=-\\csc^2 x "
|
|
|
}, {
|
|
|
"value": "\\int \\frac{1}{x}\\mathrm{d}x= \\ln \\left| x \\right| +C "
|
|
|
}, {
|
|
|
"value": "\\int \\frac{1}{\\sqrt{1-x^{2}}}\\mathrm{d}x= \\arcsin x +C "
|
|
|
}, {
|
|
|
"value": "\\int \\frac{1}{1+x^{2}}\\mathrm{d}x= \\arctan x +C "
|
|
|
}, {
|
|
|
"value": "\\int u \\frac{\\mathrm{d}v}{\\mathrm{d}x}\\,\\mathrm{d}x=uv-\\int \\frac{\\mathrm{d}u}{\\mathrm{d}x}v\\,\\mathrm{d}x "
|
|
|
}, {
|
|
|
"value": "f(x) = \\int_{-\\infty}^\\infty \\hat f(x)\\xi\\,e^{2 \\pi i \\xi x} \\,\\mathrm{d}\\xi "
|
|
|
}, {
|
|
|
"value": "\\int x^{\\mu}\\mathrm{d}x=\\frac{x^{\\mu +1}}{\\mu +1}+C, \\left({\\mu \\neq -1}\\right) "
|
|
|
}]
|
|
|
}]
|
|
|
},
|
|
|
// {
|
|
|
// name: "矩阵",
|
|
|
// value: "\\begin{pmatrix} \r\n 1 & 0 \\\\ \r\n 0 & 1 \r\n\\end{pmatrix} ",
|
|
|
// children: [{
|
|
|
// data: [
|
|
|
// { "value": "\\begin{pmatrix} \r\n 1 & 0 \\\\ \r\n 0 & 1 \r\n\\end{pmatrix} " }, { "value": "\\begin{pmatrix} \r\n a_{11} & a_{12} & a_{13} \\ \r\n a_{21} & a_{22} & a_{23} \\ \r\n a_{31} & a_{32} & a_{33} \r\n\\end{pmatrix} " }, { "value": "\\begin{pmatrix} \r\n a_{11} & \\cdots & a_{1n} \\ \r\n \\vdots & \\ddots & \\vdots \\ \r\n a_{m1} & \\cdots & a_{mn} \r\n\\end{pmatrix} " }, { "value": "\\begin{array}{c} \r\n A=A^{T} \\ \r\n A=-A^{T} \r\n\\end{array}" }, { "value": "O = \\begin{bmatrix} \r\n 0 & 0 & \\cdots & 0 \\ \r\n 0 & 0 & \\cdots & 0 \\ \r\n \\vdots & \\vdots & \\ddots & \\vdots \\ \r\n 0 & 0 & \\cdots & 0 \r\n\\end{bmatrix} " }, { "value": "A_{m\\times n}= \r\n\\begin{bmatrix} \r\n a_{11}& a_{12}& \\cdots & a_{1n} \\ \r\n a_{21}& a_{22}& \\cdots & a_{2n} \\ \r\n \\vdots & \\vdots & \\ddots & \\vdots \\ \r\n a_{m1}& a_{m2}& \\cdots & a_{mn} \r\n\\end{bmatrix} \r\n=\\left [ a_{ij}\\right ] " }, { "value": "\\begin{array}{c} \r\n A={\\left[ a_{ij}\\right]_{m \\times n}},B={\\left[ b_{ij}\\right]_{n \\times s}} \\ \r\n c_{ij}= \\sum \\limits_{k=1}^{{n}}a_{ik}b_{kj} \\ \r\n C=AB=\\left[ c_{ij}\\right]_{m \\times s} \r\n = \\left[ \\sum \\limits_{k=1}^{n}a_{ik}b_{kj}\\right]_{m \\times s} \r\n\\end{array}" }, { "value": "\\mathbf{V}_1 \\times \\mathbf{V}_2 = \r\n\\begin{vmatrix} \r\n \\mathbf{i}& \\mathbf{j}& \\mathbf{k} \\ \r\n \\frac{\\partial X}{\\partial u}& \\frac{\\partial Y}{\\partial u}& 0 \\ \r\n \\frac{\\partial X}{\\partial v}& \\frac{\\partial Y}{\\partial v}& 0 \\ \r\n\\end{vmatrix} " }
|
|
|
// ]
|
|
|
// }]
|
|
|
// },
|
|
|
{
|
|
|
name: "三角",
|
|
|
value: "e^{i \\theta}",
|
|
|
children: [{
|
|
|
name: "求和 Summation",
|
|
|
data: [{
|
|
|
"value": "e^{i \\theta} "
|
|
|
}, {
|
|
|
"value": "\\left(\\frac{\\pi}{2}-\\theta \\right ) "
|
|
|
}, {
|
|
|
"value": "\\text{sin}^{2}\\frac{\\alpha}{2}=\\frac{1- \\text{cos}\\alpha}{2} "
|
|
|
}, {
|
|
|
"value": "\\text{cos}^{2}\\frac{\\alpha}{2}=\\frac{1+ \\text{cos}\\alpha}{2} "
|
|
|
}, {
|
|
|
"value": "\\text{tan}\\frac{\\alpha}{2}=\\frac{\\text{sin}\\alpha}{1+ \\text{cos}\\alpha} "
|
|
|
}, {
|
|
|
"value": "\\sin \\alpha + \\sin \\beta =2 \\sin \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "
|
|
|
}, {
|
|
|
"value": "\\sin \\alpha - \\sin \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "
|
|
|
}, {
|
|
|
"value": "\\cos \\alpha + \\cos \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "
|
|
|
}, {
|
|
|
"value": "\\cos \\alpha - \\cos \\beta =-2\\sin \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "
|
|
|
}, {
|
|
|
"value": "a^{2}=b^{2}+c^{2}-2bc\\cos A "
|
|
|
}, {
|
|
|
"value": "\\frac{\\sin A}{a}=\\frac{\\sin B}{b}=\\frac{\\sin C}{c}=\\frac{1}{2R} "
|
|
|
}, {
|
|
|
"value": "\\sin \\left ( \\frac{\\pi}{2}-\\alpha \\right ) = \\cos \\alpha "
|
|
|
}, {
|
|
|
"value": "\\sin \\left ( \\frac{\\pi}{2}+\\alpha \\right ) = \\cos \\alpha "
|
|
|
}]
|
|
|
}]
|
|
|
}, {
|
|
|
name: "统计",
|
|
|
value: "C_{r}^{n}",
|
|
|
children: [{
|
|
|
data: [{
|
|
|
"value": "C_{r}^{n} "
|
|
|
}, {
|
|
|
"value": "\\frac{n!}{r!(n-r)!} "
|
|
|
}, {
|
|
|
"value": "\\sum_{i=1}^{n}{X_i} "
|
|
|
}, {
|
|
|
"value": "\\sum_{i=1}^{n}{X_i^2} "
|
|
|
}, {
|
|
|
"value": "X_1, \\cdots,X_n "
|
|
|
}, {
|
|
|
"value": "\\frac{x-\\mu}{\\sigma} "
|
|
|
}, {
|
|
|
"value": "\\sum_{i=1}^{n}{(X_i - \\overline{X})^2} "
|
|
|
}, {
|
|
|
"value": "\\begin{array}{c} \r\n \\text{若}P \\left( AB \\right) =P \\left( A \\right) P \\left( B \\right) \\\\ \r\n \\text{则}P \\left( A \\left| B\\right. \\right) =P \\left({B}\\right) \r\n\\end{array}"
|
|
|
}, {
|
|
|
"value": "P(E) ={n \\choose k}p^k (1-p)^{n-k} "
|
|
|
}, {
|
|
|
"value": "P \\left( A \\right) = \\lim \\limits_{n \\to \\infty}f_{n}\\left ( A \\right ) "
|
|
|
}, {
|
|
|
"value": "P \\left( \\bigcup \\limits_{i=1}^{+ \\infty}A_{i}\\right) = \\prod \\limits_{i=1}^{+ \\infty}P{\\left( A_{i}\\right)} "
|
|
|
}, {
|
|
|
"value": "\\begin{array}{c} \r\n P \\left( \\emptyset \\right) =0 \\\\ \r\n P \\left( S \\right) =1 \r\n\\end{array}"
|
|
|
}, {
|
|
|
"value": "\\begin{array}{c} \r\n \\forall A \\in S \\\\ \r\n P \\left( A \\right) \\ge 0 \r\n\\end{array}"
|
|
|
}, {
|
|
|
"value": "P \\left( \\bigcup \\limits_{i=1}^{n}A_{i}\\right) = \\prod \\limits_{i=1}^{n}P \\left( A_{i}\\right) "
|
|
|
}, {
|
|
|
"value": "\\begin{array}{c} \r\n S= \\binom{N}{n},A_{k}=\\binom{M}{k}\\cdot \\binom{N-M}{n-k} \\\\ \r\n P\\left ( A_{k}\\right ) = \\frac{\\binom{M}{k}\\cdot \\binom{N-M}{n-k}}{\\binom{N}{n}} \r\n\\end{array}"
|
|
|
}, {
|
|
|
"value": "\\begin{array}{c} \r\n P_{n}=n! \\\\ \r\n A_{n}^{k}=\\frac{n!}{\\left( n-k \\left) !\\right. \\right.} \r\n\\end{array}"
|
|
|
}]
|
|
|
}]
|
|
|
}];
|
|
|
var setValue = function setValue(item) {
|
|
|
GraphicsRef.current.setValue(GraphicsRef.current.getValue() + " " + item.value + " ");
|
|
|
};
|
|
|
var items = [{
|
|
|
key: '1',
|
|
|
label: '快捷模板',
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(antd__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.lists,
|
|
|
gutter: [10, 10],
|
|
|
children: datas.map(function (data, key) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
|
|
|
flex: "110px",
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.item,
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
|
|
|
value: "$$".concat(data.value, "$$")
|
|
|
}), data.name]
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.children,
|
|
|
children: data.children.map(function (data, key) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("h1", {
|
|
|
children: data.name
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(antd__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
|
|
|
gutter: [10, 10],
|
|
|
children: data.data.map(function (item, k) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(antd__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
|
|
|
onClick: function onClick() {
|
|
|
return setValue(item);
|
|
|
},
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.diamond,
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
|
|
|
value: "`$$" + item.value + "$$`"
|
|
|
})
|
|
|
}, k);
|
|
|
})
|
|
|
})]
|
|
|
}, key);
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
})
|
|
|
})
|
|
|
}, {
|
|
|
key: '2',
|
|
|
label: '公式模板',
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(antd__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.lists,
|
|
|
gutter: [10, 10],
|
|
|
children: datasLatex.map(function (data, key) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
|
|
|
flex: "110px",
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.item,
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
|
|
|
value: "`$$" + data.value + "$$`"
|
|
|
}), data.name]
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.children,
|
|
|
children: data.children.map(function (item, key) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
|
|
children: [item.name && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("h1", {
|
|
|
children: item.name
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(antd__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
|
|
|
gutter: [10, 10],
|
|
|
children: item.data.map(function (item, k) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(antd__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
|
|
|
onClick: function onClick() {
|
|
|
return setValue(item);
|
|
|
},
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.diamond,
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
|
|
|
value: "`$$" + item.value + "$$`"
|
|
|
})
|
|
|
}, k);
|
|
|
})
|
|
|
})]
|
|
|
}, key);
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
})
|
|
|
})
|
|
|
}];
|
|
|
var getData = function getData() {
|
|
|
var dom = document.createElement("div");
|
|
|
dom.innerHTML = GraphicsRef.current.getValue();
|
|
|
var str = dom.innerText;
|
|
|
callback && callback(str);
|
|
|
return str;
|
|
|
};
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useImperativeHandle)(ref, function () {
|
|
|
return {
|
|
|
getData: getData
|
|
|
};
|
|
|
});
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
|
if (GraphicsRef.current) GraphicsRef.current.menuItems = GraphicsRef.current.menuItems.filter(function (item) {
|
|
|
return item.id !== "copy" && item.id !== "paste" && item.keyboardShortcut !== "meta+X";
|
|
|
});
|
|
|
}, [GraphicsRef.current]);
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.mathWrap,
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, {
|
|
|
defaultActiveKey: "1",
|
|
|
items: items
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("math-field", {
|
|
|
locale: "zh_cn",
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.mathField,
|
|
|
placeholder: "\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",
|
|
|
ref: GraphicsRef,
|
|
|
style: {
|
|
|
width: 800,
|
|
|
marginTop: 30,
|
|
|
fontSize: 18
|
|
|
},
|
|
|
children: value || ""
|
|
|
}), showSaveButton && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.button,
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(antd__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .ZP, {
|
|
|
size: "large",
|
|
|
onClick: getData,
|
|
|
style: {
|
|
|
zIndex: 8,
|
|
|
marginTop: 10
|
|
|
},
|
|
|
type: "primary",
|
|
|
children: "\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
});
|
|
|
/* harmony default export */ __webpack_exports__.Z = (MathsLatex);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 36625:
|
|
|
/*!**************************************************************!*\
|
|
|
!*** ./src/components/MathsLatexKeybords/index.less?modules ***!
|
|
|
\**************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
|
|
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ __webpack_exports__.Z = ({"lists":"lists___xhHyq","item":"item___pWJAA","children":"children___sDG61","diamond":"diamond___FwgzD","button":"button___WPN6r","mathWrap":"mathWrap___FmnMJ","mathFillWrap":"mathFillWrap___PmY3H"});
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |