|
@@ -17,7 +17,10 @@ import { My } from '../../../stores/my';
|
|
|
const columns = [
|
|
|
{ key: 'question_type', title: '题型', fixSort: true },
|
|
|
{ key: 'title', title: '题目ID', fixSort: true },
|
|
|
- { key: 'description', title: '内容' },
|
|
|
+ {
|
|
|
+ key: 'description',
|
|
|
+ title: '内容',
|
|
|
+ },
|
|
|
{ key: 'time', title: '耗时', sort: true },
|
|
|
{ key: 'correct', title: '错误率', sort: true },
|
|
|
{ key: 'latest_time', title: '最近做题' },
|
|
@@ -51,7 +54,7 @@ export default class extends Page {
|
|
|
timerange: 'today',
|
|
|
filterMap: {},
|
|
|
sortMap: {},
|
|
|
- data: [{}, {}],
|
|
|
+ list: [{}, {}],
|
|
|
selectList: [],
|
|
|
allChecked: false,
|
|
|
showDetail: false,
|
|
@@ -79,22 +82,34 @@ export default class extends Page {
|
|
|
|
|
|
refreshQuestion(data) {
|
|
|
const [startTime, endTime] = timeRange(data.timerange);
|
|
|
- refreshQuestionType(this, data.subject, data.questionType, { all: true, needSentence: true, allSubject: true })
|
|
|
- .then(({ questionTypes }) => {
|
|
|
- return refreshStruct(this, data.tab, data.one, data.two, {
|
|
|
- all: true, needPreview: false, needTextbook: true,
|
|
|
- })
|
|
|
- .then(({ structIds, latest, year }) => {
|
|
|
- My.listQuestionCollect(Object.assign({ module: data.tab, questionTypes, structIds, latest, year, startTime, endTime }, this.state.search, {
|
|
|
- order: Object.keys(data.sortMap).map(key => {
|
|
|
- if (key === 'title') return 'pid desc, no desc';
|
|
|
- return `${key} ${data.sortMap[key]}`;
|
|
|
- }).join(','),
|
|
|
- })).then(result => {
|
|
|
- this.setState({ list: result.list, total: result.total });
|
|
|
- });
|
|
|
- });
|
|
|
+ refreshQuestionType(this, data.subject, data.questionType, {
|
|
|
+ all: true,
|
|
|
+ needSentence: true,
|
|
|
+ allSubject: true,
|
|
|
+ }).then(({ questionTypes }) => {
|
|
|
+ return refreshStruct(this, data.tab, data.one, data.two, {
|
|
|
+ all: true,
|
|
|
+ needPreview: false,
|
|
|
+ needTextbook: true,
|
|
|
+ }).then(({ structIds, latest, year }) => {
|
|
|
+ My.listQuestionCollect(
|
|
|
+ Object.assign(
|
|
|
+ { module: data.tab, questionTypes, structIds, latest, year, startTime, endTime },
|
|
|
+ this.state.search,
|
|
|
+ {
|
|
|
+ order: Object.keys(data.sortMap)
|
|
|
+ .map(key => {
|
|
|
+ if (key === 'title') return 'pid desc, no desc';
|
|
|
+ return `${key} ${data.sortMap[key]}`;
|
|
|
+ })
|
|
|
+ .join(','),
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ).then(result => {
|
|
|
+ this.setState({ list: result.list, total: result.total });
|
|
|
+ });
|
|
|
});
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
refreshArticle(data) {
|
|
@@ -138,7 +153,7 @@ export default class extends Page {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- onAction() { }
|
|
|
+ onAction() {}
|
|
|
|
|
|
onSelect(selectList) {
|
|
|
this.setState({ selectList });
|
|
@@ -171,40 +186,58 @@ export default class extends Page {
|
|
|
}
|
|
|
|
|
|
renderTabquestion() {
|
|
|
- const { questionSubjectSelect, questionSubjectMap = {}, oneSelect, twoSelectMap = {}, filterMap = {}, sortMap = {}, list = [] } = this.state;
|
|
|
+ const {
|
|
|
+ questionSubjectSelect,
|
|
|
+ questionSubjectMap = {},
|
|
|
+ oneSelect,
|
|
|
+ twoSelectMap = {},
|
|
|
+ filterMap = {},
|
|
|
+ sortMap = {},
|
|
|
+ list = [],
|
|
|
+ } = this.state;
|
|
|
const { selectList = [], allChecked, page, total } = this.state;
|
|
|
return (
|
|
|
<div className="tab-1-layout">
|
|
|
<UserAction
|
|
|
search
|
|
|
- selectList={[{
|
|
|
- children: [{
|
|
|
- key: 'subject',
|
|
|
- placeholder: '学科',
|
|
|
- select: questionSubjectSelect,
|
|
|
- }, {
|
|
|
- placeholder: '题型',
|
|
|
- key: 'questionType',
|
|
|
- be: 'subject',
|
|
|
- selectMap: questionSubjectMap,
|
|
|
- }],
|
|
|
- }, {
|
|
|
- label: '范围',
|
|
|
- children: [{
|
|
|
- key: 'one',
|
|
|
- placeholder: '全部',
|
|
|
- select: oneSelect,
|
|
|
- }, {
|
|
|
- key: 'two',
|
|
|
- be: 'one',
|
|
|
- placeholder: '全部',
|
|
|
- selectMap: twoSelectMap,
|
|
|
- }],
|
|
|
- }, {
|
|
|
- right: true,
|
|
|
- key: 'timerange',
|
|
|
- select: TimeRange,
|
|
|
- }]}
|
|
|
+ selectList={[
|
|
|
+ {
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ key: 'subject',
|
|
|
+ placeholder: '学科',
|
|
|
+ select: questionSubjectSelect,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ placeholder: '题型',
|
|
|
+ key: 'questionType',
|
|
|
+ be: 'subject',
|
|
|
+ selectMap: questionSubjectMap,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '范围',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ key: 'one',
|
|
|
+ placeholder: '全部',
|
|
|
+ select: oneSelect,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'two',
|
|
|
+ be: 'one',
|
|
|
+ placeholder: '全部',
|
|
|
+ selectMap: twoSelectMap,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ right: true,
|
|
|
+ key: 'timerange',
|
|
|
+ select: TimeRange,
|
|
|
+ },
|
|
|
+ ]}
|
|
|
filterMap={filterMap}
|
|
|
onFilter={value => this.onFilter(value)}
|
|
|
/>
|
|
@@ -278,7 +311,7 @@ export default class extends Page {
|
|
|
renderModal() {
|
|
|
return [
|
|
|
<ArticleDetail show={this.state.showDetail} onClose={() => this.setState({ showDetail: false })} />,
|
|
|
- <Modal title="操作提示" confirmText="好的,知道了" btnAlign="center" onConfirm={() => { }}>
|
|
|
+ <Modal title="操作提示" confirmText="好的,知道了" btnAlign="center" onConfirm={() => {}}>
|
|
|
<div className="flex-layout m-b-2">
|
|
|
<div className="flex-block">
|
|
|
<div className="t-1 t-s-18">组卷功能</div>
|
|
@@ -298,10 +331,10 @@ export default class extends Page {
|
|
|
查阅以上信息。
|
|
|
</div>
|
|
|
</Modal>,
|
|
|
- <Modal title="组卷练习" confirmText="好的,知道了" btnAlign="center" onConfirm={() => { }}>
|
|
|
+ <Modal title="组卷练习" confirmText="好的,知道了" btnAlign="center" onConfirm={() => {}}>
|
|
|
<div className="t-2 t-s-18">不可同时选中语文题和数学题,请重新选择。</div>
|
|
|
</Modal>,
|
|
|
- <Modal title="组卷练习" confirmText="开始练习" onConfirm={() => { }} onCancel={() => { }}>
|
|
|
+ <Modal title="组卷练习" confirmText="开始练习" onConfirm={() => {}} onCancel={() => {}}>
|
|
|
<div className="t-2 t-s-18">
|
|
|
您共选择了 <span className="t-4">50</span> 道题目,是否开始练习?
|
|
|
</div>
|
|
@@ -315,15 +348,15 @@ export default class extends Page {
|
|
|
次以上的错题
|
|
|
</div>
|
|
|
</Modal>,
|
|
|
- <Modal title="移出" onConfirm={() => { }} onCancel={() => { }}>
|
|
|
+ <Modal title="移出" onConfirm={() => {}} onCancel={() => {}}>
|
|
|
<div className="t-2 t-s-18">
|
|
|
当前选中的 <span className="t-4">50</span> 道题即将被移出错题本,移出后无法恢复,是否继续?
|
|
|
</div>
|
|
|
</Modal>,
|
|
|
- <Modal title="导出" confirmText="好的,知道了" btnAlign="center" onConfirm={() => { }}>
|
|
|
+ <Modal title="导出" confirmText="好的,知道了" btnAlign="center" onConfirm={() => {}}>
|
|
|
<div className="t-2 t-s-18">正在下载中,请不要关闭当前页面!</div>
|
|
|
</Modal>,
|
|
|
- <Modal title="导出" confirmText="导出" onConfirm={() => { }} onCancel={() => { }}>
|
|
|
+ <Modal title="导出" confirmText="导出" onConfirm={() => {}} onCancel={() => {}}>
|
|
|
<div className="t-2 t-s-18 m-b-5">
|
|
|
当前共选中 <span className="t-4">50</span> 道题,请确认需要导出的内容:
|
|
|
</div>
|
|
@@ -338,7 +371,7 @@ export default class extends Page {
|
|
|
})}
|
|
|
</div>
|
|
|
</Modal>,
|
|
|
- <Modal title="导出" confirmText="导出" onConfirm={() => { }} onCancel={() => { }}>
|
|
|
+ <Modal title="导出" confirmText="导出" onConfirm={() => {}} onCancel={() => {}}>
|
|
|
<div className="t-2 t-s-18 m-b-5">
|
|
|
当前共选中 <span className="t-4">50</span> 道题,请确认需要导出的内容:
|
|
|
</div>
|