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

Merge remote-tracking branch 'origin/master'

import React, { useEffect, useState } from 'react'; 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';
export default function RenderForm({ get = 'web', isCg = 'yes', ...rest }) { export default function RenderForm({ get = 'web', isCg = 'yes', ...rest }) {
const tableRoot = useRef();
useEffect(() => {
const timerId = setTimeout(() => {
const div = tableRoot.current && tableRoot.current.root;
if (div) {
div.style.overflow = 'unset';
}
}, 0);
return () => {
clearTimeout(timerId);
}
}, []);
return ( return (
<div className={styles.zyd_onestop_style_class}> <div className={styles.zyd_onestop_style_class}>
<ZdyTable get={get} isCg={isCg} {...rest} /> <ZdyTable ref={tableRoot} get={get} isCg={isCg} {...rest} />
</div> </div>
); );
} }
......
.zyd_onestop_style_class{ .zyd_onestop_style_class{
padding: 20px; padding: 20px;
table, td, div{ table, td{
overflow: unset !important; overflow: unset !important;
} }
......
{}
\ No newline at end of file
...@@ -496,7 +496,7 @@ export default class tableCom extends Component { ...@@ -496,7 +496,7 @@ export default class tableCom extends Component {
dataColumn = { base52: this.props.uuid } dataColumn = { base52: this.props.uuid }
if (Object.keys(mapData).length > 0) { if (Object.keys(mapData).length > 0) {
const columnIds = json.columnIds; const columnIds = json.columnIds;
if (columnIds && columnIds['c1']) { if (columnIds && columnIds['c1']) {
const columnId = columnIds['c1'][columnIds['c1'].length - 1]; const columnId = columnIds['c1'][columnIds['c1'].length - 1];
if (mapData[columnId] != null) { if (mapData[columnId] != null) {
...@@ -1128,9 +1128,9 @@ export default class tableCom extends Component { ...@@ -1128,9 +1128,9 @@ export default class tableCom extends Component {
}) })
try { try {
var fun1 = new Function("obj","init", "defaultValues", "env", "index", "fatherCode", "utils","$","routerState", fun); var fun1 = new Function("obj","init", "defaultValues", "env", "index", "fatherCode", "utils","$","routerState", fun);
let obj let obj
if(!this.props.isEdit&&this.props.fatherCode){ if(!this.props.isEdit&&this.props.fatherCode){
obj = { ...this.props.fatherObj, ...this.props.form.getFieldsValue(), ...this.props.defaultValues[this.props.formKey] } obj = { ...this.props.fatherObj, ...this.props.form.getFieldsValue(), ...this.props.defaultValues[this.props.formKey] }
} else { } else {
...@@ -1231,13 +1231,13 @@ export default class tableCom extends Component { ...@@ -1231,13 +1231,13 @@ export default class tableCom extends Component {
dataColumn = { base52: this.props.uuid } dataColumn = { base52: this.props.uuid }
if (Object.keys(mapData).length > 0) { if (Object.keys(mapData).length > 0) {
const columnIds = json.columnIds; const columnIds = json.columnIds;
const bindObj = this.getColumn('c1'); const bindObj = this.getColumn('c1');
let dataColumn = this.props.fatherCode != null ? (bindObj ? { ...bindObj, base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}` } : let dataColumn = this.props.fatherCode != null ? (bindObj ? { ...bindObj, base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}` } :
{ base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` }) { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` })
: bindObj; : bindObj;
if (this.props.fatherCode == null && dataColumn == null) dataColumn = { base52: this.props.uuid } if (this.props.fatherCode == null && dataColumn == null) dataColumn = { base52: this.props.uuid }
/* if (this.props.fatherCode != null) { /* if (this.props.fatherCode != null) {
...@@ -1246,7 +1246,7 @@ export default class tableCom extends Component { ...@@ -1246,7 +1246,7 @@ export default class tableCom extends Component {
dataColumn = { base52: this.props.uuid } dataColumn = { base52: this.props.uuid }
if (Object.keys(mapData).length > 0) { if (Object.keys(mapData).length > 0) {
const columnIds = json.columnIds; const columnIds = json.columnIds;
if (columnIds && columnIds['c1']) { if (columnIds && columnIds['c1']) {
const columnId = columnIds['c1'][columnIds['c1'].length - 1]; const columnId = columnIds['c1'][columnIds['c1'].length - 1];
if (mapData[columnId] != null) { if (mapData[columnId] != null) {
...@@ -1665,7 +1665,7 @@ export default class tableCom extends Component { ...@@ -1665,7 +1665,7 @@ export default class tableCom extends Component {
if (json.isLabel) { if (json.isLabel) {
if (obj.defaultValues && obj.defaultValues[formKey]) { if (obj&&obj.defaultValues && obj.defaultValues[formKey]) {
if(!isEdit ){ if(!isEdit ){
return ( return (
<Row <Row
...@@ -1821,7 +1821,7 @@ export default class tableCom extends Component { ...@@ -1821,7 +1821,7 @@ export default class tableCom extends Component {
cm = <span cm = <span
style={{ style={{
wordBreak: 'break-all', wordBreak: 'break-all',
}} }}
>{obj[dataColumn.base52]}</span>; >{obj[dataColumn.base52]}</span>;
break; break;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论