提交 8898a447 authored 作者: 钟是志's avatar 钟是志

22908 宿舍违纪管理/宿舍违纪上报申请,2001010250 选择多人上报 时 点击选择 弹出的界面优化下

上级 444a3263
...@@ -28,7 +28,7 @@ import QRCode from 'qrcode.react'; ...@@ -28,7 +28,7 @@ import QRCode from 'qrcode.react';
import { Editor } from 'draft-js'; import { Editor } from 'draft-js';
import MyBlockRenderer from '../App/MyBlockRender'; import MyBlockRenderer from '../App/MyBlockRender';
import CronEditor from 'antd-cron-editor'; import CronEditor from 'antd-cron-editor';
import { Card, Flex, List as MobileList, Switch as MobileSwitch, List } from 'antd-mobile'; import { Card, Flex, List as MobileList, Switch as MobileSwitch, List } from 'antd-mobile';
import ReactEcharts from 'echarts-for-react'; import ReactEcharts from 'echarts-for-react';
import ZdyTable from '../Table/index'; import ZdyTable from '../Table/index';
import { connect } from 'dva'; import { connect } from 'dva';
...@@ -383,6 +383,16 @@ export default class tableCom extends Component { ...@@ -383,6 +383,16 @@ export default class tableCom extends Component {
) { ) {
column.render = val => moment(val).format('YYYY-MM-DD HH:mm:ss'); column.render = val => moment(val).format('YYYY-MM-DD HH:mm:ss');
} }
if (!column.render) { // 超过30个字的字段 自动隐藏
column.render = (text, record) => {
if (text && typeof text === 'string' && text.length > 30) {
return <span title={text}>{text.slice(0, 30)}</span>;
}
};
}
columns.push(column); columns.push(column);
} else { } else {
break; break;
...@@ -424,6 +434,14 @@ export default class tableCom extends Component { ...@@ -424,6 +434,14 @@ export default class tableCom extends Component {
}; };
} }
if (!column.render) { // 超过30个字的字段 自动隐藏
column.render = (text, record) => {
if (text && typeof text === 'string' && text.length > 30) {
return <span title={text}>{text.slice(0, 30)}</span>;
}
};
}
columns.push(column); columns.push(column);
} }
this.setState({ columns }); this.setState({ columns });
...@@ -458,6 +476,14 @@ export default class tableCom extends Component { ...@@ -458,6 +476,14 @@ export default class tableCom extends Component {
if (['DATE', 'DATETIME', 'TIME', 'TIMESTAMP', 'YEAR'].includes(datas[i].type)) { if (['DATE', 'DATETIME', 'TIME', 'TIMESTAMP', 'YEAR'].includes(datas[i].type)) {
column.render = val => moment(val).format('YYYY-MM-DD HH:mm:ss'); column.render = val => moment(val).format('YYYY-MM-DD HH:mm:ss');
} }
if (!column.render) { // 超过30个字的字段 自动隐藏
column.render = (text, record) => {
if (text && typeof text === 'string' && text.length > 30) {
return <span title={text}>{text.slice(0, 30)}</span>;
}
};
}
columns.push(column); columns.push(column);
} else { } else {
break; break;
...@@ -1322,7 +1348,7 @@ export default class tableCom extends Component { ...@@ -1322,7 +1348,7 @@ export default class tableCom extends Component {
const { getFieldDecorator, getFieldError, getFieldProps } = this.props.form; const { getFieldDecorator, getFieldError, getFieldProps } = this.props.form;
const disabled = json != null ? json.disabled : false; const disabled = json != null ? json.disabled : false;
const permRank = json != null ? (json.permRank != null ? json.permRank : 0) : 0; const permRank = json != null ? (json.permRank != null ? json.permRank : 0) : 0;
if(json?.label === '账号'){ if (json?.label === '账号') {
console.log(json); console.log(json);
} }
if (json == null) { if (json == null) {
...@@ -2023,17 +2049,17 @@ export default class tableCom extends Component { ...@@ -2023,17 +2049,17 @@ export default class tableCom extends Component {
if (get === 'web' && !this.props.isPrint) { if (get === 'web' && !this.props.isPrint) {
return ( return (
<li key={index2}> <li key={index2}>
<FilePreview path={queryApiActionPath() + f.path} <FilePreview
pathName={f.name} path={queryApiActionPath() + f.path}
type={'UploadCom'}/> pathName={f.name}
type={'UploadCom'}
/>
</li> </li>
); );
} }
return ( return (
<li key={index2}> <li key={index2}>
<a target="_blank" <a target="_blank" key={f.path} href={queryApiActionPath() + f.path}>
key={f.path}
href={queryApiActionPath() + f.path}>
{f.name} {f.name}
</a> </a>
</li> </li>
...@@ -2059,7 +2085,11 @@ export default class tableCom extends Component { ...@@ -2059,7 +2085,11 @@ export default class tableCom extends Component {
if (get === 'web' || !this.props.isPrint) { if (get === 'web' || !this.props.isPrint) {
return ( return (
<li key={index2}> <li key={index2}>
<FilePreview path={queryApiActionPath() + f.path} pathName={f.name} type={'UploadCom'}/> <FilePreview
path={queryApiActionPath() + f.path}
pathName={f.name}
type={'UploadCom'}
/>
</li> </li>
); );
} }
...@@ -2265,8 +2295,7 @@ export default class tableCom extends Component { ...@@ -2265,8 +2295,7 @@ export default class tableCom extends Component {
); );
break; break;
} }
} } else {
else {
//编辑模式 //编辑模式
if (json.vlds && json.vlds.length > 0) { if (json.vlds && json.vlds.length > 0) {
for (let i in json.vlds) { for (let i in json.vlds) {
...@@ -2793,7 +2822,7 @@ export default class tableCom extends Component { ...@@ -2793,7 +2822,7 @@ export default class tableCom extends Component {
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [{ required: required, message: '请选择起止时间' }], : [{ required: required, message: '请选择起止时间' }],
})(<MobileDate disabled={disabled} formate={json.format} required={required}/>); })(<MobileDate disabled={disabled} formate={json.format} required={required} />);
if ( if (
((json.isMobileLabel != null && json.isMobileLabel) || ((json.isMobileLabel != null && json.isMobileLabel) ||
(json.isMobileLabel == null && json.isLabel)) && (json.isMobileLabel == null && json.isLabel)) &&
...@@ -3206,7 +3235,9 @@ export default class tableCom extends Component { ...@@ -3206,7 +3235,9 @@ export default class tableCom extends Component {
) : ( ) : (
'' ''
)} )}
<List.Item extra={cm} multipleLine={true}>{title}</List.Item> <List.Item extra={cm} multipleLine={true}>
{title}
</List.Item>
{/*<Card.Header title={<span style={{ fontSize: 14 }}>{title}: {cm}</span>} />*/} {/*<Card.Header title={<span style={{ fontSize: 14 }}>{title}: {cm}</span>} />*/}
{/*移动端只读模式 组件修改*/} {/*移动端只读模式 组件修改*/}
{/*<Card.Body>{cm}</Card.Body>*/} {/*<Card.Body>{cm}</Card.Body>*/}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论