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

3592 新增普查发布,有缓存

上级 03541547
......@@ -54,8 +54,7 @@ export function FormListButtons(props) {
if (!ConcatButtons || !ConcatButtons.length) {
return null;
}
console.log(ConcatButtons);
// console.log(ConcatButtons);
return ConcatButtons.map((r, i) => {
if (r.ButtonType === 'Normal') {
......
......@@ -102,21 +102,11 @@ export default function Index({
editor.create();
editor.txt.html(value);
// if (value && value.indexOf('wangEditorHtml') > -1) {
// editor.txt.html(value);
// } else {
// editor.txt.html('<div class="wangEditorHtml">' + value + '</div>');
// }
return () => {
console.log('是否销毁了editor');
console.log('销毁了editor');
editor.destroy();
};
}, []);
// useEffect(() => {
// if (value && editor && editor.txt) {
// editor.txt.html('<div class="wangEditorHtml">' + value + '</div>');
// }
// }, [value]);
return <div id={`wangEditor${domKey}`} />;
}
import React, { useState, useEffect, forwardRef } from 'react';
import React, { useState, useEffect, forwardRef, useMemo } from 'react';
import WangEditor from './OneStopWangEditor';
function Index({ onChange, value, otherProps, dataColumn, disabled, json, uuid }) {
......@@ -19,11 +19,8 @@ function Index({ onChange, value, otherProps, dataColumn, disabled, json, uuid }
if(!value || value === 'null'){
return <div></div>
}
return <div dangerouslySetInnerHTML={{__html: `<div class="wangEditorHtml">${value}</div>`}}>
</div>
return <div dangerouslySetInnerHTML={{__html: `<div class="wangEditorHtml">${value}</div>`}} />
}
return (
<WangEditor
key={'cmsContent'}
......@@ -39,19 +36,25 @@ function Index({ onChange, value, otherProps, dataColumn, disabled, json, uuid }
}
export default forwardRef((props, _ref) => {
let otherProps = {};
// console.log(props);
if(!props.uuid){
return <div></div>;
}
if (props.json?.otherProps) {
otherProps = props.json?.otherProps;
try {
otherProps = new Function(otherProps)();
// console.log(this.otherProps);
} catch (e) {
const otherProps = useMemo(() => {
let other = {};
if (props.json?.otherProps) {
let a = props.json?.otherProps;
try {
other = new Function(a)();
// console.log(this.otherProps);
} catch (e) {
other = {};
}
}
}
return other;
}, [props.json?.otherProps]);
return <Index {...props} otherProps={otherProps}/>;
});
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论