page.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. import React from 'react';
  2. // import { Link } from 'react-router-dom';
  3. import './index.less';
  4. import { Icon, Checkbox } from 'antd';
  5. import Page from '@src/containers/Page';
  6. import Assets from '@src/components/Assets';
  7. import { timeRange, formatDate, getMap, formatSeconds, formatPercent } from '@src/services/Tools';
  8. import UserLayout from '../../../layouts/User';
  9. import UserTable from '../../../components/UserTable';
  10. import UserAction from '../../../components/UserAction';
  11. import { RealAuth, QuestionNoteModal } from '../../../components/OtherModal';
  12. import Examination from '../../../components/Examination';
  13. import VipRenew from '../../../components/VipRenew';
  14. import menu, { refreshQuestionType, refreshStruct } from '../index';
  15. import Tabs from '../../../components/Tabs';
  16. import Modal from '../../../components/Modal';
  17. import Select from '../../../components/Select';
  18. import GIcon from '../../../components/Icon';
  19. import { TimeRange, QuestionType } from '../../../../Constant';
  20. import { My } from '../../../stores/my';
  21. import { Question } from '../../../stores/question';
  22. import { User } from '../../../stores/user';
  23. const QuestionTypeMap = getMap(QuestionType, 'value', 'label');
  24. const exportType = [
  25. { key: 'question', title: '题目' },
  26. { key: 'official', title: '官方解析' },
  27. { key: 'note', title: '我的笔记' },
  28. // { key: 'qx', title: '千行解析', auth: true },
  29. // { key: 'association', title: '题源联想', auth: true },
  30. // { key: 'qa', title: '相关问答', auth: true },
  31. ];
  32. export default class extends Page {
  33. constructor(props) {
  34. props.size = 10;
  35. super(props);
  36. }
  37. initState() {
  38. return {
  39. tab: 'exercise',
  40. timerange: 'all',
  41. filterMap: {},
  42. sortMap: {},
  43. data: [{}, {}],
  44. selectList: [],
  45. allChecked: false,
  46. defaultSortMap: { latest_time: 'desc' },
  47. };
  48. }
  49. init() {
  50. this.columns = [
  51. {
  52. key: 'question_type',
  53. title: '题型',
  54. width: 115,
  55. style: { whiteSpace: 'nowrap' },
  56. render: (text, record) => {
  57. return QuestionTypeMap[record.questionType];
  58. },
  59. fixSort: true,
  60. },
  61. {
  62. key: 'title',
  63. title: '题目ID',
  64. width: 100,
  65. fixSort: true,
  66. style: { whiteSpace: 'nowrap' },
  67. render: (text, record) => {
  68. return <a href={`/paper/question/${record.id}`} target="_blank">{text}</a>;
  69. },
  70. },
  71. {
  72. key: 'description',
  73. title: '内容',
  74. width: 185,
  75. render: (text) => {
  76. return <div style={{ maxHeight: '80px', overflow: 'hidden' }}>{(text || '').replace(/&nbsp;/g, '')}</div>;
  77. },
  78. },
  79. {
  80. key: 'time',
  81. title: '耗时',
  82. width: 100,
  83. sort: true,
  84. style: { whiteSpace: 'nowrap' },
  85. render: (text, record) => {
  86. const user = Math.floor(record.stat ? record.stat.userTime / record.stat.userNumber : 0);
  87. const all = Math.floor(record.questionNo.totalNumber ? record.questionNo.totalTime / record.questionNo.totalNumber : 0);
  88. return <div className="sub">
  89. <div className="t-2 t-s-12">{user > 0 ? formatSeconds(user) : '-'}{user > 0 && <Assets height={10} width={10} name={user > all ? 'down' : 'up'} />}</div>
  90. <div className="t-6 t-s-12">全站{all > 0 ? formatSeconds(all) : '-'}</div>
  91. </div>;
  92. },
  93. },
  94. {
  95. key: 'correct',
  96. title: '错误率',
  97. width: 95,
  98. sort: true,
  99. style: { whiteSpace: 'nowrap' },
  100. render: (text, record) => {
  101. return <div className="sub">
  102. <div className="t-2 t-s-12">{record.stat ? formatPercent(record.stat.userNumber - record.stat.userCorrect, record.stat.userNumber, false) : '-'}</div>
  103. <div className="t-6 t-s-12">{record.stat ? `${record.stat.userNumber - record.stat.userCorrect}/${record.stat.userNumber}` : '-'}</div>
  104. </div>;
  105. },
  106. },
  107. {
  108. key: 'latest_time',
  109. title: '最近做题',
  110. width: 105,
  111. sort: true,
  112. style: { whiteSpace: 'nowrap' },
  113. render: (text) => {
  114. return <div className="sub">
  115. <div className="t-2 t-s-12">{text.split(' ')[0]}</div>
  116. <div className="t-6 t-s-12">{text.split(' ')[1]}</div>
  117. </div>;
  118. },
  119. },
  120. {
  121. key: '',
  122. title: '',
  123. width: 70,
  124. style: { whiteSpace: 'nowrap' },
  125. render: (text, record, index) => {
  126. return <div style={{ whiteSpace: 'nowrap' }}><GIcon name="star" active={record.collect} className="m-r-5" onClick={() => this.toggleCollect(index)} /><GIcon name="note" active={record.note} onClick={() => this.note(index)} /></div>;
  127. },
  128. },
  129. ];
  130. }
  131. initData() {
  132. const data = Object.assign(this.state, this.state.search);
  133. console.log(data);
  134. data.filterMap = this.state.search;
  135. if (data.order) {
  136. data.sortMap = { [data.order]: data.direction };
  137. } else if (data.order !== null && data.order !== '') {
  138. data.sortMap = Object.assign({}, this.state.defaultSortMap);
  139. }
  140. if (data.timerange) {
  141. data.filterMap.timerange = data.timerange;
  142. }
  143. const { info = {} } = this.props.user;
  144. if (info.latestError) {
  145. // 获取最后一次错题记录
  146. Question.baseReport(info.latestError).then(result => {
  147. this.setState({ latest: result });
  148. });
  149. }
  150. const [startTime, endTime] = timeRange(data.timerange);
  151. refreshQuestionType(this, data.subject, data.questionType, {
  152. all: true,
  153. needSentence: data.tab !== 'examination',
  154. allSubject: true,
  155. }).then(({ questionTypes, selectSentence }) => {
  156. return refreshStruct(this, questionTypes, data.tab, data.one, data.two, {
  157. all: true,
  158. needPreview: true,
  159. needTextbook: true,
  160. selectSentence,
  161. }).then(({ courseModules, structIds, latest, year }) => {
  162. My.listError(
  163. Object.assign(
  164. { module: data.tab, questionTypes, courseModules, structIds, latest, year, startTime, endTime },
  165. this.state.search,
  166. {
  167. order: Object.keys(data.sortMap)
  168. .map(key => {
  169. if (key === 'title') return 'pid asc, no asc';
  170. return `${key} ${data.sortMap[key]}`;
  171. })
  172. .join(','),
  173. },
  174. ),
  175. ).then(result => {
  176. result.list = result.list.map(row => {
  177. row.questionNo = row.questionNo || {};
  178. row.key = row.questionNoId;
  179. row.questionType = row.question.questionType;
  180. row.title = row.questionNo.title;
  181. row.description = row.question.description;
  182. row.latest_time = row.latestTime ? formatDate(row.latestTime, 'YYYY-MM-DD HH:mm:ss') : '';
  183. return row;
  184. });
  185. const { selectList, allChecked, selectPage } = this.updateSelectInfo(data.page, result.list);
  186. this.setState({ list: result.list, total: result.total, selectList, allChecked, selectPage });
  187. });
  188. });
  189. });
  190. }
  191. updateSelectInfo(page, list, selectList = null) {
  192. const { selectPage = {} } = this.state;
  193. let allChecked = false;
  194. if (selectList == null) {
  195. selectList = [];
  196. if (selectPage[Number(page)]) {
  197. selectList = selectPage[Number(page)];
  198. }
  199. } else {
  200. selectPage[Number(page)] = selectList;
  201. }
  202. allChecked = list.filter(row => selectList.indexOf(row.key) >= 0).length === list.length && list.length > 0;
  203. return { selectList, allChecked, selectPage };
  204. }
  205. toggleCollect(index) {
  206. const { list } = this.state;
  207. const userQuestion = list[index];
  208. if (!userQuestion.collect) {
  209. My.addQuestionCollect(userQuestion.questionNo.id).then(() => {
  210. userQuestion.collect = true;
  211. this.setState({ list });
  212. });
  213. } else {
  214. My.delQuestionCollect(userQuestion.questionNo.id).then(() => {
  215. userQuestion.collect = false;
  216. this.setState({ list });
  217. });
  218. }
  219. }
  220. note(index) {
  221. const { list } = this.state;
  222. const userQuestion = list[index];
  223. const { questionNo } = userQuestion;
  224. My.getQuestionNote(questionNo.id)
  225. .then(result => {
  226. this.setState({ questionNo, note: result || {}, showNote: true, index });
  227. });
  228. }
  229. onTabChange(tab) {
  230. const data = { tab };
  231. this.refreshQuery(data);
  232. }
  233. onFilter(value) {
  234. this.search(value, false);
  235. this.initData();
  236. }
  237. onSearch(value) {
  238. this.search({ page: 1, keyword: value }, false);
  239. this.initData();
  240. }
  241. onSort(value) {
  242. const keys = Object.keys(value);
  243. const { sortMap, defaultSortMap } = this.state;
  244. const index = keys.length > 1 && sortMap[keys[0]] ? 1 : 0;
  245. let order = keys.length && value[keys[index]] ? keys[index] : null;
  246. let direction = keys.length ? value[keys[index]] : null;
  247. if (order == null) {
  248. const [prevOrder] = Object.keys(sortMap);
  249. console.log(prevOrder, defaultSortMap[prevOrder]);
  250. if (!defaultSortMap[prevOrder]) {
  251. [order] = Object.keys(defaultSortMap);
  252. direction = defaultSortMap[order];
  253. }
  254. }
  255. this.search({ order, direction }, false);
  256. this.initData();
  257. }
  258. onChangePage(page) {
  259. this.search({ page }, false);
  260. this.initData();
  261. }
  262. onAll(checked) {
  263. const { selectPage = {}, search = {} } = this.state;
  264. let { selectList } = this.state;
  265. const { page } = search;
  266. const { list = [] } = this.state;
  267. if (checked) {
  268. list.forEach(item => {
  269. if (selectList.indexOf(item.key) >= 0) return;
  270. selectList.push(item.key);
  271. });
  272. selectPage[Number(page)] = selectList;
  273. } else {
  274. selectList = [];
  275. delete selectPage[Number(page)];
  276. }
  277. this.setState({ selectList, selectPage, allChecked: checked });
  278. }
  279. onSelect(slist) {
  280. const { search = {}, list } = this.state;
  281. const { selectList, allChecked, selectPage } = this.updateSelectInfo(search.page, list, slist);
  282. this.setState({ selectList, allChecked, selectPage });
  283. }
  284. onAction(key) {
  285. const { info } = this.props.user;
  286. const { selectPage = {} } = this.state;
  287. const selectList = [].concat(...Object.values(selectPage).concat());
  288. switch (key) {
  289. case 'help':
  290. this.setState({ showTips: true });
  291. return;
  292. case 'clear':
  293. if (selectList.length === 0) {
  294. this.setState({ showWarn: true, warn: { title: '移除', content: '不可少于1题,请重新选择' } });
  295. return;
  296. }
  297. this.setState({ showClearConfirm: true, clearInfo: { questionNoIds: selectList } });
  298. break;
  299. case 'group':
  300. if (!info.vip) {
  301. this.setState({ showVip: true });
  302. return;
  303. }
  304. if (selectList.length < 10) {
  305. this.setState({ showWarn: true, warn: { title: '组卷练习', content: '不可小于10题,请重新选择' } });
  306. return;
  307. }
  308. if (selectList.length > 50) {
  309. this.setState({ showWarn: true, warn: { title: '组卷练习', content: '不可多余50题,请重新选择' } });
  310. return;
  311. }
  312. if (selectList.length === 0) {
  313. this.setState({ showWarn: true, warn: { title: '组卷练习', content: '不可同时选中语文题和数学题,请重新选择。' } });
  314. return;
  315. }
  316. this.setState({ showGroupConfirm: true, groupInfo: { questionNoIds: selectList, filterTimes: 2, checked: true } });
  317. break;
  318. case 'export':
  319. if (!info.vip) {
  320. this.setState({ showVip: true });
  321. return;
  322. }
  323. if (selectList.length < 1) {
  324. this.setState({ showWarn: true, warn: { title: '导出', content: '不可小于1题,请重新选择' } });
  325. return;
  326. }
  327. if (selectList.length > 100) {
  328. this.setState({ showWarn: true, warn: { title: '导出', content: '不可多余100题,请重新选择' } });
  329. return;
  330. }
  331. // if (info.bindReal) {
  332. this.setState({ showExportConfirm: true, exportInfo: { include: exportType.map(row => row.key), questionNoIds: selectList, answer: true } });
  333. // } else {
  334. // this.setState({ showExportAuthConfirm: true, exportInfo: { include: exportType.filter(row => !row.auth).map(row => row.key), questionNoIds: selectList, answer: true } });
  335. // }
  336. break;
  337. default:
  338. }
  339. }
  340. clearErrorQuestion() {
  341. const { clearInfo } = this.state;
  342. My.clearError(clearInfo.questionNoIds)
  343. .then(() => {
  344. this.setState({ showClearConfirm: false, selectList: [], selectPage: {}, allChecked: false });
  345. this.refresh();
  346. })
  347. .catch(e => {
  348. this.setState({ showWarn: true, warn: { title: '移除', content: e.message }, showClearConfirm: false });
  349. });
  350. }
  351. group() {
  352. const { groupInfo } = this.state;
  353. if (!groupInfo.checked) {
  354. delete groupInfo.filterTimes;
  355. }
  356. My.groupError(groupInfo)
  357. .then((result) => {
  358. Question.startLink('error', result);
  359. this.setState({ showGroupConfirm: false, selectList: [], selectPage: {}, allChecked: false });
  360. })
  361. .catch(e => {
  362. this.setState({ showWarn: true, warn: { title: '组卷练习', content: e.message }, showGroupConfirm: false });
  363. });
  364. }
  365. export() {
  366. const { exportInfo } = this.state;
  367. this.setState({ showExportWait: true, showExportConfirm: false, showExportAuthConfirm: false });
  368. My.exportQuestionError(exportInfo)
  369. .then((result) => {
  370. openLink(`/export/${result}`);
  371. this.setState({ showExportWait: false, selectList: [], selectPage: {}, allChecked: false });
  372. })
  373. .catch(e => {
  374. this.setState({ showWarn: true, warn: { title: '导出', content: e.message }, showExportWait: false });
  375. });
  376. }
  377. remove(report) {
  378. My.removeError(report.id)
  379. .then(() => {
  380. this.refresh();
  381. });
  382. }
  383. clearErrorReport() {
  384. My.clearLatestError()
  385. .then(() => {
  386. const { info } = this.props.user;
  387. info.latestError = 0;
  388. User.infoHandle(info);
  389. });
  390. this.setState({ latest: null });
  391. }
  392. renderView() {
  393. const { config } = this.props;
  394. return <UserLayout active={config.key} menu={menu} center={this.renderTable()} />;
  395. }
  396. renderTable() {
  397. const {
  398. tab,
  399. questionSubjectSelect,
  400. questionSubjectMap = {},
  401. oneSelect,
  402. twoSelectMap = {},
  403. oneSelectPlaceholder,
  404. twoSelectPlaceholder,
  405. filterMap = {},
  406. sortMap = {},
  407. list = [],
  408. latest,
  409. } = this.state;
  410. const { selectList = [], allChecked, page, total } = this.state;
  411. const { info } = this.props.user;
  412. return (
  413. <div className="table-layout">
  414. <Tabs
  415. border
  416. type="division"
  417. theme="theme"
  418. size="small"
  419. space={2.5}
  420. width={100}
  421. active={tab}
  422. tabs={[{ key: 'exercise', title: '练习' }, { key: 'examination', title: '模考' }]}
  423. onChange={key => this.onTabChange(key)}
  424. />
  425. <UserAction
  426. search
  427. defaultSearch={filterMap.keyword}
  428. selectList={[
  429. {
  430. children: [
  431. {
  432. key: 'subject',
  433. placeholder: '学科',
  434. select: questionSubjectSelect,
  435. },
  436. {
  437. placeholder: '题型',
  438. key: 'questionType',
  439. be: 'subject',
  440. selectMap: questionSubjectMap,
  441. },
  442. ],
  443. },
  444. {
  445. label: '范围',
  446. children: [
  447. {
  448. key: 'one',
  449. placeholder: oneSelectPlaceholder,
  450. select: oneSelect,
  451. },
  452. {
  453. key: 'two',
  454. be: 'one',
  455. placeholder: twoSelectPlaceholder,
  456. selectMap: twoSelectMap,
  457. },
  458. ],
  459. },
  460. {
  461. right: true,
  462. key: 'timerange',
  463. select: TimeRange,
  464. },
  465. ]}
  466. filterMap={filterMap}
  467. onFilter={value => this.onFilter(value)}
  468. onSearch={value => this.onSearch(value)}
  469. />
  470. <UserAction
  471. allCheckbox
  472. allChecked={allChecked}
  473. help
  474. btnList={[
  475. { title: '移除', key: 'clear' },
  476. { title: '组卷', key: 'group', tag: 'vip', disabled: !info.vip },
  477. { title: '导出', key: 'export', tag: 'vip', disabled: !info.vip },
  478. ]}
  479. right={
  480. latest && <div className="tip">
  481. {formatDate(latest.updateTime, 'YYYY-MM-DD HH:mm')} 组卷{latest.questionNumber}题,做对{latest.userCorrect}题。<span onClick={() => {
  482. this.remove(latest);
  483. }}>移除正确题目</span>
  484. <Icon type="close-circle" theme="filled" onClick={() => {
  485. this.clearErrorReport();
  486. }} />
  487. </div>
  488. }
  489. onAll={checked => this.onAll(checked)}
  490. onAction={key => this.onAction(key)}
  491. />
  492. <UserTable
  493. select
  494. columns={this.columns}
  495. sortMap={sortMap}
  496. data={list}
  497. current={page}
  498. total={Number(total)}
  499. pageSize={this.state.search.size}
  500. selectList={selectList}
  501. onSelect={l => this.onSelect(l)}
  502. onSort={v => this.onSort(v)}
  503. onChange={p => this.onChangePage(p)}
  504. />
  505. {this.renderModal()}
  506. </div>
  507. );
  508. }
  509. renderModal() {
  510. const { showTips, showWarn, warn = {}, showClearConfirm, clearInfo = {}, showGroupConfirm, groupInfo = {}, showExportConfirm, showExportAuthConfirm, exportInfo = {}, showExportWait, showExamination, showVip, showReal, showNote, note = {}, questionNo = {}, list } = this.state;
  511. const { info } = this.props.user;
  512. return [
  513. <Modal show={showTips} title="操作提示" confirmText="好的,知道了" btnAlign="center" onConfirm={() => this.setState({ showTips: false })}>
  514. <div className="flex-layout m-b-2">
  515. <div className="flex-block">
  516. <div className="t-1 t-s-18">组卷功能</div>
  517. <div className="t-2">操作数量:10-50;</div>
  518. <div className="t-2">注意事项:可跨题型、不可跨学科。</div>
  519. </div>
  520. <div className="flex-block">
  521. <div className="t-1 t-s-18">导出功能</div>
  522. <div className="t-2">操作数量:1-100;</div>
  523. <div className="t-2">注意事项:“综合推理IR”暂时无法导出。</div>
  524. </div>
  525. </div>
  526. <div className="t-3">
  527. *您可点击
  528. <Icon type="question-circle" theme="filled" />
  529. 查阅以上信息。
  530. </div>
  531. </Modal>,
  532. <Modal show={showWarn} title={warn.title} confirmText="好的,知道了" btnAlign="center" onConfirm={() => this.setState({ showWarn: false })}>
  533. <div className="t-2 t-s-18">{warn.content}</div>
  534. </Modal>,
  535. <Modal show={showGroupConfirm} title="组卷练习" confirmText="开始练习" onConfirm={() => this.group()} onCancel={() => this.setState({ showGroupConfirm: false })}>
  536. <div className="t-2 t-s-18">
  537. 您共选择了 <span className="t-4">{groupInfo.questionNoIds ? groupInfo.questionNoIds.length : 0}</span> 道题目,是否开始练习?</div>
  538. <div className="t-2 t-s-16">
  539. <Checkbox checked={groupInfo.checked} className="m-r-5" onChange={() => {
  540. groupInfo.checked = !groupInfo.checked;
  541. this.setState({ groupInfo });
  542. }} />
  543. 剔除已组卷练习 <Select
  544. theme="white"
  545. value={groupInfo.filterTimes}
  546. list={[{ key: 2, title: '2' }, { key: 3, title: '3' }]}
  547. onChange={({ key }) => {
  548. groupInfo.filterTimes = key;
  549. this.setState({ groupInfo });
  550. }}
  551. />{' '}
  552. 次以上的错题
  553. </div>
  554. </Modal>,
  555. <Modal show={showClearConfirm} title="移出" onConfirm={() => this.clearErrorQuestion()} onCancel={() => this.setState({ showClearConfirm: false })}>
  556. <div className="t-2 t-s-18">
  557. 当前选中的 <span className="t-4">{clearInfo.questionNoIds ? clearInfo.questionNoIds.length : 0}</span> 道题即将被移出错题本,移出后无法恢复,是否继续?
  558. </div>
  559. </Modal>,
  560. <Modal show={showExportWait} title="导出" confirmText="好的,知道了" btnAlign="center" onConfirm={() => this.setState({ showExportWait: false })}>
  561. <div className="t-2 t-s-18">正在导出中,请不要关闭当前页面!</div>
  562. </Modal>,
  563. <Modal show={showExportConfirm} title="导出" confirmText="导出" onConfirm={() => this.export()} onCancel={() => this.setState({ showExportConfirm: false })}>
  564. <div className="t-2 t-s-18 m-b-5">
  565. 当前共选中 <span className="t-4">{exportInfo.questionNoIds ? exportInfo.questionNoIds.length : 0}</span> 道题,请确认需要导出的内容:
  566. </div>
  567. <div className="t-2 t-s-16">
  568. {exportType.map(item => {
  569. return (
  570. <div className="d-i-b m-b-5" style={{ width: 135 }}>
  571. <Checkbox checked={exportInfo.include ? exportInfo.include.indexOf(item.key) >= 0 : false} className="m-r-5" onChange={() => {
  572. const index = exportInfo.include.indexOf(item.key);
  573. if (index >= 0) {
  574. exportInfo.include.splice(index, 1);
  575. } else {
  576. exportInfo.include.push(item.key);
  577. }
  578. this.setState({ exportInfo });
  579. }} />
  580. {item.title}
  581. </div>
  582. );
  583. })}
  584. </div>
  585. </Modal>,
  586. <Modal show={showExportAuthConfirm} title="导出" confirmText="导出" onConfirm={() => this.export()} onCancel={() => this.setState({ showExportAuthConfirm: false })}>
  587. <div className="t-2 t-s-18 m-b-5">
  588. 当前共选中 <span className="t-4">{exportInfo.questionNoIds ? exportInfo.questionNoIds.length : 0}</span> 道题,请确认需要导出的内容:
  589. </div>
  590. <div className="t-2 t-s-16 m-b-2">
  591. {exportType
  592. .filter(item => !item.auth)
  593. .map(item => {
  594. return (
  595. <div className="d-i-b m-b-2" style={{ width: 135 }}>
  596. <Checkbox checked={exportInfo.include ? exportInfo.include.indexOf(item.key) >= 0 : false} className="m-r-5" onChange={() => {
  597. const index = exportInfo.include.indexOf(item.key);
  598. if (index >= 0) {
  599. exportInfo.include.splice(index, 1);
  600. } else {
  601. exportInfo.include.push(item.key);
  602. }
  603. this.setState({ exportInfo });
  604. }} />
  605. {item.title}
  606. </div>
  607. );
  608. })}
  609. </div>
  610. <div className="b-b m-b-2 m-t-2" />
  611. <div className="t-3 m-b-1">
  612. 以下内容需实名认证后才可导出: <a className="f-r" onClick={() => this.setState({ showExportAuthConfirm: false, showReal: true })}>去认证 ></a>
  613. </div>
  614. <div className="t-2 t-s-16 m-b-2">
  615. {exportType
  616. .filter(item => item.auth)
  617. .map(item => {
  618. return (
  619. <div className="d-i-b" style={{ width: 135 }}>
  620. <Checkbox disabled className="m-r-5" />
  621. {item.title}
  622. </div>
  623. );
  624. })}
  625. </div>
  626. </Modal>,
  627. <Examination
  628. show={showExamination}
  629. data={info}
  630. onConfirm={() => this.setState({ showExamination: false })}
  631. onCancel={() => this.setState({ showExamination: false })}
  632. onClose={() => this.setState({ showExamination: false })}
  633. />,
  634. <RealAuth show={showReal} data={info} onConfirm={() => this.setState({ showReal: false })} />,
  635. <VipRenew
  636. show={showVip}
  637. data={info}
  638. onReal={() => this.setState({ showVip: false, showReal: true })}
  639. onPrepare={() => this.setState({ showVip: false, showExamination: true })}
  640. onClose={(result) => {
  641. if (result) {
  642. this.refresh();
  643. } else {
  644. this.setState({ showVip: false });
  645. }
  646. }}
  647. />,
  648. <QuestionNoteModal show={showNote} defaultData={note} questionNo={questionNo} onConfirm={() => {
  649. list[this.state.index].note = true;
  650. this.setState({ showNote: false, list });
  651. }} onCancel={() => this.setState({ showNote: false })} />,
  652. ];
  653. }
  654. }