Commit 45412787 by chenshu

fix:修复

parent 6a3be2e9
...@@ -6,8 +6,7 @@ function XMTable(props) { ...@@ -6,8 +6,7 @@ function XMTable(props) {
const [data, setData] = useState({}); const [data, setData] = useState({});
useEffect(() => { useEffect(() => {
setEmpty(props.renderEmpty) setEmpty(props.renderEmpty || {})
delete props.renderEmpty;
setData(props); setData(props);
}, [props]); }, [props]);
...@@ -25,7 +24,7 @@ function XMTable(props) { ...@@ -25,7 +24,7 @@ function XMTable(props) {
}; };
return ( return (
<ConfigProvider renderEmpty={customizeRenderEmpty}> <ConfigProvider className="xm-table-component" renderEmpty={customizeRenderEmpty}>
<Table <Table
{...data} {...data}
/> />
......
.xm-table-component {
}
\ No newline at end of file
/* /*
* @Author: wufan * @Author: wufan
* @Date: 2020-11-26 14:48:57 * @Date: 2020-11-26 14:48:57
* @Last Modified by: mikey.zhaopeng * @Last Modified by: chenshu
* @Last Modified time: 2020-11-26 14:52:02 * @Last Modified time: 2021-06-03 15:21:09
*/ */
import SearchBar from './SearchBar.tsx'; import SearchBar from './SearchBar.tsx';
...@@ -10,6 +10,7 @@ import PageControl from './PageControl.tsx'; ...@@ -10,6 +10,7 @@ import PageControl from './PageControl.tsx';
import CheckBox from './CheckBox.tsx'; import CheckBox from './CheckBox.tsx';
import CropperModal from './CropperModal.tsx'; import CropperModal from './CropperModal.tsx';
import ImgCutModalNew from './ImgCutModalNew'; import ImgCutModalNew from './ImgCutModalNew';
import XMTable from './XMTable';
export { export {
...@@ -17,5 +18,6 @@ export { ...@@ -17,5 +18,6 @@ export {
PageControl, PageControl,
CheckBox, CheckBox,
CropperModal, CropperModal,
ImgCutModalNew ImgCutModalNew,
XMTable,
} }
\ No newline at end of file
/* /*
* @Author: zhujian * @Author: zhujian
* @Date: 2018-10-10 20:49:11 * @Date: 2018-10-10 20:49:11
* @Last Modified by: zhujiapeng * @Last Modified by: chenshu
* @Last Modified time: 2020-11-16 17:02:11 * @Last Modified time: 2021-06-03 16:42:22
*/ */
// import './s.less' // import './s.less'
...@@ -42,6 +42,7 @@ class DefaultIcon extends React.Component { ...@@ -42,6 +42,7 @@ class DefaultIcon extends React.Component {
preserveAspectRatio: 'xMidYMid slice' preserveAspectRatio: 'xMidYMid slice'
} }
} }
console.log(defaultOptions, this.props, 777777)
return ( return (
<div style={this.props.style} className="DefaultIcon" key="icon"> <div style={this.props.style} className="DefaultIcon" key="icon">
<Lottie <Lottie
......
...@@ -7,17 +7,19 @@ ...@@ -7,17 +7,19 @@
* @Copyright: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyright: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import React from "react" import React from "react";
import { Table, Modal, message, Tooltip, Switch, Dropdown, Button } from "antd" import { Modal, message, Tooltip, Switch, Dropdown, Button } from "antd";
import { Route, withRouter } from "react-router-dom" import { Route, withRouter } from "react-router-dom";
import { PageControl } from "@/components" import Lottie from 'react-lottie';
import { LIVE_SHARE_MAP } from "@/common/constants/academic/cloudClass" import { PageControl, XMTable } from "@/components";
import { appId, shareUrl, LIVE_SHARE } from "@/domains/course-domain/constants" import { LIVE_SHARE_MAP } from "@/common/constants/academic/cloudClass";
import ScanFileModal from "../../resource-disk/modal/ScanFileModal" import { appId, shareUrl, LIVE_SHARE } from "@/domains/course-domain/constants";
import WatchData from "./WatchData" import ScanFileModal from "../../resource-disk/modal/ScanFileModal";
import KnowledgeAPI from "@/data-source/knowledge/request-api" import WatchData from "./WatchData";
import ENUM from "../ENUM.js" import KnowledgeAPI from "@/data-source/knowledge/request-api";
import "./KnowledgeBaseList.less" import ENUM from "../ENUM.js";
import * as studentData from '../../lottie/student/data.json';
import "./KnowledgeBaseList.less";
const DEFAULT_SIZE_UNIT = 1000 * 1000 // 将B转换成M const DEFAULT_SIZE_UNIT = 1000 * 1000 // 将B转换成M
const { confirm } = Modal const { confirm } = Modal
...@@ -492,9 +494,17 @@ class KnowledgeBaseList extends React.Component { ...@@ -492,9 +494,17 @@ class KnowledgeBaseList extends React.Component {
preserveSelectedRowKeys: true, preserveSelectedRowKeys: true,
onChange: onSelectChange, onChange: onSelectChange,
} }
const defaultOptions = {
loop: true,
autoplay: true,
animationData: studentData,
rendererSettings: {
preserveAspectRatio: 'xMidYMid slice'
}
}
return ( return (
<div className='knowledge-base-list'> <div className="knowledge-base-list">
<Table <XMTable
rowKey={(record) => record.id} rowKey={(record) => record.id}
rowSelection={rowSelection} rowSelection={rowSelection}
size="middle" size="middle"
...@@ -503,7 +513,19 @@ class KnowledgeBaseList extends React.Component { ...@@ -503,7 +513,19 @@ class KnowledgeBaseList extends React.Component {
pagination={false} pagination={false}
scroll={{ x: 900 }} scroll={{ x: 900 }}
bordered bordered
className='knowledge-list-table' className="knowledge-list-table"
renderEmpty={{
image: <div style={{ marginTop: 24 }}>
<Lottie
options={defaultOptions}
height={150}
width={150}
isStopped={false}
isPaused={false}
/>
</div>,
description: <span style={{ display: 'block', paddingBottom: 24 }}>暂无数据</span>
}}
/> />
<div className='box-footer'> <div className='box-footer'>
......
...@@ -77,9 +77,9 @@ export default class KnowledgeBase extends React.Component { ...@@ -77,9 +77,9 @@ export default class KnowledgeBase extends React.Component {
onSelectChange = (selectedRowKeys) => { onSelectChange = (selectedRowKeys) => {
if (selectedRowKeys.length > 50) { if (selectedRowKeys.length > 50) {
message.warning('最多只能选择50个题目'); message.warning('最多只能选择50个题目');
return null;
} }
this.setState({ selectedRowKeys }); const list = _.filter(selectedRowKeys, (item, index) => index < 50);
this.setState({ selectedRowKeys: list });
}; };
render() { render() {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -362,9 +362,9 @@ function AddExam(props: any) { ...@@ -362,9 +362,9 @@ function AddExam(props: any) {
style={{ width: 320 }} style={{ width: 320 }}
showTime={{ defaultValue: [moment().add(5, 'minutes'), moment().add(5, 'minutes')] }} showTime={{ defaultValue: [moment().add(5, 'minutes'), moment().add(5, 'minutes')] }}
ranges={{ ranges={{
'近七天': [moment(), moment().add(6, 'day').endOf('day')], '近七天': [moment().add(5, 'minute'), moment().add(6, 'day').endOf('day')],
'近1个月': [moment(), moment().add(1, 'month').endOf('day')], '近1个月': [moment().add(5, 'minute'), moment().add(1, 'month').endOf('day')],
'近3个月': [moment(), moment().add(3, 'month').endOf('day')], '近3个月': [moment().add(5, 'minute'), moment().add(3, 'month').endOf('day')],
}} }}
disabledDate={disabledDate} disabledDate={disabledDate}
value={[ value={[
......
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