提交 0f997269 authored 作者: tb53863844's avatar tb53863844

开发

上级 a1e2d79c
......@@ -64,6 +64,7 @@ export default class DraftEditorCom extends React.Component {
constructor(props) {
super(props);
const value = props.value || {};
console.log(value);
const editorState = changeToDraftState(value)
this.state = {
......@@ -109,6 +110,16 @@ export default class DraftEditorCom extends React.Component {
};
}
componentWillReceiveProps(nextProps) {
// Should be a controlled component.
if ('value' in nextProps) {
const value = nextProps.value;
if(value instanceof Object){
const editorState = changeToDraftState2(value)
this.setState({editorState}); }
}
}
exchange=(data,editKey,callback)=>{
const blocks = changeFromDraftState2(this.state.editorState)
......
......@@ -695,9 +695,7 @@ export default class ZdyTable extends Component {
paddingBottom: paddingBottom != null ? paddingBottom : isWebPrint ? 0 : '10px',
};
if (currentFormKey) {
console.log(currentFormKey);
}
if (!isReady) return <></>;
if (this.props.postData?.isUpdate) {
updateTime = moment(+this.props.postData?.updateTime).format('llll');
......
......@@ -30,6 +30,7 @@ import UUID from 'react-native-uuid';
import QRCode from 'qrcode.react';
import { EditorState, Editor } from 'draft-js';
import MyBlockRenderer from '../App/MyBlockRender';
import CronEditor from 'antd-cron-editor';
import {
InputItem as MobileInputItem,
ImagePicker as MobileImagePicker,
......@@ -1630,6 +1631,15 @@ export default class tableCom extends Component {
</span>
);
break;
case 'Cron':
cm = (
<span style={{ paddingRight: get == 'mobile' ? 8 : '' }}>
{value}
{get === 'mobile' ? <br /> : ''}
</span>
);
break;
case 'InputNumber':
cm = (
......@@ -2444,6 +2454,7 @@ export default class tableCom extends Component {
);
break;
case 'Input':
cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue,
......@@ -2916,6 +2927,17 @@ export default class tableCom extends Component {
);
}
break;
case 'Cron':
cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue,
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请输入' + title }],
})(
<CronEditor/>
);
break;
case 'LocationCom':
cm = getFieldDecorator(dataColumn.base52, {
initialValue: {},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论