Commit 0519ce88 authored by Bill's avatar Bill

fix: 修改进度条bug

parent e26813a4
......@@ -2,13 +2,10 @@
padding-top: 2px;
overflow: auto;
:global {
.ant-steps-item-title {
margin-right: 16px;
// &:last-child {
// margin-right: 0px;
// }
}
.title {
display: block;
max-width: 100px;
// margin-right: 8px;
text-align: center;
}
}
......@@ -109,7 +109,7 @@ const AuditProcess: React.FC<AuditProcessProp> = ({
}
return (
<Tooltip placement="top" title={stepTitle}>
<span style={{maxWidth: '100px', marginRight: '8px', textAlign: 'center'}}>{`${stepTitle}`}</span>
<span className={styles.title}>{`${stepTitle}`}</span>
</Tooltip>
)
}
......
......@@ -21,7 +21,7 @@ export interface MellowCardProps extends CardProps {
const MellowCard: React.FC<MellowCardProps> = props => {
const { children, fullHeight, ...rest } = props;
const cls = classNames(styles['mellow-card'], {
[styles.fullHeight]: fullHeight,
[styles.fullHeight]: fullHeight,
});
return (
......@@ -33,4 +33,4 @@ const MellowCard: React.FC<MellowCardProps> = props => {
)
};
export default MellowCard;
\ No newline at end of file
export default MellowCard;
import React from 'react'
import { connect, IConnectProps, MergedFieldComponentProps, registerFormField } from '@formily/antd'
import { Input } from 'antd'
const PreviewText = ({ value }: { value: string | number }) => {
return (
<span>{value}</span>
)
}
export const mapTextComponent = (
Target: React.JSXElementConstructor<any>,
props: any = {},
fieldProps: any = {}
): React.JSXElementConstructor<any> => {
const { editable } = fieldProps
// console.log("props", props, "fieldProps", fieldProps);
console.log(fieldProps.form.getFieldValue("detail.layout1.productList.0"))
if (editable !== undefined) {
if (editable === false) {
return PreviewText
}
}
return Target
}
export const mapStyledProps = (
props: IConnectProps,
fieldProps: MergedFieldComponentProps
) => {
const { loading, errors } = fieldProps
if (loading) {
props.state = props.state || 'loading'
} else if (errors && errors.length) {
props.state = 'error'
}
}
export default connect({
// getProps: mapStyledProps, //处理状态映射
getComponent: mapTextComponent //处理详情态
})((Input))
import React, { useMemo } from 'react';
import { history } from 'umi';
import ReutrnEle from '@/components/ReturnEle';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Button } from 'antd';
import { SaveOutlined } from '@ant-design/icons';
import NiceForm from '@/components/NiceForm';
import creataSchema from './schema';
import { createFormActions, FormEffectHooks, registerVirtualBox } from '@formily/antd';
import MellowCard from '@/components/MellowCard';
import AnchorPage from '@/layouts/AnchorPage';
import { ArrayTable } from '@formily/antd-components'
import ReadOnlyInput from './components/ReadOnlyInput';
const formActions = createFormActions();
registerVirtualBox('MellowCardBox', (_props) => {
const { children, props: outerProps } = _props;
const props = outerProps['x-component-props'] || {};
return (
<MellowCard
{...props}
>
{children}
</MellowCard>
)
})
const Create = () => {
const useFields = () =>
useMemo(() => {
return {
string: ReadOnlyInput
}
}, [])
const anchorColumn = useMemo(() => {
return [
{
name: '基本信息',
key: 'basicInfo'
},
{
name: '通知单明细',
key: 'detail'
},
{
name: '其他要求',
key: 'other'
},
{
name: '附件',
key: 'files'
}
]
}, [])
return (
<AnchorPage
title="新增生产通知单"
anchors={anchorColumn}
extra={
<Button
icon={<SaveOutlined />}
type="primary"
>
提交
</Button>
}
>
<NiceForm
fields={useFields() as any}
actions={formActions}
schema={creataSchema}
components={{ArrayTable}}
></NiceForm>
</AnchorPage>
)
}
export default Create;
This diff is collapsed.
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