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

开发

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