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

优化移动端代码

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