提交 05d8d3c8 authored 作者: wtj's avatar wtj

表单排版问题

上级 c6a60c6f
...@@ -73,7 +73,7 @@ export default class ZdyTable extends Component { ...@@ -73,7 +73,7 @@ export default class ZdyTable extends Component {
* this.props.table有传入值表明需要渲染流程中最新表单 * this.props.table有传入值表明需要渲染流程中最新表单
*/ */
if(isForm){ // 由表格的操作按钮进入 if(isForm){ // 由表格的操作按钮进入
const mapData = {}; const mapData = {};
const sqlData={} const sqlData={}
const dataObjs = val.form.dataObjModels; const dataObjs = val.form.dataObjModels;
...@@ -277,7 +277,7 @@ export default class ZdyTable extends Component { ...@@ -277,7 +277,7 @@ export default class ZdyTable extends Component {
const sqls = val.unifiedServicePatternModel.sqlModels const sqls = val.unifiedServicePatternModel.sqlModels
for (var i = 0; i < sqls.length; i++) { for (var i = 0; i < sqls.length; i++) {
const dob = sqls[i].dataObjModel; const dob = sqls[i].dataObjModel;
for (var j = 0; j < dob.columnModels.length; j++) { for (var j = 0; j < dob.columnModels.length; j++) {
sqlData[dob.columnModels[j].base52] = dob.columnModels[j]; sqlData[dob.columnModels[j].base52] = dob.columnModels[j];
} }
...@@ -285,7 +285,7 @@ export default class ZdyTable extends Component { ...@@ -285,7 +285,7 @@ export default class ZdyTable extends Component {
const dataObjs = val.unifiedServicePatternModel.dataObjModels; const dataObjs = val.unifiedServicePatternModel.dataObjModels;
for (var i = 0; i < dataObjs.length; i++) { for (var i = 0; i < dataObjs.length; i++) {
const dob = dataObjs[i]; const dob = dataObjs[i];
for (var j = 0; j < dob.columnModels.length; j++) { for (var j = 0; j < dob.columnModels.length; j++) {
mapData[dob.columnModels[j].base52] = dob.columnModels[j]; mapData[dob.columnModels[j].base52] = dob.columnModels[j];
} }
...@@ -305,7 +305,7 @@ export default class ZdyTable extends Component { ...@@ -305,7 +305,7 @@ export default class ZdyTable extends Component {
isReady:true, isReady:true,
formConfig:xxx, formConfig:xxx,
defaultBinds:this.props.table?obj.datas[val.taskFormKey].defaultBinds:xxx.defaultBinds, defaultBinds:this.props.table?obj.datas[val.taskFormKey].defaultBinds:xxx.defaultBinds,
}); });
return return
} }
...@@ -314,7 +314,7 @@ export default class ZdyTable extends Component { ...@@ -314,7 +314,7 @@ export default class ZdyTable extends Component {
const sqls = val.unifiedServicePatternModel.sqlModels const sqls = val.unifiedServicePatternModel.sqlModels
for (var i = 0; i < sqls.length; i++) { for (var i = 0; i < sqls.length; i++) {
const dob = sqls[i].dataObjModel; const dob = sqls[i].dataObjModel;
for (var j = 0; j < dob.columnModels.length; j++) { for (var j = 0; j < dob.columnModels.length; j++) {
sqlData[dob.columnModels[j].base52] = dob.columnModels[j]; sqlData[dob.columnModels[j].base52] = dob.columnModels[j];
} }
...@@ -322,7 +322,7 @@ export default class ZdyTable extends Component { ...@@ -322,7 +322,7 @@ export default class ZdyTable extends Component {
const dataObjs = val.unifiedServicePatternModel.dataObjModels; const dataObjs = val.unifiedServicePatternModel.dataObjModels;
for (var i = 0; i < dataObjs.length; i++) { for (var i = 0; i < dataObjs.length; i++) {
const dob = dataObjs[i]; const dob = dataObjs[i];
for (var j = 0; j < dob.columnModels.length; j++) { for (var j = 0; j < dob.columnModels.length; j++) {
mapData[dob.columnModels[j].base52] = dob.columnModels[j]; mapData[dob.columnModels[j].base52] = dob.columnModels[j];
} }
...@@ -408,8 +408,7 @@ export default class ZdyTable extends Component { ...@@ -408,8 +408,7 @@ export default class ZdyTable extends Component {
case 'web': case 'web':
return ( return (
<Form <Form
{...formItemLayout}
className="login-form" > className="login-form" >
{isEdit&&defaultBinds ? Object.keys(defaultBinds).map((k) => { {isEdit&&defaultBinds ? Object.keys(defaultBinds).map((k) => {
const r = defaultBinds[k] const r = defaultBinds[k]
...@@ -433,17 +432,17 @@ export default class ZdyTable extends Component { ...@@ -433,17 +432,17 @@ export default class ZdyTable extends Component {
<Row> <Row>
<Col span={24}> <Col span={24}>
<div <div
style={styleDiv} style={styleDiv}
ref={ref => { this.root = ref }} ref={ref => { this.root = ref }}
> >
<table <table
style={{ style={{
overflow: "auto", overflow: "auto",
margin: max * width > 550 ? "auto" : '', margin: max * width > 550 ? "auto" : '',
...style }} ...style }}
border={border} border={border}
cellSpacing="0" cellSpacing="0"
cellPadding="0" > cellPadding="0" >
<tbody> <tbody>
{items.map((row, i) => { {items.map((row, i) => {
...@@ -459,16 +458,16 @@ export default class ZdyTable extends Component { ...@@ -459,16 +458,16 @@ export default class ZdyTable extends Component {
console.log(`第${i}行第${j}列样式配置有误,${e}`) console.log(`第${i}行第${j}列样式配置有误,${e}`)
} }
} }
return !allhidden && cell.hidden ? return !allhidden && cell.hidden ?
"" ""
: <td : <td
width={ width={
i==0? i==0?
((cell.content!=null&&cell.content.cwidth!=null?cell.content.cwidth:width) * (cell.col ? cell.col : 1)) ((cell.content!=null&&cell.content.cwidth!=null?cell.content.cwidth:width) * (cell.col ? cell.col : 1))
:width * (cell.col ? cell.col : 1)} :width * (cell.col ? cell.col : 1)}
rowSpan={cell.row} rowSpan={cell.row}
colSpan={cell.col} colSpan={cell.col}
key={j} key={j}
style={{ style={{
overflow: "auto", overflow: "auto",
textAlign: cell.content&&cell.content.calign?cell.content.calign:"left", textAlign: cell.content&&cell.content.calign?cell.content.calign:"left",
...@@ -476,25 +475,25 @@ export default class ZdyTable extends Component { ...@@ -476,25 +475,25 @@ export default class ZdyTable extends Component {
...styles ...styles
}} > }} >
<TableCom <TableCom
formCode={formCode} // 当前表单code formCode={formCode} // 当前表单code
formId={formId} // 当前表单Id formId={formId} // 当前表单Id
i={i} // 当前组件下标 i={i} // 当前组件下标
j={j} // 当前行数下班 j={j} // 当前行数下班
fatherCode={fatherCode} fatherCode={fatherCode}
index={index} index={index}
fatherObj={this.props.fatherObj} fatherObj={this.props.fatherObj}
datas={datas} datas={datas}
uuid={cell.uuid} uuid={cell.uuid}
isEdit={isEdit} isEdit={isEdit}
formKey={currentFormKey} formKey={currentFormKey}
init={init} init={init}
get={get} // 区分移动端或wen端 get={get} // 区分移动端或wen端
json={cell.content} json={cell.content}
obj={ obj||{}} // 是否存在默认值 obj={ obj||{}} // 是否存在默认值
mapData={mapData} mapData={mapData}
form={this.props.form} // antd form控件 form={this.props.form} // antd form控件
sqlData={sqlData} sqlData={sqlData}
defaultValues={defaultValues || {}} // 接口中的默认值 defaultValues={defaultValues || {}} // 接口中的默认值
/> />
</td>} </td>}
...@@ -541,38 +540,38 @@ export default class ZdyTable extends Component { ...@@ -541,38 +540,38 @@ export default class ZdyTable extends Component {
{ {
items.map((item, i) => { items.map((item, i) => {
const allhidden = this.checkAllHidden(items) const allhidden = this.checkAllHidden(items)
return (<div return (<div
key={i} key={i}
style={{ style={{
marginTop: 0, marginTop: 0,
background: '#ffffff', background: '#ffffff',
paddingLeft:12, paddingLeft:12,
width: '100%', width: '100%',
flexWrap:'wrap', flexWrap:'wrap',
...style }}> ...style }}>
{ {
item.map((ary, j) => { item.map((ary, j) => {
return !allhidden && ary.hidden ? "" return !allhidden && ary.hidden ? ""
: <><TableCom : <><TableCom
formCode={formCode} formCode={formCode}
formId={formId} formId={formId}
i={i} i={i}
j={j} j={j}
index={index} index={index}
fatherCode={fatherCode} fatherCode={fatherCode}
datas={datas} datas={datas}
isEdit={isEdit} isEdit={isEdit}
fatherObj={this.props.fatherObj} fatherObj={this.props.fatherObj}
formKey={currentFormKey} formKey={currentFormKey}
init={init} init={init}
get={get} get={get}
key={j} key={j}
sqlData={sqlData} sqlData={sqlData}
obj={ obj||{}} obj={ obj||{}}
form={this.props.form} form={this.props.form}
mapData={mapData} mapData={mapData}
json={ary.content} json={ary.content}
uuid={ary.uuid} uuid={ary.uuid}
defaultValues={defaultValues || {}} /></> defaultValues={defaultValues || {}} /></>
}) })
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论