From 1eba2fa5f280273bb77380cef990042705a064b6 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Sat, 9 May 2020 11:00:03 +0800 Subject: [PATCH] =?UTF-8?q?marked=20package,=E5=8E=BB=E6=8E=89=E5=AE=9E?= =?UTF-8?q?=E8=B7=B5=E8=AF=BE=E7=A8=8B=E7=9A=84=E7=9B=B8=E5=85=B3=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/modules/paths/Index.js | 59 -- .../paths/NewStatistics/NewStatistics.js | 36 - src/modules/paths/PathDetail/Addshixuns.js | 122 --- src/modules/paths/PathDetail/DetailCards.js | 688 ------------- .../paths/PathDetail/DetailCardsEditAndAdd.js | 770 --------------- .../PathDetail/DetailCardsEditAndEdit.js | 814 --------------- .../paths/PathDetail/DetailCardsTemp.js | 174 ---- src/modules/paths/PathDetail/DetailTop.css | 88 -- src/modules/paths/PathDetail/DetailTop.js | 926 ------------------ src/modules/paths/PathDetail/Modifytext.js | 185 ---- src/modules/paths/PathDetail/OpenCourse.js | 100 -- .../paths/PathDetail/PathDetailIndex.js | 787 --------------- .../paths/PathDetail/addCollaborators.js | 233 ----- src/modules/paths/PathDetail/sendPanel.js | 282 ------ src/modules/paths/PathNew.js | 244 ----- .../paths/SchoolStatistics/FirstTab.js | 212 ---- .../paths/SchoolStatistics/SecondTab.js | 291 ------ .../paths/SchoolStatistics/Statistics.js | 82 -- .../paths/SchoolStatistics/ThirdTab.js | 247 ----- src/modules/paths/ShixunPathCard.js | 57 -- src/modules/paths/ShixunPathSearch.js | 268 ----- src/modules/paths/ShixunPaths.css | 327 ------- src/modules/paths/ShixunPaths.js | 29 - src/modules/paths/btn-new.png | Bin 2745 -> 0 bytes src/modules/paths/statics/DisplayTableData.js | 94 -- .../paths/statics/StaticNumberAndTxt.js | 43 - src/modules/paths/statics/index.js | 429 -------- src/modules/paths/statics/index.scss | 156 --- src/modules/paths/statics/mockData.js | 99 -- 30 files changed, 1 insertion(+), 7842 deletions(-) delete mode 100644 src/modules/paths/Index.js delete mode 100644 src/modules/paths/NewStatistics/NewStatistics.js delete mode 100644 src/modules/paths/PathDetail/Addshixuns.js delete mode 100644 src/modules/paths/PathDetail/DetailCards.js delete mode 100644 src/modules/paths/PathDetail/DetailCardsEditAndAdd.js delete mode 100644 src/modules/paths/PathDetail/DetailCardsEditAndEdit.js delete mode 100644 src/modules/paths/PathDetail/DetailCardsTemp.js delete mode 100644 src/modules/paths/PathDetail/DetailTop.css delete mode 100644 src/modules/paths/PathDetail/DetailTop.js delete mode 100644 src/modules/paths/PathDetail/Modifytext.js delete mode 100644 src/modules/paths/PathDetail/OpenCourse.js delete mode 100644 src/modules/paths/PathDetail/PathDetailIndex.js delete mode 100644 src/modules/paths/PathDetail/addCollaborators.js delete mode 100644 src/modules/paths/PathDetail/sendPanel.js delete mode 100644 src/modules/paths/PathNew.js delete mode 100644 src/modules/paths/SchoolStatistics/FirstTab.js delete mode 100644 src/modules/paths/SchoolStatistics/SecondTab.js delete mode 100644 src/modules/paths/SchoolStatistics/Statistics.js delete mode 100644 src/modules/paths/SchoolStatistics/ThirdTab.js delete mode 100644 src/modules/paths/ShixunPathCard.js delete mode 100644 src/modules/paths/ShixunPathSearch.js delete mode 100644 src/modules/paths/ShixunPaths.css delete mode 100644 src/modules/paths/ShixunPaths.js delete mode 100644 src/modules/paths/btn-new.png delete mode 100644 src/modules/paths/statics/DisplayTableData.js delete mode 100644 src/modules/paths/statics/StaticNumberAndTxt.js delete mode 100644 src/modules/paths/statics/index.js delete mode 100644 src/modules/paths/statics/index.scss delete mode 100644 src/modules/paths/statics/mockData.js diff --git a/package.json b/package.json index 2cf7489ca..d33e90879 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "lodash": "^4.17.15", "loglevel": "^1.6.8", "material-ui": "^1.0.0-beta.40", + "marked": "^1.0.0", "md5": "^2.2.1", "mini-css-extract-plugin": "^0.9.0", "moment": "^2.23.0", diff --git a/src/modules/paths/Index.js b/src/modules/paths/Index.js deleted file mode 100644 index 2f3514be0..000000000 --- a/src/modules/paths/Index.js +++ /dev/null @@ -1,59 +0,0 @@ -import React, { Component } from 'react'; - -import { SnackbarHOC, CNotificationHOC } from 'educoder'; - - -import { Route, Switch } from 'react-router-dom'; -import Loadable from 'react-loadable'; -import Loading from '../../Loading'; -import { TPMIndexHOC } from '../tpm/TPMIndexHOC'; - -const PathsDetail = Loadable({ - loader: () => import('./PathDetail/PathDetailIndex'), - loading: Loading, -}) -const PathsNew = Loadable({ - loader: () => import('./PathNew'), - loading: Loading, -}) -const Statistics = Loadable({ - loader: () => import('./statics'), - loading: Loading -}); - -const ShixunPaths = Loadable({ - loader: () => import('./ShixunPaths'), - loading: Loading, -}) - -class Index extends Component { - constructor(props) { - super(props) - } - render() { - return ( -
目前该实训项目尚在内测中,将于{this.state.shixunsmessage}之后开放,谢谢!
-*/} - {/*知道了*/} - {/*
*/} -实训已经更新了,正在为您重置!
-
-
-
-
-
- {item.stage_name}
- {
- idsum===key&&pathCardsedittype===true?'':
-
- this.props.detailInfoList===undefined?"":
- this.props.current_user&&this.props.current_user.admin===true||this.props.current_user&&this.props.current_user.business===true?
-
-
- { editbuttomtype===true?'':
-
-
-
-
-
{item.stage_description}
- -{item.stage_description}
-// -// -//
-
-
-
- 第{this.props.sum}部分
- {/**/}
-
章节名称
-描述
-- this.Addshixuns()} className="fl defalutGreyBorder color-grey-6 ml37"> - - 新建实训项目 -
- -- this.AddShixunBox()} className="fl defalutGreyBorder color-grey-6 ml37"> - - 选用实训项目 - -
-- 下面实训可以通过拖拽进行排序调整 -
- {selectShixun===true?:""} - {selectShixun===true?-
- - -
- {/**/}
- {/**/}
- {/**/}
-
- {/**/}
-
章节名称
*/} -描述
-- - 新建实训项目 - -
- -- - 选用实训项目 - - -
-- 下面实训可以通过拖拽进行排序调整 -
- {selectShixun === true ? : ""} - - {selectShixun === true ?*/} - {/*取消*/} - {/*保存*/} - {/*
*/} - --
- - - -
-
-
-
-
- {item.stage_name}
-
-
-
-
-
-
{item.stage_description}
- - {/* - 两个 ref={provided.innerRef} - item 加 {...provided.draggableProps} - handler 加 {...provided.dragHandleProps} - */} -
-
- 简介
- {/*{detailInfoList===undefined?"":detailInfoList.allow_statistics===true?*/}
- {/*
- 课程须知
- {/*{detailInfoList===undefined?"":detailInfoList.allow_statistics===true?*/}
- {/*
技能标签 {tags.length}
- -
- 关卡数
-
- 已学 {progress.learned}% - 学习耗时{this.timeStamp(progress.time)} -
-{team_title}
: detailInfoList.allow_add_member === true ? - ( - modify === false ? - -this.modifysy(1)}>{team_title}
-{team_title}
- } - - {members === undefined ? - members && members.map((item, key) => { - return ( -{item.name} - {/*{*/} - {/* detailInfoList===undefined?"":detailInfoList.allow_add_member===true?*/} - {/* this.shanchuallow(item.id)}>:""*/} - {/*}*/} -
-- {item.school} - {/*{item.identity}*/} -
-{item.name} - {/* 新增role 判断是否能删除 1 管理员 2 合作者 */} - - { - detailInfoList === undefined ? "" : detailInfoList.allow_add_member === true && item.role == 2 ? - this.shanchuallow(item.id)}> : "" - } -
-{item.school} - {/*{item.identity}*/} -
-{item.name} - {/*{*/} - {/* detailInfoList===undefined?"":detailInfoList.allow_add_member===true?*/} - {/* this.shanchuallow(item.id)}>:""*/} - {/*}*/} -
-{item.school} - {/*{item.identity}*/} -
-
-
已选择 {this.state.sendToShixunArray.length} 个实训
- -{pathId ? '编辑' : '创建'}实践课程
-实践课程名称
-简介
-学习须知
-课堂使用概况共{total}条记录
-| 序号 | -所属院校 | -课堂 | -学生 | -选用实训 | -
|---|---|---|---|---|
| { index + 1 } | -{school.name} | -{school.course_count} | -{school.student_count} | -{school.homework_count}次 | -
章节使用情况
- -| 章节 | -实训名称 | -学习人数 | -受用院校 | -
|---|---|---|---|
| {shixun.number} | -{shixun.shixun_name} | -{shixun.member_count} | -{shixun.school_count} | -
{subject_name}
-- {item.name} -
-- 章节: {item.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ig=HJ<<%GVGn zSsBs7#3$BBvBd5OOJFO}LaCSm>4U`0Dttd9!QsvL)v6~}Z9?TLXi)mMCHa!rpUf^V zR9bWqe *hrZiGc zs((}yZKZziq|?oBl+66}GpAU?@3R{F56}Jw=xne7bneiE00000NkvXXu0mjfB?Ur` diff --git a/src/modules/paths/statics/DisplayTableData.js b/src/modules/paths/statics/DisplayTableData.js deleted file mode 100644 index 17e034eb7..000000000 --- a/src/modules/paths/statics/DisplayTableData.js +++ /dev/null @@ -1,94 +0,0 @@ -/* - * @Description: - * @Author: tangjiang - * @Github: - * @Date: 2020-01-14 13:39:12 - * @LastEditors : tangjiang - * @LastEditTime : 2020-01-14 16:30:05 - */ -import "./index.scss"; -import React, { useRef, useState, useEffect } from "react"; -import { Table } from "antd"; -import ReactDom from "react-dom"; - -const DisplayTableData = (props) => { - const { - columns, - datas, - fetchData, - total, - paginationProps, - handleTableChange, - } = props; - let tableEl = useRef(null); - const [loading, setLoading] = useState(false); - - const renderFooter = (obj = {}) => { - const { - course_count, - student_count, - choice_shixun_num, - choice_shixun_frequency, - total, - } = obj; - if (!obj) return ""; - else { - return ( - -
- ); - } - }; - - useEffect(() => { - const table = ReactDom.findDOMNode(tableEl); - // console.log(table); - const tableBody = table.querySelector(".ant-table-body"); - let _scrollTop = 0; //保存上次滚动距离 - let isRun = false; //是否执行查询 - tableBody.addEventListener("scroll", () => { - if (tableBody.scrollTop === 0) { - _scrollTop = 0; - } - // 上一次滚动高度与当前滚动高度不同则是纵向滚动 - if (_scrollTop !== tableBody.scrollTop) { - //是否滑动到距离底部40px的位置 - const scorll = - _scrollTop >= tableBody.scrollHeight - tableBody.clientHeight - 40; - //isRun为true时 代表已经执行查询 - if (isRun && scorll) { - return; - } - //_scrollTop < tableBody.scrollTop 判断是否向下滑动 - isRun = _scrollTop < tableBody.scrollTop && scorll; - //保存当前滚动位置 - _scrollTop = tableBody.scrollTop; - if (isRun) { - fetchData && fetchData(); - } - } - }); - }, []); - return ( -- 总计
-- {total || "-"}
-- {course_count || "-"}
-- {student_count || "-"}
-- {choice_shixun_num || "-"}
-- {choice_shixun_frequency || "-"}
-record.id} - columns={columns} - dataSource={datas} - loading={loading} - // scroll={{y: 500}} - ref={(ref) => (tableEl = ref)} - footer={total ? () => renderFooter(total) : ""} - pagination={paginationProps} - onChange={handleTableChange} - /> - ); -}; - -export default DisplayTableData; diff --git a/src/modules/paths/statics/StaticNumberAndTxt.js b/src/modules/paths/statics/StaticNumberAndTxt.js deleted file mode 100644 index e061bdc80..000000000 --- a/src/modules/paths/statics/StaticNumberAndTxt.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * @Description: 数字及文字提示 - * @Author: tangjiang - * @Github: - * @Date: 2020-01-10 10:26:57 - * @LastEditors : tangjiang - * @LastEditTime : 2020-01-10 11:15:28 - */ -import './index.scss'; -import React from 'react'; -import { Tooltip } from 'antd'; -const numberal = require('numeral'); - -const StaticNumberAndTxt = ({ - count = 0, // 总数 - txt, // 文字描述 - type = 'tishi1', // 字体类型 - desc // 描述信息 -}) => { - - const formatNumber = (value, format = '0,0') => { - return numberal(value).format(format); - } - - const _classes = `iconfont icon-${type} icon`; - return ( -
- {formatNumber(count)} - - {txt} -- ); -} - -export default StaticNumberAndTxt; diff --git a/src/modules/paths/statics/index.js b/src/modules/paths/statics/index.js deleted file mode 100644 index 01e7c8c71..000000000 --- a/src/modules/paths/statics/index.js +++ /dev/null @@ -1,429 +0,0 @@ -/* - * @Description: 实践课程统计页面 - * @Author: tangjiang - * @Github: - * @Date: 2020-01-10 09:33:45 - * @LastEditors : tangjiang - * @LastEditTime : 2020-02-14 17:51:48 - */ -import "./index.scss"; -import React, { useEffect } from "react"; -import StaticNumberAndTxt from "./StaticNumberAndTxt"; -import DisplayTableData from "./DisplayTableData"; -import { Tabs, Tooltip, Pagination } from "antd"; -import { connect } from "react-redux"; -import moment from "moment"; -import actions from "../../../redux/actions"; - -// function PadZero(str) { -// //补零 -// return new RegExp(/^\d$/g).test(str) ? `0${str}` : str; -// } -const formatTime = (_seconds) => { - _seconds = parseInt(_seconds, 10); - let hours, mins, seconds; - let result = ""; - seconds = parseInt(_seconds % 60, 10); - mins = parseInt((_seconds % 3600) / 60, 10); - hours = parseInt(_seconds / 3600, 10); - - if (hours) { - result = `${hours}小时${mins}分${seconds}秒`; - } else if (mins) { - result = `${mins}分${seconds}秒`; - } else { - result = `${seconds}秒`; - } - return result; -}; -const { TabPane } = Tabs; -const App = (props) => { - const { - subject_info, - other_info, - total, - staticList, - changeParams, - initTotal, - total_count, - params, - } = props; - // const [datas, setDatas] = useState([]); - // const [sortedInfo, setSortedInfo] = useState({}); - // console.log(props); - const { pathId } = props.match.params; - const columns = [ - { - title: "序号", - dataIndex: "id", - key: "id", - render: (text, record, i) => i + 1, - width: 100, - align: "center", - }, - { - title: "使用单位", - // key: 'school_name', - dataIndex: "school_name", - // width: 300, - className: "overflow_hidden", - align: "center", - }, - { - // title: '使用课堂/个', - title: () =>- - - -使用课堂 , - // key: 'course_count', - width: 150, - dataIndex: "course_count", - align: "center", - sorter: true, - }, - { - title: () => ( -课堂学生 - ), - // key: 'student_count', - width: 150, - dataIndex: "student_count", - align: "center", - sorter: true, - }, - { - title: () => ( -选用实训/个 - ), - width: 150, - // key: 'choice_shixun_num', - dataIndex: "choice_shixun_num", - align: "center", - sorter: true, - }, - { - title: () =>选用实训/次 , - width: 150, - // key: 'choice_shixun_frequency', - dataIndex: "choice_shixun_frequency", - align: "center", - sorter: true, - }, - ]; - const sxColumns = [ - { - title: "序号", - dataIndex: "id", - render: (text, record, i) => i + 1, - width: 60, - align: "center", - }, - { - title: "章节", - dataIndex: "stage", - width: 80, - align: "center", - }, - { - title: "实训名称", - dataIndex: "shixun_name", - align: "center", - // ellipsis: true - }, - { - title: "关卡数", - dataIndex: "challenge_count", - width: 100, - align: "center", - }, - { - title: "使用课堂", - dataIndex: "course_count", - width: 110, - align: "center", - sorter: true, - }, - { - title: "使用单位", - dataIndex: "school_count", - width: 110, - align: "center", - sorter: true, - }, - { - title: "使用人数", - dataIndex: "used_count", - width: 110, - align: "center", - sorter: true, - }, - { - title: "通关人数", - dataIndex: "passed_count", - width: 110, - align: "center", - sorter: true, - }, - { - title: "评测次数", - dataIndex: "evaluate_count", - width: 110, - align: "center", - sorter: true, - }, - { - title: "通关平均时间", - dataIndex: "passed_ave_time", - width: 140, - align: "center", - render: (text) => (text && formatTime(text)) || "-", - sorter: true, - }, - ]; - const stColumns = [ - { - title: "序号", - dataIndex: "id", - render: (text, record, i) => i + 1, - width: 60, - align: "center", - }, - { - title: "姓名", - dataIndex: "username", - align: "center", - width: 200, - }, - { - title: "通关实训数", - dataIndex: "passed_myshixun_count", - align: "center", - with: 130, - render: (val) => val + "", - sorter: true, - }, - { - title: "完成关卡", - dataIndex: "passed_games_count", - align: "center", - with: 130, - render: (val) => val + "", - sorter: true, - }, - // { - // title: '代码行', - // dataIndex: 'code_line_count', - // align: 'center', - // with: 130, - // render: (val) => val + '', - // sorter: (a, b) => a.code_line_count - b.code_line_count - // }, - { - title: "评测次数", - dataIndex: "evaluate_count", - align: "center", - with: 130, - render: (val) => val + "", - sorter: true, - }, - { - title: "所用时间", - dataIndex: "cost_time", - align: "center", - with: 200, - render: (text) => (text && formatTime(text)) || "-", - sorter: true, - }, - ]; - - useEffect(() => { - changeParams({ - page: 1, - type: "subject_info", - }); - pathId && staticList(pathId); - }, []); - - const handleFetchData = () => { - pathId && staticList(pathId); - }; - - // const { - // study_count, - // course_study_count, - // initiative_study, - // passed_count, - // course_used_count, - // school_used_count - // } = subject_info; - - const maps = { - 1: "subject_info", // 实践课程使用情况 - 2: "shixun_info", // 实训使用情况 - 3: "user_info", // 用户使用情况 - }; - - const handleTabChange = (key) => { - const type = maps[+key]; - // console.log(type); - const params = { - page: 1, - type: type, - sort_by: undefined, - sort_direction: undefined, - }; - // 恢复初始值 - changeParams(params); - initTotal(); - pathId && staticList(pathId); - }; - const paginationProps = { - hideOnSinglePage: true, - current: params.page, - pageSize: params.limit, - total: total_count, - onChange: (page, pageSize) => { - changeParams({ - page, - limit: pageSize, - }); - handleFetchData(); - }, - }; - //改为后端排序 issues/29182 - const handleTableChange = (pagination, filters, sorter) => { - console.log(pagination, filters, sorter); - const { field, order } = sorter; - let sort_direction; - if (order === "descend") { - sort_direction = "desc"; - } else if (order === "ascend") { - sort_direction = "asc"; - } - changeParams({ - sort_by: sort_direction ? field : undefined, - sort_direction, - }); - handleFetchData(); - }; - return ( --- ); -}; - -const mapStateToProps = (state) => { - const { - staticReducer: { subject_info, other_info, total, total_count, params }, - } = state; - return { - subject_info, - other_info, - total, - total_count, - params, - }; -}; - -const mapDispatchToProps = (dispatch) => ({ - staticList: (id) => dispatch(actions.staticList(id)), - changeParams: (params) => dispatch(actions.changeParams(params)), - initTotal: () => dispatch(actions.initTotal()), -}); - -export default connect(mapStateToProps, mapDispatchToProps)(App); -// export default App; diff --git a/src/modules/paths/statics/index.scss b/src/modules/paths/statics/index.scss deleted file mode 100644 index 9b74791fa..000000000 --- a/src/modules/paths/statics/index.scss +++ /dev/null @@ -1,156 +0,0 @@ -.static_wrap { - .static_section_header, - .static_section_table{ - background-color: #fff; - border-radius: 5px; - padding: 30px 20px 0; - margin-top: 20px; - } - - .static_section_table{ - margin-bottom: 140px; - padding-top: 5px; - } - - .static_section_header{ - .header_title{ - line-height: 1; - .title-p, - .title-sub{ - display: inline-block; - vertical-align: bottom; - color: #303133; - } - - .title-p{ - position: relative; - font-size: 20px; - height: 20px; - line-height: 1; - font-weight: bold; - - &::before{ - //position: absolute; - //content: ''; - //border-left: 1px solid rgba(192,196,204,1); - //right: -10px; - //top: 2px; - //bottom: 0px; - //margin-left: 10px; - } - } - .title-sub{ - margin-left: 20px; - font-size: 16px; - max-width: 1000px; - overflow: hidden; - text-overflow:ellipsis; - white-space: nowrap; - vertical-align: bottom; - } - } - - .header-number{ - height: 158px; - } - .header-flex{ - display: flex; - justify-content: space-around; - align-items: center; - - .static-flex-item{ - display: flex; - flex-direction: column; - justify-content: center; - .item-count{ - font-size: 24px; - color: #4CACFF; - font-weight: bold; - } - .item-txt{ - font-size: 14px; - line-height: 1.5; - text-align: center; - color: #909399; - margin-top: 20px; - .icon{ - margin-left: 5px; - font-size: 16px !important; - } - } - } - } - } - // .static_table{ - // // .ant-table-header{ - // // overflow: hidden !important; - // // margin-bottom: 0px !important; - // // } - // // .ant-table-row-cell-break-word{ - // // background: rgba(241,248,255,1) !important; - // // } - - // // .overflow_hidden{ - // // max-width: 280px; - // // overflow: hidden; - // // text-overflow:ellipsis; - // // white-space: nowrap; - // // } - // } - .static_table{ - .ant-table-header{ - margin-bottom: 0px !important; - overflow: hidden !important; - } - .ant-table-thead{ - th{ - background: rgba(241,248,255,1); - - } - .ant-table-column-title{ - color: #303133; - font-weight: bold; - } - } - .ant-table-tbody tr:nth-child(2n) { - td{ - background: rgba(241,248,255,.4); - } - } - .ant-table-tbody tr td{ - color: #303133; - } - } - - .ant-table-footer{ - background-color: rgba(241,248,255,1); - padding: 16px 0px; - } - .footer_list{ - display: flex; - // background: #fff; - box-sizing: border-box; - text-align: center; - - li{ - color: #303133; - } - // border-top: 1px solid green; - .footer_item{ - width: 150px; - } - .footer_item:not(:first-child) { - padding-right: 10px; - } - .footer-total{ - width: 100px; - } - .footer_name{ - flex: 1; - } - } -} - -.tool-clazz{ - max-width: 200px !important; -} diff --git a/src/modules/paths/statics/mockData.js b/src/modules/paths/statics/mockData.js deleted file mode 100644 index 693bb051c..000000000 --- a/src/modules/paths/statics/mockData.js +++ /dev/null @@ -1,99 +0,0 @@ -/* - * @Description: 模拟数据 - * @Author: tangjiang - * @Github: - * @Date: 2020-01-11 10:55:33 - * @LastEditors : tangjiang - * @LastEditTime : 2020-01-14 09:11:36 - */ -import { random } from 'lodash'; - -const getGuid = () => - 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => { - /* eslint-disable */ - let r = (Math.random() * 16) | 0, - v = c == 'x' ? r : (r & 0x3) | 0x8; - return v.toString(16); - }); - -const fetchData = (startIndex = 0) => - new Promise(resolve => { - setTimeout(() => { - resolve( - startIndex >= 500 // 总共只有500条数据 - ? [] - : Array.from({ length: 50 }).map((_, i) => { - // 每次返回100条 - const index = startIndex + i; - return { - key: getGuid(), - index: `${index}`, - name: '湖南长沙中南大学湖南长沙中南大学湖南长沙中南大学湖南长沙中南大学湖南长沙中南大学', - age: i+1, - address: 'New York No. ', - address2: 'address2', - bbb: 'address3' - }; - }), - ); - }, random(0, 1.0) * 1000); - }); - -const columns = [ - { - title: '序号', - dataIndex: 'index', - render: text => text + 1, - width: 80, - align: 'center' - }, - { - title: '使用单位', - dataIndex: 'name', - width: 300, - className: 'overflow_hidden', - align: 'center' - }, - { - title: '使用课堂/个', - width: 200, - dataIndex: 'age', - align: 'center', - // sorter: (a, b) => a.age - b.age - }, - { - title: '课堂学生/个', - width: 200, - dataIndex: 'address', - align: 'center', - // sorter: (a, b) => a.age - b.age - }, - { - title: '选用实训/个', - width: 200, - dataIndex: 'address2', - align: 'center', - // sorter: (a, b) => a.age - b.age - }, - { - title: '选用实训/个', - width: 200, - dataIndex: 'bbb', - align: 'center', - // sorter: (a, b) => a.bbb - b.bbb - } -]; - -const sumData = [ - { - index: '合计', - key: 6, - name: 'Disabled User', - age: 99, - address: 'Sidney No.', - address2: 'address2', - bbb: 'address3', - } -]; - -export { columns, fetchData, sumData };----- -- 学习统计 - ----- - - - - - - -- -- -- {/* -*/} -- - -- - --