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

优化移动端代码

上级 3cd60082
...@@ -385,7 +385,7 @@ export default class ZdyTable extends Component { ...@@ -385,7 +385,7 @@ export default class ZdyTable extends Component {
configs; configs;
initExcel = (configs, callback) => { initExcel = (configs, callback) => {
this.configs = configs; this.configs = configs;
console.log(configs); // console.log(configs);
if (configs == null || configs.trees == null) { if (configs == null || configs.trees == null) {
if (callback) callback(); if (callback) callback();
return; return;
......
...@@ -5,14 +5,11 @@ import React, { Component } from 'react'; ...@@ -5,14 +5,11 @@ import React, { Component } from 'react';
import { Row, Col } from 'antd'; import { Row, Col } from 'antd';
import TableCom from '../tableCompon/index'; import TableCom from '../tableCompon/index';
export default class isNewTable extends Component { export default class IsNewTable extends Component {
render() { render() {
const { const {
isRowCol,
items, items,
checkAllHidden, checkAllHidden,
isBorder,
borderStyle,
fatherCode, fatherCode,
userId, userId,
index, index,
...@@ -23,15 +20,12 @@ export default class isNewTable extends Component { ...@@ -23,15 +20,12 @@ export default class isNewTable extends Component {
get, get,
obj, obj,
mapData, mapData,
form,
sqlData, sqlData,
defaultValues, defaultValues,
width,
routerState, routerState,
messageData, messageData,
formCode, formCode,
formId, formId,
fatherObj,
style, style,
isPreview, isPreview,
modalInit, modalInit,
...@@ -51,7 +45,7 @@ export default class isNewTable extends Component { ...@@ -51,7 +45,7 @@ export default class isNewTable extends Component {
const allhidden = checkAllHidden(items); const allhidden = checkAllHidden(items);
return ( return (
<div <div
key={i} key={item && Array.isArray(item) && item.length > 0 ? item[0].uuid : i}
style={{ style={{
marginTop: 0, marginTop: 0,
background: '#ffffff', background: '#ffffff',
...@@ -73,6 +67,7 @@ export default class isNewTable extends Component { ...@@ -73,6 +67,7 @@ export default class isNewTable extends Component {
'' ''
) : ( ) : (
<div <div
key={ary.uuid || j}
style={{ style={{
...styles, ...styles,
textAlign: 'left', textAlign: 'left',
...@@ -133,6 +128,7 @@ export default class isNewTable extends Component { ...@@ -133,6 +128,7 @@ export default class isNewTable extends Component {
const allhidden = checkAllHidden(items); const allhidden = checkAllHidden(items);
return ( return (
<Row <Row
key={item && Array.isArray(item) && item.length > 0 ? item[0].uuid : i}
style={{ style={{
...style, ...style,
}}> }}>
...@@ -148,6 +144,7 @@ export default class isNewTable extends Component { ...@@ -148,6 +144,7 @@ export default class isNewTable extends Component {
if (ary.content?.comName === 'Label') { if (ary.content?.comName === 'Label') {
return ( return (
<Col <Col
key={ary.uuid || j}
style={{ style={{
display: display:
ary.content && ary.content &&
...@@ -202,6 +199,7 @@ export default class isNewTable extends Component { ...@@ -202,6 +199,7 @@ export default class isNewTable extends Component {
} }
return ( return (
<Col <Col
key={ary.uuid || j}
span={24} span={24}
style={{ style={{
display: display:
......
import React, {useMemo} from 'react'; import React, {useMemo, Component} from 'react';
import {List, Picker} from 'antd-mobile'; import {List, Picker} from 'antd-mobile';
import styles from './styles.less'; import styles from './styles.less';
...@@ -20,11 +20,14 @@ const getItemChildren = (childrenList, parent) => { ...@@ -20,11 +20,14 @@ const getItemChildren = (childrenList, parent) => {
return childrenList; return childrenList;
} }
export default function MobileCascader(props) { // 级联选择 export default class MobileCascader extends Component{
const {onChange, options, label, disabled, value, json, otherProps} = props; constructor(props) {
super(props);
}
render() {
const {onChange, options, label, disabled, value, json, otherProps} = this.props;
// console.log(props); // console.log(props);
let opt = useMemo(() => { let opt = options &&
return options &&
Array.isArray(options) && Array.isArray(options) &&
options.map((x) => { options.map((x) => {
return { return {
...@@ -33,7 +36,6 @@ export default function MobileCascader(props) { // 级联选择 ...@@ -33,7 +36,6 @@ export default function MobileCascader(props) { // 级联选择
children: getItemChildren(x.children, x), children: getItemChildren(x.children, x),
}; };
}); });
}, [options]);
return ( return (
<div className={styles.mobileFormInput}> <div className={styles.mobileFormInput}>
<Picker <Picker
...@@ -55,4 +57,10 @@ export default function MobileCascader(props) { // 级联选择 ...@@ -55,4 +57,10 @@ export default function MobileCascader(props) { // 级联选择
</Picker> </Picker>
</div> </div>
); );
}
} }
//
//
// export default function MobileCascader(props) { // 级联选择
//
// }
...@@ -2651,13 +2651,18 @@ export default class tableCom extends Component { ...@@ -2651,13 +2651,18 @@ export default class tableCom extends Component {
/>, />,
); );
if (get === 'mobile') { if (get === 'mobile') {
console.log(json.vlds);
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue, initialValue: initValue,
rules: rules:
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [{ required: required, message: '请选择' + dataColumn.title }], : [{ required: required, message: '请选择' + dataColumn.title }],
})(<MobileCascader options={options} label={title} disabled={disabled} json={json} />); })(<MobileCascader options={options}
label={title}
disabled={disabled}
json={json}
/>);
} }
if ( if (
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论