Commit f04b5e03 authored by Bill's avatar Bill

修改flex-layout问题

parent 54cfe19f
......@@ -85,10 +85,10 @@ export function render(oldRender:Function) {
export function onRouteChange({ routes, matchedRoutes, location, action }) {
console.log('onRouteChange')
if (isDev) {
console.log('dev')
return;
}
// if (isDev) {
// console.log('dev')
// return;
// }
if (whiteLists.includes(location.pathname)) {
return
......
......@@ -2,7 +2,7 @@ import React from 'react';
import { Row, Col } from 'antd';
import { SchemaField } from "@formily/antd";
const renderCol = (schema, isLast) => {
const renderCol = (schema) => {
const { flexcol = {}, } = schema && schema['x-component-props'] || {};
const flexProps = schema['x-flex-props'] || {}
return <Col {...flexcol} {...flexProps} key={schema.path}>
......@@ -10,12 +10,12 @@ const renderCol = (schema, isLast) => {
</Col>
}
const FlexRowLayout = (props) => {
const childProperties = props.schema.getOrderProperties()
const childProperties = props.schema && props.schema.getOrderProperties()
const { justify = "start", align = "top" } = props.props['x-component-props'] || {}
return (
<Row justify={justify} align={align}>
{
childProperties.map((v, i, arr) => renderCol(v.schema, arr.length - 1 === i))
childProperties.map((v, i, arr) => renderCol(v.schema))
}
</Row>
)
......@@ -23,13 +23,13 @@ const FlexRowLayout = (props) => {
FlexRowLayout.isVirtualFieldComponent = true
const FlexColumnLayoutStyle = {
'display': 'flex',
'flexDirection': 'column'
}
const FlexColumnLayout = (props) => {
const childProperties = props.schema.getOrderProperties()
const childProperties = props.schema && props.schema.getOrderProperties();
console.log("childProperties", childProperties)
const { style } = props.props['x-component-props'] || {};
return (
......
......@@ -44,9 +44,7 @@ const InfomationInfo = () => {
const columns = res.data.map((item) => ({label: item.name, value: item.id}));
setFormStatus("layout.columnId", "options", columns)
}
// if(!preview) {
getColumn()
// }
}, [])
useEffect(() => {
......@@ -55,10 +53,8 @@ const InfomationInfo = () => {
const labels = res.data.map((item) => ({label: item.name, value: item.id}));
setFormStatus("layout.labelIds", "dataSource", labels)
}
// if(!preview) {
getLabels()
// }
})
}, [])
useEffect(() => {
const data = initialValues.data || {}
......
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