Commit b4af70e4 authored by 李纪文's avatar 李纪文

fix: 在线修改修改

parent 3d65dcec
...@@ -100,6 +100,7 @@ const ConfigurationView = (props) => { ...@@ -100,6 +100,7 @@ const ConfigurationView = (props) => {
const AuthorFrom = useRef(); const AuthorFrom = useRef();
const ConfigurationRef = useRef(); const ConfigurationRef = useRef();
const DomRef = useRef(); const DomRef = useRef();
const TwoRef = useRef();
const ConfigurationViewRef = useCallback((dom) => { const ConfigurationViewRef = useCallback((dom) => {
if (DomRef) DomRef.current = !!dom; if (DomRef) DomRef.current = !!dom;
setDomFlag(!!dom); setDomFlag(!!dom);
...@@ -857,7 +858,7 @@ const ConfigurationView = (props) => { ...@@ -857,7 +858,7 @@ const ConfigurationView = (props) => {
}, [noInitial, domFlag]); }, [noInitial, domFlag]);
useEffect(() => { useEffect(() => {
twoID = `TDG${Date.now().toString(36)}`; TwoRef.current = `TDG${Date.now().toString(36)}`;
if (!props.name) { if (!props.name) {
setDescription('咦~工艺图配置信息不全哦~'); setDescription('咦~工艺图配置信息不全哦~');
setIsEmpty(true); setIsEmpty(true);
...@@ -1552,7 +1553,7 @@ const ConfigurationView = (props) => { ...@@ -1552,7 +1553,7 @@ const ConfigurationView = (props) => {
const diagramRender = (jsonStr, chartInfo) => { const diagramRender = (jsonStr, chartInfo) => {
myDiagram = goJS( myDiagram = goJS(
go.Diagram, go.Diagram,
twoID, // must name or refer to the DIV HTML element TwoRef.current, // must name or refer to the DIV HTML element
{ {
initialContentAlignment: go.Spot.Center, initialContentAlignment: go.Spot.Center,
contentAlignment: go.Spot.Center, contentAlignment: go.Spot.Center,
...@@ -3056,7 +3057,7 @@ const ConfigurationView = (props) => { ...@@ -3056,7 +3057,7 @@ const ConfigurationView = (props) => {
return ( return (
<div className={classNames(prefixCls)} ref={ConfigurationRef}> <div className={classNames(prefixCls)} ref={ConfigurationRef}>
<div id={twoID} ref={ConfigurationViewRef} className={classNames('configurationView')}> <div id={TwoRef.current} ref={ConfigurationViewRef} className={classNames('configurationView')}>
{/* <LoadBox spinning={spinning} /> */} {/* <LoadBox spinning={spinning} /> */}
{isEmpty && <Empty theme={'dark'} description={description} />} {isEmpty && <Empty theme={'dark'} description={description} />}
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment