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

一站式bug修改. this.initExcel 方法

可能存在其他问题 要喊欢哥确认
上级 92b7c78c
...@@ -2,8 +2,13 @@ import React, { useEffect, useState, useRef } from 'react'; ...@@ -2,8 +2,13 @@ import React, { useEffect, useState, useRef } from 'react';
import ZdyTable from '@/webPublic/one_stop_public/Table'; import ZdyTable from '@/webPublic/one_stop_public/Table';
import styles from './index.less'; import styles from './index.less';
import { fetchTemplateByCode, fetchTableItem } from '@/webPublic/Services'; import { fetchTemplateByCode, fetchTableItem } from '@/webPublic/Services';
import { isJSON } from '@/webPublic/zyd_public/utils/utils';
export default function RenderForm({ get = 'web', isCg = 'yes', style, ...rest }) { export default function RenderForm({ get = 'web', isCg = 'yes', style, ...rest }) {
let content = rest?.postData?.unifiedServicePatternModel?.content;
if(isJSON(content)){
content = JSON.parse(content);
}
const tableRoot = useRef(); const tableRoot = useRef();
useEffect(() => { useEffect(() => {
const timerId = setTimeout(() => { const timerId = setTimeout(() => {
...@@ -16,12 +21,16 @@ export default function RenderForm({ get = 'web', isCg = 'yes', style, ...rest } ...@@ -16,12 +21,16 @@ export default function RenderForm({ get = 'web', isCg = 'yes', style, ...rest }
clearTimeout(timerId); clearTimeout(timerId);
} }
}, []); }, []);
if(!content){
return null;
}
return ( return (
<div className={styles.zyd_onestop_style_class} style={style}> <div className={styles.zyd_onestop_style_class} style={style}>
<ZdyTable ref={tableRoot} <ZdyTable ref={tableRoot}
get={get} get={get}
isCg={isCg} isCg={isCg}
{...rest} {...rest}
{...content}
/> />
</div> </div>
); );
......
...@@ -349,9 +349,8 @@ export default class ZdyTable extends Component { ...@@ -349,9 +349,8 @@ export default class ZdyTable extends Component {
}; };
configs; configs;
initExcel = (configs, callback) => { initExcel = (configs, callback) => {
if (configs == null || configs.trees == null){ if (configs == null || configs.trees == null){
if (callback) callback(); // if (callback) callback();
return ; return ;
} }
...@@ -632,6 +631,7 @@ export default class ZdyTable extends Component { ...@@ -632,6 +631,7 @@ export default class ZdyTable extends Component {
isWebPrint, // 打印界面 isWebPrint, // 打印界面
isWebPrintEnd, isWebPrintEnd,
isPreview, isPreview,
trees,
} = this.props; } = this.props;
let style = {}; let style = {};
if (formConfig.style != null) { if (formConfig.style != null) {
...@@ -848,6 +848,7 @@ export default class ZdyTable extends Component { ...@@ -848,6 +848,7 @@ export default class ZdyTable extends Component {
messageData={messageData} // 场景设计器共享变量参数 messageData={messageData} // 场景设计器共享变量参数
concealModel={concealModel || {}} // 场景设计器内置路由跳转函数 concealModel={concealModel || {}} // 场景设计器内置路由跳转函数
isDynamic={isDynamic} // 是否为场景配置器调用 isDynamic={isDynamic} // 是否为场景配置器调用
trees={trees}
/> />
</td> </td>
); );
......
...@@ -1450,7 +1450,6 @@ export default class tableCom extends Component { ...@@ -1450,7 +1450,6 @@ export default class tableCom extends Component {
currentFormTitle, currentFormTitle,
getCellValue getCellValue
} = this.props; } = this.props;
const { options, labels, selectDis, modalCode, modalTitle, modalInit, modalProps } = this.state; const { options, labels, selectDis, modalCode, modalTitle, modalInit, modalProps } = this.state;
const { getFieldDecorator, getFieldError, getFieldProps } = this.props.form; const { getFieldDecorator, getFieldError, getFieldProps } = this.props.form;
const disabled = json != null ? json.disabled : false; const disabled = json != null ? json.disabled : false;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论