Commit b6656235 by wufan

Merge branch 'feature/yuananting/20210327/test-paper' into 'master'

Feature/yuananting/20210327/test paper

See merge request !20
parents 4939b9d7 13601a1c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-25 11:23:47 * @Date: 2021-02-25 11:23:47
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-04-15 11:04:03 * @LastEditTime: 2021-05-20 11:37:40
* @Description: 助学工具-题库-试卷列表数据 * @Description: 助学工具-题库-试卷列表数据
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -441,7 +441,6 @@ class PaperList extends Component { ...@@ -441,7 +441,6 @@ class PaperList extends Component {
pagination={false} pagination={false}
bordered bordered
loading={loading} loading={loading}
onChange={this.handleChangeTable}
/> />
) : ( ) : (
<Table <Table
...@@ -455,7 +454,6 @@ class PaperList extends Component { ...@@ -455,7 +454,6 @@ class PaperList extends Component {
columns={this.parseColumns()} columns={this.parseColumns()}
pagination={false} pagination={false}
bordered bordered
onChange={this.handleChangeTable}
/> />
)} )}
</ConfigProvider> </ConfigProvider>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-25 11:23:47 * @Date: 2021-02-25 11:23:47
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-04-13 13:56:05 * @LastEditTime: 2021-05-20 11:43:21
* @Description: 助学工具-新建试卷-选择题目列表 * @Description: 助学工具-新建试卷-选择题目列表
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -108,15 +108,14 @@ class SelectQuestionList extends Component { ...@@ -108,15 +108,14 @@ class SelectQuestionList extends Component {
handleChangeTable = (pagination, filters, sorter) => { handleChangeTable = (pagination, filters, sorter) => {
const { columnKey, order } = sorter; const { columnKey, order } = sorter;
let sort = "UPDATED_DESC"; let sort = "UPDATED_DESC";
if (order === "ascend") { if (columnKey === "accuracy" && order === "ascend") {
sort = "ACCURACY_ASC"; sort = "ACCURACY_ASC";
} }
if (order === "descend") { if (columnKey === "accuracy" && order === "descend") {
sort = "ACCURACY_DESC"; sort = "ACCURACY_DESC";
} }
const _query = this.state.query; const _query = this.state.query;
_query.order = sort; _query.order = sort;
_query.current = 1;
this.setState({ query: _query }, () => this.queryQuestionPageListWithContent()); this.setState({ query: _query }, () => this.queryQuestionPageListWithContent());
}; };
......
...@@ -53,8 +53,14 @@ ...@@ -53,8 +53,14 @@
} }
.input-box { .input-box {
line-height: 20px; line-height: 20px;
* { display: inline-block;
display: inline; vertical-align: top;
*:not(p) {
font-weight: normal !important;
font-size: 14px !important;
font-style: normal !important;
text-decoration: none !important;
margin: 0 !important;
} }
.add-fill-line { .add-fill-line {
padding: 0 10px; padding: 0 10px;
......
...@@ -120,7 +120,7 @@ class QuestionEditor extends Component { ...@@ -120,7 +120,7 @@ class QuestionEditor extends Component {
}; };
editorRoot.config.zIndex = 999; editorRoot.config.zIndex = 999;
editorRoot.config.placeholder = ""; editorRoot.config.placeholder = "";
editorRoot.config.pasteFilterStyle = false; editorRoot.config.pasteFilterStyle = true;
editorRoot.config.pasteIgnoreImg = true; editorRoot.config.pasteIgnoreImg = true;
editorRoot.config.focus = false; editorRoot.config.focus = false;
// 自定义处理粘贴的文本内容 // 自定义处理粘贴的文本内容
...@@ -133,10 +133,11 @@ class QuestionEditor extends Component { ...@@ -133,10 +133,11 @@ class QuestionEditor extends Component {
str1 = str1.replace(/[ | ]*\n/g, "\n"); str1 = str1.replace(/[ | ]*\n/g, "\n");
str1 = str1.replace(/\&nbsp\;/gi, " "); str1 = str1.replace(/\&nbsp\;/gi, " ");
str1 = str1.replace(/[\r\n]/g, ""); str1 = str1.replace(/[\r\n]/g, "");
str1 = str1.replace(/<\/?a.*?>/g, "");
var str2 = content; // 保留空格和换行的其他字符 var str2 = content; // 保留空格和换行的其他字符
str2 = str2.replace(/<xml>[\s\S]*?<\/xml>/gi, ""); str2 = str2.replace(/<xml>[\s\S]*?<\/xml>/gi, "");
str2 = str2.replace(/<style>[\s\S]*?<\/style>/gi, ""); str2 = str2.replace(/<style>[\s\S]*?<\/style>/gi, "");
str2 = str2.replace(/<(?!br).*?>/g, ""); str2 = str2.replace(/<\/?a.*?>/g, "");
if (editorRoot.txt.text().length + str1.length > 1000) { if (editorRoot.txt.text().length + str1.length > 1000) {
content = str2.substring(0, 1000); content = str2.substring(0, 1000);
message.error("内容过长,不能超过1000字"); message.error("内容过长,不能超过1000字");
......
...@@ -38,10 +38,18 @@ ...@@ -38,10 +38,18 @@
border: 1px solid #e8e8e8; border: 1px solid #e8e8e8;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
font-size: 14px !important;
.editor-box_content { .editor-box_content {
width: calc(100% - 80px); width: calc(100% - 80px);
p { p {
display: inline; font-size: 14px !important;
}
*:not(p){
font-weight: normal !important;
font-size: 14px !important;
font-style: normal !important;
text-decoration: none !important;
margin: 0 !important;
} }
} }
.editor-limit { .editor-limit {
...@@ -56,13 +64,21 @@ ...@@ -56,13 +64,21 @@
border-radius: 4px; border-radius: 4px;
padding: 4px 0; padding: 4px 0;
border: 1px solid #e8e8e8; border: 1px solid #e8e8e8;
font-size: 14px !important;
.editor-box_content { .editor-box_content {
max-height: 110px; max-height: 110px;
overflow: auto; overflow: auto;
p { p {
display: inline; font-size: 14px !important;
overflow-y: scroll; overflow-y: scroll;
} }
*:not(p) {
font-weight: normal !important;
font-size: 14px !important;
font-style: normal !important;
text-decoration: none !important;
margin: 0 !important;
}
} }
.editor-limit { .editor-limit {
text-align: right; text-align: right;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-25 11:23:47 * @Date: 2021-02-25 11:23:47
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-04-12 14:14:19 * @LastEditTime: 2021-05-20 11:35:07
* @Description: 助学工具-题库-题目列表数据 * @Description: 助学工具-题库-题目列表数据
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -161,7 +161,7 @@ class QuestionList extends Component { ...@@ -161,7 +161,7 @@ class QuestionList extends Component {
height: 100, height: 100,
}} }}
description={ description={
<div> <span>
<span>还没有题目</span> <span>还没有题目</span>
{["CloudManager", "StoreManager"].includes(User.getUserRole()) && {["CloudManager", "StoreManager"].includes(User.getUserRole()) &&
categoryId && ( categoryId && (
...@@ -178,7 +178,7 @@ class QuestionList extends Component { ...@@ -178,7 +178,7 @@ class QuestionList extends Component {
吧! 吧!
</span> </span>
)} )}
</div> </span>
} }
></Empty> ></Empty>
); );
...@@ -202,7 +202,6 @@ class QuestionList extends Component { ...@@ -202,7 +202,6 @@ class QuestionList extends Component {
} }
const _query = this.state.query; const _query = this.state.query;
_query.order = sort || "UPDATED_DESC"; _query.order = sort || "UPDATED_DESC";
_query.current = 1;
this.setState({ query: _query }, () => this.queryQuestionPageList()); this.setState({ query: _query }, () => this.queryQuestionPageList());
}; };
...@@ -225,16 +224,27 @@ class QuestionList extends Component { ...@@ -225,16 +224,27 @@ class QuestionList extends Component {
handleVal = handleVal.replace(/<(?!img|input).*?>/g, ""); handleVal = handleVal.replace(/<(?!img|input).*?>/g, "");
handleVal = handleVal.replace(/<\s?input[^>]*>/gi, "_、"); handleVal = handleVal.replace(/<\s?input[^>]*>/gi, "_、");
handleVal = handleVal.replace(/\&nbsp\;/gi, " "); handleVal = handleVal.replace(/\&nbsp\;/gi, " ");
handleVal = handleVal.replace(/style\s*?=\s*?([‘"])[\s\S]*?\1/gi, "");
return ( return (
<Tooltip <Tooltip
overlayClassName="aid-tool-list" overlayClassName="aid-tool-list"
title={ title={
<div style={{ maxWidth: 700, width: "auto" }}>{handleVal}</div> <div
style={{ maxWidth: 700, width: "auto" }}
dangerouslySetInnerHTML={{
__html: handleVal,
}}
/>
} }
placement="topLeft" placement="topLeft"
overlayStyle={{ maxWidth: 700 }} overlayStyle={{ maxWidth: 700 }}
> >
{handleVal} <div
className="one-line-text"
dangerouslySetInnerHTML={{
__html: handleVal,
}}
/>
</Tooltip> </Tooltip>
); );
}, },
......
...@@ -32,8 +32,13 @@ ...@@ -32,8 +32,13 @@
color: #666666; color: #666666;
.input-box { .input-box {
margin-bottom: 8px; margin-bottom: 8px;
* { display: inline-block;
display: inline-block; *:not(p) {
font-weight: normal !important;
font-size: 14px !important;
font-style: normal !important;
text-decoration: none !important;
margin: 0 !important;
} }
} }
.picture-box { .picture-box {
...@@ -102,6 +107,13 @@ ...@@ -102,6 +107,13 @@
display: inline-block; display: inline-block;
max-width: calc(100% - 20px); max-width: calc(100% - 20px);
vertical-align: top; vertical-align: top;
*:not(p) {
font-weight: normal !important;
font-size: 14px !important;
font-style: normal !important;
text-decoration: none !important;
margin: 0 !important;
}
} }
} }
...@@ -197,8 +209,13 @@ ...@@ -197,8 +209,13 @@
color: #666666; color: #666666;
.desc-input-box { .desc-input-box {
margin-bottom: 8px; margin-bottom: 8px;
* { display: inline-block;
display: inline-block; *:not(p) {
font-weight: normal !important;
font-size: 14px !important;
font-style: normal !important;
text-decoration: none !important;
margin: 0 !important;
} }
} }
.desc-picture-box { .desc-picture-box {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment