Commit acb5ccd5 by yuananting

feat:样式调整+保存继续添加

parent 14a1f959
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-25 13:46:35 * @Date: 2021-02-25 13:46:35
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-18 11:15:19 * @LastEditTime: 2021-03-18 14:12:22
* @Description: 助学工具-题库-题目管理-新增题目 * @Description: 助学工具-题库-题目管理-新增题目
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -12,7 +12,7 @@ import Breadcrumbs from "@/components/Breadcrumbs"; ...@@ -12,7 +12,7 @@ import Breadcrumbs from "@/components/Breadcrumbs";
import ShowTips from "@/components/ShowTips"; import ShowTips from "@/components/ShowTips";
import "./AddNewQuestion.less"; import "./AddNewQuestion.less";
import NewQuestionTab from "./components/NewQuestionTab"; import NewQuestionTab from "./components/NewQuestionTab";
import { defineOptionInfo, defineQuestionInfo } from "./components/model"; import { defineJudgeOptionInfo, defineOptionInfo, defineQuestionInfo } from "./components/model";
import QuestionBankService from "@/domains/question-bank-domain/QuestionBankService"; import QuestionBankService from "@/domains/question-bank-domain/QuestionBankService";
import User from "@/common/js/user"; import User from "@/common/js/user";
import UploadOss from "@/core/upload"; import UploadOss from "@/core/upload";
...@@ -37,12 +37,14 @@ class AddNewQuestion extends Component { ...@@ -37,12 +37,14 @@ class AddNewQuestion extends Component {
judgeContent: defineQuestionInfo("JUDGE"), // 判断题 judgeContent: defineQuestionInfo("JUDGE"), // 判断题
gapFillingContent: defineQuestionInfo("GAP_FILLING"), // 填空题 gapFillingContent: defineQuestionInfo("GAP_FILLING"), // 填空题
indefiniteChoiceContent: defineQuestionInfo("INDEFINITE_CHOICE"), // 不定项选择题 indefiniteChoiceContent: defineQuestionInfo("INDEFINITE_CHOICE"), // 不定项选择题
currentOperate: "new",
}; };
} }
componentDidMount() { componentDidMount() {
if (getParameterByName("id")) { if (getParameterByName("id")) {
// 编辑 // 编辑
this.setState({ currentOperate: "edit" });
this.queryQuestionDetails(); this.queryQuestionDetails();
} }
} }
...@@ -78,19 +80,29 @@ class AddNewQuestion extends Component { ...@@ -78,19 +80,29 @@ class AddNewQuestion extends Component {
}; };
handleRest = (type) => { handleRest = (type) => {
this.setState({ currentOperate: "add" });
switch (type) { switch (type) {
case "SINGLE_CHOICE": case "SINGLE_CHOICE":
this.setState({ let singleChoiceContent = defineQuestionInfo("SINGLE_CHOICE");
singleChoiceContent: defineQuestionInfo("SINGLE_CHOICE"), for (var i = 0; i < 4; i++) {
}, () => this.state.singleChoiceContent.optionList.push(defineOptionInfo())); singleChoiceContent.optionList.push(defineOptionInfo());
}
this.setState({ singleChoiceContent });
break; break;
case "MULTI_CHOICE": case "MULTI_CHOICE":
this.setState({ let multiChoiceContent = defineQuestionInfo("MULTI_CHOICE");
multiChoiceContent: defineQuestionInfo("MULTI_CHOICE"), for (var i = 0; i < 4; i++) {
}, () => this.state.multiChoiceContent.optionList.push(defineOptionInfo())); multiChoiceContent.optionList.push(defineOptionInfo());
}
this.setState({ multiChoiceContent });
break; break;
case "JUDGE": case "JUDGE":
this.setState({ judgeContent: defineQuestionInfo("JUDGE") }); let judgeContent = defineQuestionInfo("JUDGE");
var judgeOptions = ["正确", "错误"];
judgeOptions.forEach(item=>{
judgeContent.optionList.push(defineJudgeOptionInfo(item));
})
this.setState({ judgeContent });
break; break;
case "GAP_FILLING": case "GAP_FILLING":
this.setState({ this.setState({
...@@ -98,10 +110,11 @@ class AddNewQuestion extends Component { ...@@ -98,10 +110,11 @@ class AddNewQuestion extends Component {
}); });
break; break;
case "INDEFINITE_CHOICE": case "INDEFINITE_CHOICE":
this.setState({ let indefiniteChoiceContent = defineQuestionInfo("INDEFINITE_CHOICE");
indefiniteChoiceContent: defineQuestionInfo("INDEFINITE_CHOICE"), for (var i = 0; i < 4; i++) {
}, () => this.state.indefiniteChoiceContent.optionList.push(defineOptionInfo())); indefiniteChoiceContent.optionList.push(defineOptionInfo());
break; }
this.setState({ indefiniteChoiceContent });
} }
}; };
...@@ -127,8 +140,7 @@ class AddNewQuestion extends Component { ...@@ -127,8 +140,7 @@ class AddNewQuestion extends Component {
}); });
let params = {}; let params = {};
let categoryId = getParameterByName("categoryId"); let categoryId = getParameterByName("categoryId");
if (getParameterByName("id") && this.state.currentOperate === "edit") {
if (getParameterByName("id")) {
params = { params = {
...content, ...content,
id: getParameterByName("id"), id: getParameterByName("id"),
...@@ -142,10 +154,10 @@ class AddNewQuestion extends Component { ...@@ -142,10 +154,10 @@ class AddNewQuestion extends Component {
if (res.success) { if (res.success) {
message.success("保存成功"); message.success("保存成功");
if (next === "add") { if (next === "add") {
// this.handleRest(type); this.handleRest(type);
window.RCHistory.push({ // window.RCHistory.push({
pathname: `/create-new-question?categoryId=${params.categoryId}&key=${type}`, // pathname: `/create-new-question?categoryId=${params.categoryId}&key=${type}`,
}); // });
} }
if (next === "close") { if (next === "close") {
window.RCHistory.push({ window.RCHistory.push({
...@@ -166,9 +178,7 @@ class AddNewQuestion extends Component { ...@@ -166,9 +178,7 @@ class AddNewQuestion extends Component {
if (res.success) { if (res.success) {
message.success("保存成功"); message.success("保存成功");
if (next === "add") { if (next === "add") {
window.RCHistory.push({ this.handleRest(type);
pathname: `/create-new-question?categoryId=${params.categoryId}&key=${type}`,
});
} }
if (next === "close") { if (next === "close") {
window.RCHistory.push({ window.RCHistory.push({
...@@ -254,7 +264,7 @@ class AddNewQuestion extends Component { ...@@ -254,7 +264,7 @@ class AddNewQuestion extends Component {
return ( return (
<div className="page add-new-question"> <div className="page add-new-question">
<Breadcrumbs <Breadcrumbs
navList={getParameterByName("id") ? "编辑题目" : "新增题目"} navList={getParameterByName("id") && this.state.currentOperate==="edit" ? "编辑题目" : "新增题目"}
goBack={() => this.handleGoBack()} goBack={() => this.handleGoBack()}
/> />
<div className="box"> <div className="box">
...@@ -279,7 +289,6 @@ class AddNewQuestion extends Component { ...@@ -279,7 +289,6 @@ class AddNewQuestion extends Component {
}} }}
questionInfo={singleChoiceContent} questionInfo={singleChoiceContent}
onSetState={(newContent) => { onSetState={(newContent) => {
console.log("newContent:", newContent);
Object.assign(singleChoiceContent, newContent); Object.assign(singleChoiceContent, newContent);
}} }}
onLogger={this.handleLogger} onLogger={this.handleLogger}
...@@ -328,7 +337,6 @@ class AddNewQuestion extends Component { ...@@ -328,7 +337,6 @@ class AddNewQuestion extends Component {
questionInfo={gapFillingContent} questionInfo={gapFillingContent}
onSetState={(newContent) => { onSetState={(newContent) => {
Object.assign(gapFillingContent, newContent); Object.assign(gapFillingContent, newContent);
console.log("gapFillingContent:", newContent);
}} }}
/> />
</TabPane> </TabPane>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-23 19:41:42 * @Date: 2021-02-23 19:41:42
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-18 09:32:37 * @LastEditTime: 2021-03-18 13:58:30
* @Description: 助学工具-题库-题目分类管理样式 * @Description: 助学工具-题库-题目分类管理样式
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -53,10 +53,11 @@ ...@@ -53,10 +53,11 @@
} }
} }
} }
// .ant-tree-treenode-selected:hover::before, .ant-tree-treenode-selected:hover::before,
// .ant-tree-treenode-selected::before { .ant-tree-treenode-selected::before {
// background: rgb(255 251 240); background: #ffb714;
// } opacity: 0.06;
}
} }
} }
.xm-show-tip { .xm-show-tip {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-25 14:34:29 * @Date: 2021-02-25 14:34:29
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-18 11:03:21 * @LastEditTime: 2021-03-18 14:11:46
* @Description: 助学工具-题库-题目管理-新建题目Tab * @Description: 助学工具-题库-题目管理-新建题目Tab
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -23,7 +23,6 @@ import XMRecord from "./XMRecord"; ...@@ -23,7 +23,6 @@ import XMRecord from "./XMRecord";
import ScanFileModal from "@/modules/resource-disk/modal/ScanFileModal"; import ScanFileModal from "@/modules/resource-disk/modal/ScanFileModal";
import SelectPrepareFileModal from "@/modules/prepare-lesson/modal/SelectPrepareFileModal"; import SelectPrepareFileModal from "@/modules/prepare-lesson/modal/SelectPrepareFileModal";
import _ from "lodash"; import _ from "lodash";
import UploadOss from "@/core/upload";
class NewQuestionTab extends Component { class NewQuestionTab extends Component {
constructor(props) { constructor(props) {
...@@ -84,7 +83,6 @@ class NewQuestionTab extends Component { ...@@ -84,7 +83,6 @@ class NewQuestionTab extends Component {
}; };
static getDerivedStateFromProps(nextProps, prevState) { static getDerivedStateFromProps(nextProps, prevState) {
console.log("nextProps:", nextProps)
// 控制录音组件展示 // 控制录音组件展示
if (nextProps.showBox && !prevState.showBox) { if (nextProps.showBox && !prevState.showBox) {
return { return {
...@@ -100,22 +98,9 @@ class NewQuestionTab extends Component { ...@@ -100,22 +98,9 @@ class NewQuestionTab extends Component {
shouldComponentUpdate(nextProps, nextState) { shouldComponentUpdate(nextProps, nextState) {
const { questionInfo } = nextProps; const { questionInfo } = nextProps;
if (this.props.questionInfo !== questionInfo) { if (this.props.questionInfo !== questionInfo) {
console.log("*********改变了:", questionInfo) this.setState({
this.setState( stemContent: JSON.parse(JSON.stringify(questionInfo.questionStemList)),
{ }); // 题干内容
stemContent: JSON.parse(
JSON.stringify(questionInfo.questionStemList)
),
},
() => {
const editorHtml = this.transferStemDocument(
questionInfo.questionStemList[0].content
);
const _blanksList = editorHtml.getElementsByClassName("fill-line");
// this.setState({blanksList:_blanksList})
console.log("转:", editorHtml.getElementsByClassName("fill-line"));
}
); // 题干内容
this.setState({ this.setState({
chooseOptions: JSON.parse(JSON.stringify(questionInfo.optionList)), chooseOptions: JSON.parse(JSON.stringify(questionInfo.optionList)),
}); // 单选多选不定项-选项列表 }); // 单选多选不定项-选项列表
...@@ -217,7 +202,7 @@ class NewQuestionTab extends Component { ...@@ -217,7 +202,7 @@ class NewQuestionTab extends Component {
if ( if (
optionContent.length === 1 && optionContent.length === 1 &&
optionContent[0].type === "RICH_TEXT" && optionContent[0].type === "RICH_TEXT" &&
optionContent[0].content.length === 0 optionContent[0].textLength === 0
) { ) {
this.setState({ [`optionsValidate_${index}`]: "error" }); this.setState({ [`optionsValidate_${index}`]: "error" });
this.setState({ [`optionsText_${index}`]: "请输入选项" }); this.setState({ [`optionsText_${index}`]: "请输入选项" });
...@@ -328,8 +313,8 @@ class NewQuestionTab extends Component { ...@@ -328,8 +313,8 @@ class NewQuestionTab extends Component {
const voiceMediaArr = _.filter(uploadItemTarget, (mediaItem) => { const voiceMediaArr = _.filter(uploadItemTarget, (mediaItem) => {
return mediaItem.type === "VOICE"; return mediaItem.type === "VOICE";
}); });
const recordMediaArr = _.filter(uploadItemTarget, (mediaItem) => { const audioMediaArr = _.filter(uploadItemTarget, (mediaItem) => {
return mediaItem.type === "RECORD"; return mediaItem.type === "AUDIO";
}); });
const videodMediaArr = _.filter(uploadItemTarget, (mediaItem) => { const videodMediaArr = _.filter(uploadItemTarget, (mediaItem) => {
return mediaItem.type === "VIDEO"; return mediaItem.type === "VIDEO";
...@@ -343,8 +328,8 @@ class NewQuestionTab extends Component { ...@@ -343,8 +328,8 @@ class NewQuestionTab extends Component {
if (voiceMediaArr.length > 0) { if (voiceMediaArr.length > 0) {
existType.push("VOICE"); existType.push("VOICE");
} }
if (recordMediaArr.length > 0) { if (audioMediaArr.length > 0) {
existType.push("RECORD"); existType.push("AUDIO");
} }
if (videodMediaArr.length > 0) { if (videodMediaArr.length > 0) {
existType.push("VIDEO"); existType.push("VIDEO");
...@@ -371,8 +356,8 @@ class NewQuestionTab extends Component { ...@@ -371,8 +356,8 @@ class NewQuestionTab extends Component {
if (voiceMediaArr.length > 0) { if (voiceMediaArr.length > 0) {
existType.push("VOICE"); existType.push("VOICE");
} }
if (recordMediaArr.length > 0) { if (audioMediaArr.length > 0) {
existType.push("RECORD"); existType.push("AUDIO");
} }
if (videodMediaArr.length > 0) { if (videodMediaArr.length > 0) {
existType.push("VIDEO"); existType.push("VIDEO");
...@@ -389,8 +374,8 @@ class NewQuestionTab extends Component { ...@@ -389,8 +374,8 @@ class NewQuestionTab extends Component {
if (voiceMediaArr.length > 0) { if (voiceMediaArr.length > 0) {
existType.push("VOICE"); existType.push("VOICE");
} }
if (recordMediaArr.length > 0) { if (audioMediaArr.length > 0) {
existType.push("RECORD"); existType.push("AUDIO");
} }
if (videodMediaArr.length > 0) { if (videodMediaArr.length > 0) {
existType.push("VIDEO"); existType.push("VIDEO");
...@@ -404,7 +389,7 @@ class NewQuestionTab extends Component { ...@@ -404,7 +389,7 @@ class NewQuestionTab extends Component {
if (key === "VOICE" && voiceMediaArr.length > 2) { if (key === "VOICE" && voiceMediaArr.length > 2) {
return message.warning("只能添加3个音频"); return message.warning("只能添加3个音频");
} }
if (key === "RECORD" && recordMediaArr.length > 2) { if (key === "AUDIO" && audioMediaArr.length > 2) {
return message.warning("只能添加3个录音"); return message.warning("只能添加3个录音");
} }
if (key === "VIDEO" && videodMediaArr.length > 2) { if (key === "VIDEO" && videodMediaArr.length > 2) {
...@@ -427,13 +412,13 @@ class NewQuestionTab extends Component { ...@@ -427,13 +412,13 @@ class NewQuestionTab extends Component {
}, },
() => { () => {
this.uploadInput.current.value = ""; this.uploadInput.current.value = "";
this.setState({ showSelectFileModal: key !== "RECORD" }); this.setState({ showSelectFileModal: key !== "AUDIO" });
// this.uploadInput.current.click(); // this.uploadInput.current.click();
} }
); );
// 录音 // 录音
if (key === "RECORD") { if (key === "AUDIO") {
this.setState({ this.setState({
showRecord: true, showRecord: true,
}); });
...@@ -686,8 +671,8 @@ class NewQuestionTab extends Component { ...@@ -686,8 +671,8 @@ class NewQuestionTab extends Component {
const voiceMediaList = _.filter(contentList, (mediaItem) => { const voiceMediaList = _.filter(contentList, (mediaItem) => {
return mediaItem.type === "VOICE"; return mediaItem.type === "VOICE";
}); });
const recordMediaList = _.filter(contentList, (mediaItem) => { const audioMediaList = _.filter(contentList, (mediaItem) => {
return mediaItem.type === "RECORD"; return mediaItem.type === "AUDIO";
}); });
const videoMediaList = _.filter(contentList, (mediaItem) => { const videoMediaList = _.filter(contentList, (mediaItem) => {
return mediaItem.type === "VIDEO"; return mediaItem.type === "VIDEO";
...@@ -768,26 +753,26 @@ class NewQuestionTab extends Component { ...@@ -768,26 +753,26 @@ class NewQuestionTab extends Component {
})} })}
</div> </div>
)} )}
{recordMediaList.length > 0 && ( {audioMediaList.length > 0 && (
<div className="desc-audio-box"> <div className="desc-audio-box">
{_.map(recordMediaList, (recordItem, recordIndex) => { {_.map(audioMediaList, (audioItem, audioIndex) => {
let { content, status, size } = recordItem; let { content, status, size } = audioItem;
if (["init", "fail"].includes(status)) { if (["init", "fail"].includes(status)) {
return ( return (
<div className="mt12" key={recordIndex}> <div className="mt12" key={audioIndex}>
<UploadingProgress <UploadingProgress
fileDesc={recordItem} fileDesc={audioItem}
canCancelUpload canCancelUpload
onReupload={() => this.handleReupload(recordItem)} onReupload={() => this.handleReupload(audioItem)}
onAbort={() => onAbort={() =>
this.handleAbort(recordItem, recordIndex) this.handleAbort(audioItem, audioIndex)
} }
/> />
</div> </div>
); );
} else { } else {
return ( return (
<div className="audio-box" key={recordIndex}> <div className="audio-box" key={audioIndex}>
<XMAudio <XMAudio
forbidParse forbidParse
url={content} url={content}
...@@ -795,14 +780,14 @@ class NewQuestionTab extends Component { ...@@ -795,14 +780,14 @@ class NewQuestionTab extends Component {
size = durationSize; size = durationSize;
this.setState({}); this.setState({});
}} }}
index={recordIndex} index={audioIndex}
size={size || 1000} size={size || 1000}
/> />
<span <span
className="icon_sider iconfont" className="icon_sider iconfont"
onClick={() => { onClick={() => {
contentList.map((item, index) => { contentList.map((item, index) => {
if (item.contentName === recordItem.contentName) { if (item.contentName === audioItem.contentName) {
contentList.splice(index, 1); contentList.splice(index, 1);
return item; return item;
} }
...@@ -962,7 +947,7 @@ class NewQuestionTab extends Component { ...@@ -962,7 +947,7 @@ class NewQuestionTab extends Component {
</div> </div>
); );
break; break;
case "RECORD": case "AUDIO":
dom = ( dom = (
<div className="audio-box"> <div className="audio-box">
<XMAudio <XMAudio
...@@ -1089,7 +1074,7 @@ class NewQuestionTab extends Component { ...@@ -1089,7 +1074,7 @@ class NewQuestionTab extends Component {
const { uploadItemTarget, contentType } = this.state; const { uploadItemTarget, contentType } = this.state;
uploadItemTarget.push({ uploadItemTarget.push({
contentType, contentType,
type: "RECORD", type: "AUDIO",
contentName: `${window.random_string(16)}.${originType}`, // 文件名 contentName: `${window.random_string(16)}.${originType}`, // 文件名
fileType: originType, // 文件后缀 fileType: originType, // 文件后缀
content: mp3URL, content: mp3URL,
...@@ -1177,7 +1162,7 @@ class NewQuestionTab extends Component { ...@@ -1177,7 +1162,7 @@ class NewQuestionTab extends Component {
{this.renderContent( {this.renderContent(
stemContent, stemContent,
placehold, placehold,
["VOICE", "RECORD", "PICTURE"], ["VOICE", "AUDIO", "PICTURE"],
"QUESTION_STEM", "QUESTION_STEM",
stemValidate stemValidate
)} )}
...@@ -1237,7 +1222,7 @@ class NewQuestionTab extends Component { ...@@ -1237,7 +1222,7 @@ class NewQuestionTab extends Component {
questionOptionContentList questionOptionContentList
); );
optionItem.optionSort = optionIndex; optionItem.optionSort = optionIndex;
const mediaBtn = ["VOICE", "RECORD", "PICTURE"]; const mediaBtn = ["VOICE", "AUDIO", "PICTURE"];
const placeHold = const placeHold =
"必填(1000字以内,可粘贴小图;可以不输入文字,只添加音频或图片)"; "必填(1000字以内,可粘贴小图;可以不输入文字,只添加音频或图片)";
return ( return (
...@@ -1366,7 +1351,7 @@ class NewQuestionTab extends Component { ...@@ -1366,7 +1351,7 @@ class NewQuestionTab extends Component {
{this.renderContent( {this.renderContent(
questionAnswerDesc, questionAnswerDesc,
"1000字以内,可粘贴小图", "1000字以内,可粘贴小图",
["VOICE", "RECORD", "PICTURE", "VIDEO"], ["VOICE", "AUDIO", "PICTURE", "VIDEO"],
"QUESTION_ANSWER_DESC" "QUESTION_ANSWER_DESC"
)} )}
</div> </div>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-22 12:02:34 * @Date: 2021-02-22 12:02:34
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-18 09:34:06 * @LastEditTime: 2021-03-18 13:59:24
* @Description: 助学工具-题库-题库主页面侧边栏样式 * @Description: 助学工具-题库-题库主页面侧边栏样式
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -54,6 +54,11 @@ ...@@ -54,6 +54,11 @@
color: #666666; color: #666666;
} }
} }
.ant-tree-treenode-selected:hover::before,
.ant-tree-treenode-selected::before {
background: #ffb714;
opacity: 0.06;
}
} }
} }
} }
...@@ -12,7 +12,7 @@ const MEDIA_MAP = [ ...@@ -12,7 +12,7 @@ const MEDIA_MAP = [
{ {
title: "录音", title: "录音",
icon: <React.Fragment>&#xe7bb;</React.Fragment>, icon: <React.Fragment>&#xe7bb;</React.Fragment>,
key: "RECORD", key: "AUDIO",
}, },
{ {
title: "图片", title: "图片",
...@@ -233,7 +233,7 @@ class QuestionEditor extends Component { ...@@ -233,7 +233,7 @@ class QuestionEditor extends Component {
} = this.state; } = this.state;
const { const {
placehold, placehold,
mediaBtn = ["VOICE", "RECORD", "PICTURE", "VIDEO"], mediaBtn = ["VOICE", "AUDIO", "PICTURE", "VIDEO"],
limitLength = 1000, limitLength = 1000,
markKey, markKey,
} = this.props; } = this.props;
......
...@@ -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-03-18 10:24:47 * @LastEditTime: 2021-03-18 14:21:22
* @Description: 助学工具-题库-题目管理主页面列表数据 * @Description: 助学工具-题库-题目管理主页面列表数据
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -69,7 +69,7 @@ class QuestionManageContent extends Component { ...@@ -69,7 +69,7 @@ class QuestionManageContent extends Component {
query: { query: {
current: 1, current: 1,
size: 10, size: 10,
order: "ACCURACY_DESC", // 排序规则[ ACCURACY_DESC, ACCURACY_ASC, CREATED_DESC, CREATED_ASC, UPDATED_DESC, UPDATED_ASC ] order: "UPDATED_DESC", // 排序规则[ ACCURACY_DESC, ACCURACY_ASC, CREATED_DESC, CREATED_ASC, UPDATED_DESC, UPDATED_ASC ]
categoryId: null, // 当前题库分类Id categoryId: null, // 当前题库分类Id
questionName: null, // 题目名称 questionName: null, // 题目名称
questionType: null, // 题目类型 questionType: null, // 题目类型
......
...@@ -87,8 +87,8 @@ class QuestionPreviewModal extends Component { ...@@ -87,8 +87,8 @@ class QuestionPreviewModal extends Component {
const voiceDescList = _.filter(questionAnswerDescList, (descItem) => { const voiceDescList = _.filter(questionAnswerDescList, (descItem) => {
return descItem.type === "VOICE"; return descItem.type === "VOICE";
}); });
const recordDescList = _.filter(questionAnswerDescList, (descItem) => { const audioDescList = _.filter(questionAnswerDescList, (descItem) => {
return descItem.type === "RECORD"; return descItem.type === "AUDIO";
}); });
const videoDeacList = _.filter(questionAnswerDescList, (descItem) => { const videoDeacList = _.filter(questionAnswerDescList, (descItem) => {
return descItem.type === "VIDEO"; return descItem.type === "VIDEO";
...@@ -327,12 +327,12 @@ class QuestionPreviewModal extends Component { ...@@ -327,12 +327,12 @@ class QuestionPreviewModal extends Component {
})} })}
</div> </div>
)} )}
{recordDescList.length > 0 && ( {audioDescList.length > 0 && (
<div className="desc-audio-box"> <div className="desc-audio-box">
{_.map(recordDescList, (recordItem, recordIndex) => { {_.map(audioDescList, (audioItem, audioIndex) => {
let { content, size } = recordItem; let { content, size } = audioItem;
return ( return (
<div className="audio-box" key={recordIndex}> <div className="audio-box" key={audioIndex}>
<XMAudio <XMAudio
forbidParse forbidParse
url={content} url={content}
...@@ -340,7 +340,7 @@ class QuestionPreviewModal extends Component { ...@@ -340,7 +340,7 @@ class QuestionPreviewModal extends Component {
size = durationSize; size = durationSize;
this.setState({}); this.setState({});
}} }}
index={recordIndex} index={audioIndex}
size={size || 1000} size={size || 1000}
/> />
</div> </div>
......
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