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

增加移动端card 组件

上级 1ba7dffb
import React, { Fragment, useEffect, useRef } from 'react';
import { WhiteSpace, WingBlank } from 'antd-mobile';
export default function MobileCard(props) {
const { value = {}, onChange, json, otherProps = {} } = props;
useEffect(() => {}, [value]);
const dataSource = value?.dataSource || [
{
name: '罗成',
type: '待知晓',
time: '2022-04-14 16:31:05',
},
];
const { columns, primaryKey } = otherProps;
console.log(columns);
return (
<>
{dataSource.map((g, index) => {
return (
<div key={g[primaryKey]} style={{
padding: '15px 0',
backgroundColor: '#ebebef',
}}>
<WingBlank>
{columns.map((c, cIndex) => {
return <div key={c.key}>
111222333444
</div>;
})}
</WingBlank>
</div>);
})}
</>
);
}
...@@ -69,6 +69,7 @@ import PictureSignature, { ...@@ -69,6 +69,7 @@ import PictureSignature, {
SignArray, SignArray,
} from '@/webPublic/one_stop_public/libs/PictureSignature/PictureSignature'; } from '@/webPublic/one_stop_public/libs/PictureSignature/PictureSignature';
import WangEditor from '@/webPublic/zyd_public/WangEditor/OnstopWang'; import WangEditor from '@/webPublic/zyd_public/WangEditor/OnstopWang';
import MobileCard from './Split_Index/MobileCard/index';
import { noPrefixRequest, uaaRequest } from '@/webPublic/one_stop_public/utils/request'; import { noPrefixRequest, uaaRequest } from '@/webPublic/one_stop_public/utils/request';
import RangePickerDiy, { import RangePickerDiy, {
getMomentArr, getMomentArr,
...@@ -2131,6 +2132,13 @@ export default class TableCom extends Component { ...@@ -2131,6 +2132,13 @@ export default class TableCom extends Component {
/> />
); );
break; break;
case 'MobileCard':
let value = obj[dataColumn.base52];
if (!value || value === 'null') {
return <div/>;
}
cm = <MobileCard value={value}/>;
break;
case 'WangEditor': case 'WangEditor':
let textV = obj[dataColumn.base52]; let textV = obj[dataColumn.base52];
if (!textV || textV === 'null') { if (!textV || textV === 'null') {
...@@ -3554,6 +3562,25 @@ ${obj[dataColumn.base52]} ...@@ -3554,6 +3562,25 @@ ${obj[dataColumn.base52]}
], ],
})(<WangEditor json={json} dataColumn={dataColumn} disabled={disabled} uuid={uuid}/>); })(<WangEditor json={json} dataColumn={dataColumn} disabled={disabled} uuid={uuid}/>);
break; break;
case 'MobileCard':
if (json?.otherProps) {
otherProps = json?.otherProps;
try {
// mode = multiple 就支持下拉多选了
otherProps = new Function(otherProps)();
} catch (e) {
otherProps = {};
}
}
cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue,
})(
<MobileCard
json={json}
uuid={uuid}
otherProps={otherProps}
/>);
break;
case 'RichText': case 'RichText':
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue, initialValue: initValue,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论