提交 81ed3047 authored 作者: 钟是志's avatar 钟是志

34150 学生提交的工作内容,老师收到的表,日期安顺序排列

上级 99ea70fd
...@@ -4,6 +4,15 @@ import ZdyTable from '../Table'; ...@@ -4,6 +4,15 @@ import ZdyTable from '../Table';
import { getOrderUid } from './splitChildForm'; import { getOrderUid } from './splitChildForm';
import { Card } from 'antd-mobile'; import { Card } from 'antd-mobile';
const sortKeys = (a = '', b = '') => {
if (a && b && typeof a === 'string' && typeof b === 'string' && a.length > 13 && b.length > 13) {
return Number(a.slice(0, 13)) - Number(b.slice(0, 13));
} else {
return 0;
}
};
export default class ChildForm extends React.Component { export default class ChildForm extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -12,7 +21,7 @@ export default class ChildForm extends React.Component { ...@@ -12,7 +21,7 @@ export default class ChildForm extends React.Component {
this.state = value; this.state = value;
} }
triggerChange = changedValue => { triggerChange = (changedValue) => {
const onChange = this.props.onChange; const onChange = this.props.onChange;
if (onChange) { if (onChange) {
onChange(changedValue); onChange(changedValue);
...@@ -53,7 +62,7 @@ export default class ChildForm extends React.Component { ...@@ -53,7 +62,7 @@ export default class ChildForm extends React.Component {
} }
} }
}; };
delete = uuid => { delete = (uuid) => {
const objs = this.state; const objs = this.state;
const { const {
json: { numCode }, json: { numCode },
...@@ -140,12 +149,17 @@ export default class ChildForm extends React.Component { ...@@ -140,12 +149,17 @@ export default class ChildForm extends React.Component {
} }
if (isMobile) { if (isMobile) {
return ( // 2022年11月24日 姚新国说的 把干掉两翼留白 解决北电科工作情况考核 移动端样式的问题 return (
// 2022年11月24日 姚新国说的 把干掉两翼留白 解决北电科工作情况考核 移动端样式的问题
<div> <div>
{Object.keys(objs).length >= 1 || rights.includes('add') ? ( {Object.keys(objs).length >= 1 || rights.includes('add') ? (
<Card> <Card>
<Card.Body style={{ minHeight: 10 }}> <Card.Body style={{ minHeight: 10 }}>
{Object.keys(objs).map(r => { {Object.keys(objs)
.sort((a, b) => {
return sortKeys(a,b);
})
.map((r) => {
if (r == '') { if (r == '') {
return ''; return '';
} }
...@@ -155,8 +169,7 @@ export default class ChildForm extends React.Component { ...@@ -155,8 +169,7 @@ export default class ChildForm extends React.Component {
style={{ style={{
zIndex: 55, zIndex: 55,
}} }}
span={isEdit ? 24 : span} span={isEdit ? 24 : span}>
>
<ZdyTable <ZdyTable
changedValues={this.props.changedValues} changedValues={this.props.changedValues}
setRealTimeValues={this.props.setRealTimeValues} setRealTimeValues={this.props.setRealTimeValues}
...@@ -210,8 +223,7 @@ export default class ChildForm extends React.Component { ...@@ -210,8 +223,7 @@ export default class ChildForm extends React.Component {
type="primary" type="primary"
size="small" size="small"
style={{ margin: 'auto' }} style={{ margin: 'auto' }}
onClick={this.add} onClick={this.add}>
>
{addName || '新增'} {addName || '新增'}
</Button>{' '} </Button>{' '}
</Col> </Col>
...@@ -228,14 +240,17 @@ export default class ChildForm extends React.Component { ...@@ -228,14 +240,17 @@ export default class ChildForm extends React.Component {
); );
} }
/*** /***
* 子表单 * 子表单
* */ * */
return ( return (
<div style={{ width: '100%' }}> <div style={{ width: '100%' }}>
<Row gutter={gutter}> <Row gutter={gutter}>
{Object.keys(objs).map(r => { {Object.keys(objs)
.sort((a, b) => {
return sortKeys(a,b);
})
.map((r) => {
if (r == '') { if (r == '') {
return ''; return '';
} }
...@@ -288,8 +303,7 @@ export default class ChildForm extends React.Component { ...@@ -288,8 +303,7 @@ export default class ChildForm extends React.Component {
lineHeight: '10px', lineHeight: '10px',
}} }}
type="danger" type="danger"
onClick={this.delete.bind(this, r)} onClick={this.delete.bind(this, r)}>
>
{deleteName || '-'} {deleteName || '-'}
</Button> </Button>
) : ( ) : (
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论