page.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  1. import React, { Component } from 'react';
  2. import { Link } from 'react-router-dom';
  3. import './index.less';
  4. import { Tooltip, Icon } from 'antd';
  5. import Page from '@src/containers/Page';
  6. import Assets from '@src/components/Assets';
  7. import { formatPercent, formatDate, formatSeconds, getMap } from '@src/services/Tools';
  8. import { asyncSMessage } from '@src/services/AsyncTools';
  9. import moment from 'moment';
  10. import Date from '../../../components/Date';
  11. import UserLayout from '../../../layouts/User';
  12. import Tabs from '../../../components/Tabs';
  13. import Button from '../../../components/Button';
  14. import { Icon as GIcon } from '../../../components/Icon';
  15. import UserTable from '../../../components/UserTable';
  16. import Examination from '../../../components/Examination';
  17. import menu from '../index';
  18. import { BindPhone, BindEmail, EditInfo, RealAuth, EditAvatar, InviteModal } from '../../../components/OtherModal';
  19. import VipRenew from '../../../components/VipRenew';
  20. import { My } from '../../../stores/my';
  21. import { Main } from '../../../stores/main';
  22. import { QuestionType } from '../../../../Constant';
  23. const QuestionTypeMap = getMap(QuestionType, 'value', 'label');
  24. class LogItem extends Component {
  25. constructor(props) {
  26. super(props);
  27. this.columns = [
  28. { title: '', key: 'title' },
  29. { title: '语法SC', key: 'sc' },
  30. { title: '逻辑CR', key: 'cr' },
  31. { title: '阅读RC', key: 'rc' },
  32. ];
  33. this.state = { open: false };
  34. }
  35. render() {
  36. const { data = {} } = this.props;
  37. const { total = [], type } = data;
  38. const { open } = this.state;
  39. return (
  40. <div className="log-item">
  41. <div className="total">
  42. {total.map(item => {
  43. return (
  44. <div className="text" style={{ width: item.width }} dangerouslySetInnerHTML={{ __html: item.title }} />
  45. );
  46. })}
  47. </div>
  48. <div className="open">
  49. <GIcon name={open ? 'small-up' : 'small-down'} onClick={() => this.setState({ open: !open })} />
  50. </div>
  51. {type === 'exercise' && this.renderExercise()}
  52. {type === 'examination' && this.renderExamination()}
  53. {type === 'course' && this.renderCourse()}
  54. </div>
  55. );
  56. }
  57. renderExercise() {
  58. const { open } = this.state;
  59. return (
  60. <div hidden={!open} className="table">
  61. <UserTable size="small" columns={this.columns} data={[{ title: '123' }]} />
  62. <div className="t-r">
  63. <Link to="/exercise">继续练习></Link>
  64. </div>
  65. </div>
  66. );
  67. }
  68. renderExamination() {
  69. const { open } = this.state;
  70. return (
  71. <div hidden={!open} className="table">
  72. <div className="title p-l-5 m-b-1 t-1 t-s-18 f-w-b">
  73. 千行-CAT01<div className="f-r t-3 t-s-12 f-w-d">2019-05-16 16:21:06</div>
  74. </div>
  75. <UserTable
  76. size="small"
  77. columns={[
  78. { key: '1', title: '' },
  79. { key: '2', title: 'Tobal' },
  80. { key: '3', title: 'IR' },
  81. { key: '4', title: 'Verbal' },
  82. { key: '5', title: 'Quant' },
  83. ]}
  84. data={[{ title: '123' }]}
  85. />
  86. <div className="title p-l-5 m-b-1 t-1 t-s-18 f-w-b m-t-2">
  87. 净化版GWD-CAT01 <div className="f-r t-3 t-s-12 f-w-d">2019-05-16 16:21:06</div>
  88. </div>
  89. <UserTable
  90. size="small"
  91. columns={[
  92. { key: '1', title: '' },
  93. { key: '2', title: 'Tobal' },
  94. { key: '3', title: 'IR' },
  95. { key: '4', title: 'Verbal' },
  96. { key: '5', title: 'Quant' },
  97. ]}
  98. data={[{ title: '123' }]}
  99. />
  100. <div className="t-r">
  101. <Link to="/exercise">继续练习></Link>
  102. </div>
  103. </div>
  104. );
  105. }
  106. renderCourse() {
  107. const { open } = this.state;
  108. return (
  109. <div hidden={!open} className="table">
  110. <UserTable
  111. header={false}
  112. size="small"
  113. even="odd"
  114. columns={[{ key: '1', width: 100 }, { key: '2', width: 310 }, { key: '3', width: 120 }]}
  115. data={[
  116. { 1: '语法SC', 2: '课时3:代词的指代', 3: '2019-04-27\n 15:14:29' },
  117. { 1: '逻辑 RC', 2: '课时3:代词的指代', 3: '2019-04-27\n 15:14:29' },
  118. { 1: '阅读CR', 2: '课时3:代词的指代', 3: '2019-04-27\n 15:14:29' },
  119. { 1: '逻辑 RC', 2: '课时3:代词的指代', 3: '2019-04-27\n 15:14:29' },
  120. ]}
  121. />
  122. <div className="t-r">
  123. <Link to="/exercise">继续练习></Link>
  124. </div>
  125. </div>
  126. );
  127. }
  128. }
  129. export default class extends Page {
  130. constructor(props) {
  131. super(props);
  132. this.colors = ['#3C39CC', '#9E9CFF', '#4292F0', '#4374EC', '#6865FD', '#8D65FD', '#6BABF6', '#7BBEFF', '#6BABF6'];
  133. }
  134. initState() {
  135. return {
  136. day: 'today',
  137. showExamination: false,
  138. timeList: [
  139. { title: '长难句', time: '3h60min', ratio: 10, color: '#3C39CC' },
  140. { title: '综合推理IR', time: '3h60min', ratio: 10, color: '#9E9CFF' },
  141. { title: '语法SC', time: '3h60min', ratio: 10, color: '#4292F0' },
  142. { title: '作文AWA', time: '3h60min', ratio: 10, color: '#4374EC' },
  143. { title: '阅读RC', time: '3h60min', ratio: 10, color: '#6865FD' },
  144. { title: '模考', time: '3h60min', ratio: 10, color: '#8D65FD' },
  145. { title: '逻辑CR', time: '3h60min', ratio: 10, color: '#6BABF6' },
  146. { title: '自由组卷', time: '3h60min', ratio: 10, color: '#7BBEFF' },
  147. { title: '数学Quant', time: '3h60min', ratio: 10, color: '#6BABF6' },
  148. ],
  149. logList: [
  150. {
  151. total: [
  152. { title: '<span>练习和订正</span>', width: 130 },
  153. { title: '<b>60</b>min', width: 90 },
  154. { title: '<b>30</b>题', width: 80 },
  155. { title: '超过了<b>30%</b>的用户' },
  156. ],
  157. detail: [
  158. { title: '做题数', sc: '10', cr: '10', rc: '20' },
  159. { title: '平均正确率', sc: '86%', cr: '86%', rc: '86%' },
  160. { title: '平均用时', sc: '1min', cr: '1min20s', rc: '1min' },
  161. ],
  162. },
  163. {
  164. total: [
  165. { title: '<span>模考和订正</span>', width: 130 },
  166. { title: '<b>60</b>min', width: 90 },
  167. { title: '<b>30</b>套卷', width: 80 },
  168. { title: '超过了<b>30%</b>的用户' },
  169. ],
  170. detail: [
  171. { title: '做题数', sc: '10', cr: '10', rc: '20' },
  172. { title: '平均正确率', sc: '86%', cr: '86%', rc: '86%' },
  173. { title: '平均用时', sc: '1min', cr: '1min20s', rc: '1min' },
  174. ],
  175. },
  176. {
  177. total: [
  178. { title: '<span>课程学习</span>', width: 130 },
  179. { title: '<b>60</b>min', width: 90 },
  180. { title: '<b>30</b>课', width: 80 },
  181. { title: '超过了<b>30%</b>的用户' },
  182. ],
  183. detail: [
  184. { title: '做题数', sc: '10', cr: '10', rc: '20' },
  185. { title: '平均正确率', sc: '86%', cr: '86%', rc: '86%' },
  186. { title: '平均用时', sc: '1min', cr: '1min20s', rc: '1min' },
  187. ],
  188. },
  189. ],
  190. };
  191. }
  192. initData() {
  193. // 获取学习数据
  194. My.getStudyTotal().then((total, index) => {
  195. total.categorys = total.categorys.map(row => {
  196. row.ratio = row.time * 100 / total.time;
  197. row.time = formatSeconds(row.time);
  198. row.color = this.colors[index];
  199. return row;
  200. });
  201. this.setState({ total });
  202. });
  203. My.getStudyWeek(0).then(latest => {
  204. const diff = latest.time - latest.avgTime;
  205. const diffPercent =
  206. diff > 0
  207. ? formatPercent(latest.time - latest.avgTime, latest.avgTime, true)
  208. : formatPercent(latest.avgTime - latest.time, latest.avgTime, true);
  209. this.setState({ latest, diff, diffPercent });
  210. My.getStudyWeek(1).then(last => {
  211. const diffLast = latest.time - last.time;
  212. const diffLastPercent =
  213. diffLast > 0
  214. ? formatPercent(latest.time - last.time, last.time, true)
  215. : formatPercent(last.time - latest.time, last.time, true);
  216. this.setState({ last, diffLast, diffLastPercent });
  217. });
  218. });
  219. // 获取广告
  220. Main.getAd('my-self').then(result => {
  221. this.setState({ ads: result });
  222. });
  223. // 获取未读消息
  224. My.message({ page: 1, size: 2, read: 0 }).then(result => {
  225. this.setState({ messages: result.list });
  226. });
  227. this.refreshDay(this.state.day);
  228. }
  229. readAllMessage() {
  230. My.readAllMessage().then(() => {
  231. asyncSMessage('操作成功');
  232. });
  233. }
  234. refreshDay(value) {
  235. let time = '';
  236. switch (value) {
  237. case 'today':
  238. time = moment().format('YYYY-MM-DD');
  239. break;
  240. case 'yesterday':
  241. time = moment()
  242. .add(-1, 'days')
  243. .format('YYYY-MM-DD');
  244. break;
  245. case 'before':
  246. time = moment()
  247. .add(-2, 'days')
  248. .format('YYYY-MM-DD');
  249. break;
  250. default:
  251. time = value.format('YYYY-MM-DD');
  252. value = 'other';
  253. }
  254. My.getStudy(time).then(result => {
  255. const study = [];
  256. const exerciseMap = {};
  257. result.exerciseList.forEach(row => {
  258. exerciseMap[row.title] = row;
  259. });
  260. study.push({
  261. type: 'exercise',
  262. total: [
  263. { title: '<span>练习和订正</span>', width: 130 },
  264. {
  265. title: result.exerciseTime
  266. ? formatSeconds(result.exerciseTime).replace(/([0-9]+)(m|min|h|hour|s)/g, '<b>$1</b>$2')
  267. : '<b>-</b>',
  268. width: 90,
  269. },
  270. { title: `<b>${result.exerciseQuestion || '-'}</b>题`, width: 80 },
  271. {
  272. title: `超过了<b>${
  273. result.exerciseExceed ? formatPercent(result.exerciseExceed.rank, result.exerciseExceed.total) : '-%'
  274. }</b>的用户`,
  275. },
  276. ],
  277. detail: [
  278. {
  279. title: '做题数',
  280. sc: exerciseMap.sc ? exerciseMap.sc.number : '-',
  281. cr: exerciseMap.cr ? exerciseMap.cr.number : '-',
  282. rc: exerciseMap.rc ? exerciseMap.rc.number : '-',
  283. },
  284. {
  285. title: '平均正确率',
  286. sc: exerciseMap.sc ? formatPercent(exerciseMap.sc.correct, exerciseMap.sc.number) : '-%',
  287. cr: exerciseMap.cr ? formatPercent(exerciseMap.cr.correct, exerciseMap.cr.number) : '-%',
  288. rc: exerciseMap.rc ? formatPercent(exerciseMap.rc.correct, exerciseMap.rc.number) : '-%',
  289. },
  290. {
  291. title: '平均用时',
  292. sc: exerciseMap.sc ? exerciseMap.sc.time / exerciseMap.sc.number : '-',
  293. cr: exerciseMap.cr ? exerciseMap.cr.time / exerciseMap.cr.number : '-',
  294. rc: exerciseMap.rc ? exerciseMap.rc.time / exerciseMap.rc.number : '-',
  295. },
  296. ],
  297. });
  298. study.push({
  299. type: 'examination',
  300. total: [
  301. { title: '<span>模考和订正</span>', width: 130 },
  302. { title: result.examinationTime ? formatSeconds(result.examinationTime).replace(/([0-9]+)(m|min|h|hour|s)/g, '<b>$1</b>$2') : '<b>-</b>', width: 90 },
  303. { title: `<b>${result.examinationPaper || '-'}</b>套卷`, width: 80 },
  304. { title: `超过了<b>${result.examinationExceed ? formatPercent(result.examinationExceed.rank, result.examinationExceed.total) : '-%'}</b>的用户` },
  305. ],
  306. detail: result.examinationList.map(row => {
  307. return {
  308. title: row.title,
  309. time: formatDate(row.report.createTime, 'YYYY-MM-DD HH:mm:ss'),
  310. score: row.report.score,
  311. };
  312. }),
  313. });
  314. study.push({
  315. type: 'course',
  316. total: [
  317. { title: '<span>课程学习</span>', width: 130 },
  318. { title: result.courseTime ? formatSeconds(result.courseTime).replace(/([0-9]+)(m|min|h|hour|s)/g, '<b>$1</b>$2') : '<b>-</b>', width: 90 },
  319. { title: `<b>${result.courseNumber || '-'}</b>课时`, width: 80 },
  320. { title: `超过了<b>${result.courseExceed ? formatPercent(result.courseExceed.rank, result.courseExceed.total) : '-%'}</b>的用户` },
  321. ],
  322. detail: result.courseList.map(row => {
  323. return {
  324. type: QuestionTypeMap[row.extend],
  325. title: `课时${row.no}: ${row.title}`,
  326. time: formatDate(row.createTime, 'YYYY-MM-DD\n HH:mm:ss'),
  327. };
  328. }),
  329. });
  330. this.setState({ study });
  331. });
  332. this.setState({ day: value, time, showCal: false });
  333. }
  334. renderView() {
  335. const { config } = this.props;
  336. return (
  337. <UserLayout
  338. active={config.key}
  339. menu={menu}
  340. center={[this.renderTop(), this.renderLog(), this.renderTime()]}
  341. right={[this.renderInfo(), this.renderMessage()]}
  342. ads={(this.state.ads || []).map(row => {
  343. return (
  344. <a href={row.link} target="_blank">
  345. <Assets src={row.image} />
  346. </a>
  347. );
  348. })}
  349. />
  350. );
  351. }
  352. renderTop() {
  353. return null; // <div className="total-layout">1</div>;
  354. }
  355. renderLog() {
  356. const { study = [{}, { type: 'examination' }, { type: 'course' }] } = this.state;
  357. const {
  358. latest = {},
  359. diff = 0,
  360. diffPercent = 0,
  361. diffLast = 0,
  362. diffLastPercent = 0,
  363. day,
  364. time,
  365. showCal,
  366. } = this.state;
  367. return (
  368. <div className="log-layout">
  369. <div className="header">
  370. <div className="title">学习记录</div>
  371. <div className="right">
  372. <span
  373. dangerouslySetInnerHTML={{
  374. __html: `本周学习时间${formatSeconds(latest.time).replace(/([0-9]+)(m|min|h|hour|s)/g, '<b>$1</b>$2')}`,
  375. }}
  376. />
  377. <span>
  378. 同比上周<b>{diffLastPercent}</b>% <Assets name={diffLast > 0 ? 'up' : 'down'} />
  379. </span>
  380. <span>
  381. 同比全站<b>{diffPercent}</b>% <Assets name={diff > 0 ? 'up' : 'down'} />
  382. </span>
  383. </div>
  384. </div>
  385. <div className="action">
  386. <Tabs
  387. className="d-i-b"
  388. type="tag"
  389. width={54}
  390. space={5}
  391. active={day}
  392. tabs={[
  393. { title: '今天', key: 'today' },
  394. { title: '昨天', key: 'yesterday' },
  395. { title: '前天', key: 'before' },
  396. ]}
  397. onChange={value => {
  398. this.refreshDay(value);
  399. }}
  400. />
  401. <div className="right">
  402. <Assets
  403. className="right"
  404. name="calendar"
  405. onClick={() => {
  406. this.setState({ showCal: true });
  407. }}
  408. />
  409. {day === 'other' && <span className="right">{formatDate(time, 'YYYY-MM-DD')}</span>}
  410. {showCal && (
  411. <Date
  412. show
  413. hideInput
  414. theme="filled"
  415. value={moment(time)}
  416. disabledDate={date => date.unix() <= moment.unix()}
  417. onChange={date => {
  418. this.refreshDay(date);
  419. }}
  420. />
  421. )}
  422. </div>
  423. </div>
  424. {study.map((log, index) => {
  425. return <LogItem key={index} data={log} />;
  426. })}
  427. </div>
  428. );
  429. }
  430. renderTime() {
  431. const { total = {} } = this.state;
  432. return (
  433. <div className="time-layout">
  434. <div className="header">
  435. <div className="title">
  436. 时间分配
  437. <Tooltip overlayClassName="gray" title="包括听课、练习与订正">
  438. <Icon type="question-circle" theme="filled" />
  439. </Tooltip>
  440. </div>
  441. <div className="right">
  442. 自 {total.createTIme && formatDate(total.createTime, 'YYYY-MM-DD')} ,您已在千行学习<b>{total.days}</b>
  443. 天,累计
  444. <span
  445. dangerouslySetInnerHTML={{
  446. __html: formatSeconds(total.time).replace(/([0-9]+)(m|min|h|hour|s)/g, '<b>$1</b>$2'),
  447. }}
  448. />
  449. </div>
  450. </div>
  451. <div className="body">
  452. <div className="line">
  453. {(total.categorys || []).map(item => {
  454. return (
  455. <Tooltip overlayClassName="gray" title={`${item.title} ${item.time}`}>
  456. <i style={{ background: item.color, width: `${item.ratio}%` }} />
  457. </Tooltip>
  458. );
  459. })}
  460. </div>
  461. <div className="list">
  462. {(total.categorys || []).map(item => {
  463. return (
  464. <div className="item">
  465. <div className="color" style={{ background: item.color }} />
  466. <div className="title">{item.title}</div>
  467. <div className="date">{item.time}</div>
  468. </div>
  469. );
  470. })}
  471. </div>
  472. </div>
  473. </div>
  474. );
  475. }
  476. renderInfo() {
  477. const { info = {} } = this.props.user;
  478. const { showExamination, showPhone, showEmail, showEdit, showReal, showAvatar, showInvite, showVip } = this.state;
  479. return (
  480. <div className="info-layout">
  481. <div className="body">
  482. <div className="info">
  483. <Assets
  484. name="sun_blue"
  485. src={info.avatar}
  486. onClick={() => {
  487. this.setState({ showEdit: true });
  488. }}
  489. />
  490. <div className="detail">
  491. <div
  492. className="name"
  493. onClick={() => {
  494. this.setState({ showEdit: true });
  495. }}
  496. >
  497. {info.nickname}{' '}
  498. </div>
  499. <div className="id">ID: {info.id} </div>
  500. </div>
  501. </div>
  502. <div className="auth">
  503. <span className="invite">
  504. <Button
  505. radius
  506. size="small"
  507. onClick={() => {
  508. this.setState({ showInvite: true });
  509. }}
  510. >
  511. 邀请
  512. </Button>
  513. </span>
  514. <Assets name="wechat" active={info.bindWechat} />
  515. <Assets
  516. name="phone_1"
  517. active={info.bindMobile}
  518. onClick={() => {
  519. this.setState({ showPhone: true });
  520. }}
  521. />
  522. <Assets
  523. name="realname"
  524. active={info.bindReal}
  525. onClick={() => {
  526. this.setState({ showReal: true });
  527. }}
  528. />
  529. <Assets
  530. name="email"
  531. active={!!info.email}
  532. onClick={() => {
  533. this.setState({ showEmail: true });
  534. }}
  535. />
  536. <Assets
  537. name="information"
  538. active={info.bindPrepare}
  539. onClick={() => {
  540. this.setState({ showExamination: true });
  541. }}
  542. />
  543. </div>
  544. </div>
  545. {
  546. <div className="footer">
  547. <Assets className="m-r-5" name="VIP" />
  548. {info.vip && <span className="date">{formatDate(info.vip, 'YYYY-MM-DD')}到期</span>}
  549. <a
  550. onClick={() => {
  551. this.setState({ showVip: true });
  552. }}
  553. >
  554. 续费
  555. </a>
  556. </div>
  557. }
  558. <Examination
  559. show={showExamination}
  560. data={info}
  561. onConfirm={() => this.setState({ showExamination: false })}
  562. onCancel={() => this.setState({ showExamination: false })}
  563. onClose={() => this.setState({ showExamination: false })}
  564. />
  565. <BindPhone
  566. show={showPhone}
  567. data={info}
  568. onConfirm={() => this.setState({ showPhone: false })}
  569. onCancel={() => this.setState({ showPhone: false })}
  570. />
  571. <BindEmail
  572. show={showEmail}
  573. data={info}
  574. onConfirm={() => this.setState({ showEmail: false })}
  575. onCancel={() => this.setState({ showEmail: false })}
  576. />
  577. <EditInfo
  578. show={showEdit}
  579. data={info}
  580. image={this.state.avatarFile}
  581. onSelectImage={file => this.setState({ showEdit: false, showAvatar: true, avatarImage: file })}
  582. onConfirm={() => this.setState({ showEdit: false, avatarFile: null })}
  583. onCancel={() => this.setState({ showEdit: false, avatarFile: null })}
  584. />
  585. <RealAuth show={showReal} data={info} onConfirm={() => this.setState({ showReal: false })} />
  586. <EditAvatar
  587. show={showAvatar}
  588. data={info}
  589. crop={{ width: 200, height: 200 }}
  590. image={this.state.avatarImage}
  591. onConfirm={file => this.setState({ showAvatar: false, showEdit: true, avatarFile: file, avatarImage: null })}
  592. onCancel={() => this.setState({ showAvatar: false, showEdit: true, avatarImage: null })}
  593. />
  594. <InviteModal show={showInvite} data={info} onClose={() => this.setState({ showInvite: false })} />
  595. <VipRenew
  596. show={showVip}
  597. data={info}
  598. onReal={() => this.setState({ showVip: false, showReal: true })}
  599. onPrepare={() => this.setState({ showVip: false, showExamination: true })}
  600. onClose={() => this.setState({ showVip: false })}
  601. />
  602. </div>
  603. );
  604. }
  605. renderMessage() {
  606. const { messages = [] } = this.state;
  607. const number = (messages || []).length;
  608. return (
  609. number > 0 && (
  610. <div className="message-layout">
  611. <div className="header">
  612. <Assets
  613. name="all"
  614. onCancel={() => {
  615. this.readAllMessage();
  616. }}
  617. />
  618. 全部已读
  619. </div>
  620. <div className="body">
  621. {(messages || []).map(row => {
  622. return (
  623. <div className="item">
  624. <div className="title dot">老师回答了您的提问</div>
  625. <div className="date">{formatDate(row.createTime, 'YYYY-MM-DD HH:mm:ss')}</div>
  626. {row.link && (
  627. <GIcon
  628. name="arrow-right-small"
  629. onClick={() => {
  630. openLink(row.link);
  631. }}
  632. />
  633. )}
  634. </div>
  635. );
  636. })}
  637. </div>
  638. <div className="footer">
  639. <Button
  640. radius
  641. size="small"
  642. onClick={() => {
  643. linkTo('/my/message');
  644. }}
  645. >
  646. 全部消息
  647. </Button>
  648. </div>
  649. </div>
  650. )
  651. );
  652. }
  653. }