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

编辑器修改

上级 e08cf547
...@@ -49,14 +49,15 @@ function EditDrawer(props) { ...@@ -49,14 +49,15 @@ function EditDrawer(props) {
// TODO localStorage 事件中获取的state 不是最新的. // TODO localStorage 事件中获取的state 不是最新的.
const handleLocalStorageSave = (e) => { const handleLocalStorageSave = (e) => {
if (e.key === 'edit-low-code-local') { if (e.key === 'save-low-code-local') {
const newV = e.newValue; const newV = e.newValue;
if (newV && newV.length > 20) { if (newV && newV.length > 20) {
changeKey(newV, 'beforeShow'); changeKey(newV, 'beforeShow');
if (!saveTimeOut.current) { if (!saveTimeOut.current) {
// saveTimeOut.current = window.setTimeout(() => { saveTimeOut.current = window.setTimeout(() => {
// handleSaveTemplate(); message.info('正在保存');
// }, 500); handleSaveTemplate();
}, 500);
} }
} }
} }
...@@ -75,11 +76,11 @@ function EditDrawer(props) { ...@@ -75,11 +76,11 @@ function EditDrawer(props) {
); );
const editFullScreen = () => { const editFullScreen = () => {
localStorage.setItem('edit-low-code-local', lowCodeEdit['beforeShow']); localStorage.setItem('edit-low-code-local', JSON.stringify(lowCodeEdit));
if(process.env.NODE_ENV === 'development'){ if(process.env.NODE_ENV === 'development'){
window.open('http://scjoyedu.eicp.net:51352/wisdomSchool/#/quanPingBianji'); window.open('http://scjoyedu.eicp.net:51352/wisdomSchool/#/quanPingBianji?id=' + lowCodeEdit.TEMPLATE);
} }
window.open(window.location.origin + '/wisdomSchool/#/quanPingBianji'); window.open(window.location.origin + '/wisdomSchool/#/quanPingBianji?id=' + lowCodeEdit.TEMPLATE);
}; };
return ( return (
...@@ -108,9 +109,10 @@ function EditDrawer(props) { ...@@ -108,9 +109,10 @@ function EditDrawer(props) {
maxRows: 20, maxRows: 20,
}} }}
defaultValue={lowCodeEdit?.beforeShow || ''} defaultValue={lowCodeEdit?.beforeShow || ''}
onChange={(e) => { readOnly={true}
changeKey(e.target.value, 'beforeShow'); // onChange={(e) => {
}} // changeKey(e.target.value, 'beforeShow');
// }}
// readOnly={true} // readOnly={true}
style={{ marginBottom: '20px' }} style={{ marginBottom: '20px' }}
/> />
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论