提交 64fe8388 authored 作者: chscls@163.com's avatar chscls@163.com

子页面样式问题

上级 e8fe178c
......@@ -50,7 +50,7 @@ export default class ZdyTable extends Component {
formDeafault = '', // 为二维码快捷发起默认值
} = this.props;
if (isPreview || isChild) {
this.setState({ ...this.state, ...this.props, isReady: true });
this.setState({ ...this.state, ...this.props, isReady: true ,formConfig:{...this.state.formConfig,style:this.props.style }});
return;
}
......@@ -233,7 +233,7 @@ export default class ZdyTable extends Component {
isChild, // 是否为子表单
} = nextProps;
if (isPreview || isChild) {
this.setState({ ...this.state, ...this.props, isReady: true });
this.setState({ ...this.state, ...this.props, isReady: true,formConfig:{...this.state.formConfig,style:this.props.style }});
return;
}
......@@ -390,6 +390,7 @@ export default class ZdyTable extends Component {
render() {
let {
width,
isRowCol,
isBorder,
sqlData,
mapData,
......@@ -710,6 +711,7 @@ export default class ZdyTable extends Component {
})
: ''}
<IsNewTable
isRowCol={isRowCol}
modalInit={modalInit}
items={items}
checkAllHidden={this.checkAllHidden}
......
......@@ -8,6 +8,7 @@ import { Row, Col } from 'antd';
export default class isNewTable extends Component {
render() {
const {
isRowCol,
items,
checkAllHidden,
isBorder,
......@@ -105,93 +106,107 @@ export default class isNewTable extends Component {
</>
);
}
if(isRowCol){
return ( items.map((item, i) => {
console.log(item)
const allhidden = checkAllHidden(items)
return <Row style={{
...style,
}}>
{
item.map((ary, j) => {
let styles = {};
if (ary.content && ary.content.styles) {
try {
styles = JSON.parse(ary.content.styles);
} catch (e) {
console.log(`第${i}行第${j}列样式配置有误,${e}`);
}
}
if(ary.content?.comName==="Label"){
console.log(ary)
return <Col
style={{
...styles,
}}
span={ary.content?.labelSpan}
>
{!allhidden && ary.hidden ? ""
:<><TableCom
formCode={formCode}
formId={formId}
i={i}
j={j}
index={index}
fatherCode={fatherCode}
datas={datas}
isEdit={isEdit}
fatherObj={this.props.fatherObj}
formKey={currentFormKey}
init={init}
get={get}
key={j}
sqlData={sqlData}
obj={obj || {}}
form={this.props.form}
mapData={mapData}
json={ary.content}
uuid={ary.uuid}
routerState={routerState} // 兼容表单设计器路由传参
defaultValues={defaultValues || {}}
messageData={messageData} // 场景设计器共享变量参数
/></>
}</Col>
}
return <Col
span={24}
>
{!allhidden && ary.hidden ? ""
:<><TableCom
formCode={formCode}
formId={formId}
i={i}
j={j}
index={index}
fatherCode={fatherCode}
datas={datas}
isEdit={isEdit}
fatherObj={this.props.fatherObj}
formKey={currentFormKey}
init={init}
get={get}
key={j}
sqlData={sqlData}
obj={obj || {}}
form={this.props.form}
mapData={mapData}
json={ary.content}
uuid={ary.uuid}
routerState={routerState} // 兼容表单设计器路由传参
defaultValues={defaultValues || {}}
messageData={messageData} // 场景设计器共享变量参数
/></>
}</Col>
})
}
</Row>
}))
}
return (
<>
{/* { // Row Col 模式
items.map((item, i) => {
console.log(item)
const allhidden = checkAllHidden(items)
return <> <Row>
{
item.map((ary, j) => {
if(ary.content?.comName==="Label"){
console.log(ary)
return <Col
span={ary.content?.labelSpan}
>
{!allhidden && ary.hidden ? ""
:<><TableCom
formCode={formCode}
formId={formId}
i={i}
j={j}
index={index}
fatherCode={fatherCode}
datas={datas}
isEdit={isEdit}
fatherObj={this.props.fatherObj}
formKey={currentFormKey}
init={init}
get={get}
key={j}
sqlData={sqlData}
obj={obj || {}}
form={this.props.form}
mapData={mapData}
json={ary.content}
uuid={ary.uuid}
routerState={routerState} // 兼容表单设计器路由传参
defaultValues={defaultValues || {}}
messageData={messageData} // 场景设计器共享变量参数
/></>
}</Col>
}
return <Col
span={24}
>
{!allhidden && ary.hidden ? ""
:<><TableCom
formCode={formCode}
formId={formId}
i={i}
j={j}
index={index}
fatherCode={fatherCode}
datas={datas}
isEdit={isEdit}
fatherObj={this.props.fatherObj}
formKey={currentFormKey}
init={init}
get={get}
key={j}
sqlData={sqlData}
obj={obj || {}}
form={this.props.form}
mapData={mapData}
json={ary.content}
uuid={ary.uuid}
routerState={routerState} // 兼容表单设计器路由传参
defaultValues={defaultValues || {}}
messageData={messageData} // 场景设计器共享变量参数
/></>
}</Col>
})
}
</Row>
</>
})
} */}
{// 卡片模式
items.map((item, i) => {
const allhidden = checkAllHidden(items);
console.log(style)
return (
<>
{' '}
<Card full
style={{
...style
}}
......@@ -300,8 +315,7 @@ export default class isNewTable extends Component {
<WhiteSpace />
</>
);
})}
</>
})
);
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论